@agent-native/core 0.208.0 → 0.209.0-nightly-20261014070126

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 (74) hide show
  1. package/agent-native.eject.json +1 -0
  2. package/dist/agent/approval-key.d.ts +2 -0
  3. package/dist/agent/approval-key.js +12 -0
  4. package/dist/agent/context-xray/tokenize.js +12 -3
  5. package/dist/agent/engine/translate-anthropic.js +4 -0
  6. package/dist/agent/engine/types.d.ts +2 -0
  7. package/dist/agent/production-agent.d.ts +20 -5
  8. package/dist/agent/production-agent.js +227 -34
  9. package/dist/agent/run-manager.js +57 -11
  10. package/dist/agent/run-store.d.ts +10 -0
  11. package/dist/agent/run-store.js +49 -4
  12. package/dist/agent/thread-data-builder.d.ts +2 -0
  13. package/dist/agent/thread-data-builder.js +288 -14
  14. package/dist/agent/tool-approval-store.d.ts +3 -1
  15. package/dist/agent/tool-approval-store.js +26 -12
  16. package/dist/agent/tool-call-journal.d.ts +1 -1
  17. package/dist/agent/tool-call-journal.js +5 -3
  18. package/dist/agent/types.d.ts +7 -0
  19. package/dist/client/chat/agentkit-agent-native.js +18 -0
  20. package/dist/client/chat/agentkit-protocol.js +56 -5
  21. package/dist/client/chat/runtime.d.ts +10 -0
  22. package/dist/client/chat/runtime.js +257 -26
  23. package/dist/client/sse-event-processor.d.ts +22 -0
  24. package/dist/client/sse-event-processor.js +91 -11
  25. package/dist/collab/struct-routes.d.ts +1 -1
  26. package/dist/connections/catalog.d.ts +24 -1
  27. package/dist/connections/catalog.js +12 -0
  28. package/dist/data-programs/schema.d.ts +1 -0
  29. package/dist/data-programs/schema.js +3 -0
  30. package/dist/data-programs/store.js +2 -1
  31. package/dist/deploy/build.js +16 -14
  32. package/dist/eject/workspace-connections.js +1 -0
  33. package/dist/extensions/fetch-tool.js +114 -23
  34. package/dist/extensions/schema.d.ts +1 -0
  35. package/dist/extensions/schema.js +3 -0
  36. package/dist/extensions/store.js +2 -1
  37. package/dist/extensions/web-content.d.ts +5 -1
  38. package/dist/extensions/web-content.js +24 -6
  39. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  40. package/dist/notifications/routes.d.ts +1 -1
  41. package/dist/provider-api/actions/custom-provider-registration.d.ts +11 -11
  42. package/dist/provider-api/actions/provider-api.d.ts +9 -9
  43. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  44. package/dist/provider-api/index.d.ts +2 -0
  45. package/dist/provider-api/index.js +95 -12
  46. package/dist/resources/handlers.d.ts +1 -1
  47. package/dist/server/agent-engine-default-model-route.d.ts +2 -2
  48. package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
  49. package/dist/server/auth.js +1 -0
  50. package/dist/server/core-routes-plugin.js +1 -0
  51. package/dist/server/index.d.ts +2 -1
  52. package/dist/server/index.js +2 -1
  53. package/dist/server/realtime-token.d.ts +1 -1
  54. package/dist/server/transcribe-voice.d.ts +1 -1
  55. package/dist/server/workspace-provider-oauth.d.ts +1 -1
  56. package/dist/server/workspace-provider-oauth.js +2 -0
  57. package/dist/shared/context-status.js +1 -1
  58. package/dist/shared/optional-peer-ssr.d.ts +2 -0
  59. package/dist/shared/optional-peer-ssr.js +123 -0
  60. package/dist/shared/tool-inputs.d.ts +2 -0
  61. package/dist/shared/tool-inputs.js +56 -0
  62. package/dist/sharing/actions/list-resource-shares.d.ts +1 -1
  63. package/dist/tracking/index.d.ts +1 -0
  64. package/dist/tracking/index.js +1 -0
  65. package/dist/vite/client.js +46 -3
  66. package/dist/workspace-connections/store.d.ts +3 -1
  67. package/dist/workspace-connections/store.js +18 -8
  68. package/dist/workspace-files/constants.d.ts +3 -0
  69. package/dist/workspace-files/constants.js +3 -0
  70. package/dist/workspace-files/store.d.ts +2 -3
  71. package/dist/workspace-files/store.js +2 -3
  72. package/docs/content/automations.mdx +19 -13
  73. package/package.json +3 -3
  74. package/src/eject/workspace-connections.ts +1 -0
