soturail 0.3.2 → 0.4.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 (77) hide show
  1. package/README.md +59 -7
  2. package/dist/cli.d.ts +1 -0
  3. package/dist/cli.js +27 -1
  4. package/dist/cli.js.map +1 -1
  5. package/dist/commands/agents.d.ts +2 -0
  6. package/dist/commands/agents.js +41 -0
  7. package/dist/commands/agents.js.map +1 -0
  8. package/dist/commands/bench.d.ts +1 -1
  9. package/dist/commands/bench.js +53 -4
  10. package/dist/commands/bench.js.map +1 -1
  11. package/dist/commands/context.js +11 -5
  12. package/dist/commands/context.js.map +1 -1
  13. package/dist/commands/doctor.js +7 -0
  14. package/dist/commands/doctor.js.map +1 -1
  15. package/dist/commands/hooks.d.ts +4 -2
  16. package/dist/commands/hooks.js +15 -10
  17. package/dist/commands/hooks.js.map +1 -1
  18. package/dist/commands/mcp.js +28 -1
  19. package/dist/commands/mcp.js.map +1 -1
  20. package/dist/commands/release.js +5 -3
  21. package/dist/commands/release.js.map +1 -1
  22. package/dist/commands/workflow.d.ts +2 -0
  23. package/dist/commands/workflow.js +40 -0
  24. package/dist/commands/workflow.js.map +1 -0
  25. package/dist/core/agent-exporter.d.ts +15 -0
  26. package/dist/core/agent-exporter.js +257 -0
  27. package/dist/core/agent-exporter.js.map +1 -0
  28. package/dist/core/agent-profile.d.ts +25 -0
  29. package/dist/core/agent-profile.js +2 -0
  30. package/dist/core/agent-profile.js.map +1 -0
  31. package/dist/core/agent-registry.d.ts +6 -0
  32. package/dist/core/agent-registry.js +109 -0
  33. package/dist/core/agent-registry.js.map +1 -0
  34. package/dist/core/config.d.ts +4 -0
  35. package/dist/core/config.js +10 -2
  36. package/dist/core/config.js.map +1 -1
  37. package/dist/core/context-pack.d.ts +3 -1
  38. package/dist/core/context-pack.js +23 -2
  39. package/dist/core/context-pack.js.map +1 -1
  40. package/dist/core/mcp-resources.js +9 -1
  41. package/dist/core/mcp-resources.js.map +1 -1
  42. package/dist/core/mcp-server.d.ts +4 -0
  43. package/dist/core/mcp-server.js +26 -0
  44. package/dist/core/mcp-server.js.map +1 -1
  45. package/dist/core/release-preflight.d.ts +1 -0
  46. package/dist/core/release-preflight.js +131 -26
  47. package/dist/core/release-preflight.js.map +1 -1
  48. package/dist/core/version.d.ts +1 -1
  49. package/dist/core/version.js +1 -1
  50. package/dist/core/workflow-store.d.ts +24 -0
  51. package/dist/core/workflow-store.js +188 -0
  52. package/dist/core/workflow-store.js.map +1 -0
  53. package/dist/core/worktree-manager.d.ts +10 -0
  54. package/dist/core/worktree-manager.js +55 -0
  55. package/dist/core/worktree-manager.js.map +1 -0
  56. package/docs/agents.md +33 -0
  57. package/docs/benchmarking.md +4 -3
  58. package/docs/comparisons.md +4 -2
  59. package/docs/context-packs.md +6 -1
  60. package/docs/hooks.md +5 -2
  61. package/docs/mcp.md +16 -0
  62. package/docs/metrics.md +2 -1
  63. package/docs/release-workflow.md +4 -0
  64. package/docs/security-model.md +6 -2
  65. package/docs/usage.md +17 -0
  66. package/docs/windows.md +27 -1
  67. package/docs/workflow-rail.md +43 -21
  68. package/examples/agents/README.md +11 -0
  69. package/examples/agents/antigravity.md +8 -0
  70. package/examples/agents/claude.md +9 -0
  71. package/examples/agents/codex.md +8 -0
  72. package/examples/agents/cursor.md +8 -0
  73. package/examples/agents/gemini.md +8 -0
  74. package/examples/workflows/README.md +13 -0
  75. package/examples/workflows/bugfix-workflow.md +11 -0
  76. package/examples/workflows/release-workflow.md +9 -0
  77. package/package.json +1 -1
