@okfit/engine 0.20.0 → 0.20.2

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/index.d.ts CHANGED
@@ -2285,8 +2285,8 @@ export declare class BundleSession extends BundleSession_base {
2285
2285
  }
2286
2286
  /**
2287
2287
  * The loaded concept at `absolutePath`, if any. `absolutePath` must already sit under
2288
- * `bundle.root` (a real resolved path, never re-resolved here: `@okfit/core`'s own
2289
- * `internal/posixPath.ts` avoids `path.resolve`/`path.relative` on purpose, because both read
2288
+ * `bundle.root` (a real resolved path, never re-resolved here: `@okfit/core`'s path
2289
+ * arithmetic, `@effected/walker`'s `PosixPath`, has no `resolve` on purpose, because it would read
2290
2290
  * `process.cwd()`, and this package holds the same line). Strips `bundle.root` as a plain
2291
2291
  * string prefix, then applies the same `ConceptId.fromPath` normalisation `withFallbackRange`
2292
2292
  * uses: `None` for a path outside the bundle, a reserved file (`index.md`, `log.md`), a
@@ -2896,7 +2896,7 @@ export declare const loadStaleCandidates: (options: PickerCandidatesOptions & {
2896
2896
  export declare const loadPreviews: (candidates: readonly PickerCandidate[]) => Effect.Effect<ReadonlyMap<string, ChangeSince>, never, import("@effected/git").Git | Path.Path>;
2897
2897
  /**
2898
2898
  * The version this engine reports as `engine_version` in every JSON
2899
- * envelope. `@savvy-web/bundler` replaces `process.env.__PACKAGE_VERSION__`
2899
+ * envelope. `effected package build` replaces `process.env.__PACKAGE_VERSION__`
2900
2900
  * with this package's own version at build time (K-32), so a release can
2901
2901
  * never desync from the printed version. `"0.0.0"` is the unbuilt-source
2902
2902
  * fallback and reads as dev mode. This is the ONE `process` read this
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@okfit/engine",
3
- "version": "0.20.0",
3
+ "version": "0.20.2",
4
4
  "private": false,
5
5
  "description": "The okfit engine: platform layer, config discovery, and the validate, verify, sync, init and context programs shared by the okfit CLI and MCP server.",
6
6
  "keywords": [
@@ -34,25 +34,25 @@
34
34
  "./package.json": "./package.json"
35
35
  },
36
36
  "dependencies": {
37
- "@effect/platform-node": "~4.1.2",
38
- "@effected/app": "^0.31.1",
39
- "@effected/config-file": "^0.25.0",
40
- "@effected/files": "^0.1.0",
41
- "@effected/git": "^0.30.0",
42
- "@effected/glob": "^0.19.0",
43
- "@effected/jsonc": "^0.24.0",
44
- "@effected/kit": "^0.13.0",
45
- "@effected/markdown": "^0.27.0",
46
- "@effected/schemastore": "^0.30.0",
47
- "@effected/source": "^0.4.0",
48
- "@effected/store": "^0.24.0",
49
- "@effected/toml": "^0.19.1",
50
- "@effected/walker": "^0.25.1",
51
- "@effected/xdg": "^0.19.1",
52
- "@effected/yaml": "^0.29.0",
53
- "@okfit/core": "0.13.0",
54
- "@okfit/profiles": "0.14.2",
55
- "effect": "~4.1.2"
37
+ "@effect/platform-node": "4.1.3",
38
+ "@effected/app": "^0.32.0",
39
+ "@effected/config-file": "^0.27.0",
40
+ "@effected/files": "^0.3.0",
41
+ "@effected/git": "^0.32.0",
42
+ "@effected/glob": "^0.21.0",
43
+ "@effected/jsonc": "^0.25.0",
44
+ "@effected/kit": "^0.14.0",
45
+ "@effected/markdown": "^0.29.0",
46
+ "@effected/schemastore": "^0.32.0",
47
+ "@effected/source": "^0.5.0",
48
+ "@effected/store": "^0.25.0",
49
+ "@effected/toml": "^0.20.0",
50
+ "@effected/walker": "^0.27.0",
51
+ "@effected/xdg": "^0.20.0",
52
+ "@effected/yaml": "^0.30.0",
53
+ "@okfit/core": "0.13.2",
54
+ "@okfit/profiles": "0.14.4",
55
+ "effect": "4.1.3"
56
56
  },
57
57
  "engines": {
58
58
  "node": ">=24.11.0"
@@ -1,7 +1,7 @@
1
- import { DistributionField } from "@effected/kit";
1
+ import { DistributionField as DistributionField$1 } from "@effected/kit";
2
2
 
3
3
  // src/render/distribution.ts
4
4
  /** Every envelope's `distribution` field: a `Distribution` or `null`. @public */
5
- const DistributionField$1 = DistributionField;
5
+ const DistributionField = DistributionField$1;
6
6
 
7
- export { DistributionField$1 as DistributionField };
7
+ export { DistributionField };
@@ -12,8 +12,8 @@ const stripTrailingSlashes = (path) => {
12
12
  };
