usesteady 0.1.0-alpha.53 → 0.1.0-alpha.54

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/CHANGELOG.md CHANGED
@@ -1,5 +1,146 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.0-alpha.54 - Onboarding quickstart and starter templates
4
+
5
+ **Released:** May 2026
6
+ **npm tag:** `alpha` - `npm install -g usesteady@alpha`
7
+
8
+ Second ship from the **Product Capability Track**. Goal: a brand-new
9
+ user can go from install to a successful, reviewed workflow in under
10
+ five minutes, without reading internal docs. Bounded scope: two new
11
+ read-only subcommands and a README walkthrough. Zero authority impact.
12
+
13
+ ### What ships
14
+
15
+ Three onboarding surfaces, all read-only:
16
+
17
+ - `usesteady quickstart` - one-screen orientation. What UseSteady is,
18
+ how to discover capabilities, how to pick a template, how to
19
+ customize and run, plain-language approval explanation, where
20
+ workflows execute, and how to stop safely. Pure text renderer;
21
+ byte-for-byte deterministic.
22
+ - `usesteady templates` - prints a list of safe starter workflows
23
+ with one-line purposes.
24
+ - `usesteady templates <name>` - prints one template in detail
25
+ (purpose, required/optional fields, example values, safety notes,
26
+ runnable JSON operations). `--output json` for machine-readable.
27
+
28
+ Five initial templates:
29
+
30
+ | Template | Operations |
31
+ |---|---|
32
+ | `append-to-file` | `append` |
33
+ | `safe-rename` | `rename` |
34
+ | `multi-file-replace` | `replace` (x3) |
35
+ | `non-destructive-cleanup` | `create_dir` + `rename` (x2) |
36
+ | `git-safe-review-flow` | `create` + `append` |
37
+
38
+ **No starter template uses `delete` or `run`.** Tests enforce this:
39
+ starter templates are deliberately non-destructive and command-free.
40
+ Every operation in every template is a member of `ALL_OPERATION_TYPES`
41
+ (`src/input/op-registry.ts`); the registry is the single source of
42
+ truth and tests assert there is no second op list to drift against.
43
+
44
+ README adds a "First 5 Minutes with UseSteady" section that walks
45
+ the exact happy path: `quickstart` -> `capabilities` -> `templates` ->
46
+ customize -> `batch` run -> approval / stop. No internal-doc
47
+ references required.
48
+
49
+ Implementation PR: `shortgigs/usesteady-core#304`.
50
+ Implementation modules: `src/shell/cli/quickstart.ts` and
51
+ `src/shell/cli/templates.ts` (pure functions only; no I/O, no
52
+ `process.exit`, no execution).
53
+
54
+ ### Friction -> Fix -> Invariant mapping
55
+
56
+ The Product Capability Track frictions are internally referenced as
57
+ F-1..F-9 in the design doc. This release closes:
58
+
59
+ | Friction (track ref) | Coverage | Invariant improved |
60
+ |---|---|---|
61
+ | F-1 Manual batch JSON loading | full | Operators can copy a complete runnable JSON operation set from any template; no hand-crafting from registry summaries. |
62
+ | F-7 Unclear first-run path | full | `usesteady quickstart` is the documented first command. README "First 5 Minutes" walks the full path without internal-doc references. |
63
+ | F-8 Command authoring friction | full | Templates surface required/optional fields, example values, and safety notes for each starter workflow before invocation. |
64
+ | F-2 Workflow scaffolding gap | partial | Five non-destructive templates cover the most common safe starting patterns. Custom workflows still require hand-authoring; that gap is deliberate. |
65
+ | F-5 Approval surprise / opaque flow | partial | Quickstart explains the approval gate, `--yes` semantics, and how to stop safely in plain language; the runtime approval surface itself is unchanged. |
66
+
67
+ ### Authority story
68
+
69
+ - Deterministic approval model: unchanged.
70
+ - No hidden execution: both new subcommands only print. Quickstart
71
+ renders static text. Templates renders static catalog data. Neither
72
+ module imports the planner, the safety gate, the executor, or any
73
+ approval surface.
74
+ - No autonomous authority expansion: no new authority granted. The
75
+ set of executable operations did NOT grow. Only inspection
76
+ surfaces grew.
77
+ - Explain-before-execute: strengthened. Operators now see a
78
+ pre-formatted, safety-noted recipe before authoring a workflow.
79
+ - Bounded execution semantics: unchanged. Templates are static data;
80
+ printing a template is not running one.
81
+ - `--yes` semantics: unchanged. `quickstart` and `templates` join
82
+ `capabilities` in the documented `--yes`-exempt list because they
83
+ never execute. Every other path still requires `--yes` for
84
+ `--output json` execution.
85
+
86
+ ### What does NOT change
87
+
88
+ - No `src/input/` change. No registry change. No IR change.
89
+ - No safety detector, drift detector, sanitizer, or canonicalizer
90
+ change. PRs #293 / #294 / #297 surfaces are untouched.
91
+ - No execution engine change. Planner, executor, and approval
92
+ surfaces are byte-identical to alpha.53.
93
+ - No new operation types. Templates compose only operations from the
94
+ existing `ALL_OPERATION_TYPES`.
95
+ - No new runtime dependencies.
96
+ - No model-insertion path change. No new prompt surfaces. No AI
97
+ workflow generation. Templates are hand-authored static data.
98
+ - No edits to ShortGigs, YODHA, StructureGuard, or SteadyHealth.
99
+
100
+ ### Tests
101
+
102
+ 73 of 73 tests pass across the three onboarding-adjacent surfaces:
103
+
104
+ - `tests/shell/capabilities.test.ts` (17, regression)
105
+ - `tests/shell/templates.test.ts` (41 new)
106
+ - `tests/shell/quickstart.test.ts` (15 new)
107
+
108
+ Key invariants enforced by tests:
109
+
110
+ - Every operation in every template uses a registered op type.
111
+ - No starter template uses `delete` or `run`.
112
+ - Quickstart text and template output are byte-for-byte deterministic.
113
+ - `--output json` works without `--yes` on all three read-only paths.
114
+ - Unknown template names exit non-zero with a helpful stderr line.
115
+ - Negative-content guarantees on quickstart: no "autonomous", no
116
+ "ai will fix", no "agent will" language anywhere in the orientation.
117
+
118
+ ### Release engineering
119
+
120
+ No changes to the release gate. `test:release` retains the `--retry=2`
121
+ flake mitigation from alpha.52. `check-stdin-ownership` runs the same
122
+ git-tracked-only scan.
123
+
124
+ ### Surface-specific monitoring
125
+
126
+ Stabilization window for the onboarding surface opens with this
127
+ release. Watch for:
128
+
129
+ - Confusion in the quickstart text (specific lines that mislead a
130
+ first-time user).
131
+ - Template copy/paste failures (JSON that doesn't parse cleanly
132
+ when pasted, escape-sequence misreads).
133
+ - Approval-flow surprises after following the quickstart (anything
134
+ the operator sees at run time that the quickstart did not prepare
135
+ them for).
136
+ - Trust/perception issues (any place where the operator cannot tell
137
+ whether something is "just printing" or "about to run").
138
+
139
+ If real friction surfaces in this window, one bounded follow-up PR
140
+ ships. No multi-candidate expansion.
141
+
142
+ ---
143
+
3
144
  ## 0.1.0-alpha.53 - Capability explorer (first Product Capability Track ship)
