@saadnvd1/agent-os 0.3.761 → 0.3.765
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/app/api/artifacts/[id]/route.ts +13 -4
- package/app/api/artifacts/[id]/versions/route.ts +16 -0
- package/app/api/sessions/[id]/artifacts/route.ts +9 -1
- package/app/api/shares/route.test.ts +66 -1
- package/app/api/shares/route.ts +15 -0
- package/components/Artifacts/ArtifactActions.tsx +308 -0
- package/components/Artifacts/ArtifactFullscreen.tsx +58 -0
- package/components/Artifacts/ArtifactPreview.tsx +141 -18
- package/components/Artifacts/ArtifactRow.tsx +5 -0
- package/components/Artifacts/ArtifactsPanel.tsx +2 -0
- package/components/Artifacts/VersionSwitcher.tsx +216 -0
- package/components/Chat/Artifact.tsx +129 -89
- package/components/Share/DownloadMenu.tsx +63 -38
- package/components/Share/ShareDialog.tsx +47 -0
- package/components/Shares/SharedLinksPanel.tsx +7 -0
- package/data/session-artifacts/keys.ts +3 -0
- package/data/session-artifacts/queries.ts +25 -0
- package/lib/artifacts/actions.ts +75 -0
- package/lib/artifacts/store.ts +105 -10
- package/lib/artifacts/tools.ts +33 -6
- package/lib/artifacts/versions.ts +73 -0
- package/lib/chat/events.ts +4 -0
- package/lib/chat/worker/host.ts +2 -0
- package/lib/connect/control-api.ts +15 -0
- package/lib/db/migrations/20261029T1200_artifact_versions.ts +28 -0
- package/lib/db/migrations/20261029T1300_shared_links_follow.ts +28 -0
- package/lib/security/demo.ts +1 -0
- package/lib/session-artifacts/collect.ts +28 -6
- package/lib/session-artifacts/derive.ts +3 -1
- package/lib/session-artifacts/types.ts +9 -0
- package/lib/share/connect.ts +10 -0
- package/lib/share/follow.ts +76 -0
- package/lib/share/service.ts +6 -0
- package/lib/share/store.ts +34 -2
- package/lib/share/view.ts +6 -0
- package/package.json +1 -1
- package/stores/shareUi.ts +6 -2
package/lib/share/view.ts
CHANGED
|
@@ -7,6 +7,8 @@ export interface ShareTarget {
|
|
|
7
7
|
kind: "chat" | "artifact";
|
|
8
8
|
sessionId?: string;
|
|
9
9
|
artifactId?: string;
|
|
10
|
+
/** A page link that is re-uploaded when the page gets a new version. */
|
|
11
|
+
follow?: "latest";
|
|
10
12
|
}
|
|
11
13
|
|
|
12
14
|
export interface PreviewRequest extends ShareTarget {
|
|
@@ -52,6 +54,10 @@ export interface SharedLinkRow {
|
|
|
52
54
|
status: "active" | "expired" | "revoked";
|
|
53
55
|
views: number | null;
|
|
54
56
|
lastViewedAt: string | null;
|
|
57
|
+
/** True when the link follows the page's latest version. */
|
|
58
|
+
follow: boolean;
|
|
59
|
+
/** The page version the link shows now. */
|
|
60
|
+
version: number | null;
|
|
55
61
|
}
|
|
56
62
|
|
|
57
63
|
export interface SharesResponse {
|
package/package.json
CHANGED
package/stores/shareUi.ts
CHANGED
|
@@ -3,12 +3,16 @@ import type { ShareTarget } from "@/data/shares";
|
|
|
3
3
|
|
|
4
4
|
// What the share dialog is open on: a chat or an artifact, started from a
|
|
5
5
|
// menu, the pane or the artifact card.
|
|
6
|
+
// A page's version, when it has more than one, is named in the title; the
|
|
7
|
+
// share is of that exact version.
|
|
8
|
+
export type ShareUiTarget = ShareTarget & { title: string; version?: number };
|
|
9
|
+
|
|
6
10
|
export const shareUi = proxy<{
|
|
7
|
-
target:
|
|
11
|
+
target: ShareUiTarget | null;
|
|
8
12
|
}>({ target: null });
|
|
9
13
|
|
|
10
14
|
export const shareUiActions = {
|
|
11
|
-
open: (target:
|
|
15
|
+
open: (target: ShareUiTarget) => {
|
|
12
16
|
shareUi.target = target;
|
|
13
17
|
},
|
|
14
18
|
close: () => {
|