13
13
  /**
14
14
  * The loaded concept at `absolutePath`, if any. `absolutePath` must already sit under
15
- * `bundle.root` (a real resolved path, never re-resolved here: `@okfit/core`'s own
16
- * `internal/posixPath.ts` avoids `path.resolve`/`path.relative` on purpose, because both read
15
+ * `bundle.root` (a real resolved path, never re-resolved here: `@okfit/core`'s path
16
+ * arithmetic, `@effected/walker`'s `PosixPath`, has no `resolve` on purpose, because it would read
17
17
  * `process.cwd()`, and this package holds the same line). Strips `bundle.root` as a plain
18
18
  * string prefix, then applies the same `ConceptId.fromPath` normalisation `withFallbackRange`
19
19
  * uses: `None` for a path outside the bundle, a reserved file (`index.md`, `log.md`), a
@@ -2,45 +2,11 @@ import { GLOB_RE } from "./resources.js";
2
2
  import { Diagnostic, DiagnosticRange, OkfitConfig } from "@okfit/core";
3
3
  import { Effect, FileSystem, Path, Result } from "effect";
4
4
  import { SURFACE_TYPE } from "@okfit/profiles";
5
+ import { descend } from "@effected/walker";
5
6
  import { GlobPattern } from "@effected/glob";
6
7
 
7
8
  // src/validate/surfaces.ts
8
9
  /**
9
- * Lists `root` breadth-first, only as deep as `segments` (the glob's remaining
10
- * segments) can match, or without a bound when the pattern contains `**`.
11
- * `node_modules` and dot-entries are skipped unless a segment names them, and
12
- * symlinked directories are listed but never descended into. Entry
13
- * paths are `/`-joined and relative to `root`. An unreadable directory
14
- * contributes nothing.
15
- */
16
- const walk = (fs, path, root, segments) => Effect.gen(function* () {
17
- const maxDepth = segments.some((segment) => segment.includes("**")) ? Number.POSITIVE_INFINITY : segments.length;
18
- const namesHidden = segments.some((segment) => /(^|[{,(|[])\./.test(segment));
19
- const namesModules = segments.some((segment) => segment.includes("node_modules"));
20
- const skipped = (name) => name === "node_modules" && !namesModules || name.startsWith(".") && !namesHidden;
21
- const out = [];
22
- let level = [""];
23
- for (let depth = 1; depth <= maxDepth && level.length > 0; depth++) {
24
- const next = [];
25
- for (const dir of level) {
26
- const names = yield* fs.readDirectory(dir === "" ? root : path.join(root, dir)).pipe(Effect.orElseSucceed(() => []));
27
- for (const name of names) {
28
- if (skipped(name)) continue;
29
- const relative = dir === "" ? name : `${dir}/${name}`;
30
- out.push(relative);
31
- if (depth < maxDepth) {
32
- const full = path.join(root, relative);
33
- const isDirectory = yield* fs.stat(full).pipe(Effect.map((info) => info.type === "Directory"), Effect.orElseSucceed(() => false));
34
- const isSymlink = isDirectory ? yield* fs.readLink(full).pipe(Effect.as(true), Effect.orElseSucceed(() => false)) : false;
35
- if (isDirectory && !isSymlink) next.push(relative);
36
- }
37
- }
38
- }
39
- level = next;
40
- }
41
- return out;
42
- });
43
- /**
44
10
  * A Surface's `resource` glob matches nothing on disk. Only concepts of type
45
11
  * `Surface` whose `resource` contains a glob metacharacter are checked; a
46
12
  * literal `resource` is `lintResources`'s concern (`source-resource-missing`).
@@ -79,7 +45,12 @@ const lintSurfaces = (bundle, config) => Effect.gen(function* () {
79
45
  else {
80
46
  const compiled = GlobPattern.compileResult(rest);
81
47
  if (Result.isFailure(compiled)) problem = `: ${compiled.failure.message}`;
82
- else if (!(yield* walk(fs, path, prefix, restSegments)).some((entry) => compiled.success.matches(entry))) problem = "";
48
+ else if ((yield* fs.realPath(prefix).pipe(Effect.flatMap((cwd) => descend(compiled.success, {
49
+ cwd,
50
+ match: "any",
51
+ prune: restSegments.some((segment) => segment.includes("node_modules")) ? [] : ["node_modules"],
52
+ onUnreadable: "skip"
53
+ })), Effect.orElseSucceed(() => []))).length === 0) problem = "";
83
54
  }
84
55
  if (problem === void 0) continue;
85
56
  const range = DiagnosticRange.forFrontmatterPath(concept.document, ["resource"]);
package/version.js CHANGED
@@ -1,7 +1,7 @@
1
1
  // src/version.ts
2
2
  /**
3
3
  * The version this engine reports as `engine_version` in every JSON
4
- * envelope. `@savvy-web/bundler` replaces `process.env.__PACKAGE_VERSION__`
4
+ * envelope. `effected package build` replaces `process.env.__PACKAGE_VERSION__`
5
5
  * with this package's own version at build time (K-32), so a release can
6
6
  * never desync from the printed version. `"0.0.0"` is the unbuilt-source
7
7
  * fallback and reads as dev mode. This is the ONE `process` read this
@@ -11,6 +11,6 @@
11
11
  *
12
12
  * @public
13
13
  */
14
- const ENGINE_VERSION = "0.20.0";
14
+ const ENGINE_VERSION = "0.20.2";
15
15
 
16
16
  export { ENGINE_VERSION };