@@ -22,14 +22,15 @@ The suite groups results as:
22
22
  - cache stability;
23
23
  - native engine availability/performance when available;
24
24
  - skill rail validation/export;
25
- - MCP resource listing/reading;
25
+ - MCP resource listing/reading/smoke;
26
26
  - context pack generation;
27
- - agent hook export;
27
+ - agent hook and agent integration export;
28
+ - Workflow Rail dry-run state;
28
29
  - memory approval workflow.
29
30
 
30
31
  Terminal reducer cases include npm install noise, npm test success, Vitest failures, TypeScript diagnostics, git diff/status noise, Docker logs, ESLint failures, Vite/Next build output, Java stack traces, Maven/Gradle failures, JSON/tool payload output, tiny-output overhead and dedupe fixtures.
31
32
 
32
- Each v0.3.2 reducer case reports:
33
+ Each reducer and integration case reports:
33
34
 
34
35
  - `raw_tokens`;
35
36
  - `reduced_tokens`;
@@ -28,8 +28,10 @@ MemPalace-like memory/evidence ideas are related. SotuRail uses local JSONL memo
28
28
 
29
29
  Nicole-style knowledge-to-rules workflows are related. SotuRail has `ingest` and `rules` with future hardened PDF extraction.
30
30
 
31
- ## Skills And Workflow Orchestration
31
+ ## Skills, Agent Integrations And Workflow Orchestration
32
32
 
33
- Agent-skills and SkillsMP-like ecosystems are related to Skill Rail exports. Compozy, Superpowers and OpenSpec-style orchestration are future Workflow Rail territory.
33
+ Agent-skills and SkillsMP-like ecosystems are related to Skill Rail exports. SotuRail v0.4.0 exports prompt/context files and MCP snippets for Claude, Codex, Gemini, Cursor, Antigravity and generic agents without claiming host-native superiority.
34
+
35
+ Compozy, Superpowers and OpenSpec-style orchestration are related to Workflow Rail. SotuRail's Workflow Rail is a local state machine with optional Git worktree isolation; it does not push, merge or delete user work automatically.
34
36
 
35
37
  SotuRail should not be described as better than these projects unless a specific local benchmark proves a specific metric.
@@ -7,7 +7,9 @@ soturail context pack --target claude
7
7
  soturail context pack --target codex
8
8
  soturail context pack --target gemini
9
9
  soturail context pack --target cursor
10
+ soturail context pack --target antigravity
10
11
  soturail context pack --target generic
12
+ soturail context pack --target all
11
13
  soturail context explain
12
14
  soturail context doctor
13
15
  ```
@@ -20,6 +22,7 @@ Common generated files:
20
22
  - `.soturail/context/codex-context.md`
21
23
  - `.soturail/context/gemini-context.md`
22
24
  - `.soturail/context/cursor-context.md`
25
+ - `.soturail/context/antigravity-context.md`
23
26
  - `.soturail/context/generic-context.md`
24
27
 
25
28
  Stable-cache order:
@@ -32,7 +35,9 @@ Stable-cache order:
32
35
  6. Approved specs.
33
36
  7. Approved memory.
34
37
  8. Skills summary.
35
- 9. Dynamic footer with timestamps, current commit, raw IDs and recent command notes.
38
+ 9. Workflow summary.
39
+ 10. MCP resource list.
40
+ 11. Dynamic footer with timestamps, current commit, raw IDs and recent command notes.
36
41
 
37
42
  Dynamic data never appears before stable blocks.
38
43
 
package/docs/hooks.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Agent Hooks
2
2
 
3
- SotuRail hook support is cautious. Claude gets conservative safe-hooks and MCP guidance first; Codex, Gemini and Cursor use prompt-only fallbacks when stable native hook APIs are unavailable.
3
+ SotuRail hook support is cautious. Claude gets conservative safe-hooks and MCP guidance first; Codex, Gemini, Cursor and Antigravity use prompt-only fallbacks when stable native hook APIs are unavailable.
4
4
 
5
5
  ```bash
