@jive-sh/skill-sync 0.4.9 → 0.4.10-latest-darwin-arm64

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 -93
  4. package/bin/package.json +0 -1
  5. package/bin/skill-sync +0 -576
  6. package/bin/skill-sync-daemon +0 -576
  7. package/dist/daemons/skill-sync-daemon.js +0 -463
  8. package/dist/daemons/skill-sync-daemon.js.map +0 -1
  9. package/dist/entrypoints/skill-sync.js +0 -140
  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 -149
  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 -46
  18. package/dist/internal/folders.js.map +0 -1
  19. package/dist/internal/path.js +0 -36
  20. package/dist/internal/path.js.map +0 -1
  21. package/dist/internal/server.js +0 -32
  22. package/dist/internal/server.js.map +0 -1
  23. package/dist/internal/sync.js +0 -162
  24. package/dist/internal/sync.js.map +0 -1
  25. package/dist/internal/usage.js +0 -251
  26. package/dist/internal/usage.js.map +0 -1
  27. package/dist/internal/wire.js +0 -18
  28. package/dist/internal/wire.js.map +0 -1
  29. package/install.cjs +0 -576
  30. package/src/daemons/skill-sync-daemon.ts +0 -457
  31. package/src/entrypoints/skill-sync.ts +0 -143
  32. package/src/index.ts +0 -15
  33. package/src/internal/config.ts +0 -191
  34. package/src/internal/control.ts +0 -127
  35. package/src/internal/folders.ts +0 -49
  36. package/src/internal/path.ts +0 -32
  37. package/src/internal/server.ts +0 -34
  38. package/src/internal/sync.ts +0 -197
  39. package/src/internal/usage.ts +0 -284
  40. package/src/internal/wire.ts +0 -210
