@shepai/cli 1.6.3 → 1.8.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 (74) hide show
  1. package/README.md +2 -2
  2. package/dist/src/application/ports/output/index.d.ts +2 -0
  3. package/dist/src/application/ports/output/index.d.ts.map +1 -1
  4. package/dist/src/application/ports/output/version-service.interface.d.ts +27 -0
  5. package/dist/src/application/ports/output/version-service.interface.d.ts.map +1 -0
  6. package/dist/src/application/ports/output/version-service.interface.js +11 -0
  7. package/dist/src/application/ports/output/web-server-service.interface.d.ts +32 -0
  8. package/dist/src/application/ports/output/web-server-service.interface.d.ts.map +1 -0
  9. package/dist/src/application/ports/output/web-server-service.interface.js +11 -0
  10. package/dist/src/infrastructure/di/container.d.ts.map +1 -1
  11. package/dist/src/infrastructure/di/container.js +8 -4
  12. package/dist/src/infrastructure/services/agents/agent-validator.service.d.ts.map +1 -1
  13. package/dist/src/infrastructure/services/agents/agent-validator.service.js +21 -2
  14. package/dist/src/infrastructure/services/version.service.d.ts.map +1 -1
  15. package/dist/src/infrastructure/services/version.service.js +17 -2
  16. package/dist/src/infrastructure/services/web-server.service.d.ts +2 -1
  17. package/dist/src/infrastructure/services/web-server.service.d.ts.map +1 -1
  18. package/dist/src/infrastructure/services/web-server.service.js +17 -2
  19. package/dist/src/presentation/cli/commands/ui.command.d.ts.map +1 -1
  20. package/dist/src/presentation/cli/commands/ui.command.js +5 -4
  21. package/dist/src/presentation/cli/commands/version.command.d.ts.map +1 -1
  22. package/dist/src/presentation/cli/commands/version.command.js +2 -2
  23. package/dist/src/presentation/cli/index.js +1 -2
  24. package/dist/tsconfig.build.tsbuildinfo +1 -1
  25. package/package.json +1 -1
  26. package/web/.next/BUILD_ID +1 -1
  27. package/web/.next/build-manifest.json +2 -2
  28. package/web/.next/cache/.previewinfo +1 -1
  29. package/web/.next/cache/.rscinfo +1 -1
  30. package/web/.next/cache/config.json +3 -3
  31. package/web/.next/fallback-build-manifest.json +2 -2
  32. package/web/.next/prerender-manifest.json +3 -3
  33. package/web/.next/required-server-files.js +1 -1
  34. package/web/.next/required-server-files.json +1 -1
  35. package/web/.next/server/app/_global-error.html +2 -2
  36. package/web/.next/server/app/_global-error.rsc +1 -1
  37. package/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  38. package/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  39. package/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  40. package/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  41. package/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  42. package/web/.next/server/app/_not-found.html +2 -2
  43. package/web/.next/server/app/_not-found.rsc +1 -1
  44. package/web/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  45. package/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  46. package/web/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  47. package/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  48. package/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  49. package/web/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  50. package/web/.next/server/app/index.html +2 -2
  51. package/web/.next/server/app/index.rsc +1 -1
  52. package/web/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  53. package/web/.next/server/app/index.segments/_full.segment.rsc +1 -1
  54. package/web/.next/server/app/index.segments/_head.segment.rsc +1 -1
  55. package/web/.next/server/app/index.segments/_index.segment.rsc +1 -1
  56. package/web/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  57. package/web/.next/server/app/version.html +2 -2
  58. package/web/.next/server/app/version.rsc +1 -1
  59. package/web/.next/server/app/version.segments/_full.segment.rsc +1 -1
  60. package/web/.next/server/app/version.segments/_head.segment.rsc +1 -1
  61. package/web/.next/server/app/version.segments/_index.segment.rsc +1 -1
  62. package/web/.next/server/app/version.segments/_tree.segment.rsc +1 -1
  63. package/web/.next/server/app/version.segments/version/__PAGE__.segment.rsc +1 -1
  64. package/web/.next/server/app/version.segments/version.segment.rsc +1 -1
  65. package/web/.next/server/chunks/ssr/_ccea5183._.js +1 -1
  66. package/web/.next/server/pages/404.html +2 -2
  67. package/web/.next/server/pages/500.html +2 -2
  68. package/web/.next/server/server-reference-manifest.js +1 -1
  69. package/web/.next/server/server-reference-manifest.json +1 -1
  70. package/web/.next/trace +1 -1
  71. package/web/.next/trace-build +1 -1
  72. /package/web/.next/static/{pUS7zNbHnxONcg65QzPqB → E7Dpp8nJB2v-mna_2IoPp}/_buildManifest.js +0 -0
  73. /package/web/.next/static/{pUS7zNbHnxONcg65QzPqB → E7Dpp8nJB2v-mna_2IoPp}/_clientMiddlewareManifest.json +0 -0
  74. /package/web/.next/static/{pUS7zNbHnxONcg65QzPqB → E7Dpp8nJB2v-mna_2IoPp}/_ssgManifest.js +0 -0
