@agent-native/core 0.77.11 → 0.77.12

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.
@@ -16,19 +16,7 @@ const STANDALONE_EXACT_DEPENDENCY_OVERRIDES = {
16
16
  "@react-router/fs-routes": "8.0.1",
17
17
  "react-router": "8.0.1",
18
18
  };
19
- const SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = [
20
- '"@sentry/browser"',
21
- '"@sentry/browser-utils"',
22
- '"@sentry/conventions"',
23
- '"@sentry/core"',
24
- '"@sentry/feedback"',
25
- '"@sentry/node"',
26
- '"@sentry/node-core"',
27
- '"@sentry/opentelemetry"',
28
- '"@sentry/replay"',
29
- '"@sentry/replay-canvas"',
30
- '"@sentry/server-utils"',
31
- ];
19
+ const SENTRY_MINIMUM_RELEASE_AGE_EXCLUDES = ['"@sentry/*"'];
32
20
  const FIRST_PARTY_TARBALL_SYMLINK_EXCLUDES = [
33
21
  "*/CLAUDE.md",
34
22
  "*/.claude/skills",
@@ -792,6 +780,7 @@ function postProcessStandalone(name, targetDir, templateName) {
792
780
  const appTitle = appTitleForScaffold(name);
793
781
  replacePlaceholders(targetDir, name, appTitle);
794
782
  rewriteTrackingAppId(targetDir, name, templateName);
783
+ rewriteAgentChatAppId(targetDir, name, templateName);
795
784
  fixPackageJsonName(targetDir, name, templateName);
796
785
  fixWebManifestName(targetDir, name, templateName);
797
786
  rewriteNetlifyToml(targetDir, name, "standalone");
@@ -885,8 +874,37 @@ function postProcessStandalone(name, targetDir, templateName) {
885
874
  }
886
875
  }
887
876
  catch { }
877
+ fixStandaloneTsconfig(targetDir, templateName);
888
878
  setupAgentSymlinks(targetDir);
889
879
  }
880
+ function fixStandaloneTsconfig(targetDir, templateName) {
881
+ const tsconfigPath = path.join(targetDir, "tsconfig.json");
882
+ if (!fs.existsSync(tsconfigPath))
883
+ return;
884
+ try {
885
+ const tsconfig = JSON.parse(fs.readFileSync(tsconfigPath, "utf-8"));
886
+ tsconfig.compilerOptions ??= {};
887
+ const hasUiApp = templateName !== "headless" && fs.existsSync(path.join(targetDir, "app"));
888
+ const paths = {
889
+ ...(tsconfig.compilerOptions.paths ?? {}),
890
+ };
891
+ paths["*"] ??= ["./*"];
892
+ if (hasUiApp) {
893
+ paths["@/*"] ??= ["./app/*"];
894
+ paths["@shared/*"] ??= ["./shared/*"];
895
+ // Child baseUrl anchors @/* for apps extending legacy core tsconfig bases
896
+ // that still ship baseUrl. Headless scaffolds omit it so raw tsgo --noEmit
897
+ // keeps working under TS 6.
898
+ tsconfig.compilerOptions.baseUrl = ".";
899
+ }
900
+ else {
901
+ delete tsconfig.compilerOptions.baseUrl;
902
+ }
903
+ tsconfig.compilerOptions.paths = paths;
904
+ fs.writeFileSync(tsconfigPath, `${JSON.stringify(tsconfig, null, 2)}\n`);
905
+ }
906
+ catch { }
907
+ }
890
908
  /* ─────────────────────────────────────────────────────────────────────────
891
909
  * Prompting helpers
892
910
  * ───────────────────────────────────────────────────────────────────────── */
@@ -1396,7 +1414,7 @@ function rewriteNetlifyToml(appDir, appName, mode) {
1396
1414
  return;
1397
1415
  try {
1398
1416
  let content = fs.readFileSync(netlifyPath, "utf-8");
1399
- const originalCommand = content.match(/^ command = "([^"]*)"$/m)?.[1];
1417
+ const originalCommand = content.match(/^\s*command = "([^"]*)"$/m)?.[1];
1400
1418
  const usesUnpooledDatabase = originalCommand?.includes("NETLIFY_DATABASE_URL_UNPOOLED") ?? false;
1401
1419
  const buildCommand = mode === "workspace"
1402
1420
  ? `APP_BASE_PATH=/${appName} VITE_APP_BASE_PATH=/${appName} NITRO_PRESET=netlify pnpm --filter ${appName} build`
@@ -1411,7 +1429,7 @@ function rewriteNetlifyToml(appDir, appName, mode) {
1411
1429
  ? `apps/${appName}/.netlify/functions-internal`
1412
1430
  : ".netlify/functions-internal";
1413
1431
  content = content
1414
- .replace(/^ command = ".*"$/m, ` command = "${command}"`)
1432
+ .replace(/^(\s*)command = ".*"$/m, `$1command = "${command}"`)
1415
1433
  .replace(/publish = "templates\/[^"]+\/dist"/g, `publish = "${publishPath}"`)
1416
1434
  .replace(/functions = "templates\/[^"]+\/\.netlify\/functions-internal"/g, `functions = "${functionsPath}"`)
1417
1435
  // Strip the `ignore` script line: it references a monorepo script path
@@ -1425,6 +1443,26 @@ function rewriteNetlifyToml(appDir, appName, mode) {
1425
1443
  }
1426
1444
  catch { }
1427
1445
  }
1446
+ function rewriteAgentChatAppId(appDir, appName, templateName) {
1447
+ const pluginPath = path.join(appDir, "server", "plugins", "agent-chat.ts");
1448
+ if (!fs.existsSync(pluginPath))
1449
+ return;
1450
+ try {
1451
+ const content = fs.readFileSync(pluginPath, "utf-8");
1452
+ const sourceAppIds = ["chat", "starter"];
1453
+ if (templateName && templateName !== appName) {
1454
+ sourceAppIds.push(templateName);
1455
+ }
1456
+ const pattern = new RegExp(`(appId:\\s*)(["'])(${sourceAppIds.map(escapeRegExp).join("|")})\\2`);
1457
+ if (!pattern.test(content))
1458
+ return;
1459
+ const next = content.replace(pattern, (_match, prefix, quote) => `${prefix}${quote}${appName}${quote}`);
1460
+ if (next !== content) {
1461
+ fs.writeFileSync(pluginPath, next);
1462
+ }
1463
+ }
1464
+ catch { }
1465
+ }
1428
1466
  function rewriteTrackingAppId(appDir, appName, templateName) {
1429
1467
  const rootPath = path.join(appDir, "app", "root.tsx");
1430
1468
  if (!fs.existsSync(rootPath))