edsger 0.45.0 → 0.45.1

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 (95) hide show
  1. package/package.json +3 -3
  2. package/tsconfig.build.json +4 -0
  3. package/tsconfig.json +3 -9
  4. package/dist/api/__tests__/app-store.test.d.ts +0 -7
  5. package/dist/api/__tests__/app-store.test.js +0 -60
  6. package/dist/api/__tests__/intelligence.test.d.ts +0 -11
  7. package/dist/api/__tests__/intelligence.test.js +0 -315
  8. package/dist/api/features/__tests__/feature-utils.test.d.ts +0 -4
  9. package/dist/api/features/__tests__/feature-utils.test.js +0 -370
  10. package/dist/api/features/__tests__/status-updater.test.d.ts +0 -4
  11. package/dist/api/features/__tests__/status-updater.test.js +0 -88
  12. package/dist/commands/build/__tests__/build.test.d.ts +0 -5
  13. package/dist/commands/build/__tests__/build.test.js +0 -206
  14. package/dist/commands/build/__tests__/detect-project.test.d.ts +0 -6
  15. package/dist/commands/build/__tests__/detect-project.test.js +0 -160
  16. package/dist/commands/build/__tests__/run-build.test.d.ts +0 -6
  17. package/dist/commands/build/__tests__/run-build.test.js +0 -433
  18. package/dist/commands/intelligence/__tests__/command.test.d.ts +0 -4
  19. package/dist/commands/intelligence/__tests__/command.test.js +0 -48
  20. package/dist/commands/workflow/core/__tests__/feature-filter.test.d.ts +0 -5
  21. package/dist/commands/workflow/core/__tests__/feature-filter.test.js +0 -316
  22. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.d.ts +0 -4
  23. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.js +0 -397
  24. package/dist/commands/workflow/core/__tests__/state-manager.test.d.ts +0 -4
  25. package/dist/commands/workflow/core/__tests__/state-manager.test.js +0 -384
  26. package/dist/config/__tests__/config.test.d.ts +0 -4
  27. package/dist/config/__tests__/config.test.js +0 -286
  28. package/dist/config/__tests__/feature-status.test.d.ts +0 -4
  29. package/dist/config/__tests__/feature-status.test.js +0 -111
  30. package/dist/errors/__tests__/index.test.d.ts +0 -4
  31. package/dist/errors/__tests__/index.test.js +0 -349
  32. package/dist/phases/app-store-generation/__tests__/agent.test.d.ts +0 -5
  33. package/dist/phases/app-store-generation/__tests__/agent.test.js +0 -142
  34. package/dist/phases/app-store-generation/__tests__/context.test.d.ts +0 -4
  35. package/dist/phases/app-store-generation/__tests__/context.test.js +0 -284
  36. package/dist/phases/app-store-generation/__tests__/prompts.test.d.ts +0 -4
  37. package/dist/phases/app-store-generation/__tests__/prompts.test.js +0 -122
  38. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.d.ts +0 -5
  39. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.js +0 -826
  40. package/dist/phases/code-review/__tests__/diff-utils.test.d.ts +0 -1
  41. package/dist/phases/code-review/__tests__/diff-utils.test.js +0 -101
  42. package/dist/phases/intelligence-analysis/__tests__/context.test.d.ts +0 -4
  43. package/dist/phases/intelligence-analysis/__tests__/context.test.js +0 -192
  44. package/dist/phases/intelligence-analysis/__tests__/matching.test.d.ts +0 -13
  45. package/dist/phases/intelligence-analysis/__tests__/matching.test.js +0 -154
  46. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.d.ts +0 -5
  47. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.js +0 -378
  48. package/dist/phases/intelligence-analysis/__tests__/prompts.test.d.ts +0 -4
  49. package/dist/phases/intelligence-analysis/__tests__/prompts.test.js +0 -33
  50. package/dist/phases/pr-execution/__tests__/file-assigner.test.d.ts +0 -1
  51. package/dist/phases/pr-execution/__tests__/file-assigner.test.js +0 -303
  52. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.d.ts +0 -1
  53. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.js +0 -157
  54. package/dist/phases/pr-resolve/__tests__/prompts.test.d.ts +0 -1
  55. package/dist/phases/pr-resolve/__tests__/prompts.test.js +0 -116
  56. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.d.ts +0 -1
  57. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.js +0 -138
  58. package/dist/phases/pr-resolve/__tests__/types.test.d.ts +0 -1
  59. package/dist/phases/pr-resolve/__tests__/types.test.js +0 -43
  60. package/dist/phases/pr-resolve/__tests__/workspace.test.d.ts +0 -1
  61. package/dist/phases/pr-resolve/__tests__/workspace.test.js +0 -111
  62. package/dist/phases/pr-review/__tests__/prompts.test.d.ts +0 -1
  63. package/dist/phases/pr-review/__tests__/prompts.test.js +0 -49
  64. package/dist/phases/pr-review/__tests__/review-comments.test.d.ts +0 -1
  65. package/dist/phases/pr-review/__tests__/review-comments.test.js +0 -110
  66. package/dist/phases/pr-shared/__tests__/agent-utils.test.d.ts +0 -1
  67. package/dist/phases/pr-shared/__tests__/agent-utils.test.js +0 -91
  68. package/dist/phases/pr-shared/__tests__/context.test.d.ts +0 -1
  69. package/dist/phases/pr-shared/__tests__/context.test.js +0 -94
  70. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.d.ts +0 -1
  71. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.js +0 -331
  72. package/dist/phases/release-sync/__tests__/github.test.d.ts +0 -9
  73. package/dist/phases/release-sync/__tests__/github.test.js +0 -123
  74. package/dist/phases/release-sync/__tests__/snapshot.test.d.ts +0 -8
  75. package/dist/phases/release-sync/__tests__/snapshot.test.js +0 -93
  76. package/dist/phases/smoke-test/__tests__/agent.test.d.ts +0 -4
  77. package/dist/phases/smoke-test/__tests__/agent.test.js +0 -85
  78. package/dist/services/coaching/__tests__/coaching-agent.test.d.ts +0 -1
  79. package/dist/services/coaching/__tests__/coaching-agent.test.js +0 -74
  80. package/dist/services/coaching/__tests__/coaching-loop.test.d.ts +0 -1
  81. package/dist/services/coaching/__tests__/coaching-loop.test.js +0 -59
  82. package/dist/services/coaching/__tests__/self-rating.test.d.ts +0 -1
  83. package/dist/services/coaching/__tests__/self-rating.test.js +0 -188
  84. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.d.ts +0 -1
  85. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.js +0 -122
  86. package/dist/services/phase-hooks/__tests__/hook-executor.test.d.ts +0 -1
  87. package/dist/services/phase-hooks/__tests__/hook-executor.test.js +0 -321
  88. package/dist/services/phase-hooks/__tests__/hook-runner.test.d.ts +0 -1
  89. package/dist/services/phase-hooks/__tests__/hook-runner.test.js +0 -261
  90. package/dist/services/phase-hooks/__tests__/plugin-loader.test.d.ts +0 -1
  91. package/dist/services/phase-hooks/__tests__/plugin-loader.test.js +0 -158
  92. package/dist/services/video/__tests__/video-pipeline.test.d.ts +0 -6
  93. package/dist/services/video/__tests__/video-pipeline.test.js +0 -249
  94. package/dist/workspace/__tests__/workspace-manager.test.d.ts +0 -7
  95. package/dist/workspace/__tests__/workspace-manager.test.js +0 -52
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "edsger",
3
- "version": "0.45.0",
3
+ "version": "0.45.1",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "edsger": "dist/index.js"
7
7
  },
