@habitat-ai/cli 0.5.15 → 0.6.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 (65) hide show
  1. package/README.md +62 -4
  2. package/dist/application-gZ8XAszE.js +80 -0
  3. package/dist/application.js +2 -18
  4. package/dist/cli-hhbbymEz.js +4738 -0
  5. package/dist/cli.js +2 -0
  6. package/dist/command-DkmTpQvc.js +74 -0
  7. package/dist/command.d.ts +36 -35
  8. package/dist/command.js +2 -45
  9. package/dist/generators/cli-command.js +263 -0
  10. package/dist/generators/cli-extension.js +192 -0
  11. package/dist/generators/init.js +20 -20
  12. package/dist/generators/preset.js +8 -7
  13. package/dist/generators/remove-hook.js +7 -4
  14. package/dist/generators/service.js +130 -139
  15. package/dist/habitat.app-Cl-58zQB.js +16615 -0
  16. package/dist/habitat.app.js +2 -0
  17. package/dist/host-BcptPYDL.js +293 -0
  18. package/dist/host.d.ts +57 -0
  19. package/dist/host.js +3 -0
  20. package/dist/index.js +8 -5
  21. package/dist/initialization-BWDg3bks.js +249 -0
  22. package/dist/migrations/0-5-7-repository-foundation.js +42 -38
  23. package/dist/nx-generators-DQDXOkMX.js +44 -0
  24. package/dist/nx-generators.js +2 -51
  25. package/dist/nx-plugin.d.ts +4 -1
  26. package/dist/nx-plugin.js +241 -15
  27. package/dist/oclif-CJS8CHjO.js +11 -0
  28. package/dist/oclif.js +3 -0
  29. package/dist/product-version-Bqc0L8lq.js +18 -0
  30. package/dist/publish-generator-tree-CgFdcykY.js +14 -0
  31. package/dist/repository-preset-DYxxe7p3.js +543 -0
  32. package/dist/verified-writes-Cne-zTxS.js +60 -0
  33. package/generators/cli-command/schema.json +20 -0
  34. package/generators/cli-extension/schema.json +20 -0
  35. package/generators/service/files/AGENTS.md.template +2 -2
  36. package/generators/service/files/habitat.toml.template +1 -1
  37. package/generators.json +10 -0
  38. package/oclif.manifest.json +1094 -27
  39. package/package.json +72 -8
  40. package/dist/application.d.ts +0 -14
  41. package/dist/commands/check.d.ts +0 -15
  42. package/dist/commands/check.js +0 -32
  43. package/dist/commands/hook.d.ts +0 -12
  44. package/dist/commands/hook.js +0 -25
  45. package/dist/commands/resolve.d.ts +0 -9
  46. package/dist/commands/resolve.js +0 -15
  47. package/dist/generators/init.d.ts +0 -3
  48. package/dist/generators/preset.d.ts +0 -4
  49. package/dist/generators/remove-hook.d.ts +0 -3
  50. package/dist/generators/service.d.ts +0 -16
  51. package/dist/index.d.ts +0 -1
  52. package/dist/lib/binding.d.ts +0 -10
  53. package/dist/lib/binding.js +0 -16
  54. package/dist/lib/output.d.ts +0 -9
  55. package/dist/lib/output.js +0 -22
  56. package/dist/migrations/0-5-7-repository-foundation.d.ts +0 -3
  57. package/dist/nx/initialization.d.ts +0 -62
  58. package/dist/nx/initialization.js +0 -265
  59. package/dist/nx/projection.d.ts +0 -29
  60. package/dist/nx/projection.js +0 -308
  61. package/dist/nx/repository-preset.d.ts +0 -22
  62. package/dist/nx/repository-preset.js +0 -596
  63. package/dist/nx-generators.d.ts +0 -42
  64. package/dist/product-version.d.ts +0 -2
  65. package/dist/product-version.js +0 -15
package/README.md CHANGED
@@ -15,6 +15,57 @@ habitat plugins --help
15
15
  `@oclif/plugin-plugins` owns listing, installation, linking, inspection,
16
16
  updates, reset, uninstallation, aliases, and its native per-user state.
17
17
 