6
6
  soturail hooks list
@@ -10,9 +10,12 @@ soturail hooks install --agent claude --mode mcp
10
10
  soturail hooks install --agent codex --mode prompt-only
11
11
  soturail hooks install --agent gemini --mode prompt-only
12
12
  soturail hooks install --agent cursor --mode prompt-only
13
+ soturail hooks install --agent antigravity --mode prompt-only --dry-run
13
14
  soturail hooks uninstall --agent claude
15
+ soturail hooks uninstall --agent claude --dry-run
14
16
  soturail hooks export --agent claude
15
17
  soturail hooks export --agent codex
18
+ soturail hooks export --agent antigravity
16
19
  ```
17
20
 
18
21
  Installers create backups before modifying existing files. Dry-run prints every file that would change. If a host config location is uncertain, SotuRail generates prompt-only guidance instead of guessing.
@@ -24,6 +27,6 @@ Always review generated hooks before enabling them. SotuRail should never auto-i
24
27
  `soturail hooks doctor` prints safe modes and next commands:
25
28
 
26
29
  - Claude: `safe-hooks` and `mcp`.
27
- - Codex, Gemini and Cursor: `prompt-only`.
30
+ - Codex, Gemini, Cursor and Antigravity: `prompt-only`.
28
31
  - Start with `--dry-run`.
29
32
  - Export guidance with `soturail hooks export --agent claude`.
package/docs/mcp.md CHANGED
@@ -5,6 +5,8 @@ SotuRail includes a local MCP-compatible server over stdio using JSON-RPC 2.0 st
5
5
  ```bash
6
6
  soturail mcp doctor
7
7
  soturail mcp manifest
8
+ soturail mcp config --agent generic
9
+ soturail mcp smoke
8
10
  soturail mcp serve --transport stdio
9
11
  ```
10
12
 
@@ -58,3 +60,17 @@ Security defaults:
58
60
  - no `soturail.run` MCP tool by default;
59
61
  - raw log expansion redacts probable secrets unless `allow_raw=true`;
60
62
  - provider cache hits are never invented.
63
+
64
+ ## Host Config Helpers
65
+
66
+ `soturail mcp config --agent claude|cursor|generic` writes a reviewed stdio snippet under `.soturail/exports/mcp/<agent>/mcp-config.json`.
67
+
68
+ The snippet runs:
69
+
70
+ ```bash
71
+ soturail mcp serve --transport stdio
72
+ ```
73
+
74
+ It does not assume a global application config path. Review it before adding it to an agent host.
75
+
76
+ `soturail mcp smoke` verifies `initialize`, `resources/list`, `resources/read` and `tools/list` without starting a long-running process, and confirms `soturail.run` is not exposed by default.
package/docs/metrics.md CHANGED
@@ -29,7 +29,8 @@ SotuRail metrics are local, append-only and transparent.
29
29
  - real provider cache hits only if imported metadata exists.
30
30
  - response compression reduction and preservation counts;
31
31
  - rules ingestion and validation counts;
32
- - benchmark fixture measurements.
32
+ - benchmark fixture measurements;
33
+ - agent export, MCP smoke and Workflow Rail benchmark measurements.
33
34
 
34
35
  Small command outputs can be larger after SotuRail adds raw recovery metadata. When that happens, `compression_effective` is `false` and the CLI prints the small-output warning instead of hiding the overhead.
35
36
 
@@ -28,6 +28,10 @@ soturail release verify-package
28
28
 
29
29
  This catches stale generated version files that local source checks might miss.
30
30
 
31
+ As of v0.3.3, release verification installs the packed `.tgz` into a clean temporary project and executes the CLI from `node_modules/soturail/dist/cli.js`. It does not call global `soturail`, `npx soturail` or `npm exec --package=soturail`, which avoids npm cache/global CLI false positives.
32
+
33
+ For v0.4.0 and later, keep using this packed-package gate before publishing. `npm exec --package=soturail@<version>` is a post-publish registry verification, not the pre-publish source of truth.
34
+
31
35
  ## Publish
32
36
 
33
37
  ```bash
