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