@@ -1,251 +0,0 @@
1
- import { closeSync, existsSync, openSync, readdirSync, readFileSync, readSync, statSync } from "node:fs";
2
- import { homedir } from "node:os";
3
- import { join } from "node:path";
4
- import { Result, Schema, SchemaIssue } from "effect";
5
- import { isLock } from "./config";
6
- /** `~/.claude`, `~/.claude-<name>`, `~/.codex` and `~/.codex-<name>`: every account folder in `home`. */
7
- export function detectAccounts(home = homedir()) {
8
- return readdirSync(home)
9
- .filter((entry) => !isLock(entry))
10
- .flatMap((entry) => {
11
- const tool = entry === ".claude" || entry.startsWith(".claude-") ? "claude"
12
- : entry === ".codex" || entry.startsWith(".codex-") ? "codex"
13
- : undefined;
14
- if (tool === undefined)
15
- return [];
16
- const path = join(home, entry);
17
- return isDirectory(path) ? [{ tool, path }] : [];
18
- })
19
- .sort((a, b) => a.path.localeCompare(b.path));
20
- }
21
- /** Every account on this machine with its usage. One account's unreadable file never hides another's. */
22
- export function readUsage(home = homedir()) {
23
- return detectAccounts(home).map((account) => {
24
- const name = account.path.slice(home.length).replace(/^[\\/]/, "");
25
- let reading;
26
- try {
27
- reading = account.tool === "claude" ? readClaude(account.path, home) : readCodex(account.path);
28
- }
29
- catch (cause) {
30
- reading = { state: "unknown", reason: `could not read: ${cause instanceof Error ? cause.message : String(cause)}` };
31
- }
32
- return { tool: account.tool, home: name, ...reading };
33
- });
34
- }
35
- function isDirectory(path) {
36
- try {
37
- return statSync(path).isDirectory();
38
- }
39
- catch {
40
- return false;
41
- }
42
- }
43
- const formatIssue = SchemaIssue.makeFormatterDefault();
44
- /** A record that failed to decode: what failed, on one line, so the dashboard can say why it shows nothing. */
45
- const unknown = (what, issue) => ({ state: "unknown", reason: `${what} changed shape: ${formatIssue(issue).replace(/\s+/g, " ").slice(0, 160)}` });
46
- // ── Claude ──────────────────────────────────────────────────────────────────────────────────────────
47
- /**
48
- * The default account keeps its state in `~/.claude.json`, beside its folder rather than in it; an
49
- * account given its own `CLAUDE_CONFIG_DIR` keeps it inside that folder.
50
- */
51
- export function claudeStatePath(accountPath, home) {
52
- return accountPath === join(home, ".claude") ? join(home, ".claude.json") : join(accountPath, ".claude.json");
53
- }
54
- function readClaude(accountPath, home) {
55
- const path = claudeStatePath(accountPath, home);
56
- return existsSync(path) ? parseClaudeState(readFileSync(path, "utf-8")) : { state: "none" };
57
- }
58
- const ClaudeWindow = Schema.Struct({ utilization: Schema.Finite, resets_at: Schema.NullOr(Schema.String) });
59
- const ClaudeMoney = Schema.Struct({ amount_minor: Schema.Finite, currency: Schema.String, exponent: Schema.Int });
60
- const ClaudeUsageCache = Schema.Struct({
61
- fetchedAtMs: Schema.Finite,
62
- utilization: Schema.Struct({
63
- five_hour: Schema.optionalKey(Schema.NullOr(ClaudeWindow)),
64
- seven_day: Schema.optionalKey(Schema.NullOr(ClaudeWindow)),
65
- // Usage credits, the account's spend beyond its plan limits. `limit` has only been seen as null, so a
66
- // limit in another shape is left out rather than failing the whole reading.
67
- spend: Schema.optionalKey(Schema.NullOr(Schema.Struct({ enabled: Schema.Boolean, used: ClaudeMoney, limit: Schema.Unknown }))),
68
- }),
69
- });
70
- /** Claude's documented window lengths: its status line calls them the 5-hour and 7-day limits. */
71
- const CLAUDE_WINDOWS = [["five_hour", 300], ["seven_day", 7 * 24 * 60]];
72
- /** Reads the usage Claude Code cached in an account's `.claude.json`. */
73
- export function parseClaudeState(text) {
74
- let state;
75
- try {
76
- state = JSON.parse(text);
77
- }
78
- catch {
79
- // Claude Code rewrites the file while it runs; a half-written one reads fine a moment later.
80
- return { state: "unknown", reason: "the account's .claude.json is not valid JSON" };
81
- }
82
- if (typeof state !== "object" || state === null || !("cachedUsageUtilization" in state))
83
- return { state: "none" };
84
- const decoded = Schema.decodeUnknownResult(ClaudeUsageCache)(state.cachedUsageUtilization);
85
- if (Result.isFailure(decoded))
86
- return unknown("Claude Code's usage cache", decoded.failure.issue);
87
- const cache = decoded.success;
88
- const windows = [];
89
- for (const [key, minutes] of CLAUDE_WINDOWS) {
90
- const window = cache.utilization[key];
91
- if (window === undefined || window === null)
92
- continue;
93
- const resetsAt = window.resets_at === null ? null : Date.parse(window.resets_at);
94
- if (resetsAt !== null && !Number.isFinite(resetsAt)) {
95
- return { state: "unknown", reason: `Claude Code's usage cache changed shape: ${key}.resets_at is not a time` };
96
- }
97
- windows.push({ minutes, usedPercent: window.utilization, resetsAt });
98
- }
99
- const spend = cache.utilization.spend;
100
- const limit = Schema.decodeUnknownOption(ClaudeMoney)(spend?.limit);
101
- return {
102
- state: "reading",
103
- asOf: cache.fetchedAtMs,
104
- windows,
105
- ...(spend?.enabled === true
106
- ? { spent: { used: money(spend.used), limit: limit._tag === "Some" ? money(limit.value) : null } }
107
- : {}),
108
- };
109
- }
110
- const money = (value) => ({ amountMinor: value.amount_minor, currency: value.currency, exponent: value.exponent });
111
- // ── Codex ───────────────────────────────────────────────────────────────────────────────────────────
112
- const CodexWindow = Schema.Struct({
113
- used_percent: Schema.Finite,
114
- window_minutes: Schema.NullOr(Schema.Finite),
115
- resets_at: Schema.NullOr(Schema.Finite),
116
- });
117
- const CodexTokenCount = Schema.Struct({
118
- timestamp: Schema.String,
119
- payload: Schema.Struct({
120
- type: Schema.Literal("token_count"),
121
- rate_limits: Schema.NullOr(Schema.Struct({
122
- limit_id: Schema.optionalKey(Schema.NullOr(Schema.String)),
123
- primary: Schema.NullOr(CodexWindow),
124
- secondary: Schema.NullOr(CodexWindow),
125
- })),
126
- }),
127
- });
128
- /** Session files newest first; only this many are searched for a reading before giving up. */
129
- const CODEX_FILES_SEARCHED = 5;
130
- /** How far back from its end a session file is searched. Each turn writes one event, so the last is near the end. */
131
- const CODEX_TAIL_BYTES = 16 * 1024 * 1024;
132
- function readCodex(accountPath) {
133
- const files = sessionFiles(join(accountPath, "sessions"))
134
- .map((path) => ({ path, modifiedAt: statSync(path).mtimeMs }))
135
- .sort((a, b) => b.modifiedAt - a.modifiedAt)
136
- .slice(0, CODEX_FILES_SEARCHED);
137
- // The most recently written file holds the latest event; an older one only matters when the newer
138
- // ones hold none, as for a session run with an API key, which has no plan limits to report.
139
- for (const { path } of files) {
140
- const reading = latestCodexReading(path);
141
- if (reading.state !== "none")
142
- return reading;
143
- }
144
- return { state: "none" };
145
- }
146
- /** Every `rollout-*.jsonl` under `sessions/`, which Codex files by date: `YYYY/MM/DD/rollout-….jsonl`. */
147
- function sessionFiles(dir) {
148
- if (!isDirectory(dir))
149
- return [];
150
- return readdirSync(dir, { recursive: true, encoding: "utf-8" })
151
- .filter((path) => /(^|[\\/])rollout-[^\\/]*\.jsonl$/.test(path))
152
- .map((path) => join(dir, path));
153
- }
154
- /** The last rate-limit reading in one session file, searched from the end, since files reach hundreds of MB. */
155
- export function latestCodexReading(path) {
156
- for (const line of linesFromEnd(path, CODEX_TAIL_BYTES)) {
157
- const reading = parseCodexLine(line);
158
- if (reading !== undefined)
159
- return reading;
160
- }
161
- return { state: "none" };
162
- }
163
- /**
164
- * The reading one session-file line carries, or undefined when it carries none: most lines are other
165
- * events, and a `token_count` from a session without plan limits has `rate_limits: null`.
166
- */
167
- export function parseCodexLine(line) {
168
- // Cheap test first: only these lines are worth parsing, and the others can be megabytes.
169
- if (!line.includes("\"token_count\""))
170
- return undefined;
171
- let event;
172
- try {
173
- event = JSON.parse(line);
174
- }
175
- catch {
176
- return undefined; // The last line of a file Codex is still writing.
177
- }
178
- if (!isTokenCount(event))
179
- return undefined;
180
- const decoded = Schema.decodeUnknownResult(CodexTokenCount)(event);
181
- if (Result.isFailure(decoded))
182
- return unknown("Codex's rate-limit record", decoded.failure.issue);
183
- const limits = decoded.success.payload.rate_limits;
184
- // Another metered bucket than the main one; the main one is `codex`, or unnamed in older versions.
185
- if (limits === null || (limits.limit_id !== undefined && limits.limit_id !== null && limits.limit_id !== "codex"))
186
- return undefined;
187
- const asOf = Date.parse(decoded.success.timestamp);
188
- if (!Number.isFinite(asOf))
189
- return { state: "unknown", reason: "Codex's rate-limit record changed shape: timestamp is not a time" };
190
- return {
191
- state: "reading",
192
- asOf,
193
- windows: [limits.primary, limits.secondary].flatMap((window) => window === null ? [] : [{
194
- minutes: window.window_minutes,
195
- usedPercent: window.used_percent,
196
- resetsAt: window.resets_at === null ? null : window.resets_at * 1000,
197
- }]),
198
- };
199
- }
200
- const isTokenCount = (event) => typeof event === "object" && event !== null && "payload" in event
201
- && typeof event.payload === "object" && event.payload !== null
202
- && "type" in event.payload && event.payload.type === "token_count";
203
- /**
204
- * A file's whole lines, last first, reading at most `limit` bytes back from its end. Lines longer than
205
- * `maxLine` bytes are skipped: holding a multi-megabyte line while reading backwards would copy it once
206
- * per chunk read, and the lines wanted here are a few hundred bytes.
207
- */
208
- export function* linesFromEnd(path, limit, maxLine = 1024 * 1024) {
209
- const CHUNK = 64 * 1024;
210
- const fd = openSync(path, "r");
211
- try {
212
- const size = statSync(path).size;
213
- const stop = Math.max(0, size - limit);
214
- let position = size;
215
- // The start of a line whose line break has not been read yet, since reading goes backwards.
216
- let carry = Buffer.alloc(0);
217
- // The line being read is longer than `maxLine`; its bytes are dropped until its start is found.
218
- let oversized = false;
219
- while (position > stop) {
220
- const length = Math.min(CHUNK, position - stop);
221
- position -= length;
222
- const chunk = Buffer.alloc(length);
223
- readSync(fd, chunk, 0, length, position);
224
- const buffer = Buffer.concat([chunk, carry]);
225
- // Splitting on the newline byte is safe in UTF-8: it never occurs inside a multi-byte character.
226
- let end = buffer.length;
227
- for (let index = buffer.length - 1; index >= 0; index--) {
228
- if (buffer[index] !== 0x0a)
229
- continue;
230
- const line = buffer.subarray(index + 1, end).toString("utf-8").trim();
231
- if (!oversized && line !== "")
232
- yield line;
233
- oversized = false;
234
- end = index;
235
- }
236
- carry = buffer.subarray(0, end);
237
- if (carry.length > maxLine) {
238
- carry = Buffer.alloc(0);
239
- oversized = true;
240
- }
241
- }
242
- // The file's first line. When the search stopped short of the start, what is left is part of a line.
243
- const first = carry.toString("utf-8").trim();
244
- if (stop === 0 && !oversized && first !== "")
245
- yield first;
246
- }
247
- finally {
248
- closeSync(fd);
249
- }
250
- }
251
- //# sourceMappingURL=usage.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage.js","sourceR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AK,CAAC,CAAC,CAAC,CAAC;gBACxB,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;QACH,CAAC;QACD,qGAAqG;QACrG,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC;QAC7C,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,IAAI,KAAK,KAAK,EAAE;YAAE,MAAM,KAAK,CAAC;IAC5D,CAAC;YAAS,CAAC;QACT,SAAS,CAAC,EAAE,CAAC,CAAC;IAChB,CAAC;AACH,CAAC"}
@@ -1,18 +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
- /**
14
- * The header a daemon names its own version in when it opens its WebSocket to the hub, so the dashboard
15
- * can show which version each machine runs. Daemons before 0.4.6 do not send it.
16
- */
17
- export const DAEMON_VERSION_HEADER = "x-skill-sync-version";
18
- //# sourceMappingURL=wire.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"wire.js","sourceRoot":"","sources":["../../../../src/internal/wire.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH;;;;GAIG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAY,EAAU,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE,CAAC;AA2CrE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,sBAAsB,CAAC"}