@open-tomato/rafa 0.31.0 → 0.32.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.
@@ -4,10 +4,10 @@ import {
4
4
  commandSpelling,
5
5
  isRoutingWord,
6
6
  isTopLevel
7
- } from "./index-e10rwa4g.js";
7
+ } from "./index-mt6hpsry.js";
8
8
  import {
9
9
  describeValue
10
- } from "./index-dnwcx1cs.js";
10
+ } from "./index-rs79dq9e.js";
11
11
 
12
12
  // src/cli/registry.ts
13
13
  var REFUSAL = "command registry";
@@ -1,18 +1,19 @@
1
1
  // @bun
2
2
  import {
3
+ BOARD_RELATIONSHIP_MODES,
3
4
  CLAUDE_SETTING_SOURCES,
4
5
  CONFIG_VERSIONS,
5
6
  INJECT_MODES,
6
- MODULE_SOURCE_KEYS,
7
- OPTIONAL_ITEM_KEYS,
8
7
  OUTPUT_MODES,
9
8
  PR_PROVIDERS,
10
9
  RELEASE_AUTO,
11
- REQUIRED_ITEM_KEYS,
12
10
  SKILL_TIERS,
13
11
  STORE_BACKENDS,
14
12
  SYNC_STRATEGIES,
13
+ below,
15
14
  busyTimeoutMs,
15
+ claimsAhead,
16
+ claimsStaleAfter,
16
17
  confidence,
17
18
  dayCount,
18
19
  describeValue,
@@ -23,14 +24,14 @@ import {
23
24
  issueNumber,
24
25
  lessonSwitch,
25
26
  listOf,
27
+ mapReading,
26
28
  mergeMethod,
27
29
  messageOf,
28
- moduleSource,
29
30
  oneOf,
30
- optionalPrerequisite,
31
31
  recurrenceCount,
32
+ refused,
33
+ refusedWith,
32
34
  releaseEnabled,
33
- requiredPrerequisite,
34
35
  routeTarget,
35
36
  skillResolverName,
36
37
  subsetOf,
@@ -38,7 +39,79 @@ import {
38
39
  tierPin,
39
40
  tierSwitch,
40
41
  usdAmount
41
- } from "./index-dnwcx1cs.js";
42
+ } from "./index-rs79dq9e.js";
43
+
44
+ // src/config-items.ts
45
+ var itemText = text("a non-empty string");
46
+ function readKeyedItem(shape, raw, at) {
47
+ const choices = shape.kinds.join(", ");
48
+ if (!isMapping(raw))
49
+ return refused(at, raw, `a mapping naming one of: ${choices}`);
50
+ const entries = Object.entries(raw);
51
+ const kinds = shape.kinds.filter((kind2) => entries.some(([name]) => name === kind2));
52
+ const [kind] = kinds;
53
+ if (kind === undefined)
54
+ return refusedWith([`${at.label} names none of: ${choices}`]);
55
+ if (kinds.length > 1) {
56
+ const named2 = kinds.join(" and ");
57
+ return refusedWith([`${at.label} names ${named2}, expected exactly one of: ${choices}`]);
58
+ }
59
+ const optionalKeys = shape.optionalFor(kind);
60
+ const problems = [];
61
+ const extras = [];
62
+ const optional = new Map;
63
+ let named;
64
+ for (const [name, value] of entries) {
65
+ if (name !== kind && !optionalKeys.includes(name)) {
66
+ extras.push({ key: `${at.key}.${name}`, value });
67
+ continue;
68
+ }
69
+ if (name !== kind && value === null)
70
+ continue;
71
+ const reading = itemText(value, below(at, `.${name}`));
72
+ problems.push(...reading.problems);
73
+ if (reading.value === undefined)
74
+ continue;
75
+ if (name === kind)
76
+ named = reading.value;
77
+ else
78
+ optional.set(name, reading.value);
79
+ }
80
+ return problems.length > 0 || named === undefined ? { value: undefined, problems, extras } : { value: { kind, named, optional }, problems, extras };
81
+ }
82
+ var PREREQUISITE_KINDS = ["tool", "env", "service", "lsp"];
83
+ var REQUIRED_ITEM_KEYS = [...PREREQUISITE_KINDS, "probe"];
84
+ var OPTIONAL_ITEM_KEYS = [...REQUIRED_ITEM_KEYS, "reason"];
85
+ var requiredPrerequisite = (raw, at) => {
86
+ const shape = { kinds: PREREQUISITE_KINDS, optionalFor: () => ["probe"] };
87
+ return mapReading(readKeyedItem(shape, raw, at), (item) => Object.freeze({
88
+ kind: item.kind,
89
+ name: item.named,
90
+ probe: item.optional.get("probe") ?? null
91
+ }));
92
+ };
93
+ var optionalPrerequisite = (raw, at) => {
94
+ const shape = { kinds: PREREQUISITE_KINDS, optionalFor: () => ["probe", "reason"] };
95
+ return mapReading(readKeyedItem(shape, raw, at), (item) => Object.freeze({
96
+ kind: item.kind,
97
+ name: item.named,
98
+ probe: item.optional.get("probe") ?? null,
99
+ reason: item.optional.get("reason") ?? null
100
+ }));
101
+ };
102
+ var MODULE_SOURCE_KINDS = ["npm", "github", "path"];
103
+ var MODULE_SOURCE_KEYS = [...MODULE_SOURCE_KINDS, "ref"];
104
+ var moduleSource = (raw, at) => {
105
+ const shape = {
106
+ kinds: MODULE_SOURCE_KINDS,
107
+ optionalFor: (kind) => kind === "github" ? ["ref"] : []
108
+ };
109
+ return mapReading(readKeyedItem(shape, raw, at), (item) => Object.freeze({
110
+ kind: item.kind,
111
+ location: item.named,
112
+ ref: item.optional.get("ref") ?? null
113
+ }));
114
+ };
42
115
 
43
116
  // src/config-schema.ts
44
117
  import { join } from "path";
@@ -115,7 +188,8 @@ var RELEASE_DEFAULTS = Object.freeze({
115
188
  releaseFragments: ".changes",
116
189
  releaseStrategy: "semver-by-level",
117
190
  releaseSettle: "push",
118
- releaseTag: "manual"
191
+ releaseTag: "manual",
192
+ releasePublishCommand: "npm publish"
119
193
  });
120
194
  var DANGEROUS_RELEASE_DEFAULTS = Object.freeze({
121
195
  dangerousAcceptVersionCollision: false
@@ -151,7 +225,12 @@ var RELEASE_SETTINGS = {
151
225
  },
152
226
  releaseStrategy: { key: "release.strategy", read: releaseStrategy, cli: false },
153
227
  releaseSettle: { key: "release.settle", read: releaseSettleMode, cli: false },
154
- releaseTag: { key: "release.tag", read: releaseTagMode, cli: false }
228
+ releaseTag: { key: "release.tag", read: releaseTagMode, cli: false },
229
+ releasePublishCommand: {
230
+ key: "release.publishCommand",
231
+ read: text("a publish command"),
232
+ cli: false
233
+ }
155
234
  };
156
235
  var DANGEROUS_RELEASE_SETTINGS = {
157
236
  dangerousAcceptVersionCollision: {
@@ -353,7 +432,10 @@ var CONFIG_DEFAULTS = Object.freeze({
353
432
  loopWorktreeDir: join(".rafa", "worktrees"),
354
433
  ...PR_DEFAULTS,
355
434
  boardTrustedAuthors: Object.freeze([]),
435
+ boardRelationships: "labels",
356
436
  roadmapIssue: null,
437
+ claimsStaleAfter: "3d",
438
+ claimsAhead: "off",
357
439
  ...RELEASE_DEFAULTS,
358
440
  cleanupStaleDays: 30,
359
441
  cleanupWorktreeIdleDays: 7,
@@ -430,7 +512,14 @@ var SETTINGS = {
430
512
  read: listOf(githubLogin, "GitHub logins"),
431
513
  cli: false
432
514
  },
515
+ boardRelationships: {
516
+ key: "board.relationships",
517
+ read: oneOf(BOARD_RELATIONSHIP_MODES),
518
+ cli: false
519
+ },
433
520
  roadmapIssue: { key: "roadmap.issue", read: issueNumber, cli: false },
521
+ claimsStaleAfter: { key: "claims.staleAfter", read: claimsStaleAfter, cli: false },
522
+ claimsAhead: { key: "claims.ahead", read: claimsAhead, cli: false },
434
523
  ...RELEASE_SETTINGS,
435
524
  cleanupStaleDays: { key: "cleanup.staleDays", read: dayCount, cli: false },
436
525
  cleanupWorktreeIdleDays: {
@@ -557,7 +646,10 @@ function readLayer(rawOf, atOf) {
557
646
  prResolveBudget: read("prResolveBudget"),
558
647
  prVersionCollision: read("prVersionCollision"),
559
648
  boardTrustedAuthors: read("boardTrustedAuthors"),
649
+ boardRelationships: read("boardRelationships"),
560
650
  roadmapIssue: read("roadmapIssue"),
651
+ claimsStaleAfter: read("claimsStaleAfter"),
652
+ claimsAhead: read("claimsAhead"),
561
653
  releaseEnabled: read("releaseEnabled"),
562
654
  releaseVersionFile: read("releaseVersionFile"),
563
655
  releaseChangelog: read("releaseChangelog"),
@@ -566,6 +658,7 @@ function readLayer(rawOf, atOf) {
566
658
  releaseStrategy: read("releaseStrategy"),
567
659
  releaseSettle: read("releaseSettle"),
568
660
  releaseTag: read("releaseTag"),
661
+ releasePublishCommand: read("releasePublishCommand"),
569
662
  cleanupStaleDays: read("cleanupStaleDays"),
570
663
  cleanupWorktreeIdleDays: read("cleanupWorktreeIdleDays"),
571
664
  cleanupKeep: read("cleanupKeep"),
@@ -1145,4 +1238,4 @@ function activeOutputMode() {
1145
1238
  return activeMode;
1146
1239
  }
1147
1240
 
1148
- export { pinKey, pinLine, collisionMessage, readItemBytes, resolveTiers, findTierItem, DEFAULT_ROUTES, DEFAULT_ROUTING, CONFIG_FILE, CONFIG_DEFAULTS, SETTINGS, ConfigError, configFilePath, parseConfigText, resolveConfig, isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, createTextOutput, activeOutput, activeOutputMode, RAFA_BLOCK_KINDS, isRafaBlockKind, readRafaBlocks, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, FINDING_DOMAINS, CHANGE_LEVELS, parseReport };
1241
+ export { PREREQUISITE_KINDS, requiredPrerequisite, optionalPrerequisite, MODULE_SOURCE_KINDS, pinKey, pinLine, collisionMessage, readItemBytes, resolveTiers, findTierItem, DEFAULT_ROUTES, DEFAULT_ROUTING, CONFIG_FILE, CONFIG_DEFAULTS, SETTINGS, ConfigError, configFilePath, parseConfigText, resolveConfig, isStampableStub, planStubFromPrompt, stampPrompt, planStubFromPath, createTextOutput, activeOutput, activeOutputMode, RAFA_BLOCK_KINDS, isRafaBlockKind, readRafaBlocks, REPORT_STATUSES, FINDING_KINDS, FINDING_SIGNALS, FINDING_DOMAINS, CHANGE_LEVELS, parseReport };
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  describeValue
4
- } from "./index-dnwcx1cs.js";
4
+ } from "./index-rs79dq9e.js";
5
5
 
6
6
  // src/cli/spends.ts
7
7
  var SPENDS_GLYPH = "\uD83E\uDE99";
@@ -3,11 +3,11 @@ import {
3
3
  activeOutput,
4
4
  isStampableStub,
5
5
  readRafaBlocks
6
- } from "./index-t6q4k1tq.js";
6
+ } from "./index-9aph6ft9.js";
7
7
  import {
8
8
  messageOf,
9
9
  parseTaskDeclaration
10
- } from "./index-dnwcx1cs.js";
10
+ } from "./index-rs79dq9e.js";
11
11
  // src/preflight/prerequisites-md.ts
12
12
  import { basename, dirname, join } from "path";
13
13
  var SECTION_AUTO_RE = /\[auto\]/i;