@agent-native/core 0.53.0 → 0.54.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 (106) hide show
  1. package/dist/action.d.ts +40 -1
  2. package/dist/action.d.ts.map +1 -1
  3. package/dist/action.js +69 -2
  4. package/dist/action.js.map +1 -1
  5. package/dist/agent/index.d.ts +1 -0
  6. package/dist/agent/index.d.ts.map +1 -1
  7. package/dist/agent/index.js +1 -0
  8. package/dist/agent/index.js.map +1 -1
  9. package/dist/agent/observational-memory/index.d.ts +6 -6
  10. package/dist/agent/observational-memory/index.js +6 -6
  11. package/dist/agent/observational-memory/index.js.map +1 -1
  12. package/dist/agent/observational-memory/read.d.ts +7 -9
  13. package/dist/agent/observational-memory/read.d.ts.map +1 -1
  14. package/dist/agent/observational-memory/read.js +7 -9
  15. package/dist/agent/observational-memory/read.js.map +1 -1
  16. package/dist/agent/processors.d.ts +146 -0
  17. package/dist/agent/processors.d.ts.map +1 -0
  18. package/dist/agent/processors.js +122 -0
  19. package/dist/agent/processors.js.map +1 -0
  20. package/dist/agent/production-agent.d.ts +10 -0
  21. package/dist/agent/production-agent.d.ts.map +1 -1
  22. package/dist/agent/production-agent.js +101 -0
  23. package/dist/agent/production-agent.js.map +1 -1
  24. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  25. package/dist/agent/run-loop-with-resume.js +4 -5
  26. package/dist/agent/run-loop-with-resume.js.map +1 -1
  27. package/dist/agent/tool-call-journal.d.ts +6 -8
  28. package/dist/agent/tool-call-journal.d.ts.map +1 -1
  29. package/dist/agent/tool-call-journal.js +6 -8
  30. package/dist/agent/tool-call-journal.js.map +1 -1
  31. package/dist/agent/types.d.ts +11 -0
  32. package/dist/agent/types.d.ts.map +1 -1
  33. package/dist/agent/types.js.map +1 -1
  34. package/dist/cli/gateway-helpers.d.ts +15 -0
  35. package/dist/cli/gateway-helpers.d.ts.map +1 -0
  36. package/dist/cli/gateway-helpers.js +51 -0
  37. package/dist/cli/gateway-helpers.js.map +1 -0
  38. package/dist/cli/plan-local.d.ts.map +1 -1
  39. package/dist/cli/plan-local.js +129 -4
  40. package/dist/cli/plan-local.js.map +1 -1
  41. package/dist/cli/skills.d.ts.map +1 -1
  42. package/dist/cli/skills.js +38 -3
  43. package/dist/cli/skills.js.map +1 -1
  44. package/dist/cli/workspace-dev.d.ts.map +1 -1
  45. package/dist/cli/workspace-dev.js +9 -27
  46. package/dist/cli/workspace-dev.js.map +1 -1
  47. package/dist/coding-tools/run-code.d.ts.map +1 -1
  48. package/dist/coding-tools/run-code.js +18 -2
  49. package/dist/coding-tools/run-code.js.map +1 -1
  50. package/dist/extensions/fetch-tool.d.ts.map +1 -1
  51. package/dist/extensions/fetch-tool.js +80 -15
  52. package/dist/extensions/fetch-tool.js.map +1 -1
  53. package/dist/extensions/web-content.d.ts +61 -0
  54. package/dist/extensions/web-content.d.ts.map +1 -0
  55. package/dist/extensions/web-content.js +468 -0
  56. package/dist/extensions/web-content.js.map +1 -0
  57. package/dist/extensions/web-search-tool.js +3 -3
  58. package/dist/extensions/web-search-tool.js.map +1 -1
  59. package/dist/mcp/build-server.d.ts.map +1 -1
  60. package/dist/mcp/build-server.js +4 -1
  61. package/dist/mcp/build-server.js.map +1 -1
  62. package/dist/provider-api/corpus-jobs.d.ts +80 -0
  63. package/dist/provider-api/corpus-jobs.d.ts.map +1 -1
  64. package/dist/provider-api/corpus-jobs.js +219 -22
  65. package/dist/provider-api/corpus-jobs.js.map +1 -1
  66. package/dist/provider-api/index.d.ts +24 -32
  67. package/dist/provider-api/index.d.ts.map +1 -1
  68. package/dist/provider-api/index.js +28 -1
  69. package/dist/provider-api/index.js.map +1 -1
  70. package/dist/server/agent-chat-plugin.js +1 -1
  71. package/dist/server/agent-chat-plugin.js.map +1 -1
  72. package/dist/server/better-auth-instance.d.ts +7 -0
  73. package/dist/server/better-auth-instance.d.ts.map +1 -1
  74. package/dist/server/better-auth-instance.js +90 -0
  75. package/dist/server/better-auth-instance.js.map +1 -1
  76. package/dist/server/deep-link.d.ts +7 -0
  77. package/dist/server/deep-link.d.ts.map +1 -1
  78. package/dist/server/deep-link.js +13 -2
  79. package/dist/server/deep-link.js.map +1 -1
  80. package/dist/server/index.d.ts +1 -1
  81. package/dist/server/index.d.ts.map +1 -1
  82. package/dist/server/index.js +1 -1
  83. package/dist/server/index.js.map +1 -1
  84. package/dist/templates/default/.agents/skills/actions/SKILL.md +52 -1
  85. package/dist/templates/default/.agents/skills/security/SKILL.md +22 -0
  86. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +52 -1
  87. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +6 -4
  88. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +11 -0
  89. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +22 -0
  90. package/docs/content/actions.md +50 -0
  91. package/docs/content/durable-resume.md +49 -0
  92. package/docs/content/external-agents.md +2 -2
  93. package/docs/content/human-approval.md +101 -0
  94. package/docs/content/observability.md +21 -0
  95. package/docs/content/observational-memory.md +63 -0
  96. package/docs/content/plan-plugin.md +5 -0
  97. package/docs/content/pr-visual-recap.md +4 -3
  98. package/docs/content/processors.md +99 -0
  99. package/docs/content/template-plan.md +78 -14
  100. package/package.json +6 -1
  101. package/src/templates/default/.agents/skills/actions/SKILL.md +52 -1
  102. package/src/templates/default/.agents/skills/security/SKILL.md +22 -0
  103. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +52 -1
  104. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +6 -4
  105. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +11 -0
  106. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +22 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,oBA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AAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,EACnC,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,IAAI,2BAA2B,GACjD,MAAM,wBAAwB,CAAC;AAUhC,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACrE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAErE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,EACb,KAAK,mBAAmB,EACxB,KAAK,YAAY,GAClB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EACh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AAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,eAAe,EACf,KAAK,qBAAqB,GAC3B,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,EACT,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,EACrB,KAAK,qBAAqB,EAC1B,KAAK,YAAY,IAAI,2BAA2B,GACjD,MAAM,wBAAwB,CAAC;AAUhC,MAAM,MAAM,cAAc,GAAG,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACrE,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,cAAc,GAAG,cAAc,CAErE"}
@@ -1,6 +1,6 @@
1
1
  export { createServer, upsertEnvFile, } from "./create-server.js";
2
2
  export { readBody, readBodyWithSizeLimit, streamFile, DEFAULT_CHAT_MAX_BODY_BYTES, DEFAULT_UPLOAD_MAX_FILE_BYTES, MAX_CHAT_ATTACHMENTS_PER_MESSAGE, isAllowedUploadMimeType, } from "./h3-helpers.js";
3
- export { buildDeepLink, toAbsoluteOpenUrl, toDesktopOpenUrl, OPEN_ROUTE_SUBPATH, DESKTOP_OPEN_URL, } from "./deep-link.js";
3
+ export { buildDeepLink, toAbsoluteOpenUrl, toDesktopOpenUrl, toVsCodeOpenUrl, OPEN_ROUTE_SUBPATH, DESKTOP_OPEN_URL, VSCODE_OPEN_URL, } from "./deep-link.js";
4
4
  export { createOpenRouteHandler } from "./open-route.js";
5
5
  export { createEmbedStartRouteHandler, buildEmbedStartPath, } from "./embed-route.js";
