@open330/oac 2026.2.5
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/LICENSE +21 -0
- package/README.md +597 -0
- package/dist/budget/index.d.ts +117 -0
- package/dist/budget/index.js +23 -0
- package/dist/budget/index.js.map +1 -0
- package/dist/chunk-4IUL7ECC.js +3152 -0
- package/dist/chunk-4IUL7ECC.js.map +1 -0
- package/dist/chunk-5GAUWC3L.js +469 -0
- package/dist/chunk-5GAUWC3L.js.map +1 -0
- package/dist/chunk-6A37SKAJ.js +58 -0
- package/dist/chunk-6A37SKAJ.js.map +1 -0
- package/dist/chunk-7C7SC4TZ.js +358 -0
- package/dist/chunk-7C7SC4TZ.js.map +1 -0
- package/dist/chunk-CJAJ4MBO.js +475 -0
- package/dist/chunk-CJAJ4MBO.js.map +1 -0
- package/dist/chunk-LQC5DLT7.js +317 -0
- package/dist/chunk-LQC5DLT7.js.map +1 -0
- package/dist/chunk-OTPXGXO7.js +2368 -0
- package/dist/chunk-OTPXGXO7.js.map +1 -0
- package/dist/chunk-QPVNC7S4.js +1833 -0
- package/dist/chunk-QPVNC7S4.js.map +1 -0
- package/dist/cli/cli.d.ts +13 -0
- package/dist/cli/cli.js +16 -0
- package/dist/cli/cli.js.map +1 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +22 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/completion/index.d.ts +91 -0
- package/dist/completion/index.js +587 -0
- package/dist/completion/index.js.map +1 -0
- package/dist/config-DequKoFA.d.ts +1468 -0
- package/dist/core/index.d.ts +64 -0
- package/dist/core/index.js +87 -0
- package/dist/core/index.js.map +1 -0
- package/dist/dashboard/index.d.ts +14 -0
- package/dist/dashboard/index.js +1253 -0
- package/dist/dashboard/index.js.map +1 -0
- package/dist/discovery/index.d.ts +285 -0
- package/dist/discovery/index.js +50 -0
- package/dist/discovery/index.js.map +1 -0
- package/dist/event-bus-KiuR6e3P.d.ts +91 -0
- package/dist/execution/index.d.ts +215 -0
- package/dist/execution/index.js +27 -0
- package/dist/execution/index.js.map +1 -0
- package/dist/repo/index.d.ts +33 -0
- package/dist/repo/index.js +19 -0
- package/dist/repo/index.js.map +1 -0
- package/dist/tracking/index.d.ts +357 -0
- package/dist/tracking/index.js +15 -0
- package/dist/tracking/index.js.map +1 -0
- package/dist/types-CYCwgojB.d.ts +34 -0
- package/dist/types-Ck7IucqK.d.ts +195 -0
- package/docs/config-reference.md +271 -0
- package/docs/multi-agent-support-technical-spec.md +312 -0
- package/package.json +82 -0
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { A as AgentProviderId, e as ExecutionResult, i as TokenEstimate, E as Epic, T as Task, d as ExecutionPlan } from '../types-Ck7IucqK.js';
|
|
2
|
+
import { k as OacEventBus, g as OacError } from '../event-bus-KiuR6e3P.js';
|
|
3
|
+
import 'eventemitter3';
|
|
4
|
+
|
|
5
|
+
interface AgentAvailability {
|
|
6
|
+
available: boolean;
|
|
7
|
+
version?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
remainingBudget?: number;
|
|
10
|
+
}
|
|
11
|
+
interface AgentExecuteParams {
|
|
12
|
+
executionId: string;
|
|
13
|
+
workingDirectory: string;
|
|
14
|
+
prompt: string;
|
|
15
|
+
targetFiles: string[];
|
|
16
|
+
tokenBudget: number;
|
|
17
|
+
allowCommits: boolean;
|
|
18
|
+
timeoutMs: number;
|
|
19
|
+
env?: Record<string, string>;
|
|
20
|
+
}
|
|
21
|
+
interface TokenEstimateParams {
|
|
22
|
+
taskId: string;
|
|
23
|
+
prompt: string;
|
|
24
|
+
targetFiles: string[];
|
|
25
|
+
contextTokens?: number;
|
|
26
|
+
expectedOutputTokens?: number;
|
|
27
|
+
}
|
|
28
|
+
type AgentEvent = {
|
|
29
|
+
type: "output";
|
|
30
|
+
content: string;
|
|
31
|
+
stream: "stdout" | "stderr";
|
|
32
|
+
} | {
|
|
33
|
+
type: "tokens";
|
|
34
|
+
inputTokens: number;
|
|
35
|
+
outputTokens: number;
|
|
36
|
+
cumulativeTokens: number;
|
|
37
|
+
} | {
|
|
38
|
+
type: "file_edit";
|
|
39
|
+
path: string;
|
|
40
|
+
action: "create" | "modify" | "delete";
|
|
41
|
+
} | {
|
|
42
|
+
type: "tool_use";
|
|
43
|
+
tool: string;
|
|
44
|
+
input: unknown;
|
|
45
|
+
} | {
|
|
46
|
+
type: "error";
|
|
47
|
+
message: string;
|
|
48
|
+
recoverable: boolean;
|
|
49
|
+
};
|
|
50
|
+
interface AgentResult extends ExecutionResult {
|
|
51
|
+
}
|
|
52
|
+
interface AgentExecution {
|
|
53
|
+
readonly executionId: string;
|
|
54
|
+
readonly providerId: AgentProviderId;
|
|
55
|
+
events: AsyncIterable<AgentEvent>;
|
|
56
|
+
result: Promise<AgentResult>;
|
|
57
|
+
pid?: number;
|
|
58
|
+
}
|
|
59
|
+
interface AgentProvider {
|
|
60
|
+
readonly id: AgentProviderId;
|
|
61
|
+
readonly name: string;
|
|
62
|
+
checkAvailability(): Promise<AgentAvailability>;
|
|
63
|
+
execute(params: AgentExecuteParams): AgentExecution;
|
|
64
|
+
estimateTokens(params: TokenEstimateParams): Promise<TokenEstimate>;
|
|
65
|
+
abort(executionId: string): Promise<void>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
declare class ClaudeCodeAdapter implements AgentProvider {
|
|
69
|
+
readonly id: AgentProviderId;
|
|
70
|
+
readonly name = "Claude Code";
|
|
71
|
+
private readonly runningExecutions;
|
|
72
|
+
checkAvailability(): Promise<AgentAvailability>;
|
|
73
|
+
execute(params: AgentExecuteParams): AgentExecution;
|
|
74
|
+
estimateTokens(params: TokenEstimateParams): Promise<TokenEstimate>;
|
|
75
|
+
abort(executionId: string): Promise<void>;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare class CodexAdapter implements AgentProvider {
|
|
79
|
+
readonly id: AgentProviderId;
|
|
80
|
+
readonly name = "Codex CLI";
|
|
81
|
+
private readonly runningExecutions;
|
|
82
|
+
checkAvailability(): Promise<AgentAvailability>;
|
|
83
|
+
execute(params: AgentExecuteParams): AgentExecution;
|
|
84
|
+
estimateTokens(params: TokenEstimateParams): Promise<TokenEstimate>;
|
|
85
|
+
abort(executionId: string): Promise<void>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
declare class OpenCodeAdapter implements AgentProvider {
|
|
89
|
+
readonly id: AgentProviderId;
|
|
90
|
+
readonly name = "OpenCode";
|
|
91
|
+
private readonly runningExecutions;
|
|
92
|
+
checkAvailability(): Promise<AgentAvailability>;
|
|
93
|
+
execute(params: AgentExecuteParams): AgentExecution;
|
|
94
|
+
estimateTokens(params: TokenEstimateParams): Promise<TokenEstimate>;
|
|
95
|
+
abort(executionId: string): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Factory function that creates a new adapter instance.
|
|
100
|
+
*
|
|
101
|
+
* Using factories (rather than singleton instances) ensures each
|
|
102
|
+
* concurrent pipeline run gets its own `runningExecutions` map.
|
|
103
|
+
*/
|
|
104
|
+
type AdapterFactory = () => AgentProvider;
|
|
105
|
+
/**
|
|
106
|
+
* Maintains a registry of agent adapter factories keyed by provider ID.
|
|
107
|
+
*
|
|
108
|
+
* Built-in adapters (claude-code, codex, opencode) are registered at
|
|
109
|
+
* module load time. Custom adapters can be added at runtime with
|
|
110
|
+
* `adapterRegistry.register(id, factory)`.
|
|
111
|
+
*/
|
|
112
|
+
declare class AdapterRegistry {
|
|
113
|
+
private readonly factories;
|
|
114
|
+
/** Well-known aliases (e.g. legacy IDs) that map to canonical provider IDs. */
|
|
115
|
+
private readonly aliases;
|
|
116
|
+
/** Register a new adapter factory. Replaces any previous factory for the same ID. */
|
|
117
|
+
register(id: string, factory: AdapterFactory): void;
|
|
118
|
+
/** Add an alias that maps to an existing canonical ID. */
|
|
119
|
+
alias(alias: string, canonicalId: string): void;
|
|
120
|
+
/** Resolve an ID (including aliases) and return the factory, or `undefined`. */
|
|
121
|
+
get(rawId: string): AdapterFactory | undefined;
|
|
122
|
+
/** Canonical ID after alias resolution. */
|
|
123
|
+
resolveId(rawId: string): string;
|
|
124
|
+
/** All registered canonical provider IDs. */
|
|
125
|
+
registeredIds(): string[];
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Global singleton registry with built-in adapters pre-registered.
|
|
129
|
+
*/
|
|
130
|
+
declare const adapterRegistry: AdapterRegistry;
|
|
131
|
+
|
|
132
|
+
interface SandboxContext {
|
|
133
|
+
path: string;
|
|
134
|
+
branchName: string;
|
|
135
|
+
cleanup(): Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
declare function createSandbox(repoPath: string, branchName: string, baseBranch: string): Promise<SandboxContext>;
|
|
138
|
+
|
|
139
|
+
interface ExecuteTaskOptions {
|
|
140
|
+
executionId?: string;
|
|
141
|
+
tokenBudget?: number;
|
|
142
|
+
timeoutMs?: number;
|
|
143
|
+
allowCommits?: boolean;
|
|
144
|
+
}
|
|
145
|
+
declare function executeTask(agent: AgentProvider, task: Task, sandbox: SandboxContext, eventBus: OacEventBus, options?: ExecuteTaskOptions): Promise<ExecutionResult>;
|
|
146
|
+
/**
|
|
147
|
+
* Build a context-aware prompt for an entire epic, including all subtasks
|
|
148
|
+
* and module context.
|
|
149
|
+
*/
|
|
150
|
+
declare function buildEpicPrompt(epic: Epic): string;
|
|
151
|
+
/**
|
|
152
|
+
* Convert an Epic into a Task for backward compatibility with executeTask().
|
|
153
|
+
*/
|
|
154
|
+
declare function epicAsTask(epic: Epic): Task;
|
|
155
|
+
|
|
156
|
+
type JobStatus = "queued" | "running" | "completed" | "failed" | "retrying" | "aborted";
|
|
157
|
+
interface Job {
|
|
158
|
+
id: string;
|
|
159
|
+
task: Task;
|
|
160
|
+
estimate: TokenEstimate;
|
|
161
|
+
status: JobStatus;
|
|
162
|
+
attempts: number;
|
|
163
|
+
maxAttempts: number;
|
|
164
|
+
createdAt: number;
|
|
165
|
+
startedAt?: number;
|
|
166
|
+
completedAt?: number;
|
|
167
|
+
result?: ExecutionResult;
|
|
168
|
+
error?: OacError;
|
|
169
|
+
workerId?: string;
|
|
170
|
+
}
|
|
171
|
+
interface ExecutionEngineConfig {
|
|
172
|
+
concurrency?: number;
|
|
173
|
+
maxAttempts?: number;
|
|
174
|
+
repoPath?: string;
|
|
175
|
+
baseBranch?: string;
|
|
176
|
+
branchPrefix?: string;
|
|
177
|
+
taskTimeoutMs?: number;
|
|
178
|
+
defaultTokenBudget?: number;
|
|
179
|
+
}
|
|
180
|
+
interface RunResult {
|
|
181
|
+
jobs: Job[];
|
|
182
|
+
completed: Job[];
|
|
183
|
+
failed: Job[];
|
|
184
|
+
aborted: Job[];
|
|
185
|
+
}
|
|
186
|
+
declare function isTransientError(error: OacError): boolean;
|
|
187
|
+
declare class ExecutionEngine {
|
|
188
|
+
private readonly agents;
|
|
189
|
+
private readonly eventBus;
|
|
190
|
+
private readonly queue;
|
|
191
|
+
private readonly jobs;
|
|
192
|
+
private readonly activeJobs;
|
|
193
|
+
private readonly concurrency;
|
|
194
|
+
private readonly maxAttempts;
|
|
195
|
+
private readonly repoPath;
|
|
196
|
+
private readonly baseBranch;
|
|
197
|
+
private readonly branchPrefix;
|
|
198
|
+
private readonly taskTimeoutMs;
|
|
199
|
+
private readonly defaultTokenBudget;
|
|
200
|
+
private aborted;
|
|
201
|
+
private nextAgentIndex;
|
|
202
|
+
constructor(agents: AgentProvider[], eventBus: OacEventBus, config?: ExecutionEngineConfig);
|
|
203
|
+
enqueue(plan: ExecutionPlan): Job[];
|
|
204
|
+
run(): Promise<RunResult>;
|
|
205
|
+
abort(): Promise<void>;
|
|
206
|
+
private schedule;
|
|
207
|
+
private runJob;
|
|
208
|
+
private handleFailure;
|
|
209
|
+
private selectAgent;
|
|
210
|
+
private createBranchName;
|
|
211
|
+
private normalizeError;
|
|
212
|
+
private buildRunResult;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
export { type AdapterFactory, type AgentAvailability, type AgentEvent, type AgentExecuteParams, type AgentExecution, type AgentProvider, type AgentResult, ClaudeCodeAdapter, CodexAdapter, type ExecuteTaskOptions, ExecutionEngine, type ExecutionEngineConfig, type Job, type JobStatus, OpenCodeAdapter, type RunResult, type SandboxContext, type TokenEstimateParams, adapterRegistry, buildEpicPrompt, createSandbox, epicAsTask, executeTask, isTransientError };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClaudeCodeAdapter,
|
|
3
|
+
CodexAdapter,
|
|
4
|
+
ExecutionEngine,
|
|
5
|
+
OpenCodeAdapter,
|
|
6
|
+
adapterRegistry,
|
|
7
|
+
buildEpicPrompt,
|
|
8
|
+
createSandbox,
|
|
9
|
+
epicAsTask,
|
|
10
|
+
executeTask,
|
|
11
|
+
isTransientError
|
|
12
|
+
} from "../chunk-QPVNC7S4.js";
|
|
13
|
+
import "../chunk-7C7SC4TZ.js";
|
|
14
|
+
import "../chunk-6A37SKAJ.js";
|
|
15
|
+
export {
|
|
16
|
+
ClaudeCodeAdapter,
|
|
17
|
+
CodexAdapter,
|
|
18
|
+
ExecutionEngine,
|
|
19
|
+
OpenCodeAdapter,
|
|
20
|
+
adapterRegistry,
|
|
21
|
+
buildEpicPrompt,
|
|
22
|
+
createSandbox,
|
|
23
|
+
epicAsTask,
|
|
24
|
+
executeTask,
|
|
25
|
+
isTransientError
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { R as ResolvedRepo } from '../types-CYCwgojB.js';
|
|
2
|
+
export { a as RepoPermissions, b as ResolvedRepoGitState, c as ResolvedRepoMeta } from '../types-CYCwgojB.js';
|
|
3
|
+
|
|
4
|
+
type RepoResolutionErrorCode = "INVALID_INPUT" | "NOT_FOUND" | "FORBIDDEN" | "ARCHIVED" | "UNKNOWN";
|
|
5
|
+
declare class RepoResolutionError extends Error {
|
|
6
|
+
readonly code: RepoResolutionErrorCode;
|
|
7
|
+
constructor(message: string, code: RepoResolutionErrorCode, cause?: unknown);
|
|
8
|
+
}
|
|
9
|
+
declare function resolveRepo(input: string): Promise<ResolvedRepo>;
|
|
10
|
+
|
|
11
|
+
declare const DEFAULT_REPO_CACHE_DIR: string;
|
|
12
|
+
declare function cloneRepo(repo: ResolvedRepo, cacheDir?: string): Promise<string>;
|
|
13
|
+
|
|
14
|
+
interface MetadataCacheOptions {
|
|
15
|
+
filePath?: string;
|
|
16
|
+
ttlMs?: number;
|
|
17
|
+
now?: () => number;
|
|
18
|
+
}
|
|
19
|
+
declare const DEFAULT_METADATA_CACHE_PATH: string;
|
|
20
|
+
declare const DEFAULT_METADATA_CACHE_TTL_MS: number;
|
|
21
|
+
declare class MetadataCache {
|
|
22
|
+
private readonly filePath;
|
|
23
|
+
private readonly ttlMs;
|
|
24
|
+
private readonly now;
|
|
25
|
+
constructor(options?: MetadataCacheOptions);
|
|
26
|
+
get(fullName: string): Promise<ResolvedRepo | null>;
|
|
27
|
+
set(fullName: string, repo: ResolvedRepo): Promise<void>;
|
|
28
|
+
invalidate(fullName?: string): Promise<void>;
|
|
29
|
+
private readCache;
|
|
30
|
+
private writeCache;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { DEFAULT_METADATA_CACHE_PATH, DEFAULT_METADATA_CACHE_TTL_MS, DEFAULT_REPO_CACHE_DIR, MetadataCache, type MetadataCacheOptions, RepoResolutionError, type RepoResolutionErrorCode, ResolvedRepo, cloneRepo, resolveRepo };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DEFAULT_METADATA_CACHE_PATH,
|
|
3
|
+
DEFAULT_METADATA_CACHE_TTL_MS,
|
|
4
|
+
DEFAULT_REPO_CACHE_DIR,
|
|
5
|
+
MetadataCache,
|
|
6
|
+
RepoResolutionError,
|
|
7
|
+
cloneRepo,
|
|
8
|
+
resolveRepo
|
|
9
|
+
} from "../chunk-CJAJ4MBO.js";
|
|
10
|
+
export {
|
|
11
|
+
DEFAULT_METADATA_CACHE_PATH,
|
|
12
|
+
DEFAULT_METADATA_CACHE_TTL_MS,
|
|
13
|
+
DEFAULT_REPO_CACHE_DIR,
|
|
14
|
+
MetadataCache,
|
|
15
|
+
RepoResolutionError,
|
|
16
|
+
cloneRepo,
|
|
17
|
+
resolveRepo
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,357 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare const taskSourceValues: readonly ["lint", "todo", "test-gap", "dead-code", "github-issue", "github-pr-review", "custom"];
|
|
4
|
+
declare const taskComplexityValues: readonly ["trivial", "simple", "moderate", "complex"];
|
|
5
|
+
declare const contributionTaskStatusValues: readonly ["success", "partial", "failed"];
|
|
6
|
+
type TaskSource = (typeof taskSourceValues)[number];
|
|
7
|
+
type TaskComplexity = (typeof taskComplexityValues)[number];
|
|
8
|
+
type ContributionTaskStatus = (typeof contributionTaskStatusValues)[number];
|
|
9
|
+
type AgentProviderId = string;
|
|
10
|
+
declare const contributionTaskSchema: z.ZodObject<{
|
|
11
|
+
taskId: z.ZodString;
|
|
12
|
+
title: z.ZodString;
|
|
13
|
+
source: z.ZodEnum<["lint", "todo", "test-gap", "dead-code", "github-issue", "github-pr-review", "custom"]>;
|
|
14
|
+
complexity: z.ZodEnum<["trivial", "simple", "moderate", "complex"]>;
|
|
15
|
+
status: z.ZodEnum<["success", "partial", "failed"]>;
|
|
16
|
+
tokensUsed: z.ZodNumber;
|
|
17
|
+
duration: z.ZodNumber;
|
|
18
|
+
filesChanged: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
pr: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
number: z.ZodNumber;
|
|
21
|
+
url: z.ZodString;
|
|
22
|
+
status: z.ZodEnum<["open", "merged", "closed"]>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
number: number;
|
|
25
|
+
status: "open" | "merged" | "closed";
|
|
26
|
+
url: string;
|
|
27
|
+
}, {
|
|
28
|
+
number: number;
|
|
29
|
+
status: "open" | "merged" | "closed";
|
|
30
|
+
url: string;
|
|
31
|
+
}>>;
|
|
32
|
+
linkedIssue: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
number: z.ZodNumber;
|
|
34
|
+
url: z.ZodString;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
number: number;
|
|
37
|
+
url: string;
|
|
38
|
+
}, {
|
|
39
|
+
number: number;
|
|
40
|
+
url: string;
|
|
41
|
+
}>>;
|
|
42
|
+
error: z.ZodOptional<z.ZodString>;
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
taskId: string;
|
|
45
|
+
title: string;
|
|
46
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
47
|
+
status: "success" | "partial" | "failed";
|
|
48
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
49
|
+
tokensUsed: number;
|
|
50
|
+
duration: number;
|
|
51
|
+
filesChanged: string[];
|
|
52
|
+
pr?: {
|
|
53
|
+
number: number;
|
|
54
|
+
status: "open" | "merged" | "closed";
|
|
55
|
+
url: string;
|
|
56
|
+
} | undefined;
|
|
57
|
+
linkedIssue?: {
|
|
58
|
+
number: number;
|
|
59
|
+
url: string;
|
|
60
|
+
} | undefined;
|
|
61
|
+
error?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
taskId: string;
|
|
64
|
+
title: string;
|
|
65
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
66
|
+
status: "success" | "partial" | "failed";
|
|
67
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
68
|
+
tokensUsed: number;
|
|
69
|
+
duration: number;
|
|
70
|
+
filesChanged: string[];
|
|
71
|
+
pr?: {
|
|
72
|
+
number: number;
|
|
73
|
+
status: "open" | "merged" | "closed";
|
|
74
|
+
url: string;
|
|
75
|
+
} | undefined;
|
|
76
|
+
linkedIssue?: {
|
|
77
|
+
number: number;
|
|
78
|
+
url: string;
|
|
79
|
+
} | undefined;
|
|
80
|
+
error?: string | undefined;
|
|
81
|
+
}>;
|
|
82
|
+
declare const contributionLogSchema: z.ZodObject<{
|
|
83
|
+
version: z.ZodLiteral<"1.0">;
|
|
84
|
+
runId: z.ZodString;
|
|
85
|
+
timestamp: z.ZodString;
|
|
86
|
+
contributor: z.ZodObject<{
|
|
87
|
+
githubUsername: z.ZodString;
|
|
88
|
+
email: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, "strip", z.ZodTypeAny, {
|
|
90
|
+
githubUsername: string;
|
|
91
|
+
email?: string | undefined;
|
|
92
|
+
}, {
|
|
93
|
+
githubUsername: string;
|
|
94
|
+
email?: string | undefined;
|
|
95
|
+
}>;
|
|
96
|
+
repo: z.ZodObject<{
|
|
97
|
+
fullName: z.ZodString;
|
|
98
|
+
headSha: z.ZodString;
|
|
99
|
+
defaultBranch: z.ZodString;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
fullName: string;
|
|
102
|
+
headSha: string;
|
|
103
|
+
defaultBranch: string;
|
|
104
|
+
}, {
|
|
105
|
+
fullName: string;
|
|
106
|
+
headSha: string;
|
|
107
|
+
defaultBranch: string;
|
|
108
|
+
}>;
|
|
109
|
+
budget: z.ZodObject<{
|
|
110
|
+
provider: z.ZodString;
|
|
111
|
+
totalTokensBudgeted: z.ZodNumber;
|
|
112
|
+
totalTokensUsed: z.ZodNumber;
|
|
113
|
+
estimatedCostUsd: z.ZodOptional<z.ZodNumber>;
|
|
114
|
+
}, "strip", z.ZodTypeAny, {
|
|
115
|
+
provider: string;
|
|
116
|
+
totalTokensBudgeted: number;
|
|
117
|
+
totalTokensUsed: number;
|
|
118
|
+
estimatedCostUsd?: number | undefined;
|
|
119
|
+
}, {
|
|
120
|
+
provider: string;
|
|
121
|
+
totalTokensBudgeted: number;
|
|
122
|
+
totalTokensUsed: number;
|
|
123
|
+
estimatedCostUsd?: number | undefined;
|
|
124
|
+
}>;
|
|
125
|
+
tasks: z.ZodArray<z.ZodObject<{
|
|
126
|
+
taskId: z.ZodString;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
source: z.ZodEnum<["lint", "todo", "test-gap", "dead-code", "github-issue", "github-pr-review", "custom"]>;
|
|
129
|
+
complexity: z.ZodEnum<["trivial", "simple", "moderate", "complex"]>;
|
|
130
|
+
status: z.ZodEnum<["success", "partial", "failed"]>;
|
|
131
|
+
tokensUsed: z.ZodNumber;
|
|
132
|
+
duration: z.ZodNumber;
|
|
133
|
+
filesChanged: z.ZodArray<z.ZodString, "many">;
|
|
134
|
+
pr: z.ZodOptional<z.ZodObject<{
|
|
135
|
+
number: z.ZodNumber;
|
|
136
|
+
url: z.ZodString;
|
|
137
|
+
status: z.ZodEnum<["open", "merged", "closed"]>;
|
|
138
|
+
}, "strip", z.ZodTypeAny, {
|
|
139
|
+
number: number;
|
|
140
|
+
status: "open" | "merged" | "closed";
|
|
141
|
+
url: string;
|
|
142
|
+
}, {
|
|
143
|
+
number: number;
|
|
144
|
+
status: "open" | "merged" | "closed";
|
|
145
|
+
url: string;
|
|
146
|
+
}>>;
|
|
147
|
+
linkedIssue: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
number: z.ZodNumber;
|
|
149
|
+
url: z.ZodString;
|
|
150
|
+
}, "strip", z.ZodTypeAny, {
|
|
151
|
+
number: number;
|
|
152
|
+
url: string;
|
|
153
|
+
}, {
|
|
154
|
+
number: number;
|
|
155
|
+
url: string;
|
|
156
|
+
}>>;
|
|
157
|
+
error: z.ZodOptional<z.ZodString>;
|
|
158
|
+
}, "strip", z.ZodTypeAny, {
|
|
159
|
+
taskId: string;
|
|
160
|
+
title: string;
|
|
161
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
162
|
+
status: "success" | "partial" | "failed";
|
|
163
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
164
|
+
tokensUsed: number;
|
|
165
|
+
duration: number;
|
|
166
|
+
filesChanged: string[];
|
|
167
|
+
pr?: {
|
|
168
|
+
number: number;
|
|
169
|
+
status: "open" | "merged" | "closed";
|
|
170
|
+
url: string;
|
|
171
|
+
} | undefined;
|
|
172
|
+
linkedIssue?: {
|
|
173
|
+
number: number;
|
|
174
|
+
url: string;
|
|
175
|
+
} | undefined;
|
|
176
|
+
error?: string | undefined;
|
|
177
|
+
}, {
|
|
178
|
+
taskId: string;
|
|
179
|
+
title: string;
|
|
180
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
181
|
+
status: "success" | "partial" | "failed";
|
|
182
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
183
|
+
tokensUsed: number;
|
|
184
|
+
duration: number;
|
|
185
|
+
filesChanged: string[];
|
|
186
|
+
pr?: {
|
|
187
|
+
number: number;
|
|
188
|
+
status: "open" | "merged" | "closed";
|
|
189
|
+
url: string;
|
|
190
|
+
} | undefined;
|
|
191
|
+
linkedIssue?: {
|
|
192
|
+
number: number;
|
|
193
|
+
url: string;
|
|
194
|
+
} | undefined;
|
|
195
|
+
error?: string | undefined;
|
|
196
|
+
}>, "many">;
|
|
197
|
+
metrics: z.ZodObject<{
|
|
198
|
+
tasksDiscovered: z.ZodNumber;
|
|
199
|
+
tasksAttempted: z.ZodNumber;
|
|
200
|
+
tasksSucceeded: z.ZodNumber;
|
|
201
|
+
tasksFailed: z.ZodNumber;
|
|
202
|
+
totalDuration: z.ZodNumber;
|
|
203
|
+
totalFilesChanged: z.ZodNumber;
|
|
204
|
+
totalLinesAdded: z.ZodNumber;
|
|
205
|
+
totalLinesRemoved: z.ZodNumber;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
tasksDiscovered: number;
|
|
208
|
+
tasksAttempted: number;
|
|
209
|
+
tasksSucceeded: number;
|
|
210
|
+
tasksFailed: number;
|
|
211
|
+
totalDuration: number;
|
|
212
|
+
totalFilesChanged: number;
|
|
213
|
+
totalLinesAdded: number;
|
|
214
|
+
totalLinesRemoved: number;
|
|
215
|
+
}, {
|
|
216
|
+
tasksDiscovered: number;
|
|
217
|
+
tasksAttempted: number;
|
|
218
|
+
tasksSucceeded: number;
|
|
219
|
+
tasksFailed: number;
|
|
220
|
+
totalDuration: number;
|
|
221
|
+
totalFilesChanged: number;
|
|
222
|
+
totalLinesAdded: number;
|
|
223
|
+
totalLinesRemoved: number;
|
|
224
|
+
}>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
version: "1.0";
|
|
227
|
+
runId: string;
|
|
228
|
+
timestamp: string;
|
|
229
|
+
contributor: {
|
|
230
|
+
githubUsername: string;
|
|
231
|
+
email?: string | undefined;
|
|
232
|
+
};
|
|
233
|
+
repo: {
|
|
234
|
+
fullName: string;
|
|
235
|
+
headSha: string;
|
|
236
|
+
defaultBranch: string;
|
|
237
|
+
};
|
|
238
|
+
budget: {
|
|
239
|
+
provider: string;
|
|
240
|
+
totalTokensBudgeted: number;
|
|
241
|
+
totalTokensUsed: number;
|
|
242
|
+
estimatedCostUsd?: number | undefined;
|
|
243
|
+
};
|
|
244
|
+
tasks: {
|
|
245
|
+
taskId: string;
|
|
246
|
+
title: string;
|
|
247
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
248
|
+
status: "success" | "partial" | "failed";
|
|
249
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
250
|
+
tokensUsed: number;
|
|
251
|
+
duration: number;
|
|
252
|
+
filesChanged: string[];
|
|
253
|
+
pr?: {
|
|
254
|
+
number: number;
|
|
255
|
+
status: "open" | "merged" | "closed";
|
|
256
|
+
url: string;
|
|
257
|
+
} | undefined;
|
|
258
|
+
linkedIssue?: {
|
|
259
|
+
number: number;
|
|
260
|
+
url: string;
|
|
261
|
+
} | undefined;
|
|
262
|
+
error?: string | undefined;
|
|
263
|
+
}[];
|
|
264
|
+
metrics: {
|
|
265
|
+
tasksDiscovered: number;
|
|
266
|
+
tasksAttempted: number;
|
|
267
|
+
tasksSucceeded: number;
|
|
268
|
+
tasksFailed: number;
|
|
269
|
+
totalDuration: number;
|
|
270
|
+
totalFilesChanged: number;
|
|
271
|
+
totalLinesAdded: number;
|
|
272
|
+
totalLinesRemoved: number;
|
|
273
|
+
};
|
|
274
|
+
}, {
|
|
275
|
+
version: "1.0";
|
|
276
|
+
runId: string;
|
|
277
|
+
timestamp: string;
|
|
278
|
+
contributor: {
|
|
279
|
+
githubUsername: string;
|
|
280
|
+
email?: string | undefined;
|
|
281
|
+
};
|
|
282
|
+
repo: {
|
|
283
|
+
fullName: string;
|
|
284
|
+
headSha: string;
|
|
285
|
+
defaultBranch: string;
|
|
286
|
+
};
|
|
287
|
+
budget: {
|
|
288
|
+
provider: string;
|
|
289
|
+
totalTokensBudgeted: number;
|
|
290
|
+
totalTokensUsed: number;
|
|
291
|
+
estimatedCostUsd?: number | undefined;
|
|
292
|
+
};
|
|
293
|
+
tasks: {
|
|
294
|
+
taskId: string;
|
|
295
|
+
title: string;
|
|
296
|
+
source: "lint" | "todo" | "test-gap" | "dead-code" | "github-issue" | "github-pr-review" | "custom";
|
|
297
|
+
status: "success" | "partial" | "failed";
|
|
298
|
+
complexity: "trivial" | "simple" | "moderate" | "complex";
|
|
299
|
+
tokensUsed: number;
|
|
300
|
+
duration: number;
|
|
301
|
+
filesChanged: string[];
|
|
302
|
+
pr?: {
|
|
303
|
+
number: number;
|
|
304
|
+
status: "open" | "merged" | "closed";
|
|
305
|
+
url: string;
|
|
306
|
+
} | undefined;
|
|
307
|
+
linkedIssue?: {
|
|
308
|
+
number: number;
|
|
309
|
+
url: string;
|
|
310
|
+
} | undefined;
|
|
311
|
+
error?: string | undefined;
|
|
312
|
+
}[];
|
|
313
|
+
metrics: {
|
|
314
|
+
tasksDiscovered: number;
|
|
315
|
+
tasksAttempted: number;
|
|
316
|
+
tasksSucceeded: number;
|
|
317
|
+
tasksFailed: number;
|
|
318
|
+
totalDuration: number;
|
|
319
|
+
totalFilesChanged: number;
|
|
320
|
+
totalLinesAdded: number;
|
|
321
|
+
totalLinesRemoved: number;
|
|
322
|
+
};
|
|
323
|
+
}>;
|
|
324
|
+
type ContributionTask = z.infer<typeof contributionTaskSchema>;
|
|
325
|
+
type ContributionLog = z.infer<typeof contributionLogSchema>;
|
|
326
|
+
declare function parseContributionLog(input: unknown): ContributionLog;
|
|
327
|
+
|
|
328
|
+
declare function writeContributionLog(log: ContributionLog, repoPath: string): Promise<string>;
|
|
329
|
+
|
|
330
|
+
interface Leaderboard {
|
|
331
|
+
generatedAt: string;
|
|
332
|
+
entries: LeaderboardEntry[];
|
|
333
|
+
repoStats: {
|
|
334
|
+
totalContributions: number;
|
|
335
|
+
totalTokensUsed: number;
|
|
336
|
+
totalPRsCreated: number;
|
|
337
|
+
totalPRsMerged: number;
|
|
338
|
+
firstContribution: string;
|
|
339
|
+
lastContribution: string;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
interface LeaderboardEntry {
|
|
343
|
+
githubUsername: string;
|
|
344
|
+
totalRuns: number;
|
|
345
|
+
totalTasksCompleted: number;
|
|
346
|
+
totalTokensDonated: number;
|
|
347
|
+
totalFilesChanged: number;
|
|
348
|
+
totalLinesChanged: number;
|
|
349
|
+
totalPRsCreated: number;
|
|
350
|
+
totalPRsMerged: number;
|
|
351
|
+
favoriteTaskSource: TaskSource;
|
|
352
|
+
firstContribution: string;
|
|
353
|
+
lastContribution: string;
|
|
354
|
+
}
|
|
355
|
+
declare function buildLeaderboard(repoPath: string): Promise<Leaderboard>;
|
|
356
|
+
|
|
357
|
+
export { type AgentProviderId, type ContributionLog, type ContributionTask, type ContributionTaskStatus, type Leaderboard, type LeaderboardEntry, type TaskComplexity, type TaskSource, buildLeaderboard, contributionLogSchema, contributionTaskSchema, parseContributionLog, writeContributionLog };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildLeaderboard,
|
|
3
|
+
contributionLogSchema,
|
|
4
|
+
contributionTaskSchema,
|
|
5
|
+
parseContributionLog,
|
|
6
|
+
writeContributionLog
|
|
7
|
+
} from "../chunk-LQC5DLT7.js";
|
|
8
|
+
export {
|
|
9
|
+
buildLeaderboard,
|
|
10
|
+
contributionLogSchema,
|
|
11
|
+
contributionTaskSchema,
|
|
12
|
+
parseContributionLog,
|
|
13
|
+
writeContributionLog
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|