Skip to content

Commit f68596c

Browse files
committed
refactor(ai): move AIService into askAi package
AIService held all of Ask AI's orchestration (event lookup, prompt assembly, model call) but lived outside the askAi/ directory that already held its supporting modules (instructions, inputs, security). Anything reusing this orchestration had to reach one level up and out of the package it conceptually belongs to. Move it in as askAi/service.ts, with an index.ts barrel for external consumers (resolvers/event.js). Internal siblings still import it directly, matching the existing github/sso package shape.
1 parent ed0cbb6 commit f68596c

4 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/resolvers/event.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const {
33
parseBulkEventIds,
44
enqueueAssigneeNotification,
55
} = require('./helpers/bulkEventUtils');
6-
const { aiService } = require('../services/ai');
6+
const { aiService } = require('../services/askAi');
77
const { UserInputError } = require('apollo-server-express');
88
const { ObjectId } = require('mongodb');
99

src/services/askAi/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { AIService, aiService } from './service';
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { vercelAIApi } from '../integrations/vercel-ai/';
2-
import { eventSolvingInput } from './askAi/inputs/eventSolving';
3-
import { ctoInstruction } from './askAi/instructions/cto';
4-
import { EventsFactoryInterface } from './types';
1+
import { vercelAIApi } from '../../integrations/vercel-ai/';
2+
import { eventSolvingInput } from './inputs/eventSolving';
3+
import { ctoInstruction } from './instructions/cto';
4+
import { EventsFactoryInterface } from '../types';
55

66
/**
77
* Service for interacting with AI

test/services/askAi.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import '../../src/env-test';
22
import { EventAddons, EventData } from '@hawk.so/types';
3-
import { AIService } from '../../src/services/ai';
3+
import { AIService } from '../../src/services/askAi/service';
44
import { vercelAIApi } from '../../src/integrations/vercel-ai/';
55
import { ctoInstruction } from '../../src/services/askAi/instructions/cto';
66
import { eventSolvingInput } from '../../src/services/askAi/inputs/eventSolving';

0 commit comments

Comments
 (0)