@agent-native/core 0.40.0 → 0.40.2
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/dist/cli/skills.d.ts +1 -1
- package/dist/cli/skills.d.ts.map +1 -1
- package/dist/cli/skills.js +0 -1
- package/dist/cli/skills.js.map +1 -1
- package/dist/client/blocks/index.d.ts +0 -2
- package/dist/client/blocks/index.d.ts.map +1 -1
- package/dist/client/blocks/index.js +0 -2
- package/dist/client/blocks/index.js.map +1 -1
- package/dist/client/blocks/library/dev-doc-ui.d.ts +1 -2
- package/dist/client/blocks/library/dev-doc-ui.d.ts.map +1 -1
- package/dist/client/blocks/library/dev-doc-ui.js +1 -2
- package/dist/client/blocks/library/dev-doc-ui.js.map +1 -1
- package/dist/client/blocks/library/server-specs.d.ts.map +1 -1
- package/dist/client/blocks/library/server-specs.js +0 -10
- package/dist/client/blocks/library/server-specs.js.map +1 -1
- package/dist/client/blocks/library/specs.d.ts +1 -1
- package/dist/client/blocks/library/specs.d.ts.map +1 -1
- package/dist/client/blocks/library/specs.js +2 -28
- package/dist/client/blocks/library/specs.js.map +1 -1
- package/dist/client/blocks/server.d.ts +0 -1
- package/dist/client/blocks/server.d.ts.map +1 -1
- package/dist/client/blocks/server.js +0 -1
- package/dist/client/blocks/server.js.map +1 -1
- package/dist/client/blocks/types.d.ts +1 -1
- package/dist/client/blocks/types.js.map +1 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.d.ts.map +1 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.js +0 -1
- package/dist/client/rich-markdown-editor/registrySlashCommands.js.map +1 -1
- package/dist/deploy/build.js +68 -0
- package/dist/deploy/build.js.map +1 -1
- package/package.json +1 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts +0 -6
- package/dist/client/blocks/library/AnnotatedCodeBlock.d.ts.map +0 -1
- package/dist/client/blocks/library/AnnotatedCodeBlock.js +0 -135
- package/dist/client/blocks/library/AnnotatedCodeBlock.js.map +0 -1
- package/dist/client/blocks/library/annotated-code.config.d.ts +0 -58
- package/dist/client/blocks/library/annotated-code.config.d.ts.map +0 -1
- package/dist/client/blocks/library/annotated-code.config.js +0 -53
- package/dist/client/blocks/library/annotated-code.config.js.map +0 -1
|
@@ -17,7 +17,6 @@ const COMPACT_REGISTRY_BLOCK_DESCRIPTIONS = {
|
|
|
17
17
|
diff: "Code diff",
|
|
18
18
|
"file-tree": "File/change tree",
|
|
19
19
|
"json-explorer": "JSON tree",
|
|
20
|
-
"annotated-code": "Code walkthrough",
|
|
21
20
|
};
|
|
22
21
|
/**
|
|
23
22
|
* Compact, user-facing slash-menu copy for structured registry blocks. The full
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registrySlashCommands.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAEA,MAAM,mCAAmC,GAA2B;IAClE,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,gBAAgB;IACzB,SAAS,EAAE,eAAe;IAC1B,eAAe,EAAE,uBAAuB;IACxC,SAAS,EAAE,iBAAiB;IAC5B,KAAK,EAAE,eAAe;IACtB,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,sBAAsB;IACnC,aAAa,EAAE,gBAAgB;IAC/B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,sBAAsB;IAC/B,OAAO,EAAE,iBAAiB;IAC1B,cAAc,EAAE,eAAe;IAC/B,cAAc,EAAE,kBAAkB;IAClC,YAAY,EAAE,YAAY;IAC1B,IAAI,EAAE,WAAW;IACjB,WAAW,EAAE,kBAAkB;IAC/B,eAAe,EAAE,WAAW;
|
|
1
|
+
{"version":3,"file":"registrySlashCommands.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/registrySlashCommands.ts"],"names":[],"mappings":"AAEA,MAAM,mCAAmC,GAA2B;IAClE,OAAO,EAAE,iBAAiB;IAC1B,OAAO,EAAE,gBAA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C,IAAI,CAAC,IAAI,IAAI,CAAC;SACrD,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,oBAAoB,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;SACrE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACZ,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CACpE,CAAC;AACN,CAAC","sourcesContent":["import type { BlockRegistry, BlockSpec } from \"../blocks/index.js\";\n\nconst COMPACT_REGISTRY_BLOCK_DESCRIPTIONS: Record<string, string> = {\n callout: \"Emphasized note\",\n diagram: \"Inline diagram\",\n wireframe: \"Screen mockup\",\n \"question-form\": \"Interactive questions\",\n checklist: \"Checklist items\",\n table: \"Editable grid\",\n \"table-block\": \"Editable grid\",\n \"code-tabs\": \"Tabbed code snippets\",\n \"custom-html\": \"Sandboxed HTML\",\n tabs: \"Tabbed block group\",\n columns: \"Side-by-side columns\",\n mermaid: \"Mermaid diagram\",\n \"api-endpoint\": \"API reference\",\n \"openapi-spec\": \"OpenAPI document\",\n \"data-model\": \"ERD schema\",\n diff: \"Code diff\",\n \"file-tree\": \"File/change tree\",\n \"json-explorer\": \"JSON tree\",\n};\n\n/**\n * Compact, user-facing slash-menu copy for structured registry blocks. The full\n * registry description remains available through search text, but the visible\n * row should scan like a command palette, not a block reference page.\n */\nexport function getRegistryBlockSlashDescription(\n spec: Pick<BlockSpec, \"type\" | \"description\">,\n): string {\n return (\n COMPACT_REGISTRY_BLOCK_DESCRIPTIONS[spec.type] ??\n spec.description.trim().replace(/\\s+/g, \" \")\n );\n}\n\n/** Searchable text for registry block slash items, including raw type keywords. */\nexport function getRegistryBlockSlashSearchText(\n spec: Pick<BlockSpec, \"type\" | \"label\" | \"description\">,\n): string {\n return [spec.label, spec.description, spec.type]\n .filter(Boolean)\n .join(\" \")\n .toLowerCase();\n}\n\n/**\n * Shared builder for the registry-derived block slash commands both the plan and\n * content editors offer. Both apps take every `BlockSpec` whose `placement`\n * includes `\"block\"`, gate it by Notion-compatibility when the open document is\n * linked to a Notion page, and emit one slash item per surviving spec that\n * inserts that block's atom node. The only legitimate per-app differences are:\n *\n * - the ITEM SHAPE (plan uses a text-glyph `icon`, content a React component),\n * - the Notion-compat PREDICATE (plan unions in prose-only NFM analogs, content\n * reads the registry `notionCompatible` flag directly), and\n * - the INSERT behavior (plan inserts a `planBlock` node, content a\n * `registryBlock` node seeded with inline `__raw`).\n *\n * Those three are injected; everything else (the `list(\"block\")` source, the\n * Notion filter wiring, the one-item-per-spec mapping) lives here so adding a\n * new library block only touches the registry, never the slash builders.\n */\nexport interface BuildRegistryBlockSlashItemsOptions<TItem, TEditor> {\n /**\n * When `true`, only specs the predicate accepts are offered (the open document\n * is linked to a Notion page, so blocks that can't round-trip to NFM are\n * hidden). When unset/false, every block-placed spec is offered.\n */\n notionCompatibleOnly?: boolean;\n /**\n * Decide whether a spec round-trips to Notion. Defaults to the spec's own\n * `notionCompatible` flag (content's rule). Plan passes a predicate that unions\n * in prose-only NFM analogs not carried as registry flags.\n */\n isNotionCompatible?: (spec: BlockSpec) => boolean;\n /** Build one app-shaped slash item from a surviving block spec. */\n toItem: (spec: BlockSpec, insert: (editor: TEditor) => void) => TItem;\n /**\n * Optional app-level capability gate. Use this for blocks whose schema is\n * registered for parse/render compatibility but whose authoring experience is\n * not available in this editor yet.\n */\n includeSpec?: (spec: BlockSpec) => boolean;\n /**\n * Insert this spec's block atom into the editor. Plan inserts a `planBlock`\n * node; content inserts a `registryBlock` node seeded with inline `__raw`.\n */\n insertBlock: (editor: TEditor, spec: BlockSpec) => void;\n}\n\n/**\n * Build the registry-derived block slash items, shared by plan and content. Each\n * app prepends its own prose/base commands and wraps the result in its own item\n * type via {@link BuildRegistryBlockSlashItemsOptions.toItem}.\n */\nexport function buildRegistryBlockSlashItems<TItem, TEditor>(\n registry: BlockRegistry,\n options: BuildRegistryBlockSlashItemsOptions<TItem, TEditor>,\n): TItem[] {\n const isCompatible =\n options.isNotionCompatible ?? ((spec) => Boolean(spec.notionCompatible));\n return registry\n .list(\"block\")\n .filter((spec) => options.includeSpec?.(spec) ?? true)\n .filter((spec) => !options.notionCompatibleOnly || isCompatible(spec))\n .map((spec) =>\n options.toItem(spec, (editor) => options.insertBlock(editor, spec)),\n );\n}\n"]}
|
package/dist/deploy/build.js
CHANGED
|
@@ -1428,6 +1428,65 @@ export async function runNitroBuildPipeline(opts) {
|
|
|
1428
1428
|
}
|
|
1429
1429
|
await hooks.nitroBuild(nitro);
|
|
1430
1430
|
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Browser-only diagram/drawing renderers that execute `window`-touching code at
|
|
1433
|
+
* module-evaluation time. They are rendered exclusively client-side — core's
|
|
1434
|
+
* `MermaidBlock` and templates' Excalidraw slides mount them inside `useEffect` /
|
|
1435
|
+
* `React.lazy`, never during SSR — so the server never needs the real module.
|
|
1436
|
+
*
|
|
1437
|
+
* Keep this list to libraries that are *provably never* invoked on the server.
|
|
1438
|
+
* Node-only deps that DO run server-side (pdf-parse, @google/genai, canvas, …)
|
|
1439
|
+
* must NOT go here — see `heavyClientExternals` for the edge-worker externals.
|
|
1440
|
+
*/
|
|
1441
|
+
const BROWSER_ONLY_SERVER_LIBS = [
|
|
1442
|
+
"@excalidraw/excalidraw",
|
|
1443
|
+
"@excalidraw/mermaid-to-excalidraw",
|
|
1444
|
+
"mermaid",
|
|
1445
|
+
];
|
|
1446
|
+
/**
|
|
1447
|
+
* Rolldown plugin for the Nitro server bundle that replaces the browser-only
|
|
1448
|
+
* renderers above with an inert proxy module.
|
|
1449
|
+
*
|
|
1450
|
+
* Why this is needed: Nitro re-bundles the server from node_modules with its own
|
|
1451
|
+
* Rolldown pipeline, and Rolldown merges Excalidraw into a SHARED vendor chunk
|
|
1452
|
+
* that the SSR render path (tiptap / radix-ui / recharts) imports *statically*.
|
|
1453
|
+
* That evaluates Excalidraw's top-level `window` access at function cold-start
|
|
1454
|
+
* and crashes every request with `ReferenceError: window is not defined` (HTTP
|
|
1455
|
+
* 502). The Vite SSR build already stubs these via `ssrStubPlugin` for
|
|
1456
|
+
* `build/server`, but that Vite plugin doesn't run during Nitro's separate
|
|
1457
|
+
* bundle — so mirror the same stub here.
|
|
1458
|
+
*/
|
|
1459
|
+
function createBrowserOnlyServerStubPlugin() {
|
|
1460
|
+
const stubbed = new Set(BROWSER_ONLY_SERVER_LIBS);
|
|
1461
|
+
const STUB_ID = "\0agent-native-browser-only-server-stub";
|
|
1462
|
+
return {
|
|
1463
|
+
name: "agent-native-browser-only-server-stub",
|
|
1464
|
+
// enforce: "pre" so we intercept before Nitro's node resolver bundles the
|
|
1465
|
+
// real package. defu concatenates rollupConfig.plugins ahead of Nitro's own.
|
|
1466
|
+
resolveId(id) {
|
|
1467
|
+
// Match the bare package name or any subpath (incl. `/index.css`).
|
|
1468
|
+
const pkg = id
|
|
1469
|
+
.split("/")
|
|
1470
|
+
.slice(0, id.startsWith("@") ? 2 : 1)
|
|
1471
|
+
.join("/");
|
|
1472
|
+
return stubbed.has(pkg) ? STUB_ID : null;
|
|
1473
|
+
},
|
|
1474
|
+
load(id) {
|
|
1475
|
+
if (id !== STUB_ID)
|
|
1476
|
+
return null;
|
|
1477
|
+
// A Proxy answers any property access (default or named) with another
|
|
1478
|
+
// proxy, so every import shape resolves without evaluating real browser
|
|
1479
|
+
// code. It is never actually invoked on the server, so it never throws.
|
|
1480
|
+
return ("const handler = { get(_t, p) {" +
|
|
1481
|
+
" if (p === Symbol.toPrimitive) return () => '';" +
|
|
1482
|
+
" if (p === 'then') return undefined;" +
|
|
1483
|
+
" if (p === '__esModule') return true;" +
|
|
1484
|
+
" return new Proxy(function () {}, handler); } };" +
|
|
1485
|
+
"const stub = new Proxy(function () {}, handler);" +
|
|
1486
|
+
"export default stub;");
|
|
1487
|
+
},
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1431
1490
|
async function buildWithNitro() {
|
|
1432
1491
|
console.log(`[deploy] Building for preset "${preset}" via Nitro...`);
|
|
1433
1492
|
const appBasePath = normalizeConfiguredAppBasePath();
|
|
@@ -1508,6 +1567,15 @@ export default bundle;
|
|
|
1508
1567
|
virtual: {
|
|
1509
1568
|
"virtual:agents-bundle": agentsBundleModuleSource,
|
|
1510
1569
|
},
|
|
1570
|
+
// Replace browser-only renderers (Excalidraw/Mermaid) with an inert proxy in
|
|
1571
|
+
// the server bundle. Without this, Nitro's Rolldown build pulls the real
|
|
1572
|
+
// Excalidraw into a shared vendor chunk imported statically by the SSR render
|
|
1573
|
+
// path, and its top-level `window` access crashes the function at cold-start
|
|
1574
|
+
// (ReferenceError: window is not defined → every request 502s). Mirrors the
|
|
1575
|
+
// Vite `ssrStubPlugin`, which only covers the `build/server` step.
|
|
1576
|
+
rollupConfig: {
|
|
1577
|
+
plugins: [createBrowserOnlyServerStubPlugin()],
|
|
1578
|
+
},
|
|
1511
1579
|
...(providedPluginsNitroPlugin
|
|
1512
1580
|
? { plugins: [providedPluginsNitroPlugin] }
|
|
1513
1581
|
: {}),
|