@@ -62,6 +62,8 @@ export interface ListWorkspaceConnectionsForAppOptions {
62
62
  }
63
63
  export interface ResolveWorkspaceConnectionForAppOptions extends ListWorkspaceConnectionsForAppOptions {
64
64
  connectionId?: string;
65
+ accountId?: string;
66
+ connectionOwnerEmail?: string;
65
67
  requireConnected?: boolean;
66
68
  }
67
69
  export interface UpsertWorkspaceConnectionInput {
@@ -243,7 +245,7 @@ export declare function summarizeWorkspaceConnectionProviderForApp({ providerId,
243
245
  export declare function summarizeWorkspaceConnectionProviderReadiness({ provider, connections, grants, appId, includeConnections, }: SummarizeWorkspaceConnectionProviderReadinessOptions): WorkspaceConnectionProviderReadiness;
244
246
  export declare function listWorkspaceConnectionProviderCatalogForApp({ appId, provider, capability, templateUse, includeDisabled, includeConnections, }: ListWorkspaceConnectionProviderCatalogForAppOptions): Promise<WorkspaceConnectionProviderCatalogForApp>;
245
247
  export declare function listWorkspaceConnectionsForApp({ appId, provider, includeDisabled, }: ListWorkspaceConnectionsForAppOptions): Promise<WorkspaceConnectionForApp[]>;
246
- export declare function resolveWorkspaceConnectionForApp({ appId, provider, includeDisabled, connectionId, requireConnected, }: ResolveWorkspaceConnectionForAppOptions): Promise<ResolvedWorkspaceConnectionForApp>;
248
+ export declare function resolveWorkspaceConnectionForApp({ appId, provider, includeDisabled, connectionId, accountId, connectionOwnerEmail, requireConnected, }: ResolveWorkspaceConnectionForAppOptions): Promise<ResolvedWorkspaceConnectionForApp>;
247
249
  export declare function listWorkspaceConnections(options?: ListWorkspaceConnectionsOptions): Promise<SerializedWorkspaceConnection[]>;
248
250
  export declare function listWorkspaceConnectionsForUser(options?: ListWorkspaceConnectionsOptions): Promise<SerializedWorkspaceConnection[]>;
249
251
  export declare function getWorkspaceConnection(id: string): Promise<SerializedWorkspaceConnection | null>;
@@ -645,32 +645,42 @@ export async function listWorkspaceConnectionsForApp({ appId, provider, includeD
645
645
  .map((connection) => connectionForApp(connection, normalizedAppId, grants))
646
646
  .filter((connection) => connection.appAccess.available);
647
647
  }
648
- export async function resolveWorkspaceConnectionForApp({ appId, provider, includeDisabled = false, connectionId, requireConnected = false, }) {
648
+ export async function resolveWorkspaceConnectionForApp({ appId, provider, includeDisabled = false, connectionId, accountId, connectionOwnerEmail, requireConnected = false, }) {
649
649
  const normalizedAppId = normalizeRequiredString(appId, "resolveWorkspaceConnectionForApp appId");
650
650
  const normalizedConnectionId = connectionId?.trim();
651
+ const normalizedAccountId = accountId?.trim();
651
652
  const scope = requireWorkspaceConnectionScope();
652
653
  const requestedConnections = await listWorkspaceConnections({
653
654
  provider,
654
- includeDisabled: includeDisabled || Boolean(normalizedConnectionId),
655
+ includeDisabled: includeDisabled || Boolean(normalizedConnectionId || normalizedAccountId),
655
656
  });
656
657
  const userConnections = await filterWorkspaceConnectionsForUser(requestedConnections, scope);
657
- const candidateConnections = normalizedConnectionId
658
- ? userConnections.filter((connection) => connection.id === normalizedConnectionId)
659
- : userConnections;
658
+ const normalizedConnectionOwnerEmail = connectionOwnerEmail
659
+ ?.trim()
660
+ .toLowerCase();
661
+ const candidateConnections = userConnections.filter((connection) => (!normalizedConnectionId || connection.id === normalizedConnectionId) &&
662
+ (!normalizedAccountId || connection.accountId === normalizedAccountId));
663
+ const ownerFilteredConnections = normalizedConnectionOwnerEmail
664
+ ? candidateConnections.filter((connection) => connection.ownerEmail.trim().toLowerCase() ===
665
+ normalizedConnectionOwnerEmail)
666
+ : candidateConnections;
660
667
  const grants = await listWorkspaceConnectionGrants({
661
668
  provider,
662
669
  appId: normalizedAppId,
663
670
  connectionId: normalizedConnectionId,
664
671
  });
665
- if (normalizedConnectionId && candidateConnections.length === 0) {
672
+ if ((normalizedConnectionId || normalizedAccountId) &&
673
+ ownerFilteredConnections.length === 0) {
666
674
  return {
667
675
  available: false,
668
676
  connection: null,
669
677
  appAccess: null,
670
- reason: `Workspace connection "${normalizedConnectionId}" was not found in the current request scope.`,
678
+ reason: normalizedConnectionId
679
+ ? `Workspace connection "${normalizedConnectionId}" was not found in the current request scope.`
680
+ : "Workspace connection for the requested account was not found in the current request scope.",
671
681
  };
672
682
  }
673
- for (const connection of candidateConnections) {
683
+ for (const connection of ownerFilteredConnections) {
674
684
  const connectionWithAccess = connectionForApp(connection, normalizedAppId, grants);
675
685
  if (!connectionWithAccess.appAccess.available) {
676
686
  if (normalizedConnectionId) {
@@ -0,0 +1,3 @@
1
+ export declare const MAX_FILE_BYTES: number;
2
+ export declare const MAX_SCOPE_BYTES: number;
3
+ export declare const SAVE_TO_FILE_MAX_BYTES: number;
@@ -0,0 +1,3 @@
1
+ export const MAX_FILE_BYTES = 2 * 1024 * 1024;
2
+ export const MAX_SCOPE_BYTES = 200 * 1024 * 1024;
3
+ export const SAVE_TO_FILE_MAX_BYTES = 20 * 1024 * 1024;
@@ -1,6 +1,5 @@
1
- export declare const MAX_FILE_BYTES: number;
2
- export declare const MAX_SCOPE_BYTES: number;
3
- export declare const SAVE_TO_FILE_MAX_BYTES: number;
1
+ import { MAX_FILE_BYTES, MAX_SCOPE_BYTES, SAVE_TO_FILE_MAX_BYTES } from "./constants.js";
2
+ export { MAX_FILE_BYTES, MAX_SCOPE_BYTES, SAVE_TO_FILE_MAX_BYTES };
4
3
  export interface WorkspaceFilesScope {
5
4
  scope: "user" | "org";
6
5
  scopeId: string;
@@ -2,9 +2,8 @@ import { getOrgRoleForEmail } from "../mcp/actions/service-token-access.js";
2
2
  import { canManageOrg } from "../org/permissions.js";
3
3
  import { SHARED_OWNER, isLegacyOrganizationWorkspaceFile, sharedResourceOwner, resourceDeleteIfCurrent, resourceGetByPath, resourceList, resourcePut, } from "../resources/store.js";
4
4
  import { getRequestUserEmail } from "../server/request-context.js";
5
- export const MAX_FILE_BYTES = 2 * 1024 * 1024;
6
- export const MAX_SCOPE_BYTES = 200 * 1024 * 1024;
7
- export const SAVE_TO_FILE_MAX_BYTES = 20 * 1024 * 1024;
5
+ import { MAX_FILE_BYTES, MAX_SCOPE_BYTES, SAVE_TO_FILE_MAX_BYTES, } from "./constants.js";
6
+ export { MAX_FILE_BYTES, MAX_SCOPE_BYTES, SAVE_TO_FILE_MAX_BYTES };
8
7
  function ownerForScope(scope) {
9
8
  return scope.scope === "org"
10
9
  ? sharedResourceOwner(scope.scopeId)
@@ -290,19 +290,25 @@ Placeholders are resolved **server-side** after the agent emits the tool call
290
290
 
291
291
  ### Parameters {#web-request-params}
292
292
 
293
- | Parameter | Type | Default | Description |
294
- | -------------- | ------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
295
- | `url` | string | — | Full URL. May contain `${keys.NAME}` references. |
296
- | `method` | string | `GET` | HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD). |
297
- | `headers` | string | `{}` | JSON object of headers. May contain `${keys.NAME}`. |
298
- | `body` | string | — | Request body. May contain `${keys.NAME}`. |
299
- | `timeout_ms` | number | 15000 | Timeout in milliseconds (max 30000). |
300
- | `maxChars` | number | 32000 | Maximum response characters to return (max 200000). Raise it to read a large page or dataset in full. |
301
- | `responseMode` | string | `auto` | How to return the response: `auto` (HTML becomes markdown, JSON/text stays raw), `raw`, `text`, `markdown`, `links`, `metadata`, or `matches` (with `search`). |
302
- | `extract` | string | `readability` | HTML extraction strategy: `readability`, `all-visible` (full visible body text), or `none` (full document). |
303
- | `includeLinks` | boolean | `true` | Whether extracted HTML responses include a compact links list. |
304
- | `search` | object | — | Optional post-fetch search over the extracted content: `{ query, queries, terms, regex, regexFlags, source, maxMatches, contextChars, caseSensitive }`. |
305
- | `saveToFile` | string | — | Workspace file path to save the full response to instead of returning it inline — useful for large pages or API responses. |
293
+ | Parameter | Type | Default | Description |
294
+ | -------------- | ------- | ------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
295
+ | `url` | string | — | Full URL. May contain `${keys.NAME}` references. |
296
+ | `method` | string | `GET` | HTTP method (GET, POST, PUT, PATCH, DELETE, HEAD). |
297
+ | `headers` | string | `{}` | JSON object of headers. May contain `${keys.NAME}`. |
298
+ | `body` | string | — | Request body. May contain `${keys.NAME}`. |
299
+ | `timeout_ms` | number | 15000 | Timeout in milliseconds (max 30000). |
300
+ | `maxChars` | number | 32000 | Maximum response-body characters returned in the agent's context (max 200000). It caps body characters, not the whole formatted tool response, so optional metadata and links can add characters. This does not limit a saved file. |
301
+ | `responseMode` | string | `auto` | How to return the response: `auto` (HTML becomes markdown, JSON/text stays raw), `raw`, `text`, `markdown`, `links`, `metadata`, or `matches` with `search`. |
302
+ | `extract` | string | `readability` | HTML extraction strategy: `readability`, `all-visible` (full visible body text), or `none` (full document). |
303
+ | `includeLinks` | boolean | varies | Whether extracted HTML responses include a compact links list. Defaults to `true` for inline responses and `false` when `saveToFile` is set. |
304
+ | `search` | object | — | Optional post-fetch search over the extracted content: `{ query, queries, terms, regex, regexFlags, source, maxMatches, contextChars, caseSensitive }`. |
305
+ | `saveToFile` | string | — | Workspace file path for saving the full response, up to 20 MiB. With `search`, returns full matches up to `maxChars`; otherwise returns a 2,000-character preview. |
306
+
307
+ By default, `maxChars` caps only response-body characters returned in the agent's context. It does not cap the whole formatted tool response, so optional metadata and links can add characters. Inline responses are limited to 1 MiB, except extracted HTML or XHTML, which can be up to 20 MiB. Raw HTML and other inline responses remain limited to 1 MiB.
308
+
309
+ `saveToFile` supports responses up to 20 MiB. HTML or XHTML saved with a non-raw `responseMode` is written as extracted Markdown or text. Raw mode and non-HTML responses are saved as decoded response body text without HTML extraction. When `saveToFile` is used with `search`, the tool returns full search matches bounded by `maxChars`. Without `search`, it returns a 2,000-character preview. `searchResultsTruncated` means `maxChars` cut the formatted result. `searchSourceTruncated` means the tool scanned only the first 500,000 characters of the selected search source.
310
+
311
+ An over-limit error reports the observed size and applicable cap, and explains how to recover. Use `saveToFile` for responses up to 20 MiB, or request a smaller response if it exceeds that limit.
306
312
 
307
313
  ## Keys {#keys}
308
314
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.208.0",
3
+ "version": "0.209.0-nightly-20261014070126",
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": {
@@ -703,7 +703,7 @@
703
703
  "yaml": "^2.9.0",
704
704
  "yjs": "^13.6.33",
705
705
  "zod": "^4.3.6",
706
- "@agent-native/agentkit": "^0.208.0",
706
+ "@agent-native/agentkit": "^0.209.0-nightly-20261014070126",
707
707
  "@agent-native/recap-cli": "^0.5.71"
708
708
  },
709
709
  "devDependencies": {
@@ -774,7 +774,7 @@
774
774
  "xlsx": "^0.18.5"
775
775
  },
776
776
  "peerDependencies": {
777
- "@agent-native/core-corpus": ">=0.196.0",
777
+ "@agent-native/core-corpus": "0.209.0-nightly-20261014070126",
778
778
  "@ai-sdk/anthropic": ">=3",
779
779
  "@ai-sdk/cohere": ">=3",
780
780
  "@ai-sdk/google": ">=3",
@@ -18,6 +18,7 @@ export const WORKSPACE_CONNECTION_PROVIDERS: WorkspaceConnectionProvider[] = [
18
18
  "notion",
19
19
  "gmail",
20
20
  "google_calendar",
21
+ "bigquery",
21
22
  "google_drive",
22
23
  "google_docs",
23
24
  "google_sheets",