@agent-native/core 0.135.2 → 0.135.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +1 -1
- package/corpus/core/CHANGELOG.md +6 -0
- package/corpus/core/docs/content/what-is-agent-native.mdx +155 -298
- package/corpus/core/package.json +1 -1
- package/corpus/templates/content/app/components/editor/database/sidebar.tsx +23 -10
- package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +20 -9
- package/corpus/templates/content/app/components/sidebar/document-sidebar-actions.ts +31 -0
- package/corpus/templates/content/changelog/2026-07-26-viewers-can-favorite-shared-pages.md +6 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/notifications/routes.d.ts +2 -2
- package/dist/observability/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/docs/content/what-is-agent-native.mdx +155 -298
- package/package.json +1 -1
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
import { useEffect, useState, type MouseEvent, type ReactNode } from "react";
|
|
22
22
|
import { Link } from "react-router";
|
|
23
23
|
|
|
24
|
+
import { documentSidebarActionAvailability } from "@/components/sidebar/document-sidebar-actions";
|
|
24
25
|
import { Button } from "@/components/ui/button";
|
|
25
26
|
import {
|
|
26
27
|
Collapsible,
|
|
@@ -717,14 +718,12 @@ function DatabaseSidebarRow({
|
|
|
717
718
|
};
|
|
718
719
|
}) {
|
|
719
720
|
const t = useT();
|
|
720
|
-
const canEdit
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
721
|
+
const { canEdit, canManage, canFavorite, hasMenuActions } =
|
|
722
|
+
documentSidebarActionAvailability(item.document, {
|
|
723
|
+
favoriteAvailable: Boolean(onToggleFavorite),
|
|
724
|
+
manageAvailable: Boolean(onDeleteItem),
|
|
725
|
+
});
|
|
725
726
|
const canCreateChild = canEdit && Boolean(onCreateChildPage);
|
|
726
|
-
const hasMenuActions =
|
|
727
|
-
Boolean(onToggleFavorite) || (canManage && Boolean(onDeleteItem));
|
|
728
727
|
function handleClick(event: MouseEvent<HTMLAnchorElement>) {
|
|
729
728
|
if (
|
|
730
729
|
event.defaultPrevented ||
|
|
@@ -828,7 +827,7 @@ function DatabaseSidebarRow({
|
|
|
828
827
|
</button>
|
|
829
828
|
</DropdownMenuTrigger>
|
|
830
829
|
<DropdownMenuContent align="start" className="w-48">
|
|
831
|
-
{onToggleFavorite ? (
|
|
830
|
+
{canFavorite && onToggleFavorite ? (
|
|
832
831
|
<DropdownMenuItem onSelect={() => onToggleFavorite(item)}>
|
|
833
832
|
<IconStar
|
|
834
833
|
className={cn(
|
|
@@ -841,7 +840,10 @@ function DatabaseSidebarRow({
|
|
|
841
840
|
: t("sidebar.pinToSidebar")}
|
|
842
841
|
</DropdownMenuItem>
|
|
843
842
|
) : null}
|
|
844
|
-
{
|
|
843
|
+
{canFavorite &&
|
|
844
|
+
onToggleFavorite &&
|
|
845
|
+
canManage &&
|
|
846
|
+
onDeleteItem ? (
|
|
845
847
|
<DropdownMenuSeparator />
|
|
846
848
|
) : null}
|
|
847
849
|
{canManage && onDeleteItem ? (
|
|
@@ -857,7 +859,7 @@ function DatabaseSidebarRow({
|
|
|
857
859
|
</DropdownMenu>
|
|
858
860
|
)}
|
|
859
861
|
|
|
860
|
-
{canCreateChild
|
|
862
|
+
{canCreateChild ? (
|
|
861
863
|
<DropdownMenu>
|
|
862
864
|
<Tooltip>
|
|
863
865
|
<TooltipTrigger asChild>
|
|
@@ -866,6 +868,7 @@ function DatabaseSidebarRow({
|
|
|
866
868
|
type="button"
|
|
867
869
|
className="flex size-6 items-center justify-center rounded text-foreground hover:bg-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
868
870
|
aria-label={t("sidebar.addChildTo", { title })}
|
|
871
|
+
data-sidebar-add-child
|
|
869
872
|
>
|
|
870
873
|
<IconPlus size={14} />
|
|
871
874
|
</button>
|
|
@@ -888,6 +891,16 @@ function DatabaseSidebarRow({
|
|
|
888
891
|
) : null}
|
|
889
892
|
</DropdownMenuContent>
|
|
890
893
|
</DropdownMenu>
|
|
894
|
+
) : (
|
|
895
|
+
<button
|
|
896
|
+
type="button"
|
|
897
|
+
className="flex size-6 cursor-not-allowed items-center justify-center rounded text-muted-foreground/50"
|
|
898
|
+
aria-label={t("sidebar.addChildTo", { title })}
|
|
899
|
+
data-sidebar-add-child
|
|
900
|
+
disabled
|
|
901
|
+
>
|
|
902
|
+
<IconPlus size={14} />
|
|
903
|
+
</button>
|
|
891
904
|
)}
|
|
892
905
|
</div>
|
|
893
906
|
)}
|
|
@@ -33,6 +33,8 @@ import {
|
|
|
33
33
|
} from "@/components/ui/tooltip";
|
|
34
34
|
import { cn } from "@/lib/utils";
|
|
35
35
|
|
|
36
|
+
import { documentSidebarActionAvailability } from "./document-sidebar-actions";
|
|
37
|
+
|
|
36
38
|
interface DocumentTreeItemProps {
|
|
37
39
|
node: DocumentTreeNode;
|
|
38
40
|
depth: number;
|
|
@@ -97,12 +99,8 @@ export function DocumentTreeItem({
|
|
|
97
99
|
const isActive = node.id === activeId;
|
|
98
100
|
const isLocalFileNode = node.source?.mode === "local-files";
|
|
99
101
|
const isLocalFolder = isLocalFileNode && node.source?.kind === "folder";
|
|
100
|
-
const canEdit
|
|
101
|
-
|
|
102
|
-
node.canManage === true ||
|
|
103
|
-
node.accessRole === "owner" ||
|
|
104
|
-
node.accessRole === "admin";
|
|
105
|
-
const hasMenuActions = canEdit || canManage;
|
|
102
|
+
const { canEdit, canManage, canFavorite, hasMenuActions } =
|
|
103
|
+
documentSidebarActionAvailability(node, { favoriteAvailable: true });
|
|
106
104
|
const canCreateChild = canEdit && !isLocalFileNode;
|
|
107
105
|
const [contextSheetOpen, setContextSheetOpen] = useState(false);
|
|
108
106
|
const indent = depth * 12 + 12;
|
|
@@ -224,7 +222,7 @@ export function DocumentTreeItem({
|
|
|
224
222
|
</button>
|
|
225
223
|
</DropdownMenuTrigger>
|
|
226
224
|
<DropdownMenuContent align="start" className="w-48">
|
|
227
|
-
{
|
|
225
|
+
{canFavorite && (
|
|
228
226
|
<DropdownMenuItem
|
|
229
227
|
onClick={(e) => {
|
|
230
228
|
e.stopPropagation();
|
|
@@ -240,7 +238,7 @@ export function DocumentTreeItem({
|
|
|
240
238
|
: t("sidebar.pinToSidebar")}
|
|
241
239
|
</DropdownMenuItem>
|
|
242
240
|
)}
|
|
243
|
-
{
|
|
241
|
+
{canFavorite && canManage && <DropdownMenuSeparator />}
|
|
244
242
|
{canEdit && !isLocalFileNode && (
|
|
245
243
|
<DropdownMenuItem
|
|
246
244
|
onSelect={(event) => {
|
|
@@ -269,7 +267,7 @@ export function DocumentTreeItem({
|
|
|
269
267
|
</DropdownMenu>
|
|
270
268
|
)}
|
|
271
269
|
|
|
272
|
-
{canCreateChild
|
|
270
|
+
{canCreateChild ? (
|
|
273
271
|
<DropdownMenu>
|
|
274
272
|
<Tooltip>
|
|
275
273
|
<TooltipTrigger asChild>
|
|
@@ -280,6 +278,7 @@ export function DocumentTreeItem({
|
|
|
280
278
|
aria-label={t("sidebar.addChildTo", {
|
|
281
279
|
title: node.title || t("sidebar.untitled"),
|
|
282
280
|
})}
|
|
281
|
+
data-sidebar-add-child
|
|
283
282
|
onClick={(e) => e.stopPropagation()}
|
|
284
283
|
>
|
|
285
284
|
<IconPlus size={14} />
|
|
@@ -309,6 +308,18 @@ export function DocumentTreeItem({
|
|
|
309
308
|
</DropdownMenuItem>
|
|
310
309
|
</DropdownMenuContent>
|
|
311
310
|
</DropdownMenu>
|
|
311
|
+
) : (
|
|
312
|
+
<button
|
|
313
|
+
type="button"
|
|
314
|
+
className="flex h-7 w-7 cursor-not-allowed items-center justify-center rounded text-muted-foreground/50"
|
|
315
|
+
aria-label={t("sidebar.addChildTo", {
|
|
316
|
+
title: node.title || t("sidebar.untitled"),
|
|
317
|
+
})}
|
|
318
|
+
data-sidebar-add-child
|
|
319
|
+
disabled
|
|
320
|
+
>
|
|
321
|
+
<IconPlus size={14} />
|
|
322
|
+
</button>
|
|
312
323
|
)}
|
|
313
324
|
</div>
|
|
314
325
|
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Document } from "@shared/api";
|
|
2
|
+
|
|
3
|
+
type SidebarDocumentAccess = Pick<
|
|
4
|
+
Document,
|
|
5
|
+
"accessRole" | "canEdit" | "canManage"
|
|
6
|
+
>;
|
|
7
|
+
|
|
8
|
+
export function documentSidebarActionAvailability(
|
|
9
|
+
document: SidebarDocumentAccess,
|
|
10
|
+
{
|
|
11
|
+
favoriteAvailable,
|
|
12
|
+
manageAvailable = true,
|
|
13
|
+
}: {
|
|
14
|
+
favoriteAvailable: boolean;
|
|
15
|
+
manageAvailable?: boolean;
|
|
16
|
+
},
|
|
17
|
+
) {
|
|
18
|
+
const canEdit = document.canEdit !== false;
|
|
19
|
+
const canManage =
|
|
20
|
+
document.canManage === true ||
|
|
21
|
+
document.accessRole === "owner" ||
|
|
22
|
+
document.accessRole === "admin";
|
|
23
|
+
const canFavorite = favoriteAvailable;
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
canEdit,
|
|
27
|
+
canManage,
|
|
28
|
+
canFavorite,
|
|
29
|
+
hasMenuActions: canFavorite || (canManage && manageAvailable),
|
|
30
|
+
};
|
|
31
|
+
}
|
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;
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
14
|
count: number;
|
|
15
15
|
updated?: undefined;
|
|
16
|
-
error?: undefined;
|
|
17
16
|
ok?: undefined;
|
|
17
|
+
error?: undefined;
|
|
18
18
|
} | {
|
|
19
19
|
updated: number;
|
|
20
|
-
error?: undefined;
|
|
21
20
|
ok?: undefined;
|
|
21
|
+
error?: undefined;
|
|
22
22
|
count?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
updated?: undefined;
|
|
@@ -41,16 +41,16 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
41
41
|
thumbsUpRate: number;
|
|
42
42
|
avgEvalScore: number;
|
|
43
43
|
} | {
|
|
44
|
+
error?: undefined;
|
|
44
45
|
summary: import("./types.js").TraceSummary;
|
|
45
46
|
spans: import("./types.js").TraceSpan[];
|
|
46
47
|
id?: undefined;
|
|
47
|
-
error?: undefined;
|
|
48
48
|
ok?: undefined;
|
|
49
49
|
} | {
|
|
50
|
+
error?: undefined;
|
|
50
51
|
summary?: undefined;
|
|
51
52
|
spans?: undefined;
|
|
52
53
|
id: string;
|
|
53
|
-
error?: undefined;
|
|
54
54
|
ok?: undefined;
|
|
55
55
|
} | {
|
|
56
56
|
summary?: undefined;
|
|
@@ -59,10 +59,10 @@ export declare function createObservabilityHandler(): import("h3").EventHandlerW
|
|
|
59
59
|
error: any;
|
|
60
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
|
}>>;
|
|
68
68
|
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -27,11 +27,11 @@ 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 {};
|
|
37
37
|
//# sourceMappingURL=agent-engine-api-key-route.d.ts.map
|
|
@@ -26,9 +26,9 @@ 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
|
}>>;
|
|
34
34
|
//# sourceMappingURL=realtime-token.d.ts.map
|