@devflow-tools/server 0.1.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/dist/app.module.d.ts +3 -0
- package/dist/app.module.d.ts.map +1 -0
- package/dist/app.module.js +37 -0
- package/dist/app.module.js.map +1 -0
- package/dist/auth/api-key.decorator.d.ts +3 -0
- package/dist/auth/api-key.decorator.d.ts.map +1 -0
- package/dist/auth/api-key.decorator.js +4 -0
- package/dist/auth/api-key.decorator.js.map +1 -0
- package/dist/auth/api-key.guard.d.ts +8 -0
- package/dist/auth/api-key.guard.d.ts.map +1 -0
- package/dist/auth/api-key.guard.js +61 -0
- package/dist/auth/api-key.guard.js.map +1 -0
- package/dist/auth/auth.module.d.ts +3 -0
- package/dist/auth/auth.module.d.ts.map +1 -0
- package/dist/auth/auth.module.js +19 -0
- package/dist/auth/auth.module.js.map +1 -0
- package/dist/auth/errors.d.ts +6 -0
- package/dist/auth/errors.d.ts.map +1 -0
- package/dist/auth/errors.js +5 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/benchmark/benchmark.controller.d.ts +11 -0
- package/dist/benchmark/benchmark.controller.d.ts.map +1 -0
- package/dist/benchmark/benchmark.controller.js +55 -0
- package/dist/benchmark/benchmark.controller.js.map +1 -0
- package/dist/benchmark/benchmark.module.d.ts +3 -0
- package/dist/benchmark/benchmark.module.d.ts.map +1 -0
- package/dist/benchmark/benchmark.module.js +16 -0
- package/dist/benchmark/benchmark.module.js.map +1 -0
- package/dist/benchmark/benchmark.service.d.ts +8 -0
- package/dist/benchmark/benchmark.service.d.ts.map +1 -0
- package/dist/benchmark/benchmark.service.js +38 -0
- package/dist/benchmark/benchmark.service.js.map +1 -0
- package/dist/common/dto.d.ts +11 -0
- package/dist/common/dto.d.ts.map +1 -0
- package/dist/common/dto.js +2 -0
- package/dist/common/dto.js.map +1 -0
- package/dist/common/error-codes.d.ts +16 -0
- package/dist/common/error-codes.d.ts.map +1 -0
- package/dist/common/error-codes.js +15 -0
- package/dist/common/error-codes.js.map +1 -0
- package/dist/common/http-exception.filter.d.ts +6 -0
- package/dist/common/http-exception.filter.d.ts.map +1 -0
- package/dist/common/http-exception.filter.js +51 -0
- package/dist/common/http-exception.filter.js.map +1 -0
- package/dist/context/context.controller.d.ts +17 -0
- package/dist/context/context.controller.d.ts.map +1 -0
- package/dist/context/context.controller.js +56 -0
- package/dist/context/context.controller.js.map +1 -0
- package/dist/context/context.module.d.ts +3 -0
- package/dist/context/context.module.d.ts.map +1 -0
- package/dist/context/context.module.js +16 -0
- package/dist/context/context.module.js.map +1 -0
- package/dist/context/context.service.d.ts +13 -0
- package/dist/context/context.service.d.ts.map +1 -0
- package/dist/context/context.service.js +50 -0
- package/dist/context/context.service.js.map +1 -0
- package/dist/graph/graph.controller.d.ts +15 -0
- package/dist/graph/graph.controller.d.ts.map +1 -0
- package/dist/graph/graph.controller.js +54 -0
- package/dist/graph/graph.controller.js.map +1 -0
- package/dist/graph/graph.module.d.ts +3 -0
- package/dist/graph/graph.module.d.ts.map +1 -0
- package/dist/graph/graph.module.js +17 -0
- package/dist/graph/graph.module.js.map +1 -0
- package/dist/graph/graph.service.d.ts +12 -0
- package/dist/graph/graph.service.d.ts.map +1 -0
- package/dist/graph/graph.service.js +37 -0
- package/dist/graph/graph.service.js.map +1 -0
- package/dist/knowledge/knowledge.controller.d.ts +13 -0
- package/dist/knowledge/knowledge.controller.d.ts.map +1 -0
- package/dist/knowledge/knowledge.controller.js +48 -0
- package/dist/knowledge/knowledge.controller.js.map +1 -0
- package/dist/knowledge/knowledge.module.d.ts +3 -0
- package/dist/knowledge/knowledge.module.d.ts.map +1 -0
- package/dist/knowledge/knowledge.module.js +17 -0
- package/dist/knowledge/knowledge.module.js.map +1 -0
- package/dist/knowledge/knowledge.service.d.ts +8 -0
- package/dist/knowledge/knowledge.service.d.ts.map +1 -0
- package/dist/knowledge/knowledge.service.js +33 -0
- package/dist/knowledge/knowledge.service.js.map +1 -0
- package/dist/main.d.ts +4 -0
- package/dist/main.d.ts.map +1 -0
- package/dist/main.js +18 -0
- package/dist/main.js.map +1 -0
- package/dist/memory/memory.controller.d.ts +19 -0
- package/dist/memory/memory.controller.d.ts.map +1 -0
- package/dist/memory/memory.controller.js +74 -0
- package/dist/memory/memory.controller.js.map +1 -0
- package/dist/memory/memory.module.d.ts +3 -0
- package/dist/memory/memory.module.d.ts.map +1 -0
- package/dist/memory/memory.module.js +17 -0
- package/dist/memory/memory.module.js.map +1 -0
- package/dist/memory/memory.service.d.ts +22 -0
- package/dist/memory/memory.service.d.ts.map +1 -0
- package/dist/memory/memory.service.js +51 -0
- package/dist/memory/memory.service.js.map +1 -0
- package/dist/projects/projects.controller.d.ts +14 -0
- package/dist/projects/projects.controller.d.ts.map +1 -0
- package/dist/projects/projects.controller.js +57 -0
- package/dist/projects/projects.controller.js.map +1 -0
- package/dist/projects/projects.module.d.ts +3 -0
- package/dist/projects/projects.module.d.ts.map +1 -0
- package/dist/projects/projects.module.js +16 -0
- package/dist/projects/projects.module.js.map +1 -0
- package/dist/projects/projects.service.d.ts +19 -0
- package/dist/projects/projects.service.d.ts.map +1 -0
- package/dist/projects/projects.service.js +38 -0
- package/dist/projects/projects.service.js.map +1 -0
- package/dist/registry/registry.controller.d.ts +14 -0
- package/dist/registry/registry.controller.d.ts.map +1 -0
- package/dist/registry/registry.controller.js +57 -0
- package/dist/registry/registry.controller.js.map +1 -0
- package/dist/registry/registry.module.d.ts +3 -0
- package/dist/registry/registry.module.d.ts.map +1 -0
- package/dist/registry/registry.module.js +16 -0
- package/dist/registry/registry.module.js.map +1 -0
- package/dist/registry/registry.service.d.ts +20 -0
- package/dist/registry/registry.service.d.ts.map +1 -0
- package/dist/registry/registry.service.js +48 -0
- package/dist/registry/registry.service.js.map +1 -0
- package/dist/telemetry/telemetry.controller.d.ts +16 -0
- package/dist/telemetry/telemetry.controller.d.ts.map +1 -0
- package/dist/telemetry/telemetry.controller.js +56 -0
- package/dist/telemetry/telemetry.controller.js.map +1 -0
- package/dist/telemetry/telemetry.module.d.ts +3 -0
- package/dist/telemetry/telemetry.module.d.ts.map +1 -0
- package/dist/telemetry/telemetry.module.js +16 -0
- package/dist/telemetry/telemetry.module.js.map +1 -0
- package/dist/telemetry/telemetry.service.d.ts +15 -0
- package/dist/telemetry/telemetry.service.d.ts.map +1 -0
- package/dist/telemetry/telemetry.service.js +47 -0
- package/dist/telemetry/telemetry.service.js.map +1 -0
- package/dist/workflow/workflow.controller.d.ts +38 -0
- package/dist/workflow/workflow.controller.d.ts.map +1 -0
- package/dist/workflow/workflow.controller.js +101 -0
- package/dist/workflow/workflow.controller.js.map +1 -0
- package/dist/workflow/workflow.module.d.ts +3 -0
- package/dist/workflow/workflow.module.d.ts.map +1 -0
- package/dist/workflow/workflow.module.js +16 -0
- package/dist/workflow/workflow.module.js.map +1 -0
- package/dist/workflow/workflow.service.d.ts +40 -0
- package/dist/workflow/workflow.service.d.ts.map +1 -0
- package/dist/workflow/workflow.service.js +78 -0
- package/dist/workflow/workflow.service.js.map +1 -0
- package/package.json +41 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.d.ts","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":"AAYA,qBAca,SAAS;CAAG"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import { AuthModule } from "./auth/auth.module.js";
|
|
9
|
+
import { ProjectsModule } from "./projects/projects.module.js";
|
|
10
|
+
import { ContextModule } from "./context/context.module.js";
|
|
11
|
+
import { GraphModule } from "./graph/graph.module.js";
|
|
12
|
+
import { WorkflowModule } from "./workflow/workflow.module.js";
|
|
13
|
+
import { MemoryModule } from "./memory/memory.module.js";
|
|
14
|
+
import { KnowledgeModule } from "./knowledge/knowledge.module.js";
|
|
15
|
+
import { TelemetryModule } from "./telemetry/telemetry.module.js";
|
|
16
|
+
import { BenchmarkModule } from "./benchmark/benchmark.module.js";
|
|
17
|
+
import { RegistryModule } from "./registry/registry.module.js";
|
|
18
|
+
let AppModule = class AppModule {
|
|
19
|
+
};
|
|
20
|
+
AppModule = __decorate([
|
|
21
|
+
Module({
|
|
22
|
+
imports: [
|
|
23
|
+
AuthModule,
|
|
24
|
+
ProjectsModule,
|
|
25
|
+
ContextModule,
|
|
26
|
+
GraphModule,
|
|
27
|
+
WorkflowModule,
|
|
28
|
+
MemoryModule,
|
|
29
|
+
KnowledgeModule,
|
|
30
|
+
TelemetryModule,
|
|
31
|
+
BenchmarkModule,
|
|
32
|
+
RegistryModule,
|
|
33
|
+
],
|
|
34
|
+
})
|
|
35
|
+
], AppModule);
|
|
36
|
+
export { AppModule };
|
|
37
|
+
//# sourceMappingURL=app.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app.module.js","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC5D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAgBxD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IAdrB,MAAM,CAAC;QACN,OAAO,EAAE;YACP,UAAU;YACV,cAAc;YACd,aAAa;YACb,WAAW;YACX,cAAc;YACd,YAAY;YACZ,eAAe;YACf,eAAe;YACf,eAAe;YACf,cAAc;SACf;KACF,CAAC;GACW,SAAS,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key.decorator.d.ts","sourceRoot":"","sources":["../../src/auth/api-key.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,aAAa,CAAC;AACxC,eAAO,MAAM,MAAM,wDAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key.decorator.js","sourceRoot":"","sources":["../../src/auth/api-key.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;AACxC,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,EAAE,CAAC,WAAW,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CanActivate, ExecutionContext } from "@nestjs/common";
|
|
2
|
+
import { Reflector } from "@nestjs/core";
|
|
3
|
+
export declare class ApiKeyGuard implements CanActivate {
|
|
4
|
+
private reflector;
|
|
5
|
+
constructor(reflector: Reflector);
|
|
6
|
+
canActivate(context: ExecutionContext): boolean;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=api-key.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key.guard.d.ts","sourceRoot":"","sources":["../../src/auth/api-key.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EACX,gBAAgB,EAGjB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAWzC,qBACa,WAAY,YAAW,WAAW;IACd,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,SAAS;IAE3D,WAAW,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO;CAgChD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Injectable, UnauthorizedException, Inject, } from "@nestjs/common";
|
|
14
|
+
import { Reflector } from "@nestjs/core";
|
|
15
|
+
import { IS_PUBLIC_KEY } from "./api-key.decorator.js";
|
|
16
|
+
import { AuthErrorCode } from "./errors.js";
|
|
17
|
+
const VALID_API_KEYS = (process.env.DEVFLOW_API_KEYS ?? "dev-key-000000")
|
|
18
|
+
.split(",")
|
|
19
|
+
.map((k) => k.trim())
|
|
20
|
+
.filter(Boolean);
|
|
21
|
+
let ApiKeyGuard = class ApiKeyGuard {
|
|
22
|
+
constructor(reflector) {
|
|
23
|
+
this.reflector = reflector;
|
|
24
|
+
}
|
|
25
|
+
canActivate(context) {
|
|
26
|
+
const isPublic = this.reflector.getAllAndOverride(IS_PUBLIC_KEY, [
|
|
27
|
+
context.getHandler(),
|
|
28
|
+
context.getClass(),
|
|
29
|
+
]);
|
|
30
|
+
if (isPublic)
|
|
31
|
+
return true;
|
|
32
|
+
const request = context.switchToHttp().getRequest();
|
|
33
|
+
const apiKey = request.headers["x-api-key"];
|
|
34
|
+
if (!apiKey) {
|
|
35
|
+
throw new UnauthorizedException({
|
|
36
|
+
error: {
|
|
37
|
+
code: AuthErrorCode.MISSING_API_KEY,
|
|
38
|
+
message: "X-API-Key header is required",
|
|
39
|
+
details: {},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (!VALID_API_KEYS.includes(apiKey)) {
|
|
44
|
+
throw new UnauthorizedException({
|
|
45
|
+
error: {
|
|
46
|
+
code: AuthErrorCode.INVALID_API_KEY,
|
|
47
|
+
message: "Invalid API key",
|
|
48
|
+
details: {},
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return true;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
ApiKeyGuard = __decorate([
|
|
56
|
+
Injectable(),
|
|
57
|
+
__param(0, Inject(Reflector)),
|
|
58
|
+
__metadata("design:paramtypes", [Reflector])
|
|
59
|
+
], ApiKeyGuard);
|
|
60
|
+
export { ApiKeyGuard };
|
|
61
|
+
//# sourceMappingURL=api-key.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key.guard.js","sourceRoot":"","sources":["../../src/auth/api-key.guard.ts"],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AAI,qBAAqB,CAAC;gBAC9B,KAAK,EAAE;oBACL,IAAI,EAAE,aAAa,CAAC,eAAe;oBACnC,OAAO,EAAE,iBAAiB;oBAC1B,OAAO,EAAE,EAAE;iBACZ;aACF,CAAC,CAAC;QACL,CAAC;QAED,OAAO,IAAI,CAAC;IACd,CAAC;CACF,CAAA;AAnCY,WAAW;IADvB,UAAU,EAAE;IAEE,WAAA,MAAM,CAAC,SAAS,CAAC,CAAA;qCAAoB,SAAS;GADhD,WAAW,CAmCvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.module.d.ts","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":"AAIA,qBAIa,UAAU;CAAG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module, Global } from "@nestjs/common";
|
|
8
|
+
import { APP_GUARD } from "@nestjs/core";
|
|
9
|
+
import { ApiKeyGuard } from "./api-key.guard.js";
|
|
10
|
+
let AuthModule = class AuthModule {
|
|
11
|
+
};
|
|
12
|
+
AuthModule = __decorate([
|
|
13
|
+
Global(),
|
|
14
|
+
Module({
|
|
15
|
+
providers: [ApiKeyGuard, { provide: APP_GUARD, useClass: ApiKeyGuard }],
|
|
16
|
+
})
|
|
17
|
+
], AuthModule);
|
|
18
|
+
export { AuthModule };
|
|
19
|
+
//# sourceMappingURL=auth.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.module.js","sourceRoot":"","sources":["../../src/auth/auth.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAM1C,IAAM,UAAU,GAAhB,MAAM,UAAU;CAAG,CAAA;AAAb,UAAU;IAJtB,MAAM,EAAE;IACR,MAAM,CAAC;QACN,SAAS,EAAE,CAAC,WAAW,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,CAAC;KACxE,CAAC;GACW,UAAU,CAAG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/auth/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;CAGhB,CAAC;AAEX,MAAM,MAAM,aAAa,GACvB,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/auth/errors.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,eAAe,EAAE,sBAAsB;IACvC,eAAe,EAAE,sBAAsB;CAC/B,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BenchmarkService } from "./benchmark.service.js";
|
|
2
|
+
export declare class BenchmarkController {
|
|
3
|
+
private readonly service;
|
|
4
|
+
constructor(service: BenchmarkService);
|
|
5
|
+
run(body: {
|
|
6
|
+
taskIds?: string[];
|
|
7
|
+
}): Promise<import("@devflow-tools/sdk").BenchmarkReport>;
|
|
8
|
+
listReports(): Promise<import("@devflow-tools/sdk").ReportMeta[]>;
|
|
9
|
+
getReport(id: string): Promise<import("@devflow-tools/sdk").BenchmarkReport>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=benchmark.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.controller.d.ts","sourceRoot":"","sources":["../../src/benchmark/benchmark.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE1D,qBACa,mBAAmB;IACQ,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,gBAAgB;IAG1E,GAAG,CAAS,IAAI,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE;IAKxC,WAAW;IAKX,SAAS,CAAc,EAAE,EAAE,MAAM;CAGxC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Controller, Get, Post, Param, Body, Inject } from "@nestjs/common";
|
|
14
|
+
import { BenchmarkService } from "./benchmark.service.js";
|
|
15
|
+
let BenchmarkController = class BenchmarkController {
|
|
16
|
+
constructor(service) {
|
|
17
|
+
this.service = service;
|
|
18
|
+
}
|
|
19
|
+
async run(body) {
|
|
20
|
+
return this.service.run(body.taskIds);
|
|
21
|
+
}
|
|
22
|
+
async listReports() {
|
|
23
|
+
return this.service.listReports();
|
|
24
|
+
}
|
|
25
|
+
async getReport(id) {
|
|
26
|
+
return this.service.getReport(id);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
Post("run"),
|
|
31
|
+
__param(0, Body()),
|
|
32
|
+
__metadata("design:type", Function),
|
|
33
|
+
__metadata("design:paramtypes", [Object]),
|
|
34
|
+
__metadata("design:returntype", Promise)
|
|
35
|
+
], BenchmarkController.prototype, "run", null);
|
|
36
|
+
__decorate([
|
|
37
|
+
Get("reports"),
|
|
38
|
+
__metadata("design:type", Function),
|
|
39
|
+
__metadata("design:paramtypes", []),
|
|
40
|
+
__metadata("design:returntype", Promise)
|
|
41
|
+
], BenchmarkController.prototype, "listReports", null);
|
|
42
|
+
__decorate([
|
|
43
|
+
Get("reports/:id"),
|
|
44
|
+
__param(0, Param("id")),
|
|
45
|
+
__metadata("design:type", Function),
|
|
46
|
+
__metadata("design:paramtypes", [String]),
|
|
47
|
+
__metadata("design:returntype", Promise)
|
|
48
|
+
], BenchmarkController.prototype, "getReport", null);
|
|
49
|
+
BenchmarkController = __decorate([
|
|
50
|
+
Controller("benchmark"),
|
|
51
|
+
__param(0, Inject(BenchmarkService)),
|
|
52
|
+
__metadata("design:paramtypes", [BenchmarkService])
|
|
53
|
+
], BenchmarkController);
|
|
54
|
+
export { BenchmarkController };
|
|
55
|
+
//# sourceMappingURL=benchmark.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.controller.js","sourceRoot":"","sources":["../../src/benchmark/benchmark.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAGnD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAAuD,OAAyB;QAAzB,YAAO,GAAP,OAAO,CAAkB;IAAG,CAAC;IAG9E,AAAN,KAAK,CAAC,GAAG,CAAS,IAA4B;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW;QACf,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC;IACpC,CAAC;IAGK,AAAN,KAAK,CAAC,SAAS,CAAc,EAAU;QACrC,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACpC,CAAC;CACF,CAAA;AAbO;IADL,IAAI,CAAC,KAAK,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;;;;8CAEhB;AAGK;IADL,GAAG,CAAC,SAAS,CAAC;;;;sDAGd;AAGK;IADL,GAAG,CAAC,aAAa,CAAC;IACF,WAAA,KAAK,CAAC,IAAI,CAAC,CAAA;;;;oDAE3B;AAhBU,mBAAmB;IAD/B,UAAU,CAAC,WAAW,CAAC;IAET,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;qCAA2B,gBAAgB;GADrE,mBAAmB,CAiB/B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.module.d.ts","sourceRoot":"","sources":["../../src/benchmark/benchmark.module.ts"],"names":[],"mappings":"AAIA,qBACa,eAAe;CAAG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import { BenchmarkService } from "./benchmark.service.js";
|
|
9
|
+
import { BenchmarkController } from "./benchmark.controller.js";
|
|
10
|
+
let BenchmarkModule = class BenchmarkModule {
|
|
11
|
+
};
|
|
12
|
+
BenchmarkModule = __decorate([
|
|
13
|
+
Module({ controllers: [BenchmarkController], providers: [BenchmarkService], exports: [BenchmarkService] })
|
|
14
|
+
], BenchmarkModule);
|
|
15
|
+
export { BenchmarkModule };
|
|
16
|
+
//# sourceMappingURL=benchmark.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.module.js","sourceRoot":"","sources":["../../src/benchmark/benchmark.module.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGzD,IAAM,eAAe,GAArB,MAAM,eAAe;CAAG,CAAA;AAAlB,eAAe;IAD3B,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC,mBAAmB,CAAC,EAAE,SAAS,EAAE,CAAC,gBAAgB,CAAC,EAAE,OAAO,EAAE,CAAC,gBAAgB,CAAC,EAAE,CAAC;GAC9F,eAAe,CAAG"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { BenchmarkEngine } from "@devflow-tools/benchmark";
|
|
2
|
+
export declare class BenchmarkService {
|
|
3
|
+
engine: BenchmarkEngine;
|
|
4
|
+
run(taskIds?: string[]): Promise<import("@devflow-tools/sdk").BenchmarkReport>;
|
|
5
|
+
listReports(): Promise<import("@devflow-tools/sdk").ReportMeta[]>;
|
|
6
|
+
getReport(id: string): Promise<import("@devflow-tools/sdk").BenchmarkReport>;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=benchmark.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.service.d.ts","sourceRoot":"","sources":["../../src/benchmark/benchmark.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAG3D,qBACa,gBAAgB;IAC3B,MAAM,kBAAyB;IAEzB,GAAG,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE;IAWtB,WAAW;IAIX,SAAS,CAAC,EAAE,EAAE,MAAM;CAK3B"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable, NotFoundException } from "@nestjs/common";
|
|
8
|
+
import { BenchmarkEngine } from "@devflow-tools/benchmark";
|
|
9
|
+
import { ErrorCode } from "../common/error-codes.js";
|
|
10
|
+
let BenchmarkService = class BenchmarkService {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.engine = new BenchmarkEngine();
|
|
13
|
+
}
|
|
14
|
+
async run(taskIds) {
|
|
15
|
+
const runner = async (task) => ({
|
|
16
|
+
taskId: task.id,
|
|
17
|
+
baseline: { tokens: 100, time: 10, correct: false },
|
|
18
|
+
experiment: { tokens: 70, time: 7, correct: true },
|
|
19
|
+
delta: { tokenReduction: 0.3, timeSaved: 0.25, accuracy: 0.15 },
|
|
20
|
+
status: "pass",
|
|
21
|
+
});
|
|
22
|
+
return this.engine.runAll(runner, { taskIds });
|
|
23
|
+
}
|
|
24
|
+
async listReports() {
|
|
25
|
+
return this.engine.listReports();
|
|
26
|
+
}
|
|
27
|
+
async getReport(id) {
|
|
28
|
+
const report = await this.engine.getReport(id);
|
|
29
|
+
if (!report)
|
|
30
|
+
throw new NotFoundException({ error: { code: ErrorCode.REPORT_NOT_FOUND, message: `Report "${id}" not found`, details: {} } });
|
|
31
|
+
return report;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
BenchmarkService = __decorate([
|
|
35
|
+
Injectable()
|
|
36
|
+
], BenchmarkService);
|
|
37
|
+
export { BenchmarkService };
|
|
38
|
+
//# sourceMappingURL=benchmark.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"benchmark.service.js","sourceRoot":"","sources":["../../src/benchmark/benchmark.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAG9C,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAAtB;QACL,WAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IAsBjC,CAAC;IApBC,KAAK,CAAC,GAAG,CAAC,OAAkB;QAC1B,MAAM,MAAM,GAAG,KAAK,EAAE,IAAS,EAAE,EAAE,CAAC,CAAC;YACnC,MAAM,EAAE,IAAI,CAAC,EAAE;YACf,QAAQ,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,OAAO,EAAE,K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 @@
|
|
|
1
|
+
{"version":3,"file":"dto.js","sourceRoot":"","sources":["../../src/common/dto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const ErrorCode: {
|
|
2
|
+
readonly CONTEXT_INDEX_INCOMPLETE: "CONTEXT_INDEX_INCOMPLETE";
|
|
3
|
+
readonly WORKFLOW_NOT_FOUND: "WORKFLOW_NOT_FOUND";
|
|
4
|
+
readonly RUN_NOT_FOUND: "RUN_NOT_FOUND";
|
|
5
|
+
readonly MEMORY_KEY_NOT_FOUND: "MEMORY_KEY_NOT_FOUND";
|
|
6
|
+
readonly PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND";
|
|
7
|
+
readonly NODE_NOT_FOUND: "NODE_NOT_FOUND";
|
|
8
|
+
readonly TASK_NOT_FOUND: "TASK_NOT_FOUND";
|
|
9
|
+
readonly REPORT_NOT_FOUND: "REPORT_NOT_FOUND";
|
|
10
|
+
readonly PLUGIN_NOT_FOUND: "PLUGIN_NOT_FOUND";
|
|
11
|
+
readonly KNOWLEDGE_SYNC_FAILED: "KNOWLEDGE_SYNC_FAILED";
|
|
12
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
13
|
+
readonly INTERNAL_ERROR: "INTERNAL_ERROR";
|
|
14
|
+
};
|
|
15
|
+
export type ErrorCode = (typeof ErrorCode)[keyof typeof ErrorCode];
|
|
16
|
+
//# sourceMappingURL=error-codes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.d.ts","sourceRoot":"","sources":["../../src/common/error-codes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;;;;;;;CAaZ,CAAC;AAEX,MAAM,MAAM,SAAS,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,OAAO,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const ErrorCode = {
|
|
2
|
+
CONTEXT_INDEX_INCOMPLETE: "CONTEXT_INDEX_INCOMPLETE",
|
|
3
|
+
WORKFLOW_NOT_FOUND: "WORKFLOW_NOT_FOUND",
|
|
4
|
+
RUN_NOT_FOUND: "RUN_NOT_FOUND",
|
|
5
|
+
MEMORY_KEY_NOT_FOUND: "MEMORY_KEY_NOT_FOUND",
|
|
6
|
+
PROJECT_NOT_FOUND: "PROJECT_NOT_FOUND",
|
|
7
|
+
NODE_NOT_FOUND: "NODE_NOT_FOUND",
|
|
8
|
+
TASK_NOT_FOUND: "TASK_NOT_FOUND",
|
|
9
|
+
REPORT_NOT_FOUND: "REPORT_NOT_FOUND",
|
|
10
|
+
PLUGIN_NOT_FOUND: "PLUGIN_NOT_FOUND",
|
|
11
|
+
KNOWLEDGE_SYNC_FAILED: "KNOWLEDGE_SYNC_FAILED",
|
|
12
|
+
VALIDATION_ERROR: "VALIDATION_ERROR",
|
|
13
|
+
INTERNAL_ERROR: "INTERNAL_ERROR",
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=error-codes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"error-codes.js","sourceRoot":"","sources":["../../src/common/error-codes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,wBAAwB,EAAE,0BAA0B;IACpD,kBAAkB,EAAE,oBAAoB;IACxC,aAAa,EAAE,eAAe;IAC9B,oBAAoB,EAAE,sBAAsB;IAC5C,iBAAiB,EAAE,mBAAmB;IACtC,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,gBAAgB,EAAE,kBAAkB;IACpC,gBAAgB,EAAE,kBAAkB;IACpC,qBAAqB,EAAE,uBAAuB;IAC9C,gBAAgB,EAAE,kBAAkB;IACpC,cAAc,EAAE,gBAAgB;CACxB,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ExceptionFilter, ArgumentsHost } from "@nestjs/common";
|
|
2
|
+
export declare class HttpExceptionFilter implements ExceptionFilter {
|
|
3
|
+
private readonly logger;
|
|
4
|
+
catch(exception: unknown, host: ArgumentsHost): void;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=http-exception.filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-exception.filter.d.ts","sourceRoot":"","sources":["../../src/common/http-exception.filter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EAEf,aAAa,EAId,MAAM,gBAAgB,CAAC;AAKxB,qBACa,mBAAoB,YAAW,eAAe;IACzD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAwC;IAE/D,KAAK,CAAC,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,GAAG,IAAI;CAwCrD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var HttpExceptionFilter_1;
|
|
8
|
+
import { Catch, HttpException, HttpStatus, Logger, } from "@nestjs/common";
|
|
9
|
+
import { ErrorCode } from "./error-codes.js";
|
|
10
|
+
let HttpExceptionFilter = HttpExceptionFilter_1 = class HttpExceptionFilter {
|
|
11
|
+
constructor() {
|
|
12
|
+
this.logger = new Logger(HttpExceptionFilter_1.name);
|
|
13
|
+
}
|
|
14
|
+
catch(exception, host) {
|
|
15
|
+
const ctx = host.switchToHttp();
|
|
16
|
+
const reply = ctx.getResponse();
|
|
17
|
+
if (exception instanceof HttpException) {
|
|
18
|
+
const status = exception.getStatus();
|
|
19
|
+
const body = exception.getResponse();
|
|
20
|
+
if (typeof body === "object" && body !== null && "error" in body) {
|
|
21
|
+
reply.status(status).send(body);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const message = typeof body === "string"
|
|
25
|
+
? body
|
|
26
|
+
: body.message ??
|
|
27
|
+
"Request failed";
|
|
28
|
+
reply.status(status).send({
|
|
29
|
+
error: {
|
|
30
|
+
code: ErrorCode.INTERNAL_ERROR,
|
|
31
|
+
message,
|
|
32
|
+
details: {},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
this.logger.error("Unhandled exception", exception instanceof Error ? exception.stack : String(exception));
|
|
38
|
+
reply.status(HttpStatus.INTERNAL_SERVER_ERROR).send({
|
|
39
|
+
error: {
|
|
40
|
+
code: ErrorCode.INTERNAL_ERROR,
|
|
41
|
+
message: "Internal server error",
|
|
42
|
+
details: {},
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
HttpExceptionFilter = HttpExceptionFilter_1 = __decorate([
|
|
48
|
+
Catch()
|
|
49
|
+
], HttpExceptionFilter);
|
|
50
|
+
export { HttpExceptionFilter };
|
|
51
|
+
//# sourceMappingURL=http-exception.filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"http-exception.filter.js","sourceRoot":"","sources":["../../src/common/http-exception.filter.ts"],"names":[],"mappings":";;;;;;;AAAA,OAAO,EAEL,KAAK,EAEL,aAAa,EACb,UAAU,EACV,MAAM,GACP,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAItC,IAAM,mBAAmB,2BAAzB,MAAM,mBAAmB;IAAzB;QACY,WAAM,GAAG,IAAI,MAAM,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IA0CjE,CAAC;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,mBAAmB;IAD/B,KAAK,EAAE;GACK,mBAAmB,CA2C/B"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ContextService, IndexStatus } from "./context.service.js";
|
|
2
|
+
import type { ContextResult } from "@devflow-tools/sdk";
|
|
3
|
+
export declare class ContextController {
|
|
4
|
+
private readonly service;
|
|
5
|
+
constructor(service: ContextService);
|
|
6
|
+
status(rootPath: string): Promise<IndexStatus>;
|
|
7
|
+
index(body: {
|
|
8
|
+
rootPath: string;
|
|
9
|
+
}): Promise<IndexStatus>;
|
|
10
|
+
build(body: {
|
|
11
|
+
rootPath: string;
|
|
12
|
+
query: string;
|
|
13
|
+
mode?: "fast" | "deep";
|
|
14
|
+
maxTokens?: number;
|
|
15
|
+
}): Promise<ContextResult>;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=context.controller.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.controller.d.ts","sourceRoot":"","sources":["../../src/context/context.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,qBACa,iBAAiB;IACQ,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,cAAc;IAGtE,MAAM,CAAoB,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKjE,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAK/D,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,aAAa,CAAC;CAGnI"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
+
};
|
|
13
|
+
import { Controller, Get, Post, Body, Query, Inject } from "@nestjs/common";
|
|
14
|
+
import { ContextService } from "./context.service.js";
|
|
15
|
+
let ContextController = class ContextController {
|
|
16
|
+
constructor(service) {
|
|
17
|
+
this.service = service;
|
|
18
|
+
}
|
|
19
|
+
async status(rootPath) {
|
|
20
|
+
return this.service.getStatus(rootPath);
|
|
21
|
+
}
|
|
22
|
+
async index(body) {
|
|
23
|
+
return this.service.indexProject(body.rootPath);
|
|
24
|
+
}
|
|
25
|
+
async build(body) {
|
|
26
|
+
return this.service.buildContext(body.rootPath, body.query, body.mode ?? "fast", body.maxTokens);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
Get("status"),
|
|
31
|
+
__param(0, Query("rootPath")),
|
|
32
|
+
__metadata("design:type", Function),
|
|
33
|
+
__metadata("design:paramtypes", [String]),
|
|
34
|
+
__metadata("design:returntype", Promise)
|
|
35
|
+
], ContextController.prototype, "status", null);
|
|
36
|
+
__decorate([
|
|
37
|
+
Post("index"),
|
|
38
|
+
__param(0, Body()),
|
|
39
|
+
__metadata("design:type", Function),
|
|
40
|
+
__metadata("design:paramtypes", [Object]),
|
|
41
|
+
__metadata("design:returntype", Promise)
|
|
42
|
+
], ContextController.prototype, "index", null);
|
|
43
|
+
__decorate([
|
|
44
|
+
Post("build"),
|
|
45
|
+
__param(0, Body()),
|
|
46
|
+
__metadata("design:type", Function),
|
|
47
|
+
__metadata("design:paramtypes", [Object]),
|
|
48
|
+
__metadata("design:returntype", Promise)
|
|
49
|
+
], ContextController.prototype, "build", null);
|
|
50
|
+
ContextController = __decorate([
|
|
51
|
+
Controller("context"),
|
|
52
|
+
__param(0, Inject(ContextService)),
|
|
53
|
+
__metadata("design:paramtypes", [ContextService])
|
|
54
|
+
], ContextController);
|
|
55
|
+
export { ContextController };
|
|
56
|
+
//# sourceMappingURL=context.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.controller.js","sourceRoot":"","sources":["../../src/context/context.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAC5E,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAC;AAI5D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAAqD,OAAuB;QAAvB,YAAO,GAAP,OAAO,CAAgB;IAAG,CAAC;IAG1E,AAAN,KAAK,CAAC,MAAM,CAAoB,QAAgB;QAC9C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAS,IAA0B;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClD,CAAC;IAGK,AAAN,KAAK,CAAC,KAAK,CAAS,IAAqF;QACvG,OAAO,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACnG,CAAC;CACF,CAAA;AAbO;IADL,GAAG,CAAC,QAAQ,CAAC;IACA,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;;;;+CAE9B;AAGK;IADL,IAAI,CAAC,OAAO,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;;;;8CAElB;AAGK;IADL,IAAI,CAAC,OAAO,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;;;;8CAElB;AAhBU,iBAAiB;IAD7B,UAAU,CAAC,SAAS,CAAC;IAEP,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;qCAA2B,cAAc;GADjE,iBAAiB,CAiB7B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.module.d.ts","sourceRoot":"","sources":["../../src/context/context.module.ts"],"names":[],"mappings":"AAIA,qBACa,aAAa;CAAG"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Module } from "@nestjs/common";
|
|
8
|
+
import { ContextService } from "./context.service.js";
|
|
9
|
+
import { ContextController } from "./context.controller.js";
|
|
10
|
+
let ContextModule = class ContextModule {
|
|
11
|
+
};
|
|
12
|
+
ContextModule = __decorate([
|
|
13
|
+
Module({ controllers: [ContextController], providers: [ContextService], exports: [ContextService] })
|
|
14
|
+
], ContextModule);
|
|
15
|
+
export { ContextModule };
|
|
16
|
+
//# sourceMappingURL=context.module.js.map
|