8
8
  "scripts": {
9
- "build": "tsc && cp -r src/phases/app-store-generation/assets dist/phases/app-store-generation/ && rm -rf dist/skills && mkdir -p dist/skills && cp -r ../edsger-skills/skills/phase dist/skills/phase",
10
- "dev": "tsc --watch",
9
+ "build": "tsc -p tsconfig.build.json && cp -r src/phases/app-store-generation/assets dist/phases/app-store-generation/ && rm -rf dist/skills && mkdir -p dist/skills && cp -r ../edsger-skills/skills/phase dist/skills/phase",
10
+ "dev": "tsc -p tsconfig.build.json --watch",
11
11
  "lint": "eslint .",
12
12
  "lint:fix": "eslint . --fix",
13
13
  "test": "npm run test:unit",
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": "./tsconfig.json",
3
+ "exclude": ["node_modules", "dist", "src/**/*.test.ts", "src/**/__tests__/**"]
4
+ }
package/tsconfig.json CHANGED
@@ -14,12 +14,6 @@
14
14
  "resolveJsonModule": true,
15
15
  "types": ["node"]
16
16
  },
17
- "include": [
18
- "src/**/*"
19
- ],
20
- "exclude": [
21
- "node_modules",
22
- "dist",
23
- "src/**/*.test.ts"
24
- ]
25
- }
17
+ "include": ["src/**/*"],
18
+ "exclude": ["node_modules", "dist"]
19
+ }
@@ -1,7 +0,0 @@
1
- /**
2
- * Unit tests for app-store API helpers.
3
- *
4
- * Tests the parsing/extraction logic that getAppStorePrimaryLocale uses
5
- * to parse MCP response data.
6
- */
7
- export {};
@@ -1,60 +0,0 @@
1
- /**
2
- * Unit tests for app-store API helpers.
3
- *
4
- * Tests the parsing/extraction logic that getAppStorePrimaryLocale uses
5
- * to parse MCP response data.
6
- */
7
- import assert from 'node:assert';
8
- import { describe, it } from 'node:test';
9
- /**
10
- * Extracts locale from an MCP response — mirrors the parsing logic
11
- * inside getAppStorePrimaryLocale without requiring network mocks.
12
- */
13
- function parseLocaleFromMcpResponse(result) {
14
- const text = result?.content?.[0]?.text || '{}';
15
- const parsed = JSON.parse(text);
16
- return parsed.locale || null;
17
- }
18
- void describe('parseLocaleFromMcpResponse', () => {
19
- void it('should return locale string when present', () => {
20
- const result = { content: [{ text: '{"locale":"en-US"}' }] };
21
- assert.strictEqual(parseLocaleFromMcpResponse(result), 'en-US');
22
- });
23
- void it('should return locale for non-English locales', () => {
24
- assert.strictEqual(parseLocaleFromMcpResponse({ content: [{ text: '{"locale":"ja"}' }] }), 'ja');
25
- assert.strictEqual(parseLocaleFromMcpResponse({
26
- content: [{ text: '{"locale":"zh-Hans"}' }],
27
- }), 'zh-Hans');
28
- assert.strictEqual(parseLocaleFromMcpResponse({ content: [{ text: '{"locale":"fr-FR"}' }] }), 'fr-FR');
29
- });
30
- void it('should return null when locale is null', () => {
31
- const result = { content: [{ text: '{"locale":null}' }] };
32
- assert.strictEqual(parseLocaleFromMcpResponse(result), null);
33
- });
34
- void it('should return null when locale is empty string', () => {
35
- const result = { content: [{ text: '{"locale":""}' }] };
36
- assert.strictEqual(parseLocaleFromMcpResponse(result), null);
37
- });
38
- void it('should return null when content array is empty', () => {
39
- const result = { content: [] };
40
- assert.strictEqual(parseLocaleFromMcpResponse(result), null);
41
- });
42
- void it('should return null when content field is missing', () => {
43
- assert.strictEqual(parseLocaleFromMcpResponse({}), null);
44
- });
45
- void it('should return null when result is null', () => {
46
- assert.strictEqual(parseLocaleFromMcpResponse(null), null);
47
- });
48
- void it('should return null when result is undefined', () => {
49
- assert.strictEqual(parseLocaleFromMcpResponse(undefined), null);
50
- });
51
- void it('should throw when text is not valid JSON', () => {
52
- assert.throws(() => {
53
- parseLocaleFromMcpResponse({ content: [{ text: 'not json' }] });
54
- });
55
- });
56
- void it('should return null when text field is missing', () => {
57
- const result = { content: [{}] };
58
- assert.strictEqual(parseLocaleFromMcpResponse(result), null);
59
- });
60
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * Tests for the MCP handler logic used in intelligence.ts.
3
- *
4
- * Since the actual MCP handlers run in Deno (supabase edge functions),
5
- * we test the equivalent logic at the API wrapper level by mocking
6
- * callMcpEndpoint responses. This verifies:
7
- * - Response parsing for all entity types
8
- * - Error handling for failed/empty responses
9
- * - Correct parameter formatting
10
- */
11
- export {};
@@ -1,315 +0,0 @@
1
- /**
2
- * Tests for the MCP handler logic used in intelligence.ts.
3
- *
4
- * Since the actual MCP handlers run in Deno (supabase edge functions),
5
- * we test the equivalent logic at the API wrapper level by mocking
6
- * callMcpEndpoint responses. This verifies:
7
- * - Response parsing for all entity types
8
- * - Error handling for failed/empty responses
9
- * - Correct parameter formatting
10
- */
11
- import assert from 'node:assert';
12
- import { describe, it } from 'node:test';
13
- // ============================================================
14
- // MCP Response Parsing
15
- // ============================================================
16
- /**
17
- * Replicate the parseMcpResponse helper from intelligence.ts
18
- * to test parsing in isolation.
19
- */
20
- function parseMcpResponse(result, fallback) {
21
- const res = result;
22
- const text = res?.content?.[0]?.text;
23
- if (!text) {
24
- return fallback;
25
- }
26
- try {
27
- return JSON.parse(text);
28
- }
29
- catch {
30
- return fallback;
31
- }
32
- }
33
- // ── Wait, that's duplicating. Let me test the real function. ────
34
- // The parseMcpResponse function is not exported from intelligence.ts.
35
- // So we test the same logic: MCP response format → parsed data.
36
- // This validates the contract between MCP handlers and the API layer.
37
- void describe('MCP response parsing — competitors', () => {
38
- const competitorJson = {
39
- id: 'comp-1',
40
- product_id: 'prod-1',
41
- name: 'Linear',
42
- url: 'https://linear.app',
43
- app_store_url: null,
44
- play_store_url: null,
45
- description: 'Issue tracker',
46
- category: 'developer-tools',
47
- status: 'confirmed',
48
- discovery_source: 'manual',
49
- discovery_reason: null,
50
- notes: null,
51
- created_by: 'user-1',
52
- created_at: '2026-03-25T00:00:00Z',
53
- updated_at: '2026-03-25T00:00:00Z',
54
- };
55
- void it('should parse single competitor response', () => {
56
- const mcpResponse = {
57
- content: [{ type: 'text', text: JSON.stringify(competitorJson) }],
58
- };
59
- const parsed = parseMcpResponse(mcpResponse, null);
60
- assert.ok(parsed);
61
- assert.strictEqual(parsed.name, 'Linear');
62
- assert.strictEqual(parsed.status, 'confirmed');
63
- });
64
- void it('should parse competitor array response', () => {
65
- const arr = [
66
- competitorJson,
67
- { ...competitorJson, id: 'comp-2', name: 'Cursor' },
68
- ];
69
- const mcpResponse = {
70
- content: [{ type: 'text', text: JSON.stringify(arr) }],
71
- };
72
- const parsed = parseMcpResponse(mcpResponse, []);
73
- assert.strictEqual(parsed.length, 2);
74
- assert.strictEqual(parsed[1].name, 'Cursor');
75
- });
76
- void it('should return fallback for empty content', () => {
77
- const parsed = parseMcpResponse({ content: [] }, []);
78
- assert.deepStrictEqual(parsed, []);
79
- });
80
- void it('should return fallback for null response', () => {
81
- const parsed = parseMcpResponse(null, []);
82
- assert.deepStrictEqual(parsed, []);
83
- });
84
- void it('should return fallback for invalid JSON', () => {
85
- const mcpResponse = { content: [{ type: 'text', text: 'not json' }] };
86
- const parsed = parseMcpResponse(mcpResponse, []);
87
- assert.deepStrictEqual(parsed, []);
88
- });
89
- void it('should return fallback for missing text field', () => {
90
- const mcpResponse = { content: [{ type: 'text' }] };
91
- const parsed = parseMcpResponse(mcpResponse, null);
92
- assert.strictEqual(parsed, null);
93
- });
94
- });
95
- void describe('MCP response parsing — snapshots', () => {
96
- const snapshotJson = {
97
- id: 'snap-1',
98
- competitor_id: 'comp-1',
99
- product_id: 'prod-1',
100
- features: [{ name: 'Issues', description: 'Issue tracking' }],
101
- pricing: {
102
- tiers: [{ name: 'Free', price: '$0', features: ['Basic'] }],
103
- model: 'freemium',
104
- },
105
- tech_stack: ['React', 'GraphQL'],
106
- app_rating: 4.5,
107
- app_review_count: 1200,
108
- app_version: '2.0.0',
109
- app_last_updated: '2026-03-20',
110
- recent_reviews: [
111
- { rating: 5, title: 'Great', body: 'Love it', date: '2026-03-19' },
112
- ],
113
- social_mentions: { reddit: 15, hn: 3, twitter: 42 },
114
- changes_detected: [{ type: 'new_feature', description: 'Added AI' }],
115
- source: 'ai_analysis',
116
- raw_data: null,
117
- created_at: '2026-03-25T00:00:00Z',
118
- };
119
- void it('should parse snapshot with all fields', () => {
120
- const mcpResponse = {
121
- content: [{ type: 'text', text: JSON.stringify(snapshotJson) }],
122
- };
123
- const parsed = parseMcpResponse(mcpResponse, null);
124
- assert.ok(parsed);
125
- assert.strictEqual(parsed.app_rating, 4.5);
126
- assert.strictEqual(parsed.features.length, 1);
127
- assert.strictEqual(parsed.tech_stack.length, 2);
128
- assert.strictEqual(parsed.changes_detected.length, 1);
129
- });
130
- void it('should parse snapshot array', () => {
131
- const arr = [
132
- snapshotJson,
133
- { ...snapshotJson, id: 'snap-2', app_rating: 3.8 },
134
- ];
135
- const mcpResponse = {
136
- content: [{ type: 'text', text: JSON.stringify(arr) }],
137
- };
138
- const parsed = parseMcpResponse(mcpResponse, []);
139
- assert.strictEqual(parsed.length, 2);
140
- assert.strictEqual(parsed[1].app_rating, 3.8);
141
- });
142
- });
143
- void describe('MCP response parsing — reports', () => {
144
- const reportJson = {
145
- id: 'rpt-1',
146
- product_id: 'prod-1',
147
- report_type: 'competitive',
148
- title: 'Competitive Intelligence Report',
149
- summary: 'Key findings summary',
150
- full_report: '# Full Report\n\nDetails...',
151
- key_findings: [
152
- {
153
- finding: 'Competitor growing fast',
154
- severity: 'critical',
155
- category: 'competitive',
156
- },
157
- ],
158
- recommendations: [
159
- {
160
- action: 'Add feature X',
161
- priority: 'high',
162
- effort: 'medium',
163
- impact: 'high',
164
- rationale: 'Gap',
165
- },
166
- ],
167
- competitor_highlights: [
168
- {
169
- competitor_id: 'comp-1',
170
- competitor_name: 'Linear',
171
- highlight: 'Raised $50M',
172
- sentiment: 'threat',
173
- },
174
- ],
175
- market_signals: [
176
- {
177
- source: 'hn',
178
- signal: 'Trending discussion',
179
- relevance: 'high',
180
- url: 'https://hn.example',
181
- },
182
- ],
183
- trends: [
184
- {
185
- trend: 'AI-first tools',
186
- direction: 'up',
187
- evidence: '3x more mentions',
188
- },
189
- ],
190
- persona_updates: null,
191
- pmf_score: null,
192
- pmf_signals: null,
193
- guidance: null,
194
- status: 'completed',
195
- snapshot_ids: ['snap-1'],
196
- created_by: 'user-1',
197
- created_at: '2026-03-25T00:00:00Z',
198
- updated_at: '2026-03-25T00:00:00Z',
199
- };
200
- void it('should parse full report', () => {
201
- const mcpResponse = {
202
- content: [{ type: 'text', text: JSON.stringify(reportJson) }],
203
- };
204
- const parsed = parseMcpResponse(mcpResponse, null);
205
- assert.ok(parsed);
206
- assert.strictEqual(parsed.report_type, 'competitive');
207
- assert.strictEqual(parsed.key_findings.length, 1);
208
- assert.strictEqual(parsed.recommendations.length, 1);
209
- assert.strictEqual(parsed.market_signals.length, 1);
210
- assert.strictEqual(parsed.trends.length, 1);
211
- });
212
- void it('should parse report array', () => {
213
- const arr = [
214
- reportJson,
215
- { ...reportJson, id: 'rpt-2', report_type: 'market' },
216
- ];
217
- const mcpResponse = {
218
- content: [{ type: 'text', text: JSON.stringify(arr) }],
219
- };
220
- const parsed = parseMcpResponse(mcpResponse, []);
221
- assert.strictEqual(parsed.length, 2);
222
- assert.strictEqual(parsed[1].report_type, 'market');
223
- });
224
- void it('should handle report with null optional fields', () => {
225
- const minimal = {
226
- ...reportJson,
227
- summary: null,
228
- full_report: null,
229
- persona_updates: null,
230
- pmf_score: null,
231
- guidance: null,
232
- };
233
- const mcpResponse = {
234
- content: [{ type: 'text', text: JSON.stringify(minimal) }],
235
- };
236
- const parsed = parseMcpResponse(mcpResponse, null);
237
- assert.ok(parsed);
238
- assert.strictEqual(parsed.summary, null);
239
- assert.strictEqual(parsed.pmf_score, null);
240
- });
241
- });
242
- // ============================================================
243
- // MCP Handler Input Validation (contract tests)
244
- // ============================================================
245
- void describe('MCP handler contracts — competitors', () => {
246
- void it('should require product_id for list', () => {
247
- // The handler throws "product_id is required"
248
- // We validate the contract: API must send product_id
249
- const params = { product_id: 'prod-1' };
250
- assert.ok(params.product_id, 'product_id must be present');
251
- });
252
- void it('should require name for create', () => {
253
- const params = { product_id: 'prod-1', name: 'Linear' };
254
- assert.ok(params.product_id && params.name, 'product_id and name must be present');
255
- });
256
- void it('should require competitor_id for update', () => {
257
- const params = { competitor_id: 'comp-1', status: 'confirmed' };
258
- assert.ok(params.competitor_id, 'competitor_id must be present');
259
- });
260
- void it('should require competitor_id for delete', () => {
261
- const params = { competitor_id: 'comp-1' };
262
- assert.ok(params.competitor_id, 'competitor_id must be present');
263
- });
264
- });
265
- void describe('MCP handler contracts — snapshots', () => {
266
- void it('should require competitor_id or product_id for list', () => {
267
- const byCompetitor = { competitor_id: 'comp-1' };
268
- const byProduct = { product_id: 'prod-1' };
269
- assert.ok(byCompetitor.competitor_id || byProduct.product_id);
270
- });
271
- void it('should require competitor_id and product_id for save', () => {
272
- const params = { competitor_id: 'comp-1', product_id: 'prod-1' };
273
- assert.ok(params.competitor_id && params.product_id);
274
- });
275
- });
276
- void describe('MCP handler contracts — reports', () => {
277
- void it('should require product_id for list', () => {
278
- const params = { product_id: 'prod-1' };
279
- assert.ok(params.product_id);
280
- });
281
- void it('should require report_id for get', () => {
282
- const params = { report_id: 'rpt-1' };
283
- assert.ok(params.report_id);
284
- });
285
- void it('should require product_id, report_type, and title for save', () => {
286
- const params = {
287
- product_id: 'prod-1',
288
- report_type: 'competitive',
289
- title: 'Report',
290
- };
291
- assert.ok(params.product_id && params.report_type && params.title);
292
- });
293
- void it('should require report_id for update', () => {
294
- const params = { report_id: 'rpt-1', status: 'completed' };
295
- assert.ok(params.report_id);
296
- });
297
- });
298
- // ============================================================
299
- // Batch create — duplicate handling contract
300
- // ============================================================
301
- void describe('MCP batch_create — duplicate handling', () => {
302
- void it('should handle unique_violation error code 23505', () => {
303
- // The handler catches error.code === '23505' and skips
304
- const errorCode = '23505';
305
- assert.strictEqual(errorCode, '23505', 'Handler should recognize PostgreSQL unique_violation');
306
- });
307
- void it('should accept competitors with suggested status by default', () => {
308
- const defaultStatus = 'suggested';
309
- assert.strictEqual(defaultStatus, 'suggested');
310
- });
311
- void it('should accept competitors with ai_discovery source by default', () => {
312
- const defaultSource = 'ai_discovery';
313
- assert.strictEqual(defaultSource, 'ai_discovery');
314
- });
315
- });
@@ -1,4 +0,0 @@
1
- /**
2
- * Unit tests for feature utility functions
3
- */
4
- export {};