pushwork 2.0.0-a.sub.1 → 2.0.0-preview.2

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 (234) hide show
  1. package/dist/branches.d.ts +20 -0
  2. package/dist/branches.d.ts.map +1 -0
  3. package/dist/branches.js +111 -0
  4. package/dist/branches.js.map +1 -0
  5. package/dist/cli.d.ts +1 -1
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +245 -270
  8. package/dist/cli.js.map +1 -1
  9. package/dist/config.d.ts +17 -0
  10. package/dist/config.d.ts.map +1 -0
  11. package/dist/config.js +84 -0
  12. package/dist/config.js.map +1 -0
  13. package/dist/fs-tree.d.ts +6 -0
  14. package/dist/fs-tree.d.ts.map +1 -0
  15. package/dist/fs-tree.js +99 -0
  16. package/dist/fs-tree.js.map +1 -0
  17. package/dist/ignore.d.ts +6 -0
  18. package/dist/ignore.d.ts.map +1 -0
  19. package/dist/ignore.js +74 -0
  20. package/dist/ignore.js.map +1 -0
  21. package/dist/index.d.ts +8 -4
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/index.js +35 -4
  24. package/dist/index.js.map +1 -1
  25. package/dist/log.d.ts +3 -0
  26. package/dist/log.d.ts.map +1 -0
  27. package/dist/log.js +14 -0
  28. package/dist/log.js.map +1 -0
  29. package/dist/pushwork.d.ts +129 -0
  30. package/dist/pushwork.d.ts.map +1 -0
  31. package/dist/pushwork.js +1062 -0
  32. package/dist/pushwork.js.map +1 -0
  33. package/dist/repo.d.ts +14 -0
  34. package/dist/repo.d.ts.map +1 -0
  35. package/dist/repo.js +60 -0
  36. package/dist/repo.js.map +1 -0
  37. package/dist/shapes/custom.d.ts +3 -0
  38. package/dist/shapes/custom.d.ts.map +1 -0
  39. package/dist/shapes/custom.js +57 -0
  40. package/dist/shapes/custom.js.map +1 -0
  41. package/dist/shapes/file.d.ts +20 -0
  42. package/dist/shapes/file.d.ts.map +1 -0
  43. package/dist/shapes/file.js +140 -0
  44. package/dist/shapes/file.js.map +1 -0
  45. package/dist/shapes/index.d.ts +10 -0
  46. package/dist/shapes/index.d.ts.map +1 -0
  47. package/dist/shapes/index.js +35 -0
  48. package/dist/shapes/index.js.map +1 -0
  49. package/dist/shapes/patchwork-folder.d.ts +3 -0
  50. package/dist/shapes/patchwork-folder.d.ts.map +1 -0
  51. package/dist/shapes/patchwork-folder.js +160 -0
  52. package/dist/shapes/patchwork-folder.js.map +1 -0
  53. package/dist/shapes/types.d.ts +38 -0
  54. package/dist/shapes/types.d.ts.map +1 -0
  55. package/dist/shapes/types.js +52 -0
  56. package/dist/shapes/types.js.map +1 -0
  57. package/dist/shapes/vfs.d.ts +3 -0
  58. package/dist/shapes/vfs.d.ts.map +1 -0
  59. package/dist/shapes/vfs.js +92 -0
  60. package/dist/shapes/vfs.js.map +1 -0
  61. package/dist/stash.d.ts +23 -0
  62. package/dist/stash.d.ts.map +1 -0
  63. package/dist/stash.js +118 -0
  64. package/dist/stash.js.map +1 -0
  65. package/dist/version.d.ts +11 -0
  66. package/dist/version.d.ts.map +1 -0
  67. package/dist/version.js +93 -0
  68. package/dist/version.js.map +1 -0
  69. package/package.json +19 -48
  70. package/patches/@automerge__automerge-repo@2.6.0-subduction.15.patch +26 -0
  71. package/.prettierrc +0 -9
  72. package/ARCHITECTURE-ACCORDING-TO-CLAUDE.md +0 -248
  73. package/CLAUDE.md +0 -141
  74. package/README.md +0 -221
  75. package/babel.config.js +0 -5
  76. package/dist/cli/commands.d.ts +0 -71
  77. package/dist/cli/commands.d.ts.map +0 -1
  78. package/dist/cli/commands.js +0 -794
  79. package/dist/cli/commands.js.map +0 -1
  80. package/dist/cli/index.d.ts +0 -2
  81. package/dist/cli/index.d.ts.map +0 -1
  82. package/dist/cli/index.js +0 -19
  83. package/dist/cli/index.js.map +0 -1
  84. package/dist/commands.d.ts +0 -61
  85. package/dist/commands.d.ts.map +0 -1
  86. package/dist/commands.js +0 -861
  87. package/dist/commands.js.map +0 -1
  88. package/dist/config/index.d.ts +0 -71
  89. package/dist/config/index.d.ts.map +0 -1
  90. package/dist/config/index.js +0 -314
  91. package/dist/config/index.js.map +0 -1
  92. package/dist/core/change-detection.d.ts +0 -80
  93. package/dist/core/change-detection.d.ts.map +0 -1
  94. package/dist/core/change-detection.js +0 -523
  95. package/dist/core/change-detection.js.map +0 -1
  96. package/dist/core/config.d.ts +0 -81
  97. package/dist/core/config.d.ts.map +0 -1
  98. package/dist/core/config.js +0 -258
  99. package/dist/core/config.js.map +0 -1
  100. package/dist/core/index.d.ts +0 -6
  101. package/dist/core/index.d.ts.map +0 -1
  102. package/dist/core/index.js +0 -6
  103. package/dist/core/index.js.map +0 -1
  104. package/dist/core/move-detection.d.ts +0 -34
  105. package/dist/core/move-detection.d.ts.map +0 -1
  106. package/dist/core/move-detection.js +0 -121
  107. package/dist/core/move-detection.js.map +0 -1
  108. package/dist/core/snapshot.d.ts +0 -105
  109. package/dist/core/snapshot.d.ts.map +0 -1
  110. package/dist/core/snapshot.js +0 -217
  111. package/dist/core/snapshot.js.map +0 -1
  112. package/dist/core/sync-engine.d.ts +0 -157
  113. package/dist/core/sync-engine.d.ts.map +0 -1
  114. package/dist/core/sync-engine.js +0 -1379
  115. package/dist/core/sync-engine.js.map +0 -1
  116. package/dist/types/config.d.ts +0 -99
  117. package/dist/types/config.d.ts.map +0 -1
  118. package/dist/types/config.js +0 -5
  119. package/dist/types/config.js.map +0 -1
  120. package/dist/types/documents.d.ts +0 -88
  121. package/dist/types/documents.d.ts.map +0 -1
  122. package/dist/types/documents.js +0 -20
  123. package/dist/types/documents.js.map +0 -1
  124. package/dist/types/index.d.ts +0 -4
  125. package/dist/types/index.d.ts.map +0 -1
  126. package/dist/types/index.js +0 -4
  127. package/dist/types/index.js.map +0 -1
  128. package/dist/types/snapshot.d.ts +0 -64
  129. package/dist/types/snapshot.d.ts.map +0 -1
  130. package/dist/types/snapshot.js +0 -2
  131. package/dist/types/snapshot.js.map +0 -1
  132. package/dist/utils/content-similarity.d.ts +0 -53
  133. package/dist/utils/content-similarity.d.ts.map +0 -1
  134. package/dist/utils/content-similarity.js +0 -155
  135. package/dist/utils/content-similarity.js.map +0 -1
  136. package/dist/utils/content.d.ts +0 -10
  137. package/dist/utils/content.d.ts.map +0 -1
  138. package/dist/utils/content.js +0 -31
  139. package/dist/utils/content.js.map +0 -1
  140. package/dist/utils/directory.d.ts +0 -24
  141. package/dist/utils/directory.d.ts.map +0 -1
  142. package/dist/utils/directory.js +0 -52
  143. package/dist/utils/directory.js.map +0 -1
  144. package/dist/utils/fs.d.ts +0 -74
  145. package/dist/utils/fs.d.ts.map +0 -1
  146. package/dist/utils/fs.js +0 -248
  147. package/dist/utils/fs.js.map +0 -1
  148. package/dist/utils/index.d.ts +0 -5
  149. package/dist/utils/index.d.ts.map +0 -1
  150. package/dist/utils/index.js +0 -5
  151. package/dist/utils/index.js.map +0 -1
  152. package/dist/utils/mime-types.d.ts +0 -13
  153. package/dist/utils/mime-types.d.ts.map +0 -1
  154. package/dist/utils/mime-types.js +0 -209
  155. package/dist/utils/mime-types.js.map +0 -1
  156. package/dist/utils/network-sync.d.ts +0 -36
  157. package/dist/utils/network-sync.d.ts.map +0 -1
  158. package/dist/utils/network-sync.js +0 -250
  159. package/dist/utils/network-sync.js.map +0 -1
  160. package/dist/utils/node-polyfills.d.ts +0 -9
  161. package/dist/utils/node-polyfills.d.ts.map +0 -1
  162. package/dist/utils/node-polyfills.js +0 -9
  163. package/dist/utils/node-polyfills.js.map +0 -1
  164. package/dist/utils/output.d.ts +0 -129
  165. package/dist/utils/output.d.ts.map +0 -1
  166. package/dist/utils/output.js +0 -368
  167. package/dist/utils/output.js.map +0 -1
  168. package/dist/utils/repo-factory.d.ts +0 -13
  169. package/dist/utils/repo-factory.d.ts.map +0 -1
  170. package/dist/utils/repo-factory.js +0 -46
  171. package/dist/utils/repo-factory.js.map +0 -1
  172. package/dist/utils/string-similarity.d.ts +0 -14
  173. package/dist/utils/string-similarity.d.ts.map +0 -1
  174. package/dist/utils/string-similarity.js +0 -39
  175. package/dist/utils/string-similarity.js.map +0 -1
  176. package/dist/utils/text-diff.d.ts +0 -37
  177. package/dist/utils/text-diff.d.ts.map +0 -1
  178. package/dist/utils/text-diff.js +0 -93
  179. package/dist/utils/text-diff.js.map +0 -1
  180. package/dist/utils/trace.d.ts +0 -19
  181. package/dist/utils/trace.d.ts.map +0 -1
  182. package/dist/utils/trace.js +0 -63
  183. package/dist/utils/trace.js.map +0 -1
  184. package/src/cli.ts +0 -442
  185. package/src/commands.ts +0 -1134
  186. package/src/core/change-detection.ts +0 -712
  187. package/src/core/config.ts +0 -313
  188. package/src/core/index.ts +0 -5
  189. package/src/core/move-detection.ts +0 -169
  190. package/src/core/snapshot.ts +0 -275
  191. package/src/core/sync-engine.ts +0 -1795
  192. package/src/index.ts +0 -4
  193. package/src/types/config.ts +0 -111
  194. package/src/types/documents.ts +0 -91
  195. package/src/types/index.ts +0 -3
  196. package/src/types/snapshot.ts +0 -67
  197. package/src/utils/content.ts +0 -34
  198. package/src/utils/directory.ts +0 -73
  199. package/src/utils/fs.ts +0 -297
  200. package/src/utils/index.ts +0 -4
  201. package/src/utils/mime-types.ts +0 -244
  202. package/src/utils/network-sync.ts +0 -319
  203. package/src/utils/node-polyfills.ts +0 -8
  204. package/src/utils/output.ts +0 -450
  205. package/src/utils/repo-factory.ts +0 -73
  206. package/src/utils/string-similarity.ts +0 -54
  207. package/src/utils/text-diff.ts +0 -101
  208. package/src/utils/trace.ts +0 -70
  209. package/test/integration/README.md +0 -328
  210. package/test/integration/clone-test.sh +0 -310
  211. package/test/integration/conflict-resolution-test.sh +0 -309
  212. package/test/integration/debug-both-nested.sh +0 -74
  213. package/test/integration/debug-concurrent-nested.sh +0 -87
  214. package/test/integration/debug-nested.sh +0 -73
  215. package/test/integration/deletion-behavior-test.sh +0 -487
  216. package/test/integration/deletion-sync-test-simple.sh +0 -193
  217. package/test/integration/deletion-sync-test.sh +0 -297
  218. package/test/integration/exclude-patterns.test.ts +0 -144
  219. package/test/integration/full-integration-test.sh +0 -363
  220. package/test/integration/fuzzer.test.ts +0 -818
  221. package/test/integration/in-memory-sync.test.ts +0 -830
  222. package/test/integration/init-sync.test.ts +0 -89
  223. package/test/integration/manual-sync-test.sh +0 -84
  224. package/test/integration/sync-deletion.test.ts +0 -280
  225. package/test/integration/sync-flow.test.ts +0 -291
  226. package/test/jest.setup.ts +0 -34
  227. package/test/run-tests.sh +0 -225
  228. package/test/unit/deletion-behavior.test.ts +0 -249
  229. package/test/unit/enhanced-mime-detection.test.ts +0 -244
  230. package/test/unit/snapshot.test.ts +0 -404
  231. package/test/unit/sync-convergence.test.ts +0 -298
  232. package/test/unit/sync-timing.test.ts +0 -134
  233. package/test/unit/utils.test.ts +0 -366
  234. package/tsconfig.json +0 -23
