@jive-sh/skill-sync 0.10.2-latest-darwin-x64 → 0.10.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 (152) hide show
  1. package/README.md +214 -0
  2. package/bin/package.json +1 -0
  3. package/bin/skill-sync +34 -0
  4. package/bin/skill-sync-daemon +34 -0
  5. package/dist/daemons/skill-sync-daemon.js +642 -0
  6. package/dist/daemons/skill-sync-daemon.js.map +1 -0
  7. package/dist/entrypoints/skill-sync.js +7 -0
  8. package/dist/entrypoints/skill-sync.js.map +1 -0
  9. package/dist/index.js +10 -0
  10. package/dist/index.js.map +1 -0
  11. package/dist/internal/agents/agent-tool.js +102 -0
  12. package/dist/internal/agents/agent-tool.js.map +1 -0
  13. package/dist/internal/agents/claude.js +424 -0
  14. package/dist/internal/agents/claude.js.map +1 -0
  15. package/dist/internal/agents/codex.js +270 -0
  16. package/dist/internal/agents/codex.js.map +1 -0
  17. package/dist/internal/agents/command.js +219 -0
  18. package/dist/internal/agents/command.js.map +1 -0
  19. package/dist/internal/agents/grok.js +170 -0
  20. package/dist/internal/agents/grok.js.map +1 -0
  21. package/dist/internal/agents/index.js +70 -0
  22. package/dist/internal/agents/index.js.map +1 -0
  23. package/dist/internal/cli.js +185 -0
  24. package/dist/internal/cli.js.map +1 -0
  25. package/dist/internal/config.js +131 -0
  26. package/dist/internal/config.js.map +1 -0
  27. package/dist/internal/control.js +113 -0
  28. package/dist/internal/control.js.map +1 -0
  29. package/dist/internal/daemon-control/impl.js +68 -0
  30. package/dist/internal/daemon-control/impl.js.map +1 -0
  31. package/dist/internal/daemon-control/interface.js +4 -0
  32. package/dist/internal/daemon-control/interface.js.map +1 -0
  33. package/dist/internal/folders.js +47 -0
  34. package/dist/internal/folders.js.map +1 -0
  35. package/dist/internal/local-skills.js +43 -0
  36. package/dist/internal/local-skills.js.map +1 -0
  37. package/dist/internal/path.js +36 -0
  38. package/dist/internal/path.js.map +1 -0
  39. package/dist/internal/server.js +80 -0
  40. package/dist/internal/server.js.map +1 -0
  41. package/dist/internal/skill-check.js +83 -0
  42. package/dist/internal/skill-check.js.map +1 -0
  43. package/dist/internal/skill-refinement/evals/cases.js +143 -0
  44. package/dist/internal/skill-refinement/evals/cases.js.map +1 -0
  45. package/dist/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
  46. package/dist/internal/skill-refinement/evals/opus-judge-original.json +165 -0
  47. package/dist/internal/skill-refinement/feedback/import-legacy.js +13 -0
  48. package/dist/internal/skill-refinement/feedback/import-legacy.js.map +1 -0
  49. package/dist/internal/skill-refinement/feedback/intake.js +52 -0
  50. package/dist/internal/skill-refinement/feedback/intake.js.map +1 -0
  51. package/dist/internal/skill-refinement/feedback/managed-intake.js +19 -0
  52. package/dist/internal/skill-refinement/feedback/managed-intake.js.map +1 -0
  53. package/dist/internal/skill-refinement/feedback/outbox.js +44 -0
  54. package/dist/internal/skill-refinement/feedback/outbox.js.map +1 -0
  55. package/dist/internal/skill-refinement/jev/impl.js +63 -0
  56. package/dist/internal/skill-refinement/jev/impl.js.map +1 -0
  57. package/dist/internal/skill-refinement/jev/interface.js +6 -0
  58. package/dist/internal/skill-refinement/jev/interface.js.map +1 -0
  59. package/dist/internal/skill-refinement/managed-daemon.js +30 -0
  60. package/dist/internal/skill-refinement/managed-daemon.js.map +1 -0
  61. package/dist/internal/skill-refinement/managed-worker-credentials.js +60 -0
  62. package/dist/internal/skill-refinement/managed-worker-credentials.js.map +1 -0
  63. package/dist/internal/skill-refinement/managed-worker-files.js +25 -0
  64. package/dist/internal/skill-refinement/managed-worker-files.js.map +1 -0
  65. package/dist/internal/skill-refinement/managed-worker-loop.js +36 -0
  66. package/dist/internal/skill-refinement/managed-worker-loop.js.map +1 -0
  67. package/dist/internal/skill-refinement/organization-site.js +13 -0
  68. package/dist/internal/skill-refinement/organization-site.js.map +1 -0
  69. package/dist/internal/skill-refinement/paths.js +62 -0
  70. package/dist/internal/skill-refinement/paths.js.map +1 -0
  71. package/dist/internal/skill-refinement/platform.js +67 -0
  72. package/dist/internal/skill-refinement/platform.js.map +1 -0
  73. package/dist/internal/skill-refinement/service.js +356 -0
  74. package/dist/internal/skill-refinement/service.js.map +1 -0
  75. package/dist/internal/skill-refinement/skills/skill-text.js +217 -0
  76. package/dist/internal/skill-refinement/skills/skill-text.js.map +1 -0
  77. package/dist/internal/skill-refinement/workflow/retry.js +44 -0
  78. package/dist/internal/skill-refinement/workflow/retry.js.map +1 -0
  79. package/dist/internal/skill-refinement/workflow/skill-refinement.js +668 -0
  80. package/dist/internal/skill-refinement/workflow/skill-refinement.js.map +1 -0
  81. package/dist/internal/skill-refinement/writer/impl.js +2 -0
  82. package/dist/internal/skill-refinement/writer/impl.js.map +1 -0
  83. package/dist/internal/skill-refinement/writer/interface.js +2 -0
  84. package/dist/internal/skill-refinement/writer/interface.js.map +1 -0
  85. package/dist/internal/sync.js +182 -0
  86. package/dist/internal/sync.js.map +1 -0
  87. package/dist/internal/wire.js +31 -0
  88. package/dist/internal/wire.js.map +1 -0
  89. package/dist/internal/writer/claude.js +84 -0
  90. package/dist/internal/writer/claude.js.map +1 -0
  91. package/dist/internal/writer/codex.js +102 -0
  92. package/dist/internal/writer/codex.js.map +1 -0
  93. package/dist/internal/writer/interface.js +6 -0
  94. package/dist/internal/writer/interface.js.map +1 -0
  95. package/dist/internal/writer/live.js +13 -0
  96. package/dist/internal/writer/live.js.map +1 -0
  97. package/dist/internal/writer/reset.js +38 -0
  98. package/dist/internal/writer/reset.js.map +1 -0
  99. package/dist/internal/writer/selection.js +79 -0
  100. package/dist/internal/writer/selection.js.map +1 -0
  101. package/package.json +45 -11
  102. package/postinstall.cjs +663 -0
  103. package/src/daemons/skill-sync-daemon.ts +647 -0
  104. package/src/entrypoints/skill-sync.ts +12 -0
  105. package/src/index.ts +15 -0
  106. package/src/internal/agents/agent-tool.ts +149 -0
  107. package/src/internal/agents/claude.ts +442 -0
  108. package/src/internal/agents/codex.ts +288 -0
  109. package/src/internal/agents/command.ts +257 -0
  110. package/src/internal/agents/grok.ts +174 -0
  111. package/src/internal/agents/index.ts +74 -0
  112. package/src/internal/cli.ts +217 -0
  113. package/src/internal/config.ts +172 -0
  114. package/src/internal/control.ts +157 -0
  115. package/src/internal/daemon-control/impl.ts +80 -0
  116. package/src/internal/daemon-control/interface.ts +40 -0
  117. package/src/internal/folders.ts +50 -0
  118. package/src/internal/local-skills.ts +58 -0
  119. package/src/internal/path.ts +32 -0
  120. package/src/internal/server.ts +76 -0
  121. package/src/internal/skill-check.ts +97 -0
  122. package/src/internal/skill-refinement/evals/cases.ts +167 -0
  123. package/src/internal/skill-refinement/evals/opus-action-judge-original.json +350 -0
  124. package/src/internal/skill-refinement/evals/opus-judge-original.json +165 -0
  125. package/src/internal/skill-refinement/feedback/import-legacy.ts +16 -0
  126. package/src/internal/skill-refinement/feedback/intake.ts +66 -0
  127. package/src/internal/skill-refinement/feedback/managed-intake.ts +19 -0
  128. package/src/internal/skill-refinement/feedback/outbox.ts +50 -0
  129. package/src/internal/skill-refinement/jev/impl.ts +76 -0
  130. package/src/internal/skill-refinement/jev/interface.ts +56 -0
  131. package/src/internal/skill-refinement/managed-daemon.ts +38 -0
  132. package/src/internal/skill-refinement/managed-worker-credentials.ts +59 -0
  133. package/src/internal/skill-refinement/managed-worker-files.ts +24 -0
  134. package/src/internal/skill-refinement/managed-worker-loop.ts +46 -0
  135. package/src/internal/skill-refinement/organization-site.ts +15 -0
  136. package/src/internal/skill-refinement/paths.ts +87 -0
  137. package/src/internal/skill-refinement/platform.ts +71 -0
  138. package/src/internal/skill-refinement/service.ts +413 -0
  139. package/src/internal/skill-refinement/skills/skill-text.ts +290 -0
  140. package/src/internal/skill-refinement/workflow/retry.ts +61 -0
  141. package/src/internal/skill-refinement/workflow/skill-refinement.ts +756 -0
  142. package/src/internal/skill-refinement/writer/impl.ts +1 -0
  143. package/src/internal/skill-refinement/writer/interface.ts +1 -0
  144. package/src/internal/sync.ts +216 -0
  145. package/src/internal/wire.ts +439 -0
  146. package/src/internal/writer/claude.ts +98 -0
  147. package/src/internal/writer/codex.ts +93 -0
  148. package/src/internal/writer/interface.ts +48 -0
  149. package/src/internal/writer/live.ts +19 -0
  150. package/src/internal/writer/reset.ts +34 -0
  151. package/src/internal/writer/selection.ts +84 -0
  152. package/multi-call-binary +0 -4
