@msn-control/liftoff 0.3.4 → 0.4.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.
Files changed (65) hide show
  1. package/README.md +82 -32
  2. package/assets/locks/frontend/package-lock.json +2217 -0
  3. package/assets/locks/frontend/package.json +19 -0
  4. package/assets/locks/node-backend/package-lock.json +4352 -0
  5. package/assets/locks/node-backend/package.json +32 -0
  6. package/dist/args.d.ts +42 -1
  7. package/dist/args.js +170 -37
  8. package/dist/args.js.map +1 -1
  9. package/dist/catalogs.d.ts +10 -1
  10. package/dist/catalogs.js +89 -0
  11. package/dist/catalogs.js.map +1 -1
  12. package/dist/cli.js +11 -1
  13. package/dist/cli.js.map +1 -1
  14. package/dist/commands.d.ts +9 -0
  15. package/dist/commands.js +832 -227
  16. package/dist/commands.js.map +1 -1
  17. package/dist/file-system.js +89 -5
  18. package/dist/file-system.js.map +1 -1
  19. package/dist/framework-adapters.d.ts +18 -0
  20. package/dist/framework-adapters.js +115 -0
  21. package/dist/framework-adapters.js.map +1 -0
  22. package/dist/framework-validation.d.ts +8 -0
  23. package/dist/framework-validation.js +83 -0
  24. package/dist/framework-validation.js.map +1 -0
  25. package/dist/init-filesystem.d.ts +102 -0
  26. package/dist/init-filesystem.js +762 -0
  27. package/dist/init-filesystem.js.map +1 -0
  28. package/dist/interactive.d.ts +43 -2
  29. package/dist/interactive.js +202 -91
  30. package/dist/interactive.js.map +1 -1
  31. package/dist/npm-template-assets.d.ts +3 -0
  32. package/dist/npm-template-assets.js +32 -0
  33. package/dist/npm-template-assets.js.map +1 -0
  34. package/dist/planner.d.ts +5 -0
  35. package/dist/planner.js +87 -21
  36. package/dist/planner.js.map +1 -1
  37. package/dist/process-runner.d.ts +28 -0
  38. package/dist/process-runner.js +83 -0
  39. package/dist/process-runner.js.map +1 -0
  40. package/dist/project-dependencies.d.ts +30 -0
  41. package/dist/project-dependencies.js +164 -0
  42. package/dist/project-dependencies.js.map +1 -0
  43. package/dist/published-verifier.js +1 -1
  44. package/dist/published-verifier.js.map +1 -1
  45. package/dist/reconcile.js +4 -1
  46. package/dist/reconcile.js.map +1 -1
  47. package/dist/runtime.d.ts +2 -0
  48. package/dist/runtime.js +9 -0
  49. package/dist/runtime.js.map +1 -0
  50. package/dist/standard-templates.js +3 -30
  51. package/dist/standard-templates.js.map +1 -1
  52. package/dist/templates.d.ts +9 -1
  53. package/dist/templates.js +110 -46
  54. package/dist/templates.js.map +1 -1
  55. package/dist/terminal.d.ts +128 -0
  56. package/dist/terminal.js +598 -0
  57. package/dist/terminal.js.map +1 -0
  58. package/dist/types.d.ts +38 -1
  59. package/dist/workstation-catalog.d.ts +20 -0
  60. package/dist/workstation-catalog.js +122 -0
  61. package/dist/workstation-catalog.js.map +1 -0
  62. package/dist/workstation.d.ts +76 -0
  63. package/dist/workstation.js +461 -0
  64. package/dist/workstation.js.map +1 -0
  65. package/package.json +8 -2
package/README.md CHANGED
@@ -26,63 +26,86 @@ Versions before 0.3.0 are unsupported and must not be used for new projects. If
26
26
 
27
27
  ## Quick Start
28
28
 
29
- Preview a generated project before writing files:
29
+ Preview a project and its derived workstation requirements without writing files or running installers:
30
30
 