18
+ ## Curated Agent Plugins
19
+
20
+ `habitat agent plugins check|package|status|sync|test|vendors update` projects
21
+ the platform lifecycle service. Use each command's native `--help` for its
22
+ closed request shape. Content repositories, immutable Git identities, provider
23
+ homes and package outputs are explicit inputs, not executable plugin discovery.
24
+
25
+ Current-main consumes `.habitat/agent-plugin-lifecycle/channels/current-main.json`
26
+ and the selected commit's `.habitat/release-input.json`. Older `.rawr` paths are
27
+ not fallback aliases. Publishing these records in Marketplace is a separate
28
+ repository-owner adoption action; installing the CLI does not migrate them.
29
+
30
+ Technical telemetry defaults to disabled. `HABITAT_TELEMETRY` accepts explicit
31
+ JSON matching the SDK's `OpenTelemetryNodeConfigSchema`, excluding
32
+ `processIdentity`, which the app supplies. Enabled configuration specifies all
33
+ three OTLP HTTP signal URLs, headers, timeouts and export settings. It is read
34
+ only after native command admission; help and parser refusals acquire nothing.
35
+ Telemetry configures transport, not a HyperDX/ClickHouse backend or product
36
+ analytics pipeline.
37
+
38
+ ## Development Operations
39
+
40
+ The four generic operations use native Git and Graphite through the selected
41
+ Effect Platform Node resources:
42
+
43
+ ```sh
44
+ habitat dev repo sync-upstream
45
+ habitat dev stack doctor
46
+ habitat dev stack drain
47
+ habitat dev worktree cleanup --prefix wt- --trunk main
48
+ ```
49
+
50
+ Commands target `--repository <path>` or the invoking directory. Mutators plan
51
+ by default; `--apply` executes and `--dry-run` overrides it. Optional repeated
52
+ `--scratch-file` inputs check only those files, with warning or explicit
53
+ `--scratch-mode block`; Habitat assumes no personal document layout.
54
+
55
+ Upstream sync fast-forwards the current checkout from its Git-configured upstream
56
+ or paired `--remote`/`--branch` override. It creates no integration branch and
57
+ does not maintain Graphite ancestry. Cleanup requires an explicit local trunk,
58
+ preserves current/pinned/detached/locked/trunk worktrees and defaults to merged
59
+ branches only. A failed native removal stops the remaining removals; there is no
60
+ force removal or branch deletion.
61
+
62
+ Stack drain submits the current downstack and requests one native Graphite
63
+ merge. `Requested` means accepted submission, not completed merging. After the
64
+ operator or workstream verifies actual merge completion, use Graphite's native
65
+ `gt sync --force --no-restack --no-interactive` once. The forced sync has native
66
+ repository-wide update/cleanup scope; protect unrelated work before invoking it.
67
+ Habitat does not implement a polling, resubmission or automatic cleanup loop.
68
+
18
69
  ## Create A Repository
19
70
 
20
71
  Nx invokes the package's Bun-only `preset` generator while creating the workspace:
@@ -52,12 +103,19 @@ Later package releases use ordinary Nx migrations:
52
103
  ```sh
53
104
  bunx nx migrate @habitat-ai/cli@latest
54
105
  bun install
55
- bunx nx migrate --run-migrations
56
106
  ```
57
107
 
58
108
  The first command updates the fixed CLI/SDK pair and writes any applicable
59
- Habitat migrations. The final command applies those package-owned repository
60
- changes; no consumer copies or independently maintains the preset wiring.
109
+ Habitat migrations. If Nx generated a nonempty migration plan, review it and
110
+ apply those package-owned repository changes:
111
+
112
+ ```sh
113
+ bunx nx migrate --run-migrations=migrations.json
114
+ ```
115
+
116
+ A package-only upgrade may correctly generate no migration file. Do not replay
117
+ an older plan or synthesize one. No consumer copies or independently maintains
118
+ the preset wiring.
61
119
 
62
120
  Habitat `0.5.3` used Nx `23.1.0`, whose provenance reader predates npm 12. When
63
121
  that exact historical pair is upgraded under npm 12, pin the migration CLI and
@@ -67,7 +125,7 @@ the final command applies the repository changes:
67
125
 
