@agent-native/core 0.161.20 → 0.161.22
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/actions/finalize-meeting.ts +57 -21
- package/corpus/templates/clips/actions/get-meeting.ts +11 -3
- package/corpus/templates/clips/actions/request-transcript.ts +183 -8
- package/corpus/templates/clips/actions/update-meeting.ts +66 -14
- package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +80 -135
- package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
- package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +470 -35
- package/corpus/templates/clips/changelog/2026-08-18-meeting-notes-support-rich-editing-for-personal-notes-summar.md +6 -0
- package/corpus/templates/clips/desktop/src-tauri/src/whisper_speech.rs +13 -3
- package/corpus/templates/mail/app/components/email/EmailList.tsx +74 -22
- package/corpus/templates/mail/app/components/email/infinite-pagination.ts +82 -0
- package/corpus/templates/mail/app/hooks/use-emails.ts +1 -0
- package/corpus/templates/mail/app/pages/InboxPage.tsx +15 -10
- package/corpus/templates/mail/app/pages/inbox-zero.ts +35 -0
- package/corpus/templates/mail/changelog/2026-08-18-pinned-labels-load-matches.md +6 -0
- package/corpus/templates/slides/actions/get-deck.ts +5 -1
- package/corpus/templates/slides/actions/list-decks.ts +29 -8
- package/corpus/templates/slides/actions/view-screen.ts +7 -3
- package/corpus/templates/slides/changelog/2026-08-18-decks-appear-under-mine.md +6 -0
- package/corpus/templates/slides/shared/ownership.ts +6 -0
- package/dist/app-config/schema.d.ts +2 -0
- package/dist/app-config/workspace.d.ts +2 -0
- package/dist/app-config/workspace.js +18 -0
- package/dist/catalog.json +23 -23
- package/dist/client/analytics.d.ts +1 -0
- package/dist/client/api-path.js +7 -3
- package/dist/client/frame.js +20 -6
- package/dist/client/org/workspace-app-links.js +10 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/deploy/build.js +26 -2
- 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 +6 -6
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
- package/dist/provider-api/actions/provider-api.d.ts +15 -15
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/app-origin-config.d.ts +1 -0
- package/dist/server/app-origin-config.js +3 -0
- package/dist/server/auth.js +2 -2
- package/dist/server/cookie-namespace.js +17 -2
- package/dist/server/credential-provider.js +5 -2
- package/dist/server/derived-secret.js +3 -2
- package/dist/server/onboarding-html.js +34 -2
- package/dist/server/workspace-oauth.js +11 -6
- package/dist/shared/runtime-config.d.ts +2 -0
- package/dist/shared/runtime-config.js +12 -3
- package/dist/vite/client.js +5 -2
- package/package.json +2 -2
|
@@ -62,6 +62,11 @@ import { ensureThread, warmThreads } from "@/lib/thread-cache";
|
|
|
62
62
|
import { cn } from "@/lib/utils";
|
|
63
63
|
|
|
64
64
|
import { EmailListItem } from "./EmailListItem";
|
|
65
|
+
import {
|
|
66
|
+
observeNextPage,
|
|
67
|
+
retryNextPage as runPaginationRetry,
|
|
68
|
+
shouldShowPaginationRetry,
|
|
69
|
+
} from "./infinite-pagination";
|
|
65
70
|
|
|
66
71
|
type EmailsPage = { emails: EmailMessage[]; nextPageToken?: string };
|
|
67
72
|
type InfiniteEmails = InfiniteData<EmailsPage, string | undefined>;
|
|
@@ -83,6 +88,7 @@ interface EmailListProps {
|
|
|
83
88
|
hasNextPage?: boolean;
|
|
84
89
|
fetchNextPage?: () => Promise<unknown>;
|
|
85
90
|
isFetchingNextPage?: boolean;
|
|
91
|
+
isFetchNextPageError?: boolean;
|
|
86
92
|
focusedId: string | null;
|
|
87
93
|
setFocusedId: (id: string | null) => void;
|
|
88
94
|
selectedIds: Set<string>;
|
|
@@ -366,6 +372,7 @@ export function EmailList({
|
|
|
366
372
|
hasNextPage: hasNextPageProp,
|
|
367
373
|
fetchNextPage: fetchNextPageProp,
|
|
368
374
|
isFetchingNextPage: isFetchingNextPageProp,
|
|
375
|
+
isFetchNextPageError: isFetchNextPageErrorProp,
|
|
369
376
|
focusedId,
|
|
370
377
|
setFocusedId,
|
|
371
378
|
selectedIds,
|
|
@@ -397,6 +404,7 @@ export function EmailList({
|
|
|
397
404
|
hasNextPage: fetchedEmailsHasNextPage,
|
|
398
405
|
fetchNextPage: fetchFetchedNextPage,
|
|
399
406
|
isFetchingNextPage: fetchedEmailsFetchingNextPage,
|
|
407
|
+
isFetchNextPageError: fetchedEmailsFetchNextPageError,
|
|
400
408
|
} = useEmails(view, searchQuery, labelParam ?? undefined, {
|
|
401
409
|
enabled: emailsProp === undefined,
|
|
402
410
|
});
|
|
@@ -410,6 +418,13 @@ export function EmailList({
|
|
|
410
418
|
const fetchNextPage = fetchNextPageProp ?? fetchFetchedNextPage;
|
|
411
419
|
const isFetchingNextPage =
|
|
412
420
|
isFetchingNextPageProp ?? fetchedEmailsFetchingNextPage;
|
|
421
|
+
const isFetchNextPageError =
|
|
422
|
+
isFetchNextPageErrorProp ?? fetchedEmailsFetchNextPageError;
|
|
423
|
+
const paginationRetryInFlightRef = useRef(false);
|
|
424
|
+
const retryNextPage = useCallback(
|
|
425
|
+
() => runPaginationRetry(fetchNextPage, paginationRetryInFlightRef),
|
|
426
|
+
[fetchNextPage],
|
|
427
|
+
);
|
|
413
428
|
const markRead = useMarkRead();
|
|
414
429
|
const markThreadRead = useMarkThreadRead();
|
|
415
430
|
const toggleStar = useToggleStar();
|
|
@@ -1127,31 +1142,20 @@ export function EmailList({
|
|
|
1127
1142
|
}, [focusedIndex, rowVirtualizer]);
|
|
1128
1143
|
|
|
1129
1144
|
// Infinite scroll — fetch next page when the sentinel enters the viewport.
|
|
1130
|
-
//
|
|
1131
|
-
//
|
|
1132
|
-
// sentinel is still visible after a fetch, a reconnecting observer would
|
|
1133
|
-
// immediately fire again and we'd loop (visible to the user as "Loading
|
|
1134
|
-
// more..." flashing every ~second while tab is idle).
|
|
1145
|
+
// Re-arm the observer when a fetch completes so a still-visible sentinel can
|
|
1146
|
+
// walk through consecutive pages with no client-side filtered matches.
|
|
1135
1147
|
const sentinelRef = useRef<HTMLDivElement>(null);
|
|
1136
|
-
const isFetchingNextPageRef = useRef(isFetchingNextPage);
|
|
1137
|
-
isFetchingNextPageRef.current = isFetchingNextPage;
|
|
1138
1148
|
useEffect(() => {
|
|
1139
1149
|
const el = sentinelRef.current;
|
|
1140
|
-
if (!el
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
},
|
|
1150
|
-
{ rootMargin: "200px" },
|
|
1151
|
-
);
|
|
1152
|
-
observer.observe(el);
|
|
1153
|
-
return () => observer.disconnect();
|
|
1154
|
-
}, [hasNextPage, fetchNextPage]);
|
|
1150
|
+
if (!el) return;
|
|
1151
|
+
return observeNextPage({
|
|
1152
|
+
element: el,
|
|
1153
|
+
hasNextPage: Boolean(hasNextPage),
|
|
1154
|
+
isFetchingNextPage: Boolean(isFetchingNextPage),
|
|
1155
|
+
isFetchNextPageError: Boolean(isFetchNextPageError),
|
|
1156
|
+
fetchNextPage,
|
|
1157
|
+
});
|
|
1158
|
+
}, [hasNextPage, isFetchingNextPage, isFetchNextPageError, fetchNextPage]);
|
|
1155
1159
|
|
|
1156
1160
|
// Advance selection when an email is snoozed (same logic as archiveFocused)
|
|
1157
1161
|
useEffect(() => {
|
|
@@ -1597,6 +1601,41 @@ export function EmailList({
|
|
|
1597
1601
|
return <MailLoadingState containerRef={containerRef} />;
|
|
1598
1602
|
}
|
|
1599
1603
|
|
|
1604
|
+
// Client-sliced inbox tabs can have no matches on the first page even when
|
|
1605
|
+
// later inbox pages contain matching threads. Keep the sentinel mounted so
|
|
1606
|
+
// the infinite query can continue before showing an empty state.
|
|
1607
|
+
if (threads.length === 0 && hasNextPage) {
|
|
1608
|
+
return (
|
|
1609
|
+
<div className="flex h-full flex-col" ref={containerRef}>
|
|
1610
|
+
<div className="flex flex-1 items-center justify-center" />
|
|
1611
|
+
<div
|
|
1612
|
+
ref={sentinelRef}
|
|
1613
|
+
className="flex items-center justify-center py-3"
|
|
1614
|
+
>
|
|
1615
|
+
{isFetchingNextPage && (
|
|
1616
|
+
<div className="flex items-center gap-2 text-xs text-muted-foreground">
|
|
1617
|
+
<Spinner className="size-3 text-muted-foreground" />
|
|
1618
|
+
{t("mail.empty.loadingMore")}
|
|
1619
|
+
</div>
|
|
1620
|
+
)}
|
|
1621
|
+
{shouldShowPaginationRetry({
|
|
1622
|
+
hasNextPage: Boolean(hasNextPage),
|
|
1623
|
+
isFetchingNextPage: Boolean(isFetchingNextPage),
|
|
1624
|
+
isFetchNextPageError: Boolean(isFetchNextPageError),
|
|
1625
|
+
}) && (
|
|
1626
|
+
<button
|
|
1627
|
+
type="button"
|
|
1628
|
+
onClick={() => void retryNextPage()}
|
|
1629
|
+
className="rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm hover:bg-primary/90"
|
|
1630
|
+
>
|
|
1631
|
+
{t("mail.error.tryAgain")}
|
|
1632
|
+
</button>
|
|
1633
|
+
)}
|
|
1634
|
+
</div>
|
|
1635
|
+
</div>
|
|
1636
|
+
);
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1600
1639
|
// Empty state
|
|
1601
1640
|
if (threads.length === 0) {
|
|
1602
1641
|
if (searchQuery) {
|
|
@@ -1737,6 +1776,19 @@ export function EmailList({
|
|
|
1737
1776
|
{t("mail.empty.loadingMore")}
|
|
1738
1777
|
</div>
|
|
1739
1778
|
)}
|
|
1779
|
+
{shouldShowPaginationRetry({
|
|
1780
|
+
hasNextPage: Boolean(hasNextPage),
|
|
1781
|
+
isFetchingNextPage: Boolean(isFetchingNextPage),
|
|
1782
|
+
isFetchNextPageError: Boolean(isFetchNextPageError),
|
|
1783
|
+
}) && (
|
|
1784
|
+
<button
|
|
1785
|
+
type="button"
|
|
1786
|
+
onClick={() => void retryNextPage()}
|
|
1787
|
+
className="rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm hover:bg-primary/90"
|
|
1788
|
+
>
|
|
1789
|
+
{t("mail.error.tryAgain")}
|
|
1790
|
+
</button>
|
|
1791
|
+
)}
|
|
1740
1792
|
</div>
|
|
1741
1793
|
)}
|
|
1742
1794
|
</div>
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
interface ObserveNextPageOptions {
|
|
2
|
+
element: Element;
|
|
3
|
+
hasNextPage: boolean;
|
|
4
|
+
isFetchingNextPage: boolean;
|
|
5
|
+
isFetchNextPageError: boolean;
|
|
6
|
+
fetchNextPage: () => Promise<unknown>;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface PaginationRetryState {
|
|
10
|
+
hasNextPage: boolean;
|
|
11
|
+
isFetchingNextPage: boolean;
|
|
12
|
+
isFetchNextPageError: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function shouldShowPaginationRetry({
|
|
16
|
+
hasNextPage,
|
|
17
|
+
isFetchingNextPage,
|
|
18
|
+
isFetchNextPageError,
|
|
19
|
+
}: PaginationRetryState): boolean {
|
|
20
|
+
return hasNextPage && isFetchNextPageError && !isFetchingNextPage;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Run an explicit pagination retry without leaking a rejected provider promise
|
|
25
|
+
* to the browser. The shared state closes the synchronous double-click window
|
|
26
|
+
* before React Query has reflected isFetchingNextPage.
|
|
27
|
+
*/
|
|
28
|
+
export async function retryNextPage(
|
|
29
|
+
fetchNextPage: () => Promise<unknown>,
|
|
30
|
+
inFlightState: { current: boolean },
|
|
31
|
+
): Promise<void> {
|
|
32
|
+
if (inFlightState.current) return;
|
|
33
|
+
inFlightState.current = true;
|
|
34
|
+
try {
|
|
35
|
+
await fetchNextPage();
|
|
36
|
+
} catch {
|
|
37
|
+
// coercion-ok: React Query owns the error; catch prevents an unhandled retry rejection.
|
|
38
|
+
// React Query owns the visible error state for the failed page.
|
|
39
|
+
} finally {
|
|
40
|
+
inFlightState.current = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Observe a visible infinite-scroll sentinel for one page at a time.
|
|
46
|
+
*
|
|
47
|
+
* The owning effect re-runs when `isFetchingNextPage` changes. That lets the
|
|
48
|
+
* next observer receive the sentinel's already-visible state after a fetch,
|
|
49
|
+
* including when several consecutive pages contain no filtered matches. A
|
|
50
|
+
* failed page is deliberately left unobserved until the user explicitly
|
|
51
|
+
* retries it, so a persistent provider error cannot create a request loop.
|
|
52
|
+
*/
|
|
53
|
+
export function observeNextPage({
|
|
54
|
+
element,
|
|
55
|
+
hasNextPage,
|
|
56
|
+
isFetchingNextPage,
|
|
57
|
+
isFetchNextPageError,
|
|
58
|
+
fetchNextPage,
|
|
59
|
+
}: ObserveNextPageOptions): () => void {
|
|
60
|
+
if (!hasNextPage || isFetchingNextPage || isFetchNextPageError)
|
|
61
|
+
return () => {};
|
|
62
|
+
|
|
63
|
+
let fetchInFlight = false;
|
|
64
|
+
const observer = new IntersectionObserver(
|
|
65
|
+
(entries) => {
|
|
66
|
+
if (!entries[0]?.isIntersecting || fetchInFlight) return;
|
|
67
|
+
|
|
68
|
+
fetchInFlight = true;
|
|
69
|
+
void fetchNextPage()
|
|
70
|
+
.catch(() => {
|
|
71
|
+
// React Query owns the visible error state; avoid a global
|
|
72
|
+
// unhandledrejection for transient list-page fetch failures.
|
|
73
|
+
})
|
|
74
|
+
.finally(() => {
|
|
75
|
+
fetchInFlight = false;
|
|
76
|
+
});
|
|
77
|
+
},
|
|
78
|
+
{ rootMargin: "200px" },
|
|
79
|
+
);
|
|
80
|
+
observer.observe(element);
|
|
81
|
+
return () => observer.disconnect();
|
|
82
|
+
}
|
|
@@ -31,6 +31,8 @@ import {
|
|
|
31
31
|
import { groupIntoThreads, type ThreadSummary } from "@/lib/threads";
|
|
32
32
|
import { cn } from "@/lib/utils";
|
|
33
33
|
|
|
34
|
+
import { shouldShowInboxZero } from "./inbox-zero";
|
|
35
|
+
|
|
34
36
|
function ContactPanel({
|
|
35
37
|
emailId,
|
|
36
38
|
contactEmail,
|
|
@@ -315,6 +317,7 @@ export function InboxPage() {
|
|
|
315
317
|
hasNextPage,
|
|
316
318
|
fetchNextPage,
|
|
317
319
|
isFetchingNextPage,
|
|
320
|
+
isFetchNextPageError,
|
|
318
321
|
} = useEmails(view, searchQuery, effectiveLabel);
|
|
319
322
|
const hasEmailData = rawEmails !== undefined;
|
|
320
323
|
const emailListLoading =
|
|
@@ -590,16 +593,17 @@ export function InboxPage() {
|
|
|
590
593
|
|
|
591
594
|
const isMobile = useIsMobile();
|
|
592
595
|
const hasThread = !!threadId;
|
|
593
|
-
const
|
|
594
|
-
view
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
596
|
+
const isInboxZero = shouldShowInboxZero({
|
|
597
|
+
view,
|
|
598
|
+
activeLabel,
|
|
599
|
+
hasEmailData,
|
|
600
|
+
isLoading: emailListLoading,
|
|
601
|
+
isError,
|
|
602
|
+
hasThread,
|
|
603
|
+
searchQuery,
|
|
604
|
+
threadCount: threads.length,
|
|
605
|
+
hasNextPage: Boolean(hasNextPage),
|
|
606
|
+
});
|
|
603
607
|
const [sidebarContactEmail, setSidebarContactEmail] = useState<
|
|
604
608
|
string | undefined
|
|
605
609
|
>();
|
|
@@ -680,6 +684,7 @@ export function InboxPage() {
|
|
|
680
684
|
hasNextPage={hasNextPage}
|
|
681
685
|
fetchNextPage={fetchNextPage}
|
|
682
686
|
isFetchingNextPage={isFetchingNextPage}
|
|
687
|
+
isFetchNextPageError={isFetchNextPageError}
|
|
683
688
|
/>
|
|
684
689
|
)}
|
|
685
690
|
</div>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface InboxZeroState {
|
|
2
|
+
view: string;
|
|
3
|
+
activeLabel: string | null | undefined;
|
|
4
|
+
hasEmailData: boolean;
|
|
5
|
+
isLoading: boolean;
|
|
6
|
+
isError: boolean;
|
|
7
|
+
hasThread: boolean;
|
|
8
|
+
searchQuery: string | undefined;
|
|
9
|
+
threadCount: number;
|
|
10
|
+
hasNextPage: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function shouldShowInboxZero({
|
|
14
|
+
view,
|
|
15
|
+
activeLabel,
|
|
16
|
+
hasEmailData,
|
|
17
|
+
isLoading,
|
|
18
|
+
isError,
|
|
19
|
+
hasThread,
|
|
20
|
+
searchQuery,
|
|
21
|
+
threadCount,
|
|
22
|
+
hasNextPage,
|
|
23
|
+
}: InboxZeroState): boolean {
|
|
24
|
+
return (
|
|
25
|
+
view === "inbox" &&
|
|
26
|
+
(!activeLabel || activeLabel === "important") &&
|
|
27
|
+
hasEmailData &&
|
|
28
|
+
!isLoading &&
|
|
29
|
+
!isError &&
|
|
30
|
+
!hasThread &&
|
|
31
|
+
!searchQuery &&
|
|
32
|
+
threadCount === 0 &&
|
|
33
|
+
!hasNextPage
|
|
34
|
+
);
|
|
35
|
+
}
|
|
@@ -6,6 +6,7 @@ import { z } from "zod";
|
|
|
6
6
|
|
|
7
7
|
import { formatSlideHtml } from "../server/lib/slide-content-patch.js";
|
|
8
8
|
import { summarizeSlideAnimationTargets } from "../server/lib/validate-slide-animations.js";
|
|
9
|
+
import { normalizeOwnerEmail } from "../shared/ownership.js";
|
|
9
10
|
import { hashSlideContent } from "../shared/slide-fit.js";
|
|
10
11
|
import "../server/db/index.js"; // ensure registerShareableResource runs
|
|
11
12
|
|
|
@@ -112,6 +113,7 @@ export default defineAction({
|
|
|
112
113
|
const data = JSON.parse(row.data);
|
|
113
114
|
const slides = data?.slides || [];
|
|
114
115
|
const ownerEmail = getRequestUserEmail();
|
|
116
|
+
const normalizedOwnerEmail = normalizeOwnerEmail(ownerEmail);
|
|
115
117
|
const selectedSlideIndex =
|
|
116
118
|
args.slideId === undefined
|
|
117
119
|
? -1
|
|
@@ -198,7 +200,9 @@ export default defineAction({
|
|
|
198
200
|
id: row.id,
|
|
199
201
|
title: row.title || data?.title,
|
|
200
202
|
visibility: row.visibility,
|
|
201
|
-
createdByMe:
|
|
203
|
+
createdByMe:
|
|
204
|
+
normalizedOwnerEmail !== null &&
|
|
205
|
+
normalizeOwnerEmail(row.ownerEmail) === normalizedOwnerEmail,
|
|
202
206
|
designSystemId: row.designSystemId ?? null,
|
|
203
207
|
slideCount: slides.length,
|
|
204
208
|
slideNumbering:
|
|
@@ -2,10 +2,11 @@ import { defineAction } from "@agent-native/core";
|
|
|
2
2
|
import { buildDeepLink } from "@agent-native/core/server";
|
|
3
3
|
import { getRequestUserEmail } from "@agent-native/core/server/request-context";
|
|
4
4
|
import { accessFilter } from "@agent-native/core/sharing";
|
|
5
|
-
import { and, desc, eq } from "drizzle-orm";
|
|
5
|
+
import { and, desc, eq, sql } from "drizzle-orm";
|
|
6
6
|
import { z } from "zod";
|
|
7
7
|
|
|
8
8
|
import { getDb, schema } from "../server/db/index.js";
|
|
9
|
+
import { normalizeOwnerEmail } from "../shared/ownership.js";
|
|
9
10
|
import { getDeckUrl } from "./_app-url.js";
|
|
10
11
|
|
|
11
12
|
function slidesDeepLink(): string {
|
|
@@ -47,24 +48,28 @@ export default defineAction({
|
|
|
47
48
|
run: async (args, ctx) => {
|
|
48
49
|
const db = getDb();
|
|
49
50
|
const ownerEmail = getRequestUserEmail();
|
|
51
|
+
const normalizedOwnerEmail = normalizeOwnerEmail(ownerEmail);
|
|
50
52
|
if (
|
|
51
53
|
args.includeSlides === "true" &&
|
|
52
54
|
ctx?.caller === "frontend" &&
|
|
53
|
-
|
|
55
|
+
normalizedOwnerEmail === null
|
|
54
56
|
) {
|
|
55
57
|
const err = new Error("Unauthorized") as Error & { statusCode?: number };
|
|
56
58
|
err.statusCode = 401;
|
|
57
59
|
throw err;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
if (args.createdBy === "me" &&
|
|
62
|
+
if (args.createdBy === "me" && normalizedOwnerEmail === null) {
|
|
61
63
|
return { count: 0, decks: [] };
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
const visibleDecks = accessFilter(schema.decks, schema.deckShares);
|
|
65
67
|
const where =
|
|
66
|
-
args.createdBy === "me" &&
|
|
67
|
-
? and(
|
|
68
|
+
args.createdBy === "me" && normalizedOwnerEmail !== null
|
|
69
|
+
? and(
|
|
70
|
+
visibleDecks,
|
|
71
|
+
sql`lower(trim(${schema.decks.ownerEmail})) = ${normalizedOwnerEmail}`,
|
|
72
|
+
)
|
|
68
73
|
: visibleDecks;
|
|
69
74
|
|
|
70
75
|
if (args.light === "true") {
|
|
@@ -79,11 +84,23 @@ export default defineAction({
|
|
|
79
84
|
title: schema.decks.title,
|
|
80
85
|
updatedAt: schema.decks.updatedAt,
|
|
81
86
|
visibility: schema.decks.visibility,
|
|
87
|
+
ownerEmail: schema.decks.ownerEmail,
|
|
82
88
|
})
|
|
83
89
|
.from(schema.decks)
|
|
84
90
|
.where(where)
|
|
85
91
|
.orderBy(desc(schema.decks.updatedAt));
|
|
86
|
-
return {
|
|
92
|
+
return {
|
|
93
|
+
count: rows.length,
|
|
94
|
+
decks: rows.map((row) => ({
|
|
95
|
+
id: row.id,
|
|
96
|
+
title: row.title,
|
|
97
|
+
updatedAt: row.updatedAt,
|
|
98
|
+
visibility: row.visibility,
|
|
99
|
+
createdByMe:
|
|
100
|
+
normalizedOwnerEmail !== null &&
|
|
101
|
+
normalizeOwnerEmail(row.ownerEmail) === normalizedOwnerEmail,
|
|
102
|
+
})),
|
|
103
|
+
};
|
|
87
104
|
}
|
|
88
105
|
|
|
89
106
|
if (args.includeSlides !== "true") {
|
|
@@ -112,7 +129,9 @@ export default defineAction({
|
|
|
112
129
|
url: getDeckUrl(row.id),
|
|
113
130
|
visibility: row.visibility,
|
|
114
131
|
designSystemId: row.designSystemId ?? null,
|
|
115
|
-
createdByMe:
|
|
132
|
+
createdByMe:
|
|
133
|
+
normalizedOwnerEmail !== null &&
|
|
134
|
+
normalizeOwnerEmail(row.ownerEmail) === normalizedOwnerEmail,
|
|
116
135
|
createdAt: row.createdAt,
|
|
117
136
|
updatedAt: row.updatedAt,
|
|
118
137
|
})),
|
|
@@ -138,7 +157,9 @@ export default defineAction({
|
|
|
138
157
|
id: row.id,
|
|
139
158
|
title: row.title,
|
|
140
159
|
visibility: row.visibility,
|
|
141
|
-
createdByMe:
|
|
160
|
+
createdByMe:
|
|
161
|
+
normalizedOwnerEmail !== null &&
|
|
162
|
+
normalizeOwnerEmail(row.ownerEmail) === normalizedOwnerEmail,
|
|
142
163
|
designSystemId: row.designSystemId ?? data.designSystemId ?? null,
|
|
143
164
|
createdAt:
|
|
144
165
|
typeof data.createdAt === "string" ? data.createdAt : row.createdAt,
|
|
@@ -8,6 +8,7 @@ import { and, desc, eq } from "drizzle-orm";
|
|
|
8
8
|
import { z } from "zod";
|
|
9
9
|
|
|
10
10
|
import { getDb, schema } from "../server/db/index.js";
|
|
11
|
+
import { normalizeOwnerEmail } from "../shared/ownership.js";
|
|
11
12
|
import { hashSlideContent, type DeckFitState } from "../shared/slide-fit.js";
|
|
12
13
|
import { readAppStateForCurrentTab } from "./_tab-state.js";
|
|
13
14
|
|
|
@@ -369,11 +370,14 @@ export default defineAction({
|
|
|
369
370
|
.where(accessFilter(schema.decks, schema.deckShares))
|
|
370
371
|
.orderBy(desc(schema.decks.updatedAt));
|
|
371
372
|
|
|
372
|
-
const
|
|
373
|
+
const normalizedUserEmail = normalizeOwnerEmail(getRequestUserEmail());
|
|
373
374
|
const filteredRows =
|
|
374
375
|
navigation?.deckFilter === "created-by-me"
|
|
375
|
-
?
|
|
376
|
-
? rows.filter(
|
|
376
|
+
? normalizedUserEmail !== null
|
|
377
|
+
? rows.filter(
|
|
378
|
+
(row) =>
|
|
379
|
+
normalizeOwnerEmail(row.ownerEmail) === normalizedUserEmail,
|
|
380
|
+
)
|
|
377
381
|
: []
|
|
378
382
|
: rows;
|
|
379
383
|
const lines: string[] = [];
|
|
@@ -40,6 +40,8 @@ export declare const appConfigSchema: z.ZodObject<{
|
|
|
40
40
|
publicUploadFallback: z.ZodDefault<z.ZodBoolean>;
|
|
41
41
|
}, z.core.$strip>>;
|
|
42
42
|
workspace: z.ZodPrefault<z.ZodObject<{
|
|
43
|
+
isWorkspace: z.ZodOptional<z.ZodBoolean>;
|
|
44
|
+
appsJson: z.ZodOptional<z.ZodString>;
|
|
43
45
|
gatewayUrl: z.ZodOptional<z.ZodString>;
|
|
44
46
|
oauthOrigin: z.ZodOptional<z.ZodString>;
|
|
45
47
|
}, z.core.$strip>>;
|
|
@@ -16,6 +16,8 @@ import { z } from "zod";
|
|
|
16
16
|
* in the process down with it.
|
|
17
17
|
*/
|
|
18
18
|
export declare const workspaceConfig: z.ZodObject<{
|
|
19
|
+
isWorkspace: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
appsJson: z.ZodOptional<z.ZodString>;
|
|
19
21
|
gatewayUrl: z.ZodOptional<z.ZodString>;
|
|
20
22
|
oauthOrigin: z.ZodOptional<z.ZodString>;
|
|
21
23
|
}, z.core.$strip>;
|
|
@@ -16,6 +16,24 @@ import { z } from "zod";
|
|
|
16
16
|
* in the process down with it.
|
|
17
17
|
*/
|
|
18
18
|
export const workspaceConfig = z.object({
|
|
19
|
+
isWorkspace: z
|
|
20
|
+
.boolean()
|
|
21
|
+
.optional()
|
|
22
|
+
.meta({
|
|
23
|
+
env: ["AGENT_NATIVE_WORKSPACE", "VITE_AGENT_NATIVE_WORKSPACE"],
|
|
24
|
+
doc: "Whether this app is mounted inside a shared workspace gateway.",
|
|
25
|
+
}),
|
|
26
|
+
appsJson: z
|
|
27
|
+
.string()
|
|
28
|
+
.min(1)
|
|
29
|
+
.optional()
|
|
30
|
+
.meta({
|
|
31
|
+
env: [
|
|
32
|
+
"AGENT_NATIVE_WORKSPACE_APPS_JSON",
|
|
33
|
+
"VITE_AGENT_NATIVE_WORKSPACE_APPS_JSON",
|
|
34
|
+
],
|
|
35
|
+
doc: "Serialized workspace app manifest used by mounted app runtimes.",
|
|
36
|
+
}),
|
|
19
37
|
gatewayUrl: z
|
|
20
38
|
.string()
|
|
21
39
|
.min(1)
|
package/dist/catalog.json
CHANGED
|
@@ -7,28 +7,28 @@
|
|
|
7
7
|
"@radix-ui/react-popover": "^1.1.19",
|
|
8
8
|
"@radix-ui/react-select": "^2.3.3",
|
|
9
9
|
"@radix-ui/react-tooltip": "^1.2.12",
|
|
10
|
-
"@tiptap/core": "3.
|
|
11
|
-
"@tiptap/extension-blockquote": "3.
|
|
12
|
-
"@tiptap/extension-bubble-menu": "3.
|
|
13
|
-
"@tiptap/extension-code-block-lowlight": "3.
|
|
14
|
-
"@tiptap/extension-collaboration": "3.
|
|
15
|
-
"@tiptap/extension-collaboration-caret": "3.
|
|
16
|
-
"@tiptap/extension-color": "3.
|
|
17
|
-
"@tiptap/extension-horizontal-rule": "3.
|
|
18
|
-
"@tiptap/extension-image": "3.
|
|
19
|
-
"@tiptap/extension-link": "3.
|
|
20
|
-
"@tiptap/extension-list": "3.
|
|
21
|
-
"@tiptap/extension-placeholder": "3.
|
|
22
|
-
"@tiptap/extension-table": "3.
|
|
23
|
-
"@tiptap/extension-table-cell": "3.
|
|
24
|
-
"@tiptap/extension-table-header": "3.
|
|
25
|
-
"@tiptap/extension-table-row": "3.
|
|
26
|
-
"@tiptap/extension-task-item": "3.
|
|
27
|
-
"@tiptap/extension-task-list": "3.
|
|
28
|
-
"@tiptap/extension-text-style": "3.
|
|
29
|
-
"@tiptap/pm": "3.
|
|
30
|
-
"@tiptap/react": "3.
|
|
31
|
-
"@tiptap/starter-kit": "3.
|
|
10
|
+
"@tiptap/core": "3.30.1",
|
|
11
|
+
"@tiptap/extension-blockquote": "3.30.1",
|
|
12
|
+
"@tiptap/extension-bubble-menu": "3.30.1",
|
|
13
|
+
"@tiptap/extension-code-block-lowlight": "3.30.1",
|
|
14
|
+
"@tiptap/extension-collaboration": "3.30.1",
|
|
15
|
+
"@tiptap/extension-collaboration-caret": "3.30.1",
|
|
16
|
+
"@tiptap/extension-color": "3.30.1",
|
|
17
|
+
"@tiptap/extension-horizontal-rule": "3.30.1",
|
|
18
|
+
"@tiptap/extension-image": "3.30.1",
|
|
19
|
+
"@tiptap/extension-link": "3.30.1",
|
|
20
|
+
"@tiptap/extension-list": "3.30.1",
|
|
21
|
+
"@tiptap/extension-placeholder": "3.30.1",
|
|
22
|
+
"@tiptap/extension-table": "3.30.1",
|
|
23
|
+
"@tiptap/extension-table-cell": "3.30.1",
|
|
24
|
+
"@tiptap/extension-table-header": "3.30.1",
|
|
25
|
+
"@tiptap/extension-table-row": "3.30.1",
|
|
26
|
+
"@tiptap/extension-task-item": "3.30.1",
|
|
27
|
+
"@tiptap/extension-task-list": "3.30.1",
|
|
28
|
+
"@tiptap/extension-text-style": "3.30.1",
|
|
29
|
+
"@tiptap/pm": "3.30.1",
|
|
30
|
+
"@tiptap/react": "3.30.1",
|
|
31
|
+
"@tiptap/starter-kit": "3.30.1",
|
|
32
32
|
"@tiptap/y-tiptap": "3.0.7",
|
|
33
33
|
"@tabler/icons-react": "^3.41.1",
|
|
34
34
|
"@tailwindcss/vite": "^4.2.4",
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"vite": "8.1.0",
|
|
57
57
|
"vitest": "^4.1.5",
|
|
58
58
|
"y-protocols": "^1.0.7",
|
|
59
|
-
"yjs": "^13.6.
|
|
59
|
+
"yjs": "^13.6.32"
|
|
60
60
|
}
|
package/dist/client/api-path.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isTruthyRuntimeValue } from "../shared/runtime-config.js";
|
|
1
2
|
import { initializeAgentNativeClient } from "./client-bootstrap.js";
|
|
2
3
|
const FRAMEWORK_ROUTE_PREFIX = "/_agent-native";
|
|
3
4
|
function normalizeBasePath(value) {
|
|
@@ -34,8 +35,11 @@ function pathMatchesBasePath(pathname, basePath) {
|
|
|
34
35
|
}
|
|
35
36
|
function isWorkspaceRuntime() {
|
|
36
37
|
const env = clientEnv();
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
const projected = typeof window !== "undefined" &&
|
|
39
|
+
window.__AGENT_NATIVE_CONFIG__?.workspaceRuntime === true;
|
|
40
|
+
return (projected ||
|
|
41
|
+
isTruthyRuntimeValue(env?.VITE_AGENT_NATIVE_WORKSPACE) ||
|
|
42
|
+
isTruthyRuntimeValue(env?.AGENT_NATIVE_WORKSPACE) ||
|
|
39
43
|
typeof env?.VITE_AGENT_NATIVE_WORKSPACE_APPS_JSON === "string");
|
|
40
44
|
}
|
|
41
45
|
function workspacePathBasePath() {
|
|
@@ -78,7 +82,7 @@ export function appBasePath() {
|
|
|
78
82
|
const configured = configuredBasePath();
|
|
79
83
|
const derived = pathDerivedBasePath();
|
|
80
84
|
if (!configured)
|
|
81
|
-
return derived;
|
|
85
|
+
return derived || workspacePathBasePath();
|
|
82
86
|
if (typeof window === "undefined")
|
|
83
87
|
return configured;
|
|
84
88
|
const pathname = window.location.pathname;
|