spock-cli 0.0.0-stage → 0.6.0

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +49 -2
  3. package/bin/spock +54 -0
  4. package/package.json +41 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Leo Ostera
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,50 @@
1
- # Temporary Holding Version
1
+ # spock-cli
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Prebuilt native binaries for [`spock`](https://github.com/leostera/spock), a statically typed TLA+ model checker in Rust.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ bun add -D spock-cli
9
+ # or
10
+ npm install -D spock-cli
11
+ ```
12
+
13
+ No `postinstall` scripts, no `trustedDependencies`, and no Rust toolchain required — platform binaries ship via `optionalDependencies`.
14
+
15
+ ## Usage
16
+
17
+ Run all `.spock` specs in your repo (discovered recursively, run in parallel, cached):
18
+
19
+ ```sh
20
+ bun run spock
21
+ ```
22
+
23
+ Or add a script to `package.json`:
24
+
25
+ ```json
26
+ {
27
+ "scripts": {
28
+ "specs": "spock"
29
+ }
30
+ }
31
+ ```
32
+
33
+ Other commands:
34
+
35
+ ```sh
36
+ bun run spock specs/ # check all specs under specs/
37
+ bun run spock --filter shard # filter models by substring
38
+ bun run spock check specs/foo.spock # check one spec/model
39
+ bun run spock trace specs/foo.spock run.jsonl
40
+ bun run spock prove specs/foo.spock # inductive proof via SMT
41
+ bun run spock skill # print coding-agent SKILL.md
42
+ ```
43
+
44
+ ## Platforms
45
+
46
+ - macOS arm64 (`@leostera/spock-darwin-arm64`)
47
+ - macOS x64 (`@leostera/spock-darwin-x64`)
48
+ - Linux x64 (`@leostera/spock-linux-x64`)
49
+ - Linux arm64 (`@leostera/spock-linux-arm64`)
50
+ - Windows x64 (`@leostera/spock-win32-x64`)
package/bin/spock ADDED
@@ -0,0 +1,54 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("node:child_process");
5
+
6
+ const PLATFORMS = {
7
+ "darwin:arm64": "@leostera/spock-darwin-arm64/bin/spock",
8
+ "darwin:x64": "@leostera/spock-darwin-x64/bin/spock",
9
+ "linux:x64": "@leostera/spock-linux-x64/bin/spock",
10
+ "linux:arm64": "@leostera/spock-linux-arm64/bin/spock",
11
+ "win32:x64": "@leostera/spock-win32-x64/bin/spock.exe",
12
+ };
13
+
14
+ function resolveBinary() {
15
+ if (process.env.SPOCK_BIN) {
16
+ return process.env.SPOCK_BIN;
17
+ }
18
+
19
+ const key = `${process.platform}:${process.arch}`;
20
+ const target = PLATFORMS[key];
21
+ if (!target) {
22
+ console.error(
23
+ `spock-cli: no prebuilt binary for ${process.platform}/${process.arch}.\n` +
24
+ "Install from source with: cargo install spock-cli"
25
+ );
26
+ process.exit(1);
27
+ }
28
+
29
+ try {
30
+ return require.resolve(target);
31
+ } catch {
32
+ const pkg = target.slice(0, target.indexOf("/bin/"));
33
+ console.error(
34
+ `spock-cli: platform package ${pkg} is not installed.\n` +
35
+ "Make sure optionalDependencies are enabled (do not pass --no-optional),\n" +
36
+ "or install directly with: cargo install spock-cli"
37
+ );
38
+ process.exit(1);
39
+ }
40
+ }
41
+
42
+ const bin = resolveBinary();
43
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
44
+
45
+ if (result.error) {
46
+ console.error(`spock-cli: failed to run ${bin}: ${result.error.message}`);
47
+ process.exit(1);
48
+ }
49
+
50
+ if (result.signal) {
51
+ process.kill(process.pid, result.signal);
52
+ }
53
+
54
+ process.exit(result.status ?? 1);
package/package.json CHANGED
@@ -1,6 +1,43 @@
1
1
  {
2
2
  "name": "spock-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.6.0",
4
+ "description": "Statically typed TLA+ model checker — discover and check all .spock specs with one command",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/leostera/spock.git"
9
+ },
10
+ "homepage": "https://github.com/leostera/spock",
11
+ "bugs": {
12
+ "url": "https://github.com/leostera/spock/issues"
13
+ },
14
+ "keywords": [
15
+ "spock",
16
+ "tla",
17
+ "tlaplus",
18
+ "model-checker",
19
+ "formal-methods",
20
+ "verification"
21
+ ],
22
+ "bin": {
23
+ "spock": "bin/spock"
24
+ },
25
+ "files": [
26
+ "bin",
27
+ "README.md",
28
+ "LICENSE"
29
+ ],
30
+ "optionalDependencies": {
31
+ "@leostera/spock-darwin-arm64": "0.6.0",
32
+ "@leostera/spock-darwin-x64": "0.6.0",
33
+ "@leostera/spock-linux-x64": "0.6.0",
34
+ "@leostera/spock-linux-arm64": "0.6.0",
35
+ "@leostera/spock-win32-x64": "0.6.0"
36
+ },
37
+ "engines": {
38
+ "node": ">=18"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ }
43
+ }