@chibitek/chibi 0.1.180 → 0.1.182
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/dist/assets/{abnfDiagram-O67JEVCF-C91sfqR5.js → abnfDiagram-O67JEVCF-B8rB4VYk.js} +1 -1
- package/dist/assets/{arc-ywHVvcgD.js → arc-COTt5eKp.js} +1 -1
- package/dist/assets/{architectureDiagram-NJMV4G6O-BgUERWVi.js → architectureDiagram-NJMV4G6O-CPejbWZ8.js} +1 -1
- package/dist/assets/{blockDiagram-BEXU5L5S-CpeTJJap.js → blockDiagram-BEXU5L5S-DoioDp90.js} +1 -1
- package/dist/assets/{c4Diagram-YGBWAQC7-BgdM3M47.js → c4Diagram-YGBWAQC7-8PWWVdYW.js} +1 -1
- package/dist/assets/channel-CDw9Li4I.js +1 -0
- package/dist/assets/{chunk-2Q5K7J3B-BcMR6SsJ.js → chunk-2Q5K7J3B-DxtJtts-.js} +1 -1
- package/dist/assets/{chunk-3FUC2YCW-DNzXM7Mm.js → chunk-3FUC2YCW-D3YkXW5d.js} +2 -2
- package/dist/assets/{chunk-5VM5RSS4-kVNi7GcP.js → chunk-5VM5RSS4-CsKzmOcP.js} +1 -1
- package/dist/assets/{chunk-GTNCS2PH-B5bYzLKn.js → chunk-GTNCS2PH-gZEIPwuj.js} +1 -1
- package/dist/assets/{chunk-GWA4HPMP-DiMuTVC6.js → chunk-GWA4HPMP-Bjt2-00s.js} +1 -1
- package/dist/assets/{chunk-JWPE2WC7-Bl2yeh-K.js → chunk-JWPE2WC7-BvUQuiRB.js} +1 -1
- package/dist/assets/{chunk-NETBCI7D-Klel5WGa.js → chunk-NETBCI7D-Dq0TzVqk.js} +1 -1
- package/dist/assets/{chunk-WEXAMYUT-CPIykbsI.js → chunk-WEXAMYUT-DYCSZnMz.js} +1 -1
- package/dist/assets/{chunk-XXDRQBXY-8cVOBFNO.js → chunk-XXDRQBXY-B_OfX3TH.js} +1 -1
- package/dist/assets/{classDiagram-v2-NBCMYWYE-DxDpAPju.js → classDiagram-v2-NBCMYWYE-CyGFfePO.js} +1 -1
- package/dist/assets/{cose-bilkent-JH36ORCC-Bb935SMz.js → cose-bilkent-JH36ORCC-v7FbM5j-.js} +1 -1
- package/dist/assets/{cynefin-OW5HDTMX-CxYWe3QR.js → cynefin-OW5HDTMX-CqvJgX3t.js} +1 -1
- package/dist/assets/{cynefinDiagram-VND7K2PF-CYhyAhYv.js → cynefinDiagram-VND7K2PF-CA2yN6Xd.js} +1 -1
- package/dist/assets/{dagre-6A5THRUB-Bb41Vmni.js → dagre-6A5THRUB-Zr9etAoq.js} +1 -1
- package/dist/assets/{diagram-22UHCM2B-BNvUBpgi.js → diagram-22UHCM2B-DtUG2c4U.js} +1 -1
- package/dist/assets/{diagram-3UASUU5V-D9x2CdxS.js → diagram-3UASUU5V-D9Y-Wrhr.js} +1 -1
- package/dist/assets/{diagram-ATOU4E4O-BXIrC_GF.js → diagram-ATOU4E4O-DkeBHA-m.js} +1 -1
- package/dist/assets/{diagram-CDSNMT55-OI4ao0qQ.js → diagram-CDSNMT55-CdGlcHWC.js} +1 -1
- package/dist/assets/{diagram-MLGK6HIB-_zZZdxaC.js → diagram-MLGK6HIB-BeHhIQjn.js} +1 -1
- package/dist/assets/{diagram-MPIPVDR6-9k65oUfK.js → diagram-MPIPVDR6-AgCxokZc.js} +1 -1
- package/dist/assets/{ebnfDiagram-ZINNZB2B-Chvztd4J.js → ebnfDiagram-ZINNZB2B-CqYoX9yZ.js} +1 -1
- package/dist/assets/{elk-276RUBZZ-CMWtKZmi.js → elk-276RUBZZ-Br_wamlb.js} +1 -1
- package/dist/assets/{erDiagram-OPXOYQCR-2vqBM9HW.js → erDiagram-OPXOYQCR-YuGMoUl0.js} +1 -1
- package/dist/assets/{flowDiagram-KWPJA3E3-C6y9L478.js → flowDiagram-KWPJA3E3-VflMWlTN.js} +1 -1
- package/dist/assets/{ganttDiagram-FUAMR5RP-uWHpQwJY.js → ganttDiagram-FUAMR5RP-q1LvQaev.js} +1 -1
- package/dist/assets/{gitGraphDiagram-X574FWY7-BLM0_X6z.js → gitGraphDiagram-X574FWY7-CHRdJIvn.js} +1 -1
- package/dist/assets/{index-CPnrJ6T1.js → index-B_gcNCKf.js} +3 -3
- package/dist/assets/{index-YJUVFbCT.js → index-C2q5K4Lk.js} +1 -1
- package/dist/assets/{infoDiagram-VRGFBTTK-DWeJ1wdL.js → infoDiagram-VRGFBTTK-DRwVvitP.js} +1 -1
- package/dist/assets/{ishikawaDiagram-OU5B5YK6-R28kPwvB.js → ishikawaDiagram-OU5B5YK6-BXZw4L0c.js} +1 -1
- package/dist/assets/{journeyDiagram-ZHPQQLJL-BHWE5-BX.js → journeyDiagram-ZHPQQLJL-B7AeEVRV.js} +1 -1
- package/dist/assets/{kanban-definition-PNTS6WVX-M-Er9io8.js → kanban-definition-PNTS6WVX-CQLN4aVl.js} +1 -1
- package/dist/assets/{linear-UI6pE8Wd.js → linear-CbYhE1pa.js} +1 -1
- package/dist/assets/{mermaid.core-B_hsjjFv.js → mermaid.core-D1syQdvp.js} +5 -5
- package/dist/assets/{mindmap-definition-NLK3R4M7-C6u7tH0B.js → mindmap-definition-NLK3R4M7-B2IFEIiB.js} +1 -1
- package/dist/assets/{pegDiagram-GJSIUBJH-HdJHW3kd.js → pegDiagram-GJSIUBJH-DHZYilhs.js} +1 -1
- package/dist/assets/{pieDiagram-5QR66LMP-DYm0T2vD.js → pieDiagram-5QR66LMP-DO_aJLMk.js} +1 -1
- package/dist/assets/{quadrantDiagram-O4NWA36T-CEqOPSKh.js → quadrantDiagram-O4NWA36T-gUPrtKHH.js} +1 -1
- package/dist/assets/{railroadDiagram-XR7U4H2S-I8gLnKDm.js → railroadDiagram-XR7U4H2S-BBF0wp-6.js} +1 -1
- package/dist/assets/{requirementDiagram-PLB6GJNP-0AbgBQwX.js → requirementDiagram-PLB6GJNP-xcAp1hln.js} +1 -1
- package/dist/assets/{sankeyDiagram-IPEJSGJF-CELks0t3.js → sankeyDiagram-IPEJSGJF-Dm5c9FwQ.js} +1 -1
- package/dist/assets/{sequenceDiagram-PO4LG4MO-Lv5pg-Nj.js → sequenceDiagram-PO4LG4MO-vRzb3zIA.js} +1 -1
- package/dist/assets/{sizeCapture-INFHLROL-D13uYR-m.js → sizeCapture-INFHLROL-Czu8kIt2.js} +1 -1
- package/dist/assets/{stateDiagram-v2-GCMORJYK-C6ntlRJp.js → stateDiagram-v2-GCMORJYK-BOfJjcD1.js} +1 -1
- package/dist/assets/{swimlanes-2SLR337P-BBMTJMbP.js → swimlanes-2SLR337P-D0ipJonR.js} +1 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-BJpOJd6C.js +8 -0
- package/dist/assets/{timeline-definition-EJHVYXUP-CQqiq_9n.js → timeline-definition-EJHVYXUP-TpaYbjnd.js} +1 -1
- package/dist/assets/{usecaseDiagram-POWQR4AR-CMdMUvua.js → usecaseDiagram-POWQR4AR-B-jKTFl6.js} +1 -1
- package/dist/assets/{vennDiagram-UO4OBE2U-DwNRIC20.js → vennDiagram-UO4OBE2U-Dy6k1yAu.js} +1 -1
- package/dist/assets/{wardleyDiagram-VNRHLVJA-BDP4uswI.js → wardleyDiagram-VNRHLVJA-DYRJUBY6.js} +1 -1
- package/dist/assets/{xychartDiagram-PMCCYNJV-B9qFFRsi.js → xychartDiagram-PMCCYNJV-CETDzaRA.js} +1 -1
- package/dist/index.html +1 -1
- package/dist-server/index.js +297 -229
- package/dist-server/server/index.js +4 -3
- package/dist-server/server/workspace-backup-copy.js +67 -0
- package/dist-server/server/workspace-backup-http.js +1 -0
- package/dist-server/server/workspace-backup-maintenance.js +12 -2
- package/dist-server/server/workspace-backup.js +32 -50
- package/package.json +1 -1
- package/dist/assets/channel-Ck_atLKb.js +0 -1
- package/dist/assets/swimlanesDiagram-TC7HE7FX-CN2rFhol.js +0 -8
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import "../electron/socket-qos.mjs";
|
|
1
2
|
import { createMessageFileRoutes } from "./routes/message-file.js";
|
|
2
3
|
import { SharedDeliverables, createSharedDeliverablesRoutes, sharedDeliverableAccess } from "./shared-deliverables.js";
|
|
3
4
|
import { connectionCredentialServer } from "./connection-credential.js";
|
|
@@ -15137,9 +15138,9 @@ const workspaceBackupRoutes = createWorkspaceBackupRoutes({
|
|
|
15137
15138
|
resume: () => { routines?.start(); primaryBot.start(); calendarCalls?.start(); watchdog.start(); },
|
|
15138
15139
|
flush: async () => {
|
|
15139
15140
|
await Promise.all([flushAllProfileHistory(), flushAllMemoryJournals(), flushUsageLedger(DATA_DIR), flushDecisionLog(DATA_DIR), flushAdminActivity(DATA_DIR)]);
|
|
15140
|
-
//
|
|
15141
|
-
|
|
15142
|
-
|
|
15141
|
+
// Export uses SQLite online backup while writers keep their connection.
|
|
15142
|
+
if (keepLocked)
|
|
15143
|
+
closeMessageDb();
|
|
15143
15144
|
},
|
|
15144
15145
|
}, keepLocked),
|
|
15145
15146
|
});
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { closeSync, constants, fstatSync, fsyncSync, lstatSync, openSync, readSync, writeSync } from "node:fs";
|
|
3
|
+
import { MAX_WORKSPACE_BACKUP_BYTES } from "./workspace-backup-archive.js";
|
|
4
|
+
/** Export captures live files; restore keeps the strict staged-file check.
|
|
5
|
+
* Reads stay on the opened descriptor, never a replacement symlink. Each live
|
|
6
|
+
* attempt stops at its initial size so a growing log cannot run forever. */
|
|
7
|
+
export function copyRegular(source, destination, onLiveChange) {
|
|
8
|
+
let captured;
|
|
9
|
+
for (let attempt = 0; attempt < 3; attempt++) {
|
|
10
|
+
let input;
|
|
11
|
+
try {
|
|
12
|
+
input = openSync(source, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (!onLiveChange || error.code !== "ENOENT")
|
|
16
|
+
throw error;
|
|
17
|
+
onLiveChange(captured ? "changed" : "removed");
|
|
18
|
+
return captured ?? null;
|
|
19
|
+
}
|
|
20
|
+
let output;
|
|
21
|
+
try {
|
|
22
|
+
const before = fstatSync(input);
|
|
23
|
+
if (!before.isFile() || before.size > MAX_WORKSPACE_BACKUP_BYTES)
|
|
24
|
+
throw new Error("A workspace file is not regular or exceeds the 64 GB backup limit.");
|
|
25
|
+
const mode = before.mode & 0o100 ? 0o700 : 0o600;
|
|
26
|
+
output = openSync(destination, attempt === 0 ? "wx" : constants.O_WRONLY | constants.O_NOFOLLOW | constants.O_TRUNC, mode);
|
|
27
|
+
const chunk = Buffer.allocUnsafe(1024 * 1024);
|
|
28
|
+
const hash = createHash("sha256");
|
|
29
|
+
let size = 0;
|
|
30
|
+
while (!onLiveChange || size < before.size) {
|
|
31
|
+
const length = onLiveChange ? Math.min(chunk.length, before.size - size) : chunk.length;
|
|
32
|
+
const count = readSync(input, chunk, 0, length, null);
|
|
33
|
+
if (!count)
|
|
34
|
+
break;
|
|
35
|
+
size += count;
|
|
36
|
+
if (!onLiveChange && size > before.size)
|
|
37
|
+
throw new Error("A staged workspace file changed during restore.");
|
|
38
|
+
hash.update(chunk.subarray(0, count));
|
|
39
|
+
let offset = 0;
|
|
40
|
+
while (offset < count)
|
|
41
|
+
offset += writeSync(output, chunk, offset, count - offset);
|
|
42
|
+
}
|
|
43
|
+
const after = fstatSync(input);
|
|
44
|
+
const current = onLiveChange ? null : lstatSync(source);
|
|
45
|
+
const changed = size !== before.size || after.size !== before.size || after.mtimeMs !== before.mtimeMs || after.ctimeMs !== before.ctimeMs ||
|
|
46
|
+
(current !== null && (current.ino !== before.ino || current.dev !== before.dev || current.isSymbolicLink()));
|
|
47
|
+
if (changed && !onLiveChange)
|
|
48
|
+
throw new Error("A staged workspace file changed during restore.");
|
|
49
|
+
fsyncSync(output);
|
|
50
|
+
captured = { size, mode, sha256: hash.digest("hex") };
|
|
51
|
+
if (!changed)
|
|
52
|
+
return captured;
|
|
53
|
+
// ponytail: three bounded captures, then keep the bytes with a warning.
|
|
54
|
+
// A filesystem snapshot is needed for point-in-time external file consistency.
|
|
55
|
+
if (attempt === 2) {
|
|
56
|
+
onLiveChange?.("changed");
|
|
57
|
+
return captured;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
finally {
|
|
61
|
+
closeSync(input);
|
|
62
|
+
if (output !== undefined)
|
|
63
|
+
closeSync(output);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return captured ?? null;
|
|
67
|
+
}
|
|
@@ -148,6 +148,7 @@ export function createWorkspaceBackupRoutes(options) {
|
|
|
148
148
|
const restored = options.restored;
|
|
149
149
|
json(res, 200, {
|
|
150
150
|
...options.status(),
|
|
151
|
+
busy: operating || options.status().busy,
|
|
151
152
|
progress,
|
|
152
153
|
lastRestoreId: restored.restored ? restored.id : null,
|
|
153
154
|
safetyCopyPath: restored.safetyCopyPath ?? null,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/** Export reads a live snapshot; only restore requires a quiet workspace. */
|
|
2
2
|
export class WorkspaceBackupMaintenance {
|
|
3
3
|
active = false;
|
|
4
4
|
pendingRestore = false;
|
|
@@ -16,8 +16,18 @@ export class WorkspaceBackupMaintenance {
|
|
|
16
16
|
}
|
|
17
17
|
async run(work, hooks, keepLocked = false) {
|
|
18
18
|
this.assertAvailable();
|
|
19
|
+
if (!keepLocked) {
|
|
20
|
+
const release = this.request();
|
|
21
|
+
try {
|
|
22
|
+
await hooks.flush();
|
|
23
|
+
return await work();
|
|
24
|
+
}
|
|
25
|
+
finally {
|
|
26
|
+
release();
|
|
27
|
+
}
|
|
28
|
+
}
|
|
19
29
|
if (this.requests || !hooks.idle())
|
|
20
|
-
throw Object.assign(new Error("Wait for bot turns, approvals, sign-ins, and computer actions to finish before
|
|
30
|
+
throw Object.assign(new Error("Wait for bot turns, approvals, sign-ins, and computer actions to finish before restoring."), { status: 409 });
|
|
21
31
|
this.active = true;
|
|
22
32
|
let committed = false;
|
|
23
33
|
try {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
// A filesystem snapshot, not an additive import, encrypted unless the person
|
|
2
|
-
// turns that off (workspace-backup-archive.ts).
|
|
3
|
-
// writers before
|
|
2
|
+
// turns that off (workspace-backup-archive.ts). Restore must quiesce
|
|
3
|
+
// app-owned writers before commit. Restore runs before config/store load.
|
|
4
4
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
5
|
-
import { chmodSync, closeSync, constants, copyFileSync, cpSync, existsSync, fstatSync,
|
|
5
|
+
import { chmodSync, closeSync, constants, copyFileSync, cpSync, existsSync, fstatSync, lstatSync, mkdirSync, openSync, readFileSync, readdirSync, readlinkSync, readSync, realpathSync, renameSync, rmSync, writeFileSync, } from "node:fs";
|
|
6
6
|
import { isAbsolute, join, parse, posix, relative, resolve, win32 } from "node:path";
|
|
7
7
|
import { homedir } from "node:os";
|
|
8
8
|
import { backup, DatabaseSync } from "node:sqlite";
|
|
9
9
|
import * as tar from "tar";
|
|
10
10
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
11
|
+
import { copyRegular } from "./workspace-backup-copy.js";
|
|
11
12
|
import { writeFileAtomic } from "./atomic.js";
|
|
12
13
|
import { escapeAttribute, splitTranscriptAttachments } from "../src/lib/composer-attachments.js";
|
|
13
14
|
import { WORKSPACE_BACKUP_CLIENT_KEYS } from "../shared/workspace-backup-client.js";
|
|
@@ -173,47 +174,6 @@ function assertLocalAuthOutsideSnapshot(dataDir) {
|
|
|
173
174
|
check(instance.config.configDir, "config.configDir", String(environment.HOME || environment.USERPROFILE || homedir()));
|
|
174
175
|
}
|
|
175
176
|
}
|
|
176
|
-
// Open without following links and copy synchronously so this server cannot
|
|
177
|
-
// interleave a mutation. External writers are detected where stat permits.
|
|
178
|
-
function copyRegular(source, destination) {
|
|
179
|
-
const input = openSync(source, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
180
|
-
let output;
|
|
181
|
-
try {
|
|
182
|
-
const before = fstatSync(input);
|
|
183
|
-
if (!before.isFile() || before.size > MAX_WORKSPACE_BACKUP_BYTES)
|
|
184
|
-
throw new Error("A workspace file is not regular or exceeds the 64 GB backup limit.");
|
|
185
|
-
const mode = before.mode & 0o100 ? 0o700 : 0o600;
|
|
186
|
-
output = openSync(destination, "wx", mode);
|
|
187
|
-
const chunk = Buffer.allocUnsafe(1024 * 1024);
|
|
188
|
-
const hash = createHash("sha256");
|
|
189
|
-
let size = 0;
|
|
190
|
-
for (;;) {
|
|
191
|
-
const count = readSync(input, chunk, 0, chunk.length, null);
|
|
192
|
-
if (!count)
|
|
193
|
-
break;
|
|
194
|
-
size += count;
|
|
195
|
-
if (size > before.size)
|
|
196
|
-
throw new Error("A workspace file changed during backup. Stop its writer and retry.");
|
|
197
|
-
hash.update(chunk.subarray(0, count));
|
|
198
|
-
let offset = 0;
|
|
199
|
-
while (offset < count)
|
|
200
|
-
offset += writeSync(output, chunk, offset, count - offset);
|
|
201
|
-
}
|
|
202
|
-
const after = fstatSync(input);
|
|
203
|
-
const current = lstatSync(source);
|
|
204
|
-
if (size !== before.size || after.mtimeMs !== before.mtimeMs || after.ctimeMs !== before.ctimeMs ||
|
|
205
|
-
current.ino !== before.ino || current.dev !== before.dev || current.isSymbolicLink()) {
|
|
206
|
-
throw new Error("A workspace file changed during backup. Stop its writer and retry.");
|
|
207
|
-
}
|
|
208
|
-
fsyncSync(output);
|
|
209
|
-
return { size, mode, sha256: hash.digest("hex") };
|
|
210
|
-
}
|
|
211
|
-
finally {
|
|
212
|
-
closeSync(input);
|
|
213
|
-
if (output !== undefined)
|
|
214
|
-
closeSync(output);
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
177
|
function hashFile(path) {
|
|
218
178
|
const fd = openSync(path, constants.O_RDONLY | constants.O_NOFOLLOW);
|
|
219
179
|
try {
|
|
@@ -286,17 +246,19 @@ export async function createWorkspaceBackup(dataDir, options) {
|
|
|
286
246
|
const entries = [];
|
|
287
247
|
const links = [];
|
|
288
248
|
const checkouts = [];
|
|
289
|
-
const warnings = ["
|
|
249
|
+
const warnings = ["Files are captured as the backup runs. External changes made after a file is captured belong to the next backup.",
|
|
290
250
|
encrypted ? "Conversation text and user files are not redacted and may contain secrets you pasted. Keep the encrypted backup private." : "This backup is not encrypted. Anyone with the file can read your conversations and files; keep it private.",
|
|
291
251
|
...(secrets ? ["This backup holds your keys, passwords and tokens. Anyone with the file and its password can use them."] : []), RESTORE_WARNING];
|
|
292
252
|
let bytes = 0;
|
|
293
253
|
let skippedLinks = 0;
|
|
254
|
+
let changedFiles = 0;
|
|
255
|
+
let removedFiles = 0;
|
|
294
256
|
const progress = () => options.onProgress?.({ phase: "copying", files: entries.length, bytes });
|
|
295
257
|
try {
|
|
296
258
|
const root = realpathSync(dataDir);
|
|
297
259
|
const sourceDb = join(root, "messages.db");
|
|
298
|
-
//
|
|
299
|
-
//
|
|
260
|
+
// SQLite online backup captures committed WAL records while the live
|
|
261
|
+
// message connection remains open and turns continue writing.
|
|
300
262
|
if (existsSync(sourceDb)) {
|
|
301
263
|
if (lstatSync(sourceDb).isSymbolicLink())
|
|
302
264
|
throw new Error("The message database must not be a symbolic link.");
|
|
@@ -352,7 +314,16 @@ export async function createWorkspaceBackup(dataDir, options) {
|
|
|
352
314
|
if (!validRelative(path))
|
|
353
315
|
throw new Error("A workspace filename cannot be safely restored on supported platforms.");
|
|
354
316
|
const source = join(directory, name);
|
|
355
|
-
|
|
317
|
+
let stat;
|
|
318
|
+
try {
|
|
319
|
+
stat = lstatSync(source);
|
|
320
|
+
}
|
|
321
|
+
catch (error) {
|
|
322
|
+
if (error.code !== "ENOENT")
|
|
323
|
+
throw error;
|
|
324
|
+
removedFiles++;
|
|
325
|
+
continue;
|
|
326
|
+
}
|
|
356
327
|
if (prefix && REINSTALLABLE_DIRS.has(name) && (stat.isDirectory() || stat.isSymbolicLink()))
|
|
357
328
|
continue;
|
|
358
329
|
if (stat.isSymbolicLink() && BROWSER_LOCK_LINKS.has(name))
|
|
@@ -410,8 +381,15 @@ export async function createWorkspaceBackup(dataDir, options) {
|
|
|
410
381
|
}
|
|
411
382
|
copied = { size: lstatSync(destination).size, mode: 0o600, sha256: hashFile(destination) };
|
|
412
383
|
}
|
|
413
|
-
else
|
|
414
|
-
|
|
384
|
+
else {
|
|
385
|
+
const captured = copyRegular(path === "messages.db" ? join(snapshot, "messages-snapshot.db") : source, destination, path === "messages.db" ? undefined : (kind) => { if (kind === "changed")
|
|
386
|
+
changedFiles++;
|
|
387
|
+
else
|
|
388
|
+
removedFiles++; });
|
|
389
|
+
if (!captured)
|
|
390
|
+
continue;
|
|
391
|
+
copied = captured;
|
|
392
|
+
}
|
|
415
393
|
bytes += copied.size;
|
|
416
394
|
if (bytes > MAX_WORKSPACE_BACKUP_BYTES)
|
|
417
395
|
throw new Error("The workspace exceeds the 64 GB backup limit.");
|
|
@@ -424,6 +402,10 @@ export async function createWorkspaceBackup(dataDir, options) {
|
|
|
424
402
|
}
|
|
425
403
|
};
|
|
426
404
|
walk(root);
|
|
405
|
+
if (changedFiles)
|
|
406
|
+
warnings.push(`${changedFiles} file(s) kept changing during backup. Their captured bytes are included, but may contain an in-progress write.`);
|
|
407
|
+
if (removedFiles)
|
|
408
|
+
warnings.push(`${removedFiles} file(s) disappeared before they could be captured and are not included.`);
|
|
427
409
|
if (skippedLinks)
|
|
428
410
|
warnings.push(`${skippedLinks} managed skill discovery link(s) were omitted and are recreated by the app.`);
|
|
429
411
|
if (checkouts.length)
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{U as a,C as n}from"./mermaid.core-B_hsjjFv.js";const t=(r,o)=>a.lang.round(n.parse(r)[o]);export{t as c};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{c as r,s as e}from"./flowDiagram-KWPJA3E3-C6y9L478.js";import{_ as a}from"./mermaid.core-B_hsjjFv.js";import"./chunk-5VM5RSS4-kVNi7GcP.js";import"./chunk-XXDRQBXY-8cVOBFNO.js";import"./chunk-WEXAMYUT-CPIykbsI.js";import"./chunk-GWA4HPMP-DiMuTVC6.js";import"./channel-Ck_atLKb.js";import"./index-CPnrJ6T1.js";var o=a(t=>`${e(t)}
|
|
2
|
-
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
|
-
stroke: ${t.clusterBorder} !important;
|
|
4
|
-
}
|
|
5
|
-
[data-look="neo"].cluster rect {
|
|
6
|
-
filter: none;
|
|
7
|
-
}
|
|
8
|
-
`,"getStyles"),s=o,u=r({styles:s});export{u as diagram};
|