6
6
  export { createEmbedSessionTicket, consumeEmbedSessionTicket, normalizeEmbedTargetPath, requestHasEmbedAuthMarker, resolveEmbedSessionFromRequest, setEmbedSessionCookie, signEmbedSessionToken, verifyEmbedSessionToken, } from "./embed-session.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GAEjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAyB,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GAQxB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAA0B,MAAM,UAAU,CAAC;AACpE,OAAO,EACL,mBAAmB,EACnB,aAAa,EACb,UAAU,EACV,WAAW,EACX,UAAU,EACV,aAAa,EACb,eAAe,EACf,+BAA+B,EAC/B,yBAAyB,EACzB,4BAA4B,EAC5B,YAAY,EACZ,kBAAkB,EAClB,uBAAuB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C;AAE3B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,EACnC,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,GAIV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAWhC,MAAM,UAAU,iBAAiB,CAAC,GAAmB;IACnD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export {\n createServer,\n upsertEnvFile,\n type CreateServerOptions,\n type EnvKeyConfig,\n} from \"./create-server.js\";\n\nexport {\n readBody,\n readBodyWithSizeLimit,\n streamFile,\n DEFAULT_CHAT_MAX_BODY_BYTES,\n DEFAULT_UPLOAD_MAX_FILE_BYTES,\n MAX_CHAT_ATTACHMENTS_PER_MESSAGE,\n isAllowedUploadMimeType,\n} from \"./h3-helpers.js\";\nexport {\n buildDeepLink,\n toAbsoluteOpenUrl,\n toDesktopOpenUrl,\n OPEN_ROUTE_SUBPATH,\n DESKTOP_OPEN_URL,\n type DeepLinkInput,\n} from \"./deep-link.js\";\nexport { createOpenRouteHandler, type OpenRouteOptions } from \"./open-route.js\";\nexport {\n createEmbedStartRouteHandler,\n buildEmbedStartPath,\n type EmbedStartRouteOptions,\n} from \"./embed-route.js\";\nexport {\n createEmbedSessionTicket,\n consumeEmbedSessionTicket,\n normalizeEmbedTargetPath,\n requestHasEmbedAuthMarker,\n resolveEmbedSessionFromRequest,\n setEmbedSessionCookie,\n signEmbedSessionToken,\n verifyEmbedSessionToken,\n type ConsumedEmbedSessionTicket,\n type ConsumeEmbedSessionTicketOptions,\n type EmbedSessionTicket,\n type EmbedSessionTicketInput,\n type EmbedSessionTokenClaims,\n type ResolvedEmbedSession,\n type VerifyEmbedSessionTokenResult,\n} from \"./embed-session.js\";\nexport { createSSEHandler, type SSEHandlerOptions } from \"./sse.js\";\nexport {\n mountAuthMiddleware,\n autoMountAuth,\n getSession,\n COOKIE_NAME,\n addSession,\n removeSession,\n getSessionEmail,\n getFrameworkSessionCookieValues,\n setFrameworkSessionCookie,\n clearFrameworkSessionCookies,\n runAuthGuard,\n setDesktopExchange,\n setDesktopExchangeError,\n safeReturnPath,\n type DesktopExchangeErrorPayload,\n type AuthSession,\n type AuthOptions,\n} from \"./auth.js\";\nexport {\n handleIdentitySso,\n getIdentityHubUrl,\n isIdentitySsoEnabled,\n isIdentitySsoBypassPath,\n identitySsoLoginButtonHtml,\n IDENTITY_SSO_PROVIDER_ID,\n IDENTITY_SSO_SCOPE,\n} from \"./identity-sso.js\";\nexport { requireEnvKey, type MissingKeyResponse } from \"./missing-key.js\";\nexport { verifyCaptcha, type CaptchaVerifyResult } from \"./captcha.js\";\nexport {\n createProductionAgentHandler,\n type ActionEntry,\n type ScriptEntry,\n type ProductionAgentOptions,\n type ActionTool,\n type ScriptTool,\n type AgentMessage,\n type AgentChatRequest,\n type AgentChatEvent,\n type AgentChatAttachment,\n type AgentChatReference,\n type MentionProvider,\n type MentionProviderItem,\n type AgentLoopFinalResponseGuard,\n type AgentLoopFinalResponseGuardContext,\n type AgentLoopFinalResponseGuardResult,\n type AgentLoopToolCallSummary,\n type AgentLoopToolResultSummary,\n} from \"../agent/index.js\";\nexport {\n actionsToEngineTools,\n getOwnerActiveApiKey,\n runAgentLoop,\n} from \"../agent/production-agent.js\";\nexport {\n getStoredModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nexport {\n completeText,\n type CompleteTextMessage,\n type CompleteTextOptions,\n type CompleteTextResult,\n type CompleteTextUsage,\n} from \"./complete-text.js\";\nexport { createDevScriptRegistry } from \"../scripts/dev/index.js\";\n\nexport {\n createPollHandler,\n recordChange,\n getVersion,\n getChangesSince,\n getPollEmitter,\n canSeeChangeForUser,\n POLL_CHANGE_EVENT,\n} from \"./poll.js\";\nexport { createPollEventsHandler } from \"./poll-events.js\";\nexport { createAuthPlugin, defaultAuthPlugin } from \"./auth-plugin.js\";\nexport {\n initServerSentry,\n isServerSentryEnabled,\n setSentryUserForRequest,\n captureRouteError,\n type RouteErrorContext,\n} from \"./sentry.js\";\nexport {\n captureError,\n captureServerError,\n registerErrorCaptureProvider,\n type CaptureErrorContext,\n type CaptureErrorProvider,\n} from \"./capture-error.js\";\nexport { createSentryPlugin, defaultSentryPlugin } from \"./sentry-plugin.js\";\n// Re-export the org plugin so the auto-discovery's DEFAULT_PLUGIN_REGISTRY\n// (which references \"defaultOrgPlugin\" from @agent-native/core/server) can\n// resolve it during the deploy build worker-entry generation.\nexport { createOrgPlugin, defaultOrgPlugin } from \"../org/plugin.js\";\nexport {\n createContextXrayPlugin,\n defaultContextXrayPlugin,\n} from \"../agent/context-xray/plugin.js\";\nexport {\n createObservationalMemoryPlugin,\n defaultObservationalMemoryPlugin,\n} from \"../agent/observational-memory/plugin.js\";\nexport {\n createGoogleAuthPlugin,\n type GoogleAuthPluginOptions,\n} from \"./google-auth-plugin.js\";\nexport type { GoogleAuthMode } from \"./google-auth-mode.js\";\nexport {\n createAgentChatPlugin,\n defaultAgentChatPlugin,\n type AgentChatPluginOptions,\n} from \"./agent-chat-plugin.js\";\nexport {\n configureAgentNativeEmbeddedEnvironment,\n createAgentNativeEmbeddedAuthOptions,\n createAgentNativeEmbeddedPlugin,\n mountAgentNativeEmbedded,\n normalizeAgentNativeEmbeddedSession,\n type AgentNativeEmbeddedAuthOptions,\n type AgentNativeEmbeddedGetSession,\n type AgentNativeEmbeddedHostSession,\n type AgentNativeEmbeddedPluginOptions,\n} from \"./embedded.js\";\nexport {\n createThread,\n getThread,\n listThreads,\n updateThreadData,\n deleteThread,\n setThreadArchived,\n setThreadPinned,\n setThreadScope,\n type ChatThread,\n type ChatThreadScope,\n type ChatThreadSummary,\n type ListThreadsOptions,\n} from \"../chat-threads/store.js\";\nexport {\n createResourcesPlugin,\n defaultResourcesPlugin,\n} from \"./resources-plugin.js\";\nexport {\n createCoreRoutesPlugin,\n defaultCoreRoutesPlugin,\n FRAMEWORK_ROUTE_PREFIX,\n type CoreRoutesPluginOptions,\n} from \"./core-routes-plugin.js\";\nexport {\n AGENT_NATIVE_OG_IMAGE_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_HEIGHT,\n AGENT_NATIVE_OG_IMAGE_NETLIFY_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_WIDTH,\n agentNativeOgImageResponseHeaders,\n createAgentNativeOgImageHandler,\n renderAgentNativeOgImagePng,\n renderAgentNativeOgImageSvg,\n type AgentNativeOgImageInput,\n} from \"./social-og-image.js\";\nexport {\n createBrowserSessionActionEntries,\n type CreateBrowserSessionActionEntriesOptions,\n} from \"../browser-sessions/actions.js\";\nexport {\n DEFAULT_BROWSER_SESSION_REQUEST_POLL_MS,\n DEFAULT_BROWSER_SESSION_REQUEST_TIMEOUT_MS,\n DEFAULT_BROWSER_SESSION_TTL_MS,\n callBrowserSession,\n claimBrowserSessionRequest,\n completeBrowserSessionRequest,\n createBrowserSessionRequest,\n disconnectBrowserSession,\n getBrowserSession,\n getBrowserSessionRequest,\n listBrowserSessions,\n registerBrowserSession,\n waitForBrowserSessionRequest,\n} from \"../browser-sessions/store.js\";\nexport {\n mountBrowserSessionRoutes,\n type MountBrowserSessionRoutesOptions,\n} from \"../browser-sessions/routes.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n createTerminalPlugin,\n defaultTerminalPlugin,\n type TerminalPluginOptions,\n} from \"../terminal/terminal-plugin.js\";\nexport {\n createCollabPlugin,\n type CollabPluginOptions,\n} from \"./collab-plugin.js\";\n\nexport {\n spawnTask,\n getTask,\n getTaskByThread,\n listTasks,\n sendToTask,\n markTaskErrored,\n type AgentTask,\n type SpawnTaskOptions,\n} from \"./agent-teams.js\";\nexport { isOAuthConnected, getOAuthAccounts } from \"./oauth-helpers.js\";\nexport { wrapWithAnalytics } from \"./analytics.js\";\nexport {\n getH3App,\n awaitBootstrap,\n markDefaultPluginProvided,\n type H3AppShim,\n} from \"./framework-request-handler.js\";\nexport {\n autoDiscoverActions,\n autoDiscoverScripts,\n loadActionsFromStaticRegistry,\n mergeCoreSharingActions,\n registerPackageActions,\n} from \"./action-discovery.js\";\nexport {\n mountActionRoutes,\n type MountActionRoutesOptions,\n} from \"./action-routes.js\";\nexport {\n runWithRequestContext,\n hasRequestContext,\n getRequestContext,\n getRequestUserEmail,\n getRequestUserName,\n getRequestOrgId,\n getRequestTimezone,\n getRequestRunContext,\n getCredentialContext,\n isIntegrationCallerRequest,\n type RequestContext,\n type RequestRunContext,\n} from \"./request-context.js\";\nexport { formatDateInTimezone, todayInTimezone } from \"./date-utils.js\";\n\nexport {\n createOnboardingPlugin,\n defaultOnboardingPlugin,\n} from \"../onboarding/plugin.js\";\n\nexport {\n registerFileUploadProvider,\n unregisterFileUploadProvider,\n listFileUploadProviders,\n getActiveFileUploadProvider,\n uploadFile,\n builderFileUploadProvider,\n type FileUploadInput,\n type FileUploadProvider,\n type FileUploadResult,\n} from \"../file-upload/index.js\";\n\nexport {\n createIntegrationsPlugin,\n defaultIntegrationsPlugin,\n enqueueRemoteCommand,\n slackAdapter,\n telegramAdapter,\n whatsappAdapter,\n emailAdapter,\n type PlatformAdapter,\n type IncomingMessage,\n type OutgoingMessage,\n type IntegrationStatus,\n type IntegrationsPluginOptions,\n} from \"../integrations/index.js\";\n\nexport {\n isElectron,\n isMobile,\n getOrigin,\n getAppBasePath,\n getAppUrl,\n resolveOAuthRedirectUri,\n isAllowedOAuthRedirectUri,\n encodeOAuthState,\n decodeOAuthState,\n resolveOAuthOwner,\n createOAuthSession,\n oauthCallbackResponse,\n oauthErrorPage,\n oauthDesktopExchangePage,\n type OAuthStatePayload,\n type OAuthOwnerResult,\n type OAuthSessionResult,\n} from \"./google-oauth.js\";\n\nexport {\n FeatureNotConfiguredError,\n hasBuilderPrivateKey,\n isBuilderEnvManaged,\n getBuilderProxyOrigin,\n getBuilderImageGenerationBaseUrl,\n getBuilderWebSearchBaseUrl,\n getBuilderAuthHeader,\n resolveBuilderPrivateKey,\n resolveBuilderAuthHeader,\n resolveHasBuilderPrivateKey,\n resolveHasCompleteBuilderConnection,\n resolveBuilderCredentials,\n resolveBuilderCredential,\n writeBuilderCredentials,\n deleteBuilderCredentials,\n resolveSecret,\n} from \"./credential-provider.js\";\nexport {\n getBuilderBranchProjectId,\n isBuilderBranchingEnabled,\n resolveBuilderBranchProjectId,\n resolveIsBuilderBranchingEnabled,\n runBuilderAgent,\n type RunBuilderAgentResult,\n} from \"./builder-browser.js\";\n\nexport {\n sendEmail,\n isEmailConfigured,\n getEmailProvider,\n type EmailProvider,\n type SendEmailArgs,\n} from \"./email.js\";\nexport {\n renderEmail,\n emailStrong,\n emailLink,\n type RenderEmailArgs,\n type RenderedEmail,\n type EmailCta,\n} from \"./email-template.js\";\nexport { getAppProductionUrl, getFirstPartyProdUrl } from \"./app-url.js\";\nexport {\n getConfiguredAppBasePath,\n normalizeAppBasePath,\n withConfiguredAppBasePath,\n} from \"./app-base-path.js\";\nexport {\n signShortLivedToken,\n verifyShortLivedToken,\n type ShortLivedTokenClaims,\n type VerifyResult as ShortLivedTokenVerifyResult,\n} from \"./short-lived-token.js\";\n\n// SSR handler is NOT re-exported here — it uses a virtual module\n// (virtual:react-router/server-build) that only exists at Vite dev/build time.\n// Including it in this barrel would break the esbuild CF Pages bundler.\n// Templates import directly: import { ssrHandler } from \"@agent-native/core/server/ssr-handler\"\n\n// Nitro plugin helper — re-exported so templates don't need nitro as a direct dependency.\n// defineNitroPlugin is an identity function; this typed wrapper lets templates use it\n// without resolving `nitro/runtime` (which requires Nitro's virtual modules at runtime).\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\nexport function defineNitroPlugin(def: NitroPluginDef): NitroPluginDef {\n return def;\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EACZ,aAAa,GAGd,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,QAAQ,EACR,qBAAqB,EACrB,UAAU,EACV,2BAA2B,EAC3B,6BAA6B,EAC7B,gCAAgC,EAChC,uBAAuB,GACxB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,GAEhB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,sBAAsB,EAAyB,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GAEpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,8BAA8B,EAC9B,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,GAQxB,MAAM,oBAAoB,CAAC;AAC5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CAAC;AAElC,OAAO,EACL,UAAU,EACV,QAAQ,EACR,SAAS,EACT,cAAc,EACd,SAAS,EACT,uBAAuB,EACvB,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,cAAc,EACd,wBAAwB,GAIzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,mBAAmB,EACnB,qBAAqB,EACrB,gCAAgC,EAChC,0BAA0B,EAC1B,oBAAoB,EACpB,wBAAwB,EACxB,wBAAwB,EACxB,2BAA2B,EAC3B,mCAAmC,EACnC,yBAAyB,EACzB,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,EACxB,aAAa,GACd,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,6BAA6B,EAC7B,gCAAgC,EAChC,eAAe,GAEhB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,gBAAgB,GAGjB,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,WAAW,EACX,WAAW,EACX,SAAS,GAIV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,mBAAmB,EACnB,qBAAqB,GAGtB,MAAM,wBAAwB,CAAC;AAWhC,MAAM,UAAU,iBAAiB,CAAC,GAAmB;IACnD,OAAO,GAAG,CAAC;AACb,CAAC","sourcesContent":["export {\n createServer,\n upsertEnvFile,\n type CreateServerOptions,\n type EnvKeyConfig,\n} from \"./create-server.js\";\n\nexport {\n readBody,\n readBodyWithSizeLimit,\n streamFile,\n DEFAULT_CHAT_MAX_BODY_BYTES,\n DEFAULT_UPLOAD_MAX_FILE_BYTES,\n MAX_CHAT_ATTACHMENTS_PER_MESSAGE,\n isAllowedUploadMimeType,\n} from \"./h3-helpers.js\";\nexport {\n buildDeepLink,\n toAbsoluteOpenUrl,\n toDesktopOpenUrl,\n toVsCodeOpenUrl,\n OPEN_ROUTE_SUBPATH,\n DESKTOP_OPEN_URL,\n VSCODE_OPEN_URL,\n type DeepLinkInput,\n} from \"./deep-link.js\";\nexport { createOpenRouteHandler, type OpenRouteOptions } from \"./open-route.js\";\nexport {\n createEmbedStartRouteHandler,\n buildEmbedStartPath,\n type EmbedStartRouteOptions,\n} from \"./embed-route.js\";\nexport {\n createEmbedSessionTicket,\n consumeEmbedSessionTicket,\n normalizeEmbedTargetPath,\n requestHasEmbedAuthMarker,\n resolveEmbedSessionFromRequest,\n setEmbedSessionCookie,\n signEmbedSessionToken,\n verifyEmbedSessionToken,\n type ConsumedEmbedSessionTicket,\n type ConsumeEmbedSessionTicketOptions,\n type EmbedSessionTicket,\n type EmbedSessionTicketInput,\n type EmbedSessionTokenClaims,\n type ResolvedEmbedSession,\n type VerifyEmbedSessionTokenResult,\n} from \"./embed-session.js\";\nexport { createSSEHandler, type SSEHandlerOptions } from \"./sse.js\";\nexport {\n mountAuthMiddleware,\n autoMountAuth,\n getSession,\n COOKIE_NAME,\n addSession,\n removeSession,\n getSessionEmail,\n getFrameworkSessionCookieValues,\n setFrameworkSessionCookie,\n clearFrameworkSessionCookies,\n runAuthGuard,\n setDesktopExchange,\n setDesktopExchangeError,\n safeReturnPath,\n type DesktopExchangeErrorPayload,\n type AuthSession,\n type AuthOptions,\n} from \"./auth.js\";\nexport {\n handleIdentitySso,\n getIdentityHubUrl,\n isIdentitySsoEnabled,\n isIdentitySsoBypassPath,\n identitySsoLoginButtonHtml,\n IDENTITY_SSO_PROVIDER_ID,\n IDENTITY_SSO_SCOPE,\n} from \"./identity-sso.js\";\nexport { requireEnvKey, type MissingKeyResponse } from \"./missing-key.js\";\nexport { verifyCaptcha, type CaptchaVerifyResult } from \"./captcha.js\";\nexport {\n createProductionAgentHandler,\n type ActionEntry,\n type ScriptEntry,\n type ProductionAgentOptions,\n type ActionTool,\n type ScriptTool,\n type AgentMessage,\n type AgentChatRequest,\n type AgentChatEvent,\n type AgentChatAttachment,\n type AgentChatReference,\n type MentionProvider,\n type MentionProviderItem,\n type AgentLoopFinalResponseGuard,\n type AgentLoopFinalResponseGuardContext,\n type AgentLoopFinalResponseGuardResult,\n type AgentLoopToolCallSummary,\n type AgentLoopToolResultSummary,\n} from \"../agent/index.js\";\nexport {\n actionsToEngineTools,\n getOwnerActiveApiKey,\n runAgentLoop,\n} from \"../agent/production-agent.js\";\nexport {\n getStoredModelForEngine,\n resolveEngine,\n} from \"../agent/engine/index.js\";\nexport {\n completeText,\n type CompleteTextMessage,\n type CompleteTextOptions,\n type CompleteTextResult,\n type CompleteTextUsage,\n} from \"./complete-text.js\";\nexport { createDevScriptRegistry } from \"../scripts/dev/index.js\";\n\nexport {\n createPollHandler,\n recordChange,\n getVersion,\n getChangesSince,\n getPollEmitter,\n canSeeChangeForUser,\n POLL_CHANGE_EVENT,\n} from \"./poll.js\";\nexport { createPollEventsHandler } from \"./poll-events.js\";\nexport { createAuthPlugin, defaultAuthPlugin } from \"./auth-plugin.js\";\nexport {\n initServerSentry,\n isServerSentryEnabled,\n setSentryUserForRequest,\n captureRouteError,\n type RouteErrorContext,\n} from \"./sentry.js\";\nexport {\n captureError,\n captureServerError,\n registerErrorCaptureProvider,\n type CaptureErrorContext,\n type CaptureErrorProvider,\n} from \"./capture-error.js\";\nexport { createSentryPlugin, defaultSentryPlugin } from \"./sentry-plugin.js\";\n// Re-export the org plugin so the auto-discovery's DEFAULT_PLUGIN_REGISTRY\n// (which references \"defaultOrgPlugin\" from @agent-native/core/server) can\n// resolve it during the deploy build worker-entry generation.\nexport { createOrgPlugin, defaultOrgPlugin } from \"../org/plugin.js\";\nexport {\n createContextXrayPlugin,\n defaultContextXrayPlugin,\n} from \"../agent/context-xray/plugin.js\";\nexport {\n createObservationalMemoryPlugin,\n defaultObservationalMemoryPlugin,\n} from \"../agent/observational-memory/plugin.js\";\nexport {\n createGoogleAuthPlugin,\n type GoogleAuthPluginOptions,\n} from \"./google-auth-plugin.js\";\nexport type { GoogleAuthMode } from \"./google-auth-mode.js\";\nexport {\n createAgentChatPlugin,\n defaultAgentChatPlugin,\n type AgentChatPluginOptions,\n} from \"./agent-chat-plugin.js\";\nexport {\n configureAgentNativeEmbeddedEnvironment,\n createAgentNativeEmbeddedAuthOptions,\n createAgentNativeEmbeddedPlugin,\n mountAgentNativeEmbedded,\n normalizeAgentNativeEmbeddedSession,\n type AgentNativeEmbeddedAuthOptions,\n type AgentNativeEmbeddedGetSession,\n type AgentNativeEmbeddedHostSession,\n type AgentNativeEmbeddedPluginOptions,\n} from \"./embedded.js\";\nexport {\n createThread,\n getThread,\n listThreads,\n updateThreadData,\n deleteThread,\n setThreadArchived,\n setThreadPinned,\n setThreadScope,\n type ChatThread,\n type ChatThreadScope,\n type ChatThreadSummary,\n type ListThreadsOptions,\n} from \"../chat-threads/store.js\";\nexport {\n createResourcesPlugin,\n defaultResourcesPlugin,\n} from \"./resources-plugin.js\";\nexport {\n createCoreRoutesPlugin,\n defaultCoreRoutesPlugin,\n FRAMEWORK_ROUTE_PREFIX,\n type CoreRoutesPluginOptions,\n} from \"./core-routes-plugin.js\";\nexport {\n AGENT_NATIVE_OG_IMAGE_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_HEIGHT,\n AGENT_NATIVE_OG_IMAGE_NETLIFY_CACHE_CONTROL,\n AGENT_NATIVE_OG_IMAGE_WIDTH,\n agentNativeOgImageResponseHeaders,\n createAgentNativeOgImageHandler,\n renderAgentNativeOgImagePng,\n renderAgentNativeOgImageSvg,\n type AgentNativeOgImageInput,\n} from \"./social-og-image.js\";\nexport {\n createBrowserSessionActionEntries,\n type CreateBrowserSessionActionEntriesOptions,\n} from \"../browser-sessions/actions.js\";\nexport {\n DEFAULT_BROWSER_SESSION_REQUEST_POLL_MS,\n DEFAULT_BROWSER_SESSION_REQUEST_TIMEOUT_MS,\n DEFAULT_BROWSER_SESSION_TTL_MS,\n callBrowserSession,\n claimBrowserSessionRequest,\n completeBrowserSessionRequest,\n createBrowserSessionRequest,\n disconnectBrowserSession,\n getBrowserSession,\n getBrowserSessionRequest,\n listBrowserSessions,\n registerBrowserSession,\n waitForBrowserSessionRequest,\n} from \"../browser-sessions/store.js\";\nexport {\n mountBrowserSessionRoutes,\n type MountBrowserSessionRoutesOptions,\n} from \"../browser-sessions/routes.js\";\nexport type {\n AgentNativeBrowserSession,\n AgentNativeBrowserSessionAction,\n AgentNativeBrowserSessionRecord,\n AgentNativeBrowserSessionRequest,\n AgentNativeBrowserSessionRequestStatus,\n AgentNativeBrowserSessionRequestType,\n CreateAgentNativeBrowserSessionRequestInput,\n RegisterAgentNativeBrowserSessionInput,\n} from \"../browser-sessions/types.js\";\nexport {\n createTerminalPlugin,\n defaultTerminalPlugin,\n type TerminalPluginOptions,\n} from \"../terminal/terminal-plugin.js\";\nexport {\n createCollabPlugin,\n type CollabPluginOptions,\n} from \"./collab-plugin.js\";\n\nexport {\n spawnTask,\n getTask,\n getTaskByThread,\n listTasks,\n sendToTask,\n markTaskErrored,\n type AgentTask,\n type SpawnTaskOptions,\n} from \"./agent-teams.js\";\nexport { isOAuthConnected, getOAuthAccounts } from \"./oauth-helpers.js\";\nexport { wrapWithAnalytics } from \"./analytics.js\";\nexport {\n getH3App,\n awaitBootstrap,\n markDefaultPluginProvided,\n type H3AppShim,\n} from \"./framework-request-handler.js\";\nexport {\n autoDiscoverActions,\n autoDiscoverScripts,\n loadActionsFromStaticRegistry,\n mergeCoreSharingActions,\n registerPackageActions,\n} from \"./action-discovery.js\";\nexport {\n mountActionRoutes,\n type MountActionRoutesOptions,\n} from \"./action-routes.js\";\nexport {\n runWithRequestContext,\n hasRequestContext,\n getRequestContext,\n getRequestUserEmail,\n getRequestUserName,\n getRequestOrgId,\n getRequestTimezone,\n getRequestRunContext,\n getCredentialContext,\n isIntegrationCallerRequest,\n type RequestContext,\n type RequestRunContext,\n} from \"./request-context.js\";\nexport { formatDateInTimezone, todayInTimezone } from \"./date-utils.js\";\n\nexport {\n createOnboardingPlugin,\n defaultOnboardingPlugin,\n} from \"../onboarding/plugin.js\";\n\nexport {\n registerFileUploadProvider,\n unregisterFileUploadProvider,\n listFileUploadProviders,\n getActiveFileUploadProvider,\n uploadFile,\n builderFileUploadProvider,\n type FileUploadInput,\n type FileUploadProvider,\n type FileUploadResult,\n} from \"../file-upload/index.js\";\n\nexport {\n createIntegrationsPlugin,\n defaultIntegrationsPlugin,\n enqueueRemoteCommand,\n slackAdapter,\n telegramAdapter,\n whatsappAdapter,\n emailAdapter,\n type PlatformAdapter,\n type IncomingMessage,\n type OutgoingMessage,\n type IntegrationStatus,\n type IntegrationsPluginOptions,\n} from \"../integrations/index.js\";\n\nexport {\n isElectron,\n isMobile,\n getOrigin,\n getAppBasePath,\n getAppUrl,\n resolveOAuthRedirectUri,\n isAllowedOAuthRedirectUri,\n encodeOAuthState,\n decodeOAuthState,\n resolveOAuthOwner,\n createOAuthSession,\n oauthCallbackResponse,\n oauthErrorPage,\n oauthDesktopExchangePage,\n type OAuthStatePayload,\n type OAuthOwnerResult,\n type OAuthSessionResult,\n} from \"./google-oauth.js\";\n\nexport {\n FeatureNotConfiguredError,\n hasBuilderPrivateKey,\n isBuilderEnvManaged,\n getBuilderProxyOrigin,\n getBuilderImageGenerationBaseUrl,\n getBuilderWebSearchBaseUrl,\n getBuilderAuthHeader,\n resolveBuilderPrivateKey,\n resolveBuilderAuthHeader,\n resolveHasBuilderPrivateKey,\n resolveHasCompleteBuilderConnection,\n resolveBuilderCredentials,\n resolveBuilderCredential,\n writeBuilderCredentials,\n deleteBuilderCredentials,\n resolveSecret,\n} from \"./credential-provider.js\";\nexport {\n getBuilderBranchProjectId,\n isBuilderBranchingEnabled,\n resolveBuilderBranchProjectId,\n resolveIsBuilderBranchingEnabled,\n runBuilderAgent,\n type RunBuilderAgentResult,\n} from \"./builder-browser.js\";\n\nexport {\n sendEmail,\n isEmailConfigured,\n getEmailProvider,\n type EmailProvider,\n type SendEmailArgs,\n} from \"./email.js\";\nexport {\n renderEmail,\n emailStrong,\n emailLink,\n type RenderEmailArgs,\n type RenderedEmail,\n type EmailCta,\n} from \"./email-template.js\";\nexport { getAppProductionUrl, getFirstPartyProdUrl } from \"./app-url.js\";\nexport {\n getConfiguredAppBasePath,\n normalizeAppBasePath,\n withConfiguredAppBasePath,\n} from \"./app-base-path.js\";\nexport {\n signShortLivedToken,\n verifyShortLivedToken,\n type ShortLivedTokenClaims,\n type VerifyResult as ShortLivedTokenVerifyResult,\n} from \"./short-lived-token.js\";\n\n// SSR handler is NOT re-exported here — it uses a virtual module\n// (virtual:react-router/server-build) that only exists at Vite dev/build time.\n// Including it in this barrel would break the esbuild CF Pages bundler.\n// Templates import directly: import { ssrHandler } from \"@agent-native/core/server/ssr-handler\"\n\n// Nitro plugin helper — re-exported so templates don't need nitro as a direct dependency.\n// defineNitroPlugin is an identity function; this typed wrapper lets templates use it\n// without resolving `nitro/runtime` (which requires Nitro's virtual modules at runtime).\nexport type NitroPluginDef = (nitroApp: any) => void | Promise<void>;\nexport function defineNitroPlugin(def: NitroPluginDef): NitroPluginDef {\n return def;\n}\n"]}
