@okfit/core 0.1.0 → 0.3.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/Actor.js +31 -0
- package/AttestedComputation.js +40 -0
- package/Bundle.js +263 -0
- package/Concept.js +44 -0
- package/ConceptId.js +30 -0
- package/Derive.js +120 -0
- package/Diagnostic.js +81 -0
- package/Generated.js +28 -0
- package/Graph.js +158 -0
- package/IndexDocument.js +30 -0
- package/LogDocument.js +28 -0
- package/OkfitConfig.js +471 -0
- package/README.md +13 -2
- package/Source.js +29 -0
- package/Status.js +15 -0
- package/Timestamp.js +18 -0
- package/Validate.js +44 -0
- package/Verification.js +29 -0
- package/index.d.ts +918 -5
- package/index.js +19 -6
- package/internal/conceptDecode.js +122 -0
- package/internal/fence.js +18 -0
- package/internal/frontmatter.js +62 -0
- package/internal/links.js +129 -0
- package/internal/lintRules.js +94 -0
- package/internal/position.js +40 -0
- package/internal/posixPath.js +53 -0
- package/internal/reserved.js +205 -0
- package/internal/templates.js +16 -0
- package/internal/walk.js +45 -0
- package/package.json +10 -3
package/index.d.ts
CHANGED
|
@@ -1,15 +1,928 @@
|
|
|
1
|
-
|
|
1
|
+
import { Brand, DateTime, Duration, Effect, FileSystem, Graph as Graph$1, Option, Path, Schema } from "effect";
|
|
2
|
+
import { MarkdownDocument } from "@effected/markdown";
|
|
3
|
+
import { ConfigReadError } from "@effected/config-file";
|
|
4
|
+
//#region src/Actor.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* An OKF actor string: `<producer>/<version>`, `human:<id>`, `process:<id>`,
|
|
7
|
+
* or any other `<prefix>:<id>` (the spec's `team:` examples).
|
|
8
|
+
* @public
|
|
9
|
+
*/
|
|
10
|
+
export type Actor = string & Brand.Brand<"Actor">;
|
|
11
|
+
/**
|
|
12
|
+
* Prefix classification; `other` drives lint `actor-prefix-unknown` (D-18).
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
type ActorForm = "producer" | "human" | "process" | "other";
|
|
16
|
+
/**
|
|
17
|
+
* Branded, pattern-checked actor codec with prefix classification statics.
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export declare const Actor: Schema.Codec<Actor, string> & {
|
|
21
|
+
readonly isHuman: (actor: string) => boolean;
|
|
22
|
+
readonly form: (actor: string) => ActorForm;
|
|
23
|
+
};
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/AttestedComputation.d.ts
|
|
26
|
+
declare const ComputationParameter_base: Schema.Class<ComputationParameter, Schema.Struct<{
|
|
27
|
+
readonly name: Schema.String;
|
|
28
|
+
readonly type: Schema.String;
|
|
29
|
+
readonly required: Schema.withDecodingDefaultKey<Schema.Boolean, never>;
|
|
30
|
+
}>, {}>;
|
|
31
|
+
/**
|
|
32
|
+
* One declared input of an attested computation.
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
35
|
+
export declare class ComputationParameter extends ComputationParameter_base {}
|
|
36
|
+
declare const ComputationExecutor_base: Schema.Class<ComputationExecutor, Schema.Struct<{
|
|
37
|
+
readonly resource: Schema.String;
|
|
38
|
+
readonly receipt: Schema.$Array<Schema.String>;
|
|
39
|
+
}>, {}>;
|
|
40
|
+
/**
|
|
41
|
+
* The skill that runs the computation and the receipt fields it must return.
|
|
42
|
+
* @public
|
|
43
|
+
*/
|
|
44
|
+
export declare class ComputationExecutor extends ComputationExecutor_base {}
|
|
45
|
+
declare const ComputationAttester_base: Schema.Class<ComputationAttester, Schema.Struct<{
|
|
46
|
+
readonly resource: Schema.String;
|
|
47
|
+
}>, {}>;
|
|
48
|
+
/**
|
|
49
|
+
* The deterministic attester that checks an executor's receipt.
|
|
50
|
+
* @public
|
|
51
|
+
*/
|
|
52
|
+
export declare class ComputationAttester extends ComputationAttester_base {}
|
|
53
|
+
declare const AttestedComputation_base: Schema.Class<AttestedComputation, Schema.Struct<{
|
|
54
|
+
readonly runtime: Schema.optionalKey<Schema.String>;
|
|
55
|
+
readonly parameters: Schema.withDecodingDefaultKey<Schema.$Array<typeof ComputationParameter>, never>;
|
|
56
|
+
readonly computation: Schema.optionalKey<Schema.String>;
|
|
57
|
+
readonly executor: Schema.optionalKey<typeof ComputationExecutor>;
|
|
58
|
+
readonly attester: Schema.optionalKey<typeof ComputationAttester>;
|
|
59
|
+
}>, {}>;
|
|
60
|
+
/**
|
|
61
|
+
* The `Attested Computation` family (D-20). `runtime` absent means lint
|
|
62
|
+
* `computation-runtime-missing`; the concept still loads.
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export declare class AttestedComputation extends AttestedComputation_base {}
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region src/Generated.d.ts
|
|
68
|
+
/**
|
|
69
|
+
* A lowercase 64-character hex sha256 digest of a concept's body, as `@okfit/profiles`'
|
|
70
|
+
* `Derivation.bodyDigest` computes it (issue #19). Optional: every concept stamped before
|
|
71
|
+
* this field existed lacks it, and core itself never computes one -- it only holds the field.
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare const BodySha256: Schema.String;
|
|
75
|
+
/**
|
|
76
|
+
* The type of {@link (BodySha256:variable)}.
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export type BodySha256 = typeof BodySha256.Type;
|
|
80
|
+
declare const Generated_base: Schema.Class<Generated, Schema.Struct<{
|
|
81
|
+
readonly by: Schema.Codec<Actor, string, never, never> & {
|
|
82
|
+
readonly isHuman: (actor: string) => boolean;
|
|
83
|
+
readonly form: (actor: string) => ActorForm;
|
|
84
|
+
};
|
|
85
|
+
readonly at: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
|
|
86
|
+
readonly body_sha256: Schema.optionalKey<Schema.String>;
|
|
87
|
+
}>, {}>;
|
|
88
|
+
/**
|
|
89
|
+
* Who last generated a concept's content, and when.
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
export declare class Generated extends Generated_base {
|
|
93
|
+
/** The `by` used when a legacy v0.1 `timestamp` is folded into `generated.at` (D-15); v0.1 has no actor. */
|
|
94
|
+
static readonly LEGACY_BY: Actor;
|
|
95
|
+
}
|
|
96
|
+
//#endregion
|
|
97
|
+
//#region src/Source.d.ts
|
|
98
|
+
declare const UsageWindow_base: Schema.Class<UsageWindow, Schema.Struct<{
|
|
99
|
+
readonly from: Schema.Codec<import("effect/DateTime").Utc, string, never, never>;
|
|
100
|
+
readonly to: Schema.Codec<import("effect/DateTime").Utc, string, never, never>;
|
|
101
|
+
}>, {}>;
|
|
102
|
+
/**
|
|
103
|
+
* A closed interval of use, on a concept or on one of its sources.
|
|
104
|
+
* @public
|
|
105
|
+
*/
|
|
106
|
+
export declare class UsageWindow extends UsageWindow_base {}
|
|
107
|
+
declare const Source_base: Schema.Class<Source, Schema.Struct<{
|
|
108
|
+
readonly resource: Schema.String;
|
|
109
|
+
readonly id: Schema.optionalKey<Schema.String>;
|
|
110
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
111
|
+
readonly author: Schema.optionalKey<Schema.Codec<Actor, string, never, never> & {
|
|
112
|
+
readonly isHuman: (actor: string) => boolean;
|
|
113
|
+
readonly form: (actor: string) => ActorForm;
|
|
114
|
+
}>;
|
|
115
|
+
readonly usage_count: Schema.optionalKey<Schema.Union<readonly [Schema.Number, Schema.FiniteFromString]>>;
|
|
116
|
+
readonly last_modified: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
|
|
117
|
+
readonly usage_window: Schema.optionalKey<typeof UsageWindow>;
|
|
118
|
+
}>, {}>;
|
|
119
|
+
/**
|
|
120
|
+
* One provenance entry. `resource` is a URL, a bundle path or a scope descriptor (D-24); never resolved here.
|
|
121
|
+
* @public
|
|
122
|
+
*/
|
|
123
|
+
export declare class Source extends Source_base {}
|
|
124
|
+
//#endregion
|
|
125
|
+
//#region src/Verification.d.ts
|
|
126
|
+
declare const Verification_base: Schema.Class<Verification, Schema.Struct<{
|
|
127
|
+
readonly by: Schema.Codec<Actor, string, never, never> & {
|
|
128
|
+
readonly isHuman: (actor: string) => boolean;
|
|
129
|
+
readonly form: (actor: string) => ActorForm;
|
|
130
|
+
};
|
|
131
|
+
readonly at: Schema.Codec<import("effect/DateTime").Utc, string, never, never>;
|
|
132
|
+
}>, {}>;
|
|
133
|
+
/**
|
|
134
|
+
* One verification attestation: who verified and when.
|
|
135
|
+
* @public
|
|
136
|
+
*/
|
|
137
|
+
export declare class Verification extends Verification_base {
|
|
138
|
+
/**
|
|
139
|
+
* Bare mapping or list in; always a list out on decode AND encode (D-17):
|
|
140
|
+
* this transform's encode is `Fn.identity`, so a concept that arrived as a
|
|
141
|
+
* bare mapping is list-shaped on disk from the first re-encode onward. Not
|
|
142
|
+
* `Schema.ArrayEnsure`, whose encode returns the single element for a
|
|
143
|
+
* one-element array (`Schema.ts:4738-4746`) and would round-trip a
|
|
144
|
+
* one-entry list back to a bare mapping.
|
|
145
|
+
*/
|
|
146
|
+
static readonly List: Schema.decodeTo<Schema.$Array<Schema.toType<typeof Verification>>, Schema.Union<readonly [typeof Verification, Schema.$Array<typeof Verification>]>, never, never>;
|
|
147
|
+
}
|
|
148
|
+
//#endregion
|
|
149
|
+
//#region src/Concept.d.ts
|
|
150
|
+
/**
|
|
151
|
+
* The exact `type` value that enables the computation family (D-20).
|
|
152
|
+
* @public
|
|
153
|
+
*/
|
|
154
|
+
export declare const ATTESTED_COMPUTATION_TYPE: "Attested Computation";
|
|
155
|
+
declare const Concept_base: Schema.Class<Concept, Schema.Struct<{
|
|
156
|
+
readonly type: Schema.String;
|
|
157
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
158
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
159
|
+
readonly resource: Schema.optionalKey<Schema.String>;
|
|
160
|
+
readonly tags: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
161
|
+
readonly sources: Schema.optionalKey<Schema.$Array<typeof Source>>;
|
|
162
|
+
readonly usage_window: Schema.optionalKey<typeof UsageWindow>;
|
|
163
|
+
readonly generated: Schema.optionalKey<typeof Generated>;
|
|
164
|
+
readonly verified: Schema.optionalKey<Schema.decodeTo<Schema.$Array<Schema.toType<typeof Verification>>, Schema.Union<readonly [typeof Verification, Schema.$Array<typeof Verification>]>, never, never>>;
|
|
165
|
+
readonly status: Schema.optionalKey<Schema.Literals<readonly ["draft", "stable", "deprecated"]>>;
|
|
166
|
+
readonly stale_after: Schema.optionalKey<Schema.Codec<import("effect/DateTime").Utc, string, never, never>>;
|
|
167
|
+
readonly attested: Schema.optionalKey<typeof AttestedComputation>;
|
|
168
|
+
readonly extensions: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
169
|
+
readonly raw: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
170
|
+
}>, {}>;
|
|
171
|
+
/**
|
|
172
|
+
* A typed OKF concept: the stage-1 envelope (`type`), every optional family,
|
|
173
|
+
* unknown keys in `extensions`, and the whole decoded mapping in `raw`.
|
|
174
|
+
*
|
|
175
|
+
* @remarks
|
|
176
|
+
* The strict codec for tooling that builds values. `Bundle.load` never decodes
|
|
177
|
+
* through it whole: `internal/conceptDecode.ts` decodes the envelope, then each
|
|
178
|
+
* family independently, then calls `Concept.make` (D-15). `attested` is a field,
|
|
179
|
+
* not a subclass, so a bad `executor` cannot reject the concept.
|
|
180
|
+
* @public
|
|
181
|
+
*/
|
|
182
|
+
export declare class Concept extends Concept_base {}
|
|
183
|
+
//#endregion
|
|
184
|
+
//#region src/ConceptId.d.ts
|
|
185
|
+
/** A posix bundle-relative path with `.md` stripped and no leading slash (D-12). @public */
|
|
186
|
+
export type ConceptId = string & Brand.Brand<"ConceptId">;
|
|
187
|
+
/**
|
|
188
|
+
* Branded concept id codec: the posix path with `.md` stripped, plus path
|
|
189
|
+
* conversion, a tolerant input normaliser, and the reserved-file test (D-12).
|
|
190
|
+
* @public
|
|
191
|
+
*/
|
|
192
|
+
export declare const ConceptId: Schema.Codec<ConceptId, string> & {
|
|
193
|
+
readonly fromPath: (path: string) => Option.Option<ConceptId>;
|
|
194
|
+
readonly toPath: (id: ConceptId) => string;
|
|
195
|
+
readonly normalize: (input: string) => Option.Option<ConceptId>;
|
|
196
|
+
readonly isReservedFile: (path: string) => boolean;
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/Diagnostic.d.ts
|
|
200
|
+
/** @public */
|
|
201
|
+
export declare const DiagnosticSeverity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
202
|
+
/** @public */
|
|
203
|
+
export type DiagnosticSeverity = typeof DiagnosticSeverity.Type;
|
|
204
|
+
/** Always `"error"`, never configurable (D-33). @public */
|
|
205
|
+
export declare const ConformanceCode: Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>;
|
|
206
|
+
/** @public */
|
|
207
|
+
export type ConformanceCode = typeof ConformanceCode.Type;
|
|
208
|
+
/** Severity from `OkfitConfig` (D-34). @public */
|
|
209
|
+
export declare const LintCode: Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift"]>;
|
|
210
|
+
/** @public */
|
|
211
|
+
export type LintCode = typeof LintCode.Type;
|
|
212
|
+
/** @public */
|
|
213
|
+
export declare const DiagnosticCode: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift"]>]>;
|
|
214
|
+
/** @public */
|
|
215
|
+
export type DiagnosticCode = typeof DiagnosticCode.Type;
|
|
216
|
+
declare const DiagnosticRange_base: Schema.Class<DiagnosticRange, Schema.Struct<{
|
|
217
|
+
readonly offset: Schema.Number;
|
|
218
|
+
readonly length: Schema.Number;
|
|
219
|
+
readonly line: Schema.Number;
|
|
220
|
+
readonly character: Schema.Number;
|
|
221
|
+
}>, {}>;
|
|
222
|
+
/**
|
|
223
|
+
* A range inside a file's text, zero-based (D-32); the CLI renders one-based.
|
|
224
|
+
* @public
|
|
225
|
+
*/
|
|
226
|
+
export declare class DiagnosticRange extends DiagnosticRange_base {
|
|
227
|
+
/** Core's own offset-to-line/character helper over the file text (D-14, `internal/position.ts`). */
|
|
228
|
+
static readonly fromOffset: (text: string, offset: number, length: number) => DiagnosticRange;
|
|
229
|
+
}
|
|
230
|
+
declare const Diagnostic_base: Schema.Class<Diagnostic, Schema.Struct<{
|
|
231
|
+
readonly file: Schema.String;
|
|
232
|
+
readonly range: Schema.optionalKey<typeof DiagnosticRange>;
|
|
233
|
+
readonly code: Schema.Union<readonly [Schema.Literals<readonly ["frontmatter-missing", "frontmatter-unclosed", "frontmatter-unparseable", "type-missing", "index-frontmatter", "index-malformed", "log-heading-invalid", "log-malformed"]>, Schema.Literals<readonly ["broken-links", "missing-index", "unknown-type", "required-key-missing", "field-value-unknown", "require-verified-unmet", "family-invalid", "computation-runtime-missing", "footnote-source-unknown", "log-frontmatter", "actor-prefix-unknown", "legacy-timestamp", "config-unknown-key", "stale", "walk-unreadable", "generated-at-drift"]>]>;
|
|
234
|
+
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
235
|
+
readonly message: Schema.String;
|
|
236
|
+
}>, {}>;
|
|
237
|
+
/**
|
|
238
|
+
* One conformance or lint finding (D-32).
|
|
239
|
+
* @public
|
|
240
|
+
*/
|
|
241
|
+
export declare class Diagnostic extends Diagnostic_base {
|
|
242
|
+
/** True when `code` is one of `ConformanceCode`'s always-error members. */
|
|
243
|
+
static readonly isConformance: (diagnostic: Diagnostic) => boolean;
|
|
244
|
+
}
|
|
245
|
+
//#endregion
|
|
246
|
+
//#region src/IndexDocument.d.ts
|
|
247
|
+
declare const IndexEntry_base: Schema.Class<IndexEntry, Schema.Struct<{
|
|
248
|
+
readonly title: Schema.String;
|
|
249
|
+
readonly target: Schema.String;
|
|
250
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
251
|
+
readonly range: typeof DiagnosticRange;
|
|
252
|
+
}>, {}>;
|
|
253
|
+
/** One `index.md` list item. @public */
|
|
254
|
+
export declare class IndexEntry extends IndexEntry_base {}
|
|
255
|
+
declare const IndexSection_base: Schema.Class<IndexSection, Schema.Struct<{
|
|
256
|
+
readonly heading: Schema.String;
|
|
257
|
+
readonly entries: Schema.$Array<typeof IndexEntry>;
|
|
258
|
+
readonly range: typeof DiagnosticRange;
|
|
259
|
+
}>, {}>;
|
|
260
|
+
/** One `index.md` H1 section. @public */
|
|
261
|
+
export declare class IndexSection extends IndexSection_base {}
|
|
262
|
+
declare const IndexDocument_base: Schema.Class<IndexDocument, Schema.Struct<{
|
|
263
|
+
readonly path: Schema.String;
|
|
264
|
+
readonly dir: Schema.String;
|
|
265
|
+
readonly okfVersion: Schema.optionalKey<Schema.String>;
|
|
266
|
+
readonly sections: Schema.$Array<typeof IndexSection>;
|
|
267
|
+
}>, {}>;
|
|
268
|
+
/**
|
|
269
|
+
* A parsed `index.md` (D-21). `okfVersion` is present only on the bundle root.
|
|
270
|
+
* @public
|
|
271
|
+
*/
|
|
272
|
+
export declare class IndexDocument extends IndexDocument_base {}
|
|
273
|
+
//#endregion
|
|
274
|
+
//#region src/LogDocument.d.ts
|
|
275
|
+
declare const LogItem_base: Schema.Class<LogItem, Schema.Struct<{
|
|
276
|
+
readonly text: Schema.String;
|
|
277
|
+
readonly range: typeof DiagnosticRange;
|
|
278
|
+
}>, {}>;
|
|
279
|
+
/** One `log.md` list item. @public */
|
|
280
|
+
export declare class LogItem extends LogItem_base {}
|
|
281
|
+
declare const LogGroup_base: Schema.Class<LogGroup, Schema.Struct<{
|
|
282
|
+
readonly date: Schema.String;
|
|
283
|
+
readonly items: Schema.$Array<typeof LogItem>;
|
|
284
|
+
readonly range: typeof DiagnosticRange;
|
|
285
|
+
}>, {}>;
|
|
286
|
+
/** One `log.md` `## YYYY-MM-DD` group. @public */
|
|
287
|
+
export declare class LogGroup extends LogGroup_base {}
|
|
288
|
+
declare const LogDocument_base: Schema.Class<LogDocument, Schema.Struct<{
|
|
289
|
+
readonly path: Schema.String;
|
|
290
|
+
readonly dir: Schema.String;
|
|
291
|
+
readonly title: Schema.optionalKey<Schema.String>;
|
|
292
|
+
readonly groups: Schema.$Array<typeof LogGroup>;
|
|
293
|
+
}>, {}>;
|
|
294
|
+
/**
|
|
295
|
+
* A parsed `log.md` (D-21).
|
|
296
|
+
* @public
|
|
297
|
+
*/
|
|
298
|
+
export declare class LogDocument extends LogDocument_base {}
|
|
299
|
+
//#endregion
|
|
300
|
+
//#region src/Bundle.d.ts
|
|
301
|
+
declare const BundleRootNotFoundError_base: Schema.Class<BundleRootNotFoundError, Schema.TaggedStruct<"BundleRootNotFoundError", {
|
|
302
|
+
readonly root: Schema.String;
|
|
303
|
+
}>, import("effect/Cause").YieldableError>;
|
|
304
|
+
/**
|
|
305
|
+
* The bundle root does not exist or is not a directory (D-9).
|
|
306
|
+
*
|
|
307
|
+
* @public
|
|
308
|
+
*/
|
|
309
|
+
export declare class BundleRootNotFoundError extends BundleRootNotFoundError_base {
|
|
310
|
+
get message(): string;
|
|
311
|
+
}
|
|
312
|
+
declare const BundleReadError_base: Schema.Class<BundleReadError, Schema.TaggedStruct<"BundleReadError", {
|
|
313
|
+
readonly root: Schema.String;
|
|
314
|
+
/** Bundle-relative posix path; `""` for the root. */
|
|
315
|
+
readonly path: Schema.String;
|
|
316
|
+
/** The `PlatformError`, preserved structurally. */
|
|
317
|
+
readonly cause: Schema.Defect;
|
|
318
|
+
}>, import("effect/Cause").YieldableError>;
|
|
319
|
+
/**
|
|
320
|
+
* A directory or file under the root could not be read. Never raised for content (spec 8).
|
|
321
|
+
*
|
|
322
|
+
* @public
|
|
323
|
+
*/
|
|
324
|
+
export declare class BundleReadError extends BundleReadError_base {
|
|
325
|
+
get message(): string;
|
|
326
|
+
}
|
|
327
|
+
declare const BundleDepthExceededError_base: Schema.Class<BundleDepthExceededError, Schema.TaggedStruct<"BundleDepthExceededError", {
|
|
328
|
+
readonly root: Schema.String;
|
|
329
|
+
/** Bundle-relative posix path of the directory the walk could not enter. */
|
|
330
|
+
readonly path: Schema.String;
|
|
331
|
+
readonly limit: Schema.Number;
|
|
332
|
+
}>, import("effect/Cause").YieldableError>;
|
|
333
|
+
/**
|
|
334
|
+
* The walk descended past `maxDepth` (D-8). A depth cap that silently truncated would
|
|
335
|
+
* silently change membership, which D-9 forbids; the cap fails instead.
|
|
336
|
+
*
|
|
337
|
+
* @public
|
|
338
|
+
*/
|
|
339
|
+
export declare class BundleDepthExceededError extends BundleDepthExceededError_base {
|
|
340
|
+
get message(): string;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Everything `Bundle.load` can fail with.
|
|
344
|
+
*
|
|
345
|
+
* @public
|
|
346
|
+
*/
|
|
347
|
+
type BundleLoadError = BundleRootNotFoundError | BundleReadError | BundleDepthExceededError;
|
|
348
|
+
/**
|
|
349
|
+
* Options for {@link Bundle.load} (D-8).
|
|
350
|
+
*
|
|
351
|
+
* @public
|
|
352
|
+
*/
|
|
353
|
+
interface BundleLoadOptions {
|
|
354
|
+
/** Absolute bundle root; core never reads `process.cwd()`. */
|
|
355
|
+
readonly root: string;
|
|
356
|
+
/** Admit entries whose name starts with `.` (default `false`, D-11). */
|
|
357
|
+
readonly includeHidden?: boolean;
|
|
358
|
+
/** Directory levels below the root to descend; positive integer, default 256; exceeding it fails with `BundleDepthExceededError`. */
|
|
359
|
+
readonly maxDepth?: number;
|
|
360
|
+
/** Directory names never descended (default `["node_modules", ".git"]`). */
|
|
361
|
+
readonly prune?: ReadonlyArray<string>;
|
|
362
|
+
}
|
|
363
|
+
declare const LoadedConcept_base: Schema.Class<LoadedConcept, Schema.Struct<{
|
|
364
|
+
readonly id: Schema.Codec<ConceptId, string, never, never> & {
|
|
365
|
+
readonly fromPath: (path: string) => Option.Option<ConceptId>;
|
|
366
|
+
readonly toPath: (id: ConceptId) => string;
|
|
367
|
+
readonly normalize: (input: string) => Option.Option<ConceptId>;
|
|
368
|
+
readonly isReservedFile: (path: string) => boolean;
|
|
369
|
+
};
|
|
370
|
+
/** Posix bundle-relative path with `.md`. */
|
|
371
|
+
readonly path: Schema.String;
|
|
372
|
+
readonly frontmatter: typeof Concept;
|
|
373
|
+
readonly document: typeof MarkdownDocument;
|
|
374
|
+
readonly computationBody: Schema.Option<Schema.String>;
|
|
375
|
+
}>, {}>;
|
|
376
|
+
/**
|
|
377
|
+
* One concept file after loading: typed frontmatter, the parsed body, and the
|
|
378
|
+
* `# Computation` section body when present (D-20).
|
|
379
|
+
*
|
|
380
|
+
* @public
|
|
381
|
+
*/
|
|
382
|
+
export declare class LoadedConcept extends LoadedConcept_base {}
|
|
383
|
+
declare const LoadedBundle_base: Schema.Class<LoadedBundle, Schema.Struct<{
|
|
384
|
+
readonly root: Schema.String;
|
|
385
|
+
readonly files: Schema.$Array<Schema.String>;
|
|
386
|
+
readonly directories: Schema.$Array<Schema.String>;
|
|
387
|
+
readonly concepts: Schema.$ReadonlyMap<Schema.Codec<ConceptId, string, never, never> & {
|
|
388
|
+
readonly fromPath: (path: string) => Option.Option<ConceptId>;
|
|
389
|
+
readonly toPath: (id: ConceptId) => string;
|
|
390
|
+
readonly normalize: (input: string) => Option.Option<ConceptId>;
|
|
391
|
+
readonly isReservedFile: (path: string) => boolean;
|
|
392
|
+
}, typeof LoadedConcept>;
|
|
393
|
+
readonly indexes: Schema.$ReadonlyMap<Schema.String, typeof IndexDocument>;
|
|
394
|
+
readonly logs: Schema.$ReadonlyMap<Schema.String, typeof LogDocument>;
|
|
395
|
+
readonly diagnostics: Schema.$Array<typeof Diagnostic>;
|
|
396
|
+
}>, {}>;
|
|
397
|
+
/**
|
|
398
|
+
* The result of {@link Bundle.load}: every walked file, every directory holding a
|
|
399
|
+
* concept, concepts by id, reserved documents by directory, load-time diagnostics.
|
|
400
|
+
*
|
|
401
|
+
* @public
|
|
402
|
+
*/
|
|
403
|
+
export declare class LoadedBundle extends LoadedBundle_base {}
|
|
404
|
+
/**
|
|
405
|
+
* Static facade for loading a bundle (D-6). Only `FileSystem` and `Path` are required
|
|
406
|
+
* (spec 3.2); `Path` is used solely for `path.join(root, relative)` (D-27).
|
|
407
|
+
*
|
|
408
|
+
* @public
|
|
409
|
+
*/
|
|
410
|
+
export declare class Bundle {
|
|
411
|
+
private constructor();
|
|
412
|
+
/**
|
|
413
|
+
* Load the bundle at `options.root` (D-8, D-9, D-11 to D-14, D-21). Content never
|
|
414
|
+
* fails: every bad file becomes a diagnostic and loading continues (spec 8). A walk
|
|
415
|
+
* that descends past `options.maxDepth` fails typed with `BundleDepthExceededError`
|
|
416
|
+
* (W-1) rather than being silently truncated.
|
|
417
|
+
*/
|
|
418
|
+
static readonly load: (options: BundleLoadOptions) => Effect.Effect<LoadedBundle, BundleLoadError, FileSystem.FileSystem | Path.Path>;
|
|
419
|
+
}
|
|
420
|
+
//#endregion
|
|
421
|
+
//#region src/Status.d.ts
|
|
422
|
+
/**
|
|
423
|
+
* Concept lifecycle status. Absent on a concept means `stable` (`Derive.status`).
|
|
424
|
+
* @public
|
|
425
|
+
*/
|
|
426
|
+
export declare const Status: Schema.Literals<readonly ["draft", "stable", "deprecated"]>;
|
|
427
|
+
/**
|
|
428
|
+
* The decoded status value.
|
|
429
|
+
* @public
|
|
430
|
+
*/
|
|
431
|
+
export type Status = typeof Status.Type;
|
|
432
|
+
//#endregion
|
|
433
|
+
//#region src/Derive.d.ts
|
|
434
|
+
/** Trust tier from `verified` (OKF 0.2 §5.3): none maps to unverified; only non-human maps to machine-confirmed; any `human:` maps to human-reviewed. @public */
|
|
435
|
+
export declare const TrustTier: Schema.Literals<readonly ["unverified", "machine-confirmed", "human-reviewed"]>;
|
|
436
|
+
/** @public */
|
|
437
|
+
export type TrustTier = typeof TrustTier.Type;
|
|
438
|
+
/** Three-way staleness; `unknown` means no `stale_after`. @public */
|
|
439
|
+
export declare const Staleness: Schema.Literals<readonly ["fresh", "stale", "unknown"]>;
|
|
440
|
+
/** @public */
|
|
441
|
+
export type Staleness = typeof Staleness.Type;
|
|
442
|
+
/** One dated `log.md` group to render. @public */
|
|
443
|
+
interface LogEntry {
|
|
444
|
+
readonly date: string;
|
|
445
|
+
readonly items: ReadonlyArray<string>;
|
|
446
|
+
}
|
|
447
|
+
/** One stale concept: its id, its `stale_after` instant, and whole days past it. @public */
|
|
448
|
+
interface StaleConcept {
|
|
449
|
+
readonly id: ConceptId;
|
|
450
|
+
readonly staleAfter: DateTime.Utc;
|
|
451
|
+
/** Whole days between `staleAfter` and `now`, floored; never negative. */
|
|
452
|
+
readonly daysPast: number;
|
|
453
|
+
}
|
|
454
|
+
/** Options for {@link Derive.renderIndex}. @public */
|
|
455
|
+
interface RenderIndexOptions {
|
|
456
|
+
/** Emits `---\nokf_version: "<v>"\n---\n\n` first; root index only (D-21). */
|
|
457
|
+
readonly okfVersion?: string;
|
|
458
|
+
/** Rendered as `* [name](name/index.md)` under a trailing `# Subdirectories` section. */
|
|
459
|
+
readonly subdirectories?: ReadonlyArray<string>;
|
|
460
|
+
}
|
|
461
|
+
/** Pure derivations (D-10, D-36): trust tier, status, staleness against a supplied instant, index/log rendering. @public */
|
|
462
|
+
export declare class Derive {
|
|
463
|
+
private constructor();
|
|
464
|
+
/** Any `human:` verifier means human-reviewed; otherwise machine-confirmed; none means unverified. */
|
|
465
|
+
static readonly trustTier: (concept: Concept) => TrustTier;
|
|
466
|
+
/** Absent `status` reads as `stable` (OKF 0.2 §5.4). */
|
|
467
|
+
static readonly status: (concept: Concept) => Status;
|
|
468
|
+
/** `stale` when `now >= stale_after` (OKF 0.2 §5.5); `unknown` without `stale_after`. */
|
|
469
|
+
static readonly staleness: (concept: Concept, now: DateTime.Utc) => Staleness;
|
|
470
|
+
/** Boolean form of {@link Derive.staleness} (D-36). */
|
|
471
|
+
static readonly isStale: (concept: Concept, now: DateTime.Utc) => boolean;
|
|
472
|
+
/**
|
|
473
|
+
* Every concept in `bundle` that {@link Derive.isStale} reports stale against
|
|
474
|
+
* `now`, sorted by id ascending. Pure (D-10); `now` is always an argument,
|
|
475
|
+
* never read from a clock here (D-36).
|
|
476
|
+
*/
|
|
477
|
+
static readonly staleReport: (bundle: LoadedBundle, now: DateTime.Utc) => ReadonlyArray<StaleConcept>;
|
|
478
|
+
/** Frontmatter `title`, else the file name without `.md` (OKF 0.2 §4.1). */
|
|
479
|
+
static readonly title: (concept: LoadedConcept) => string;
|
|
480
|
+
/** One H1 per `type` (sorted), entries sorted by title, then `# Subdirectories` (D-36; spec §8). */
|
|
481
|
+
static readonly renderIndex: (dir: string, concepts: ReadonlyArray<LoadedConcept>, options?: RenderIndexOptions) => string;
|
|
482
|
+
/** `## <date>` plus one `* <item>` line per item, newline-terminated (D-36). */
|
|
483
|
+
static readonly renderLogEntry: (entry: LogEntry) => string;
|
|
484
|
+
/**
|
|
485
|
+
* Assemble a whole log document from its groups: `# <title>\n\n` followed
|
|
486
|
+
* by each group's own {@link Derive.renderLogEntry} rendering, joined by
|
|
487
|
+
* one blank line (S-11). Default title `"Log"`. `init` and `sync`'s log
|
|
488
|
+
* mode both call this instead of hand-assembling the join; `sync`'s
|
|
489
|
+
* `mergeLog` uses it only for brand-new groups it renders, since existing
|
|
490
|
+
* groups are re-emitted verbatim from source.
|
|
491
|
+
*/
|
|
492
|
+
static readonly renderLog: (groups: ReadonlyArray<LogEntry>, options?: {
|
|
493
|
+
readonly title?: string;
|
|
494
|
+
}) => string;
|
|
495
|
+
/** Index text for `dir` from the concepts directly in it plus its immediate child directories; no frontmatter. */
|
|
496
|
+
static readonly synthesizeIndex: (bundle: LoadedBundle, dir: string) => string;
|
|
497
|
+
}
|
|
498
|
+
//#endregion
|
|
499
|
+
//#region src/Graph.d.ts
|
|
500
|
+
/**
|
|
501
|
+
* Kind of a graph node: a loaded concept, an existing non-concept file (including reserved
|
|
502
|
+
* `index.md`/`log.md`), or a placeholder for a target that does not exist (D-25).
|
|
503
|
+
*
|
|
504
|
+
* @public
|
|
505
|
+
*/
|
|
506
|
+
export declare const GraphNodeKind: Schema.Literals<readonly ["concept", "file", "missing"]>;
|
|
507
|
+
/** @public */
|
|
508
|
+
export type GraphNodeKind = typeof GraphNodeKind.Type;
|
|
509
|
+
/** Frontmatter fields whose value is a bundle path (D-23). @public */
|
|
510
|
+
type PathField = "resource" | "sources.resource" | "computation" | "executor.resource" | "attester.resource";
|
|
511
|
+
/** A node: a concept id, or a bundle-relative path with extension for `file` and `missing` nodes. @public */
|
|
512
|
+
interface GraphNode {
|
|
513
|
+
readonly id: string;
|
|
514
|
+
readonly kind: GraphNodeKind;
|
|
515
|
+
}
|
|
516
|
+
/** Edge data (D-25): where the link was written, its raw text, and its span in the linking file when locatable. @public */
|
|
517
|
+
interface GraphEdge {
|
|
518
|
+
readonly source: "body" | "frontmatter";
|
|
519
|
+
readonly field?: PathField;
|
|
520
|
+
readonly raw: string;
|
|
521
|
+
readonly position?: DiagnosticRange;
|
|
522
|
+
}
|
|
523
|
+
/** An edge with its endpoints as node ids. @public */
|
|
524
|
+
interface GraphLink {
|
|
525
|
+
readonly from: string;
|
|
526
|
+
readonly to: string;
|
|
527
|
+
readonly data: GraphEdge;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* The link graph of a bundle over `effect/Graph` (D-26). `graph` is the underlying directed graph for
|
|
531
|
+
* `dfs`, `topo`, `stronglyConnectedComponents`; `index` maps node ids to `NodeIndex`.
|
|
532
|
+
*
|
|
533
|
+
* @public
|
|
534
|
+
*/
|
|
535
|
+
export declare class LinkGraph {
|
|
536
|
+
readonly graph: Graph$1.DirectedGraph<GraphNode, GraphEdge>;
|
|
537
|
+
readonly index: ReadonlyMap<string, Graph$1.NodeIndex>;
|
|
538
|
+
readonly nodes: ReadonlyArray<GraphNode>;
|
|
539
|
+
readonly edges: ReadonlyArray<GraphLink>;
|
|
540
|
+
private constructor();
|
|
541
|
+
/** @internal */
|
|
542
|
+
static readonly _make: (graph: Graph$1.DirectedGraph<GraphNode, GraphEdge>, index: ReadonlyMap<string, Graph$1.NodeIndex>) => LinkGraph;
|
|
543
|
+
/** The node with `id`, if present. */
|
|
544
|
+
node(id: string): Option.Option<GraphNode>;
|
|
545
|
+
/** Unique targets of outgoing edges; `[]` for an unknown id. */
|
|
546
|
+
successors(id: string): ReadonlyArray<GraphNode>;
|
|
547
|
+
/** Unique sources of incoming edges; `[]` for an unknown id. */
|
|
548
|
+
predecessors(id: string): ReadonlyArray<GraphNode>;
|
|
549
|
+
/** Edges whose target is a `missing` node; the input of lint `broken-links`. */
|
|
550
|
+
dangling(): ReadonlyArray<GraphLink>;
|
|
551
|
+
/** Mermaid flowchart; nodes labelled by id, frontmatter edges by field. */
|
|
552
|
+
toMermaid(options?: Graph$1.MermaidOptions<GraphNode, GraphEdge>): string;
|
|
553
|
+
/** GraphViz DOT; same labelling defaults as `toMermaid`. */
|
|
554
|
+
toGraphViz(options?: Graph$1.GraphVizOptions<GraphNode, GraphEdge>): string;
|
|
555
|
+
private neighbours;
|
|
556
|
+
}
|
|
557
|
+
/**
|
|
558
|
+
* Static facade building a {@link LinkGraph} from a loaded bundle (D-6).
|
|
559
|
+
*
|
|
560
|
+
* @public
|
|
561
|
+
*/
|
|
562
|
+
export declare class Graph {
|
|
563
|
+
private constructor();
|
|
564
|
+
/**
|
|
565
|
+
* Pure. Body links come from `document.links`, path fields from the frontmatter (D-23, D-24).
|
|
566
|
+
* Placeholder `missing` nodes are added before their edge because `Graph.addEdge` throws on an absent endpoint.
|
|
567
|
+
*/
|
|
568
|
+
static readonly fromBundle: (bundle: LoadedBundle) => LinkGraph;
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/OkfitConfig.d.ts
|
|
572
|
+
/**
|
|
573
|
+
* Severity a lint rule is configured to. `"info"` extends spec 4.2's
|
|
574
|
+
* `off | warn | error` so the D-34 `info` defaults are expressible.
|
|
575
|
+
*
|
|
576
|
+
* @public
|
|
577
|
+
*/
|
|
578
|
+
export declare const LintLevel: Schema.Literals<readonly ["off", "info", "warn", "error"]>;
|
|
579
|
+
/**
|
|
580
|
+
* The type of `LintLevel`.
|
|
581
|
+
* @public
|
|
582
|
+
*/
|
|
583
|
+
export type LintLevel = typeof LintLevel.Type;
|
|
584
|
+
/**
|
|
585
|
+
* `lifecycle.default_stale_after` codec: `^(\d+)(h|d|w)$` or Effect's
|
|
586
|
+
* `"<n> <unit>"` form decodes to a `Duration` (D-30). Encoding emits the
|
|
587
|
+
* shortest exact `w`/`d`/`h` spelling, otherwise `"<n> millis"`.
|
|
588
|
+
*
|
|
589
|
+
* @remarks
|
|
590
|
+
* `@effected/toml` has no duration syntax and `Schema.DurationFromString`
|
|
591
|
+
* rejects `"90d"`, so this is core's own codec (effected-yaml-toml-config-file-app.md §2).
|
|
592
|
+
*
|
|
593
|
+
* @public
|
|
594
|
+
*/
|
|
595
|
+
export declare const StaleAfterDuration: Schema.Codec<Duration.Duration, string>;
|
|
596
|
+
/**
|
|
597
|
+
* A `types.<Name>.fields.<key>` declaration (spec 4.2): a description plus
|
|
598
|
+
* either an enum of values with descriptions or `kind = "path"`.
|
|
599
|
+
* @public
|
|
600
|
+
*/
|
|
601
|
+
export declare const FieldDeclaration: Schema.Struct<{
|
|
602
|
+
readonly description: Schema.String;
|
|
603
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
604
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
605
|
+
}>;
|
|
606
|
+
/**
|
|
607
|
+
* A `types.<Name>` declaration (spec 4.2).
|
|
608
|
+
* @public
|
|
609
|
+
*/
|
|
610
|
+
export declare const TypeDeclaration: Schema.Struct<{
|
|
611
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
612
|
+
readonly guidance: Schema.optionalKey<Schema.String>;
|
|
613
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
614
|
+
readonly require_verified: Schema.optionalKey<Schema.Boolean>;
|
|
615
|
+
readonly fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
616
|
+
readonly description: Schema.String;
|
|
617
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
618
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
619
|
+
}>>>;
|
|
620
|
+
}>;
|
|
621
|
+
/**
|
|
622
|
+
* A `tags.<name>` declaration (spec 4.2).
|
|
623
|
+
* @public
|
|
624
|
+
*/
|
|
625
|
+
export declare const TagDeclaration: Schema.Struct<{
|
|
626
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
627
|
+
}>;
|
|
2
628
|
/**
|
|
3
|
-
*
|
|
629
|
+
* The `[lint]` table: one optional `LintLevel` per lint code, snake_case (D-34).
|
|
630
|
+
* @public
|
|
631
|
+
*/
|
|
632
|
+
export declare const LintTable: Schema.Struct<{
|
|
633
|
+
readonly broken_links: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
634
|
+
readonly missing_index: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
635
|
+
readonly unknown_type: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
636
|
+
readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
637
|
+
readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
638
|
+
readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
639
|
+
readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
640
|
+
readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
641
|
+
readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
642
|
+
readonly log_frontmatter: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
643
|
+
readonly actor_prefix_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
644
|
+
readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
645
|
+
readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
646
|
+
readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
647
|
+
readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
648
|
+
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
649
|
+
}>;
|
|
650
|
+
/**
|
|
651
|
+
* The `OkfitConfig` struct schema. Exported only so the `OkfitConfigFields`
|
|
652
|
+
* type below is reachable from the rollup; the barrel never re-exports this
|
|
653
|
+
* value, so it stays out of the named public surface.
|
|
654
|
+
* @public
|
|
655
|
+
*/
|
|
656
|
+
declare const okfitConfigFields: Schema.Struct<{
|
|
657
|
+
readonly okf_version: Schema.optionalKey<Schema.String>;
|
|
658
|
+
readonly bundle: Schema.optionalKey<Schema.Struct<{
|
|
659
|
+
readonly path: Schema.optionalKey<Schema.String>;
|
|
660
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
661
|
+
}>>;
|
|
662
|
+
readonly concepts: Schema.optionalKey<Schema.Struct<{
|
|
663
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
664
|
+
readonly tags: Schema.optionalKey<Schema.Struct<{
|
|
665
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
666
|
+
}>>;
|
|
667
|
+
}>>;
|
|
668
|
+
readonly lifecycle: Schema.optionalKey<Schema.Struct<{
|
|
669
|
+
readonly default_stale_after: Schema.optionalKey<Schema.Codec<Duration.Duration, string, never, never>>;
|
|
670
|
+
}>>;
|
|
671
|
+
readonly actors: Schema.optionalKey<Schema.Struct<{
|
|
672
|
+
readonly agent: Schema.optionalKey<Schema.Codec<Actor, string, never, never>>;
|
|
673
|
+
readonly humans: Schema.optionalKey<Schema.$Array<Schema.Codec<Actor, string, never, never> & {
|
|
674
|
+
readonly isHuman: (actor: string) => boolean;
|
|
675
|
+
readonly form: (actor: string) => ActorForm;
|
|
676
|
+
}>>;
|
|
677
|
+
}>>;
|
|
678
|
+
readonly lint: Schema.optionalKey<Schema.Struct<{
|
|
679
|
+
readonly broken_links: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
680
|
+
readonly missing_index: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
681
|
+
readonly unknown_type: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
682
|
+
readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
683
|
+
readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
684
|
+
readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
685
|
+
readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
686
|
+
readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
687
|
+
readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
688
|
+
readonly log_frontmatter: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
689
|
+
readonly actor_prefix_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
690
|
+
readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
691
|
+
readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
692
|
+
readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
693
|
+
readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
694
|
+
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
695
|
+
}>>;
|
|
696
|
+
readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
697
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
698
|
+
readonly guidance: Schema.optionalKey<Schema.String>;
|
|
699
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
700
|
+
readonly require_verified: Schema.optionalKey<Schema.Boolean>;
|
|
701
|
+
readonly fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
702
|
+
readonly description: Schema.String;
|
|
703
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
704
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
705
|
+
}>>>;
|
|
706
|
+
}>>>;
|
|
707
|
+
readonly tags: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
708
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
709
|
+
}>>>;
|
|
710
|
+
readonly extensions: Schema.$Record<Schema.String, Schema.Unknown>;
|
|
711
|
+
}>;
|
|
712
|
+
/**
|
|
713
|
+
* The schema the published JSON Schema document is generated from (C-15):
|
|
714
|
+
* `okfitConfigFields` minus `extensions` (wire bookkeeping no human writes),
|
|
715
|
+
* with an open rest so unknown top-level keys are permitted at the root while
|
|
716
|
+
* every declared table stays closed (C-16, D-31).
|
|
4
717
|
*
|
|
5
|
-
* @
|
|
718
|
+
* @public
|
|
6
719
|
*/
|
|
720
|
+
export declare const okfitConfigDocumentFields: Schema.StructWithRest<Schema.Struct<{
|
|
721
|
+
readonly okf_version: Schema.optionalKey<Schema.String>;
|
|
722
|
+
readonly bundle: Schema.optionalKey<Schema.Struct<{
|
|
723
|
+
readonly path: Schema.optionalKey<Schema.String>;
|
|
724
|
+
readonly profile: Schema.optionalKey<Schema.String>;
|
|
725
|
+
}>>;
|
|
726
|
+
readonly concepts: Schema.optionalKey<Schema.Struct<{
|
|
727
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
728
|
+
readonly tags: Schema.optionalKey<Schema.Struct<{
|
|
729
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
730
|
+
}>>;
|
|
731
|
+
}>>;
|
|
732
|
+
readonly lifecycle: Schema.optionalKey<Schema.Struct<{
|
|
733
|
+
readonly default_stale_after: Schema.optionalKey<Schema.Codec<Duration.Duration, string, never, never>>;
|
|
734
|
+
}>>;
|
|
735
|
+
readonly actors: Schema.optionalKey<Schema.Struct<{
|
|
736
|
+
readonly agent: Schema.optionalKey<Schema.Codec<Actor, string, never, never>>;
|
|
737
|
+
readonly humans: Schema.optionalKey<Schema.$Array<Schema.Codec<Actor, string, never, never> & {
|
|
738
|
+
readonly isHuman: (actor: string) => boolean;
|
|
739
|
+
readonly form: (actor: string) => ActorForm;
|
|
740
|
+
}>>;
|
|
741
|
+
}>>;
|
|
742
|
+
readonly lint: Schema.optionalKey<Schema.Struct<{
|
|
743
|
+
readonly broken_links: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
744
|
+
readonly missing_index: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
745
|
+
readonly unknown_type: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
746
|
+
readonly required_key_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
747
|
+
readonly field_value_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
748
|
+
readonly require_verified_unmet: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
749
|
+
readonly family_invalid: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
750
|
+
readonly computation_runtime_missing: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
751
|
+
readonly footnote_source_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
752
|
+
readonly log_frontmatter: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
753
|
+
readonly actor_prefix_unknown: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
754
|
+
readonly legacy_timestamp: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
755
|
+
readonly config_unknown_key: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
756
|
+
readonly stale: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
757
|
+
readonly walk_unreadable: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
758
|
+
readonly generated_at_drift: Schema.optionalKey<Schema.Literals<readonly ["off", "info", "warn", "error"]>>;
|
|
759
|
+
}>>;
|
|
760
|
+
readonly types: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
761
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
762
|
+
readonly guidance: Schema.optionalKey<Schema.String>;
|
|
763
|
+
readonly required: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
764
|
+
readonly require_verified: Schema.optionalKey<Schema.Boolean>;
|
|
765
|
+
readonly fields: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
766
|
+
readonly description: Schema.String;
|
|
767
|
+
readonly values: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
768
|
+
readonly kind: Schema.optionalKey<Schema.Literal<"path">>;
|
|
769
|
+
}>>>;
|
|
770
|
+
}>>>;
|
|
771
|
+
readonly tags: Schema.optionalKey<Schema.$Record<Schema.String, Schema.Struct<{
|
|
772
|
+
readonly description: Schema.optionalKey<Schema.String>;
|
|
773
|
+
}>>>;
|
|
774
|
+
}>, readonly [Schema.$Record<Schema.String, Schema.Unknown>]>;
|
|
775
|
+
/**
|
|
776
|
+
* The decoded config: spec 4.2's shape as a plain object (D-28). Every key is
|
|
777
|
+
* optional except `extensions`, which holds unknown top-level keys verbatim (D-31).
|
|
778
|
+
* @public
|
|
779
|
+
*/
|
|
780
|
+
export type OkfitConfig = typeof okfitConfigFields.Type;
|
|
781
|
+
/**
|
|
782
|
+
* The field shape behind `OkfitConfig`, exported type-only so the barrel can
|
|
783
|
+
* re-export the name without adding a runtime value to the public surface.
|
|
784
|
+
* @public
|
|
785
|
+
*/
|
|
786
|
+
type OkfitConfigFields = typeof okfitConfigFields.fields;
|
|
787
|
+
/**
|
|
788
|
+
* The okfit config codec and its statics (spec 4.2, D-28 to D-31).
|
|
789
|
+
*
|
|
790
|
+
* @remarks
|
|
791
|
+
* Decodes a parsed TOML table to a plain `OkfitConfig`, keeping unknown
|
|
792
|
+
* top-level keys in `extensions`; encoding flattens them back so the on-disk
|
|
793
|
+
* shape never carries a literal `extensions` key. `merge` is pure: plain
|
|
794
|
+
* objects deep-merge, arrays and scalars in `override` replace wholesale. The
|
|
795
|
+
* intended order is `DEFAULTS < profile < file`, applied by the caller (the
|
|
796
|
+
* CLI resolves the profile; core cannot import `@okfit/profiles`).
|
|
797
|
+
*
|
|
798
|
+
* @public
|
|
799
|
+
*/
|
|
800
|
+
export declare const OkfitConfig: Schema.Codec<OkfitConfig, Record<string, unknown>> & {
|
|
801
|
+
readonly fields: OkfitConfigFields;
|
|
802
|
+
readonly DEFAULTS: OkfitConfig;
|
|
803
|
+
readonly merge: (base: OkfitConfig, override: OkfitConfig) => OkfitConfig;
|
|
804
|
+
readonly severityFor: (config: OkfitConfig, code: LintCode) => DiagnosticSeverity | "off";
|
|
805
|
+
readonly read: (path: string) => Effect.Effect<OkfitConfig, ConfigReadError, FileSystem.FileSystem>;
|
|
806
|
+
};
|
|
807
|
+
declare const OkfitConfigFile_base: import("effect/Context").ServiceClass<OkfitConfigFile, "@okfit/core/OkfitConfigFile", import("@effected/config-file").ConfigFileShape<{
|
|
808
|
+
readonly okf_version?: string;
|
|
809
|
+
readonly bundle?: {
|
|
810
|
+
readonly path?: string;
|
|
811
|
+
readonly profile?: string;
|
|
812
|
+
};
|
|
813
|
+
readonly concepts?: {
|
|
814
|
+
readonly required?: readonly string[];
|
|
815
|
+
readonly tags?: {
|
|
816
|
+
readonly required?: readonly string[];
|
|
817
|
+
};
|
|
818
|
+
};
|
|
819
|
+
readonly lifecycle?: {
|
|
820
|
+
readonly default_stale_after?: Duration.Duration;
|
|
821
|
+
};
|
|
822
|
+
readonly actors?: {
|
|
823
|
+
readonly agent?: Actor;
|
|
824
|
+
readonly humans?: readonly Actor[];
|
|
825
|
+
};
|
|
826
|
+
readonly lint?: {
|
|
827
|
+
readonly broken_links?: "error" | "info" | "off" | "warn";
|
|
828
|
+
readonly missing_index?: "error" | "info" | "off" | "warn";
|
|
829
|
+
readonly unknown_type?: "error" | "info" | "off" | "warn";
|
|
830
|
+
readonly required_key_missing?: "error" | "info" | "off" | "warn";
|
|
831
|
+
readonly field_value_unknown?: "error" | "info" | "off" | "warn";
|
|
832
|
+
readonly require_verified_unmet?: "error" | "info" | "off" | "warn";
|
|
833
|
+
readonly family_invalid?: "error" | "info" | "off" | "warn";
|
|
834
|
+
readonly computation_runtime_missing?: "error" | "info" | "off" | "warn";
|
|
835
|
+
readonly footnote_source_unknown?: "error" | "info" | "off" | "warn";
|
|
836
|
+
readonly log_frontmatter?: "error" | "info" | "off" | "warn";
|
|
837
|
+
readonly actor_prefix_unknown?: "error" | "info" | "off" | "warn";
|
|
838
|
+
readonly legacy_timestamp?: "error" | "info" | "off" | "warn";
|
|
839
|
+
readonly config_unknown_key?: "error" | "info" | "off" | "warn";
|
|
840
|
+
readonly stale?: "error" | "info" | "off" | "warn";
|
|
841
|
+
readonly walk_unreadable?: "error" | "info" | "off" | "warn";
|
|
842
|
+
readonly generated_at_drift?: "error" | "info" | "off" | "warn";
|
|
843
|
+
};
|
|
844
|
+
readonly types?: {
|
|
845
|
+
readonly [x: string]: {
|
|
846
|
+
readonly description?: string;
|
|
847
|
+
readonly guidance?: string;
|
|
848
|
+
readonly required?: readonly string[];
|
|
849
|
+
readonly require_verified?: boolean;
|
|
850
|
+
readonly fields?: {
|
|
851
|
+
readonly [x: string]: {
|
|
852
|
+
readonly description: string;
|
|
853
|
+
readonly values?: {
|
|
854
|
+
readonly [x: string]: string;
|
|
855
|
+
};
|
|
856
|
+
readonly kind?: "path";
|
|
857
|
+
};
|
|
858
|
+
};
|
|
859
|
+
};
|
|
860
|
+
};
|
|
861
|
+
readonly tags?: {
|
|
862
|
+
readonly [x: string]: {
|
|
863
|
+
readonly description?: string;
|
|
864
|
+
};
|
|
865
|
+
};
|
|
866
|
+
readonly extensions: {
|
|
867
|
+
readonly [x: string]: unknown;
|
|
868
|
+
};
|
|
869
|
+
}>>;
|
|
870
|
+
/**
|
|
871
|
+
* The only service in core: the config-file service tag for okfit's TOML
|
|
872
|
+
* config (D-7). Core exports the tag so `@okfit/cli` and `@okfit/mcp` share
|
|
873
|
+
* one identity; the layer (`ConfigFile.layer` with the spec 4.1 resolvers and
|
|
874
|
+
* XDG fallback) is built by the CLI, never here (D-29).
|
|
875
|
+
*
|
|
876
|
+
* @remarks
|
|
877
|
+
* Shape is `ConfigFileShape<OkfitConfig>`: `load`, `loadFrom`, `discover`,
|
|
878
|
+
* `loadOrDefault`, `validate`, `write(value, path)` (used by `okfit init`), `save`, `update`.
|
|
879
|
+
*
|
|
880
|
+
* @public
|
|
881
|
+
*/
|
|
882
|
+
export declare class OkfitConfigFile extends OkfitConfigFile_base {}
|
|
883
|
+
//#endregion
|
|
884
|
+
//#region src/Timestamp.d.ts
|
|
885
|
+
/**
|
|
886
|
+
* A decoded OKF timestamp: always a UTC instant.
|
|
887
|
+
* @public
|
|
888
|
+
*/
|
|
889
|
+
export type Timestamp = DateTime.Utc;
|
|
890
|
+
/**
|
|
891
|
+
* ISO 8601 string with an explicit offset (`Z`, `+hh:mm` or `-hh:mm`) to `DateTime.Utc`.
|
|
892
|
+
* Offset-less input fails before parsing so its family surfaces as `family-invalid` (D-15/D-16).
|
|
893
|
+
* Encoding writes `2026-03-01T08:00:00Z` for a whole second and keeps non-zero milliseconds.
|
|
894
|
+
* @public
|
|
895
|
+
*/
|
|
896
|
+
export declare const Timestamp: Schema.Codec<DateTime.Utc, string>;
|
|
897
|
+
//#endregion
|
|
898
|
+
//#region src/Validate.d.ts
|
|
899
|
+
/** Options for {@link Validate.lint}; `stale` fires only when `now` is supplied (D-34). @public */
|
|
900
|
+
interface ValidateOptions {
|
|
901
|
+
readonly now?: DateTime.Utc;
|
|
902
|
+
}
|
|
903
|
+
/** Both tiers. Non-empty `conformance` means CLI exit 2; any `error` in `lint` means exit 1 (spec 3.4). @public */
|
|
904
|
+
interface ValidationReport {
|
|
905
|
+
readonly conformance: ReadonlyArray<Diagnostic>;
|
|
906
|
+
readonly lint: ReadonlyArray<Diagnostic>;
|
|
907
|
+
}
|
|
908
|
+
/** Conformance and lint tiers over a {@link LoadedBundle}; pure (D-35). @public */
|
|
909
|
+
export declare class Validate {
|
|
910
|
+
private constructor();
|
|
911
|
+
/** The conformance-coded entries of `bundle.diagnostics`; always severity `error` (D-33). */
|
|
912
|
+
static readonly conformance: (bundle: LoadedBundle) => ReadonlyArray<Diagnostic>;
|
|
913
|
+
/** Load-time lint diagnostics re-severitied via `OkfitConfig.severityFor` (`off` drops), then every rule (D-34). */
|
|
914
|
+
static readonly lint: (bundle: LoadedBundle, config: OkfitConfig, options?: ValidateOptions) => ReadonlyArray<Diagnostic>;
|
|
915
|
+
/** Runs both tiers (D-35). */
|
|
916
|
+
static readonly all: (bundle: LoadedBundle, config: OkfitConfig, options?: ValidateOptions) => ValidationReport;
|
|
917
|
+
}
|
|
918
|
+
//#endregion
|
|
919
|
+
//#region src/index.d.ts
|
|
7
920
|
/**
|
|
8
921
|
* The OKF specification version this package implements.
|
|
9
922
|
*
|
|
10
923
|
* @public
|
|
11
924
|
*/
|
|
12
|
-
declare const OKF_SPEC_VERSION: "0.2";
|
|
925
|
+
export declare const OKF_SPEC_VERSION: "0.2";
|
|
13
926
|
//#endregion
|
|
14
|
-
export {
|
|
927
|
+
export type { ActorForm, BundleLoadError, BundleLoadOptions, GraphEdge, GraphLink, GraphNode, LogEntry, OkfitConfigFields, PathField, RenderIndexOptions, StaleConcept, ValidateOptions, ValidationReport };
|
|
15
928
|
//# sourceMappingURL=index.d.ts.map
|