@jive-sh/skill-sync 0.6.2-latest-darwin-x64 → 0.6.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 (70) hide show
  1. package/README.md +146 -0
  2. package/bin/package.json +1 -0
  3. package/bin/skill-sync +614 -0
  4. package/bin/skill-sync-daemon +614 -0
  5. package/dist/daemons/skill-sync-daemon.js +499 -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 +92 -0
  12. package/dist/internal/agents/agent-tool.js.map +1 -0
  13. package/dist/internal/agents/claude.js +422 -0
  14. package/dist/internal/agents/claude.js.map +1 -0
  15. package/dist/internal/agents/codex.js +266 -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 +172 -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 +161 -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 +62 -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 +32 -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/sync.js +183 -0
  44. package/dist/internal/sync.js.map +1 -0
  45. package/dist/internal/wire.js +24 -0
  46. package/dist/internal/wire.js.map +1 -0
  47. package/install.cjs +614 -0
  48. package/package.json +36 -11
  49. package/src/daemons/skill-sync-daemon.ts +491 -0
  50. package/src/entrypoints/skill-sync.ts +12 -0
  51. package/src/index.ts +15 -0
  52. package/src/internal/agents/agent-tool.ts +136 -0
  53. package/src/internal/agents/claude.ts +440 -0
  54. package/src/internal/agents/codex.ts +283 -0
  55. package/src/internal/agents/command.ts +257 -0
  56. package/src/internal/agents/grok.ts +176 -0
  57. package/src/internal/agents/index.ts +74 -0
  58. package/src/internal/cli.ts +194 -0
  59. package/src/internal/config.ts +172 -0
  60. package/src/internal/control.ts +153 -0
  61. package/src/internal/daemon-control/impl.ts +74 -0
  62. package/src/internal/daemon-control/interface.ts +38 -0
  63. package/src/internal/folders.ts +50 -0
  64. package/src/internal/local-skills.ts +58 -0
  65. package/src/internal/path.ts +32 -0
  66. package/src/internal/server.ts +34 -0
  67. package/src/internal/skill-check.ts +97 -0
  68. package/src/internal/sync.ts +217 -0
  69. package/src/internal/wire.ts +315 -0
  70. package/multi-call-binary +0 -4
