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,42 @@
|
|
|
1
|
+
// MCP + tickets piece 9 (ITEM33-BUILD R7, port of fwd's `cardSchedule`, src/panel/authortrigger.js@v0.29.0): the $0 check of the New job card's Schedule row, before any session exists.
|
|
2
|
+
// The row's pick becomes the typed trigger the job is signed with (`spec.trigger`): "Every day at HH:MM" is the card's own data, "When a new ticket arrives" is filled from the card's
|
|
3
|
+
// Inputs (exactly one issues-list line) and the pick's tools, the same `ticketLookOf` the sign-time check and the scheduler's look read. By hand = no schedule at all: the key stays absent,
|
|
4
|
+
// so a job with no schedule hashes exactly as before. Pure; writes nothing.
|
|
5
|
+
import { validateTrigger, isClockTrigger, isTicketTrigger } from './trigger.js';
|
|
6
|
+
import { ticketInputLabels, ticketLookOf } from './ticketschedule.js';
|
|
7
|
+
import { parseTicketList } from './ticketshape.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @param {any} card the card as submitted (`card.schedule` = {kind, hour?, minute?, day?} or absent / null / {kind: 'hand'})
|
|
11
|
+
* @param {{ flowType: 'plain'|'mcp'|'tickets', pick: {server: string, tools: string[]}|null, inputs: Array<{label: string, value: string}>, hasSchedule?: (job: string) => boolean }} o
|
|
12
|
+
* `hasSchedule(job)` = the job (by the card's name) already has a schedule file: the card does not overwrite it
|
|
13
|
+
* @returns {{ok: true, trigger: import('./trigger.js').Trigger|null} | {ok: false, error: string}}
|
|
14
|
+
*/
|
|
15
|
+
export function cardScheduleOf(card, o) {
|
|
16
|
+
const pick = card?.schedule;
|
|
17
|
+
if (pick === undefined || pick === null || pick.kind === 'hand') return { ok: true, trigger: null };
|
|
18
|
+
/** @param {string} error */
|
|
19
|
+
const no = (error) => ({ ok: /** @type {const} */ (false), error });
|
|
20
|
+
if (typeof pick !== 'object' || Array.isArray(pick)) return no('The Schedule is not something this card can sign. Nothing spent.');
|
|
21
|
+
if (typeof card.jobName === 'string' && card.jobName !== '' && o.hasSchedule?.(card.jobName)) {
|
|
22
|
+
return no(`The job "${card.jobName}" already has a schedule. Change it with Cancel / modify schedule on one of its runs. Nothing spent.`);
|
|
23
|
+
}
|
|
24
|
+
/** @type {unknown} */
|
|
25
|
+
let want = pick;
|
|
26
|
+
if (pick.kind === 'new-ticket') {
|
|
27
|
+
const spec = { flowType: o.flowType, mcp: o.pick, inputs: o.inputs };
|
|
28
|
+
const labels = ticketInputLabels(spec);
|
|
29
|
+
if (labels.length === 0) {
|
|
30
|
+
// the same sentence the sign-time check would say (not a Tickets job, no issues list, no list_issues signed)
|
|
31
|
+
const first = (o.inputs.find((i) => { const l = parseTicketList(i.value); return l.ok && l.kind === 'issue'; }) ?? o.inputs.find((i) => i.label))?.label ?? '';
|
|
32
|
+
const look = ticketLookOf(spec, { kind: 'new-ticket', input: first });
|
|
33
|
+
return no(`${look.ok ? 'This job cannot start on a new ticket.' : look.say.replace(/ Nothing was changed\.$/, '')} Nothing spent.`);
|
|
34
|
+
}
|
|
35
|
+
if (labels.length !== 1) return no('When a new ticket arrives needs exactly one ticket list in Inputs. Nothing spent.');
|
|
36
|
+
want = { kind: 'new-ticket', input: labels[0] };
|
|
37
|
+
}
|
|
38
|
+
const tv = validateTrigger(want);
|
|
39
|
+
if (!tv.ok) return no(`${tv.say}. Nothing spent.`);
|
|
40
|
+
if (!isClockTrigger(tv.trigger) && !isTicketTrigger(tv.trigger)) return no('The New job card can start a job every day or on a new ticket. A file trigger is set after the first good run. Nothing spent.');
|
|
41
|
+
return { ok: true, trigger: tv.trigger };
|
|
42
|
+
}
|