@@ -41,9 +41,13 @@ soturail expand <raw_id> --allow-raw --yes
41
41
 
42
42
  MCP raw-log expansion also redacts probable secrets by default unless `allow_raw=true` is explicitly passed.
43
43
 
44
- ## MCP And Skills
44
+ ## MCP, Skills, Agents And Workflows
45
45
 
46
- The v0.3.0 MCP server does not expose arbitrary shell execution. Skill Rail exports are local files for human review; SotuRail does not auto-install unreviewed third-party skills.
46
+ The MCP server does not expose arbitrary shell execution. Skill Rail exports are local files for human review; SotuRail does not auto-install unreviewed third-party skills.
47
+
48
+ Agent installs are dry-run-first and backup-first. Unknown global host config locations are not modified automatically.
49
+
50
+ Workflow Rail does not push, merge or delete worktrees automatically. Worktree support is local and review-oriented.
47
51
 
48
52
  ## Limitations
49
53
 
package/docs/usage.md CHANGED
@@ -85,3 +85,20 @@ soturail release check
85
85
  MCP is local stdio JSON-RPC style transport and does not expose arbitrary shell execution in v0.3.0.
86
86
 
87
87
  For a first clean-folder walkthrough, see [first-real-workflow.md](first-real-workflow.md).
88
+
89
+ ## v0.4.0 Workflows
90
+
91
+ ```bash
92
+ soturail agents list
93
+ soturail agents doctor
94
+ soturail agents export --agent all
95
+ soturail agents install --agent claude --mode mcp --dry-run
96
+ soturail mcp config --agent generic
97
+ soturail mcp smoke
98
+ soturail context pack --target all
99
+ soturail workflow new "Implement feature"
100
+ soturail workflow list
101
+ soturail workflow start <id> --worktree --dry-run
102
+ ```
103
+
104
+ Agent exports are written to `.soturail/exports/agents/`. Workflow Rail stores local task state under `.soturail/workflows/`.
package/docs/windows.md CHANGED
@@ -78,7 +78,10 @@ PowerShell examples:
78
78
  ```powershell
79
79
  soturail mcp doctor
80
80
  soturail mcp manifest
81
+ soturail mcp smoke
82
+ soturail mcp config --agent generic
81
83
  soturail context pack --target generic
84
+ soturail context pack --target all
82
85
  ```
83
86
 
84
87
  CMD examples:
@@ -86,11 +89,34 @@ CMD examples:
86
89
  ```bat
87
90
  soturail mcp doctor
88
91
  soturail mcp manifest
92
+ soturail mcp smoke
93
+ soturail mcp config --agent generic
89
94
  soturail context pack --target generic
95
+ soturail context pack --target all
90
96
  ```
91
97
 