package/dist/cli.js CHANGED
@@ -1,310 +1,285 @@
1
1
  #!/usr/bin/env node
2
- import { Command, Option } from "@commander-js/extra-typings";
3
- import chalk from "chalk";
4
- import { init, clone, sync, root, diff, status, log, checkout, commit, url, rm, ls, config, watch, read, } from "./commands.js";
5
- import { createRequire } from "module";
6
- const require = createRequire(import.meta.url);
7
- const version = require("../package.json").version;
8
- const program = new Command()
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ require("./log.js"); // sets up DEBUG=true → DEBUG=* before anything else
38
+ const extra_typings_1 = require("@commander-js/extra-typings");
39
+ const path = __importStar(require("path"));
40
+ const pushwork_js_1 = require("./pushwork.js");
41
+ const log_js_1 = require("./log.js");
42
+ const version_js_1 = require("./version.js");
43
+ const dlog = (0, log_js_1.log)("cli");
44
+ const collect = (value, prev) => (prev ?? []).concat(value);
45
+ const program = new extra_typings_1.Command()
9
46
  .name("pushwork")
10
47
  .description("Bidirectional directory synchronization using Automerge CRDTs")
11
- .version(version, "-V, --version", "output the version number");
12
- // Init command
13
- program
14
- .command("init")
15
- .summary("Initialize sync in a directory")
16
- .argument("[path]", "Directory path to initialize (default: current directory)", ".")
17
- .option("--sync-server <url>", "Custom sync server URL")
18
- .action(async (path, opts) => {
19
- await init(path, { syncServer: opts.syncServer });
20
- });
21
- // Track command (set root directory URL without full initialization)
22
- const trackAction = async (url, path, opts) => {
23
- await root(url, path, { force: opts.force });
24
- };
48
+ .version((0, version_js_1.formatVersions)(), "-v, --version", "Print version info and exit");
25
49
  program
