@open-tomato/rafa 0.16.0 → 0.18.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.
@@ -3,9 +3,9 @@ import {
3
3
  DESCRIBE_BINARY,
4
4
  DESCRIBE_SCHEMA_VERSION,
5
5
  describeRegistry
6
- } from "./index-qzhpqmfy.js";
7
- import"./index-p901zs2p.js";
8
- import"./index-n3rw8rhr.js";
6
+ } from "./index-kvnggvyk.js";
7
+ import"./index-ddf85qac.js";
8
+ import"./index-944pncd8.js";
9
9
  export {
10
10
  describeRegistry,
11
11
  DESCRIBE_SCHEMA_VERSION,
@@ -4,12 +4,12 @@ import {
4
4
  openNdjsonStore,
5
5
  openSqliteStore,
6
6
  selectEffortStore
7
- } from "../../index-q491ekzm.js";
8
- import"../../index-6cw1n0qy.js";
9
- import"../../index-p901zs2p.js";
7
+ } from "../../index-at9f1z2z.js";
8
+ import"../../index-jva32qe6.js";
9
+ import"../../index-ddf85qac.js";
10
10
  import {
11
11
  STORE_BACKENDS
12
- } from "../../index-n3rw8rhr.js";
12
+ } from "../../index-944pncd8.js";
13
13
  export {
14
14
  selectEffortStore,
15
15
  openSqliteStore,
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  activeOutput,
4
4
  readRafaBlocks
5
- } from "./index-6cw1n0qy.js";
5
+ } from "./index-jva32qe6.js";
6
6
  import {
7
7
  messageOf,
8
8
  parseTaskDeclaration
9
- } from "./index-n3rw8rhr.js";
9
+ } from "./index-944pncd8.js";
10
10
  // src/preflight/prerequisites-md.ts
11
11
  import { basename, dirname, join } from "path";
12
12
  var SECTION_AUTO_RE = /\[auto\]/i;
@@ -16,7 +16,7 @@ var ITEM_RE = /^-\s+\[\s*\]\s+/;
16
16
  var INLINE_AUTO_RE = /^-\s+\[\s*\]\s+\[auto\]\s+/i;
17
17
  var INLINE_HUMAN_RE = /^-\s+\[\s*\]\s+\[human\]\s+/i;
18
18
  var INLINE_START_RE = /^-\s+\[\s*\]\s+\[start\]\s+/i;
19
- var BACKTICK_RE = /`([^`]+)`/;
19
+ var PROBE_RE = /:\s+`([^`]+)`\s*$/;
20
20
  var HEADING_MARKS_RE = /^#+/;
21
21
  var FENCE_RE = /^ {0,3}(`{3,}|~{3,})/;
22
22
  var NESTED_LIST_ITEM_RE = /^\s+(?:[-*+]|\d+[.)])\s/;
@@ -78,7 +78,7 @@ function isProbedTag(tag) {
78
78
  return tag === "auto" || tag === "start";
79
79
  }
80
80
  function extractProbe(description) {
81
- const probe = BACKTICK_RE.exec(description)?.[1]?.trim();
81
+ const probe = PROBE_RE.exec(description)?.[1]?.trim();
82
82
  return probe || null;
83
83
  }
84
84
  function readItem(lines, lineIndex, inherited) {
@@ -125,24 +125,37 @@ function requiredItemsTagged(items, tag) {
125
125
  const probed = items.filter(isProbed).filter((item) => item.tag === tag);
126
126
  return Object.freeze(probed.map(requiredItem));
127
127
  }
128
- function reminderOf(item) {
128
+ function namedItemOf(item) {
129
129
  return Object.freeze({ description: item.description, tag: item.tag, line: item.lineIndex + 1 });
130
130
  }
131
+ function isMalformed(item) {
132
+ return isProbedTag(item.tag) && item.probe === null;
133
+ }
131
134
  function planPrerequisites(content) {
132
135
  const items = parsePrerequisites(content);
133
136
  return Object.freeze({
134
137
  required: requiredItemsTagged(items, "auto"),
135
138
  startRequired: requiredItemsTagged(items, "start"),
136
- reminders: Object.freeze(items.filter((item) => !isProbed(item)).map(reminderOf))
139
+ reminders: Object.freeze(items.filter((item) => !isProbedTag(item.tag)).map(namedItemOf)),
140
+ malformed: Object.freeze(items.filter(isMalformed).map(namedItemOf))
137
141
  });
138
142
  }
143
+ var PROBE_ITEM_EXAMPLE = "- [ ] uv installed: `uvx --version`";
144
+ function malformedPrerequisiteLines(file, malformed) {
145
+ return [
146
+ `${file} holds ${malformed.length} malformed [auto] or [start] item(s): no command ends the item after a final ": ".`,
147
+ ...malformed.map((item) => ` line ${item.line} [${item.tag}]: ${item.description}`),
148
+ `Write each as ${PROBE_ITEM_EXAMPLE}, its one backticked span a complete command run as written;` + " prove a tool is there with `<tool> --version`, `<tool> --help` or `which <tool>`."
149
+ ];
150
+ }
139
151
  function mergePlanPrerequisites(settings, content) {
140
152
  const plan = planPrerequisites(content ?? "");
141
153
  return Object.freeze({
142
154
  required: Object.freeze([...settings.prerequisitesRequired, ...plan.required]),
143
155
  startRequired: plan.startRequired,
144
156
  optional: Object.freeze([...settings.prerequisitesOptional]),
145
- reminders: plan.reminders
157
+ reminders: plan.reminders,
158
+ malformed: plan.malformed
146
159
  });
147
160
  }
148
161
  function prerequisitesPathForPlan(planPath) {
@@ -1100,4 +1113,4 @@ function renderInjection(request) {
1100
1113
  }
1101
1114
  return { requested: mode, mode, text: RENDERERS[mode](model, location.task), fallback: null };
1102
1115
  }
1103
- export { isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, CHANGE_LEVELS, parseReport, escapeBlockerText, splitBlockerComment, findNextTask, updateTrackerLine, writeTrackerBlocker, trackerPathFor, PLAN_BLOCK_KINDS, PLAN_HEADER_FIELDS, parsePlan, parsePrerequisites, planPrerequisites, mergePlanPrerequisites, prerequisitesPathForPlan, loadPlanPrerequisites, PROBE_TIMEOUT_MS, runShellProbe, runPreflight, renderInjection };
1116
+ export { isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, CHANGE_LEVELS, parseReport, escapeBlockerText, splitBlockerComment, findNextTask, updateTrackerLine, writeTrackerBlocker, trackerPathFor, PLAN_BLOCK_KINDS, PLAN_HEADER_FIELDS, parsePlan, parsePrerequisites, planPrerequisites, malformedPrerequisiteLines, mergePlanPrerequisites, prerequisitesPathForPlan, loadPlanPrerequisites, PROBE_TIMEOUT_MS, runShellProbe, runPreflight, renderInjection };