92
98
  When testing `soturail mcp serve --transport stdio`, send one JSON object per line. See `examples\mcp\` for payloads.
93
99
 
100
+ ## Agent And Workflow Commands
101
+
102
+ PowerShell:
103
+
104
+ ```powershell
105
+ soturail agents doctor
106
+ soturail agents export --agent all
107
+ soturail workflow new "Try SotuRail"
108
+ ```
109
+
110
+ CMD:
111
+
112
+ ```bat
113
+ soturail agents doctor
114
+ soturail agents export --agent all
115
+ soturail workflow new "Try SotuRail"
116
+ ```
117
+
118
+ Quote workflow titles and paths with spaces.
119
+
94
120
  ## Safety
95
121
 
96
122
  SotuRail blocks destructive command shapes through `soturail run`, including `rm -rf`, `sudo`, `del /s`, downloaded script piping and automatic `git push`.
@@ -107,7 +133,7 @@ npm run release:check
107
133
 
108
134
  `package.json`, `package-lock.json`, `node dist/cli.js --version`, the npm tarball name, the changelog and the release notes must all agree on the same version.
109
135
 
110
- v0.3.2 also verifies the packed tarball by installing it in a temporary clean project and running the installed CLI. This helps catch stale generated version files before publish.
136
+ v0.4.0 also verifies the packed tarball by installing it in a temporary clean project and running the installed CLI. This helps catch stale generated version files before publish.
111
137
 
112
138
  Use browser-based npm login when needed:
113
139
 
@@ -1,32 +1,54 @@
1
1
  # Workflow Rail
2
2
 
3
- Workflow Rail is planned for v0.4.0. It is not implemented in v0.3.x.
3
+ Workflow Rail is a local task state system for SotuRail v0.4.0. It stores auditable workflow artifacts under `.soturail/workflows/` and can optionally plan or create local Git worktrees.
4
4
 
5
- The goal is to describe repeatable engineering workflows as local, auditable artifacts that can later export into Skill Rail or an MCP server.
5
+ ```bash
6
+ soturail workflow new "Implement feature"
7
+ soturail workflow list
8
+ soturail workflow show <id>
9
+ soturail workflow plan <id>
10
+ soturail workflow start <id> --worktree --dry-run
11
+ soturail workflow status <id>
12
+ soturail workflow verify <id>
13
+ soturail workflow close <id>
14
+ ```
6
15
 
7
- Planned commands:
16
+ ## State Machine
8
17
 
9
- ```bash
10
- soturail workflow new <name>
11
- soturail workflow from-template <name>
12
- soturail workflow validate
13
- soturail workflow export skill
18
+ Workflows use explicit states:
19
+
20
+ - `draft`
21
+ - `planned`
22
+ - `active`
23
+ - `verifying`
24
+ - `ready_for_review`
25
+ - `closed`
26
+ - `blocked`
27
+
28
+ ## Storage
29
+
30
+ Each workflow uses:
31
+
32
+ ```txt
33
+ .soturail/workflows/<id>/
34
+ ├── workflow.yml
35
+ ├── plan.md
36
+ ├── tasks.md
37
+ ├── verification.md
38
+ └── logs/
14
39
  ```
15
40
 
16
- ## Security Requirements
41
+ ## Worktrees
42
+
43
+ `soturail workflow start <id> --worktree --dry-run` prints a local worktree plan. If run without `--dry-run` inside a Git repository, SotuRail may create a local worktree under `.soturail/worktrees/<id>/`.
17
44
 
18
- - Keep generated workflows local-first by default.
19
- - Validate workflow files before execution or export.
20
- - Scan for prompt injection.
21
- - Scan for destructive shell commands.
22
- - Scan for secret exfiltration.
23
- - Scan for downloaded script execution such as `curl ... | sh` and `wget ... | bash`.
24
- - Require human approval before enabling generated workflows or exported skills.
45
+ Safety rules:
25
46
 
26
- Workflow Rail should complement, not replace, the existing SotuRail rails: `soturail run`, raw log recovery, Knowledge-to-Rules, benchmarks, cache-normalized payloads and self-dogfooding reports.
47
+ - SotuRail does not push.
48
+ - SotuRail does not merge.
49
+ - SotuRail does not delete user work without explicit confirmation.
50
+ - Rollback instructions are printed when worktrees are planned.
27
51
 
28
- ## Current Road
52
+ ## Verification
29
53
 