package/README.md CHANGED
@@ -57,7 +57,7 @@ This launches a TUI wizard to:
57
57
 
58
58
  1. Configure Claude Code authentication (setup token or use existing session)
59
59
  2. Start repository analysis
60
- 3. Open the web UI at `http://localhost:3000/`
60
+ 3. Open the web UI at `http://localhost:4050/`
61
61
 
62
62
  ## How It Works
63
63
 
@@ -150,7 +150,7 @@ Uses **Repository Pattern** with SQLite:
150
150
  | TUI Framework | [@inquirer/prompts](https://github.com/SBoudrias/Inquirer.js) |
151
151
  | Web UI | Next.js 16 + React 19 + shadcn/ui ([@shepai/web](./src/presentation/web/)) |
152
152
  | Design System | Storybook |
153
- | Build Tool | Vite |
153
+ | Build Tool | tsc + tsc-alias (prod), Vite (dev) |
154
154
  | Database | SQLite |
155
155
  | Agent System | [LangGraph](https://www.langchain.com/langgraph) (`@langchain/langgraph`) |
156
156
  | Vector DB | [LanceDB](https://lancedb.com/) (file-based) |
@@ -6,4 +6,6 @@
6
6
  */
7
7
  export type { ISettingsRepository } from './settings.repository.interface.js';
8
8
  export type { IAgentValidator, AgentValidationResult } from './agent-validator.interface.js';
9
+ export type { IVersionService } from './version-service.interface.js';
10
+ export type { IWebServerService } from './web-server-service.interface.js';
9
11
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,YAAY,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,YAAY,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC7F,YAAY,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACtE,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Version Service Interface
3
+ *
4
+ * Output port for reading package version information.
5
+ * Infrastructure layer provides concrete implementation.
6
+ *
7
+ * Following Clean Architecture:
8
+ * - Domain and Application layers depend on this interface
9
+ * - Infrastructure layer provides concrete implementations
10
+ */
11
+ import type { VersionInfo } from '../../../domain/value-objects/version-info.js';
12
+ /**
13
+ * Port interface for reading version information.
14
+ *
15
+ * Implementations must:
16
+ * - Read version info from the package manifest (package.json)
17
+ * - Return sensible defaults when the manifest cannot be read
18
+ */
19
+ export interface IVersionService {
20
+ /**
21
+ * Get version information for the package.
22
+ *
23
+ * @returns Version info with name, version, and description
24
+ */
25
+ getVersion(): VersionInfo;
26
+ }
27
+ //# sourceMappingURL=version-service.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-service.interface.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/version-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAEjF;;;;;;GAMG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;OAIG;IACH,UAAU,IAAI,WAAW,CAAC;CAC3B"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Version Service Interface
3
+ *
4
+ * Output port for reading package version information.
5
+ * Infrastructure layer provides concrete implementation.
6
+ *
7
+ * Following Clean Architecture:
8
+ * - Domain and Application layers depend on this interface
9
+ * - Infrastructure layer provides concrete implementations
10
+ */
11
+ export {};
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Web Server Service Interface
3
+ *
4
+ * Output port for managing the web UI server lifecycle.
5
+ * Infrastructure layer provides concrete implementation.
6
+ *
7
+ * Following Clean Architecture:
8
+ * - Application layer depends on this interface
9
+ * - Infrastructure layer provides concrete implementations
10
+ */
11
+ /**
12
+ * Port interface for managing the web UI server.
13
+ *
14
+ * Implementations must:
15
+ * - Start a web server on the specified port
16
+ * - Support graceful shutdown
17
+ */
18
+ export interface IWebServerService {
19
+ /**
20
+ * Start the web server.
21
+ *
22
+ * @param port - Port to listen on
23
+ * @param dir - Path to the web package directory
24
+ * @param dev - Whether to run in development mode
25
+ */
26
+ start(port: number, dir: string, dev?: boolean): Promise<void>;
27
+ /**
28
+ * Gracefully stop the server.
29
+ */
30
+ stop(): Promise<void>;
31
+ }
32
+ //# sourceMappingURL=web-server-service.interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-server-service.interface.d.ts","sourceRoot":"","sources":["../../../../../src/application/ports/output/web-server-service.interface.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;;;OAMG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;OAEG;IACH,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Web Server Service Interface
3
+ *
4
+ * Output port for managing the web UI server lifecycle.
5
+ * Infrastructure layer provides concrete implementation.
6
+ *
7
+ * Following Clean Architecture:
8
+ * - Application layer depends on this interface
9
+ * - Infrastructure layer provides concrete implementations
10
+ */
11
+ export {};
@@ -1 +1 @@
1
- {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAwBrC;;;;;GAKG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAgCrE;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
1
+ {"version":3,"file":"container.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/di/container.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AA8BrC;;;;;GAKG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,SAAS,CAAC,CAmCrE;AAED;;;GAGG;AACH,OAAO,EAAE,SAAS,EAAE,CAAC"}
@@ -16,6 +16,8 @@ import { SQLiteSettingsRepository } from '../repositories/sqlite-settings.reposi
16
16
  import { AgentValidatorService } from '../services/agents/agent-validator.service.js';
17
17
  import { promisify } from 'node:util';
18
18
  import { execFile } from 'node:child_process';
19
+ import { VersionService } from '../services/version.service.js';
20
+ import { WebServerService } from '../services/web-server.service.js';
19
21
  // Use cases
20
22
  import { InitializeSettingsUseCase } from '../../application/use-cases/settings/initialize-settings.use-case.js';
21
23
  import { LoadSettingsUseCase } from '../../application/use-cases/settings/load-settings.use-case.js';
@@ -45,11 +47,13 @@ export async function initializeContainer() {
45
47
  return new SQLiteSettingsRepository(database);
46
48
  },
47
49
  });
48
- // Register validators
50
+ // Register external dependencies as tokens
49
51
  const execFileAsync = promisify(execFile);
50
- container.register('IAgentValidator', {
51
- useFactory: () => new AgentValidatorService(execFileAsync),
52
- });
52
+ container.registerInstance('ExecFunction', execFileAsync);
53
+ // Register services (singletons via @injectable + token)
54
+ container.registerSingleton('IAgentValidator', AgentValidatorService);
55
+ container.registerSingleton('IVersionService', VersionService);
56
+ container.registerSingleton('IWebServerService', WebServerService);
53
57
  // Register use cases (singletons for performance)
54
58
  container.registerSingleton(InitializeSettingsUseCase);
55
59
  container.registerSingleton(LoadSettingsUseCase);
@@ -1 +1 @@
1
- {"version":3,"file":"agent-validator.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/agents/agent-validator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,gEAAgE,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,KACX,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AASjD;;;;;GAKG;AACH,qBAAa,qBAAsB,YAAW,eAAe;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC;;;OAGG;gBACS,MAAM,EAAE,YAAY;IAIhC;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA2BxE"}
1
+ {"version":3,"file":"agent-validator.service.d.ts","sourceRoot":"","sources":["../../../../../src/infrastructure/services/agents/agent-validator.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,KAAK,EACV,eAAe,EACf,qBAAqB,EACtB,MAAM,gEAAgE,CAAC;AAExE;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,KACX,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AASjD;;;;;GAKG;AACH,qBACa,qBAAsB,YAAW,eAAe;IAC3D,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;IAEtC;;;OAGG;gBACiC,MAAM,EAAE,YAAY;IAIxD;;;;;OAKG;IACG,WAAW,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,qBAAqB,CAAC;CA2BxE"}
@@ -8,6 +8,19 @@
8
8
  * Uses constructor dependency injection for the command executor
9
9
  * to enable testability without mocking node:child_process directly.
10
10
  */
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ var __metadata = (this && this.__metadata) || function (k, v) {
18
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
+ };
20
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
21
+ return function (target, key) { decorator(target, key, paramIndex); }
22
+ };
23
+ import { injectable, inject } from 'tsyringe';
11
24
  /**
12
25
  * Map of supported agent types to their binary command names.
13
26
  */
@@ -20,7 +33,7 @@ const AGENT_BINARY_MAP = {
20
33
  * Checks if the agent binary exists and is executable by running
21
34
  * `<binary> --version` and parsing the output.
22
35
  */
23
- export class AgentValidatorService {
36
+ let AgentValidatorService = class AgentValidatorService {
24
37
  execFn;
25
38
  /**
26
39
  * @param execFn - Command executor function (injectable for testing).
@@ -59,4 +72,10 @@ export class AgentValidatorService {
59
72
  };
60
73
  }
61
74
  }
62
- }
75
+ };
76
+ AgentValidatorService = __decorate([
77
+ injectable(),
78
+ __param(0, inject('ExecFunction')),
79
+ __metadata("design:paramtypes", [Function])
80
+ ], AgentValidatorService);
81
+ export { AgentValidatorService };
@@ -1 +1 @@
1
- {"version":3,"file":"version.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/version.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAG9E,YAAY,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAuB9E;;GAEG;AACH,qBAAa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;;IAM1C,OAAO,CAAC,eAAe;IAqCvB;;OAEG;IACH,UAAU,IAAI,WAAW;CAG1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAIzD"}
1
+ {"version":3,"file":"version.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/version.service.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAG9E,YAAY,EAAE,WAAW,EAAE,MAAM,4CAA4C,CAAC;AAuB9E;;GAEG;AACH,qBACa,cAAc;IACzB,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAc;;IAM1C,OAAO,CAAC,eAAe;IAqCvB;;OAEG;IACH,UAAU,IAAI,WAAW;CAG1B;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,CAIzD"}
@@ -4,9 +4,19 @@
4
4
  * Infrastructure service that reads version information from package.json.
5
5
  * Follows Clean Architecture: Infrastructure layer implements data access.
6
6
  */
7
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
8
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
9
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
10
+ 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;
11
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
12
+ };
13
+ var __metadata = (this && this.__metadata) || function (k, v) {
14
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
15
+ };
7
16
  import { existsSync, readFileSync } from 'node:fs';
8
17
  import { dirname, join } from 'node:path';
9
18
  import { fileURLToPath } from 'node:url';
19
+ import { injectable } from 'tsyringe';
10
20
  import { DEFAULT_VERSION_INFO } from '../../domain/value-objects/version-info.js';
11
21
  /**
12
22
  * Find package.json by traversing up from a starting directory.
@@ -30,7 +40,7 @@ function findPackageJson(startDir) {
30
40
  /**
31
41
  * Service for reading version information from package.json
32
42
  */
33
- export class VersionService {
43
+ let VersionService = class VersionService {
34
44
  versionInfo;
35
45
  constructor() {
36
46
  this.versionInfo = this.loadVersionInfo();
@@ -72,7 +82,12 @@ export class VersionService {
72
82
  getVersion() {
73
83
  return this.versionInfo;
74
84
  }
75
- }
85
+ };
86
+ VersionService = __decorate([
87
+ injectable(),
88
+ __metadata("design:paramtypes", [])
89
+ ], VersionService);
90
+ export { VersionService };
76
91
  /**
77
92
  * Set version info as NEXT_PUBLIC environment variables.
78
93
  * Must be called BEFORE starting the Next.js web server
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import next from 'next';
12
12
  import http from 'node:http';
13
+ import type { IWebServerService } from '../../application/ports/output/web-server-service.interface.js';
13
14
  export interface WebServerDeps {
14
15
  createNextApp: typeof next;
15
16
  createHttpServer: typeof http.createServer;
@@ -22,7 +23,7 @@ export declare function resolveWebDir(): {
22
23
  dir: string;
23
24
  dev: boolean;
24
25
  };
25
- export declare class WebServerService {
26
+ export declare class WebServerService implements IWebServerService {
26
27
  private app;
27
28
  private server;
28
29
  private isShuttingDown;
@@ -1 +1 @@
1
- {"version":3,"file":"web-server.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/web-server.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,WAAW,CAAC;AAM7B,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,IAAI,CAAC;IAC3B,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC;CAC5C;AAOD;;;GAGG;AACH,wBAAgB,aAAa,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAiB7D;AAED,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;gBAEzB,IAAI,GAAE,OAAO,CAAC,aAAa,CAAM;IAI7C;;;;;OAKG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB5B"}
1
+ {"version":3,"file":"web-server.service.d.ts","sourceRoot":"","sources":["../../../../src/infrastructure/services/web-server.service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,IAAI,MAAM,WAAW,CAAC;AAG7B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gEAAgE,CAAC;AAIxG,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,OAAO,IAAI,CAAC;IAC3B,gBAAgB,EAAE,OAAO,IAAI,CAAC,YAAY,CAAC;CAC5C;AAOD;;;GAGG;AACH,wBAAgB,aAAa,IAAI;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,OAAO,CAAA;CAAE,CAiB7D;AAED,qBACa,gBAAiB,YAAW,iBAAiB;IACxD,OAAO,CAAC,GAAG,CAAwB;IACnC,OAAO,CAAC,MAAM,CAA4B;IAC1C,OAAO,CAAC,cAAc,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAgB;gBAEzB,IAAI,GAAE,OAAO,CAAC,aAAa,CAAM;IAI7C;;;;;OAKG;IACG,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,UAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BjE;;OAEG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;CAoB5B"}
@@ -8,6 +8,16 @@
8
8
  * Supports both development (dev: true) and production (dev: false) modes.
9
9
  * In production mode, Next.js serves the pre-built .next output.
10
10
  */
11
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
12
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
13
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
14
+ 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;
15
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
16
+ };
17
+ var __metadata = (this && this.__metadata) || function (k, v) {
18
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
19
+ };
20
+ import { injectable } from 'tsyringe';
11
21
  import next from 'next';
12
22
  import http from 'node:http';
13
23
  import path from 'node:path';
@@ -34,7 +44,7 @@ export function resolveWebDir() {
34
44
  }
35
45
  throw new Error('Web UI directory not found. Ensure the web UI is built (pnpm build:web).');
36
46
  }
37
- export class WebServerService {
47
+ let WebServerService = class WebServerService {
38
48
  app = null;
39
49
  server = null;
40
50
  isShuttingDown = false;
@@ -92,4 +102,9 @@ export class WebServerService {
92
102
  this.isShuttingDown = false;
93
103
  }
94
104
  }
95
- }
105
+ };
106
+ WebServerService = __decorate([
107
+ injectable(),
108
+ __metadata("design:paramtypes", [Object])
109
+ ], WebServerService);
110
+ export { WebServerService };
@@ -1 +1 @@
1
- {"version":3,"file":"ui.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ui.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AAoB1D;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAqDzC"}
1
+ {"version":3,"file":"ui.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/ui.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;AAiB1D;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAqDzC"}
@@ -16,8 +16,9 @@
16
16
  */
17
17
  import { Command, InvalidArgumentError } from 'commander';
18
18
  import { findAvailablePort, DEFAULT_PORT } from '../../../infrastructure/services/port.service.js';
19
- import { VersionService, setVersionEnvVars, } from '../../../infrastructure/services/version.service.js';
20
- import { WebServerService, resolveWebDir, } from '../../../infrastructure/services/web-server.service.js';
19
+ import { container } from '../../../infrastructure/di/container.js';
20
+ import { setVersionEnvVars } from '../../../infrastructure/services/version.service.js';
21
+ import { resolveWebDir } from '../../../infrastructure/services/web-server.service.js';
21
22
  import { colors, fmt, messages } from '../ui/index.js';
22
23
  function parsePort(value) {
23
24
  const port = parseInt(value, 10);
@@ -43,13 +44,13 @@ Examples:
43
44
  const port = await findAvailablePort(startPort);
44
45
  const { dir, dev } = resolveWebDir();
45
46
  // Set version env vars so Next.js web UI can read them
46
- const versionService = new VersionService();
47
+ const versionService = container.resolve('IVersionService');
47
48
  setVersionEnvVars(versionService.getVersion());
48
49
  messages.newline();
49
50
  console.log(fmt.heading('Shep Web UI'));
50
51
  console.log(colors.muted(`Starting web server${dev ? ' (dev mode)' : ''}...`));
51
52
  messages.newline();
52
- const service = new WebServerService();
53
+ const service = container.resolve('IWebServerService');
53
54
  await service.start(port, dir, dev);
54
55
  messages.success(`Server ready at ${fmt.code(`http://localhost:${port}`)}`);
55
56
  messages.info('Press Ctrl+C to stop');
@@ -1 +1 @@
1
- {"version":3,"file":"version.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/version.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAIpC;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAa9C"}
1
+ {"version":3,"file":"version.command.d.ts","sourceRoot":"","sources":["../../../../../src/presentation/cli/commands/version.command.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,OAAO,CAa9C"}
@@ -15,14 +15,14 @@
15
15
  * Platform: linux x64
16
16
  */
17
17
  import { Command } from 'commander';
18
- import { VersionService } from '../../../infrastructure/services/version.service.js';
18
+ import { container } from '../../../infrastructure/di/container.js';
19
19
  import { colors, fmt, messages } from '../ui/index.js';
20
20
  /**
21
21
  * Create the version command
22
22
  */
23
23
  export function createVersionCommand() {
24
24
  return new Command('version').description('Display version information').action(() => {
25
- const versionService = new VersionService();
25
+ const versionService = container.resolve('IVersionService');
26
26
  const info = versionService.getVersion();
27
27
  messages.newline();
28
28
  console.log(`${fmt.heading(info.name)} ${fmt.version(info.version)}`);
@@ -20,7 +20,6 @@
20
20
  // IMPORTANT: reflect-metadata must be imported first for tsyringe DI
21
21
  import 'reflect-metadata';
22
22
  import { Command } from 'commander';
23
- import { VersionService } from '../../infrastructure/services/version.service.js';
24
23
  import { createVersionCommand } from './commands/version.command.js';
25
24
  import { createSettingsCommand } from './commands/settings/index.js';
26
25
  import { createUiCommand } from './commands/ui.command.js';
@@ -56,7 +55,7 @@ async function bootstrap() {
56
55
  throw error;
57
56
  }
58
57
  // Step 3: Set up Commander CLI
59
- const versionService = new VersionService();
58
+ const versionService = container.resolve('IVersionService');
60
59
  const { version, description } = versionService.getVersion();
61
60
  const program = new Command()
62
61
  .name('shep')