@@ -112,7 +112,10 @@ action trio instead:
112
112
  docs/spec URLs, placeholders, and examples without exposing secrets.
113
113
  - `provider-api-docs`: fetches public provider docs/spec/changelog URLs when
114
114
  the exact endpoint, filter operator, payload shape, or pagination contract is
115
- uncertain. Registered docs URLs are curated starting points.
115
+ uncertain. Registered docs URLs are curated starting points. Use
116
+ `responseMode: "markdown"` for clean readable docs, or
117
+ `responseMode: "matches"` with `search: { query | terms | regex }` for
118
+ compact snippets instead of flooding context with raw HTML.
116
119
  - `provider-api-request`: makes a constrained authenticated HTTP request to the
117
120
  provider host, injects configured credentials, blocks private/internal URLs,
118
121
  and redacts secrets.
@@ -151,6 +154,12 @@ pagination status, truncation, failed pages, and uncovered gaps. They must not
151
154
  turn default limits, sampled rows, truncated excerpts, or aborted calls into a
152
155
  confident "none found", "all records", or exhaustive conclusion.
153
156
 
157
+ For public web pages and docs, prefer the token-efficient path: `web-search`
158
+ to find likely URLs, `web-request` or `provider-api-docs` with clean
159
+ `responseMode` output to read a page, and `run-code` with `webRead()` /
160
+ `webFetch()` when you need to grep, aggregate, or compare many pages before
161
+ returning a small result.
162
+
154
163
  ### The `http` Option