30
- - v0.3.1: real usage polish, installed workflow examples and clean-folder smoke tests.
31
- - v0.3.2: stronger reducers and deduplication.
32
- - v0.4.0: real agent integrations and Workflow Rail.
54
+ `soturail workflow verify <id>` only runs configured safe checks when they are explicit. Without configured checks, it prints a checklist instead of inventing commands.
@@ -0,0 +1,11 @@
1
+ # Agent Examples
2
+
3
+ These examples show how to use SotuRail exports without modifying global agent configuration.
4
+
5
+ ```bash
6
+ soturail agents doctor
7
+ soturail agents export --agent all
8
+ soturail mcp config --agent generic
9
+ ```
10
+
11
+ Review generated files under `.soturail/exports/agents/` before enabling them in any agent host.
@@ -0,0 +1,8 @@
1
+ # Antigravity Example
2
+
3
+ ```bash
4
+ soturail agents export --agent antigravity
5
+ soturail context pack --target antigravity
6
+ ```
7
+
8
+ SotuRail v0.4.0 uses prompt-only/context-pack support for Antigravity. It does not assume a stable local config format.
@@ -0,0 +1,9 @@
1
+ # Claude Example
2
+
3
+ ```bash
4
+ soturail agents export --agent claude
5
+ soturail mcp config --agent claude
6
+ soturail hooks install --agent claude --mode safe-hooks --dry-run
7
+ ```
8
+
9
+ Review `CLAUDE.md`, `mcp-config.json` and `safe-hooks.md` before copying anything into Claude Code settings.
@@ -0,0 +1,8 @@
1
+ # Codex Example
2
+
3
+ ```bash
4
+ soturail agents export --agent codex
5
+ soturail context pack --target codex
6
+ ```
7
+
8
+ Use the generated `AGENTS.md` and context pack as project-local guidance. Do not route `git push` through `soturail run`.
@@ -0,0 +1,8 @@
1
+ # Cursor Example
2
+
3
+ ```bash
4
+ soturail agents export --agent cursor
5
+ soturail agents install --agent cursor --mode rules --dry-run
6
+ ```
7
+
8
+ Cursor rule exports are project-local and should be reviewed before writing to `.cursor/rules/`.
@@ -0,0 +1,8 @@
1
+ # Gemini Example
2
+
3
+ ```bash
4
+ soturail agents export --agent gemini
5
+ soturail context pack --target gemini
6
+ ```
7
+
8
+ Review `GEMINI.md` before adding it to a repository.
@@ -0,0 +1,13 @@
1
+ # Workflow Examples
2
+
3
+ Workflow Rail stores local task state under `.soturail/workflows/`.
4
+
5
+ ```bash
6
+ soturail workflow new "Fix bug"
7
+ soturail workflow list
8
+ soturail workflow plan <id>
9
+ soturail workflow start <id> --worktree --dry-run
10
+ soturail workflow verify <id>
11
+ ```
12
+
13
+ SotuRail does not push, merge or delete worktrees automatically.
@@ -0,0 +1,11 @@
1
+ # Bugfix Workflow
2
+
3
+ ```bash
4
+ soturail workflow new "Fix parser bug"
5
+ soturail workflow plan <id>
6
+ soturail context pack --target codex
7
+ soturail run npm test
8
+ soturail workflow verify <id>
9
+ ```
10
+
11
+ Keep evidence local and include raw IDs in the final review notes when useful.
@@ -0,0 +1,9 @@
1
+ # Release Workflow
2
+
3
+ ```bash
4
+ soturail self all
5
+ soturail release check
6
+ npm pack --dry-run
7
+ ```
8
+
9
+ Only create a GitHub release after npm publish succeeds and the published CLI version is verified.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soturail",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Local-first context rails for AI coding agents: reversible terminal compression, progressive repo reading, SDD workflows, hooks, benchmarks, memory and cache-friendly payloads.",
5
5
  "type": "module",
6
6
  "bin": {