bareloop 0.55.0 → 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 +47 -0
- package/bareloop.context.md +4 -2
- package/package.json +2 -2
- package/src/authorflow.js +141 -264
- package/src/authoring.js +2 -3
- package/src/authorjob.js +117 -88
- package/src/authorreadout.js +9 -15
- package/src/authorrun.js +13 -4
- package/src/behaviour.js +14 -0
- package/src/blockasks.js +43 -0
- package/src/checkblock.js +772 -0
- package/src/checklist.js +128 -0
- package/src/checkpick.js +30 -312
- package/src/checkwords.js +3 -1
- package/src/declaredclose.js +30 -1
- package/src/destpoint.js +3 -1
- package/src/draftspend.js +46 -0
- package/src/facts.js +8 -1
- package/src/fitcheck.js +5 -3
- package/src/pagemap.js +15 -3
- package/src/panel/authorroutes.js +15 -3
- package/src/panel/authorsession.js +133 -46
- package/src/panel/index.html +194 -22
- package/src/panel/jobplan.js +85 -33
- package/src/panel/server.js +52 -7
- package/src/pickrecord.js +19 -1
- package/src/placerule.js +355 -0
- package/src/promptregisters.js +11 -0
- package/src/questionbox.js +112 -0
- package/src/rowedit.js +115 -0
- package/src/rubricstep.js +212 -125
- package/src/run.js +10 -2
- package/src/userrun.js +46 -1
- package/types/authorflow.d.ts +32 -139
- package/types/authorjob.d.ts +24 -6
- package/types/authorreadout.d.ts +4 -10
- package/types/behaviour.d.ts +12 -0
- package/types/blockasks.d.ts +37 -0
- package/types/checkblock.d.ts +361 -0
- package/types/checklist.d.ts +134 -0
- package/types/checkpick.d.ts +3 -140
- package/types/declaredclose.d.ts +4 -0
- package/types/destpoint.d.ts +2 -0
- package/types/draftspend.d.ts +21 -0
- package/types/fitcheck.d.ts +7 -1
- package/types/pagemap.d.ts +4 -0
- package/types/panel/authorsession.d.ts +13 -2
- package/types/panel/jobgrid.d.ts +8 -8
- package/types/panel/jobplan.d.ts +48 -10
- package/types/panel/server.d.ts +14 -13
- package/types/pickrecord.d.ts +12 -0
- package/types/placerule.d.ts +194 -0
- package/types/questionbox.d.ts +87 -0
- package/types/rowedit.d.ts +32 -0
- package/types/rubricstep.d.ts +91 -48
- package/types/run.d.ts +10 -1
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
// The question box of the drafting chat (hamr 2026-11-12, as fwdloop M10 am29/am30/am31): a question asked while drafting gets its own box in the panel, with the question,
|
|
2
|
+
// its own buttons where the question offers choices (the person's intent is a typed choice, never words read), and one line to type in. This file is the ONE owner of what the
|
|
3
|
+
// panel shows for a pending question and of which choices a question offers (the page draws it, never works it out). The CLI (src/authorrun.js) is a sibling caller of the same
|
|
4
|
+
// questions and keeps typing words; the stored question text never changes, only the panel's copy of it is cut.
|
|
5
|
+
import { readingTail, cantCheckTail, DROP_IT } from './pagemap.js';
|
|
6
|
+
import { HOW_TO_ANSWER } from './checkpick.js';
|
|
7
|
+
import { FIT_ANSWER, FIT_GO_ON } from './fitcheck.js';
|
|
8
|
+
import { DEST_ANSWER } from './destpoint.js';
|
|
9
|
+
|
|
10
|
+
/** the door's refusals, word for word (fwd am31); a refusal leaves the question open and writes nothing */
|
|
11
|
+
export const CHOICE_SAYS = Object.freeze({
|
|
12
|
+
bad: 'That answer is not one of the choices. Nothing was saved.',
|
|
13
|
+
notOffered: 'That choice is not offered for this question. Nothing was saved.',
|
|
14
|
+
outOfDate: 'This page is out of date. Reload it and answer again. Nothing was saved.',
|
|
15
|
+
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.',
|
|
16
|
+
blank: 'An answer is needed here — there is no skip. Type it in the box and press Send.',
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* 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
|
|
21
|
+
* one of the person's own `~` rules Not checked (a can't-check ask or a check-pick ask about a rule number).
|
|
22
|
+
* @param {{source?: string, ask?: string, reading?: unknown, check?: unknown, rule?: unknown}} q @returns {{agree: boolean, drop: boolean}}
|
|
23
|
+
*/
|
|
24
|
+
export function offersOf(q) {
|
|
25
|
+
const look = q.source === 'look';
|
|
26
|
+
const agree = look && ((q.ask === 'reading' && typeof q.reading === 'string') || (q.ask === 'check' && q.check !== null && typeof q.check === 'object'));
|
|
27
|
+
const drop = look && Number.isInteger(q.rule) && (q.ask === 'cant-check' || q.ask === 'check' || q.ask === 'no-check');
|
|
28
|
+
return { agree, drop };
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* 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.
|
|
33
|
+
* 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.
|
|
34
|
+
* @param {{question: string, line?: number, source?: string}} q @returns {string}
|
|
35
|
+
*/
|
|
36
|
+
export function panelQuestionText(q) {
|
|
37
|
+
const text = String(q.question);
|
|
38
|
+
if (q.source === 'fit-check') return text.endsWith(FIT_ANSWER) ? text.slice(0, text.length - FIT_ANSWER.length) : text;
|
|
39
|
+
if (q.source === 'dest-point') return text.endsWith(DEST_ANSWER) ? text.slice(0, text.length - DEST_ANSWER.length) : text;
|
|
40
|
+
if (q.source !== 'look' || !Number.isInteger(q.line)) return text;
|
|
41
|
+
const n = /** @type {number} */ (q.line);
|
|
42
|
+
const hit = [readingTail(n), cantCheckTail(n), ` ${HOW_TO_ANSWER(n, true)}`, ` ${HOW_TO_ANSWER(n, false)}`].find((t) => text.endsWith(t));
|
|
43
|
+
return hit === undefined ? text : text.slice(0, text.length - hit.length);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* 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)
|
|
48
|
+
* keeps the chat input. `sendChoice` = the choice the box's own Send posts.
|
|
49
|
+
* @param {{kind: string, source?: string, index?: number, total?: number, question?: string, line?: number, offers?: {agree: boolean, drop: boolean}, folder?: string, current?: string}} step
|
|
50
|
+
* @returns {{head: string, line: string, text: string, choices: {choice: string, label: string}[], orLabel: string|null, sendChoice: string}|null}
|
|
51
|
+
*/
|
|
52
|
+
export function boxFor(step) {
|
|
53
|
+
if (step.kind !== 'answer' || typeof step.question !== 'string') return null;
|
|
54
|
+
const before = step.source === 'fit-check' || step.source === 'dest-point';
|
|
55
|
+
// the fit check: two buttons, no box (go on = keep drafting; stop = anything else, as typed words did)
|
|
56
|
+
if (step.source === 'fit-check') {
|
|
57
|
+
return { head: 'A question before drafting', line: '', text: panelQuestionText(/** @type {any} */ (step)), choices: [{ choice: 'go-on', label: 'Go on' }, { choice: 'stop', label: 'Stop' }], orLabel: null, sendChoice: 'stop' };
|
|
58
|
+
}
|
|
59
|
+
// the Destination point: yes / no buttons and a box for a different Destination (checked at $0 before it is taken)
|
|
60
|
+
if (step.source === 'dest-point') {
|
|
61
|
+
return {
|
|
62
|
+
head: 'A question before drafting', line: Number.isInteger(step.line) ? `About job line ${step.line}` : '', text: panelQuestionText(/** @type {any} */ (step)),
|
|
63
|
+
choices: [{ choice: 'yes', label: `Yes, set it to ${step.folder ?? ''}` }, { choice: 'no', label: `No, keep ${String(step.current ?? '').trim().replace(/\s*\n\s*/g, ', ')}` }],
|
|
64
|
+
orLabel: 'Or type a different Destination:', sendChoice: 'path',
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
/** @type {{choice: string, label: string}[]} */
|
|
68
|
+
const choices = [];
|
|
69
|
+
if (step.offers?.agree) choices.push({ choice: 'agree', label: 'Agree' });
|
|
70
|
+
if (step.offers?.drop) choices.push({ choice: 'drop', label: 'Drop it' });
|
|
71
|
+
return {
|
|
72
|
+
head: before ? 'A question before drafting' : `A question the plan raised (${step.index ?? 1} of ${step.total ?? 1})`,
|
|
73
|
+
line: Number.isInteger(step.line) ? `About job line ${step.line}` : '',
|
|
74
|
+
text: panelQuestionText({ question: step.question, source: step.source, ...(Number.isInteger(step.line) ? { line: step.line } : {}) }),
|
|
75
|
+
choices,
|
|
76
|
+
orLabel: choices.length > 0 ? 'Or type a new rule:' : 'Type your answer:',
|
|
77
|
+
sendChoice: 'rule',
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** the choices each kind of question's typed answer may name */
|
|
82
|
+
const CHOICES = { look: ['agree', 'drop', 'rule'], 'fit-check': ['go-on', 'stop'], 'dest-point': ['yes', 'no', 'path'] };
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The door's check of a choice sent for the pending ask. Null = accepted; else the refusal words.
|
|
86
|
+
* @param {{kind: string, source?: string, rule?: unknown, offers?: {agree: boolean, drop: boolean}}} step @param {unknown} choice @returns {string|null}
|
|
87
|
+
*/
|
|
88
|
+
export function refuseChoice(step, choice) {
|
|
89
|
+
if (step.kind !== 'answer') return CHOICE_SAYS.notOffered;
|
|
90
|
+
const own = /** @type {string[]|undefined} */ (/** @type {Record<string, string[]>} */ (CHOICES)[step.source === 'fit-check' || step.source === 'dest-point' ? step.source : 'look']);
|
|
91
|
+
if (typeof choice !== 'string' || !(own ?? CHOICES.look).includes(choice)) return CHOICE_SAYS.bad;
|
|
92
|
+
if (step.source === 'fit-check' || step.source === 'dest-point') return null;
|
|
93
|
+
if (choice === 'agree' && step.offers?.agree !== true) return CHOICE_SAYS.notOffered;
|
|
94
|
+
if (choice === 'drop' && step.offers?.drop !== true) return step.source === 'look' && !Number.isInteger(step.rule) ? CHOICE_SAYS.noRule : CHOICE_SAYS.notOffered;
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* 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
|
|
100
|
+
* sees as their own. `rule` = the box's words kept whole.
|
|
101
|
+
* @param {unknown} choice @param {unknown} text @returns {{value: string, shown: string}|{error: string}}
|
|
102
|
+
*/
|
|
103
|
+
export function resolveChoice(choice, text) {
|
|
104
|
+
if (choice === 'agree') return { value: 'agree', shown: 'Agree' };
|
|
105
|
+
if (choice === 'drop') return { value: DROP_IT, shown: 'Drop it' };
|
|
106
|
+
if (choice === 'go-on') return { value: FIT_GO_ON, shown: 'Go on' };
|
|
107
|
+
if (choice === 'stop') return { value: 'stop', shown: 'Stop' };
|
|
108
|
+
if (choice === 'yes') return { value: 'yes', shown: 'Yes' };
|
|
109
|
+
if (choice === 'no') return { value: 'no', shown: 'No' };
|
|
110
|
+
const said = String(text ?? '').replace(/\s*\n\s*/g, ' ').trim();
|
|
111
|
+
return said === '' ? { error: CHOICE_SAYS.blank } : { value: said, shown: said };
|
|
112
|
+
}
|
package/src/rowedit.js
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// THE DRAFTER'S ROW-EDIT TURN of a rubric job (the check block, docs/product/ITEM33-BUILD.md "CHECK BLOCK BUILD SPEC" section 4 and hamr's rulings of 2026-11-12).
|
|
2
|
+
// The AI never writes a part, a check or a declaration: it sends EDITS to the list of checks code keeps in the CheckBlock (src/checkblock.js). Code reads the inputs, proves every
|
|
3
|
+
// word, builds every check and decides what can be checked; every edit is judged on its own. The confirm turn owns the goal (ruling 5), so the reply has none. A Tickets job's reply
|
|
4
|
+
// may also carry the optional `ticketFilter` (ruling 2, R5), checked by its own reader. No text here restates the list of checks (the block's invariant 5): the only list-shaped input is
|
|
5
|
+
// the look's report, an input the drafter already had, and the person's own job lines.
|
|
6
|
+
import { lineRules } from './rubricstep.js';
|
|
7
|
+
import { renderLookReport } from './inputlook.js';
|
|
8
|
+
import { OFFERED } from './checkwords.js';
|
|
9
|
+
import { rubricVocabulary } from 'bareguard';
|
|
10
|
+
import { TICKET_FILTER_SCHEMA_WORDS } from './ticketfilter.js';
|
|
11
|
+
|
|
12
|
+
/** the tool a row-edit reply is delivered through */
|
|
13
|
+
export const ROW_EDIT_TOOL = 'submit_edits';
|
|
14
|
+
/** what an acknowledged reply returns (the loop ends the call the moment the tool fires) */
|
|
15
|
+
export const ROW_EDIT_ACK = 'edits received';
|
|
16
|
+
|
|
17
|
+
const IGNORED_FIELDS = new Set(['id', 'field', 'text', 'strict']);
|
|
18
|
+
const GLOSS = /** @type {Record<string, string>} */ ({ nonEmpty: 'the output is not empty', maxWords: 'at most value words in all', minWords: 'at least value words in all', maxLines: 'at most value lines', listItems: 'exactly value list items (bullets)', maxListItems: 'at most value list items', minListItems: 'at least value list items', sections: 'the output has sections with these names', sectionOrder: 'the sections come in this order', sectionWords: 'each named section has at most wordsPerSection words', mustCarry: 'the output carries these phrases', blockLines: 'blocks of size lines carry these phrases' });
|
|
19
|
+
/** the checks a `pick` edit may name: the checker's own list (the same bareguard vocabulary src/checkpick.js reads) */
|
|
20
|
+
const pickMenu = () => OFFERED.map((r) => {
|
|
21
|
+
const fields = Object.entries(/** @type {any} */ (rubricVocabulary).rules[r].fields).filter(([k]) => !IGNORED_FIELDS.has(k)).map(([k, v]) => `${k}${/** @type {any} */ (v).required ? '' : '?'}`);
|
|
22
|
+
return `- ${r}${fields.length ? ` { ${fields.join(', ')} }` : ''}: ${GLOSS[r] ?? ''}`;
|
|
23
|
+
}).join('\n');
|
|
24
|
+
|
|
25
|
+
/** the drafter's system text for the row-edit turn (a prompt register: src/promptregisters.js) */
|
|
26
|
+
export const ROW_EDIT_SYSTEM = `You help turn the lines of a job into checks, by sending EDITS to a list of checks that code keeps. You never write a check, a stage, a part or a declaration: code reads the inputs, proves every word, builds every check and decides what can be checked. Each edit you send is judged on its own: a refused edit is dropped and says why, and it never costs your other edits.
|
|
27
|
+
|
|
28
|
+
HOW TO ANSWER
|
|
29
|
+
Deliver ONE reply with an "edits" list (the ${ROW_EDIT_TOOL} tool, or one JSON object {"edits": [ ... ]} and nothing else when no tool is offered). An empty "edits" list is a good answer when you have nothing sure to send.
|
|
30
|
+
|
|
31
|
+
THE FOUR EDITS (each has "op"; the op is exactly one of: add, reading, pick, not-checkable. A count is an add with "kind":"count"; "count" is never an op)
|
|
32
|
+
1. add - a check the inputs support that the person did not write and the look did not give:
|
|
33
|
+
{"op":"add","kind":"fact","line":N,"name":"price label","shape":"money","words":["words copied exactly from the input"],"unit":["US dollars"],"currency":["$"],"source":"<input label>"}
|
|
34
|
+
{"op":"add","kind":"phrase","line":N,"name":"letters and spaces only","words":["fixed words copied exactly from the input"],"source":"<input label>"}
|
|
35
|
+
{"op":"add","kind":"count","line":N,"min":3,"max":3} (how many results the job line itself asks for; whole numbers of 1 or more; only when the line states it)
|
|
36
|
+
"shape" is one of phrase, money, number, date, time. A name uses letters, spaces, "-" or "_" only (no digits). "words" are copied exactly from the input, never typed from memory; words the input does not hold are refused. At most 3 adds in one reply: the later ones are refused.
|
|
37
|
+
2. reading - the limit a ~ rule means, for a ~ rule the look tied to a fact ("carries ~ rule N") without giving the limit:
|
|
38
|
+
{"op":"reading","line":N,"rules":[n],"fact":"<that look fact's name>","reading":{"op":"lt","value":450}} (reading op is lt, lte, gt or gte)
|
|
39
|
+
{"op":"reading","line":N,"rules":[n],"fact":"<that look fact's name>","reading":{"op":"between","lo":"05:00","hi":"21:00"}}
|
|
40
|
+
A money limit is a number. A time limit is a 24-hour "HH:MM" string. A limit the person WROTE ("under $450") is a rule that can be checked: give its reading with its number. A number YOU make out of their words ("not a red-eye" becomes a departure time between 06:00 and 21:00) is your proposal for the person to check, and a time limit that you propose is a RANGE (between), never one-sided. A rule that holds more than one amount or range gets no reading.
|
|
41
|
+
3. pick - for a ~ rule that counts words, bullets, lines or sections: the one check that says exactly what that rule says:
|
|
42
|
+
{"op":"pick","line":N,"rules":[n],"check":{"rule":"<one of the checks below>", ...that check's own fields}}
|
|
43
|
+
Use only numbers the ~ rule itself states and only words it contains. The checks (field? = optional):
|
|
44
|
+
${pickMenu()}
|
|
45
|
+
4. not-checkable - a ~ rule no check on the inputs can carry ("the cheapest", "the best", "the newest one"):
|
|
46
|
+
{"op":"not-checkable","line":N,"rule":n,"reason":"plain words, the person's own"}
|
|
47
|
+
|
|
48
|
+
RULES
|
|
49
|
+
- Names, labels and units are the input's own words, copied exactly as the input writes them. When the input does not use the person's word, use the words the input uses; never invent a word the input holds nowhere, and never add a code (like SFO) that the person did not write and the input does not hold.
|
|
50
|
+
- The look (below) is what a read of the inputs already found and code already checks: do not send it again as an add. Use it to name the fact a reading belongs to.
|
|
51
|
+
- Send only what you are sure of. A fact or ~ rule you cannot name from the look and the input is not guessed at.
|
|
52
|
+
- "line" is the job line's number; "rule" and "rules" are the ~ rule numbers shown under that line (1 = the first).`;
|
|
53
|
+
|
|
54
|
+
/** the fixed sentence that follows the refusals in a revise turn (the turn carries each refusal's own reason and nothing else) */
|
|
55
|
+
export const ROW_EDIT_REVISE = 'Send corrected edits only (an empty "edits" list is a good answer).';
|
|
56
|
+
|
|
57
|
+
/** how much of each input the turn is shown (the bound src/checklist.js used) */
|
|
58
|
+
const SHOWN_CHARS = 8000;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The ONE user message: the person's job lines (their `~` rules numbered), the look, the inputs (bounded).
|
|
62
|
+
* @param {{jobLines: any[], look: any, texts: Record<string, string>}} o
|
|
63
|
+
* @returns {string}
|
|
64
|
+
*/
|
|
65
|
+
export function rowEditUserText({ jobLines, look, texts }) {
|
|
66
|
+
const out = ["THE JOB (the person's own words)"];
|
|
67
|
+
for (const l of jobLines) {
|
|
68
|
+
out.push(`${l.n}. ${l.text}`);
|
|
69
|
+
lineRules(l).forEach((r, i) => out.push(` ~ rule ${i + 1}: ${r}`));
|
|
70
|
+
}
|
|
71
|
+
const report = look && typeof look === 'object' ? renderLookReport(look).replace(/^WHAT THE LOOK AT THE INPUTS FOUND[^\n]*/, 'WHAT THE LOOK AT THE INPUTS FOUND - code checks each of these itself; you do not write them') : '';
|
|
72
|
+
if (report) out.push('', report);
|
|
73
|
+
for (const [label, t] of Object.entries(texts)) out.push('', `INPUT "${label}" (first ${SHOWN_CHARS} characters):`, String(t).slice(0, SHOWN_CHARS));
|
|
74
|
+
return out.join('\n');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** @param {boolean} ticket @returns {Record<string, any>} the tool's schema: the edits list (each edit judged by code, so an item is any object), and for a Tickets job the optional ticketFilter */
|
|
78
|
+
const rowEditSchema = (ticket) => ({
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
edits: { type: 'array', items: { type: 'object', properties: { op: { enum: ['add', 'reading', 'pick', 'not-checkable'] } }, required: ['op'] }, description: 'row edits; each is judged on its own' },
|
|
82
|
+
...(ticket ? {
|
|
83
|
+
ticketFilter: {
|
|
84
|
+
type: 'object',
|
|
85
|
+
properties: {
|
|
86
|
+
priority: { type: 'array', items: { type: 'string', enum: ['P0', 'P1', 'P2', 'P3'] }, description: 'priorities a ticket must have; only when a job line names them' },
|
|
87
|
+
labels: { type: 'array', items: { type: 'string' }, description: 'label names, one of which a ticket must carry; only when a job line names them' },
|
|
88
|
+
},
|
|
89
|
+
additionalProperties: false,
|
|
90
|
+
description: TICKET_FILTER_SCHEMA_WORDS,
|
|
91
|
+
},
|
|
92
|
+
} : {}),
|
|
93
|
+
},
|
|
94
|
+
required: ['edits'],
|
|
95
|
+
additionalProperties: false,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/** @param {boolean} ticket the channel `askStructured` reads (src/authorflow.js) */
|
|
99
|
+
export const rowEditChannel = (ticket = false) => ({
|
|
100
|
+
name: ROW_EDIT_TOOL,
|
|
101
|
+
instruction: `Your reply did not deliver exactly one ${ROW_EDIT_TOOL} call. Call ${ROW_EDIT_TOOL} exactly once, with the edits list as its arguments. Do not write the answer as text.`,
|
|
102
|
+
textPath: 'edits',
|
|
103
|
+
tool: (/** @type {{calls: any[]}} */ box) => ({
|
|
104
|
+
name: ROW_EDIT_TOOL,
|
|
105
|
+
description: 'Deliver your row edits (or an empty list). Call this exactly once.',
|
|
106
|
+
parameters: rowEditSchema(ticket),
|
|
107
|
+
execute: async (/** @type {any} */ args) => { box.calls.push(args); return ROW_EDIT_ACK; },
|
|
108
|
+
}),
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The edits a reply holds, as a list (a reply whose `edits` is not a list holds none; each edit is still judged by the block).
|
|
113
|
+
* @param {any} artifact @returns {any[]}
|
|
114
|
+
*/
|
|
115
|
+
export const editsOf = (artifact) => (artifact && typeof artifact === 'object' && Array.isArray(artifact.edits) ? artifact.edits : []);
|