claudeship 0.2.11 → 0.2.14

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 (119) hide show
  1. package/apps/server/dist/app.module.js +8 -0
  2. package/apps/server/dist/app.module.js.map +1 -1
  3. package/apps/server/dist/chat/prompts/fullstack-express-prompt.d.ts +1 -1
  4. package/apps/server/dist/chat/prompts/fullstack-express-prompt.js +110 -1
  5. package/apps/server/dist/chat/prompts/fullstack-express-prompt.js.map +1 -1
  6. package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.d.ts +1 -1
  7. package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js +110 -1
  8. package/apps/server/dist/chat/prompts/fullstack-fastapi-prompt.js.map +1 -1
  9. package/apps/server/dist/chat/prompts/web-system-prompt.d.ts +1 -1
  10. package/apps/server/dist/chat/prompts/web-system-prompt.js +157 -0
  11. package/apps/server/dist/chat/prompts/web-system-prompt.js.map +1 -1
  12. package/apps/server/dist/checkpoint/checkpoint.controller.d.ts +19 -0
  13. package/apps/server/dist/checkpoint/checkpoint.controller.js +93 -0
  14. package/apps/server/dist/checkpoint/checkpoint.controller.js.map +1 -0
  15. package/apps/server/dist/checkpoint/checkpoint.module.d.ts +2 -0
  16. package/apps/server/dist/checkpoint/checkpoint.module.js +25 -0
  17. package/apps/server/dist/checkpoint/checkpoint.module.js.map +1 -0
  18. package/apps/server/dist/checkpoint/checkpoint.service.d.ts +41 -0
  19. package/apps/server/dist/checkpoint/checkpoint.service.js +261 -0
  20. package/apps/server/dist/checkpoint/checkpoint.service.js.map +1 -0
  21. package/apps/server/dist/database/database.controller.d.ts +23 -0
  22. package/apps/server/dist/database/database.controller.js +109 -0
  23. package/apps/server/dist/database/database.controller.js.map +1 -0
  24. package/apps/server/dist/database/database.module.d.ts +2 -0
  25. package/apps/server/dist/database/database.module.js +25 -0
  26. package/apps/server/dist/database/database.module.js.map +1 -0
  27. package/apps/server/dist/database/database.service.d.ts +32 -0
  28. package/apps/server/dist/database/database.service.js +238 -0
  29. package/apps/server/dist/database/database.service.js.map +1 -0
  30. package/apps/server/dist/preview/preview.controller.d.ts +5 -0
  31. package/apps/server/dist/preview/preview.controller.js +41 -0
  32. package/apps/server/dist/preview/preview.controller.js.map +1 -1
  33. package/apps/server/dist/preview/preview.service.d.ts +20 -0
  34. package/apps/server/dist/preview/preview.service.js +51 -2
  35. package/apps/server/dist/preview/preview.service.js.map +1 -1
  36. package/apps/server/dist/project/project.controller.d.ts +10 -1
  37. package/apps/server/dist/project/project.controller.js +57 -0
  38. package/apps/server/dist/project/project.controller.js.map +1 -1
  39. package/apps/server/dist/project/project.service.d.ts +15 -0
  40. package/apps/server/dist/project/project.service.js +111 -0
  41. package/apps/server/dist/project/project.service.js.map +1 -1
  42. package/apps/server/dist/project-context/project-context.controller.d.ts +42 -0
  43. package/apps/server/dist/project-context/project-context.controller.js +127 -0
  44. package/apps/server/dist/project-context/project-context.controller.js.map +1 -0
  45. package/apps/server/dist/project-context/project-context.module.d.ts +2 -0
  46. package/apps/server/dist/project-context/project-context.module.js +25 -0
  47. package/apps/server/dist/project-context/project-context.module.js.map +1 -0
  48. package/apps/server/dist/project-context/project-context.service.d.ts +36 -0
  49. package/apps/server/dist/project-context/project-context.service.js +260 -0
  50. package/apps/server/dist/project-context/project-context.service.js.map +1 -0
  51. package/apps/server/dist/testing/testing.controller.d.ts +24 -0
  52. package/apps/server/dist/testing/testing.controller.js +126 -0
  53. package/apps/server/dist/testing/testing.controller.js.map +1 -0
  54. package/apps/server/dist/testing/testing.module.d.ts +2 -0
  55. package/apps/server/dist/testing/testing.module.js +26 -0
  56. package/apps/server/dist/testing/testing.module.js.map +1 -0
  57. package/apps/server/dist/testing/testing.service.d.ts +62 -0
  58. package/apps/server/dist/testing/testing.service.js +269 -0
  59. package/apps/server/dist/testing/testing.service.js.map +1 -0
  60. package/apps/server/dist/tsconfig.tsbuildinfo +1 -1
  61. package/apps/server/package.json +1 -1
  62. package/apps/web/.next/BUILD_ID +1 -1
  63. package/apps/web/.next/app-build-manifest.json +7 -7
  64. package/apps/web/.next/app-path-routes-manifest.json +2 -2
  65. package/apps/web/.next/build-manifest.json +2 -2
  66. package/apps/web/.next/cache/.previewinfo +1 -1
  67. package/apps/web/.next/cache/.rscinfo +1 -1
  68. package/apps/web/.next/cache/.tsbuildinfo +1 -1
  69. package/apps/web/.next/cache/config.json +3 -3
  70. package/apps/web/.next/cache/eslint/.cache_j3uhuz +1 -1
  71. package/apps/web/.next/cache/webpack/client-production/0.pack +0 -0
  72. package/apps/web/.next/cache/webpack/client-production/index.pack +0 -0
  73. package/apps/web/.next/cache/webpack/edge-server-production/index.pack +0 -0
  74. package/apps/web/.next/cache/webpack/server-production/0.pack +0 -0
  75. package/apps/web/.next/cache/webpack/server-production/index.pack +0 -0
  76. package/apps/web/.next/prerender-manifest.json +13 -13
  77. package/apps/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  78. package/apps/web/.next/server/app/_not-found.html +1 -1
  79. package/apps/web/.next/server/app/_not-found.rsc +2 -2
  80. package/apps/web/.next/server/app/index.html +1 -1
  81. package/apps/web/.next/server/app/index.rsc +3 -3
  82. package/apps/web/.next/server/app/page.js +2 -2
  83. package/apps/web/.next/server/app/page_client-reference-manifest.js +1 -1
  84. package/apps/web/.next/server/app/project/[id]/page.js +2 -2
  85. package/apps/web/.next/server/app/project/[id]/page_client-reference-manifest.js +1 -1
  86. package/apps/web/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  87. package/apps/web/.next/server/app/settings.html +1 -1
  88. package/apps/web/.next/server/app/settings.rsc +3 -3
  89. package/apps/web/.next/server/app-paths-manifest.json +2 -2
  90. package/apps/web/.next/server/chunks/392.js +1 -1
  91. package/apps/web/.next/server/pages/404.html +1 -1
  92. package/apps/web/.next/server/pages/500.html +1 -1
  93. package/apps/web/.next/server/server-reference-manifest.json +1 -1
  94. package/apps/web/.next/static/chunks/712-11fca77fb30a2a06.js +1 -0
  95. package/apps/web/.next/static/chunks/app/page-0db1c152fbd48359.js +1 -0
  96. package/apps/web/.next/static/chunks/app/project/[id]/page-7c44ae18c8984726.js +1 -0
  97. package/apps/web/.next/static/chunks/app/settings/page-d1318c2fd58729a5.js +1 -0
  98. package/apps/web/.next/static/css/d0f1b036f222bc16.css +3 -0
  99. package/apps/web/.next/trace +18 -17
  100. package/apps/web/node_modules/.bin/eslint +2 -2
  101. package/apps/web/package.json +2 -1
  102. package/apps/web/src/components/checkpoint/CheckpointPanel.tsx +384 -0
  103. package/apps/web/src/components/database/DatabasePanel.tsx +405 -0
  104. package/apps/web/src/components/env/EnvPanel.tsx +356 -0
  105. package/apps/web/src/components/preview/ConsoleViewer.tsx +270 -0
  106. package/apps/web/src/components/preview/ErrorOverlay.tsx +189 -0
  107. package/apps/web/src/components/preview/PreviewPanel.tsx +148 -6
  108. package/apps/web/src/components/testing/TestRunner.tsx +481 -0
  109. package/apps/web/src/components/ui/tabs.tsx +55 -0
  110. package/apps/web/src/components/visual-editor/VisualEditor.tsx +382 -0
  111. package/apps/web/src/lib/api.ts +5 -2
  112. package/package.json +1 -1
  113. package/apps/web/.next/static/chunks/298-6f3d6b321c288cd3.js +0 -1
  114. package/apps/web/.next/static/chunks/app/page-3d093f7f480a8599.js +0 -1
  115. package/apps/web/.next/static/chunks/app/project/[id]/page-e5cda6f9050b0a52.js +0 -1
  116. package/apps/web/.next/static/chunks/app/settings/page-92d28565c3d8c755.js +0 -1
  117. package/apps/web/.next/static/css/8f946046a2047594.css +0 -3
  118. /package/apps/web/.next/static/{zw4FcukMOho6_dzgpEdNW → tV_Qc76rupeogXvWEMw6p}/_buildManifest.js +0 -0
  119. /package/apps/web/.next/static/{zw4FcukMOho6_dzgpEdNW → tV_Qc76rupeogXvWEMw6p}/_ssgManifest.js +0 -0
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ProjectContextModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const project_context_service_1 = require("./project-context.service");
12
+ const project_context_controller_1 = require("./project-context.controller");
13
+ const project_module_1 = require("../project/project.module");
14
+ let ProjectContextModule = class ProjectContextModule {
15
+ };
16
+ exports.ProjectContextModule = ProjectContextModule;
17
+ exports.ProjectContextModule = ProjectContextModule = __decorate([
18
+ (0, common_1.Module)({
19
+ imports: [project_module_1.ProjectModule],
20
+ controllers: [project_context_controller_1.ProjectContextController],
21
+ providers: [project_context_service_1.ProjectContextService],
22
+ exports: [project_context_service_1.ProjectContextService],
23
+ })
24
+ ], ProjectContextModule);
25
+ //# sourceMappingURL=project-context.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-context.module.js","sourceRoot":"","sources":["../../src/project-context/project-context.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,uEAAkE;AAClE,6EAAwE;AACxE,8DAA0D;AAQnD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAAG,CAAA;AAAvB,oDAAoB;+BAApB,oBAAoB;IANhC,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,CAAC;QACxB,WAAW,EAAE,CAAC,qDAAwB,CAAC;QACvC,SAAS,EAAE,CAAC,+CAAqB,CAAC;QAClC,OAAO,EAAE,CAAC,+CAAqB,CAAC;KACjC,CAAC;GACW,oBAAoB,CAAG"}
@@ -0,0 +1,36 @@
1
+ import { ProjectService } from "../project/project.service";
2
+ export interface ProjectContext {
3
+ name: string;
4
+ overview: string;
5
+ techStack: {
6
+ frontend: string[];
7
+ backend: string[];
8
+ database: string[];
9
+ };
10
+ designDirection: {
11
+ style: string;
12
+ colorScheme: string;
13
+ tone: string;
14
+ };
15
+ coreFeatures: string[];
16
+ codingConventions: {
17
+ components: string;
18
+ functions: string;
19
+ files: string;
20
+ };
21
+ agentInstructions: string[];
22
+ }
23
+ export declare class ProjectContextService {
24
+ private projectService;
25
+ constructor(projectService: ProjectService);
26
+ getContext(projectId: string): Promise<string | null>;
27
+ getContextParsed(projectId: string): Promise<ProjectContext | null>;
28
+ createContext(projectId: string, content?: string): Promise<string>;
29
+ updateContext(projectId: string, content: string): Promise<string>;
30
+ deleteContext(projectId: string): Promise<void>;
31
+ hasContext(projectId: string): Promise<boolean>;
32
+ private parseProjectMd;
33
+ private parseListItems;
34
+ getDefaultTemplate(): string;
35
+ generateContextFromProject(name: string, projectType: string, backendFramework: string | null, description?: string): string;
36
+ }
@@ -0,0 +1,260 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.ProjectContextService = void 0;
13
+ const common_1 = require("@nestjs/common");
14
+ const project_service_1 = require("../project/project.service");
15
+ const fs = require("fs/promises");
16
+ const path = require("path");
17
+ const CONTEXT_FILENAME = "PROJECT.md";
18
+ const DEFAULT_CONTEXT_TEMPLATE = `# Project Name
19
+
20
+ ## Overview
21
+ [Project description]
22
+
23
+ ## Tech Stack
24
+ - Frontend: Next.js 15, TypeScript, Tailwind CSS
25
+ - Backend: Express, Prisma, SQLite
26
+ - Auth: NextAuth.js
27
+
28
+ ## Design Direction
29
+ - Style: Minimal, Clean
30
+ - Color Scheme: Blue-based primary
31
+ - Tone: Professional, Trustworthy
32
+
33
+ ## Core Features
34
+ 1. User Authentication
35
+ 2. Dashboard
36
+ 3. ...
37
+
38
+ ## Coding Conventions
39
+ - Components: PascalCase
40
+ - Functions: camelCase
41
+ - Files: kebab-case
42
+
43
+ ## Agent Instructions
44
+ - Respond in Korean
45
+ - Request confirmation at each step
46
+ - Use shadcn/ui components
47
+ `;
48
+ let ProjectContextService = class ProjectContextService {
49
+ constructor(projectService) {
50
+ this.projectService = projectService;
51
+ }
52
+ async getContext(projectId) {
53
+ const projectPath = await this.projectService.getProjectPath(projectId);
54
+ const contextPath = path.join(projectPath, CONTEXT_FILENAME);
55
+ try {
56
+ const content = await fs.readFile(contextPath, "utf-8");
57
+ return content;
58
+ }
59
+ catch {
60
+ return null;
61
+ }
62
+ }
63
+ async getContextParsed(projectId) {
64
+ const content = await this.getContext(projectId);
65
+ if (!content)
66
+ return null;
67
+ return this.parseProjectMd(content);
68
+ }
69
+ async createContext(projectId, content) {
70
+ const projectPath = await this.projectService.getProjectPath(projectId);
71
+ const contextPath = path.join(projectPath, CONTEXT_FILENAME);
72
+ const finalContent = content || DEFAULT_CONTEXT_TEMPLATE;
73
+ await fs.writeFile(contextPath, finalContent, "utf-8");
74
+ return finalContent;
75
+ }
76
+ async updateContext(projectId, content) {
77
+ const projectPath = await this.projectService.getProjectPath(projectId);
78
+ const contextPath = path.join(projectPath, CONTEXT_FILENAME);
79
+ try {
80
+ await fs.access(contextPath);
81
+ }
82
+ catch {
83
+ throw new common_1.NotFoundException(`PROJECT.md not found for project ${projectId}`);
84
+ }
85
+ await fs.writeFile(contextPath, content, "utf-8");
86
+ return content;
87
+ }
88
+ async deleteContext(projectId) {
89
+ const projectPath = await this.projectService.getProjectPath(projectId);
90
+ const contextPath = path.join(projectPath, CONTEXT_FILENAME);
91
+ try {
92
+ await fs.unlink(contextPath);
93
+ }
94
+ catch {
95
+ throw new common_1.NotFoundException(`PROJECT.md not found for project ${projectId}`);
96
+ }
97
+ }
98
+ async hasContext(projectId) {
99
+ const projectPath = await this.projectService.getProjectPath(projectId);
100
+ const contextPath = path.join(projectPath, CONTEXT_FILENAME);
101
+ try {
102
+ await fs.access(contextPath);
103
+ return true;
104
+ }
105
+ catch {
106
+ return false;
107
+ }
108
+ }
109
+ parseProjectMd(content) {
110
+ const lines = content.split("\n");
111
+ const context = {
112
+ name: "",
113
+ overview: "",
114
+ techStack: { frontend: [], backend: [], database: [] },
115
+ designDirection: { style: "", colorScheme: "", tone: "" },
116
+ coreFeatures: [],
117
+ codingConventions: { components: "", functions: "", files: "" },
118
+ agentInstructions: [],
119
+ };
120
+ let currentSection = "";
121
+ let currentContent = [];
122
+ const processSection = () => {
123
+ const text = currentContent.join("\n").trim();
124
+ switch (currentSection.toLowerCase()) {
125
+ case "overview":
126
+ context.overview = text;
127
+ break;
128
+ case "tech stack":
129
+ for (const line of currentContent) {
130
+ if (line.toLowerCase().includes("frontend:")) {
131
+ context.techStack.frontend = this.parseListItems(line.split(":")[1] || "");
132
+ }
133
+ else if (line.toLowerCase().includes("backend:")) {
134
+ context.techStack.backend = this.parseListItems(line.split(":")[1] || "");
135
+ }
136
+ else if (line.toLowerCase().includes("database:") || line.toLowerCase().includes("db:")) {
137
+ context.techStack.database = this.parseListItems(line.split(":")[1] || "");
138
+ }
139
+ }
140
+ break;
141
+ case "design direction":
142
+ for (const line of currentContent) {
143
+ if (line.toLowerCase().includes("style:")) {
144
+ context.designDirection.style = line.split(":")[1]?.trim() || "";
145
+ }
146
+ else if (line.toLowerCase().includes("color")) {
147
+ context.designDirection.colorScheme = line.split(":")[1]?.trim() || "";
148
+ }
149
+ else if (line.toLowerCase().includes("tone:")) {
150
+ context.designDirection.tone = line.split(":")[1]?.trim() || "";
151
+ }
152
+ }
153
+ break;
154
+ case "core features":
155
+ context.coreFeatures = currentContent
156
+ .filter(line => line.match(/^\s*\d+\./))
157
+ .map(line => line.replace(/^\s*\d+\.\s*/, "").trim());
158
+ break;
159
+ case "coding conventions":
160
+ for (const line of currentContent) {
161
+ if (line.toLowerCase().includes("component")) {
162
+ context.codingConventions.components = line.split(":")[1]?.trim() || "";
163
+ }
164
+ else if (line.toLowerCase().includes("function")) {
165
+ context.codingConventions.functions = line.split(":")[1]?.trim() || "";
166
+ }
167
+ else if (line.toLowerCase().includes("file")) {
168
+ context.codingConventions.files = line.split(":")[1]?.trim() || "";
169
+ }
170
+ }
171
+ break;
172
+ case "agent instructions":
173
+ context.agentInstructions = currentContent
174
+ .filter(line => line.match(/^\s*-/))
175
+ .map(line => line.replace(/^\s*-\s*/, "").trim());
176
+ break;
177
+ }
178
+ };
179
+ for (const line of lines) {
180
+ if (line.startsWith("# ") && !context.name) {
181
+ context.name = line.replace("# ", "").trim();
182
+ continue;
183
+ }
184
+ if (line.startsWith("## ")) {
185
+ if (currentSection) {
186
+ processSection();
187
+ }
188
+ currentSection = line.replace("## ", "").trim();
189
+ currentContent = [];
190
+ continue;
191
+ }
192
+ if (currentSection && line.trim()) {
193
+ currentContent.push(line);
194
+ }
195
+ }
196
+ if (currentSection) {
197
+ processSection();
198
+ }
199
+ return context;
200
+ }
201
+ parseListItems(text) {
202
+ return text
203
+ .split(",")
204
+ .map(item => item.trim())
205
+ .filter(item => item.length > 0);
206
+ }
207
+ getDefaultTemplate() {
208
+ return DEFAULT_CONTEXT_TEMPLATE;
209
+ }
210
+ generateContextFromProject(name, projectType, backendFramework, description) {
211
+ const isFullstack = backendFramework && backendFramework !== "NONE";
212
+ let techStack = "";
213
+ if (projectType === "WEB") {
214
+ techStack = "- Frontend: Next.js 15, TypeScript, Tailwind CSS, shadcn/ui";
215
+ if (isFullstack) {
216
+ if (backendFramework === "EXPRESS") {
217
+ techStack += "\n- Backend: Express, Prisma, SQLite";
218
+ }
219
+ else if (backendFramework === "FASTAPI") {
220
+ techStack += "\n- Backend: FastAPI, SQLAlchemy, SQLite";
221
+ }
222
+ }
223
+ }
224
+ return `# ${name}
225
+
226
+ ## Overview
227
+ ${description || "[Project description]"}
228
+
229
+ ## Tech Stack
230
+ ${techStack}
231
+
232
+ ## Design Direction
233
+ - Style: Minimal, Clean
234
+ - Color Scheme: Blue-based primary
235
+ - Tone: Professional, Modern
236
+
237
+ ## Core Features
238
+ 1. [Feature 1]
239
+ 2. [Feature 2]
240
+ 3. [Feature 3]
241
+
242
+ ## Coding Conventions
243
+ - Components: PascalCase
244
+ - Functions: camelCase
245
+ - Files: kebab-case
246
+
247
+ ## Agent Instructions
248
+ - Respond in Korean
249
+ - Request confirmation at each step
250
+ - Use shadcn/ui components
251
+ - Follow incremental building strategy
252
+ `;
253
+ }
254
+ };
255
+ exports.ProjectContextService = ProjectContextService;
256
+ exports.ProjectContextService = ProjectContextService = __decorate([
257
+ (0, common_1.Injectable)(),
258
+ __metadata("design:paramtypes", [project_service_1.ProjectService])
259
+ ], ProjectContextService);
260
+ //# sourceMappingURL=project-context.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-context.service.js","sourceRoot":"","sources":["../../src/project-context/project-context.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA+D;AAC/D,gEAA4D;AAC5D,kCAAkC;AAClC,6BAA6B;AAwB7B,MAAM,gBAAgB,GAAG,YAAY,CAAC;AAEtC,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6BhC,CAAC;AAGK,IAAM,qBAAqB,GAA3B,MAAM,qBAAqB;IAChC,YAAoB,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAEtD,KAAK,CAAC,UAAU,CAAC,SAAiB;QAChC,MAAM,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,SAAS,GAAG,6DAA6D,CAAC;YAC1E,IAAI,WAAW,EAAE,CAAC;gBAChB,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;oBACnC,SAAS,IAAI,sCAAsC,CAAC;gBACtD,CAAC;qBAAM,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;oBAC1C,SAAS,IAAI,0CAA0C,CAAC;gBAC1D,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,KAAK,IAAI;;;EAGlB,WAAW,IAAI,uBAAuB;;;EAGtC,SAAS;;;;;;;;;;;;;;;;;;;;;;CAsBV,CAAC;IACA,CAAC;CACF,CAAA;AA3OY,sDAAqB;gCAArB,qBAAqB;IADjC,IAAA,mBAAU,GAAE;qCAEyB,gCAAc;GADvC,qBAAqB,CA2OjC"}
@@ -0,0 +1,24 @@
1
+ import { MessageEvent } from "@nestjs/common";
2
+ import { Response } from "express";
3
+ import { Observable } from "rxjs";
4
+ import { TestingService, TestStep } from "./testing.service";
5
+ export declare class TestingController {
6
+ private readonly testingService;
7
+ constructor(testingService: TestingService);
8
+ getScenarios(projectId: string): Promise<import("./testing.service").TestScenario[]>;
9
+ getScenario(projectId: string, scenarioId: string): Promise<import("./testing.service").TestScenario>;
10
+ createScenario(projectId: string, body: {
11
+ name: string;
12
+ steps: TestStep[];
13
+ }): Promise<import("./testing.service").TestScenario>;
14
+ updateScenario(projectId: string, scenarioId: string, body: {
15
+ name: string;
16
+ steps: TestStep[];
17
+ }): Promise<import("./testing.service").TestScenario>;
18
+ deleteScenario(projectId: string, scenarioId: string): Promise<void>;
19
+ runScenario(projectId: string, scenarioId: string): Promise<import("./testing.service").TestResult>;
20
+ stopScenario(scenarioId: string): {
21
+ success: boolean;
22
+ };
23
+ streamTestEvents(projectId: string, res: Response): Observable<MessageEvent>;
24
+ }
@@ -0,0 +1,126 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.TestingController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const rxjs_1 = require("rxjs");
18
+ const testing_service_1 = require("./testing.service");
19
+ let TestingController = class TestingController {
20
+ constructor(testingService) {
21
+ this.testingService = testingService;
22
+ }
23
+ getScenarios(projectId) {
24
+ return this.testingService.getScenarios(projectId);
25
+ }
26
+ getScenario(projectId, scenarioId) {
27
+ return this.testingService.getScenario(projectId, scenarioId);
28
+ }
29
+ createScenario(projectId, body) {
30
+ return this.testingService.createScenario(projectId, body.name, body.steps);
31
+ }
32
+ updateScenario(projectId, scenarioId, body) {
33
+ return this.testingService.updateScenario(projectId, scenarioId, body.name, body.steps);
34
+ }
35
+ deleteScenario(projectId, scenarioId) {
36
+ return this.testingService.deleteScenario(projectId, scenarioId);
37
+ }
38
+ runScenario(projectId, scenarioId) {
39
+ return this.testingService.runScenario(projectId, scenarioId);
40
+ }
41
+ stopScenario(scenarioId) {
42
+ this.testingService.stopTest(scenarioId);
43
+ return { success: true };
44
+ }
45
+ streamTestEvents(projectId, res) {
46
+ const closeSubject = new rxjs_1.Subject();
47
+ res.on("close", () => {
48
+ closeSubject.next();
49
+ closeSubject.complete();
50
+ });
51
+ const heartbeat$ = (0, rxjs_1.interval)(30000).pipe((0, rxjs_1.map)(() => ({ data: { type: "heartbeat", timestamp: Date.now() } })));
52
+ const events$ = this.testingService.getTestStream(projectId).pipe((0, rxjs_1.map)((event) => ({
53
+ data: event,
54
+ })));
55
+ return (0, rxjs_1.merge)(heartbeat$, events$).pipe((0, rxjs_1.takeUntil)(closeSubject), (0, rxjs_1.map)((event) => ({ data: JSON.stringify(event.data) })));
56
+ }
57
+ };
58
+ exports.TestingController = TestingController;
59
+ __decorate([
60
+ (0, common_1.Get)("scenarios"),
61
+ __param(0, (0, common_1.Param)("projectId")),
62
+ __metadata("design:type", Function),
63
+ __metadata("design:paramtypes", [String]),
64
+ __metadata("design:returntype", void 0)
65
+ ], TestingController.prototype, "getScenarios", null);
66
+ __decorate([
67
+ (0, common_1.Get)("scenarios/:scenarioId"),
68
+ __param(0, (0, common_1.Param)("projectId")),
69
+ __param(1, (0, common_1.Param)("scenarioId")),
70
+ __metadata("design:type", Function),
71
+ __metadata("design:paramtypes", [String, String]),
72
+ __metadata("design:returntype", void 0)
73
+ ], TestingController.prototype, "getScenario", null);
74
+ __decorate([
75
+ (0, common_1.Post)("scenarios"),
76
+ __param(0, (0, common_1.Param)("projectId")),
77
+ __param(1, (0, common_1.Body)()),
78
+ __metadata("design:type", Function),
79
+ __metadata("design:paramtypes", [String, Object]),
80
+ __metadata("design:returntype", void 0)
81
+ ], TestingController.prototype, "createScenario", null);
82
+ __decorate([
83
+ (0, common_1.Put)("scenarios/:scenarioId"),
84
+ __param(0, (0, common_1.Param)("projectId")),
85
+ __param(1, (0, common_1.Param)("scenarioId")),
86
+ __param(2, (0, common_1.Body)()),
87
+ __metadata("design:type", Function),
88
+ __metadata("design:paramtypes", [String, String, Object]),
89
+ __metadata("design:returntype", void 0)
90
+ ], TestingController.prototype, "updateScenario", null);
91
+ __decorate([
92
+ (0, common_1.Delete)("scenarios/:scenarioId"),
93
+ __param(0, (0, common_1.Param)("projectId")),
94
+ __param(1, (0, common_1.Param)("scenarioId")),
95
+ __metadata("design:type", Function),
96
+ __metadata("design:paramtypes", [String, String]),
97
+ __metadata("design:returntype", void 0)
98
+ ], TestingController.prototype, "deleteScenario", null);
99
+ __decorate([
100
+ (0, common_1.Post)("scenarios/:scenarioId/run"),
101
+ __param(0, (0, common_1.Param)("projectId")),
102
+ __param(1, (0, common_1.Param)("scenarioId")),
103
+ __metadata("design:type", Function),
104
+ __metadata("design:paramtypes", [String, String]),
105
+ __metadata("design:returntype", void 0)
106
+ ], TestingController.prototype, "runScenario", null);
107
+ __decorate([
108
+ (0, common_1.Post)("scenarios/:scenarioId/stop"),
109
+ __param(0, (0, common_1.Param)("scenarioId")),
110
+ __metadata("design:type", Function),
111
+ __metadata("design:paramtypes", [String]),
112
+ __metadata("design:returntype", void 0)
113
+ ], TestingController.prototype, "stopScenario", null);
114
+ __decorate([
115
+ (0, common_1.Sse)("stream"),
116
+ __param(0, (0, common_1.Param)("projectId")),
117
+ __param(1, (0, common_1.Res)()),
118
+ __metadata("design:type", Function),
119
+ __metadata("design:paramtypes", [String, Object]),
120
+ __metadata("design:returntype", rxjs_1.Observable)
121
+ ], TestingController.prototype, "streamTestEvents", null);
122
+ exports.TestingController = TestingController = __decorate([
123
+ (0, common_1.Controller)("projects/:projectId/testing"),
124
+ __metadata("design:paramtypes", [testing_service_1.TestingService])
125
+ ], TestingController);
126
+ //# sourceMappingURL=testing.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.controller.js","sourceRoot":"","sources":["../../src/testing/testing.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAWwB;AAExB,+BAA4E;AAC5E,uDAAwE;AAGjE,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,YAA6B,cAA8B;QAA9B,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAG/D,YAAY,CAAqB,SAAiB;QAChD,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IACrD,CAAC;IAGD,WAAW,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AC,uBAAuB,CAAC;IAE7B,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;uDAGrB;AAGD;IADC,IAAA,aAAI,EAAC,2BAA2B,CAAC;IAE/B,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;oDAGrB;AAGD;IADC,IAAA,aAAI,EAAC,4BAA4B,CAAC;IACrB,WAAA,IAAA,cAAK,EAAC,YAAY,CAAC,CAAA;;;;qDAGhC;AAGD;IADC,IAAA,YAAG,EAAC,QAAQ,CAAC;IAEX,WAAA,IAAA,cAAK,EAAC,WAAW,CAAC,CAAA;IAClB,WAAA,IAAA,YAAG,GAAE,CAAA;;;oCACL,iBAAU;yDAwBZ;4BAxFU,iBAAiB;IAD7B,IAAA,mBAAU,EAAC,6BAA6B,CAAC;qCAEK,gCAAc;GADhD,iBAAiB,CAyF7B"}
@@ -0,0 +1,2 @@
1
+ export declare class TestingModule {
2
+ }
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ 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;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.TestingModule = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const testing_controller_1 = require("./testing.controller");
12
+ const testing_service_1 = require("./testing.service");
13
+ const project_module_1 = require("../project/project.module");
14
+ const preview_module_1 = require("../preview/preview.module");
15
+ let TestingModule = class TestingModule {
16
+ };
17
+ exports.TestingModule = TestingModule;
18
+ exports.TestingModule = TestingModule = __decorate([
19
+ (0, common_1.Module)({
20
+ imports: [project_module_1.ProjectModule, preview_module_1.PreviewModule],
21
+ controllers: [testing_controller_1.TestingController],
22
+ providers: [testing_service_1.TestingService],
23
+ exports: [testing_service_1.TestingService],
24
+ })
25
+ ], TestingModule);
26
+ //# sourceMappingURL=testing.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing.module.js","sourceRoot":"","sources":["../../src/testing/testing.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6DAAyD;AACzD,uDAAmD;AACnD,8DAA0D;AAC1D,8DAA0D;AAQnD,IAAM,aAAa,GAAnB,MAAM,aAAa;CAAG,CAAA;AAAhB,sCAAa;wBAAb,aAAa;IANzB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,8BAAa,EAAE,8BAAa,CAAC;QACvC,WAAW,EAAE,CAAC,sCAAiB,CAAC;QAChC,SAAS,EAAE,CAAC,gCAAc,CAAC;QAC3B,OAAO,EAAE,CAAC,gCAAc,CAAC;KAC1B,CAAC;GACW,aAAa,CAAG"}
@@ -0,0 +1,62 @@
1
+ import { ProjectService } from "../project/project.service";
2
+ import { PreviewService } from "../preview/preview.service";
3
+ import { Observable } from "rxjs";
4
+ export interface TestStep {
5
+ action: "navigate" | "click" | "fill" | "waitFor" | "screenshot" | "assert";
6
+ selector?: string;
7
+ url?: string;
8
+ value?: string;
9
+ name?: string;
10
+ expected?: string;
11
+ }
12
+ export interface TestScenario {
13
+ id: string;
14
+ name: string;
15
+ steps: TestStep[];
16
+ createdAt: number;
17
+ }
18
+ export interface TestResult {
19
+ scenarioId: string;
20
+ scenarioName: string;
21
+ status: "passed" | "failed" | "running";
22
+ startTime: number;
23
+ endTime?: number;
24
+ steps: StepResult[];
25
+ error?: string;
26
+ screenshots: string[];
27
+ }
28
+ export interface StepResult {
29
+ step: TestStep;
30
+ status: "passed" | "failed" | "skipped";
31
+ duration: number;
32
+ error?: string;
33
+ screenshot?: string;
34
+ }
35
+ export interface TestEvent {
36
+ type: "step" | "complete" | "error";
37
+ scenarioId: string;
38
+ data: StepResult | TestResult | {
39
+ error: string;
40
+ };
41
+ }
42
+ export declare class TestingService {
43
+ private projectService;
44
+ private previewService;
45
+ private readonly logger;
46
+ private scenarios;
47
+ private runningTests;
48
+ private testSubjects;
49
+ constructor(projectService: ProjectService, previewService: PreviewService);
50
+ getScenarios(projectId: string): Promise<TestScenario[]>;
51
+ getScenario(projectId: string, scenarioId: string): Promise<TestScenario>;
52
+ createScenario(projectId: string, name: string, steps: TestStep[]): Promise<TestScenario>;
53
+ updateScenario(projectId: string, scenarioId: string, name: string, steps: TestStep[]): Promise<TestScenario>;
54
+ deleteScenario(projectId: string, scenarioId: string): Promise<void>;
55
+ runScenario(projectId: string, scenarioId: string): Promise<TestResult>;
56
+ private generatePlaywrightScript;
57
+ private executePlaywright;
58
+ private parseTestOutput;
59
+ getTestStream(projectId: string): Observable<TestEvent>;
60
+ private emitEvent;
61
+ stopTest(scenarioId: string): void;
62
+ }