155
164
 
156
165
  Controls how the action is exposed as an HTTP endpoint:
@@ -195,6 +204,48 @@ run: async (args) => {
195
204
  }
196
205
  ```
197
206
 
207
+ ### Validating Return Values (`outputSchema`)
208
+
209
+ `schema` validates inputs; `outputSchema` validates what the action **returns**. Pass any Standard Schema-compatible schema (Zod, Valibot, ArkType) and the framework validates the result _after_ `run()` resolves — input validated before `run`, output after.
210
+
211
+ ```ts
212
+ export default defineAction({
213
+ description: "Summarize a thread.",
214
+ schema: z.object({ threadId: z.string() }),
215
+ outputSchema: z.object({ summary: z.string(), messageCount: z.number() }),
216
+ outputErrorStrategy: "warn", // default; "strict" | "fallback"
217
+ // outputFallback: { summary: "", messageCount: 0 }, // used only by "fallback"
218
+ run: async ({ threadId }) => {
219
+ /* ... */
220
+ },
221
+ });
222
+ ```
223
+
224
+ - `"warn"` (default) — `console.warn` the issues and return the **original** result unchanged. Non-breaking.
225
+ - `"strict"` — throw a clear error so a buggy action surfaces loudly.
226
+ - `"fallback"` — return `outputFallback` in place of the invalid result.
227
+
228
+ On success the validated value is returned, so coercion/defaults on `outputSchema` apply. Omit `outputSchema` and behavior is byte-for-byte unchanged (no wrapping).
229
+
230
+ ### Human-in-the-Loop Approval (`needsApproval`)
231
+
232
+ For high-consequence, outward-facing, hard-to-undo actions (sending an email, charging a card, deleting an account), set `needsApproval` so the agent **cannot** run the action without a human approving the specific call:
233
+
234
+ ```ts
235
+ export default defineAction({
236
+ description: "Send an email via Gmail.",
237
+ schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
238
+ needsApproval: true, // boolean, or (args, ctx) => boolean | Promise<boolean>
239
+ run: async (args) => {
240
+ /* ...actually send... */
241
+ },
242
+ });
243
+ ```
244
+
245
+ 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". 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.
246
+
247
+ **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.
248
+
198
249
  ## Frontend Hooks
199
250
 
200
251
  The frontend calls actions using React Query hooks from `@agent-native/core/client`. Components should not hand-write `fetch("/_agent-native/actions/...")`; add or reuse a client hook/helper instead. Use `callAction` from the same package for imperative cases that do not fit a hook, such as debounced search, prefetching, or non-React event handlers.
@@ -139,6 +139,28 @@ export default defineEventHandler(async (event) => {
139
139
 
140
140
  - Never create unprotected routes that modify data.
141
141
 
142
+ ## Human-in-the-Loop Approval for High-Consequence Actions
143
+
144
+ For a small set of outward-facing, hard-to-undo operations — sending an email, charging a card, deleting an account, posting publicly — auth and access control are necessary but not sufficient: you also do not want the **agent** to perform them autonomously. Set `needsApproval` on the `defineAction` so the agent cannot run the action without a human approving the specific call.
145
+
146
+ ```ts
147
+ export default defineAction({
148
+ description: "Send an email via Gmail.",
149
+ schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
150
+ needsApproval: true, // or (args, ctx) => boolean | Promise<boolean>
151
+ run: async (args) => {
152
+ /* ...actually send... */
153
+ },
154
+ });
155
+ ```
156
+
157
+ When the gate is truthy and the call is not yet approved, the loop emits an `approval_required` event and **stops the turn — `run()` never executes**. The human approves via the chat UI's Approve affordance, which re-issues the turn with the call's stable `approvalKey`; only then does the action run. A predicate gates conditionally (e.g. only external recipients) and **fails closed** — a throw is treated as "approval required".
158
+
159
+ Rules:
160
+
161
+ - Reach for `needsApproval` only for genuinely high-consequence operations. The default is off, and the framework intentionally keeps approvals rare — over-gating turns the agent into a click-through wizard. The canonical (and intentionally lone) framework example is Mail's `send-email`.
162
+ - `needsApproval` is **not** a substitute for `accessFilter` / `assertAccess` or for hiding sensitive operations from the model with `agentTool: false` / `toolCallable: false`. It is the layer for "a human must explicitly bless this specific outward-facing call," not for scoping data. See the `actions` skill for the full surface.
163
+
142
164
  ## Custom HTTP Routes Must Apply Access Control Themselves
143
165
 
144
166
  This is the single most-failed rule in the codebase. Auto-mounted action routes (`/_agent-native/actions/...`) get a request context wired up automatically. **Hand-written `/api/*` Nitro routes do not.** If your handler queries an ownable resource (any table with `...ownableColumns()`), you MUST:
@@ -112,7 +112,10 @@ action trio instead:
112
112
  docs/spec URLs, placeholders, and examples without exposing secrets.
113
113
  - `provider-api-docs`: fetches public provider docs/spec/changelog URLs when
114
114
  the exact endpoint, filter operator, payload shape, or pagination contract is
115
- uncertain. Registered docs URLs are curated starting points.
115
+ uncertain. Registered docs URLs are curated starting points. Use
116
+ `responseMode: "markdown"` for clean readable docs, or
117
+ `responseMode: "matches"` with `search: { query | terms | regex }` for
118
+ compact snippets instead of flooding context with raw HTML.
116
119
  - `provider-api-request`: makes a constrained authenticated HTTP request to the
117
120
  provider host, injects configured credentials, blocks private/internal URLs,
118
121
  and redacts secrets.
@@ -151,6 +154,12 @@ pagination status, truncation, failed pages, and uncovered gaps. They must not
151
154
  turn default limits, sampled rows, truncated excerpts, or aborted calls into a
152
155
  confident "none found", "all records", or exhaustive conclusion.
153
156
 
157
+ For public web pages and docs, prefer the token-efficient path: `web-search`
158
+ to find likely URLs, `web-request` or `provider-api-docs` with clean
159
+ `responseMode` output to read a page, and `run-code` with `webRead()` /
160
+ `webFetch()` when you need to grep, aggregate, or compare many pages before
161
+ returning a small result.
162
+
154
163
  ### The `http` Option
155
164
 
156
165
  Controls how the action is exposed as an HTTP endpoint:
@@ -195,6 +204,48 @@ run: async (args) => {
195
204
  }
196
205
  ```
197
206
 
207
+ ### Validating Return Values (`outputSchema`)
208
+
209
+ `schema` validates inputs; `outputSchema` validates what the action **returns**. Pass any Standard Schema-compatible schema (Zod, Valibot, ArkType) and the framework validates the result _after_ `run()` resolves — input validated before `run`, output after.
210
+
211
+ ```ts
212
+ export default defineAction({
213
+ description: "Summarize a thread.",
214
+ schema: z.object({ threadId: z.string() }),
215
+ outputSchema: z.object({ summary: z.string(), messageCount: z.number() }),
216
+ outputErrorStrategy: "warn", // default; "strict" | "fallback"
217
+ // outputFallback: { summary: "", messageCount: 0 }, // used only by "fallback"
218
+ run: async ({ threadId }) => {
219
+ /* ... */
220
+ },
221
+ });
222
+ ```
223
+
224
+ - `"warn"` (default) — `console.warn` the issues and return the **original** result unchanged. Non-breaking.
225
+ - `"strict"` — throw a clear error so a buggy action surfaces loudly.
226
+ - `"fallback"` — return `outputFallback` in place of the invalid result.
227
+
228
+ On success the validated value is returned, so coercion/defaults on `outputSchema` apply. Omit `outputSchema` and behavior is byte-for-byte unchanged (no wrapping).
229
+
230
+ ### Human-in-the-Loop Approval (`needsApproval`)
231
+
232
+ For high-consequence, outward-facing, hard-to-undo actions (sending an email, charging a card, deleting an account), set `needsApproval` so the agent **cannot** run the action without a human approving the specific call:
233
+
234
+ ```ts
235
+ export default defineAction({
236
+ description: "Send an email via Gmail.",
237
+ schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
238
+ needsApproval: true, // boolean, or (args, ctx) => boolean | Promise<boolean>
239
+ run: async (args) => {
240
+ /* ...actually send... */
241
+ },
242
+ });
243
+ ```
244
+
245
+ 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". 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.
246
+
247
+ **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.
248
+
198
249
  ## Frontend Hooks
199
250
 
200
251
  The frontend calls actions using React Query hooks from `@agent-native/core/client`. Components should not hand-write `fetch("/_agent-native/actions/...")`; add or reuse a client hook/helper instead. Use `callAction` from the same package for imperative cases that do not fit a hook, such as debounced search, prefetching, or non-React event handlers.
@@ -197,7 +197,7 @@ path is obvious.
197
197
  `defineAction` accepts an optional `link` builder. When set, every MCP/A2A
198
198
  result for that tool auto-appends a markdown `[label →](absoluteUrl)` block and
199
199
  a structured `_meta["agent-native/openLink"] = { label, view, webUrl,
200
- desktopUrl }`; `tools/list` adds
200
+ desktopUrl, vscodeUrl }`; `tools/list` adds
201
201
  `annotations["agent-native/producesOpenLink"]` plus a description suffix so the
