@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.
Files changed (37) hide show
  1. package/app/api/artifacts/[id]/route.ts +13 -4
  2. package/app/api/artifacts/[id]/versions/route.ts +16 -0
  3. package/app/api/sessions/[id]/artifacts/route.ts +9 -1
  4. package/app/api/shares/route.test.ts +66 -1
  5. package/app/api/shares/route.ts +15 -0
  6. package/components/Artifacts/ArtifactActions.tsx +308 -0
  7. package/components/Artifacts/ArtifactFullscreen.tsx +58 -0
  8. package/components/Artifacts/ArtifactPreview.tsx +141 -18
  9. package/components/Artifacts/ArtifactRow.tsx +5 -0
  10. package/components/Artifacts/ArtifactsPanel.tsx +2 -0
  11. package/components/Artifacts/VersionSwitcher.tsx +216 -0
  12. package/components/Chat/Artifact.tsx +129 -89
  13. package/components/Share/DownloadMenu.tsx +63 -38
  14. package/components/Share/ShareDialog.tsx +47 -0
  15. package/components/Shares/SharedLinksPanel.tsx +7 -0
  16. package/data/session-artifacts/keys.ts +3 -0
  17. package/data/session-artifacts/queries.ts +25 -0
  18. package/lib/artifacts/actions.ts +75 -0
  19. package/lib/artifacts/store.ts +105 -10
  20. package/lib/artifacts/tools.ts +33 -6
  21. package/lib/artifacts/versions.ts +73 -0
  22. package/lib/chat/events.ts +4 -0
  23. package/lib/chat/worker/host.ts +2 -0
  24. package/lib/connect/control-api.ts +15 -0
  25. package/lib/db/migrations/20261029T1200_artifact_versions.ts +28 -0
  26. package/lib/db/migrations/20261029T1300_shared_links_follow.ts +28 -0
  27. package/lib/security/demo.ts +1 -0
  28. package/lib/session-artifacts/collect.ts +28 -6
  29. package/lib/session-artifacts/derive.ts +3 -1
  30. package/lib/session-artifacts/types.ts +9 -0
  31. package/lib/share/connect.ts +10 -0
  32. package/lib/share/follow.ts +76 -0
  33. package/lib/share/service.ts +6 -0
  34. package/lib/share/store.ts +34 -2
  35. package/lib/share/view.ts +6 -0
  36. package/package.json +1 -1
  37. 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saadnvd1/agent-os",
3
- "version": "0.3.761",
3
+ "version": "0.3.765",
4
4
  "description": "Self-hosted web UI for managing Claude Code sessions",
5
5
  "bin": {
6
6
  "agent-os": "scripts/agent-os"
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: (ShareTarget & { title: string }) | null;
11
+ target: ShareUiTarget | null;
8
12
  }>({ target: null });
9
13
 
10
14
  export const shareUiActions = {
11
- open: (target: ShareTarget & { title: string }) => {
15
+ open: (target: ShareUiTarget) => {
12
16
  shareUi.target = target;
13
17
  },
14
18
  close: () => {