agentic-drive 0.8.0 → 0.9.1
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/CHANGELOG.md +28 -0
- package/README.md +20 -4
- package/dist/{chunk-R2DUVOJT.js → chunk-622NAJ6K.js} +123 -11
- package/dist/{chunk-6UQ6CDLJ.js → chunk-D6KW6NVM.js} +1 -1
- package/dist/{chunk-LELTSSZF.js → chunk-SEHT5Q5L.js} +4 -0
- package/dist/cli.js +12 -3
- package/dist/client.d.ts +7 -2
- package/dist/client.js +1 -1
- package/dist/{drive-Dxy0gL0_.d.ts → drive-BRg1Uj_3.d.ts} +25 -1
- package/dist/embed.css +152 -0
- package/dist/embed.js +283 -97
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mcp.d.ts +1 -1
- package/dist/mcp.js +3 -2
- package/dist/worker.d.ts +2 -2
- package/dist/worker.js +7 -1
- package/package.json +6 -4
- package/ui-dist/assets/index-BiYPMlrf.js +49 -0
- package/ui-dist/assets/index-oybSrFGW.css +1 -0
- package/ui-dist/index.html +2 -2
- package/ui-dist/assets/index-GxwjdcYH.css +0 -1
- package/ui-dist/assets/index-mHs8RJgV.js +0 -49
package/dist/embed.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import {
|
|
2
2
|
DriveApiError,
|
|
3
3
|
createClient
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-SEHT5Q5L.js";
|
|
5
5
|
|
|
6
6
|
// ui/embed.tsx
|
|
7
|
-
import { useEffect as
|
|
7
|
+
import { useEffect as useEffect3, useState as useState3 } from "react";
|
|
8
8
|
import { createRoot } from "react-dom/client";
|
|
9
|
-
import { FolderIcon as
|
|
9
|
+
import { FolderIcon as FolderIcon3, SidebarNav as SidebarNav2, ToastProvider, TooltipProvider } from "agentic-design/react";
|
|
10
10
|
|
|
11
11
|
// ui/App.tsx
|
|
12
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
12
|
+
import { useEffect as useEffect2, useMemo, useRef as useRef2, useState as useState2 } from "react";
|
|
13
13
|
import {
|
|
14
14
|
AppShell,
|
|
15
|
-
Button,
|
|
15
|
+
Button as Button2,
|
|
16
16
|
Dialog,
|
|
17
17
|
DialogClose,
|
|
18
18
|
EmptyState,
|
|
19
|
-
FileIcon,
|
|
19
|
+
FileIcon as FileIcon2,
|
|
20
20
|
FileList,
|
|
21
21
|
FileRow,
|
|
22
|
-
FolderIcon,
|
|
22
|
+
FolderIcon as FolderIcon2,
|
|
23
23
|
IconButton,
|
|
24
24
|
Input,
|
|
25
25
|
Menu,
|
|
26
26
|
MoreIcon,
|
|
27
27
|
PlusIcon,
|
|
28
|
-
PresenceChip,
|
|
28
|
+
PresenceChip as PresenceChip2,
|
|
29
29
|
Select,
|
|
30
30
|
ShareDialog,
|
|
31
31
|
SidebarNav,
|
|
@@ -34,15 +34,155 @@ import {
|
|
|
34
34
|
useTheme,
|
|
35
35
|
useToast
|
|
36
36
|
} from "agentic-design/react";
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
// ui/Activity.tsx
|
|
39
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
40
|
+
var VERBS = {
|
|
41
|
+
create: "created this item",
|
|
42
|
+
rename: "renamed it",
|
|
43
|
+
move: "moved it",
|
|
44
|
+
update: "replaced its content",
|
|
45
|
+
share: "shared it",
|
|
46
|
+
unshare: "stopped sharing it",
|
|
47
|
+
delete: "moved it to the trash",
|
|
48
|
+
restore: "restored it"
|
|
49
|
+
};
|
|
50
|
+
function detailText(e) {
|
|
51
|
+
const d = e.detail ?? {};
|
|
52
|
+
if (e.action === "rename") return d.from === void 0 ? "" : `from "${d.from}" to "${d.to}"`;
|
|
53
|
+
if (e.action === "share") return d.subjectId ? `with ${d.subjectId} as ${d.role}` : "";
|
|
54
|
+
if (e.action === "unshare") return d.subjectId ? `from ${d.subjectId}` : "";
|
|
55
|
+
return "";
|
|
56
|
+
}
|
|
57
|
+
var describe = (e) => e.action === "share" && e.detail?.via === "invite" ? e.detail.role === void 0 ? "accepted an invite" : `accepted an invite and now has the role ${e.detail.role}` : `${VERBS[e.action]} ${detailText(e)}`.trim();
|
|
58
|
+
var AgentLabel = ({ entry }) => entry.actor.kind === "agent" ? /* @__PURE__ */ jsx("span", { className: "agd-pill", children: "AI agent" }) : null;
|
|
59
|
+
function ActivityList({ entries }) {
|
|
60
|
+
if (entries.length === 0) return /* @__PURE__ */ jsx("p", { className: "drive-muted", children: "No activity yet." });
|
|
61
|
+
return /* @__PURE__ */ jsx("ol", { className: "drive-activity", "aria-label": "Activity", children: entries.map((e) => /* @__PURE__ */ jsxs("li", { children: [
|
|
62
|
+
/* @__PURE__ */ jsx("strong", { children: e.actor.id }),
|
|
63
|
+
" ",
|
|
64
|
+
/* @__PURE__ */ jsx(AgentLabel, { entry: e }),
|
|
65
|
+
" ",
|
|
66
|
+
describe(e),
|
|
67
|
+
" ",
|
|
68
|
+
/* @__PURE__ */ jsx("time", { dateTime: new Date(e.at).toISOString(), children: new Date(e.at).toLocaleString() })
|
|
69
|
+
] }, e.id)) });
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// ui/browse.tsx
|
|
73
|
+
import { useEffect, useRef, useState } from "react";
|
|
74
|
+
import { Button, FileIcon, FolderIcon, PresenceChip } from "agentic-design/react";
|
|
75
|
+
import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
76
|
+
function sortItems(items, { key, dir }, dateOf = (i) => i.updatedAt) {
|
|
77
|
+
const sign = dir === "asc" ? 1 : -1;
|
|
78
|
+
const by = key === "name" ? (a, b) => a.name.localeCompare(b.name, void 0, { numeric: true }) : (a, b) => dateOf(a) - dateOf(b);
|
|
79
|
+
return [...items].sort((a, b) => (a.kind === "folder" ? 0 : 1) - (b.kind === "folder" ? 0 : 1) || sign * by(a, b) || a.name.localeCompare(b.name));
|
|
80
|
+
}
|
|
81
|
+
function Stamp({ at }) {
|
|
82
|
+
const d = new Date(at);
|
|
83
|
+
return Number.isFinite(d.getTime()) ? /* @__PURE__ */ jsx2("time", { dateTime: d.toISOString(), children: dateFormat.format(d) }) : /* @__PURE__ */ jsx2("span", { children: "\u2014" });
|
|
84
|
+
}
|
|
85
|
+
var dateFormat = new Intl.DateTimeFormat(void 0, { dateStyle: "medium", timeStyle: "short" });
|
|
86
|
+
function ExpandableSearch({ value, onChange }) {
|
|
87
|
+
const [open, setOpen] = useState(false);
|
|
88
|
+
const input = useRef(null);
|
|
89
|
+
const trigger = useRef(null);
|
|
90
|
+
const restore = useRef(false);
|
|
91
|
+
const shown = open || !!value;
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
if (shown) input.current?.focus();
|
|
94
|
+
else if (restore.current) {
|
|
95
|
+
restore.current = false;
|
|
96
|
+
trigger.current?.focus();
|
|
97
|
+
}
|
|
98
|
+
}, [shown]);
|
|
99
|
+
const close = () => {
|
|
100
|
+
restore.current = true;
|
|
101
|
+
onChange("");
|
|
102
|
+
setOpen(false);
|
|
103
|
+
};
|
|
104
|
+
if (!shown) {
|
|
105
|
+
return /* @__PURE__ */ jsx2(Button, { ref: trigger, variant: "ghost", size: "sm", onClick: () => setOpen(true), children: "Search" });
|
|
106
|
+
}
|
|
107
|
+
return /* @__PURE__ */ jsxs2("div", { className: "drive-search", role: "search", children: [
|
|
108
|
+
/* @__PURE__ */ jsx2(
|
|
109
|
+
"input",
|
|
110
|
+
{
|
|
111
|
+
ref: input,
|
|
112
|
+
type: "search",
|
|
113
|
+
className: "drive-search__input",
|
|
114
|
+
"aria-label": "Search this folder",
|
|
115
|
+
placeholder: "Search this folder",
|
|
116
|
+
value,
|
|
117
|
+
onChange: (e) => onChange(e.target.value),
|
|
118
|
+
onKeyDown: (e) => {
|
|
119
|
+
if (e.key === "Escape") close();
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
),
|
|
123
|
+
/* @__PURE__ */ jsx2(Button, { variant: "ghost", size: "sm", onClick: close, children: "Close search" })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
function ItemTable({ label, items, sort, onSort, selected = /* @__PURE__ */ new Set(), onSelect, href, who: who2, actions, dateOf = (i) => i.updatedAt }) {
|
|
127
|
+
const all = items.length > 0 && items.every((i) => selected.has(i.id));
|
|
128
|
+
const some = !all && items.some((i) => selected.has(i.id));
|
|
129
|
+
const head = useRef(null);
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
if (head.current) head.current.indeterminate = some;
|
|
132
|
+
}, [some]);
|
|
133
|
+
const toggle = (id, on) => {
|
|
134
|
+
if (!onSelect) return;
|
|
135
|
+
const next = new Set(selected);
|
|
136
|
+
if (on) next.add(id);
|
|
137
|
+
else next.delete(id);
|
|
138
|
+
onSelect(next);
|
|
139
|
+
};
|
|
140
|
+
const th = (key, text, cls) => /* @__PURE__ */ jsx2("th", { scope: "col", className: cls, "aria-sort": sort.key === key ? sort.dir === "asc" ? "ascending" : "descending" : "none", children: /* @__PURE__ */ jsxs2("button", { type: "button", className: "drive-sort", onClick: () => onSort(key), children: [
|
|
141
|
+
text,
|
|
142
|
+
/* @__PURE__ */ jsx2("span", { "aria-hidden": "true", children: sort.key === key ? sort.dir === "asc" ? " \u2191" : " \u2193" : "" })
|
|
143
|
+
] }) });
|
|
144
|
+
return /* @__PURE__ */ jsxs2("table", { className: "drive-table", "aria-label": label, children: [
|
|
145
|
+
/* @__PURE__ */ jsx2("thead", { children: /* @__PURE__ */ jsxs2("tr", { children: [
|
|
146
|
+
onSelect && /* @__PURE__ */ jsx2("th", { scope: "col", className: "drive-table__check", children: /* @__PURE__ */ jsx2("input", { ref: head, type: "checkbox", className: "agd-checkbox", "aria-label": "Select all items", checked: all, onChange: (e) => onSelect(e.target.checked ? new Set(items.map((i) => i.id)) : /* @__PURE__ */ new Set()) }) }),
|
|
147
|
+
th("name", "Name"),
|
|
148
|
+
/* @__PURE__ */ jsx2("th", { scope: "col", className: "drive-table__who", children: "Edited by" }),
|
|
149
|
+
th("modified", "Modified", "drive-table__date"),
|
|
150
|
+
/* @__PURE__ */ jsx2("th", { scope: "col", children: /* @__PURE__ */ jsx2("span", { className: "drive-sr", children: "Actions" }) })
|
|
151
|
+
] }) }),
|
|
152
|
+
/* @__PURE__ */ jsx2("tbody", { children: items.map((i) => /* @__PURE__ */ jsxs2("tr", { className: "drive-row", "data-selected": selected.has(i.id) || void 0, children: [
|
|
153
|
+
onSelect && /* @__PURE__ */ jsx2("td", { className: "drive-table__check", children: /* @__PURE__ */ jsx2("input", { type: "checkbox", className: "agd-checkbox", "aria-label": `Select ${i.name}`, checked: selected.has(i.id), onChange: (e) => toggle(i.id, e.target.checked) }) }),
|
|
154
|
+
/* @__PURE__ */ jsx2("td", { children: /* @__PURE__ */ jsxs2("div", { className: "drive-table__name", children: [
|
|
155
|
+
/* @__PURE__ */ jsx2("span", { className: "drive-table__icon", "aria-hidden": "true", children: i.kind === "folder" ? /* @__PURE__ */ jsx2(FolderIcon, {}) : /* @__PURE__ */ jsx2(FileIcon, {}) }),
|
|
156
|
+
/* @__PURE__ */ jsx2("a", { href: href(i), children: i.name })
|
|
157
|
+
] }) }),
|
|
158
|
+
/* @__PURE__ */ jsx2("td", { className: "drive-table__who", children: /* @__PURE__ */ jsx2(PresenceChip, { entry: who2(i.updatedBy, i.owner) }) }),
|
|
159
|
+
/* @__PURE__ */ jsx2("td", { className: "drive-table__date", children: /* @__PURE__ */ jsx2(Stamp, { at: dateOf(i) }) }),
|
|
160
|
+
/* @__PURE__ */ jsx2("td", { className: "drive-table__actions", children: actions(i) })
|
|
161
|
+
] }, i.id)) })
|
|
162
|
+
] });
|
|
163
|
+
}
|
|
164
|
+
function BulkBar({ count, busy, onTrash, onClear }) {
|
|
165
|
+
if (count === 0) return null;
|
|
166
|
+
return /* @__PURE__ */ jsxs2("div", { role: "region", "aria-label": "Selected items", className: "drive-bulk", children: [
|
|
167
|
+
/* @__PURE__ */ jsxs2("span", { role: "status", children: [
|
|
168
|
+
count,
|
|
169
|
+
" selected"
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ jsx2(Button, { variant: "danger", size: "sm", onClick: onTrash, disabled: busy, children: "Move to trash" }),
|
|
172
|
+
/* @__PURE__ */ jsx2(Button, { variant: "ghost", size: "sm", onClick: onClear, children: "Clear selection" })
|
|
173
|
+
] });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// ui/App.tsx
|
|
177
|
+
import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
38
178
|
var errorText = (e) => e instanceof DriveApiError ? `${e.message} (${e.code})` : e instanceof Error ? e.message : "Something went wrong";
|
|
39
179
|
var byName = (a, b) => (a.kind === "folder" ? 0 : 1) - (b.kind === "folder" ? 0 : 1) || a.name.localeCompare(b.name);
|
|
40
180
|
var who = (a, owner) => a.kind === "human" ? { id: a.id, name: a.id, kind: "person" } : { id: a.id, name: a.id, kind: "agent", actingFor: owner };
|
|
41
|
-
var MachineLabel = ({ item }) => item.machineMade ? /* @__PURE__ */
|
|
181
|
+
var MachineLabel = ({ item }) => item.machineMade ? /* @__PURE__ */ jsx3("span", { className: "agd-pill", children: "Created by agent" }) : null;
|
|
42
182
|
function useLoad(fn) {
|
|
43
|
-
const [state, set] =
|
|
44
|
-
const [tick, setTick] =
|
|
45
|
-
|
|
183
|
+
const [state, set] = useState2({ status: "loading" });
|
|
184
|
+
const [tick, setTick] = useState2(0);
|
|
185
|
+
useEffect2(() => {
|
|
46
186
|
let live = true;
|
|
47
187
|
fn().then((data) => live && set({ status: "ok", data }), (e) => live && set({ status: "error", error: errorText(e) }));
|
|
48
188
|
return () => {
|
|
@@ -52,27 +192,35 @@ function useLoad(fn) {
|
|
|
52
192
|
return [state, () => setTick((n) => n + 1)];
|
|
53
193
|
}
|
|
54
194
|
function Status({ state, retry, children }) {
|
|
55
|
-
if (state.status === "loading") return /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
195
|
+
if (state.status === "loading") return /* @__PURE__ */ jsxs3("p", { role: "status", className: "drive-status", children: [
|
|
196
|
+
/* @__PURE__ */ jsx3("span", { className: "agd-spinner", "aria-hidden": "true" }),
|
|
57
197
|
" Loading\u2026"
|
|
58
198
|
] });
|
|
59
|
-
if (state.status === "error") return /* @__PURE__ */
|
|
60
|
-
return /* @__PURE__ */
|
|
199
|
+
if (state.status === "error") return /* @__PURE__ */ jsx3("div", { role: "alert", children: /* @__PURE__ */ jsx3(EmptyState, { title: "Could not load this page", description: state.error, action: /* @__PURE__ */ jsx3(Button2, { onClick: retry, children: "Try again" }) }) });
|
|
200
|
+
return /* @__PURE__ */ jsx3(Fragment, { children });
|
|
61
201
|
}
|
|
62
202
|
var routeParts = (hash) => hash.replace(/^#\/?/, "").split("/");
|
|
203
|
+
var goHash = (loc) => {
|
|
204
|
+
history.replaceState(null, "", `#/${loc}`);
|
|
205
|
+
dispatchEvent(new HashChangeEvent("hashchange"));
|
|
206
|
+
};
|
|
63
207
|
function Routes({ hash, client, origin, go }) {
|
|
64
208
|
const parts = routeParts(hash);
|
|
65
|
-
if (parts[0] === "trash") return /* @__PURE__ */
|
|
66
|
-
if (parts[0] === "
|
|
67
|
-
return /* @__PURE__ */
|
|
209
|
+
if (parts[0] === "trash") return /* @__PURE__ */ jsx3(TrashView, { client }, "trash");
|
|
210
|
+
if (parts[0] === "a" && parts[1]) return /* @__PURE__ */ jsx3(ActivityView, { client, id: parts[1] }, hash);
|
|
211
|
+
if (parts[0] === "f" && parts[1]) return /* @__PURE__ */ jsx3(Download, { client, id: parts[1], origin, go }, hash);
|
|
212
|
+
return /* @__PURE__ */ jsx3(Browser, { client, loc: parts[0] || "/", origin }, hash);
|
|
68
213
|
}
|
|
69
214
|
function Browser({ client, loc, origin }) {
|
|
70
215
|
const toast = useToast();
|
|
71
|
-
const [view, setView] =
|
|
72
|
-
const [dlg, setDlg] =
|
|
73
|
-
const [drag, setDrag] =
|
|
74
|
-
const [busy, setBusy] =
|
|
75
|
-
const
|
|
216
|
+
const [view, setView] = useState2(() => localStorage.getItem("agentic-drive-view") === "grid" ? "grid" : "list");
|
|
217
|
+
const [dlg, setDlg] = useState2(null);
|
|
218
|
+
const [drag, setDrag] = useState2(false);
|
|
219
|
+
const [busy, setBusy] = useState2(false);
|
|
220
|
+
const [query, setQuery] = useState2("");
|
|
221
|
+
const [sort, setSort] = useState2({ key: "name", dir: "asc" });
|
|
222
|
+
const [selected, setSelected] = useState2(/* @__PURE__ */ new Set());
|
|
223
|
+
const input = useRef2(null);
|
|
76
224
|
const [state, reload] = useLoad(async () => {
|
|
77
225
|
const root = await client.stat("/");
|
|
78
226
|
const folder = loc === "/" ? root : await client.stat(loc);
|
|
@@ -116,77 +264,101 @@ function Browser({ client, loc, origin }) {
|
|
|
116
264
|
setDrag(false);
|
|
117
265
|
if (e.dataTransfer.files.length) void upload(e.dataTransfer.files);
|
|
118
266
|
};
|
|
267
|
+
const onSort = (key) => setSort((s) => ({ key, dir: s.key === key && s.dir === "asc" ? "desc" : "asc" }));
|
|
268
|
+
const trashSelected = async (ids) => {
|
|
269
|
+
setBusy(true);
|
|
270
|
+
const results = await Promise.allSettled(ids.map((id) => client.trash(id)));
|
|
271
|
+
const failed = results.filter((r) => r.status === "rejected");
|
|
272
|
+
if (failed.length) toast({ title: `${failed.length} of ${ids.length} items did not move`, description: errorText(failed[0].reason), tone: "danger" });
|
|
273
|
+
else toast({ title: `Moved ${ids.length} ${ids.length === 1 ? "item" : "items"} to trash`, tone: "success" });
|
|
274
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
275
|
+
setBusy(false);
|
|
276
|
+
reload();
|
|
277
|
+
};
|
|
119
278
|
const setViewMode = (v) => {
|
|
279
|
+
setSelected(/* @__PURE__ */ new Set());
|
|
120
280
|
localStorage.setItem("agentic-drive-view", v);
|
|
121
281
|
setView(v);
|
|
122
282
|
};
|
|
123
|
-
return /* @__PURE__ */
|
|
283
|
+
return /* @__PURE__ */ jsx3("section", { onDragOver: (e) => {
|
|
124
284
|
e.preventDefault();
|
|
125
285
|
setDrag(true);
|
|
126
286
|
}, onDragLeave: (e) => {
|
|
127
287
|
if (!e.currentTarget.contains(e.relatedTarget)) setDrag(false);
|
|
128
|
-
}, onDrop, className: drag ? "
|
|
129
|
-
const { folder, root, crumbs,
|
|
130
|
-
const
|
|
131
|
-
|
|
132
|
-
|
|
288
|
+
}, onDrop, className: `drive-drop${drag ? " drive-drop--over" : ""}${view === "list" && selected.size ? " drive-drop--bulk" : ""}`, "aria-label": "Files", children: /* @__PURE__ */ jsx3(Status, { state, retry: reload, children: state.status === "ok" && (() => {
|
|
289
|
+
const { folder, root, crumbs, tree } = state.data;
|
|
290
|
+
const needle = query.trim().toLowerCase();
|
|
291
|
+
const items = sortItems(state.data.items.filter((i) => i.name.toLowerCase().includes(needle)), sort);
|
|
292
|
+
const picked = items.filter((i) => selected.has(i.id)).map((i) => i.id);
|
|
293
|
+
const actions = (item) => /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
294
|
+
/* @__PURE__ */ jsx3(MachineLabel, { item }),
|
|
295
|
+
/* @__PURE__ */ jsx3(Menu, { align: "end", trigger: /* @__PURE__ */ jsx3(IconButton, { label: `Actions for ${item.name}`, icon: /* @__PURE__ */ jsx3(MoreIcon, {}), variant: "ghost" }), items: [
|
|
133
296
|
{ label: "Rename", onSelect: () => setDlg({ kind: "rename", item }) },
|
|
134
297
|
{ label: "Move", onSelect: () => setDlg({ kind: "move", item }) },
|
|
298
|
+
{ label: "Activity", onSelect: () => goHash(`a/${item.id}`) },
|
|
135
299
|
{ label: "Share", onSelect: () => setDlg({ kind: "share", item }) },
|
|
136
300
|
"separator",
|
|
137
301
|
{ label: "Move to trash", danger: true, onSelect: () => void act(() => client.trash(item.id), `Moved ${item.name} to trash`) }
|
|
138
302
|
] })
|
|
139
303
|
] });
|
|
140
304
|
const href = (i) => i.kind === "folder" ? `#/${i.id}` : `#/f/${i.id}`;
|
|
141
|
-
const level = (id) => /* @__PURE__ */
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
/* @__PURE__ */
|
|
305
|
+
const level = (id) => /* @__PURE__ */ jsx3("ul", { className: "drive-tree", children: (tree.get(id) ?? []).map((n) => /* @__PURE__ */ jsxs3("li", { children: [
|
|
306
|
+
/* @__PURE__ */ jsxs3("a", { href: `#/${n.id}`, "aria-current": n.id === folder.id ? "page" : void 0, children: [
|
|
307
|
+
/* @__PURE__ */ jsx3(FolderIcon2, { "aria-hidden": "true" }),
|
|
144
308
|
" ",
|
|
145
309
|
n.name
|
|
146
310
|
] }),
|
|
147
311
|
tree.has(n.id) && level(n.id)
|
|
148
312
|
] }, n.id)) });
|
|
149
|
-
return /* @__PURE__ */
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
-
crumbs.map((c, i) => /* @__PURE__ */
|
|
313
|
+
return /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
314
|
+
/* @__PURE__ */ jsx3("nav", { "aria-label": "Breadcrumb", className: "drive-crumbs", children: /* @__PURE__ */ jsxs3("ol", { children: [
|
|
315
|
+
/* @__PURE__ */ jsx3("li", { children: crumbs.length ? /* @__PURE__ */ jsx3("a", { href: "#/", children: "My files" }) : /* @__PURE__ */ jsx3("span", { "aria-current": "page", children: "My files" }) }),
|
|
316
|
+
crumbs.map((c, i) => /* @__PURE__ */ jsx3("li", { children: i === crumbs.length - 1 ? /* @__PURE__ */ jsx3("span", { "aria-current": "page", children: c.name }) : /* @__PURE__ */ jsx3("a", { href: `#/${c.id}`, children: c.name }) }, c.id))
|
|
153
317
|
] }) }),
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
156
|
-
|
|
157
|
-
/* @__PURE__ */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
/* @__PURE__ */
|
|
318
|
+
/* @__PURE__ */ jsxs3("div", { className: "drive-bar", children: [
|
|
319
|
+
/* @__PURE__ */ jsxs3("div", { className: "drive-title", children: [
|
|
320
|
+
/* @__PURE__ */ jsx3("h1", { children: folder.id === root.id ? "My files" : folder.name }),
|
|
321
|
+
folder.id !== root.id && /* @__PURE__ */ jsx3(Button2, { variant: "secondary", size: "sm", onClick: () => setDlg({ kind: "share", item: folder }), children: "Share" })
|
|
322
|
+
] }),
|
|
323
|
+
/* @__PURE__ */ jsxs3(Toolbar, { label: "Folder actions", children: [
|
|
324
|
+
/* @__PURE__ */ jsx3(ToolbarButton, { label: "New folder", icon: /* @__PURE__ */ jsx3(PlusIcon, {}), onClick: () => setDlg({ kind: "mkdir" }) }),
|
|
325
|
+
/* @__PURE__ */ jsx3(ToolbarButton, { label: "Upload files", icon: /* @__PURE__ */ jsx3(FileIcon2, {}), onClick: () => input.current?.click(), disabled: busy }),
|
|
326
|
+
/* @__PURE__ */ jsx3(ToolbarButton, { label: "List view", icon: /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", children: "\u2630" }), pressed: view === "list", onClick: () => setViewMode("list") }),
|
|
327
|
+
/* @__PURE__ */ jsx3(ToolbarButton, { label: "Grid view", icon: /* @__PURE__ */ jsx3("span", { "aria-hidden": "true", children: "\u25A6" }), pressed: view === "grid", onClick: () => setViewMode("grid") })
|
|
161
328
|
] }),
|
|
162
|
-
/* @__PURE__ */
|
|
329
|
+
/* @__PURE__ */ jsx3("input", { ref: input, type: "file", multiple: true, hidden: true, "aria-label": "Choose files to upload", onChange: (e) => {
|
|
163
330
|
if (e.target.files) void upload(e.target.files);
|
|
164
331
|
e.target.value = "";
|
|
165
332
|
} })
|
|
166
333
|
] }),
|
|
167
|
-
/* @__PURE__ */
|
|
168
|
-
/* @__PURE__ */
|
|
169
|
-
/* @__PURE__ */
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
-
/* @__PURE__ */
|
|
173
|
-
"
|
|
174
|
-
/* @__PURE__ */
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
334
|
+
/* @__PURE__ */ jsxs3("div", { className: "drive-split", children: [
|
|
335
|
+
/* @__PURE__ */ jsx3("nav", { "aria-label": "Folders", className: "drive-folders", children: level(root.id) }),
|
|
336
|
+
/* @__PURE__ */ jsxs3("div", { children: [
|
|
337
|
+
/* @__PURE__ */ jsx3("div", { className: "drive-tools", children: /* @__PURE__ */ jsx3(ExpandableSearch, { value: query, onChange: setQuery }) }),
|
|
338
|
+
/* @__PURE__ */ jsx3("p", { role: "status", className: "drive-sr", children: needle ? `${items.length} of ${state.data.items.length} items match` : "" }),
|
|
339
|
+
state.data.items.length === 0 ? /* @__PURE__ */ jsx3(EmptyState, { title: "This folder is empty", description: "Drop files here, or use Upload files.", action: /* @__PURE__ */ jsx3(Button2, { onClick: () => input.current?.click(), disabled: busy, children: "Upload files" }) }) : items.length === 0 ? /* @__PURE__ */ jsx3(EmptyState, { title: "Nothing matches", description: `No item in this folder has \u201C${query.trim()}\u201D in its name.`, action: /* @__PURE__ */ jsx3(Button2, { onClick: () => setQuery(""), children: "Clear search" }) }) : view === "list" ? /* @__PURE__ */ jsx3(ItemTable, { label: `Items in ${folder.name || "My files"}`, items, sort, onSort, selected, onSelect: setSelected, href, who, actions }) : /* @__PURE__ */ jsx3("ul", { className: "drive-grid", "aria-label": `Items in ${folder.name || "My files"}`, children: items.map((i) => /* @__PURE__ */ jsxs3("li", { className: "drive-card", children: [
|
|
340
|
+
/* @__PURE__ */ jsx3("span", { className: "drive-card__icon", "aria-hidden": "true", children: i.kind === "folder" ? /* @__PURE__ */ jsx3(FolderIcon2, {}) : /* @__PURE__ */ jsx3(FileIcon2, {}) }),
|
|
341
|
+
/* @__PURE__ */ jsx3("a", { href: href(i), className: "drive-card__name", children: i.name }),
|
|
342
|
+
/* @__PURE__ */ jsxs3("span", { className: "drive-card__meta", children: [
|
|
343
|
+
"Edited by ",
|
|
344
|
+
/* @__PURE__ */ jsx3(PresenceChip2, { entry: who(i.updatedBy, i.owner) })
|
|
345
|
+
] }),
|
|
346
|
+
/* @__PURE__ */ jsx3("span", { className: "drive-card__actions", children: actions(i) })
|
|
347
|
+
] }, i.id)) })
|
|
348
|
+
] })
|
|
178
349
|
] }),
|
|
179
|
-
|
|
180
|
-
dlg?.kind === "
|
|
181
|
-
dlg?.kind === "
|
|
182
|
-
dlg?.kind === "
|
|
350
|
+
view === "list" && /* @__PURE__ */ jsx3(BulkBar, { count: picked.length, busy, onTrash: () => void trashSelected(picked), onClear: () => setSelected(/* @__PURE__ */ new Set()) }),
|
|
351
|
+
dlg?.kind === "mkdir" && /* @__PURE__ */ jsx3(Prompt, { open: true, title: "New folder", label: "Folder name", initial: "", submit: "Create", onClose: () => setDlg(null), onSubmit: (name) => act(() => client.mkdir(folder.id === root.id ? `/${name}` : `${folder.id}/${name}`), `Created ${name}`) }),
|
|
352
|
+
dlg?.kind === "rename" && /* @__PURE__ */ jsx3(Prompt, { open: true, title: "Rename", label: "New name", initial: dlg.item.name, submit: "Rename", onClose: () => setDlg(null), onSubmit: (name) => act(() => client.move(dlg.item.id, dlg.item.parentId, { name }), `Renamed to ${name}`) }),
|
|
353
|
+
dlg?.kind === "move" && /* @__PURE__ */ jsx3(MoveDialog, { client, item: dlg.item, onClose: () => setDlg(null), onMove: (to) => act(() => client.move(dlg.item.id, to), `Moved ${dlg.item.name}`) }),
|
|
354
|
+
dlg?.kind === "share" && /* @__PURE__ */ jsx3(Sharing, { client, item: dlg.item, origin, onClose: () => setDlg(null) })
|
|
183
355
|
] });
|
|
184
356
|
})() }) });
|
|
185
357
|
}
|
|
186
358
|
function Prompt({ open, title, label, initial, submit, onClose, onSubmit }) {
|
|
187
|
-
const [value, setValue] =
|
|
188
|
-
const sent =
|
|
189
|
-
const [problem, setProblem] =
|
|
359
|
+
const [value, setValue] = useState2(initial);
|
|
360
|
+
const sent = useRef2(false);
|
|
361
|
+
const [problem, setProblem] = useState2();
|
|
190
362
|
const send = (name) => {
|
|
191
363
|
if (!name) return;
|
|
192
364
|
if (name.includes("/")) return setProblem("A name cannot have a slash.");
|
|
@@ -196,16 +368,16 @@ function Prompt({ open, title, label, initial, submit, onClose, onSubmit }) {
|
|
|
196
368
|
sent.current = false;
|
|
197
369
|
});
|
|
198
370
|
};
|
|
199
|
-
return /* @__PURE__ */
|
|
371
|
+
return /* @__PURE__ */ jsx3(Dialog, { open: !!open, onOpenChange: (o) => {
|
|
200
372
|
if (!o) onClose();
|
|
201
|
-
}, title, children: /* @__PURE__ */
|
|
373
|
+
}, title, children: /* @__PURE__ */ jsxs3("form", { onSubmit: (e) => {
|
|
202
374
|
e.preventDefault();
|
|
203
375
|
if (!sent.current) send(value.trim());
|
|
204
376
|
}, className: "drive-form", children: [
|
|
205
|
-
/* @__PURE__ */
|
|
206
|
-
/* @__PURE__ */
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ jsx3(Input, { label, value, onChange: (e) => setValue(e.target.value), error: problem, required: true }),
|
|
378
|
+
/* @__PURE__ */ jsxs3("div", { className: "drive-form__actions", children: [
|
|
379
|
+
/* @__PURE__ */ jsx3(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx3(Button2, { variant: "ghost", type: "button", children: "Cancel" }) }),
|
|
380
|
+
/* @__PURE__ */ jsx3(Button2, { type: "submit", children: submit })
|
|
209
381
|
] })
|
|
210
382
|
] }) });
|
|
211
383
|
}
|
|
@@ -216,11 +388,11 @@ function MoveDialog({ client, item, onClose, onMove }) {
|
|
|
216
388
|
const own = all.find((x) => x.id === item.id)?.path;
|
|
217
389
|
return [{ id: "/", path: "/", name: "My files" }, ...all.filter((x) => x.id !== root.id && !(own && (x.path === own || x.path.startsWith(`${own}/`))))];
|
|
218
390
|
});
|
|
219
|
-
const [to, setTo] =
|
|
220
|
-
const sent =
|
|
221
|
-
return /* @__PURE__ */
|
|
391
|
+
const [to, setTo] = useState2("/");
|
|
392
|
+
const sent = useRef2(false);
|
|
393
|
+
return /* @__PURE__ */ jsx3(Dialog, { open: true, onOpenChange: (o) => {
|
|
222
394
|
if (!o) onClose();
|
|
223
|
-
}, title: `Move ${item.name}`, children: /* @__PURE__ */
|
|
395
|
+
}, title: `Move ${item.name}`, children: /* @__PURE__ */ jsx3(Status, { state: folders, retry, children: folders.status === "ok" && /* @__PURE__ */ jsxs3("form", { onSubmit: (e) => {
|
|
224
396
|
e.preventDefault();
|
|
225
397
|
if (sent.current) return;
|
|
226
398
|
sent.current = true;
|
|
@@ -228,10 +400,10 @@ function MoveDialog({ client, item, onClose, onMove }) {
|
|
|
228
400
|
sent.current = false;
|
|
229
401
|
});
|
|
230
402
|
}, className: "drive-form", children: [
|
|
231
|
-
/* @__PURE__ */
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
/* @__PURE__ */
|
|
234
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ jsx3(Select, { label: "Move to", value: to, onChange: (e) => setTo(e.target.value), children: folders.data.map((x) => /* @__PURE__ */ jsx3("option", { value: x.id, children: x.path === "/" ? "My files" : x.path }, x.id)) }),
|
|
404
|
+
/* @__PURE__ */ jsxs3("div", { className: "drive-form__actions", children: [
|
|
405
|
+
/* @__PURE__ */ jsx3(DialogClose, { asChild: true, children: /* @__PURE__ */ jsx3(Button2, { variant: "ghost", type: "button", children: "Cancel" }) }),
|
|
406
|
+
/* @__PURE__ */ jsx3(Button2, { type: "submit", children: "Move" })
|
|
235
407
|
] })
|
|
236
408
|
] }) }) });
|
|
237
409
|
}
|
|
@@ -239,7 +411,7 @@ var EXPIRY_MS = { never: void 0, "1d": 864e5, "7d": 7 * 864e5, "30d": 30 * 864e5
|
|
|
239
411
|
function Sharing({ client, item, origin, onClose }) {
|
|
240
412
|
const toast = useToast();
|
|
241
413
|
const [state, reload] = useLoad(() => client.shares(item.id));
|
|
242
|
-
const [link, setLink] =
|
|
414
|
+
const [link, setLink] = useState2({ role: "viewer", expiry: "never", signedInOnly: false });
|
|
243
415
|
const liveLinks = state.status === "ok" ? state.data.links.filter((l) => !l.revoked && (l.expiresAt === null || l.expiresAt > Date.now())) : [];
|
|
244
416
|
const live = liveLinks[0];
|
|
245
417
|
const current = link.id ? link : live ? { ...link, id: live.id, role: live.role === "owner" ? "editor" : live.role, signedInOnly: live.signedInOnly } : link;
|
|
@@ -270,7 +442,7 @@ function Sharing({ client, item, origin, onClose }) {
|
|
|
270
442
|
url: current.token ? `${origin}/#/s/${item.id}/${current.token}` : "Turn the link off and on to make a new one. The address shows once.",
|
|
271
443
|
expiresAt: live?.expiresAt ? new Date(live.expiresAt) : null
|
|
272
444
|
};
|
|
273
|
-
return /* @__PURE__ */
|
|
445
|
+
return /* @__PURE__ */ jsx3(
|
|
274
446
|
ShareDialog,
|
|
275
447
|
{
|
|
276
448
|
open: true,
|
|
@@ -298,9 +470,12 @@ function Sharing({ client, item, origin, onClose }) {
|
|
|
298
470
|
}
|
|
299
471
|
);
|
|
300
472
|
}
|
|
473
|
+
var trashedAt = (i) => i.trashedAt ?? i.updatedAt;
|
|
301
474
|
function TrashView({ client }) {
|
|
302
475
|
const toast = useToast();
|
|
303
476
|
const [state, reload] = useLoad(() => client.listTrash());
|
|
477
|
+
const [sort, setSort] = useState2({ key: "name", dir: "asc" });
|
|
478
|
+
const onSort = (key) => setSort((s) => ({ key, dir: s.key === key && s.dir === "asc" ? "desc" : "asc" }));
|
|
304
479
|
const restore = async (i) => {
|
|
305
480
|
try {
|
|
306
481
|
await client.restore(i.id, { onConflict: "rename" });
|
|
@@ -310,14 +485,25 @@ function TrashView({ client }) {
|
|
|
310
485
|
}
|
|
311
486
|
reload();
|
|
312
487
|
};
|
|
313
|
-
return /* @__PURE__ */
|
|
314
|
-
/* @__PURE__ */
|
|
315
|
-
/* @__PURE__ */
|
|
316
|
-
/* @__PURE__ */
|
|
317
|
-
/* @__PURE__ */
|
|
318
|
-
] }) }
|
|
488
|
+
return /* @__PURE__ */ jsxs3("section", { "aria-label": "Trash", children: [
|
|
489
|
+
/* @__PURE__ */ jsx3("h1", { children: "Trash" }),
|
|
490
|
+
/* @__PURE__ */ jsx3(Status, { state, retry: reload, children: state.status === "ok" && (state.data.length === 0 ? /* @__PURE__ */ jsx3(EmptyState, { title: "The trash is empty", description: "Items you move to the trash show up here." }) : /* @__PURE__ */ jsx3(ItemTable, { label: "Items in the trash", items: sortItems(state.data, sort, trashedAt), dateOf: trashedAt, sort, onSort, href: () => "#/trash", who, actions: (i) => /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
491
|
+
/* @__PURE__ */ jsx3(MachineLabel, { item: i }),
|
|
492
|
+
/* @__PURE__ */ jsx3(Button2, { size: "sm", onClick: () => void restore(i), children: `Restore ${i.name}` })
|
|
493
|
+
] }) })) })
|
|
319
494
|
] });
|
|
320
495
|
}
|
|
496
|
+
function ActivityView({ client, id }) {
|
|
497
|
+
const [state, retry] = useLoad(async () => ({ item: await client.stat(id), entries: await client.listActivity(id) }));
|
|
498
|
+
return /* @__PURE__ */ jsx3("section", { "aria-label": "Item activity", children: /* @__PURE__ */ jsx3(Status, { state, retry, children: state.status === "ok" && /* @__PURE__ */ jsxs3(Fragment, { children: [
|
|
499
|
+
/* @__PURE__ */ jsxs3("h1", { children: [
|
|
500
|
+
"Activity: ",
|
|
501
|
+
state.data.item.name
|
|
502
|
+
] }),
|
|
503
|
+
/* @__PURE__ */ jsx3("p", { children: /* @__PURE__ */ jsx3("a", { href: state.data.item.kind === "folder" ? `#/${id}` : `#/${state.data.item.parentId === "root" ? "" : state.data.item.parentId}`, children: "Back to files" }) }),
|
|
504
|
+
/* @__PURE__ */ jsx3(ActivityList, { entries: state.data.entries })
|
|
505
|
+
] }) }) });
|
|
506
|
+
}
|
|
321
507
|
function Download({ client, id, origin, go }) {
|
|
322
508
|
const [state, retry] = useLoad(async () => {
|
|
323
509
|
const item = await client.stat(id);
|
|
@@ -330,11 +516,11 @@ function Download({ client, id, origin, go }) {
|
|
|
330
516
|
go(item.parentId);
|
|
331
517
|
return item;
|
|
332
518
|
});
|
|
333
|
-
return /* @__PURE__ */
|
|
519
|
+
return /* @__PURE__ */ jsx3(Status, { state, retry, children: null });
|
|
334
520
|
}
|
|
335
521
|
|
|
336
522
|
// ui/embed.tsx
|
|
337
|
-
import { jsx as
|
|
523
|
+
import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
338
524
|
var PLACEHOLDER = "from-get-token";
|
|
339
525
|
function makeClient({ baseUrl, getToken }) {
|
|
340
526
|
if (typeof getToken !== "function") throw new TypeError("getToken must be a function");
|
|
@@ -354,16 +540,16 @@ function makeClient({ baseUrl, getToken }) {
|
|
|
354
540
|
}
|
|
355
541
|
var clients = 0;
|
|
356
542
|
function DriveBrowser({ baseUrl, getToken }) {
|
|
357
|
-
const [made, setMade] =
|
|
358
|
-
|
|
543
|
+
const [made, setMade] = useState3();
|
|
544
|
+
useEffect3(() => {
|
|
359
545
|
const next = makeClient({ baseUrl, getToken });
|
|
360
546
|
setMade({ id: ++clients, client: next.client, origin: new URL(baseUrl).origin });
|
|
361
547
|
return () => next.close();
|
|
362
548
|
}, [baseUrl, getToken]);
|
|
363
|
-
return made ? /* @__PURE__ */
|
|
549
|
+
return made ? /* @__PURE__ */ jsx4(DriveView, { client: made.client, origin: made.origin }, made.id) : null;
|
|
364
550
|
}
|
|
365
551
|
function DriveView({ client, origin }) {
|
|
366
|
-
const [hash, setHash] =
|
|
552
|
+
const [hash, setHash] = useState3("#/");
|
|
367
553
|
const go = (loc) => setHash(`#/${loc === "/" ? "" : loc}`);
|
|
368
554
|
const follow = (e) => {
|
|
369
555
|
if (e.defaultPrevented || e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) return;
|
|
@@ -373,12 +559,12 @@ function DriveView({ client, origin }) {
|
|
|
373
559
|
setHash(link.getAttribute("href"));
|
|
374
560
|
};
|
|
375
561
|
const place = hash.startsWith("#/trash") ? "trash" : "files";
|
|
376
|
-
return /* @__PURE__ */
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
{ href: "#/", label: "My files", icon: /* @__PURE__ */
|
|
562
|
+
return /* @__PURE__ */ jsxs4("div", { className: "drive-root", onClick: follow, children: [
|
|
563
|
+
/* @__PURE__ */ jsx4(SidebarNav2, { label: "Places", items: [
|
|
564
|
+
{ href: "#/", label: "My files", icon: /* @__PURE__ */ jsx4(FolderIcon3, { "aria-hidden": "true" }), current: place === "files" },
|
|
379
565
|
{ href: "#/trash", label: "Trash", current: place === "trash" }
|
|
380
566
|
] }),
|
|
381
|
-
/* @__PURE__ */
|
|
567
|
+
/* @__PURE__ */ jsx4("div", { className: "drive-main", children: /* @__PURE__ */ jsx4(Routes, { hash, client, origin, go }) })
|
|
382
568
|
] });
|
|
383
569
|
}
|
|
384
570
|
function mount(element, options) {
|
|
@@ -387,7 +573,7 @@ function mount(element, options) {
|
|
|
387
573
|
let open = true;
|
|
388
574
|
let version = 0;
|
|
389
575
|
const render = (next, client) => root.render(
|
|
390
|
-
/* @__PURE__ */
|
|
576
|
+
/* @__PURE__ */ jsx4(TooltipProvider, { children: /* @__PURE__ */ jsx4(ToastProvider, { children: /* @__PURE__ */ jsx4(DriveView, { client, origin: new URL(next.baseUrl).origin }, version++) }) })
|
|
391
577
|
);
|
|
392
578
|
render(options, current.client);
|
|
393
579
|
return {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { O as OnConflict, D as Drive, C as Ctx, N as Node,
|
|
2
|
-
export {
|
|
1
|
+
import { O as OnConflict, D as Drive, C as Ctx, N as Node, b as Actor } from './drive-BRg1Uj_3.js';
|
|
2
|
+
export { c as ACTOR_KINDS, d as Action, a as ActivityAction, A as ActivityEntry, e as ActorKind, f as Can, g as DriveDeps, h as DriveError, i as ERROR_STATUS, E as ErrorCode, R as ROOT_ID, S as SearchQuery, j as createDrive, p as parseName, k as parseSubject, s as subjectKindOf } from './drive-BRg1Uj_3.js';
|
|
3
3
|
import { Store, Blobs, Doc } from 'agentic-identity';
|
|
4
4
|
export { B as BackfillOptions, a as BackfillResult, b as backfillAuthorIds, c as backfillResources } from './migrate-B79gRPMu.js';
|
|
5
5
|
|
|
@@ -22,7 +22,7 @@ declare function upload(drive: Drive, ctx: Ctx, path: string, source: AsyncItera
|
|
|
22
22
|
/**
|
|
23
23
|
* Everything one owner has, as a zip. `manifest.json` names the person (id and kind), lists each item with its
|
|
24
24
|
* metadata and, for a file, the entry that holds its bytes, and adds what the person made in other drives, the
|
|
25
|
-
* shares they hold, the invites they sent, and the audit entries of what they did. Only the person in person gets
|
|
25
|
+
* shares they hold, the invites they sent, and the audit entries of what they did. It also adds the activity log entries of their changes to items. Each has the actor kind, `human` or `agent`. An entry in the drive of another person has no names. Only the person in person gets
|
|
26
26
|
* those parts, and the items of their agents that have an identity of their own (no bytes). For an agent the
|
|
27
27
|
* manifest says `partial: true`. Trashed items are included and flagged.
|
|
28
28
|
* Entries are named by item id, never by file name. A file whose bytes are gone is marked `missing`.
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-AB2RTTHJ.js";
|
|
4
4
|
import {
|
|
5
5
|
VERSION
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-D6KW6NVM.js";
|
|
7
7
|
import {
|
|
8
8
|
ACTOR_KINDS,
|
|
9
9
|
AuthError,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
subjectKindOf,
|
|
30
30
|
upload,
|
|
31
31
|
writeZip
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-622NAJ6K.js";
|
|
33
33
|
export {
|
|
34
34
|
ACTOR_KINDS,
|
|
35
35
|
AuthError,
|