31
31
  ```bash
32
- liftoff plan --pattern rag --cloud azure --region eastus --frontend
32
+ liftoff plan --pattern rag --cloud azure --region eastus --frontend --agents copilot,claude
33
33
  ```
34
34
 
35
- Create a project non-interactively:
35
+ Initialize a named project. Liftoff probes required runtimes, the selected spec framework, cloud/development tools, and every selected AI coding agent before it writes:
36
36
 
37
37
  ```bash
38
- liftoff create claims-copilot --pattern rag --cloud azure --region eastus --spec openspec --frontend --yes
38
+ liftoff init claims-copilot --pattern rag --cloud azure --region eastus --spec openspec --agents copilot,claude --frontend --yes
39
39
  cd claims-copilot
40
40
  cp .env.example .env
41
41
  liftoff validate
42
42
  liftoff doctor
43
43
  ```
44
44
 
45
- Create a standard Node.js API without GenAI components:
45
+ Add `--install-tools` only after reviewing machine-level install commands, and add `--install-dependencies` to run the generated project's locked dependency commands. These permissions are independent from `--yes`.
46
+
47
+ To initialize an existing Git worktree root in place, run `liftoff init` at that exact root. With no project name, Liftoff uses the repository directory name; a supplied name changes project identity without creating a child directory.
46
48
 
47
49
  ```bash
48
- liftoff plan --no-genai --api node --cloud azure --region eastus
49
- liftoff create claims-api --no-genai --api node --cloud azure --region eastus --spec openspec --no-frontend --yes
50
+ cd existing-repository
51
+ liftoff init --no-genai --api node --cloud azure --region eastus --spec spec-kit --agents copilot,claude --default-agent copilot
50
52
  ```
51
53
 
52
- Standard API choices are `python` (FastAPI), `node` (Fastify with TypeScript), and `go` (Huma v2 with Chi). Existing GenAI commands that provide `--pattern` continue to infer the GenAI project type and Python/FastAPI stack.
54
+ In a non-Git directory or below (but not at) a Git root, a project name creates a named child. Standard API choices are `python` (FastAPI), `node` (Fastify with TypeScript), and `go` (Huma v2 with Chi). A GenAI `--pattern` selects the Python/FastAPI/PydanticAI stack.
53
55
 
54
- Use the local development helper to print the Docker Compose command, then run the printed command:
56
+ For an existing application, migration creates a fresh sibling scaffold, runs the same readiness and official-framework pipeline, stages a filtered source copy, and leaves the source byte-for-byte unchanged:
55
57
 
56
58
  ```bash
57
- liftoff dev up
58
- docker compose up --build
59
+ liftoff migrate ../legacy-app --region eastus --agents copilot,claude --yes
59
60
  ```
60
61
 
61
- For an existing project, create a Liftoff-shaped sibling scaffold and staged migration plan without modifying the source project:
62
+ ## Terminal Interface
63
+
64
+ Interactive `init`, `migrate`, and `plan` sessions open with the Liftoff identity before discovery or the first question. Human-readable help, prompts, plans, readiness checks, consent details, maintenance results, catalogs, errors, remedies, and completion summaries use the same presentation hierarchy:
65
+
66
+ ```text
67
+ ┌──────────────────────────────────────────────────────────────────────────────┐
68
+ │ ██╗ ██╗███████╗████████╗ ██████╗ ███████╗███████╗ │
69
+ │ ██║ ██║██╔════╝╚══██╔══╝██╔═══██╗██╔════╝██╔════╝ │
70
+ │ ██║ ██║█████╗ ██║ ██║ ██║█████╗ █████╗ │
71
+ │ ██║ ██║██╔══╝ ██║ ██║ ██║██╔══╝ ██╔══╝ │
72
+ │ ███████╗██║██║ ██║ ╚██████╔╝██║ ██║ │
73
+ │ ╚══════╝╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝ │
74
+ └──────────────────────────────────────────────────────────────────────────────┘
75
+ ◆ Configure project
76
+ ┌─ Resolved project plan ──────────────────────────────────────────────────────┐
77
+ │ Project claims-copilot │
78
+ │ Spec workflow OpenSpec │
79
+ │ Coding agents GitHub Copilot, Claude Code │
80
+ └──────────────────────────────────────────────────────────────────────────────┘
81
+ ```
82
+
83
+ TTYs at least 96 columns receive the rich wordmark, Unicode sections, aligned tables, and restrained semantic color. Widths from 64 through 95 columns use the compact identity and wrapped sections. Narrow or redirected output is deterministic plain text with no ANSI sequences or decorative borders, so paths, commands, labels, values, and remedies remain copyable.
84
+
85
+ Set `NO_COLOR=1` to retain the selected layout and hierarchy without ANSI color:
62
86
 
