@agent-native/core 0.181.0-nightly-20260916071057 → 0.181.0
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/templates/analytics/CHANGELOG.md +10 -0
- package/corpus/templates/calendar/CHANGELOG.md +5 -0
- package/corpus/templates/clips/CHANGELOG.md +12 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +14 -0
- package/corpus/templates/design/CHANGELOG.md +36 -0
- package/corpus/templates/design/actions/update-design.ts +69 -1
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +14 -0
- package/corpus/templates/design/app/components/design/edit-panel/interaction-state-helpers.ts +14 -0
- package/corpus/templates/design/changelog/2026-09-16-authored-flex-direction-wrap-gaps-justify-content-and-paddin.md +6 -0
- package/corpus/templates/design/shared/canvas-frames.ts +6 -0
- package/corpus/templates/mail/CHANGELOG.md +4 -0
- package/corpus/templates/slides/CHANGELOG.md +16 -0
- package/dist/automation/index.d.ts +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.d.ts +2 -0
- package/dist/deploy/build.js +151 -0
- 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 +5 -5
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/package.json +4 -4
package/corpus/README.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable user-facing changes to Agent-Native Analytics are documented here. Open it any
|
|
4
4
|
time from the command menu (Cmd+K → "What's new") or from Settings.
|
|
5
5
|
|
|
6
|
+
## 2026-09-15
|
|
7
|
+
|
|
8
|
+
### Improved
|
|
9
|
+
|
|
10
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- Implementing an Analytics plan now starts a fresh Act-mode run.
|
|
15
|
+
|
|
6
16
|
## 2026-09-14
|
|
7
17
|
|
|
8
18
|
### Improved
|
|
@@ -7,6 +7,7 @@ time from the command menu (Cmd+K → "What's new") or from Settings.
|
|
|
7
7
|
|
|
8
8
|
### Improved
|
|
9
9
|
|
|
10
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
10
11
|
- Calendar mirrors Notion Calendar's customizable day ranges and view settings
|
|
11
12
|
|
|
12
13
|
### Fixed
|
|
@@ -76,6 +77,10 @@ time from the command menu (Cmd+K → "What's new") or from Settings.
|
|
|
76
77
|
|
|
77
78
|
## 2026-09-04
|
|
78
79
|
|
|
80
|
+
### Added
|
|
81
|
+
|
|
82
|
+
- Booking link hosts now show whether their real working hours are applied, with a one-click request to fix it when they aren't
|
|
83
|
+
|
|
79
84
|
### Improved
|
|
80
85
|
|
|
81
86
|
- Generated booking-link OG images now use the shared branded background.
|
|
@@ -5,12 +5,24 @@ from the command menu (Cmd+K → "What's new") or from Settings.
|
|
|
5
5
|
|
|
6
6
|
## 2026-09-15
|
|
7
7
|
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Recordings include a structured timeline of browser interactions and diagnostics
|
|
11
|
+
|
|
8
12
|
### Improved
|
|
9
13
|
|
|
14
|
+
- Clips places editing controls between the video preview and timeline.
|
|
15
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
10
16
|
- Trash now supports paging through more than 100 deleted recordings
|
|
11
17
|
|
|
12
18
|
### Fixed
|
|
13
19
|
|
|
20
|
+
- Clips Desktop keeps Dictate visible when voice dictation is enabled
|
|
21
|
+
- Clips no longer reports 0% completion on a clip that only agents have read - completion and CTA conversion now show as unknown until a human view is counted
|
|
22
|
+
- Clips popovers now close when you switch to another application.
|
|
23
|
+
- Clips serves private thumbnails through the same-origin thumbnail route.
|
|
24
|
+
- Playback speed changes no longer restart paused clips, Picture-in-Picture stops cleanly when leaving the player, and the Windows tray stays within the usable desktop without hiding recorder controls.
|
|
25
|
+
- The comments empty state now uses the shared shadcn empty-state style with an icon
|
|
14
26
|
- Fixed the volume slider knob alignment in shared recordings
|
|
15
27
|
- Shared Clips now focus the agent when asked, show clear viewer-safe transcript states, and keep workspace branding visible.
|
|
16
28
|
|
|
@@ -2866,6 +2866,20 @@ export const editorChromeBridgeScript: string = `"use strict";
|
|
|
2866
2866
|
"gridTemplateColumns",
|
|
2867
2867
|
"gridTemplateRows",
|
|
2868
2868
|
"gridAutoFlow",
|
|
2869
|
+
"flexDirection",
|
|
2870
|
+
"flexWrap",
|
|
2871
|
+
"columnGap",
|
|
2872
|
+
"rowGap",
|
|
2873
|
+
"justifyContent",
|
|
2874
|
+
"paddingTop",
|
|
2875
|
+
"paddingRight",
|
|
2876
|
+
"paddingBottom",
|
|
2877
|
+
"paddingLeft",
|
|
2878
|
+
"alignItems",
|
|
2879
|
+
"alignContent",
|
|
2880
|
+
"justifyItems",
|
|
2881
|
+
"gap",
|
|
2882
|
+
"padding",
|
|
2869
2883
|
"webkitBoxOrient",
|
|
2870
2884
|
"webkitLineClamp",
|
|
2871
2885
|
"--agent-native-truncate-original-display",
|
|
@@ -7,8 +7,44 @@ from the command menu (Cmd+K → "What's new") or from Settings.
|
|
|
7
7
|
|
|
8
8
|
### Fixed
|
|
9
9
|
|
|
10
|
+
- Authored flex direction, wrap, gaps, justify-content, and padding now survive layout edits instead of being reset.
|
|
10
11
|
- A message that only mentions a design, or pastes Design's own guidance back into chat, no longer ends with a false "couldn't confirm that a Design artifact was saved" reply.
|
|
11
12
|
|
|
13
|
+
## 2026-09-15
|
|
14
|
+
|
|
15
|
+
### Improved
|
|
16
|
+
|
|
17
|
+
- Auto layout controls use a compact alignment and gap layout with smaller constraint controls.
|
|
18
|
+
- Keep the Screens list focused and resize its split with Layers
|
|
19
|
+
- Large-design element selection keeps bulk geometry collection lightweight for faster marquee interactions.
|
|
20
|
+
- Large visual-edit maps limit concurrent live app boots so more screens stay responsive
|
|
21
|
+
- Layers have more breathing room, smaller chevrons, and balanced toolbar icons; inspector tabs have more vertical padding.
|
|
22
|
+
- Main component structure edits stay linked across instances, and deleted main components can be restored from an instance.
|
|
23
|
+
- Marquee select and double-click element select on the canvas are much faster on large screens.
|
|
24
|
+
- Responsive breakpoint edits preserve authored CSS, and Shift-dragging a padding handle updates all four sides together.
|
|
25
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
26
|
+
- Visual structure reorders now verify after source updates even when HMR changes runtime identities
|
|
27
|
+
|
|
28
|
+
### Fixed
|
|
29
|
+
|
|
30
|
+
- Alt-dragging a layer inside a group now keeps the duplicate under the cursor for the whole drag instead of jumping into place on release.
|
|
31
|
+
- Breakpoint width edits preserve the existing breakpoint, and new Screens stay clear of visible breakpoint previews.
|
|
32
|
+
- Changing a grid's column or row count no longer turns fill or hug tracks into fixed pixel sizes
|
|
33
|
+
- Creating and focusing Screens keeps the canvas zoom and position stable.
|
|
34
|
+
- Figma imports preserve original layer names in the Layers panel
|
|
35
|
+
- Figma layer names now survive import, rename, and reload in Design
|
|
36
|
+
- Fixed padding indicator tick marks so they render at the same length on every edge
|
|
37
|
+
- Groups now resize with linked text overrides in the editor, previews, and exports.
|
|
38
|
+
- Keep local Design rotation edits undoable while preserving collaboration conflict checks.
|
|
39
|
+
- New designs start with fresh prompts, reliable asset picking, and responsive screens.
|
|
40
|
+
- Overview canvas no longer shows generated screens as blank or black frames at low zoom
|
|
41
|
+
- Prevent pending visual edits from being lost during screen navigation
|
|
42
|
+
- Rapid dependent layout edits now retain changes made immediately before them.
|
|
43
|
+
- Restore the standard Agent-Native chat header and tabs in the Design editor.
|
|
44
|
+
- Text typed immediately after clicking the Text tool on empty canvas space is no longer lost, and the new layer is named from what you typed
|
|
45
|
+
- The Letter spacing field now accepts percentages and em values like Figma, and keeps two decimals instead of rounding 0.64 to 0.6
|
|
46
|
+
- Visual edit maps keep query-specific screens distinct and expose the latest native WebMCP surface.
|
|
47
|
+
|
|
12
48
|
## 2026-09-14
|
|
13
49
|
|
|
14
50
|
### Added
|
|
@@ -9,6 +9,11 @@ import { numericDesignDataWriteError } from "../shared/canvas-frames.js";
|
|
|
9
9
|
|
|
10
10
|
const MAX_DATA_CAS_ATTEMPTS = 5;
|
|
11
11
|
const MAX_DATA_OPERATION_SOURCES = 128;
|
|
12
|
+
const NUMERIC_DESIGN_DATA_MAPS = new Set([
|
|
13
|
+
"canvasFrames",
|
|
14
|
+
"screenMetadata",
|
|
15
|
+
"localhostScreens",
|
|
16
|
+
]);
|
|
12
17
|
const FORBIDDEN_DATA_PATH_SEGMENTS = new Set([
|
|
13
18
|
"__proto__",
|
|
14
19
|
"constructor",
|
|
@@ -237,6 +242,39 @@ function applyDataOperations(
|
|
|
237
242
|
return JSON.stringify(root);
|
|
238
243
|
}
|
|
239
244
|
|
|
245
|
+
function validatePersistedDataSnapshot(
|
|
246
|
+
raw: string,
|
|
247
|
+
touchedMaps?: ReadonlySet<string>,
|
|
248
|
+
touchedCanvasFrameIds?: ReadonlySet<string>,
|
|
249
|
+
): void {
|
|
250
|
+
const parsed = JSON.parse(raw);
|
|
251
|
+
if (!isRecord(parsed)) return;
|
|
252
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
253
|
+
if (
|
|
254
|
+
touchedMaps &&
|
|
255
|
+
NUMERIC_DESIGN_DATA_MAPS.has(key) &&
|
|
256
|
+
!touchedMaps.has(key)
|
|
257
|
+
) {
|
|
258
|
+
continue;
|
|
259
|
+
}
|
|
260
|
+
if (key === "canvasFrames" && touchedCanvasFrameIds) {
|
|
261
|
+
if (!isRecord(value)) {
|
|
262
|
+
const message = numericDesignDataWriteError([key], value);
|
|
263
|
+
if (message) throw new Error(message);
|
|
264
|
+
continue;
|
|
265
|
+
}
|
|
266
|
+
for (const [frameId, frame] of Object.entries(value)) {
|
|
267
|
+
if (!touchedCanvasFrameIds.has(frameId)) continue;
|
|
268
|
+
const message = numericDesignDataWriteError([key, frameId], frame);
|
|
269
|
+
if (message) throw new Error(message);
|
|
270
|
+
}
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
const message = numericDesignDataWriteError([key], value);
|
|
274
|
+
if (message) throw new Error(message);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
|
|
240
278
|
export default defineAction({
|
|
241
279
|
description:
|
|
242
280
|
"Update an existing design project. Requires editor access. " +
|
|
@@ -244,7 +282,11 @@ export default defineAction({
|
|
|
244
282
|
"For map entries such as canvasFrames, use dataOperations " +
|
|
245
283
|
"with explicit set/delete paths instead of a full data snapshot. " +
|
|
246
284
|
"Dimensions and positions (x, y, width, height, rotation, z) are " +
|
|
247
|
-
"numbers. String values are rejected."
|
|
285
|
+
"numbers. String values are rejected. Renderable screens created by " +
|
|
286
|
+
"create-file or generate-design are auto-placed, so omit canvasFrames " +
|
|
287
|
+
"unless intentionally placing or moving a frame. Full placement objects " +
|
|
288
|
+
"must provide complete numeric geometry; path-addressed updates may change " +
|
|
289
|
+
"individual numeric fields.",
|
|
248
290
|
schema: z
|
|
249
291
|
.object({
|
|
250
292
|
id: z.string().describe("Design ID"),
|
|
@@ -457,6 +499,32 @@ export default defineAction({
|
|
|
457
499
|
})
|
|
458
500
|
: data!;
|
|
459
501
|
}
|
|
502
|
+
// Validate the complete post-operation snapshot. Nested set/delete
|
|
503
|
+
// operations can otherwise leave an empty canvas frame after the
|
|
504
|
+
// per-value numeric checks have passed.
|
|
505
|
+
const touchedMaps = dataOperations
|
|
506
|
+
? new Set(dataOperations.map((operation) => operation.path[0]))
|
|
507
|
+
: (() => {
|
|
508
|
+
const parsed = JSON.parse(data!);
|
|
509
|
+
return new Set(isRecord(parsed) ? Object.keys(parsed) : []);
|
|
510
|
+
})();
|
|
511
|
+
const touchedCanvasFrameIds = dataOperations
|
|
512
|
+
? (() => {
|
|
513
|
+
const ids = dataOperations
|
|
514
|
+
.filter(
|
|
515
|
+
(operation) =>
|
|
516
|
+
operation.path[0] === "canvasFrames" &&
|
|
517
|
+
operation.path.length > 1,
|
|
518
|
+
)
|
|
519
|
+
.map((operation) => operation.path[1]!);
|
|
520
|
+
return ids.length > 0 ? new Set(ids) : undefined;
|
|
521
|
+
})()
|
|
522
|
+
: undefined;
|
|
523
|
+
validatePersistedDataSnapshot(
|
|
524
|
+
nextData,
|
|
525
|
+
touchedMaps,
|
|
526
|
+
touchedCanvasFrameIds,
|
|
527
|
+
);
|
|
460
528
|
|
|
461
529
|
// Compare-and-swap on the exact data snapshot. Transactions at the
|
|
462
530
|
// default isolation level do not make a read-merge-write safe: two
|
|
@@ -3016,6 +3016,20 @@ declare var __INITIAL_SOURCE_HEAD__: string;
|
|
|
3016
3016
|
"gridTemplateColumns",
|
|
3017
3017
|
"gridTemplateRows",
|
|
3018
3018
|
"gridAutoFlow",
|
|
3019
|
+
"flexDirection",
|
|
3020
|
+
"flexWrap",
|
|
3021
|
+
"columnGap",
|
|
3022
|
+
"rowGap",
|
|
3023
|
+
"justifyContent",
|
|
3024
|
+
"paddingTop",
|
|
3025
|
+
"paddingRight",
|
|
3026
|
+
"paddingBottom",
|
|
3027
|
+
"paddingLeft",
|
|
3028
|
+
"alignItems",
|
|
3029
|
+
"alignContent",
|
|
3030
|
+
"justifyItems",
|
|
3031
|
+
"gap",
|
|
3032
|
+
"padding",
|
|
3019
3033
|
"webkitBoxOrient",
|
|
3020
3034
|
"webkitLineClamp",
|
|
3021
3035
|
"--agent-native-truncate-original-display",
|
package/corpus/templates/design/app/components/design/edit-panel/interaction-state-helpers.ts
CHANGED
|
@@ -16,6 +16,20 @@ export const AUTHORED_INLINE_STYLE_PROPERTIES = [
|
|
|
16
16
|
"gridTemplateColumns",
|
|
17
17
|
"gridTemplateRows",
|
|
18
18
|
"gridAutoFlow",
|
|
19
|
+
"flexDirection",
|
|
20
|
+
"flexWrap",
|
|
21
|
+
"columnGap",
|
|
22
|
+
"rowGap",
|
|
23
|
+
"justifyContent",
|
|
24
|
+
"paddingTop",
|
|
25
|
+
"paddingRight",
|
|
26
|
+
"paddingBottom",
|
|
27
|
+
"paddingLeft",
|
|
28
|
+
"alignItems",
|
|
29
|
+
"alignContent",
|
|
30
|
+
"justifyItems",
|
|
31
|
+
"gap",
|
|
32
|
+
"padding",
|
|
19
33
|
"display",
|
|
20
34
|
"overflow",
|
|
21
35
|
"webkitBoxOrient",
|
|
@@ -111,6 +111,12 @@ function numericEntryError(
|
|
|
111
111
|
if (!entry || typeof entry !== "object" || Array.isArray(entry)) {
|
|
112
112
|
return `Design ${map} entry must be an object with numeric width and height fields, received ${describeRejectedValue(entry)}. Use a delete operation to clear an entry.`;
|
|
113
113
|
}
|
|
114
|
+
if (
|
|
115
|
+
map === "canvasFrames" &&
|
|
116
|
+
!Object.keys(entry).some((key) => numericKeys.has(key))
|
|
117
|
+
) {
|
|
118
|
+
return "Design canvasFrames entry must include at least one geometry field. Use a delete operation to clear an entry.";
|
|
119
|
+
}
|
|
114
120
|
if (map === "screenMetadata") {
|
|
115
121
|
const heights = (entry as Record<string, unknown>).breakpointHeights;
|
|
116
122
|
if (heights !== undefined) {
|
|
@@ -7,11 +7,15 @@ time from the command menu (Cmd+K → "What's new") or from Settings.
|
|
|
7
7
|
|
|
8
8
|
### Improved
|
|
9
9
|
|
|
10
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
10
11
|
- Mail labels recipient and account controls for keyboard and assistive-technology parity.
|
|
11
12
|
- Match Superhuman's compact compose card geometry on desktop
|
|
12
13
|
|
|
13
14
|
### Fixed
|
|
14
15
|
|
|
16
|
+
- Inbox archive and read-state changes stay consistent during rapid actions
|
|
17
|
+
- Mail keeps rapid archive and read actions in sync
|
|
18
|
+
- Mail recovers cleanly when an email view or navigation takes too long to load.
|
|
15
19
|
- New drafts focus the To field immediately for keyboard-first composing
|
|
16
20
|
|
|
17
21
|
## 2026-09-14
|
|
@@ -3,6 +3,21 @@
|
|
|
3
3
|
All notable user-facing changes to Agent-Native Slides are documented here. Open it any
|
|
4
4
|
time from the command menu (Cmd+K → "What's new").
|
|
5
5
|
|
|
6
|
+
## 2026-09-15
|
|
7
|
+
|
|
8
|
+
### Improved
|
|
9
|
+
|
|
10
|
+
- Design previews can inspect every onboarding step and apply visual edits more reliably across screens.
|
|
11
|
+
- Generated slide decks keep a cohesive visual theme while layouts vary with the story
|
|
12
|
+
- Account menus are now shorter, with workspace apps and agent management available in Settings.
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Google Slides exports keep every line of text where it sits in Slides instead of re-wrapping into overlapping, stacked text.
|
|
17
|
+
- Imported decks now export to PowerPoint and Google Slides in their original layer order, so background panels no longer cover slide content
|
|
18
|
+
- PowerPoint and Google Slides exports keep full-size text on every slide, not just the one open in the editor.
|
|
19
|
+
- Table rules and dividers now export to PowerPoint and Google Slides as editable lines instead of images
|
|
20
|
+
|
|
6
21
|
## 2026-09-14
|
|
7
22
|
|
|
8
23
|
### Improved
|
|
@@ -12,6 +27,7 @@ time from the command menu (Cmd+K → "What's new").
|
|
|
12
27
|
|
|
13
28
|
### Fixed
|
|
14
29
|
|
|
30
|
+
- Asking the agent to restyle a whole deck no longer reports slides as beautified when their content was left exactly as it was, and a restyle that changes nothing now fails instead of claiming success.
|
|
15
31
|
- An attached PDF, PowerPoint, or Word reference is now read before a new deck is generated, and its typography, palette, and page proportions steer the design instead of being silently dropped
|
|
16
32
|
- Creating a design system no longer fails silently when Builder indexing is unavailable.
|
|
17
33
|
- Design system creation from onboarding now opens inline instead of a new tab, so onboarding progress is no longer lost
|
|
@@ -186,8 +186,8 @@ export declare function createAutomationCallbackHandler(runtime: AutomationRunti
|
|
|
186
186
|
duplicate?: undefined;
|
|
187
187
|
eventId?: undefined;
|
|
188
188
|
} | {
|
|
189
|
+
error?: undefined;
|
|
189
190
|
accepted: boolean;
|
|
190
191
|
duplicate: boolean;
|
|
191
192
|
eventId: string;
|
|
192
|
-
error?: undefined;
|
|
193
193
|
}>;
|
package/dist/collab/routes.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const getCollabState: import("h3").EventHandlerWithFetch<import("
|
|
|
26
26
|
* Body: { update: string (base64), requestSource?: string }
|
|
27
27
|
*/
|
|
28
28
|
export declare const postCollabUpdate: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
29
|
-
error: string;
|
|
30
29
|
ok?: undefined;
|
|
30
|
+
error: string;
|
|
31
31
|
} | {
|
|
32
32
|
error?: undefined;
|
|
33
33
|
ok: boolean;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* Body: { json: any, fieldName?: string, type?: "map"|"array", requestSource?: string }
|
|
14
14
|
*/
|
|
15
15
|
export declare const postCollabJson: import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
16
|
-
ok?: undefined;
|
|
17
16
|
error: string;
|
|
17
|
+
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
package/dist/deploy/build.d.ts
CHANGED
package/dist/deploy/build.js
CHANGED
|
@@ -19,6 +19,7 @@ import fs from "fs";
|
|
|
19
19
|
import { createRequire } from "module";
|
|
20
20
|
import path from "path";
|
|
21
21
|
import { fileURLToPath } from "url";
|
|
22
|
+
import { runInNewContext } from "vm";
|
|
22
23
|
import { loadEnv } from "vite";
|
|
23
24
|
import { AGENT_BACKGROUND_FUNCTION_NAME, AGENT_BACKGROUND_FUNCTION_URL_PATH, AGENT_BACKGROUND_PROCESSOR_A2A, AGENT_BACKGROUND_PROCESSOR_FIELD, AGENT_BACKGROUND_PROCESSOR_INTEGRATION, AGENT_BACKGROUND_PROCESSOR_ROUTE, AGENT_BACKGROUND_PROCESSOR_ROUTE_FIELD, AGENT_CHAT_PROCESS_RUN_PATH, isDurableBackgroundFlagExplicitlyDisabled, } from "../agent/durable-background.js";
|
|
24
25
|
import { declaredEnvKeys } from "../app-config/describe.js";
|
|
@@ -1855,6 +1856,152 @@ function findReactRouterManifest(distDir) {
|
|
|
1855
1856
|
}
|
|
1856
1857
|
return JSON.parse(match[1].replace(/;$/, ""));
|
|
1857
1858
|
}
|
|
1859
|
+
const REACT_ROUTER_ASSET_MANIFEST_FIELDS = [
|
|
1860
|
+
"module",
|
|
1861
|
+
"imports",
|
|
1862
|
+
"css",
|
|
1863
|
+
"clientActionModule",
|
|
1864
|
+
"clientLoaderModule",
|
|
1865
|
+
"clientMiddlewareModule",
|
|
1866
|
+
"hydrateFallbackModule",
|
|
1867
|
+
];
|
|
1868
|
+
function asManifestRecord(value, label) {
|
|
1869
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
1870
|
+
throw new Error(`React Router ${label} is not an object`);
|
|
1871
|
+
}
|
|
1872
|
+
return value;
|
|
1873
|
+
}
|
|
1874
|
+
function copyReactRouterAssetManifestFields(target, source) {
|
|
1875
|
+
for (const field of REACT_ROUTER_ASSET_MANIFEST_FIELDS) {
|
|
1876
|
+
if (Object.prototype.hasOwnProperty.call(source, field)) {
|
|
1877
|
+
target[field] = source[field];
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
/**
|
|
1882
|
+
* The trusted Functions build starts from the base checkout, while a PR
|
|
1883
|
+
* preview supplies the PR's client build. Keep the server route metadata from
|
|
1884
|
+
* the trusted build, but make every client asset reference agree with the
|
|
1885
|
+
* paired artifact in Nitro's emitted server bundle.
|
|
1886
|
+
*/
|
|
1887
|
+
function mergeReactRouterServerManifest(serverManifest, clientManifest) {
|
|
1888
|
+
const serverManifestRecord = asManifestRecord(serverManifest, "server manifest");
|
|
1889
|
+
const serverEntry = asManifestRecord(serverManifestRecord.entry, "server manifest entry");
|
|
1890
|
+
const clientManifestRecord = clientManifest;
|
|
1891
|
+
const clientEntry = asManifestRecord(clientManifestRecord.entry, "client manifest entry");
|
|
1892
|
+
copyReactRouterAssetManifestFields(serverEntry, clientEntry);
|
|
1893
|
+
const serverRoutes = asManifestRecord(serverManifestRecord.routes, "server manifest routes");
|
|
1894
|
+
const clientRoutes = asManifestRecord(clientManifestRecord.routes, "client manifest routes");
|
|
1895
|
+
const serverRouteIds = Object.keys(serverRoutes).sort();
|
|
1896
|
+
const clientRouteIds = Object.keys(clientRoutes).sort();
|
|
1897
|
+
if (serverRouteIds.join("\n") !== clientRouteIds.join("\n")) {
|
|
1898
|
+
throw new Error(`React Router server/client route manifests differ: server=${serverRouteIds.join(",")} client=${clientRouteIds.join(",")}`);
|
|
1899
|
+
}
|
|
1900
|
+
for (const routeId of clientRouteIds) {
|
|
1901
|
+
copyReactRouterAssetManifestFields(asManifestRecord(serverRoutes[routeId], `server route ${routeId}`), asManifestRecord(clientRoutes[routeId], `client route ${routeId}`));
|
|
1902
|
+
}
|
|
1903
|
+
for (const field of ["url", "version", "sri"]) {
|
|
1904
|
+
if (Object.prototype.hasOwnProperty.call(clientManifestRecord, field)) {
|
|
1905
|
+
serverManifestRecord[field] = clientManifestRecord[field];
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1908
|
+
return serverManifestRecord;
|
|
1909
|
+
}
|
|
1910
|
+
function findJavaScriptObjectEnd(source, valueStart) {
|
|
1911
|
+
const stack = [];
|
|
1912
|
+
let quote;
|
|
1913
|
+
let escaped = false;
|
|
1914
|
+
for (let index = valueStart; index < source.length; index += 1) {
|
|
1915
|
+
const character = source[index];
|
|
1916
|
+
if (quote) {
|
|
1917
|
+
if (escaped) {
|
|
1918
|
+
escaped = false;
|
|
1919
|
+
}
|
|
1920
|
+
else if (character === "\\") {
|
|
1921
|
+
escaped = true;
|
|
1922
|
+
}
|
|
1923
|
+
else if (character === quote) {
|
|
1924
|
+
quote = undefined;
|
|
1925
|
+
}
|
|
1926
|
+
continue;
|
|
1927
|
+
}
|
|
1928
|
+
if (character === "'" || character === '"' || character === "`") {
|
|
1929
|
+
quote = character;
|
|
1930
|
+
continue;
|
|
1931
|
+
}
|
|
1932
|
+
if (character === "{" || character === "[" || character === "(") {
|
|
1933
|
+
stack.push(character === "{" ? "}" : character === "[" ? "]" : ")");
|
|
1934
|
+
continue;
|
|
1935
|
+
}
|
|
1936
|
+
if (character === "}" || character === "]" || character === ")") {
|
|
1937
|
+
if (stack.pop() !== character) {
|
|
1938
|
+
throw new Error("React Router server manifest has unbalanced syntax");
|
|
1939
|
+
}
|
|
1940
|
+
if (stack.length === 0)
|
|
1941
|
+
return index;
|
|
1942
|
+
}
|
|
1943
|
+
}
|
|
1944
|
+
throw new Error("React Router server manifest object is unterminated");
|
|
1945
|
+
}
|
|
1946
|
+
function evaluateReactRouterServerManifest(source, serverBuildFile, valueStart, valueEnd) {
|
|
1947
|
+
try {
|
|
1948
|
+
return runInNewContext(`(${source.slice(valueStart, valueEnd + 1)})`, Object.create(null), { timeout: 1000 });
|
|
1949
|
+
}
|
|
1950
|
+
catch (error) {
|
|
1951
|
+
throw new Error(`Could not parse React Router server manifest ${serverBuildFile}: ${error instanceof Error ? error.message : String(error)}`);
|
|
1952
|
+
}
|
|
1953
|
+
}
|
|
1954
|
+
function patchReactRouterServerManifestSource(source, serverBuildFile, clientManifest) {
|
|
1955
|
+
const regionStart = source.indexOf("//#region \\0virtual:react-router/server-manifest");
|
|
1956
|
+
if (regionStart >= 0) {
|
|
1957
|
+
const assignmentStart = source.indexOf("var server_manifest_default = ", regionStart);
|
|
1958
|
+
const regionEnd = source.indexOf("//#endregion", assignmentStart);
|
|
1959
|
+
const assignmentEnd = source.lastIndexOf(";", regionEnd);
|
|
1960
|
+
if (assignmentStart < 0 ||
|
|
1961
|
+
regionEnd < 0 ||
|
|
1962
|
+
assignmentEnd < assignmentStart) {
|
|
1963
|
+
throw new Error(`React Router server manifest assignment not found in ${serverBuildFile}`);
|
|
1964
|
+
}
|
|
1965
|
+
const valueStart = assignmentStart + "var server_manifest_default = ".length;
|
|
1966
|
+
const serverManifest = evaluateReactRouterServerManifest(source, serverBuildFile, valueStart, assignmentEnd - 1);
|
|
1967
|
+
const replacement = JSON.stringify(mergeReactRouterServerManifest(serverManifest, clientManifest));
|
|
1968
|
+
return (source.slice(0, valueStart) + replacement + source.slice(assignmentEnd));
|
|
1969
|
+
}
|
|
1970
|
+
const assignments = /\b[A-Za-z_$][\w$]*\s*=\s*(\{\s*(?:entry|["']entry["'])\s*:)/g;
|
|
1971
|
+
for (const match of source.matchAll(assignments)) {
|
|
1972
|
+
const valueStart = match.index + match[0].lastIndexOf("{");
|
|
1973
|
+
const valueEnd = findJavaScriptObjectEnd(source, valueStart);
|
|
1974
|
+
const serverManifest = evaluateReactRouterServerManifest(source, serverBuildFile, valueStart, valueEnd);
|
|
1975
|
+
if (!serverManifest ||
|
|
1976
|
+
typeof serverManifest !== "object" ||
|
|
1977
|
+
Array.isArray(serverManifest) ||
|
|
1978
|
+
!("routes" in serverManifest) ||
|
|
1979
|
+
!("url" in serverManifest)) {
|
|
1980
|
+
continue;
|
|
1981
|
+
}
|
|
1982
|
+
const replacement = JSON.stringify(mergeReactRouterServerManifest(serverManifest, clientManifest));
|
|
1983
|
+
return (source.slice(0, valueStart) + replacement + source.slice(valueEnd + 1));
|
|
1984
|
+
}
|
|
1985
|
+
return undefined;
|
|
1986
|
+
}
|
|
1987
|
+
function patchReactRouterServerManifestInOutput(serverDirectory, clientDirectory) {
|
|
1988
|
+
const clientManifest = findReactRouterManifest(clientDirectory);
|
|
1989
|
+
let patchedFile;
|
|
1990
|
+
walkServerJavaScriptFiles(serverDirectory, (serverBuildFile) => {
|
|
1991
|
+
if (patchedFile)
|
|
1992
|
+
return;
|
|
1993
|
+
const source = fs.readFileSync(serverBuildFile, "utf8");
|
|
1994
|
+
const patched = patchReactRouterServerManifestSource(source, serverBuildFile, clientManifest);
|
|
1995
|
+
if (patched === undefined)
|
|
1996
|
+
return;
|
|
1997
|
+
fs.writeFileSync(serverBuildFile, patched);
|
|
1998
|
+
patchedFile = serverBuildFile;
|
|
1999
|
+
});
|
|
2000
|
+
if (!patchedFile) {
|
|
2001
|
+
throw new Error(`React Router server manifest not found in Nitro output ${serverDirectory}`);
|
|
2002
|
+
}
|
|
2003
|
+
console.log(`[deploy] Paired React Router server manifest in ${path.relative(process.cwd(), patchedFile)} with ${path.basename(clientDirectory)}`);
|
|
2004
|
+
}
|
|
1858
2005
|
function collectModulePreloads(manifest, route) {
|
|
1859
2006
|
const paths = new Set();
|
|
1860
2007
|
const add = (value) => {
|
|
@@ -4056,6 +4203,7 @@ export async function runNitroBuildPipeline(opts) {
|
|
|
4056
4203
|
const { nitro, hooks, clientDir, publicOutputDir, appBasePath, cwd, includeImmutableAssetRouteRules = true, } = opts;
|
|
4057
4204
|
const resolvedClientDir = resolveNitroClientDirectory(cwd, clientDir);
|
|
4058
4205
|
const hasClientBuild = fs.existsSync(resolvedClientDir) && Boolean(publicOutputDir);
|
|
4206
|
+
const usingPairedClientArtifact = Boolean(process.env[PREBUILT_CLIENT_DIRECTORY_ENV]?.trim());
|
|
4059
4207
|
if (hasClientBuild && includeImmutableAssetRouteRules) {
|
|
4060
4208
|
// Install hashed-asset route rules before Nitro prepares platform output.
|
|
4061
4209
|
// Some presets materialize headers during prepare/copy phases, not only in
|
|
@@ -4075,6 +4223,9 @@ export async function runNitroBuildPipeline(opts) {
|
|
|
4075
4223
|
console.log(`[deploy] Copied client assets to ${path.relative(cwd, publicOutputDir)}`);
|
|
4076
4224
|
}
|
|
4077
4225
|
await hooks.nitroBuild(nitro);
|
|
4226
|
+
if (hasClientBuild && usingPairedClientArtifact) {
|
|
4227
|
+
patchReactRouterServerManifestInOutput(nitro.options.output.serverDir, resolvedClientDir);
|
|
4228
|
+
}
|
|
4078
4229
|
}
|
|
4079
4230
|
function resolveNitroClientDirectory(cwd, defaultClientDirectory) {
|
|
4080
4231
|
const configured = process.env[PREBUILT_CLIENT_DIRECTORY_ENV]?.trim();
|
|
@@ -17,11 +17,11 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
17
17
|
url?: undefined;
|
|
18
18
|
provider?: undefined;
|
|
19
19
|
} | {
|
|
20
|
+
error?: undefined;
|
|
20
21
|
configured?: undefined;
|
|
21
22
|
connectPath?: undefined;
|
|
22
23
|
url: string;
|
|
23
24
|
id: string;
|
|
24
25
|
provider: string;
|
|
25
|
-
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export default _default;
|
|
@@ -41,27 +41,27 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
+
error?: undefined;
|
|
45
|
+
ok?: undefined;
|
|
44
46
|
summary: import("./types.js").TraceSummary;
|
|
45
47
|
spans: import("./types.js").TraceSpan[];
|
|
46
48
|
id?: undefined;
|
|
49
|
+
} | {
|
|
47
50
|
error?: undefined;
|
|
48
51
|
ok?: undefined;
|
|
49
|
-
} | {
|
|
50
52
|
summary?: undefined;
|
|
51
53
|
spans?: undefined;
|
|
52
54
|
id: string;
|
|
53
|
-
error?: undefined;
|
|
54
|
-
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
|
+
ok?: undefined;
|
|
56
57
|
summary?: undefined;
|
|
57
58
|
spans?: undefined;
|
|
58
59
|
id?: undefined;
|
|
59
60
|
error: any;
|
|
60
|
-
ok?: undefined;
|
|
61
61
|
} | {
|
|
62
|
+
error?: undefined;
|
|
62
63
|
summary?: undefined;
|
|
63
64
|
spans?: undefined;
|
|
64
65
|
id?: undefined;
|
|
65
|
-
error?: undefined;
|
|
66
66
|
ok: boolean;
|
|
67
67
|
}>>;
|
|
@@ -56,10 +56,10 @@ export declare function createAgentEngineApiKeyHandler(): import("h3").EventHand
|
|
|
56
56
|
ok: boolean;
|
|
57
57
|
error: string;
|
|
58
58
|
} | {
|
|
59
|
-
error?: undefined;
|
|
60
59
|
ok: boolean;
|
|
61
60
|
key: string;
|
|
62
61
|
baseUrlKey?: string;
|
|
63
62
|
scope: AgentEngineApiKeyScope;
|
|
63
|
+
error?: undefined;
|
|
64
64
|
}>>;
|
|
65
65
|
export {};
|
|
@@ -59,8 +59,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
59
59
|
expiresAt?: undefined;
|
|
60
60
|
ttlSeconds?: undefined;
|
|
61
61
|
} | {
|
|
62
|
-
error?: undefined;
|
|
63
62
|
token: string;
|
|
64
63
|
expiresAt: string;
|
|
65
64
|
ttlSeconds: number;
|
|
65
|
+
error?: undefined;
|
|
66
66
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.181.0
|
|
3
|
+
"version": "0.181.0",
|
|
4
4
|
"description": "The agentic application framework for building autonomous agents with intuitive UIs",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -484,9 +484,9 @@
|
|
|
484
484
|
"yaml": "^2.9.0",
|
|
485
485
|
"yjs": "^13.6.32",
|
|
486
486
|
"zod": "^4.3.6",
|
|
487
|
-
"@agent-native/recap-cli": "0.5.
|
|
488
|
-
"@agent-native/
|
|
489
|
-
"@agent-native/
|
|
487
|
+
"@agent-native/recap-cli": "0.5.32",
|
|
488
|
+
"@agent-native/agentkit": "^0.2.2",
|
|
489
|
+
"@agent-native/toolkit": "^0.20.2"
|
|
490
490
|
},
|
|
491
491
|
"devDependencies": {
|
|
492
492
|
"@ai-sdk/anthropic": "^3.0.71",
|