@habitat-ai/cli 0.6.0 → 0.7.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.
package/README.md CHANGED
@@ -117,6 +117,44 @@ A package-only upgrade may correctly generate no migration file. Do not replay
117
117
  an older plan or synthesize one. No consumer copies or independently maintains
118
118
  the preset wiring.
119
119
 
120
+ **Windows is not supported in 0.7.0.** Habitat is tested and released on
121
+ Linux and macOS only; Windows is not tested in CI. In earlier hosted Windows
122
+ runs, the package-manager install inside `create-nx-workspace` and the install
123
+ of the new pair during an upgrade intermittently stalled past their deadlines,
124
+ with the cause not identified. The Windows policy behaviour described below is
125
+ kept in the CLI but is no longer tested.
126
+
127
+ **Windows policy checks:** Habitat can check explicit files with Grit on
128
+ Windows. If a selected Grit rule scans a directory, the CLI reports
129
+ `cannot evaluate on Windows`, marks the application as an error, and exits
130
+ nonzero from `habitat check`. This includes rules whose patterns might work
131
+ on Windows in isolation. Run the same selection on macOS or Linux to obtain
132
+ a verdict. The distinction is the input to Grit: a catalog rule that resolves
133
+ a directory or glob to an explicit file list still gets checked. The bundled
134
+ service v1 and resource v1 policies include direct directory scans; a new
135
+ preset does not select them automatically. Native structure checks are
136
+ unaffected. Codex agent-stop runs structure checks, not Grit.
137
+
138
+ Windows also limits the length of a native command line. A large explicit
139
+ file list may not fit; that check returns an error, not a partial result.
140
+ Run the full selection on macOS or Linux rather than dropping files.
141
+
142
+ Habitat's inferred Nx policy targets distinguish host platforms when they
143
+ run Grit, even for explicit files. Custom cacheable targets that wrap `habitat check`
144
+ must do the same or run uncached; a cached POSIX pass is not a Windows result.
145
+
146
+ **Existing services on the beta.51 oRPC cohort:** updating the CLI/SDK pair
147
+ does not change which service policy a repository selected. For the bundled
148
+ service blueprint, change the service's own `habitat.toml` from version 3
149
+ to 5, or from 4 to 6, preserving its existing base policy. Do not infer the
150
+ selection from the installed package version. From the workspace root, run
151
+ `habitat resolve --json`, then `habitat check --owner <project> --json`.
152
+ Look for the evaluated `service_v5_effect_bridge` or `service_v6_effect_bridge`
153
+ rule. A pass on the older rule does not cover the renamed bridge. Align any
154
+ direct native dependencies with the selected SDK; a single physical oRPC
155
+ and Effect installation is required. Plain handlers need no bootstrap;
156
+ Effect services use only the SDK facade in `src/service/impl.ts`.
157
+
120
158
  Habitat `0.5.3` used Nx `23.1.0`, whose provenance reader predates npm 12. When
121
159
  that exact historical pair is upgraded under npm 12, pin the migration CLI and
122
160
  scope Nx's documented compatibility flag to both migration commands. The first
@@ -1,6 +1,6 @@
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";
1
+ import { n as runHabitatProcess } from "./cli-DxjKzwlV.js";
2
+ import { T as contract } from "./habitat.app-CgdXa2f2.js";
3
+ import { n as sourceBundle } from "./oclif-DBwcAyVK.js";
4
4
  import { createRequire } from "node:module";
5
5
  import { resolve } from "node:path";
6
6
  import { randomUUID } from "node:crypto";
@@ -1,2 +1,2 @@
1
- import { n as resolveCatalogForWorkspace, t as executeHabitat } from "./application-gZ8XAszE.js";
1
+ import { n as resolveCatalogForWorkspace, t as executeHabitat } from "./application-Idvdhc9h.js";
2
2
  export { executeHabitat, resolveCatalogForWorkspace };