202
202
  external agent knows the tool yields an openable link.
203
203
 
@@ -285,9 +285,11 @@ ngrok/prod testing caveats are documented in
285
285
 
286
286
  `buildDeepLink(...)` returns the app-relative path
287
287
  `/_agent-native/open?app=…&view=…&<recordId>=…`. The MCP layer turns that into
288
- an absolute web URL (`toAbsoluteOpenUrl`, using the request origin) and a
289
- desktop `agentnative://open?…` URL (`toDesktopOpenUrl`). When the user clicks
290
- it in any browser or inline webview, `GET /_agent-native/open`
288
+ an absolute web URL (`toAbsoluteOpenUrl`, using the request origin), a
289
+ desktop `agentnative://open?…` URL (`toDesktopOpenUrl`), and a VS Code
290
+ extension URL (`toVsCodeOpenUrl`) for
291
+ `vscode://builderio.agent-native/open?url=…`. When the user clicks the web
292
+ link in any browser or inline webview, `GET /_agent-native/open`
291
293
  (`createOpenRouteHandler`, mounted by the core routes plugin, gated by
292
294
  `disableOpenRoute`, customizable via `resolveOpenPath`):
293
295
 
@@ -220,3 +220,14 @@ await putSetting("observability-config", {
220
220
  ```
221
221
 
222
222
  The framework emits `gen_ai.*` semantic convention spans compatible with Langfuse, Datadog, Grafana, New Relic, and any OTel-compatible backend.
223
+
224
+ ## Live OpenTelemetry Spans (Optional)
225
+
226
+ Separate from the `exporters` config above (which ships the in-house traces to an OTLP endpoint), the agent loop can also emit **live OpenTelemetry spans** for every run, model call, and tool call, so a host that already runs an OTel collector sees agent activity alongside its other distributed traces.
227
+
228
+ This layer is optional and **no-op by default**:
229
+
230
+ - `@opentelemetry/api` is an **optional dependency**. If it isn't installed, the span helpers degrade to silent no-ops — they never throw into the agent loop.
231
+ - Even with the api package installed, it ships a default no-op tracer. Spans become real only once the **host registers a `TracerProvider`** (via `@opentelemetry/sdk-node` or similar). The framework deliberately does not depend on the heavy SDK/exporter packages and never registers a provider itself — instrumentation is opt-in by the embedding app.
232
+
233
+ The loop emits `agent.run` (with `agent.run_id`, `agent.thread_id`, `agent.user_id`, `agent.model`), `tool.call` (`tool.name` + status), and `llm.call` spans, each finished with OK/ERROR status. This is purely additive to the in-house `agent_trace_spans` / `agent_trace_summaries` tables. Source: `packages/core/src/observability/tracing.ts` + `traces.ts`. See the Observability doc for the full table.
@@ -139,6 +139,28 @@ export default defineEventHandler(async (event) => {
139
139
 
140
140
  - Never create unprotected routes that modify data.
141
141
 
142
+ ## Human-in-the-Loop Approval for High-Consequence Actions
143
+
144
+ For a small set of outward-facing, hard-to-undo operations — sending an email, charging a card, deleting an account, posting publicly — auth and access control are necessary but not sufficient: you also do not want the **agent** to perform them autonomously. Set `needsApproval` on the `defineAction` so the agent cannot run the action without a human approving the specific call.
145
+
146
+ ```ts
147
+ export default defineAction({
148
+ description: "Send an email via Gmail.",
149
+ schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
150
+ needsApproval: true, // or (args, ctx) => boolean | Promise<boolean>
151
+ run: async (args) => {
152
+ /* ...actually send... */
153
+ },
154
+ });
155
+ ```
156
+
157
+ When the gate is truthy and the call is not yet approved, the loop emits an `approval_required` event and **stops the turn — `run()` never executes**. The human approves via the chat UI's Approve affordance, which re-issues the turn with the call's stable `approvalKey`; only then does the action run. A predicate gates conditionally (e.g. only external recipients) and **fails closed** — a throw is treated as "approval required".
158
+
159
+ Rules:
160
+
161
+ - Reach for `needsApproval` only for genuinely high-consequence operations. The default is off, and the framework intentionally keeps approvals rare — over-gating turns the agent into a click-through wizard. The canonical (and intentionally lone) framework example is Mail's `send-email`.
162
+ - `needsApproval` is **not** a substitute for `accessFilter` / `assertAccess` or for hiding sensitive operations from the model with `agentTool: false` / `toolCallable: false`. It is the layer for "a human must explicitly bless this specific outward-facing call," not for scoping data. See the `actions` skill for the full surface.
163
+
142
164
  ## Custom HTTP Routes Must Apply Access Control Themselves
143
165
 
144
166
  This is the single most-failed rule in the codebase. Auto-mounted action routes (`/_agent-native/actions/...`) get a request context wired up automatically. **Hand-written `/api/*` Nitro routes do not.** If your handler queries an ownable resource (any table with `...ownableColumns()`), you MUST:
@@ -49,6 +49,35 @@ That's it. The framework auto-discovers every file in `actions/` and mounts them
49
49
 
50
50
  The schema is converted to JSON Schema for the Claude API tool definition, _and_ used at runtime to validate inputs before `run()` fires. Invalid inputs never reach your handler.
51
51
 
52
+ ### Validating the return value {#output-schema}
53
+
54
+ `schema` validates _inputs_. To also validate what an action **returns**, pass an `outputSchema` (any Standard Schema-compatible schema — Zod, Valibot, ArkType, same surface as `schema`). The framework validates the result _after_ `run()` resolves, composing with input validation: input validated before `run`, output validated after.
55
+
56
+ ```ts
57
+ export default defineAction({
58
+ description: "Summarize a thread.",
59
+ schema: z.object({ threadId: z.string() }),
60
+ outputSchema: z.object({
61
+ summary: z.string(),
62
+ messageCount: z.number(),
63
+ }),
64
+ outputErrorStrategy: "warn", // default
65
+ run: async ({ threadId }) => {
66
+ /* ...returns { summary, messageCount } ... */
67
+ },
68
+ });
69
+ ```
70
+
71
+ `outputErrorStrategy` controls what happens on a mismatch:
72
+
73
+ | Strategy | Behavior on mismatch |
74
+ | ------------ | -------------------------------------------------------------------------------------------------- |
75
+ | `"warn"` | **Default.** `console.warn` the issues and return the **original** result unchanged. Non-breaking. |
76
+ | `"strict"` | Throw a clear error so a buggy action surfaces loudly. |
77
+ | `"fallback"` | Return the provided `outputFallback` value in place of the invalid result. |
78
+
79
+ On success, the **validated** value is returned, so any coercion or defaults defined on the `outputSchema` take effect (mirroring the input path). When no `outputSchema` is supplied, behavior is byte-for-byte unchanged — there is no wrapping. This is borrowed from Mastra/Flue structured-output and kept dependency-free on the action layer.
80
+
52
81
  ### HTTP config {#http}
53
82
 
54
83
  By default every action is exposed as `POST /_agent-native/actions/<name>`. Override with the `http` option:
@@ -221,6 +250,26 @@ export default defineAction({
221
250
 
222
251
  For list and read actions, use `accessFilter` to scope the query to the current user and org. For actions that update or delete a specific row, use `assertAccess` to confirm the caller is allowed before writing. See [Security](/docs/security#access-guards) and [Sharing](/docs/sharing) for the full helper API.
223
252
 
253
+ ### Human-in-the-loop approval {#needs-approval}
254
+
255
+ A handful of actions are too consequential to let the agent run autonomously — sending an email, charging a card, deleting an account. For those, set `needsApproval` to pause the loop and require a human to approve the specific call before `run()` executes:
256
+
257
+ ```ts
258
+ export default defineAction({
259
+ description: "Send an email via Gmail.",
260
+ schema: z.object({ to: z.string(), subject: z.string(), body: z.string() }),
261
+ needsApproval: true, // pause; a human must approve this specific send
262
+ run: async (args) => {
263
+ /* ...actually send... */
264
+ },
265
+ });
266
+ ```
267
+
268
+ `needsApproval` accepts a boolean or a predicate `(args, ctx) => boolean | Promise<boolean>` to gate conditionally (e.g. only external recipients, only above a threshold). The predicate **fails closed**: a throw is treated as "approval required". When the gate is truthy and the call isn't yet approved, the loop emits an `approval_required` event and stops the turn — the side effect never happens — and the action runs only once a human approves via the chat UI's Approve affordance.
269
+
270
+ > [!WARNING]
271
+ > Keep approvals rare. Each gated action is a hard stop in the agent loop. The default is **off**, and almost every action should leave it off. See [Human-in-the-Loop Approvals](/docs/human-approval) for the full flow.
272
+
224
273
  ## Calling it from the UI {#ui}
225
274
 
226
275
  Two hooks, both in `@agent-native/core/client`. Types are inferred from your `defineAction` schemas — no manual type declarations.
@@ -390,6 +439,7 @@ const args = parseArgs(["--name", "Steve", "--verbose", "--count=3"]);
390
439
 
391
440
  ## What's next
392
441
 
442
+ - [**Human-in-the-Loop Approvals**](/docs/human-approval) — the `needsApproval` gate in depth
393
443
  - [**Drop-in Agent**](/docs/drop-in-agent) — `useActionMutation` / `useActionQuery` in React
394
444
  - [**Context Awareness**](/docs/context-awareness) — the `view-screen` + `navigate` pattern in depth
395
445
  - [**A2A Protocol**](/docs/a2a-protocol) — how other agents discover and call your actions
@@ -0,0 +1,49 @@
1
+ ---
2
+ title: "Durable Resume"
3
+ description: "When a hosted agent run is interrupted and resumes, completed side-effecting tool calls are not re-run — a tool-call journal derived from the durable ledger blocks duplicate sends, charges, and tickets."
4
+ ---
5
+
6
+ # Durable Resume
7
+
8
+ Hosted agent runs get interrupted: a serverless function hits its hard timeout mid-stream, a gateway drops the connection at 45s, a socket hangs up, the platform cold-starts. The framework already recovers from these by saving the conversation prefix and re-running the LLM call ("continue from where you left off"). But recovery alone has a sharp edge: if the interrupted attempt **already sent an email or created a ticket**, a naive resume could do it again.
9
+
10
+ Durable resume closes that gap. On resume, the framework knows which side-effecting tool calls already completed and refuses to re-run them — at two layers.
11
+
12
+ ## The tool-call journal {#journal}
13
+
14
+ The journal is a **pure read over the durable run-event ledger** — there is no new recording hook in the hot path. It classifies the tool calls already recorded for the current turn:
15
+
16
+ - **Completed** — a `tool_start` with a matching `tool_done`. The call ran, its side effect happened, and its result was recorded. **Do not re-run.**
17
+ - **Interrupted** — a `tool_start` with **no** matching `tool_done`. The call began, its side effect may or may not have landed, and the interruption ate the result. Outcome unknown.
18
+
19
+ Matching mirrors how durable turns are rebuilt elsewhere: a `tool_done` pairs with the oldest still-open `tool_start` for the same tool name (FIFO per tool). A `clear` event (discarded partial output) resets the per-turn tally so abandoned partials don't leave phantom open calls.
20
+
21
+ ## Layer 1: prompt-level journal note {#prompt-note}
22
+
23
+ When a run resumes (soft timeout, gateway timeout, or any resumable transport error), the framework appends a **structured journal note** to the resume prompt, right after the "continue from where you left off" nudge. The note tells the model, in plain text:
24
+
25
+ - which tool calls **already completed** (with short results) so it reuses them and does **not** re-run them, and
26
+ - which tool calls were **interrupted with unknown outcome** so it verifies state before assuming success or failure.
27
+
28
+ When the journal is empty (a turn with no tool activity, or a clean continuation), nothing extra is appended and resume behavior is byte-for-byte what it was before. The note is best-effort: a failed ledger read never blocks a recovery that would otherwise succeed.
29
+
30
+ ## Layer 2: tool-layer hard-block {#hard-block}
31
+
32
+ The prompt note is advisory — a well-behaved model heeds it, but a model isn't a guarantee. So the loop also enforces it at the tool layer.
33
+
34
+ Before the loop runs in a resumed chunk, it snapshots the journal once (capturing only **prior** chunks of this logical turn). When the model re-dispatches a **write** tool whose tool name **and input** match a completed journal entry, the loop short-circuits: it returns the journaled result instead of executing the action, with a note that the call already completed in an earlier interrupted attempt and was not re-run to avoid a duplicate side effect.
35
+
36
+ Key properties:
37
+
38
+ - **Write tools only.** Read-only (`readOnly` / GET) actions are never blocked — re-reading is safe and idempotent.
39
+ - **Content-addressed.** The match is on tool name + input signature, so a resumed call sitting at a different position in the turn still matches; a _different_ call (different args) is treated as fresh and runs normally.
40
+ - **Consume-once.** Each completed entry is claimed when matched, so two genuinely-distinct identical fresh calls in the same turn don't both short-circuit on one journaled completion.
41
+ - **Fresh calls untouched.** A first-turn call sees an empty journal; nothing changes for normal runs.
42
+
43
+ Together the two layers mean an interrupted run that already had a real side effect resumes without repeating it — no duplicate emails, charges, or tickets — while genuinely new work still runs.
44
+
45
+ ## Related
46
+
47
+ - [**Real-Time Sync**](/docs/real-time-collaboration) — how the durable run ledger streams to the client and replays on reconnect.
48
+ - [**Actions**](/docs/actions) — `readOnly` marks reads as safe to re-run; everything else is treated as side-effecting.
49
+ - [**In-Loop Processors**](/docs/processors) — another loop-internal hardening seam.
@@ -386,7 +386,7 @@ Every allow-listed template that produces or lists a navigable resource ships a
386
386
 
387
387
  ## Authoring: the `link` builder {#link-builder}
388
388
 
389
- This section is for template authors. `defineAction` accepts an optional `link` builder. When set, every MCP/A2A result for that tool auto-appends a markdown `[label →](absoluteUrl)` block and a structured `_meta["agent-native/openLink"] = { label, view, webUrl, desktopUrl }`. `tools/list` adds `annotations["agent-native/producesOpenLink"]` and a description suffix so the external agent knows the tool yields an openable link and should surface it.
389
+ This section is for template authors. `defineAction` accepts an optional `link` builder. When set, every MCP/A2A result for that tool auto-appends a markdown `[label →](absoluteUrl)` block and a structured `_meta["agent-native/openLink"] = { label, view, webUrl, desktopUrl, vscodeUrl }`. `tools/list` adds `annotations["agent-native/producesOpenLink"]` and a description suffix so the external agent knows the tool yields an openable link and should surface it.
390
390
 
391
391
  Build the URL with `buildDeepLink(...)` — it is the single source of truth for the open-route format. Never hand-format the `/_agent-native/open` URL.
392
392
 
@@ -431,7 +431,7 @@ See [MCP Apps](/docs/mcp-apps) for the full authoring guide — `embedRoute` vs
431
431
 
432
432
  The `link` builder is **pure and synchronous — no I/O, no awaits**. It runs best-effort: a throw, `null`, or `undefined` is swallowed and **never** fails the tool call. It only reads the call's `args` and `result`; it must not query the DB, read app-state, or call other actions. Return `null` when there's nothing to open.
433
433
 
434
- `buildDeepLink({ app, view, params?, to?, compose? })` returns the app-relative path `/_agent-native/open?app=…&view=…&<recordId>=…`. The MCP layer turns that into an absolute web URL (`toAbsoluteOpenUrl`, using the request origin) and a desktop `agentnative://open?…` URL (`toDesktopOpenUrl`); the markdown link uses the desktop URL when the client signals `target: "desktop"`.
434
+ `buildDeepLink({ app, view, params?, to?, compose? })` returns the app-relative path `/_agent-native/open?app=…&view=…&<recordId>=…`. The MCP layer turns that into an absolute web URL (`toAbsoluteOpenUrl`, using the request origin), a desktop `agentnative://open?…` URL (`toDesktopOpenUrl`), and a VS Code extension URL (`toVsCodeOpenUrl`) for `vscode://builderio.agent-native/open?url=…`; the markdown link uses the desktop URL when the client signals `target: "desktop"`.
435
435
 
