@rotorsoft/act-diagram 0.3.10 → 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 (38) hide show
  1. package/README.md +27 -1
  2. package/dist/.tsbuildinfo +1 -1
  3. package/dist/@types/cli/colors.d.ts +19 -0
  4. package/dist/@types/cli/colors.d.ts.map +1 -0
  5. package/dist/@types/cli/contract-index.d.ts +57 -0
  6. package/dist/@types/cli/contract-index.d.ts.map +1 -0
  7. package/dist/@types/cli/format.d.ts +22 -0
  8. package/dist/@types/cli/format.d.ts.map +1 -0
  9. package/dist/@types/cli/index.d.ts +32 -0
  10. package/dist/@types/cli/index.d.ts.map +1 -0
  11. package/dist/@types/cli/json-schema.d.ts +13 -0
  12. package/dist/@types/cli/json-schema.d.ts.map +1 -0
  13. package/dist/@types/cli/load-project.d.ts +15 -0
  14. package/dist/@types/cli/load-project.d.ts.map +1 -0
  15. package/dist/@types/cli/markdown.d.ts +3 -0
  16. package/dist/@types/cli/markdown.d.ts.map +1 -0
  17. package/dist/@types/cli/open-editor.d.ts +23 -0
  18. package/dist/@types/cli/open-editor.d.ts.map +1 -0
  19. package/dist/@types/cli/repl.d.ts +3 -0
  20. package/dist/@types/cli/repl.d.ts.map +1 -0
  21. package/dist/@types/cli/vim-keys.d.ts +34 -0
  22. package/dist/@types/cli/vim-keys.d.ts.map +1 -0
  23. package/dist/@types/client/components/Diagram.d.ts.map +1 -1
  24. package/dist/@types/client/lib/build-model.d.ts.map +1 -1
  25. package/dist/@types/client/lib/layout.d.ts +6 -0
  26. package/dist/@types/client/lib/layout.d.ts.map +1 -1
  27. package/dist/@types/client/lib/schema-extract.d.ts +37 -0
  28. package/dist/@types/client/lib/schema-extract.d.ts.map +1 -0
  29. package/dist/@types/client/types/domain-model.d.ts +15 -0
  30. package/dist/@types/client/types/domain-model.d.ts.map +1 -1
  31. package/dist/cli/act.js +3324 -0
  32. package/dist/cli/act.js.map +1 -0
  33. package/dist/index.cjs +413 -39
  34. package/dist/index.cjs.map +1 -1
  35. package/dist/index.js +413 -39
  36. package/dist/index.js.map +1 -1
  37. package/dist/styles.css +2 -2
  38. package/package.json +13 -7
package/README.md CHANGED
@@ -6,6 +6,8 @@
6
6
 
7
7
  Interactive domain model diagram for [@rotorsoft/act](https://www.npmjs.com/package/@rotorsoft/act) event-sourced apps. Extracts states, actions, events, reactions, slices, and projections from TypeScript source code and renders them as an interactive SVG.
8
8
 
9
+ > **Stability:** Public API governed by the [Act Stability Charter](../../STABILITY.md). The diagram **output shape** (SVG structure, click-through anchors) is *not* part of the stability surface and may evolve. Charter takes effect at 1.0 (gated on [milestone 1.0](https://github.com/Rotorsoft/act-root/milestone/1)).
10
+
9
11
  ## Features
10
12
 
11
13
  - **Real-time visualization** — SVG diagram updates as source files change
@@ -15,7 +17,8 @@ Interactive domain model diagram for [@rotorsoft/act](https://www.npmjs.com/pack
15
17
  - **IDE-agnostic** — works over props, postMessage, or WebSocket (see [act-nvim](https://github.com/Rotorsoft/act-nvim) for Neovim integration)
16
18
  - **Embeddable** — React component for any host (IDE webview, standalone app, docs site)
17
19
  - **AI refinement** — optional prompt bar to generate code via a streaming endpoint (see [AI server](#ai-server-optional))
18
- - **High test coverage** — over 300 tests covering extraction, layout, navigation, and error paths
20
+ - **`act` CLI** — terminal companion that walks the model interactively, surfaces Zod schemas as captured source text, and jumps into `$EDITOR` at any file:line (see [the act CLI](#the-act-cli))
21
+ - **High test coverage** — over 400 tests covering extraction, layout, navigation, the CLI, and error paths
19
22
 
20
23
  ## Installation
21
24
 
@@ -202,6 +205,29 @@ type DiagramMessage =
202
205
  | { type: "aiRequest"; prompt: string; files: FileTab[] };
203
206
  ```
204
207
 
208
+ ## The `act` CLI
209
+
210
+ A terminal companion for the diagram. Reuses the same parser to walk the model, but renders neighborhoods as text and lets you jump into `$EDITOR` at any file:line.
211
+
212
+ ```sh
213
+ # From the monorepo root
214
+ pnpm act # interactive: pick category → entry → detail
215
+ pnpm act packages/wolfdesk # target a specific package
216
+ pnpm act -q TicketOpened # non-interactive: print one entity and exit
217
+ ```
218
+
219
+ In interactive mode you navigate with arrow keys (powered by [`@clack/prompts`](https://github.com/natemoo-re/clack)). Each entry shows producers, consumers, captured Zod schema text, deprecation status (via the `_v<n>` convention), and a one-key shortcut to open the source in `$EDITOR` (`$VISUAL` takes precedence). VS Code, Cursor, vim, nvim, nano, and emacs are all recognized.
220
+
221
+ `-q <name>` is the script-friendly path — exits 0 with the detail on a single match, 0 with the match list on ambiguity, 1 with no matches. CI uses this to smoke-test the parser against the example apps.
222
+
223
+ The CLI ships as the `act` bin from this package, so:
224
+
225
+ ```sh
226
+ npx -p @rotorsoft/act-diagram act
227
+ ```
228
+
229
+ works from any project that has the package installed.
230
+
205
231
  ## AI server (optional)
206
232
 
207
233
  The `AiBar` component dispatches refinement prompts to a streaming endpoint. The package ships with a reference server at `src/server/server.ts` (port 4002) that forwards prompts to Anthropic's API: