deepclause-pi 0.1.4 → 0.2.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.
package/README.md CHANGED
@@ -131,6 +131,29 @@ The resulting `.dml` file is the plan. Steps use one of two executors:
131
131
 
132
132
  For each pi step, only the exact tools named in the committed plan are temporarily active. They must still be installed and active when execution begins; existing tool policies, UI, and approvals remain authoritative. DeepClause control tools cannot be requested recursively. The prior active-tool set is restored after success, failure, or cancellation.
133
133
 
134
+ ## Diagrams
135
+
136
+ Ask pi for a diagram of any DML file in plain language:
137
+
138
+ ```text
139
+ Make a presentation-grade diagram of .pi/deepclause/skills/deep_research.dml
140
+ Give me a specification-grade diagram of src/report.dml
141
+ ```
142
+
143
+ Pi calls the always-active `dc_diagram` model tool, which:
144
+
145
+ 1. extracts a deterministic Mermaid seed from the DML in-process,
146
+ 2. has the active pi model rewrite it in the requested grade,
147
+ 3. validates each attempt (structural checks, plus the real Mermaid parser when Chrome is available),
148
+ 4. writes the sidecar under `.pi/deepclause/diagrams/`, rebuilds the self-contained offline `viewer.html`, and opens it.
149
+
150
+ Grades:
151
+
152
+ - **presentation** — about 8-12 nodes, plain language, headline numbers; for slides and overviews.
153
+ - **specification** — function names, task/tool roles, post-conditions; for engineers.
154
+
155
+ Selecting `both` produces both sidecars. The DML source may be anywhere (workspace-relative or absolute); only the generated viewer is confined to `.pi/deepclause/`. `dc_diagram` never executes the DML and needs no shell approval. Regenerating a grade replaces only that grade's sidecar (`<name>.presentation.mmd` / `<name>.specification.mmd`). The Mermaid bundle is vendored so the viewer works offline.
156
+
134
157
  ## Runtime tools and approval
135
158
 
136
159
  The extension never exposes pi's general tool registry directly to ordinary DML. The optional `dc_run` tool runs an existing DML program; inside that runtime, only these host operations are registered:
@@ -0,0 +1,5 @@
1
+ export interface RenderOptions {
2
+ hideOutput?: boolean;
3
+ }
4
+ export declare function renderDml(file: string, src: string, opts?: RenderOptions): string;
5
+ export declare function renderSequence(file: string, src: string): string;