@@ -1,4 +1,4 @@
1
- import { A as FilesystemRuntimeResource, C as SourceInventoryPathSchema, D as RuleEvaluationRequestSchema, E as MAX_RULE_EVALUATION_FAILURE_DETAIL, O as SourceInventoryRuntimeResource, S as ObserveSourceInventoryInputSchema, _ as CodexNativeAgentProviderRuntimeResource, a as MaterializeRemoteInputSchema, b as MAX_SOURCE_INVENTORY_FAILURE_DETAIL, c as CanonicalGitRepositoryUrlSchema, d as NativeProviderMarketplaceIdentityInputSchema, f as NativeProviderPluginFilesReadInputSchema, g as ClaudeNativeAgentProviderRuntimeResource, h as VersionedContentRuntimeResource, i as MAX_VERSIONED_CONTENT_FAILURE_DETAIL, k as RuleEvaluationRuntimeResource, l as NativeMarketplaceSourceSchema, m as NativeProviderSessionInputSchema, n as ChildProcessRuntimeResource, o as ObserveRemoteInputSchema, p as NativeProviderPluginSelectorInputSchema, r as AncestryInputSchema, s as VersionedContentTreeEntrySchema, t as habitatApp, u as NativeProviderInventorySchema, v as ContentWorkspaceRuntimeResource, w as SourceInventoryResultSchema, x as MAX_SOURCE_INVENTORY_ROOT_LENGTH, y as AgentPluginPackageOutputRuntimeResource } from "./habitat.app-Cl-58zQB.js";
1
+ import { A as FilesystemRuntimeResource, C as SourceInventoryPathSchema, D as RuleEvaluationRequestSchema, E as MAX_RULE_EVALUATION_FAILURE_DETAIL, O as SourceInventoryRuntimeResource, S as ObserveSourceInventoryInputSchema, _ as CodexNativeAgentProviderRuntimeResource, a as MaterializeRemoteInputSchema, b as MAX_SOURCE_INVENTORY_FAILURE_DETAIL, c as CanonicalGitRepositoryUrlSchema, d as NativeProviderMarketplaceIdentityInputSchema, f as NativeProviderPluginFilesReadInputSchema, g as ClaudeNativeAgentProviderRuntimeResource, h as VersionedContentRuntimeResource, i as MAX_VERSIONED_CONTENT_FAILURE_DETAIL, k as RuleEvaluationRuntimeResource, l as NativeMarketplaceSourceSchema, m as NativeProviderSessionInputSchema, n as ChildProcessRuntimeResource, o as ObserveRemoteInputSchema, p as NativeProviderPluginSelectorInputSchema, r as AncestryInputSchema, s as VersionedContentTreeEntrySchema, t as habitatApp, u as NativeProviderInventorySchema, v as ContentWorkspaceRuntimeResource, w as SourceInventoryResultSchema, x as MAX_SOURCE_INVENTORY_ROOT_LENGTH, y as AgentPluginPackageOutputRuntimeResource } from "./habitat.app-CgdXa2f2.js";
2
2
  import { t as createOclifHost } from "./host-BcptPYDL.js";
3
3
  import { createRequire } from "node:module";
4
4
  import { requireResource } from "@habitat-ai/sdk/runtime/resources";
@@ -9,7 +9,7 @@ import Schema, { Validator } from "typebox/schema";
9
9
  import { Value } from "typebox/value";
10
10
  import { defineEntrypoint, defineProcessCatalog, startApp } from "@habitat-ai/sdk/app";
11
11
  import path from "node:path";
12
- import { ChildProcess, ChildProcessSpawner } from "effect/unstable/process";
12
+ import { ChildProcess, ChildProcessSpawner } from "effect/process";
13
13
  import { TelemetryRuntimeResource, defineOpenTelemetryNodeRuntimeProvider } from "@habitat-ai/sdk/telemetry";
14
14
  import { defineRuntimeProvider } from "@habitat-ai/sdk/runtime/providers";
15
15
  import { providerFx } from "@habitat-ai/sdk/runtime/providers/effect";
