@agent-native/core 0.198.5 → 0.198.7-nightly-20260930213124

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.
@@ -0,0 +1,6 @@
1
+ import { z } from "zod";
2
+ export declare const dispatchConfig: z.ZodObject<{
3
+ adminEmails: z.ZodDefault<z.ZodArray<z.ZodString>>;
4
+ workspaceOwnerEmails: z.ZodDefault<z.ZodArray<z.ZodString>>;
5
+ defaultOwnerEmail: z.ZodOptional<z.ZodString>;
6
+ }, z.core.$strip>;
@@ -0,0 +1,15 @@
1
+ import { z } from "zod";
2
+ export const dispatchConfig = z.object({
3
+ adminEmails: z.array(z.string().email()).default([]).meta({
4
+ env: "DISPATCH_ADMIN_EMAILS",
5
+ doc: "Comma-separated deployment administrators for Dispatch.",
6
+ }),
7
+ workspaceOwnerEmails: z.array(z.string().email()).default([]).meta({
8
+ env: "WORKSPACE_OWNER_EMAIL",
9
+ doc: "Comma-separated workspace owner emails trusted by Dispatch.",
10
+ }),
11
+ defaultOwnerEmail: z.string().email().optional().meta({
12
+ env: "DISPATCH_DEFAULT_OWNER_EMAIL",
13
+ doc: "Default Dispatch owner email.",
14
+ }),
15
+ });
@@ -64,6 +64,11 @@ export declare const appConfigSchema: z.ZodObject<{
64
64
  disableDesktopSsoFallbackInDevelopment: z.ZodDefault<z.ZodBoolean>;
65
65
  requireEmailVerification: z.ZodOptional<z.ZodBoolean>;
66
66
  }, z.core.$strip>>;