68
126
  ```sh
69
127
  NX_MIGRATE_CLI_VERSION=23.1.1 NX_SKIP_PROVENANCE_CHECK=true \
70
- bunx nx migrate @habitat-ai/cli@0.5.15
128
+ bunx nx migrate @habitat-ai/cli@0.6.0
71
129
  bun install
72
130
  NX_MIGRATE_CLI_VERSION=23.1.1 NX_SKIP_PROVENANCE_CHECK=true \
73
131
  bunx nx migrate --run-migrations=migrations.json --no-interactive
@@ -0,0 +1,80 @@
1
+ import { n as runHabitatProcess } from "./cli-hhbbymEz.js";
2
+ import { T as contract } from "./habitat.app-Cl-58zQB.js";
3
+ import { n as sourceBundle } from "./oclif-CJS8CHjO.js";
4
+ import { createRequire } from "node:module";
5
+ import { resolve } from "node:path";
6
+ import { randomUUID } from "node:crypto";
7
+ //#region runtime/sources.ts
8
+ const require = createRequire(import.meta.url);
9
+ /** Deployment locators and caller input are explicit values, not a cached provider acquisition. */
10
+ function runtimeSources(appRoot, workspaceRoot) {
11
+ const timeoutInput = process.env.HABITAT_COMMAND_TIMEOUT_MS;
12
+ const timeoutMs = timeoutInput === void 0 ? 6e5 : Number(timeoutInput);
13
+ if (!Number.isInteger(timeoutMs) || timeoutMs < 1 || timeoutMs > 6e5) throw new TypeError("HABITAT_COMMAND_TIMEOUT_MS must be an integer from 1 through 600000.");
14
+ const gritEntrypoint = require.resolve("@getgrit/cli/run-grit.js");
15
+ return {
16
+ appRoot,
17
+ memory: {
18
+ "habitat.catalog.scope": { workspaceRoot: resolve(workspaceRoot) },
19
+ "habitat.catalog.config": { policyPack: {
20
+ name: "@habitat-ai/sdk",
21
+ packageJsonPath: require.resolve("@habitat-ai/sdk/package.json"),
22
+ manifestPath: require.resolve("@habitat-ai/sdk/habitat-pack.json")
23
+ } },
24
+ "habitat.source-inventory": {},
25
+ "habitat.telemetry": telemetryConfiguration(),
26
+ "habitat.rule-evaluation": {
27
+ command: process.platform === "win32" ? "node" : gritEntrypoint,
28
+ args: process.platform === "win32" ? [gritEntrypoint] : [],
29
+ timeoutMs
30
+ }
31
+ }
32
+ };
33
+ }
34
+ function telemetryConfiguration() {
35
+ const raw = process.env.HABITAT_TELEMETRY;
36
+ let value = { enabled: false };
37
+ if (raw !== void 0) try {
38
+ value = JSON.parse(raw);
39
+ } catch {
40
+ throw new TypeError("HABITAT_TELEMETRY must contain valid JSON.");
41
+ }
42
+ if (typeof value !== "object" || value === null || Array.isArray(value) || "processIdentity" in value) throw new TypeError("HABITAT_TELEMETRY must be a provider configuration without processIdentity.");
43
+ return {
44
+ ...value,
45
+ processIdentity: {
46
+ serviceName: "habitat",
47
+ processRole: "cli",
48
+ deploymentEnvironment: "local",
49
+ processInstanceId: randomUUID()
50
+ }
51
+ };
52
+ }
53
+ //#endregion
54
+ //#region src/application.ts
55
+ /** Run one app-selected process; the native host owns dispatch and finalization. */
56
+ function executeHabitat(input) {
57
+ return runHabitatProcess({
58
+ ...input,
59
+ sources: () => runtimeSources(input.appRoot, input.workspaceRoot),
60
+ sourceBundle,
61
+ terminal: true
62
+ });
63
+ }
64
+ /** A bounded native invocation returns only validated data, never an escaped managed client. */
65
+ async function resolveCatalogForWorkspace(input) {
66
+ const value = await runHabitatProcess({
67
+ ...input,
68
+ args: ["resolve"],
69
+ sources: () => runtimeSources(input.appRoot, input.workspaceRoot),
70
+ sourceBundle,
71
+ terminal: false
72
+ });
73
+ const schemas = contract.catalog.resolve["~orpc"].outputSchemas;
74
+ if (schemas?.length !== 1 || schemas[0] === void 0) throw new TypeError("Catalog resolve must declare its output schema.");
75
+ const result = await schemas[0]["~standard"].validate(value);
76
+ if (result.issues !== void 0) throw new TypeError("Native catalog invocation returned an invalid result.");
77
+ return result.value;
78
+ }
79
+ //#endregion
80
+ export { resolveCatalogForWorkspace as n, executeHabitat as t };
@@ -1,18 +1,2 @@
1
- import { createHabitatClientForWorkspace } from "@habitat-ai/sdk";
2
- import { execute, settings } from "@oclif/core";
3
- import { bindHabitatClient } from "./lib/binding.js";
4
- /**
5
- * Runs one native Oclif invocation over the app-selected Habitat client.
6
- *
7
- * Oclif owns command discovery and dispatch; this boundary supplies only the
8
- * ready workspace client required by the Habitat commands.
9
- */
10
- export async function executeHabitat({ appRoot, workspaceRoot, args, development, }) {
11
- settings.enableAutoTranspile = development === true;
12
- const client = await createHabitatClientForWorkspace(workspaceRoot);
13
- return execute({
14
- ...(args === undefined ? {} : { args }),
15
- ...(development === undefined ? {} : { development }),
16
- loadOptions: bindHabitatClient({ root: appRoot }, client),
17
- });
18
- }
1
+ import { n as resolveCatalogForWorkspace, t as executeHabitat } from "./application-gZ8XAszE.js";
2
+ export { executeHabitat, resolveCatalogForWorkspace };