@google/jules-fleet 0.0.1-experimental.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +205 -0
- package/dist/analyze/formatting.d.ts +19 -0
- package/dist/analyze/goals.d.ts +18 -0
- package/dist/analyze/handler.d.ts +23 -0
- package/dist/analyze/index.d.ts +8 -0
- package/dist/analyze/milestone.d.ts +43 -0
- package/dist/analyze/prompt.d.ts +10 -0
- package/dist/analyze/spec.d.ts +54 -0
- package/dist/analyze/triage-prompt.d.ts +16 -0
- package/dist/cli/analyze.command.d.ts +24 -0
- package/dist/cli/analyze.command.mjs +1015 -0
- package/dist/cli/commands.json +1 -0
- package/dist/cli/configure.command.d.ts +21 -0
- package/dist/cli/configure.command.mjs +623 -0
- package/dist/cli/dispatch.command.d.ts +16 -0
- package/dist/cli/dispatch.command.mjs +777 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.mjs +40 -0
- package/dist/cli/init.command.d.ts +38 -0
- package/dist/cli/init.command.mjs +1287 -0
- package/dist/cli/merge.command.d.ts +36 -0
- package/dist/cli/merge.command.mjs +859 -0
- package/dist/cli/signal.command.d.ts +2 -0
- package/dist/cli/signal.command.mjs +288 -0
- package/dist/configure/handler.d.ts +19 -0
- package/dist/configure/index.d.ts +4 -0
- package/dist/configure/labels.d.ts +6 -0
- package/dist/configure/spec.d.ts +49 -0
- package/dist/dispatch/events.d.ts +12 -0
- package/dist/dispatch/handler.d.ts +21 -0
- package/dist/dispatch/index.d.ts +5 -0
- package/dist/dispatch/spec.d.ts +47 -0
- package/dist/dispatch/status.d.ts +24 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.mjs +2105 -0
- package/dist/init/handler.d.ts +22 -0
- package/dist/init/index.d.ts +4 -0
- package/dist/init/ops/commit-files.d.ts +10 -0
- package/dist/init/ops/create-branch.d.ts +16 -0
- package/dist/init/ops/create-pr.d.ts +15 -0
- package/dist/init/ops/pr-body.d.ts +5 -0
- package/dist/init/ops/upload-secrets.d.ts +11 -0
- package/dist/init/spec.d.ts +50 -0
- package/dist/init/templates/analyze.d.ts +2 -0
- package/dist/init/templates/dispatch.d.ts +2 -0
- package/dist/init/templates/example-goal.d.ts +5 -0
- package/dist/init/templates/merge.d.ts +2 -0
- package/dist/init/templates/types.d.ts +6 -0
- package/dist/init/templates.d.ts +10 -0
- package/dist/init/types.d.ts +19 -0
- package/dist/init/wizard/headless.d.ts +8 -0
- package/dist/init/wizard/index.d.ts +3 -0
- package/dist/init/wizard/interactive.d.ts +9 -0
- package/dist/init/wizard/types.d.ts +22 -0
- package/dist/merge/handler.d.ts +21 -0
- package/dist/merge/index.d.ts +5 -0
- package/dist/merge/ops/index.d.ts +4 -0
- package/dist/merge/ops/redispatch.d.ts +8 -0
- package/dist/merge/ops/squash-merge.d.ts +8 -0
- package/dist/merge/ops/update-branch.d.ts +11 -0
- package/dist/merge/ops/wait-for-ci.d.ts +7 -0
- package/dist/merge/select/by-fleet-run.d.ts +8 -0
- package/dist/merge/select/by-label.d.ts +7 -0
- package/dist/merge/select/index.d.ts +2 -0
- package/dist/merge/spec.d.ts +99 -0
- package/dist/shared/auth/cache-plugin.d.ts +9 -0
- package/dist/shared/auth/git.d.ts +22 -0
- package/dist/shared/auth/index.d.ts +4 -0
- package/dist/shared/auth/octokit.d.ts +11 -0
- package/dist/shared/auth/resolve-key.d.ts +11 -0
- package/dist/shared/events/analyze.d.ts +37 -0
- package/dist/shared/events/configure.d.ts +21 -0
- package/dist/shared/events/dispatch.d.ts +26 -0
- package/dist/shared/events/error.d.ts +7 -0
- package/dist/shared/events/index.d.ts +16 -0
- package/dist/shared/events/init.d.ts +49 -0
- package/dist/shared/events/merge.d.ts +72 -0
- package/dist/shared/events.d.ts +1 -0
- package/dist/shared/index.d.ts +6 -0
- package/dist/shared/result/create-result-schemas.d.ts +72 -0
- package/dist/shared/result/fail.d.ts +10 -0
- package/dist/shared/result/index.d.ts +3 -0
- package/dist/shared/result/ok.d.ts +5 -0
- package/dist/shared/schemas/check-run.d.ts +16 -0
- package/dist/shared/schemas/index.d.ts +4 -0
- package/dist/shared/schemas/label.d.ts +16 -0
- package/dist/shared/schemas/pr.d.ts +19 -0
- package/dist/shared/schemas/repo-info.d.ts +16 -0
- package/dist/shared/session-dispatcher.d.ts +18 -0
- package/dist/shared/ui/assert-never.d.ts +13 -0
- package/dist/shared/ui/index.d.ts +18 -0
- package/dist/shared/ui/interactive.d.ts +19 -0
- package/dist/shared/ui/plain.d.ts +16 -0
- package/dist/shared/ui/render/analyze.d.ts +4 -0
- package/dist/shared/ui/render/configure.d.ts +4 -0
- package/dist/shared/ui/render/dispatch.d.ts +4 -0
- package/dist/shared/ui/render/error.d.ts +4 -0
- package/dist/shared/ui/render/init.d.ts +4 -0
- package/dist/shared/ui/render/merge.d.ts +4 -0
- package/dist/shared/ui/session-url.d.ts +13 -0
- package/dist/shared/ui/spec.d.ts +30 -0
- package/dist/signal/handler.d.ts +17 -0
- package/dist/signal/index.d.ts +3 -0
- package/dist/signal/spec.d.ts +60 -0
- package/package.json +76 -0
package/README.md
ADDED
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
# Jules Fleet
|
|
2
|
+
|
|
3
|
+
Continuous analysis and development, driven by simple goal files.
|
|
4
|
+
|
|
5
|
+
Fleet connects your development goals to Jules.
|
|
6
|
+
|
|
7
|
+
1. Write goals as markdown files describing what you want — improved test coverage, API drift detection, triaging open issues.
|
|
8
|
+
|
|
9
|
+
2. Fleet continuously analyzes your repository against those goals, creates actionable issues, dispatches Jules sessions to implement them, and sequentially merges the resulting PRs
|
|
10
|
+
|
|
11
|
+
The entire pipeline runs on a schedule via GitHub Actions, or on-demand from the CLI.
|
|
12
|
+
|
|
13
|
+
## Define a goal
|
|
14
|
+
|
|
15
|
+
Create a markdown file in `.fleet/goals/` describing what you want done. Goals are dispatched as agent sessions that each produce a pull request.
|
|
16
|
+
|
|
17
|
+
```markdown
|
|
18
|
+
---
|
|
19
|
+
milestone: "1"
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# Improve test coverage
|
|
23
|
+
|
|
24
|
+
Find modules with low test coverage and add missing unit tests.
|
|
25
|
+
|
|
26
|
+
## Tools
|
|
27
|
+
- Test Coverage: `npx vitest --coverage --json`
|
|
28
|
+
|
|
29
|
+
## Assessment Hints
|
|
30
|
+
- Focus on uncovered error handling paths
|
|
31
|
+
- Look for edge cases in utility functions
|
|
32
|
+
|
|
33
|
+
## Insight Hints
|
|
34
|
+
- Report on overall test coverage metrics
|
|
35
|
+
- Note modules below 60% coverage
|
|
36
|
+
|
|
37
|
+
## Constraints
|
|
38
|
+
- Do NOT duplicate tests that already exist
|
|
39
|
+
- Use the existing test patterns in the repo
|
|
40
|
+
- Keep tasks small — one module per issue
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## What happens when goals are dispatched
|
|
44
|
+
|
|
45
|
+
1. **Analyze** — The fleet reads your goal files and creates GitHub issues from them.
|
|
46
|
+
2. **Dispatch** — Each issue is sent to a Jules session that works on it in parallel.
|
|
47
|
+
3. **Merge** — Once sessions produce PRs, the fleet merges them one at a time, updating each branch and waiting for CI before the next merge.
|
|
48
|
+
|
|
49
|
+
If a merge conflict is detected, the fleet closes the conflicting PR, re-dispatches the task against the current base branch, and retries.
|
|
50
|
+
|
|
51
|
+
## Set up a repository
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npx @google/jules-fleet init --repo your-org/your-repo
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
This creates a pull request containing three GitHub Actions workflows and an example goal file. Merge the PR, then add `JULES_API_KEY` to your repository secrets.
|
|
58
|
+
|
|
59
|
+
## Configure labels
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
npx @google/jules-fleet configure labels --owner your-org --repo your-repo
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
Creates the `fleet-merge-ready` and `fleet` labels used by the workflows. Safe to run multiple times — existing labels are skipped.
|
|
66
|
+
|
|
67
|
+
## CLI Reference
|
|
68
|
+
|
|
69
|
+
### `jules-fleet merge`
|
|
70
|
+
|
|
71
|
+
Sequentially merge PRs that are ready, updating branches and waiting for CI between each merge.
|
|
72
|
+
|
|
73
|
+
```
|
|
74
|
+
jules-fleet merge --owner <owner> --repo <repo> [options]
|
|
75
|
+
|
|
76
|
+
Options:
|
|
77
|
+
--mode <label|fleet-run> PR selection mode (default: label)
|
|
78
|
+
--run-id <id> Fleet run ID (required for fleet-run mode)
|
|
79
|
+
--base <branch> Base branch (default: main)
|
|
80
|
+
--admin Bypass branch protection
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Label mode** merges all open PRs with the `fleet-merge-ready` label, oldest first.
|
|
84
|
+
|
|
85
|
+
**Fleet-run mode** merges PRs that contain a `<!-- fleet-run: <id> -->` marker in the body, grouping PRs from a single batch.
|
|
86
|
+
|
|
87
|
+
### `jules-fleet init`
|
|
88
|
+
|
|
89
|
+
Scaffold a repository for fleet workflows by creating a PR with the necessary files.
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
jules-fleet init --repo <owner/repo> [options]
|
|
93
|
+
|
|
94
|
+
Options:
|
|
95
|
+
--base <branch> Base branch for the PR (default: main)
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Files added by the PR:
|
|
99
|
+
- `.github/workflows/fleet-merge.yml`
|
|
100
|
+
- `.github/workflows/fleet-dispatch.yml`
|
|
101
|
+
- `.github/workflows/fleet-analyze.yml`
|
|
102
|
+
- `.fleet/goals/example.md`
|
|
103
|
+
|
|
104
|
+
### `jules-fleet configure`
|
|
105
|
+
|
|
106
|
+
Manage repository resources used by fleet workflows.
|
|
107
|
+
|
|
108
|
+
```
|
|
109
|
+
jules-fleet configure <resource> --owner <owner> --repo <repo> [options]
|
|
110
|
+
|
|
111
|
+
Resources:
|
|
112
|
+
labels Create or delete fleet labels
|
|
113
|
+
|
|
114
|
+
Options:
|
|
115
|
+
--delete Delete resources instead of creating them
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### `jules-fleet analyze`
|
|
119
|
+
|
|
120
|
+
Read goal files, fetch milestone context, and fire Jules analyzer sessions.
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
jules-fleet analyze [options]
|
|
124
|
+
|
|
125
|
+
Options:
|
|
126
|
+
--goal <path> Path to a specific goal file
|
|
127
|
+
--goals-dir <dir> Directory to discover goals from (default: .fleet/goals)
|
|
128
|
+
--milestone <id> Milestone ID to scope context
|
|
129
|
+
--owner <owner> Repository owner (auto-detected from git remote)
|
|
130
|
+
--repo <repo> Repository name (auto-detected from git remote)
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
Each goal file produces a Jules session that analyzes the repository and creates signals (GitHub issues labeled `fleet`).
|
|
134
|
+
|
|
135
|
+
### `jules-fleet dispatch`
|
|
136
|
+
|
|
137
|
+
Find undispatched fleet issues in a milestone and fire Jules worker sessions for each.
|
|
138
|
+
|
|
139
|
+
```
|
|
140
|
+
jules-fleet dispatch --milestone <id> [options]
|
|
141
|
+
|
|
142
|
+
Options:
|
|
143
|
+
--milestone <id> (required) Milestone ID to scope dispatch
|
|
144
|
+
--owner <owner> Repository owner (auto-detected from git remote)
|
|
145
|
+
--repo <repo> Repository name (auto-detected from git remote)
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Issues are skipped if they already have a dispatch event or linked PRs.
|
|
149
|
+
|
|
150
|
+
### `jules-fleet signal create`
|
|
151
|
+
|
|
152
|
+
Create a signal (insight or assessment) as a GitHub issue.
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
jules-fleet signal create --title <title> [options]
|
|
156
|
+
|
|
157
|
+
Options:
|
|
158
|
+
--title <title> (required) Signal title
|
|
159
|
+
--kind <insight|assessment> Signal kind (default: assessment)
|
|
160
|
+
--body <markdown> Signal body content
|
|
161
|
+
--body-file <path> Path to a markdown file for the body
|
|
162
|
+
--tag <tags> Comma-separated tags
|
|
163
|
+
--scope <name> Scope name (maps to milestone in GitHub)
|
|
164
|
+
--owner <owner> Repository owner (auto-detected from git remote)
|
|
165
|
+
--repo <repo> Repository name (auto-detected from git remote)
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Insights are informational findings. Assessments are actionable tasks that dispatch picks up.
|
|
169
|
+
|
|
170
|
+
### Environment Variables
|
|
171
|
+
|
|
172
|
+
```
|
|
173
|
+
GITHUB_TOKEN Required. GitHub token with repo access.
|
|
174
|
+
JULES_API_KEY Required for dispatch and re-dispatch operations.
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## Programmatic API
|
|
178
|
+
|
|
179
|
+
The handlers are exported for use in scripts and custom workflows.
|
|
180
|
+
|
|
181
|
+
```ts
|
|
182
|
+
import { MergeHandler, InitHandler, ConfigureHandler } from '@google/jules-fleet';
|
|
183
|
+
import { Octokit } from 'octokit';
|
|
184
|
+
|
|
185
|
+
const octokit = new Octokit({ auth: process.env.GITHUB_TOKEN });
|
|
186
|
+
|
|
187
|
+
const merge = new MergeHandler(octokit);
|
|
188
|
+
const result = await merge.execute({
|
|
189
|
+
mode: 'label',
|
|
190
|
+
baseBranch: 'main',
|
|
191
|
+
admin: false,
|
|
192
|
+
owner: 'your-org',
|
|
193
|
+
repo: 'your-repo',
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
if (result.success) {
|
|
197
|
+
console.log(`Merged: ${result.data.merged.join(', ')}`);
|
|
198
|
+
}
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## License
|
|
202
|
+
|
|
203
|
+
Apache-2.0
|
|
204
|
+
|
|
205
|
+
> **Note:** This is not an officially supported Google product. This project is not eligible for the [Google Open Source Software Vulnerability Rewards Program](https://bughunters.google.com/open-source-security).
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MilestoneIssue } from './milestone.js';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a MilestoneIssue into a rich markdown block suitable for prompt injection.
|
|
4
|
+
*/
|
|
5
|
+
export declare function toIssueMarkdown(issue: MilestoneIssue): string;
|
|
6
|
+
/**
|
|
7
|
+
* One-liner summary for compact prompt injection.
|
|
8
|
+
*/
|
|
9
|
+
export declare function toIssueLean(issue: MilestoneIssue): string;
|
|
10
|
+
/**
|
|
11
|
+
* Format PR context with issue links extracted from body.
|
|
12
|
+
*/
|
|
13
|
+
export declare function formatPRContext(pr: {
|
|
14
|
+
number: number;
|
|
15
|
+
title: string;
|
|
16
|
+
body?: string | null;
|
|
17
|
+
head?: string;
|
|
18
|
+
base?: string;
|
|
19
|
+
}): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** Parsed frontmatter configuration */
|
|
2
|
+
export interface GoalFileConfig {
|
|
3
|
+
/** Milestone number to scope to */
|
|
4
|
+
milestone?: string;
|
|
5
|
+
}
|
|
6
|
+
/** Result of parsing a goal file */
|
|
7
|
+
export interface ParsedGoalFile {
|
|
8
|
+
config: GoalFileConfig;
|
|
9
|
+
body: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parses a goal file's YAML frontmatter and markdown body.
|
|
13
|
+
*/
|
|
14
|
+
export declare function parseGoalFile(filePath: string): ParsedGoalFile;
|
|
15
|
+
/**
|
|
16
|
+
* Parses goal file content (for testability without filesystem).
|
|
17
|
+
*/
|
|
18
|
+
export declare function parseGoalContent(content: string): ParsedGoalFile;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Octokit } from 'octokit';
|
|
2
|
+
import type { AnalyzeInput, AnalyzeResult, AnalyzeSpec } from './spec.js';
|
|
3
|
+
import type { SessionDispatcher } from '../shared/session-dispatcher.js';
|
|
4
|
+
import type { FleetEmitter } from '../shared/events.js';
|
|
5
|
+
export interface AnalyzeHandlerDeps {
|
|
6
|
+
octokit: Octokit;
|
|
7
|
+
dispatcher: SessionDispatcher;
|
|
8
|
+
emit?: FleetEmitter;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* AnalyzeHandler reads goal files, fetches milestone context,
|
|
12
|
+
* builds a prompt, and dispatches Jules analyzer sessions.
|
|
13
|
+
* Never throws — all errors returned as Result.
|
|
14
|
+
*/
|
|
15
|
+
export declare class AnalyzeHandler implements AnalyzeSpec {
|
|
16
|
+
private octokit;
|
|
17
|
+
private dispatcher;
|
|
18
|
+
private emit;
|
|
19
|
+
constructor(deps: AnalyzeHandlerDeps);
|
|
20
|
+
execute(input: AnalyzeInput): Promise<AnalyzeResult>;
|
|
21
|
+
private resolveGoalFiles;
|
|
22
|
+
private processGoal;
|
|
23
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type { AnalyzeInput, AnalyzeResult, AnalyzeSuccess, AnalyzeFailure, AnalyzeSpec, } from './spec.js';
|
|
2
|
+
export { AnalyzeInputSchema, AnalyzeErrorCode } from './spec.js';
|
|
3
|
+
export { TRIAGE_GOAL_FILENAME, getBuiltInTriagePrompt } from './triage-prompt.js';
|
|
4
|
+
export { AnalyzeHandler } from './handler.js';
|
|
5
|
+
export { parseGoalFile, parseGoalContent, type GoalFileConfig, type ParsedGoalFile, } from './goals.js';
|
|
6
|
+
export { getMilestoneContext, type MilestoneContext, type MilestoneContextOptions, type MilestoneIssue, type MilestonePullRequest, } from './milestone.js';
|
|
7
|
+
export { toIssueMarkdown, toIssueLean, formatPRContext } from './formatting.js';
|
|
8
|
+
export { buildAnalyzerPrompt, type AnalyzerPromptOptions } from './prompt.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { Octokit } from 'octokit';
|
|
2
|
+
export interface MilestoneContextOptions {
|
|
3
|
+
owner: string;
|
|
4
|
+
repo: string;
|
|
5
|
+
/** Milestone number. When omitted, fetches unmilestoned issues. */
|
|
6
|
+
milestone?: string;
|
|
7
|
+
/** How many days back to include closed issues (default: 14). */
|
|
8
|
+
closedLookbackDays?: number;
|
|
9
|
+
}
|
|
10
|
+
export interface MilestoneIssue {
|
|
11
|
+
number: number;
|
|
12
|
+
title: string;
|
|
13
|
+
state: string;
|
|
14
|
+
labels: string[];
|
|
15
|
+
body: string;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
closedAt?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface MilestonePullRequest {
|
|
20
|
+
number: number;
|
|
21
|
+
title: string;
|
|
22
|
+
head: string;
|
|
23
|
+
base: string;
|
|
24
|
+
body: string;
|
|
25
|
+
}
|
|
26
|
+
export interface MilestoneContext {
|
|
27
|
+
milestone?: {
|
|
28
|
+
number: number;
|
|
29
|
+
title: string;
|
|
30
|
+
};
|
|
31
|
+
issues: {
|
|
32
|
+
open: MilestoneIssue[];
|
|
33
|
+
closed: MilestoneIssue[];
|
|
34
|
+
};
|
|
35
|
+
pullRequests: MilestonePullRequest[];
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Returns structured data about a milestone's current state:
|
|
39
|
+
* open issues, recently closed issues, and open pull requests.
|
|
40
|
+
*
|
|
41
|
+
* Takes Octokit as a parameter for testability.
|
|
42
|
+
*/
|
|
43
|
+
export declare function getMilestoneContext(octokit: Octokit, options: MilestoneContextOptions): Promise<MilestoneContext>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** Options for building the analyzer prompt */
|
|
2
|
+
export interface AnalyzerPromptOptions {
|
|
3
|
+
goalInstructions: string;
|
|
4
|
+
openContext: string;
|
|
5
|
+
closedContext: string;
|
|
6
|
+
prContext?: string;
|
|
7
|
+
milestoneTitle?: string;
|
|
8
|
+
milestoneId?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function buildAnalyzerPrompt(options: AnalyzerPromptOptions): string;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const AnalyzeInputSchema: z.ZodObject<{
|
|
3
|
+
/** Path to a specific goal file */
|
|
4
|
+
goal: z.ZodOptional<z.ZodString>;
|
|
5
|
+
/** Directory to auto-discover goal files from */
|
|
6
|
+
goalsDir: z.ZodDefault<z.ZodString>;
|
|
7
|
+
/** Milestone ID to scope context */
|
|
8
|
+
milestone: z.ZodOptional<z.ZodString>;
|
|
9
|
+
/** Repository owner */
|
|
10
|
+
owner: z.ZodString;
|
|
11
|
+
/** Repository name */
|
|
12
|
+
repo: z.ZodString;
|
|
13
|
+
/** Base branch for Jules sessions */
|
|
14
|
+
baseBranch: z.ZodDefault<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
owner: string;
|
|
17
|
+
repo: string;
|
|
18
|
+
baseBranch: string;
|
|
19
|
+
goalsDir: string;
|
|
20
|
+
milestone?: string | undefined;
|
|
21
|
+
goal?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
owner: string;
|
|
24
|
+
repo: string;
|
|
25
|
+
milestone?: string | undefined;
|
|
26
|
+
baseBranch?: string | undefined;
|
|
27
|
+
goal?: string | undefined;
|
|
28
|
+
goalsDir?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type AnalyzeInput = z.infer<typeof AnalyzeInputSchema>;
|
|
31
|
+
export declare const AnalyzeErrorCode: z.ZodEnum<["GOAL_NOT_FOUND", "NO_GOALS_FOUND", "MILESTONE_FETCH_FAILED", "SESSION_DISPATCH_FAILED", "UNKNOWN_ERROR"]>;
|
|
32
|
+
export type AnalyzeErrorCode = z.infer<typeof AnalyzeErrorCode>;
|
|
33
|
+
export interface AnalyzeSuccess {
|
|
34
|
+
success: true;
|
|
35
|
+
data: {
|
|
36
|
+
sessionsStarted: Array<{
|
|
37
|
+
goal: string;
|
|
38
|
+
sessionId: string;
|
|
39
|
+
}>;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export interface AnalyzeFailure {
|
|
43
|
+
success: false;
|
|
44
|
+
error: {
|
|
45
|
+
code: AnalyzeErrorCode;
|
|
46
|
+
message: string;
|
|
47
|
+
recoverable: boolean;
|
|
48
|
+
suggestion?: string;
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export type AnalyzeResult = AnalyzeSuccess | AnalyzeFailure;
|
|
52
|
+
export interface AnalyzeSpec {
|
|
53
|
+
execute(input: AnalyzeInput): Promise<AnalyzeResult>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in triage goal.
|
|
3
|
+
*
|
|
4
|
+
* When `.fleet/goals/triage.md` doesn't exist, the analyze command
|
|
5
|
+
* auto-injects this prompt to triage all open issues that are not
|
|
6
|
+
* associated with a milestone.
|
|
7
|
+
*
|
|
8
|
+
* Users override this by creating their own `triage.md` in the goals dir.
|
|
9
|
+
*/
|
|
10
|
+
/** The reserved filename. If a user creates this, it overrides the built-in. */
|
|
11
|
+
export declare const TRIAGE_GOAL_FILENAME = "triage.md";
|
|
12
|
+
/**
|
|
13
|
+
* Returns the built-in triage prompt content.
|
|
14
|
+
* This is the goal directive telling the analyzer what to look for.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getBuiltInTriagePrompt(repoFullName: string): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare const _default: import("citty").CommandDef<{
|
|
2
|
+
goal: {
|
|
3
|
+
type: "string";
|
|
4
|
+
description: string;
|
|
5
|
+
};
|
|
6
|
+
'goals-dir': {
|
|
7
|
+
type: "string";
|
|
8
|
+
default: string;
|
|
9
|
+
description: string;
|
|
10
|
+
};
|
|
11
|
+
milestone: {
|
|
12
|
+
type: "string";
|
|
13
|
+
description: string;
|
|
14
|
+
};
|
|
15
|
+
owner: {
|
|
16
|
+
type: "string";
|
|
17
|
+
description: string;
|
|
18
|
+
};
|
|
19
|
+
repo: {
|
|
20
|
+
type: "string";
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
}>;
|
|
24
|
+
export default _default;
|