4
145
 
5
146
  **Released:** May 2026
package/README.md CHANGED
@@ -168,6 +168,70 @@ Requires Node.js 18+. Runs fully local. Optional: set `ANTHROPIC_API_KEY` to ena
168
168
 
169
169
  ---
170
170
 
171
+ ## First 5 Minutes with UseSteady
172
+
173
+ This is the fastest path from a fresh install to a successful, reviewed change.
174
+
175
+ ### 1. Read the orientation
176
+
177
+ ```bash
178
+ npx usesteady quickstart
179
+ ```
180
+
181
+ One screen. What UseSteady is, the steps below, plain-language approval, where workflows execute, how to stop. Read-only - this command does not run anything.
182
+
183
+ ### 2. See what operations exist
184
+
185
+ ```bash
186
+ npx usesteady capabilities
187
+ ```
188
+
189
+ The full catalog of supported operations (`replace`, `append`, `rename`, `create`, etc.), with the exact JSON shape for each. Source of truth - no second list to drift against.
190
+
191
+ ### 3. Pick a starter template
192
+
193
+ ```bash
194
+ npx usesteady templates
195
+ ```
196
+
197
+ Lists five safe, non-destructive starter workflows:
198
+
199
+ | Template | What it does |
200
+ |---|---|
201
+ | `append-to-file` | Add a block to an existing file (recommended first run). |
202
+ | `safe-rename` | Rename one file with explicit approval. |
203
+ | `multi-file-replace` | Same exact-text replacement across a hand-listed file set. |
204
+ | `non-destructive-cleanup` | Move files into a new directory via rename (no deletions). |
205
+ | `git-safe-review-flow` | Capture review notes in `REVIEW.md` without touching source. |
206
+
207
+ Print a template in detail:
208
+
209
+ ```bash
210
+ npx usesteady templates append-to-file
211
+ ```
212
+
213
+ You get the purpose, required fields, example values, safety notes, and a runnable JSON operation block.
214
+
215
+ ### 4. Customize and run
216
+
217
+ Copy the JSON operations from the template into a file (e.g. `ops.json` - as a JSON array), replace the placeholder values with your real values, then:
218
+
219
+ ```bash
220
+ npx usesteady batch ops.json
221
+ ```
222
+
223
+ UseSteady prints **SYSTEM WILL** with the exact operation, waits for your approval, and only runs after you say yes. Every operation. No exceptions.
224
+
225
+ ### 5. If you change your mind
226
+
227
+ At any approval prompt, choose **Reject** (or press `Ctrl+C`). The current operation is not applied; UseSteady exits. Operations approved earlier in the workflow are filesystem changes you already authorized one at a time; undo them via your version control (`git revert`) or by reversing the operation manually.
228
+
229
+ ### Approval, in one sentence
230
+
231
+ By default UseSteady stops before every operation. Add `--yes` only when you have already read and reviewed the entire spec (typical in CI).
232
+
233
+ ---
234
+
171
235
  ## Discover what UseSteady can do
