Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 45 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/fleet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,11 @@
"access": "public"
},
"dependencies": {
"@clack/prompts": "^1.0.1",
"@octokit/auth-app": "^8.2.0",
"citty": "^0.1.6",
"glob": "^13.0.6",
"libsodium-wrappers": "^0.8.2",
"octokit": "^4.1.3",
"yaml": "^2.8.2",
"zod": "^3.25.0"
Expand All @@ -61,6 +63,7 @@
"devDependencies": {
"@google/jules-sdk": "^0.0.6",
"@types/bun": "^1.3.9",
"@types/libsodium-wrappers": "^0.8.2",
"@types/node": "^22.15.0",
"typescript": "^5.8.3",
"vitest": "^3.2.4"
Expand Down
8 changes: 4 additions & 4 deletions packages/fleet/src/__tests__/analyze-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('AnalyzeHandler', () => {
});

it('auto-injects triage goal when no goal files exist', async () => {
const handler = new AnalyzeHandler(octokit, dispatcher, noop);
const handler = new AnalyzeHandler({ octokit, dispatcher });
const result = await handler.execute({
goalsDir: '/nonexistent/dir',
owner: 'o',
Expand All @@ -65,7 +65,7 @@ describe('AnalyzeHandler', () => {
});

it('returns NO_GOALS_FOUND when goal file does not exist', async () => {
const handler = new AnalyzeHandler(octokit, dispatcher, noop);
const handler = new AnalyzeHandler({ octokit, dispatcher });
const result = await handler.execute({
goal: '/nonexistent/goal.md',
goalsDir: '.fleet/goals',
Expand All @@ -90,7 +90,7 @@ describe('AnalyzeHandler', () => {
const goalPath = join(dir, 'test-goal.md');
writeFileSync(goalPath, `---\nmilestone: "1"\n---\n\n# Test Goal\n\nDo something.`);

const handler = new AnalyzeHandler(octokit, dispatcher, noop);
const handler = new AnalyzeHandler({ octokit, dispatcher });
const result = await handler.execute({
goal: goalPath,
goalsDir: '.fleet/goals',
Expand Down Expand Up @@ -124,7 +124,7 @@ describe('AnalyzeHandler', () => {
const goalPath = join(dir, 'test-goal.md');
writeFileSync(goalPath, '# Test\n\nBody.');

const handler = new AnalyzeHandler(octokit, failingDispatcher, noop);
const handler = new AnalyzeHandler({ octokit, dispatcher: failingDispatcher });
const result = await handler.execute({
goal: goalPath,
goalsDir: '.fleet/goals',
Expand Down
12 changes: 6 additions & 6 deletions packages/fleet/src/__tests__/analyze-triage.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe('Triage Goal Auto-Injection', () => {

const octokit = createMockOctokit();
const dispatcher = createMockDispatcher();
const handler = new AnalyzeHandler(octokit, dispatcher, () => {});
const handler = new AnalyzeHandler({ octokit, dispatcher });

const result = await handler.execute({
goalsDir: dir,
Expand Down Expand Up @@ -92,8 +92,8 @@ describe('Triage Goal Auto-Injection', () => {

const octokit = createMockOctokit();
const dispatcher = createMockDispatcher();
const logs: string[] = [];
const handler = new AnalyzeHandler(octokit, dispatcher, (m) => logs.push(m));
const events: Array<{ type: string }> = [];
const handler = new AnalyzeHandler({ octokit, dispatcher, emit: (e) => events.push(e) });

const result = await handler.execute({
goalsDir: dir,
Expand All @@ -103,9 +103,9 @@ describe('Triage Goal Auto-Injection', () => {
});

expect(result.success).toBe(true);
// Should NOT log the "Using built-in triage goal" message
const usedBuiltIn = logs.some((l) => l.includes('built-in triage'));
expect(usedBuiltIn).toBe(false);
// Should NOT be using built-in triage goal when user has their own
const goalStartEvents = events.filter((e) => e.type === 'analyze:goal:start');
expect(goalStartEvents.length).toBe(1);

const { rmSync } = await import('fs');
rmSync(dir, { recursive: true, force: true });
Expand Down
10 changes: 5 additions & 5 deletions packages/fleet/src/__tests__/configure-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ describe('ConfigureHandler (Logic Tests)', () => {
describe('create labels', () => {
it('creates both fleet labels', async () => {
const octokit = createMockOctokit();
const handler = new ConfigureHandler(octokit, () => {});
const handler = new ConfigureHandler({ octokit });
const result = await handler.execute({
resource: 'labels',
action: 'create',
Expand All @@ -57,7 +57,7 @@ describe('ConfigureHandler (Logic Tests)', () => {
},
});

const handler = new ConfigureHandler(octokit, () => {});
const handler = new ConfigureHandler({ octokit });
const result = await handler.execute({
resource: 'labels',
action: 'create',
Expand All @@ -83,7 +83,7 @@ describe('ConfigureHandler (Logic Tests)', () => {
},
});

const handler = new ConfigureHandler(octokit, () => {});
const handler = new ConfigureHandler({ octokit });
const result = await handler.execute({
resource: 'labels',
action: 'create',
Expand All @@ -101,7 +101,7 @@ describe('ConfigureHandler (Logic Tests)', () => {
describe('delete labels', () => {
it('deletes both fleet labels', async () => {
const octokit = createMockOctokit();
const handler = new ConfigureHandler(octokit, () => {});
const handler = new ConfigureHandler({ octokit });
const result = await handler.execute({
resource: 'labels',
action: 'delete',
Expand All @@ -126,7 +126,7 @@ describe('ConfigureHandler (Logic Tests)', () => {
},
});

const handler = new ConfigureHandler(octokit, () => {});
const handler = new ConfigureHandler({ octokit });
const result = await handler.execute({
resource: 'labels',
action: 'delete',
Expand Down
8 changes: 4 additions & 4 deletions packages/fleet/src/__tests__/dispatch-handler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe('DispatchHandler', () => {
it('returns empty result when no fleet issues', async () => {
const octokit = createMockOctokit({ openIssues: [] });
const dispatcher = createMockDispatcher();
const handler = new DispatchHandler(octokit, dispatcher, noop);
const handler = new DispatchHandler({ octokit, dispatcher });

const result = await handler.execute({
milestone: '1',
Expand Down Expand Up @@ -95,7 +95,7 @@ describe('DispatchHandler', () => {
],
});
const dispatcher = createMockDispatcher();
const handler = new DispatchHandler(octokit, dispatcher, noop);
const handler = new DispatchHandler({ octokit, dispatcher });

const result = await handler.execute({
milestone: '1',
Expand Down Expand Up @@ -134,7 +134,7 @@ describe('DispatchHandler', () => {
],
});
const dispatcher = createMockDispatcher();
const handler = new DispatchHandler(octokit, dispatcher, noop);
const handler = new DispatchHandler({ octokit, dispatcher });

const result = await handler.execute({
milestone: '1',
Expand Down Expand Up @@ -179,7 +179,7 @@ describe('DispatchHandler', () => {
.mockResolvedValueOnce({ id: 'session-ok' }),
};

const handler = new DispatchHandler(octokit, dispatcher, noop);
const handler = new DispatchHandler({ octokit, dispatcher });
const result = await handler.execute({
milestone: '1',
owner: 'o',
Expand Down
Loading
Loading