63
87
  ```bash
64
- liftoff migrate ../legacy-app --region eastus --yes
88
+ NO_COLOR=1 liftoff init
89
+ liftoff doctor > readiness.txt
65
90
  ```
66
91
 
67
- ## How Liftoff Works
92
+ Machine contracts bypass presentation. `liftoff doctor --json` and `liftoff update --json` emit only their documented JSON values, while `liftoff --version` remains exactly one line. Liftoff labels installer, framework, and dependency stages, then forwards child stdout and stderr unchanged.
68
93
 
69
- Liftoff turns a small set of project decisions into a deterministic scaffold and records what it wrote so future CLI versions can reconcile safely.
94
+ ## Lifecycle
70
95
 
71
96
  ```text
72
- plan -> create or migrate -> validate and doctor -> update -> dev and infra helpers
97
+ plan -> init or migrate -> validate and doctor -> update -> dev and infra helpers
73
98
  ```
74
99
 
75
- - `liftoff plan` resolves flags or config into a project plan, renders the artifact list, and writes nothing.
76
- - `liftoff create` first determines whether the project is GenAI or standard. GenAI projects select a pattern and use Python/FastAPI/PydanticAI; standard projects select an approved Python, Node.js, or Go API stack. Both flows collect cloud, region, frontend, environments, and spec workflow.
77
- - `liftoff migrate <path>` scans a legacy project, generates a fresh sibling Liftoff scaffold, stages a filtered legacy copy under `migration/legacy`, and emits an OpenSpec migration change or `MIGRATION.md`.
78
- - `liftoff validate` checks that `liftoff.manifest.json` can be loaded and every durable manifest artifact exists on disk.
79
- - `liftoff doctor` runs read-only readiness checks. Outside a generated project it checks the local environment; inside a generated project it also checks manifest health, scaffold drift, runtime configuration, cloud auth, and Azure Functions tooling for worker-enabled Azure projects.
80
- - `liftoff update` checks scaffold drift by default and writes nothing. It exits 0 when clean and 2 when drift exists, which makes it usable as a CI drift gate.
81
- - `liftoff update --apply` writes safe changes such as new, missing, moved, or untouched upgraded artifacts. It skips conflicts unless `--force` is also provided, and it reports orphaned files without deleting them automatically.
82
- - `liftoff dev` prints Docker Compose helper commands such as `docker compose up --build`, `docker compose logs -f`, and `docker compose down --volumes`.
83
- - `liftoff infra` prints OpenTofu helper commands such as `tofu init`, `tofu plan -var-file=environments/dev.tfvars`, and `tofu apply -var-file=environments/dev.tfvars`.
100
+ - `liftoff plan` resolves project decisions, previews artifacts and requirements, and has no side effects.
101
+ - `liftoff init` initializes a new child or the exact current Git root, checks workstation readiness, runs the pinned official OpenSpec or Spec Kit initializer in temporary staging, validates all output, and merges transactionally.
102
+ - `liftoff migrate <path>` scans a non-Liftoff source, requires a new or empty sibling target, and uses the same staged framework and optional dependency phases. `--force` never permits a non-empty migration target.
103
+ - `liftoff validate` checks the manifest's durable files plus the declared framework contract and selected-agent markers.
104
+ - `liftoff doctor` performs read-only plan-derived probes with blocking, advisory, authentication-health, framework, drift, runtime, and cloud layers. JSON output uses stable requirement identifiers and states.
105
+ - `liftoff update` is a read-only drift check by default. `liftoff update --apply` writes safe durable changes, skips conflicts unless `--force` is supplied, and reports orphans without deleting them.
106
+ - `liftoff dev` and `liftoff infra` print Docker Compose and OpenTofu helper commands; they do not execute them.
84
107
 
