@jive-sh/skill-sync 0.3.0 → 0.3.1-latest-darwin-x64

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 (40) hide show
  1. package/multi-call-binary +4 -0
  2. package/package.json +11 -39
  3. package/README.md +0 -58
  4. package/bin/package.json +0 -1
  5. package/bin/skill-sync +0 -579
  6. package/bin/skill-sync-daemon +0 -579
  7. package/dist/daemons/skill-sync-daemon.js +0 -401
  8. package/dist/daemons/skill-sync-daemon.js.map +0 -1
  9. package/dist/entrypoints/skill-sync.js +0 -114
  10. package/dist/entrypoints/skill-sync.js.map +0 -1
  11. package/dist/index.js +0 -10
  12. package/dist/index.js.map +0 -1
  13. package/dist/internal/config.js +0 -134
  14. package/dist/internal/config.js.map +0 -1
  15. package/dist/internal/control.js +0 -101
  16. package/dist/internal/control.js.map +0 -1
  17. package/dist/internal/folders.js +0 -65
  18. package/dist/internal/folders.js.map +0 -1
  19. package/dist/internal/notify.js +0 -50
  20. package/dist/internal/notify.js.map +0 -1
  21. package/dist/internal/path.js +0 -36
  22. package/dist/internal/path.js.map +0 -1
  23. package/dist/internal/reconcile.js +0 -124
  24. package/dist/internal/reconcile.js.map +0 -1
  25. package/dist/internal/sync.js +0 -241
  26. package/dist/internal/sync.js.map +0 -1
  27. package/dist/internal/wire.js +0 -13
  28. package/dist/internal/wire.js.map +0 -1
  29. package/install.cjs +0 -579
  30. package/src/daemons/skill-sync-daemon.ts +0 -397
  31. package/src/entrypoints/skill-sync.ts +0 -116
  32. package/src/index.ts +0 -15
  33. package/src/internal/config.ts +0 -171
  34. package/src/internal/control.ts +0 -123
  35. package/src/internal/folders.ts +0 -69
  36. package/src/internal/notify.ts +0 -53
  37. package/src/internal/path.ts +0 -32
  38. package/src/internal/reconcile.ts +0 -166
  39. package/src/internal/sync.ts +0 -304
  40. package/src/internal/wire.ts +0 -162
