@redspec/cli 0.1.0-alpha.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Nate Hernandez
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 ADDED
@@ -0,0 +1,8 @@
1
+ # @redspec/cli
2
+
3
+ ```
4
+ npx @redspec/cli init
5
+ redspec status | check | new | accept | sync | doctor | board
6
+ ```
7
+
8
+ See the root README for the commands, and `docs/agents/redspec.md` in an initialised repo for the conventions.
package/bin/redspec.js ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import("../dist/index.js").then((m) => m.run(process.argv))
@@ -0,0 +1,110 @@
1
+ import { Command } from 'commander';
2
+ import { Framework, Harness, SpecConfig, LoadedSpec, BundleReport, Finding } from '@redspec/core';
3
+ import { Harness as Harness$1 } from '@redspec/method';
4
+
5
+ type AcceptOptions = {
6
+ ids?: string[];
7
+ slice?: string;
8
+ clarification?: string;
9
+ /** Override the configured command. Tests use `true`/`false`. */
10
+ command?: string;
11
+ quiet?: boolean;
12
+ };
13
+ /**
14
+ * Re-stamp artifacts -- but only after the verification command passes in this
15
+ * same invocation. This is where all the discipline in the system can leak
16
+ * out, exactly as `--update-snapshots` does elsewhere, so there is no flag that
17
+ * skips the run.
18
+ */
19
+ declare function accept(root: string, opts: AcceptOptions): Promise<number>;
20
+
21
+ declare function check(root: string, opts?: {
22
+ json?: boolean;
23
+ quiet?: boolean;
24
+ }): Promise<number>;
25
+
26
+ declare function doctor(root: string): Promise<number>;
27
+
28
+ type Written = {
29
+ path: string;
30
+ action: "created" | "updated" | "kept";
31
+ };
32
+ declare class Writer {
33
+ readonly root: string;
34
+ written: Written[];
35
+ constructor(root: string);
36
+ /** Write only if the file does not exist. */
37
+ create(rel: string, content: string): void;
38
+ /** Overwrite; these are generated files that carry a "generated" header. */
39
+ write(rel: string, content: string): void;
40
+ /** Replace or append a marked section, leaving the rest of the file alone. */
41
+ section(rel: string, content: string): void;
42
+ append(rel: string, content: string): void;
43
+ read(rel: string): string | null;
44
+ }
45
+
46
+ type InitOptions = {
47
+ root: string;
48
+ yes?: boolean;
49
+ harness?: string;
50
+ framework?: Framework;
51
+ quiet?: boolean;
52
+ /** Write the files but leave the dependencies to the caller. */
53
+ skipInstall?: boolean;
54
+ };
55
+ declare function init(opts: InitOptions): Promise<{
56
+ writer: Writer;
57
+ install: string[];
58
+ harnesses: Harness[];
59
+ framework: Framework;
60
+ }>;
61
+
62
+ declare function newFeature(root: string, slug: string, quiet?: boolean): Promise<number>;
63
+ declare function newState(root: string, id: string, opts: {
64
+ surface?: string;
65
+ quiet?: boolean;
66
+ }): Promise<number>;
67
+ declare function newRule(root: string, id: string, opts: {
68
+ feature?: string;
69
+ form: string;
70
+ quiet?: boolean;
71
+ }): Promise<number>;
72
+ declare function newSlice(root: string, slug: string, name: string, opts: {
73
+ claims: string[];
74
+ amends: string[];
75
+ quiet?: boolean;
76
+ }): Promise<number>;
77
+ /** Regenerate the journey tier from the flows: one fixme per reachable path. */
78
+ declare function newJourneys(root: string, slug: string, quiet?: boolean): Promise<number>;
79
+
80
+ declare function status(root: string, opts?: {
81
+ ids?: string;
82
+ }): Promise<number>;
83
+
84
+ /** Render every configured harness's context and record what was written. */
85
+ declare function sync(root: string, config: SpecConfig, harnesses?: Harness$1[]): Writer;
86
+
87
+ type Context = {
88
+ root: string;
89
+ config: SpecConfig;
90
+ configPath: string | null;
91
+ specs: LoadedSpec[];
92
+ reports: BundleReport[];
93
+ /** Findings not tied to one bundle. */
94
+ extra: Finding[];
95
+ pkg: Record<string, unknown> | null;
96
+ };
97
+ declare function loadContext(root?: string, now?: Date): Promise<Context>;
98
+
99
+ type Detection = {
100
+ harness: Harness;
101
+ evidence: string;
102
+ };
103
+ /** Which agent harnesses this repo already shows signs of. */
104
+ declare function detectHarnesses(root: string, env?: NodeJS.ProcessEnv): Detection[];
105
+ declare function detectFramework(pkg: Record<string, unknown> | null): Framework;
106
+
107
+ declare function program(): Command;
108
+ declare function run(argv: string[]): Promise<void>;
109
+
110
+ export { accept, check, detectFramework, detectHarnesses, doctor, init, loadContext, newFeature, newJourneys, newRule, newSlice, newState, program, run, status, sync };