85
- Discovery commands are available for the catalogs that drive generation:
108
+ Catalog discovery remains available:
86
109
 
87
110
  ```bash
88
111
  liftoff patterns
@@ -91,19 +114,46 @@ liftoff regions
91
114
  liftoff regions search korea --cloud azure
92
115
  ```
93
116
 
94
- Azure is the available V1 provider. AWS and GCP are listed as planned provider adapters and are rejected before generation.
117
+ Azure is the available V1 provider. AWS and GCP remain planned and are rejected before generation.
118
+
119
+ ## Workstation Readiness
120
+
121
+ Liftoff automatically detects requirements derived from the full project plan:
122
+
123
+ - Blocking: Node.js 20.19+, the selected Python/Node/Go runtime, the exact tested OpenSpec or Spec Kit CLI, and every selected Copilot or Claude Code integration.
124
+ - Advisory: Docker and daemon health, OpenTofu, Azure CLI, and cloud authentication.
125
+ - Authentication: Liftoff reports observable health but never stores credentials or signs in on the developer's behalf.
126
+
127
+ On macOS, allowlisted recipes use Homebrew, npm, or `uv`; on Windows they use WinGet, npm, or `uv`. Liftoff prints each command and requires `--install-tools` or separate interactive approval. Linux system packages are never installed with automatic elevation: Liftoff gives distribution-appropriate official guidance, while npm/`uv` framework recipes remain separately consented. PATH-changing installs are re-probed and may require a new terminal.
128
+
129
+ Copilot is detected through its CLI or supported VS Code extensions. Claude Code is checked with its version and doctor commands. Both agents may be selected together; Spec Kit additionally records one selected agent as its default integration.
130
+
131
+ ## Target, Ownership, And Consent Safety
132
+
133
+ Liftoff renders into a temporary staging directory, runs official framework commands there, rejects symlinks and unexpected framework roots, validates the complete tree, then computes one immutable destination preflight. Existing unrelated files are preserved. Different regular files are disclosed as one conflict set; structural collisions, symlink paths, unsafe ancestors, and an existing `liftoff.manifest.json` are non-overridable blockers. Writes are atomic and handled failures roll back created or replaced files.
134
+
135
+ The four consent flags do not imply one another:
136
+
137
+ | Flag | Authorizes | Does not authorize |
138
+ | --- | --- | --- |
139
+ | `--yes` | Project defaults and plan confirmation | File replacement, machine installs, or project dependencies |
140
+ | `--force` | Only listed, validated regular-file replacements | Manifest guards, symlinks, structural collisions, tools, dependencies, or non-empty migration targets |
141
+ | `--install-tools` | Allowlisted workstation installation commands | Project decisions, overwrites, or project dependencies |
142
+ | `--install-dependencies` | Locked project-local dependency commands after a successful merge | Machine tools, project decisions, or overwrites |
143
+
144
+ OpenSpec and Spec Kit core/integration output is owned by their official initializers. Liftoff validates the declared version and selected-agent markers but does not place framework-owned or one-time seed files in durable artifact hashes. Schema-v3 manifests record this contract explicitly; schema-v2 projects remain supported as legacy state without inventing framework ownership or agent selections.
95
145
 
96
146
  ## Strict Commands And Safe Recovery
97
147
 
98
148
  Liftoff validates each command before running it. Unknown flags or subcommands, missing flag values, invalid booleans, incompatible duplicates, and extra positional arguments exit 1 without generating files or printing a fallback helper command. Use command-specific help to see the accepted syntax:
99
149
 
100
150
  ```bash
101
- liftoff create --help
151
+ liftoff init --help
152
+ liftoff migrate --help
102
153
  liftoff update --help
103
- liftoff regions --help
104
154
  ```
105
155
 