@@ -1,241 +0,0 @@
1
- import { mkdirSync, readFileSync, rmSync, statSync, writeFileSync, existsSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { CONFLICT_SUFFIX, hashBytes, listLocalFiles } from "./config";
4
- import { invalidPathReason } from "./path";
5
- import { backUp } from "./reconcile";
6
- import { skillOf } from "./wire";
7
- /** True when a report has nothing in it worth telling anyone. */
8
- export function isQuiet(report) {
9
- return [report.pulled, report.pushed, report.deletedLocally, report.conflicts, report.merged,
10
- report.mergeFailures, report.rejected].every((list) => list.length === 0);
11
- }
12
- /**
13
- * `skills` are the skills this folder has opted into. Everything else in the folder is local to it: never
14
- * pushed, never overwritten, never deleted by a sync.
15
- */
16
- export async function syncOnce(config, folder, state, skills, reconciler) {
17
- const report = {
18
- pulled: [], pushed: [], deletedLocally: [], conflicts: [], merged: [], mergeFailures: [], reconciliations: [],
19
- rejected: [], retry: false,
20
- };
21
- mkdirSync(folder, { recursive: true });
22
- // A skill opted in since last cycle may have server files older than the cursor; re-read from the start.
23
- if ([...skills].some((skill) => !(state.skills ?? []).includes(skill)))
24
- state.cursor = 0;
25
- state.skills = [...skills].sort();
26
- // A skill opted out stops being tracked here. Left in `known`, its files would look deleted from this
27
- // folder and the push would tombstone them on every machine.
28
- for (const path of Object.keys(state.known)) {
29
- if (!skills.has(skillOf(path)))
30
- delete state.known[path];
31
- }
32
- const present = new Set(listLocalFiles(folder, config.exclude).filter((path) => skills.has(skillOf(path))));
33
- const ctx = { config, folder, state, report, reconciler, skills };
34
- /**
35
- * Files deleted here since the last cycle, worked out before anything is fetched.
36
- *
37
- * A push does not advance this machine's cursor, so the next pull sees its own earlier write as news.
38
- * With the file now gone from disk that looked like "remote has it, we do not" and the pull put it
39
- * straight back, undoing the delete every time. Deciding what was deleted up front, and refusing to
40
- * recreate those paths, is what lets the push below turn them into tombstones.
41
- */
42
- const pendingDeletes = new Set(Object.keys(state.known).filter((path) => !present.has(path)));
43
- // `present` is passed through both passes and kept current: the pull removes tombstoned files and adds
44
- // new ones, and a push that read a stale snapshot would try to open a file the pull had just deleted.
45
- await pull(ctx, pendingDeletes, present);
46
- await push(ctx, present);
47
- return report;
48
- }
49
- async function pull(ctx, pendingDeletes, present) {
50
- const { config, folder, state, report } = ctx;
51
- const response = await call(config, `/files?since=${state.cursor}`);
52
- const body = await response.json();
53
- for (const file of body.files) {
54
- // The server is not trusted to supply a path either: one bad row would otherwise write outside the
55
- // skills directory on every machine that syncs.
56
- const badPath = invalidPathReason(file.path);
57
- if (badPath) {
58
- report.rejected.push(`${file.path} (${badPath})`);
59
- continue;
60
- }
61
- // Local to this folder: the server's version is not wanted here.
62
- if (!ctx.skills.has(skillOf(file.path)))
63
- continue;
64
- const local = join(folder, file.path);
65
- // Deleted here and not yet reported; the push pass owns this path for the rest of the cycle.
66
- if (pendingDeletes.has(file.path))
67
- continue;
68
- if (file.deleted) {
69
- if (existsSync(local)) {
70
- // Never destroy content this machine never agreed with the server on. A file written here that
71
- // the server happens to have tombstoned — a fresh machine, or one that was offline through the
72
- // delete — is not the same file, and deleting it silently would lose work nobody could recover.
73
- const localHash = hashBytes(readFileSync(local));
74
- if (localHash !== state.known[file.path]) {
75
- writeFileSync(`${local}${CONFLICT_SUFFIX}`, readFileSync(local));
76
- report.conflicts.push(file.path);
77
- }
78
- rmSync(local, { force: true });
79
- report.deletedLocally.push(file.path);
80
- }
81
- present.delete(file.path);
82
- delete state.known[file.path];
83
- continue;
84
- }
85
- const localHash = existsSync(local) ? hashBytes(readFileSync(local)) : undefined;
86
- if (localHash === file.hash) {
87
- // Already identical — record agreement so the push pass does not treat it as a local edit.
88
- state.known[file.path] = file.hash;
89
- continue;
90
- }
91
- const content = new Uint8Array(await (await call(config, `/content/${file.hash}`)).arrayBuffer());
92
- // Changed here and on the server. Merge the two when possible: the merge is written here, recorded as
93
- // based on the server's copy, and so goes out in this cycle's push.
94
- if (localHash !== undefined && localHash !== state.known[file.path]) {
95
- if (await mergeInto(ctx, file, local, content)) {
96
- present.add(file.path);
97
- continue;
98
- }
99
- // No merge: a local edit we have not pushed yet would be destroyed by overwriting, so it is kept
100
- // beside the incoming copy.
101
- writeFileSync(`${local}${CONFLICT_SUFFIX}`, readFileSync(local));
102
- report.conflicts.push(file.path);
103
- }
104
- mkdirSync(dirname(local), { recursive: true });
105
- writeFileSync(local, content);
106
- state.known[file.path] = file.hash;
107
- present.add(file.path);
108
- report.pulled.push(file.path);
109
- }
110
- state.cursor = body.cursor;
111
- }
112
- /**
113
- * Merges this machine's copy with the server's and writes the result over the local file. False when
114
- * there is no merger, either side is not text, or the merge failed — the caller then keeps `.local`.
115
- */
116
- async function mergeInto(ctx, file, local, remote) {
117
- const { config, folder, state, report, reconciler } = ctx;
118
- if (reconciler === undefined)
119
- return false;
120
- const mine = readFileSync(local);
121
- const localText = asText(mine);
122
- const remoteText = asText(remote);
123
- if (localText === undefined || remoteText === undefined)
124
- return false;
125
- const known = state.known[file.path];
126
- const base = known === undefined ? null : await fetchText(config, known);
127
- const conflict = {
128
- folder,
129
- path: file.path,
130
- local: {
131
- content: localText,
132
- label: `the copy in ${folder} on ${config.machine}, last edited ${statSync(local).mtime.toISOString()}`,
133
- },
134
- remote: {
135
- content: remoteText,
136
- label: `the synced copy, last uploaded by ${file.updatedBy} at ${new Date(file.updatedAt).toISOString()}`,
137
- },
138
- base,
139
- };
140
- backUp(conflict);
141
- reconciler.onMerging?.(file.path);
142
- let resolution;
143
- try {
144
- resolution = await reconciler.merge(conflict);
145
- }
146
- catch (cause) {
147
- const reason = cause instanceof Error ? cause.message : String(cause);
148
- report.mergeFailures.push(`${file.path}: ${reason}`);
149
- report.reconciliations.push({
150
- path: file.path, outcome: "failed",
151
- conflict: "This machine's copy and the server's differ.",
152
- resolution: `Not merged: ${reason}. The server's version was kept and this machine's saved as ${file.path}${CONFLICT_SUFFIX}.`,
153
- });
154
- return false;
155
- }
156
- writeFileSync(local, resolution.merged);
157
- state.known[file.path] = file.hash;
158
- report.merged.push(file.path);
159
- report.reconciliations.push({
160
- path: file.path, outcome: "merged", conflict: resolution.conflict, resolution: resolution.resolution,
161
- });
162
- return true;
163
- }
164
- /** Text only: a merge by a language model is meaningless for an image or a binary, and harmful. */
165
- function asText(bytes) {
166
- if (bytes.length > 512 * 1024 || bytes.includes(0))
167
- return undefined;
168
- try {
169
- return new TextDecoder("utf-8", { fatal: true }).decode(bytes);
170
- }
171
- catch {
172
- return undefined;
173
- }
174
- }
175
- /** The base is a nicety for the merge; if the server no longer has it, merge without one. */
176
- async function fetchText(config, hash) {
177
- try {
178
- return asText(new Uint8Array(await (await call(config, `/content/${hash}`)).arrayBuffer())) ?? null;
179
- }
180
- catch {
181
- return null;
182
- }
183
- }
184
- async function push(ctx, present) {
185
- const { config, folder, state, report } = ctx;
186
- for (const path of present) {
187
- const bytes = readFileSync(join(folder, path));
188
- const hash = hashBytes(bytes);
189
- if (state.known[path] === hash)
190
- continue;
191
- const accepted = await put(config, {
192
- path,
193
- baseHash: state.known[path] ?? null,
194
- hash,
195
- content: Buffer.from(bytes).toString("base64"),
196
- });
197
- if (accepted) {
198
- state.known[path] = hash;
199
- report.pushed.push(path);
200
- }
201
- else {
202
- // Another machine wrote first. Not a conflict yet: the next cycle pulls its version and merges.
203
- report.retry = true;
204
- }
205
- }
206
- // A path we previously agreed on that is no longer on disk was deleted here, and the server needs the
207
- // tombstone or the next machine to sync will upload it back.
208
- for (const path of Object.keys(state.known)) {
209
- if (present.has(path))
210
- continue;
211
- if (await put(config, { path, baseHash: state.known[path], hash: null, content: null })) {
212
- delete state.known[path];
213
- report.pushed.push(`${path} (deleted)`);
214
- }
215
- else {
216
- report.conflicts.push(path);
217
- }
218
- }
219
- }
220
- /** True when the server accepted the write; false means another machine got there first. */
221
- async function put(config, body) {
222
- const response = await fetch(`${config.endpoint}/files`, {
223
- method: "PUT",
224
- headers: { authorization: `Bearer ${config.token}`, "content-type": "application/json" },
225
- body: JSON.stringify({ ...body, machine: config.machine }),
226
- });
227
- if (response.status === 409)
228
- return false;
229
- if (!response.ok)
230
- throw new Error(`PUT /files ${body.path}: ${response.status} ${await response.text()}`);
231
- return true;
232
- }
233
- async function call(config, path) {
234
- const response = await fetch(`${config.endpoint}${path}`, {
235
- headers: { authorization: `Bearer ${config.token}` },
236
- });
237
- if (!response.ok)
238
- throw new Error(`GET ${path}: ${response.status} ${await response.text()}`);
239
- return response;
240
- }
241
- //# sourceMappingURL=sync.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sync.js","sourceRoot":"","sources":["../../../../src/internal/sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC/F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAA2B,MAAM,UAAU,CAAC;AAC/F,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAkC,MAAM,aAAa,CAAC;AACrE,OAAO,EAAE,OAAO,EAA8B,MAAM,QAAQ,CAAC;AA6C7D,iEAAiE;AACjE,MAAM,UAAU,OAAO,CAAC,MAAc;IACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM;QAC1F,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AAC9E,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAC5B,MAAc,EAAE,MAAc,EAAE,KAAY,EAAE,MAA2B,EAAE,UAAuB;IAElG,MAAM,MAAM,GAAW;QACrB,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,cAAc,EA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c,EAAE,IAAY;IAC9C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,MAAM,CAAC,QAAQ,GAAG,IAAI,EAAE,EAAE;QACxD,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,MAAM,CAAC,KAAK,EAAE,EAAE;KACrD,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,QAAQ,CAAC,MAAM,IAAI,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAC9F,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * The shapes the daemon and the service exchange.
3
- *
4
- * Declared in the library and imported by the service so there is one definition rather than two that
5
- * drift. The service depends on the library; nothing goes the other way.
6
- */
7
- /**
8
- * A skill is a top-level entry of a skills folder — usually a directory like `jive/` holding `SKILL.md`
9
- * and its files — and it is the unit of opting in: all of its files sync, or none do, so a skill never
10
- * arrives half-present on another machine.
11
- */
12
- export const skillOf = (path) => path.split("/")[0];
13
- //# sourceMappingURL=wire.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../../../src/internal/wire.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAoCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC"}