bareloop 0.40.0 → 0.42.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/CHANGELOG.md +96 -1
- package/README.md +13 -21
- package/bareloop.context.md +141 -128
- package/package.json +5 -4
- package/src/authorflow.js +346 -38
- package/src/authoring.js +92 -7
- package/src/authorjob.js +82 -20
- package/src/authorreadout.js +89 -5
- package/src/authorrun.js +39 -30
- package/src/authorscout.js +112 -4
- package/src/bundle.js +7 -4
- package/src/bundlerun.js +4 -1
- package/src/cli.js +1 -1
- package/src/config.js +129 -29
- package/src/declaredclose.js +23 -12
- package/src/draftspend.js +4 -4
- package/src/facts.js +317 -0
- package/src/factwords.js +129 -0
- package/src/index.js +2 -4
- package/src/inputlook.js +301 -0
- package/src/interviewrun.js +17 -25
- package/src/job.js +15 -8
- package/src/jobblock.js +7 -2
- package/src/judged.js +11 -43
- package/src/keysfile.js +15 -7
- package/src/kinds.js +86 -5
- package/src/labelscan.js +170 -0
- package/src/modellist.js +84 -0
- package/src/monthly.js +23 -43
- package/src/pagefetch.js +125 -0
- package/src/panel/authorroutes.js +34 -16
- package/src/panel/authorsession.js +161 -80
- package/src/panel/index.html +553 -152
- package/src/panel/jobplan.js +34 -11
- package/src/panel/runroutes.js +3 -0
- package/src/panel/server.js +54 -18
- package/src/panel/settingsroutes.js +232 -173
- package/src/planrun.js +5 -4
- package/src/providerrows.js +226 -141
- package/src/providers.js +58 -332
- package/src/providershapes.js +18 -0
- package/src/replay.js +1 -1
- package/src/rubricstep.js +804 -0
- package/src/source.js +166 -1
- package/src/thinking.js +130 -0
- package/src/u-readout.js +1 -1
- package/src/userrun.js +64 -75
- package/types/authorflow.d.ts +272 -18
- package/types/authoring.d.ts +29 -1
- package/types/authorjob.d.ts +9 -7
- package/types/authorreadout.d.ts +27 -2
- package/types/authorscout.d.ts +72 -2
- package/types/config.d.ts +23 -6
- package/types/declaredclose.d.ts +4 -2
- package/types/draftspend.d.ts +8 -8
- package/types/facts.d.ts +71 -0
- package/types/factwords.d.ts +42 -0
- package/types/index.d.ts +1 -1
- package/types/inputlook.d.ts +238 -0
- package/types/job.d.ts +5 -5
- package/types/jobblock.d.ts +8 -1
- package/types/judged.d.ts +5 -36
- package/types/keysfile.d.ts +15 -4
- package/types/labelscan.d.ts +38 -0
- package/types/modellist.d.ts +50 -0
- package/types/monthly.d.ts +4 -3
- package/types/pagefetch.d.ts +71 -0
- package/types/panel/authorsession.d.ts +20 -11
- package/types/panel/jobplan.d.ts +12 -4
- package/types/panel/server.d.ts +18 -6
- package/types/providerrows.d.ts +192 -99
- package/types/providers.d.ts +34 -159
- package/types/providershapes.d.ts +10 -0
- package/types/rubricstep.d.ts +286 -0
- package/types/source.d.ts +94 -0
- package/types/thinking.d.ts +90 -0
- package/types/userrun.d.ts +17 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What bare-agent knows about switching this model's thinking. A missing kind, a non-function `impl`, or a throw all read
|
|
3
|
+
* `'unverified'` — never a guess in either direction.
|
|
4
|
+
* @param {string} shape an API shape id (src/providershapes.js)
|
|
5
|
+
* @param {string} model
|
|
6
|
+
* @param {{ baseUrl?: string|null, impl?: Function }} [o] `impl` is a test seam; production uses bare-agent's own
|
|
7
|
+
* @returns {true|false|'unverified'}
|
|
8
|
+
*/
|
|
9
|
+
export function thinkingSupport(shape: string, model: string, { baseUrl, impl }?: {
|
|
10
|
+
baseUrl?: string | null;
|
|
11
|
+
impl?: Function;
|
|
12
|
+
}): true | false | "unverified";
|
|
13
|
+
/**
|
|
14
|
+
* The per-call options for one support answer and one tick (`true` = "Thinking on"). The table (PANEL-BUILD.md P8, ruling Q1):
|
|
15
|
+
* tick on : true -> on | false -> {} (the box is greyed, cannot be on) | 'unverified' -> on
|
|
16
|
+
* tick off: true -> off | false -> {} (the model thinks as it would) | 'unverified' -> off (bare-agent decides; plain request on failure)
|
|
17
|
+
* @param {true|false|'unverified'} support
|
|
18
|
+
* @param {boolean} tick
|
|
19
|
+
* @returns {{ thinkingMode: 'on'|'off' } | {}}
|
|
20
|
+
*/
|
|
21
|
+
export function thinkingOptions(support: true | false | "unverified", tick: boolean): {
|
|
22
|
+
thinkingMode: "on" | "off";
|
|
23
|
+
} | {};
|
|
24
|
+
/**
|
|
25
|
+
* Throw unless `mode` is one of {@link THINKING_MODES} — an operator-param guard, so a typo never silently means a mode.
|
|
26
|
+
* @param {unknown} mode
|
|
27
|
+
* @returns {'on'|'off'}
|
|
28
|
+
*/
|
|
29
|
+
export function assertThinkingMode(mode: unknown): "on" | "off";
|
|
30
|
+
/**
|
|
31
|
+
* The API shape of a constructed bare-agent provider (the three client classes only); `null` for a test double or a clipipe.
|
|
32
|
+
* @param {any} provider
|
|
33
|
+
* @returns {string|null}
|
|
34
|
+
*/
|
|
35
|
+
export function shapeOfProvider(provider: any): string | null;
|
|
36
|
+
/**
|
|
37
|
+
* The per-call options every DRAFTING and JUDGING model call on this provider instance carries for this mode. A provider that is
|
|
38
|
+
* not one of the three client classes (a test double, a clipipe) is never sent the switch.
|
|
39
|
+
* @param {any} provider a constructed bare-agent provider
|
|
40
|
+
* @param {unknown} [mode] 'on' | 'off' (default 'off')
|
|
41
|
+
* @returns {{ thinkingMode: 'on'|'off' } | {}}
|
|
42
|
+
*/
|
|
43
|
+
export function thinkingCallOptions(provider: any, mode?: unknown): {
|
|
44
|
+
thinkingMode: "on" | "off";
|
|
45
|
+
} | {};
|
|
46
|
+
/**
|
|
47
|
+
* What the drafting calls will carry for a model the caller has only NAMED (shape, model id, Base URL) — no key, no network. The
|
|
48
|
+
* first drafting row is shown from this, before the key is read.
|
|
49
|
+
* @param {{providerName: string, model: string, baseUrl?: string|null}} o
|
|
50
|
+
* @param {unknown} [mode] 'on' | 'off'
|
|
51
|
+
* @returns {{ support: true|false|'unverified', mode: 'on'|'off', options: {thinkingMode?: 'on'|'off'} }}
|
|
52
|
+
*/
|
|
53
|
+
export function thinkingPlanFor({ providerName, model, baseUrl }: {
|
|
54
|
+
providerName: string;
|
|
55
|
+
model: string;
|
|
56
|
+
baseUrl?: string | null;
|
|
57
|
+
}, mode?: unknown): {
|
|
58
|
+
support: true | false | "unverified";
|
|
59
|
+
mode: "on" | "off";
|
|
60
|
+
options: {
|
|
61
|
+
thinkingMode?: "on" | "off";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* The server's answer for one Model-menu line: whether the "Thinking on" box can change and the words under it. `false` greys and
|
|
66
|
+
* unticks the box (the note reads {@link THINKING_FIXED_SAY}); `'unverified'` leaves it enabled with no note.
|
|
67
|
+
* @param {string} shape @param {string} model @param {string|null|undefined} baseUrl
|
|
68
|
+
* @returns {{ support: true|false|'unverified', canChange: boolean, say: string }}
|
|
69
|
+
*/
|
|
70
|
+
export function thinkingForLine(shape: string, model: string, baseUrl: string | null | undefined): {
|
|
71
|
+
support: true | false | "unverified";
|
|
72
|
+
canChange: boolean;
|
|
73
|
+
say: string;
|
|
74
|
+
};
|
|
75
|
+
/**
|
|
76
|
+
* The first drafting row's words — code-owned, ALWAYS starting "thinking on" or "thinking off". `status` is bare-agent's own
|
|
77
|
+
* `thinkingStatus` for a call that has run ('applied' | 'unsupported' | 'ignored' | 'unknown'); undefined = before any call, read from
|
|
78
|
+
* the plan (`support`, `mode`).
|
|
79
|
+
* @param {{ mode: 'on'|'off', support?: true|false|'unverified', status?: string }} s
|
|
80
|
+
* @returns {string}
|
|
81
|
+
*/
|
|
82
|
+
export function thinkingRowText({ mode, support, status }: {
|
|
83
|
+
mode: "on" | "off";
|
|
84
|
+
support?: true | false | "unverified";
|
|
85
|
+
status?: string;
|
|
86
|
+
}): string;
|
|
87
|
+
/** The words under a greyed "Thinking on" box (the server's `thinking.canChange` decides; the page decides nothing). */
|
|
88
|
+
export const THINKING_FIXED_SAY: "can't change this for this model";
|
|
89
|
+
/** The enumerated operator knob a drafting call is built with: 'on' | 'off' (the tick, spelled as a word). */
|
|
90
|
+
export const THINKING_MODES: readonly string[];
|
package/types/userrun.d.ts
CHANGED
|
@@ -61,6 +61,17 @@ export type Deps = {
|
|
|
61
61
|
*/
|
|
62
62
|
provider?: any;
|
|
63
63
|
providerFor?: ((tier: string) => any) | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* PART 1c - a test seam: how a web input is read at run start (production: barebrowse)
|
|
66
|
+
*/
|
|
67
|
+
fetchUrl?: ((url: string) => Promise<{
|
|
68
|
+
ok: true;
|
|
69
|
+
text: string;
|
|
70
|
+
url: string;
|
|
71
|
+
} | {
|
|
72
|
+
ok: false;
|
|
73
|
+
error: string;
|
|
74
|
+
}>) | undefined;
|
|
64
75
|
judgeProvider?: any;
|
|
65
76
|
/**
|
|
66
77
|
* F196 — a test seam for `appendRun`'s
|
|
@@ -136,9 +147,13 @@ export type RunOpts = {
|
|
|
136
147
|
*/
|
|
137
148
|
into?: string | undefined;
|
|
138
149
|
/**
|
|
139
|
-
* the raw `--model
|
|
150
|
+
* the raw `--model <id>` (a model id of a ticked Settings line), or null
|
|
140
151
|
*/
|
|
141
152
|
model?: string | null | undefined;
|
|
153
|
+
/**
|
|
154
|
+
* the raw `--provider <KEY>` (a key's env name), or null
|
|
155
|
+
*/
|
|
156
|
+
providerKey?: string | null | undefined;
|
|
142
157
|
/**
|
|
143
158
|
* the raw `--read-shim` arm name, or null for the default
|
|
144
159
|
*/
|
|
@@ -205,6 +220,7 @@ export type RunCtx = {
|
|
|
205
220
|
*/
|
|
206
221
|
into?: string | undefined;
|
|
207
222
|
model: string | null;
|
|
223
|
+
providerKey: string | null;
|
|
208
224
|
readShim: string | null;
|
|
209
225
|
scout: string | null;
|
|
210
226
|
draftSpentUsd: string | null;
|