package/README.md ADDED
@@ -0,0 +1,146 @@
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 opens
11
+ `skill-sync.jive.sh` in your browser, where you verify with your jive.sh passkey (from any passkey
12
+ manager, such as Google Password Manager). The service hands a per-machine token straight to the daemon,
13
+ never through the CLI. The daemon keeps it in `~/.jive/skill-sync-token.json` and starts syncing, and it
14
+ stays signed in through restarts, reboots and upgrades until you run `skill-sync logout` or revoke the
15
+ token.
16
+
17
+ ```
18
+ skill-sync login sign this machine in with your passkey; the daemon starts syncing
19
+ skill-sync logout revoke this machine's token and stop syncing
20
+ skill-sync list list the skills that sync, as the server holds them (needs a sign-in)
21
+ skill-sync add <skill> put a skill on the synced list, as ticking it on the dashboard does
22
+ skill-sync show <skill> print a synced skill's description and where its copies are on this machine
23
+ skill-sync upgrade upgrade with the package manager that installed it
24
+ skill-sync version print the installed version
25
+ ```
26
+
27
+ Tab completes every command. After `show` it lists the synced skills and after `add` the skills in the
28
+ detected folders that `add` would accept and that are not synced yet, both asked of the daemon when Tab is
29
+ pressed. Tab never starts the daemon: when none is running, or it does not answer within 3 seconds, Tab shows why
30
+ instead. Installing or upgrading turns Tab completion on in your shell; `skill-sync --remove-completion` turns
31
+ it off.
32
+
33
+ Everything else — which folders sync, unticking skills, renaming computers — is on the
34
+ dashboard.
35
+
36
+ ## Adding a skill from an agent
37
+
38
+ An agent that writes a new skill meant for every project runs `skill-sync add <skill>` in the same step,
39
+ so nobody has to tick it. `<skill>` is the skill's folder name. Running it again changes nothing. It is
40
+ refused, with the reason, unless:
41
+
42
+ - the skill is in a folder skill-sync detects (above). A skill in a project's own `.claude/skills`,
43
+ `.agents/skills` or `.grok/skills` is specific to that project and never syncs. That is the only sign of
44
+ a project-specific skill skill-sync can read; one written into a home folder but about one project is
45
+ not caught.
46
+ - its `SKILL.md` starts with frontmatter whose `name` is the folder name and whose `description` is not
47
+ empty.
48
+ - the name is lowercase letters and digits in hyphen-joined words, at most 64 characters.
49
+
50
+ The skill's files upload from the folders holding it that are ticked on the dashboard; if none is, the
51
+ command says so.
52
+
53
+ The daemon registers itself to start at login when the package is installed. It also keeps skill-sync up
54
+ to date: every 5 minutes it asks the package manager that installed it (bun, pnpm, yarn or npm, with that
55
+ manager's own registry settings) whether a newer version is published, installs it the same way, and
56
+ restarts on it, still signed in. `skill-sync upgrade` does the same at once.
57
+
58
+ ## The dashboard
59
+
60
+ `https://skill-sync.jive.sh/` shows, live, the latest version published on npm, and:
61
+
62
+ - **Accounts**: a table with one row per Claude, Codex and Grok account on the running computers.
63
+ An account its tool can name (Claude's organization, Codex's email) is one row however many computers use
64
+ it. Each limit gets a column with the share used and the time to its reset; then each computer's own use of
65
+ the account over the last 30 days, and when the limits were read. See [Account usage](#account-usage).
66
+ - **Synced skills**: the list, with the shared version of each skill and where it was last edited.
67
+ - **Computers**: each machine (renameable), whether its daemon is running and which version it runs, its
68
+ skills folders, and the skills in each with their files. A daemon older than the published version is
69
+ marked "update pending"; it upgrades itself within 5 minutes.
70
+
71
+ Every file shows the first 8 characters of its SHA-256, amber when a folder's copy differs from the synced
72
+ one. The page reloads itself when a new version of the service is deployed.
73
+
74
+ The server holds one list of skills to sync. Every enabled folder on every machine pushes and pulls
75
+ exactly the skills on that list, and never touches any other skill. A skill's checkbox adds it to the
76
+ list or removes it, for every machine at once. A folder's checkbox turns syncing on or off for that
77
+ 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
78
+ and survive a reinstall.
79
+
80
+ A folder that lacks a listed skill gets a copy. Deleting a listed skill in any folder deletes it in every
81
+ folder and takes it off the list; unticking it instead stops syncing and leaves every copy where it is.
82
+
83
+ ## The latest edit wins
84
+
85
+ Every file carries the time it was last edited: on a machine, its modification time; on the server, the
86
+ edit time of the version it holds. Whenever two copies of a file differ, the one edited later replaces
87
+ the other, on the server and in every folder. Nothing is merged and nothing is set aside. A deletion
88
+ counts as an edit made when the daemon noticed it.
89
+
90
+ Edit times come from each machine's clock, so a machine whose clock is far off can win or lose against
91
+ edits it should not.
92
+
93
+ ## Account usage
94
+
95
+ An account is a folder in your home directory: `~/.claude` and each `~/.claude-<name>` for Claude (each a
96
+ `CLAUDE_CONFIG_DIR`), `~/.codex` and each `~/.codex-<name>` for Codex (each a `CODEX_HOME`), `~/.grok` and each
97
+ `~/.grok-<name>` for Grok (each a `GROK_HOME`). The daemon reads two things about each, and sends them to the
98
+ dashboard when they change.
99
+
100
+ **The account's limits**, which its provider counts across every computer. The daemon asks the tool's own CLI,
101
+ at most every five minutes per account. The CLI is signed in to the account and makes the call; skill-sync
102
+ reads no credential file, and only the numbers and the account's email leave the machine.
103
+
104
+ - **Claude**: `claude auth status` (who is signed in) and `claude -p /usage --no-session-persistence` (the
105
+ session, weekly and per-model weekly limits). Neither starts a model turn, and the second saves no session.
106
+ Usage credits spent beyond the plan are not in `/usage`'s output, so they show only when the CLI could not be
107
+ asked (below).
108
+ - **Codex**: `codex app-server`, the JSON-RPC interface Codex's editors and desktop app use: `account/read` and
109
+ `account/rateLimits/read`.
110
+ - **Grok**: `grok agent stdio`, asked `_x.ai/billing`, the request Grok's own `/usage` screen makes. Grok has no
111
+ command that says who is signed in, so its accounts show as unidentified.
112
+
113
+ The daemon runs with the service manager's PATH, not your shell's, so it looks for `claude` and `codex` on PATH,
114
+ then in the folders installers put them in (`~/.local/bin`, `~/.bun/bin`, npm's and nvm's global folders,
115
+ Homebrew's), then, for Codex, inside the ChatGPT and Codex desktop apps and Codex's editor extension (VS Code,
116
+ Cursor or Windsurf, locally or on a machine they reach over SSH), which each ship one. When a CLI is not found
117
+ or fails, the limits are what the tool last recorded on this machine, and the dashboard's hover on their age
118
+ says so and why: for Claude, the plan usage it keeps in the account's `.claude.json`; for Codex, the limits it
119
+ recorded with its latest turn in its session files. Those are as old as the tool's last use of the account. An
120
+ account using Amazon Bedrock or an API key has no plan limits.
121
+
122
+ **This machine's use** of the account over the last 30 days, from the files the tool writes:
123
+
124
+ - **Claude**: Claude Code's own estimate of each session's cost at list price, which it saves in the session's
125
+ file under `projects/` when the session ends, is cleared, resumed or forked, summed over sessions active in
126
+ the period (Claude Code deletes older session files by default). A running session counts as of its last
127
+ save, and your provider's bill can differ from list price. The row says Bedrock when the account's
128
+ `settings.json` sets `CLAUDE_CODE_USE_BEDROCK` or `CLAUDE_CODE_USE_MANTLE` in its `env`, or its sessions used
129
+ Bedrock model IDs.
130
+ - **Codex**: the tokens its sessions active in the period used, cached input included, from the running total
131
+ Codex records in its session files.
132
+ - **Grok**: what `grok usage <session-id>` reports, summed over sessions active in the period. A session's
133
+ totals include history it inherited by resume or fork, so a fork counts that part twice.
134
+
135
+ A limit whose reset time has passed since the reading shows no number, since the new window's use is not known
136
+ yet. None of these outputs is a published format: when a tool changes one, the row says "unknown" and why,
137
+ rather than showing a wrong number. Daemons before 0.5.0 send usage in a shape the dashboard no longer takes,
138
+ so their accounts are not shown until they upgrade themselves.
139
+
140
+ ## Configuration
141
+
142
+ `~/.jive/skill-sync.json` holds the endpoint and the machine name, written on first run.
143
+ `~/.jive/skill-sync-token.json` holds this machine's token while it is signed in. It is an ordinary file,
144
+ so anything that can read your home directory can copy the token; signing out, or the server rejecting the
145
+ token, deletes it. The CLI reaches the daemon over `~/.jive/skill-sync.sock` (a named pipe on Windows),
146
+ which only your user can open.
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}