@agent-native/core 0.101.3 → 0.101.5
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.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +14 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/action.ts +15 -0
- package/corpus/core/src/agent/production-agent.ts +215 -19
- package/corpus/core/src/client/RunStuckBanner.tsx +12 -5
- package/corpus/core/src/client/sse-event-processor.ts +36 -1
- package/corpus/core/src/client/use-run-stuck-detection.ts +162 -25
- package/corpus/core/src/coding-tools/run-code.ts +11 -5
- package/corpus/core/src/deploy/build.ts +78 -25
- package/corpus/core/src/extensions/actions.ts +15 -0
- package/corpus/core/src/extensions/url-safety.ts +11 -1
- package/corpus/core/src/notifications/channels.ts +61 -30
- package/corpus/core/src/server/action-discovery.ts +4 -1
- package/corpus/core/src/server/agent-chat/context-tools.ts +4 -0
- package/corpus/templates/chat/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +6 -0
- package/corpus/templates/clips/app/components/player/media-duration.ts +24 -0
- package/corpus/templates/clips/app/components/player/video-player.tsx +9 -18
- package/corpus/templates/clips/changelog/2026-07-14-paused-time-no-longer-counts-toward-chrome-extension-recordi.md +6 -0
- package/corpus/templates/clips/chrome-extension/src/offscreen.ts +30 -4
- package/corpus/templates/clips/chrome-extension/src/recording-duration.ts +32 -0
- package/corpus/templates/slides/actions/_uploaded-files.ts +13 -2
- package/corpus/templates/slides/actions/import-docx.ts +3 -9
- package/corpus/templates/slides/actions/import-file.ts +11 -14
- package/corpus/templates/slides/actions/import-pptx.ts +3 -9
- package/corpus/templates/slides/changelog/2026-07-14-powerpoint-template-uploads-now-work-in-hosted-slides-deploy.md +6 -0
- package/corpus/templates/slides/server/handlers/uploads.ts +100 -50
- package/corpus/templates/slides/server/lib/tenant-files.ts +38 -11
- package/corpus/templates/slides/server/lib/uploaded-reference-storage.ts +108 -0
- package/dist/action.d.ts +12 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js +2 -0
- package/dist/action.js.map +1 -1
- package/dist/agent/production-agent.d.ts +24 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +175 -18
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +9 -5
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +33 -1
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts +4 -4
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +104 -19
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/coding-tools/run-code.d.ts +5 -2
- package/dist/coding-tools/run-code.d.ts.map +1 -1
- package/dist/coding-tools/run-code.js +11 -5
- package/dist/coding-tools/run-code.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts +15 -14
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +64 -23
- package/dist/deploy/build.js.map +1 -1
- package/dist/extensions/actions.d.ts.map +1 -1
- package/dist/extensions/actions.js +14 -0
- package/dist/extensions/actions.js.map +1 -1
- package/dist/extensions/url-safety.d.ts +6 -0
- package/dist/extensions/url-safety.d.ts.map +1 -1
- package/dist/extensions/url-safety.js +6 -0
- package/dist/extensions/url-safety.js.map +1 -1
- package/dist/notifications/channels.d.ts.map +1 -1
- package/dist/notifications/channels.js +38 -22
- package/dist/notifications/channels.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/observability/routes.d.ts +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +4 -1
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +4 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/package.json +3 -3
package/dist/deploy/build.js
CHANGED
|
@@ -2101,15 +2101,15 @@ function walkServerJavaScriptFiles(dir, onFile) {
|
|
|
2101
2101
|
}
|
|
2102
2102
|
}
|
|
2103
2103
|
/**
|
|
2104
|
-
* Nitro
|
|
2105
|
-
*
|
|
2106
|
-
*
|
|
2107
|
-
*
|
|
2104
|
+
* Nitro receives the React Router SSR build as prebuilt chunks, so its normal
|
|
2105
|
+
* dependency resolver cannot reliably fold the preserved bare `yjs` imports
|
|
2106
|
+
* into the same module instance used by core's server collaboration code.
|
|
2107
|
+
* Keep Yjs external through Nitro, bundle its complete public ESM surface once,
|
|
2108
|
+
* then point every emitted server chunk at that one portable runtime module.
|
|
2108
2109
|
*/
|
|
2109
|
-
export function
|
|
2110
|
+
export function bundleYjsRuntimeForServerlessOutput(serverDir, projectCwd) {
|
|
2110
2111
|
const bareImports = [];
|
|
2111
2112
|
const unsupportedSubpathImports = [];
|
|
2112
|
-
const bundledYjsPath = path.join(serverDir, "_libs", "yjs.mjs");
|
|
2113
2113
|
walkServerJavaScriptFiles(serverDir, (filePath) => {
|
|
2114
2114
|
const source = fs.readFileSync(filePath, "utf-8");
|
|
2115
2115
|
if (!hasBareYjsRuntimeImport(source))
|
|
@@ -2125,9 +2125,17 @@ export function rewriteBareYjsImportsForServerlessOutput(serverDir) {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
if (bareImports.length === 0)
|
|
2127
2127
|
return [];
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2128
|
+
const bundledYjsPath = path.join(serverDir, "_libs", "yjs-runtime.mjs");
|
|
2129
|
+
fs.mkdirSync(path.dirname(bundledYjsPath), { recursive: true });
|
|
2130
|
+
execFileSync(findEsbuild(), [
|
|
2131
|
+
resolveNitroBundledYjsEntry(),
|
|
2132
|
+
"--bundle",
|
|
2133
|
+
"--format=esm",
|
|
2134
|
+
"--platform=node",
|
|
2135
|
+
"--target=node22",
|
|
2136
|
+
"--minify",
|
|
2137
|
+
`--outfile=${bundledYjsPath}`,
|
|
2138
|
+
], { cwd: projectCwd, stdio: "pipe" });
|
|
2131
2139
|
for (const filePath of bareImports) {
|
|
2132
2140
|
const bundledImport = path
|
|
2133
2141
|
.relative(path.dirname(filePath), bundledYjsPath)
|
|
@@ -2217,6 +2225,19 @@ export function assertSingleTemplateNetlifyBuildOutput(projectCwd) {
|
|
|
2217
2225
|
if (bareYjsImports.length > 0) {
|
|
2218
2226
|
failures.push(`Netlify server bundle leaves yjs as a runtime import: ${bareYjsImports.join(", ")}`);
|
|
2219
2227
|
}
|
|
2228
|
+
// Nitro's `_libs/yjs.mjs` is a private tree-shaken chunk, not a package
|
|
2229
|
+
// facade. Repointing a prebuilt SSR chunk at it can request public exports
|
|
2230
|
+
// (notably `Text`) that the private chunk did not retain. The controlled
|
|
2231
|
+
// serverless pass must instead target the complete `yjs-runtime.mjs` bundle.
|
|
2232
|
+
const privateYjsImports = [];
|
|
2233
|
+
walkServerJavaScriptFiles(serverDir, (filePath) => {
|
|
2234
|
+
if (/\b(?:from\s*|import\s*\(\s*|import\s*)(["'])[^"']*_libs\/yjs\.mjs\1/.test(fs.readFileSync(filePath, "utf-8"))) {
|
|
2235
|
+
privateYjsImports.push(path.relative(projectCwd, filePath));
|
|
2236
|
+
}
|
|
2237
|
+
});
|
|
2238
|
+
if (privateYjsImports.length > 0) {
|
|
2239
|
+
failures.push(`Netlify server bundle imports Nitro's internal tree-shaken _libs/yjs.mjs: ${privateYjsImports.join(", ")}`);
|
|
2240
|
+
}
|
|
2220
2241
|
if (isDurableBackgroundDeployEnabled()) {
|
|
2221
2242
|
const backgroundDir = path.join(internalDir, AGENT_BACKGROUND_FUNCTION_NAME);
|
|
2222
2243
|
const backgroundEntryPath = path.join(backgroundDir, `${AGENT_BACKGROUND_FUNCTION_NAME}.mjs`);
|
|
@@ -2567,17 +2588,25 @@ const BROWSER_ONLY_SERVER_LIBS = [
|
|
|
2567
2588
|
"mermaid",
|
|
2568
2589
|
];
|
|
2569
2590
|
/**
|
|
2570
|
-
* Dependencies
|
|
2571
|
-
*
|
|
2572
|
-
*
|
|
2573
|
-
* `yjs` is a direct core dependency, but it is deliberately externalized from
|
|
2574
|
-
* the intermediate Vite SSR graph so that Vite and Nitro do not create two
|
|
2575
|
-
* incompatible Yjs constructors. On file-traced serverless presets, leaving it
|
|
2576
|
-
* external at Nitro's final build can emit `import "yjs"` into a function
|
|
2577
|
-
* chunk without placing the package in that function's `node_modules`. Bundle
|
|
2578
|
-
* it in Nitro's final output so every template receives the one portable copy.
|
|
2591
|
+
* Dependencies Nitro itself must bundle outside the controlled serverless
|
|
2592
|
+
* output pass. Netlify, Vercel, and Lambda keep Yjs external through Nitro;
|
|
2593
|
+
* `bundleYjsRuntimeForServerlessOutput` then creates their one portable copy.
|
|
2579
2594
|
*/
|
|
2580
2595
|
export const NITRO_SERVER_RUNTIME_BUNDLED_DEPS = ["yjs"];
|
|
2596
|
+
/**
|
|
2597
|
+
* Locate the core-owned ESM entry used by the controlled serverless bundling
|
|
2598
|
+
* pass. Resolving from this module keeps the build independent of whether a
|
|
2599
|
+
* template exposes core's transitive Yjs dependency at its own package root.
|
|
2600
|
+
*/
|
|
2601
|
+
export function resolveNitroBundledYjsEntry() {
|
|
2602
|
+
const requireFromCore = createRequire(import.meta.url);
|
|
2603
|
+
const packageDir = path.dirname(requireFromCore.resolve("yjs/package.json"));
|
|
2604
|
+
const entry = path.join(packageDir, "dist", "yjs.mjs");
|
|
2605
|
+
if (!fs.existsSync(entry)) {
|
|
2606
|
+
throw new Error(`[build] Could not resolve the Yjs ESM entry at ${entry}`);
|
|
2607
|
+
}
|
|
2608
|
+
return entry;
|
|
2609
|
+
}
|
|
2581
2610
|
/**
|
|
2582
2611
|
* Edge runtimes have no node_modules, while Node/serverless outputs only need
|
|
2583
2612
|
* the small set above bundled to keep their package manifests traceable.
|
|
@@ -2586,7 +2615,11 @@ export function nitroNoExternalsForPreset(targetPreset) {
|
|
|
2586
2615
|
return targetPreset.startsWith("cloudflare") ||
|
|
2587
2616
|
targetPreset.startsWith("deno")
|
|
2588
2617
|
? true
|
|
2589
|
-
:
|
|
2618
|
+
: targetPreset === "netlify" ||
|
|
2619
|
+
targetPreset === "vercel" ||
|
|
2620
|
+
targetPreset === "aws-lambda"
|
|
2621
|
+
? []
|
|
2622
|
+
: NITRO_SERVER_RUNTIME_BUNDLED_DEPS;
|
|
2590
2623
|
}
|
|
2591
2624
|
/**
|
|
2592
2625
|
* Rolldown plugin for the Nitro server bundle that replaces the browser-only
|
|
@@ -2722,6 +2755,14 @@ export default bundle;
|
|
|
2722
2755
|
// (ReferenceError: window is not defined → every request 502s). Mirrors the
|
|
2723
2756
|
// Vite `ssrStubPlugin`, which only covers the `build/server` step.
|
|
2724
2757
|
rollupConfig: {
|
|
2758
|
+
// Nitro treats the intermediate React Router SSR files as prebuilt
|
|
2759
|
+
// chunks, while core's server collaboration files participate in the
|
|
2760
|
+
// final Rolldown graph. Externalize Yjs consistently on serverless so
|
|
2761
|
+
// both graphs retain their public import shapes; the controlled
|
|
2762
|
+
// post-build pass below bundles and rewrites them to one module.
|
|
2763
|
+
...(preset === "netlify" || preset === "vercel" || preset === "aws-lambda"
|
|
2764
|
+
? { external: ["yjs"] }
|
|
2765
|
+
: {}),
|
|
2725
2766
|
plugins: [createBrowserOnlyServerStubPlugin()],
|
|
2726
2767
|
},
|
|
2727
2768
|
...(providedPluginsNitroPlugin
|
|
@@ -2729,9 +2770,9 @@ export default bundle;
|
|
|
2729
2770
|
: {}),
|
|
2730
2771
|
routeRules: mcpEmbedStaticAssetRouteRules(appBasePath),
|
|
2731
2772
|
// Edge presets (cloudflare, deno) bundle all deps because node_modules are
|
|
2732
|
-
// unavailable at runtime. Node
|
|
2733
|
-
//
|
|
2734
|
-
//
|
|
2773
|
+
// unavailable at runtime. Ordinary Node presets bundle Yjs through Nitro.
|
|
2774
|
+
// Controlled serverless presets externalize it above, then emit one full
|
|
2775
|
+
// runtime module after Nitro has preserved every consumer's public imports.
|
|
2735
2776
|
noExternals: nitroNoExternalsForPreset(preset),
|
|
2736
2777
|
});
|
|
2737
2778
|
await runNitroBuildPipeline({
|
|
@@ -2747,7 +2788,7 @@ export default bundle;
|
|
|
2747
2788
|
copyInstalledResvgPackages(nitro.options.output.serverDir);
|
|
2748
2789
|
copyInstalledFfmpegStaticPackage(nitro.options.output.serverDir);
|
|
2749
2790
|
sanitizeServerlessFunctionPackageManifest(nitro.options.output.serverDir);
|
|
2750
|
-
|
|
2791
|
+
bundleYjsRuntimeForServerlessOutput(nitro.options.output.serverDir, cwd);
|
|
2751
2792
|
}
|
|
2752
2793
|
// Durable background agent runs (default-OFF / opt-in; enable with a truthy
|
|
2753
2794
|
// AGENT_CHAT_DURABLE_BACKGROUND). Additive ONLY: emits a SECOND Netlify
|