@devflow-tools/server 0.2.3 → 0.3.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.
Files changed (70) hide show
  1. package/dist/app.module.d.ts.map +1 -1
  2. package/dist/app.module.js +7 -0
  3. package/dist/app.module.js.map +1 -1
  4. package/dist/common/dto.d.ts +1 -0
  5. package/dist/common/dto.d.ts.map +1 -1
  6. package/dist/common/response.interceptor.d.ts +6 -0
  7. package/dist/common/response.interceptor.d.ts.map +1 -0
  8. package/dist/common/response.interceptor.js +23 -0
  9. package/dist/common/response.interceptor.js.map +1 -0
  10. package/dist/common/response.interceptor.test.d.ts +2 -0
  11. package/dist/common/response.interceptor.test.d.ts.map +1 -0
  12. package/dist/common/response.interceptor.test.js +23 -0
  13. package/dist/common/response.interceptor.test.js.map +1 -0
  14. package/dist/common/root-path.decorator.d.ts +2 -0
  15. package/dist/common/root-path.decorator.d.ts.map +1 -0
  16. package/dist/common/root-path.decorator.js +6 -0
  17. package/dist/common/root-path.decorator.js.map +1 -0
  18. package/dist/context/context.controller.d.ts +4 -3
  19. package/dist/context/context.controller.d.ts.map +1 -1
  20. package/dist/context/context.controller.js +27 -12
  21. package/dist/context/context.controller.js.map +1 -1
  22. package/dist/context/context.service.d.ts +1 -0
  23. package/dist/context/context.service.d.ts.map +1 -1
  24. package/dist/context/context.service.js +4 -0
  25. package/dist/context/context.service.js.map +1 -1
  26. package/dist/graph/graph.controller.d.ts +3 -3
  27. package/dist/graph/graph.controller.d.ts.map +1 -1
  28. package/dist/graph/graph.controller.js +14 -11
  29. package/dist/graph/graph.controller.js.map +1 -1
  30. package/dist/knowledge/knowledge.controller.d.ts +5 -3
  31. package/dist/knowledge/knowledge.controller.d.ts.map +1 -1
  32. package/dist/knowledge/knowledge.controller.js +22 -9
  33. package/dist/knowledge/knowledge.controller.js.map +1 -1
  34. package/dist/knowledge/knowledge.service.d.ts +7 -5
  35. package/dist/knowledge/knowledge.service.d.ts.map +1 -1
  36. package/dist/knowledge/knowledge.service.js +26 -14
  37. package/dist/knowledge/knowledge.service.js.map +1 -1
  38. package/dist/memory/memory.controller.d.ts +5 -5
  39. package/dist/memory/memory.controller.d.ts.map +1 -1
  40. package/dist/memory/memory.controller.js +19 -14
  41. package/dist/memory/memory.controller.js.map +1 -1
  42. package/dist/registry/registry.controller.d.ts +13 -0
  43. package/dist/registry/registry.controller.d.ts.map +1 -1
  44. package/dist/registry/registry.controller.js +24 -1
  45. package/dist/registry/registry.controller.js.map +1 -1
  46. package/dist/registry/registry.service.d.ts +8 -0
  47. package/dist/registry/registry.service.d.ts.map +1 -1
  48. package/dist/registry/registry.service.js +18 -0
  49. package/dist/registry/registry.service.js.map +1 -1
  50. package/dist/server.controller.d.ts +8 -0
  51. package/dist/server.controller.d.ts.map +1 -0
  52. package/dist/server.controller.js +31 -0
  53. package/dist/server.controller.js.map +1 -0
  54. package/dist/telemetry/telemetry.controller.d.ts +32 -1
  55. package/dist/telemetry/telemetry.controller.d.ts.map +1 -1
  56. package/dist/telemetry/telemetry.controller.js +46 -4
  57. package/dist/telemetry/telemetry.controller.js.map +1 -1
  58. package/dist/telemetry/telemetry.service.d.ts +25 -1
  59. package/dist/telemetry/telemetry.service.d.ts.map +1 -1
  60. package/dist/telemetry/telemetry.service.js +67 -3
  61. package/dist/telemetry/telemetry.service.js.map +1 -1
  62. package/dist/workflow/workflow.controller.d.ts +1 -0
  63. package/dist/workflow/workflow.controller.d.ts.map +1 -1
  64. package/dist/workflow/workflow.controller.js +10 -0
  65. package/dist/workflow/workflow.controller.js.map +1 -1
  66. package/dist/workflow/workflow.service.d.ts +1 -0
  67. package/dist/workflow/workflow.service.d.ts.map +1 -1
  68. package/dist/workflow/workflow.service.js +13 -0
  69. package/dist/workflow/workflow.service.js.map +1 -1
  70. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"app.module.d.ts","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":"AAYA,qBAca,SAAS;CAAG"}
1
+ {"version":3,"file":"app.module.d.ts","sourceRoot":"","sources":["../src/app.module.ts"],"names":[],"mappings":"AAeA,qBAkBa,SAAS;CAAG"}
@@ -5,6 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Module } from "@nestjs/common";
8
+ import { APP_INTERCEPTOR } from "@nestjs/core";
8
9
  import { AuthModule } from "./auth/auth.module.js";
9
10
  import { ProjectsModule } from "./projects/projects.module.js";
