@agent-native/core 0.90.4 → 0.90.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 +8 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/durable-background.ts +18 -18
- package/corpus/core/src/agent/engine/ai-sdk-engine.ts +8 -2
- package/corpus/core/src/agent/engine/anthropic-engine.ts +11 -1
- package/corpus/core/src/agent/production-agent.ts +22 -11
- package/corpus/core/src/agent/run-manager.ts +17 -6
- package/corpus/core/src/agent/run-store.ts +16 -11
- package/corpus/core/src/cli/design-connect.ts +16 -2
- package/corpus/core/src/client/KeepTabOpenNotice.tsx +20 -15
- package/corpus/core/src/client/RunStuckBanner.tsx +14 -13
- package/corpus/core/src/client/agent-chat-adapter.ts +28 -17
- package/corpus/core/src/client/use-run-stuck-detection.ts +8 -5
- package/corpus/templates/content/AGENTS.md +1 -0
- package/corpus/templates/content/actions/_database-source-utils.ts +73 -8
- package/corpus/templates/content/actions/_database-utils.ts +2 -1
- package/corpus/templates/content/actions/prepare-builder-source-review.ts +20 -1
- package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +663 -0
- package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +33 -7
- package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +53 -4
- package/corpus/templates/content/app/components/editor/database/settings.tsx +24 -0
- package/corpus/templates/content/app/hooks/use-content-database.ts +70 -1
- package/corpus/templates/content/app/hooks/use-document-properties.ts +63 -5
- package/corpus/templates/content/app/i18n/zh-TW.ts +3 -0
- package/corpus/templates/content/app/i18n-data.ts +31 -0
- package/corpus/templates/content/changelog/2026-07-01-builder-source-rows-can-be-staged-in-bulk-with-a-reviewable.md +6 -0
- package/corpus/templates/content/changelog/2026-07-07-builder-backed-database-fields-now-edit-like-normal-content-fields.md +6 -0
- package/corpus/templates/content/parity/matrix.md +24 -24
- package/corpus/templates/content/parity/matrix.ts +2 -0
- package/corpus/templates/content/shared/api.ts +59 -4
- package/corpus/templates/design/actions/connect-localhost.ts +26 -3
- package/corpus/templates/design/actions/open-visual-edit.ts +4 -37
- package/corpus/templates/design/app/components/design/DesignCanvas.tsx +26 -10
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-keeps-bridge-access-when-opening-previousl.md +6 -0
- package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-now-keeps-the-live-app-connection-authenti.md +6 -0
- package/dist/agent/durable-background.d.ts +12 -12
- package/dist/agent/durable-background.js +18 -18
- package/dist/agent/durable-background.js.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
- package/dist/agent/engine/ai-sdk-engine.js +8 -2
- package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
- package/dist/agent/engine/anthropic-engine.js +11 -1
- package/dist/agent/engine/anthropic-engine.js.map +1 -1
- package/dist/agent/production-agent.d.ts +2 -2
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +18 -11
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-manager.d.ts +7 -1
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +6 -1
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/run-store.d.ts +1 -1
- package/dist/agent/run-store.d.ts.map +1 -1
- package/dist/agent/run-store.js +15 -10
- package/dist/agent/run-store.js.map +1 -1
- package/dist/cli/design-connect.d.ts.map +1 -1
- package/dist/cli/design-connect.js +12 -2
- package/dist/cli/design-connect.js.map +1 -1
- package/dist/client/KeepTabOpenNotice.d.ts +9 -10
- package/dist/client/KeepTabOpenNotice.d.ts.map +1 -1
- package/dist/client/KeepTabOpenNotice.js +8 -4
- package/dist/client/KeepTabOpenNotice.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +14 -13
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +25 -17
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/use-run-stuck-detection.d.ts +1 -1
- package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
- package/dist/client/use-run-stuck-detection.js +6 -4
- package/dist/client/use-run-stuck-detection.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/package.json +1 -1
|
@@ -302,6 +302,7 @@ export function serializeSourceField(
|
|
|
302
302
|
|
|
303
303
|
function serializeSourceRowRecord(
|
|
304
304
|
row: ContentDatabaseSourceRecordRowDb,
|
|
305
|
+
options: { includeHeavyBuilderBodyValues?: boolean } = {},
|
|
305
306
|
): ContentDatabaseSourceRow {
|
|
306
307
|
return {
|
|
307
308
|
id: row.id,
|
|
@@ -310,10 +311,12 @@ function serializeSourceRowRecord(
|
|
|
310
311
|
sourceRowId: row.sourceRowId,
|
|
311
312
|
sourceQualifiedId: row.sourceQualifiedId,
|
|
312
313
|
sourceDisplayKey: row.sourceDisplayKey,
|
|
313
|
-
sourceValues:
|
|
314
|
+
sourceValues: sourceValuesForSnapshot(
|
|
314
315
|
parseObject<Record<string, DocumentPropertyValue>>(
|
|
315
316
|
row.sourceValuesJson,
|
|
316
317
|
) ?? {},
|
|
318
|
+
options,
|
|
319
|
+
),
|
|
317
320
|
provenance: row.provenance,
|
|
318
321
|
syncState: normalizeSourceSyncState(row.syncState),
|
|
319
322
|
freshness: normalizeSourceFreshness(row.freshness),
|
|
@@ -322,6 +325,27 @@ function serializeSourceRowRecord(
|
|
|
322
325
|
};
|
|
323
326
|
}
|
|
324
327
|
|
|
328
|
+
const HEAVY_BUILDER_BODY_SOURCE_VALUE_KEYS = new Set([
|
|
329
|
+
BUILDER_CMS_BODY_CONTENT_KEY,
|
|
330
|
+
BUILDER_CMS_BODY_LOSSLESS_CONTENT_KEY,
|
|
331
|
+
BUILDER_CMS_BODY_READABLE_MAP_KEY,
|
|
332
|
+
BUILDER_CMS_BODY_SIDECARS_KEY,
|
|
333
|
+
]);
|
|
334
|
+
|
|
335
|
+
export function sourceValuesForSnapshot(
|
|
336
|
+
sourceValues: Record<string, DocumentPropertyValue>,
|
|
337
|
+
options: { includeHeavyBuilderBodyValues?: boolean } = {},
|
|
338
|
+
): Record<string, DocumentPropertyValue> {
|
|
339
|
+
if (options.includeHeavyBuilderBodyValues === true) return sourceValues;
|
|
340
|
+
let next: Record<string, DocumentPropertyValue> | null = null;
|
|
341
|
+
for (const key of HEAVY_BUILDER_BODY_SOURCE_VALUE_KEYS) {
|
|
342
|
+
if (!Object.prototype.hasOwnProperty.call(sourceValues, key)) continue;
|
|
343
|
+
next ??= { ...sourceValues };
|
|
344
|
+
delete next[key];
|
|
345
|
+
}
|
|
346
|
+
return next ?? sourceValues;
|
|
347
|
+
}
|
|
348
|
+
|
|
325
349
|
function serializeSourceChangeSet(
|
|
326
350
|
row: ContentDatabaseSourceChangeSetRowDb,
|
|
327
351
|
): ContentDatabaseSourceChangeSet {
|
|
@@ -1919,7 +1943,9 @@ export async function getContentDatabaseSourceSnapshot(
|
|
|
1919
1943
|
asc(schema.contentDatabaseSources.id),
|
|
1920
1944
|
);
|
|
1921
1945
|
if (!source) return null;
|
|
1922
|
-
return loadSourceSnapshot(source, database
|
|
1946
|
+
return loadSourceSnapshot(source, database, {
|
|
1947
|
+
includeHeavyBuilderBodyValues: false,
|
|
1948
|
+
});
|
|
1923
1949
|
}
|
|
1924
1950
|
|
|
1925
1951
|
/**
|
|
@@ -1942,7 +1968,9 @@ export async function getContentDatabaseSourceSnapshotById(
|
|
|
1942
1968
|
),
|
|
1943
1969
|
);
|
|
1944
1970
|
if (!source) return null;
|
|
1945
|
-
return loadSourceSnapshot(source, database
|
|
1971
|
+
return loadSourceSnapshot(source, database, {
|
|
1972
|
+
includeHeavyBuilderBodyValues: false,
|
|
1973
|
+
});
|
|
1946
1974
|
}
|
|
1947
1975
|
|
|
1948
1976
|
/**
|
|
@@ -1955,9 +1983,37 @@ export async function getContentDatabaseSourceSnapshotForWrite(
|
|
|
1955
1983
|
database: ContentDatabaseRow | ContentDatabase,
|
|
1956
1984
|
sourceId?: string | null,
|
|
1957
1985
|
): Promise<ContentDatabaseSource | null> {
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1986
|
+
if (sourceId) {
|
|
1987
|
+
const db = getDb();
|
|
1988
|
+
const [source] = await db
|
|
1989
|
+
.select()
|
|
1990
|
+
.from(schema.contentDatabaseSources)
|
|
1991
|
+
.where(
|
|
1992
|
+
and(
|
|
1993
|
+
eq(schema.contentDatabaseSources.id, sourceId),
|
|
1994
|
+
eq(schema.contentDatabaseSources.databaseId, database.id),
|
|
1995
|
+
),
|
|
1996
|
+
);
|
|
1997
|
+
return source
|
|
1998
|
+
? loadSourceSnapshot(source, database, {
|
|
1999
|
+
includeHeavyBuilderBodyValues: true,
|
|
2000
|
+
})
|
|
2001
|
+
: null;
|
|
2002
|
+
}
|
|
2003
|
+
const db = getDb();
|
|
2004
|
+
const [source] = await db
|
|
2005
|
+
.select()
|
|
2006
|
+
.from(schema.contentDatabaseSources)
|
|
2007
|
+
.where(eq(schema.contentDatabaseSources.databaseId, database.id))
|
|
2008
|
+
.orderBy(
|
|
2009
|
+
asc(schema.contentDatabaseSources.createdAt),
|
|
2010
|
+
asc(schema.contentDatabaseSources.id),
|
|
2011
|
+
);
|
|
2012
|
+
return source
|
|
2013
|
+
? loadSourceSnapshot(source, database, {
|
|
2014
|
+
includeHeavyBuilderBodyValues: true,
|
|
2015
|
+
})
|
|
2016
|
+
: null;
|
|
1961
2017
|
}
|
|
1962
2018
|
|
|
1963
2019
|
/**
|
|
@@ -1982,7 +2038,11 @@ export async function getAllContentDatabaseSourceSnapshots(
|
|
|
1982
2038
|
);
|
|
1983
2039
|
const snapshots: ContentDatabaseSource[] = [];
|
|
1984
2040
|
for (const source of sources) {
|
|
1985
|
-
snapshots.push(
|
|
2041
|
+
snapshots.push(
|
|
2042
|
+
await loadSourceSnapshot(source, database, {
|
|
2043
|
+
includeHeavyBuilderBodyValues: false,
|
|
2044
|
+
}),
|
|
2045
|
+
);
|
|
1986
2046
|
}
|
|
1987
2047
|
return snapshots;
|
|
1988
2048
|
}
|
|
@@ -2135,6 +2195,7 @@ async function loadSourceSnapshotRowsOptimistically(args: {
|
|
|
2135
2195
|
async function loadSourceSnapshot(
|
|
2136
2196
|
source: ContentDatabaseSourceRowDb,
|
|
2137
2197
|
database: ContentDatabaseRow | ContentDatabase,
|
|
2198
|
+
options: { includeHeavyBuilderBodyValues: boolean },
|
|
2138
2199
|
): Promise<ContentDatabaseSource> {
|
|
2139
2200
|
const db = getDb();
|
|
2140
2201
|
const [fieldRows, changeRows, reviewRows, executionRows, propertyDefs] =
|
|
@@ -2218,7 +2279,11 @@ async function loadSourceSnapshot(
|
|
|
2218
2279
|
database,
|
|
2219
2280
|
isBuilderSource,
|
|
2220
2281
|
});
|
|
2221
|
-
const rows = rowRows.map(
|
|
2282
|
+
const rows = rowRows.map((row) =>
|
|
2283
|
+
serializeSourceRowRecord(row, {
|
|
2284
|
+
includeHeavyBuilderBodyValues: options.includeHeavyBuilderBodyValues,
|
|
2285
|
+
}),
|
|
2286
|
+
);
|
|
2222
2287
|
const documentTitleById = new Map(
|
|
2223
2288
|
rowDocuments.map((document) => [document.id, document.title]),
|
|
2224
2289
|
);
|
|
@@ -123,12 +123,13 @@ export function normalizeContentDatabasePageOptions(options: {
|
|
|
123
123
|
function serializeDocument(
|
|
124
124
|
doc: typeof schema.documents.$inferSelect,
|
|
125
125
|
membership?: DatabaseMembershipRow,
|
|
126
|
+
options: { includeContent?: boolean } = {},
|
|
126
127
|
) {
|
|
127
128
|
return {
|
|
128
129
|
id: doc.id,
|
|
129
130
|
parentId: doc.parentId,
|
|
130
131
|
title: doc.title,
|
|
131
|
-
content: doc.content,
|
|
132
|
+
content: options.includeContent === true ? doc.content : "",
|
|
132
133
|
icon: doc.icon,
|
|
133
134
|
position: doc.position,
|
|
134
135
|
isFavorite: parseDocumentFavorite(doc.isFavorite),
|
|
@@ -382,6 +382,11 @@ export default defineAction({
|
|
|
382
382
|
.string()
|
|
383
383
|
.optional()
|
|
384
384
|
.describe("Target source ID (defaults to the primary source)"),
|
|
385
|
+
changeSetIds: z
|
|
386
|
+
.array(z.string())
|
|
387
|
+
.max(BUILDER_SOURCE_REVIEW_PREPARE_LIMIT)
|
|
388
|
+
.optional()
|
|
389
|
+
.describe("Optional bounded set of Builder change-set IDs to prepare"),
|
|
385
390
|
pushModeConfirmation: z
|
|
386
391
|
.enum(["autosave", "draft", "publish"])
|
|
387
392
|
.optional()
|
|
@@ -409,13 +414,27 @@ export default defineAction({
|
|
|
409
414
|
if (!snapshot || snapshot.sourceType !== "builder-cms") {
|
|
410
415
|
throw new Error("Attach a Builder CMS source before reviewing updates.");
|
|
411
416
|
}
|
|
417
|
+
const requestedIds = new Set(args.changeSetIds ?? []);
|
|
412
418
|
const allReviewableChanges = snapshot.changeSets.filter(
|
|
413
419
|
(changeSet) =>
|
|
414
420
|
changeSet.direction === "outbound" &&
|
|
415
421
|
(changeSet.state === "pending_push" ||
|
|
416
422
|
changeSet.state === "staged_revision" ||
|
|
417
|
-
changeSet.state === "approved")
|
|
423
|
+
changeSet.state === "approved") &&
|
|
424
|
+
(requestedIds.size === 0 || requestedIds.has(changeSet.id)),
|
|
418
425
|
);
|
|
426
|
+
if (
|
|
427
|
+
requestedIds.size > 0 &&
|
|
428
|
+
allReviewableChanges.length !== requestedIds.size
|
|
429
|
+
) {
|
|
430
|
+
const foundIds = new Set(
|
|
431
|
+
allReviewableChanges.map((changeSet) => changeSet.id),
|
|
432
|
+
);
|
|
433
|
+
const missingIds = [...requestedIds].filter((id) => !foundIds.has(id));
|
|
434
|
+
throw new Error(
|
|
435
|
+
`Requested Builder change-set is not reviewable: ${missingIds.join(", ")}.`,
|
|
436
|
+
);
|
|
437
|
+
}
|
|
419
438
|
if (allReviewableChanges.length === 0) {
|
|
420
439
|
throw new Error("No pending local Builder changes to review.");
|
|
421
440
|
}
|