172
236
 
173
237
  Print a structured catalog of every operation this build supports - read-only, never executes anything:
@@ -0,0 +1,41 @@
1
+ /**
2
+ * usesteady quickstart -- guided first-run onboarding text.
3
+ *
4
+ * Pure module. No I/O, no process.exit, no execution. Importing this
5
+ * module cannot read stdin, write the filesystem, spawn a process, or
6
+ * talk to a model. It exists to render a single-screen orientation that
7
+ * gets a brand-new user from install to first safe workflow in under five
8
+ * minutes.
9
+ *
10
+ * Determinism: the exported function is pure and returns identical bytes
11
+ * across runs for a given build. There is no template interpolation, no
12
+ * environment-dependent text, no clock-based output.
13
+ *
14
+ * Authority:
15
+ * - This module does not interact with the planner, the safety gate,
16
+ * the executor, the model-insertion path, or any approval surface.
17
+ * - Quickstart only PRINTS instructions. It never starts a workflow,
18
+ * never approves anything, never reads stdin, never writes files.
19
+ * - Every command suggested in the text goes through the existing
20
+ * CLI dispatcher; nothing new is granted authority by quickstart.
21
+ *
22
+ * Source of truth:
23
+ * - For the operation catalog, the text directs the user to
24
+ * `usesteady capabilities` (src/shell/cli/capabilities.ts).
25
+ * - For starter workflows, the text directs the user to
26
+ * `usesteady templates` (src/shell/cli/templates.ts).
27
+ * - For full CLI usage, the text directs the user to
28
+ * `usesteady help`.
29
+ * No content is duplicated; quickstart is a curated entry point, not
30
+ * a second source of truth.
31
+ *
32
+ * Design: docs/product/useability-and-guided-execution-track.md (Product
33
+ * Capability Track) -- onboarding clarity. Surface added in the first
34
+ * implementation slice of "first successful workflow in under 5 minutes."
35
+ */
36
+ /**
37
+ * Render the quickstart guide as a human-readable text block. Bytes are
38
+ * identical across runs for a given build. Always succeeds.
39
+ */
40
+ export declare function renderQuickstartText(): string;
41
+ //# sourceMappingURL=quickstart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quickstart.d.ts","sourceRoot":"","sources":["../../../../src/shell/cli/quickstart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;GAGG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAsH7C"}
@@ -0,0 +1,159 @@
1
+ /**
2
+ * usesteady quickstart -- guided first-run onboarding text.
3
+ *
4
+ * Pure module. No I/O, no process.exit, no execution. Importing this
5
+ * module cannot read stdin, write the filesystem, spawn a process, or
6
+ * talk to a model. It exists to render a single-screen orientation that
7
+ * gets a brand-new user from install to first safe workflow in under five
8
+ * minutes.
9
+ *
10
+ * Determinism: the exported function is pure and returns identical bytes
11
+ * across runs for a given build. There is no template interpolation, no
12
+ * environment-dependent text, no clock-based output.
13
+ *
14
+ * Authority:
15
+ * - This module does not interact with the planner, the safety gate,
16
+ * the executor, the model-insertion path, or any approval surface.
17
+ * - Quickstart only PRINTS instructions. It never starts a workflow,
18
+ * never approves anything, never reads stdin, never writes files.
19
+ * - Every command suggested in the text goes through the existing
20
+ * CLI dispatcher; nothing new is granted authority by quickstart.
21
+ *
22
+ * Source of truth:
23
+ * - For the operation catalog, the text directs the user to
24
+ * `usesteady capabilities` (src/shell/cli/capabilities.ts).
25
+ * - For starter workflows, the text directs the user to
26
+ * `usesteady templates` (src/shell/cli/templates.ts).
27
+ * - For full CLI usage, the text directs the user to
28
+ * `usesteady help`.
29
+ * No content is duplicated; quickstart is a curated entry point, not
30
+ * a second source of truth.
31
+ *
32
+ * Design: docs/product/useability-and-guided-execution-track.md (Product
33
+ * Capability Track) -- onboarding clarity. Surface added in the first
34
+ * implementation slice of "first successful workflow in under 5 minutes."
35
+ */
36
+ /**
37
+ * Render the quickstart guide as a human-readable text block. Bytes are
38
+ * identical across runs for a given build. Always succeeds.
39
+ */
40
+ export function renderQuickstartText() {
41
+ const lines = [];
42
+ lines.push("");
43
+ lines.push(" UseSteady -- first 5 minutes");
44
+ lines.push("");
45
+ lines.push(" What UseSteady is");
46
+ lines.push(" A command-line tool for governed workflow execution.");
47
+ lines.push(" You describe a change, review the exact operation, and approve");
48
+ lines.push(" it before anything runs. No hidden execution, no surprise");
49
+ lines.push(" actions, nothing happens without your explicit approval.");
50
+ lines.push("");
51
+ lines.push(" ---------------------------------------------------------------");
52
+ lines.push(" Step 1. See what UseSteady can do");
53
+ lines.push(" ---------------------------------------------------------------");
54
+ lines.push("");
55
+ lines.push(" usesteady capabilities");
56
+ lines.push("");
57
+ lines.push(" Prints the full catalog of supported operations. Read-only; this");
58
+ lines.push(" command never executes anything. Add --output json for a");
59
+ lines.push(" machine-readable shape.");
60
+ lines.push("");
61
+ lines.push(" ---------------------------------------------------------------");
62
+ lines.push(" Step 2. Pick a starter template");
63
+ lines.push(" ---------------------------------------------------------------");
64
+ lines.push("");
65
+ lines.push(" usesteady templates");
66
+ lines.push("");
67
+ lines.push(" Prints the list of safe starter workflows. Each one is a small,");
68
+ lines.push(" non-destructive recipe you can copy and customize. To see the");
69
+ lines.push(" full body of one template:");
70
+ lines.push("");
71
+ lines.push(" usesteady templates <name>");
72
+ lines.push("");
73
+ lines.push(" Recommended first template: append-to-file");
74
+ lines.push("");
75
+ lines.push(" usesteady templates append-to-file");
76
+ lines.push("");
77
+ lines.push(" Append is the safest starter: it never overwrites existing");
78
+ lines.push(" content and is reversible by editing the file back.");
79
+ lines.push("");
80
+ lines.push(" ---------------------------------------------------------------");
81
+ lines.push(" Step 3. Customize the template");
82
+ lines.push(" ---------------------------------------------------------------");
83
+ lines.push("");
84
+ lines.push(" Copy the JSON operations from the template output into a file");
85
+ lines.push(" (for example ops.json) and replace the placeholder values with");
86
+ lines.push(" your real values. The file is a JSON array of operations, e.g.:");
87
+ lines.push("");
88
+ lines.push(" [");
89
+ lines.push(" { \"type\": \"append\", \"file\": \"NOTES.md\", \"to\": \"hello from usesteady\\n\" }");
90
+ lines.push(" ]");
91
+ lines.push("");
92
+ lines.push(" ---------------------------------------------------------------");
93
+ lines.push(" Step 4. Run the workflow (with approval)");
94
+ lines.push(" ---------------------------------------------------------------");
95
+ lines.push("");
96
+ lines.push(" usesteady batch ops.json");
97
+ lines.push("");
98
+ lines.push(" UseSteady will:");
99
+ lines.push("");
100
+ lines.push(" 1. Show you the exact operation (SYSTEM WILL).");
101
+ lines.push(" 2. Wait for your approval before doing anything.");
102
+ lines.push(" 3. Only run after you say yes.");
103
+ lines.push("");
104
+ lines.push(" ---------------------------------------------------------------");
105
+ lines.push(" Approval, in plain language");
106
+ lines.push(" ---------------------------------------------------------------");
107
+ lines.push("");
108
+ lines.push(" By default, UseSteady stops and asks you before every operation.");
109
+ lines.push(" You see the exact file, the exact text, the exact change.");
110
+ lines.push("");
111
+ lines.push(" - To approve interactively: type the approve key when prompted.");
112
+ lines.push(" - To skip approval (CI/automation only): add --yes.");
113
+ lines.push(" - --yes means \"I have already reviewed this spec\".");
114
+ lines.push(" Do not use --yes for workflows you have not read.");
115
+ lines.push("");
116
+ lines.push(" ---------------------------------------------------------------");
117
+ lines.push(" Where do workflows execute?");
118
+ lines.push(" ---------------------------------------------------------------");
119
+ lines.push("");
120
+ lines.push(" Operations run locally, in your current working directory, as");
121
+ lines.push(" your user. UseSteady does not:");
122
+ lines.push("");
123
+ lines.push(" - upload your files anywhere;");
124
+ lines.push(" - run a background daemon;");
125
+ lines.push(" - spawn workers that outlive the command;");
126
+ lines.push(" - perform any operation you did not approve.");
127
+ lines.push("");
128
+ lines.push(" A CLI invocation ends when it ends. Its authority ends with it.");
129
+ lines.push("");
130
+ lines.push(" ---------------------------------------------------------------");
131
+ lines.push(" How to stop safely");
132
+ lines.push(" ---------------------------------------------------------------");
133
+ lines.push("");
134
+ lines.push(" At any approval prompt, choose Reject (or press Ctrl+C). The");
135
+ lines.push(" current operation is not applied; UseSteady exits. Operations");
136
+ lines.push(" already approved earlier in the workflow remain applied (they");
137
+ lines.push(" were filesystem changes you authorized one at a time).");
138
+ lines.push("");
139
+ lines.push(" To undo an applied change:");
140
+ lines.push("");
141
+ lines.push(" - For tracked files: git checkout / git revert.");
142
+ lines.push(" - For renames: rename back with the values swapped.");
143
+ lines.push(" - For appends: edit the file to remove the added block.");
144
+ lines.push("");
145
+ lines.push(" ---------------------------------------------------------------");
146
+ lines.push(" Next steps");
147
+ lines.push(" ---------------------------------------------------------------");
148
+ lines.push("");
149
+ lines.push(" usesteady help Full CLI usage");
150
+ lines.push(" usesteady capabilities Catalog of operations");
151
+ lines.push(" usesteady templates List of starter workflows");
152
+ lines.push(" usesteady templates <name> One template, in detail");
153
+ lines.push("");
154
+ lines.push(" Quickstart is read-only. Running this command does not execute");
155
+ lines.push(" anything; it only prints this guide.");
156
+ lines.push("");
157
+ return lines.join("\n");
158
+ }
159
+ //# sourceMappingURL=quickstart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../../../src/shell/cli/quickstart.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH;;;GAGG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAC7C,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC;IAClC,KAAK,CAAC,IAAI,CAAC,4DAA4D,CAAC,CAAC;IACzE,KAAK,CAAC,IAAI,CAAC,sEAAsE,CAAC,CAAC;IACnF,KAAK,CAAC,IAAI,CAAC,iEAAiE,CAAC,CAAC;IAC9E,KAAK,CAAC,IAAI,CAAC,gEAAgE,CAAC,CAAC;IAC7E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CA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2D,CAAC,CAAC;IACxE,KAAK,CAAC,IAAI,CAAC,+DAA+D,CAAC,CAAC;IAC5E,KAAK,CAAC,IAAI,CAAC,6DAA6D,CAAC,CAAC;IAC1E,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,KAAK,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAC;IAC/E,KAAK,CAAC,IAAI,CAAC,wCAAwC,CAAC,CAAC;IACrD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
@@ -0,0 +1,142 @@
1
+ /**
2
+ * usesteady templates -- read-only catalog of safe starter workflows.
3
+ *
4
+ * Pure module. No I/O, no process.exit, no execution. Importing this module
5
+ * cannot read stdin, write the filesystem, spawn a process, or talk to a
6
+ * model. It exists to render operator-facing example workflows that the
7
+ * operator can copy, customize, and run through the existing approval flow.
8
+ *
9
+ * Source of truth: every operation referenced in every template MUST be a
10
+ * member of ALL_OPERATION_TYPES (src/input/op-registry.ts). Tests assert
11
+ * this. There is no second op list to drift against.
12
+ *
13
+ * Wire shape: each operation in a template matches the same public JSON
14
+ * shape exposed by `usesteady capabilities` (src/shell/cli/capabilities.ts
15
+ * PUBLIC_JSON_EXAMPLES). The operator can take the printed JSON, replace
16
+ * the placeholder values, and run it through `usesteady --json '...' --yes`
17
+ * (single op) or via a batch file (`usesteady batch <file> --yes`).
18
+ *
19
+ * Authority:
20
+ * - This module does not interact with the planner, the safety gate, the
21
+ * executor, the model-insertion path, or any approval surface.
22
+ * - The output is informational. Printing a template does NOT approve or
23
+ * execute anything. To actually run a customized template the operator
24
+ * must invoke a separate `usesteady run` / `--json` / `batch` command
25
+ * which then goes through the standard approval flow.
26
+ * - Templates contain placeholder values only (e.g. "path/to/file.ts").
27
+ * No template targets a real file in the operator's workspace.
28
+ *
29
+ * Determinism: every exported function is pure and order-stable.
30
+ * - templates are returned in TEMPLATE_NAMES order (frozen);
31
+ * - JSON output is single-line with stable key order;
32
+ * - text output bytes are identical across runs for a given build.
33
+ *
34
+ * Design: docs/product/useability-and-guided-execution-track.md section 3.2.
35
+ */
36
+ import { type OperationType } from "../../input/op-registry.js";
37
+ /**
38
+ * Stable identifiers for templates. Frozen. Tests assert that every name
39
+ * here has a matching entry in TEMPLATE_REGISTRY and vice versa.
40
+ */
41
+ export declare const TEMPLATE_NAMES: readonly ["append-to-file", "safe-rename", "multi-file-replace", "non-destructive-cleanup", "git-safe-review-flow"];
42
+ export type TemplateName = typeof TEMPLATE_NAMES[number];
43
+ /**
44
+ * Public template entry shape. Stable; this is the JSON output schema for
45
+ * `usesteady templates <name> --output json`.
46
+ *
47
+ * - `name` : kebab-case identifier (stable across versions).
48
+ * - `purpose` : one-sentence description of what the template does.
49
+ * - `requiredFields` : placeholder field names the operator MUST replace.
50
+ * - `optionalFields` : placeholder field names the operator MAY replace.
51
+ * - `exampleValues` : ordered (key, description) pairs documenting what
52
+ * realistic values look like for each placeholder.
53
+ * - `safetyNotes` : short bullet list of what to verify before running.
54
+ * - `operations` : array of public-JSON-shape operation objects with
55
+ * placeholder values. Operator copies, customizes,
56
+ * and runs through the standard approval flow.
57
+ */
58
+ export type TemplateEntry = {
59
+ readonly name: TemplateName;
60
+ readonly purpose: string;
61
+ readonly requiredFields: readonly string[];
62
+ readonly optionalFields: readonly string[];
63
+ readonly exampleValues: readonly {
64
+ readonly field: string;
65
+ readonly example: string;
66
+ }[];
67
+ readonly safetyNotes: readonly string[];
68
+ readonly operations: readonly Readonly<Record<string, unknown>>[];
69
+ };
70
+ /**
71
+ * Top-level catalog shape. Stable; the JSON output of
72
+ * `usesteady templates --output json` is exactly this.
73
+ */
74
+ export type TemplatesCatalog = {
75
+ readonly templates: readonly {
76
+ readonly name: TemplateName;
77
+ readonly purpose: string;
78
+ }[];
79
+ };
80
+ /**
81
+ * Look up a template by name. Pure data accessor. Returns undefined for
82
+ * unknown names -- callers decide how to surface that (exit code, error
83
+ * message, etc.).
84
+ */
85
+ export declare function getTemplate(name: string): TemplateEntry | undefined;
86
+ /**
87
+ * Type guard for unknown values. Used by the CLI dispatcher to decide
88
+ * whether `usesteady templates <name>` should print a template or report
89
+ * an unknown-template error.
90
+ */
91
+ export declare function isKnownTemplateName(value: unknown): value is TemplateName;
92
+ /**
93
+ * Build the top-level catalog. Pure. Deterministic. Templates are returned
94
+ * in TEMPLATE_NAMES order (which is itself frozen).
95
+ */
96
+ export declare function buildTemplatesCatalog(): TemplatesCatalog;
97
+ /**
98
+ * Internal helper: assert every operation in every template uses a known
99
+ * operation type. Exported for the test suite -- the assertion runs at test
100
+ * time so a future template addition that introduces a typo or an unknown
101
+ * op type fails CI rather than shipping broken JSON wire shapes.
102
+ */
103
+ export declare function getAllTemplateOperationTypes(): readonly string[];
104
+ /**
105
+ * Returns true if every operation in every template uses an operation type
106
+ * present in ALL_OPERATION_TYPES. Pure. Tests assert this.
107
+ */
108
+ export declare function allTemplateOperationsUseRegisteredOps(): boolean;
109
+ /**
110
+ * Render the top-level catalog as a single-line JSON string terminated by
111
+ * exactly one newline. Determinism: JSON.stringify preserves insertion
112
+ * order for string keys per the ECMAScript spec.
113
+ */
114
+ export declare function renderTemplatesListJson(): string;
115
+ /**
116
+ * Render the top-level catalog as a human-readable text block. Bytes are
117
+ * identical across runs for a given build.
118
+ */
119
+ export declare function renderTemplatesListText(): string;
120
+ /**
121
+ * Render one template as JSON. Returns undefined for unknown names so the
122
+ * caller can decide the exit-code policy.
123
+ */
124
+ export declare function renderTemplateDetailJson(name: string): string | undefined;
125
+ /**
126
+ * Render one template as a human-readable text block. Returns undefined
127
+ * for unknown names so the caller can decide the exit-code policy.
128
+ */
129
+ export declare function renderTemplateDetailText(name: string): string | undefined;
130
+ /**
131
+ * Render an unknown-template error as a text block. Centralized so the CLI
132
+ * dispatcher and tests see the same wording.
133
+ */
134
+ export declare function renderUnknownTemplateText(name: string): string;
135
+ /**
136
+ * Re-export OperationType to keep callers that need to inspect template
137
+ * operations from having to import op-registry separately. Read-only --
138
+ * the registry itself is in op-registry.ts and is the single source of
139
+ * truth.
140
+ */
141
+ export type { OperationType };
142
+ //# sourceMappingURL=templates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../../src/shell/cli/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAEL,KAAK,aAAa,EACnB,MAAM,4BAA4B,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,cAAc,qHAMhB,CAAC;AAEZ,MAAM,MAAM,YAAY,GAAG,OAAO,cAAc,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,cAAc,EAAE,SAAS,MAAM,EAAE,CAAC;IAC3C,QAAQ,CAAC,aAAa,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxF,QAAQ,CAAC,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IACxC,QAAQ,CAAC,UAAU,EAAE,SAAS,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,EAAE,CAAC;CACnE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,QAAQ,CAAC,SAAS,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;QAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC1F,CAAC;AA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