@open-tomato/rafa 0.24.1 → 0.28.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.
@@ -1,12 +1,13 @@
1
1
  // @bun
2
2
  import {
3
3
  activeOutput,
4
+ isStampableStub,
4
5
  readRafaBlocks
5
- } from "./index-twbp38kz.js";
6
+ } from "./index-rv7y8y1j.js";
6
7
  import {
7
8
  messageOf,
8
9
  parseTaskDeclaration
9
- } from "./index-pmkgvtfe.js";
10
+ } from "./index-sf2brh4w.js";
10
11
  // src/preflight/prerequisites-md.ts
11
12
  import { basename, dirname, join } from "path";
12
13
  var SECTION_AUTO_RE = /\[auto\]/i;
@@ -376,36 +377,6 @@ async function runPreflight(items, options) {
376
377
  knownMissing: Object.freeze(knownMissing)
377
378
  });
378
379
  }
379
- // src/utils/plan-stamp.ts
380
- var STUB_PATTERN = "[A-Za-z0-9._-]+";
381
- var STAMP_PATTERN = new RegExp(`<!--\\s*ralph:plan=(${STUB_PATTERN})\\s*-->`);
382
- function isStampableStub(stub) {
383
- return new RegExp(`^${STUB_PATTERN}$`).test(stub);
384
- }
385
- function planStampLine(stub) {
386
- if (!isStampableStub(stub)) {
387
- throw new Error(`rafa plan stamp: unusable stub ${JSON.stringify(stub)}`);
388
- }
389
- return `<!-- ralph:plan=${stub} -->`;
390
- }
391
- function planStubFromPrompt(content) {
392
- if (typeof content !== "string" || content.length === 0)
393
- return null;
394
- const match = STAMP_PATTERN.exec(content);
395
- const stub = match?.[1];
396
- return stub !== undefined && isStampableStub(stub) ? stub : null;
397
- }
398
- function stampPrompt(stub, prompt) {
399
- return `${prompt}
400
- ${planStampLine(stub)}`;
401
- }
402
- function planStubFromPath(planPath) {
403
- const base = planPath.split("/").pop() ?? planPath;
404
- const match = /^PLAN(?:_TRACKER)?-(.+)\.md$/.exec(base);
405
- const stub = match?.[1];
406
- return stub !== undefined && isStampableStub(stub) ? stub : null;
407
- }
408
-
409
380
  // src/utils/tracker.ts
410
381
  import fs from "fs";
411
382
  var BLOCKER_OPEN = "<!-- blocked: ";
@@ -900,4 +871,4 @@ function renderInjection(request) {
900
871
  }
901
872
  return { requested: mode, mode, text: RENDERERS[mode](model, location.task), fallback: null };
902
873
  }
903
- export { isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, 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 };
874
+ export { 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 };
@@ -11,6 +11,7 @@ import {
11
11
  REQUIRED_ITEM_KEYS,
12
12
  SKILL_TIERS,
13
13
  STORE_BACKENDS,
14
+ busyTimeoutMs,
14
15
  confidence,
15
16
  dayCount,
16
17
  describeValue,
@@ -36,7 +37,7 @@ import {
36
37
  tierPin,
37
38
  tierSwitch,
38
39
  usdAmount
39
- } from "./index-pmkgvtfe.js";
40
+ } from "./index-sf2brh4w.js";
40
41
 
41
42
  // src/config-schema.ts
42
43
  import { join } from "path";
