@zabuti/tools 0.1.11 → 0.1.12
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.
- package/README.md +60 -60
- package/dist/installer/src/index.js +24 -24
- package/dist/shared/keep-local-edits.js +17 -6
- package/package.json +33 -33
package/README.md
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
# @zabuti/tools
|
|
2
|
-
|
|
3
|
-
Installs the licensed Zabuti developer tools (Logic Map, Logic Optimizer, Deadlock Map) as
|
|
4
|
-
Claude Code skills. Needs a Zabuti license and a download token from zabuti.com/account (CLI
|
|
5
|
-
access).
|
|
6
|
-
|
|
7
|
-
```
|
|
8
|
-
npx @zabuti/tools login # paste the token when it asks (it isn't shown)
|
|
9
|
-
npx @zabuti/tools add logic-map
|
|
10
|
-
npx @zabuti/tools add logic-optimizer
|
|
11
|
-
npx @zabuti/tools add deadlock-map # beta
|
|
12
|
-
npx @zabuti/tools add resource-drain-map # beta
|
|
13
|
-
```
|
|
14
|
-
|
|
15
|
-
## Updates
|
|
16
|
-
|
|
17
|
-
```
|
|
18
|
-
npx @zabuti/tools status # what is installed, and whether updates exist
|
|
19
|
-
npx @zabuti/tools update # update every installed skill that has a newer version
|
|
20
|
-
npx @zabuti/tools rollback logic-map # switch back to the copy the last update replaced
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
An update keeps the copy it replaces in `~/.zabuti/previous/<name>/`, outside the skills
|
|
24
|
-
folder so Claude Code doesn't load it as a second skill. Running `rollback` again swaps back.
|
|
25
|
-
Re-running `add` or `update` when nothing changed leaves the kept copy alone.
|
|
26
|
-
|
|
27
|
-
Nothing installed is overwritten without asking. If you didn't change a skill, `update`
|
|
28
|
-
lists the files it replaces and asks (Enter = yes). If you changed any file in it, `update`
|
|
29
|
-
writes nothing, not even the files you didn't touch. It lists your changes and offers to stage
|
|
30
|
-
the new version in `~/.zabuti/updates/<name>/` (`.new`, beside the `.original` yours started
|
|
31
|
-
from) with a prompt to paste into Claude Code to merge it. After merging a file, delete its
|
|
32
|
-
`.new`; the next `update` counts the new version as installed. Files you add to the skill
|
|
33
|
-
folder are never touched.
|
|
34
|
-
|
|
35
|
-
Outside an interactive terminal (scripts, CI), add `--yes` to answer yes. `--yes` never
|
|
36
|
-
replaces files you changed: a changed skill is staged. `--overwrite` takes the new versions
|
|
37
|
-
anyway, after asking, and backs up what it replaces to `~/.zabuti/backup/` (the replaced copy
|
|
38
|
-
is also kept for `rollback`). `--dry-run` shows the plan from the file list alone: nothing is
|
|
39
|
-
downloaded and no seat is taken. `logout` removes the saved token.
|
|
40
|
-
|
|
41
|
-
The skill is written to `~/.claude/skills/<name>/`. The server checks your token and your
|
|
42
|
-
organization's license on every download. Nothing from your project is sent. The free
|
|
43
|
-
`zabuti` CLI (components and icons) is a separate package and makes no network calls.
|
|
44
|
-
|
|
45
|
-
## Behind a corporate network
|
|
46
|
-
|
|
47
|
-
If `add` says it couldn't reach zabuti.com and the cause is a certificate error
|
|
48
|
-
(`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `SELF_SIGNED_CERT_IN_CHAIN`, `CERT_HAS_EXPIRED`), your
|
|
49
|
-
network is probably re-signing secure traffic with a company certificate. The browser trusts it
|
|
50
|
-
because the operating system does; Node keeps its own list. Tell Node to use the system's
|
|
51
|
-
certificates (Node 22.15 or later), then run the command again:
|
|
52
|
-
|
|
53
|
-
```
|
|
54
|
-
$env:NODE_OPTIONS = "--use-system-ca" # PowerShell, this window only
|
|
55
|
-
npx @zabuti/tools add logic-map
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
Make it permanent with `setx NODE_OPTIONS "--use-system-ca"`. On older Node, set
|
|
59
|
-
`NODE_EXTRA_CA_CERTS` to your company's root certificate file instead. Please don't use
|
|
60
|
-
`NODE_TLS_REJECT_UNAUTHORIZED=0`: it turns certificate checks off entirely.
|
|
1
|
+
# @zabuti/tools
|
|
2
|
+
|
|
3
|
+
Installs the licensed Zabuti developer tools (Logic Map, Logic Optimizer, Deadlock Map) as
|
|
4
|
+
Claude Code skills. Needs a Zabuti license and a download token from zabuti.com/account (CLI
|
|
5
|
+
access).
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
npx @zabuti/tools login # paste the token when it asks (it isn't shown)
|
|
9
|
+
npx @zabuti/tools add logic-map
|
|
10
|
+
npx @zabuti/tools add logic-optimizer
|
|
11
|
+
npx @zabuti/tools add deadlock-map # beta
|
|
12
|
+
npx @zabuti/tools add resource-drain-map # beta
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Updates
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
npx @zabuti/tools status # what is installed, and whether updates exist
|
|
19
|
+
npx @zabuti/tools update # update every installed skill that has a newer version
|
|
20
|
+
npx @zabuti/tools rollback logic-map # switch back to the copy the last update replaced
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
An update keeps the copy it replaces in `~/.zabuti/previous/<name>/`, outside the skills
|
|
24
|
+
folder so Claude Code doesn't load it as a second skill. Running `rollback` again swaps back.
|
|
25
|
+
Re-running `add` or `update` when nothing changed leaves the kept copy alone.
|
|
26
|
+
|
|
27
|
+
Nothing installed is overwritten without asking. If you didn't change a skill, `update`
|
|
28
|
+
lists the files it replaces and asks (Enter = yes). If you changed any file in it, `update`
|
|
29
|
+
writes nothing, not even the files you didn't touch. It lists your changes and offers to stage
|
|
30
|
+
the new version in `~/.zabuti/updates/<name>/` (`.new`, beside the `.original` yours started
|
|
31
|
+
from) with a prompt to paste into Claude Code to merge it. After merging a file, delete its
|
|
32
|
+
`.new`; the next `update` counts the new version as installed. Files you add to the skill
|
|
33
|
+
folder are never touched.
|
|
34
|
+
|
|
35
|
+
Outside an interactive terminal (scripts, CI), add `--yes` to answer yes. `--yes` never
|
|
36
|
+
replaces files you changed: a changed skill is staged. `--overwrite` takes the new versions
|
|
37
|
+
anyway, after asking, and backs up what it replaces to `~/.zabuti/backup/` (the replaced copy
|
|
38
|
+
is also kept for `rollback`). `--dry-run` shows the plan from the file list alone: nothing is
|
|
39
|
+
downloaded and no seat is taken. `logout` removes the saved token.
|
|
40
|
+
|
|
41
|
+
The skill is written to `~/.claude/skills/<name>/`. The server checks your token and your
|
|
42
|
+
organization's license on every download. Nothing from your project is sent. The free
|
|
43
|
+
`zabuti` CLI (components and icons) is a separate package and makes no network calls.
|
|
44
|
+
|
|
45
|
+
## Behind a corporate network
|
|
46
|
+
|
|
47
|
+
If `add` says it couldn't reach zabuti.com and the cause is a certificate error
|
|
48
|
+
(`UNABLE_TO_GET_ISSUER_CERT_LOCALLY`, `SELF_SIGNED_CERT_IN_CHAIN`, `CERT_HAS_EXPIRED`), your
|
|
49
|
+
network is probably re-signing secure traffic with a company certificate. The browser trusts it
|
|
50
|
+
because the operating system does; Node keeps its own list. Tell Node to use the system's
|
|
51
|
+
certificates (Node 22.15 or later), then run the command again:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
$env:NODE_OPTIONS = "--use-system-ca" # PowerShell, this window only
|
|
55
|
+
npx @zabuti/tools add logic-map
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Make it permanent with `setx NODE_OPTIONS "--use-system-ca"`. On older Node, set
|
|
59
|
+
`NODE_EXTRA_CA_CERTS` to your company's root certificate file instead. Please don't use
|
|
60
|
+
`NODE_TLS_REJECT_UNAUTHORIZED=0`: it turns certificate checks off entirely.
|
|
@@ -6,30 +6,30 @@
|
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
7
|
import { cmdLogin, cmdLogout } from "../../shared/token.js";
|
|
8
8
|
import { cmdAddSkill, cmdRollback, cmdStatus, cmdUpdate, SKILL_NAMES } from "./skills.js";
|
|
9
|
-
const USAGE = `zabuti-tools: install the licensed Zabuti developer tools
|
|
10
|
-
|
|
11
|
-
zabuti-tools login save your download token (make one at zabuti.com/account);
|
|
12
|
-
asks for it without showing it (or pipe it in)
|
|
13
|
-
zabuti-tools logout remove the saved token
|
|
14
|
-
zabuti-tools add <skill> install a skill into ~/.claude/skills/
|
|
15
|
-
skills: ${SKILL_NAMES.join(", ")}
|
|
16
|
-
zabuti-tools update [skill] update installed skills that have a newer version
|
|
17
|
-
zabuti-tools rollback <skill> switch back to the copy the last update replaced
|
|
18
|
-
|
|
19
|
-
zabuti-tools status show what is installed and whether updates exist
|
|
20
|
-
zabuti-tools --version
|
|
21
|
-
|
|
22
|
-
Nothing installed is overwritten without asking. If you changed a skill, an update
|
|
23
|
-
writes nothing: it lists your changes and offers to stage the new version in
|
|
24
|
-
~/.zabuti/updates/<skill>/ with a prompt for Claude Code to merge it.
|
|
25
|
-
|
|
26
|
-
Options: --dry-run (add/update: show what would change, write nothing; fetches
|
|
27
|
-
only the file list, so it never takes a seat)
|
|
28
|
-
--yes (add/update: answer yes outside an interactive terminal; never
|
|
29
|
-
overwrites files you changed: a changed skill is staged)
|
|
30
|
-
--out=<folder> (add: install there instead)
|
|
31
|
-
--overwrite (add/update: take the new versions even where you changed a file,
|
|
32
|
-
after asking; what it replaces is backed up to ~/.zabuti/backup/)
|
|
9
|
+
const USAGE = `zabuti-tools: install the licensed Zabuti developer tools
|
|
10
|
+
|
|
11
|
+
zabuti-tools login save your download token (make one at zabuti.com/account);
|
|
12
|
+
asks for it without showing it (or pipe it in)
|
|
13
|
+
zabuti-tools logout remove the saved token
|
|
14
|
+
zabuti-tools add <skill> install a skill into ~/.claude/skills/
|
|
15
|
+
skills: ${SKILL_NAMES.join(", ")}
|
|
16
|
+
zabuti-tools update [skill] update installed skills that have a newer version
|
|
17
|
+
zabuti-tools rollback <skill> switch back to the copy the last update replaced
|
|
18
|
+
|
|
19
|
+
zabuti-tools status show what is installed and whether updates exist
|
|
20
|
+
zabuti-tools --version
|
|
21
|
+
|
|
22
|
+
Nothing installed is overwritten without asking. If you changed a skill, an update
|
|
23
|
+
writes nothing: it lists your changes and offers to stage the new version in
|
|
24
|
+
~/.zabuti/updates/<skill>/ with a prompt for Claude Code to merge it.
|
|
25
|
+
|
|
26
|
+
Options: --dry-run (add/update: show what would change, write nothing; fetches
|
|
27
|
+
only the file list, so it never takes a seat)
|
|
28
|
+
--yes (add/update: answer yes outside an interactive terminal; never
|
|
29
|
+
overwrites files you changed: a changed skill is staged)
|
|
30
|
+
--out=<folder> (add: install there instead)
|
|
31
|
+
--overwrite (add/update: take the new versions even where you changed a file,
|
|
32
|
+
after asking; what it replaces is backed up to ~/.zabuti/backup/)
|
|
33
33
|
An option a command doesn't take stops it before anything is written.`;
|
|
34
34
|
function die(msg) {
|
|
35
35
|
console.error(`zabuti-tools: ${msg}`);
|
|
@@ -31,6 +31,18 @@ import { copyFileSync, existsSync, mkdirSync, readdirSync, readFileSync, renameS
|
|
|
31
31
|
import { dirname, join, relative, sep } from "node:path";
|
|
32
32
|
import { ask, choose, interactive } from "./ask.js";
|
|
33
33
|
export const sha256 = (s) => createHash("sha256").update(s, "utf8").digest("hex");
|
|
34
|
+
/**
|
|
35
|
+
* Does a file on disk match a recorded hash? Line endings don't count: Git for Windows
|
|
36
|
+
* checks files out with CRLF (core.autocrlf=true by default), so a committed Zabuti file
|
|
37
|
+
* comes back with every line "changed". Feedback e52b1626, 2026-11-28.
|
|
38
|
+
*/
|
|
39
|
+
export function sameText(diskText, hash) {
|
|
40
|
+
if (hash === undefined)
|
|
41
|
+
return false;
|
|
42
|
+
if (sha256(diskText) === hash)
|
|
43
|
+
return true;
|
|
44
|
+
return diskText.includes("\r") && sha256(diskText.replace(/\r\n?/g, "\n")) === hash;
|
|
45
|
+
}
|
|
34
46
|
export const incoming = (rel, full, content) => ({ rel, full, next: sha256(content), content });
|
|
35
47
|
function readText(path) {
|
|
36
48
|
try {
|
|
@@ -99,19 +111,18 @@ export function planProduct(files, recorded, store, { dropRoot, dryRun = false }
|
|
|
99
111
|
const knownInstalled = installed;
|
|
100
112
|
const planned = files.map((f) => {
|
|
101
113
|
const diskText = readText(f.full);
|
|
102
|
-
const disk = diskText === null ? null : sha256(diskText);
|
|
103
114
|
const was = knownInstalled?.get(f.rel);
|
|
104
115
|
const p = (kind, note) => ({ ...f, kind, note });
|
|
105
|
-
if (
|
|
106
|
-
return p("same", "");
|
|
107
|
-
if (disk === null) {
|
|
116
|
+
if (diskText === null) {
|
|
108
117
|
if (was === undefined)
|
|
109
118
|
return p("new", "");
|
|
110
119
|
return was === f.next ? p("yours", "you deleted it") : p("conflict", "you deleted it");
|
|
111
120
|
}
|
|
121
|
+
if (sameText(diskText, f.next))
|
|
122
|
+
return p("same", "");
|
|
112
123
|
if (was === undefined)
|
|
113
124
|
return p("conflict", knownInstalled ? "a file of yours has the same name" : "added before Zabuti tracked changes");
|
|
114
|
-
if (
|
|
125
|
+
if (sameText(diskText, was))
|
|
115
126
|
return p("update", "");
|
|
116
127
|
return was === f.next ? p("yours", "you changed it") : p("conflict", "you changed it");
|
|
117
128
|
});
|
|
@@ -123,7 +134,7 @@ export function planProduct(files, recorded, store, { dropRoot, dryRun = false }
|
|
|
123
134
|
continue;
|
|
124
135
|
const full = dropRoot(rel);
|
|
125
136
|
const diskText = readText(full);
|
|
126
|
-
dropped.push({ rel, full, kind: diskText === null ? "gone" :
|
|
137
|
+
dropped.push({ rel, full, kind: diskText === null ? "gone" : sameText(diskText, was) ? "remove" : "yours" });
|
|
127
138
|
}
|
|
128
139
|
}
|
|
129
140
|
const has = (k) => planned.some((f) => f.kind === k);
|
package/package.json
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zabuti/tools",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Installs the licensed Zabuti developer tools (Logic Map, Logic Optimizer, Deadlock Map, Resource Drain Map) as Claude Code skills. Needs a license and a download token from zabuti.com.",
|
|
5
|
-
"homepage": "https://zabuti.com",
|
|
6
|
-
"license": "MIT",
|
|
7
|
-
"type": "module",
|
|
8
|
-
"bin": {
|
|
9
|
-
"zabuti-tools": "dist/installer/src/index.js"
|
|
10
|
-
},
|
|
11
|
-
"files": [
|
|
12
|
-
"dist",
|
|
13
|
-
"README.md"
|
|
14
|
-
],
|
|
15
|
-
"engines": {
|
|
16
|
-
"node": ">=20"
|
|
17
|
-
},
|
|
18
|
-
"keywords": [
|
|
19
|
-
"claude-code",
|
|
20
|
-
"skills",
|
|
21
|
-
"zabuti"
|
|
22
|
-
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc -p tsconfig.json",
|
|
25
|
-
"check": "tsc -p tsconfig.json --noEmit",
|
|
26
|
-
"smoke": "node scripts/smoke.mjs",
|
|
27
|
-
"prepack": "npm run build"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/node": "^22.0.0",
|
|
31
|
-
"typescript": "^5.6.0"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zabuti/tools",
|
|
3
|
+
"version": "0.1.12",
|
|
4
|
+
"description": "Installs the licensed Zabuti developer tools (Logic Map, Logic Optimizer, Deadlock Map, Resource Drain Map) as Claude Code skills. Needs a license and a download token from zabuti.com.",
|
|
5
|
+
"homepage": "https://zabuti.com",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"bin": {
|
|
9
|
+
"zabuti-tools": "dist/installer/src/index.js"
|
|
10
|
+
},
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md"
|
|
14
|
+
],
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=20"
|
|
17
|
+
},
|
|
18
|
+
"keywords": [
|
|
19
|
+
"claude-code",
|
|
20
|
+
"skills",
|
|
21
|
+
"zabuti"
|
|
22
|
+
],
|
|
23
|
+
"scripts": {
|
|
24
|
+
"build": "tsc -p tsconfig.json",
|
|
25
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
26
|
+
"smoke": "node scripts/smoke.mjs",
|
|
27
|
+
"prepack": "npm run build"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"@types/node": "^22.0.0",
|
|
31
|
+
"typescript": "^5.6.0"
|
|
32
|
+
}
|
|
33
|
+
}
|