@agent-native/core 0.101.7 → 0.101.10
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 +22 -0
- package/corpus/core/docs/content/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/ar-SA/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/de-DE/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/es-ES/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/fr-FR/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/hi-IN/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/ja-JP/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/ko-KR/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/pt-BR/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/zh-CN/deployment.mdx +9 -7
- package/corpus/core/docs/content/locales/zh-TW/deployment.mdx +9 -7
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/review/ReviewCommentComposer.tsx +9 -1
- package/corpus/core/src/client/review/ReviewThreadPanel.tsx +17 -2
- package/corpus/core/src/client/settings/SettingsPanel.tsx +41 -21
- package/corpus/core/src/client/settings/useBuilderStatus.ts +28 -9
- package/corpus/core/src/client/setup-connections/BuilderConnectCard.tsx +2 -7
- package/corpus/core/src/server/auth.ts +25 -1
- package/corpus/core/src/server/builder-browser.ts +353 -1
- package/corpus/core/src/server/core-routes-plugin.ts +601 -223
- package/corpus/templates/calendar/app/components/calendar/DayView.tsx +80 -1
- package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +28 -3
- package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +5 -1
- package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +30 -3
- package/corpus/templates/calendar/app/components/calendar/OutOfOfficeEvent.tsx +196 -0
- package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +115 -1
- package/corpus/templates/calendar/app/lib/out-of-office.ts +45 -0
- package/corpus/templates/calendar/changelog/2026-07-14-out-of-office-blocks-now-sit-behind-meetings-and-event-stack.md +6 -0
- package/corpus/templates/content/AGENTS.md +3 -2
- package/corpus/templates/content/actions/_builder-cms-intent-lookup.ts +87 -0
- package/corpus/templates/content/actions/_builder-cms-read-client.ts +173 -25
- package/corpus/templates/content/actions/_builder-cms-source-adapter.ts +1 -0
- package/corpus/templates/content/actions/_builder-cms-write-adapter.ts +427 -18
- package/corpus/templates/content/actions/_builder-cms-write-client.ts +17 -73
- package/corpus/templates/content/actions/_builder-cms-write-settings.ts +27 -7
- package/corpus/templates/content/actions/_builder-source-execution-claim.ts +124 -0
- package/corpus/templates/content/actions/_builder-source-execution-preservation.ts +21 -0
- package/corpus/templates/content/actions/_builder-source-timings.ts +57 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +1041 -154
- package/corpus/templates/content/actions/_database-utils.ts +89 -12
- package/corpus/templates/content/actions/_preview-document-draft.ts +31 -0
- package/corpus/templates/content/actions/cancel-prepared-builder-source-update.ts +309 -0
- package/corpus/templates/content/actions/execute-builder-source-batch.ts +120 -49
- package/corpus/templates/content/actions/execute-builder-source-execution.ts +608 -264
- package/corpus/templates/content/actions/get-preview-document-draft.ts +26 -0
- package/corpus/templates/content/actions/materialize-builder-required-fields.ts +550 -0
- package/corpus/templates/content/actions/prepare-builder-source-execution.ts +112 -65
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +463 -170
- package/corpus/templates/content/actions/preview-builder-source-review.ts +99 -0
- package/corpus/templates/content/actions/set-content-database-source-write-mode.ts +2 -2
- package/corpus/templates/content/actions/update-preview-document-draft.ts +153 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +27 -15
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +57 -5
- package/corpus/templates/content/app/components/editor/body-hydration.ts +27 -0
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +2353 -576
- package/corpus/templates/content/app/components/editor/database/settings.tsx +13 -10
- package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +358 -75
- package/corpus/templates/content/app/components/editor/previewDocumentSaveController.ts +124 -29
- package/corpus/templates/content/app/components/editor/previewDocumentSaveRegistry.ts +2 -0
- package/corpus/templates/content/app/global.css +18 -1
- package/corpus/templates/content/app/hooks/use-content-database.ts +68 -0
- package/corpus/templates/content/app/hooks/use-documents.ts +53 -4
- package/corpus/templates/content/app/i18n/zh-TW.ts +25 -0
- package/corpus/templates/content/app/i18n-data.ts +287 -0
- package/corpus/templates/content/changelog/2026-07-10-builder-backed-preview-edits-are-preserved-when-article-bodi.md +6 -0
- package/corpus/templates/content/changelog/2026-07-10-builder-cms-sources-can-now-be-enabled-for-guarded-staged-or.md +6 -0
- package/corpus/templates/content/changelog/2026-07-13-builder-connection-setup-is-now-available-directly-from-conn.md +6 -0
- package/corpus/templates/content/changelog/2026-07-13-builder-reviews-now-hide-already-applied-writes-detect-nativ.md +6 -0
- package/corpus/templates/content/changelog/2026-07-13-required-builder-publishing-fields-can-now-be-added-directly.md +6 -0
- package/corpus/templates/content/changelog/2026-07-13-you-can-now-cancel-a-prepared-builder-update-safely-before-i.md +6 -0
- package/corpus/templates/content/changelog/2026-07-14-builder-account-connection-now-remains-available-when-branch.md +6 -0
- package/corpus/templates/content/changelog/2026-07-14-builder-backed-articles-now-preserve-fifth-and-sixth-level-h.md +6 -0
- package/corpus/templates/content/changelog/2026-07-14-builder-sources-now-review-and-publish-rich-article-updates-.md +6 -0
- package/corpus/templates/content/changelog/2026-07-14-builder-writes-now-stop-retries-when-reconciliation-is-needed.md +6 -0
- package/corpus/templates/content/changelog/2026-07-14-file-and-media-links-now-validate-before-saving.md +6 -0
- package/corpus/templates/content/parity/matrix.md +27 -25
- package/corpus/templates/content/parity/matrix.ts +50 -2
- package/corpus/templates/content/server/db/schema.ts +47 -0
- package/corpus/templates/content/server/plugins/auth.ts +1 -0
- package/corpus/templates/content/server/plugins/db.ts +53 -0
- package/corpus/templates/content/shared/api.ts +70 -1
- package/corpus/templates/content/shared/builder-mdx.ts +705 -15
- package/corpus/templates/content/shared/nfm.ts +3 -3
- package/corpus/templates/design/app/components/design/ReadOnlyDesignBanner.tsx +52 -7
- package/corpus/templates/design/app/components/design/ReviewCommentsPanel.tsx +36 -4
- package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +4 -1
- package/corpus/templates/design/app/i18n/ar-SA.ts +1 -0
- package/corpus/templates/design/app/i18n/de-DE.ts +1 -0
- package/corpus/templates/design/app/i18n/en-US.ts +1 -0
- package/corpus/templates/design/app/i18n/es-ES.ts +1 -0
- package/corpus/templates/design/app/i18n/fr-FR.ts +1 -0
- package/corpus/templates/design/app/i18n/hi-IN.ts +1 -0
- package/corpus/templates/design/app/i18n/ja-JP.ts +1 -0
- package/corpus/templates/design/app/i18n/ko-KR.ts +1 -0
- package/corpus/templates/design/app/i18n/pt-BR.ts +1 -0
- package/corpus/templates/design/app/i18n/zh-CN.ts +1 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/design/app/pages/design-editor/selection-state.ts +8 -0
- package/corpus/templates/design/app/pages/design-editor/tool-state.ts +11 -0
- package/corpus/templates/design/changelog/2026-07-14-reviewers-can-now-pin-comments-from-the-canvas-toolbar-targe.md +6 -0
- package/corpus/templates/design/changelog/2026-07-15-viewer-comment-controls-now-sit-inside-the-read-only-notice-.md +6 -0
- package/corpus/templates/design/shared/review-anchor.ts +48 -0
- package/corpus/templates/plan/server/plan-mdx.ts +53 -7
- package/dist/client/review/ReviewCommentComposer.d.ts +2 -1
- package/dist/client/review/ReviewCommentComposer.d.ts.map +1 -1
- package/dist/client/review/ReviewCommentComposer.js +3 -3
- package/dist/client/review/ReviewCommentComposer.js.map +1 -1
- package/dist/client/review/ReviewThreadPanel.d.ts +9 -1
- package/dist/client/review/ReviewThreadPanel.d.ts.map +1 -1
- package/dist/client/review/ReviewThreadPanel.js +6 -4
- package/dist/client/review/ReviewThreadPanel.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +3 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +11 -4
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/settings/useBuilderStatus.d.ts +8 -4
- package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
- package/dist/client/settings/useBuilderStatus.js +19 -6
- package/dist/client/settings/useBuilderStatus.js.map +1 -1
- package/dist/client/setup-connections/BuilderConnectCard.d.ts.map +1 -1
- package/dist/client/setup-connections/BuilderConnectCard.js +2 -5
- package/dist/client/setup-connections/BuilderConnectCard.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/auth.d.ts +1 -0
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +19 -2
- package/dist/server/auth.js.map +1 -1
- package/dist/server/builder-browser.d.ts +78 -0
- package/dist/server/builder-browser.d.ts.map +1 -1
- package/dist/server/builder-browser.js +246 -1
- package/dist/server/builder-browser.js.map +1 -1
- package/dist/server/core-routes-plugin.d.ts +41 -0
- package/dist/server/core-routes-plugin.d.ts.map +1 -1
- package/dist/server/core-routes-plugin.js +260 -14
- package/dist/server/core-routes-plugin.js.map +1 -1
- package/docs/content/deployment.mdx +9 -7
- package/docs/content/locales/ar-SA/deployment.mdx +9 -7
- package/docs/content/locales/de-DE/deployment.mdx +9 -7
- package/docs/content/locales/es-ES/deployment.mdx +9 -7
- package/docs/content/locales/fr-FR/deployment.mdx +9 -7
- package/docs/content/locales/hi-IN/deployment.mdx +9 -7
- package/docs/content/locales/ja-JP/deployment.mdx +9 -7
- package/docs/content/locales/ko-KR/deployment.mdx +9 -7
- package/docs/content/locales/pt-BR/deployment.mdx +9 -7
- package/docs/content/locales/zh-CN/deployment.mdx +9 -7
- package/docs/content/locales/zh-TW/deployment.mdx +9 -7
- package/package.json +2 -2
|
@@ -9,6 +9,9 @@ import type {
|
|
|
9
9
|
PrepareBuilderSourceExecutionRequest,
|
|
10
10
|
} from "../shared/api.js";
|
|
11
11
|
import { buildBuilderCmsExecutionPlan } from "./_builder-cms-write-adapter.js";
|
|
12
|
+
import { claimBuilderSourceExecutionGate } from "./_builder-source-execution-claim.js";
|
|
13
|
+
import { shouldPreserveBuilderExecution } from "./_builder-source-execution-preservation.js";
|
|
14
|
+
import { createBuilderSourceTiming } from "./_builder-source-timings.js";
|
|
12
15
|
import {
|
|
13
16
|
getContentDatabaseSourceSnapshotForWrite,
|
|
14
17
|
resolveDatabaseForSourceMutation,
|
|
@@ -42,81 +45,125 @@ export default defineAction({
|
|
|
42
45
|
run: async (
|
|
43
46
|
args: PrepareBuilderSourceExecutionRequest,
|
|
44
47
|
): Promise<ContentDatabaseResponse> => {
|
|
45
|
-
const
|
|
46
|
-
|
|
47
|
-
await assertAccess("document", database.documentId, "editor");
|
|
48
|
-
|
|
49
|
-
const source = await getContentDatabaseSourceSnapshotForWrite(
|
|
50
|
-
database,
|
|
51
|
-
args.sourceId,
|
|
48
|
+
const timing = createBuilderSourceTiming(
|
|
49
|
+
"prepare_builder_source_execution",
|
|
52
50
|
);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
51
|
+
try {
|
|
52
|
+
const { database, source } = await timing.measure(
|
|
53
|
+
"snapshot_read_and_diff_load",
|
|
54
|
+
async () => {
|
|
55
|
+
const database = await resolveDatabaseForSourceMutation(args);
|
|
56
|
+
if (!database) throw new Error("Database not found.");
|
|
57
|
+
await assertAccess("document", database.documentId, "editor");
|
|
58
|
+
const source = await getContentDatabaseSourceSnapshotForWrite(
|
|
59
|
+
database,
|
|
60
|
+
args.sourceId,
|
|
61
|
+
);
|
|
62
|
+
return { database, source };
|
|
63
|
+
},
|
|
56
64
|
);
|
|
57
|
-
|
|
65
|
+
if (!source || source.sourceType !== "builder-cms") {
|
|
66
|
+
throw new Error(
|
|
67
|
+
"Attach a Builder CMS source before preparing execution.",
|
|
68
|
+
);
|
|
69
|
+
}
|
|
58
70
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (!changeSet) throw new Error("Source change-set not found.");
|
|
63
|
-
|
|
64
|
-
const plan = buildBuilderCmsExecutionPlan({
|
|
65
|
-
source,
|
|
66
|
-
changeSet,
|
|
67
|
-
pushModeConfirmation: args.pushModeConfirmation,
|
|
68
|
-
publicationTransition: args.publicationTransition,
|
|
69
|
-
confirmUnpublish: args.confirmUnpublish,
|
|
70
|
-
});
|
|
71
|
-
const now = new Date().toISOString();
|
|
72
|
-
const db = getDb();
|
|
73
|
-
const [existing] = await db
|
|
74
|
-
.select()
|
|
75
|
-
.from(schema.contentDatabaseSourceExecutions)
|
|
76
|
-
.where(
|
|
77
|
-
and(
|
|
78
|
-
eq(
|
|
79
|
-
schema.contentDatabaseSourceExecutions.idempotencyKey,
|
|
80
|
-
plan.idempotencyKey,
|
|
81
|
-
),
|
|
82
|
-
eq(schema.contentDatabaseSourceExecutions.sourceId, source.id),
|
|
83
|
-
),
|
|
71
|
+
const gateStartedAt = timing.start();
|
|
72
|
+
const changeSet = source.changeSets.find(
|
|
73
|
+
(candidate) => candidate.id === args.changeSetId,
|
|
84
74
|
);
|
|
75
|
+
if (!changeSet) throw new Error("Source change-set not found.");
|
|
85
76
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
.where(eq(schema.contentDatabaseSourceExecutions.id, existing.id));
|
|
97
|
-
} else {
|
|
98
|
-
await db.insert(schema.contentDatabaseSourceExecutions).values({
|
|
99
|
-
id: crypto.randomUUID(),
|
|
77
|
+
const plan = buildBuilderCmsExecutionPlan({
|
|
78
|
+
source,
|
|
79
|
+
changeSet,
|
|
80
|
+
pushModeConfirmation: args.pushModeConfirmation,
|
|
81
|
+
publicationTransition: args.publicationTransition,
|
|
82
|
+
confirmUnpublish: args.confirmUnpublish,
|
|
83
|
+
});
|
|
84
|
+
const now = new Date().toISOString();
|
|
85
|
+
const db = getDb();
|
|
86
|
+
const executionId = await claimBuilderSourceExecutionGate({
|
|
100
87
|
ownerEmail: database.ownerEmail,
|
|
101
88
|
sourceId: source.id,
|
|
102
|
-
changeSetId: changeSet.id,
|
|
103
|
-
adapter: plan.adapter,
|
|
104
|
-
pushMode: plan.pushMode,
|
|
105
|
-
state: plan.state,
|
|
106
89
|
idempotencyKey: plan.idempotencyKey,
|
|
107
|
-
|
|
108
|
-
payloadJson: JSON.stringify(plan.payload),
|
|
109
|
-
lastError: plan.lastError,
|
|
110
|
-
createdAt: now,
|
|
111
|
-
updatedAt: now,
|
|
90
|
+
now,
|
|
112
91
|
});
|
|
113
|
-
|
|
92
|
+
try {
|
|
93
|
+
await db.transaction(async (tx) => {
|
|
94
|
+
const [existing] = await tx
|
|
95
|
+
.select()
|
|
96
|
+
.from(schema.contentDatabaseSourceExecutions)
|
|
97
|
+
.where(eq(schema.contentDatabaseSourceExecutions.id, executionId))
|
|
98
|
+
.limit(1);
|
|
99
|
+
|
|
100
|
+
const preserve =
|
|
101
|
+
existing &&
|
|
102
|
+
shouldPreserveBuilderExecution({
|
|
103
|
+
state: existing.state,
|
|
104
|
+
payloadJson: existing.payloadJson,
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
if (existing && !preserve) {
|
|
108
|
+
await tx
|
|
109
|
+
.update(schema.contentDatabaseSourceExecutions)
|
|
110
|
+
.set({
|
|
111
|
+
state: plan.state,
|
|
112
|
+
summary: plan.summary,
|
|
113
|
+
payloadJson: JSON.stringify(plan.payload),
|
|
114
|
+
lastError: plan.lastError,
|
|
115
|
+
updatedAt: now,
|
|
116
|
+
})
|
|
117
|
+
.where(
|
|
118
|
+
eq(schema.contentDatabaseSourceExecutions.id, existing.id),
|
|
119
|
+
);
|
|
120
|
+
} else if (!existing) {
|
|
121
|
+
await tx.insert(schema.contentDatabaseSourceExecutions).values({
|
|
122
|
+
id: executionId,
|
|
123
|
+
ownerEmail: database.ownerEmail,
|
|
124
|
+
sourceId: source.id,
|
|
125
|
+
changeSetId: changeSet.id,
|
|
126
|
+
adapter: plan.adapter,
|
|
127
|
+
pushMode: plan.pushMode,
|
|
128
|
+
state: plan.state,
|
|
129
|
+
idempotencyKey: plan.idempotencyKey,
|
|
130
|
+
summary: plan.summary,
|
|
131
|
+
payloadJson: JSON.stringify(plan.payload),
|
|
132
|
+
lastError: plan.lastError,
|
|
133
|
+
createdAt: now,
|
|
134
|
+
updatedAt: now,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
114
137
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
138
|
+
if (!preserve) {
|
|
139
|
+
await tx
|
|
140
|
+
.update(schema.contentDatabaseSources)
|
|
141
|
+
.set({ updatedAt: now })
|
|
142
|
+
.where(eq(schema.contentDatabaseSources.id, source.id));
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
} catch (error) {
|
|
146
|
+
// A concurrent prepare may win the unique (source, key) race after our
|
|
147
|
+
// initial SELECT. Reuse that durable gate; rethrow unrelated failures.
|
|
148
|
+
const [winner] = await db
|
|
149
|
+
.select({ id: schema.contentDatabaseSourceExecutions.id })
|
|
150
|
+
.from(schema.contentDatabaseSourceExecutions)
|
|
151
|
+
.where(eq(schema.contentDatabaseSourceExecutions.id, executionId))
|
|
152
|
+
.limit(1);
|
|
153
|
+
if (!winner) throw error;
|
|
154
|
+
}
|
|
155
|
+
timing.record("gate_preparation_and_dry_run_validation", gateStartedAt);
|
|
119
156
|
|
|
120
|
-
|
|
157
|
+
const response = await timing.measure("response_load", () =>
|
|
158
|
+
getContentDatabaseResponse(database.id),
|
|
159
|
+
);
|
|
160
|
+
const result = { ...response, timings: timing.finish() };
|
|
161
|
+
timing.log("succeeded");
|
|
162
|
+
return result;
|
|
163
|
+
} catch (error) {
|
|
164
|
+
timing.ensure("gate_preparation_and_dry_run_validation");
|
|
165
|
+
timing.log("failed");
|
|
166
|
+
throw error;
|
|
167
|
+
}
|
|
121
168
|
},
|
|
122
169
|
});
|