@msn-control/liftoff 0.3.3 → 0.4.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 (68) hide show
  1. package/README.md +66 -42
  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 +9 -1
  7. package/dist/args.js +113 -33
  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 +5 -0
  13. package/dist/cli.js.map +1 -1
  14. package/dist/commands.d.ts +5 -0
  15. package/dist/commands.js +633 -124
  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 +15 -0
  20. package/dist/framework-adapters.js +112 -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 +5 -1
  29. package/dist/interactive.js +75 -4
  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.js +62 -3
  35. package/dist/planner.js.map +1 -1
  36. package/dist/process-runner.d.ts +28 -0
  37. package/dist/process-runner.js +80 -0
  38. package/dist/process-runner.js.map +1 -0
  39. package/dist/project-dependencies.d.ts +28 -0
  40. package/dist/project-dependencies.js +163 -0
  41. package/dist/project-dependencies.js.map +1 -0
  42. package/dist/published-verifier.d.ts +39 -0
  43. package/dist/published-verifier.js +173 -0
  44. package/dist/published-verifier.js.map +1 -0
  45. package/dist/reconcile.js +4 -1
  46. package/dist/reconcile.js.map +1 -1
  47. package/dist/release-identity.d.ts +17 -0
  48. package/dist/release-identity.js +51 -0
  49. package/dist/release-identity.js.map +1 -0
  50. package/dist/runtime.d.ts +2 -0
  51. package/dist/runtime.js +9 -0
  52. package/dist/runtime.js.map +1 -0
  53. package/dist/standard-templates.js +3 -30
  54. package/dist/standard-templates.js.map +1 -1
  55. package/dist/templates.d.ts +9 -1
  56. package/dist/templates.js +110 -46
  57. package/dist/templates.js.map +1 -1
  58. package/dist/terminal.d.ts +32 -0
  59. package/dist/terminal.js +182 -0
  60. package/dist/terminal.js.map +1 -0
  61. package/dist/types.d.ts +38 -1
  62. package/dist/workstation-catalog.d.ts +20 -0
  63. package/dist/workstation-catalog.js +122 -0
  64. package/dist/workstation-catalog.js.map +1 -0
  65. package/dist/workstation.d.ts +76 -0
  66. package/dist/workstation.js +461 -0
  67. package/dist/workstation.js.map +1 -0
  68. package/package.json +10 -2
