@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
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ExecuteBuilderSourceBatchResponse,
|
|
11
11
|
type ExecuteBuilderSourceBatchTransition,
|
|
12
12
|
} from "../shared/api.js";
|
|
13
|
+
import { createBuilderSourceTiming } from "./_builder-source-timings.js";
|
|
13
14
|
import {
|
|
14
15
|
getContentDatabaseSourceSnapshotForWrite,
|
|
15
16
|
resolveDatabaseForSourceMutation,
|
|
@@ -63,25 +64,41 @@ function realBatchDeps(
|
|
|
63
64
|
publicationTransition: transition?.publicationTransition,
|
|
64
65
|
confirmUnpublish: transition?.confirmUnpublish,
|
|
65
66
|
};
|
|
67
|
+
let preparationTimings;
|
|
66
68
|
if (transition?.publicationTransition) {
|
|
67
|
-
|
|
69
|
+
preparationTimings = (
|
|
70
|
+
await prepareBuilderSourceExecution.run(executionArgs)
|
|
71
|
+
).timings;
|
|
68
72
|
}
|
|
69
73
|
try {
|
|
70
|
-
await executeBuilderSourceExecutionWithDeps(
|
|
74
|
+
const response = await executeBuilderSourceExecutionWithDeps(
|
|
71
75
|
executionArgs,
|
|
72
76
|
realExecutionDeps(args.sourceId),
|
|
73
77
|
);
|
|
78
|
+
return {
|
|
79
|
+
changeSetId,
|
|
80
|
+
status: "succeeded",
|
|
81
|
+
timings: [...(preparationTimings ?? []), ...(response.timings ?? [])],
|
|
82
|
+
};
|
|
74
83
|
} catch (error) {
|
|
75
84
|
if (!isMissingGateMessage(errorMessage(error))) {
|
|
76
85
|
throw error;
|
|
77
86
|
}
|
|
78
|
-
|
|
79
|
-
|
|
87
|
+
const preparation =
|
|
88
|
+
await prepareBuilderSourceExecution.run(executionArgs);
|
|
89
|
+
const response = await executeBuilderSourceExecutionWithDeps(
|
|
80
90
|
executionArgs,
|
|
81
91
|
realExecutionDeps(args.sourceId),
|
|
82
92
|
);
|
|
93
|
+
return {
|
|
94
|
+
changeSetId,
|
|
95
|
+
status: "succeeded",
|
|
96
|
+
timings: [
|
|
97
|
+
...(preparation.timings ?? []),
|
|
98
|
+
...(response.timings ?? []),
|
|
99
|
+
],
|
|
100
|
+
};
|
|
83
101
|
}
|
|
84
|
-
return { changeSetId, status: "succeeded" };
|
|
85
102
|
},
|
|
86
103
|
};
|
|
87
104
|
}
|
|
@@ -112,6 +129,12 @@ function isBlockedMessage(message: string) {
|
|
|
112
129
|
].some((pattern) => pattern.test(message));
|
|
113
130
|
}
|
|
114
131
|
|
|
132
|
+
function isReconciliationRequiredMessage(message: string) {
|
|
133
|
+
return /reconciliation required|requires reconciliation|remote outcome is unknown/i.test(
|
|
134
|
+
message,
|
|
135
|
+
);
|
|
136
|
+
}
|
|
137
|
+
|
|
115
138
|
function clampConcurrency(value: number | undefined) {
|
|
116
139
|
if (!value || !Number.isFinite(value)) {
|
|
117
140
|
return DEFAULT_BUILDER_SOURCE_BATCH_CONCURRENCY;
|
|
@@ -180,6 +203,9 @@ function summarize(results: BuilderSourceBatchItemResult[]) {
|
|
|
180
203
|
total: results.length,
|
|
181
204
|
succeeded: results.filter((result) => result.status === "succeeded").length,
|
|
182
205
|
blocked: results.filter((result) => result.status === "blocked").length,
|
|
206
|
+
reconciliationRequired: results.filter(
|
|
207
|
+
(result) => result.status === "reconciliation_required",
|
|
208
|
+
).length,
|
|
183
209
|
failed: results.filter((result) => result.status === "failed").length,
|
|
184
210
|
};
|
|
185
211
|
}
|
|
@@ -188,55 +214,100 @@ export async function executeBuilderSourceBatchWithDeps(
|
|
|
188
214
|
args: ExecuteBuilderSourceBatchRequest,
|
|
189
215
|
deps: ExecuteBuilderSourceBatchDeps,
|
|
190
216
|
): Promise<ExecuteBuilderSourceBatchResponse> {
|
|
191
|
-
const
|
|
192
|
-
|
|
193
|
-
|
|
217
|
+
const timing = createBuilderSourceTiming("execute_builder_source_batch");
|
|
218
|
+
try {
|
|
219
|
+
const { source } = await timing.measure(
|
|
220
|
+
"snapshot_read_and_diff_load",
|
|
221
|
+
async () => {
|
|
222
|
+
const database = await deps.resolveDatabase(args);
|
|
223
|
+
if (!database) throw new Error("Database not found.");
|
|
224
|
+
await deps.assertEditor(database);
|
|
225
|
+
return { source: await deps.getSourceSnapshot(database) };
|
|
226
|
+
},
|
|
227
|
+
);
|
|
228
|
+
if (!source || source.sourceType !== "builder-cms") {
|
|
229
|
+
throw new Error("Attach a Builder CMS source before executing writes.");
|
|
230
|
+
}
|
|
194
231
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
232
|
+
const ids = uniqueIds(
|
|
233
|
+
args.changeSetIds ?? defaultBatchChangeSetIds(source),
|
|
234
|
+
);
|
|
235
|
+
const changeSetsById = new Map(
|
|
236
|
+
source.changeSets.map((changeSet) => [changeSet.id, changeSet]),
|
|
237
|
+
);
|
|
238
|
+
const maxConcurrency = clampConcurrency(args.maxConcurrency);
|
|
239
|
+
const results = await timing.measure("batch_dispatch", () =>
|
|
240
|
+
runBoundedPool(ids, maxConcurrency, async (changeSetId) => {
|
|
241
|
+
const changeSet = changeSetsById.get(changeSetId);
|
|
242
|
+
if (changeSet && hasSucceededExecution(changeSet)) {
|
|
243
|
+
return {
|
|
244
|
+
changeSetId,
|
|
245
|
+
status: "succeeded",
|
|
246
|
+
message: "Builder execution already succeeded; skipped.",
|
|
247
|
+
};
|
|
248
|
+
}
|
|
199
249
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
const maxConcurrency = clampConcurrency(args.maxConcurrency);
|
|
205
|
-
const results = await runBoundedPool(
|
|
206
|
-
ids,
|
|
207
|
-
maxConcurrency,
|
|
208
|
-
async (changeSetId) => {
|
|
209
|
-
const changeSet = changeSetsById.get(changeSetId);
|
|
210
|
-
if (changeSet && hasSucceededExecution(changeSet)) {
|
|
211
|
-
return {
|
|
212
|
-
changeSetId,
|
|
213
|
-
status: "succeeded",
|
|
214
|
-
message: "Builder execution already succeeded; skipped.",
|
|
215
|
-
};
|
|
216
|
-
}
|
|
250
|
+
const blocker = explicitBatchBlocker(changeSet);
|
|
251
|
+
if (blocker) {
|
|
252
|
+
return { changeSetId, status: "blocked", message: blocker };
|
|
253
|
+
}
|
|
217
254
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
255
|
+
try {
|
|
256
|
+
return await deps.runOne(
|
|
257
|
+
changeSetId,
|
|
258
|
+
args.transitions?.[changeSetId],
|
|
259
|
+
);
|
|
260
|
+
} catch (error) {
|
|
261
|
+
const message = errorMessage(error);
|
|
262
|
+
return {
|
|
263
|
+
changeSetId,
|
|
264
|
+
status: isReconciliationRequiredMessage(message)
|
|
265
|
+
? "reconciliation_required"
|
|
266
|
+
: isBlockedMessage(message)
|
|
267
|
+
? "blocked"
|
|
268
|
+
: "failed",
|
|
269
|
+
message,
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
}),
|
|
273
|
+
);
|
|
222
274
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
275
|
+
const phaseDuration = (names: string[]) =>
|
|
276
|
+
results.reduce(
|
|
277
|
+
(total, result) =>
|
|
278
|
+
total +
|
|
279
|
+
(result.timings ?? [])
|
|
280
|
+
.filter((item) => names.includes(item.name))
|
|
281
|
+
.reduce((sum, item) => sum + item.durationMs, 0),
|
|
282
|
+
0,
|
|
283
|
+
);
|
|
284
|
+
timing.add(
|
|
285
|
+
"approval_gate_preparation_and_dry_run_validation",
|
|
286
|
+
phaseDuration([
|
|
287
|
+
"gate_preparation_and_dry_run_validation",
|
|
288
|
+
"approval_gate_and_dry_run_validation",
|
|
289
|
+
]),
|
|
290
|
+
);
|
|
291
|
+
timing.add("write_dispatch", phaseDuration(["write_dispatch"]));
|
|
292
|
+
timing.add(
|
|
293
|
+
"reconciliation_and_persistence",
|
|
294
|
+
phaseDuration(["reconciliation_and_persistence"]),
|
|
295
|
+
);
|
|
235
296
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
297
|
+
const response = {
|
|
298
|
+
summary: summarize(results),
|
|
299
|
+
results,
|
|
300
|
+
timings: timing.finish(),
|
|
301
|
+
};
|
|
302
|
+
timing.log("succeeded");
|
|
303
|
+
return response;
|
|
304
|
+
} catch (error) {
|
|
305
|
+
timing.ensure("approval_gate_preparation_and_dry_run_validation");
|
|
306
|
+
timing.ensure("write_dispatch");
|
|
307
|
+
timing.ensure("reconciliation_and_persistence");
|
|
308
|
+
timing.log("failed");
|
|
309
|
+
throw error;
|
|
310
|
+
}
|
|
240
311
|
}
|
|
241
312
|
|
|
242
313
|
const transitionSchema = z.object({
|