10
11
  import { ContextModule } from "./context/context.module.js";
@@ -15,6 +16,8 @@ import { KnowledgeModule } from "./knowledge/knowledge.module.js";
15
16
  import { TelemetryModule } from "./telemetry/telemetry.module.js";
16
17
  import { BenchmarkModule } from "./benchmark/benchmark.module.js";
17
18
  import { RegistryModule } from "./registry/registry.module.js";
19
+ import { ResponseInterceptor } from "./common/response.interceptor.js";
20
+ import { ServerController } from "./server.controller.js";
18
21
  let AppModule = class AppModule {
19
22
  };
20
23
  AppModule = __decorate([
@@ -31,6 +34,10 @@ AppModule = __decorate([
31
34
  BenchmarkModule,
32
35
  RegistryModule,
33
36
  ],
37
+ controllers: [ServerController],
38
+ providers: [
39
+ { provide: APP_INTERCEPTOR, useClass: ResponseInterceptor },
40
+ ],
34
41
  })
35
42
  ], AppModule);
36
43
  export { AppModule };
@@ -1 +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,C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CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAoBnD,IAAM,SAAS,GAAf,MAAM,SAAS;CAAG,CAAA;AAAZ,SAAS;IAlBrB,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;QACD,WAAW,EAAE,CAAC,gBAAgB,CAAC;QAC/B,SAAS,EAAE;YACT,EAAE,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,mBAAmB,EAAE;SAC5D;KACF,CAAC;GACW,SAAS,CAAG"}
@@ -6,6 +6,7 @@ export interface ApiError {
6
6
  };
7
7
  }
8
8
  export interface ApiResponse<T> {
9
+ ok: true;
9
10
  data: T;
10
11
  }
11
12
  //# sourceMappingURL=dto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/common/dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC;CACH;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,IAAI,EAAE,CAAC,CAAC;CACT"}
1
+ {"version":3,"file":"dto.d.ts","sourceRoot":"","sources":["../../src/common/dto.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KAClC,CAAC;CACH;AAED,MAAM,WAAW,WAAW,CAAC,CAAC;IAC5B,EAAE,EAAE,IAAI,CAAC;IACT,IAAI,EAAE,CAAC,CAAC;CACT"}
@@ -0,0 +1,6 @@
1
+ import { NestInterceptor, ExecutionContext, CallHandler } from "@nestjs/common";
2
+ import { Observable } from "rxjs";
3
+ export declare class ResponseInterceptor implements NestInterceptor {
4
+ intercept(context: ExecutionContext, next: CallHandler): Observable<unknown>;
5
+ }
6
+ //# sourceMappingURL=response.interceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interceptor.d.ts","sourceRoot":"","sources":["../../src/common/response.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,eAAe,EACf,gBAAgB,EAChB,WAAW,EACZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAGlC,qBACa,mBAAoB,YAAW,eAAe;IACzD,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU,CAAC,OAAO,CAAC;CAU7E"}
@@ -0,0 +1,23 @@
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, } from "@nestjs/common";
8
+ import { map } from "rxjs/operators";
9
+ let ResponseInterceptor = class ResponseInterceptor {
10
+ intercept(context, next) {
11
+ return next.handle().pipe(map((data) => {
12
+ if (data && typeof data === "object" && "error" in data) {
13
+ return data;
14
+ }
15
+ return { ok: true, data: data ?? null };
16
+ }));
17
+ }
18
+ };
19
+ ResponseInterceptor = __decorate([
20
+ Injectable()
21
+ ], ResponseInterceptor);
22
+ export { ResponseInterceptor };
23
+ //# sourceMappingURL=response.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interceptor.js","sourceRoot":"","sources":["../../src/common/response.interceptor.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EACL,UAAU,GAIX,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG9B,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,SAAS,CAAC,OAAyB,EAAE,IAAiB;QACpD,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,CACvB,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;YACX,IAAI,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;gBACxD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,IAAI,IAAI,EAAE,CAAC;QAC1C,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;CACF,CAAA;AAXY,mBAAmB;IAD/B,UAAU,EAAE;GACA,mBAAmB,CAW/B"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=response.interceptor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interceptor.test.d.ts","sourceRoot":"","sources":["../../src/common/response.interceptor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,23 @@
1
+ import { describe, it, expect } from "vitest";
2
+ import { lastValueFrom, of } from "rxjs";
3
+ import { ResponseInterceptor } from "./response.interceptor.js";
4
+ describe("ResponseInterceptor", () => {
5
+ const interceptor = new ResponseInterceptor();
6
+ const handler = (data) => ({ handle: () => of(data) });
7
+ it("should wrap object response in { ok: true, data }", async () => {
8
+ const ctx = { switchToHttp: () => ({ getResponse: () => ({ statusCode: 200 }) }) };
9
+ const result = await lastValueFrom(interceptor.intercept(ctx, handler({ hello: "world" })));
10
+ expect(result).toEqual({ ok: true, data: { hello: "world" } });
11
+ });
12
+ it("should wrap null response in { ok: true, data: null }", async () => {
13
+ const ctx = { switchToHttp: () => ({ getResponse: () => ({ statusCode: 200 }) }) };
14
+ const result = await lastValueFrom(interceptor.intercept(ctx, handler(null)));
15
+ expect(result).toEqual({ ok: true, data: null });
16
+ });
17
+ it("should pass through error responses unchanged", async () => {
18
+ const ctx = { switchToHttp: () => ({ getResponse: () => ({ statusCode: 400 }) }) };
19
+ const result = await lastValueFrom(interceptor.intercept(ctx, handler({ error: { code: "X", message: "bad" } })));
20
+ expect(result).toEqual({ error: { code: "X", message: "bad" } });
21
+ });
22
+ });
23
+ //# sourceMappingURL=response.interceptor.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response.interceptor.test.js","sourceRoot":"","sources":["../../src/common/response.interceptor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,EAAE,EAAE,MAAM,MAAM,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,MAAM,WAAW,GAAG,IAAI,mBAAmB,EAAE,CAAC;IAC9C,MAAM,OAAO,GAAG,CAAC,IAAa,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAEhE,EAAE,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACjE,MAAM,GAAG,GAAG,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,EAAE,CAAC,EAAS,CAAC;QAC1F,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,WAAW,CAAC,SAAS,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EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const RootPathFromRequest: (...dataOrPipes: unknown[]) => ParameterDecorator;
2
+ //# sourceMappingURL=root-path.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-path.decorator.d.ts","sourceRoot":"","sources":["../../src/common/root-path.decorator.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,mBAAmB,mDAK/B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { createParamDecorator } from "@nestjs/common";
2
+ export const RootPathFromRequest = createParamDecorator((_data, ctx) => {
3
+ const request = ctx.switchToHttp().getRequest();
4
+ return request.query?.rootPath ?? request.headers["x-devflow-project"];
5
+ });
6
+ //# sourceMappingURL=root-path.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-path.decorator.js","sourceRoot":"","sources":["../../src/common/root-path.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAC;AAExE,MAAM,CAAC,MAAM,mBAAmB,GAAG,oBAAoB,CACrD,CAAC,KAAc,EAAE,GAAqB,EAAsB,EAAE;IAC5D,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAQ,OAAO,CAAC,KAAK,EAAE,QAAmB,IAAK,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAwB,CAAC;AAC7G,CAAC,CACF,CAAC"}
@@ -6,15 +6,16 @@ export declare class ContextController {
6
6
  private readonly projects;
7
7
  constructor(service: ContextService, projects: ProjectsService);
8
8
  private resolveRootPath;
9
- status(rootPath?: string): Promise<IndexStatus>;
9
+ status(rootPath?: string, xProject?: string): Promise<IndexStatus>;
10
10
  index(body: {
11
11
  rootPath?: string;
12
- }): Promise<IndexStatus>;
12
+ }, xProject?: string): Promise<IndexStatus>;
13
13
  build(body: {
14
14
  rootPath?: string;
15
15
  query: string;
16
16
  mode?: "fast" | "deep";
17
17
  maxTokens?: number;
18
- }): Promise<ContextResult>;
18
+ }, xProject?: string): Promise<ContextResult>;
19
+ findSymbol(name: string, rootPath?: string, xProject?: string): Promise<import("@devflow-tools/sdk").SymbolEntry[]>;
19
20
  }