436
436
  ### The `/_agent-native/open` route {#open-route}
437
437
 
@@ -0,0 +1,101 @@
1
+ ---
2
+ title: "Human-in-the-Loop Approvals"
3
+ description: "Pause the agent before a high-consequence action runs — defineAction's needsApproval gate emits an approval_required event, the human approves, and only then does the tool execute."
4
+ ---
5
+
6
+ # Human-in-the-Loop Approvals
7
+
8
+ Most actions should just run. A few — sending an email, charging a card, deleting an account — are outward-facing and hard to undo, and you don't want the agent to do them autonomously. For those, `defineAction` has an opt-in **approval gate**: when the agent tries to call the action, the loop pauses, surfaces an Approve/Deny affordance to the human, and runs the action _only_ after the human approves that specific call.
9
+
10
+ > [!WARNING]
11
+ > Keep approvals rare. Every gated action is a hard stop in the agent loop — it interrupts the run and demands a human round-trip. Use `needsApproval` only for genuinely high-consequence, hard-to-undo, outward-facing operations. If you find yourself gating reads or routine writes, you're holding it wrong. The default is **off**, and almost every action should leave it off.
12
+
13
+ ## The `needsApproval` gate {#needs-approval}
14
+
15
+ Set `needsApproval` on a `defineAction`. It accepts a boolean or a predicate:
16
+
17
+ ```ts
18
+ // actions/send-email.ts
19
+ export default defineAction({
20
+ description: "Send an email via Gmail.",
21
+ schema: z.object({
22
+ to: z.string(),
23
+ subject: z.string(),
24
+ body: z.string(),
25
+ }),
26
+ // Sending is outward-facing and hard to undo, so the agent can never send
27
+ // without a human approving the specific call. Drafting/queueing is
28
+ // unaffected — only the real send is gated.
29
+ needsApproval: true,
30
+ run: async (args) => {
31
+ /* ...actually send... */
32
+ },
33
+ });
34
+ ```
35
+
36
+ - **`needsApproval: true`** — always require approval.
37
+ - **`needsApproval: (args, ctx) => boolean | Promise<boolean>`** — require approval only when the predicate returns true. Gate conditionally, e.g. only for external recipients or only above a dollar threshold:
38
+
39
+ ```ts
40
+ needsApproval: (args) => !args.to.endsWith("@your-company.com"),
41
+ ```
42
+
43
+ Keep the predicate pure and fast. **It fails closed**: if the predicate throws, the framework treats that as "approval required" rather than silently running a high-consequence action.
44
+
45
+ When `needsApproval` is omitted, behavior is byte-for-byte unchanged — there is no extra cost on the common path.
46
+
47
+ This works the same for legacy `parameters`-style actions and schema-based actions, and for the in-app agent, sub-agents, A2A, and MCP callers (every agent surface routes through the same loop).
48
+
49
+ ## How the loop pauses {#loop}
50
+
51
+ When the agent calls a gated action and this specific call has **not** already been approved, the loop does **not** execute `run()`. Instead it:
52
+
53
+ 1. Resolves the gate. For a predicate, it calls `needsApproval(input, ctx)`; a throw is treated as "must approve" (fail closed).
54
+ 2. Emits a `tool_start` event (so the UI shows the call) followed immediately by an **`approval_required`** event, then stops the turn. The action's side effect never happens.
55
+
56
+ The `approval_required` event carries everything the client needs to render an affordance:
57
+
58
+ | Field | Type | Notes |
59
+ | ------------- | -------- | ------------------------------------------------------------------- |
60
+ | `tool` | `string` | The action name the agent tried to call. |
61
+ | `input` | object | The arguments the agent passed. |
62
+ | `approvalKey` | `string` | **Stable key** the client echoes back to approve _this exact call_. |
63
+ | `toolCallId` | `string` | The model-side tool-call id, when available. |
64
+
65
+ The `approvalKey` is derived deterministically from the tool name plus its input, so the same logical call always produces the same key. The model never sees or sets it — it is purely a handshake between the framework and the human's Approve affordance.
66
+
67
+ The paused tool returns a result telling the model the turn is paused and not to retry, so the model doesn't spin.
68
+
69
+ ## How the human approves {#approve}
70
+
71
+ On `approval_required`, the chat UI renders an **Approve / Deny** affordance on the paused tool call. This is wired automatically in `AssistantChat` — you don't build it per template.
72
+
73
+ - **Approve** re-issues the turn (an ordinary continuation message) carrying the call's key in `approvedToolCalls: [approvalKey]`. On the re-issued turn, the gate sees the key in the approved set and lets that specific call run normally.
74
+ - **Deny** dismisses the affordance locally; nothing is re-issued, so the action never runs.
75
+
76
+ `approvedToolCalls` is a field on the chat request (`AgentChatRequest.approvedToolCalls`). Keys not present in it stay paused — approving one call never blankly approves others. Because the key is content-addressed, an approval authorizes _that call with those arguments_; if the model later proposes a different send, that's a new key and a fresh approval.
77
+
78
+ ## End-to-end {#flow}
79
+
80
+ ```txt
81
+ agent calls send-email
82
+
83
+
84
+ needsApproval truthy, call not yet approved
85
+ │ loop emits tool_start + approval_required { tool, input, approvalKey }
86
+
87
+ turn pauses — run() did NOT execute
88
+
89
+ human clicks Approve in the chat UI
90
+ │ client re-issues the turn with approvedToolCalls: [approvalKey]
91
+
92
+ gate sees the key → run() executes → email sends
93
+ ```
94
+
95
+ The canonical (and intentionally rare) use of this gate in the framework is the Mail template's `send-email` action, which sets `needsApproval: true` so the agent can draft and queue freely but can never actually send a message without a human approving the specific send.
96
+
97
+ ## Related
98
+
99
+ - [**Actions**](/docs/actions#needs-approval) — the full `defineAction` surface, including `outputSchema` for validating return values.
100
+ - [**Security**](/docs/security) — when to reach for an approval gate vs. hiding an action from the model.
101
+ - [**Mail template**](/docs/template-mail) — `send-email` is the reference example.