@venizia/vulcan-okf 0.4.8 → 0.4.9-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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/vulcan-okf",
3
- "version": "0.4.8",
3
+ "version": "0.4.9-0",
4
4
  "description": "VULCAN knowledge tooling: OKF v0.2 conformance check (plus --strict house rules), gen, coverage and the offline graph explorer for a project's .agents/knowledge bundle. Bun-only.",
5
5
  "homepage": "https://github.com/VENIZIA-AI/vulcan/tree/main/packages/okf",
6
6
  "bugs": {
@@ -47,11 +47,10 @@
47
47
  "devDependencies": {
48
48
  "@types/bun": "1.4.3",
49
49
  "@types/cytoscape-fcose": "2.2.5",
50
- "@venizia/dev-configs": "0.4.4",
50
+ "@venizia/dev-configs": "0.4.7-0",
51
51
  "eslint": "10.13.0",
52
52
  "oxlint": "1.89.0",
53
- "oxlint-tsgolint": "7.0.2004",
54
- "typescript": "^6.0.3"
53
+ "oxlint-tsgolint": "7.0.2004"
55
54
  },
56
55
  "engines": {
57
56
  "bun": ">=1.4.4"
@@ -1,7 +1,8 @@
1
1
  import { spawnSync } from 'node:child_process';
2
2
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
3
3
  import { join, relative } from 'node:path';
4
- import { readOkfProject } from '../project/index.ts';
4
+ import { RecordValue } from '../common/record.ts';
5
+ import { OkfProject } from '../project/index.ts';
5
6
 
6
7
  const DATED_ENTRY = /^\d{4}-\d{2}-\d{2}-.*\.md$/;
7
8
  const FRONTMATTER = /^---\r?\n([\s\S]*?)\r?\n---/;
@@ -10,14 +11,11 @@ const RELEASE_OVERRIDE = /^(.+)@([^@]+)$/;
10
11
 
11
12
  type TRecord = Record<string, unknown>;
12
13
 
13
- const isRecord = (opts: { value: unknown }): opts is { value: TRecord } =>
14
- typeof opts.value === 'object' && opts.value !== null && !Array.isArray(opts.value);
15
-
16
14
  const frontmatterOf = (opts: { text: string }): TRecord => {
17
15
  const block = FRONTMATTER.exec(opts.text)?.[1];
18
16
  const parsed = { value: block === undefined ? undefined : Bun.YAML.parse(block) };
19
17
 
20
- return isRecord(parsed) ? parsed.value : {};
18
+ return RecordValue.isRecord(parsed) ? parsed.value : {};
21
19
  };
22
20
 
23
21
  /** The tag a release override names, by one template of the project; a `<date>` part matches any date. */
@@ -41,89 +39,91 @@ const tagsOf = (opts: { root: string }): string[] => {
41
39
  : [];
42
40
  };
43
41
 
44
- /**
45
- * Project Contract v1, C3: every dated changelog entry declares the packages it covers by npm name -
46
- * atlas reads that list and never the prose. An optional `release: '<npm name>@<version>'` places an
47
- * entry git would place wrong (a backfill); it must name a tag that exists.
48
- */
49
- export const collectChangelogProblems = (): string[] => {
50
- const project = readOkfProject();
51
- const directory = project.changelogs;
52
-
53
- if (directory === undefined || !existsSync(directory)) {
54
- return [];
55
- }
56
-
57
- const names = new Map(project.packages.map((entry) => [entry.name, entry.dir]));
58
- const problems: string[] = [];
59
- let tags: string[] | undefined;
60
-
61
- for (const file of readdirSync(directory)
62
- .filter((name) => DATED_ENTRY.test(name))
63
- .sort()) {
64
- const path = relative(project.root, join(directory, file));
65
- let frontmatter: TRecord;
66
-
67
- // One broken entry is one problem; the rest of the directory is still checked.
68
- try {
69
- frontmatter = frontmatterOf({ text: readFileSync(join(directory, file), 'utf8') });
70
- } catch (error) {
71
- problems.push(
72
- `changelog: ${path}: the frontmatter is not valid YAML (${error instanceof Error ? error.message : String(error)})`,
73
- );
74
- continue;
42
+ export class ChangelogCheck {
43
+ /**
44
+ * Project Contract v1, C3: every dated changelog entry declares the packages it covers by npm name -
45
+ * atlas reads that list and never the prose. An optional `release: '<npm name>@<version>'` places an
46
+ * entry git would place wrong (a backfill); it must name a tag that exists.
47
+ */
48
+ static collectProblems(): string[] {
49
+ const project = OkfProject.read();
50
+ const directory = project.changelogs;
51
+
52
+ if (directory === undefined || !existsSync(directory)) {
53
+ return [];
75
54
  }
76
55
 
77
- // `packages: []` is a decision - an entry about no package, such as repository tooling. Only a
78
- // missing list is undecided.
79
- if (!Array.isArray(frontmatter.packages)) {
80
- problems.push(
81
- `changelog: ${path} declares no packages - add \`packages: [<npm name>, ...]\` (\`vulcan x atlas changelogs migrate\` fills it)`,
82
- );
83
- continue;
84
- }
56
+ const names = new Map(project.packages.map((entry) => [entry.name, entry.dir]));
57
+ const problems: string[] = [];
58
+ let tags: string[] | undefined;
85
59
 
86
- const declared: unknown[] = frontmatter.packages;
60
+ for (const file of readdirSync(directory)
61
+ .filter((name) => DATED_ENTRY.test(name))
62
+ .sort()) {
63
+ const path = relative(project.root, join(directory, file));
64
+ let frontmatter: TRecord;
87
65
 
88
- for (const name of declared) {
89
- if (typeof name !== 'string' || !names.has(name)) {
66
+ // One broken entry is one problem; the rest of the directory is still checked.
67
+ try {
68
+ frontmatter = frontmatterOf({ text: readFileSync(join(directory, file), 'utf8') });
69
+ } catch (error) {
90
70
  problems.push(
91
- `changelog: ${path} names '${String(name)}', not a declared package's npm name`,
71
+ `changelog: ${path}: the frontmatter is not valid YAML (${error instanceof Error ? error.message : String(error)})`,
92
72
  );
73
+ continue;
93
74
  }
94
- }
95
75
 
96
- if (typeof frontmatter.release !== 'string') {
97
- continue;
98
- }
76
+ // `packages: []` is a decision - an entry about no package, such as repository tooling. Only a
77
+ // missing list is undecided.
78
+ if (!Array.isArray(frontmatter.packages)) {
79
+ problems.push(
80
+ `changelog: ${path} declares no packages - add \`packages: [<npm name>, ...]\` (\`vulcan x atlas changelogs migrate\` fills it)`,
81
+ );
82
+ continue;
83
+ }
99
84
 
100
- const override = RELEASE_OVERRIDE.exec(frontmatter.release);
101
- const dir = override === null ? undefined : names.get(override[1]);
85
+ const declared: unknown[] = frontmatter.packages;
102
86
 
103
- if (override === null || dir === undefined) {
104
- problems.push(
105
- `changelog: ${path}: release '${frontmatter.release}' is not '<declared npm name>@<version>'`,
106
- );
107
- continue;
108
- }
87
+ for (const name of declared) {
88
+ if (typeof name !== 'string' || !names.has(name)) {
89
+ problems.push(
90
+ `changelog: ${path} names '${String(name)}', not a declared package's npm name`,
91
+ );
92
+ }
93
+ }
109
94
 
110
- tags ??= tagsOf({ root: project.root });
95
+ if (typeof frontmatter.release !== 'string') {
96
+ continue;
97
+ }
111
98
 
112
- const patterns = [project.tagPattern, ...project.legacyTagPatterns].map((template) =>
113
- tagPatternOf({ template, dir, version: override[2] }),
114
- );
99
+ const override = RELEASE_OVERRIDE.exec(frontmatter.release);
100
+ const dir = override === null ? undefined : names.get(override[1]);
115
101
 
116
- if (!tags.some((tag) => patterns.some((pattern) => pattern.test(tag)))) {
117
- const expected = project.tagPattern
118
- .replace(/<(?:dir|package)>/g, dir)
119
- .replace(/<version>/g, override[2])
120
- .replace(/<date>/g, 'YYYY-MM-DD');
102
+ if (override === null || dir === undefined) {
103
+ problems.push(
104
+ `changelog: ${path}: release '${frontmatter.release}' is not '<declared npm name>@<version>'`,
105
+ );
106
+ continue;
107
+ }
121
108
 
122
- problems.push(
123
- `changelog: ${path}: release '${frontmatter.release}' names no tag (${expected})`,
109
+ tags ??= tagsOf({ root: project.root });
110
+
111
+ const patterns = [project.tagPattern, ...project.legacyTagPatterns].map((template) =>
112
+ tagPatternOf({ template, dir, version: override[2] }),
124
113
  );
114
+
115
+ if (!tags.some((tag) => patterns.some((pattern) => pattern.test(tag)))) {
116
+ const expected = project.tagPattern
117
+ .replace(/<(?:dir|package)>/g, dir)
118
+ .replace(/<version>/g, override[2])
119
+ .replace(/<date>/g, 'YYYY-MM-DD');
120
+
121
+ problems.push(
122
+ `changelog: ${path}: release '${frontmatter.release}' names no tag (${expected})`,
123
+ );
124
+ }
125
125
  }
126
- }
127
126
 
128
- return problems;
129
- };
127
+ return problems;
128
+ }
129
+ }
@@ -1,36 +1,38 @@
1
1
  import { readFileSync } from 'node:fs';
2
2
  import { join, relative } from 'node:path';
3
3
  import { RESERVED_FILES } from '../config.ts';
4
- import { readOkfProject } from '../project/index.ts';
5
- import { IssueSeverities, OkfVersions, checkBundle } from '../spec/index.ts';
4
+ import { OkfProject } from '../project/index.ts';
5
+ import { IssueSeverities, OkfVersions, BundleConformance } from '../spec/index.ts';
6
6
  import type { IBundleFile, IConformanceIssue } from '../spec/index.ts';
7
- import { loadGeneration } from '../generate/index.ts';
8
- import { collectHouseProblems } from './house.ts';
9
- import { repoRelative, walkFiles } from '../source/index.ts';
7
+ import { GenerationRegistry } from '../generate/index.ts';
8
+ import { HouseCheck } from './house.ts';
9
+ import { SourceScanner } from '../source/index.ts';
10
10
 
11
- export const readBundleFiles = (): IBundleFile[] =>
12
- walkFiles({ dir: readOkfProject().bundle })
11
+ const readBundleFiles = (): IBundleFile[] =>
12
+ SourceScanner.walkFiles({ dir: OkfProject.read().bundle })
13
13
  .filter((file) => file.endsWith('.md'))
14
14
  .map((file) => ({
15
- path: relative(readOkfProject().bundle, file),
15
+ path: relative(OkfProject.read().bundle, file),
16
16
  text: readFileSync(file, 'utf8'),
17
17
  }));
18
18
 
19
- export const formatIssue = (opts: { issue: IConformanceIssue }): string =>
20
- `${repoRelative({ path: join(readOkfProject().bundle, opts.issue.file) })}: ${opts.issue.rule} ${opts.issue.message}`;
19
+ const formatIssue = (opts: { issue: IConformanceIssue }): string =>
20
+ `${SourceScanner.repoRelative({ path: join(OkfProject.read().bundle, opts.issue.file) })}: ${opts.issue.rule} ${opts.issue.message}`;
21
21
 
22
22
  /** The house rules on top of OKF conformance: links resolve, docs style, structural coverage, freshness. */
23
23
 
24
24
  export const check = async (opts: { strict: boolean }): Promise<void> => {
25
25
  const files = readBundleFiles();
26
- const issues = checkBundle({ files });
26
+ const issues = BundleConformance.check({ files });
27
27
  const warnings = issues.filter((issue) => issue.severity === IssueSeverities.WARNING);
28
28
  const problems = issues
29
29
  .filter((issue) => issue.severity === IssueSeverities.ERROR)
30
30
  .map((issue) => formatIssue({ issue }));
31
31
 
32
32
  if (opts.strict) {
33
- problems.push(...collectHouseProblems({ files, ...(await loadGeneration()) }));
33
+ const generation = await GenerationRegistry.load();
34
+
35
+ problems.push(...HouseCheck.collectProblems({ files, ...generation }));
34
36
  }
35
37
 
36
38
  if (warnings.length) {
@@ -1,43 +1,21 @@
1
1
  import { existsSync, readFileSync } from 'node:fs';
2
2
  import { join } from 'node:path';
3
3
  import { REGENERATE_HINT } from '../config.ts';
4
- import { readOkfProject } from '../project/index.ts';
5
- import { loadConcepts, stripCode } from '../lib.ts';
4
+ import { OkfProject } from '../project/index.ts';
5
+ import { ConceptLoader, MarkdownText } from '../lib.ts';
6
6
  import type { Concept } from '../lib.ts';
7
7
  import type { IBundleFile } from '../spec/index.ts';
8
- import { collectCoverageAxes, isItemCovered, resourceKeysOf } from '../coverage-report/axes.ts';
9
- import { collectContentsProblems } from '../generate/contents-files.ts';
10
- import { collectChangelogProblems } from './changelogs.ts';
11
- import { extractRegion, renderPages } from '../generate/index.ts';
8
+ import { CoverageAxes } from '../coverage-report/axes.ts';
9
+ import { ContentsFiles } from '../generate/contents-files.ts';
10
+ import { ChangelogCheck } from './changelogs.ts';
11
+ import { GeneratedPages, ManagedRegion } from '../generate/index.ts';
12
12
  import type { ILoadedRegion, ILoadedRenderer } from '../generate/index.ts';
13
- import { brandSpelling, repoRelative } from '../source/index.ts';
13
+ import { SourceCollector, SourceScanner } from '../source/index.ts';
14
14
 
15
15
  // --- docs style ---
16
16
 
17
- /**
18
- * Repo docs rules, enforced on prose (see check step 3). To write a forbidden literal - as the
19
- * concept defining these rules must - put it in a code span; `stripCode` removes those first.
20
- */
21
- export const styleRules = (opts: { brand: string }): { pattern: RegExp; message: string }[] => {
22
- const spelling = brandSpelling({ brand: opts.brand });
23
-
24
- return [
25
- { pattern: /[—–]/, message: 'use a hyphen, not an em-dash or en-dash' },
26
- ...(spelling === undefined
27
- ? []
28
- : [
29
- {
30
- pattern: new RegExp(spelling.source),
31
- message: `the brand is always written ${opts.brand}`,
32
- },
33
- ]),
34
- ];
35
- };
36
-
37
- // --- freshness ---
38
-
39
17
  /** Compare generated content ignoring trailing whitespace, so an editor's final newline is not "stale". */
40
- export const sameContent = (opts: { left: string; right: string }): boolean => {
18
+ const sameContent = (opts: { left: string; right: string }): boolean => {
41
19
  const normalize = (value: string) =>
42
20
  value
43
21
  .split('\n')
@@ -48,112 +26,142 @@ export const sameContent = (opts: { left: string; right: string }): boolean => {
48
26
  return normalize(opts.left) === normalize(opts.right);
49
27
  };
50
28
 
51
- export const collectHouseProblems = (opts: {
52
- files: IBundleFile[];
53
- renderers: ILoadedRenderer[];
54
- regions: ILoadedRegion[];
55
- }): string[] => {
56
- const problems: string[] = [];
57
-
58
- // A concept that fails to load is already reported by the spec layer; links need the loaded set.
59
- let concepts: Concept[] = [];
60
-
61
- try {
62
- concepts = loadConcepts();
63
- } catch (error) {
64
- console.error(
65
- `check: links skipped - ${error instanceof Error ? error.message : String(error)}`,
66
- );
29
+ export class HouseCheck {
30
+ /**
31
+ * Repo docs rules, enforced on prose (see check step 3). To write a forbidden literal - as the
32
+ * concept defining these rules must - put it in a code span; `stripCode` removes those first.
33
+ */
34
+ static styleRules(opts: { brand: string }): { pattern: RegExp; message: string }[] {
35
+ const spelling = SourceCollector.brandSpelling({ brand: opts.brand });
36
+
37
+ return [
38
+ { pattern: /[—–]/, message: 'use a hyphen, not an em-dash or en-dash' },
39
+ ...(spelling === undefined
40
+ ? []
41
+ : [
42
+ {
43
+ pattern: new RegExp(spelling.source),
44
+ message: `the brand is always written ${opts.brand}`,
45
+ },
46
+ ]),
47
+ ];
67
48
  }
68
49
 
69
- const ids = new Set(concepts.map((concept) => concept.id));
50
+ static collectProblems(opts: {
51
+ files: IBundleFile[];
52
+ renderers: ILoadedRenderer[];
53
+ regions: ILoadedRegion[];
54
+ }): string[] {
55
+ const problems: string[] = [];
56
+
57
+ // A concept that fails to load is already reported by the spec layer; links need the loaded set.
58
+ let concepts: Concept[] = [];
59
+
60
+ try {
61
+ concepts = ConceptLoader.load();
62
+ } catch (error) {
63
+ console.error(
64
+ `check: links skipped - ${error instanceof Error ? error.message : String(error)}`,
65
+ );
66
+ }
67
+
68
+ const ids = new Set(concepts.map((concept) => concept.id));
70
69
 
71
- for (const concept of concepts) {
72
- for (const target of concept.links) {
73
- if (!ids.has(target)) {
74
- problems.push(`${repoRelative({ path: concept.file })}: broken link -> ${target}.md`);
70
+ for (const concept of concepts) {
71
+ for (const target of concept.links) {
72
+ if (!ids.has(target)) {
73
+ problems.push(
74
+ `${SourceScanner.repoRelative({ path: concept.file })}: broken link -> ${target}.md`,
75
+ );
76
+ }
75
77
  }
76
78
  }
77
- }
78
79
 
79
- // Prose only: code is stripped, so the concept that defines a style rule can still quote what it forbids.
80
- for (const file of opts.files) {
81
- const prose = stripCode({ text: file.text });
80
+ // Prose only: code is stripped, so the concept that defines a style rule can still quote what it forbids.
81
+ for (const file of opts.files) {
82
+ const prose = MarkdownText.stripCode({ text: file.text });
82
83
 
83
- for (const rule of styleRules({ brand: readOkfProject().viz.brand })) {
84
- const match = prose.match(rule.pattern);
84
+ for (const rule of HouseCheck.styleRules({ brand: OkfProject.read().viz.brand })) {
85
+ const match = prose.match(rule.pattern);
85
86
 
86
- if (match) {
87
- problems.push(
88
- `${repoRelative({ path: join(readOkfProject().bundle, file.path) })}: ${rule.message} (found "${match[0]}")`,
89
- );
87
+ if (match) {
88
+ problems.push(
89
+ `${SourceScanner.repoRelative({ path: join(OkfProject.read().bundle, file.path) })}: ${rule.message} (found "${match[0]}")`,
90
+ );
91
+ }
90
92
  }
91
93
  }
92
- }
93
94
 
94
- const filePaths = new Set(opts.files.map((file) => `/${file.path.replace(/\.md$/, '')}`));
95
- const resources = resourceKeysOf({ concepts });
95
+ const filePaths = new Set(opts.files.map((file) => `/${file.path.replace(/\.md$/, '')}`));
96
+ const resources = CoverageAxes.resourceKeysOf({ concepts });
96
97
 
97
- const { axes, problems: axisProblems } = collectCoverageAxes();
98
+ const { axes, problems: axisProblems } = CoverageAxes.collect();
98
99
 
99
- problems.push(...axisProblems);
100
+ problems.push(...axisProblems);
100
101
 
101
- for (const axis of axes) {
102
- const section = axis.name;
102
+ for (const axis of axes) {
103
+ const section = axis.name;
103
104
 
104
- for (const name of axis.items) {
105
- if (!isItemCovered({ axis, item: name, ids: filePaths, resources })) {
106
- problems.push(`coverage: ${section}/${name} has no concept (${section}/${name}.md)`);
105
+ for (const name of axis.items) {
106
+ if (!CoverageAxes.isItemCovered({ axis, item: name, ids: filePaths, resources })) {
107
+ problems.push(`coverage: ${section}/${name} has no concept (${section}/${name}.md)`);
108
+ }
107
109
  }
108
110
  }
109
- }
110
111
 
111
- for (const region of opts.regions) {
112
- if (!existsSync(region.file)) {
113
- problems.push(
114
- `freshness: region '${region.id}' host file missing (${repoRelative({ path: region.file })})`,
115
- );
116
- continue;
117
- }
112
+ for (const region of opts.regions) {
113
+ if (!existsSync(region.file)) {
114
+ problems.push(
115
+ `freshness: region '${region.id}' host file missing (${SourceScanner.repoRelative({ path: region.file })})`,
116
+ );
117
+ continue;
118
+ }
118
119
 
119
- let actual: string;
120
+ let actual: string;
120
121
 
121
- // Broken markers are the person's to fix by hand - gen refuses them, so never call them stale.
122
- try {
123
- actual = extractRegion({
124
- text: readFileSync(region.file, 'utf8'),
125
- id: region.id,
126
- file: repoRelative({ path: region.file }),
127
- });
128
- } catch (error) {
129
- problems.push(
130
- `freshness: ${(error instanceof Error ? error.message : String(error)).replace(/^okf: /, '')}`,
131
- );
132
- continue;
133
- }
122
+ // Broken markers are the person's to fix by hand - gen refuses them, so never call them stale.
123
+ try {
124
+ actual = ManagedRegion.extract({
125
+ text: readFileSync(region.file, 'utf8'),
126
+ id: region.id,
127
+ file: SourceScanner.repoRelative({ path: region.file }),
128
+ });
129
+ } catch (error) {
130
+ problems.push(
131
+ `freshness: ${(error instanceof Error ? error.message : String(error)).replace(/^okf: /, '')}`,
132
+ );
133
+ continue;
134
+ }
134
135
 
135
- if (!sameContent({ left: actual, right: region.render() })) {
136
- problems.push(`freshness: region '${region.id}' is stale - ${REGENERATE_HINT}`);
136
+ if (!sameContent({ left: actual, right: region.render() })) {
137
+ problems.push(`freshness: region '${region.id}' is stale - ${REGENERATE_HINT}`);
138
+ }
137
139
  }
138
- }
139
140
 
140
- const pages = renderPages({ renderers: opts.renderers });
141
+ const pages = GeneratedPages.render({ renderers: opts.renderers });
141
142
 
142
- for (const { path, content } of pages) {
143
- const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
143
+ for (const { path, content } of pages) {
144
+ const current = existsSync(path) ? readFileSync(path, 'utf8') : '';
144
145
 
145
- if (!sameContent({ left: current, right: content })) {
146
- problems.push(`freshness: ${repoRelative({ path })} is stale - ${REGENERATE_HINT}`);
146
+ if (!sameContent({ left: current, right: content })) {
147
+ problems.push(
148
+ `freshness: ${SourceScanner.repoRelative({ path })} is stale - ${REGENERATE_HINT}`,
149
+ );
150
+ }
147
151
  }
148
- }
149
152
 
150
- // C3: every dated changelog entry declares its packages by npm name.
151
- problems.push(...collectChangelogProblems());
153
+ // C3: every dated changelog entry declares its packages by npm name.
154
+ problems.push(...ChangelogCheck.collectProblems());
152
155
 
153
- // A long agent-read file opens with its contents - an agent may read its first lines only.
154
- problems.push(...collectContentsProblems({ skip: new Set(pages.map((page) => page.path)) }));
156
+ // A long agent-read file opens with its contents - an agent may read its first lines only.
157
+ problems.push(
158
+ ...ContentsFiles.collectProblems({ skip: new Set(pages.map((page) => page.path)) }),
159
+ );
155
160
 
156
- return problems;
157
- };
161
+ return problems;
162
+ }
163
+ }
164
+
165
+ // --- freshness ---
158
166
 
159
167
  /** OKF conformance (errors fail, warnings print); `strict` adds the house rules. */
package/src/cli.ts CHANGED
@@ -29,4 +29,6 @@ const child = Bun.spawn([process.execPath, join(import.meta.dir, 'run.ts'), comm
29
29
  stdio: ['inherit', 'inherit', 'inherit'],
30
30
  });
31
31
 
32
- process.exit(await child.exited);
32
+ const exitCode = await child.exited;
33
+
34
+ process.exit(exitCode);
@@ -0,0 +1,6 @@
1
+ /** The one answer to "is this parsed YAML or JSON a plain object": a mapping, not an array, not null. */
2
+ export class RecordValue {
3
+ static isRecord(opts: { value: unknown }): opts is { value: Record<string, unknown> } {
4
+ return typeof opts.value === 'object' && opts.value !== null && !Array.isArray(opts.value);
5
+ }
6
+ }