@thynameisjayvee/alpha-cli 0.1.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 (69) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +143 -0
  3. package/bin/alpha.js +15 -0
  4. package/dist/cli.d.ts +12 -0
  5. package/dist/cli.d.ts.map +1 -0
  6. package/dist/cli.js +125 -0
  7. package/dist/cli.js.map +1 -0
  8. package/dist/core/alpha.d.ts +64 -0
  9. package/dist/core/alpha.d.ts.map +1 -0
  10. package/dist/core/alpha.js +94 -0
  11. package/dist/core/alpha.js.map +1 -0
  12. package/dist/core/generator/index.d.ts +16 -0
  13. package/dist/core/generator/index.d.ts.map +1 -0
  14. package/dist/core/generator/index.js +231 -0
  15. package/dist/core/generator/index.js.map +1 -0
  16. package/dist/core/implementation/index.d.ts +22 -0
  17. package/dist/core/implementation/index.d.ts.map +1 -0
  18. package/dist/core/implementation/index.js +398 -0
  19. package/dist/core/implementation/index.js.map +1 -0
  20. package/dist/core/init/catalog.d.ts +23 -0
  21. package/dist/core/init/catalog.d.ts.map +1 -0
  22. package/dist/core/init/catalog.js +87 -0
  23. package/dist/core/init/catalog.js.map +1 -0
  24. package/dist/core/init/index.d.ts +10 -0
  25. package/dist/core/init/index.d.ts.map +1 -0
  26. package/dist/core/init/index.js +214 -0
  27. package/dist/core/init/index.js.map +1 -0
  28. package/dist/core/requirements/index.d.ts +10 -0
  29. package/dist/core/requirements/index.d.ts.map +1 -0
  30. package/dist/core/requirements/index.js +232 -0
  31. package/dist/core/requirements/index.js.map +1 -0
  32. package/dist/core/reviewer/index.d.ts +29 -0
  33. package/dist/core/reviewer/index.d.ts.map +1 -0
  34. package/dist/core/reviewer/index.js +419 -0
  35. package/dist/core/reviewer/index.js.map +1 -0
  36. package/dist/core/stack/index.d.ts +10 -0
  37. package/dist/core/stack/index.d.ts.map +1 -0
  38. package/dist/core/stack/index.js +243 -0
  39. package/dist/core/stack/index.js.map +1 -0
  40. package/dist/index.d.ts +29 -0
  41. package/dist/index.d.ts.map +1 -0
  42. package/dist/index.js +32 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/types/index.d.ts +128 -0
  45. package/dist/types/index.d.ts.map +1 -0
  46. package/dist/types/index.js +5 -0
  47. package/dist/types/index.js.map +1 -0
  48. package/dist/utils/config.d.ts +105 -0
  49. package/dist/utils/config.d.ts.map +1 -0
  50. package/dist/utils/config.js +99 -0
  51. package/dist/utils/config.js.map +1 -0
  52. package/dist/utils/file-system.d.ts +17 -0
  53. package/dist/utils/file-system.d.ts.map +1 -0
  54. package/dist/utils/file-system.js +48 -0
  55. package/dist/utils/file-system.js.map +1 -0
  56. package/dist/utils/input.d.ts +18 -0
  57. package/dist/utils/input.d.ts.map +1 -0
  58. package/dist/utils/input.js +50 -0
  59. package/dist/utils/input.js.map +1 -0
  60. package/dist/utils/logger.d.ts +37 -0
  61. package/dist/utils/logger.d.ts.map +1 -0
  62. package/dist/utils/logger.js +109 -0
  63. package/dist/utils/logger.js.map +1 -0
  64. package/dist/utils/paths.d.ts +26 -0
  65. package/dist/utils/paths.d.ts.map +1 -0
  66. package/dist/utils/paths.js +51 -0
  67. package/dist/utils/paths.js.map +1 -0
  68. package/package.json +79 -0
  69. package/scripts/postinstall.js +110 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 thynameisjayvee
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,143 @@
1
+ # Alpha
2
+
3
+ Alpha is an **assistive harness** for AI-driven development. It is **not** an agent: it never edits your code and never spawns or triggers other agents (Cursor, Claude, etc.).
4
+
5
+ Instead, the LLM agent is the brain and Alpha is the tooling it calls. The agent invokes `alpha <command>` (or `pnpm alpha <command>` / `npx alpha <command>`, or a generated `/alpha-*` slash command), and Alpha:
6
+
7
+ - **emits** structured templates, questionnaires, and plans for the agent to act on, and
8
+ - **ingests** the agent's content, validates it, and persists artifacts under `.alpha/`, and
9
+ - runs **deterministic** analysis (e.g. static code review) that needs no LLM at all.
10
+
11
+ The agent reads Alpha's output and applies any code changes itself.
12
+
13
+ ## Why this design
14
+
15
+ - **No hidden magic.** Alpha never guesses with fake "AI" heuristics and never silently drives another agent. What it does is deterministic and inspectable.
16
+ - **Agent-drivable.** Commands are non-interactive by default and print machine-readable output to stdout (human logs go to stderr). Add `--json` for a `{ ok, command, data }` envelope.
17
+ - **Human-friendly too.** Add `--interactive` to any authoring command to answer prompts yourself.
18
+ - **Cross-agent.** `alpha init` generates a universal `AGENTS.md`/`SKILL.md` plus Claude (`.claude/commands` + `CLAUDE.md`) and Cursor (`.cursor/commands`) command files from one source of truth.
19
+
20
+ ## Install
21
+
22
+ ```bash
23
+ npm install -D @thynameisjayvee/alpha-cli
24
+ # then generate the agent skill files:
25
+ npx alpha init
26
+ ```
27
+
28
+ Postinstall creates `.alpha/` and adds it to `.gitignore`. `alpha init` generates the agent-facing skill/command files.
29
+
30
+ ## Commands
31
+
32
+ | Command | What it does |
33
+ |---------|--------------|
34
+ | `alpha init` | Scaffold `.alpha/` and generate agent skill files (`AGENTS.md`, `SKILL.md`, `.cursor/`, `.claude/`). |
35
+ | `alpha gather` | Emit a requirements questionnaire, or ingest answers into `.alpha/project-context.json`. |
36
+ | `alpha stack` | Emit reference tech stacks, or ingest a chosen/custom stack into `.alpha/tech-stack.json`. |
37
+ | `alpha spec` | Emit a spec authoring template / skeleton, or ingest a finished spec into `.alpha/specs/`. |
38
+ | `alpha review` | Run deterministic static analysis and write a findings report to `.alpha/reports/`. |
39
+ | `alpha implement` | Parse the latest report and emit a per-finding fix plan for you to apply. |
40
+ | `alpha workflow` | Run `gather → stack → spec → review → implement` in sequence. |
41
+
42
+ ### Global options
43
+
44
+ - `--json` — emit a machine-readable JSON envelope on stdout.
45
+ - `-i, --interactive` — use human-facing prompts instead of emit/ingest.
46
+
47
+ ## The emit / ingest pattern
48
+
49
+ Steps that require judgement don't fake intelligence. They either hand you a template (**emit**) or accept your content (**ingest**).
50
+
51
+ ```bash
52
+ # 1. EMIT: ask Alpha what it needs
53
+ alpha gather
54
+ # → prints a questionnaire (markdown), or use --json for structured form
55
+
56
+ # 2. INGEST: give Alpha the answers (file or stdin via `-`)
57
+ alpha gather --input answers.json
58
+ echo '{ "project_name": "Demo", "primary_goal": "ship fast" }' | alpha gather --input -
59
+ ```
60
+
61
+ > Stdin is only read when you pass `--input -`, so a bare command never blocks.
62
+
63
+ ## Review then implement
64
+
65
+ ```bash
66
+ # Deterministic analysis → report on disk
67
+ alpha review --target src/
68
+
69
+ # Turn the latest report into an actionable plan (you apply the edits)
70
+ alpha implement --severity critical,high
71
+
72
+ # After applying changes, re-check and clean up the report when resolved
73
+ alpha implement --severity critical,high --verify --cleanup
74
+ ```
75
+
76
+ `alpha implement` emits prompts; it does not modify files. You (or your agent) make the changes.
77
+
78
+ ## Programmatic API
79
+
80
+ ```typescript
81
+ import { Alpha } from '@thynameisjayvee/alpha-cli';
82
+
83
+ const alpha = await Alpha.open();
84
+
85
+ await alpha.init();
86
+ const review = await alpha.review({ target: 'src/' });
87
+ await alpha.implement({ severity: 'critical,high', verify: true });
88
+ ```
89
+
90
+ Individual functions are also exported: `runInit`, `gatherRequirements`, `adviseStack`, `generateSpec`, `runReview`, `runImplementation`, plus the `emit` / `setJsonMode` helpers and path/fs utilities.
91
+
92
+ ## Artifacts
93
+
94
+ ```
95
+ your-project/
96
+ ├── .alpha/ # gitignored
97
+ │ ├── config.json
98
+ │ ├── project-context.json # from `gather`
99
+ │ ├── tech-stack.json # from `stack`
100
+ │ ├── specs/ # from `spec`
101
+ │ └── reports/ # from `review`, consumed by `implement`
102
+ ├── AGENTS.md # generated by `alpha init`
103
+ ├── SKILL.md # generated by `alpha init`
104
+ ├── .cursor/commands/alpha-*.md
105
+ └── .claude/commands/alpha-*.md
106
+ ```
107
+
108
+ ## Configuration
109
+
110
+ `.alpha/config.json`:
111
+
112
+ ```json
113
+ {
114
+ "version": "0.1.0",
115
+ "output": {
116
+ "alphaDir": ".alpha",
117
+ "specsDir": ".alpha/specs",
118
+ "reportsDir": ".alpha/reports"
119
+ },
120
+ "review": {
121
+ "defaultChecks": ["quality", "security", "performance"]
122
+ },
123
+ "implementation": {
124
+ "autoVerify": false,
125
+ "cleanupOnVerify": false
126
+ }
127
+ }
128
+ ```
129
+
130
+ ## Development
131
+
132
+ ```bash
133
+ npm install
134
+ npm run build # tsc → dist/
135
+ npm run dev # tsx src/cli.ts
136
+ npm test # vitest
137
+ ```
138
+
139
+ The CLI entry (`bin/alpha.js`) is a thin wrapper over the compiled `dist/cli.js`, so `alpha`, `pnpm alpha`, and `npx alpha` all share one implementation.
140
+
141
+ ## License
142
+
143
+ MIT
package/bin/alpha.js ADDED
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Alpha CLI entry point.
5
+ *
6
+ * Thin wrapper that delegates to the compiled CLI in dist/ so that `alpha`,
7
+ * `pnpm alpha`, and `npx alpha` all share one implementation.
8
+ */
9
+
10
+ import { run } from '../dist/cli.js';
11
+
12
+ run().catch((error) => {
13
+ console.error(error instanceof Error ? error.message : String(error));
14
+ process.exitCode = 1;
15
+ });
package/dist/cli.d.ts ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Alpha CLI — thin, non-interactive-by-default wrapper over the Alpha harness.
4
+ *
5
+ * Alpha never edits code and never spawns agents. Commands emit structured
6
+ * output on stdout (human logs go to stderr); pass --json for an envelope and
7
+ * --interactive to drive a command through human prompts.
8
+ */
9
+ import { Command } from 'commander';
10
+ export declare function buildProgram(): Command;
11
+ export declare function run(argv?: string[]): Promise<void>;
12
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAWpC,wBAAgB,YAAY,IAAI,OAAO,CAuGtC;AAED,wBAAsB,GAAG,CAAC,IAAI,GAAE,MAAM,EAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEtE"}
package/dist/cli.js ADDED
@@ -0,0 +1,125 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Alpha CLI — thin, non-interactive-by-default wrapper over the Alpha harness.
4
+ *
5
+ * Alpha never edits code and never spawns agents. Commands emit structured
6
+ * output on stdout (human logs go to stderr); pass --json for an envelope and
7
+ * --interactive to drive a command through human prompts.
8
+ */
9
+ import { Command } from 'commander';
10
+ import { Alpha } from './core/alpha.js';
11
+ import { setJsonMode } from './utils/logger.js';
12
+ function applyGlobals(thisCommand) {
13
+ const opts = thisCommand.optsWithGlobals();
14
+ if (opts.json) {
15
+ setJsonMode(true);
16
+ }
17
+ }
18
+ export function buildProgram() {
19
+ const program = new Command();
20
+ program
21
+ .name('alpha')
22
+ .description('AI development assistive harness (LLM-driven, non-interactive by default)')
23
+ .version('0.1.0')
24
+ .option('--json', 'emit machine-readable JSON envelopes on stdout')
25
+ .option('-i, --interactive', 'use human-facing interactive prompts')
26
+ .hook('preAction', (thisCommand) => applyGlobals(thisCommand));
27
+ program
28
+ .command('init')
29
+ .description('Scaffold .alpha/ and generate agent skill files (AGENTS.md, etc.)')
30
+ .option('--agents <list>', 'comma-separated targets: universal,claude,cursor')
31
+ .option('--force', 'overwrite existing generated files')
32
+ .action(async (opts) => {
33
+ const alpha = await Alpha.open();
34
+ await alpha.init({ agents: opts.agents, force: opts.force });
35
+ });
36
+ program
37
+ .command('gather')
38
+ .alias('requirements')
39
+ .description('Capture project requirements (emit questionnaire or ingest answers)')
40
+ .option('--input <file>', 'JSON answers/context file (otherwise reads stdin)')
41
+ .action(async (opts, cmd) => {
42
+ const alpha = await Alpha.open();
43
+ await alpha.gatherRequirements({
44
+ input: opts.input,
45
+ interactive: cmd.optsWithGlobals().interactive,
46
+ });
47
+ });
48
+ program
49
+ .command('stack')
50
+ .alias('advise-stack')
51
+ .description('Decide the tech stack (emit reference stacks or ingest a decision)')
52
+ .option('--input <file>', 'JSON stack/decision file (otherwise reads stdin)')
53
+ .action(async (opts, cmd) => {
54
+ const alpha = await Alpha.open();
55
+ await alpha.adviseStack({
56
+ input: opts.input,
57
+ interactive: cmd.optsWithGlobals().interactive,
58
+ });
59
+ });
60
+ program
61
+ .command('spec')
62
+ .alias('generate-spec')
63
+ .description('Author a specification (emit template/skeleton or ingest a spec)')
64
+ .option('--input <file>', 'JSON spec file (otherwise reads stdin)')
65
+ .option('--title <title>', 'write a skeleton spec with this title')
66
+ .option('--type <type>', 'feature | bugfix | refactor | enhancement')
67
+ .option('--description <text>', 'short description for the skeleton')
68
+ .action(async (opts, cmd) => {
69
+ const alpha = await Alpha.open();
70
+ await alpha.spec({
71
+ input: opts.input,
72
+ title: opts.title,
73
+ type: opts.type,
74
+ description: opts.description,
75
+ interactive: cmd.optsWithGlobals().interactive,
76
+ });
77
+ });
78
+ program
79
+ .command('review')
80
+ .description('Run deterministic static analysis and write a findings report')
81
+ .option('--target <path>', 'directory to analyze (default: cwd)')
82
+ .action(async (opts) => {
83
+ const alpha = await Alpha.open();
84
+ await alpha.review({ target: opts.target });
85
+ });
86
+ program
87
+ .command('implement')
88
+ .alias('fix')
89
+ .description('Emit a fix plan from the latest review report (does not edit code)')
90
+ .option('--severity <list>', 'comma-separated severities, e.g. critical,high')
91
+ .option('--findings <list>', 'comma-separated finding ids or indexes')
92
+ .option('--verify', 're-run deterministic checks on selected findings')
93
+ .option('--cleanup', 'delete the report when verification fully passes')
94
+ .action(async (opts, cmd) => {
95
+ const alpha = await Alpha.open();
96
+ await alpha.implement({
97
+ severity: opts.severity,
98
+ findings: opts.findings,
99
+ verify: opts.verify,
100
+ cleanup: opts.cleanup,
101
+ interactive: cmd.optsWithGlobals().interactive,
102
+ });
103
+ });
104
+ program
105
+ .command('workflow')
106
+ .description('Run gather → stack → spec → review → implement in sequence')
107
+ .action(async (_opts, cmd) => {
108
+ const alpha = await Alpha.open();
109
+ await alpha.workflow({ interactive: cmd.optsWithGlobals().interactive });
110
+ });
111
+ return program;
112
+ }
113
+ export async function run(argv = process.argv) {
114
+ await buildProgram().parseAsync(argv);
115
+ }
116
+ // Auto-run only when invoked directly (e.g. `tsx src/cli.ts` or `node dist/cli.js`),
117
+ // not when imported by the bin wrapper.
118
+ const entry = process.argv[1] ?? '';
119
+ if (entry.endsWith('cli.ts') || entry.endsWith('cli.js')) {
120
+ run().catch((error) => {
121
+ console.error(error instanceof Error ? error.message : String(error));
122
+ process.exitCode = 1;
123
+ });
124
+ }
125
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA;;;;;;GAMG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,E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,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,4DAA4D,CAAC;SACzE,MAAM,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE;QAC3B,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,IAAI,EAAE,CAAC;QACjC,MAAM,KAAK,CAAC,QAAQ,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,eAAe,EAAE,CAAC,WAAW,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,GAAG,CAAC,OAAiB,OAAO,CAAC,IAAI;IACrD,MAAM,YAAY,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,qFAAqF;AACrF,wCAAwC;AACxC,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;IACzD,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;QACpB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,64 @@
1
+ import { type Config } from '../utils/config.js';
2
+ import { type GatherOptions } from './requirements/index.js';
3
+ import { type StackOptions } from './stack/index.js';
4
+ import { type SpecOptions } from './generator/index.js';
5
+ import { type ReviewOptions } from './reviewer/index.js';
6
+ import { type ImplementOptions } from './implementation/index.js';
7
+ import { type InitOptions } from './init/index.js';
8
+ import type { ProjectContext, StackRecommendation, Specification, ReviewReport } from '../types/index.js';
9
+ /**
10
+ * Alpha - programmatic entry point for the assistive harness.
11
+ *
12
+ * Alpha never edits code and never spawns agents. The calling LLM (or a human
13
+ * via --interactive) drives these methods; each one either emits a
14
+ * template/prompt or ingests + persists caller-provided content under .alpha/.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { Alpha } from '@thynameisjayvee/alpha-cli';
19
+ *
20
+ * const alpha = await Alpha.open();
21
+ * const review = await alpha.review({ target: 'src/' });
22
+ * await alpha.implement({ severity: 'critical,high' });
23
+ * ```
24
+ */
25
+ export declare class Alpha {
26
+ private projectRoot;
27
+ private alphaDir;
28
+ private config;
29
+ private constructor();
30
+ /**
31
+ * Open an Alpha instance for the current project.
32
+ * @param projectRoot - Optional project root path (defaults to nearest package.json)
33
+ */
34
+ static open(projectRoot?: string): Promise<Alpha>;
35
+ private initialize;
36
+ getProjectRoot(): string;
37
+ getAlphaDir(): string;
38
+ getConfig(): Config | null;
39
+ /** Scaffold .alpha/ and generate the agent skill surface. */
40
+ init(options?: InitOptions): Promise<void>;
41
+ /** Capture project requirements (emit questionnaire or ingest answers). */
42
+ gatherRequirements(options?: GatherOptions): Promise<ProjectContext | null>;
43
+ /** Decide the tech stack (emit reference stacks or ingest a decision). */
44
+ adviseStack(options?: StackOptions): Promise<StackRecommendation | null>;
45
+ /** Author a specification (emit template/skeleton or ingest a finished spec). */
46
+ spec(options?: SpecOptions): Promise<Specification | null>;
47
+ /** Run deterministic static review and persist a report. */
48
+ review(options?: ReviewOptions): Promise<ReviewReport>;
49
+ /** Emit a fix plan from the latest review report (does not edit code). */
50
+ implement(options?: ImplementOptions): Promise<void>;
51
+ /**
52
+ * Run the complete Alpha workflow:
53
+ * gather → stack → spec → review → implement.
54
+ */
55
+ workflow(options?: {
56
+ interactive?: boolean;
57
+ }): Promise<{
58
+ context: ProjectContext | null;
59
+ stack: StackRecommendation | null;
60
+ spec: Specification | null;
61
+ review: ReviewReport;
62
+ }>;
63
+ }
64
+ //# sourceM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F;IAC3E,IAAI,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC;IAIpE,4DAA4D;IACtD,MAAM,CAAC,OAAO,GAAE,aAAkB,GAAG,OAAO,CAAC,YAAY,CAAC;IAIhE,0EAA0E;IACpE,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC;IAI9D;;;OAGG;IACG,QAAQ,CACZ,OAAO,GAAE;QAAE,WAAW,CAAC,EAAE,OAAO,CAAA;KAAO,GACtC,OAAO,CAAC;QACT,OAAO,EAAE,cAAc,GAAG,IAAI,CAAC;QAC/B,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAAC;QAClC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;QAC3B,MAAM,EAAE,YAAY,CAAC;KACtB,CAAC;CAWH"}
@@ -0,0 +1,94 @@
1
+ import { getProjectRoot, getAlphaDir, ensureAlphaDir } from '../utils/paths.js';
2
+ import { loadConfig } from '../utils/config.js';
3
+ import { gatherRequirements } from './requirements/index.js';
4
+ import { adviseStack } from './stack/index.js';
5
+ import { generateSpec } from './generator/index.js';
6
+ import { runReview } from './reviewer/index.js';
7
+ import { runImplementation, } from './implementation/index.js';
8
+ import { runInit } from './init/index.js';
9
+ /**
10
+ * Alpha - programmatic entry point for the assistive harness.
11
+ *
12
+ * Alpha never edits code and never spawns agents. The calling LLM (or a human
13
+ * via --interactive) drives these methods; each one either emits a
14
+ * template/prompt or ingests + persists caller-provided content under .alpha/.
15
+ *
16
+ * @example
17
+ * ```typescript
18
+ * import { Alpha } from '@thynameisjayvee/alpha-cli';
19
+ *
20
+ * const alpha = await Alpha.open();
21
+ * const review = await alpha.review({ target: 'src/' });
22
+ * await alpha.implement({ severity: 'critical,high' });
23
+ * ```
24
+ */
25
+ export class Alpha {
26
+ projectRoot;
27
+ alphaDir;
28
+ config = null;
29
+ constructor(projectRoot) {
30
+ this.projectRoot = projectRoot;
31
+ this.alphaDir = getAlphaDir();
32
+ }
33
+ /**
34
+ * Open an Alpha instance for the current project.
35
+ * @param projectRoot - Optional project root path (defaults to nearest package.json)
36
+ */
37
+ static async open(projectRoot) {
38
+ const root = projectRoot || getProjectRoot();
39
+ const alpha = new Alpha(root);
40
+ await alpha.initialize();
41
+ return alpha;
42
+ }
43
+ async initialize() {
44
+ ensureAlphaDir();
45
+ this.config = await loadConfig();
46
+ }
47
+ getProjectRoot() {
48
+ return this.projectRoot;
49
+ }
50
+ getAlphaDir() {
51
+ return this.alphaDir;
52
+ }
53
+ getConfig() {
54
+ return this.config;
55
+ }
56
+ /** Scaffold .alpha/ and generate the agent skill surface. */
57
+ async init(options = {}) {
58
+ return await runInit(options);
59
+ }
60
+ /** Capture project requirements (emit questionnaire or ingest answers). */
61
+ async gatherRequirements(options = {}) {
62
+ return await gatherRequirements(options);
63
+ }
64
+ /** Decide the tech stack (emit reference stacks or ingest a decision). */
65
+ async adviseStack(options = {}) {
66
+ return await adviseStack(options);
67
+ }
68
+ /** Author a specification (emit template/skeleton or ingest a finished spec). */
69
+ async spec(options = {}) {
70
+ return await generateSpec(options);
71
+ }
72
+ /** Run deterministic static review and persist a report. */
73
+ async review(options = {}) {
74
+ return await runReview(options);
75
+ }
76
+ /** Emit a fix plan from the latest review report (does not edit code). */
77
+ async implement(options = {}) {
78
+ return await runImplementation(options);
79
+ }
80
+ /**
81
+ * Run the complete Alpha workflow:
82
+ * gather → stack → spec → review → implement.
83
+ */
84
+ async workflow(options = {}) {
85
+ const passthrough = { interactive: options.interactive };
86
+ const context = await this.gatherRequirements(passthrough);
87
+ const stack = await this.adviseStack(passthrough);
88
+ const spec = await this.spec(passthrough);
89
+ const review = await this.review();
90
+ await this.implement(passthrough);
91
+ return { context, stack, spec, review };
92
+ }
93
+ }
94
+ //# sourceMappingURL=alpha.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"alpha.js","sourceRoot":"","sources":["../../src/core/alpha.ts"],"names":[],"mappings":"AAAA,OAA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AM,EAAE,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env node
2
+ import { Specification } from '../../types/index.js';
3
+ export interface SpecOptions {
4
+ /** Run the human-facing interactive flow (inquirer). */
5
+ interactive?: boolean;
6
+ /** Path to a JSON spec file (otherwise stdin is used). */
7
+ input?: string;
8
+ /** Spec title (enables skeleton generation in default/emit mode). */
9
+ title?: string;
10
+ /** Spec type. */
11
+ type?: Specification['type'];
12
+ /** Short description. */
13
+ description?: string;
14
+ }
15
+ export declare function generateSpec(options?: SpecOptions): Promise<Specification | null>;
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/core/generator/index.ts"],"names":[],"mappings":";AAMA,OAAO,EACL,aAAa,EAMd,MAAM,sBAAsB,CAAC;AAG9B,MAAM,WAAW,WAAW;IAC1B,wDAAwD;IACxD,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7B,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAmOD,wBAAsB,YAAY,CAChC,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAiD/B"}