@twelvehart/orcats 0.0.0-seed.0 → 0.2.3
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/LICENSE +48 -0
- package/NOTICE +5 -0
- package/README.md +399 -0
- package/bin/orcats +4 -0
- package/dist/backends/acp-client.d.ts +74 -0
- package/dist/backends/acp-client.d.ts.map +1 -0
- package/dist/backends/acp-run.d.ts +31 -0
- package/dist/backends/acp-run.d.ts.map +1 -0
- package/dist/backends/claude-run.d.ts +35 -0
- package/dist/backends/claude-run.d.ts.map +1 -0
- package/dist/backends/claude-stream-json.d.ts +15 -0
- package/dist/backends/claude-stream-json.d.ts.map +1 -0
- package/dist/backends/codex-jsonl.d.ts +34 -0
- package/dist/backends/codex-jsonl.d.ts.map +1 -0
- package/dist/backends/codex-run.d.ts +40 -0
- package/dist/backends/codex-run.d.ts.map +1 -0
- package/dist/backends/codex.d.ts +5 -0
- package/dist/backends/codex.d.ts.map +1 -0
- package/dist/backends/conversation-config.d.ts +12 -0
- package/dist/backends/conversation-config.d.ts.map +1 -0
- package/dist/backends/index.d.ts +14 -0
- package/dist/backends/index.d.ts.map +1 -0
- package/dist/backends/opencode-run.d.ts +48 -0
- package/dist/backends/opencode-run.d.ts.map +1 -0
- package/dist/backends/opencode-sse.d.ts +35 -0
- package/dist/backends/opencode-sse.d.ts.map +1 -0
- package/dist/backends/pi-rpc.d.ts +21 -0
- package/dist/backends/pi-rpc.d.ts.map +1 -0
- package/dist/backends/pi-run.d.ts +21 -0
- package/dist/backends/pi-run.d.ts.map +1 -0
- package/dist/backends/select.d.ts +17 -0
- package/dist/backends/select.d.ts.map +1 -0
- package/dist/backends/subprocess-run.d.ts +68 -0
- package/dist/backends/subprocess-run.d.ts.map +1 -0
- package/dist/backends/types.d.ts +17 -0
- package/dist/backends/types.d.ts.map +1 -0
- package/dist/backends/unsupported.d.ts +9 -0
- package/dist/backends/unsupported.d.ts.map +1 -0
- package/dist/baseline/index.d.ts +56 -0
- package/dist/baseline/index.d.ts.map +1 -0
- package/dist/cli/args.d.ts +22 -0
- package/dist/cli/args.d.ts.map +1 -0
- package/dist/cli/embedded.d.ts +7 -0
- package/dist/cli/embedded.d.ts.map +1 -0
- package/dist/cli/main.d.ts +6 -0
- package/dist/cli/main.d.ts.map +1 -0
- package/dist/cli/version.d.ts +2 -0
- package/dist/cli/version.d.ts.map +1 -0
- package/dist/conversation/ask-user.d.ts +17 -0
- package/dist/conversation/ask-user.d.ts.map +1 -0
- package/dist/conversation/conversation.d.ts +46 -0
- package/dist/conversation/conversation.d.ts.map +1 -0
- package/dist/conversation/harness.d.ts +14 -0
- package/dist/conversation/harness.d.ts.map +1 -0
- package/dist/conversation/index.d.ts +5 -0
- package/dist/conversation/index.d.ts.map +1 -0
- package/dist/conversation/queue.d.ts +15 -0
- package/dist/conversation/queue.d.ts.map +1 -0
- package/dist/flow/accessors.d.ts +13 -0
- package/dist/flow/accessors.d.ts.map +1 -0
- package/dist/flow/approvals.d.ts +6 -0
- package/dist/flow/approvals.d.ts.map +1 -0
- package/dist/flow/args.d.ts +4 -0
- package/dist/flow/args.d.ts.map +1 -0
- package/dist/flow/context.d.ts +36 -0
- package/dist/flow/context.d.ts.map +1 -0
- package/dist/flow/index.d.ts +5 -0
- package/dist/flow/index.d.ts.map +1 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/loop/builder/index.d.ts +17 -0
- package/dist/loop/builder/index.d.ts.map +1 -0
- package/dist/loop/builder/types.d.ts +97 -0
- package/dist/loop/builder/types.d.ts.map +1 -0
- package/dist/loop/context/compaction.d.ts +38 -0
- package/dist/loop/context/compaction.d.ts.map +1 -0
- package/dist/loop/context/index.d.ts +4 -0
- package/dist/loop/context/index.d.ts.map +1 -0
- package/dist/loop/context/offload.d.ts +34 -0
- package/dist/loop/context/offload.d.ts.map +1 -0
- package/dist/loop/context/types.d.ts +13 -0
- package/dist/loop/context/types.d.ts.map +1 -0
- package/dist/loop/engine/bridge.d.ts +21 -0
- package/dist/loop/engine/bridge.d.ts.map +1 -0
- package/dist/loop/engine/index.d.ts +73 -0
- package/dist/loop/engine/index.d.ts.map +1 -0
- package/dist/loop/execution.d.ts +68 -0
- package/dist/loop/execution.d.ts.map +1 -0
- package/dist/loop/fanout.d.ts +148 -0
- package/dist/loop/fanout.d.ts.map +1 -0
- package/dist/loop/firing.d.ts +54 -0
- package/dist/loop/firing.d.ts.map +1 -0
- package/dist/loop/graph/analyze.d.ts +8 -0
- package/dist/loop/graph/analyze.d.ts.map +1 -0
- package/dist/loop/graph/index.d.ts +3 -0
- package/dist/loop/graph/index.d.ts.map +1 -0
- package/dist/loop/graph/types.d.ts +35 -0
- package/dist/loop/graph/types.d.ts.map +1 -0
- package/dist/loop/index.d.ts +7 -0
- package/dist/loop/index.d.ts.map +1 -0
- package/dist/loop/io/index.d.ts +4 -0
- package/dist/loop/io/index.d.ts.map +1 -0
- package/dist/loop/io/linear.d.ts +142 -0
- package/dist/loop/io/linear.d.ts.map +1 -0
- package/dist/loop/io/sink.d.ts +47 -0
- package/dist/loop/io/sink.d.ts.map +1 -0
- package/dist/loop/io/source.d.ts +64 -0
- package/dist/loop/io/source.d.ts.map +1 -0
- package/dist/loop/serve.d.ts +97 -0
- package/dist/loop/serve.d.ts.map +1 -0
- package/dist/loop/state/index.d.ts +5 -0
- package/dist/loop/state/index.d.ts.map +1 -0
- package/dist/loop/state/manifest.d.ts +36 -0
- package/dist/loop/state/manifest.d.ts.map +1 -0
- package/dist/loop/state/port.d.ts +33 -0
- package/dist/loop/state/port.d.ts.map +1 -0
- package/dist/loop/state/snapshot.d.ts +15 -0
- package/dist/loop/state/snapshot.d.ts.map +1 -0
- package/dist/loop/state/sqlite.d.ts +31 -0
- package/dist/loop/state/sqlite.d.ts.map +1 -0
- package/dist/loop/termination-contract.d.ts +28 -0
- package/dist/loop/termination-contract.d.ts.map +1 -0
- package/dist/loop/termination.d.ts +33 -0
- package/dist/loop/termination.d.ts.map +1 -0
- package/dist/model/backend-config.d.ts +30 -0
- package/dist/model/backend-config.d.ts.map +1 -0
- package/dist/model/brand.d.ts +9 -0
- package/dist/model/brand.d.ts.map +1 -0
- package/dist/model/errors.d.ts +11 -0
- package/dist/model/errors.d.ts.map +1 -0
- package/dist/model/index.d.ts +8 -0
- package/dist/model/index.d.ts.map +1 -0
- package/dist/model/json-schema.d.ts +4 -0
- package/dist/model/json-schema.d.ts.map +1 -0
- package/dist/model/result.d.ts +3 -0
- package/dist/model/result.d.ts.map +1 -0
- package/dist/model/schemas.d.ts +435 -0
- package/dist/model/schemas.d.ts.map +1 -0
- package/dist/model/structured.d.ts +9 -0
- package/dist/model/structured.d.ts.map +1 -0
- package/dist/monitor/index.d.ts +139 -0
- package/dist/monitor/index.d.ts.map +1 -0
- package/dist/plan/index.d.ts +3 -0
- package/dist/plan/index.d.ts.map +1 -0
- package/dist/plan/persistent.d.ts +23 -0
- package/dist/plan/persistent.d.ts.map +1 -0
- package/dist/plan/verdict.d.ts +9 -0
- package/dist/plan/verdict.d.ts.map +1 -0
- package/dist/review/index.d.ts +4 -0
- package/dist/review/index.d.ts.map +1 -0
- package/dist/review/loop.d.ts +117 -0
- package/dist/review/loop.d.ts.map +1 -0
- package/dist/review/reviewers.d.ts +13 -0
- package/dist/review/reviewers.d.ts.map +1 -0
- package/dist/review/tool.d.ts +20 -0
- package/dist/review/tool.d.ts.map +1 -0
- package/dist/run-output/index.d.ts +112 -0
- package/dist/run-output/index.d.ts.map +1 -0
- package/dist/runner/index.d.ts +2 -0
- package/dist/runner/index.d.ts.map +1 -0
- package/dist/runner/typecheck.d.ts +23 -0
- package/dist/runner/typecheck.d.ts.map +1 -0
- package/dist/test-utils/fakes.d.ts +76 -0
- package/dist/test-utils/fakes.d.ts.map +1 -0
- package/dist/test-utils/fixtures.d.ts +4 -0
- package/dist/test-utils/fixtures.d.ts.map +1 -0
- package/dist/test-utils/index.d.ts +4 -0
- package/dist/test-utils/index.d.ts.map +1 -0
- package/dist/test-utils/tier2.d.ts +8 -0
- package/dist/test-utils/tier2.d.ts.map +1 -0
- package/dist/tools/fs.d.ts +11 -0
- package/dist/tools/fs.d.ts.map +1 -0
- package/dist/tools/git.d.ts +10 -0
- package/dist/tools/git.d.ts.map +1 -0
- package/dist/tools/github.d.ts +13 -0
- package/dist/tools/github.d.ts.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/linear.d.ts +117 -0
- package/dist/tools/linear.d.ts.map +1 -0
- package/dist/tools/process.d.ts +40 -0
- package/dist/tools/process.d.ts.map +1 -0
- package/dist/tools/terminal.d.ts +23 -0
- package/dist/tools/terminal.d.ts.map +1 -0
- package/package.json +89 -9
- package/src/backends/acp-client.ts +324 -0
- package/src/backends/acp-run.ts +636 -0
- package/src/backends/claude-run.ts +226 -0
- package/src/backends/claude-stream-json.ts +273 -0
- package/src/backends/codex-jsonl.ts +339 -0
- package/src/backends/codex-run.ts +177 -0
- package/src/backends/codex.ts +84 -0
- package/src/backends/conversation-config.ts +26 -0
- package/src/backends/index.ts +13 -0
- package/src/backends/opencode-run.ts +432 -0
- package/src/backends/opencode-sse.ts +360 -0
- package/src/backends/pi-rpc.ts +242 -0
- package/src/backends/pi-run.ts +154 -0
- package/src/backends/select.ts +77 -0
- package/src/backends/subprocess-run.ts +305 -0
- package/src/backends/types.ts +29 -0
- package/src/backends/unsupported.ts +48 -0
- package/src/baseline/index.ts +437 -0
- package/src/cli/args.ts +109 -0
- package/src/cli/embedded.ts +206 -0
- package/src/cli/main.ts +332 -0
- package/src/cli/version.ts +1 -0
- package/src/conversation/ask-user.ts +105 -0
- package/src/conversation/conversation.ts +109 -0
- package/src/conversation/harness.ts +39 -0
- package/src/conversation/index.ts +4 -0
- package/src/conversation/queue.ts +86 -0
- package/src/flow/accessors.ts +43 -0
- package/src/flow/approvals.ts +10 -0
- package/src/flow/args.ts +26 -0
- package/src/flow/context.ts +106 -0
- package/src/flow/index.ts +4 -0
- package/src/index.ts +17 -0
- package/src/loop/builder/index.ts +346 -0
- package/src/loop/builder/types.ts +131 -0
- package/src/loop/context/compaction.ts +175 -0
- package/src/loop/context/index.ts +3 -0
- package/src/loop/context/offload.ts +79 -0
- package/src/loop/context/types.ts +17 -0
- package/src/loop/engine/bridge.ts +61 -0
- package/src/loop/engine/index.ts +166 -0
- package/src/loop/execution.ts +453 -0
- package/src/loop/fanout.ts +444 -0
- package/src/loop/firing.ts +188 -0
- package/src/loop/graph/analyze.ts +128 -0
- package/src/loop/graph/index.ts +2 -0
- package/src/loop/graph/types.ts +45 -0
- package/src/loop/index.ts +11 -0
- package/src/loop/io/index.ts +3 -0
- package/src/loop/io/linear.ts +714 -0
- package/src/loop/io/sink.ts +170 -0
- package/src/loop/io/source.ts +255 -0
- package/src/loop/serve.ts +307 -0
- package/src/loop/state/index.ts +4 -0
- package/src/loop/state/manifest.ts +56 -0
- package/src/loop/state/port.ts +43 -0
- package/src/loop/state/snapshot.ts +129 -0
- package/src/loop/state/sqlite.ts +265 -0
- package/src/loop/termination-contract.ts +89 -0
- package/src/loop/termination.ts +156 -0
- package/src/model/backend-config.ts +34 -0
- package/src/model/brand.ts +11 -0
- package/src/model/errors.ts +28 -0
- package/src/model/index.ts +7 -0
- package/src/model/json-schema.ts +14 -0
- package/src/model/result.ts +28 -0
- package/src/model/schemas.ts +218 -0
- package/src/model/structured.ts +26 -0
- package/src/monitor/index.ts +367 -0
- package/src/plan/index.ts +2 -0
- package/src/plan/persistent.ts +98 -0
- package/src/plan/verdict.ts +3 -0
- package/src/review/index.ts +3 -0
- package/src/review/loop.ts +365 -0
- package/src/review/reviewers.ts +92 -0
- package/src/review/tool.ts +41 -0
- package/src/run-output/index.ts +319 -0
- package/src/runner/index.ts +1 -0
- package/src/runner/typecheck.ts +72 -0
- package/src/test-utils/fakes.ts +260 -0
- package/src/test-utils/fixtures.ts +33 -0
- package/src/test-utils/index.ts +3 -0
- package/src/test-utils/tier2.ts +12 -0
- package/src/tools/fs.ts +44 -0
- package/src/tools/git.ts +34 -0
- package/src/tools/github.ts +25 -0
- package/src/tools/index.ts +6 -0
- package/src/tools/linear.ts +428 -0
- package/src/tools/process.ts +156 -0
- package/src/tools/terminal.ts +116 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type Result } from "neverthrow";
|
|
2
|
+
import { type FingerprintAction, type FingerprintDetectorOptions, type TokenUsageSummary } from "../loop/termination.ts";
|
|
3
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
4
|
+
import type { ReviewerId, ReviewerPrompt } from "./reviewers.ts";
|
|
5
|
+
export type { FingerprintAction, FingerprintDetectorOptions, TokenUsageSummary, } from "../loop/termination.ts";
|
|
6
|
+
/** Why the loop stopped. `converged` is the only success; the rest are
|
|
7
|
+
* non-convergence reasons that map onto a `regressed` verdict. */
|
|
8
|
+
export type FixLoopStop = "converged" | "unfixable" | "stuck" | "timeout" | "ceiling" | "budget-exhausted";
|
|
9
|
+
export type FixLoopFixOutcome = Result<unknown, RuntimeError>;
|
|
10
|
+
export interface FixLoopSummary<I extends {
|
|
11
|
+
readonly fixable: boolean;
|
|
12
|
+
} = ReviewIssue> {
|
|
13
|
+
readonly iterations: number;
|
|
14
|
+
readonly ignoredIssues: readonly I[];
|
|
15
|
+
readonly converged: boolean;
|
|
16
|
+
readonly stop: FixLoopStop;
|
|
17
|
+
readonly events: readonly string[];
|
|
18
|
+
readonly tokenUsage?: TokenUsageSummary;
|
|
19
|
+
}
|
|
20
|
+
export type IssueFingerprint<I extends {
|
|
21
|
+
readonly fixable: boolean;
|
|
22
|
+
}> = ((issues: readonly I[]) => FingerprintAction | undefined) | (Omit<FingerprintDetectorOptions<readonly I[]>, "project"> & {
|
|
23
|
+
readonly project: (issues: readonly I[]) => FingerprintAction | undefined;
|
|
24
|
+
});
|
|
25
|
+
export interface FixLoopOptions<I extends {
|
|
26
|
+
readonly fixable: boolean;
|
|
27
|
+
}> {
|
|
28
|
+
/** High sanity ceiling on fix iterations — a seatbelt, not the policy. */
|
|
29
|
+
readonly maxIterations?: number;
|
|
30
|
+
/** Wall-clock backstop in ms across the whole loop. */
|
|
31
|
+
readonly wallClockMs?: number;
|
|
32
|
+
/** Optional token budget across fix cycles that report backend usage. */
|
|
33
|
+
readonly tokenBudget?: number;
|
|
34
|
+
/** Stateful no-progress detector, owned by the caller. Called with the
|
|
35
|
+
* current round's issues before each fix; returning `true` stops the loop as
|
|
36
|
+
* `stuck`. Preserved for callers that already own their signature state. */
|
|
37
|
+
readonly stalled?: (issues: readonly I[]) => boolean;
|
|
38
|
+
/** Configured issue-list projection into the shared fingerprint primitive. */
|
|
39
|
+
readonly fingerprint?: IssueFingerprint<I>;
|
|
40
|
+
/** Injectable clock for deterministic tests. */
|
|
41
|
+
readonly now?: () => number;
|
|
42
|
+
}
|
|
43
|
+
export type FixLoopAction = FingerprintAction;
|
|
44
|
+
export interface GenericFixLoopSummary<State> {
|
|
45
|
+
readonly iterations: number;
|
|
46
|
+
readonly converged: boolean;
|
|
47
|
+
readonly stop: FixLoopStop;
|
|
48
|
+
readonly lastEvaluation: State;
|
|
49
|
+
readonly events: readonly string[];
|
|
50
|
+
readonly tokenUsage?: TokenUsageSummary;
|
|
51
|
+
}
|
|
52
|
+
export interface GenericFixLoopOptions<State, Action extends FixLoopAction = FixLoopAction> {
|
|
53
|
+
readonly evaluate: () => Promise<Result<State, RuntimeError>>;
|
|
54
|
+
readonly converged: (state: State) => boolean;
|
|
55
|
+
readonly nextAction: (state: State) => Action | undefined;
|
|
56
|
+
readonly fix: (action: Action, state: State) => Promise<FixLoopFixOutcome>;
|
|
57
|
+
/** High sanity ceiling on fix iterations — a seatbelt, not the policy. */
|
|
58
|
+
readonly maxIterations?: number;
|
|
59
|
+
/** Wall-clock backstop in ms across the whole loop. */
|
|
60
|
+
readonly wallClockMs?: number;
|
|
61
|
+
/** Optional token budget across fix cycles that report backend usage. */
|
|
62
|
+
readonly tokenBudget?: number;
|
|
63
|
+
/** Additional caller-owned stop predicate. The built-in fingerprint guard is
|
|
64
|
+
* still the default stuck detector for generic actions. */
|
|
65
|
+
readonly stalled?: (state: State, action: Action) => boolean;
|
|
66
|
+
/** Generic actions are fingerprinted by `{identity, inputs}` by default. */
|
|
67
|
+
readonly fingerprint?: false | Omit<FingerprintDetectorOptions<{
|
|
68
|
+
readonly state: State;
|
|
69
|
+
readonly action: Action;
|
|
70
|
+
}>, "project">;
|
|
71
|
+
/** Injectable clock for deterministic tests. */
|
|
72
|
+
readonly now?: () => number;
|
|
73
|
+
}
|
|
74
|
+
/** Generic convergence primitive: iterate `evaluate → action → fix` until the
|
|
75
|
+
* state converges or one guard fires. The action fingerprint guard hashes
|
|
76
|
+
* `{identity, inputs}` over a sliding window, so repeated commands and A→B→A
|
|
77
|
+
* oscillation use the same primitive. */
|
|
78
|
+
export declare function fixLoop<State, Action extends FixLoopAction = FixLoopAction>(options: GenericFixLoopOptions<State, Action>): Promise<Result<GenericFixLoopSummary<State>, RuntimeError>>;
|
|
79
|
+
/** Issue-list overload kept for current review callers. The third argument
|
|
80
|
+
* accepts a bare iteration count for backward compatibility or a full
|
|
81
|
+
* {@link FixLoopOptions}. */
|
|
82
|
+
export declare function fixLoop<I extends {
|
|
83
|
+
readonly fixable: boolean;
|
|
84
|
+
}>(evaluate: () => Promise<Result<readonly I[], RuntimeError>>, fix: (issues: readonly I[]) => Promise<FixLoopFixOutcome>, options?: number | FixLoopOptions<I>): Promise<Result<FixLoopSummary<I>, RuntimeError>>;
|
|
85
|
+
export interface ReviewIssue {
|
|
86
|
+
readonly reviewer: ReviewerId;
|
|
87
|
+
readonly message: string;
|
|
88
|
+
readonly fixable: boolean;
|
|
89
|
+
}
|
|
90
|
+
export interface ReviewTurn {
|
|
91
|
+
readonly reviewer: ReviewerId;
|
|
92
|
+
readonly issues: readonly ReviewIssue[];
|
|
93
|
+
}
|
|
94
|
+
export interface ReviewLoopSummary {
|
|
95
|
+
readonly selected: readonly ReviewerId[];
|
|
96
|
+
readonly issues: readonly ReviewIssue[];
|
|
97
|
+
readonly fixed: boolean;
|
|
98
|
+
readonly events: readonly string[];
|
|
99
|
+
}
|
|
100
|
+
export declare function runReviewersParallel<I extends ReviewIssue>(reviewers: readonly ReviewerPrompt[], review: (reviewer: ReviewerPrompt) => Promise<Result<readonly I[], RuntimeError>>): Promise<Result<readonly I[], RuntimeError>>;
|
|
101
|
+
export interface ReviewAndFixOptions {
|
|
102
|
+
readonly requested?: readonly ReviewerId[];
|
|
103
|
+
readonly loadPrompts?: () => Promise<ReviewerPrompt[]>;
|
|
104
|
+
readonly review: (reviewer: ReviewerPrompt) => Promise<Result<readonly ReviewIssue[], RuntimeError>>;
|
|
105
|
+
readonly fix: (issues: readonly ReviewIssue[]) => Promise<Result<void, RuntimeError>>;
|
|
106
|
+
readonly parallel?: boolean;
|
|
107
|
+
}
|
|
108
|
+
/** Review-and-fix `.until()` strategy over loop execution (design D7):
|
|
109
|
+
* one review pass collects issues, then loop execution drives the fixable-issue count
|
|
110
|
+
* to zero. A two-phase state runs reviewers exactly once and applies the fix at
|
|
111
|
+
* most once, reproducing the single-pass review/fix behavior. */
|
|
112
|
+
export declare function reviewAndFixStrategy(options: ReviewAndFixOptions): Promise<Result<ReviewLoopSummary, RuntimeError>>;
|
|
113
|
+
/** Deprecated compatibility wrapper kept for one release (design D7): delegates to
|
|
114
|
+
* `reviewAndFixStrategy` and emits a runtime DeprecationWarning. Not tagged
|
|
115
|
+
* `@deprecated` so existing callers still using it for this release stay lint-clean. */
|
|
116
|
+
export declare function runReviewAndFixLoop(options: ReviewAndFixOptions): Promise<Result<ReviewLoopSummary, RuntimeError>>;
|
|
117
|
+
//# sourceMappingURL=loop.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loop.d.ts","sourceRoot":"","sources":["../../src/review/loop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,EAEL,KAAK,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MAAM,EAAE,CAAC,QAAQ,EAAE,cAAc,KAAK,OAAO,CAAC,MAAM,CAAC,SAAS,WAAW,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC;IACrG,QAAQ,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IACtF,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;;iEAGiE;AACjE,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC,CA6ClD;AA8BD;;wFAEwF;AACxF,wBAAgB,mBAAmB,CACjC,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC,CAGlD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const ReviewerIds: readonly ["code-functionality", "test", "readability", "code-structure", "simplicity", "performance", "security", "scala-fp"];
|
|
2
|
+
export type ReviewerId = (typeof ReviewerIds)[number];
|
|
3
|
+
export interface ReviewerPrompt {
|
|
4
|
+
readonly id: ReviewerId;
|
|
5
|
+
readonly name?: string;
|
|
6
|
+
readonly description?: string;
|
|
7
|
+
readonly files?: string;
|
|
8
|
+
readonly prompt: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadReviewerPrompts(root?: string): Promise<ReviewerPrompt[]>;
|
|
11
|
+
export declare function selectReviewers(prompts: readonly ReviewerPrompt[], requested?: readonly ReviewerId[]): ReviewerPrompt[];
|
|
12
|
+
export declare function parseReviewerPrompt(id: ReviewerId, content: string): ReviewerPrompt;
|
|
13
|
+
//# sourceMappingURL=reviewers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewers.d.ts","sourceRoot":"","sources":["../../src/review/reviewers.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,WAAW,+HASd,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,EAAE,EAAE,UAAU,CAAC;IACxB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAsB,mBAAmB,CACvC,IAAI,SAAsB,GACzB,OAAO,CAAC,cAAc,EAAE,CAAC,CAO3B;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,SAAS,GAAE,SAAS,UAAU,EAAkD,GAC/E,cAAc,EAAE,CASlB;AAED,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAoCnF"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { Result } from "neverthrow";
|
|
2
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
3
|
+
import { type ReviewAndFixOptions, type ReviewLoopSummary } from "./loop.ts";
|
|
4
|
+
import type { ReviewerId, ReviewerPrompt } from "./reviewers.ts";
|
|
5
|
+
export declare const DefaultReviewers: readonly ["code-functionality", "readability", "test"];
|
|
6
|
+
export interface ReviewTool {
|
|
7
|
+
readonly reviewers: readonly ReviewerId[];
|
|
8
|
+
run(options: ReviewToolRunOptions): Promise<Result<ReviewLoopSummary, RuntimeError>>;
|
|
9
|
+
}
|
|
10
|
+
export interface ReviewToolOptions {
|
|
11
|
+
readonly reviewers?: readonly ReviewerId[];
|
|
12
|
+
}
|
|
13
|
+
export interface ReviewToolRunOptions {
|
|
14
|
+
readonly requested?: readonly ReviewerId[];
|
|
15
|
+
readonly loadPrompts?: () => Promise<ReviewerPrompt[]>;
|
|
16
|
+
readonly review: ReviewAndFixOptions["review"];
|
|
17
|
+
readonly fix: ReviewAndFixOptions["fix"];
|
|
18
|
+
}
|
|
19
|
+
export declare function createReviewTool(options?: ReviewToolOptions): ReviewTool;
|
|
20
|
+
//# sourceMappingURL=tool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tool.d.ts","sourceRoot":"","sources":["../../src/review/tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,iBAAiB,EACvB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEjE,eAAO,MAAM,gBAAgB,wDAAyD,CAAC;AAEvF,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,SAAS,EAAE,SAAS,UAAU,EAAE,CAAC;IAC1C,GAAG,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;CAC5C;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,SAAS,CAAC,EAAE,SAAS,UAAU,EAAE,CAAC;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;IACvD,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAC/C,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAC,KAAK,CAAC,CAAC;CAC1C;AAED,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,iBAAsB,GAAG,UAAU,CAa5E"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { Usage } from "../model/index.ts";
|
|
2
|
+
export type RunEvent = RunStartedEvent | RunHeartbeatEvent | RunFinishedEvent | PreflightEvent | StageEvent | AgentActivityEvent | CycleProgressEvent | OutcomeEvent | FailureEvent | ArtifactEvent;
|
|
3
|
+
export interface RunStartedEvent {
|
|
4
|
+
readonly type: "run_started";
|
|
5
|
+
readonly runId?: string;
|
|
6
|
+
readonly label?: string;
|
|
7
|
+
readonly backend?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface RunHeartbeatEvent {
|
|
10
|
+
readonly type: "run_heartbeat";
|
|
11
|
+
readonly label?: string;
|
|
12
|
+
readonly elapsedMs?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface RunFinishedEvent {
|
|
15
|
+
readonly type: "run_finished";
|
|
16
|
+
readonly label?: string;
|
|
17
|
+
readonly status: "success" | "failed";
|
|
18
|
+
readonly stopReason?: string;
|
|
19
|
+
readonly iterations?: number;
|
|
20
|
+
readonly error?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface PreflightEvent {
|
|
23
|
+
readonly type: "preflight";
|
|
24
|
+
readonly name: string;
|
|
25
|
+
readonly status: "started" | "passed" | "failed" | "skipped";
|
|
26
|
+
readonly reason?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface StageEvent {
|
|
29
|
+
readonly type: "stage";
|
|
30
|
+
readonly name: string;
|
|
31
|
+
readonly status: "started" | "running" | "completed" | "failed";
|
|
32
|
+
readonly durationMs?: number;
|
|
33
|
+
readonly message?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface AgentActivityEvent {
|
|
36
|
+
readonly type: "agent_activity";
|
|
37
|
+
readonly activity: "started" | "tool_use" | "tool_result" | "assistant_summary" | "usage";
|
|
38
|
+
readonly backend?: string;
|
|
39
|
+
readonly name?: string;
|
|
40
|
+
readonly summary?: string;
|
|
41
|
+
readonly usage?: Usage;
|
|
42
|
+
}
|
|
43
|
+
export interface CycleBranchEvent {
|
|
44
|
+
readonly id: string;
|
|
45
|
+
readonly status: string;
|
|
46
|
+
readonly usage?: Usage | "unknown";
|
|
47
|
+
}
|
|
48
|
+
export interface CycleContextPressureEvent {
|
|
49
|
+
readonly offloadCount: number;
|
|
50
|
+
readonly compactionStages: readonly string[];
|
|
51
|
+
readonly tokensBefore: number;
|
|
52
|
+
readonly tokensAfter: number;
|
|
53
|
+
readonly observationCount: number;
|
|
54
|
+
}
|
|
55
|
+
export interface CycleProgressEvent {
|
|
56
|
+
readonly type: "cycle_progress";
|
|
57
|
+
readonly iteration: number;
|
|
58
|
+
readonly measure?: number;
|
|
59
|
+
readonly delta?: number;
|
|
60
|
+
readonly stopStatus?: string;
|
|
61
|
+
readonly usage?: Usage | "unknown";
|
|
62
|
+
readonly branches?: readonly CycleBranchEvent[];
|
|
63
|
+
readonly contextPressure?: CycleContextPressureEvent;
|
|
64
|
+
}
|
|
65
|
+
export interface OutcomeEvent {
|
|
66
|
+
readonly type: "outcome";
|
|
67
|
+
readonly file: string;
|
|
68
|
+
readonly verdict: string;
|
|
69
|
+
readonly durationMs?: number;
|
|
70
|
+
readonly reason?: string;
|
|
71
|
+
}
|
|
72
|
+
export interface FailureEvent {
|
|
73
|
+
readonly type: "failure";
|
|
74
|
+
readonly file: string;
|
|
75
|
+
readonly category?: string;
|
|
76
|
+
readonly durationMs?: number;
|
|
77
|
+
readonly message: string;
|
|
78
|
+
}
|
|
79
|
+
export interface ArtifactEvent {
|
|
80
|
+
readonly type: "artifact";
|
|
81
|
+
readonly artifact: string;
|
|
82
|
+
readonly path: string;
|
|
83
|
+
readonly label?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface RunEventSink {
|
|
86
|
+
handle(event: RunEvent): void | Promise<void>;
|
|
87
|
+
}
|
|
88
|
+
export interface RunReporter {
|
|
89
|
+
emit(event: RunEvent): void;
|
|
90
|
+
events(): readonly RunEvent[];
|
|
91
|
+
flush(): Promise<void>;
|
|
92
|
+
}
|
|
93
|
+
export interface RunReporterOptions {
|
|
94
|
+
readonly sinks?: readonly RunEventSink[];
|
|
95
|
+
}
|
|
96
|
+
export interface RunNarrator {
|
|
97
|
+
summarize(events: readonly RunEvent[]): string | Promise<string>;
|
|
98
|
+
}
|
|
99
|
+
export interface RunPresenterOptions {
|
|
100
|
+
readonly env?: Record<string, string | undefined>;
|
|
101
|
+
readonly isTTY?: boolean;
|
|
102
|
+
readonly narration?: "disabled" | "enabled";
|
|
103
|
+
readonly narrator?: RunNarrator;
|
|
104
|
+
readonly writeDiagnostic?: (text: string) => void;
|
|
105
|
+
readonly writeOutput?: (text: string) => void;
|
|
106
|
+
}
|
|
107
|
+
export declare function activeRunReporter(): RunReporter | undefined;
|
|
108
|
+
export declare function withRunReporter<T>(reporter: RunReporter | undefined, fn: () => Promise<T> | T): Promise<T>;
|
|
109
|
+
export declare function createRunReporter(options?: RunReporterOptions): RunReporter;
|
|
110
|
+
export declare function createRunPresenter(options?: RunPresenterOptions): RunEventSink;
|
|
111
|
+
export declare function formatRunEvent(event: RunEvent, options?: Pick<RunPresenterOptions, "env" | "isTTY">): string;
|
|
112
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/run-output/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAChB,eAAe,GACf,iBAAiB,GACjB,gBAAgB,GAChB,cAAc,GACd,UAAU,GACV,kBAAkB,GAClB,kBAAkB,GAClB,YAAY,GACZ,YAAY,GACZ,aAAa,CAAC;AAElB,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,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,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;IAClD,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAC5C,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAClD,QAAQ,CAAC,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/C;AAKD,wBAAgB,iBAAiB,IAAI,WAAW,GAAG,SAAS,CAE3D;AAED,wBAAsB,eAAe,CAAC,CAAC,EACrC,QAAQ,EAAE,WAAW,GAAG,SAAS,EACjC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GACvB,OAAO,CAAC,CAAC,CAAC,CAUZ;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,kBAAuB,GAAG,WAAW,CA0B/E;AAED,wBAAgB,kBAAkB,CAAC,OAAO,GAAE,mBAAwB,GAAG,YAAY,CA6BlF;AAED,wBAAgB,cAAc,CAC5B,KAAK,EAAE,QAAQ,EACf,OAAO,GAAE,IAAI,CAAC,mBAAmB,EAAE,KAAK,GAAG,OAAO,CAAM,GACvD,MAAM,CAkCR"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runner/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Result } from "neverthrow";
|
|
2
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
3
|
+
import { type QuietProcResult } from "../tools/process.ts";
|
|
4
|
+
export interface CommandRunner {
|
|
5
|
+
(command: string, args: readonly string[], options: {
|
|
6
|
+
cwd: string;
|
|
7
|
+
}): Promise<Result<QuietProcResult, RuntimeError>>;
|
|
8
|
+
}
|
|
9
|
+
export interface TypecheckOptions {
|
|
10
|
+
readonly cwd: string;
|
|
11
|
+
readonly project?: string;
|
|
12
|
+
readonly skip?: boolean;
|
|
13
|
+
readonly runner?: CommandRunner;
|
|
14
|
+
readonly which?: (cwd: string) => string | null;
|
|
15
|
+
}
|
|
16
|
+
export interface TypecheckResult {
|
|
17
|
+
readonly skipped: boolean;
|
|
18
|
+
readonly stdout: string;
|
|
19
|
+
readonly stderr: string;
|
|
20
|
+
readonly reason?: "flag" | "tsc-not-found";
|
|
21
|
+
}
|
|
22
|
+
export declare function runTypecheck(options: TypecheckOptions): Promise<Result<TypecheckResult, RuntimeError>>;
|
|
23
|
+
//# sourceMappingURL=typecheck.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typecheck.d.ts","sourceRoot":"","sources":["../../src/runner/typecheck.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAErE,MAAM,WAAW,aAAa;IAC5B,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,OAAO,EAAE;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;CACtH;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,CAAC;CACjD;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,eAAe,CAAC;CAC5C;AAED,wBAAsB,YAAY,CAChC,OAAO,EAAE,gBAAgB,GACxB,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CA+BhD"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { ConversationEvent, LlmResult } from "../model/index.ts";
|
|
2
|
+
import { type Result } from "neverthrow";
|
|
3
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
4
|
+
import type { LlmBackend, LlmTool } from "../backends/types.ts";
|
|
5
|
+
import type { Sink, Source } from "../loop/io/index.ts";
|
|
6
|
+
import type { LinearAgentActivityInput, LinearAgentSessionUpdateInput, LinearIssueUpdateInput, LinearTool } from "../tools/index.ts";
|
|
7
|
+
export interface FakeSubprocess {
|
|
8
|
+
readonly lines: readonly string[];
|
|
9
|
+
readonly stderr?: string;
|
|
10
|
+
readonly exitCode?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface FakeHttpSseTransport {
|
|
13
|
+
readonly events: readonly string[];
|
|
14
|
+
}
|
|
15
|
+
export interface FakeRpcTransport<Request = unknown, Response = unknown> {
|
|
16
|
+
readonly requests: Request[];
|
|
17
|
+
readonly responses: Response[];
|
|
18
|
+
}
|
|
19
|
+
export interface FakeAgentRun {
|
|
20
|
+
readonly events: readonly ConversationEvent[];
|
|
21
|
+
readonly result: LlmResult;
|
|
22
|
+
readonly diff?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface ScriptedFakeAgentStep {
|
|
25
|
+
readonly events?: readonly ConversationEvent[];
|
|
26
|
+
readonly output?: string;
|
|
27
|
+
readonly diff?: string;
|
|
28
|
+
readonly failure?: RuntimeError;
|
|
29
|
+
}
|
|
30
|
+
export interface ScriptedFakeAgent {
|
|
31
|
+
run(prompt: string): Promise<Result<FakeAgentRun, RuntimeError>>;
|
|
32
|
+
readonly prompts: readonly string[];
|
|
33
|
+
}
|
|
34
|
+
export declare function scriptedSubprocess(lines: readonly string[]): FakeSubprocess;
|
|
35
|
+
export declare function scriptedSse(events: readonly string[]): FakeHttpSseTransport;
|
|
36
|
+
export declare function scriptedRpc<Request, Response>(responses: readonly Response[]): FakeRpcTransport<Request, Response>;
|
|
37
|
+
export declare function fakeAgentRun(events: readonly ConversationEvent[], result: LlmResult): FakeAgentRun;
|
|
38
|
+
export interface FakeLlmBackend extends LlmBackend<"codex"> {
|
|
39
|
+
readonly calls: readonly string[];
|
|
40
|
+
}
|
|
41
|
+
export declare function fakeBackend(outputs: readonly string[]): FakeLlmBackend;
|
|
42
|
+
export interface EventRecorder<E = ConversationEvent> {
|
|
43
|
+
readonly push: (event: E) => void;
|
|
44
|
+
readonly events: () => readonly E[];
|
|
45
|
+
}
|
|
46
|
+
export declare function eventRecorder<E = ConversationEvent>(): EventRecorder<E>;
|
|
47
|
+
export declare function createFakeLlmTool(fake: FakeLlmBackend): LlmTool;
|
|
48
|
+
export declare function scriptedFakeAgent(steps: readonly ScriptedFakeAgentStep[]): ScriptedFakeAgent;
|
|
49
|
+
export interface FakeSource<E> extends Source<E> {
|
|
50
|
+
readonly kind: "manual";
|
|
51
|
+
/** Push a trigger event to the started handler. No-op until started / after stop. */
|
|
52
|
+
fire(event: E): void;
|
|
53
|
+
/** Whether a handler is currently subscribed. */
|
|
54
|
+
isStarted(): boolean;
|
|
55
|
+
}
|
|
56
|
+
export declare function fakeSource<E = void>(): FakeSource<E>;
|
|
57
|
+
export interface FakeSink<A> extends Sink<A> {
|
|
58
|
+
readonly kind: "stdout";
|
|
59
|
+
/** Outputs captured by each successful emit, in order. */
|
|
60
|
+
emitted(): readonly A[];
|
|
61
|
+
}
|
|
62
|
+
/** A capturing Sink. With `failWith`, every emit returns `err(RuntimeError)` and captures nothing. */
|
|
63
|
+
export declare function fakeSink<A = unknown>(options?: {
|
|
64
|
+
failWith?: RuntimeError;
|
|
65
|
+
}): FakeSink<A>;
|
|
66
|
+
export interface FakeLinearTool extends LinearTool {
|
|
67
|
+
readonly issueComments: readonly {
|
|
68
|
+
readonly issueId: string;
|
|
69
|
+
readonly body: string;
|
|
70
|
+
}[];
|
|
71
|
+
readonly issueUpdates: readonly LinearIssueUpdateInput[];
|
|
72
|
+
readonly agentActivities: readonly LinearAgentActivityInput[];
|
|
73
|
+
readonly agentSessionUpdates: readonly LinearAgentSessionUpdateInput[];
|
|
74
|
+
}
|
|
75
|
+
export declare function createFakeLinearTool(): FakeLinearTool;
|
|
76
|
+
//# sourceMappingURL=fakes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fakes.d.ts","sourceRoot":"","sources":["../../src/test-utils/fakes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtE,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAqB,MAAM,sBAAsB,CAAC;AAInF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,EAAsB,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EACV,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,UAAU,EACX,MAAM,mBAAmB,CAAC;AAE3B,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAA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AAsG;AACtG,wBAAgB,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,GAAE;IAAE,QAAQ,CAAC,EAAE,YAAY,CAAA;CAAO,GAAG,QAAQ,CAAC,CAAC,CAAC,CAc5F;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,QAAQ,CAAC,aAAa,EAAE,SAAS;QAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACvF,QAAQ,CAAC,YAAY,EAAE,SAAS,sBAAsB,EAAE,CAAC;IACzD,QAAQ,CAAC,eAAe,EAAE,SAAS,wBAAwB,EAAE,CAAC;IAC9D,QAAQ,CAAC,mBAAmB,EAAE,SAAS,6BAA6B,EAAE,CAAC;CACxE;AAED,wBAAgB,oBAAoB,IAAI,cAAc,CA2CrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/test-utils/fixtures.ts"],"names":[],"mappings":"AAIA,wBAAsB,eAAe,CAAC,CAAC,GAAG,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC,CAE3E;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAAG,IAAI,CAExE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEjD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface Tier2Golden {
|
|
2
|
+
readonly commits: readonly string[];
|
|
3
|
+
readonly planFiles: Readonly<Record<string, string>>;
|
|
4
|
+
readonly terminal: readonly string[];
|
|
5
|
+
readonly events: readonly unknown[];
|
|
6
|
+
}
|
|
7
|
+
export declare function assertTier2Golden(actual: Tier2Golden, expected: Tier2Golden): void;
|
|
8
|
+
//# sourceMappingURL=tier2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tier2.d.ts","sourceRoot":"","sources":["../../src/test-utils/tier2.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC;CACrC;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,GAAG,IAAI,CAElF"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Result } from "neverthrow";
|
|
2
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
3
|
+
export interface FsTool {
|
|
4
|
+
readText(path: string): Promise<Result<string, RuntimeError>>;
|
|
5
|
+
writeText(path: string, content: string, options?: {
|
|
6
|
+
readonly mode?: number;
|
|
7
|
+
}): Promise<Result<void, RuntimeError>>;
|
|
8
|
+
exists(path: string): Promise<boolean>;
|
|
9
|
+
}
|
|
10
|
+
export declare function createFsTool(): FsTool;
|
|
11
|
+
//# sourceMappingURL=fs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/tools/fs.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAClD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAC9D,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IACpH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CACxC;AAED,wBAAgB,YAAY,IAAI,MAAM,CAgCrC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Result } from "neverthrow";
|
|
2
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
3
|
+
import { type QuietProcResult } from "./process.ts";
|
|
4
|
+
export interface GitTool {
|
|
5
|
+
status(): Promise<Result<string, RuntimeError>>;
|
|
6
|
+
add(paths: readonly string[]): Promise<Result<void, RuntimeError>>;
|
|
7
|
+
commit(message: string): Promise<Result<QuietProcResult, RuntimeError>>;
|
|
8
|
+
}
|
|
9
|
+
export declare function createGitTool(cwd: string): GitTool;
|
|
10
|
+
//# sourceMappingURL=git.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/tools/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAO,KAAK,MAAM,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,WAAW,OAAO;IACtB,MAAM,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC;IAChD,GAAG,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC;IACnE,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;CACzE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAuBlD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Result } from "neverthrow";
|
|
2
|
+
import type { RuntimeError } from "../model/index.ts";
|
|
3
|
+
import { type QuietProcResult } from "./process.ts";
|
|
4
|
+
export interface PullRequestInput {
|
|
5
|
+
readonly title: string;
|
|
6
|
+
readonly bodyFile: string;
|
|
7
|
+
readonly base?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface GitHubTool {
|
|
10
|
+
createPullRequest(input: PullRequestInput): Promise<Result<QuietProcResult, RuntimeError>>;
|
|
11
|
+
}
|
|
12
|
+
export declare function createGitHubTool(cwd: string): GitHubTool;
|
|
13
|
+
//# sourceMappingURL=github.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github.d.ts","sourceRoot":"","sources":["../../src/tools/github.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAE9D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,UAAU;IACzB,iBAAiB,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;CAC5F;AAED,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU,CAUxD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { type Result } from "neverthrow";
|
|
2
|
+
import { type RuntimeError } from "../model/index.ts";
|
|
3
|
+
export type LinearAuth = {
|
|
4
|
+
readonly kind: "apiKey";
|
|
5
|
+
readonly token: string;
|
|
6
|
+
} | {
|
|
7
|
+
readonly kind: "oauth";
|
|
8
|
+
readonly token: string;
|
|
9
|
+
};
|
|
10
|
+
export interface LinearGraphQLRequest {
|
|
11
|
+
readonly endpoint: string;
|
|
12
|
+
readonly query: string;
|
|
13
|
+
readonly variables?: Record<string, unknown>;
|
|
14
|
+
readonly headers: Record<string, string>;
|
|
15
|
+
readonly operationName?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LinearGraphQLError {
|
|
18
|
+
readonly message: string;
|
|
19
|
+
readonly path?: readonly (string | number)[];
|
|
20
|
+
readonly extensions?: Record<string, unknown>;
|
|
21
|
+
}
|
|
22
|
+
export interface LinearGraphQLResponse<TData = unknown> {
|
|
23
|
+
readonly data?: TData | null;
|
|
24
|
+
readonly errors?: readonly LinearGraphQLError[];
|
|
25
|
+
}
|
|
26
|
+
export type LinearGraphQLTransport = <TData = unknown>(request: LinearGraphQLRequest) => Promise<Result<LinearGraphQLResponse<TData>, RuntimeError>>;
|
|
27
|
+
export interface LinearTeamRef {
|
|
28
|
+
readonly id: string;
|
|
29
|
+
readonly key?: string | null;
|
|
30
|
+
readonly name?: string | null;
|
|
31
|
+
}
|
|
32
|
+
export interface LinearProjectRef {
|
|
33
|
+
readonly id: string;
|
|
34
|
+
readonly name?: string | null;
|
|
35
|
+
}
|
|
36
|
+
export interface LinearWorkflowState {
|
|
37
|
+
readonly id: string;
|
|
38
|
+
readonly name: string;
|
|
39
|
+
readonly type?: string | null;
|
|
40
|
+
}
|
|
41
|
+
export interface LinearIssue {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly identifier?: string | null;
|
|
44
|
+
readonly title?: string | null;
|
|
45
|
+
readonly description?: string | null;
|
|
46
|
+
readonly url?: string | null;
|
|
47
|
+
readonly team?: LinearTeamRef | null;
|
|
48
|
+
readonly project?: LinearProjectRef | null;
|
|
49
|
+
readonly state?: LinearWorkflowState | null;
|
|
50
|
+
}
|
|
51
|
+
export interface LinearIssueUpdateInput {
|
|
52
|
+
readonly issueId: string;
|
|
53
|
+
readonly title?: string;
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
readonly stateId?: string;
|
|
56
|
+
readonly assigneeId?: string | null;
|
|
57
|
+
readonly projectId?: string | null;
|
|
58
|
+
readonly priority?: number | null;
|
|
59
|
+
readonly labelIds?: readonly string[];
|
|
60
|
+
}
|
|
61
|
+
export interface LinearIssueComment {
|
|
62
|
+
readonly id: string;
|
|
63
|
+
readonly body?: string | null;
|
|
64
|
+
readonly url?: string | null;
|
|
65
|
+
}
|
|
66
|
+
export interface LinearAgentActivity {
|
|
67
|
+
readonly id: string;
|
|
68
|
+
readonly type?: string | null;
|
|
69
|
+
readonly body?: string | null;
|
|
70
|
+
}
|
|
71
|
+
export interface LinearExternalUrl {
|
|
72
|
+
readonly label?: string;
|
|
73
|
+
readonly url: string;
|
|
74
|
+
}
|
|
75
|
+
export interface LinearAgentSession {
|
|
76
|
+
readonly id: string;
|
|
77
|
+
readonly plan?: string | null;
|
|
78
|
+
readonly externalUrl?: string | null;
|
|
79
|
+
readonly externalUrls?: readonly LinearExternalUrl[];
|
|
80
|
+
}
|
|
81
|
+
export interface LinearAgentActivityInput {
|
|
82
|
+
readonly agentSessionId: string;
|
|
83
|
+
readonly type?: "action" | "response" | "error";
|
|
84
|
+
readonly body: string;
|
|
85
|
+
readonly metadata?: Record<string, unknown>;
|
|
86
|
+
}
|
|
87
|
+
export interface LinearAgentSessionUpdateInput {
|
|
88
|
+
readonly agentSessionId: string;
|
|
89
|
+
readonly plan?: string;
|
|
90
|
+
readonly externalUrl?: string;
|
|
91
|
+
readonly externalUrls?: readonly LinearExternalUrl[];
|
|
92
|
+
}
|
|
93
|
+
export interface LinearTool {
|
|
94
|
+
fetchIssue(input: {
|
|
95
|
+
readonly issueId: string;
|
|
96
|
+
}): Promise<Result<LinearIssue | null, RuntimeError>>;
|
|
97
|
+
updateIssue(input: LinearIssueUpdateInput): Promise<Result<LinearIssue, RuntimeError>>;
|
|
98
|
+
createIssueComment(input: {
|
|
99
|
+
readonly issueId: string;
|
|
100
|
+
readonly body: string;
|
|
101
|
+
}): Promise<Result<LinearIssueComment, RuntimeError>>;
|
|
102
|
+
createAgentActivity(input: LinearAgentActivityInput): Promise<Result<LinearAgentActivity, RuntimeError>>;
|
|
103
|
+
updateAgentSession(input: LinearAgentSessionUpdateInput): Promise<Result<LinearAgentSession, RuntimeError>>;
|
|
104
|
+
getTeamWorkflowStates(input: {
|
|
105
|
+
readonly teamId: string;
|
|
106
|
+
}): Promise<Result<readonly LinearWorkflowState[], RuntimeError>>;
|
|
107
|
+
}
|
|
108
|
+
export interface LinearToolOptions {
|
|
109
|
+
readonly auth?: LinearAuth;
|
|
110
|
+
readonly endpoint?: string;
|
|
111
|
+
readonly transport?: LinearGraphQLTransport;
|
|
112
|
+
readonly env?: Record<string, string | undefined>;
|
|
113
|
+
}
|
|
114
|
+
export declare function linearAuthFromEnv(env?: Record<string, string | undefined>): LinearAuth | undefined;
|
|
115
|
+
export declare function createFetchLinearGraphQLTransport(fetchImpl?: typeof fetch): LinearGraphQLTransport;
|
|
116
|
+
export declare function createLinearTool(options?: LinearToolOptions): LinearTool;
|
|
117
|
+
//# sourceMappingURL=linear.d.ts.map
|