@agent-native/core 0.123.1 → 0.123.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/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +8 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/deploy/build.ts +8 -0
- package/corpus/core/src/server/builder-browser.ts +76 -0
- package/corpus/core/src/server/core-routes-plugin.ts +15 -5
- package/corpus/templates/assets/app/global.css +0 -4
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +195 -167
- package/corpus/templates/assets/changelog/2026-07-23-drafts-preview-panel-now-fills-the-full-width-with-a-large-p.md +6 -0
- package/corpus/templates/content/actions/_builder-cms-source-adapter.ts +1 -0
- package/corpus/templates/content/actions/_builder-cms-write-client.ts +55 -9
- package/corpus/templates/content/actions/_database-source-utils.ts +756 -182
- package/corpus/templates/content/actions/change-content-database-source-role.ts +21 -20
- package/corpus/templates/content/actions/execute-builder-source-execution.ts +49 -8
- package/corpus/templates/content/actions/materialize-builder-required-fields.ts +42 -9
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +88 -90
- package/corpus/templates/content/actions/preview-builder-source-review.ts +4 -3
- package/corpus/templates/content/actions/refresh-content-database-source.ts +36 -9
- package/corpus/templates/content/actions/set-content-database-source-write-mode.ts +28 -24
- package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +62 -12
- package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +91 -16
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +15 -1
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +234 -44
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +194 -16
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +95 -42
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +4 -2
- package/corpus/templates/content/app/components/editor/extensions/CodeBlockNode.tsx +10 -166
- package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +32 -8
- package/corpus/templates/content/app/components/editor/extensions/VideoNode.ts +14 -0
- package/corpus/templates/content/app/components/editor/registrySlashItems.ts +5 -1
- package/corpus/templates/content/app/hooks/use-content-database.ts +59 -2
- package/corpus/templates/content/app/hooks/use-documents.ts +18 -26
- package/corpus/templates/content/app/root.tsx +1 -6
- package/corpus/templates/content/changelog/2026-07-24-builder-can-now-publish-approved-updates-to-entries-that-are.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-collection-loading-no-longer-restarts-from-the-begin.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-connections-now-complete-securely-from-netlify-deplo.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-draft-creation-now-scopes-execution-to-the-selected-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-review-now-distinguishes-preparing-a-safe-dry-run-from.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-source-imports-now-recover-from-a-transient-paginati.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-source-refresh-now-preserves-the-provider-bound-fiel.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-update-reviews-now-open-reliably-on-large-collection.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-builder-write-policy-controls-now-reflect-successful-changes.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-date-properties-now-save-reliably-when-selected-with-the-nat.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-editor-slash-search-now-keeps-multi-word-block-names-open.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-exact-editor-slash-commands-now-execute-on-enter-even-if-the.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-new-collaborative-pages-now-save-their-first-edits.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-new-local-builder-rows-no-longer-remain-locked-behind-a-none.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-opening-or-closing-a-collaborative-document-no-longer-lets-u.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-selected-text-now-opens-the-link-editor-with-command-k-or-co.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-slash-menu-block-choices-no-longer-stall-pointer-interaction.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-uploaded-and-embedded-media-now-stay-intact-while-collaborative-document-drafts-save.md +6 -0
- package/corpus/templates/content/changelog/2026-07-24-video-link-insertion-now-keeps-its-source-panel-open-while-t.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-builder-publishing-now-shows-safe-validation-details-instead.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-builder-reviews-stay-responsive-on-large-collections-and-pre.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-collaborative-documents-no-longer-flash-duplicated-recent-bl.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-corrected-builder-updates-are-now-reviewed-separately-from-f.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-documents-now-remain-read-only-until-their-live-collaborativ.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-slash-command-menus-now-stay-reachable-when-editing-near-the.md +6 -0
- package/corpus/templates/content/changelog/2026-07-26-the-slash-menu-now-shows-one-clear-callout-choice-instead-of.md +6 -0
- package/corpus/templates/content/shared/api.ts +1 -0
- package/corpus/templates/content/shared/builder-mdx.ts +73 -16
- package/corpus/toolkit/CHANGELOG.md +6 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/editor/useCollabReconcile.ts +14 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/deploy/build.js +6 -0
- package/dist/deploy/build.js.map +1 -1
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/server/builder-browser.d.ts +13 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +59 -0
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +10 -5
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/package.json +2 -2
- package/src/deploy/build.ts +8 -0
- package/src/server/builder-browser.ts +76 -0
- package/src/server/core-routes-plugin.ts +15 -5
|
@@ -1872,19 +1872,75 @@ function freshTextHtmlBlock(text: string, stableSource: string): unknown {
|
|
|
1872
1872
|
};
|
|
1873
1873
|
}
|
|
1874
1874
|
|
|
1875
|
-
function assertSafeFreshCalloutNode(node: MdxNode) {
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1875
|
+
function assertSafeFreshCalloutNode(node: MdxNode, raw: string) {
|
|
1876
|
+
const rootStart = node.position?.start?.offset;
|
|
1877
|
+
const visit = (candidate: MdxNode) => {
|
|
1878
|
+
for (const child of candidate.children ?? []) {
|
|
1879
|
+
const childStart = child.position?.start?.offset;
|
|
1880
|
+
const childEnd = child.position?.end?.offset;
|
|
1881
|
+
const childRaw =
|
|
1882
|
+
typeof rootStart === "number" &&
|
|
1883
|
+
typeof childStart === "number" &&
|
|
1884
|
+
typeof childEnd === "number"
|
|
1885
|
+
? raw.slice(childStart - rootStart, childEnd - rootStart).trim()
|
|
1886
|
+
: "";
|
|
1887
|
+
const emptyBlockNode =
|
|
1888
|
+
(child.type === "mdxJsxFlowElement" ||
|
|
1889
|
+
child.type === "mdxJsxTextElement") &&
|
|
1890
|
+
child.name === "empty-block";
|
|
1891
|
+
if (emptyBlockNode) {
|
|
1892
|
+
if (isEmptyEditorBlockSentinel(child, childRaw)) continue;
|
|
1893
|
+
throw new Error(
|
|
1894
|
+
"Unsupported Builder callout empty-block syntax. Only an attribute-free, self-closing Content editor sentinel can be omitted.",
|
|
1895
|
+
);
|
|
1896
|
+
}
|
|
1897
|
+
if (
|
|
1898
|
+
child.type === "mdxFlowExpression" ||
|
|
1899
|
+
child.type === "mdxTextExpression" ||
|
|
1900
|
+
child.type === "mdxjsEsm" ||
|
|
1901
|
+
child.type === "mdxJsxFlowElement" ||
|
|
1902
|
+
child.type === "mdxJsxTextElement"
|
|
1903
|
+
) {
|
|
1904
|
+
throw new Error("Unsupported dynamic syntax inside Builder callout.");
|
|
1905
|
+
}
|
|
1906
|
+
visit(child);
|
|
1885
1907
|
}
|
|
1886
|
-
|
|
1887
|
-
|
|
1908
|
+
};
|
|
1909
|
+
visit(node);
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
function removeSafeCalloutEmptyBlockSentinels(node: MdxNode, raw: string) {
|
|
1913
|
+
const rootStart = node.position?.start?.offset;
|
|
1914
|
+
if (typeof rootStart !== "number") return raw;
|
|
1915
|
+
const ranges: Array<{ start: number; end: number }> = [];
|
|
1916
|
+
|
|
1917
|
+
const visit = (candidate: MdxNode) => {
|
|
1918
|
+
for (const child of candidate.children ?? []) {
|
|
1919
|
+
const start = child.position?.start?.offset;
|
|
1920
|
+
const end = child.position?.end?.offset;
|
|
1921
|
+
if (typeof start !== "number" || typeof end !== "number") {
|
|
1922
|
+
visit(child);
|
|
1923
|
+
continue;
|
|
1924
|
+
}
|
|
1925
|
+
const relativeStart = start - rootStart;
|
|
1926
|
+
const relativeEnd = end - rootStart;
|
|
1927
|
+
const childRaw = raw.slice(relativeStart, relativeEnd).trim();
|
|
1928
|
+
if (isEmptyEditorBlockSentinel(child, childRaw)) {
|
|
1929
|
+
ranges.push({ start: relativeStart, end: relativeEnd });
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
visit(child);
|
|
1933
|
+
}
|
|
1934
|
+
};
|
|
1935
|
+
visit(node);
|
|
1936
|
+
|
|
1937
|
+
return ranges
|
|
1938
|
+
.sort((left, right) => right.start - left.start)
|
|
1939
|
+
.reduce(
|
|
1940
|
+
(current, range) =>
|
|
1941
|
+
`${current.slice(0, range.start)}${current.slice(range.end)}`,
|
|
1942
|
+
raw,
|
|
1943
|
+
);
|
|
1888
1944
|
}
|
|
1889
1945
|
|
|
1890
1946
|
function findMdxOpeningTagEnd(raw: string) {
|
|
@@ -1936,14 +1992,15 @@ function freshCalloutBlock(
|
|
|
1936
1992
|
`Unsupported Builder callout attribute: ${attribute.name}.`,
|
|
1937
1993
|
);
|
|
1938
1994
|
}
|
|
1939
|
-
assertSafeFreshCalloutNode(node);
|
|
1995
|
+
assertSafeFreshCalloutNode(node, raw);
|
|
1940
1996
|
|
|
1941
|
-
const
|
|
1942
|
-
const
|
|
1997
|
+
const contentRaw = removeSafeCalloutEmptyBlockSentinels(node, raw);
|
|
1998
|
+
const openingEnd = findMdxOpeningTagEnd(contentRaw);
|
|
1999
|
+
const closingStart = contentRaw.lastIndexOf("</callout>");
|
|
1943
2000
|
if (openingEnd < 0 || closingStart < openingEnd) {
|
|
1944
2001
|
throw new Error("Builder callout must have an explicit closing tag.");
|
|
1945
2002
|
}
|
|
1946
|
-
const markdown =
|
|
2003
|
+
const markdown = contentRaw
|
|
1947
2004
|
.slice(openingEnd + 1, closingStart)
|
|
1948
2005
|
.split(/\r?\n/)
|
|
1949
2006
|
.map((line) => line.replace(/^(?:\t| {2})/, ""))
|
|
@@ -626,7 +626,20 @@ export function useCollabReconcile({
|
|
|
626
626
|
// app's local mirror or autosave path (Content serializes an empty paragraph
|
|
627
627
|
// as `<empty-block/>`, which is non-empty text and bypasses the generic
|
|
628
628
|
// registerEmitted empty-string guard).
|
|
629
|
-
if (collab && !seededRef.current)
|
|
629
|
+
if (collab && !seededRef.current) {
|
|
630
|
+
// Passive effects normally mark a synced empty document initialized
|
|
631
|
+
// before a person can type. Keep the event boundary correct too: if a
|
|
632
|
+
// genuine local edit wins that tiny race, it is itself proof that the
|
|
633
|
+
// synced empty document is ready. Remote Yjs transactions stay ignored.
|
|
634
|
+
const firstSyncedEmptyUserEdit =
|
|
635
|
+
collabSynced &&
|
|
636
|
+
!value.trim() &&
|
|
637
|
+
transaction.docChanged &&
|
|
638
|
+
Boolean(transaction.getMeta("uiEvent")) &&
|
|
639
|
+
!isChangeOrigin(transaction);
|
|
640
|
+
if (!firstSyncedEmptyUserEdit) return true;
|
|
641
|
+
seededRef.current = true;
|
|
642
|
+
}
|
|
630
643
|
if (transaction.getMeta(RICH_MARKDOWN_PROGRAMMATIC_TRANSACTION)) {
|
|
631
644
|
return true;
|
|
632
645
|
}
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -41,9 +41,9 @@ export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import
|
|
|
41
41
|
* Body: { text: string, fieldName?: string, requestSource?: string }
|
|
42
42
|
*/
|
|
43
43
|
export declare const postCollabText: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
44
|
+
text?: undefined;
|
|
44
45
|
ok?: undefined;
|
|
45
46
|
error: string;
|
|
46
|
-
text?: undefined;
|
|
47
47
|
} | {
|
|
48
48
|
error?: undefined;
|
|
49
49
|
ok: boolean;
|
package/dist/deploy/build.js
CHANGED
|
@@ -3075,6 +3075,12 @@ export default bundle;
|
|
|
3075
3075
|
"virtual:agents-bundle": agentsBundleModuleSource,
|
|
3076
3076
|
},
|
|
3077
3077
|
replace: {
|
|
3078
|
+
// Netlify exposes DEPLOY_ID only while building. Embed it into the Nitro
|
|
3079
|
+
// function so preview OAuth relays can target this immutable deployment
|
|
3080
|
+
// even though the value is unavailable in the function runtime.
|
|
3081
|
+
"process.env.AGENT_NATIVE_BUILD_ID": JSON.stringify(process.env.DEPLOY_ID?.trim() ||
|
|
3082
|
+
process.env.AGENT_NATIVE_BUILD_ID?.trim() ||
|
|
3083
|
+
""),
|
|
3078
3084
|
"process.env.AGENT_NATIVE_BUILD_GA_MEASUREMENT_ID": JSON.stringify(process.env.GA_MEASUREMENT_ID?.trim() || ""),
|
|
3079
3085
|
"process.env.AGENT_NATIVE_BUILD_GTM_CONTAINER_ID": JSON.stringify(process.env.GTM_CONTAINER_ID?.trim() || ""),
|
|
3080
3086
|
"process.env.AGENT_NATIVE_BUILD_DEPLOY_CONTEXT": JSON.stringify(process.env.CONTEXT?.trim() || ""),
|