20
21
  //# sourceMappingURL=context.controller.d.ts.map
@@ -1 +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,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,qBACa,iBAAiB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADT,OAAO,EAAE,cAAc,EACtB,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,MAAM,CAAoB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKlE,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAKhE,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,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;CAGpI"}
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,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,qBACa,iBAAiB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACvB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADT,OAAO,EAAE,cAAc,EACtB,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,MAAM,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKnH,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,EAAgC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAKjH,KAAK,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAAgC,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAK9K,UAAU,CAAgB,IAAI,EAAE,MAAM,EAAqB,QAAQ,CAAC,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM;CAGpI"}
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { Controller, Get, Post, Body, Query, Inject, BadRequestException } from "@nestjs/common";
13
+ import { Controller, Get, Post, Body, Query, Param, Headers, Inject, BadRequestException } from "@nestjs/common";
14
14
  import { ContextService } from "./context.service.js";
15
15
  import { ProjectsService } from "../projects/projects.service.js";
16
16
  let ContextController = class ContextController {
@@ -18,43 +18,58 @@ let ContextController = class ContextController {
18
18
  this.service = service;
19
19
  this.projects = projects;
20
20
  }
21
- resolveRootPath(rootPath) {
22
- const resolved = rootPath ?? this.projects.getActiveProjectRoot();
21
+ resolveRootPath(rootPath, xProject) {
22
+ const resolved = rootPath ?? xProject ?? this.projects.getActiveProjectRoot();
23
23
  if (!resolved)
24
24
  throw new BadRequestException("rootPath is required — no active project connected");
25
25
  return resolved;
26
26
  }
27
- async status(rootPath) {
28
- return this.service.getStatus(this.resolveRootPath(rootPath));
27
+ async status(rootPath, xProject) {
28
+ return this.service.getStatus(this.resolveRootPath(rootPath, xProject));
29
29
  }
30
- async index(body) {
31
- return this.service.indexProject(this.resolveRootPath(body.rootPath));
30
+ async index(body, xProject) {
31
+ return this.service.indexProject(this.resolveRootPath(body.rootPath, xProject));
32
32
  }
33
- async build(body) {
34
- return this.service.buildContext(this.resolveRootPath(body.rootPath), body.query, body.mode ?? "fast", body.maxTokens);
33
+ async build(body, xProject) {
34
+ return this.service.buildContext(this.resolveRootPath(body.rootPath, xProject), body.query, body.mode ?? "fast", body.maxTokens);
35
+ }
36
+ async findSymbol(name, rootPath, xProject) {
37
+ return this.service.findSymbol(this.resolveRootPath(rootPath, xProject), name);
35
38
  }
36
39
  };
37
40
  __decorate([
38
41
  Get("status"),
39
42
  __param(0, Query("rootPath")),
43
+ __param(1, Headers("x-devflow-project")),
40
44
  __metadata("design:type", Function),
41
- __metadata("design:paramtypes", [String]),
45
+ __metadata("design:paramtypes", [String, String]),
42
46
  __metadata("design:returntype", Promise)
43
47
  ], ContextController.prototype, "status", null);
44
48
  __decorate([
45
49
  Post("index"),
46
50
  __param(0, Body()),
51
+ __param(1, Headers("x-devflow-project")),
47
52
  __metadata("design:type", Function),
48
- __metadata("design:paramtypes", [Object]),
53
+ __metadata("design:paramtypes", [Object, String]),
49
54
  __metadata("design:returntype", Promise)
50
55
  ], ContextController.prototype, "index", null);
51
56
  __decorate([
52
57
  Post("build"),
53
58
  __param(0, Body()),
59
+ __param(1, Headers("x-devflow-project")),
54
60
  __metadata("design:type", Function),
55
- __metadata("design:paramtypes", [Object]),
61
+ __metadata("design:paramtypes", [Object, String]),
56
62
  __metadata("design:returntype", Promise)
57
63
  ], ContextController.prototype, "build", null);
64
+ __decorate([
65
+ Get("symbol/:name"),
66
+ __param(0, Param("name")),
67
+ __param(1, Query("rootPath")),
68
+ __param(2, Headers("x-devflow-project")),
69
+ __metadata("design:type", Function),
70
+ __metadata("design:paramtypes", [String, String, String]),
71
+ __metadata("design:returntype", Promise)
72
+ ], ContextController.prototype, "findSymbol", null);
58
73
  ContextController = __decorate([
59
74
  Controller("context"),
60
75
  __param(0, Inject(ContextService)),
@@ -1 +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,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,cAAc,EAAe,MAAM,sBAAsB,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAI3D,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAC2C,OAAuB,EACtB,QAAyB;QAD1B,YAAO,GAAP,OAAO,CAAgB;QACtB,aAAQ,GAAR,QAAQ,CAAiB;IAClE,CAAC;IAEI,eAAe,CAAC,QAAiB;QACvC,MAAM,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;QAClE,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,mBAAmB,CAAC,oDAAoD,CAAC,CAAC;QACnG,OAAO,QAAQ,CAAC;IAClB,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAoB,QAAiB;QAC/C,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,eAAe,CA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AE,IAAI,CAAC,CAAC;IACjF,CAAC;CACF,CAAA;AAlBO;IADL,GAAG,CAAC,QAAQ,CAAC;IACA,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAAqB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;+CAE/E;AAGK;IADL,IAAI,CAAC,OAAO,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;IAA+B,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;8CAE7E;AAGK;IADL,IAAI,CAAC,OAAO,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;IAA0F,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;8CAExI;AAGK;IADL,GAAG,CAAC,cAAc,CAAC;IACF,WAAA,KAAK,CAAC,MAAM,CAAC,CAAA;IAAgB,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAAqB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;mDAEhH;AA9BU,iBAAiB;IAD7B,UAAU,CAAC,SAAS,CAAC;IAGjB,WAAA,MAAM,CAAC,cAAc,CAAC,CAAA;IACtB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;qCAD0B,cAAc;QACZ,eAAe;GAH1D,iBAAiB,CA+B7B"}
@@ -9,5 +9,6 @@ export declare class ContextService {
9
9
  indexProject(rootPath: string): Promise<IndexStatus>;
10
10
  getStatus(rootPath: string): Promise<IndexStatus>;
11
11
  buildContext(rootPath: string, query: string, mode: "fast" | "deep", maxTokens?: number): Promise<ContextResult>;
12
+ findSymbol(rootPath: string, name: string): Promise<import("@devflow-tools/sdk").SymbolEntry[]>;
12
13
  }
13
14
  //# sourceMappingURL=context.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context.service.d.ts","sourceRoot":"","sources":["../../src/context/context.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qBACa,cAAc;IACnB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAYpD,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBjD,YAAY,CAChB,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GACzE,OAAO,CAAC,aAAa,CAAC;CAI1B"}
1
+ {"version":3,"file":"context.service.d.ts","sourceRoot":"","sources":["../../src/context/context.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,qBACa,cAAc;IACnB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAYpD,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IAoBjD,YAAY,CAChB,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GACzE,OAAO,CAAC,aAAa,CAAC;IAKnB,UAAU,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAIhD"}
@@ -42,6 +42,10 @@ let ContextService = class ContextService {
42
42
  const { context } = await createEngines(rootPath);
43
43
  return context.build({ query, mode, maxTokens: maxTokens ?? 8000, includeGraph: mode === "deep" });
44
44
  }
45
+ async findSymbol(rootPath, name) {
46
+ const { indexer } = await createEngines(rootPath);
47
+ return indexer.findSymbol(name);
48
+ }
45
49
  };
46
50
  ContextService = __decorate([
47
51
  Injectable()
@@ -1 +1 @@
1
- {"version":3,"file":"context.service.js","sourceRoot":"","sources":["../../src/context/context.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAWvD,IAAM,cAAc,GAApB,MAAM,cAAc;IACzB,KAAK,CAAC,YAAY,CAAC,QAAgB;QACjC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;QAC7D,MAAM,OAAO,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;QAC9B,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;QACnC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,SAAS;YAC3B,YAAY,EAAE,KAAK,CAAC,SAAS;YAC7B,aAAa,EAAE,KAAK,CAAC,WAAW;YAChC,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAE;SACjC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,QAAgB;QAC9B,IAAI,CAAC;YACH,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;YACpD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;YACnC,OAAO;gBACL,UAAU,EAAE,KAAK,CAAC,SAAS;gBAC3B,YAAY,EAAE,KAAK,CAAC,SAAS;gBAC7B,aAAa,EAAE,KAAK,CAAC,WAAW;gBAChC,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAE;aACjC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,CAA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YACpD,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE,CAAC;YACnC,OAAO;gBACL,UAAU,EAAE,KAAK,CAAC,SAAS;gBAC3B,YAAY,EAAE,KAAK,CAAC,SAAS;gBAC7B,aAAa,EAAE,KAAK,CAAC,WAAW;gBAChC,QAAQ,EAAE,SAAS,CAAC,UAAU,EAAE;aACjC,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,OAAO;gBACL,UAAU,EAAE,CAAC;gBACb,YAAY,EAAE,CAAC;gBACf,aAAa,EAAE,CAAC;gBAChB,QAAQ,EAAE,KAAK;aAChB,CAAC;QACJ,CAAC;IACH,CAAC;IAED,KAAK,CAAC,YAAY,CAChB,QAAgB,EAAE,KAAa,EAAE,IAAqB,EAAE,SAAkB;QAE1E,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,IAAI,IAAI,EAAE,YAAY,EAAE,IAAI,KAAK,MAAM,EAAE,CAAC,CAAC;IACrG,CAAC;IAED,KAAK,CAAC,UAAU,CAAC,QAAgB,EAAE,IAAY;QAC7C,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;QAClD,OAAO,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF,CAAA;AA5CY,cAAc;IAD1B,UAAU,EAAE;GACA,cAAc,CA4C1B"}
@@ -5,9 +5,9 @@ export declare class GraphController {
5
5
  private readonly projects;
6
6
  constructor(service: GraphService, projects: ProjectsService);
7
7
  private resolveRootPath;
8
- getFullGraph(rootPath?: string, view?: string): Promise<any>;
9
- getNode(rootPath: string | undefined, nodeId: string): Promise<import("@colbymchenry/codegraph").Node>;
10
- expandNode(rootPath: string | undefined, nodeId: string, depth?: string, direction?: string): Promise<{
8
+ getFullGraph(rootPath?: string, view?: string, xProject?: string): Promise<any>;
9
+ getNode(rootPath: string | undefined, nodeId: string, xProject?: string): Promise<import("@colbymchenry/codegraph").Node>;
10
+ expandNode(rootPath: string | undefined, nodeId: string, depth?: string, direction?: string, xProject?: string): Promise<{
11
11
  node: import("@devflow-tools/sdk").GraphNode | undefined;
12
12
  subGraph: import("@devflow-tools/sdk").SubGraph;
13
13
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"graph.controller.d.ts","sourceRoot":"","sources":["../../src/graph/graph.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,qBACa,eAAe;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADX,OAAO,EAAE,YAAY,EAClB,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,YAAY,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAiB,IAAI,CAAC,EAAE,MAAM;IAM/E,OAAO,CAAoB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAmB,MAAM,EAAE,MAAM;IAGxF,UAAU,CACK,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,MAAM;;;;CAEzC"}
1
+ {"version":3,"file":"graph.controller.d.ts","sourceRoot":"","sources":["../../src/graph/graph.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,qBACa,eAAe;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACrB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADX,OAAO,EAAE,YAAY,EAClB,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,YAAY,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAiB,IAAI,CAAC,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM;IAMhI,OAAO,CAAoB,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAmB,MAAM,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM;IAGzI,UAAU,CACK,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC9B,MAAM,EAAE,MAAM,EACf,KAAK,CAAC,EAAE,MAAM,EACV,SAAS,CAAC,EAAE,MAAM,EACR,QAAQ,CAAC,EAAE,MAAM;;;;CAElD"}
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { Controller, Get, Param, Query, Inject, BadRequestException } from "@nestjs/common";
13
+ import { Controller, Get, Param, Query, Headers, Inject, BadRequestException } from "@nestjs/common";
14
14
  import { GraphService } from "./graph.service.js";
15
15
  import { ProjectsService } from "../projects/projects.service.js";
16
16
  let GraphController = class GraphController {
@@ -18,34 +18,36 @@ let GraphController = class GraphController {
18
18
  this.service = service;
19
19
  this.projects = projects;
20
20
  }
21
- resolveRootPath(rootPath) {
22
- const resolved = rootPath ?? this.projects.getActiveProjectRoot();
21
+ resolveRootPath(rootPath, xProject) {
22
+ const resolved = rootPath ?? xProject ?? this.projects.getActiveProjectRoot();
23
23
  if (!resolved)
24
24
  throw new BadRequestException("rootPath is required — no active project connected");
25
25
  return resolved;
26
26
  }
27
- async getFullGraph(rootPath, view) {
27
+ async getFullGraph(rootPath, view, xProject) {
28
28
  if (view === "layered")
29
- return this.service.getLayeredGraph(this.resolveRootPath(rootPath));
30
- return this.service.getFullGraph(this.resolveRootPath(rootPath));
29
+ return this.service.getLayeredGraph(this.resolveRootPath(rootPath, xProject));
30
+ return this.service.getFullGraph(this.resolveRootPath(rootPath, xProject));
31
31
  }
32
- async getNode(rootPath, nodeId) { return this.service.getNode(this.resolveRootPath(rootPath), nodeId); }
33
- async expandNode(rootPath, nodeId, depth, direction) { return this.service.expandNode(this.resolveRootPath(rootPath), nodeId, Number(depth) || 2, direction || "both"); }
32
+ async getNode(rootPath, nodeId, xProject) { return this.service.getNode(this.resolveRootPath(rootPath, xProject), nodeId); }
33
+ async expandNode(rootPath, nodeId, depth, direction, xProject) { return this.service.expandNode(this.resolveRootPath(rootPath, xProject), nodeId, Number(depth) || 2, direction || "both"); }
34
34
  };
35
35
  __decorate([
36
36
  Get(),
37
37
  __param(0, Query("rootPath")),
38
38
  __param(1, Query("view")),
39
+ __param(2, Headers("x-devflow-project")),
39
40
  __metadata("design:type", Function),
40
- __metadata("design:paramtypes", [String, String]),
41
+ __metadata("design:paramtypes", [String, String, String]),
41
42
  __metadata("design:returntype", Promise)
42
43
  ], GraphController.prototype, "getFullGraph", null);
43
44
  __decorate([
44
45
  Get(":nodeId"),
45
46
  __param(0, Query("rootPath")),
46
47
  __param(1, Param("nodeId")),
48
+ __param(2, Headers("x-devflow-project")),
47
49
  __metadata("design:type", Function),
48
- __metadata("design:paramtypes", [Object, String]),
50
+ __metadata("design:paramtypes", [Object, String, String]),
49
51
  __metadata("design:returntype", Promise)
50
52
  ], GraphController.prototype, "getNode", null);
51
53
  __decorate([
@@ -54,8 +56,9 @@ __decorate([
54
56
  __param(1, Param("nodeId")),
55
57
  __param(2, Query("depth")),
56
58
  __param(3, Query("direction")),
59
+ __param(4, Headers("x-devflow-project")),
57
60
  __metadata("design:type", Function),
58
- __metadata("design:paramtypes", [Object, String, String, String]),
61
+ __metadata("design:paramtypes", [Object, String, String, String, String]),
59
62
  __metadata("design:returntype", Promise)
60
63
  ], GraphController.prototype, "expandNode", null);
61
64
  GraphController = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"graph.controller.js","sourceRoot":"","sources":["../../src/graph/graph.controller.ts"],"names":[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AA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;mDAGnH;AAGK;IADL,GAAG,CAAC,SAAS,CAAC;IACA,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAAgC,WAAA,KAAK,CAAC,QAAQ,CAAC,CAAA;IAAkB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;8CAAsG;AAG7N;IADL,GAAG,CAAC,gBAAgB,CAAC;IAEnB,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IACjB,WAAA,KAAK,CAAC,QAAQ,CAAC,CAAA;IACf,WAAA,KAAK,CAAC,OAAO,CAAC,CAAA;IACd,WAAA,KAAK,CAAC,WAAW,CAAC,CAAA;IAClB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;iDACiG;AA5BrH,eAAe;IAD3B,UAAU,CAAC,OAAO,CAAC;IAGf,WAAA,MAAM,CAAC,YAAY,CAAC,CAAA;IACpB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;qCADwB,YAAY;QACR,eAAe;GAH1D,eAAe,CA6B3B"}
@@ -5,12 +5,14 @@ export declare class KnowledgeController {
5
5
  private readonly projects;
6
6
  constructor(service: KnowledgeService, projects: ProjectsService);
7
7
  private resolveRootPath;
8
- search(rootPath?: string, q?: string, scope?: string): Promise<import("@devflow-tools/sdk").KnowledgeEntry[]>;
8
+ search(rootPath?: string, q?: string, scope?: string, xProject?: string): Promise<import("@devflow-tools/sdk").KnowledgeEntry[]>;
9
9
  sync(body: {
10
10
  rootPath?: string;
11
11
  pluginName?: string;
12
- }): Promise<{
13
- synced: number;
12
+ }, xProject?: string): Promise<import("@devflow-tools/sdk").SyncResult[]>;
13
+ getSources(rootPath?: string, xProject?: string): Promise<{
14
+ ok: boolean;
15
+ data: import("@devflow-tools/sdk").KnowledgeSourceStatus[];
14
16
  }>;
15
17
  }
16
18
  //# sourceMappingURL=knowledge.controller.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.controller.d.ts","sourceRoot":"","sources":["../../src/knowledge/knowledge.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,qBACa,mBAAmB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADP,OAAO,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,MAAM,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAc,CAAC,CAAC,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,MAAM;IAKnG,IAAI,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE;;;CAGpE"}
1
+ {"version":3,"file":"knowledge.controller.d.ts","sourceRoot":"","sources":["../../src/knowledge/knowledge.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,qBACa,mBAAmB;IAEF,OAAO,CAAC,QAAQ,CAAC,OAAO;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;gBADP,OAAO,EAAE,gBAAgB,EAC1B,QAAQ,EAAE,eAAe;IAGrE,OAAO,CAAC,eAAe;IAOjB,MAAM,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAc,CAAC,CAAC,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM;IAKpJ,IAAI,CAAS,IAAI,EAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,EAAgC,QAAQ,CAAC,EAAE,MAAM;IAK9G,UAAU,CAAoB,QAAQ,CAAC,EAAE,MAAM,EAAgC,QAAQ,CAAC,EAAE,MAAM;;;;CAGvG"}
@@ -10,7 +10,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
10
10
  var __param = (this && this.__param) || function (paramIndex, decorator) {
11
11
  return function (target, key) { decorator(target, key, paramIndex); }
12
12
  };
13
- import { Controller, Get, Post, Query, Body, Inject, BadRequestException } from "@nestjs/common";
13
+ import { Controller, Get, Post, Query, Body, Headers, Inject, BadRequestException } from "@nestjs/common";
14
14
  import { KnowledgeService } from "./knowledge.service.js";
15
15
  import { ProjectsService } from "../projects/projects.service.js";
16
16
  let KnowledgeController = class KnowledgeController {
@@ -18,17 +18,20 @@ let KnowledgeController = class KnowledgeController {
18
18
  this.service = service;
19
19
  this.projects = projects;
20
20
  }
21
- resolveRootPath(rootPath) {
22
- const resolved = rootPath ?? this.projects.getActiveProjectRoot();
21
+ resolveRootPath(rootPath, xProject) {
22
+ const resolved = rootPath ?? xProject ?? this.projects.getActiveProjectRoot();
23
23
  if (!resolved)
24
24
  throw new BadRequestException("rootPath is required — no active project connected");
25
25
  return resolved;
26
26
  }
27
- async search(rootPath, q, scope) {
28
- return this.service.search(this.resolveRootPath(rootPath), q ?? "", scope);
27
+ async search(rootPath, q, scope, xProject) {
28
+ return this.service.search(this.resolveRootPath(rootPath, xProject), q ?? "", scope);
29
29
  }
30
- async sync(body) {
31
- return this.service.sync(this.resolveRootPath(body.rootPath), body.pluginName);
30
+ async sync(body, xProject) {
31
+ return this.service.sync(this.resolveRootPath(body.rootPath, xProject), body.pluginName);
32
+ }
33
+ async getSources(rootPath, xProject) {
34
+ return { ok: true, data: await this.service.getSources(this.resolveRootPath(rootPath, xProject)) };
32
35
  }
33
36
  };
34
37
  __decorate([
@@ -36,17 +39,27 @@ __decorate([
36
39
  __param(0, Query("rootPath")),
37
40
  __param(1, Query("q")),
38
41
  __param(2, Query("scope")),
42
+ __param(3, Headers("x-devflow-project")),
39
43
  __metadata("design:type", Function),
40
- __metadata("design:paramtypes", [String, String, String]),
44
+ __metadata("design:paramtypes", [String, String, String, String]),
41
45
  __metadata("design:returntype", Promise)
42
46
  ], KnowledgeController.prototype, "search", null);
43
47
  __decorate([
44
48
  Post("sync"),
45
49
  __param(0, Body()),
50
+ __param(1, Headers("x-devflow-project")),
46
51
  __metadata("design:type", Function),
47
- __metadata("design:paramtypes", [Object]),
52
+ __metadata("design:paramtypes", [Object, String]),
48
53
  __metadata("design:returntype", Promise)
49
54
  ], KnowledgeController.prototype, "sync", null);
55
+ __decorate([
56
+ Get("sources"),
57
+ __param(0, Query("rootPath")),
58
+ __param(1, Headers("x-devflow-project")),
59
+ __metadata("design:type", Function),
60
+ __metadata("design:paramtypes", [String, String]),
61
+ __metadata("design:returntype", Promise)
62
+ ], KnowledgeController.prototype, "getSources", null);
50
63
  KnowledgeController = __decorate([
51
64
  Controller("knowledge"),
52
65
  __param(0, Inject(KnowledgeService)),
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.controller.js","sourceRoot":"","sources":["../../src/knowledge/knowledge.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAG3D,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAC9B,YAC6C,OAAyB,EAC1B,QAAyB;QADxB,YAAO,GAAP,OAAO,CAAkB;QAC1B,aAAQ,GAAR,QAAQ,CAAiB;IAClE,CAAC;IAEI,eAAe,CAAC,QAAiB;QACvC,MAAM,QAAQ,GAAG,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,oBAAoB,EAAE,CAAC;QAClE,IAAI,CAAC,QAAQ;YAAE,MAAM,IAAI,mBAAmB,C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A,KAAK,CAAC,GAAG,CAAC,CAAA;IAAc,WAAA,KAAK,CAAC,OAAO,CAAC,CAAA;IAAkB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;iDAEvI;AAGK;IADL,IAAI,CAAC,MAAM,CAAC;IACD,WAAA,IAAI,EAAE,CAAA;IAAoD,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;+CAEjG;AAGK;IADL,GAAG,CAAC,SAAS,CAAC;IACG,WAAA,KAAK,CAAC,UAAU,CAAC,CAAA;IAAqB,WAAA,OAAO,CAAC,mBAAmB,CAAC,CAAA;;;;qDAEnF;AAzBU,mBAAmB;IAD/B,UAAU,CAAC,WAAW,CAAC;IAGnB,WAAA,MAAM,CAAC,gBAAgB,CAAC,CAAA;IACxB,WAAA,MAAM,CAAC,eAAe,CAAC,CAAA;qCAD4B,gBAAgB;QAChB,eAAe;GAH1D,mBAAmB,CA0B/B"}
@@ -1,8 +1,10 @@
1
- import type { KnowledgeEntry } from "@devflow-tools/sdk";
2
- export declare class KnowledgeService {
1
+ import { OnModuleInit } from "@nestjs/common";
2
+ import type { KnowledgeEntry, SyncResult, KnowledgeSourceStatus } from "@devflow-tools/sdk";
3
+ export declare class KnowledgeService implements OnModuleInit {
4
+ private getEngine;
5
+ onModuleInit(): Promise<void>;
3
6
  search(rootPath: string, query: string, scope?: string): Promise<KnowledgeEntry[]>;
4
- sync(rootPath: string, pluginName?: string): Promise<{
5
- synced: number;
6
- }>;
7
+ sync(rootPath: string, pluginName?: string): Promise<SyncResult[]>;
8
+ getSources(rootPath: string): Promise<KnowledgeSourceStatus[]>;
7
9
  }
8
10
  //# sourceMappingURL=knowledge.service.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.service.d.ts","sourceRoot":"","sources":["../../src/knowledge/knowledge.service.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEzD,qBACa,gBAAgB;IACrB,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAYlF,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;CAM/E"}
1
+ {"version":3,"file":"knowledge.service.d.ts","sourceRoot":"","sources":["../../src/knowledge/knowledge.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAE5F,qBACa,gBAAiB,YAAW,YAAY;IACnD,OAAO,CAAC,SAAS;IAIX,YAAY;IAgBZ,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IAMlF,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;IAIlE,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,qBAAqB,EAAE,CAAC;CAGrE"}
@@ -5,25 +5,37 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { Injectable } from "@nestjs/common";
8
- import { createEngines } from "@devflow-tools/context-engine";
8
+ import { KnowledgeEngine } from "@devflow-tools/knowledge-engine";
9
9
  let KnowledgeService = class KnowledgeService {
10
+ getEngine(rootPath) {
11
+ return new KnowledgeEngine({ projectRoot: rootPath });
12
+ }
13
+ async onModuleInit() {
14
+ const projectRoot = process.env.DEVFLOW_PROJECT_ROOT ?? process.cwd();
15
+ try {
16
+ const engine = this.getEngine(projectRoot);
17
+ const sources = await engine.getSources();
18
+ const weekAgo = Date.now() - 7 * 24 * 60 * 60 * 1000;
19
+ for (const s of sources) {
20
+ if (!s.lastSyncTime || s.lastSyncTime < weekAgo) {
21
+ await engine.syncDocs(s.source.name);
22
+ }
23
+ }
24
+ }
25
+ catch {
26
+ // Auto-sync failure is non-fatal — server continues
27
+ }
28
+ }
10
29
  async search(rootPath, query, scope) {
11
- const { knowledge } = await createEngines(rootPath);
12
- const all = await knowledge.search("", { limit: 100 });
13
- if (!query && !scope)
14
- return all;
15
- const lower = query?.toLowerCase() ?? "";
16
- return all.filter((e) => {
17
- const nameMatch = !lower || e.title.toLowerCase().includes(lower) || e.content.toLowerCase().includes(lower);
18
- const scopeMatch = !scope || scope === "all" || e.source === scope || e.id.startsWith(`${scope}:`);
19
- return nameMatch && scopeMatch;
30
+ return this.getEngine(rootPath).search(query, {
31
+ sources: scope && scope !== "all" ? [scope] : undefined,
20
32
  });
21
33
  }
22
34
  async sync(rootPath, pluginName) {
23
- const { knowledge } = await createEngines(rootPath);
24
- const sources = await knowledge.getSources();
25
- const targets = pluginName ? sources.filter((s) => s.source.name.includes(pluginName)) : sources;
26
- return { synced: targets.length };
35
+ return this.getEngine(rootPath).syncDocs(pluginName ?? "");
36
+ }
37
+ async getSources(rootPath) {
38
+ return this.getEngine(rootPath).getSources();
27
39
  }
28
40
  };
29
41
  KnowledgeService = __decorate([
@@ -1 +1 @@
1
- {"version":3,"file":"knowledge.service.js","sourceRoot":"","sources":["../../src/knowledge/knowledge.service.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAIvD,IAAM,gBAAgB,GAAtB,MAAM,gBAAgB;IAC3B,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,KAAa,EAAE,KAAc;QAC1D,MAAM,EAAE,SAAS,EAA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