@open-tomato/rafa 0.19.0 → 0.21.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-c5cecsga.js";
7
- import"./index-vg7ycs94.js";
8
- import"./index-cedghpva.js";
6
+ } from "./index-4a45ffqh.js";
7
+ import"./index-28jzpyks.js";
8
+ import"./index-pmkgvtfe.js";
9
9
  import"./index-wp8c28fd.js";
10
10
  export {
11
11
  describeRegistry,
@@ -4,13 +4,13 @@ import {
4
4
  openNdjsonStore,
5
5
  openSqliteStore,
6
6
  selectEffortStore
7
- } from "../../index-gb51x34c.js";
8
- import"../../index-pqrpcfaz.js";
7
+ } from "../../index-am92b8qp.js";
8
+ import"../../index-twbp38kz.js";
9
9
  import"../../index-d6d0942q.js";
10
- import"../../index-vg7ycs94.js";
10
+ import"../../index-28jzpyks.js";
11
11
  import {
12
12
  STORE_BACKENDS
13
- } from "../../index-cedghpva.js";
13
+ } from "../../index-pmkgvtfe.js";
14
14
  import"../../index-wp8c28fd.js";
15
15
  export {
16
16
  selectEffortStore,
@@ -2,11 +2,11 @@
2
2
  import {
3
3
  activeOutput,
4
4
  readRafaBlocks
5
- } from "./index-pqrpcfaz.js";
5
+ } from "./index-twbp38kz.js";
6
6
  import {
7
7
  messageOf,
8
8
  parseTaskDeclaration
9
- } from "./index-cedghpva.js";
9
+ } from "./index-pmkgvtfe.js";
10
10
  // src/preflight/prerequisites-md.ts
11
11
  import { basename, dirname, join } from "path";
12
12
  var SECTION_AUTO_RE = /\[auto\]/i;
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  import {
3
3
  describeValue
4
- } from "./index-cedghpva.js";
4
+ } from "./index-pmkgvtfe.js";
5
5
 
6
6
  // src/cli/spends.ts
7
7
  var SPENDS_GLYPH = "\uD83E\uDE99";
@@ -4,10 +4,10 @@ import {
4
4
  commandSpelling,
5
5
  isRoutingWord,
6
6
  isTopLevel
7
- } from "./index-vg7ycs94.js";
7
+ } from "./index-28jzpyks.js";
8
8
  import {
9
9
  describeValue
10
- } from "./index-cedghpva.js";
10
+ } from "./index-pmkgvtfe.js";
11
11
 
12
12
  // src/cli/registry.ts
13
13
  var REFUSAL = "command registry";
@@ -8,14 +8,14 @@ import {
8
8
  activeOutputMode,
9
9
  createTextOutput,
10
10
  readRafaBlocks
11
- } from "./index-pqrpcfaz.js";
11
+ } from "./index-twbp38kz.js";
12
12
  import {
13
13
  bless,
14
14
  merge
15
15
  } from "./index-d6d0942q.js";
