@open330/oac 2026.4.3 → 2026.220.2
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 +115 -0
- package/README.md +2 -2
- package/dist/{chunk-YWIB3TRI.js → chunk-6A37SKAJ.js} +15 -2
- package/dist/chunk-6A37SKAJ.js.map +1 -0
- package/dist/{chunk-HDMLNOND.js → chunk-6JEFW6B7.js} +92 -20
- package/dist/chunk-6JEFW6B7.js.map +1 -0
- package/dist/{chunk-ZRYAHZQJ.js → chunk-7C7SC4TZ.js} +1 -1
- package/dist/{chunk-XUW3XWTX.js → chunk-LRTQCVQK.js} +145 -121
- package/dist/chunk-LRTQCVQK.js.map +1 -0
- package/dist/{chunk-CJAJ4MBO.js → chunk-OS3XDHOJ.js} +57 -18
- package/dist/chunk-OS3XDHOJ.js.map +1 -0
- package/dist/{chunk-7FWC3Z4W.js → chunk-QPVNC7S4.js} +479 -196
- package/dist/chunk-QPVNC7S4.js.map +1 -0
- package/dist/cli/cli.js +6 -6
- package/dist/cli/index.js +6 -6
- package/dist/completion/index.d.ts +5 -0
- package/dist/completion/index.js +49 -8
- package/dist/completion/index.js.map +1 -1
- package/dist/core/index.d.ts +16 -1
- package/dist/core/index.js +8 -4
- package/dist/dashboard/index.js +33 -24
- package/dist/dashboard/index.js.map +1 -1
- package/dist/discovery/index.d.ts +18 -2
- package/dist/discovery/index.js +4 -2
- package/dist/execution/index.d.ts +45 -1
- package/dist/execution/index.js +7 -3
- package/dist/repo/index.d.ts +2 -2
- package/dist/repo/index.js +1 -1
- package/dist/{types-CYCwgojB.d.ts → types-3_IAAxh5.d.ts} +1 -0
- package/docs/config-reference.md +271 -0
- package/docs/multi-agent-support-technical-spec.md +312 -0
- package/package.json +23 -18
- package/dist/chunk-7FWC3Z4W.js.map +0 -1
- package/dist/chunk-CJAJ4MBO.js.map +0 -1
- package/dist/chunk-HDMLNOND.js.map +0 -1
- package/dist/chunk-XUW3XWTX.js.map +0 -1
- package/dist/chunk-YWIB3TRI.js.map +0 -1
- /package/dist/{chunk-ZRYAHZQJ.js.map → chunk-7C7SC4TZ.js.map} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to OAC (Open Agent Contribution) are documented here.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
_No unreleased changes._
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## [2026.2.5] — 2026-02-20
|
|
12
|
+
|
|
13
|
+
> **Note**: Versions `2026.3.x` and `2026.4.x` were published with an incorrect CalVer month.
|
|
14
|
+
> This release corrects the version to `2026.2.5` (year=2026, month=February, patch=5th iteration).
|
|
15
|
+
|
|
16
|
+
### Config Loader Fix (`fb57557`)
|
|
17
|
+
- **fix**: Config loader now matches `@open330/oac` import (previously only matched `@open330/oac-core`)
|
|
18
|
+
|
|
19
|
+
### OpenCode Provider Integration (`afdf725`)
|
|
20
|
+
- **feat**: OpenCode adapter (`src/execution/agents/opencode.adapter.ts`)
|
|
21
|
+
- **feat**: Adapter registry replacing hard-coded switch (`src/execution/agents/registry.ts`)
|
|
22
|
+
- **fix**: 7 pre-existing typecheck errors resolved (`doctor.ts`, `explain.ts`, `init.ts`, `task.ts`)
|
|
23
|
+
|
|
24
|
+
### Security & Quality Fixes (`55780e4`)
|
|
25
|
+
- **security**: Fixed shell injection in dashboard browser opener (replaced `exec` with `open` library)
|
|
26
|
+
- **security**: Sanitized branch names in `sandbox.ts` against path traversal
|
|
27
|
+
- **security**: Replaced `sh -c` shell redirect with `execa` piping in `github-auth.ts`
|
|
28
|
+
- **security**: Added `AbortSignal.timeout` to all GitHub API `fetch` calls
|
|
29
|
+
- **security**: SHA-pinned all CI/CD workflow actions
|
|
30
|
+
- **refactor**: Consolidated `truncate()` and `isRecord()` into `core/utils.ts`
|
|
31
|
+
- **refactor**: Unified error normalization into shared `normalizeError` module
|
|
32
|
+
- **refactor**: Extracted `AsyncEventQueue` into shared module for agent adapters
|
|
33
|
+
- **refactor**: Created scanner factory to eliminate construction duplication
|
|
34
|
+
- **chore**: Annotated all 10 empty catch blocks with `// best-effort` comments
|
|
35
|
+
- **ci**: Added `pnpm audit --prod` to CI pipeline
|
|
36
|
+
|
|
37
|
+
### Deploy Readiness (`91898c8`)
|
|
38
|
+
- **chore**: Added `LICENSE`, `CHANGELOG.md`, `docs/` to npm `files` array
|
|
39
|
+
- **chore**: Added `prepublishOnly` script (`pnpm build && pnpm test`)
|
|
40
|
+
- **chore**: Restored CI/CD workflows (SHA-pinned actions)
|
|
41
|
+
- **chore**: Lowered Node.js requirement from `>=24` to `>=20`
|
|
42
|
+
- **chore**: Fixed repository URL in `package.json`
|
|
43
|
+
|
|
44
|
+
### Wave 9 — Final P3/T3 Polish (`f8ff2ae`)
|
|
45
|
+
- **feat**: `oac init --minimal` for quick, non-interactive setup
|
|
46
|
+
- **feat**: `oac explain <task-id>` command — inspect why a task/epic was selected
|
|
47
|
+
- **feat**: Colored diff output in `--dry-run` mode (source files, complexity, scanner)
|
|
48
|
+
- **docs**: Comprehensive troubleshooting section in README
|
|
49
|
+
- **perf**: Streaming file reads in analyzer for large files (>1MB threshold)
|
|
50
|
+
- **perf**: Memory pressure monitoring — PQueue auto-throttles when heap usage exceeds 85%
|
|
51
|
+
|
|
52
|
+
### Wave 8 — Final UX Polish (`806a170`)
|
|
53
|
+
- **docs**: Auto-generated config reference from Zod schema (`docs/config-reference.md`)
|
|
54
|
+
- **docs**: Added CHANGELOG
|
|
55
|
+
|
|
56
|
+
### Maintenance
|
|
57
|
+
- **chore**: Temporarily removed CI/CD workflows during dev phase (`cb90214`)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## [2026.4.3] — 2026-02-18 _(deprecated — wrong CalVer month)_
|
|
62
|
+
|
|
63
|
+
### Wave 7 — Quick Wins Bundle (`7c179a0`)
|
|
64
|
+
- **feat**: `oac r` alias for `oac run` (power-user shortcut)
|
|
65
|
+
- **feat**: Distinct exit codes for CI/CD integration:
|
|
66
|
+
- `0` — all tasks succeeded or dry-run
|
|
67
|
+
- `1` — unhandled error
|
|
68
|
+
- `2` — config/validation error
|
|
69
|
+
- `3` — every task/epic failed
|
|
70
|
+
- `4` — partial success (some tasks failed)
|
|
71
|
+
- **feat**: Resettable token counters (`claudeCounter.reset()`, `codexCounter.reset()`) for correctness in long-lived processes
|
|
72
|
+
- **feat**: Progress percentages on long operations (file analysis, task estimation, epic execution)
|
|
73
|
+
|
|
74
|
+
### Wave 6 — Single-Command Pipeline (`156c7d2`)
|
|
75
|
+
- **feat**: `oac run` now performs the full scan → analyze → execute pipeline in one command
|
|
76
|
+
- **ux**: Clarified distinction between `oac scan` (discover tasks) and `oac analyze` (build context)
|
|
77
|
+
|
|
78
|
+
### Wave 5 — Run Module Decomposition (`aea2760`)
|
|
79
|
+
- **refactor**: Decomposed the 1,692-line `run.ts` monolith into `src/cli/commands/run/` with 8 focused modules:
|
|
80
|
+
- `index.ts` — command definition and option parsing
|
|
81
|
+
- `pipeline.ts` — top-level orchestration
|
|
82
|
+
- `epic.ts` — epic-based execution flow
|
|
83
|
+
- `task.ts` — single-task execution
|
|
84
|
+
- `retry.ts` — `--retry-failed` pipeline
|
|
85
|
+
- `output.ts` — summary rendering and JSON output
|
|
86
|
+
- `validation.ts` — config and input validation
|
|
87
|
+
- `types.ts` — shared types, exit codes, `ConfigError`
|
|
88
|
+
|
|
89
|
+
### Wave 4 — Timeout, Completion, & Retry (`cb1af6c`)
|
|
90
|
+
- **feat**: PR creation timeout (prevents hanging on GitHub API issues)
|
|
91
|
+
- **perf**: Replaced hand-rolled `runWithConcurrency` with `PQueue` for bounded parallelism
|
|
92
|
+
- **feat**: `oac completion` command for shell tab-completion (bash/zsh/fish)
|
|
93
|
+
- **feat**: `--retry-failed` flag to re-run only previously failed tasks
|
|
94
|
+
|
|
95
|
+
### Wave 3 — UX & CLI Improvements (`9869073`)
|
|
96
|
+
- **ux**: Usage examples in every `--help` screen
|
|
97
|
+
- **feat**: Global `--quiet` flag suppresses spinner/progress output (for CI pipelines)
|
|
98
|
+
- **ux**: Failed task/epic details included in run summary
|
|
99
|
+
- **perf**: Parallelized epic execution pipeline with bounded concurrency
|
|
100
|
+
|
|
101
|
+
### Wave 2 — Helpers, Parallelism, & Cleanup (`417fc85`)
|
|
102
|
+
- **refactor**: Extracted 11 duplicated helper functions into `src/cli/helpers.ts`
|
|
103
|
+
- **perf**: Parallelized `analyzer.ts` file processing with `PQueue`
|
|
104
|
+
- **perf**: Parallelized `todo-scanner.ts` file processing
|
|
105
|
+
- **chore**: Removed dead `withTimeout` utility
|
|
106
|
+
|
|
107
|
+
### Wave 1 — Foundation Fixes (`4196c59`)
|
|
108
|
+
- **fix**: `withWorktreeLock` now correctly releases locks on error
|
|
109
|
+
- **perf**: Bounded `Promise.all` with `PQueue` to prevent unbounded parallelism
|
|
110
|
+
- **perf**: Replaced `child_process.spawn` with `execa` for better error handling
|
|
111
|
+
- **feat**: SIGINT handler for graceful shutdown
|
|
112
|
+
- **fix**: Removed simulation fallback that silently skipped real execution
|
|
113
|
+
- **feat**: `defineConfig()` wrapper for type-safe config files
|
|
114
|
+
- **ux**: Getting Started help text for first-time users
|
|
115
|
+
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
[](https://www.npmjs.com/package/@open330/oac)
|
|
16
16
|
[](LICENSE)
|
|
17
|
-
[](https://nodejs.org/)
|
|
18
18
|
[](https://typescriptlang.org/)
|
|
19
19
|
|
|
20
20
|
[Getting Started](#-getting-started) · [How It Works](#-how-it-works) · [Commands](#commands) · [Configuration](#configuration) · [Architecture](#architecture) · [Contributing](#contributing)
|
|
@@ -93,7 +93,7 @@ npx @open330/oac run --repo facebook/react --tokens unlimited
|
|
|
93
93
|
|
|
94
94
|
### Prerequisites
|
|
95
95
|
|
|
96
|
-
- **Node.js** >=
|
|
96
|
+
- **Node.js** >= 20 (see `engines` in package.json)
|
|
97
97
|
- **git** installed
|
|
98
98
|
- At least one AI agent CLI: [Claude Code](https://claude.ai/code), [Codex](https://github.com/openai/codex), or [OpenCode](https://github.com/opencode-ai/opencode)
|
|
99
99
|
|
|
@@ -38,8 +38,21 @@ function createMemoryMonitor(options) {
|
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
|
|
41
|
+
// src/core/utils.ts
|
|
42
|
+
function truncate(value, maxLength, ellipsis = "\u2026") {
|
|
43
|
+
if (value.length <= maxLength) {
|
|
44
|
+
return value;
|
|
45
|
+
}
|
|
46
|
+
return `${value.slice(0, Math.max(0, maxLength - ellipsis.length))}${ellipsis}`;
|
|
47
|
+
}
|
|
48
|
+
function isRecord(value) {
|
|
49
|
+
return typeof value === "object" && value !== null;
|
|
50
|
+
}
|
|
51
|
+
|
|
41
52
|
export {
|
|
42
53
|
getMemorySnapshot,
|
|
43
|
-
createMemoryMonitor
|
|
54
|
+
createMemoryMonitor,
|
|
55
|
+
truncate,
|
|
56
|
+
isRecord
|
|
44
57
|
};
|
|
45
|
-
//# sourceMappingURL=chunk-
|
|
58
|
+
//# sourceMappingURL=chunk-6A37SKAJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/core/memory.ts","../src/core/utils.ts"],"sourcesContent":["/**\n * Memory pressure monitoring utilities.\n *\n * Provides lightweight heap-usage checks that callers can use to\n * throttle work when the process is approaching memory limits.\n */\n\n/** Default threshold: pause work when heap usage exceeds 85% of the limit. */\nconst DEFAULT_PRESSURE_RATIO = 0.85;\n\nexport interface MemorySnapshot {\n heapUsedMB: number;\n heapTotalMB: number;\n rssUsedMB: number;\n /** Ratio of heapUsed / heapTotal (0–1). */\n heapPressure: number;\n /** True when heapPressure exceeds the configured threshold. */\n isUnderPressure: boolean;\n}\n\n/**\n * Take a snapshot of current memory usage.\n *\n * @param pressureRatio - Threshold ratio (0–1) above which `isUnderPressure`\n * is set to `true`. Defaults to 0.85.\n */\nexport function getMemorySnapshot(pressureRatio = DEFAULT_PRESSURE_RATIO): MemorySnapshot {\n const mem = process.memoryUsage();\n const heapUsedMB = mem.heapUsed / 1_048_576;\n const heapTotalMB = mem.heapTotal / 1_048_576;\n const rssUsedMB = mem.rss / 1_048_576;\n const heapPressure = mem.heapTotal > 0 ? mem.heapUsed / mem.heapTotal : 0;\n\n return {\n heapUsedMB: Math.round(heapUsedMB * 10) / 10,\n heapTotalMB: Math.round(heapTotalMB * 10) / 10,\n rssUsedMB: Math.round(rssUsedMB * 10) / 10,\n heapPressure: Math.round(heapPressure * 1000) / 1000,\n isUnderPressure: heapPressure >= pressureRatio,\n };\n}\n\n/**\n * Creates a monitor that periodically checks memory pressure and calls\n * `onPressure` when the threshold is exceeded. The monitor can be used\n * to pause a PQueue or reduce concurrency under load.\n *\n * Returns a `stop` function to clear the interval.\n */\nexport function createMemoryMonitor(options: {\n /** Polling interval in milliseconds (default: 5 000). */\n intervalMs?: number;\n /** Heap pressure ratio threshold (default: 0.85). */\n pressureRatio?: number;\n /** Called when heap pressure exceeds the threshold. */\n onPressure: (snapshot: MemorySnapshot) => void;\n /** Called when heap pressure drops back below the threshold. */\n onRelief?: (snapshot: MemorySnapshot) => void;\n}): { stop: () => void } {\n const intervalMs = options.intervalMs ?? 5_000;\n const pressureRatio = options.pressureRatio ?? DEFAULT_PRESSURE_RATIO;\n let wasPressured = false;\n\n const timer = setInterval(() => {\n const snapshot = getMemorySnapshot(pressureRatio);\n\n if (snapshot.isUnderPressure && !wasPressured) {\n wasPressured = true;\n options.onPressure(snapshot);\n } else if (!snapshot.isUnderPressure && wasPressured) {\n wasPressured = false;\n options.onRelief?.(snapshot);\n }\n }, intervalMs);\n\n // Unref so this doesn't keep the process alive\n if (typeof timer === \"object\" && \"unref\" in timer) {\n timer.unref();\n }\n\n return {\n stop() {\n clearInterval(timer);\n },\n };\n}\n\n","/**\n * Shared utility functions used across the codebase.\n */\n\n/**\n * Truncate a string to `maxLength`, appending an ellipsis when trimmed.\n * Defaults to the unicode ellipsis `\"…\"` (1 char). Pass `\"...\"` for the\n * three-dot ASCII variant.\n */\nexport function truncate(\n value: string,\n maxLength: number,\n ellipsis = \"…\",\n): string {\n if (value.length <= maxLength) {\n return value;\n }\n return `${value.slice(0, Math.max(0, maxLength - ellipsis.length))}${ellipsis}`;\n}\n\n/**\n * Type guard: returns `true` when `value` is a non-null object\n * (i.e.\\ a `Record<string, unknown>`).\n */\nexport function isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n\n"],"mappings":";AAQA,IAAM,yBAAyB;AAkBxB,SAAS,kBAAkB,gBAAgB,wBAAwC;AACxF,QAAM,MAAM,QAAQ,YAAY;AAChC,QAAM,aAAa,IAAI,WAAW;AAClC,QAAM,cAAc,IAAI,YAAY;AACpC,QAAM,YAAY,IAAI,MAAM;AAC5B,QAAM,eAAe,IAAI,YAAY,IAAI,IAAI,WAAW,IAAI,YAAY;AAExE,SAAO;AAAA,IACL,YAAY,KAAK,MAAM,aAAa,EAAE,IAAI;AAAA,IAC1C,aAAa,KAAK,MAAM,cAAc,EAAE,IAAI;AAAA,IAC5C,WAAW,KAAK,MAAM,YAAY,EAAE,IAAI;AAAA,IACxC,cAAc,KAAK,MAAM,eAAe,GAAI,IAAI;AAAA,IAChD,iBAAiB,gBAAgB;AAAA,EACnC;AACF;AASO,SAAS,oBAAoB,SASX;AACvB,QAAM,aAAa,QAAQ,cAAc;AACzC,QAAM,gBAAgB,QAAQ,iBAAiB;AAC/C,MAAI,eAAe;AAEnB,QAAM,QAAQ,YAAY,MAAM;AAC9B,UAAM,WAAW,kBAAkB,aAAa;AAEhD,QAAI,SAAS,mBAAmB,CAAC,cAAc;AAC7C,qBAAe;AACf,cAAQ,WAAW,QAAQ;AAAA,IAC7B,WAAW,CAAC,SAAS,mBAAmB,cAAc;AACpD,qBAAe;AACf,cAAQ,WAAW,QAAQ;AAAA,IAC7B;AAAA,EACF,GAAG,UAAU;AAGb,MAAI,OAAO,UAAU,YAAY,WAAW,OAAO;AACjD,UAAM,MAAM;AAAA,EACd;AAEA,SAAO;AAAA,IACL,OAAO;AACL,oBAAc,KAAK;AAAA,IACrB;AAAA,EACF;AACF;;;AC5EO,SAAS,SACd,OACA,WACA,WAAW,UACH;AACR,MAAI,MAAM,UAAU,WAAW;AAC7B,WAAO;AAAA,EACT;AACA,SAAO,GAAG,MAAM,MAAM,GAAG,KAAK,IAAI,GAAG,YAAY,SAAS,MAAM,CAAC,CAAC,GAAG,QAAQ;AAC/E;AAMO,SAAS,SAAS,OAAkD;AACzE,SAAO,OAAO,UAAU,YAAY,UAAU;AAChD;","names":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
|
-
createMemoryMonitor
|
|
3
|
-
|
|
2
|
+
createMemoryMonitor,
|
|
3
|
+
truncate
|
|
4
|
+
} from "./chunk-6A37SKAJ.js";
|
|
4
5
|
|
|
5
6
|
// src/discovery/scanners/todo-scanner.ts
|
|
6
7
|
import { spawn } from "child_process";
|
|
@@ -289,12 +290,6 @@ function extractTodoKeyword(lineText) {
|
|
|
289
290
|
}
|
|
290
291
|
return match[1].toUpperCase();
|
|
291
292
|
}
|
|
292
|
-
function truncate(value, maxLength) {
|
|
293
|
-
if (value.length <= maxLength) {
|
|
294
|
-
return value;
|
|
295
|
-
}
|
|
296
|
-
return `${value.slice(0, maxLength - 1)}\u2026`;
|
|
297
|
-
}
|
|
298
293
|
function createTaskId(source, targetFiles, title, suffix) {
|
|
299
294
|
const base = [source, [...targetFiles].sort().join(","), title, suffix].join("::");
|
|
300
295
|
return createHash("sha256").update(base).digest("hex").slice(0, 16);
|
|
@@ -1142,6 +1137,8 @@ import { readFile as readFile4 } from "fs/promises";
|
|
|
1142
1137
|
import { resolve as resolve4 } from "path";
|
|
1143
1138
|
var GITHUB_API_BASE_URL = "https://api.github.com";
|
|
1144
1139
|
var ISSUES_PER_PAGE = 30;
|
|
1140
|
+
var OAC_PR_PAGE_SIZE = 100;
|
|
1141
|
+
var OAC_PR_TITLE_PREFIX = "[OAC]";
|
|
1145
1142
|
var TITLE_LIMIT = 120;
|
|
1146
1143
|
var DESCRIPTION_LIMIT = 500;
|
|
1147
1144
|
var ESTIMATED_TOKENS_BY_COMPLEXITY = {
|
|
@@ -1165,12 +1162,15 @@ var GitHubIssuesScanner = class {
|
|
|
1165
1162
|
if (!repo) {
|
|
1166
1163
|
return [];
|
|
1167
1164
|
}
|
|
1168
|
-
const issues = await
|
|
1165
|
+
const [issues, claimedIssueNumbers] = await Promise.all([
|
|
1166
|
+
fetchOpenIssues(repo, token),
|
|
1167
|
+
fetchOacClaimedIssueNumbers(repo, token)
|
|
1168
|
+
]);
|
|
1169
1169
|
if (issues.length === 0) {
|
|
1170
1170
|
return [];
|
|
1171
1171
|
}
|
|
1172
1172
|
const discoveredAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
1173
|
-
const tasks = issues.filter((issue) => issue.pull_request === void 0).map((issue) => mapIssueToTask(issue, discoveredAt)).filter((task) => task !== void 0);
|
|
1173
|
+
const tasks = issues.filter((issue) => issue.pull_request === void 0).filter((issue) => !claimedIssueNumbers.has(asNumber3(issue.number) ?? -1)).map((issue) => mapIssueToTask(issue, discoveredAt)).filter((task) => task !== void 0);
|
|
1174
1174
|
if (typeof options.maxTasks === "number" && options.maxTasks >= 0) {
|
|
1175
1175
|
return tasks.slice(0, options.maxTasks);
|
|
1176
1176
|
}
|
|
@@ -1194,7 +1194,8 @@ async function fetchOpenIssues(repo, token) {
|
|
|
1194
1194
|
headers: {
|
|
1195
1195
|
Authorization: `Bearer ${token}`,
|
|
1196
1196
|
Accept: "application/vnd.github.v3+json"
|
|
1197
|
-
}
|
|
1197
|
+
},
|
|
1198
|
+
signal: AbortSignal.timeout(3e4)
|
|
1198
1199
|
});
|
|
1199
1200
|
if (!response.ok) {
|
|
1200
1201
|
return [];
|
|
@@ -1208,6 +1209,47 @@ async function fetchOpenIssues(repo, token) {
|
|
|
1208
1209
|
return [];
|
|
1209
1210
|
}
|
|
1210
1211
|
}
|
|
1212
|
+
async function fetchOacClaimedIssueNumbers(repo, token) {
|
|
1213
|
+
const url = `${GITHUB_API_BASE_URL}/repos/${encodeURIComponent(repo.owner)}/${encodeURIComponent(repo.name)}/pulls?state=open&per_page=${OAC_PR_PAGE_SIZE}&sort=updated&direction=desc`;
|
|
1214
|
+
try {
|
|
1215
|
+
const response = await fetch(url, {
|
|
1216
|
+
method: "GET",
|
|
1217
|
+
headers: {
|
|
1218
|
+
Authorization: `Bearer ${token}`,
|
|
1219
|
+
Accept: "application/vnd.github.v3+json"
|
|
1220
|
+
},
|
|
1221
|
+
signal: AbortSignal.timeout(15e3)
|
|
1222
|
+
});
|
|
1223
|
+
if (!response.ok) {
|
|
1224
|
+
return /* @__PURE__ */ new Set();
|
|
1225
|
+
}
|
|
1226
|
+
const pulls = await response.json();
|
|
1227
|
+
if (!Array.isArray(pulls)) {
|
|
1228
|
+
return /* @__PURE__ */ new Set();
|
|
1229
|
+
}
|
|
1230
|
+
return extractClaimedIssueNumbers(pulls);
|
|
1231
|
+
} catch {
|
|
1232
|
+
return /* @__PURE__ */ new Set();
|
|
1233
|
+
}
|
|
1234
|
+
}
|
|
1235
|
+
function extractClaimedIssueNumbers(pulls) {
|
|
1236
|
+
const claimed = /* @__PURE__ */ new Set();
|
|
1237
|
+
const issueRefPattern = /(?:Fixes|Closes|Resolves)\s+#(\d+)/gi;
|
|
1238
|
+
for (const pr of pulls) {
|
|
1239
|
+
if (!pr || typeof pr !== "object") continue;
|
|
1240
|
+
const record = pr;
|
|
1241
|
+
const title = typeof record.title === "string" ? record.title : "";
|
|
1242
|
+
if (!title.startsWith(OAC_PR_TITLE_PREFIX)) continue;
|
|
1243
|
+
const body = typeof record.body === "string" ? record.body : "";
|
|
1244
|
+
for (const match of body.matchAll(issueRefPattern)) {
|
|
1245
|
+
const num = Number.parseInt(match[1], 10);
|
|
1246
|
+
if (Number.isFinite(num)) {
|
|
1247
|
+
claimed.add(num);
|
|
1248
|
+
}
|
|
1249
|
+
}
|
|
1250
|
+
}
|
|
1251
|
+
return claimed;
|
|
1252
|
+
}
|
|
1211
1253
|
async function parseRepoFromGitConfig(repoPath) {
|
|
1212
1254
|
const config = await readGitConfig(repoPath);
|
|
1213
1255
|
if (!config) {
|
|
@@ -1324,8 +1366,8 @@ function mapIssueToTask(issue, discoveredAt) {
|
|
|
1324
1366
|
const estimatedTokens = ESTIMATED_TOKENS_BY_COMPLEXITY[complexity];
|
|
1325
1367
|
const bodyText = asString3(issue.body)?.trim() || "No description provided.";
|
|
1326
1368
|
const labelSummary = labels.length > 0 ? `Labels: ${labels.join(", ")}` : "Labels: none";
|
|
1327
|
-
const title =
|
|
1328
|
-
const description =
|
|
1369
|
+
const title = truncate(rawTitle, TITLE_LIMIT);
|
|
1370
|
+
const description = truncate(`${bodyText}
|
|
1329
1371
|
|
|
1330
1372
|
${labelSummary}`, DESCRIPTION_LIMIT);
|
|
1331
1373
|
const url = asString3(issue.html_url) ?? "";
|
|
@@ -1406,12 +1448,6 @@ function readAuthor(user) {
|
|
|
1406
1448
|
}
|
|
1407
1449
|
return login;
|
|
1408
1450
|
}
|
|
1409
|
-
function truncate2(value, maxLength) {
|
|
1410
|
-
if (value.length <= maxLength) {
|
|
1411
|
-
return value;
|
|
1412
|
-
}
|
|
1413
|
-
return `${value.slice(0, maxLength - 1)}\u2026`;
|
|
1414
|
-
}
|
|
1415
1451
|
function toIssueResponse(value) {
|
|
1416
1452
|
if (value && typeof value === "object") {
|
|
1417
1453
|
return value;
|
|
@@ -1524,6 +1560,41 @@ function unique(values) {
|
|
|
1524
1560
|
return Array.from(new Set(values.filter((value) => value.trim().length > 0)));
|
|
1525
1561
|
}
|
|
1526
1562
|
|
|
1563
|
+
// src/discovery/scanner-factory.ts
|
|
1564
|
+
function buildScanners(config, hasGitHubAuth) {
|
|
1565
|
+
const names = [];
|
|
1566
|
+
if (config?.discovery.scanners.lint !== false) {
|
|
1567
|
+
names.push("lint");
|
|
1568
|
+
}
|
|
1569
|
+
if (config?.discovery.scanners.todo !== false) {
|
|
1570
|
+
names.push("todo");
|
|
1571
|
+
}
|
|
1572
|
+
if (config?.discovery.scanners.testGap !== false) {
|
|
1573
|
+
names.push("test-gap");
|
|
1574
|
+
}
|
|
1575
|
+
if (hasGitHubAuth) {
|
|
1576
|
+
names.push("github-issues");
|
|
1577
|
+
}
|
|
1578
|
+
if (names.length === 0) {
|
|
1579
|
+
names.push("lint", "todo", "test-gap");
|
|
1580
|
+
}
|
|
1581
|
+
const unique2 = [...new Set(names)];
|
|
1582
|
+
const instances = unique2.map(instantiateScanner);
|
|
1583
|
+
return { names: unique2, instances, composite: new CompositeScanner(instances) };
|
|
1584
|
+
}
|
|
1585
|
+
function instantiateScanner(name) {
|
|
1586
|
+
switch (name) {
|
|
1587
|
+
case "lint":
|
|
1588
|
+
return new LintScanner();
|
|
1589
|
+
case "todo":
|
|
1590
|
+
return new TodoScanner();
|
|
1591
|
+
case "test-gap":
|
|
1592
|
+
return new TestGapScanner();
|
|
1593
|
+
case "github-issues":
|
|
1594
|
+
return new GitHubIssuesScanner();
|
|
1595
|
+
}
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1527
1598
|
// src/discovery/ranker.ts
|
|
1528
1599
|
var IMPACT_BY_SOURCE = {
|
|
1529
1600
|
lint: 22,
|
|
@@ -2323,6 +2394,7 @@ export {
|
|
|
2323
2394
|
GitHubIssuesScanner,
|
|
2324
2395
|
CompositeScanner,
|
|
2325
2396
|
createDefaultCompositeScanner,
|
|
2397
|
+
buildScanners,
|
|
2326
2398
|
rankTasks,
|
|
2327
2399
|
analyzeCodebase,
|
|
2328
2400
|
persistContext,
|
|
@@ -2339,4 +2411,4 @@ export {
|
|
|
2339
2411
|
updateBacklog,
|
|
2340
2412
|
getPendingEpics
|
|
2341
2413
|
};
|
|
2342
|
-
//# sourceMappingURL=chunk-
|
|
2414
|
+
//# sourceMappingURL=chunk-6JEFW6B7.js.map
|