26
- .command("track")
27
- .summary("Set root directory URL without full initialization")
28
- .argument("<url>", "AutomergeUrl of root directory (format: automerge:XXXXX)")
29
- .argument("[path]", "Directory path (default: current directory)", ".")
30
- .option("-f, --force", "Overwrite existing pushwork setup", false)
31
- .action(async (url, path, opts) => {
32
- await trackAction(url, path, opts);
50
+ .command("version")
51
+ .description("Print pushwork and Automerge package versions")
52
+ .action(() => {
53
+ process.stdout.write((0, version_js_1.formatVersions)() + "\n");
33
54
  });
34
- // Hidden alias for backwards compatibility
35
55
  program
36
- .command("root", { hidden: true })
37
- .argument("<url>")
38
- .argument("[path]", "", ".")
39
- .option("-f, --force", "", false)
40
- .action(async (url, path, opts) => {
41
- await trackAction(url, path, opts);
56
+ .command("init")
57
+ .description("Initialize pushwork in a directory")
58
+ .argument("[dir]", "Directory to initialize", ".")
59
+ .option("--sub", "Use subduction backend")
60
+ .option("--shape <shape>", "Document shape: vfs, patchwork-folder, or path to a custom shape module", "vfs")
61
+ .option("--artifact-dir <dir>", "Directory whose contents are stored as ImmutableString and pinned with heads in the root doc. Repeatable.", collect, undefined)
62
+ .option("--no-branches", "Skip wrapping the root doc in a branches doc")
63
+ .action(async (dir, opts) => {
64
+ dlog("init dir=%s opts=%o", dir, opts);
65
+ const u = await (0, pushwork_js_1.init)({
66
+ dir: path.resolve(dir),
67
+ backend: opts.sub ? "subduction" : "legacy",
68
+ shape: opts.shape,
69
+ artifactDirectories: opts.artifactDir,
70
+ branches: opts.branches,
71
+ });
72
+ process.stderr.write(`initialized ${u}\n`);
42
73
  });
43
- // Clone command
44
74
  program
45
75
  .command("clone")
46
- .summary("Clone an existing synced directory")
47
- .argument("<url>", "AutomergeUrl of root directory to clone (format: automerge:XXXXX)")
48
- .argument("<path>", "Target directory path")
49
- .option("-f, --force", "Overwrite existing directory", false)
50
- .option("--sync-server <url>", "Custom sync server URL")
51
- .option("-v, --verbose", "Verbose output", false)
52
- .action(async (url, path, opts) => {
53
- await clone(url, path, {
54
- force: opts.force,
55
- verbose: opts.verbose,
56
- syncServer: opts.syncServer,
76
+ .description("Clone an automerge URL into a directory")
77
+ .argument("<url>", "automerge: URL")
78
+ .argument("[dir]", "Target directory", ".")
79
+ .option("--sub", "Use subduction backend")
80
+ .option("--shape <shape>", "Document shape: vfs, patchwork-folder, or path to a custom shape module", "vfs")
81
+ .option("--artifact-dir <dir>", "Directory whose contents are stored as ImmutableString and pinned with heads in the root doc. Repeatable.", collect, undefined)
82
+ .option("--branch <name>", "Branch to track when cloning a branches doc")
83
+ .action(async (u, dir, opts) => {
84
+ dlog("clone url=%s dir=%s opts=%o", u, dir, opts);
85
+ await (0, pushwork_js_1.clone)({
86
+ url: u,
87
+ dir: path.resolve(dir),
88
+ backend: opts.sub ? "subduction" : "legacy",
89
+ shape: opts.shape,
90
+ artifactDirectories: opts.artifactDir,
91
+ branch: opts.branch,
57
92
  });
93
+ process.stderr.write(`cloned into ${path.resolve(dir)}\n`);
58
94
  });
59
- // Commit command
60
95
  program
61
- .command("commit")
62
- .summary("Save local changes to Automerge documents")
63
- .argument("[path]", "Directory path to commit (default: current directory)", ".")
64
- .action(async (path, _opts) => {
65
- await commit(path);
96
+ .command("url")
97
+ .description("Print the automerge URL of this pushwork repo")
98
+ .action(async () => {
99
+ dlog("url cwd=%s", process.cwd());
100
+ const u = await (0, pushwork_js_1.url)(process.cwd());
101
+ process.stdout.write(u + "\n");
66
102
  });
67
- // Sync command
68
103
  program
69
104
  .command("sync")
70
- .summary("Run full bidirectional synchronization")
71
- .argument("[path]", "Directory path to sync (default: current directory)", ".")
72
- .option("--dry-run", "Show what would be done without applying changes", false)
73
- .option("--gentle", "Use config files and only sync changed files (instead of default full resync)", false)
74
- .option("--nuclear", "Recreate all Automerge documents from scratch", false)
75
- .addOption(new Option("-f, --force", "Accepted for backwards compatibility").default(false).hideHelp())
76
- .option("-v, --verbose", "Verbose output", false)
77
- .action(async (path, opts) => {
78
- await sync(path, {
79
- dryRun: opts.dryRun,
80
- force: opts.force,
81
- gentle: opts.gentle,
82
- nuclear: opts.nuclear,
83
- verbose: opts.verbose,
84
- });
105
+ .description("Sync local changes with peers")
106
+ .option("--nuclear", "Re-create every doc (file, folder, branches) with a fresh URL before syncing. Stops referencing the old URLs from this repo.")
107
+ .action(async (opts) => {
108
+ dlog("sync cwd=%s opts=%o", process.cwd(), opts);
109
+ await (0, pushwork_js_1.sync)(process.cwd(), { nuclear: opts.nuclear });
110
+ process.stderr.write(opts.nuclear ? "nuclear synced\n" : "synced\n");
85
111
  });
86
- // Diff command
87
112
  program
88
- .command("diff")
89
- .summary("Show changes in working directory")
90
- .argument("[path]", "Limit diff to specific path (default: current directory)", ".")
91
- .option("--name-only", "Show only changed file names", false)
92
- .action(async (path, opts) => {
93
- await diff(path, {
94
- nameOnly: opts.nameOnly,
95
- });
113
+ .command("save")
114
+ .alias("commit")
115
+ .description("Commit local changes to the current branch without contacting the sync server")
116
+ .action(async () => {
117
+ dlog("save cwd=%s", process.cwd());
118
+ await (0, pushwork_js_1.save)(process.cwd());
119
+ process.stderr.write("saved\n");
96
120
  });
97
- // Status command
98
121
  program
99
122
  .command("status")
100
- .summary("Show sync status summary")
101
- .argument("[path]", "Directory path (default: current directory)", ".")
102
- .option("-v, --verbose", "Show detailed status including document info and all tracked files", false)
103
- .action(async (path, opts) => {
104
- await status(path, {
105
- verbose: opts.verbose,
106
- });
123
+ .description("Show current branch and changes against it")
124
+ .action(async () => {
125
+ const { branch, diff: d } = await (0, pushwork_js_1.status)(process.cwd());
126
+ const lines = [];
127
+ if (branch)
128
+ lines.push(`On branch ${branch}`);
129
+ else
130
+ lines.push("(no branches)");
131
+ const total = d.added.length + d.modified.length + d.deleted.length;
132
+ if (total === 0) {
133
+ lines.push("nothing to save, working tree clean");
134
+ }
135
+ else {
136
+ lines.push("Changes:");
137
+ for (const p of d.modified)
138
+ lines.push(` modified: ${p}`);
139
+ for (const p of d.added)
140
+ lines.push(` added: ${p}`);
141
+ for (const p of d.deleted)
142
+ lines.push(` deleted: ${p}`);
143
+ }
144
+ process.stdout.write(lines.join("\n") + "\n");
107
145
  });
108
- // Log command
109
146
  program
110
- .command("log")
111
- .summary("Show sync history (experimental)")
112
- .argument("[path]", "Show history for specific file or directory (default: current directory)", ".")
113
- .option("--oneline", "Compact one-line per sync format", false)
114
- .option("--since <date>", "Show syncs since date")
115
- .option("--limit <n>", "Limit number of syncs shown", "10")
116
- .action(async (path, opts) => {
117
- await log(path, {
118
- oneline: opts.oneline,
119
- since: opts.since,
120
- limit: parseInt(opts.limit),
121
- });
147
+ .command("diff")
148
+ .description("Show textual diffs of local changes against the current branch")
149
+ .argument("[path]", "Limit to a specific path")
150
+ .action(async (limitPath) => {
151
+ const entries = await (0, pushwork_js_1.diff)(process.cwd(), limitPath);
152
+ if (entries.length === 0) {
153
+ process.stdout.write("(no changes)\n");
154
+ return;
155
+ }
156
+ const { createPatch } = await Promise.resolve().then(() => __importStar(require("diff")));
157
+ const td = new TextDecoder("utf-8", { fatal: false });
158
+ for (const e of entries) {
159
+ const before = e.before ? td.decode(e.before) : "";
160
+ const after = e.after ? td.decode(e.after) : "";
161
+ const header = e.kind === "added" ? `+++ ${e.path}` :
162
+ e.kind === "deleted" ? `--- ${e.path}` :
163
+ `*** ${e.path}`;
164
+ process.stdout.write(header + "\n");
165
+ process.stdout.write(createPatch(e.path, before, after, "", "") + "\n");
166
+ }
122
167
  });
123
- // Checkout command
124
168
  program
125
- .command("checkout")
126
- .summary("Restore to previous sync (experimental)")
127
- .argument("<sync-id>", "Sync ID to restore to")
128
- .argument("[path]", "Specific path to restore (default: current directory)", ".")
129
- .option("-f, --force", "Force checkout even if there are uncommitted changes", false)
130
- .action(async (syncId, path, opts) => {
131
- await checkout(syncId, path, {
132
- force: opts.force,
133
- });
169
+ .command("branch")
170
+ .description("With no arg: print the current branch. With <name>: create a new branch from the current one and switch to it (offline).")
171
+ .argument("[name]", "Name of the new branch")
172
+ .action(async (name) => {
173
+ if (!name) {
174
+ const cur = await (0, pushwork_js_1.currentBranch)(process.cwd());
175
+ process.stdout.write((cur ?? "(none)") + "\n");
176
+ return;
177
+ }
178
+ const newUrl = await (0, pushwork_js_1.createBranch)(process.cwd(), name);
179
+ process.stderr.write(`created branch ${name} → ${newUrl}\nswitched to ${name}\n`);
134
180
  });
135
- // URL command
136
181
  program
137
- .command("url")
138
- .summary("Show the Automerge root URL")
139
- .argument("[path]", "Directory path (default: current directory)", ".")
140
- .action(async (path) => {
141
- await url(path);
182
+ .command("switch")
183
+ .description("Switch to a branch (offline). With no name: list branches.")
184
+ .argument("[name]", "Name of the branch to switch to")
185
+ .action(async (name) => {
186
+ if (!name) {
187
+ const { current, names } = await (0, pushwork_js_1.listBranches)(process.cwd());
188
+ for (const n of names) {
189
+ process.stdout.write(`${n === current ? "* " : " "}${n}\n`);
190
+ }
191
+ return;
192
+ }
193
+ await (0, pushwork_js_1.switchBranch)(process.cwd(), name);
194
+ process.stderr.write(`switched to ${name}\n`);
142
195
  });
143
- // Remove command
144
196
  program
145
- .command("rm")
146
- .summary("Remove local pushwork data")
147
- .argument("[path]", "Directory path (default: current directory)", ".")
148
- .action(async (path) => {
149
- await rm(path);
197
+ .command("merge")
198
+ .description("Apply changes from <source> branch onto the current branch (offline)")
199
+ .argument("<source>", "Branch to merge into the current one")
200
+ .option("--dry", "Preview the merge without applying")
201
+ .action(async (source, opts) => {
202
+ if (opts.dry) {
203
+ const preview = await (0, pushwork_js_1.previewMerge)(process.cwd(), source);
204
+ const lines = [];
205
+ lines.push(`Merging ${preview.source} into ${preview.target} (preview)`);
206
+ if (preview.entries.length === 0) {
207
+ lines.push("(no changes)");
208
+ process.stdout.write(lines.join("\n") + "\n");
209
+ return;
210
+ }
211
+ const { createPatch } = await Promise.resolve().then(() => __importStar(require("diff")));
212
+ const td = new TextDecoder("utf-8", { fatal: false });
213
+ for (const e of preview.entries) {
214
+ const before = e.before ? td.decode(e.before) : "";
215
+ const after = td.decode(e.after);
216
+ const tag = e.kind === "added" ? "added" : "merged";
217
+ lines.push(` ${tag}: ${e.path}`);
218
+ lines.push(createPatch(e.path, before, after, "", ""));
219
+ }
220
+ process.stdout.write(lines.join("\n") + "\n");
221
+ return;
222
+ }
223
+ const report = await (0, pushwork_js_1.mergeBranch)(process.cwd(), source);
224
+ const lines = [];
225
+ lines.push(`Merging ${report.source} into ${report.target}`);
226
+ if (report.merged.length === 0 && report.added.length === 0) {
227
+ lines.push("(no changes)");
228
+ }
229
+ else {
230
+ for (const p of report.merged)
231
+ lines.push(` merged: ${p}`);
232
+ for (const p of report.added)
233
+ lines.push(` added: ${p}`);
234
+ }
235
+ process.stdout.write(lines.join("\n") + "\n");
150
236
  });
151
- // List command
152
237
  program
153
- .command("ls")
154
- .summary("List tracked files")
155
- .argument("[path]", "Directory path (default: current directory)", ".")
156
- .option("-v, --verbose", "Show with Automerge URLs", false)
157
- .action(async (path, opts) => {
158
- await ls(path, {
159
- verbose: opts.verbose,
160
- });
238
+ .command("cut")
239
+ .description("Stash working-tree changes against the current branch and reset the tree to clean (offline)")
240
+ .argument("[name]", "Optional name for the stash entry")
241
+ .action(async (name) => {
242
+ const result = await (0, pushwork_js_1.cutWorkdir)(process.cwd(), { name });
243
+ process.stderr.write(`cut #${result.id}: ${result.entries} entr${result.entries === 1 ? "y" : "ies"}\n`);
161
244
  });
162
- // Config command
163
245
  program
164
- .command("config")
165
- .summary("View or edit configuration")
166
- .argument("[path]", "Directory path (default: current directory)", ".")
167
- .option("--list", "Show full configuration", false)
168
- .option("--get <key>", "Get specific config value (dot notation, e.g., sync.move_detection_threshold)")
169
- .action(async (path, opts) => {
170
- await config(path, {
171
- list: opts.list,
172
- get: opts.get,
173
- });
246
+ .command("paste")
247
+ .description("Re-apply a stashed set of changes; default is the most recent (offline)")
248
+ .argument("[id-or-name]", "Stash id or name")
249
+ .action(async (selector) => {
250
+ const result = await (0, pushwork_js_1.pasteStash)(process.cwd(), selector);
251
+ process.stderr.write(`pasted #${result.id}${result.name ? ` (${result.name})` : ""}: ${result.entries} entr${result.entries === 1 ? "y" : "ies"}\n`);
174
252
  });
175
- // Watch command
176
253
  program
177
- .command("watch")
178
- .summary("Watch directory for changes, build, and sync")
179
- .argument("[path]", "Directory path to sync (default: current directory)", ".")
180
- .option("--script <command>", "Build script to run before syncing", "pnpm build")
181
- .option("--dir <dir>", "Directory to watch for changes (relative to working directory)", "src")
182
- .option("-v, --verbose", "Show build script output", false)
183
- .action(async (path, opts) => {
184
- await watch(path, {
185
- script: opts.script,
186
- watchDir: opts.dir,
187
- verbose: opts.verbose,
188
- });
254
+ .command("cuts")
255
+ .description("List stashed change sets (newest first)")
256
+ .action(async () => {
257
+ const stashes = await (0, pushwork_js_1.showStashes)(process.cwd());
258
+ if (stashes.length === 0) {
259
+ process.stdout.write("(no stashes)\n");
260
+ return;
261
+ }
262
+ for (const s of stashes) {
263
+ const ts = new Date(s.createdAt).toISOString();
264
+ const label = s.name ? `"${s.name}"` : "";
265
+ const branch = s.branch ? ` on ${s.branch}` : "";
266
+ process.stdout.write(`#${s.id}${label ? " " + label : ""}${branch} ${s.entries.length} entr${s.entries.length === 1 ? "y" : "ies"} ${ts}\n`);
267
+ }
189
268
  });
190
- // Read command
191
269
  program
192
- .command("read")
193
- .summary("Read a file document by its Automerge URL")
194
- .argument("<url>", "AutomergeUrl of file document (format: automerge:XXXXX)")
195
- .option("-r, --remote", "Read from sync server instead of local storage", false)
196
- .action(async (url, opts) => {
197
- await read(url, {
198
- remote: opts.remote,
199
- });
200
- });
201
- // Completion command (hidden from help)
202
- program.command("completion", { hidden: true }).action(() => {
203
- // Generate completion dynamically from registered commands
204
- const commands = program.commands
205
- .filter((cmd) => cmd.name() !== "completion") // Exclude self
206
- .map((cmd) => {
207
- const name = cmd.name();
208
- const desc = (cmd.summary() || cmd.description() || "").replace(/'/g, "\\'");
209
- return `'${name}:${desc}'`;
210
- })
211
- .join(" ");
212
- // Generate option completions for each command
213
- const commandCases = program.commands
214
- .filter((cmd) => cmd.name() !== "completion")
215
- .map((cmd) => {
216
- const options = cmd.options
217
- .filter((opt) => opt.flags !== "-h, --help") // Exclude help
218
- .map((opt) => {
219
- // Parse flags like "-v, --verbose" or "--dry-run"
220
- const flags = opt.flags.split(",").map((f) => f.trim());
221
- const desc = (opt.description || "")
222
- .replace(/'/g, "\\'")
223
- .replace(/\n/g, " ");
224
- // For options with arguments like "--sync-server <url>"
225
- // Extract just the flag part
226
- const cleanFlags = flags.map((f) => f.split(/\s+/)[0]);
227
- if (cleanFlags.length > 1) {
228
- // Multiple flags (short and long): '(-v --verbose)'{-v,--verbose}'[description]'
229
- const short = cleanFlags[0];
230
- const long = cleanFlags[1];
231
- return `'(${short} ${long})'{${short},${long}}'[${desc}]'`;
232
- }
233
- else {
234
- // Single flag: '--flag[description]'
235
- return `'${cleanFlags[0]}[${desc}]'`;
236
- }
237
- })
238
- .join(" \\\n ");
239
- return options
240
- ? ` ${cmd.name()})
241
- _arguments \\
242
- ${options}
243
- ;;`
244
- : "";
245
- })
246
- .filter(Boolean)
247
- .join("\n");
248
- const completionScript = `
249
- # pushwork completion for zsh
250
- _pushwork() {
251
- local -a commands
252
- commands=(${commands})
253
-
254
- _arguments -C \\
255
- '1: :->command' \\
256
- '*::arg:->args'
257
-
258
- case $state in
259
- command)
260
- _describe 'command' commands
261
- ;;
262
- args)
263
- case $words[1] in
264
- ${commandCases}
265
- esac
266
- ;;
267
- esac
268
- }
269
-
270
- compdef _pushwork pushwork
271
- `.trim();
272
- console.log(completionScript);
273
- });
274
- process.on("unhandledRejection", (error) => {
275
- console.log(chalk.bgRed.white(" ERROR "));
276
- if (error instanceof Error && error.stack) {
277
- console.log(chalk.red(error.stack));
270
+ .command("branches")
271
+ .description("List branches")
272
+ .action(async () => {
273
+ const { current, names } = await (0, pushwork_js_1.listBranches)(process.cwd());
274
+ for (const n of names) {
275
+ process.stdout.write(`${n === current ? "* " : " "}${n}\n`);
278
276
  }
279
- else {
280
- console.error(chalk.red(error));
281
- }
282
- process.exit(1);
283
277
  });
284
- // Configure help colors using Commander v13's built-in color support
285
278
  program
286
- .configureHelp({
287
- styleTitle: (str) => chalk.bold(str),
288
- styleCommandText: (str) => chalk.white(str),
289
- styleCommandDescription: (str) => chalk.dim(str),
290
- styleOptionText: (str) => chalk.green(str),
291
- styleArgumentText: (str) => chalk.cyan(str),
292
- subcommandTerm: (cmd) => {
293
- const opts = cmd.options
294
- .filter((opt) => opt.flags !== "-h, --help")
295
- .map((opt) => opt.short || opt.long)
296
- .join(", ");
297
- const name = chalk.white(cmd.name());
298
- const args = cmd.registeredArguments
299
- .map((arg) => arg.required
300
- ? chalk.cyan(`<${arg.name()}>`)
301
- : chalk.dim(`[${arg.name()}]`))
302
- .join(" ");
303
- return [name, args, opts && chalk.dim(`[${opts}]`)]
304
- .filter(Boolean)
305
- .join(" ");
306
- },
307
- })
308
- .addHelpText("after", chalk.dim('\nEnable tab completion by adding this to your ~/.zshrc:\neval "$(pushwork completion)"'));
309
- program.parseAsync();
279
+ .parseAsync(process.argv)
280
+ .then(() => process.exit(0))
281
+ .catch((err) => {
282
+ process.stderr.write(`pushwork: ${err instanceof Error ? err.message : String(err)}\n`);
283
+ process.exit(1);
284
+ });
310
285
  //# sourceMappingURL=cli.js.map
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,MAAM,EACN,GAAG,EACH,EAAE,EACF,EAAE,EACF,MAAM,EACN,KAAK,EACL,IAAI,GACL,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAC;AACnD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,UAAU,CAAC;KAChB,WA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AAC,GAAG,CAAC,IAAI,CACjE,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { AutomergeUrl } from "@automerge/automerge-repo";
2
+ export type Backend = "legacy" | "subduction";
3
+ export declare const CONFIG_VERSION = 3;
4
+ export interface PushworkConfig {
5
+ version: typeof CONFIG_VERSION;
6
+ rootUrl: AutomergeUrl;
7
+ backend: Backend;
8
+ shape: string;
9
+ artifactDirectories: string[];
10
+ branches: boolean;
11
+ }
12
+ export declare const pushworkDir: (root: string) => string;
13
+ export declare const storageDir: (root: string) => string;
14
+ export declare function readConfig(root: string): Promise<PushworkConfig>;
15
+ export declare function writeConfig(root: string, config: PushworkConfig): Promise<void>;
16
+ export declare function configExists(root: string): Promise<boolean>;
17
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,YAAY,CAAC;AAE9C,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC,MAAM,WAAW,cAAc;IAC9B,OAAO,EAAE,OAAO,cAAc,CAAC;IAC/B,OAAO,EAAE,YAAY,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,OAAO,CAAC;CAClB;AAMD,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,WAAyB,CAAC;AAClE,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,WAAkC,CAAC;AAE1E,wBAAsB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAmBtE;AAED,wBAAsB,WAAW,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,cAAc,GACpB,OAAO,CAAC,IAAI,CAAC,CAMf;AAED,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAOjE"}