bareloop 0.54.1 → 0.56.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 +122 -0
- package/bareloop.context.md +67 -6
- package/package.json +3 -3
- package/src/authorflow.js +217 -238
- package/src/authoring.js +22 -6
- package/src/authorjob.js +138 -30
- package/src/authorreadout.js +15 -4
- package/src/authorrun.js +13 -4
- package/src/authorscout.js +9 -6
- package/src/behaviour.js +14 -0
- package/src/blockasks.js +43 -0
- package/src/cardschedule.js +42 -0
- package/src/checkblock.js +772 -0
- package/src/checklist.js +128 -0
- package/src/checkpick.js +294 -0
- package/src/checksuggest.js +28 -0
- package/src/checkwords.js +27 -0
- package/src/cli.js +1 -1
- package/src/config.js +24 -1
- package/src/declaredclose.js +30 -1
- package/src/destpoint.js +151 -0
- package/src/draftspend.js +85 -0
- package/src/facts.js +8 -1
- package/src/factwords.js +14 -1
- package/src/fitcheck.js +5 -3
- package/src/job.js +81 -1
- package/src/jobblock.js +9 -0
- package/src/labelscan.js +11 -0
- package/src/launcher.js +3 -2
- package/src/mcpchecks.js +52 -0
- package/src/mcppick.js +36 -0
- package/src/mcpsources.js +77 -0
- package/src/mcpuse.js +97 -0
- package/src/natural.js +23 -0
- package/src/pagemap.js +20 -5
- package/src/panel/authorroutes.js +105 -18
- package/src/panel/authorsession.js +293 -44
- package/src/panel/index.html +873 -41
- package/src/panel/jobgrid.js +117 -0
- package/src/panel/jobplan.js +103 -35
- package/src/panel/scheduler.js +80 -13
- package/src/panel/schedules.js +189 -28
- package/src/panel/schedulestart.js +44 -13
- package/src/panel/server.js +471 -39
- package/src/panel/settingsroutes.js +133 -3
- package/src/panel/status.js +19 -1
- package/src/panel/tickets.js +44 -0
- package/src/pickrecord.js +163 -0
- package/src/placerule.js +355 -0
- package/src/plan.js +31 -2
- package/src/planrun.js +71 -15
- package/src/prcheckout.js +259 -0
- package/src/promptregisters.js +11 -0
- package/src/questionbox.js +112 -0
- package/src/readshim.js +3 -2
- package/src/revises.js +56 -0
- package/src/rowedit.js +115 -0
- package/src/rubricstep.js +265 -132
- package/src/run.js +19 -2
- package/src/runexport.js +2 -0
- package/src/runlist.js +3 -2
- package/src/schedulewords.js +46 -4
- package/src/source.js +81 -7
- package/src/stepmcp.js +86 -0
- package/src/ticket.js +113 -0
- package/src/ticketfilter.js +76 -0
- package/src/ticketlabels.js +79 -0
- package/src/ticketmcp.js +111 -0
- package/src/ticketnext.js +35 -0
- package/src/ticketrepo.js +98 -0
- package/src/ticketschedule.js +32 -0
- package/src/ticketshape.js +45 -0
- package/src/tools.js +9 -0
- package/src/trigger.js +14 -2
- package/src/triggerclock.js +7 -3
- package/src/triggerfiles.js +19 -11
- package/src/triggertickets.js +244 -0
- package/src/userrun.js +191 -10
- package/src/validate.js +3 -1
- package/src/worktree.js +43 -1
- package/types/authorflow.d.ts +86 -93
- package/types/authorjob.d.ts +35 -4
- package/types/authorreadout.d.ts +4 -3
- package/types/authorscout.d.ts +4 -2
- package/types/behaviour.d.ts +12 -0
- package/types/blockasks.d.ts +37 -0
- package/types/cardschedule.d.ts +24 -0
- package/types/checkblock.d.ts +361 -0
- package/types/checklist.d.ts +134 -0
- package/types/checkpick.d.ts +160 -0
- package/types/checksuggest.d.ts +30 -0
- package/types/checkwords.d.ts +14 -0
- package/types/config.d.ts +7 -0
- package/types/declaredclose.d.ts +4 -0
- package/types/destpoint.d.ts +89 -0
- package/types/draftspend.d.ts +37 -0
- package/types/factwords.d.ts +7 -0
- package/types/fitcheck.d.ts +7 -1
- package/types/job.d.ts +13 -0
- package/types/jobblock.d.ts +9 -0
- package/types/labelscan.d.ts +7 -0
- package/types/launcher.d.ts +2 -2
- package/types/mcpchecks.d.ts +8 -0
- package/types/mcppick.d.ts +33 -0
- package/types/mcpsources.d.ts +51 -0
- package/types/mcpuse.d.ts +15 -0
- package/types/natural.d.ts +2 -0
- package/types/pagemap.d.ts +6 -1
- package/types/panel/authorroutes.d.ts +11 -2
- package/types/panel/authorsession.d.ts +69 -3
- package/types/panel/jobgrid.d.ts +405 -0
- package/types/panel/jobplan.d.ts +55 -11
- package/types/panel/scheduler.d.ts +7 -2
- package/types/panel/schedules.d.ts +124 -4
- package/types/panel/schedulestart.d.ts +21 -3
- package/types/panel/server.d.ts +432 -10
- package/types/panel/settingsroutes.d.ts +4 -2
- package/types/panel/status.d.ts +16 -2
- package/types/panel/tickets.d.ts +61 -0
- package/types/pickrecord.d.ts +100 -0
- package/types/placerule.d.ts +194 -0
- package/types/plan.d.ts +1 -0
- package/types/prcheckout.d.ts +151 -0
- package/types/questionbox.d.ts +87 -0
- package/types/readshim.d.ts +4 -3
- package/types/revises.d.ts +23 -0
- package/types/rowedit.d.ts +32 -0
- package/types/rubricstep.d.ts +100 -48
- package/types/run.d.ts +27 -1
- package/types/runlist.d.ts +6 -3
- package/types/schedulewords.d.ts +29 -2
- package/types/source.d.ts +40 -4
- package/types/stepmcp.d.ts +40 -0
- package/types/ticket.d.ts +114 -0
- package/types/ticketfilter.d.ts +34 -0
- package/types/ticketlabels.d.ts +44 -0
- package/types/ticketmcp.d.ts +84 -0
- package/types/ticketnext.d.ts +33 -0
- package/types/ticketrepo.d.ts +118 -0
- package/types/ticketschedule.d.ts +21 -0
- package/types/ticketshape.d.ts +37 -0
- package/types/tools.d.ts +1 -0
- package/types/trigger.d.ts +9 -1
- package/types/triggerclock.d.ts +6 -2
- package/types/triggerfiles.d.ts +13 -5
- package/types/triggertickets.d.ts +110 -0
- package/types/userrun.d.ts +50 -0
- package/types/validate.d.ts +1 -0
- package/types/worktree.d.ts +19 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The key of every job line: its own words, plus how many lines before it have the same words (equal lines match in their order).
|
|
3
|
+
* @param {{n: number, text: string}[]} lines @returns {Map<number, {lineWords: string, occurrence: number}>}
|
|
4
|
+
*/
|
|
5
|
+
export function lineKeys(lines: {
|
|
6
|
+
n: number;
|
|
7
|
+
text: string;
|
|
8
|
+
}[]): Map<number, {
|
|
9
|
+
lineWords: string;
|
|
10
|
+
occurrence: number;
|
|
11
|
+
}>;
|
|
12
|
+
/**
|
|
13
|
+
* The entries for answers just given, numbered on THIS card (the answer redraft's card: its line and rule numbers are the ones the asks carried).
|
|
14
|
+
* @param {{n: number, text: string}[]} lines @param {Rule[]} rules
|
|
15
|
+
* @param {{line: number, rule: number, check?: Record<string, any>|null, added?: string|null, own?: boolean}[]} picks @param {{line: number, rule: number}[]} left
|
|
16
|
+
* @returns {Entry[]}
|
|
17
|
+
*/
|
|
18
|
+
export function entriesFromAnswers(lines: {
|
|
19
|
+
n: number;
|
|
20
|
+
text: string;
|
|
21
|
+
}[], rules: Rule[], picks: {
|
|
22
|
+
line: number;
|
|
23
|
+
rule: number;
|
|
24
|
+
check?: Record<string, any> | null;
|
|
25
|
+
added?: string | null;
|
|
26
|
+
own?: boolean;
|
|
27
|
+
}[], left: {
|
|
28
|
+
line: number;
|
|
29
|
+
rule: number;
|
|
30
|
+
}[]): Entry[];
|
|
31
|
+
/**
|
|
32
|
+
* Decide, for the card in hand, which stored picks are kept and which guardrails must be asked.
|
|
33
|
+
* A pick is KEPT when the job line with its words (same order among equal lines) still has its source guardrail with the exact words and, if the pick wrote a `~` line,
|
|
34
|
+
* that line with its exact words too. Otherwise the pick is dropped (never partly kept) and its guardrails are asked: a pair broken on one side is ONE ask, so the
|
|
35
|
+
* partner left on the card is folded (neither asked nor given the old check) - except an EDITED added line (M10 am21): that one is asked (`pairRule` = its source's number) and the source is folded. Pure.
|
|
36
|
+
* @param {Entry[]} entries @param {{n: number, text: string}[]} lines @param {Rule[]} rules every guardrail the call settles
|
|
37
|
+
* @returns {{picks: {line: number, rule: number, check: Record<string, any>|null, added?: string, own?: boolean}[], left: {line: number, rule: number}[],
|
|
38
|
+
* kept: {line: number, rule: number, entry: Entry}[], askRules: (Rule & {pairRule?: number})[]}}
|
|
39
|
+
*/
|
|
40
|
+
export function matchRecord(entries: Entry[], lines: {
|
|
41
|
+
n: number;
|
|
42
|
+
text: string;
|
|
43
|
+
}[], rules: Rule[]): {
|
|
44
|
+
picks: {
|
|
45
|
+
line: number;
|
|
46
|
+
rule: number;
|
|
47
|
+
check: Record<string, any> | null;
|
|
48
|
+
added?: string;
|
|
49
|
+
own?: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
left: {
|
|
52
|
+
line: number;
|
|
53
|
+
rule: number;
|
|
54
|
+
}[];
|
|
55
|
+
kept: {
|
|
56
|
+
line: number;
|
|
57
|
+
rule: number;
|
|
58
|
+
entry: Entry;
|
|
59
|
+
}[];
|
|
60
|
+
askRules: (Rule & {
|
|
61
|
+
pairRule?: number;
|
|
62
|
+
})[];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Read a carried record (the session folder's file). A missing or unreadable file is no record (a draft from before R10 has none).
|
|
66
|
+
* @param {string} file @returns {Entry[]|null}
|
|
67
|
+
*/
|
|
68
|
+
export function readRecordFile(file: string): Entry[] | null;
|
|
69
|
+
/**
|
|
70
|
+
* The Drop/Add choices a draft's person made on the confirm card (hamr 2026-11-13, N-2), carried the same way as the picks: tied to the line's words and the row's own name, never to a number.
|
|
71
|
+
* @param {string} file @returns {{lineWords: string, occurrence: number, tail: string, choice: string}[]|null}
|
|
72
|
+
*/
|
|
73
|
+
export function readRowChoices(file: string): {
|
|
74
|
+
lineWords: string;
|
|
75
|
+
occurrence: number;
|
|
76
|
+
tail: string;
|
|
77
|
+
choice: string;
|
|
78
|
+
}[] | null;
|
|
79
|
+
/** write a part of the record without losing the other: `patch` is `{picks}` or `{rowChoices}` @param {string} file @param {Record<string, any>} patch */
|
|
80
|
+
export function writeRecordPart(file: string, patch: Record<string, any>): void;
|
|
81
|
+
/** the record's file, inside a drafting session folder only (never a run folder) */
|
|
82
|
+
export const RECORD_FILE: "picks-record.json";
|
|
83
|
+
/** the exact words a kept pick is marked with in the draft log, the Audit and the plan card (M10 am17 (6)) */
|
|
84
|
+
export const KEPT_WORDS: "kept from last draft";
|
|
85
|
+
export function sameWords(a: unknown, b: unknown): boolean;
|
|
86
|
+
export function recordPath(planDir: string): string;
|
|
87
|
+
export type Entry = {
|
|
88
|
+
lineWords: string;
|
|
89
|
+
occurrence: number;
|
|
90
|
+
ruleText: string;
|
|
91
|
+
added: string | null;
|
|
92
|
+
check: Record<string, any> | null;
|
|
93
|
+
own: boolean;
|
|
94
|
+
left: boolean;
|
|
95
|
+
};
|
|
96
|
+
export type Rule = {
|
|
97
|
+
line: number;
|
|
98
|
+
rule: number;
|
|
99
|
+
text: string;
|
|
100
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {{kind: 'headingBetween'|'headingDateAfter', prefix: string, end: string, shape: string, skip: string[]}} PlaceRule
|
|
3
|
+
* @typedef {{found: true, value: string, lineIndex: number}|{found: false, reason: string}} PlaceRead
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Why a rule is not a legal place rule, or null when it is. Pure.
|
|
7
|
+
* @param {unknown} rule @returns {string|null}
|
|
8
|
+
*/
|
|
9
|
+
export function placeRuleProblem(rule: unknown): string | null;
|
|
10
|
+
/**
|
|
11
|
+
* Heading lines at the rule's level: lines outside ``` / ~~~ fences that start with the level mark (for example "## "). Pure.
|
|
12
|
+
* @param {string} text @param {string} prefix @returns {{i: number, line: string}[]}
|
|
13
|
+
*/
|
|
14
|
+
export function levelLines(text: string, prefix: string): {
|
|
15
|
+
i: number;
|
|
16
|
+
line: string;
|
|
17
|
+
}[];
|
|
18
|
+
/**
|
|
19
|
+
* The mixed-level guard: every non-fenced heading line is scanned; semver-carrying headings at MORE THAN ONE level mean mixed. A heading with no
|
|
20
|
+
* semver (a "# Changelog" title, "### Fixed") is ignored. It only ever turns a read into not found, never into a value.
|
|
21
|
+
* @param {string} text @returns {boolean}
|
|
22
|
+
*/
|
|
23
|
+
export function mixedLevels(text: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Read one rule against one input text: the run-start function, code only. A rule that is not legal throws (the signed spec was validated, so a bad one
|
|
26
|
+
* is a defect, never a read).
|
|
27
|
+
* @param {PlaceRule} rule @param {string} text @returns {PlaceRead}
|
|
28
|
+
*/
|
|
29
|
+
export function readPlace(rule: PlaceRule, text: string): PlaceRead;
|
|
30
|
+
/**
|
|
31
|
+
* Fit a place rule to a fact's own words, by CODE, at drafting. The words must be exactly one version (X.Y.Z) or exactly one ISO date; the frozen
|
|
32
|
+
* candidates are walked in order, and the first whose strict first-heading read on the input's own text returns exactly those words wins. Null =
|
|
33
|
+
* no fit (a version and a date together, any other words, another date form, a mixed-level file, no text, or no candidate reading them): the caller
|
|
34
|
+
* refuses the words as week-only exactly as before. Only the two kinds are handled. Pure.
|
|
35
|
+
* @param {string} words @param {string|null|undefined} text
|
|
36
|
+
* @returns {PlaceRule|null}
|
|
37
|
+
*/
|
|
38
|
+
export function fitPlaceRule(words: string, text: string | null | undefined): PlaceRule | null;
|
|
39
|
+
/**
|
|
40
|
+
* STRIP (P1b, hamr 2026-11-11): the words of a phrase fact that are a piece of the newest release heading ("## [0.54.1]", "[0.54.1] -", "0.54.1",
|
|
41
|
+
* "2026-11-04", "## [0.54.1] - 2026-11-04") are stripped by code to their value(s). The words hold exactly one version (X.Y.Z, an optional leading v) and/or
|
|
42
|
+
* exactly one ISO date and nothing else but heading marks; each value is fitted with {@link fitPlaceRule} on the input's own text, and when both are
|
|
43
|
+
* present both must sit on the SAME first release heading line. Returns the values (version first) each with its rule, or null: two versions, two dates,
|
|
44
|
+
* any other word, another date form, a value that is not at the first release heading, no text. Pure.
|
|
45
|
+
* @param {string} words @param {string|null|undefined} text
|
|
46
|
+
* @returns {{kind: 'version'|'date', value: string, rule: PlaceRule}[]|null}
|
|
47
|
+
*/
|
|
48
|
+
export function fitPlacePhrase(words: string, text: string | null | undefined): {
|
|
49
|
+
kind: "version" | "date";
|
|
50
|
+
value: string;
|
|
51
|
+
rule: PlaceRule;
|
|
52
|
+
}[] | null;
|
|
53
|
+
/**
|
|
54
|
+
* @typedef {{key: string, name: string, source: string, stage: number, part: number, fact: number, place: PlaceRule, phrase: string}} PlaceFact
|
|
55
|
+
*/
|
|
56
|
+
/**
|
|
57
|
+
* Every place-rule fact of a spec, in stage / part / fact order. The key is the stage's name and the fact's name (both stable across the runs of one
|
|
58
|
+
* workflow), so an earlier run's record finds the same fact. Pure.
|
|
59
|
+
* @param {any} spec @returns {PlaceFact[]}
|
|
60
|
+
*/
|
|
61
|
+
export function placeFactsOf(spec: any): PlaceFact[];
|
|
62
|
+
/**
|
|
63
|
+
* A copy of the spec with each place fact's phrase replaced by the value the run read. The input spec is never touched (the signed spec and its hash
|
|
64
|
+
* stay as signed); the copy is for this run's planner and close only. A key with no value is left as the signed drafting words.
|
|
65
|
+
* @param {any} spec @param {Record<string, string>} values place-fact key to the value read @returns {any}
|
|
66
|
+
*/
|
|
67
|
+
export function bindPlaceValues(spec: any, values: Record<string, string>): any;
|
|
68
|
+
/**
|
|
69
|
+
* The value the drafting words themselves hold for this rule: the first version for headingBetween, the first ISO date for headingDateAfter. Null when
|
|
70
|
+
* the words hold none. Used as "last read" when no earlier run has one.
|
|
71
|
+
* @param {PlaceRule} rule @param {string} words @returns {string|null}
|
|
72
|
+
*/
|
|
73
|
+
export function valueInWords(rule: PlaceRule, words: string): string | null;
|
|
74
|
+
/**
|
|
75
|
+
* Re-read EVERY place fact against the run's own input text, one by one, before any spend. A row is same / new / notfound. Any notfound stops the run;
|
|
76
|
+
* otherwise the run proceeds with the new words.
|
|
77
|
+
* @param {{fact: PlaceFact, text: string|null, was: string|null}[]} items `text` null = the input could not be read
|
|
78
|
+
* @returns {{proceed: boolean, rows: {key: string, name: string, kind: string, found: boolean, value: string|null, was: string|null, reason: string|null}[], values: Record<string, string>}}
|
|
79
|
+
*/
|
|
80
|
+
export function readPlaceRules(items: {
|
|
81
|
+
fact: PlaceFact;
|
|
82
|
+
text: string | null;
|
|
83
|
+
was: string | null;
|
|
84
|
+
}[]): {
|
|
85
|
+
proceed: boolean;
|
|
86
|
+
rows: {
|
|
87
|
+
key: string;
|
|
88
|
+
name: string;
|
|
89
|
+
kind: string;
|
|
90
|
+
found: boolean;
|
|
91
|
+
value: string | null;
|
|
92
|
+
was: string | null;
|
|
93
|
+
reason: string | null;
|
|
94
|
+
}[];
|
|
95
|
+
values: Record<string, string>;
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* The words of the $0 stop, plain words from code. Every rule is listed, found or not: "<name>: found <value>" (with "(was <last>)" when the value is
|
|
99
|
+
* new) or "<name>: not found (<plain reason>)", then the closing line. The reasons come only from the closed list.
|
|
100
|
+
* @param {{name: string, found: boolean, value: string|null, was: string|null, reason: string|null}[]} rows @returns {string}
|
|
101
|
+
*/
|
|
102
|
+
export function stopWords(rows: {
|
|
103
|
+
name: string;
|
|
104
|
+
found: boolean;
|
|
105
|
+
value: string | null;
|
|
106
|
+
was: string | null;
|
|
107
|
+
reason: string | null;
|
|
108
|
+
}[]): string;
|
|
109
|
+
/**
|
|
110
|
+
* The values of the LAST `place-rules` record in a run's own events (key to value): what a RESUME of that run rebinds, since a resume does not re-read. Null when
|
|
111
|
+
* there is no record, or any of its rows was not found.
|
|
112
|
+
* @param {any[]} events @returns {Record<string, string>|null}
|
|
113
|
+
*/
|
|
114
|
+
export function placeValuesOfEvents(events: any[]): Record<string, string> | null;
|
|
115
|
+
/**
|
|
116
|
+
* What the newest EARLIER run of the same workflow read, per fact key: "last read". `rows` are the run list's rows (file order, oldest first). Candidates are
|
|
117
|
+
* the rows of the same job, newest first, at most {@link LAST_READ_LOOK} of them; the first whose spine holds a `place-rules` record of the same workflow key
|
|
118
|
+
* answers. An unreadable spine is skipped. Empty when there is none (the caller falls back to the drafting words).
|
|
119
|
+
* @param {{rows: {runid: string, job: string, spine: string}[], job: string, workflowKey: string, runid: string}} o @returns {Record<string, string>}
|
|
120
|
+
*/
|
|
121
|
+
export function lastPlaceRead({ rows, job, workflowKey, runid }: {
|
|
122
|
+
rows: {
|
|
123
|
+
runid: string;
|
|
124
|
+
job: string;
|
|
125
|
+
spine: string;
|
|
126
|
+
}[];
|
|
127
|
+
job: string;
|
|
128
|
+
workflowKey: string;
|
|
129
|
+
runid: string;
|
|
130
|
+
}): Record<string, string>;
|
|
131
|
+
/**
|
|
132
|
+
* The Audit lines of a run's `place-rules` record, in plain words from code: "<name>: <value>" (with "(was <last>)" when the value is new) or
|
|
133
|
+
* "<name>: not found (<reason>)". Null when the run has no record.
|
|
134
|
+
* @param {any[]} events @returns {string[]|null}
|
|
135
|
+
*/
|
|
136
|
+
export function placeRuleLines(events: any[]): string[] | null;
|
|
137
|
+
/** the two rule kinds on the menu: the version in a heading, and the date on the same heading line */
|
|
138
|
+
export const PLACE_KINDS: readonly string[];
|
|
139
|
+
/** the end-of-line end mark */
|
|
140
|
+
export const EOL: "$EOL";
|
|
141
|
+
/** the field a place rule may carry */
|
|
142
|
+
export const PLACE_FIELDS: readonly string[];
|
|
143
|
+
/** the closed list of reasons a read can end not found */
|
|
144
|
+
export const PLACE_REASONS: readonly string[];
|
|
145
|
+
/** plain words for each reason, from code (the person never reads a raw code) */
|
|
146
|
+
export const PLAIN_REASONS: Readonly<{
|
|
147
|
+
'mixed-levels': "the file writes its version headings at more than one level";
|
|
148
|
+
'no-heading-line': "the file has no heading at the level the rule reads";
|
|
149
|
+
'first-heading-mismatch': "the newest heading does not start the way the rule says";
|
|
150
|
+
'end-mark-missing': "the newest heading does not have the mark the rule reads up to";
|
|
151
|
+
'capture-not-shape': "the newest heading does not carry a version number";
|
|
152
|
+
'only-skipped-headings': "the file has only an Unreleased heading and no release after it";
|
|
153
|
+
'no-date-on-line': "the newest heading line carries no date";
|
|
154
|
+
'no-file': "the input could not be read";
|
|
155
|
+
'empty-text': "the input is empty";
|
|
156
|
+
}>;
|
|
157
|
+
/** the frozen candidate list: 9 prefixes crossed with 3 ends, prefix-major (27) */
|
|
158
|
+
export const PLACE_CANDIDATES: readonly Readonly<{
|
|
159
|
+
prefix: string;
|
|
160
|
+
end: string;
|
|
161
|
+
}>[];
|
|
162
|
+
/** the end of the stop words: what the person can do, and that nothing ran or was spent */
|
|
163
|
+
export const STOP_TAIL: "Reuse workflow and adjust the rules, or check the input. The run did not start. Nothing spent.";
|
|
164
|
+
/** the plain words of the door's refusal when a place-rule run has no record of the values it read */
|
|
165
|
+
export const NO_PLACE_RECORD_WORDS: "This run has no record of the values it read, so it cannot be checked again. Use Reuse workflow.";
|
|
166
|
+
/** the spine event a run writes, once, after job-start */
|
|
167
|
+
export const PLACE_EVENT: "place-rules";
|
|
168
|
+
/** how many earlier runs of the job are looked at for "last read" */
|
|
169
|
+
export const LAST_READ_LOOK: 25;
|
|
170
|
+
export type PlaceRule = {
|
|
171
|
+
kind: "headingBetween" | "headingDateAfter";
|
|
172
|
+
prefix: string;
|
|
173
|
+
end: string;
|
|
174
|
+
shape: string;
|
|
175
|
+
skip: string[];
|
|
176
|
+
};
|
|
177
|
+
export type PlaceRead = {
|
|
178
|
+
found: true;
|
|
179
|
+
value: string;
|
|
180
|
+
lineIndex: number;
|
|
181
|
+
} | {
|
|
182
|
+
found: false;
|
|
183
|
+
reason: string;
|
|
184
|
+
};
|
|
185
|
+
export type PlaceFact = {
|
|
186
|
+
key: string;
|
|
187
|
+
name: string;
|
|
188
|
+
source: string;
|
|
189
|
+
stage: number;
|
|
190
|
+
part: number;
|
|
191
|
+
fact: number;
|
|
192
|
+
place: PlaceRule;
|
|
193
|
+
phrase: string;
|
|
194
|
+
};
|
package/types/plan.d.ts
CHANGED
|
@@ -161,6 +161,7 @@ export const MAX_SCOPE_MENU: 24;
|
|
|
161
161
|
* guard there): the rule and its pre-flight must read ONE spelling of which
|
|
162
162
|
* verbs count, never two that can drift apart. */
|
|
163
163
|
export const RETRIEVAL_PAIR: readonly string[];
|
|
164
|
+
export function mcpToolsExample(mcp: any): string;
|
|
164
165
|
/** P (design record 2026-07-28): the signed per-step model-tier menu. Closed by
|
|
165
166
|
* construction — the agent picks a tier, never names an arbitrary model string
|
|
166
167
|
* (the tier→model mapping and any effort params are the RUNNER's, per provider).
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The PR address a ticket list gives: `https://github.com/<owner>/<repo>/pull/<n>`.
|
|
3
|
+
* @param {unknown} url
|
|
4
|
+
* @returns {{ok: true, owner: string, repo: string, number: number}|{ok: false, error: string}}
|
|
5
|
+
*/
|
|
6
|
+
export function parsePrAddress(url: unknown): {
|
|
7
|
+
ok: true;
|
|
8
|
+
owner: string;
|
|
9
|
+
repo: string;
|
|
10
|
+
number: number;
|
|
11
|
+
} | {
|
|
12
|
+
ok: false;
|
|
13
|
+
error: string;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* THE one accessor of the frozen PR record's head commit: GitHub's own `head.sha`. Everything in this file reads the head through here, so the day the reader's record
|
|
17
|
+
* names it differently there is one line to change. A record without a full 40-hex sha has no head (null).
|
|
18
|
+
* @param {any} record @returns {string|null}
|
|
19
|
+
*/
|
|
20
|
+
export function prHeadSha(record: any): string | null;
|
|
21
|
+
/** the PR's base as the record gives it (`base.ref`, `base.sha`), or null when it names none @param {any} record @returns {{ref: string|null, sha: string}|null} */
|
|
22
|
+
export function prBaseOf(record: any): {
|
|
23
|
+
ref: string | null;
|
|
24
|
+
sha: string;
|
|
25
|
+
} | null;
|
|
26
|
+
/**
|
|
27
|
+
* The remotes a git config text declares, with their addresses AS WRITTEN (before any `insteadOf` rewrite): `[remote "name"]` sections, `url = ...` lines.
|
|
28
|
+
* Read from the config file instead of `git remote`, which would need a subcommand this piece is not allowed and prints the rewritten address.
|
|
29
|
+
* @param {string} text @returns {{name: string, url: string}[]}
|
|
30
|
+
*/
|
|
31
|
+
export function remotesOfConfig(text: string): {
|
|
32
|
+
name: string;
|
|
33
|
+
url: string;
|
|
34
|
+
}[];
|
|
35
|
+
/**
|
|
36
|
+
* Does a remote address name `github.com/<owner>/<repo>`? https, ssh:// and the scp-like `git@github.com:owner/repo.git` forms; case-blind, `.git` optional.
|
|
37
|
+
* @param {string} url @param {string} owner @param {string} repo
|
|
38
|
+
*/
|
|
39
|
+
export function remoteNames(url: string, owner: string, repo: string): boolean;
|
|
40
|
+
/** the remote to fetch from: `origin` when it names the repo, else the first that does; null = none @param {{name: string, url: string}[]} remotes @returns {{name: string, url: string}|null} */
|
|
41
|
+
export function matchRemote(remotes: {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
}[], owner: any, repo: any): {
|
|
45
|
+
name: string;
|
|
46
|
+
url: string;
|
|
47
|
+
} | null;
|
|
48
|
+
/** an address that carries a login: `https://user:pass@host`, `https://token@host`, or `ssh://user:pass@host` (a bare ssh user such as `git@` is not a secret) @param {string} url */
|
|
49
|
+
export function urlCarriesLogin(url: string): boolean;
|
|
50
|
+
/** the address with any login masked, for the words a person reads @param {string} url */
|
|
51
|
+
export function maskUrl(url: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* The environment of every git child of this piece: the panel's env MINUS what `CLOSE_ENV_DENY` names (the one deny list, never re-spelled), KEEPING `HOME` and
|
|
54
|
+
* `SSH_AUTH_SOCK` (the documented exception: stripping it breaks git over ssh), with prompts off - no human is mid-run, so a credential question is a refusal, never a wait.
|
|
55
|
+
* @param {NodeJS.ProcessEnv} base @returns {NodeJS.ProcessEnv}
|
|
56
|
+
*/
|
|
57
|
+
export function prGitEnv(base: NodeJS.ProcessEnv): NodeJS.ProcessEnv;
|
|
58
|
+
/**
|
|
59
|
+
* The argv of one git call. The subcommand is checked against `PR_GIT_SUBCOMMANDS` HERE, before any process exists.
|
|
60
|
+
* @param {string} sub @param {string[]} rest @param {string[]} [cfg] extra `-c key=value` words
|
|
61
|
+
* @returns {string[]}
|
|
62
|
+
*/
|
|
63
|
+
export function prGitArgs(sub: string, rest: string[], cfg?: string[]): string[];
|
|
64
|
+
/**
|
|
65
|
+
* The fetch (spec item 3): the PR's head ref from the base repo into bareloop's private ref, so the object survives gc during the run and no branch, tag or FETCH_HEAD is touched.
|
|
66
|
+
* The `+` lets a Rerun move the ref when the PR was force-pushed since the last run.
|
|
67
|
+
* @param {string} remote @param {number} n @param {{writeFetchHead?: boolean}} [o] `false` (default) = `--no-write-fetch-head`
|
|
68
|
+
* @returns {string[]} the subcommand's own args (after `fetch`)
|
|
69
|
+
*/
|
|
70
|
+
export function fetchRest(remote: string, n: number, { writeFetchHead }?: {
|
|
71
|
+
writeFetchHead?: boolean;
|
|
72
|
+
}): string[];
|
|
73
|
+
/** git's reason, one line, with logins in addresses and secret shapes masked @param {string} stderr @param {string} [fallback] */
|
|
74
|
+
export function firstReason(stderr: string, fallback?: string): string;
|
|
75
|
+
/**
|
|
76
|
+
* @typedef {object} PrCheckout
|
|
77
|
+
* @property {string} sha the PR's head commit, now the worktree's detached HEAD @property {number} number @property {string} ownerRepo `owner/repo`
|
|
78
|
+
* @property {string} remote the remote the fetch used @property {string} ref the private ref @property {{ref: string|null, sha: string}|null} base @property {string|null} mergeBase
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* RUN START for a PR job: fetch the PR's head, verify it is the sha the frozen record names, and move the run's worktree there (detached). Every refusal is plain words
|
|
82
|
+
* that end in "Nothing spent." and leaves no private ref behind. Never pushes; the person's own tree is never touched (the worktree is the run's).
|
|
83
|
+
* @param {object} o
|
|
84
|
+
* @param {string} o.repo the person's repo root (the worktree's `repo` in source.json) @param {string} o.worktree the run's worktree
|
|
85
|
+
* @param {{url: string, record: any, reread?: () => Promise<any>}} o.pr `url` = the PR address; `record` = the frozen PR record; `reread` = optional: read the record again (one try, spec item 5)
|
|
86
|
+
* @param {NodeJS.ProcessEnv} [o.env] @param {number} [o.timeoutMs] @param {typeof spawnClose} [o.run] test seam for the child process
|
|
87
|
+
* @returns {Promise<{ok: true, checkout: PrCheckout}|{ok: false, error: string}>}
|
|
88
|
+
*/
|
|
89
|
+
export function checkoutPrHead({ repo, worktree, pr, env, timeoutMs, run }: {
|
|
90
|
+
repo: string;
|
|
91
|
+
worktree: string;
|
|
92
|
+
pr: {
|
|
93
|
+
url: string;
|
|
94
|
+
record: any;
|
|
95
|
+
reread?: () => Promise<any>;
|
|
96
|
+
};
|
|
97
|
+
env?: NodeJS.ProcessEnv | undefined;
|
|
98
|
+
timeoutMs?: number | undefined;
|
|
99
|
+
run?: typeof spawnClose | undefined;
|
|
100
|
+
}): Promise<{
|
|
101
|
+
ok: true;
|
|
102
|
+
checkout: PrCheckout;
|
|
103
|
+
} | {
|
|
104
|
+
ok: false;
|
|
105
|
+
error: string;
|
|
106
|
+
}>;
|
|
107
|
+
/**
|
|
108
|
+
* A RESUME's check (spec item 12): the recorded PR head is an ancestor of the worktree's HEAD, so the work branch still holds the PR's code. No fetch.
|
|
109
|
+
* @param {string} worktree @param {string} prHead @param {{run?: typeof spawnClose, env?: NodeJS.ProcessEnv}} [o]
|
|
110
|
+
* @returns {Promise<boolean>}
|
|
111
|
+
*/
|
|
112
|
+
export function prHeadIsAncestor(worktree: string, prHead: string, { run, env }?: {
|
|
113
|
+
run?: typeof spawnClose;
|
|
114
|
+
env?: NodeJS.ProcessEnv;
|
|
115
|
+
}): Promise<boolean>;
|
|
116
|
+
/**
|
|
117
|
+
* Write the checkout into the run's `source.json` (spec item 6): `seed:<sha>`, `prHead`, `prNumber`, `prBase:{ref,sha}`. Only these fields change.
|
|
118
|
+
* @param {string} into the prepared copy's folder (holds source.json) @param {PrCheckout} c
|
|
119
|
+
*/
|
|
120
|
+
export function recordPrOnManifest(into: string, c: PrCheckout): void;
|
|
121
|
+
export { prRefName };
|
|
122
|
+
/** the ONLY git subcommands this piece may run (spec item 10a): anything else throws before a process is made. Nothing that writes to a remote, to the person's config or to their index is on the list. */
|
|
123
|
+
export const PR_GIT_SUBCOMMANDS: readonly string[];
|
|
124
|
+
/** the hard deadline of the fetch, in ms (spec item 3: 120 s; tighten-only, like the other clamps) */
|
|
125
|
+
export const PR_FETCH_DEADLINE_MS: 120000;
|
|
126
|
+
export type PrCheckout = {
|
|
127
|
+
/**
|
|
128
|
+
* the PR's head commit, now the worktree's detached HEAD
|
|
129
|
+
*/
|
|
130
|
+
sha: string;
|
|
131
|
+
number: number;
|
|
132
|
+
/**
|
|
133
|
+
* `owner/repo`
|
|
134
|
+
*/
|
|
135
|
+
ownerRepo: string;
|
|
136
|
+
/**
|
|
137
|
+
* the remote the fetch used
|
|
138
|
+
*/
|
|
139
|
+
remote: string;
|
|
140
|
+
/**
|
|
141
|
+
* the private ref
|
|
142
|
+
*/
|
|
143
|
+
ref: string;
|
|
144
|
+
base: {
|
|
145
|
+
ref: string | null;
|
|
146
|
+
sha: string;
|
|
147
|
+
} | null;
|
|
148
|
+
mergeBase: string | null;
|
|
149
|
+
};
|
|
150
|
+
import { spawnClose } from './ralph.js';
|
|
151
|
+
import { prRefName } from './worktree.js';
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which buttons a look question offers. Agree only when it carries a proposal (a reading ask with its reading, a check-pick ask with its check); Drop it only where "drop it" leaves
|
|
3
|
+
* one of the person's own `~` rules Not checked (a can't-check ask or a check-pick ask about a rule number).
|
|
4
|
+
* @param {{source?: string, ask?: string, reading?: unknown, check?: unknown, rule?: unknown}} q @returns {{agree: boolean, drop: boolean}}
|
|
5
|
+
*/
|
|
6
|
+
export function offersOf(q: {
|
|
7
|
+
source?: string;
|
|
8
|
+
ask?: string;
|
|
9
|
+
reading?: unknown;
|
|
10
|
+
check?: unknown;
|
|
11
|
+
rule?: unknown;
|
|
12
|
+
}): {
|
|
13
|
+
agree: boolean;
|
|
14
|
+
drop: boolean;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* A look question as the PANEL shows it: the code's own answer words (`Answer "agree"...` / `Answer "drop it"...`) cut off the end, because the buttons and the box say it.
|
|
18
|
+
* Only the known tails are cut, matched exactly as a suffix (never a pattern over the prose); a question that ends in none of them is returned whole.
|
|
19
|
+
* @param {{question: string, line?: number, source?: string}} q @returns {string}
|
|
20
|
+
*/
|
|
21
|
+
export function panelQuestionText(q: {
|
|
22
|
+
question: string;
|
|
23
|
+
line?: number;
|
|
24
|
+
source?: string;
|
|
25
|
+
}): string;
|
|
26
|
+
/**
|
|
27
|
+
* What the panel's question box shows for one pending ask. Only a question the person answers (`kind: 'answer'`) has a box; every other ask (language, menu, install)
|
|
28
|
+
* keeps the chat input. `sendChoice` = the choice the box's own Send posts.
|
|
29
|
+
* @param {{kind: string, source?: string, index?: number, total?: number, question?: string, line?: number, offers?: {agree: boolean, drop: boolean}, folder?: string, current?: string}} step
|
|
30
|
+
* @returns {{head: string, line: string, text: string, choices: {choice: string, label: string}[], orLabel: string|null, sendChoice: string}|null}
|
|
31
|
+
*/
|
|
32
|
+
export function boxFor(step: {
|
|
33
|
+
kind: string;
|
|
34
|
+
source?: string;
|
|
35
|
+
index?: number;
|
|
36
|
+
total?: number;
|
|
37
|
+
question?: string;
|
|
38
|
+
line?: number;
|
|
39
|
+
offers?: {
|
|
40
|
+
agree: boolean;
|
|
41
|
+
drop: boolean;
|
|
42
|
+
};
|
|
43
|
+
folder?: string;
|
|
44
|
+
current?: string;
|
|
45
|
+
}): {
|
|
46
|
+
head: string;
|
|
47
|
+
line: string;
|
|
48
|
+
text: string;
|
|
49
|
+
choices: {
|
|
50
|
+
choice: string;
|
|
51
|
+
label: string;
|
|
52
|
+
}[];
|
|
53
|
+
orLabel: string | null;
|
|
54
|
+
sendChoice: string;
|
|
55
|
+
} | null;
|
|
56
|
+
/**
|
|
57
|
+
* The door's check of a choice sent for the pending ask. Null = accepted; else the refusal words.
|
|
58
|
+
* @param {{kind: string, source?: string, rule?: unknown, offers?: {agree: boolean, drop: boolean}}} step @param {unknown} choice @returns {string|null}
|
|
59
|
+
*/
|
|
60
|
+
export function refuseChoice(step: {
|
|
61
|
+
kind: string;
|
|
62
|
+
source?: string;
|
|
63
|
+
rule?: unknown;
|
|
64
|
+
offers?: {
|
|
65
|
+
agree: boolean;
|
|
66
|
+
drop: boolean;
|
|
67
|
+
};
|
|
68
|
+
}, choice: unknown): string | null;
|
|
69
|
+
/**
|
|
70
|
+
* What a choice resolves the question with: the words the asker reads (today's own words for the effect, so the drafting log and the CLI path see the same), and the chat line the person
|
|
71
|
+
* sees as their own. `rule` = the box's words kept whole.
|
|
72
|
+
* @param {unknown} choice @param {unknown} text @returns {{value: string, shown: string}|{error: string}}
|
|
73
|
+
*/
|
|
74
|
+
export function resolveChoice(choice: unknown, text: unknown): {
|
|
75
|
+
value: string;
|
|
76
|
+
shown: string;
|
|
77
|
+
} | {
|
|
78
|
+
error: string;
|
|
79
|
+
};
|
|
80
|
+
/** the door's refusals, word for word (fwd am31); a refusal leaves the question open and writes nothing */
|
|
81
|
+
export const CHOICE_SAYS: Readonly<{
|
|
82
|
+
bad: "That answer is not one of the choices. Nothing was saved.";
|
|
83
|
+
notOffered: "That choice is not offered for this question. Nothing was saved.";
|
|
84
|
+
outOfDate: "This page is out of date. Reload it and answer again. Nothing was saved.";
|
|
85
|
+
noRule: "That question is about the job line, not one of your ~ rules, so there is nothing to drop. Agree, or type your own words. Nothing was saved.";
|
|
86
|
+
blank: "An answer is needed here — there is no skip. Type it in the box and press Send.";
|
|
87
|
+
}>;
|
package/types/readshim.d.ts
CHANGED
|
@@ -46,9 +46,9 @@ export function buildReadMap({ rel, lines, chunks }: {
|
|
|
46
46
|
symbols: number;
|
|
47
47
|
} | null;
|
|
48
48
|
/**
|
|
49
|
-
* @typedef {{root: string, hasGet: boolean, getNode: (rel: string) => any, refresh?: (() => Promise<unknown>)|null, emit: (type: string, data: object) => void}} ReadMapOpts
|
|
49
|
+
* @typedef {{root: string, hasGet: boolean, getNode: (rel: string) => any, indexed?: (() => boolean)|null, refresh?: (() => Promise<unknown>)|null, emit: (type: string, data: object) => void}} ReadMapOpts
|
|
50
50
|
* `root`: the job root (paths are made relative to it); `hasGet`: this worker holds `ctx_get` (a map hands out handles only that tool opens);
|
|
51
|
-
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
51
|
+
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `indexed`: whether the job has an index at all (`lc.indexed`; false skips with `no-index`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
52
52
|
* `emit`: the spine channel, for the report-only `read-map` / `read-map-skip` records (counts and a reason, never text).
|
|
53
53
|
*/
|
|
54
54
|
/**
|
|
@@ -135,13 +135,14 @@ export const READ_MAP_MIN_LINES: 200;
|
|
|
135
135
|
export const READ_MAP_CAP: 4000;
|
|
136
136
|
/**
|
|
137
137
|
* `root`: the job root (paths are made relative to it); `hasGet`: this worker holds `ctx_get` (a map hands out handles only that tool opens);
|
|
138
|
-
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
138
|
+
* `getNode`: the LiteCtx index's node for a path (its `chunks`); `indexed`: whether the job has an index at all (`lc.indexed`; false skips with `no-index`); `refresh`: re-index first so the ranges are true to the file as it now is;
|
|
139
139
|
* `emit`: the spine channel, for the report-only `read-map` / `read-map-skip` records (counts and a reason, never text).
|
|
140
140
|
*/
|
|
141
141
|
export type ReadMapOpts = {
|
|
142
142
|
root: string;
|
|
143
143
|
hasGet: boolean;
|
|
144
144
|
getNode: (rel: string) => any;
|
|
145
|
+
indexed?: (() => boolean) | null;
|
|
145
146
|
refresh?: (() => Promise<unknown>) | null;
|
|
146
147
|
emit: (type: string, data: object) => void;
|
|
147
148
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** The one spelling of the drafting sessions folder (the session and the routes both read it).
|
|
2
|
+
* @param {string|undefined} root */
|
|
3
|
+
export function sessionsRootOf(root: string | undefined): string;
|
|
4
|
+
/** @param {string} root @param {string} id revises used by that draft; no file, or an unreadable one, is 0 (a draft from before the count existed)
|
|
5
|
+
* @returns {number} */
|
|
6
|
+
export function revisesUsedOf(root: string, id: string): number;
|
|
7
|
+
/** The revises a draft will have used, given what it follows: a Revise adds one to the draft it follows; Start over, or following nothing, starts at 0.
|
|
8
|
+
* @param {string} root @param {unknown} carryFrom @param {unknown} carryKind
|
|
9
|
+
* @returns {number} */
|
|
10
|
+
export function nextRevisesUsed(root: string, carryFrom: unknown, carryKind: unknown): number;
|
|
11
|
+
/** Plain words when that revise would be a third; null when it is allowed. $0: called before anything is ended or started.
|
|
12
|
+
* @param {string} root @param {unknown} carryFrom @param {unknown} carryKind
|
|
13
|
+
* @returns {string|null} */
|
|
14
|
+
export function reviseRefusal(root: string, carryFrom: unknown, carryKind: unknown): string | null;
|
|
15
|
+
/** The words the draft record and the Audit use for a draft that follows another (fwdloop am14 item 6): `revise 1`, `revise 2`, `start over`; a first draft has none.
|
|
16
|
+
* @param {unknown} carryFrom @param {unknown} carryKind @param {number} used this draft's revises used
|
|
17
|
+
* @returns {string|null} */
|
|
18
|
+
export function draftLabelOf(carryFrom: unknown, carryKind: unknown, used: number): string | null;
|
|
19
|
+
/** @param {string} dir the session's folder @param {number} used */
|
|
20
|
+
export function writeRevisesUsed(dir: string, used: number): void;
|
|
21
|
+
export const MAX_REVISES: 2;
|
|
22
|
+
/** the count's file, inside a drafting session folder only */
|
|
23
|
+
export const REVISES_FILE: "revises.json";
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ONE user message: the person's job lines (their `~` rules numbered), the look, the inputs (bounded).
|
|
3
|
+
* @param {{jobLines: any[], look: any, texts: Record<string, string>}} o
|
|
4
|
+
* @returns {string}
|
|
5
|
+
*/
|
|
6
|
+
export function rowEditUserText({ jobLines, look, texts }: {
|
|
7
|
+
jobLines: any[];
|
|
8
|
+
look: any;
|
|
9
|
+
texts: Record<string, string>;
|
|
10
|
+
}): string;
|
|
11
|
+
/** the tool a row-edit reply is delivered through */
|
|
12
|
+
export const ROW_EDIT_TOOL: "submit_edits";
|
|
13
|
+
/** what an acknowledged reply returns (the loop ends the call the moment the tool fires) */
|
|
14
|
+
export const ROW_EDIT_ACK: "edits received";
|
|
15
|
+
/** the drafter's system text for the row-edit turn (a prompt register: src/promptregisters.js) */
|
|
16
|
+
export const ROW_EDIT_SYSTEM: string;
|
|
17
|
+
/** the fixed sentence that follows the refusals in a revise turn (the turn carries each refusal's own reason and nothing else) */
|
|
18
|
+
export const ROW_EDIT_REVISE: "Send corrected edits only (an empty \"edits\" list is a good answer).";
|
|
19
|
+
export function rowEditChannel(ticket?: boolean): {
|
|
20
|
+
name: string;
|
|
21
|
+
instruction: string;
|
|
22
|
+
textPath: string;
|
|
23
|
+
tool: (box: {
|
|
24
|
+
calls: any[];
|
|
25
|
+
}) => {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
parameters: Record<string, any>;
|
|
29
|
+
execute: (args: any) => Promise<string>;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
export function editsOf(artifact: any): any[];
|