106
- `liftoff update --apply` preflights every path and destination before its first mutation. A new or moved artifact is adopted when the destination already contains the rendered bytes; different pre-existing bytes are reported as a conflict and skipped. `--force` overwrites reviewed conflicts. Orphans are reported but never deleted automatically. Any write, replacement, cleanup, or manifest failure exits 1 without a success summary or false manifest state, so fixing the filesystem issue and retrying is safe.
156
+ The former `liftoff create` command is intentionally rejected with guidance to use `liftoff init`; there is no compatibility alias.
107
157
 
108
158
  Manifest paths must be portable path-part arrays confined to the project. Traversal, absolute, drive-qualified, UNC, embedded-separator, empty, and symlink-escaping paths are rejected before artifact access. If validation reports an unsafe or malformed manifest, restore `liftoff.manifest.json` from version control or regenerate a fresh project with the matching Liftoff version. Do not repair the issue by weakening path validation or by retaining a hand-edited unsafe path.
109
159
 
@@ -178,7 +228,7 @@ Conditional areas:
178
228
  Generated projects contain two root files with different ownership models:
179
229
 
180
230
  - `liftoff.config.json` is user-owned desired state after creation. Liftoff writes it once during generation and does not machine-rewrite it afterwards. Supported changes, such as adding an environment or enabling frontend output, are reconciled by `liftoff update`. Project type, API stack, and GenAI pattern changes are migrations and should use `liftoff migrate`.
181
- - `liftoff.manifest.json` is the CLI-owned compatibility record. Manifest schema v2 records `artifactVersion`, the generating `liftoffVersion`, project type, API stack, applicable GenAI pattern, durable generated artifact `logicalName`s, categories, OS-neutral path parts, and `sha256:` content hashes.
231
+ - `liftoff.manifest.json` is the CLI-owned compatibility record. Manifest schema v3 records the generating `liftoffVersion`, project identity, selected agents, applicable default agent, official framework adapter and tested contract version, and durable generated artifact `logicalName`s with OS-neutral path parts and `sha256:` content hashes. V2 manifests remain readable as explicit legacy framework state.
182
232
 
183
233
  The manifest lets `liftoff validate`, `liftoff doctor`, and `liftoff update` distinguish clean generated files from local edits. Seed content, such as the initial OpenSpec bootstrap change, is written once and intentionally omitted from the durable manifest so it can follow its own lifecycle. Treat the manifest as CLI-owned: restore or regenerate it when validation fails rather than hand-editing artifact paths or hashes.
184
234
 
@@ -186,7 +236,7 @@ The manifest lets `liftoff validate`, `liftoff doctor`, and `liftoff update` dis
186
236
 
187
237
  Generated projects contain persistent files that outlive any CLI release. The following rules are the compatibility contract, enforced by `tests/contract.test.ts` where possible:
188
238
 
189
- - **Manifest schema**: `liftoff.manifest.json` uses `artifactVersion` 2, the first supported schema version, recording the generating CLI version (`liftoffVersion`) and a `sha256:`-prefixed `contentHash` per artifact. Readers accept every supported version and reject others with a remedy; writers always write the latest version.
239
+ - **Manifest schema**: writers use `artifactVersion` 3; readers support v2 legacy and v3 initialized framework state and reject other versions with a remedy. Durable artifacts retain `sha256:`-prefixed hashes, while framework-owned and seed files are validated separately.
190
240
  - **Append-only identifiers**: artifact `logicalName`s and catalog ids (project types, API stacks, patterns, providers, environments, spec workflows) are never renamed or removed, only added. The contract test snapshots the logical-name sets.
191
241
  - **Deterministic rendering**: artifact content depends only on the project plan and the template code, with no timestamps, randomness, or environment leakage. Verified by a double-render byte-equality test.
192
242
  - **Reserved namespaces**: `.liftoff/` in generated projects is reserved for future CLI-managed state; no new CLI-managed root-level files beyond `liftoff.config.json` and `liftoff.manifest.json`. `liftoff.config.json` is written once at generation and never machine-written afterwards.