@@ -1114,11 +1114,11 @@ const captureRegularFile = Effect.fn("agentPluginPackageOutput.captureRegularFil
1114
1114
  const nlink = Option.getOrUndefined(info.nlink);
1115
1115
  const mtime = Option.getOrUndefined(info.mtime)?.getTime();
1116
1116
  const size = Number(info.size);
1117
- if (canonical !== filePath || info.type !== "File" || info.dev !== parent.dev || ino === void 0 || nlink !== 1 || mtime === void 0 || !Number.isSafeInteger(size) || size < 0 || size > maxBytes) return yield* rejected("publish-output", reason, phase, filePath, "Output must be one bounded canonical regular file in its captured parent");
1117
+ if (canonical !== filePath || info.type !== "File" || info.dev !== parent.dev || ino === void 0 || nlink !== 1n || mtime === void 0 || !Number.isSafeInteger(size) || size < 0 || size > maxBytes) return yield* rejected("publish-output", reason, phase, filePath, "Output must be one bounded canonical regular file in its captured parent");
1118
1118
  const bytes = yield* fs.readFile(filePath).pipe(mapPlatform$5("publish-output", reason, `${phase}-read`, filePath));
1119
1119
  if (bytes.byteLength !== size) return yield* rejected("publish-output", reason, `${phase}-read`, filePath, "Output size changed while it was read");
1120
1120
  const after = yield* fs.stat(filePath).pipe(mapPlatform$5("publish-output", reason, `${phase}-revalidation`, filePath));
1121
- if (after.type !== "File" || after.dev !== info.dev || Option.getOrUndefined(after.ino) !== ino || after.mode !== info.mode || Number(after.size) !== size || Option.getOrUndefined(after.mtime)?.getTime() !== mtime || Option.getOrUndefined(after.nlink) !== 1) return yield* rejected("publish-output", reason, `${phase}-revalidation`, filePath, "Output identity changed while it was read");
1121
+ if (after.type !== "File" || after.dev !== info.dev || Option.getOrUndefined(after.ino) !== ino || after.mode !== info.mode || Number(after.size) !== size || Option.getOrUndefined(after.mtime)?.getTime() !== mtime || Option.getOrUndefined(after.nlink) !== 1n) return yield* rejected("publish-output", reason, `${phase}-revalidation`, filePath, "Output identity changed while it was read");
1122
1122
  return Object.freeze({
1123
1123
  path: filePath,
1124
1124
  dev: info.dev,
@@ -1150,7 +1150,7 @@ const allocateTemporaryFile = Effect.fn("agentPluginPackageOutput.allocateTempor
1150
1150
  }));
1151
1151
  const fileInfo = yield* file.stat.pipe(mapPlatform$5("publish-output", "TemporaryFailed", "temporary-identity", temporaryPath));
1152
1152
  const ino = Option.getOrUndefined(fileInfo.ino);
1153
- if (fileInfo.type !== "File" || fileInfo.dev !== parent.dev || ino === void 0 || Option.getOrUndefined(fileInfo.nlink) !== 1) return yield* rejected("publish-output", "TemporaryFailed", "temporary-identity", temporaryPath, "Created temporary file descriptor did not provide one stable regular-file identity");
1153
+ if (fileInfo.type !== "File" || fileInfo.dev !== parent.dev || ino === void 0 || Option.getOrUndefined(fileInfo.nlink) !== 1n) return yield* rejected("publish-output", "TemporaryFailed", "temporary-identity", temporaryPath, "Created temporary file descriptor did not provide one stable regular-file identity");
1154
1154
  const captured = Object.freeze({
1155
1155
  parent,
1156
1156
  path: temporaryPath,
@@ -1176,14 +1176,14 @@ const revalidateOwnedTemporaryFile = Effect.fn("agentPluginPackageOutput.revalid
1176
1176
  yield* revalidateParent(fs, owned.parent, operation);
1177
1177
  if (paths.dirname(owned.path) !== owned.parent.path || !paths.basename(owned.path).startsWith(PRIVATE_TEMPORARY_PREFIX)) return yield* rejected(operation, "TemporaryFailed", "temporary-revalidation", owned.path, "Owned temporary escaped its exact output parent");
1178
1178
  const [canonical, info] = yield* Effect.all([fs.realPath(owned.path).pipe(mapPlatform$5(operation, "TemporaryFailed", "temporary-revalidation", owned.path)), fs.stat(owned.path).pipe(mapPlatform$5(operation, "TemporaryFailed", "temporary-revalidation", owned.path))]);
1179
- if (canonical !== owned.path || info.type !== "File" || info.dev !== owned.dev || Option.getOrUndefined(info.ino) !== owned.ino || Option.getOrUndefined(info.nlink) !== expectedLinks) return yield* rejected(operation, "TemporaryFailed", "temporary-revalidation", owned.path, "Owned temporary identity changed");
1179
+ if (canonical !== owned.path || info.type !== "File" || info.dev !== owned.dev || Option.getOrUndefined(info.ino) !== owned.ino || Option.getOrUndefined(info.nlink) !== BigInt(expectedLinks)) return yield* rejected(operation, "TemporaryFailed", "temporary-revalidation", owned.path, "Owned temporary identity changed");
1180
1180
  });
1181
1181
  const admitCreatedTemporaryFile = Effect.fn("agentPluginPackageOutput.admitCreatedTemporaryFile")(function* (fs, paths, created) {
1182
1182
  yield* revalidateParent(fs, created.parent, "cleanup");
1183
1183
  if (paths.dirname(created.path) !== created.parent.path || !paths.basename(created.path).startsWith(PRIVATE_TEMPORARY_PREFIX)) return yield* rejected("cleanup", "TemporaryFailed", "temporary-admission", created.path, "Created temporary escaped its exact output parent");
1184
1184
  const [canonical, info] = yield* Effect.all([fs.realPath(created.path).pipe(mapPlatform$5("cleanup", "TemporaryFailed", "temporary-admission", created.path)), fs.stat(created.path).pipe(mapPlatform$5("cleanup", "TemporaryFailed", "temporary-admission", created.path))]);
1185
1185
  const ino = Option.getOrUndefined(info.ino);
1186
- if (canonical !== created.path || info.type !== "File" || info.dev !== created.parent.dev || ino === void 0 || Option.getOrUndefined(info.nlink) !== 1) return yield* rejected("cleanup", "TemporaryFailed", "temporary-admission", created.path, "Created temporary could not be admitted as one owned regular file");
1186
+ if (canonical !== created.path || info.type !== "File" || info.dev !== created.parent.dev || ino === void 0 || Option.getOrUndefined(info.nlink) !== 1n) return yield* rejected("cleanup", "TemporaryFailed", "temporary-admission", created.path, "Created temporary could not be admitted as one owned regular file");
1187
1187
  return Object.freeze({
1188
1188
  parent: created.parent,
1189
1189
  path: created.path,
@@ -1714,18 +1714,21 @@ function makeContentWorkspaceResource(options = {}) {
1714
1714
  const present = yield* fs.exists(root).pipe(mapPlatform$4("materialize-content-tree", root));
1715
1715
  if (present) yield* requireContentTreeDirectory(fs, parent, root);
1716
1716
  if (present && (yield* contentTreeMatches(fs, parent, root, input))) return Object.freeze({ root });
1717
- return yield* Effect.acquireUseRelease(fs.makeTempDirectory({
1718
- directory: parent,
1719
- prefix: CONTENT_TREE_STAGE_PREFIX
1720
- }).pipe(mapPlatform$4("materialize-content-tree", parent)), (stage) => Effect.gen(function* () {
1721
- yield* requireContentTreeStage(fs, parent, stage);
1722
- yield* populateContentTree(fs, stage, input);
1723
- yield* cutOverContentTree(fs, parent, root, stage, present);
1724
- return Object.freeze({ root });
1725
- }), (stage, useExit) => {
1726
- if (Exit.isSuccess(useExit)) return Effect.void;
1727
- return cleanupContentTreeStage(fs, parent, stage).pipe(Effect.catchCause((cleanupCause) => Effect.failCause(Cause.combine(useExit.cause, cleanupCause))));
1728
- });
1717
+ return yield* Effect.uninterruptibleMask((restore) => Effect.gen(function* () {
1718
+ const stage = yield* fs.makeTempDirectory({
1719
+ directory: parent,
1720
+ prefix: CONTENT_TREE_STAGE_PREFIX
1721
+ }).pipe(mapPlatform$4("materialize-content-tree", parent));
1722
+ const attempted = yield* Effect.exit(restore(Effect.gen(function* () {
1723
+ yield* requireContentTreeStage(fs, parent, stage);
1724
+ yield* populateContentTree(fs, stage, input);
1725
+ yield* cutOverContentTree(fs, parent, root, stage, present);
1726
+ })));
1727
+ if (Exit.isSuccess(attempted)) return Object.freeze({ root });
1728
+ const cleaned = yield* Effect.exit(cleanupContentTreeStage(fs, parent, stage));
1729
+ const cause = Exit.isFailure(cleaned) ? Cause.combine(attempted.cause, cleaned.cause) : attempted.cause;
1730
+ return yield* Effect.failCause(cause);
1731
+ }));
1729
1732
  });
1730
1733
  const capture = Effect.fn("contentWorkspace.capture")(function* (input) {
1731
1734
  const fs = yield* FileSystem.FileSystem;
@@ -2482,7 +2485,7 @@ function observeGitWorkspaceAnchor(fs, executable, locator, input, operation) {
2482
2485
  return Object.freeze({
2483
2486
  root,
2484
2487
  rootDevice: String(rootInfo.dev),
2485
- rootInode: String(Option.getOrElse(rootInfo.ino, () => -1)),
2488
+ rootInode: String(Option.getOrElse(rootInfo.ino, () => -1n)),
2486
2489
  refName,
2487
2490
  commit,
2488
2491
  refCommit,
@@ -3863,6 +3866,8 @@ const GRIT_PATTERN_PREFIX = "habitat_rule_evaluation_";
3863
3866
  const MAX_GRIT_STDOUT_BYTES = 262144;
3864
3867
  const GRIT_REPORT_HEADROOM_BYTES = 262144;
3865
3868
  const MAX_GRIT_STDERR_BYTES = 16777216;
3869
+ const WINDOWS_COMMAND_LINE_LIMIT = 32767;
3870
+ const WINDOWS_DISK_SUBJECT_PATH = /^(?:[A-Za-z]:\/|\/\/(?![.?]\/)[^/]+\/[^/]+(?:\/|$))/u;
3866
3871
  /** Structural schema for Grit provider construction. */
3867
3872
  const GritRuleEvaluationProviderConfigSchema = ReadonlyObject(Type.Object({
3868
3873
  command: Type.String({
@@ -3934,12 +3939,26 @@ function makeGritRuleEvaluationResource(config) {
3934
3939
  const [firstProgram, ...remainingPrograms] = input.programs;
3935
3940
  if (firstProgram === void 0) return yield* fail$2("InvalidInput", "Rule-evaluation request requires at least one program");
3936
3941
  if (new Set(input.programs.map(({ id }) => id)).size !== input.programs.length) return yield* fail$2("InvalidInput", "Rule-evaluation program identities must be unique");
3942
+ const subjectPaths = path.sep === "\\" ? yield* windowsFileArguments(input.subjectPaths) : input.subjectPaths;
3937
3943
  const programs = [materializeProgram(firstProgram, 0), ...remainingPrograms.map((program) => materializeProgram(program, 0))];
3938
- const evaluations = yield* Effect.forEach(programs, (program) => Effect.scoped(withScopedGritCatalog([program], (catalog) => runGritCheck(config, catalog, [program], input.subjectPaths))), { concurrency: 1 });
3944
+ const evaluations = yield* Effect.forEach(programs, (program) => Effect.scoped(withScopedGritCatalog([program], (catalog) => runGritCheck(config, catalog, [program], subjectPaths))), { concurrency: 1 });
3939
3945
  return Object.freeze({ results: Object.freeze(evaluations.flatMap(({ results }) => results)) });
3940
3946
  });
3941
3947
  return Object.freeze({ evaluate });
3942
3948
  }
3949
+ const windowsFileArguments = Effect.fn(function* (subjectPaths) {
3950
+ const args = subjectPaths.map((subjectPath) => subjectPath.replaceAll("\\", "/"));
3951
+ if (args.some((arg) => !WINDOWS_DISK_SUBJECT_PATH.test(arg))) return yield* fail$2("InvalidInput", "Windows Grit subjects must use drive-absolute or UNC paths outside device namespaces");
3952
+ const fs = yield* FileSystem.FileSystem;
3953
+ for (const subjectPath of subjectPaths) {
3954
+ const info = yield* fs.stat(subjectPath).pipe(mapPlatform$2("ExecutionFailed", `Failed to inspect Windows Grit subject '${subjectPath}'`));
3955
+ if (info.type === "Directory") return yield* fail$2("ExecutionFailed", `Grit cannot evaluate on Windows when a subject is a directory. Run this check on a POSIX host (macOS or Linux). Directory: '${subjectPath}'`);
3956
+ if (info.type !== "File") return yield* fail$2("ExecutionFailed", `Unsupported Windows Grit subject type '${info.type}'; expected a regular file: '${subjectPath}'`);
3957
+ }
3958
+ const subjectUnits = args.reduce((total, arg) => total + arg.length + 1, 0);
3959
+ if (subjectUnits > WINDOWS_COMMAND_LINE_LIMIT) return yield* fail$2("ExecutionFailed", `Grit file arguments exceed the Windows command line limit of ${WINDOWS_COMMAND_LINE_LIMIT} UTF-16 code units (selected files: ${args.length}; minimum required: ${subjectUnits}). Run this check on a POSIX host (macOS or Linux).`);
3960
+ return args;
3961
+ });
3943
3962
  function withScopedGritCatalog(programs, use) {
3944
3963
  return Effect.gen(function* () {
3945
3964
  const fs = yield* FileSystem.FileSystem;
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- import { n as runHabitatProcess, t as entrypoint } from "./cli-hhbbymEz.js";
1
+ import { n as runHabitatProcess, t as entrypoint } from "./cli-DxjKzwlV.js";
2
2
  export { entrypoint, runHabitatProcess };
@@ -77,7 +77,7 @@ function packageWithTestContract(contents) {
77
77
  };
78
78
  manifest.devDependencies = { ...manifest.devDependencies };
79
79
  for (const [name, version] of Object.entries({
80
- effect: "4.0.0-beta.101",
80
+ effect: "4.1.4",
81
81
  "bun-types": "1.3.14"
82
82
  })) if ((manifest.dependencies?.[name] ?? manifest.devDependencies[name]) === void 0) manifest.devDependencies[name] = version;
83
83
  return `${JSON.stringify(manifest, null, 2)}\n`;
@@ -11,8 +11,8 @@ const KEBAB_NAME_PATTERN = "^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$";
11
11
  const STRICT_IDENTIFIER_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
12
12
  /** Exact non-SDK dependency pins emitted into every constructed service package. */
13
13
  const SERVICE_GENERATOR_DEPENDENCY_VERSIONS = {
14
- "@orpc/contract": "2.0.0-beta.32",
15
- "@orpc/server": "2.0.0-beta.32",
14
+ "@orpc/contract": "2.0.0-beta.51",
15
+ "@orpc/server": "2.0.0-beta.51",
16
16
  typebox: "1.3.8"
17
17
  };
18
18
  const RESERVED_IDENTIFIERS = /* @__PURE__ */ new Set([
@@ -2,7 +2,7 @@ import { defineRuntimeResource } from "@habitat-ai/sdk/runtime/resources";
2
2
  import { RuntimeSchema } from "@habitat-ai/sdk/runtime/schema";
3
3
  import { defineService, procedureMetadata, resourceDep, sealService } from "@habitat-ai/sdk/service";
4
4
  import { createRouterClient, implement, os } from "@orpc/server";
5
- import { Clock, Effect, Result, Stream } from "effect";
5
+ import { Cause, Clock, Effect, Result, Stream } from "effect";
6
6
  import { ReadonlyObject, Refine, Type } from "typebox";
7
7
  import { oc } from "@orpc/contract";
8
8
  import { standard } from "@habitat-ai/sdk/service/schema";
@@ -17,7 +17,7 @@ import { createOclifCommand } from "@habitat-ai/sdk/plugins/cli/oclif";
17
17
  import { posix } from "node:path";
18
18
  import { Args, Flags } from "@oclif/core";
19
19
  import { Effect as Effect$1 } from "@habitat-ai/sdk/effect";
20
- import { ChildProcess } from "effect/unstable/process";
20
+ import { ChildProcess } from "effect/process";
21
21
  //#region ../../resources/filesystem/dist/runtime.js
22
22
  const FilesystemRuntimeResource = defineRuntimeResource({
23
23
  id: "filesystem",
@@ -2828,8 +2828,10 @@ const middleware = base.middleware(async ({ context, next }) => {
2828
2828
  const workspaceRealPathAttempt = yield* Effect.result(fileSystem.realPath(workspaceRoot));
2829
2829
  if (workspaceRealPathAttempt._tag === "Failure") return rejected$1([filesystemIssue(workspaceRealPathAttempt.failure, workspaceRoot, "resolve workspaceRoot", "workspaceRoot does not exist.")]);
2830
2830
  const workspaceRealRoot = workspaceRealPathAttempt.success;
2831
- const excludes = excludedRepositoryGlobs.map((pattern) => path.resolve(workspaceRoot, pattern));
2832
- const globResults = yield* Effect.all(authorityGlobs.map(({ kind, pattern }) => Effect.result(fileSystem.glob(path.resolve(workspaceRoot, pattern), { exclude: excludes })).pipe(Effect.map((result) => ({
2831
+ const globResults = yield* Effect.all(authorityGlobs.map(({ kind, pattern }) => Effect.result(fileSystem.glob(pattern, {
2832
+ root: workspaceRoot,
2833
+ exclude: excludedRepositoryGlobs
2834
+ })).pipe(Effect.map((result) => ({
2833
2835
  kind,
2834
2836
  result
2835
2837
  })))));
@@ -15872,7 +15874,7 @@ function runCommand(spawner, command, args, cwd, timeoutMs = 6e4) {
15872
15874
  exitCode,
15873
15875
  stdout: decode(stdout),
15874
15876
  stderr: decode(stderr),
15875
- failure: attempt._tag === "Failure" ? failureMessage(attempt.failure) : null
15877
+ failure: attempt._tag === "Failure" ? Cause.isTimeoutError(attempt.failure) ? attempt.failure._tag : failureMessage(attempt.failure) : null
15876
15878
  };
15877
15879
  });
15878
15880
  }
@@ -1,2 +1,2 @@
1
- import { t as habitatApp } from "./habitat.app-Cl-58zQB.js";
1
+ import { t as habitatApp } from "./habitat.app-CgdXa2f2.js";
2
2
  export { habitatApp };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { t as executeHabitat } from "./application-gZ8XAszE.js";
1
+ import { t as executeHabitat } from "./application-Idvdhc9h.js";
2
2
  import { t as cliPackageRoot } from "./product-version-Bqc0L8lq.js";
3
3
  //#region src/index.ts
4
4
  await executeHabitat({
package/dist/nx-plugin.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as resolveCatalogForWorkspace } from "./application-gZ8XAszE.js";
1
+ import { n as resolveCatalogForWorkspace } from "./application-Idvdhc9h.js";
2
2
  import { t as cliPackageRoot } from "./product-version-Bqc0L8lq.js";
3
3
  import { posix } from "node:path";
4
4
  //#region src/nx/projection.ts
@@ -13,6 +13,7 @@ const HABITAT_AUTHORITY_GLOB = `{${HABITAT_CATALOG_PATHS.join(",")}}`;
13
13
  const DEFAULT_CHECK_TARGET = "check:policy";
14
14
  const HABITAT_EXECUTABLE = "habitat";
15
15
  const PORTABLE_OWNER_PROJECT = /^[A-Za-z0-9@][A-Za-z0-9@._/+:-]*$/u;
16
+ const GRIT_PLATFORM_INPUT = { runtime: "node -p process.platform" };
16
17
  /**
17
18
  * Projects resolved Habitat applications and compatibility rules into native Nx targets.
18
19
  *
@@ -158,14 +159,17 @@ function ownerTarget(ownerProject, inputs, hasCompatibility) {
158
159
  };
159
160
  }
160
161
  function ownerInputs(targets, runtimeInputs) {
161
- const runtimeStrings = new Set(runtimeInputs.filter((input) => typeof input === "string"));
162
+ const ownerRuntimeInputs = new Set(runtimeInputs);
162
163
  const corpusInputs = /* @__PURE__ */ new Set();
163
- for (const target of Object.values(targets)) for (const input of target.inputs ?? []) if (typeof input === "string" && !runtimeStrings.has(input)) corpusInputs.add(input);
164
- return [...runtimeInputs, ...[...corpusInputs].sort(compareText)];
164
+ for (const target of Object.values(targets)) for (const input of target.inputs ?? []) if (typeof input !== "string") ownerRuntimeInputs.add(input);
165
+ else if (!ownerRuntimeInputs.has(input)) corpusInputs.add(input);
166
+ return [...ownerRuntimeInputs, ...[...corpusInputs].sort(compareText)];
165
167
  }
166
168
  function applicationInputs(application, runtimeInputs) {
167
169
  const files = new Set(HABITAT_CATALOG_PATHS.map(workspaceInput));
170
+ const inputs = [...runtimeInputs];
168
171
  if (application.runner.name === "grit") {
172
+ inputs.push(GRIT_PLATFORM_INPUT);
169
173
  addLocalAssetInput(files, application.runner.pattern);
170
174
  for (const entry of application.runner.acquisition.entries) if (entry.source.kind === "root-pattern") files.add(workspaceInput(entry.path));
171
175
  else addSubjectInputs(files, entry.path, entry.kind);
@@ -173,22 +177,24 @@ function applicationInputs(application, runtimeInputs) {
173
177
  addLocalAssetInput(files, application.runner.structure);
174
178
  for (const binding of application.runner.rootBindings) if (binding.path !== void 0) addSubjectInputs(files, binding.path, binding.kind);
175
179
  }
176
- return [...runtimeInputs, ...[...files].sort()];
180
+ return [...inputs, ...[...files].sort()];
177
181
  }
178
182
  function compatibilityInputs(rule, runtimeInputs) {
179
183
  const files = new Set(HABITAT_CATALOG_PATHS.map(workspaceInput));
184
+ const inputs = [...runtimeInputs];
180
185
  files.add(workspaceInput(".habitat/**"));
181
186
  files.add(workspaceInput(rule.manifestPath));
182
187
  addLocalAssetInput(files, rule.baseline);
183
188
  for (const pattern of rule.coveragePatterns) files.add(workspaceInput(pattern));
184
189
  if (rule.runner.name === "grit") {
190
+ inputs.push(GRIT_PLATFORM_INPUT);
185
191
  addLocalAssetInput(files, rule.runner.pattern);
186
192
  for (const entry of rule.runner.acquisition.entries) {
187
193
  if (entry.kind === "directory" && entry.path === ".") continue;
188
194
  addSubjectInputs(files, entry.path, entry.kind);
189
195
  }
190
196
  } else addLocalAssetInput(files, rule.runner.structure);
191
- return [...runtimeInputs, ...[...files].sort(compareText)];
197
+ return [...inputs, ...[...files].sort(compareText)];
192
198
  }
193
199
  function addLocalAssetInput(target, asset) {
194
200
  if (asset.provenance.kind === "local") target.add(workspaceInput(asset.relativePath));
@@ -1,4 +1,4 @@
1
- import { t as entrypoint } from "./cli-hhbbymEz.js";
1
+ import { t as entrypoint } from "./cli-DxjKzwlV.js";
2
2
  import { n as createOclifSourceBundle } from "./host-BcptPYDL.js";
3
3
  import { deriveRuntimeArtifacts } from "@habitat-ai/sdk/runtime/derivation";
4
4
  //#region src/oclif.ts
package/dist/oclif.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { r as FINALLY_HOOK } from "./host-BcptPYDL.js";
2
- import { n as sourceBundle, t as COMMANDS } from "./oclif-CJS8CHjO.js";
2
+ import { n as sourceBundle, t as COMMANDS } from "./oclif-DBwcAyVK.js";
3
3
  export { COMMANDS, FINALLY_HOOK, sourceBundle };
@@ -28,4 +28,7 @@
28
28
 
29
29
  ## Validation
30
30
 
31
+ - Read this package's `habitat.toml` for its service blueprint version. From the workspace root,
32
+ run `habitat check --owner <%= name %> --json` and confirm the selected bridge rule was evaluated.
33
+ The unversioned service blueprint README and skill belong to version 1, not this generated service.
31
34
  - Run `bunx nx run <%= name %>:typecheck` and `bunx nx run <%= name %>:build`.
@@ -2,7 +2,7 @@ schemaVersion = 1
2
2
  id = <%- nameLiteral %>
3
3
  ownerProject = <%- nameLiteral %>
4
4
  blueprint = "service"
5
- blueprintVersion = 3
5
+ blueprintVersion = 5
6
6
 
7
7
  [roots]
8
8
  project = <%- directoryLiteral %>
@@ -1166,5 +1166,5 @@
1166
1166
  "enableJsonFlag": false
1167
1167
  }
1168
1168
  },
1169
- "version": "0.6.0"
1169
+ "version": "0.7.0"
1170
1170
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@habitat-ai/cli",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",
@@ -70,18 +70,18 @@
70
70
  "test": "vitest run --project habitat-cli"
71
71
  },
72
72
  "dependencies": {
73
- "@effect/platform-node": "4.0.0-beta.101",
73
+ "@effect/platform-node": "4.1.4",
74
74
  "@getgrit/cli": "0.1.0-alpha.1743007075",
75
- "@habitat-ai/sdk": "0.6.0",
75
+ "@habitat-ai/sdk": "0.7.0",
76
76
  "@nx/devkit": "23.1.1",
77
77
  "@oclif/core": "4.13.3",
78
78
  "@oclif/plugin-help": "^6.2.27",
79
79
  "@oclif/plugin-plugins": "^5.4.84",
80
80
  "@opentelemetry/api": "1.9.0",
81
- "@orpc/contract": "2.0.0-beta.32",
82
- "@orpc/experimental-effect": "2.0.0-beta.32",
83
- "@orpc/server": "2.0.0-beta.32",
84
- "effect": "4.0.0-beta.101",
81
+ "@orpc/contract": "2.0.0-beta.51",
82
+ "@orpc/effect": "2.0.0-beta.51",
83
+ "@orpc/server": "2.0.0-beta.51",
84
+ "effect": "4.1.4",
85
85
  "nx": "23.1.1",
86
86
  "picomatch": "4.0.4",
87
87
  "smol-toml": "1.7.0",