@open-tomato/rafa 0.46.0 → 0.48.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/README.md +70 -37
- package/dist/adapters/logger/settings.d.ts +2 -2
- package/dist/bugs/places.d.ts +1 -1
- package/dist/bugs/record.d.ts +1 -1
- package/dist/bundled/skills/dev-planner/SKILL.md +2 -2
- package/dist/cli.js +73457 -72996
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.js +6 -4
- package/dist/config/shape.d.ts +20 -15
- package/dist/config/templates.d.ts +64 -0
- package/dist/config-registry.d.ts +21 -12
- package/dist/config-schema-board-project.d.ts +3 -3
- package/dist/config-schema-bugs.d.ts +3 -3
- package/dist/config-schema-checks.d.ts +114 -0
- package/dist/config-schema-errors.d.ts +3 -3
- package/dist/config-schema-features.d.ts +4 -4
- package/dist/config-schema-hub.d.ts +6 -4
- package/dist/config-schema-issues.d.ts +2 -2
- package/dist/config-schema-logger.d.ts +3 -3
- package/dist/config-schema-loop-continue.d.ts +3 -3
- package/dist/config-schema-loop-retries.d.ts +4 -4
- package/dist/config-schema-release.d.ts +23 -24
- package/dist/config-schema-tests.d.ts +35 -27
- package/dist/config-schema-triage.d.ts +3 -3
- package/dist/config-schema-wrap-up.d.ts +4 -4
- package/dist/core/command/command.d.ts +1 -1
- package/dist/core/command/confirm.d.ts +11 -5
- package/dist/core/command/global-flags.d.ts +25 -0
- package/dist/core/command/index.d.ts +47 -23
- package/dist/core/command/registry-types.d.ts +4 -4
- package/dist/core/command/shared-flags.d.ts +40 -0
- package/dist/core/command/types.d.ts +3 -2
- package/dist/core/config/branch-template.d.ts +2 -0
- package/dist/core/config/config-items.d.ts +1 -1
- package/dist/core/config/config-load-module.d.ts +43 -0
- package/dist/core/config/config-load.d.ts +43 -12
- package/dist/core/config/config-origins.d.ts +31 -30
- package/dist/core/config/config-schema.d.ts +11 -0
- package/dist/core/config/config-sections.d.ts +15 -14
- package/dist/core/config/config.d.ts +90 -25
- package/dist/core/config/core-section.d.ts +1 -1
- package/dist/core/config/default-routing.d.ts +1 -1
- package/dist/core/config/index.d.ts +14 -10
- package/dist/core/config/merge-method.d.ts +40 -0
- package/dist/core/config/scope.d.ts +2 -2
- package/dist/core/config/section.d.ts +81 -1
- package/dist/core/config/sections.d.ts +17 -6
- package/dist/core/git/gh-runner.d.ts +1 -1
- package/dist/core/git/git.d.ts +34 -0
- package/dist/core/git/index.d.ts +13 -8
- package/dist/core/loop/claude.d.ts +11 -5
- package/dist/core/loop/hop-record.d.ts +6 -6
- package/dist/core/loop/index.d.ts +9 -8
- package/dist/core/loop/session-record-parse.d.ts +9 -2
- package/dist/core/loop/sessions.d.ts +23 -11
- package/dist/core/loop/suite-failure.d.ts +8 -6
- package/dist/core/output/active.d.ts +1 -1
- package/dist/core/plan/block-reader.d.ts +1 -1
- package/dist/core/runtime/identity.d.ts +13 -0
- package/dist/core/runtime/index.d.ts +12 -6
- package/dist/effort/store/check-rows.d.ts +1 -1
- package/dist/effort/store/commit-stats.d.ts +1 -1
- package/dist/effort/store/index.js +7 -8
- package/dist/effort/store/merge-commit-gaps.d.ts +1 -1
- package/dist/effort/store/plan-stubs.d.ts +1 -1
- package/dist/effort/store/session-row-types.d.ts +2 -2
- package/dist/errors/rafa-codes.d.ts +1 -1
- package/dist/index-2xzkzwm6.js +670 -0
- package/dist/index-ajv88fkm.js +448 -0
- package/dist/{index-ykggr043.js → index-fpgmdmww.js} +13 -5
- package/dist/index-g91ys6kw.js +249 -0
- package/dist/{index-cy98y87p.js → index-jx3x70xh.js} +1111 -638
- package/dist/{index-gvek4r8m.js → index-m672ptpg.js} +84 -26
- package/dist/{index-39kbcw68.js → index-w5qbpdtp.js} +415 -842
- package/dist/{index-gqz4jn6j.js → index-z4r20zwr.js} +8974 -11438
- package/dist/{index-j4k2vdz3.js → index-zsak0jy6.js} +124 -290
- package/dist/index.js +24940 -18766
- package/dist/learning/index.js +221 -12
- package/dist/plan/index.js +10 -9
- package/dist/ports/index.d.ts +7 -7
- package/dist/ports/learning.d.ts +5 -4
- package/dist/ports/spec-review.d.ts +1 -1
- package/dist/ready-gax3hhtt.js +241 -0
- package/dist/release-templates/release-bot-fragment.yml +6 -6
- package/dist/release-templates/release-publish.yml +8 -8
- package/dist/release-templates/release-settle.yml +8 -7
- package/dist/release-templates/release-tag.yml +8 -7
- package/package.json +53 -2
- package/dist/index-77ajfffn.js +0 -223
- package/dist/index-jh1r4kcn.js +0 -1067
- package/dist/index-z1w83f81.js +0 -4
- package/dist/pr/checks.d.ts +0 -133
- package/dist/pr/types.d.ts +0 -422
- package/dist/ready-4f8edezt.js +0 -2016
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Where a resolved setting came from
|
|
3
|
-
*
|
|
4
|
-
* `provenance` and `shadowed` (`config.ts`).
|
|
2
|
+
* Where a resolved setting came from: the record `ResolvedConfig`
|
|
3
|
+
* carries beside its values, `provenance` (`config.ts`).
|
|
5
4
|
*
|
|
6
5
|
* ## An origin
|
|
7
6
|
*
|
|
@@ -11,19 +10,24 @@
|
|
|
11
10
|
* file is one entry, so every setting it answers is entry 0. A setting
|
|
12
11
|
* the command line or a default answered has no origin: no file set it.
|
|
13
12
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
13
|
+
* `resolveConfig` ranks four files, two per scope: the project's local
|
|
14
|
+
* file, the project's file, the user scope's local file and the user
|
|
15
|
+
* scope's file, highest first. {@link originOf} takes the FILE that
|
|
16
|
+
* answered a setting, never a source name, so the two user files, which
|
|
17
|
+
* both report source `user`, each name their own path, as the project's
|
|
18
|
+
* local file (`local`) and its other file (`file`) do. `cli` and
|
|
19
|
+
* `default` name no file and answer none. A map setting merged across
|
|
20
|
+
* several files names the highest of them, the file its source names.
|
|
19
21
|
*
|
|
20
|
-
*
|
|
22
|
+
* A setting a template answered (`template`) names the file whose
|
|
23
|
+
* `templates` key named it, which is the file that answered, since a
|
|
24
|
+
* file's templates are laid under its own keys, with the entry of that
|
|
25
|
+
* file that last set `templates`, and carries the template's name as
|
|
26
|
+
* `template`. An origin a file's own key gave carries no `template`.
|
|
21
27
|
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* file of its scope left unread, named so the warning and `rafa doctor`
|
|
26
|
-
* can say which keys stopped applying.
|
|
28
|
+
* No file of a scope shadows another: each scope is read from its
|
|
29
|
+
* module file and its YAML file over it (`config-load.ts`), so no
|
|
30
|
+
* record here names a file left unread.
|
|
27
31
|
*/
|
|
28
32
|
import type { ConfigFile, ConfigSetting, ConfigSource } from './config.js';
|
|
29
33
|
/** The two scopes a config file is read in. */
|
|
@@ -32,26 +36,23 @@ export type ConfigScopeName = 'user' | 'project';
|
|
|
32
36
|
export interface SettingOrigin {
|
|
33
37
|
/** The file, as its layer names it. */
|
|
34
38
|
readonly file: string;
|
|
35
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* The zero-based entry of that file that last set the setting, or for
|
|
41
|
+
* a template's setting the entry that last set the file's `templates`.
|
|
42
|
+
*/
|
|
36
43
|
readonly entry: number;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
export interface ShadowedFile {
|
|
40
|
-
/** The scope both files sit in. */
|
|
41
|
-
readonly layer: ConfigScopeName;
|
|
42
|
-
/** The YAML file left unread. */
|
|
43
|
-
readonly path: string;
|
|
44
|
-
/** The module file read in its place. */
|
|
45
|
-
readonly by: string;
|
|
44
|
+
/** The template that answered the setting, by name; absent for a file's own key. */
|
|
45
|
+
readonly template?: string;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* The origin of `setting`,
|
|
49
|
-
*
|
|
48
|
+
* The origin of `setting`, read off the file that answered it; see the
|
|
49
|
+
* module note.
|
|
50
50
|
*
|
|
51
51
|
* @param source - The layer that answered the setting.
|
|
52
52
|
* @param setting - The setting.
|
|
53
|
-
* @param
|
|
54
|
-
*
|
|
55
|
-
* @returns The file and entry, or null for the command line
|
|
53
|
+
* @param answeredBy - The file that answered it, or null where the
|
|
54
|
+
* command line or a default did.
|
|
55
|
+
* @returns The file and entry, or null for the command line, a default,
|
|
56
|
+
* or a template the file records none for.
|
|
56
57
|
*/
|
|
57
|
-
export declare function originOf(source: ConfigSource, setting: ConfigSetting,
|
|
58
|
+
export declare function originOf(source: ConfigSource, setting: ConfigSetting, answeredBy: ConfigFile | null): SettingOrigin | null;
|
|
@@ -82,6 +82,12 @@ export interface RafaConfig {
|
|
|
82
82
|
* project root. `loop.worktreeDir`.
|
|
83
83
|
*/
|
|
84
84
|
loopWorktreeDir: string;
|
|
85
|
+
/**
|
|
86
|
+
* The shell command a `--as-worktree` run runs in its new or reused
|
|
87
|
+
* worktree before the first session, or null to run nothing.
|
|
88
|
+
* `loop.worktreeSetup`.
|
|
89
|
+
*/
|
|
90
|
+
loopWorktreeSetup: string | null;
|
|
85
91
|
/**
|
|
86
92
|
* The logins trusted with board text besides the repository's own
|
|
87
93
|
* write-holders. `board.trustedAuthors`.
|
|
@@ -177,6 +183,11 @@ export interface RafaConfig {
|
|
|
177
183
|
* once; `loop start` creates the branch it names. `naming.branch`.
|
|
178
184
|
*/
|
|
179
185
|
namingBranch: string;
|
|
186
|
+
/**
|
|
187
|
+
* The config templates a file adopts, by name: each a non-empty
|
|
188
|
+
* string, in the order written. `templates`.
|
|
189
|
+
*/
|
|
190
|
+
templates: readonly string[];
|
|
180
191
|
}
|
|
181
192
|
/** The name of one setting, as a field of {@link RafaConfig}. */
|
|
182
193
|
export type ConfigSetting = keyof RafaConfig;
|
|
@@ -167,15 +167,16 @@
|
|
|
167
167
|
* back.
|
|
168
168
|
*
|
|
169
169
|
* The range {@link confidence} accepts, {@link CONFIDENCE_MIN} to
|
|
170
|
-
* {@link CONFIDENCE_MAX}, is declared here and not read from the
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
* library clamps every lesson's confidence to,
|
|
174
|
-
* `src/tests/learning-contract.test.ts` holds the two equal.
|
|
175
|
-
*
|
|
176
|
-
* The reader of `pr.mergeMethod`, over the pull request port's three
|
|
177
|
-
*
|
|
178
|
-
* `config-schema-release.ts`, so
|
|
170
|
+
* {@link CONFIDENCE_MAX}, is declared here and not read from the learning
|
|
171
|
+
* library: core imports nothing above it, and the library under
|
|
172
|
+
* `packages/rafa-inventory/src/learning/` imports nothing outside its folder,
|
|
173
|
+
* so each declares the pair the library clamps every lesson's confidence to,
|
|
174
|
+
* and `src/tests/learning-contract.test.ts` holds the two equal.
|
|
175
|
+
*
|
|
176
|
+
* The reader of `pr.mergeMethod`, over the pull request port's three methods,
|
|
177
|
+
* is not here: it sits with the setting it reads, in
|
|
178
|
+
* `config-schema-release.ts`, so this file imports nothing from
|
|
179
|
+
* `packages/rafa/src/pr/types.ts`.
|
|
179
180
|
*/
|
|
180
181
|
import type { SkillTier } from '../../schema/tiers.js';
|
|
181
182
|
/** One key a file carried that names nothing this version reads. */
|
|
@@ -253,10 +254,10 @@ export type ClaudeSettingSource = (typeof CLAUDE_SETTING_SOURCES)[number];
|
|
|
253
254
|
/**
|
|
254
255
|
* The pull request providers a file may name: the GitHub CLI, and none.
|
|
255
256
|
*
|
|
256
|
-
* `none` is a provider and not an absence: under it the loop pushes the
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* `pr/provider.ts` resolves off the `origin` remote.
|
|
257
|
+
* `none` is a provider and not an absence: under it the loop pushes the branch,
|
|
258
|
+
* prints the compare URL and skips the CI wait, which is a behaviour an
|
|
259
|
+
* operator chooses, where a setting left unnamed is one
|
|
260
|
+
* `packages/rafa/src/pr/provider.ts` resolves off the `origin` remote.
|
|
260
261
|
*/
|
|
261
262
|
export declare const PR_PROVIDERS: readonly ["gh", "none"];
|
|
262
263
|
/** One of the two pull request providers. */
|
|
@@ -347,7 +348,7 @@ export declare const usdAmount: Reader<number>;
|
|
|
347
348
|
* Accepts an issue number as the board spells one: a whole number above
|
|
348
349
|
* zero, and no string spelled like one.
|
|
349
350
|
*
|
|
350
|
-
* The bound matches `src/board/naming.ts`, which refuses anything else
|
|
351
|
+
* The bound matches `packages/rafa/src/board/naming.ts`, which refuses anything else
|
|
351
352
|
* with a `RangeError` rather than spelling `rafa-0` into a path. A
|
|
352
353
|
* setting read here is handed straight to `gh issue view <n>`, so `0`,
|
|
353
354
|
* `-1` and `2.5` are refused where the person can still fix the file,
|
|
@@ -1,18 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Reading rafa's settings: the phase 1 schema of the
|
|
2
|
+
* Reading rafa's settings: the phase 1 schema of the config files
|
|
3
3
|
* (`.rafa/config.yaml`, `rafa.config.ts` or `rafa.config.mjs`).
|
|
4
4
|
*
|
|
5
|
+
* Four files rank, two per scope ({@link ConfigLayers}): the project's
|
|
6
|
+
* local file over the project's file, then the user scope's local file
|
|
7
|
+
* over the user scope's file under `~/.rafa/`. A scope's local file is
|
|
8
|
+
* its `.rafa/config.yaml`, read over the scope's module file key by key;
|
|
9
|
+
* which file on disk fills each layer is `config-load.ts`'s to say.
|
|
5
10
|
* Every setting takes the value the COMMAND LINE gave it, else the
|
|
6
|
-
* value the
|
|
7
|
-
*
|
|
11
|
+
* value of the first of the four files, in that order, that gave it one,
|
|
12
|
+
* else its default; a map setting merges by key in the reverse order,
|
|
13
|
+
* the default under the user's files under the project's. Each
|
|
8
14
|
* setting is ranked on its own, so a flag naming one leaves the others
|
|
9
|
-
* to the files and a
|
|
10
|
-
*
|
|
15
|
+
* to the files and a file naming one leaves the others to the files
|
|
16
|
+
* under it, and {@link ResolvedConfig.sources} records which layer
|
|
11
17
|
* answered each. That record keeps precedence observable when two
|
|
12
|
-
* layers agree: a file spelling the default still reports
|
|
13
|
-
* the value alone could not tell a file that was read from one
|
|
14
|
-
* skipped. `
|
|
15
|
-
*
|
|
18
|
+
* layers agree: a file spelling the default still reports its layer,
|
|
19
|
+
* where the value alone could not tell a file that was read from one
|
|
20
|
+
* that was skipped. `local` names the project's local file and `file`
|
|
21
|
+
* the project's other file, as it did when that was the only file read;
|
|
22
|
+
* `user` names either of the user scope's, and the origin in
|
|
23
|
+
* {@link ResolvedConfig.provenance}, read off the file that answered,
|
|
24
|
+
* tells the two apart.
|
|
25
|
+
*
|
|
26
|
+
* A file may name config templates with its `templates` key, and each
|
|
27
|
+
* template's entry sits under that file's own keys and over every lower
|
|
28
|
+
* file: each of the four over its own templates over the next file down,
|
|
29
|
+
* the last over the default. A setting a template answered and no
|
|
30
|
+
* file outranked reports `template`, and its `provenance` names the
|
|
31
|
+
* template and the file that named it. {@link layTemplatesUnder} lays
|
|
32
|
+
* them; `config-load.ts` reads them through the template hook.
|
|
16
33
|
*
|
|
17
34
|
* This module is the pure half: text, or a document already parsed,
|
|
18
35
|
* into a layer, and layers into one resolution. Finding and reading each
|
|
@@ -29,11 +46,10 @@
|
|
|
29
46
|
* other two modules export for a caller to import rather than reaching
|
|
30
47
|
* into a sibling; however, most
|
|
31
48
|
* callers import `config-sections.ts`'s names directly,
|
|
32
|
-
* through its barrel `core/config/sections.js`.
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
* `
|
|
36
|
-
* second place to learn it from.
|
|
49
|
+
* through its barrel `core/config/sections.js`. `MergeMethod`, the type
|
|
50
|
+
* of {@link RafaConfig.prMergeMethod}, is `merge-method.ts`'s, exported
|
|
51
|
+
* by that barrel and re-exported by the pull request port
|
|
52
|
+
* (`packages/rafa/src/pr/types.ts`); this module does not re-export it.
|
|
37
53
|
*
|
|
38
54
|
* - `config-sections.ts` holds every rule about a VALUE: the readers,
|
|
39
55
|
* the closed lists of values, and why nothing is coerced.
|
|
@@ -180,7 +196,7 @@
|
|
|
180
196
|
* boolean. So a `tracking` flag spelled `yes` is refused rather
|
|
181
197
|
* than read as true.
|
|
182
198
|
*/
|
|
183
|
-
import type { SettingOrigin
|
|
199
|
+
import type { SettingOrigin } from './config-origins.js';
|
|
184
200
|
import type { CommandLineSetting, ConfigSetting, RafaConfig } from './config-schema.js';
|
|
185
201
|
import type { ConfigExtra } from './config-sections.js';
|
|
186
202
|
export type { CommandLineSetting, ConfigSetting, RafaConfig, } from './config-schema.js';
|
|
@@ -191,9 +207,11 @@ export type { ModuleSource, ModuleSourceKind, OptionalPrerequisiteItem, Prerequi
|
|
|
191
207
|
export { MODULE_SOURCE_KINDS, PREREQUISITE_KINDS } from './config-items.js';
|
|
192
208
|
/**
|
|
193
209
|
* The layer that answered a setting: the command line, the project's
|
|
194
|
-
* file, the
|
|
210
|
+
* local file, the project's file, either of the user scope's two files,
|
|
211
|
+
* a template any file named, or the default. Which user file answered,
|
|
212
|
+
* and which file named the template, is the setting's `provenance`.
|
|
195
213
|
*/
|
|
196
|
-
export type ConfigSource = 'cli' | 'file' | 'user' | 'default';
|
|
214
|
+
export type ConfigSource = 'cli' | 'local' | 'file' | 'user' | 'template' | 'default';
|
|
197
215
|
/**
|
|
198
216
|
* One layer's say on every setting: a value, or undefined for silence.
|
|
199
217
|
*
|
|
@@ -228,13 +246,30 @@ export interface ConfigFile {
|
|
|
228
246
|
* setting is entry 0.
|
|
229
247
|
*/
|
|
230
248
|
entries?: ReadonlyMap<ConfigSetting, number>;
|
|
249
|
+
/**
|
|
250
|
+
* The template that answered each setting the file's own keys left
|
|
251
|
+
* silent, by name, as {@link layTemplatesUnder} laid it. Absent for a
|
|
252
|
+
* file naming no template.
|
|
253
|
+
*/
|
|
254
|
+
templates?: ReadonlyMap<ConfigSetting, string>;
|
|
255
|
+
}
|
|
256
|
+
/** One template a file named, read: its name and its say on every setting. */
|
|
257
|
+
export interface TemplateLayer {
|
|
258
|
+
/** The name the file's `templates` key gave. */
|
|
259
|
+
readonly name: string;
|
|
260
|
+
/** Its value for each setting, or undefined where it said nothing. */
|
|
261
|
+
readonly values: ConfigLayer;
|
|
231
262
|
}
|
|
232
263
|
/** The layers {@link resolveConfig} ranks, highest first. */
|
|
233
264
|
export interface ConfigLayers {
|
|
234
265
|
/** Command-line values. Absent is the same as no flag given. */
|
|
235
266
|
cli?: ConfigOverrides;
|
|
267
|
+
/** The project's parsed local file, its `.rafa/config.yaml`, or null when there is none. */
|
|
268
|
+
local?: ConfigFile | null;
|
|
236
269
|
/** The project's parsed file, or null when there is none. */
|
|
237
270
|
file?: ConfigFile | null;
|
|
271
|
+
/** The user scope's parsed local file, or null when there is none. Its settings report `user`. */
|
|
272
|
+
userLocal?: ConfigFile | null;
|
|
238
273
|
/** The user scope's parsed file, or null when there is none. */
|
|
239
274
|
user?: ConfigFile | null;
|
|
240
275
|
}
|
|
@@ -246,21 +281,31 @@ export interface ResolvedConfig {
|
|
|
246
281
|
sources: Readonly<Record<ConfigSetting, ConfigSource>>;
|
|
247
282
|
/** The project's file consulted, or null when there was none. */
|
|
248
283
|
path: string | null;
|
|
284
|
+
/** The project's local file consulted, or null when there was none. */
|
|
285
|
+
localPath: string | null;
|
|
249
286
|
/** The user scope's file consulted, or null when there was none. */
|
|
250
287
|
userPath: string | null;
|
|
288
|
+
/** The user scope's local file consulted, its `~/.rafa/config.yaml`, or null when there was none. */
|
|
289
|
+
userLocalPath: string | null;
|
|
251
290
|
/** The project file's unknown keys, retained. Empty with no file. */
|
|
252
291
|
extras: readonly ConfigExtra[];
|
|
292
|
+
/** The project's local file's unknown keys, retained. Empty with no file. */
|
|
293
|
+
localExtras: readonly ConfigExtra[];
|
|
253
294
|
/** The user file's unknown keys, retained. Empty with no file. */
|
|
254
295
|
userExtras: readonly ConfigExtra[];
|
|
255
|
-
/**
|
|
296
|
+
/** The user scope's local file's unknown keys, retained. Empty with no file. */
|
|
297
|
+
userLocalExtras: readonly ConfigExtra[];
|
|
298
|
+
/**
|
|
299
|
+
* One sentence per retained unknown key, in layer order from the
|
|
300
|
+
* bottom: the user file's, the user's local file's, the project
|
|
301
|
+
* file's, then the project's local file's.
|
|
302
|
+
*/
|
|
256
303
|
warnings: readonly string[];
|
|
257
304
|
/**
|
|
258
305
|
* The file and entry that answered each setting, or null where the
|
|
259
306
|
* command line or a default did (`config-origins.ts`).
|
|
260
307
|
*/
|
|
261
308
|
provenance: Readonly<Record<ConfigSetting, SettingOrigin | null>>;
|
|
262
|
-
/** The YAML files a module file of their scope left unread. Empty here; `config-load.ts` fills it. */
|
|
263
|
-
shadowed: readonly ShadowedFile[];
|
|
264
309
|
}
|
|
265
310
|
/**
|
|
266
311
|
* A config the loop cannot run on: unreadable, not YAML, not a
|
|
@@ -300,14 +345,34 @@ export declare function parseConfigText(text: string, path: string): ConfigFile;
|
|
|
300
345
|
* the top is refused, and every key is judged. Pure; `path` only labels.
|
|
301
346
|
*/
|
|
302
347
|
export declare function readConfigDocument(parsed: unknown, path: string): ConfigFile;
|
|
348
|
+
/**
|
|
349
|
+
* `file` with each of `templates` laid under its own keys, in the order
|
|
350
|
+
* named, a later template over an earlier one: a setting the file left
|
|
351
|
+
* silent takes the last template's value that answers it, and a map
|
|
352
|
+
* setting merges by key, the templates under the file. Each setting a
|
|
353
|
+
* template answered and the file did not is recorded in
|
|
354
|
+
* {@link ConfigFile.templates} under that template's name. Pure; answers
|
|
355
|
+
* `file` itself when no template is given.
|
|
356
|
+
*
|
|
357
|
+
* @param file - The file as its own keys read.
|
|
358
|
+
* @param templates - The templates its `templates` key named, read.
|
|
359
|
+
* @returns The file with the templates' values beneath its own.
|
|
360
|
+
*/
|
|
361
|
+
export declare function layTemplatesUnder(file: ConfigFile, templates: readonly TemplateLayer[]): ConfigFile;
|
|
303
362
|
/**
|
|
304
363
|
* Ranks the layers: for each registered setting, the command line over
|
|
305
|
-
* the project's file,
|
|
306
|
-
* user's over
|
|
307
|
-
* `section.ts`).
|
|
364
|
+
* the project's local file, that over the project's file, that over the
|
|
365
|
+
* user scope's local file, that over the user scope's file, and that
|
|
366
|
+
* over its registered default (`activeDefaults()` in `section.ts`). A
|
|
367
|
+
* map setting merges by key in the reverse order, each file over the
|
|
368
|
+
* ones beneath it. A file's templates are already laid under it
|
|
369
|
+
* ({@link layTemplatesUnder}), so a setting one answered ranks with its
|
|
370
|
+
* file and reports `template`. Each setting's origin is read off the
|
|
371
|
+
* file that answered it ({@link originOf}), the highest one naming a map
|
|
372
|
+
* setting, so the two user files, both reporting `user`, name their own.
|
|
308
373
|
*
|
|
309
|
-
* Pure. Warnings come back as data — one per unknown key
|
|
310
|
-
* retained, the
|
|
374
|
+
* Pure. Warnings come back as data — one per unknown key any file
|
|
375
|
+
* retained, from the bottom layer up — and are never printed here. A command-line value no
|
|
311
376
|
* setting accepts throws a {@link ConfigError} naming every one, and
|
|
312
377
|
* is never downgraded to the file's value: an operator who mistyped a
|
|
313
378
|
* flag asked for something, and running on something else is the
|
|
@@ -21,7 +21,7 @@ export declare const SCOPE_DIR: string;
|
|
|
21
21
|
* rather than read off a value, since `isolatedDeclarations` asks every
|
|
22
22
|
* exported type to be written out.
|
|
23
23
|
*/
|
|
24
|
-
export type CoreSetting = 'version' | 'store' | 'effortBusyTimeoutMs' | 'effortSync' | 'inject' | 'planDir' | 'specsDir' | 'trackerDefault' | 'trackerFallback' | 'learningAdapter' | 'learningBlessMinConfidence' | 'learningPromoteAfter' | 'learningPromoteMinConfidence' | 'outputMode' | 'prerequisitesRequired' | 'prerequisitesOptional' | 'trackingSpecs' | 'trackingPlans' | 'trackingAll' | 'modules' | 'allowList' | 'settingSources' | 'loopWorktreeDir' | 'boardTrustedAuthors' | 'boardRelationships' | 'boardProjectTemplate' | 'boardProjectNumber' | 'roadmapIssue' | 'claimsStaleAfter' | 'claimsAhead' | 'cleanupStaleDays' | 'cleanupWorktreeIdleDays' | 'cleanupKeep' | 'dangerousAcceptStaleRefs' | 'dangerousSelfUpdateDuringLoop' | 'statusNotice' | 'tiersRafa' | 'tiersSkills' | 'tiersAgents' | 'routing' | 'taskSkills' | 'taskLessons' | 'mergeDuplicates' | 'namingBranch';
|
|
24
|
+
export type CoreSetting = 'version' | 'store' | 'effortBusyTimeoutMs' | 'effortSync' | 'inject' | 'planDir' | 'specsDir' | 'trackerDefault' | 'trackerFallback' | 'learningAdapter' | 'learningBlessMinConfidence' | 'learningPromoteAfter' | 'learningPromoteMinConfidence' | 'outputMode' | 'prerequisitesRequired' | 'prerequisitesOptional' | 'trackingSpecs' | 'trackingPlans' | 'trackingAll' | 'modules' | 'allowList' | 'settingSources' | 'loopWorktreeDir' | 'loopWorktreeSetup' | 'boardTrustedAuthors' | 'boardRelationships' | 'boardProjectTemplate' | 'boardProjectNumber' | 'roadmapIssue' | 'claimsStaleAfter' | 'claimsAhead' | 'cleanupStaleDays' | 'cleanupWorktreeIdleDays' | 'cleanupKeep' | 'dangerousAcceptStaleRefs' | 'dangerousSelfUpdateDuringLoop' | 'statusNotice' | 'tiersRafa' | 'tiersSkills' | 'tiersAgents' | 'routing' | 'taskSkills' | 'taskLessons' | 'mergeDuplicates' | 'namingBranch' | 'templates';
|
|
25
25
|
/** Core's section: its package, the spec and the default of each of its settings, and no check. */
|
|
26
26
|
export interface CoreSection extends ConfigSection {
|
|
27
27
|
/** Each of core's settings, by name, in the order problems are reported. */
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* rafa's routing defaults: which agent a task of each shape goes to
|
|
3
3
|
* when no config layer says otherwise.
|
|
4
4
|
*
|
|
5
|
-
* The table moved here from `src/tiers/routing.ts`, which re-exports
|
|
5
|
+
* The table moved here from `packages/rafa-inventory/src/tiers/routing.ts`, which re-exports
|
|
6
6
|
* each name, so `core-section.ts` reads {@link DEFAULT_ROUTING} without
|
|
7
7
|
* importing above core. What the rows mean, and why the map is one
|
|
8
8
|
* shared `Map` while the list is frozen, is `routing.ts`'s module note.
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
*
|
|
29
29
|
* `scope.ts` joined it with a scope's paths, `Scope`, the project the
|
|
30
30
|
* dispatcher resolved, `ProjectFound`, and `scopeAt`, whose walk,
|
|
31
|
-
* `resolveScope`, stays in `src/project/scope.ts`. It reads `config.ts`
|
|
31
|
+
* `resolveScope`, stays in `packages/rafa/src/project/scope.ts`. It reads `config.ts`
|
|
32
32
|
* and `core-section.ts` by value and `config-load.ts` as a type, so it
|
|
33
33
|
* is no leaf for `sections.ts`, and `load.ts` holds `config-load.ts`
|
|
34
34
|
* alone.
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
* imports the barrel back by value is a runtime cycle. None of the
|
|
47
47
|
* eight files behind this one imports outward by value:
|
|
48
48
|
* `core-section.ts` reads the routing defaults from `default-routing.ts`
|
|
49
|
-
* beside it, and `src/tiers/routing.ts` imports them from this barrel by
|
|
49
|
+
* beside it, and `packages/rafa-inventory/src/tiers/routing.ts` imports them from this barrel by
|
|
50
50
|
* value with nothing here importing it back. No file behind it
|
|
51
51
|
* imports a section file (`src/config-schema-*.ts`), by value or as a
|
|
52
52
|
* type: `config-merged.ts`, which spread the eleven into one schema,
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
*
|
|
70
70
|
* Measured again when core's keys moved into `core-section.ts`, on bun
|
|
71
71
|
* 1.3.14: each barrel, each of the five files, `section.ts`,
|
|
72
|
-
* `src/tiers/routing.ts` and each section file loaded first in a fresh
|
|
72
|
+
* `packages/rafa-inventory/src/tiers/routing.ts` and each section file loaded first in a fresh
|
|
73
73
|
* `bun` process, `SETTINGS` and `CONFIG_DEFAULTS` holding 89 entries and
|
|
74
74
|
* `CORE_SECTION` 42 each time. The control, `config-schema-hub.ts`
|
|
75
75
|
* reading `SETTINGS` off this barrel at load, threw `Cannot access
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
* the value imports of the five files behind this one reach no section
|
|
88
88
|
* file and not the registry, and each config barrel, each of the five
|
|
89
89
|
* files, `config-load.ts`, the registry, `packages/rafa/src/effort/store/settings.ts`,
|
|
90
|
-
* `src/tiers/routing.ts`, `packages/rafa/src/core/adapters/registry.ts` and each
|
|
90
|
+
* `packages/rafa-inventory/src/tiers/routing.ts`, `packages/rafa/src/core/adapters/registry.ts` and each
|
|
91
91
|
* section file loaded first in a fresh `bun` process, the registry then
|
|
92
92
|
* answering 89 registered settings and 89 defaults each time.
|
|
93
93
|
*
|
|
@@ -108,15 +108,19 @@
|
|
|
108
108
|
* `SECTIONS` and `knownKeysAbove`) is not here: a file outside
|
|
109
109
|
* `packages/rafa/src/core/` imports it from `src/config-registry.ts`, and core reads
|
|
110
110
|
* the registered settings, defaults and key indexes off `section.ts`.
|
|
111
|
+
* A feature file that reads the whole `CONFIG_DEFAULTS` or `SETTINGS`
|
|
112
|
+
* record without importing the registry takes `registeredDefaults()`
|
|
113
|
+
* or `registeredSettings()` from here, which answer the registered
|
|
114
|
+
* records typed whole.
|
|
111
115
|
* Neither are the hub's `HubContext` and `HubTimeout`, which a file
|
|
112
|
-
* imports from `src/config-schema-hub.ts`.
|
|
116
|
+
* imports from `packages/rafa/src/config-schema-hub.ts`.
|
|
113
117
|
*
|
|
114
118
|
* The published surface is narrower than this file. `src/index.ts`
|
|
115
119
|
* re-exports part of it, and of the runtime names leaves out core's
|
|
116
120
|
* section, the routing defaults, the item readers, `config.ts`'s two
|
|
117
121
|
* document readers the loader reads a scope through, and the section
|
|
118
122
|
* registry with its key indexes (`CORE_SECTION`, `moduleSource`, `registerConfigSections`,
|
|
119
|
-
* `activeSettingByKey` and
|
|
123
|
+
* `activeSettingByKey` and thirty-three more), which `src/index.test.ts`
|
|
120
124
|
* spells under `CONFIG_BARREL_ONLY`. Its `CONFIG_DEFAULTS` is
|
|
121
125
|
* `src/config-registry.ts`'s.
|
|
122
126
|
*
|
|
@@ -127,15 +131,15 @@
|
|
|
127
131
|
export type { ModuleSource, ModuleSourceKind, OptionalPrerequisiteItem, PrerequisiteItem, PrerequisiteKind, PrerequisiteScope, } from './config-items.js';
|
|
128
132
|
export type { CommandLineSetting, ConfigSetting, RafaConfig, SettingSpec, } from './config-schema.js';
|
|
129
133
|
export type { CoreSection, CoreSetting } from './core-section.js';
|
|
130
|
-
export type { ConfigCheck, ConfigCheckInput, ConfigLoadHook, ConfigSection, ConfigSectionRegistry, SettingsRecord, } from './section.js';
|
|
131
|
-
export type { ConfigFile, ConfigLayer, ConfigLayers, ConfigOverrides, ConfigSource, ResolvedConfig, } from './config.js';
|
|
134
|
+
export type { ConfigCheck, ConfigCheckInput, ConfigLoadHook, ConfigSection, ConfigSectionRegistry, ConfigTemplateHook, SettingsRecord, } from './section.js';
|
|
135
|
+
export type { ConfigFile, ConfigLayer, ConfigLayers, ConfigOverrides, ConfigSource, ResolvedConfig, TemplateLayer, } from './config.js';
|
|
132
136
|
export type { DangerousPhrases } from './dangerous.js';
|
|
133
137
|
export type { ProjectFound, Scope } from './scope.js';
|
|
134
138
|
export type { Route } from './default-routing.js';
|
|
135
139
|
export { MODULE_SOURCE_KEYS, MODULE_SOURCE_KINDS, moduleSource, OPTIONAL_ITEM_KEYS, optionalPrerequisite, PREREQUISITE_KINDS, REQUIRED_ITEM_KEYS, requiredPrerequisite, } from './config-items.js';
|
|
136
140
|
export { CONFIG_FILE, CORE_SECTION, SCOPE_DIR } from './core-section.js';
|
|
137
|
-
export { activeChecks, activeConfigLoadHook, activeDefaults, activeKnownKeysAbove, activeSectionPaths, activeSections, activeSettingByKey, activeSettings, ConfigSectionError, EMPTY_CONFIG_REGISTRY, mergeConfigSections, registerConfigSections, restoreConfigSections, setConfigLoadHook, } from './section.js';
|
|
138
|
-
export { ConfigError, configFilePath, parseConfigDocument, parseConfigText, readConfigDocument, resolveConfig, } from './config.js';
|
|
141
|
+
export { activeChecks, activeConfigLoadHook, activeConfigTemplateHook, activeDefaults, activeKnownKeysAbove, activeSectionPaths, activeSections, activeSettingByKey, activeSettings, ConfigSectionError, EMPTY_CONFIG_REGISTRY, mergeConfigSections, registerConfigSections, registeredDefaults, registeredSettings, restoreConfigSections, setConfigLoadHook, setConfigTemplateHook, } from './section.js';
|
|
142
|
+
export { ConfigError, configFilePath, layTemplatesUnder, parseConfigDocument, parseConfigText, readConfigDocument, resolveConfig, } from './config.js';
|
|
139
143
|
export { dangerousKeys, dangerousPassLines, dangerousPhrases, restoreDangerousPhrases, runWithDangerousPhrases, setDangerousPhrases, writeDangerousPassLines, } from './dangerous.js';
|
|
140
144
|
export { scopeAt } from './scope.js';
|
|
141
145
|
export { DEFAULT_ROUTES, DEFAULT_ROUTING } from './default-routing.js';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a pull request is merged: the {@link MergeMethod} words, the
|
|
3
|
+
* {@link MERGE_METHODS} list a reader validates against and the
|
|
4
|
+
* {@link isMergeMethod} guard.
|
|
5
|
+
*
|
|
6
|
+
* They sat in `packages/rafa/src/pr/types.ts`, the pull request port, until the
|
|
7
|
+
* monorepo cut: the `pr.mergeMethod` setting in
|
|
8
|
+
* `packages/rafa/src/config-schema-release.ts` read them there, which tied the
|
|
9
|
+
* release section to `src/pr/`. Here they are a core leaf, importing
|
|
10
|
+
* nothing, so the section and the port both read them from the sections
|
|
11
|
+
* barrel `./sections.ts`, and `packages/rafa/src/pr/types.ts` re-exports them under
|
|
12
|
+
* the same names for the port's own importers.
|
|
13
|
+
*
|
|
14
|
+
* The setting's reader, `mergeMethod`, stays in
|
|
15
|
+
* `packages/rafa/src/config-schema-release.ts` beside the one setting that reads it:
|
|
16
|
+
* this file holds the words, not a reading of the config.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* How a merge is made. GitHub's three, and no other: `gh pr merge`
|
|
20
|
+
* takes exactly `--squash`, `--merge` and `--rebase`, and a provider
|
|
21
|
+
* that cannot do one of them refuses the call rather than substituting
|
|
22
|
+
* another, which would rewrite history the operator did not ask for.
|
|
23
|
+
*/
|
|
24
|
+
export type MergeMethod = 'squash' | 'merge' | 'rebase';
|
|
25
|
+
/**
|
|
26
|
+
* The merge methods, in the order a refusal lists them.
|
|
27
|
+
*
|
|
28
|
+
* A runtime value beside the type so the config reader and the
|
|
29
|
+
* `--method` flag validate against one list rather than each spelling
|
|
30
|
+
* the three words again. Frozen: a caller that pushed onto it would
|
|
31
|
+
* change what every later refusal says it accepts.
|
|
32
|
+
*/
|
|
33
|
+
export declare const MERGE_METHODS: readonly MergeMethod[];
|
|
34
|
+
/**
|
|
35
|
+
* Whether a value is one of {@link MERGE_METHODS}.
|
|
36
|
+
*
|
|
37
|
+
* @param value - Anything, a flag's value or a config reading.
|
|
38
|
+
* @returns True when the value is exactly one of the three words.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isMergeMethod(value: unknown): value is MergeMethod;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* One scope's paths, and the project the dispatcher resolved: the
|
|
3
|
-
* shapes `resolveScope` answers in `src/project/scope.ts`, and
|
|
3
|
+
* shapes `resolveScope` answers in `packages/rafa/src/project/scope.ts`, and
|
|
4
4
|
* {@link scopeAt}, which builds a scope from its base directory.
|
|
5
5
|
*
|
|
6
6
|
* The walk itself, `resolveScope` with its refusals and its hint, stays
|
|
7
|
-
* in `src/project/scope.ts`, which imports these names from the config
|
|
7
|
+
* in `packages/rafa/src/project/scope.ts`, which imports these names from the config
|
|
8
8
|
* barrel and re-exports them under the same names. Core holds the
|
|
9
9
|
* shapes alone, so `RafaContext` can name the project a command runs in
|
|
10
10
|
* and the session store can find a project's `.rafa` directory without
|
|
@@ -13,6 +13,12 @@
|
|
|
13
13
|
* sections lives outside `packages/rafa/src/core/`, in `src/config-registry.ts`, the
|
|
14
14
|
* module that calls {@link registerConfigSections}.
|
|
15
15
|
*
|
|
16
|
+
* {@link registeredDefaults} and {@link registeredSettings} answer the
|
|
17
|
+
* same two records typed whole, as {@link RafaConfig} and
|
|
18
|
+
* {@link SettingsRecord}, for a feature file that reads a default or a
|
|
19
|
+
* spec without importing that module; each refuses with a
|
|
20
|
+
* {@link ConfigSectionError} naming it while nothing is registered.
|
|
21
|
+
*
|
|
16
22
|
* This file imports types alone, so it loads first in any order and can
|
|
17
23
|
* be imported by value from the loader and from every section file
|
|
18
24
|
* without closing a runtime cycle.
|
|
@@ -91,7 +97,7 @@
|
|
|
91
97
|
*
|
|
92
98
|
* A setting core resolves can be read by a module outside `packages/rafa/src/core/`
|
|
93
99
|
* that core must not import: the logger's settings are read through
|
|
94
|
-
* `loggerSettingsOf` in `src/config-schema-logger.ts`. So the module that
|
|
100
|
+
* `loggerSettingsOf` in `packages/rafa/src/config-schema-logger.ts`. So the module that
|
|
95
101
|
* lists the sections also hands core one {@link ConfigLoadHook} with
|
|
96
102
|
* {@link setConfigLoadHook}, and `loadConfig` (`config-load.ts`) calls
|
|
97
103
|
* {@link activeConfigLoadHook} with every config it resolves, before it
|
|
@@ -99,8 +105,28 @@
|
|
|
99
105
|
* own, beside the registry rather than in it: restoring a registry
|
|
100
106
|
* leaves the hook as it was, and a case that sets one puts the previous
|
|
101
107
|
* hook back in a `finally`, as a case that registers does.
|
|
108
|
+
*
|
|
109
|
+
* ## The template hook
|
|
110
|
+
*
|
|
111
|
+
* A config template is a named entry a file adopts with its `templates`
|
|
112
|
+
* key, and the templates live outside `packages/rafa/src/core/` too,
|
|
113
|
+
* in `src/config/templates.ts`, which core must not import. So core
|
|
114
|
+
* takes one {@link ConfigTemplateHook} through
|
|
115
|
+
* {@link setConfigTemplateHook}, for the module that lists the sections
|
|
116
|
+
* to set, and answers it off {@link activeConfigTemplateHook} for the
|
|
117
|
+
* loader to call by name. The hook answers the entry a name
|
|
118
|
+
* stands for, a mapping nested as a file nests its keys (the shape of a
|
|
119
|
+
* `ConfigEntry`, `src/config/entry.ts`, typed here as a plain
|
|
120
|
+
* {@link Mapping} since core imports nothing from `src/config/`), or null
|
|
121
|
+
* for a name it does not know, and may carry the `names` it knows, which
|
|
122
|
+
* the loader lists when it refuses a name. Like the load hook it is a module-level
|
|
123
|
+
* value of its own, beside the registry: restoring a registry leaves it
|
|
124
|
+
* as it was, and a case that sets one puts the previous hook back in a
|
|
125
|
+
* `finally`.
|
|
102
126
|
*/
|
|
127
|
+
import type { SettingOrigin } from './config-origins.js';
|
|
103
128
|
import type { ConfigSetting, RafaConfig, SettingSpec } from './config-schema.js';
|
|
129
|
+
import type { Mapping } from './config-sections.js';
|
|
104
130
|
import type { ConfigSource } from './config.js';
|
|
105
131
|
/** Every setting's spec, by name: the record a section hands a part of. */
|
|
106
132
|
export type SettingsRecord = {
|
|
@@ -116,6 +142,13 @@ export interface ConfigCheckInput {
|
|
|
116
142
|
readonly path: string | null;
|
|
117
143
|
/** The user scope's file consulted, or null when there was none. */
|
|
118
144
|
readonly userPath: string | null;
|
|
145
|
+
/**
|
|
146
|
+
* The file and entry that answered each setting, null where the
|
|
147
|
+
* command line or a default did: the one reading that tells a scope's
|
|
148
|
+
* local file from its module file, and the user scope's two files,
|
|
149
|
+
* which both report `user`, apart.
|
|
150
|
+
*/
|
|
151
|
+
readonly provenance: Readonly<Record<ConfigSetting, SettingOrigin | null>>;
|
|
119
152
|
}
|
|
120
153
|
/**
|
|
121
154
|
* A cross-key refusal: the problems the resolved config holds, one
|
|
@@ -178,6 +211,31 @@ export declare function activeSettings(): Readonly<Partial<SettingsRecord>>;
|
|
|
178
211
|
export declare function activeDefaults(): Readonly<Partial<RafaConfig>>;
|
|
179
212
|
/** Every registered section's checks, in registration order. */
|
|
180
213
|
export declare function activeChecks(): readonly ConfigCheck[];
|
|
214
|
+
/**
|
|
215
|
+
* Every setting's default, typed as the whole {@link RafaConfig}: the
|
|
216
|
+
* active registry's defaults, the same object {@link activeDefaults}
|
|
217
|
+
* answers, for a file outside `packages/rafa/src/core/` that reads a
|
|
218
|
+
* default without importing the module that lists the sections.
|
|
219
|
+
*
|
|
220
|
+
* Throws a {@link ConfigSectionError} naming `src/config-registry.ts`
|
|
221
|
+
* while no section is registered, as `loadConfig` refuses then. Types
|
|
222
|
+
* are erased at runtime, so core cannot list the {@link ConfigSetting}
|
|
223
|
+
* names and refuses an empty registry alone: the completeness rule
|
|
224
|
+
* pairs every registered setting with its default, and
|
|
225
|
+
* `src/config-registry.test.ts` holds what the registration answers
|
|
226
|
+
* here equal to the registry's whole `CONFIG_DEFAULTS`. Read it when a
|
|
227
|
+
* default is needed, never as a module loads: an entry registers after
|
|
228
|
+
* its imports have loaded.
|
|
229
|
+
*/
|
|
230
|
+
export declare function registeredDefaults(): Readonly<RafaConfig>;
|
|
231
|
+
/**
|
|
232
|
+
* Every setting's spec, typed as the whole {@link SettingsRecord}: the
|
|
233
|
+
* active registry's settings, the same object {@link activeSettings}
|
|
234
|
+
* answers. Refuses as {@link registeredDefaults} does, on the same
|
|
235
|
+
* reading, and `src/config-registry.test.ts` holds it equal to the
|
|
236
|
+
* registry's whole `SETTINGS`.
|
|
237
|
+
*/
|
|
238
|
+
export declare function registeredSettings(): SettingsRecord;
|
|
181
239
|
/** Every registered setting's name, by the dotted key a file spells it with. */
|
|
182
240
|
export declare function activeSettingByKey(): ReadonlyMap<string, ConfigSetting>;
|
|
183
241
|
/** Every dotted prefix a registered setting sits under: the sections a file opens. */
|
|
@@ -204,3 +262,25 @@ export type ConfigLoadHook = (config: Readonly<RafaConfig>) => void;
|
|
|
204
262
|
export declare function setConfigLoadHook(hook: ConfigLoadHook | null): ConfigLoadHook | null;
|
|
205
263
|
/** The hook `loadConfig` calls with every config it resolves, or null when none is set. */
|
|
206
264
|
export declare function activeConfigLoadHook(): ConfigLoadHook | null;
|
|
265
|
+
/**
|
|
266
|
+
* The entry a config template's name stands for, a mapping nested as a
|
|
267
|
+
* file nests its keys, or null for a name the hook does not know. See
|
|
268
|
+
* "The template hook" in the module note.
|
|
269
|
+
*/
|
|
270
|
+
export interface ConfigTemplateHook {
|
|
271
|
+
/** The entry `name` stands for, or null for a name the hook does not know. */
|
|
272
|
+
(name: string): Mapping | null;
|
|
273
|
+
/**
|
|
274
|
+
* Every name the hook knows, which `loadConfig` lists when it refuses
|
|
275
|
+
* one a file gives. Absent from a hook that cannot list its names.
|
|
276
|
+
*/
|
|
277
|
+
readonly names?: readonly string[];
|
|
278
|
+
}
|
|
279
|
+
/**
|
|
280
|
+
* Makes `hook` the one core reads a config template's entry from, or
|
|
281
|
+
* clears it with null. Answers the hook it replaced, for a caller to put
|
|
282
|
+
* back.
|
|
283
|
+
*/
|
|
284
|
+
export declare function setConfigTemplateHook(hook: ConfigTemplateHook | null): ConfigTemplateHook | null;
|
|
285
|
+
/** The hook core reads a config template's entry from, or null when none is set. */
|
|
286
|
+
export declare function activeConfigTemplateHook(): ConfigTemplateHook | null;
|