Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit b4a5f0a

Browse files
committed
refactor: correct context module
1 parent 147a869 commit b4a5f0a

25 files changed

+47
-34
lines changed

cortex-js/src/app.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import { AppLoggerMiddleware } from './infrastructure/middlewares/app.logger.mid
1515
import { TelemetryModule } from './usecases/telemetry/telemetry.module';
1616
import { APP_FILTER } from '@nestjs/core';
1717
import { GlobalExceptionFilter } from './infrastructure/exception/global.exception';
18-
import { UtilModule } from './util/util.module';
1918
import { EventEmitterModule } from '@nestjs/event-emitter';
2019
import { EventsController } from './infrastructure/controllers/events.controller';
2120
import { AssistantsController } from './infrastructure/controllers/assistants.controller';
@@ -26,6 +25,7 @@ import { ThreadsController } from './infrastructure/controllers/threads.controll
2625
import { StatusController } from './infrastructure/controllers/status.controller';
2726
import { ProcessController } from './infrastructure/controllers/process.controller';
2827
import { DownloadManagerModule } from './infrastructure/services/download-manager/download-manager.module';
28+
import { ContextModule } from './infrastructure/services/context/context.module';
2929

3030
@Module({
3131
imports: [
@@ -48,7 +48,7 @@ import { DownloadManagerModule } from './infrastructure/services/download-manage
4848
ExtensionModule,
4949
FileManagerModule,
5050
TelemetryModule,
51-
UtilModule,
51+
ContextModule,
5252
DownloadManagerModule,
5353
],
5454
controllers: [

cortex-js/src/command.module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ import { KillCommand } from './infrastructure/commanders/kill.command';
2828
import { PresetCommand } from './infrastructure/commanders/presets.command';
2929
import { TelemetryModule } from './usecases/telemetry/telemetry.module';
3030
import { TelemetryCommand } from './infrastructure/commanders/telemetry.command';
31-
import { UtilModule } from './util/util.module';
3231
import { EmbeddingCommand } from './infrastructure/commanders/embeddings.command';
3332
import { BenchmarkCommand } from './infrastructure/commanders/benchmark.command';
3433
import { EventEmitterModule } from '@nestjs/event-emitter';
3534
import { DownloadManagerModule } from './infrastructure/services/download-manager/download-manager.module';
3635
import { ServeStopCommand } from './infrastructure/commanders/sub-commands/serve-stop.command';
36+
import { ContextModule } from './infrastructure/services/context/context.module';
3737

3838
@Module({
3939
imports: [
@@ -53,7 +53,7 @@ import { ServeStopCommand } from './infrastructure/commanders/sub-commands/serve
5353
MessagesModule,
5454
FileManagerModule,
5555
TelemetryModule,
56-
UtilModule,
56+
ContextModule,
5757
DownloadManagerModule,
5858
],
5959
providers: [

cortex-js/src/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { CommandModule } from './command.module';
44
import { TelemetryUsecases } from './usecases/telemetry/telemetry.usecases';
55
import { TelemetrySource } from './domain/telemetry/telemetry.interface';
66
import { AsyncLocalStorage } from 'async_hooks';
7-
import { ContextService } from './util/context.service';
7+
import { ContextService } from '@/infrastructure/services/context/context.service';
88

99
export const asyncLocalStorage = new AsyncLocalStorage();
1010

cortex-js/src/infrastructure/commanders/chat.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { exit } from 'node:process';
99
import { PSCliUsecases } from './usecases/ps.cli.usecases';
1010
import { ModelsUsecases } from '@/usecases/models/models.usecases';
1111
import { SetCommandContext } from './decorators/CommandContext';
12-
import { ContextService } from '@/util/context.service';
1312
import { ModelStat } from './types/model-stat.interface';
13+
import { ContextService } from '../services/context/context.service';
1414

1515
type ChatOptions = {
1616
threadId?: string;

cortex-js/src/infrastructure/commanders/cortex-command.commander.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import pkg from '@/../package.json';
1111
import { PresetCommand } from './presets.command';
1212
import { TelemetryCommand } from './telemetry.command';
1313
import { SetCommandContext } from './decorators/CommandContext';
14-
import { ContextService } from '@/util/context.service';
1514
import { EmbeddingCommand } from './embeddings.command';
1615
import { BenchmarkCommand } from './benchmark.command';
1716
import chalk from 'chalk';
1817
import { printSlogan } from '@/utils/logo';
18+
import { ContextService } from '../services/context/context.service';
1919

2020
@RootCommand({
2121
subCommands: [

cortex-js/src/infrastructure/commanders/kill.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
22
import { CortexUsecases } from '@/usecases/cortex/cortex.usecases';
33
import { SetCommandContext } from './decorators/CommandContext';
4-
import { ContextService } from '@/util/context.service';
4+
import { ContextService } from '../services/context/context.service';
55

66
@SubCommand({
77
name: 'kill',

cortex-js/src/infrastructure/commanders/models/model-get.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
22
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
33
import { exit } from 'node:process';
4-
import { ContextService } from '@/util/context.service';
54
import { SetCommandContext } from '../decorators/CommandContext';
5+
import { ContextService } from '@/infrastructure/services/context/context.service';
66

77
@SubCommand({
88
name: 'get',

cortex-js/src/infrastructure/commanders/models/model-list.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { CommandRunner, SubCommand, Option } from 'nest-commander';
22
import { ModelsCliUsecases } from '../usecases/models.cli.usecases';
33
import { SetCommandContext } from '../decorators/CommandContext';
4-
import { ContextService } from '@/util/context.service';
4+
import { ContextService } from '@/infrastructure/services/context/context.service';
55

66
interface ModelListOptions {
77
format: 'table' | 'json';

cortex-js/src/infrastructure/commanders/models/model-pull.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
22
import { exit } from 'node:process';
33
import { SetCommandContext } from '../decorators/CommandContext';
4-
import { ContextService } from '@/util/context.service';
54
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
65
import { ModelNotFoundException } from '@/infrastructure/exception/model-not-found.exception';
6+
import { ContextService } from '@/infrastructure/services/context/context.service';
77

88
@SubCommand({
99
name: 'pull',

cortex-js/src/infrastructure/commanders/models/model-remove.command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { CommandRunner, SubCommand } from 'nest-commander';
22
import { ModelsCliUsecases } from '@commanders/usecases/models.cli.usecases';
33
import { exit } from 'node:process';
4-
import { ContextService } from '@/util/context.service';
54
import { SetCommandContext } from '../decorators/CommandContext';
5+
import { ContextService } from '@/infrastructure/services/context/context.service';
66

77
@SubCommand({
88
name: 'remove',

0 commit comments

Comments
 (0)