package/README.md ADDED
@@ -0,0 +1,214 @@
1
+ # @jive-sh/skill-sync
2
+
3
+ Keeps the skills you choose identical across every Claude, Codex and Grok skills folder on every machine
4
+ you work on.
5
+
6
+ A daemon finds each agent home on the machine (Claude's `~/.claude` and every `~/.claude-<name>`, Grok's
7
+ `~/.grok` and every `~/.grok-<name>` (each a `GROK_HOME`), and Codex's `~/.agents`, counted as soon as
8
+ either `~/.agents` or `~/.codex` exists; anything named `*.lock` is
9
+ another program's lock and is ignored, as a home and as a file or folder inside a skills folder) and syncs the `skills`
10
+ folder in each through a Cloudflare Worker: file index in D1, contents in R2 addressed by hash. `skill-sync login` asks the daemon to sign in and prints a
11
+ `skill-sync.jive.sh` page, opening it in your browser when the machine has one. You approve there with your
12
+ jive.sh passkey (from any passkey manager, such as Google Password Manager), on that computer or any other,
13
+ such as your phone, so a server with no browser signs in the same way. The daemon then collects a per-machine
14
+ token from the service with a secret only it holds, never through the CLI or the page. The daemon keeps it in `~/.jive/skill-sync-token.json` and starts syncing, and it
15
+ stays signed in through restarts, reboots and upgrades until you run `skill-sync logout` or revoke the
16
+ token.
17
+
18
+ ```
19
+ skill-sync login sign this machine in with your passkey; the daemon starts syncing
20
+ skill-sync logout revoke this machine's token and stop syncing
21
+ skill-sync list list the skills that sync, as the server holds them (needs a sign-in)
22
+ skill-sync add <skill> put a skill on the synced list, as ticking it on the dashboard does
23
+ skill-sync show <skill> print a synced skill's description and where its copies are on this machine
24
+ skill-sync feedback <slug> <file> hand one feedback item to this machine's skill refinement workflow
25
+ skill-sync upgrade upgrade with the package manager that installed it
26
+ skill-sync version print the installed version
27
+ ```
28
+
29
+ Tab completes every command. After `show` it lists the synced skills and after `add` the skills in the
30
+ detected folders that `add` would accept and that are not synced yet, both asked of the daemon when Tab is
31
+ pressed. Tab never starts the daemon: when none is running, or it does not answer within 3 seconds, Tab shows why
32
+ instead. Installing or upgrading turns Tab completion on in your shell; `skill-sync --remove-completion` turns
33
+ it off.
34
+
35
+ Everything else — which folders sync, unticking skills, renaming computers — is on the
36
+ dashboard.
37
+
38
+ ## Adding a skill from an agent
39
+
40
+ An agent that writes a new skill meant for every project runs `skill-sync add <skill>` in the same step,
41
+ so nobody has to tick it. `<skill>` is the skill's folder name. Running it again changes nothing. It is
42
+ refused, with the reason, unless:
43
+
44
+ - the skill is in a folder skill-sync detects (above). A skill in a project's own `.claude/skills`,
45
+ `.agents/skills` or `.grok/skills` is specific to that project and never syncs. That is the only sign of
46
+ a project-specific skill skill-sync can read; one written into a home folder but about one project is
47
+ not caught.
48
+ - its `SKILL.md` starts with frontmatter whose `name` is the folder name and whose `description` is not
49
+ empty.
50
+ - the name is lowercase letters and digits in hyphen-joined words, at most 64 characters.
51
+
52
+ The skill's files upload from the folders holding it that are ticked on the dashboard; if none is, the
53
+ command says so.
54
+
55
+ The daemon registers itself to start at login when the package is installed. It also keeps skill-sync up
56
+ to date: every 5 minutes it asks the package manager that installed it (bun, pnpm, yarn or npm, with that
57
+ manager's own registry settings) whether a newer version is published, installs it the same way, and
58
+ restarts on it, still signed in. `skill-sync upgrade` does the same at once.
59
+
60
+ ## The dashboard
61
+
62
+ `https://skill-sync.jive.sh/` shows, live, the latest version published on npm, and three tabs (the address keeps the
63
+ one open, `#accounts`, `#computers` or `#refinement`):
64
+
65
+ - **Accounts**: a table with one row per Claude, Codex and Grok account on the running computers.
66
+ An account its tool can name (Claude's organization, Codex's email) is one row however many computers use
67
+ it. Each limit gets a column with the share used and the time to its reset; then each computer's own use of
68
+ the account over the last 30 days, and when the limits were read. See [Account usage](#account-usage).
69
+ - **Skills & computers**: the synced skills, with the shared version of each and where it was last edited; then each
70
+ machine (renameable), whether its daemon is running and which version it runs, and its skills folders, one line
71
+ each with its checkbox, state and counts (synced, not synced, and how many synced skills differ here). Opening a
72
+ folder lists its skills and their files. A daemon older than the published version is marked "update pending"; it
73
+ upgrades itself within 5 minutes.
74
+ - **Skill refinement**: each machine's skill refinement workflow (below), drawn by
75
+ [`@jive-sh/workflow-platform`](https://www.npmjs.com/package/@jive-sh/workflow-platform)'s own dashboard: its queue,
76
+ where each run is and every step's tokens, spend and time over the last day, with − / + for its run and agent limits,
77
+ which go to that machine's daemon. An offline machine shows what it last reported; one that runs no workflow says why;
78
+ one whose last report came from skill-sync before 0.8.0, on the platform's older report shape, says to upgrade it.
79
+
80
+ Every file shows the first 8 characters of its SHA-256, amber when a folder's copy differs from the synced
81
+ one. The page reloads itself when a new version of the service is deployed.
82
+
83
+ The server holds one list of skills to sync. Every enabled folder on every machine pushes and pulls
84
+ exactly the skills on that list, and never touches any other skill. A skill's checkbox adds it to the
85
+ list or removes it, for every machine at once. A folder's checkbox turns syncing on or off for that
86
+ folder; a folder seen for the first time starts off, so nothing is written into a folder until you tick it. Both are stored on the server, so they apply at once
87
+ and survive a reinstall.
88
+
89
+ A folder that lacks a listed skill gets a copy. Deleting a listed skill in any folder deletes it in every
90
+ folder and takes it off the list; unticking it instead stops syncing and leaves every copy where it is.
91
+
92
+ ## The latest edit wins
93
+
94
+ Every file carries the time it was last edited: on a machine, its modification time; on the server, the
95
+ edit time of the version it holds. Whenever two copies of a file differ, the one edited later replaces
96
+ the other, on the server and in every folder. Nothing is merged and nothing is set aside. A deletion
97
+ counts as an edit made when the daemon noticed it.
98
+
99
+ Edit times come from each machine's clock, so a machine whose clock is far off can win or lose against
100
+ edits it should not.
101
+
102
+ ## Account usage
103
+
104
+ An account is a folder in your home directory: `~/.claude` and each `~/.claude-<name>` for Claude (each a
105
+ `CLAUDE_CONFIG_DIR`), `~/.codex` and each `~/.codex-<name>` for Codex (each a `CODEX_HOME`), `~/.grok` and each
106
+ `~/.grok-<name>` for Grok (each a `GROK_HOME`). The daemon reads two things about each, and sends them to the
107
+ dashboard when they change.
108
+
109
+ **The account's limits**, which its provider counts across every computer. The daemon asks the tool's own CLI,
110
+ at most every five minutes per account. The CLI is signed in to the account and makes the call; skill-sync
111
+ reads no credential file, and only the numbers and the account's email leave the machine.
112
+
113
+ - **Claude**: `claude auth status` (who is signed in) and `claude -p /usage --no-session-persistence` (the
114
+ session, weekly and per-model weekly limits). Neither starts a model turn, and the second saves no session.
115
+ Usage credits spent beyond the plan are not in `/usage`'s output, so they show only when the CLI could not be
116
+ asked (below).
117
+ - **Codex**: `codex app-server`, the JSON-RPC interface Codex's editors and desktop app use: `account/read` and
118
+ `account/rateLimits/read`.
119
+ - **Grok**: `grok agent stdio`, asked `_x.ai/billing`, the request Grok's own `/usage` screen makes. Grok has no
120
+ command that says who is signed in, so its accounts show as unidentified.
121
+
122
+ The daemon runs with the service manager's PATH, not your shell's, so it looks for `claude` and `codex` on PATH,
123
+ then in the folders installers put them in (`~/.local/bin`, `~/.bun/bin`, npm's and nvm's global folders,
124
+ Homebrew's), then, for Codex, inside the ChatGPT and Codex desktop apps and Codex's editor extension (VS Code,
125
+ Cursor or Windsurf, locally or on a machine they reach over SSH), which each ship one. When a CLI is not found
126
+ or fails, the limits are what the tool last recorded on this machine, and the dashboard's hover on their age
127
+ says so and why: for Claude, the plan usage it keeps in the account's `.claude.json`; for Codex, the limits it
128
+ recorded with its latest turn in its session files. Those are as old as the tool's last use of the account. An
129
+ account using Amazon Bedrock or an API key has no plan limits.
130
+
131
+ **This machine's use** of the account over the last 30 days, from the files the tool writes:
132
+
133
+ - **Claude**: Claude Code's own estimate of each session's cost at list price, which it saves in the session's
134
+ file under `projects/` when the session ends, is cleared, resumed or forked, summed over sessions active in
135
+ the period (Claude Code deletes older session files by default). A running session counts as of its last
136
+ save, and your provider's bill can differ from list price. The row says Bedrock when the account's
137
+ `settings.json` sets `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_MANTLE` in its `env`, or its sessions used
138
+ Bedrock model IDs.
139
+ - **Codex**: the tokens its sessions active in the period used, cached input included, from the running total
140
+ Codex records in its session files.
141
+ - **Grok**: what `grok usage <session-id>` reports, summed over sessions active in the period. A session's
142
+ totals include history it inherited by resume or fork, so a fork counts that part twice.
143
+
144
+ The daemon sends each session's figure with the session's id, and the dashboard counts every session once. A
145
+ session found on several computers, because its files were copied or synced between them, counts on the computer
146
+ where it was last active, so a session resumed elsewhere moves there with its whole cost. When the computers agree
147
+ on that time, as they do for copied files, it counts on the computer that reported it first, which is where it ran.
148
+
149
+ A limit whose reset time has passed since the reading shows no number, since the new window's use is not known
150
+ yet. None of these outputs is a published format: when a tool changes one, the row says "unknown" and why,
151
+ rather than showing a wrong number. Daemons before 0.7.0 send usage in a shape the dashboard no longer takes,
152
+ so their accounts are not shown until they upgrade themselves.
153
+
154
+ ## Skill refinement
155
+
156
+ The daemon runs the `autonomous-skill-refinement` skill's workflow: each feedback item an agent hands over becomes a
157
+ tested change to the synced skills, installed into this machine's skills folder, which then syncs everywhere. The
158
+ skill's `SKILL.md` holds the rules each step follows; the workflow itself is in `src/internal/skill-refinement/`.
159
+
160
+ - **Handing feedback over:** `skill-sync feedback <slug> <file>`, a few words naming the item and a file holding his
161
+ exact words and what drew them. The daemon adds it to the workflow's intake and the next run takes it.
162
+ - **Where it works from:** the copy of the skill in an agent account folder (`~/.claude-alex/skills/…`): the one in
163
+ `SKILL_REFINEMENT_CLAUDE_CONFIG_DIR` when that is set, else the one whose `.local/` already holds the workflow's
164
+ database, else the first Claude account's. Its `.local/` holds the queue, run files and databases; skill-sync never
165
+ syncs a name starting with a dot, so they stay on the machine. The intakes of every copy on the machine are read.
166
+ - **Models:** Jev, with the key in `TYPESAFE_API_KEY` or the skill folder's `typesafe-api-key` file, classifies and
167
+ judges; Opus drafts and writes the A/B replies through the `claude` CLI, found as for account usage, on the account
168
+ that holds the copy.
169
+ - **Taking over from another runner:** while another live process runs the workflow on the same data (the
170
+ `skill-refinement.service` a machine had before, or a copy started by hand), the daemon waits and checks every
171
+ minute, so stopping that process hands the work over. It reads that from the engine's own runner records.
172
+ - **Managed worker:** the daemon asks the sibling Jive daemon for short-lived grants for the configured `jive-sh`
173
+ deployment. Before cutover, a machine without a grant keeps feedback in its local intake. The worker bundles the
174
+ managed workflow with its own runtime, so the local picker uses workflow-platform 0.7 and its existing SQLite files. A confirmed
175
+ managed installation of feedback acknowledged to this machine allows it to drain active local runs and copy the
176
+ pending intake into the managed outbox in one transaction. The original intake files and SQLite history stay on
177
+ the machine.
178
+ - **The platform's own workflow beside it:** the daemon also runs workflow-platform's Retention every hour, first 5
179
+ minutes after it starts. It deletes a finished run's step records once they are 7 days old and none of their step's
180
+ newest 10,000 runs, so a machine's refinement history is kept whole until it passes 10,000 runs.
181
+ - **When a failed item runs again:** an item whose run ends without an install waits until something it runs on
182
+ changes (its text, a skill, Draft or the judge). A failure of a service outside it changes none of those, so it carries
183
+ a retry time instead: a Claude usage limit at the reset its message states (an hour on when it states none), any other
184
+ failure of Jev or the generative model an hour on. The daemon checks every minute and runs the item again once that
185
+ time passes, once per failure (`src/internal/skill-refinement/workflow/retry.ts`). A run Claude or Jev could not do at
186
+ all (a usage or rate limit, an overload, Jev unreachable, a 408, 429 or 5xx from it, or the model unknown to it) fails
187
+ with the workflow platform's `OutsideServiceUnavailable`, so it is no try toward the platform's block after 10 failed
188
+ tries; any other failure of either is one.
189
+ - **Edits made while a run works:** a run takes minutes, and the skill it changes can be edited meanwhile, by hand or
190
+ by another machine's install pulled here. Install applies the winner's exact replacements to the skill's text as it
191
+ is then, so every edit outside the lines the winner replaces is kept, and runs the rule-deletion check again on that
192
+ text. It first waits up to two minutes for this copy to pull an edit the server lists but this copy lacks, and writes
193
+ only if the text is still the one it built on; an edit landing during the write, or another machine's later edit
194
+ replacing it afterwards, makes it install again on the new text, up to three times. When an edit has changed the
195
+ lines the winner replaces, nothing is installed, and the item's next run drafts on the new text. Still open:
196
+ skill-sync keeps the later of two edits to a file, so a `history.md` entry two machines append within one sync cycle
197
+ loses one of them, and two machines can pick the same A/B case number.
198
+ - A machine with no copy of the skill, or no `claude` CLI, runs no workflow; the dashboard says which.
199
+
200
+ ## Configuration
201
+
202
+ `~/.jive/skill-sync.json` holds the endpoint and the machine name, written on first run.
203
+ `~/.jive/skill-sync-token.json` holds this machine's token while it is signed in. It is an ordinary file,
204
+ so anything that can read your home directory can copy the token; signing out, or the server rejecting the
205
+ token, deletes it.
206
+
207
+ Each token is issued to one machine, and the server records everything sent with it (folders, edits, account
208
+ readings) as that machine's. A token copied onto another computer, as when you copy your home folder to a new
209
+ one, is refused there: the server answers that the token belongs to the machine it was issued to, and that
210
+ computer's daemon stops syncing and reporting, logs which machine the token belongs to, and answers `list`,
211
+ `add` and `logout` with the same explanation. Run `skill-sync login` on it to sign it in as itself. Do not run
212
+ `skill-sync logout` there: it would revoke the other machine's token. The daemon refuses to, and so does the
213
+ server. The CLI reaches the daemon over `~/.jive/skill-sync.sock` (a named pipe on Windows),
214
+ which only your user can open.
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
package/bin/skill-sync ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Every command's file in a built package's bin/, the same for every command: it is the command its own file name says.
5
+ *
6
+ * On macOS and Linux it runs once. It has the package's postinstall.cjs replace it (and every other command's file)
7
+ * with a hard link to the real program, which the package manager skips when it does not run postinstall (Bun, for a
8
+ * package it does not trust), then runs the program with what was typed. On Windows a command starts through its .cmd
9
+ * shim, which always runs this file, so it runs the program every time and sets up again only when the commands are
10
+ * stale.
11
+ *
12
+ * CommonJS for the reason postinstall.cjs gives: bin/package.json makes this extensionless file CommonJS.
13
+ */
14
+ const { spawnSync } = require("child_process");
15
+ const { realpathSync } = require("fs");
16
+ const { basename, dirname, join } = require("path");
17
+
18
+ // The real path: reached through a link in a bin directory, the package is wherever the link points.
19
+ const launcherPath = realpathSync(__filename);
20
+ const packageDir = dirname(dirname(launcherPath));
21
+ const postinstall = require(join(packageDir, "postinstall.cjs"));
22
+
23
+ if (process.platform !== "win32" || !postinstall.commandsAreCurrent({ packageDir })) {
24
+ // A shell's, a launcher's or the user's own call to the completion code is left to do its job alone.
25
+ const setUpCompletion = !postinstall.COMPLETION_FLAGS.includes(process.argv[2]);
26
+ postinstall.setUp({ packageDir, repairOnly: false, setUpCompletion });
27
+ }
28
+
29
+ const result = spawnSync(postinstall.commandTarget({ packageDir, command: basename(launcherPath) }), process.argv.slice(2), { stdio: "inherit" });
30
+ if (result.error) {
31
+ console.error(result.error.message);
32
+ process.exit(1);
33
+ }
34
+ process.exit(result.status === null ? 1 : result.status);
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ /**
4
+ * Every command's file in a built package's bin/, the same for every command: it is the command its own file name says.
5
+ *
6
+ * On macOS and Linux it runs once. It has the package's postinstall.cjs replace it (and every other command's file)
7
+ * with a hard link to the real program, which the package manager skips when it does not run postinstall (Bun, for a
8
+ * package it does not trust), then runs the program with what was typed. On Windows a command starts through its .cmd
9
+ * shim, which always runs this file, so it runs the program every time and sets up again only when the commands are
10
+ * stale.
11
+ *
12
+ * CommonJS for the reason postinstall.cjs gives: bin/package.json makes this extensionless file CommonJS.
13
+ */
14
+ const { spawnSync } = require("child_process");
15
+ const { realpathSync } = require("fs");
16
+ const { basename, dirname, join } = require("path");
17
+
18
+ // The real path: reached through a link in a bin directory, the package is wherever the link points.
19
+ const launcherPath = realpathSync(__filename);
20
+ const packageDir = dirname(dirname(launcherPath));
21
+ const postinstall = require(join(packageDir, "postinstall.cjs"));
22
+
23
+ if (process.platform !== "win32" || !postinstall.commandsAreCurrent({ packageDir })) {
24
+ // A shell's, a launcher's or the user's own call to the completion code is left to do its job alone.
25
+ const setUpCompletion = !postinstall.COMPLETION_FLAGS.includes(process.argv[2]);
26
+ postinstall.setUp({ packageDir, repairOnly: false, setUpCompletion });
27
+ }
28
+
29
+ const result = spawnSync(postinstall.commandTarget({ packageDir, command: basename(launcherPath) }), process.argv.slice(2), { stdio: "inherit" });
30
+ if (result.error) {
31
+ console.error(result.error.message);
32
+ process.exit(1);
33
+ }
34
+ process.exit(result.status === null ? 1 : result.status);