arco-workbench 0.1.3 → 0.1.4

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 (296) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/README.md +5 -1
  3. package/client/dist/assets/{PhosphorBackdrop-CkVIGkeX.js → PhosphorBackdrop-CNumba2X.js} +1 -1
  4. package/client/dist/assets/{ThemedBackgroundShaderImpl-DHF7CnpE.js → ThemedBackgroundShaderImpl-DX5KyCt3.js} +1 -1
  5. package/client/dist/assets/{XtermView-SY0UcZUS.js → XtermView-DhS5g8Rt.js} +1 -1
  6. package/client/dist/assets/{galleryEditor-Ca4F8HiM.js → galleryEditor-fPb76Cjv.js} +1 -1
  7. package/client/dist/assets/index-CjkHb-_n.js +592 -0
  8. package/client/dist/assets/index-DIbh3ae5.css +1 -0
  9. package/client/dist/index.html +2 -2
  10. package/client/src/App.tsx +2 -0
  11. package/client/src/alerts/desktopAlerts.ts +13 -1
  12. package/client/src/brief/briefFacts.ts +22 -0
  13. package/client/src/brief/briefFromStore.ts +7 -2
  14. package/client/src/components/ArtifactMoveDialog.tsx +64 -0
  15. package/client/src/components/BriefControl.tsx +38 -47
  16. package/client/src/components/CatchMeUp.tsx +25 -25
  17. package/client/src/components/CheckpointActions.tsx +7 -4
  18. package/client/src/components/ClusterComposerButtons.tsx +6 -3
  19. package/client/src/components/ClusterPlanTab.tsx +15 -1
  20. package/client/src/components/ClusterRightPanel/AutoPickupControl.tsx +6 -2
  21. package/client/src/components/ClusterTab.tsx +33 -3
  22. package/client/src/components/ClusterTaskBoardTab.tsx +62 -8
  23. package/client/src/components/DialogShell.tsx +115 -0
  24. package/client/src/components/DocsUpdateDialog.tsx +16 -42
  25. package/client/src/components/ForwardMessages.tsx +28 -32
  26. package/client/src/components/GitDialog.tsx +52 -52
  27. package/client/src/components/GitOtherWork.tsx +4 -2
  28. package/client/src/components/HandoffDialog.tsx +19 -45
  29. package/client/src/components/Home/HomeView.tsx +36 -8
  30. package/client/src/components/Home/home.css +7 -0
  31. package/client/src/components/KeepButton.tsx +23 -0
  32. package/client/src/components/MdTuneupDialog.tsx +52 -51
  33. package/client/src/components/MemberCard.tsx +4 -1
  34. package/client/src/components/MemberPane.tsx +1 -1
  35. package/client/src/components/NotificationCenter.tsx +4 -3
  36. package/client/src/components/NotificationChannelsSettings.tsx +25 -7
  37. package/client/src/components/PlanCandidateBanner.tsx +111 -57
  38. package/client/src/components/PlanComposerDialog.tsx +55 -87
  39. package/client/src/components/ProjectStateNotice.tsx +60 -0
  40. package/client/src/components/PublicProjectBox.tsx +25 -0
  41. package/client/src/components/ResearchDialog.tsx +15 -24
  42. package/client/src/components/ReviewDialog.tsx +32 -57
  43. package/client/src/components/RightPanel/OutputsPanel.tsx +4 -0
  44. package/client/src/components/RightPanel/PlanTab.tsx +24 -2
  45. package/client/src/components/RightPanel/UsageTab.tsx +77 -1
  46. package/client/src/components/SkillEditorDialog.tsx +38 -73
  47. package/client/src/components/SpawnDialog.tsx +19 -41
  48. package/client/src/components/StorageWarnings.tsx +21 -0
  49. package/client/src/components/SystemHeader.tsx +2 -2
  50. package/client/src/components/TerminalInput.tsx +6 -2
  51. package/client/src/components/TidyComposer.tsx +24 -41
  52. package/client/src/components/TranscriptSendDialog.tsx +151 -202
  53. package/client/src/components/UtilityAgentPicker.tsx +4 -2
  54. package/client/src/components/WorkflowCreator/index.tsx +2 -0
  55. package/client/src/components/WorkflowView.tsx +4 -1
  56. package/client/src/components/clusterNeedsYou.ts +35 -3
  57. package/client/src/components/compare/CompareDialog.tsx +26 -2
  58. package/client/src/components/terminalInput/planDraft.ts +33 -4
  59. package/client/src/components/utilityResult.ts +5 -1
  60. package/client/src/explorer/ExplorerApp.tsx +5 -2
  61. package/client/src/explorer/PlansLens.tsx +60 -19
  62. package/client/src/explorer/StorageLens.tsx +275 -0
  63. package/client/src/explorer/launch.ts +3 -3
  64. package/client/src/explorer/plansGrouping.ts +15 -0
  65. package/client/src/help/content/cluster.tsx +42 -7
  66. package/client/src/help/content/composer.tsx +26 -6
  67. package/client/src/help/content/header.tsx +16 -14
  68. package/client/src/help/content/misc.tsx +141 -6
  69. package/client/src/help/content/rightPanel.tsx +16 -0
  70. package/client/src/help/content/settings.tsx +4 -4
  71. package/client/src/help/manualSections/actions.tsx +19 -4
  72. package/client/src/help/manualSections/clusters.tsx +29 -16
  73. package/client/src/help/manualSections/configuration.tsx +6 -4
  74. package/client/src/help/manualSections/maintenance.tsx +27 -5
  75. package/client/src/help/manualSections/plans.tsx +96 -2
  76. package/client/src/help/manualSections/powerFeatures.tsx +2 -2
  77. package/client/src/help/manualSections/reference.tsx +6 -0
  78. package/client/src/help/manualSections/workspace.tsx +9 -5
  79. package/client/src/stores/appStore.ts +10 -1
  80. package/client/src/stores/appStore.types.ts +2 -0
  81. package/client/src/stores/mdTuneupStore.ts +5 -4
  82. package/client/src/stores/memoryTrim.ts +18 -2
  83. package/client/src/stores/storageWarningStore.ts +18 -0
  84. package/client/src/utils/gitDialogMemory.ts +26 -0
  85. package/client/src/utils/historyEvents.ts +1 -0
  86. package/client/src/utils/homeModel.ts +19 -0
  87. package/client/src/utils/publicProject.ts +56 -0
  88. package/client/src/ws/handleServerMessage.ts +7 -2
  89. package/docs/ARCHITECTURE.md +1 -1
  90. package/docs/CHECKPOINTS.md +2 -0
  91. package/docs/CLIENT.md +29 -11
  92. package/docs/FEATURES.md +14 -11
  93. package/docs/GETTING_STARTED.md +7 -7
  94. package/docs/GLOSSARY.md +3 -3
  95. package/docs/GOTCHAS.md +3 -2
  96. package/docs/HTTP_API.md +31 -1
  97. package/docs/NOTIFICATIONS.md +13 -14
  98. package/docs/OPERATIONS.md +27 -1
  99. package/docs/OPERATOR_ACTIONS.md +1 -1
  100. package/docs/OUTPUTS.md +9 -0
  101. package/docs/PERSISTENCE.md +34 -4
  102. package/docs/PLAN_OR_BOARD.md +7 -0
  103. package/docs/PRIMITIVES.md +3 -3
  104. package/docs/PROTOCOL.md +14 -4
  105. package/docs/PROTOCOL_CLUSTER.md +3 -2
  106. package/docs/SERVICE_MODE.md +5 -1
  107. package/docs/SETTINGS.md +8 -6
  108. package/docs/STORAGE_PLAN.md +324 -0
  109. package/docs/TASK_LEDGER.md +5 -4
  110. package/native/linux-arm64/manifest.json +1 -1
  111. package/node_modules/@arco/shared/dist/index.d.ts +2 -0
  112. package/node_modules/@arco/shared/dist/index.js +2 -0
  113. package/node_modules/@arco/shared/dist/protocol/autoPickup.d.ts +1 -1
  114. package/node_modules/@arco/shared/dist/protocol/autoPickup.js +1 -1
  115. package/node_modules/@arco/shared/dist/protocol/checkpoints.d.ts +1 -0
  116. package/node_modules/@arco/shared/dist/protocol/clusters.d.ts +2 -1
  117. package/node_modules/@arco/shared/dist/protocol/index.d.ts +1 -0
  118. package/node_modules/@arco/shared/dist/protocol/index.js +1 -0
  119. package/node_modules/@arco/shared/dist/protocol/mdTuneup.d.ts +6 -0
  120. package/node_modules/@arco/shared/dist/protocol/notifications.d.ts +2 -1
  121. package/node_modules/@arco/shared/dist/protocol/notifications.js +3 -2
  122. package/node_modules/@arco/shared/dist/protocol/plans.d.ts +2 -0
  123. package/node_modules/@arco/shared/dist/protocol/serverMessages.d.ts +2 -1
  124. package/node_modules/@arco/shared/dist/protocol/storage.d.ts +21 -0
  125. package/node_modules/@arco/shared/dist/protocol/storage.js +3 -0
  126. package/node_modules/@arco/shared/dist/protocol/tasks.d.ts +3 -0
  127. package/node_modules/@arco/shared/dist/protocol/utilityAgent.d.ts +2 -2
  128. package/node_modules/@arco/shared/dist/protocol/utilityAgent.js +2 -2
  129. package/node_modules/@arco/shared/dist/publicGuardrails.d.ts +7 -0
  130. package/node_modules/@arco/shared/dist/publicGuardrails.js +47 -0
  131. package/node_modules/@arco/shared/dist/publicSafetyRules.d.ts +1 -0
  132. package/node_modules/@arco/shared/dist/publicSafetyRules.js +6 -0
  133. package/node_modules/@arco/shared/package.json +1 -1
  134. package/package.json +3 -2
  135. package/scripts/packaging/arco.mjs +17 -1
  136. package/scripts/packaging/services.mjs +35 -5
  137. package/scripts/packaging/storage.mjs +125 -0
  138. package/scripts/packaging/update.mjs +3 -3
  139. package/server/dist/artifactCopy.d.ts +26 -0
  140. package/server/dist/artifactCopy.js +398 -0
  141. package/server/dist/atomicFile.d.ts +1 -0
  142. package/server/dist/atomicFile.js +1 -1
  143. package/server/dist/attention.d.ts +1 -1
  144. package/server/dist/attention.js +10 -13
  145. package/server/dist/catchUp.d.ts +2 -0
  146. package/server/dist/catchUp.js +46 -23
  147. package/server/dist/clusterPeerOps.d.ts +2 -0
  148. package/server/dist/clusterPeerOps.js +2 -0
  149. package/server/dist/clusterSnapshots.js +22 -12
  150. package/server/dist/eventLog.d.ts +55 -0
  151. package/server/dist/eventLog.js +792 -0
  152. package/server/dist/explorerLaunch.d.ts +4 -1
  153. package/server/dist/explorerLaunch.js +3 -2
  154. package/server/dist/explorerPlans.d.ts +4 -0
  155. package/server/dist/explorerPlans.js +27 -2
  156. package/server/dist/http/clusterRoutes.js +2 -0
  157. package/server/dist/http/explorerRoutes.js +2 -1
  158. package/server/dist/http/publicProjectRoutes.d.ts +2 -0
  159. package/server/dist/http/publicProjectRoutes.js +68 -0
  160. package/server/dist/http/router.js +6 -0
  161. package/server/dist/http/storageRoutes.d.ts +2 -0
  162. package/server/dist/http/storageRoutes.js +254 -0
  163. package/server/dist/http/usageStatsRoutes.js +3 -12
  164. package/server/dist/index.js +4 -0
  165. package/server/dist/keepStore.d.ts +16 -0
  166. package/server/dist/keepStore.js +119 -0
  167. package/server/dist/management/clusterActivity.js +6 -20
  168. package/server/dist/management/initHubLink.js +10 -43
  169. package/server/dist/mcp/clusterMcpTools.js +8 -1
  170. package/server/dist/notifications.d.ts +3 -1
  171. package/server/dist/notifications.js +5 -4
  172. package/server/dist/outputStore.d.ts +1 -0
  173. package/server/dist/outputStore.js +1 -1
  174. package/server/dist/outputs.js +39 -8
  175. package/server/dist/planHistory.d.ts +3 -0
  176. package/server/dist/planHistory.js +60 -0
  177. package/server/dist/primitives/runMdTuneup.d.ts +5 -1
  178. package/server/dist/primitives/runMdTuneup.js +43 -2
  179. package/server/dist/project/taskLedger.d.ts +4 -0
  180. package/server/dist/project/taskLedger.js +19 -0
  181. package/server/dist/providers/claude-native/peerTools.js +4 -0
  182. package/server/dist/providers/claude-native/resumeSummary.js +30 -19
  183. package/server/dist/providers/index.js +8 -13
  184. package/server/dist/providers/localProviderQueue.d.ts +2 -0
  185. package/server/dist/providers/localProviderQueue.js +11 -0
  186. package/server/dist/publicProject.d.ts +54 -0
  187. package/server/dist/publicProject.js +135 -0
  188. package/server/dist/recall/index.js +22 -23
  189. package/server/dist/server/broadcast.d.ts +2 -1
  190. package/server/dist/server/broadcast.js +56 -1
  191. package/server/dist/smartPickupAdapters.d.ts +7 -0
  192. package/server/dist/smartPickupAdapters.js +172 -8
  193. package/server/dist/storageActions.d.ts +50 -0
  194. package/server/dist/storageActions.js +326 -0
  195. package/server/dist/storageArchive.d.ts +24 -0
  196. package/server/dist/storageArchive.js +358 -0
  197. package/server/dist/storageOverview.d.ts +47 -0
  198. package/server/dist/storageOverview.js +197 -0
  199. package/server/dist/storageReport.d.ts +48 -0
  200. package/server/dist/storageReport.js +185 -0
  201. package/server/dist/storageWarnings.d.ts +4 -0
  202. package/server/dist/storageWarnings.js +96 -0
  203. package/server/dist/workers/limits.js +4 -1
  204. package/server/dist/workflowStore.d.ts +2 -0
  205. package/server/dist/workflowStore.js +88 -72
  206. package/server/dist/workflows/purgeWorkflow.d.ts +1 -0
  207. package/server/dist/workflows/purgeWorkflow.js +15 -2
  208. package/server/dist/workflows/sessionDiscovery.js +5 -17
  209. package/server/dist/workflows/sessionIndex.js +22 -17
  210. package/server/dist/ws/taskLedgerHandlers.js +8 -3
  211. package/server/dist/ws/workflowHandlers.js +5 -4
  212. package/server/package.json +1 -1
  213. package/server/src/artifactCopy.ts +254 -0
  214. package/server/src/atomicFile.ts +1 -1
  215. package/server/src/attention.ts +9 -10
  216. package/server/src/catchUp.ts +37 -15
  217. package/server/src/clusterPeerOps.ts +5 -0
  218. package/server/src/clusterSnapshots.ts +20 -13
  219. package/server/src/eventLog.ts +571 -0
  220. package/server/src/explorerLaunch.ts +3 -2
  221. package/server/src/explorerPlans.ts +22 -2
  222. package/server/src/http/clusterRoutes.ts +4 -1
  223. package/server/src/http/explorerRoutes.ts +2 -1
  224. package/server/src/http/publicProjectRoutes.ts +54 -0
  225. package/server/src/http/router.ts +4 -0
  226. package/server/src/http/storageRoutes.ts +187 -0
  227. package/server/src/http/usageStatsRoutes.ts +3 -11
  228. package/server/src/index.ts +4 -0
  229. package/server/src/keepStore.ts +102 -0
  230. package/server/src/management/clusterActivity.ts +6 -16
  231. package/server/src/management/initHubLink.ts +10 -39
  232. package/server/src/mcp/clusterMcpTools.ts +8 -2
  233. package/server/src/notifications.ts +4 -3
  234. package/server/src/outputStore.ts +5 -2
  235. package/server/src/outputs.ts +30 -6
  236. package/server/src/planHistory.ts +48 -0
  237. package/server/src/primitives/runMdTuneup.ts +32 -2
  238. package/server/src/project/taskLedger.ts +20 -0
  239. package/server/src/providers/claude-native/peerTools.ts +4 -0
  240. package/server/src/providers/claude-native/resumeSummary.ts +32 -18
  241. package/server/src/providers/index.ts +2 -16
  242. package/server/src/providers/localProviderQueue.ts +13 -0
  243. package/server/src/publicProject.ts +142 -0
  244. package/server/src/recall/index.ts +4 -9
  245. package/server/src/server/broadcast.ts +53 -1
  246. package/server/src/smartPickupAdapters.ts +128 -5
  247. package/server/src/storageActions.ts +216 -0
  248. package/server/src/storageArchive.ts +277 -0
  249. package/server/src/storageOverview.ts +184 -0
  250. package/server/src/storageReport.ts +210 -0
  251. package/server/src/storageWarnings.ts +84 -0
  252. package/server/src/workers/limits.ts +4 -1
  253. package/server/src/workflowStore.ts +78 -61
  254. package/server/src/workflows/purgeWorkflow.ts +12 -3
  255. package/server/src/workflows/sessionDiscovery.ts +5 -13
  256. package/server/src/workflows/sessionIndex.ts +5 -9
  257. package/server/src/ws/taskLedgerHandlers.ts +8 -3
  258. package/server/src/ws/workflowHandlers.ts +5 -4
  259. package/shared/dist/index.d.ts +2 -0
  260. package/shared/dist/index.js +2 -0
  261. package/shared/dist/protocol/autoPickup.d.ts +1 -1
  262. package/shared/dist/protocol/autoPickup.js +1 -1
  263. package/shared/dist/protocol/checkpoints.d.ts +1 -0
  264. package/shared/dist/protocol/clusters.d.ts +2 -1
  265. package/shared/dist/protocol/index.d.ts +1 -0
  266. package/shared/dist/protocol/index.js +1 -0
  267. package/shared/dist/protocol/mdTuneup.d.ts +6 -0
  268. package/shared/dist/protocol/notifications.d.ts +2 -1
  269. package/shared/dist/protocol/notifications.js +3 -2
  270. package/shared/dist/protocol/plans.d.ts +2 -0
  271. package/shared/dist/protocol/serverMessages.d.ts +2 -1
  272. package/shared/dist/protocol/storage.d.ts +21 -0
  273. package/shared/dist/protocol/storage.js +3 -0
  274. package/shared/dist/protocol/tasks.d.ts +3 -0
  275. package/shared/dist/protocol/utilityAgent.d.ts +2 -2
  276. package/shared/dist/protocol/utilityAgent.js +2 -2
  277. package/shared/dist/publicGuardrails.d.ts +7 -0
  278. package/shared/dist/publicGuardrails.js +47 -0
  279. package/shared/dist/publicSafetyRules.d.ts +1 -0
  280. package/shared/dist/publicSafetyRules.js +6 -0
  281. package/shared/src/index.ts +3 -0
  282. package/shared/src/protocol/autoPickup.ts +1 -1
  283. package/shared/src/protocol/checkpoints.ts +4 -0
  284. package/shared/src/protocol/clusters.ts +6 -1
  285. package/shared/src/protocol/index.ts +1 -0
  286. package/shared/src/protocol/mdTuneup.ts +5 -0
  287. package/shared/src/protocol/notifications.ts +6 -2
  288. package/shared/src/protocol/plans.ts +2 -0
  289. package/shared/src/protocol/serverMessages.ts +2 -0
  290. package/shared/src/protocol/storage.ts +35 -0
  291. package/shared/src/protocol/tasks.ts +6 -0
  292. package/shared/src/protocol/utilityAgent.ts +2 -2
  293. package/shared/src/publicGuardrails.ts +50 -0
  294. package/shared/src/publicSafetyRules.ts +5 -0
  295. package/client/dist/assets/index-CcNtMA2y.js +0 -546
  296. package/client/dist/assets/index-Dl8tYsSp.css +0 -1
