@okfit/engine 0.18.1 → 0.18.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/errors.js +2 -9
- package/package.json +19 -18
- package/render/json.js +5 -12
- package/sync/run.js +1 -2
- package/tsdoc-metadata.json +1 -1
- package/version.js +1 -1
package/errors.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Runtime, Schema } from "effect";
|
|
2
|
+
import { ErrorText } from "@effected/engine";
|
|
2
3
|
|
|
3
4
|
// src/errors.ts
|
|
4
5
|
/**
|
|
@@ -100,14 +101,6 @@ var VerifyNothingToRevokeError = class extends Schema.TaggedError()("VerifyNothi
|
|
|
100
101
|
return `"${this.id}" has no verified entry by ${this.actor} to revoke`;
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
|
-
/** The error's `message` when it has one as a string, else `String(error)`. */
|
|
104
|
-
const messageOf = (error) => {
|
|
105
|
-
if (typeof error === "object" && error !== null && "message" in error) {
|
|
106
|
-
const message = error.message;
|
|
107
|
-
if (typeof message === "string") return message;
|
|
108
|
-
}
|
|
109
|
-
return String(error);
|
|
110
|
-
};
|
|
111
104
|
/**
|
|
112
105
|
* A config file at a KNOWN path failed to parse or validate (K-46's own
|
|
113
106
|
* intent — "each class' message already names the offending path" does not
|
|
@@ -124,7 +117,7 @@ var ConfigMalformedError = class extends Schema.TaggedError()("ConfigMalformedEr
|
|
|
124
117
|
}) {
|
|
125
118
|
[Runtime.errorExitCode] = 3;
|
|
126
119
|
get message() {
|
|
127
|
-
return `malformed config ${this.path}: ${
|
|
120
|
+
return `malformed config ${this.path}: ${ErrorText.describe(this.cause)}`;
|
|
128
121
|
}
|
|
129
122
|
};
|
|
130
123
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@okfit/engine",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.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,23 +34,24 @@
|
|
|
34
34
|
"./package.json": "./package.json"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@effect/platform-node": "^4.0.
|
|
38
|
-
"@effected/app": "^0.
|
|
39
|
-
"@effected/config-file": "^0.
|
|
40
|
-
"@effected/engine": "^0.
|
|
41
|
-
"@effected/git": "^0.
|
|
42
|
-
"@effected/glob": "^0.
|
|
43
|
-
"@effected/jsonc": "^0.
|
|
44
|
-
"@effected/markdown": "^0.
|
|
45
|
-
"@effected/schemastore": "^0.
|
|
46
|
-
"@effected/
|
|
47
|
-
"@effected/
|
|
48
|
-
"@effected/
|
|
49
|
-
"@effected/
|
|
50
|
-
"@effected/
|
|
51
|
-
"@
|
|
52
|
-
"@okfit/
|
|
53
|
-
"
|
|
37
|
+
"@effect/platform-node": "^4.0.7",
|
|
38
|
+
"@effected/app": "^0.29.0",
|
|
39
|
+
"@effected/config-file": "^0.22.0",
|
|
40
|
+
"@effected/engine": "^0.10.0",
|
|
41
|
+
"@effected/git": "^0.27.0",
|
|
42
|
+
"@effected/glob": "^0.16.0",
|
|
43
|
+
"@effected/jsonc": "^0.21.0",
|
|
44
|
+
"@effected/markdown": "^0.24.0",
|
|
45
|
+
"@effected/schemastore": "^0.27.0",
|
|
46
|
+
"@effected/source": "^0.1.0",
|
|
47
|
+
"@effected/store": "^0.21.0",
|
|
48
|
+
"@effected/toml": "^0.17.0",
|
|
49
|
+
"@effected/walker": "^0.22.0",
|
|
50
|
+
"@effected/xdg": "^0.17.0",
|
|
51
|
+
"@effected/yaml": "^0.26.0",
|
|
52
|
+
"@okfit/core": "0.11.8",
|
|
53
|
+
"@okfit/profiles": "0.13.0",
|
|
54
|
+
"effect": "^4.0.7"
|
|
54
55
|
},
|
|
55
56
|
"engines": {
|
|
56
57
|
"node": ">=24.11.0"
|
package/render/json.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { DistributionField } from "./distribution.js";
|
|
1
|
+
import { DistributionField as DistributionField$1 } from "./distribution.js";
|
|
2
2
|
import { tally } from "./exit.js";
|
|
3
3
|
import { ENGINE_VERSION } from "../version.js";
|
|
4
4
|
import { sort } from "./sort.js";
|
|
5
5
|
import { DiagnosticRange, DiagnosticSeverity } from "@okfit/core";
|
|
6
6
|
import { Runtime, Schema } from "effect";
|
|
7
|
+
import { ErrorText } from "@effected/engine";
|
|
7
8
|
|
|
8
9
|
// src/render/json.ts
|
|
9
10
|
/** One entry of the `diagnostics` array (K-21). @public */
|
|
@@ -47,7 +48,7 @@ const JsonEnvelope = Schema.Struct({
|
|
|
47
48
|
okfit_version: Schema.String,
|
|
48
49
|
engine_version: Schema.String,
|
|
49
50
|
producer: Schema.String,
|
|
50
|
-
distribution: DistributionField,
|
|
51
|
+
distribution: DistributionField$1,
|
|
51
52
|
okf_version: Schema.String,
|
|
52
53
|
root: Schema.String,
|
|
53
54
|
profile: Schema.NullOr(Schema.String),
|
|
@@ -71,7 +72,7 @@ const JsonErrorEnvelope = Schema.Struct({
|
|
|
71
72
|
schema: Schema.Literal(1),
|
|
72
73
|
okfit_version: Schema.String,
|
|
73
74
|
engine_version: Schema.String,
|
|
74
|
-
distribution: DistributionField,
|
|
75
|
+
distribution: DistributionField$1,
|
|
75
76
|
exit_code: Schema.Literals([3, 64]),
|
|
76
77
|
error: Schema.Struct({
|
|
77
78
|
tag: Schema.String,
|
|
@@ -127,14 +128,6 @@ const tagOf = (error) => {
|
|
|
127
128
|
if (typeof tag === "string") return tag;
|
|
128
129
|
return error.constructor?.name ?? "UnknownError";
|
|
129
130
|
};
|
|
130
|
-
/** The error's `message` when it has one as a string, else `String(error)`. */
|
|
131
|
-
const messageOf = (error) => {
|
|
132
|
-
if (typeof error === "object" && error !== null && "message" in error) {
|
|
133
|
-
const message = error.message;
|
|
134
|
-
if (typeof message === "string") return message;
|
|
135
|
-
}
|
|
136
|
-
return String(error);
|
|
137
|
-
};
|
|
138
131
|
/**
|
|
139
132
|
* The `[Runtime.errorExitCode]` marker's value when it is present and is one
|
|
140
133
|
* of the two exit codes the JSON error envelope can carry; `3` otherwise
|
|
@@ -156,7 +149,7 @@ const jsonError = (error, okfitVersion, distribution) => ({
|
|
|
156
149
|
exit_code: exitCodeOf(error),
|
|
157
150
|
error: {
|
|
158
151
|
tag: tagOf(error),
|
|
159
|
-
message:
|
|
152
|
+
message: ErrorText.describe(error)
|
|
160
153
|
}
|
|
161
154
|
});
|
|
162
155
|
|
package/sync/run.js
CHANGED
|
@@ -61,8 +61,7 @@ const planSync = Effect.fn("okfit/sync/planSync")(function* (options) {
|
|
|
61
61
|
const git = yield* Git;
|
|
62
62
|
const fs = yield* FileSystem.FileSystem;
|
|
63
63
|
const path = yield* Path.Path;
|
|
64
|
-
|
|
65
|
-
repoRoot = worktree !== void 0 ? yield* fs.realPath(worktree) : yield* git.repoRoot(bundle.root);
|
|
64
|
+
repoRoot = yield* git.repoRoot(bundle.root, { ignoreRepositoryEnv: true }).pipe(Effect.catchTag("NotARepositoryError", () => git.repoRoot(bundle.root)));
|
|
66
65
|
const stagedPaths = new Set(yield* git.stagedChanges(repoRoot));
|
|
67
66
|
const selected = /* @__PURE__ */ new Set();
|
|
68
67
|
const provenanceStaged = /* @__PURE__ */ new Map();
|
package/tsdoc-metadata.json
CHANGED