@agent-native/core 0.0.0-beta-20260819173911 → 0.0.0-beta-20260819181349
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/clips/changelog/2026-08-19-clips-nightly-builds-are-available-for-trying-the-latest-upd.md +6 -0
- package/corpus/templates/clips/changelog/2026-08-19-social-preview-video-frames.md +1 -0
- package/corpus/templates/clips/desktop/README.md +19 -4
- package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +3 -2
- package/corpus/templates/clips/desktop/src-tauri/tauri.conf.json +1 -0
- package/corpus/templates/clips/server/routes/api/clips-updater.json.get.ts +41 -22
- package/dist/client/AgentPanel.d.ts +5 -1
- package/dist/client/AgentPanel.js +2 -2
- package/dist/client/AssistantChat.d.ts +5 -1
- package/dist/client/AssistantChat.js +40 -6
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/package.json +1 -1
package/corpus/README.md
CHANGED
|
@@ -79,13 +79,28 @@ Clips registers itself to open at login by default, then runs quietly in the men
|
|
|
79
79
|
|
|
80
80
|
## Releases + auto-update
|
|
81
81
|
|
|
82
|
-
Clips Desktop
|
|
82
|
+
Clips Desktop has separate stable and Nightly lanes. The stable app keeps the
|
|
83
|
+
`Clips` name, `Clips` binary, `clips://` scheme, and `com.clips.tray` identifier;
|
|
84
|
+
its releases use `clips-v*` tags, the `clips-latest` updater pointer, and
|
|
85
|
+
`/api/clips-updater.json`. Nightly builds are named `Clips Nightly`, use the
|
|
86
|
+
`Clips-Nightly` binary, the `clips-nightly://` scheme, and
|
|
87
|
+
`com.clips.tray.nightly`. They use the `clips-nightly-v*` tags,
|
|
88
|
+
`clips-nightly-latest` pointer, and `/api/clips-updater.json?channel=nightly`.
|
|
89
|
+
The in-app updater only sees the pointer for the channel that produced the
|
|
90
|
+
installed app, and the separate native binary/desktop entry keeps both lanes
|
|
91
|
+
installable at once.
|
|
83
92
|
|
|
84
93
|
### Shipping a release
|
|
85
94
|
|
|
86
|
-
1.
|
|
87
|
-
|
|
88
|
-
|
|
95
|
+
1. For a stable release, dispatch **Clips Desktop Release** in GitHub Actions
|
|
96
|
+
with `channel: production` and an explicit version. Stable releases are
|
|
97
|
+
deliberate workflow runs; pushes to `main` never replace the stable lane.
|
|
98
|
+
2. Pushes to `main` automatically build the Nightly lane. A Nightly run can
|
|
99
|
+
also be dispatched explicitly with `channel: nightly`.
|
|
100
|
+
3. The workflow builds macOS (universal), Windows, and Linux x86_64 installers,
|
|
101
|
+
signs updater artifacts, and publishes the versioned release plus that
|
|
102
|
+
channel's pointer manifest. Installed copies auto-download only updates
|
|
103
|
+
from their own lane on the next hourly or app-focus check.
|
|
89
104
|
|
|
90
105
|
### Auto-update flow (inside the app)
|
|
91
106
|
|
|
@@ -15,8 +15,9 @@ crate-type = ["lib", "cdylib", "staticlib"]
|
|
|
15
15
|
|
|
16
16
|
# Force the dev binary name so macOS shows "Clips" in the Dock / app switcher
|
|
17
17
|
# (macOS derives the display name from the executable filename when the app
|
|
18
|
-
# is unbundled — e.g. during `tauri dev`).
|
|
19
|
-
#
|
|
18
|
+
# is unbundled — e.g. during `tauri dev`). The Nightly release workflow
|
|
19
|
+
# rewrites this target and tauri.conf.json's mainBinaryName to
|
|
20
|
+
# `Clips-Nightly` before packaging so both lanes can coexist.
|
|
20
21
|
[[bin]]
|
|
21
22
|
name = "Clips"
|
|
22
23
|
path = "src/main.rs"
|
|
@@ -1,17 +1,23 @@
|
|
|
1
|
-
import { defineEventHandler, setResponseHeaders } from "h3";
|
|
1
|
+
import { defineEventHandler, getQuery, setResponseHeaders } from "h3";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Tauri updater manifest endpoint for the Clips desktop app.
|
|
5
5
|
*
|
|
6
6
|
* The installed app only needs this endpoint to be valid JSON when no signed
|
|
7
|
-
* updater bundle is available. If the
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* updater bundle is available. If the channel's GitHub pointer release exists,
|
|
8
|
+
* we proxy its signed manifest. If it does not, return a deliberately old
|
|
9
|
+
* no-update manifest so the desktop UI stays quiet instead of surfacing a
|
|
10
10
|
* release-channel setup error to end users.
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
type ClipsUpdateChannel = "production" | "nightly";
|
|
14
|
+
|
|
15
|
+
const GITHUB_MANIFEST_URL: Record<ClipsUpdateChannel, string> = {
|
|
16
|
+
production:
|
|
17
|
+
"https://github.com/BuilderIO/agent-native/releases/download/clips-latest/clips-latest.json",
|
|
18
|
+
nightly:
|
|
19
|
+
"https://github.com/BuilderIO/agent-native/releases/download/clips-nightly-latest/clips-nightly-latest.json",
|
|
20
|
+
};
|
|
15
21
|
const CACHE_TTL_MS = 5 * 60_000;
|
|
16
22
|
|
|
17
23
|
// Tauri throws a red-banner error if the requesting client's target triple is
|
|
@@ -48,8 +54,8 @@ export const INERT_MANIFEST = {
|
|
|
48
54
|
},
|
|
49
55
|
};
|
|
50
56
|
|
|
51
|
-
|
|
52
|
-
|
|
57
|
+
const cache = new Map<ClipsUpdateChannel, { data: unknown; ts: number }>();
|
|
58
|
+
const inFlight = new Map<ClipsUpdateChannel, Promise<unknown>>();
|
|
53
59
|
|
|
54
60
|
function isManifestLike(value: unknown): value is Record<string, unknown> {
|
|
55
61
|
if (!value || typeof value !== "object") return false;
|
|
@@ -72,8 +78,10 @@ export function hasAllRequiredPlatforms(value: unknown): boolean {
|
|
|
72
78
|
return REQUIRED_PLATFORM_KEYS.every((k) => k in platforms);
|
|
73
79
|
}
|
|
74
80
|
|
|
75
|
-
async function fetchSignedManifest(
|
|
76
|
-
|
|
81
|
+
async function fetchSignedManifest(
|
|
82
|
+
channel: ClipsUpdateChannel,
|
|
83
|
+
): Promise<unknown> {
|
|
84
|
+
const res = await fetch(GITHUB_MANIFEST_URL[channel], {
|
|
77
85
|
headers: {
|
|
78
86
|
accept: "application/json",
|
|
79
87
|
"user-agent": "clips-updater-manifest",
|
|
@@ -94,38 +102,49 @@ async function fetchSignedManifest(): Promise<unknown> {
|
|
|
94
102
|
return json;
|
|
95
103
|
}
|
|
96
104
|
|
|
97
|
-
|
|
105
|
+
function normalizeChannel(value: unknown): ClipsUpdateChannel {
|
|
106
|
+
return value === "nightly" ? "nightly" : "production";
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
async function getManifest(
|
|
110
|
+
channel: ClipsUpdateChannel = "production",
|
|
111
|
+
): Promise<unknown> {
|
|
98
112
|
const now = Date.now();
|
|
99
|
-
|
|
100
|
-
if (
|
|
101
|
-
|
|
113
|
+
const cached = cache.get(channel);
|
|
114
|
+
if (cached && now - cached.ts < CACHE_TTL_MS) return cached.data;
|
|
115
|
+
const pending = inFlight.get(channel);
|
|
116
|
+
if (pending) return pending;
|
|
117
|
+
const request = (async () => {
|
|
102
118
|
try {
|
|
103
|
-
const data = await fetchSignedManifest();
|
|
104
|
-
cache
|
|
119
|
+
const data = await fetchSignedManifest(channel);
|
|
120
|
+
cache.set(channel, { data, ts: Date.now() });
|
|
105
121
|
return data;
|
|
106
122
|
} catch {
|
|
107
123
|
// A validation or network failure may serve the last good manifest (or
|
|
108
124
|
// inert fallback), but it must not make that fallback fresh again.
|
|
109
125
|
// Otherwise an incomplete release manifest can indefinitely extend the
|
|
110
126
|
// stale cache window on every failed refresh.
|
|
111
|
-
return cache?.data ?? INERT_MANIFEST;
|
|
127
|
+
return cache.get(channel)?.data ?? INERT_MANIFEST;
|
|
112
128
|
} finally {
|
|
113
|
-
inFlight
|
|
129
|
+
inFlight.delete(channel);
|
|
114
130
|
}
|
|
115
131
|
})();
|
|
116
|
-
|
|
132
|
+
inFlight.set(channel, request);
|
|
133
|
+
return request;
|
|
117
134
|
}
|
|
118
135
|
|
|
119
136
|
export const __clipsUpdaterTest = {
|
|
120
137
|
getManifest,
|
|
121
138
|
reset() {
|
|
122
|
-
cache
|
|
123
|
-
inFlight
|
|
139
|
+
cache.clear();
|
|
140
|
+
inFlight.clear();
|
|
124
141
|
},
|
|
125
142
|
};
|
|
126
143
|
|
|
127
144
|
export default defineEventHandler(async (event) => {
|
|
128
|
-
const
|
|
145
|
+
const query = getQuery(event);
|
|
146
|
+
const channel = normalizeChannel(query.channel);
|
|
147
|
+
const manifest = await getManifest(channel);
|
|
129
148
|
setResponseHeaders(event, {
|
|
130
149
|
"content-type": "application/json; charset=utf-8",
|
|
131
150
|
"cache-control": "public, max-age=60",
|
|
@@ -223,6 +223,10 @@ export interface AgentSidebarProps {
|
|
|
223
223
|
apiUrl?: string;
|
|
224
224
|
/** Runtime surface identity used for server-side chat capabilities. */
|
|
225
225
|
agentChatSurface?: AgentChatSurfaceKind;
|
|
226
|
+
/** Whether the desktop host is currently showing its unauthenticated identity gate. */
|
|
227
|
+
desktopIdentityUnauthenticated?: AssistantChatProps["desktopIdentityUnauthenticated"];
|
|
228
|
+
/** Whether the desktop host has just established its authenticated identity session. */
|
|
229
|
+
desktopIdentityAuthenticated?: AssistantChatProps["desktopIdentityAuthenticated"];
|
|
226
230
|
/** Show the chat thread tab row. Default: true. */
|
|
227
231
|
showTabBar?: MultiTabAssistantChatProps["showTabBar"];
|
|
228
232
|
/** Keep inline app-opening results inside the current app chat. */
|
|
@@ -250,7 +254,7 @@ export interface AgentSidebarProps {
|
|
|
250
254
|
* Wraps app content with a toggleable agent sidebar.
|
|
251
255
|
* Use AgentToggleButton in your header to open/close it.
|
|
252
256
|
*/
|
|
253
|
-
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
257
|
+
export declare function AgentSidebar({ children, emptyStateText, suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position, defaultOpen, animateMobile, animateDesktop, chatViewTransition, chatViewTransitionHandoff, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding, }: AgentSidebarProps): React.JSX.Element;
|
|
254
258
|
/**
|
|
255
259
|
* Focus the agent chat composer input.
|
|
256
260
|
* Opens the sidebar if closed, then focuses the text input.
|
|
@@ -1418,7 +1418,7 @@ export function AgentChatSurface({ mode = "panel", className, defaultMode = "cha
|
|
|
1418
1418
|
* Wraps app content with a toggleable agent sidebar.
|
|
1419
1419
|
* Use AgentToggleButton in your header to open/close it.
|
|
1420
1420
|
*/
|
|
1421
|
-
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openStorageKey, apiUrl, agentChatSurface, showTabBar = true, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1421
|
+
export function AgentSidebar({ children, emptyStateText = "How can I help you?", suggestions, dynamicSuggestions, composerToolbarSlot, composerSlot, onComposerTextChange, imageModelMenu, availableAgents, availableModels, modelListLoading, selectedAgent, onAgentChange, onConnectLocalRuntime, runtime, adapterReloadKey, threadFooterSlot, defaultSidebarWidth, sidebarWidth, position = "right", defaultOpen = false, animateMobile = true, animateDesktop = true, chatViewTransition = false, chatViewTransitionHandoff = false, storageKey, openStorageKey, apiUrl, agentChatSurface, desktopIdentityUnauthenticated, desktopIdentityAuthenticated, showTabBar = true, suppressInlineOpenApp, composerPlaceholder, openOnChatRunning = false, onFullscreenRequest, scope, showScopeBadge, browserTabId, threadUrlSync, agentPageHref, suppressFirstRunOnboarding = false, }) {
|
|
1422
1422
|
const staticHostedHarnessEnabled = isHostedHarnessConfigured(injectedAgentNativeConfig().harness);
|
|
1423
1423
|
const hostedHarnessQuery = useActionQuery("get-hosted-harness-config", undefined, { enabled: staticHostedHarnessEnabled });
|
|
1424
1424
|
const hostedHarnessStatus = hostedHarnessQuery.data;
|
|
@@ -2059,7 +2059,7 @@ export function AgentSidebar({ children, emptyStateText = "How can I help you?",
|
|
|
2059
2059
|
? "desktop"
|
|
2060
2060
|
: undefined, "data-agent-sidebar-layout": panelLayout, "data-agent-sidebar-position": effectivePosition, "data-agent-native-hosted-harness-ui": hostedHarnessUi ? "desktop" : undefined, "data-agent-sidebar-state": panelOpen ? "open" : "closed", "data-agent-sidebar-per-app-chat": isPerAppChatSidebar ? "true" : undefined, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, "data-agent-sidebar-chat-handoff": chatViewTransitionHandoff ? "true" : undefined, style: chatViewTransition
|
|
2061
2061
|
? getAgentChatViewTransitionStyle(panelStyle)
|
|
2062
|
-
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, availableAgents: effectiveAvailableAgents, availableModels: availableModels, modelListLoading: modelListLoading, selectedAgent: effectiveSelectedAgent, onAgentChange: effectiveOnAgentChange, hostedHarness: hostedHarnessEnabled, onConnectLocalRuntime: onConnectLocalRuntime, runtime: runtime, adapterReloadKey: adapterReloadKey, threadFooterSlot: threadFooterSlot, apiUrl: apiUrl, agentChatSurface: agentChatSurface, showTabBar: effectiveShowTabBar, suppressInlineOpenApp: suppressInlineOpenApp, composerPlaceholder: composerPlaceholder, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, onFullViewRequest: onFullscreenRequest, storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: effectivePosition, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
2062
|
+
: panelStyle, inert: sidebarAnimationEnabled && !panelOpen ? true : undefined, "aria-hidden": sidebarAnimationEnabled && !panelOpen ? true : undefined, children: _jsx("div", { className: "agent-sidebar-panel-inner flex min-h-0 flex-1 flex-col", children: _jsx(AgentPanel, { emptyStateText: emptyStateText, suggestions: suggestions, dynamicSuggestions: dynamicSuggestions, composerToolbarSlot: composerToolbarSlot, composerSlot: composerSlot, onComposerTextChange: onComposerTextChange, imageModelMenu: imageModelMenu, availableAgents: effectiveAvailableAgents, availableModels: availableModels, modelListLoading: modelListLoading, selectedAgent: effectiveSelectedAgent, onAgentChange: effectiveOnAgentChange, hostedHarness: hostedHarnessEnabled, onConnectLocalRuntime: onConnectLocalRuntime, runtime: runtime, adapterReloadKey: adapterReloadKey, threadFooterSlot: threadFooterSlot, apiUrl: apiUrl, agentChatSurface: agentChatSurface, desktopIdentityUnauthenticated: desktopIdentityUnauthenticated, desktopIdentityAuthenticated: desktopIdentityAuthenticated, showTabBar: effectiveShowTabBar, suppressInlineOpenApp: suppressInlineOpenApp, composerPlaceholder: composerPlaceholder, missingApiKeySetupLayout: "sidebar", onCollapse: () => setOpenPersisted(false), onSnapTo75Percent: isMobile ? undefined : snapTo75Percent, isWideDrawer: isMobile ? false : isWideDrawer, onExitWideDrawer: isMobile ? undefined : exitWideDrawer, onFullViewRequest: onFullscreenRequest, storageKey: storageKey, scope: scope, showScopeBadge: showScopeBadge, browserTabId: browserTabId, threadUrlSync: threadUrlSync, agentPageHref: agentPageHref, allowSettingsMode: false, chatOnly: true }) }) }), showResizeHandle && isLeft && (_jsx(ResizeHandle, { position: effectivePosition, onDrag: handleDrag, onResizeStart: handleResizeStart, onResizeEnd: handleResizeEnd }))] })) : null;
|
|
2063
2063
|
const drawerPlaceholder = wideDrawerEnabled && !presentationMode && panelOpen ? (_jsx("div", { "aria-hidden": "true", className: "agent-sidebar-drawer-placeholder shrink-0", "data-agent-sidebar-placeholder": "true", style: { width: drawerPlaceholderWidth + 1 } })) : null;
|
|
2064
2064
|
return (_jsx(AgentSidebarOnboardingContext.Provider, { value: true, children: _jsxs(RealtimeVoiceModeProvider, { browserTabId: browserTabId, children: [showFirstRunOnboarding && (_jsx(Suspense, { fallback: null, children: _jsx(FirstRunOnboarding, {}) })), _jsxs("div", { className: "agent-sidebar-shell flex min-w-0 flex-1 h-screen overflow-hidden", "data-agent-sidebar-position": effectivePosition, "data-agent-native-hosted-harness-ui": hostedHarnessUi ? "desktop" : undefined, "data-agent-native-hosted-chat": isPerAppChatHosted ? "true" : undefined, "data-agent-sidebar-resizing": isResizing ? "true" : undefined, children: [isMobile &&
|
|
2065
2065
|
!isPerAppChatHosted &&
|
|
@@ -14,7 +14,7 @@ import { type ContentPart } from "./sse-event-processor.js";
|
|
|
14
14
|
import type { ChatThreadScope, ChatThreadSnapshot } from "./use-chat-threads.js";
|
|
15
15
|
export { AssistantMessageListErrorBoundary, AssistantUiStaleIndexErrorBoundary, assistantUiRecoverableRenderErrorKind, isAssistantUiRecoverableRenderError, isAssistantUiStaleIndexError, } from "./assistant-ui-recovery.js";
|
|
16
16
|
export { displayableUserMessageText } from "./chat/message-components.js";
|
|
17
|
-
export declare function shouldSuppressUnauthenticatedDesktopThreadRestore(surface: AgentChatSurfaceKind, status: number): boolean;
|
|
17
|
+
export declare function shouldSuppressUnauthenticatedDesktopThreadRestore(surface: AgentChatSurfaceKind, status: number, desktopIdentityUnauthenticated?: boolean): boolean;
|
|
18
18
|
type AssistantUiMessageResourceShape = {
|
|
19
19
|
id: string;
|
|
20
20
|
content: readonly unknown[];
|
|
@@ -278,6 +278,10 @@ export interface AssistantChatProps {
|
|
|
278
278
|
* dev filesystem/bash code-editing tools out of in-product sidebars.
|
|
279
279
|
*/
|
|
280
280
|
agentChatSurface?: AgentChatSurfaceKind;
|
|
281
|
+
/** Whether the desktop host is currently showing its unauthenticated identity gate. */
|
|
282
|
+
desktopIdentityUnauthenticated?: boolean;
|
|
283
|
+
/** Whether the desktop host has just established its authenticated identity session. */
|
|
284
|
+
desktopIdentityAuthenticated?: boolean;
|
|
281
285
|
/** Route completed first-party open_app calls through the host app pane. */
|
|
282
286
|
suppressInlineOpenApp?: boolean;
|
|
283
287
|
/** Placeholder text for empty state */
|
|
@@ -44,10 +44,14 @@ import { useRunStuckDetection } from "./use-run-stuck-detection.js";
|
|
|
44
44
|
import { cn } from "./utils.js";
|
|
45
45
|
export { AssistantMessageListErrorBoundary, AssistantUiStaleIndexErrorBoundary, assistantUiRecoverableRenderErrorKind, isAssistantUiRecoverableRenderError, isAssistantUiStaleIndexError, } from "./assistant-ui-recovery.js";
|
|
46
46
|
export { displayableUserMessageText } from "./chat/message-components.js";
|
|
47
|
-
// Desktop chat mounts beside the parent identity gate
|
|
48
|
-
//
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
// Desktop chat mounts beside the parent identity gate. The server masks an
|
|
48
|
+
// unauthenticated thread lookup as 404, so a stale local pointer must not turn
|
|
49
|
+
// the sign-in screen into a dead-thread error.
|
|
50
|
+
export function shouldSuppressUnauthenticatedDesktopThreadRestore(surface, status, desktopIdentityUnauthenticated = false) {
|
|
51
|
+
return (surface === "desktop" &&
|
|
52
|
+
(status === 401 ||
|
|
53
|
+
status === 403 ||
|
|
54
|
+
(status === 404 && desktopIdentityUnauthenticated)));
|
|
51
55
|
}
|
|
52
56
|
const useBrowserLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
|
|
53
57
|
export function assistantUiMessageListStructureKey(messages) {
|
|
@@ -1382,7 +1386,7 @@ function approvalResolutionIdentity(approvalKey, toolCallId,
|
|
|
1382
1386
|
askId) {
|
|
1383
1387
|
return `${toolCallId ?? ""}\u0000${approvalKey}\u0000${askId ?? ""}`;
|
|
1384
1388
|
}
|
|
1385
|
-
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, dynamicSuggestions, threadFooterSlot, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, browserTabId, threadId, contextScope, contextNamespace, isActiveComposer = true, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, onComposerTextChange, composerAreaClassName, composerPlaceholder, missingApiKeySetupLayout = "default", composerLayoutVariant = "default", centerComposerWhenEmpty = false, emptyStateDisplay = "default", composerToolbarSlot, composerExtraActionButton, showModelSelector = true, composerDisabled = false, composerDisabledPlaceholder, isNewThread, isThreadStateLoading, onSlashCommand, execMode, onExecModeChange, approvalActions, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, modelListLoading, onModelChange, onEffortChange, availableAgents, selectedAgent, hostedHarness, onAgentChange, imageModelMenu, onForkChat, onConnectProvider, onConnectLocalRuntime, plusMenuMode = "full", providerStatusChecksEnabled = true, loadHistoryRepository, historyReloadKey, externalStreaming = false, agentChatSurface = "app", suppressInlineOpenApp = false, }, ref) {
|
|
1389
|
+
const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateText, suggestions, dynamicSuggestions, threadFooterSlot, emptyStateAddon, showHeader = true, onSwitchToCli, className, apiUrl, tabId, browserTabId, threadId, contextScope, contextNamespace, isActiveComposer = true, onMessageCountChange, onSaveThread, onGenerateTitle, composerSlot, onComposerTextChange, composerAreaClassName, composerPlaceholder, missingApiKeySetupLayout = "default", composerLayoutVariant = "default", centerComposerWhenEmpty = false, emptyStateDisplay = "default", composerToolbarSlot, composerExtraActionButton, showModelSelector = true, composerDisabled = false, composerDisabledPlaceholder, isNewThread, isThreadStateLoading, onSlashCommand, execMode, onExecModeChange, approvalActions, planModeDisabled, planModeDisabledReason, selectedModel, defaultModel, selectedEngine, selectedEffort, availableModels, modelListLoading, onModelChange, onEffortChange, availableAgents, selectedAgent, hostedHarness, onAgentChange, imageModelMenu, onForkChat, onConnectProvider, onConnectLocalRuntime, plusMenuMode = "full", providerStatusChecksEnabled = true, loadHistoryRepository, historyReloadKey, externalStreaming = false, agentChatSurface = "app", desktopIdentityUnauthenticated = false, desktopIdentityAuthenticated = false, suppressInlineOpenApp = false, }, ref) {
|
|
1386
1390
|
const t = useT();
|
|
1387
1391
|
const thread = useThread();
|
|
1388
1392
|
const threadRuntime = useThreadRuntime();
|
|
@@ -1843,6 +1847,35 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1843
1847
|
setIsRestoring(true);
|
|
1844
1848
|
setRestoreAttempt((attempt) => attempt + 1);
|
|
1845
1849
|
}, [isNewThread, threadId]);
|
|
1850
|
+
// The desktop identity gate and chat restore run in sibling surfaces. If the
|
|
1851
|
+
// gate wins the race after a masked 404 has already rendered, clear the
|
|
1852
|
+
// transient not-found card and leave the user at a fresh composer.
|
|
1853
|
+
useEffect(() => {
|
|
1854
|
+
if (!desktopIdentityUnauthenticated)
|
|
1855
|
+
return;
|
|
1856
|
+
setThreadRestoreError((current) => current === "not-found" ? null : current);
|
|
1857
|
+
}, [desktopIdentityUnauthenticated]);
|
|
1858
|
+
const desktopIdentityAuthenticatedRef = useRef(desktopIdentityAuthenticated);
|
|
1859
|
+
useEffect(() => {
|
|
1860
|
+
const becameAuthenticated = desktopIdentityAuthenticated && !desktopIdentityAuthenticatedRef.current;
|
|
1861
|
+
desktopIdentityAuthenticatedRef.current = desktopIdentityAuthenticated;
|
|
1862
|
+
if (!becameAuthenticated ||
|
|
1863
|
+
agentChatSurface !== "desktop" ||
|
|
1864
|
+
!threadId ||
|
|
1865
|
+
isNewThread) {
|
|
1866
|
+
return;
|
|
1867
|
+
}
|
|
1868
|
+
// A saved-thread request can race the identity handoff and be masked as a
|
|
1869
|
+
// 404/401/403. Retry once the host confirms the authenticated session so
|
|
1870
|
+
// the thread is restored without requiring a remount or manual retry.
|
|
1871
|
+
retryThreadRestore();
|
|
1872
|
+
}, [
|
|
1873
|
+
agentChatSurface,
|
|
1874
|
+
desktopIdentityAuthenticated,
|
|
1875
|
+
isNewThread,
|
|
1876
|
+
retryThreadRestore,
|
|
1877
|
+
threadId,
|
|
1878
|
+
]);
|
|
1846
1879
|
const onSaveThreadRef = useRef(onSaveThread);
|
|
1847
1880
|
onSaveThreadRef.current = onSaveThread;
|
|
1848
1881
|
const onGenerateTitleRef = useRef(onGenerateTitle);
|
|
@@ -2668,7 +2701,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2668
2701
|
const res = await fetch(`${apiUrl}/threads/${encodeURIComponent(threadId)}`);
|
|
2669
2702
|
if (!res.ok) {
|
|
2670
2703
|
if (!cancelled) {
|
|
2671
|
-
setThreadRestoreError(shouldSuppressUnauthenticatedDesktopThreadRestore(agentChatSurface, res.status)
|
|
2704
|
+
setThreadRestoreError(shouldSuppressUnauthenticatedDesktopThreadRestore(agentChatSurface, res.status, desktopIdentityUnauthenticated)
|
|
2672
2705
|
? null
|
|
2673
2706
|
: res.status === 404
|
|
2674
2707
|
? "not-found"
|
|
@@ -2776,6 +2809,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2776
2809
|
loadHistoryRepository,
|
|
2777
2810
|
isNewThread,
|
|
2778
2811
|
isThreadStateLoading,
|
|
2812
|
+
desktopIdentityUnauthenticated,
|
|
2779
2813
|
restoreAttempt,
|
|
2780
2814
|
]);
|
|
2781
2815
|
useEffect(() => {
|
|
@@ -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
|
-
error: string;
|
|
17
16
|
ok?: undefined;
|
|
17
|
+
error: string;
|
|
18
18
|
} | {
|
|
19
19
|
error?: undefined;
|
|
20
20
|
ok: boolean;
|
package/dist/secrets/routes.d.ts
CHANGED
|
@@ -34,37 +34,37 @@ export declare function createListSecretsHandler(): import("h3").EventHandlerWit
|
|
|
34
34
|
/** POST /_agent-native/secrets/:key — write a secret. */
|
|
35
35
|
export declare function createWriteSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
36
36
|
error: string;
|
|
37
|
-
status?: undefined;
|
|
38
37
|
ok?: undefined;
|
|
38
|
+
status?: undefined;
|
|
39
39
|
} | {
|
|
40
|
+
error?: undefined;
|
|
40
41
|
ok: boolean;
|
|
41
42
|
status: string;
|
|
42
|
-
error?: undefined;
|
|
43
43
|
} | {
|
|
44
|
+
ok?: undefined;
|
|
44
45
|
error: string;
|
|
45
46
|
removed?: undefined;
|
|
46
|
-
ok?: undefined;
|
|
47
47
|
} | {
|
|
48
|
+
error?: undefined;
|
|
48
49
|
ok: boolean;
|
|
49
50
|
removed: boolean;
|
|
50
|
-
error?: undefined;
|
|
51
51
|
}>>;
|
|
52
52
|
/**
|
|
53
53
|
* POST /_agent-native/secrets/:key/test — validate an optional candidate value
|
|
54
54
|
* or the current stored value without changing anything.
|
|
55
55
|
*/
|
|
56
56
|
export declare function createTestSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
57
|
+
ok?: undefined;
|
|
57
58
|
error: string;
|
|
58
59
|
note?: undefined;
|
|
59
|
-
ok?: undefined;
|
|
60
60
|
} | {
|
|
61
|
+
error?: undefined;
|
|
61
62
|
ok: boolean;
|
|
62
63
|
note?: undefined;
|
|
63
|
-
error?: undefined;
|
|
64
64
|
} | {
|
|
65
|
+
error?: undefined;
|
|
65
66
|
ok: boolean;
|
|
66
67
|
note: string;
|
|
67
|
-
error?: undefined;
|
|
68
68
|
} | {
|
|
69
69
|
note?: undefined;
|
|
70
70
|
ok: boolean;
|
|
@@ -95,11 +95,11 @@ export interface AdHocSecretPayload {
|
|
|
95
95
|
export declare function createAdHocSecretHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<AdHocSecretPayload[] | {
|
|
96
96
|
error: string;
|
|
97
97
|
} | {
|
|
98
|
+
error?: undefined;
|
|
98
99
|
ok: boolean;
|
|
99
100
|
key: string;
|
|
100
|
-
error?: undefined;
|
|
101
101
|
} | {
|
|
102
|
+
error?: undefined;
|
|
102
103
|
ok: boolean;
|
|
103
104
|
removed: boolean;
|
|
104
|
-
error?: undefined;
|
|
105
105
|
}>>;
|
|
@@ -27,10 +27,10 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
|
|
|
27
27
|
export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
28
28
|
error: any;
|
|
29
29
|
} | {
|
|
30
|
+
error?: undefined;
|
|
30
31
|
ok: boolean;
|
|
31
32
|
key: string;
|
|
32
33
|
baseUrlKey?: string;
|
|
33
34
|
scope: AgentEngineApiKeyScope;
|
|
34
|
-
error?: undefined;
|
|
35
35
|
}>>;
|
|
36
36
|
export {};
|
|
@@ -26,8 +26,8 @@ export declare function createRealtimeTokenHandler(): import("h3").EventHandlerW
|
|
|
26
26
|
expiresAt?: undefined;
|
|
27
27
|
ttlSeconds?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
error?: undefined;
|
|
29
30
|
token: string;
|
|
30
31
|
expiresAt: string;
|
|
31
32
|
ttlSeconds: number;
|
|
32
|
-
error?: undefined;
|
|
33
33
|
}>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agent-native/core",
|
|
3
|
-
"version": "0.0.0-beta-
|
|
3
|
+
"version": "0.0.0-beta-20260819181349",
|
|
4
4
|
"description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
|
|
5
5
|
"homepage": "https://github.com/BuilderIO/agent-native#readme",
|
|
6
6
|
"bugs": {
|