package/README.md CHANGED
@@ -8,77 +8,72 @@ Source, issues, and contribution guidance live at [github.com/voyager163/liftoff
8
8
 
9
9
  ## Installation
10
10
 
11
- Install the latest stable CLI globally:
11
+ The authoritative Liftoff release registry is `https://registry.npmjs.org`. Where direct public npm access is permitted, verify and install the latest stable CLI explicitly from that registry:
12
12
 
13
13
  ```bash
14
- npm install -g @msn-control/liftoff@latest
14
+ npm view @msn-control/liftoff@latest version --registry=https://registry.npmjs.org
15
+ npm install -g @msn-control/liftoff@latest --registry=https://registry.npmjs.org
15
16
  ```
16
17
 
17
- After installation, confirm the command is available:
18
+ After installation, confirm the resolved version and command availability:
18
19
 
19
20
  ```bash
21
+ liftoff --version
20
22
  liftoff help
21
23
  ```
22
24
 
25
+ Versions before 0.3.0 are unsupported and must not be used for new projects. If npm is configured to use a managed registry or mirror, query `@msn-control/liftoff@latest` through that registry before installing and compare it with the canonical version. Stop if the managed registry exposes an older version or rejects the current explicit version; ask the mirror owner to synchronize or approve the release before onboarding resumes. Liftoff does not modify `.npmrc` or bypass managed-registry policy automatically.
26
+
23
27
  ## Quick Start
24
28
 
25
- Preview a generated project before writing files:
29
+ Preview a project and its derived workstation requirements without writing files or running installers:
26
30
 
27
31
  ```bash
28
- liftoff plan --pattern rag --cloud azure --region eastus --frontend
32
+ liftoff plan --pattern rag --cloud azure --region eastus --frontend --agents copilot,claude
29
33
  ```
30
34
 
31
- 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:
32
36
 
33
37
  ```bash
34
- 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
35
39
  cd claims-copilot
36
40
  cp .env.example .env
37
41
  liftoff validate
38
42
  liftoff doctor
39
43
  ```
40
44
 
41
- Create a standard Node.js API without GenAI components:
42
-
43
- ```bash
44
- liftoff plan --no-genai --api node --cloud azure --region eastus
45
- liftoff create claims-api --no-genai --api node --cloud azure --region eastus --spec openspec --no-frontend --yes
46
- ```
47
-
48
- 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.
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`.
49
46
 
50
- Use the local development helper to print the Docker Compose command, then run the printed command:
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.
51
48
 
52
49
  ```bash
53
- liftoff dev up
54
- docker compose up --build
50
+ cd existing-repository
51
+ liftoff init --no-genai --api node --cloud azure --region eastus --spec spec-kit --agents copilot,claude --default-agent copilot
55
52
  ```
56
53
 
57
- For an existing project, create a Liftoff-shaped sibling scaffold and staged migration plan without modifying the source project:
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.
55
+
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:
58
57
 
59
58
  ```bash
60
- liftoff migrate ../legacy-app --region eastus --yes
59
+ liftoff migrate ../legacy-app --region eastus --agents copilot,claude --yes
61
60
  ```
62
61
 
63
- ## How Liftoff Works
64
-
65
- Liftoff turns a small set of project decisions into a deterministic scaffold and records what it wrote so future CLI versions can reconcile safely.
62
+ ## Lifecycle
66
63
 
67
64
  ```text
68
- plan -> create or migrate -> validate and doctor -> update -> dev and infra helpers
65
+ plan -> init or migrate -> validate and doctor -> update -> dev and infra helpers
69
66
  ```
70
67
 
71
- - `liftoff plan` resolves flags or config into a project plan, renders the artifact list, and writes nothing.
72
- - `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.
73
- - `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`.
74
- - `liftoff validate` checks that `liftoff.manifest.json` can be loaded and every durable manifest artifact exists on disk.
75
- - `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.
76
- - `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.
77
- - `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.
78
- - `liftoff dev` prints Docker Compose helper commands such as `docker compose up --build`, `docker compose logs -f`, and `docker compose down --volumes`.
79
- - `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`.
68
+ - `liftoff plan` resolves project decisions, previews artifacts and requirements, and has no side effects.
69
+ - `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.
70
+ - `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.
71
+ - `liftoff validate` checks the manifest's durable files plus the declared framework contract and selected-agent markers.
72
+ - `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.
73
+ - `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.
74
+ - `liftoff dev` and `liftoff infra` print Docker Compose and OpenTofu helper commands; they do not execute them.
80
75
 
81
- Discovery commands are available for the catalogs that drive generation:
76
+ Catalog discovery remains available:
82
77
 
83
78
  ```bash
84
79
  liftoff patterns
@@ -87,19 +82,46 @@ liftoff regions
87
82
  liftoff regions search korea --cloud azure
88
83
  ```
89
84
 
90
- Azure is the available V1 provider. AWS and GCP are listed as planned provider adapters and are rejected before generation.
85
+ Azure is the available V1 provider. AWS and GCP remain planned and are rejected before generation.
86
+
87
+ ## Workstation Readiness
88
+
89
+ Liftoff automatically detects requirements derived from the full project plan:
90
+
91
+ - 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.
92
+ - Advisory: Docker and daemon health, OpenTofu, Azure CLI, and cloud authentication.
93
+ - Authentication: Liftoff reports observable health but never stores credentials or signs in on the developer's behalf.
94
+
95
+ 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.
96
+
97
+ 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.
98
+
99
+ ## Target, Ownership, And Consent Safety
100
+
101
+ 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.
102
+
103
+ The four consent flags do not imply one another:
104
+
105
+ | Flag | Authorizes | Does not authorize |
106
+ | --- | --- | --- |
107
+ | `--yes` | Project defaults and plan confirmation | File replacement, machine installs, or project dependencies |
108
+ | `--force` | Only listed, validated regular-file replacements | Manifest guards, symlinks, structural collisions, tools, dependencies, or non-empty migration targets |
109
+ | `--install-tools` | Allowlisted workstation installation commands | Project decisions, overwrites, or project dependencies |
110
+ | `--install-dependencies` | Locked project-local dependency commands after a successful merge | Machine tools, project decisions, or overwrites |
111
+
112
+ 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.
91
113
 
92
114
  ## Strict Commands And Safe Recovery
93
115
 
94
116
  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:
95
117
 
96
118
  ```bash
97
- liftoff create --help
119
+ liftoff init --help
120
+ liftoff migrate --help
98
121
  liftoff update --help
99
- liftoff regions --help
100
122
  ```
101
123
 
102
- `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.
124
+ The former `liftoff create` command is intentionally rejected with guidance to use `liftoff init`; there is no compatibility alias.
103
125
 
104
126
  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.
105
127
 
@@ -174,7 +196,7 @@ Conditional areas:
174
196
  Generated projects contain two root files with different ownership models:
175
197
 
176
198
  - `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`.
177
- - `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.
199
+ - `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.
178
200
 
179
201
  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.
180
202
 
@@ -182,7 +204,7 @@ The manifest lets `liftoff validate`, `liftoff doctor`, and `liftoff update` dis
182
204
 
183
205
  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:
184
206
 
185
- - **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.
207
+ - **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.
186
208
  - **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.
187
209
  - **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.
188
210
  - **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.
@@ -213,6 +235,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the contribution workflow and [SECURI
213
235
 
214
236
  ## Release
215
237
 
216
- The `Release Liftoff` workflow builds, tests, packs, smoke-installs, and publishes `@msn-control/liftoff` from this repository. Stable versions publish with the `latest` npm dist-tag; prerelease versions publish with `next`.
238
+ The `Release Liftoff` workflow builds, tests, packs, smoke-installs, and publishes `@msn-control/liftoff` from this repository. Stable versions publish with the `latest` npm dist-tag; prerelease versions publish with `next`. After publication, the workflow waits for canonical npm propagation, clean-installs the selected dist-tag into an isolated prefix, verifies its package version, and executes installed CLI commands. A mismatch fails the workflow even though npm has already accepted immutable package bytes.
239
+
240
+ Releases use npm trusted publishing with provenance from this public repository. Publishing remains blocked unless npm authorizes `.github/workflows/release.yml` for `voyager163/liftoff`.
217
241
 
218
- Releases use npm trusted publishing with provenance from this public repository. Publishing remains blocked unless npm authorizes `.github/workflows/release.yml` for `voyager163/liftoff`.
242
+ Canonical publication does not prove that an external managed mirror has synchronized. Organizations using a mirror should gate their internal release announcement on that mirror exposing the canonical stable version. See [CONTRIBUTING.md](CONTRIBUTING.md) for post-publish recovery and historical-version deprecation procedures.