67
+ dispatch: z.ZodPrefault<z.ZodObject<{
68
+ adminEmails: z.ZodDefault<z.ZodArray<z.ZodString>>;
69
+ workspaceOwnerEmails: z.ZodDefault<z.ZodArray<z.ZodString>>;
70
+ defaultOwnerEmail: z.ZodOptional<z.ZodString>;
71
+ }, z.core.$strip>>;
67
72
  integrations: z.ZodPrefault<z.ZodObject<{
68
73
  durableDispatch: z.ZodOptional<z.ZodBoolean>;
69
74
  allowUnverifiedWebhooks: z.ZodDefault<z.ZodBoolean>;
@@ -5,6 +5,7 @@ import { agentConfig } from "./agent.js";
5
5
  import { analyticsConfig } from "./analytics.js";
6
6
  import { appConfig } from "./app.js";
7
7
  import { authConfig } from "./auth.js";
8
+ import { dispatchConfig } from "./dispatch.js";
8
9
  import { integrationsConfig } from "./integrations.js";
9
10
  import { launchDarklyConfig } from "./launchdarkly.js";
10
11
  import { migrationConfig } from "./migration.js";
@@ -21,6 +22,7 @@ export const appConfigSchema = z.object({
21
22
  analytics: analyticsConfig.prefault({}),
22
23
  app: appConfig.prefault({}),
23
24
  auth: authConfig.prefault({}),
25
+ dispatch: dispatchConfig.prefault({}),
24
26
  integrations: integrationsConfig.prefault({}),
25
27
  launchDarkly: launchDarklyConfig.prefault({}),
26
28
  migration: migrationConfig.prefault({}),
@@ -139,8 +139,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
139
139
  duplicate?: undefined;
140
140
  eventId?: undefined;
141
141
  } | {
142
- error?: undefined;
143
142
  accepted: boolean;
144
143
  duplicate: boolean;
145
144
  eventId: string;
145
+ error?: undefined;
146
146
  }>;
@@ -3,7 +3,7 @@ import path from "node:path";
3
3
  import { scanDbToolScoping, scanDrizzlePush, scanEmptyMigrations, scanEnvCredentials, scanEnvMutation, scanExplicitCollabAccess, scanIdentityColumnsRegistered, scanLocalhostFallback, scanResourceActionAccess, scanUnscopedCredentials, scanUnscopedQueries, } from "../guards/index.js";
4
4
  import { AGENT_NATIVE_MIGRATION_GUIDE_URL, AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND, loadMigrationManifestsForProject, resolveMigrationSymbolMove, scanDeprecatedImports, } from "../package-lifecycle/index.js";
5
5
  import { formatBytes, scanCleanTargets } from "./clean.js";
6
- import { loadActiveMigrationDependencies, readCliCoreVersion, readUpgradeEnvironment, resolveInstalledPackageVersion, selectMigrationDependencies, } from "./upgrade.js";
6
+ import { loadActiveMigrationDependencies, isDirectCoreDependency, readCliCoreVersion, readUpgradeEnvironment, resolveInstalledPackageVersion, selectMigrationDependencies, } from "./upgrade.js";
7
7
  const AGENTKIT_CHAT_MIGRATION_GUIDE_URL = new URL("../../docs/migrations/agentkit-chat.md", import.meta.url).href;
8
8
  const AGENTKIT_CHAT_MIGRATION_GUIDE_SOURCE_URL = "https://github.com/BuilderIO/agent-native/blob/main/packages/core/docs/migrations/agentkit-chat.md";
9
9
  function resolveRemovedExportMigrationGuide(guide) {
@@ -84,6 +84,25 @@ function runGuard(name, root, config, migrationManifests, shellEnvironment = pro
84
84
  case "resource-action-access":
85
85
  return scanResourceActionAccess({ root });
86
86
  case "feature-dependencies": {
87
+ let packageJson;
88
+ const packageJsonPath = path.join(root, "package.json");
89
+ try {
90
+ packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
91
+ }
92
+ catch (error) {
93
+ if (error.code === "ENOENT") {
94
+ return { name, findings: [] };
95
+ }
96
+ throw new Error(`Could not read ${packageJsonPath}: ${error instanceof Error ? error.message : String(error)}`);
97
+ }
98
+ if (packageJson === null ||
99
+ typeof packageJson !== "object" ||
100
+ Array.isArray(packageJson)) {
101
+ throw new Error(`Invalid ${packageJsonPath}: expected a JSON object`);
102
+ }
103
+ if (!isDirectCoreDependency(packageJson)) {
104
+ return { name, findings: [] };
105
+ }
87
106
  const dependencies = selectMigrationDependencies(loadActiveMigrationDependencies(root, readCliCoreVersion(), migrationManifests), readUpgradeEnvironment(root, root, shellEnvironment));
88
107
  return {
89
108
  name,
package/dist/cli/index.js CHANGED
@@ -1059,6 +1059,7 @@ Options:
1059
1059
  --eager With workspace dev, start every app immediately
1060
1060
  --prewarm With workspace dev, warm non-default apps in the background
1061
1061
  --no-prewarm With workspace dev, keep non-default apps lazy
1062
+ --no-open With workspace dev, do not open a browser
1062
1063
  --url <url> URL to audit with audit-agent-web
1063
1064
 
1064
1065
  Feedback: ${FEEDBACK_URL}
@@ -113,6 +113,7 @@ export declare function isAgentNativePackageName(name: string): boolean;
113
113
  export declare function isPinnedOrLocalVersion(version: string): boolean;
114
114
  export declare function shouldBumpAgentNativeVersion(version: string): boolean;
115
115
  export declare function selectMigrationDependencies(dependencies: MigrationDependency[], environment: NodeJS.ProcessEnv): MigrationDependency[];
116
+ export declare function isDirectCoreDependency(pkg: PackageJsonLike): boolean;
116
117
  export declare function readUpgradeEnvironment(projectRoot: string, packageDir: string, shellEnvironment: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
117
118
  export declare function loadActiveMigrationDependencies(projectRoot: string, packageVersion: string | null, manifests?: import("../package-lifecycle/migration-manifest.js").MigrationManifest[]): MigrationDependency[];
118
119
  export declare function planMigrationDependencyAdditions(project: UpgradeProject, shellEnvironment?: NodeJS.ProcessEnv): UpgradeDependencyAddition[];
@@ -248,7 +248,7 @@ export function selectMigrationDependencies(dependencies, environment) {
248
248
  }
249
249
  return [...selected.values()];
250
250
  }
251
- function isDirectCoreDependency(pkg) {
251
+ export function isDirectCoreDependency(pkg) {
252
252
  return [pkg.dependencies, pkg.devDependencies, pkg.optionalDependencies].some((dependencies) => Boolean(dependencies?.["@agent-native/core"]));
253
253
  }
254
254
  function findWorkspaceEnvironmentRoot(packageDir, fallbackRoot) {
@@ -54,6 +54,7 @@ export declare function workspaceGatewayUrl(host: string, port: number): string;
54
54
  export declare function isWorkspaceWatcherLimitError(err: Pick<NodeJS.ErrnoException, "code">): boolean;
55
55
  export declare function shouldEagerStartWorkspaceApps(args?: string[], env?: NodeJS.ProcessEnv): boolean;
56
56
  export declare function shouldPrewarmWorkspaceApps(args?: string[], env?: NodeJS.ProcessEnv): boolean;
57
+ export declare function shouldOpenWorkspaceBrowser(args?: string[], env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform): boolean;
57
58
  export declare function workspacePrewarmConcurrency(args?: string[], env?: NodeJS.ProcessEnv): number;
58
59
  export declare function workspacePrewarmDelayMs(env?: NodeJS.ProcessEnv): number;
59
60
  export type PollingFileWatcherMode = "enable" | "disable-explicit" | "disable-default";
@@ -67,6 +67,30 @@ export function shouldPrewarmWorkspaceApps(args = [], env = process.env) {
67
67
  env.WORKSPACE_PREWARM === "1" ||
68
68
  env.WORKSPACE_PREWARM === "true");
69
69
  }
70
+ export function shouldOpenWorkspaceBrowser(args = [], env = process.env, platform = process.platform) {
71
+ if (args.includes("--no-open"))
72
+ return false;
73
+ if (env.WORKSPACE_NO_OPEN === "1" || env.AGENT_NATIVE_NO_OPEN === "1") {
74
+ return false;
75
+ }
76
+ if (env.CI === "1" || env.CI === "true")
77
+ return false;
78
+ if (env.BUILDER_IO_DEV_SERVER ||
79
+ env.BUILDER_PROJECT_ID ||
80
+ env.CODESPACES ||
81
+ env.GITPOD_WORKSPACE_ID ||
82
+ env.REMOTE_CONTAINERS ||
83
+ env.DEVCONTAINER) {
84
+ return false;
85
+ }
86
+ if (platform !== "darwin" &&
87
+ platform !== "win32" &&
88
+ !env.DISPLAY &&
89
+ !env.WAYLAND_DISPLAY) {
90
+ return false;
91
+ }
92
+ return true;
93
+ }
70
94
  export function workspacePrewarmConcurrency(args = [], env = process.env) {
71
95
  const flag = args.find((arg) => arg.startsWith("--prewarm-concurrency="));
72
96
  const raw = flag
@@ -1044,7 +1068,9 @@ export async function runWorkspaceDev(options = {}) {
1044
1068
  await Promise.all(Array.from({ length: workerCount }, () => worker()));
1045
1069
  }
1046
1070
  function openBrowser(url) {
1047
- if (options.openBrowser === false || env.WORKSPACE_NO_OPEN === "1")
1071
+ if (options.openBrowser === false)
1072
+ return;
1073
+ if (!shouldOpenWorkspaceBrowser(args, env))
1048
1074
  return;
1049
1075
  const command = process.platform === "darwin"
1050
1076
  ? "open"
@@ -1052,11 +1078,19 @@ export async function runWorkspaceDev(options = {}) {
1052
1078
  ? "cmd"
1053
1079
  : "xdg-open";
1054
1080
  const openArgs = process.platform === "win32" ? ["/c", "start", "", url] : [url];
1055
- const child = spawnProcess(command, openArgs, {
1056
- stdio: "ignore",
1057
- detached: true,
1058
- });
1059
- child.unref();
1081
+ const warn = (reason) => stderr.write(`[workspace] Could not auto-open browser (${reason}). Open ${url} manually.\n`);
1082
+ try {
1083
+ const child = spawnProcess(command, openArgs, {
1084
+ stdio: "ignore",
1085
+ detached: true,
1086
+ });
1087
+ // Without a listener, a missing opener (ENOENT) crashes the gateway.
1088
+ child.on("error", (err) => warn(err.code === "ENOENT" ? `${command} not installed` : err.message));
1089
+ child.unref();
1090
+ }
1091
+ catch (err) {
1092
+ warn(err instanceof Error ? err.message : String(err));
1093
+ }
1060
1094
  }
1061
1095
  const server = http.createServer(async (req, res) => {
1062
1096
  const parsedUrl = new URL(req.url || "/", "http://workspace.local");
@@ -35,20 +35,20 @@ declare const _default: import("../../action.js").ActionDefinition<{
35
35
  } | {
36
36
  error: string;
37
37
  url?: undefined;
38
- id?: undefined;
39
38
  provider?: undefined;
40
39
  configured?: undefined;
40
+ id?: undefined;
41
41
  } | {
42
42
  url: string;
43
43
  id: string;
44
44
  provider: string;
45
- error?: undefined;
46
45
  configured?: undefined;
46
+ error?: undefined;
47
47
  } | {
48
48
  url?: undefined;
49
- id?: undefined;
50
49
  provider?: undefined;
51
50
  error: string;
52
51
  configured: boolean;
52
+ id?: undefined;
53
53
  }>;
54
54
  export default _default;
@@ -27,38 +27,38 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
27
27
  thumbsUpRate: number;
28
28
  avgEvalScore: number;
29
29
  } | {
30
- id?: undefined;
31
- ok?: undefined;
32
30
  error: string;
33
31
  message: string;
34
32
  summary?: undefined;
35
33
  spans?: undefined;
36
- } | {
37
34
  id?: undefined;
38
- error?: undefined;
39
35
  ok?: undefined;
36
+ } | {
37
+ error?: undefined;
40
38
  message?: undefined;
41
39
  summary: import("./types.js").TraceSummary;
42
40
  spans: import("./types.js").TraceSpan[];
41
+ id?: undefined;
42
+ ok?: undefined;
43
43
  } | {
44
44
  error?: undefined;
45
- ok?: undefined;
46
45
  message?: undefined;
47
46
  summary?: undefined;
48
47
  spans?: undefined;
49
48
  id: string;
50
- } | {
51
- id?: undefined;
52
49
  ok?: undefined;
50
+ } | {
53
51
  message?: undefined;
54
52
  summary?: undefined;
55
53
  spans?: undefined;
54
+ id?: undefined;
56
55
  error: any;
56
+ ok?: undefined;
57
57
  } | {
58
- id?: undefined;
59
58
  error?: undefined;
60
59
  message?: undefined;
61
60
  summary?: undefined;
62
61
  spans?: undefined;
62
+ id?: undefined;
63
63
  ok: boolean;
64
64
  }>>;
@@ -2,6 +2,6 @@ export declare function createProgressHandler(): import("h3").EventHandlerWithFe
2
2
  error: string;
3
3
  ok?: undefined;
4
4
  } | {
5
- error?: undefined;
6
5
  ok: boolean;
6
+ error?: undefined;
7
7
  }>>;
@@ -39,8 +39,8 @@ export declare function handleUpdateResource(event: any): Promise<import("./stor
39
39
  error: string;
40
40
  }>;
41
41
  export declare function handleDeleteResource(event: any): Promise<{
42
- ok?: undefined;
43
42
  error: string;
43
+ ok?: undefined;
44
44
  } | {
45
45
  error?: undefined;
46
46
  ok: boolean;
@@ -65,8 +65,8 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
65
65
  error: any;
66
66
  code: any;
67
67
  } | {
68
- error?: undefined;
69
68
  errorCode?: undefined;
69
+ error?: undefined;
70
70
  code?: undefined;
71
71
  ok: boolean;
72
72
  key: string;
@@ -1,7 +1,7 @@
1
1
  export declare function createAgentEngineOllamaModelsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
2
2
  error: string;
3
- ok?: undefined;
4
3
  models?: undefined;
4
+ ok?: undefined;
5
5
  } | {
6
6
  ok: boolean;
7
7
  models: string[];
@@ -54,8 +54,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
54
54
  expiresAt?: undefined;
55
55
  ttlSeconds?: undefined;
56
56
  } | {
57
- error?: undefined;
58
57
  token: string;
59
58
  expiresAt: string;
60
59
  ttlSeconds: number;
60
+ error?: undefined;
61
61
  }>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.198.5",
3
+ "version": "0.198.7-nightly-20260930213124",
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": {
@@ -662,8 +662,8 @@
662
662
  "yaml": "^2.9.0",
663
663
  "yjs": "^13.6.33",
664
664
  "zod": "^4.3.6",
665
- "@agent-native/agentkit": "^0.198.5",
666
- "@agent-native/recap-cli": "^0.5.55"
665
+ "@agent-native/agentkit": "^0.198.7-nightly-20260930213124",
666
+ "@agent-native/recap-cli": "^0.5.56"
667
667
  },
668
668
  "devDependencies": {
669
669
  "@ai-sdk/anthropic": "^3.0.71",
@@ -734,7 +734,7 @@
734
734
  "xlsx": "^0.18.5"
735
735
  },
736
736
  "peerDependencies": {
737
- "@agent-native/core-corpus": ">=0.196.0",
737
+ "@agent-native/core-corpus": "0.198.7-nightly-20260930213124",
738
738
  "@ai-sdk/anthropic": ">=3",
739
739
  "@ai-sdk/cohere": ">=3",
740
740
  "@ai-sdk/google": ">=3",