@@ -0,0 +1,358 @@
1
+ import { promises as fs, createReadStream, createWriteStream } from 'node:fs';
2
+ import { createBrotliCompress, createBrotliDecompress, constants as zc } from 'node:zlib';
3
+ import { createHash, randomUUID } from 'node:crypto';
4
+ import { pipeline } from 'node:stream/promises';
5
+ import { Readable } from 'node:stream';
6
+ import path from 'node:path';
7
+ import { STAYING_FILES, holdsKept, isKept, readKeep, withKeepLock } from './keepStore.js';
8
+ import { checkedArchiveFolder, checkedConversationDir, conversationDir, recordStorageAction, StorageActionError, unsafe } from './storageActions.js';
9
+ import { renameWithRetry } from './atomicFile.js';
10
+ import { ensureProjectStateIgnore } from './projectStateIgnore.js';
11
+ // ARCHIVE and restore for closed conversations (P7.5, docs/STORAGE_PLAN.md).
12
+ //
13
+ // An archive is one Brotli-compressed file, <project>/.arco/archive/<id>.arcoarchive:
14
+ // "ARCO-ARCHIVE 1\n"
15
+ // then per file: one JSON header line {path, size, mode, mtimeMs, sha256}
16
+ // followed by exactly `size` bytes and a newline,
17
+ // and a final line {"end": true, "files": N, "workflowId": id, "archivedAt": ms}.
18
+ // The archive is written to a temporary file, read back and checked file by
19
+ // file against the original hashes, renamed into place, and only then are the
20
+ // archived files removed. Kept items (keep.json) stay in the conversation
21
+ // folder and are not archived. Plans are outside conversation folders and
22
+ // never involved.
23
+ const MAGIC = 'ARCO-ARCHIVE 1\n';
24
+ export const ARCHIVE_SUFFIX = '.arcoarchive';
25
+ export function archiveDir(cwd) { return path.join(cwd, '.arco', 'archive'); }
26
+ export function archivePath(cwd, workflowId) {
27
+ conversationDir(cwd, workflowId); // validates the id
28
+ return path.join(archiveDir(cwd), `${workflowId}${ARCHIVE_SUFFIX}`);
29
+ }
30
+ async function hashFile(file) {
31
+ const h = createHash('sha256');
32
+ for await (const chunk of createReadStream(file))
33
+ h.update(chunk);
34
+ return h.digest('hex');
35
+ }
36
+ // Regular files to archive, relative to the conversation folder, '/' paths.
37
+ // Links are not followed and not archived (they stay, like kept items).
38
+ async function collect(dir, kept) {
39
+ const files = [];
40
+ let skipped = 0;
41
+ const walk = async (rel) => {
42
+ const abs = rel ? path.join(dir, ...rel.split('/')) : dir;
43
+ for (const entry of await fs.readdir(abs, { withFileTypes: true })) {
44
+ const childRel = rel ? `${rel}/${entry.name}` : entry.name;
45
+ if (isKept(kept, childRel)) {
46
+ skipped++;
47
+ continue;
48
+ }
49
+ // The KEEP list and the size-warning record always stay in place, so
50
+ // kept items stay protected after an archive.
51
+ if (!rel && STAYING_FILES.has(entry.name)) {
52
+ skipped++;
53
+ continue;
54
+ }
55
+ const child = path.join(abs, entry.name);
56
+ if (entry.isDirectory()) {
57
+ await walk(childRel);
58
+ continue;
59
+ }
60
+ if (!entry.isFile()) {
61
+ skipped++;
62
+ continue;
63
+ }
64
+ const st = await fs.lstat(child);
65
+ files.push({ path: childRel, size: st.size, mode: st.mode & 0o777, mtimeMs: st.mtimeMs, sha256: await hashFile(child) });
66
+ }
67
+ };
68
+ await walk('');
69
+ return { files, skipped };
70
+ }
71
+ async function* archiveStream(dir, files, trailer) {
72
+ yield Buffer.from(MAGIC);
73
+ for (const f of files) {
74
+ yield Buffer.from(JSON.stringify(f) + '\n');
75
+ let written = 0;
76
+ for await (const chunk of createReadStream(path.join(dir, ...f.path.split('/')), { start: 0, end: Math.max(0, f.size - 1) })) {
77
+ if (f.size === 0)
78
+ break;
79
+ written += chunk.length;
80
+ yield chunk;
81
+ }
82
+ if (written !== f.size)
83
+ throw new Error(`${f.path} changed while it was archived`);
84
+ yield Buffer.from('\n');
85
+ }
86
+ yield Buffer.from(JSON.stringify({ end: true, files: files.length, ...trailer }) + '\n');
87
+ }
88
+ // Reads an archive and calls `onFile` with each header and its bytes as an
89
+ // async iterable pulled straight from the decompressor (one chunk in memory
90
+ // at a time). Bytes the callback leaves unread are skipped. Returns the trailer.
91
+ async function readArchive(file, onFile) {
92
+ const input = createReadStream(file);
93
+ const source = input.pipe(createBrotliDecompress());
94
+ const it = source[Symbol.asyncIterator]();
95
+ let buf = Buffer.alloc(0);
96
+ const fill = async () => {
97
+ const next = await it.next();
98
+ if (next.done)
99
+ return false;
100
+ buf = buf.length ? Buffer.concat([buf, next.value]) : next.value;
101
+ return true;
102
+ };
103
+ const line = async () => {
104
+ for (;;) {
105
+ const i = buf.indexOf(10);
106
+ if (i >= 0) {
107
+ const s = buf.subarray(0, i).toString('utf8');
108
+ buf = buf.subarray(i + 1);
109
+ return s;
110
+ }
111
+ if (buf.length > 1024 * 1024)
112
+ throw new Error('The archive is damaged.');
113
+ if (!(await fill()))
114
+ throw new Error('The archive ends early.');
115
+ }
116
+ };
117
+ try {
118
+ if ((await line()) + '\n' !== MAGIC)
119
+ throw new Error('Not an Arco archive.');
120
+ for (;;) {
121
+ const header = JSON.parse(await line());
122
+ if (header.end)
123
+ return header;
124
+ if (typeof header.path !== 'string' || !Number.isSafeInteger(header.size) || header.size < 0)
125
+ throw new Error('The archive is damaged.');
126
+ let remaining = header.size;
127
+ const next = async () => {
128
+ if (remaining <= 0)
129
+ return null;
130
+ if (!buf.length && !(await fill()))
131
+ throw new Error('The archive ends early.');
132
+ const take = buf.subarray(0, Math.min(remaining, buf.length));
133
+ buf = buf.subarray(take.length);
134
+ remaining -= take.length;
135
+ return take;
136
+ };
137
+ const data = { [Symbol.asyncIterator]: () => ({ next: async () => { const v = await next(); return v ? { value: v, done: false } : { value: undefined, done: true }; } }) };
138
+ await onFile(header, data);
139
+ while (await next()) { /* skip what the callback did not read */ }
140
+ if (!buf.length && !(await fill()))
141
+ throw new Error('The archive ends early.');
142
+ if (buf[0] !== 10)
143
+ throw new Error('The archive is damaged.');
144
+ buf = buf.subarray(1);
145
+ }
146
+ }
147
+ finally {
148
+ input.destroy();
149
+ source.destroy();
150
+ }
151
+ }
152
+ function safeRel(rel) {
153
+ const parts = rel.split('/');
154
+ if (!rel || parts.some((p) => !p || p === '.' || p === '..') || path.isAbsolute(rel) || rel.includes('\\') || rel.includes('\0')) {
155
+ throw new Error('The archive holds an unsafe path.');
156
+ }
157
+ return rel;
158
+ }
159
+ // Every existing part of `rel` below the conversation folder is a real folder
160
+ // or file, not a link.
161
+ async function noLinkOnPath(dir, rel) {
162
+ const parts = rel.split('/');
163
+ for (let i = 1; i <= parts.length; i++) {
164
+ const sub = parts.slice(0, i).join('/');
165
+ try {
166
+ if ((await fs.lstat(path.join(dir, ...parts.slice(0, i)))).isSymbolicLink())
167
+ throw unsafe(sub);
168
+ }
169
+ catch (err) {
170
+ if (err.code === 'ENOENT')
171
+ return;
172
+ throw err;
173
+ }
174
+ }
175
+ }
176
+ export async function archiveConversation(cwd, workflowId, opts) {
177
+ if (opts.open || opts.busy)
178
+ throw new StorageActionError('open', 'Close the conversation before archiving it.');
179
+ const dir = await checkedConversationDir(cwd, workflowId);
180
+ await checkedArchiveFolder(cwd);
181
+ const target = archivePath(cwd, workflowId);
182
+ try {
183
+ await fs.lstat(target);
184
+ throw new StorageActionError('exists', 'An archive of this conversation already exists.');
185
+ }
186
+ catch (err) {
187
+ if (err instanceof StorageActionError)
188
+ throw err;
189
+ }
190
+ // Hold the KEEP lock from the read through the last removal.
191
+ return withKeepLock(dir, async () => {
192
+ const keep = await readKeep(dir);
193
+ if (!keep.ok)
194
+ throw new StorageActionError('keep_unreadable', 'The KEEP list of this conversation cannot be read, so nothing was archived.');
195
+ if (isKept(keep.items, '.'))
196
+ throw new StorageActionError('kept', 'The whole conversation is kept.');
197
+ const { files, skipped } = await collect(dir, keep.items);
198
+ const archivedAt = Date.now();
199
+ ensureProjectStateIgnore(cwd);
200
+ await fs.mkdir(archiveDir(cwd), { recursive: true });
201
+ const tmp = `${target}.${randomUUID()}.tmp`;
202
+ try {
203
+ await pipeline(Readable.from(archiveStream(dir, files, { workflowId, archivedAt })), createBrotliCompress({ params: { [zc.BROTLI_PARAM_QUALITY]: 4, [zc.BROTLI_PARAM_LGWIN]: 22 } }), createWriteStream(tmp, { flags: 'wx', mode: 0o600 }));
204
+ const fh = await fs.open(tmp, 'r+');
205
+ try {
206
+ await fh.sync();
207
+ }
208
+ finally {
209
+ await fh.close();
210
+ }
211
+ // Read back: every file present with the same size and hash.
212
+ const expected = new Map(files.map((f) => [f.path, f]));
213
+ let seen = 0;
214
+ await readArchive(tmp, async (entry, data) => {
215
+ const h = createHash('sha256');
216
+ let size = 0;
217
+ for await (const chunk of data) {
218
+ h.update(chunk);
219
+ size += chunk.length;
220
+ }
221
+ const want = expected.get(entry.path);
222
+ if (!want || want.size !== size || want.sha256 !== h.digest('hex'))
223
+ throw new Error(`${entry.path} did not read back correctly`);
224
+ seen++;
225
+ });
226
+ if (seen !== files.length)
227
+ throw new Error('The archive is incomplete.');
228
+ await renameWithRetry(tmp, target);
229
+ }
230
+ catch (err) {
231
+ await fs.rm(tmp, { force: true });
232
+ throw err;
233
+ }
234
+ // Remove what was archived; kept items and links stay. A folder swapped
235
+ // for a link since the walk stops the removal.
236
+ for (const f of files) {
237
+ await noLinkOnPath(dir, f.path);
238
+ await fs.rm(path.join(dir, ...f.path.split('/')), { force: true });
239
+ }
240
+ await pruneEmptyFolders(dir, keep.items);
241
+ const archiveBytes = (await fs.stat(target)).size;
242
+ const originalBytes = files.reduce((n, f) => n + f.size, 0);
243
+ await recordStorageAction(cwd, { action: 'archive', by: opts.by, workflowId, files: files.length, originalBytes, archiveBytes, keptItems: skipped });
244
+ return { files: files.length, originalBytes, archiveBytes, keptItems: skipped };
245
+ });
246
+ }
247
+ async function pruneEmptyFolders(dir, kept) {
248
+ const prune = async (abs, rel) => {
249
+ let entries;
250
+ try {
251
+ entries = await fs.readdir(abs, { withFileTypes: true });
252
+ }
253
+ catch {
254
+ return false;
255
+ }
256
+ let empty = true;
257
+ for (const e of entries) {
258
+ const childRel = rel ? `${rel}/${e.name}` : e.name;
259
+ if (e.isDirectory() && !isKept(kept, childRel) && await prune(path.join(abs, e.name), childRel))
260
+ continue;
261
+ empty = false;
262
+ }
263
+ if (empty && rel && !holdsKept(kept, rel)) {
264
+ await fs.rmdir(abs).catch(() => undefined);
265
+ return true;
266
+ }
267
+ return empty && !!rel;
268
+ };
269
+ if (await prune(dir, ''))
270
+ await fs.rmdir(dir).catch(() => undefined);
271
+ }
272
+ // Restore into the conversation folder. Refused when any archived file
273
+ // already exists there (nothing is overwritten); the archive is removed only
274
+ // after every file is written and checked.
275
+ export async function restoreConversation(cwd, workflowId) {
276
+ const dir = await checkedConversationDir(cwd, workflowId, { mayBeMissing: true });
277
+ await checkedArchiveFolder(cwd);
278
+ const source = archivePath(cwd, workflowId);
279
+ let sourceStat;
280
+ try {
281
+ sourceStat = await fs.lstat(source);
282
+ }
283
+ catch {
284
+ throw new StorageActionError('not_found', 'No archive of this conversation was found.');
285
+ }
286
+ if (!sourceStat.isFile())
287
+ throw unsafe(path.relative(cwd, source));
288
+ // A file that already exists (keep.json included) is never overwritten.
289
+ const collisions = [];
290
+ // First pass: the whole archive reads back with matching hashes, and no
291
+ // file exists yet. Nothing is written before both hold.
292
+ await readArchive(source, async (entry, data) => {
293
+ const rel = safeRel(entry.path);
294
+ const h = createHash('sha256');
295
+ for await (const chunk of data)
296
+ h.update(chunk);
297
+ if (h.digest('hex') !== entry.sha256)
298
+ throw new Error(`${rel} is damaged in the archive; nothing was restored`);
299
+ await noLinkOnPath(dir, rel);
300
+ try {
301
+ await fs.lstat(path.join(dir, ...rel.split('/')));
302
+ collisions.push(rel);
303
+ }
304
+ catch { /* free */ }
305
+ });
306
+ if (collisions.length)
307
+ throw new StorageActionError('exists', `The conversation folder already holds ${collisions[0]}; nothing was restored.`);
308
+ let files = 0, restoredBytes = 0;
309
+ await readArchive(source, async (entry, data) => {
310
+ const rel = safeRel(entry.path);
311
+ const dest = path.join(dir, ...rel.split('/'));
312
+ await noLinkOnPath(dir, rel);
313
+ await fs.mkdir(path.dirname(dest), { recursive: true });
314
+ await noLinkOnPath(dir, rel);
315
+ const tmp = `${dest}.${randomUUID()}.tmp`;
316
+ const h = createHash('sha256');
317
+ async function* hashed() { for await (const c of data) {
318
+ h.update(c);
319
+ yield c;
320
+ } }
321
+ await pipeline(Readable.from(hashed()), createWriteStream(tmp, { flags: 'wx', mode: entry.mode || 0o600 }));
322
+ if (h.digest('hex') !== entry.sha256) {
323
+ await fs.rm(tmp, { force: true });
324
+ throw new Error(`${rel} did not restore correctly`);
325
+ }
326
+ await renameWithRetry(tmp, dest);
327
+ await fs.utimes(dest, new Date(entry.mtimeMs), new Date(entry.mtimeMs)).catch(() => undefined);
328
+ files++;
329
+ restoredBytes += entry.size;
330
+ });
331
+ await checkedArchiveFolder(cwd);
332
+ if ((await fs.lstat(source)).isFile())
333
+ await fs.rm(source, { force: true });
334
+ await recordStorageAction(cwd, { action: 'restore', workflowId, files, restoredBytes });
335
+ return { files, restoredBytes };
336
+ }
337
+ export async function listArchives(cwd) {
338
+ let names = [];
339
+ try {
340
+ names = await fs.readdir(archiveDir(cwd));
341
+ }
342
+ catch {
343
+ return [];
344
+ }
345
+ const out = [];
346
+ for (const name of names) {
347
+ if (!name.endsWith(ARCHIVE_SUFFIX))
348
+ continue;
349
+ const workflowId = name.slice(0, -ARCHIVE_SUFFIX.length);
350
+ try {
351
+ const st = await fs.stat(path.join(archiveDir(cwd), name));
352
+ out.push({ workflowId, bytes: st.size, archivedAt: st.mtimeMs });
353
+ }
354
+ catch { /* vanished */ }
355
+ }
356
+ return out;
357
+ }
358
+ //# sourceMappingURL=storageArchive.js.map
@@ -0,0 +1,47 @@
1
+ import { type StorageBucketName, type StorageFile } from './storageReport.js';
2
+ export interface StoragePolicy {
3
+ version: 1;
4
+ autoArchiveClosedDays: number | null;
5
+ budgetGiB: number;
6
+ budgetNotice: boolean;
7
+ }
8
+ export declare const DEFAULT_POLICY: StoragePolicy;
9
+ export declare function readPolicy(): Promise<StoragePolicy>;
10
+ export declare function sanitizePolicy(v: Partial<StoragePolicy>): StoragePolicy;
11
+ export declare function writePolicy(patch: Partial<StoragePolicy>): Promise<StoragePolicy>;
12
+ export declare function openWorkflowIds(): Set<string>;
13
+ export interface ProjectOverview {
14
+ path: string;
15
+ kind: 'project' | 'chat';
16
+ stateBytes: number;
17
+ buckets: Partial<Record<StorageBucketName, number>>;
18
+ biggest: StorageFile | null;
19
+ conversations: number;
20
+ openConversations: number;
21
+ archives: Array<{
22
+ workflowId: string;
23
+ bytes: number;
24
+ archivedAt: number;
25
+ }>;
26
+ errors: number;
27
+ }
28
+ export interface StorageOverview {
29
+ measuredAt: number;
30
+ totalBytes: number;
31
+ home: {
32
+ stateBytes: number;
33
+ buckets: Partial<Record<StorageBucketName, number>>;
34
+ biggest: StorageFile | null;
35
+ };
36
+ projects: ProjectOverview[];
37
+ budget: {
38
+ enabled: boolean;
39
+ limitBytes: number;
40
+ over: boolean;
41
+ };
42
+ }
43
+ export declare function storageOverview(refresh?: boolean): Promise<StorageOverview>;
44
+ export declare function cachedOverviewAge(): number | null;
45
+ export declare function staleConversations(cwd: string, days: number, now?: number): Promise<string[]>;
46
+ export declare function runAutoArchive(): Promise<number>;
47
+ export declare function startStoragePolicy(): void;
@@ -0,0 +1,197 @@
1
+ import { promises as fs } from 'node:fs';
2
+ import path from 'node:path';
3
+ import { arcoHome } from './arcoHome.js';
4
+ import { projectPaths, isChatStorage } from './projects.js';
5
+ import { readKnownCwds } from './explorerArtifacts.js';
6
+ import { snapshot } from './workspace.js';
7
+ import { workflows } from './server/state.js';
8
+ import { scanStorage } from './storageReport.js';
9
+ import { archiveConversation, listArchives } from './storageArchive.js';
10
+ import { atomicWriteFile } from './atomicFile.js';
11
+ import { readKeep, isKept } from './keepStore.js';
12
+ // The all-projects STORAGE view, the disk-budget notice and the optional
13
+ // auto-archive rule (P7.5, docs/STORAGE_PLAN.md). Reads use the bounded,
14
+ // read-only storage report; the only write is archiving, and only when the
15
+ // operator turned the rule on.
16
+ const GiB = 1024 * 1024 * 1024;
17
+ export const DEFAULT_POLICY = { version: 1, autoArchiveClosedDays: null, budgetGiB: 100, budgetNotice: true };
18
+ function policyPath() { return path.join(arcoHome(), 'storage-policy.json'); }
19
+ export async function readPolicy() {
20
+ try {
21
+ const v = JSON.parse(await fs.readFile(policyPath(), 'utf8'));
22
+ return sanitizePolicy(v);
23
+ }
24
+ catch {
25
+ return { ...DEFAULT_POLICY };
26
+ }
27
+ }
28
+ export function sanitizePolicy(v) {
29
+ const days = v.autoArchiveClosedDays;
30
+ const budget = v.budgetGiB;
31
+ return {
32
+ version: 1,
33
+ autoArchiveClosedDays: typeof days === 'number' && Number.isInteger(days) && days >= 1 && days <= 3650 ? days : null,
34
+ budgetGiB: typeof budget === 'number' && Number.isFinite(budget) && budget >= 1 && budget <= 1_000_000 ? budget : DEFAULT_POLICY.budgetGiB,
35
+ budgetNotice: typeof v.budgetNotice === 'boolean' ? v.budgetNotice : DEFAULT_POLICY.budgetNotice,
36
+ };
37
+ }
38
+ export async function writePolicy(patch) {
39
+ const next = sanitizePolicy({ ...(await readPolicy()), ...patch });
40
+ await atomicWriteFile(policyPath(), JSON.stringify(next, null, 2) + '\n');
41
+ return next;
42
+ }
43
+ export function openWorkflowIds() {
44
+ const ws = snapshot();
45
+ return new Set([...ws.workflows.map((w) => w.workflowId), ...ws.clusters.flatMap((c) => c.memberIds)]);
46
+ }
47
+ function bucketBytes(buckets) {
48
+ const out = {};
49
+ for (const [name, b] of Object.entries(buckets))
50
+ if (b.bytes > 0)
51
+ out[name] = b.bytes;
52
+ return out;
53
+ }
54
+ async function stateFolders() {
55
+ const seen = new Set();
56
+ const out = [];
57
+ const add = (p, kind) => { const r = path.resolve(p); if (!seen.has(r)) {
58
+ seen.add(r);
59
+ out.push({ path: r, kind });
60
+ } };
61
+ for (const p of await projectPaths().catch(() => []))
62
+ add(p, 'project');
63
+ for (const p of await readKnownCwds().catch(() => []))
64
+ if (isChatStorage(p))
65
+ add(p, 'chat');
66
+ return out;
67
+ }
68
+ async function stateDir(cwd) {
69
+ const dir = path.join(cwd, '.arco');
70
+ try {
71
+ const st = await fs.lstat(dir);
72
+ return st.isDirectory() ? dir : null;
73
+ }
74
+ catch {
75
+ return null;
76
+ }
77
+ }
78
+ let cached = null;
79
+ // One scan of every known project and chat state folder and Arco's own
80
+ // folder, one worker at a time. Cached; `refresh` measures again.
81
+ export function storageOverview(refresh = false) {
82
+ if (!cached || refresh) {
83
+ const promise = measureAll();
84
+ cached = { promise, at: Date.now() };
85
+ promise.catch(() => { if (cached?.promise === promise)
86
+ cached = null; });
87
+ }
88
+ return cached.promise;
89
+ }
90
+ export function cachedOverviewAge() { return cached ? Date.now() - cached.at : null; }
91
+ async function measureAll() {
92
+ const open = openWorkflowIds();
93
+ const projects = [];
94
+ for (const folder of await stateFolders()) {
95
+ const dir = await stateDir(folder.path);
96
+ if (!dir)
97
+ continue;
98
+ const report = await scanStorage(dir, null, { open: [...open] });
99
+ projects.push({
100
+ path: folder.path, kind: folder.kind, stateBytes: report.stateBytes, buckets: bucketBytes(report.buckets),
101
+ biggest: report.largestFiles[0] ?? null, conversations: report.workflows.length,
102
+ openConversations: report.workflows.filter((w) => w.open).length,
103
+ archives: await listArchives(folder.path), errors: report.errors,
104
+ });
105
+ }
106
+ projects.sort((a, b) => b.stateBytes - a.stateBytes);
107
+ const home = await scanStorage(arcoHome(), null, { scope: 'home' });
108
+ const totalBytes = home.stateBytes + projects.reduce((n, p) => n + p.stateBytes, 0);
109
+ const policy = await readPolicy();
110
+ const limitBytes = policy.budgetGiB * GiB;
111
+ return {
112
+ measuredAt: Date.now(), totalBytes,
113
+ home: { stateBytes: home.stateBytes, buckets: bucketBytes(home.buckets), biggest: home.largestFiles[0] ?? null },
114
+ projects,
115
+ budget: { enabled: policy.budgetNotice, limitBytes, over: policy.budgetNotice && totalBytes > limitBytes },
116
+ };
117
+ }
118
+ // Conversations closed for at least `days` days: not open, not working, not
119
+ // wholly kept, last written (meta.json or a log file) before the cutoff.
120
+ export async function staleConversations(cwd, days, now = Date.now()) {
121
+ const root = path.join(cwd, '.arco', 'workflows');
122
+ const open = openWorkflowIds();
123
+ const cutoff = now - days * 24 * 60 * 60 * 1000;
124
+ let names = [];
125
+ try {
126
+ names = await fs.readdir(root);
127
+ }
128
+ catch {
129
+ return [];
130
+ }
131
+ const out = [];
132
+ for (const id of names) {
133
+ if (!/^[a-zA-Z0-9-]{1,64}$/.test(id) || open.has(id) || workflows.get(id)?.busy)
134
+ continue;
135
+ const dir = path.join(root, id);
136
+ let latest = 0;
137
+ try {
138
+ for (const name of await fs.readdir(dir)) {
139
+ if (name !== 'meta.json' && !name.startsWith('events.'))
140
+ continue;
141
+ latest = Math.max(latest, (await fs.lstat(path.join(dir, name))).mtimeMs);
142
+ }
143
+ }
144
+ catch {
145
+ continue;
146
+ }
147
+ if (!latest || latest > cutoff)
148
+ continue;
149
+ const keep = await readKeep(dir);
150
+ if (!keep.ok || isKept(keep.items, '.'))
151
+ continue;
152
+ out.push(id);
153
+ }
154
+ return out;
155
+ }
156
+ // The opt-in rule: archive conversations closed for more than N days. Never
157
+ // deletes. Returns how many were archived.
158
+ export async function runAutoArchive() {
159
+ const policy = await readPolicy();
160
+ if (!policy.autoArchiveClosedDays)
161
+ return 0;
162
+ let archived = 0;
163
+ for (const folder of await stateFolders()) {
164
+ for (const id of await staleConversations(folder.path, policy.autoArchiveClosedDays)) {
165
+ try {
166
+ await archiveConversation(folder.path, id, { open: false, busy: false, by: 'policy' });
167
+ archived++;
168
+ }
169
+ catch (err) {
170
+ console.error(`[arco] auto-archive skipped ${id.slice(0, 8)}: ${err instanceof Error ? err.message : String(err)}`);
171
+ }
172
+ }
173
+ }
174
+ return archived;
175
+ }
176
+ let timer = null;
177
+ // Daily: the auto-archive rule (when on) and a fresh measurement for the
178
+ // disk-budget notice (when on). The first run waits ten minutes after start.
179
+ export function startStoragePolicy() {
180
+ if (timer || process.env.ARCO_STORAGE_POLICY === '0')
181
+ return;
182
+ const run = async () => {
183
+ try {
184
+ const policy = await readPolicy();
185
+ if (policy.autoArchiveClosedDays)
186
+ await runAutoArchive();
187
+ if (policy.budgetNotice)
188
+ await storageOverview(true);
189
+ }
190
+ catch (err) {
191
+ console.error('[arco] storage policy run failed:', err);
192
+ }
193
+ };
194
+ timer = setTimeout(function tick() { void run().finally(() => { timer = setTimeout(tick, 24 * 60 * 60 * 1000); timer.unref(); }); }, 10 * 60 * 1000);
195
+ timer.unref();
196
+ }
197
+ //# sourceMappingURL=storageOverview.js.map
@@ -0,0 +1,48 @@
1
+ export interface StorageFile {
2
+ path: string;
3
+ bytes: number;
4
+ }
5
+ export interface StorageBucket {
6
+ bytes: number;
7
+ allocatedBytes: number;
8
+ files: number;
9
+ }
10
+ export declare const STORAGE_BUCKETS: readonly ["events", "artifacts", "handoffs", "checkpoints", "scratch", "conversationFiles", "plans", "boards", "worktrees", "savedClusters", "voiceAndModels", "caches", "providerData", "logs", "archives", "other"];
11
+ export type StorageBucketName = typeof STORAGE_BUCKETS[number];
12
+ export interface StorageWorkflow {
13
+ id: string;
14
+ open: boolean;
15
+ lastActive: number;
16
+ eventBytes: number;
17
+ eventTypes: Record<string, number>;
18
+ artifactBytes: number;
19
+ handoffBytes: number;
20
+ checkpointBytes: number;
21
+ scratchBytes: number;
22
+ otherBytes: number;
23
+ largestFiles: StorageFile[];
24
+ largeFiles: StorageFile[];
25
+ errors: number;
26
+ }
27
+ export interface StorageReport {
28
+ measuredAt: number;
29
+ scope: 'project' | 'home';
30
+ stateBytes: number;
31
+ allocatedBytes: number;
32
+ hardLinkBytes: number;
33
+ nestedFolders: number;
34
+ checkpointBytes: number;
35
+ buckets: Record<StorageBucketName, StorageBucket>;
36
+ workflows: StorageWorkflow[];
37
+ largestFiles: StorageFile[];
38
+ largeFiles: StorageFile[];
39
+ errors: number;
40
+ }
41
+ export declare const LARGE_FILE_BYTES: number;
42
+ export interface ScanOptions {
43
+ scope?: 'project' | 'home';
44
+ stateName?: string;
45
+ open?: string[];
46
+ }
47
+ export declare function scanStorage(stateRoot: string, checkpointRoot: string | null, opts?: ScanOptions | string[]): Promise<StorageReport>;
48
+ export declare function projectCheckpointRoot(home: string, cwd: string): string;