@@ -243,6 +244,7 @@ var CONFIG_FILE = join(".rafa", "config.yaml");
243
244
  var CONFIG_DEFAULTS = Object.freeze({
244
245
  version: 1,
245
246
  store: "sqlite",
247
+ effortBusyTimeoutMs: 5000,
246
248
  inject: "stage",
247
249
  planDir: join(".rafa", "plans"),
248
250
  specsDir: join(".rafa", "specs"),
@@ -286,6 +288,7 @@ var CONFIG_DEFAULTS = Object.freeze({
286
288
  var SETTINGS = {
287
289
  version: { key: "version", read: oneOf(CONFIG_VERSIONS), cli: false },
288
290
  store: { key: "store", read: oneOf(STORE_BACKENDS), cli: true },
291
+ effortBusyTimeoutMs: { key: "effort.busyTimeoutMs", read: busyTimeoutMs, cli: false },
289
292
  inject: { key: "plan.inject", read: oneOf(INJECT_MODES), cli: true },
290
293
  planDir: { key: "plan.dir", read: directory, cli: true },
291
294
  specsDir: { key: "specs.dir", read: directory, cli: true },
@@ -449,6 +452,7 @@ function readLayer(rawOf, atOf) {
449
452
  const layer = {
450
453
  version: read("version"),
451
454
  store: read("store"),
455
+ effortBusyTimeoutMs: read("effortBusyTimeoutMs"),
452
456
  inject: read("inject"),
453
457
  planDir: read("planDir"),
454
458
  specsDir: read("specsDir"),
@@ -936,6 +940,36 @@ function parseReport(output) {
936
940
  return { present: true, report, block, issues };
937
941
  }
938
942
 
943
+ // src/utils/plan-stamp.ts
944
+ var STUB_PATTERN = "[A-Za-z0-9._-]+";
945
+ var STAMP_PATTERN = new RegExp(`<!--\\s*ralph:plan=(${STUB_PATTERN})\\s*-->`);
946
+ function isStampableStub(stub) {
947
+ return new RegExp(`^${STUB_PATTERN}$`).test(stub);
948
+ }
949
+ function planStampLine(stub) {
950
+ if (!isStampableStub(stub)) {
951
+ throw new Error(`rafa plan stamp: unusable stub ${JSON.stringify(stub)}`);
952
+ }
953
+ return `<!-- ralph:plan=${stub} -->`;
954
+ }
955
+ function planStubFromPrompt(content) {
956
+ if (typeof content !== "string" || content.length === 0)
957
+ return null;
958
+ const match = STAMP_PATTERN.exec(content);
959
+ const stub = match?.[1];
960
+ return stub !== undefined && isStampableStub(stub) ? stub : null;
961
+ }
962
+ function stampPrompt(stub, prompt) {
963
+ return `${prompt}
964
+ ${planStampLine(stub)}`;
965
+ }
966
+ function planStubFromPath(planPath) {
967
+ const base = planPath.split("/").pop() ?? planPath;
968
+ const match = /^PLAN(?:_TRACKER)?-(.+)\.md$/.exec(base);
969
+ const stub = match?.[1];
970
+ return stub !== undefined && isStampableStub(stub) ? stub : null;
971
+ }
972
+
939
973
  // src/adapters/output/text.ts
940
974
  var DEBUG_VERBOSITY = 2;
941
975
  function formatPayload(payload) {
@@ -1024,4 +1058,4 @@ function activeOutputMode() {
1024
1058
  return activeMode;
1025
1059
  }
1026
1060
 
1027
- export { pinKey, pinLine, collisionMessage, readItemBytes, resolveTiers, findTierItem, DEFAULT_ROUTES, DEFAULT_ROUTING, CONFIG_FILE, CONFIG_DEFAULTS, SETTINGS, ConfigError, configFilePath, parseConfigText, resolveConfig, RAFA_BLOCK_KINDS, isRafaBlockKind, readRafaBlocks, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, FINDING_DOMAINS, CHANGE_LEVELS, parseReport, createTextOutput, activeOutput, activeOutputMode };
1061
+ export { pinKey, pinLine, collisionMessage, readItemBytes, resolveTiers, findTierItem, DEFAULT_ROUTES, DEFAULT_ROUTING, CONFIG_FILE, CONFIG_DEFAULTS, SETTINGS, ConfigError, configFilePath, parseConfigText, resolveConfig, isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, RAFA_BLOCK_KINDS, isRafaBlockKind, readRafaBlocks, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, FINDING_DOMAINS, CHANGE_LEVELS, parseReport, createTextOutput, activeOutput, activeOutputMode };
@@ -354,6 +354,12 @@ var usdAmount = (raw, at) => {
354
354
  };
355
355
  var issueNumber = (raw, at) => typeof raw === "number" && Number.isSafeInteger(raw) && raw > 0 ? accepted(raw) : refused(at, raw, "an issue number, a whole number above zero");
356
356
  var dayCount = (raw, at) => typeof raw === "number" && Number.isSafeInteger(raw) && raw > 0 ? accepted(raw) : refused(at, raw, "a number of days, a whole number above zero");
357
+ var BUSY_TIMEOUT_MIN_MS = 1;
358
+ var BUSY_TIMEOUT_MAX_MS = 60000;
359
+ function isBusyTimeoutMs(raw) {
360
+ return typeof raw === "number" && Number.isSafeInteger(raw) && raw >= BUSY_TIMEOUT_MIN_MS && raw <= BUSY_TIMEOUT_MAX_MS;
361
+ }
362
+ var busyTimeoutMs = (raw, at) => isBusyTimeoutMs(raw) ? accepted(raw) : refused(at, raw, `a lock wait in milliseconds, a whole number from ${String(BUSY_TIMEOUT_MIN_MS)} to ${String(BUSY_TIMEOUT_MAX_MS)}`);
357
363
  var confidence = (raw, at) => typeof raw === "number" && Number.isFinite(raw) && toHundredths(raw) >= toHundredths(CONFIDENCE_MIN) && toHundredths(raw) <= toHundredths(CONFIDENCE_MAX) ? accepted(raw) : refused(at, raw, `a confidence from ${String(CONFIDENCE_MIN)} to ${String(CONFIDENCE_MAX)}`);
358
364
  function toHundredths(value) {
359
365
  return Math.round(value * 100);
@@ -474,4 +480,4 @@ var moduleSource = (raw, at) => {
474
480
  }));
475
481
  };
476
482
 
477
- export { MERGE_METHODS, isMergeMethod, SKILL_TIERS, RAFA_INSTINCTS_PATH, BUNDLED_SKILLS_DIR, isSkillTier, realEntry, bundledBinDirectory, skillTierDirectory, resolveSkillTiers, resolveInstinctScopes, tierExists, isAgentName, BUDGET_FLAG, parseBudgetUsd, parseTaskDeclaration, stripTaskDeclaration, resolveDeclarationFlags, isMapping, describeValue, messageOf, CONFIG_VERSIONS, STORE_BACKENDS, INJECT_MODES, OUTPUT_MODES, CLAUDE_SETTING_SOURCES, PR_PROVIDERS, RELEASE_AUTO, SKILL_RESOLVERS, oneOf, text, flag, mergeMethod, usdAmount, issueNumber, dayCount, confidence, recurrenceCount, releaseEnabled, tierSwitch, tierPin, routeTarget, skillResolverName, lessonSwitch, isGitHubLogin, githubLogin, listOf, subsetOf, PREREQUISITE_KINDS, REQUIRED_ITEM_KEYS, OPTIONAL_ITEM_KEYS, requiredPrerequisite, optionalPrerequisite, MODULE_SOURCE_KINDS, MODULE_SOURCE_KEYS, moduleSource };
483
+ export { MERGE_METHODS, isMergeMethod, SKILL_TIERS, RAFA_INSTINCTS_PATH, BUNDLED_SKILLS_DIR, isSkillTier, realEntry, bundledBinDirectory, skillTierDirectory, resolveSkillTiers, resolveInstinctScopes, tierExists, isAgentName, BUDGET_FLAG, parseBudgetUsd, parseTaskDeclaration, stripTaskDeclaration, resolveDeclarationFlags, isMapping, describeValue, messageOf, CONFIG_VERSIONS, STORE_BACKENDS, INJECT_MODES, OUTPUT_MODES, CLAUDE_SETTING_SOURCES, PR_PROVIDERS, RELEASE_AUTO, SKILL_RESOLVERS, oneOf, text, flag, mergeMethod, usdAmount, issueNumber, dayCount, BUSY_TIMEOUT_MIN_MS, BUSY_TIMEOUT_MAX_MS, isBusyTimeoutMs, busyTimeoutMs, confidence, recurrenceCount, releaseEnabled, tierSwitch, tierPin, routeTarget, skillResolverName, lessonSwitch, isGitHubLogin, githubLogin, listOf, subsetOf, PREREQUISITE_KINDS, REQUIRED_ITEM_KEYS, OPTIONAL_ITEM_KEYS, requiredPrerequisite, optionalPrerequisite, MODULE_SOURCE_KINDS, MODULE_SOURCE_KEYS, moduleSource };
@@ -4,10 +4,10 @@ import {
4
4
  commandSpelling,
5
5
  isRoutingWord,
6
6
  isTopLevel
7
- } from "./index-4fwgqveh.js";
7
+ } from "./index-4j1e3h26.js";
8
8
  import {
9
9
  describeValue
10
- } from "./index-pmkgvtfe.js";
10
+ } from "./index-sf2brh4w.js";
11
11
 
12
12
  // src/cli/registry.ts
13
13
  var REFUSAL = "command registry";
package/dist/index.js CHANGED
@@ -1,26 +1,18 @@
1
1
  // @bun
2
2
  import {
3
- DISK_FILE_SYSTEM,
4
3
  FEATURE_TYPES,
5
- INIT_COMMAND,
6
4
  MANIFEST_VERSION,
7
5
  OUTPUT_CHANNELS,
8
6
  RUNNING_MANIFEST_SEAMS,
9
- SCOPE_DIR,
10
- ScopeError,
11
7
  collect,
12
- initHint,
13
8
  loadConfig,
14
9
  plan,
15
10
  readConfigFile,
16
11
  report,
17
- resolveScope,
18
- scopeAt,
19
- selfAndAncestors,
20
12
  start,
21
13
  usage,
22
14
  validateManifest
23
- } from "./index-h369efkh.js";
15
+ } from "./index-6jkj0dcx.js";
24
16
  import {
25
17
  PLAN_BLOCK_KINDS,
26
18
  PLAN_HEADER_FIELDS,
@@ -34,16 +26,24 @@ import {
34
26
  renderInjection,
35
27
  runPreflight,
36
28
  runShellProbe
37
- } from "./index-21qkxk63.js";
29
+ } from "./index-p1265xgj.js";
38
30
  import {
39
31
  CORE_ADAPTER_REGISTRY,
32
+ DISK_FILE_SYSTEM,
40
33
  EFFORT_KEY_PROJECTIONS,
34
+ INIT_COMMAND,
41
35
  PORT_VERSIONS,
36
+ SCOPE_DIR,
37
+ ScopeError,
42
38
  createAdapterRegistry,
39
+ initHint,
43
40
  openNdjsonStore,
44
41
  openSqliteStore,
45
- selectEffortStore
46
- } from "./index-7qgng1rf.js";
42
+ resolveScope,
43
+ scopeAt,
44
+ selectEffortStore,
45
+ selfAndAncestors
46
+ } from "./index-4rwvr6t4.js";
47
47
  import {
48
48
  CONFIG_DEFAULTS,
49
49
  CONFIG_FILE,
@@ -58,10 +58,10 @@ import {
58
58
  parseReport,
59
59
  readRafaBlocks,
60
60
  resolveConfig
61
- } from "./index-twbp38kz.js";
61
+ } from "./index-rv7y8y1j.js";
62
62
  import"./index-d6d0942q.js";
63
- import"./index-w1dnwja1.js";
64
- import"./index-4fwgqveh.js";
63
+ import"./index-xwr54rzt.js";
64
+ import"./index-4j1e3h26.js";
65
65
  import {
66
66
  CLAUDE_SETTING_SOURCES,
67
67
  CONFIG_VERSIONS,
@@ -72,7 +72,7 @@ import {
72
72
  PR_PROVIDERS,
73
73
  RELEASE_AUTO,
74
74
  STORE_BACKENDS
75
- } from "./index-pmkgvtfe.js";
75
+ } from "./index-sf2brh4w.js";
76
76
  import"./index-wp8c28fd.js";
77
77
  export {
78
78
  validateManifest,
@@ -12,7 +12,7 @@ import {
12
12
  renderInjection,
13
13
  runPreflight,
14
14
  runShellProbe
15
- } from "../index-21qkxk63.js";
15
+ } from "../index-p1265xgj.js";
16
16
  import {
17
17
  FINDING_KINDS,
18
18
  FINDING_SIGNALS,
@@ -21,10 +21,10 @@ import {
21
21
  isRafaBlockKind,
22
22
  parseReport,
23
23
  readRafaBlocks
24
- } from "../index-twbp38kz.js";
24
+ } from "../index-rv7y8y1j.js";
25
25
  import {
26
26
  INJECT_MODES
27
- } from "../index-pmkgvtfe.js";
27
+ } from "../index-sf2brh4w.js";
28
28
  import"../index-wp8c28fd.js";
29
29
  export {
30
30
  runShellProbe,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-tomato/rafa",
3
- "version": "0.24.1",
3
+ "version": "0.28.0",
4
4
  "description": "Alpha. Runs a plan through the ralph loop: one Claude Code session per task, one commit per task, then a pull request and a CI wait.",
5
5
  "private": false,
6
6
  "publishConfig": {