@open-tomato/rafa 0.45.0 → 0.46.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 +255 -23
- package/dist/PROMPT.md +18 -1
- package/dist/adapters/logger/settings.d.ts +132 -0
- package/dist/bugs/closest.d.ts +19 -0
- package/dist/bugs/fenced.d.ts +8 -0
- package/dist/bugs/places.d.ts +20 -0
- package/dist/bugs/record.d.ts +145 -0
- package/dist/bugs/title.d.ts +83 -0
- package/dist/bundled/agents/doc-updater.md +17 -3
- package/dist/bundled/agents/loop-implementer.md +14 -2
- package/dist/bundled/operators/skills/rafa-stretch-pit-stop/SKILL.md +10 -3
- package/dist/bundled/operators/skills/rafa-stretch-sweep/SKILL.md +5 -0
- package/dist/bundled/skills/dev-planner/SKILL.md +101 -18
- package/dist/cli.js +74726 -62960
- package/dist/config/entry.d.ts +119 -0
- package/dist/config/index.d.ts +36 -0
- package/dist/config/index.js +51 -0
- package/dist/config/shape.d.ts +232 -0
- package/dist/config-registry.d.ts +127 -0
- package/dist/config-schema-board-project.d.ts +157 -0
- package/dist/config-schema-bugs.d.ts +71 -0
- package/dist/config-schema-errors.d.ts +54 -0
- package/dist/config-schema-features.d.ts +64 -0
- package/dist/config-schema-hub.d.ts +150 -0
- package/dist/config-schema-issues.d.ts +95 -0
- package/dist/config-schema-logger.d.ts +91 -0
- package/dist/config-schema-loop-continue.d.ts +122 -0
- package/dist/config-schema-loop-retries.d.ts +94 -0
- package/dist/config-schema-release.d.ts +307 -0
- package/dist/config-schema-tests.d.ts +170 -0
- package/dist/config-schema-triage.d.ts +142 -0
- package/dist/config-schema-wrap-up.d.ts +96 -0
- package/dist/core/command/command.d.ts +228 -0
- package/dist/core/command/confirm.d.ts +67 -0
- package/dist/core/command/index.d.ts +112 -0
- package/dist/core/command/lazy.d.ts +54 -0
- package/dist/core/command/registry-types.d.ts +96 -0
- package/dist/core/command/running.d.ts +96 -0
- package/dist/core/command/spends.d.ts +39 -0
- package/dist/core/command/types.d.ts +92 -0
- package/dist/core/command/version.d.ts +4 -0
- package/dist/core/config/branch-template.d.ts +20 -0
- package/dist/core/config/config-items.d.ts +86 -0
- package/dist/core/config/config-load.d.ts +47 -0
- package/dist/core/config/config-origins.d.ts +57 -0
- package/dist/core/config/config-readers.d.ts +167 -0
- package/dist/core/config/config-schema.d.ts +207 -0
- package/dist/core/config/config-sections.d.ts +493 -0
- package/dist/core/config/config.d.ts +320 -0
- package/dist/core/config/core-section.d.ts +39 -0
- package/dist/core/config/dangerous.d.ts +58 -0
- package/dist/core/config/default-routing.d.ts +16 -0
- package/dist/core/config/index.d.ts +141 -0
- package/dist/core/config/scope.d.ts +42 -0
- package/dist/core/config/section.d.ts +206 -0
- package/dist/core/config/sections.d.ts +45 -0
- package/dist/core/config/standard-schema.d.ts +27 -0
- package/dist/core/git/commit.d.ts +232 -0
- package/dist/core/git/gh-runner.d.ts +24 -0
- package/dist/core/git/git.d.ts +22 -0
- package/dist/core/git/index.d.ts +85 -0
- package/dist/core/loop/claude.d.ts +388 -0
- package/dist/core/loop/hop-record.d.ts +52 -0
- package/dist/core/loop/index.d.ts +179 -0
- package/dist/core/loop/session-env.d.ts +20 -0
- package/dist/core/loop/session-record-parse.d.ts +63 -0
- package/dist/core/loop/sessions.d.ts +408 -0
- package/dist/core/loop/suite-failure.d.ts +25 -0
- package/dist/core/output/active.d.ts +100 -0
- package/dist/core/output/stream.d.ts +20 -0
- package/dist/core/output/text.d.ts +55 -0
- package/dist/core/plan/block-reader.d.ts +46 -0
- package/dist/core/plan/blocks.d.ts +139 -0
- package/dist/core/plan/declaration.d.ts +366 -0
- package/dist/core/plan/plan-stamp.d.ts +75 -0
- package/dist/core/runtime/identity.d.ts +21 -0
- package/dist/core/runtime/index.d.ts +46 -0
- package/dist/effort/store/bring-forward.d.ts +131 -0
- package/dist/effort/store/check-rows.d.ts +31 -0
- package/dist/effort/store/commit-stats.d.ts +42 -0
- package/dist/effort/store/copy.d.ts +35 -0
- package/dist/effort/store/development-build.d.ts +105 -0
- package/dist/effort/store/effort-levels.d.ts +13 -0
- package/dist/effort/store/findings.d.ts +214 -0
- package/dist/effort/store/fix-schema.d.ts +184 -0
- package/dist/effort/store/index.js +10 -7
- package/dist/effort/store/location.d.ts +44 -0
- package/dist/effort/store/merge-commit-gaps.d.ts +68 -0
- package/dist/effort/store/merge-conflicts.d.ts +91 -0
- package/dist/effort/store/merge-rules.d.ts +82 -0
- package/dist/effort/store/merge-store.d.ts +211 -0
- package/dist/effort/store/merge-union.d.ts +92 -0
- package/dist/effort/store/migrate.d.ts +146 -0
- package/dist/effort/store/migrations.d.ts +92 -0
- package/dist/effort/store/ndjson-files.d.ts +114 -0
- package/dist/effort/store/origins.d.ts +116 -0
- package/dist/effort/store/plan-stubs.d.ts +79 -0
- package/dist/effort/store/rebuild-aside.d.ts +172 -0
- package/dist/effort/store/schema-plan.d.ts +102 -0
- package/dist/effort/store/session-row-types.d.ts +64 -0
- package/dist/effort/store/settings.d.ts +13 -0
- package/dist/effort/store/sqlite.d.ts +340 -0
- package/dist/effort/store/store-generation.d.ts +17 -0
- package/dist/effort/store/store-identity.d.ts +220 -0
- package/dist/effort/store/store-meta.d.ts +305 -0
- package/dist/effort/store/store-replaced.d.ts +72 -0
- package/dist/effort/store/types.d.ts +223 -0
- package/dist/errors/codes.d.ts +56 -0
- package/dist/errors/rafa-codes.d.ts +36 -0
- package/dist/index-2a7nb3an.js +125 -0
- package/dist/{index-r28fzsvc.js → index-39kbcw68.js} +350 -165
- package/dist/{index-nv34ptht.js → index-77ajfffn.js} +14 -9
- package/dist/index-cy98y87p.js +2597 -0
- package/dist/index-gqz4jn6j.js +13447 -0
- package/dist/index-gvek4r8m.js +710 -0
- package/dist/index-j4k2vdz3.js +1125 -0
- package/dist/index-jh1r4kcn.js +1067 -0
- package/dist/{index-mgh2s9bj.js → index-ykggr043.js} +58 -455
- package/dist/index-z1w83f81.js +4 -0
- package/dist/index.js +14715 -21516
- package/dist/learning/index.js +5 -6
- package/dist/plan/index.js +12 -11
- package/dist/plan-prompt.md +3 -1
- package/dist/ports/index.d.ts +732 -0
- package/dist/ports/learning.d.ts +101 -0
- package/dist/ports/log-level.d.ts +13 -0
- package/dist/ports/spec-review.d.ts +66 -0
- package/dist/pr/checks.d.ts +133 -0
- package/dist/pr/types.d.ts +422 -0
- package/dist/ready-4f8edezt.js +2016 -0
- package/dist/release-templates/release-bot-fragment.yml +153 -0
- package/dist/release-templates/release-publish.yml +110 -0
- package/dist/release-templates/release-settle.yml +122 -0
- package/dist/release-templates/release-tag.yml +102 -0
- package/dist/report/parse.d.ts +415 -0
- package/dist/schema/project-id.d.ts +79 -0
- package/dist/schema/tiers.d.ts +107 -0
- package/package.json +41 -3
- package/dist/index-hf2k497d.js +0 -16
- package/dist/index-nsr78ct2.js +0 -8219
|
@@ -0,0 +1,493 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The value readers behind `config.ts`: one per shape a setting takes,
|
|
3
|
+
* and the closed lists of values a setting accepts. The two item shapes
|
|
4
|
+
* the schema's lists hold, a prerequisite item and a module source, are
|
|
5
|
+
* read in `config-items.ts`, through the reading helpers exported here.
|
|
6
|
+
*
|
|
7
|
+
* `config.ts` owns the file: its sections, its keys, the layers and how
|
|
8
|
+
* they rank. For each setting it asks this module one question: is this
|
|
9
|
+
* raw value one the setting accepts, and if so, what is it? Every rule
|
|
10
|
+
* about a VALUE lives here, apart from the rules about KEYS, and
|
|
11
|
+
* `config.ts` stays under the size cap.
|
|
12
|
+
*
|
|
13
|
+
* The file is `config-sections.ts` and not `config/index.ts` on purpose.
|
|
14
|
+
* While both sat in `src/`, `./config.js` resolved to `src/config.ts`
|
|
15
|
+
* (now `packages/rafa/src/core/config/config.ts`), and a `src/config/` directory
|
|
16
|
+
* beside it would have set the trap `context/source.md` records for
|
|
17
|
+
* `./plan`.
|
|
18
|
+
*
|
|
19
|
+
* ## What a reader answers
|
|
20
|
+
*
|
|
21
|
+
* A {@link Reader} takes the raw value, as the YAML parser returned it
|
|
22
|
+
* or as a command line passed it, and a {@link ValueAt} saying where
|
|
23
|
+
* that value sits. It answers a {@link Reading}: the value, or undefined
|
|
24
|
+
* with every problem named, plus any unknown key an item carried. A
|
|
25
|
+
* reader never throws and never prints, because `config.ts` collects the
|
|
26
|
+
* problems of every setting before it refuses, so one run names all of
|
|
27
|
+
* them.
|
|
28
|
+
*
|
|
29
|
+
* A problem is one sentence opening with the label it was handed, so
|
|
30
|
+
* one reader serves the file (`/repo/.rafa/config.yaml: tracker.default`)
|
|
31
|
+
* and the command line (`command line: trackerDefault`). A list item's
|
|
32
|
+
* label and key gain its index: `prerequisites.required[1]`.
|
|
33
|
+
*
|
|
34
|
+
* ## Rules every reader keeps
|
|
35
|
+
*
|
|
36
|
+
* - Nothing is coerced. `tracker.fallback: local` is not read as
|
|
37
|
+
* `[local]`, and `tracking.all: "true"` is not read as `true`.
|
|
38
|
+
* Guessing what the operator meant is the silent choice `config.ts`
|
|
39
|
+
* refuses.
|
|
40
|
+
* - A string names something only when it holds a character other
|
|
41
|
+
* than whitespace. It is kept as written, never trimmed.
|
|
42
|
+
* - A key an item carries is matched against a list with `===`,
|
|
43
|
+
* never with `in` or an object index. The parser keeps a key spelled
|
|
44
|
+
* `toString`, `constructor` or `__proto__` as an ordinary own key,
|
|
45
|
+
* and `'toString' in item` is true for every mapping. Measured on
|
|
46
|
+
* bun 1.3.14: an item carrying `__proto__: x` beside `tool: bun`
|
|
47
|
+
* holds both as own keys, and its prototype stays `Object.prototype`.
|
|
48
|
+
* - Every list a reader answers is frozen, and so is every item in
|
|
49
|
+
* it. A value one caller holds cannot be edited for the next.
|
|
50
|
+
* - A null optional key in an item (`probe:` above a commented-out
|
|
51
|
+
* command) says nothing, as a null setting says nothing in
|
|
52
|
+
* `config.ts`. A null kind key (`- tool:`) names no tool and is
|
|
53
|
+
* refused.
|
|
54
|
+
* - A key an item does not read is retained as a {@link ConfigExtra}
|
|
55
|
+
* under its path (`prerequisites.optional[0].timeout`), for
|
|
56
|
+
* `config.ts` to warn about, never refused. That is the rule
|
|
57
|
+
* `config.ts` keeps for unknown keys, applied one level down.
|
|
58
|
+
*
|
|
59
|
+
* ## The `dangerous` section
|
|
60
|
+
*
|
|
61
|
+
* A setting under `dangerous:` turns a refusal off on every run, so it
|
|
62
|
+
* is read as strictly as any: `dangerous.acceptStaleRefs` and
|
|
63
|
+
* `dangerous.selfUpdateDuringLoop` go through {@link flag}, the reader every `tracking` key takes, and no reader of
|
|
64
|
+
* its own. That is on purpose. A reader that took `yes`, `"true"` or
|
|
65
|
+
* `1` as true would let a spelling nobody meant as an answer switch
|
|
66
|
+
* check 4 of the readiness gate off, which is the one reading this
|
|
67
|
+
* section must never make by guessing. The section holds no closed
|
|
68
|
+
* list and no item shape, so nothing else here names it.
|
|
69
|
+
*
|
|
70
|
+
* ## The `tiers` section
|
|
71
|
+
*
|
|
72
|
+
* `.rafa/specs/rafa-26-skill-tiers.md` spells `tiers.rafa` as `on` or
|
|
73
|
+
* `off`, and `tiers.skills` and `tiers.agents` as maps of a name to
|
|
74
|
+
* `false` or a tier. {@link tierSwitch} reads the first and
|
|
75
|
+
* {@link tierPin} one value of the other two; the map around it is
|
|
76
|
+
* `config-readers.ts`'s `mapOf`, because what that reader rules on is a
|
|
77
|
+
* key. Three readings are this module's:
|
|
78
|
+
*
|
|
79
|
+
* - `tiers.rafa` takes the WORDS `on` and `off`, as the spec writes
|
|
80
|
+
* them, and not the booleans. `Bun.YAML.parse` answers both words
|
|
81
|
+
* as strings (see {@link ReleaseEnabled}), so a file spelling
|
|
82
|
+
* `rafa: off` reaches the reader as `off`, and `rafa: false` is
|
|
83
|
+
* refused and told what to write, since nothing is coerced.
|
|
84
|
+
* - A pin is the boolean `false`, which turns the item off in every
|
|
85
|
+
* tier, or one of the three tiers, which names the holder that
|
|
86
|
+
* serves it. `true` is refused: an item is on unless something
|
|
87
|
+
* turns it off, so `true` would say nothing, and a value that says
|
|
88
|
+
* nothing is not one a person meant to write.
|
|
89
|
+
* - A null pin, a name written with nothing after it, is refused and
|
|
90
|
+
* not read as silence. It is the `- tool:` of a map: a name that
|
|
91
|
+
* pins nothing, where silence is the name left out.
|
|
92
|
+
*
|
|
93
|
+
* ## The `routing` setting
|
|
94
|
+
*
|
|
95
|
+
* The spec spells `routing` as a map of a task shape to an agent.
|
|
96
|
+
* {@link routeTarget} reads one value; the map around it is `mapOf`
|
|
97
|
+
* again, and the defaults are `default-routing.ts`'s. Two readings are
|
|
98
|
+
* this module's:
|
|
99
|
+
*
|
|
100
|
+
* - A value is an agent name, any non-empty string, or `false`, a
|
|
101
|
+
* shape routed nowhere, as `false` turns an item off in
|
|
102
|
+
* `tiers.skills`. Whether the name is an agent anything defines is
|
|
103
|
+
* a question for the tier resolver the spec plans, never for a
|
|
104
|
+
* reader. So a quoted `"false"` is read as a name and not coerced
|
|
105
|
+
* to `false`.
|
|
106
|
+
* - `true` and null are refused, as for a pin: `true` names no agent,
|
|
107
|
+
* and a shape with nothing after it routes nothing, where silence
|
|
108
|
+
* is the shape left out.
|
|
109
|
+
*
|
|
110
|
+
* ## The `task` section
|
|
111
|
+
*
|
|
112
|
+
* `task.skills` names the resolver that picks a task's skills at
|
|
113
|
+
* dispatch, and `task.lessons` whether blessed lessons join its prompt.
|
|
114
|
+
* {@link skillResolverName} reads the first and {@link lessonSwitch}
|
|
115
|
+
* the second, each a closed list declared here. Two readings are this
|
|
116
|
+
* module's:
|
|
117
|
+
*
|
|
118
|
+
* - `task.skills` takes `planner`, `tag` or `none` and nothing else.
|
|
119
|
+
* Which resolver runs under each name is `task/resolve-skills.ts`'s
|
|
120
|
+
* to say. A name outside the list, `model` included, is refused
|
|
121
|
+
* here, where a person can still fix the file, and not left for
|
|
122
|
+
* dispatch to find.
|
|
123
|
+
* - `task.lessons` takes the WORDS `on` and `off`, as `tiers.rafa`
|
|
124
|
+
* does and for the same reason: `Bun.YAML.parse` answers both as
|
|
125
|
+
* strings, so `lessons: false` is refused and told what to write.
|
|
126
|
+
* It has a list of its own rather than {@link TIER_SWITCHES},
|
|
127
|
+
* since the two settings share a spelling and not a meaning.
|
|
128
|
+
*
|
|
129
|
+
* ## The `claims` section
|
|
130
|
+
*
|
|
131
|
+
* `claims.staleAfter` is how long a `rafa:claimed` claim stands before
|
|
132
|
+
* another device may take it over; `claims.ahead` whether a claim may
|
|
133
|
+
* reach one issue ahead. {@link claimsStaleAfter} reads the first and
|
|
134
|
+
* {@link claimsAhead} the second. Three readings are this module's:
|
|
135
|
+
*
|
|
136
|
+
* - A duration is whole digits then `h` or `d`, and nothing else:
|
|
137
|
+
* `1.5d`, `3w`, `3D` and ` 3d` are refused, and so is the bare
|
|
138
|
+
* number `3`, which names no unit. It is kept as written, and
|
|
139
|
+
* {@link claimDurationHours} answers the hours it spells.
|
|
140
|
+
* - `0h`, `0d` and anything below are refused and not read as "off":
|
|
141
|
+
* a claim stale at once is one any device takes over, and `disabled`
|
|
142
|
+
* is already the word for off.
|
|
143
|
+
* - `claims.ahead` takes the WORDS `off` and `allow`, so
|
|
144
|
+
* `ahead: false` is refused and told what to write.
|
|
145
|
+
*
|
|
146
|
+
* ## The lists this module does not own
|
|
147
|
+
*
|
|
148
|
+
* Every other closed list here is declared here. Two are not, because
|
|
149
|
+
* another module is already their authority and a second spelling could
|
|
150
|
+
* disagree with it:
|
|
151
|
+
*
|
|
152
|
+
* - The three tiers a pin names are `schema/tiers.ts`'s
|
|
153
|
+
* {@link SKILL_TIERS}, the order a listing reads them in. That
|
|
154
|
+
* module imports `node:fs` and `node:path` alone, so reaching it
|
|
155
|
+
* here is no cycle.
|
|
156
|
+
* - The shape {@link usdAmount} accepts is `parseBudgetUsd`'s
|
|
157
|
+
* (`core/plan/declaration.ts`), which is what a plan's `budget=` goes
|
|
158
|
+
* through and therefore what `--max-budget-usd` has been measured
|
|
159
|
+
* against. The reader asks it about `String(raw)`, so a config
|
|
160
|
+
* value is accepted only when the number the loop would pass on
|
|
161
|
+
* survives that round trip: `.inf`, `.nan`, `1e21` and `1e-7` are
|
|
162
|
+
* each a number the parser returns and `String` writes as something
|
|
163
|
+
* the flag never takes.
|
|
164
|
+
*
|
|
165
|
+
* `core/plan/declaration.ts` imports only the store's `effort-levels.ts`,
|
|
166
|
+
* which imports nothing, so this module reaches it without its reaching
|
|
167
|
+
* back.
|
|
168
|
+
*
|
|
169
|
+
* The range {@link confidence} accepts, {@link CONFIDENCE_MIN} to
|
|
170
|
+
* {@link CONFIDENCE_MAX}, is declared here and not read from the
|
|
171
|
+
* learning library: core imports nothing above it, and `src/learning/`
|
|
172
|
+
* imports nothing from the rest of `src/`, so each declares the pair the
|
|
173
|
+
* library clamps every lesson's confidence to, and
|
|
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
|
+
* methods, is not here: it sits with the setting it reads, in
|
|
178
|
+
* `config-schema-release.ts`, so no core file imports `pr/types.ts`.
|
|
179
|
+
*/
|
|
180
|
+
import type { SkillTier } from '../../schema/tiers.js';
|
|
181
|
+
/** One key a file carried that names nothing this version reads. */
|
|
182
|
+
export interface ConfigExtra {
|
|
183
|
+
/**
|
|
184
|
+
* Its path from the top of the file: `nonesuch`, `plan.depth`,
|
|
185
|
+
* `prerequisites.required[0].timeout`.
|
|
186
|
+
*/
|
|
187
|
+
key: string;
|
|
188
|
+
/**
|
|
189
|
+
* The value exactly as the parser returned it. Never serialised
|
|
190
|
+
* here: a YAML alias can make it cyclic.
|
|
191
|
+
*/
|
|
192
|
+
value: unknown;
|
|
193
|
+
}
|
|
194
|
+
/** Where a value sits, as a problem and an extra name it. */
|
|
195
|
+
export interface ValueAt {
|
|
196
|
+
/** What a problem opens with: `<file>: tracker.default`. */
|
|
197
|
+
label: string;
|
|
198
|
+
/** The path an unknown key inside the value is retained under. */
|
|
199
|
+
key: string;
|
|
200
|
+
}
|
|
201
|
+
/** What a reader made of one raw value. */
|
|
202
|
+
export interface Reading<T> {
|
|
203
|
+
/** The value read, or undefined when a problem refused it. */
|
|
204
|
+
value: T | undefined;
|
|
205
|
+
/** One sentence per problem, each opening with the label. */
|
|
206
|
+
problems: readonly string[];
|
|
207
|
+
/** Keys inside the value that name nothing, retained. */
|
|
208
|
+
extras: readonly ConfigExtra[];
|
|
209
|
+
}
|
|
210
|
+
/** Reads one raw value; see the module note. */
|
|
211
|
+
export type Reader<T> = (raw: unknown, at: ValueAt) => Reading<T>;
|
|
212
|
+
/** A plain mapping, as the parser returns one. */
|
|
213
|
+
export type Mapping = Readonly<Record<string, unknown>>;
|
|
214
|
+
/** True for a mapping; false for a list, a scalar or null. */
|
|
215
|
+
export declare function isMapping(value: unknown): value is Mapping;
|
|
216
|
+
/** A value as a refusal quotes it. Never serialises a collection. */
|
|
217
|
+
export declare function describeValue(value: unknown): string;
|
|
218
|
+
/** The message of whatever was thrown, for a refusal to quote. */
|
|
219
|
+
export declare function messageOf(error: unknown): string;
|
|
220
|
+
/** The schema versions `config.ts` reads. */
|
|
221
|
+
export declare const CONFIG_VERSIONS: readonly [1];
|
|
222
|
+
/** One schema version `config.ts` reads. */
|
|
223
|
+
export type ConfigVersion = (typeof CONFIG_VERSIONS)[number];
|
|
224
|
+
/** Backends the effort store can be selected as. */
|
|
225
|
+
export declare const STORE_BACKENDS: readonly ["sqlite", "ndjson"];
|
|
226
|
+
/** One of the two effort-store backends. */
|
|
227
|
+
export type StoreBackend = (typeof STORE_BACKENDS)[number];
|
|
228
|
+
/**
|
|
229
|
+
* How a project's effort store travels between devices, as
|
|
230
|
+
* `effort.sync` names it. Closed: `git`, `service` and `p2p` are named
|
|
231
|
+
* here though modules bring their adapters, so a value outside the five
|
|
232
|
+
* is refused at load rather than when a sync is attempted.
|
|
233
|
+
*/
|
|
234
|
+
export declare const SYNC_STRATEGIES: readonly ["local", "file", "git", "service", "p2p"];
|
|
235
|
+
/** One of the five effort-store sync strategies. */
|
|
236
|
+
export type SyncStrategy = (typeof SYNC_STRATEGIES)[number];
|
|
237
|
+
/** How the board records epics and blockers: labels, or GitHub's own links. */
|
|
238
|
+
export declare const BOARD_RELATIONSHIP_MODES: readonly ["labels", "native"];
|
|
239
|
+
/** One of the two board relationship modes, as `board.relationships` names it. */
|
|
240
|
+
export type BoardRelationshipMode = (typeof BOARD_RELATIONSHIP_MODES)[number];
|
|
241
|
+
/** How much of the plan a task session is handed, widest first. */
|
|
242
|
+
export declare const INJECT_MODES: readonly ["full", "stage", "task"];
|
|
243
|
+
/** One of the three injection modes. */
|
|
244
|
+
export type InjectMode = (typeof INJECT_MODES)[number];
|
|
245
|
+
/** How a command writes what it has to say. */
|
|
246
|
+
export declare const OUTPUT_MODES: readonly ["text", "json", "events"];
|
|
247
|
+
/** One of the three output modes. */
|
|
248
|
+
export type OutputMode = (typeof OUTPUT_MODES)[number];
|
|
249
|
+
/** The sources Claude Code's `--setting-sources` takes a subset of. */
|
|
250
|
+
export declare const CLAUDE_SETTING_SOURCES: readonly ["user", "project", "local"];
|
|
251
|
+
/** One of Claude Code's three setting sources. */
|
|
252
|
+
export type ClaudeSettingSource = (typeof CLAUDE_SETTING_SOURCES)[number];
|
|
253
|
+
/**
|
|
254
|
+
* The pull request providers a file may name: the GitHub CLI, and none.
|
|
255
|
+
*
|
|
256
|
+
* `none` is a provider and not an absence: under it the loop pushes the
|
|
257
|
+
* branch, prints the compare URL and skips the CI wait, which is a
|
|
258
|
+
* behaviour an operator chooses, where a setting left unnamed is one
|
|
259
|
+
* `pr/provider.ts` resolves off the `origin` remote.
|
|
260
|
+
*/
|
|
261
|
+
export declare const PR_PROVIDERS: readonly ["gh", "none"];
|
|
262
|
+
/** One of the two pull request providers. */
|
|
263
|
+
export type PrProvider = (typeof PR_PROVIDERS)[number];
|
|
264
|
+
/**
|
|
265
|
+
* What `release.enabled` takes: a YAML boolean, or `auto`.
|
|
266
|
+
*
|
|
267
|
+
* `auto` is a third value and not a spelling of either boolean. It
|
|
268
|
+
* means "on when both configured files exist", a reading only
|
|
269
|
+
* `release/enabled.ts` can make, because only it looks at a disk.
|
|
270
|
+
*
|
|
271
|
+
* The two explicit answers are the BOOLEANS `true` and `false`, and
|
|
272
|
+
* not the words `on` and `off`: nothing here is coerced, so a file
|
|
273
|
+
* spelling `enabled: on` is refused and told what to write instead.
|
|
274
|
+
* Measured on bun 1.3.14, `Bun.YAML.parse` reads `on`, `off`, `yes`
|
|
275
|
+
* and `no` as strings and `true`, `True` and `TRUE` as the boolean, so
|
|
276
|
+
* `on` reaches the reader as the string and never as true.
|
|
277
|
+
*/
|
|
278
|
+
export type ReleaseEnabled = boolean | 'auto';
|
|
279
|
+
/** The value of `release.enabled` that defers to the two files. */
|
|
280
|
+
export declare const RELEASE_AUTO = "auto";
|
|
281
|
+
/**
|
|
282
|
+
* What `merge.duplicates` takes: how two entries of one config file
|
|
283
|
+
* setting one key are reported. `warn` prints each, `error` refuses the
|
|
284
|
+
* load with every one, `allow` drops them.
|
|
285
|
+
*/
|
|
286
|
+
export declare const DUPLICATE_LEVELS: readonly ["warn", "error", "allow"];
|
|
287
|
+
/** One of {@link DUPLICATE_LEVELS}. */
|
|
288
|
+
export type DuplicatesLevel = (typeof DUPLICATE_LEVELS)[number];
|
|
289
|
+
/** What `tiers.rafa` takes: the words, not the booleans. */
|
|
290
|
+
export declare const TIER_SWITCHES: readonly ["on", "off"];
|
|
291
|
+
/** One of {@link TIER_SWITCHES}. */
|
|
292
|
+
export type TierSwitch = (typeof TIER_SWITCHES)[number];
|
|
293
|
+
/**
|
|
294
|
+
* One value of `tiers.skills` or `tiers.agents`: `false` to turn the
|
|
295
|
+
* item off in every tier, or the tier whose holder serves it.
|
|
296
|
+
*/
|
|
297
|
+
export type TierPin = false | SkillTier;
|
|
298
|
+
/**
|
|
299
|
+
* One value of `routing`: the agent a task of that shape goes to, or
|
|
300
|
+
* `false` for a shape routed nowhere.
|
|
301
|
+
*/
|
|
302
|
+
export type RouteTarget = false | string;
|
|
303
|
+
/** The skill resolvers `task.skills` may name; see "The `task` section". */
|
|
304
|
+
export declare const SKILL_RESOLVERS: readonly ["planner", "tag", "none"];
|
|
305
|
+
/** One of {@link SKILL_RESOLVERS}. */
|
|
306
|
+
export type SkillResolverName = (typeof SKILL_RESOLVERS)[number];
|
|
307
|
+
/** What `task.lessons` takes: the words, not the booleans. */
|
|
308
|
+
export declare const LESSON_SWITCHES: readonly ["on", "off"];
|
|
309
|
+
/** One of {@link LESSON_SWITCHES}. */
|
|
310
|
+
export type LessonSwitch = (typeof LESSON_SWITCHES)[number];
|
|
311
|
+
/** The value of `claims.staleAfter` that turns stale takeover off. */
|
|
312
|
+
export declare const CLAIMS_STALE_DISABLED = "disabled";
|
|
313
|
+
/**
|
|
314
|
+
* What `claims.staleAfter` takes: a whole number of hours or days above
|
|
315
|
+
* zero, spelled as written (`36h`, `3d`), or `disabled`.
|
|
316
|
+
*/
|
|
317
|
+
export type ClaimsStaleAfter = `${number}h` | `${number}d` | typeof CLAIMS_STALE_DISABLED;
|
|
318
|
+
/** What `claims.ahead` takes; see "The `claims` section". */
|
|
319
|
+
export declare const CLAIMS_AHEAD: readonly ["off", "allow"];
|
|
320
|
+
/** One of {@link CLAIMS_AHEAD}. */
|
|
321
|
+
export type ClaimsAhead = (typeof CLAIMS_AHEAD)[number];
|
|
322
|
+
/** A reading refusing `raw`, saying what was expected instead. */
|
|
323
|
+
export declare function refused<T>(at: ValueAt, raw: unknown, expected: string): Reading<T>;
|
|
324
|
+
/** A reading carrying `problems` alone. */
|
|
325
|
+
export declare function refusedWith<T>(problems: readonly string[]): Reading<T>;
|
|
326
|
+
/** `reading` with its value, when it has one, passed through `map`. */
|
|
327
|
+
export declare function mapReading<T, U>(reading: Reading<T>, map: (value: T) => U): Reading<U>;
|
|
328
|
+
/** `at` one step down: an index (`[1]`) or a key (`.probe`). */
|
|
329
|
+
export declare function below(at: ValueAt, step: string): ValueAt;
|
|
330
|
+
/** Accepts exactly one of `values`, compared with `===`. */
|
|
331
|
+
export declare function oneOf<T>(values: readonly T[]): Reader<T>;
|
|
332
|
+
/**
|
|
333
|
+
* Accepts a string holding a character other than whitespace, kept as
|
|
334
|
+
* written. `expected` names what the string is for, in a refusal.
|
|
335
|
+
*/
|
|
336
|
+
export declare function text(expected: string): Reader<string>;
|
|
337
|
+
/** Accepts a YAML boolean, and nothing spelled like one. */
|
|
338
|
+
export declare const flag: Reader<boolean>;
|
|
339
|
+
/**
|
|
340
|
+
* Accepts a number of US dollars a session can be handed as a budget:
|
|
341
|
+
* above zero, at most six digits either side of the point, and no
|
|
342
|
+
* string spelled like one. What it accepts is `parseBudgetUsd`'s shape,
|
|
343
|
+
* asked about `String(raw)`; the module note says why.
|
|
344
|
+
*/
|
|
345
|
+
export declare const usdAmount: Reader<number>;
|
|
346
|
+
/**
|
|
347
|
+
* Accepts an issue number as the board spells one: a whole number above
|
|
348
|
+
* zero, and no string spelled like one.
|
|
349
|
+
*
|
|
350
|
+
* The bound matches `src/board/naming.ts`, which refuses anything else
|
|
351
|
+
* with a `RangeError` rather than spelling `rafa-0` into a path. A
|
|
352
|
+
* setting read here is handed straight to `gh issue view <n>`, so `0`,
|
|
353
|
+
* `-1` and `2.5` are refused where the person can still fix the file,
|
|
354
|
+
* and not where a command has already been sent.
|
|
355
|
+
*
|
|
356
|
+
* `Bun.YAML.parse` reads `31`, `0x1f` and `3.1e1` all as the number 31,
|
|
357
|
+
* so the three spellings are one value here. A QUOTED `"31"` is refused,
|
|
358
|
+
* as every other reader refuses a string spelled like its type.
|
|
359
|
+
*/
|
|
360
|
+
export declare const issueNumber: Reader<number>;
|
|
361
|
+
/**
|
|
362
|
+
* Accepts a number of days as the `cleanup` thresholds take one: a
|
|
363
|
+
* whole number above zero, and no string spelled like one.
|
|
364
|
+
*
|
|
365
|
+
* Zero is refused and not read as "off": a zero-day threshold would put
|
|
366
|
+
* every branch under Stale and every worktree under idle, which is a
|
|
367
|
+
* listing nobody asks for by writing a number. A fraction is refused
|
|
368
|
+
* as `issueNumber` refuses one: the setting counts whole days, and
|
|
369
|
+
* `2.5` would be a precision nobody has said the reading keeps.
|
|
370
|
+
*/
|
|
371
|
+
export declare const dayCount: Reader<number>;
|
|
372
|
+
/** The shortest lock wait `effort.busyTimeoutMs` accepts, in milliseconds. */
|
|
373
|
+
export declare const BUSY_TIMEOUT_MIN_MS = 1;
|
|
374
|
+
/** The longest lock wait `effort.busyTimeoutMs` accepts: one minute. */
|
|
375
|
+
export declare const BUSY_TIMEOUT_MAX_MS = 60000;
|
|
376
|
+
/**
|
|
377
|
+
* True for a lock wait the effort store accepts: a whole number of
|
|
378
|
+
* milliseconds from {@link BUSY_TIMEOUT_MIN_MS} to
|
|
379
|
+
* {@link BUSY_TIMEOUT_MAX_MS}, both included.
|
|
380
|
+
*/
|
|
381
|
+
export declare function isBusyTimeoutMs(raw: unknown): raw is number;
|
|
382
|
+
/**
|
|
383
|
+
* Accepts how long an effort store open waits for another process's
|
|
384
|
+
* write lock, as `effort.busyTimeoutMs` takes it.
|
|
385
|
+
*
|
|
386
|
+
* Zero is refused and not read as "no wait": SQLite reads a zero busy
|
|
387
|
+
* timeout as none, so an open would throw `SQLITE_BUSY` at once, the
|
|
388
|
+
* failure the key exists to prevent. There is no unlimited value, since
|
|
389
|
+
* a lock wait with no end can hang a loop. A fraction, a quoted number
|
|
390
|
+
* and `false` are refused as every reader here refuses them.
|
|
391
|
+
*/
|
|
392
|
+
export declare const busyTimeoutMs: Reader<number>;
|
|
393
|
+
/**
|
|
394
|
+
* The lowest confidence a lesson may carry, and the lowest
|
|
395
|
+
* {@link confidence} accepts: the learning library's `CONFIDENCE_MIN`.
|
|
396
|
+
*/
|
|
397
|
+
export declare const CONFIDENCE_MIN = 0.3;
|
|
398
|
+
/**
|
|
399
|
+
* The highest confidence a lesson may carry, and the highest
|
|
400
|
+
* {@link confidence} accepts: the learning library's `CONFIDENCE_MAX`.
|
|
401
|
+
*/
|
|
402
|
+
export declare const CONFIDENCE_MAX = 0.9;
|
|
403
|
+
/**
|
|
404
|
+
* Accepts a lesson confidence as the `learning` thresholds take one: a
|
|
405
|
+
* number from {@link CONFIDENCE_MIN} to {@link CONFIDENCE_MAX}, both
|
|
406
|
+
* included, and no string spelled like one.
|
|
407
|
+
*
|
|
408
|
+
* A bound is compared after rounding to two decimals, as the library
|
|
409
|
+
* compares confidences, so `0.9000000000000001` reads as 0.9. The value
|
|
410
|
+
* is kept as written. A quoted `"0.5"` is refused, as every reader here
|
|
411
|
+
* refuses a string spelled like its type.
|
|
412
|
+
*/
|
|
413
|
+
export declare const confidence: Reader<number>;
|
|
414
|
+
/**
|
|
415
|
+
* Accepts how many times a lesson must recur as `learning.promote.after`
|
|
416
|
+
* counts it: a whole number of 1 or more, and no string spelled like one.
|
|
417
|
+
*
|
|
418
|
+
* Zero is refused and not read as "off": every held lesson was
|
|
419
|
+
* confirmed by at least one source, so 0 would promote exactly what 1
|
|
420
|
+
* does, and a second spelling of one threshold is a value nobody can
|
|
421
|
+
* tell was meant. A fraction is refused as {@link dayCount} refuses one:
|
|
422
|
+
* the setting counts distinct sources, which come whole.
|
|
423
|
+
*/
|
|
424
|
+
export declare const recurrenceCount: Reader<number>;
|
|
425
|
+
/**
|
|
426
|
+
* Accepts `true`, `false` or `auto`, each as itself. A string spelled
|
|
427
|
+
* like a boolean is refused; see {@link ReleaseEnabled}.
|
|
428
|
+
*/
|
|
429
|
+
export declare const releaseEnabled: Reader<ReleaseEnabled>;
|
|
430
|
+
/** Accepts one of {@link DUPLICATE_LEVELS}, as words. */
|
|
431
|
+
export declare const duplicatesLevel: Reader<DuplicatesLevel>;
|
|
432
|
+
/** Accepts `on` or `off`, as words; see "The `tiers` section". */
|
|
433
|
+
export declare const tierSwitch: Reader<TierSwitch>;
|
|
434
|
+
/**
|
|
435
|
+
* Accepts `false` or one of the three tiers, each as itself; see "The
|
|
436
|
+
* `tiers` section" for why `true` and null are refused.
|
|
437
|
+
*/
|
|
438
|
+
export declare const tierPin: Reader<TierPin>;
|
|
439
|
+
/**
|
|
440
|
+
* Accepts `false` or an agent name, each as itself; see "The `routing`
|
|
441
|
+
* setting" for why `true` and null are refused.
|
|
442
|
+
*/
|
|
443
|
+
export declare const routeTarget: Reader<RouteTarget>;
|
|
444
|
+
/** Accepts one of {@link SKILL_RESOLVERS}; see "The `task` section". */
|
|
445
|
+
export declare const skillResolverName: Reader<SkillResolverName>;
|
|
446
|
+
/** Accepts `on` or `off`, as words; see "The `task` section". */
|
|
447
|
+
export declare const lessonSwitch: Reader<LessonSwitch>;
|
|
448
|
+
/**
|
|
449
|
+
* The hours a `claims.staleAfter` duration spells (`36h` → 36, `3d` →
|
|
450
|
+
* 72), or null for anything else, `disabled` and `0d` included.
|
|
451
|
+
*/
|
|
452
|
+
export declare function claimDurationHours(raw: unknown): number | null;
|
|
453
|
+
/**
|
|
454
|
+
* Accepts a duration of whole hours or days above zero, or `disabled`,
|
|
455
|
+
* each kept as written; see "The `claims` section".
|
|
456
|
+
*/
|
|
457
|
+
export declare const claimsStaleAfter: Reader<ClaimsStaleAfter>;
|
|
458
|
+
/** Accepts `off` or `allow`; see "The `claims` section". */
|
|
459
|
+
export declare const claimsAhead: Reader<ClaimsAhead>;
|
|
460
|
+
/** True for a string shaped like a GitHub login; see {@link GITHUB_LOGIN}. */
|
|
461
|
+
export declare function isGitHubLogin(value: unknown): value is string;
|
|
462
|
+
/** Accepts a GitHub account login, kept as written; see {@link GITHUB_LOGIN}. */
|
|
463
|
+
export declare const githubLogin: Reader<string>;
|
|
464
|
+
/**
|
|
465
|
+
* The URL `board.project.template` names when no layer does: open-tomato's
|
|
466
|
+
* public "rafa board template", with the five fields, the three saved
|
|
467
|
+
* views and every automation off.
|
|
468
|
+
*/
|
|
469
|
+
export declare const BOARD_PROJECT_TEMPLATE_DEFAULT = "https://github.com/orgs/open-tomato/projects/6";
|
|
470
|
+
/** Accepts a GitHub project URL, kept as written; see {@link PROJECT_URL}. */
|
|
471
|
+
export declare const projectUrl: Reader<string>;
|
|
472
|
+
/**
|
|
473
|
+
* Accepts a GitHub project number: a whole number above zero, and no
|
|
474
|
+
* string spelled like one, for the reasons {@link issueNumber} gives.
|
|
475
|
+
* It is read apart from `issueNumber` only so a refusal names a
|
|
476
|
+
* project and not an issue.
|
|
477
|
+
*/
|
|
478
|
+
export declare const projectNumber: Reader<number>;
|
|
479
|
+
/**
|
|
480
|
+
* Accepts a list whose every entry `item` accepts, answered frozen.
|
|
481
|
+
* Every entry is read, so a list with two unusable entries names both.
|
|
482
|
+
* `expected` names the entries, in the refusal of a value that is not a
|
|
483
|
+
* list.
|
|
484
|
+
*/
|
|
485
|
+
export declare function listOf<T>(item: Reader<T>, expected: string): Reader<readonly T[]>;
|
|
486
|
+
/**
|
|
487
|
+
* Accepts a comma-separated subset of `values`, answered as a frozen
|
|
488
|
+
* list in the order written. Space around a comma is allowed, since the
|
|
489
|
+
* list, not the string, is what a caller acts on. An empty value, an
|
|
490
|
+
* empty entry, an entry naming nothing in `values` and an entry given
|
|
491
|
+
* twice are each refused: none of them is a subset spelled out.
|
|
492
|
+
*/
|
|
493
|
+
export declare function subsetOf<T extends string>(values: readonly T[]): Reader<readonly T[]>;
|