16
16
  import {
17
17
  commandSpelling
18
- } from "./index-vg7ycs94.js";
18
+ } from "./index-28jzpyks.js";
19
19
  import {
20
20
  RAFA_INSTINCTS_PATH,
21
21
  STORE_BACKENDS,
@@ -25,7 +25,7 @@ import {
25
25
  messageOf,
26
26
  resolveInstinctScopes,
27
27
  tierExists
28
- } from "./index-cedghpva.js";
28
+ } from "./index-pmkgvtfe.js";
29
29
  import {
30
30
  actionHash,
31
31
  triggerKey
@@ -176,10 +176,8 @@ function openNdjsonStore(repoRoot) {
176
176
  import { existsSync as existsSync2, mkdirSync as mkdirSync2 } from "fs";
177
177
  import { dirname as dirname2, join as join2 } from "path";
178
178
  import { Database } from "bun:sqlite";
179
- var STORE_FILE_NAME = "effort.sqlite";
180
- function sqliteStorePath(repoRoot) {
181
- return join2(repoRoot, EFFORT_STORE_DIR, STORE_FILE_NAME);
182
- }
179
+
180
+ // src/effort/store/migrations.ts
183
181
  var SQLITE_MIGRATIONS = [
184
182
  `
185
183
  CREATE TABLE sessions (
@@ -334,9 +332,53 @@ var SQLITE_MIGRATIONS = [
334
332
  `
335
333
  ALTER TABLE out_of_scope_bugs
336
334
  ADD COLUMN scope TEXT CHECK (scope IN ('machine', 'rafa'));
335
+ `,
336
+ `
337
+ ALTER TABLE dispatches
338
+ ADD COLUMN resolver TEXT CHECK (resolver IN ('planner', 'tag', 'none'));
339
+ ALTER TABLE dispatches
340
+ ADD COLUMN skills_offered TEXT CHECK (skills_offered IS NULL OR json_type(skills_offered) = 'array');
341
+ ALTER TABLE dispatches
342
+ ADD COLUMN lessons_offered TEXT CHECK (lessons_offered IS NULL OR json_type(lessons_offered) = 'array');
343
+ `,
344
+ `
345
+ CREATE TABLE skill_invocations (
346
+ seq INTEGER PRIMARY KEY,
347
+ session_id TEXT NOT NULL CHECK (session_id <> ''),
348
+ name TEXT CHECK (name <> ''),
349
+ sidechain INTEGER CHECK (sidechain IN (0, 1)),
350
+ count INTEGER CHECK (count IS NULL OR (typeof(count) = 'integer' AND count > 0)),
351
+ CHECK ((name IS NULL) = (count IS NULL) AND (name IS NULL) = (sidechain IS NULL))
352
+ );
353
+
354
+ CREATE UNIQUE INDEX skill_invocations_by_use
355
+ ON skill_invocations (session_id, ifnull(name, ''), ifnull(sidechain, -1));
356
+ `,
357
+ `
358
+ ALTER TABLE task_reports
359
+ ADD COLUMN skills_used TEXT CHECK (skills_used IS NULL OR json_type(skills_used) = 'array');
360
+ `,
361
+ `
362
+ CREATE TABLE plan_ci (
363
+ seq INTEGER PRIMARY KEY,
364
+ plan_stub TEXT NOT NULL CHECK (plan_stub <> ''),
365
+ pr INTEGER NOT NULL CHECK (typeof(pr) = 'integer' AND pr > 0),
366
+ head_sha TEXT NOT NULL CHECK (head_sha <> ''),
367
+ verdict TEXT NOT NULL CHECK (verdict IN ('green', 'red', 'none')),
368
+ failing TEXT NOT NULL CHECK (json_valid(failing) AND json_type(failing) = 'array'),
369
+ read_at TEXT NOT NULL CHECK (read_at <> ''),
370
+ UNIQUE (pr, head_sha, read_at),
371
+ CHECK ((verdict = 'red') = (json_array_length(failing) > 0))
372
+ );
337
373
  `
338
374
  ];
339
375
  var SQLITE_SCHEMA_VERSION = SQLITE_MIGRATIONS.length;
376
+
377
+ // src/effort/store/sqlite.ts
378
+ var STORE_FILE_NAME = "effort.sqlite";
379
+ function sqliteStorePath(repoRoot) {
380
+ return join2(repoRoot, EFFORT_STORE_DIR, STORE_FILE_NAME);
381
+ }
340
382
  var KIND_TABLES = {
341
383
  sessions: { name: "sessions", keyColumn: "session_id" },
342
384
  commits: { name: "commits", keyColumn: "sha" }
@@ -2822,4 +2864,4 @@ function selectEffortStore(repoRoot, config) {
2822
2864
  return adapter.create({ repoRoot });
2823
2865
  }
2824
2866
 
2825
- export { EFFORT_STORE_DIR, effortStorePath, EFFORT_KEY_PROJECTIONS, openNdjsonStore, sqliteStorePath, LONE_SURROGATE, withSqliteStore, writeSqliteStore, openSqliteStore, SKILL_FILE, MARKDOWN_EXTENSION, scanLayout, declaredNameIssue, readFrontmatterDocument, readFrontmatter, renderFrontmatter, mergeFrontmatter, writeFrontmatter, normalizeRemote, gitRemoteUrl, ACTION_HEADING, CAUSE_HEADING, parseInstinct, writeInstinct, readScopes, allRecords, findRecords, instinctProject, toHeldRecords, sessionSpawnEnv, getClaudeUsagePercent, checkUsage, CLAUDE_BIN, claudeArgs, interruptClaudeSessions, runClaude, spawnClaudeCaptured, runClaudeCaptured, planFilePath, ClaudePlannerError, ISSUE_TYPES, ISSUE_PRIORITIES, ISSUE_STATES, GITHUB_LABELS, createGhRunner, typeOfLabels, moduleOfLabels, createLocalTracker, PORT_VERSIONS, createAdapterRegistry, CORE_ADAPTER_REGISTRY, selectEffortStore };
2867
+ export { EFFORT_STORE_DIR, effortStorePath, EFFORT_KEY_PROJECTIONS, openNdjsonStore, SQLITE_MIGRATIONS, sqliteStorePath, LONE_SURROGATE, migrateSchema, withSqliteStore, writeSqliteStore, openSqliteStore, SKILL_FILE, MARKDOWN_EXTENSION, scanLayout, declaredNameIssue, readFrontmatterDocument, readFrontmatter, renderFrontmatter, mergeFrontmatter, writeFrontmatter, normalizeRemote, gitRemoteUrl, ACTION_HEADING, CAUSE_HEADING, parseInstinct, writeInstinct, readScopes, allRecords, findRecords, instinctProject, toHeldRecords, sessionSpawnEnv, getClaudeUsagePercent, checkUsage, CLAUDE_BIN, claudeArgs, interruptClaudeSessions, runClaude, spawnClaudeCaptured, runClaudeCaptured, planFilePath, ClaudePlannerError, ISSUE_TYPES, ISSUE_PRIORITIES, ISSUE_STATES, GITHUB_LABELS, createGhRunner, typeOfLabels, moduleOfLabels, createLocalTracker, PORT_VERSIONS, createAdapterRegistry, CORE_ADAPTER_REGISTRY, selectEffortStore };