edsger 0.46.0 → 0.48.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 (121) hide show
  1. package/.claude/settings.local.json +3 -23
  2. package/dist/api/__tests__/app-store.test.d.ts +7 -0
  3. package/dist/api/__tests__/app-store.test.js +60 -0
  4. package/dist/api/__tests__/intelligence.test.d.ts +11 -0
  5. package/dist/api/__tests__/intelligence.test.js +315 -0
  6. package/dist/api/features/__tests__/feature-utils.test.d.ts +4 -0
  7. package/dist/api/features/__tests__/feature-utils.test.js +370 -0
  8. package/dist/api/features/__tests__/status-updater.test.d.ts +4 -0
  9. package/dist/api/features/__tests__/status-updater.test.js +88 -0
  10. package/dist/commands/build/__tests__/build.test.d.ts +5 -0
  11. package/dist/commands/build/__tests__/build.test.js +206 -0
  12. package/dist/commands/build/__tests__/detect-project.test.d.ts +6 -0
  13. package/dist/commands/build/__tests__/detect-project.test.js +160 -0
  14. package/dist/commands/build/__tests__/run-build.test.d.ts +6 -0
  15. package/dist/commands/build/__tests__/run-build.test.js +433 -0
  16. package/dist/commands/intelligence/__tests__/command.test.d.ts +4 -0
  17. package/dist/commands/intelligence/__tests__/command.test.js +48 -0
  18. package/dist/commands/run-sheet/index.js +6 -0
  19. package/dist/commands/workflow/core/__tests__/feature-filter.test.d.ts +5 -0
  20. package/dist/commands/workflow/core/__tests__/feature-filter.test.js +316 -0
  21. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.d.ts +4 -0
  22. package/dist/commands/workflow/core/__tests__/pipeline-evaluator.test.js +397 -0
  23. package/dist/commands/workflow/core/__tests__/state-manager.test.d.ts +4 -0
  24. package/dist/commands/workflow/core/__tests__/state-manager.test.js +384 -0
  25. package/dist/config/__tests__/config.test.d.ts +4 -0
  26. package/dist/config/__tests__/config.test.js +286 -0
  27. package/dist/config/__tests__/feature-status.test.d.ts +4 -0
  28. package/dist/config/__tests__/feature-status.test.js +111 -0
  29. package/dist/errors/__tests__/index.test.d.ts +4 -0
  30. package/dist/errors/__tests__/index.test.js +349 -0
  31. package/dist/index.js +0 -0
  32. package/dist/phases/app-store-generation/__tests__/agent.test.d.ts +5 -0
  33. package/dist/phases/app-store-generation/__tests__/agent.test.js +142 -0
  34. package/dist/phases/app-store-generation/__tests__/context.test.d.ts +4 -0
  35. package/dist/phases/app-store-generation/__tests__/context.test.js +284 -0
  36. package/dist/phases/app-store-generation/__tests__/prompts.test.d.ts +4 -0
  37. package/dist/phases/app-store-generation/__tests__/prompts.test.js +122 -0
  38. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.d.ts +5 -0
  39. package/dist/phases/app-store-generation/__tests__/screenshot-composer.test.js +826 -0
  40. package/dist/phases/code-review/__tests__/diff-utils.test.d.ts +1 -0
  41. package/dist/phases/code-review/__tests__/diff-utils.test.js +101 -0
  42. package/dist/phases/intelligence-analysis/__tests__/context.test.d.ts +4 -0
  43. package/dist/phases/intelligence-analysis/__tests__/context.test.js +192 -0
  44. package/dist/phases/intelligence-analysis/__tests__/matching.test.d.ts +13 -0
  45. package/dist/phases/intelligence-analysis/__tests__/matching.test.js +154 -0
  46. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.d.ts +5 -0
  47. package/dist/phases/intelligence-analysis/__tests__/orchestration.test.js +378 -0
  48. package/dist/phases/intelligence-analysis/__tests__/prompts.test.d.ts +4 -0
  49. package/dist/phases/intelligence-analysis/__tests__/prompts.test.js +33 -0
  50. package/dist/phases/pr-execution/__tests__/file-assigner.test.d.ts +1 -0
  51. package/dist/phases/pr-execution/__tests__/file-assigner.test.js +303 -0
  52. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.d.ts +1 -0
  53. package/dist/phases/pr-resolve/__tests__/checklist-learner.test.js +157 -0
  54. package/dist/phases/pr-resolve/__tests__/prompts.test.d.ts +1 -0
  55. package/dist/phases/pr-resolve/__tests__/prompts.test.js +116 -0
  56. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.d.ts +1 -0
  57. package/dist/phases/pr-resolve/__tests__/resolve-mapping.test.js +138 -0
  58. package/dist/phases/pr-resolve/__tests__/types.test.d.ts +1 -0
  59. package/dist/phases/pr-resolve/__tests__/types.test.js +43 -0
  60. package/dist/phases/pr-resolve/__tests__/workspace.test.d.ts +1 -0
  61. package/dist/phases/pr-resolve/__tests__/workspace.test.js +111 -0
  62. package/dist/phases/pr-review/__tests__/prompts.test.d.ts +1 -0
  63. package/dist/phases/pr-review/__tests__/prompts.test.js +49 -0
  64. package/dist/phases/pr-review/__tests__/review-comments.test.d.ts +1 -0
  65. package/dist/phases/pr-review/__tests__/review-comments.test.js +110 -0
  66. package/dist/phases/pr-shared/__tests__/agent-utils.test.d.ts +1 -0
  67. package/dist/phases/pr-shared/__tests__/agent-utils.test.js +91 -0
  68. package/dist/phases/pr-shared/__tests__/context.test.d.ts +1 -0
  69. package/dist/phases/pr-shared/__tests__/context.test.js +94 -0
  70. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.d.ts +1 -0
  71. package/dist/phases/pr-splitting/__tests__/import-dep-validator.test.js +331 -0
  72. package/dist/phases/release-sync/github.d.ts +12 -0
  73. package/dist/phases/release-sync/github.js +39 -0
  74. package/dist/phases/release-sync/snapshot.js +0 -1
  75. package/dist/phases/run-sheet/index.d.ts +15 -0
  76. package/dist/phases/run-sheet/index.js +154 -22
  77. package/dist/phases/run-sheet/render.d.ts +23 -5
  78. package/dist/phases/run-sheet/render.js +193 -31
  79. package/dist/phases/smoke-test/__tests__/agent.test.d.ts +4 -0
  80. package/dist/phases/smoke-test/__tests__/agent.test.js +84 -0
  81. package/dist/phases/smoke-test/__tests__/github.test.d.ts +9 -0
  82. package/dist/phases/smoke-test/__tests__/github.test.js +120 -0
  83. package/dist/phases/smoke-test/__tests__/snapshot.test.d.ts +8 -0
  84. package/dist/phases/smoke-test/__tests__/snapshot.test.js +93 -0
  85. package/dist/phases/smoke-test/github.d.ts +54 -0
  86. package/dist/phases/smoke-test/github.js +101 -0
  87. package/dist/phases/smoke-test/snapshot.d.ts +27 -0
  88. package/dist/phases/smoke-test/snapshot.js +157 -0
  89. package/dist/services/coaching/__tests__/coaching-agent.test.d.ts +1 -0
  90. package/dist/services/coaching/__tests__/coaching-agent.test.js +74 -0
  91. package/dist/services/coaching/__tests__/coaching-loop.test.d.ts +1 -0
  92. package/dist/services/coaching/__tests__/coaching-loop.test.js +59 -0
  93. package/dist/services/coaching/__tests__/self-rating.test.d.ts +1 -0
  94. package/dist/services/coaching/__tests__/self-rating.test.js +188 -0
  95. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.d.ts +4 -0
  96. package/dist/services/lifecycle-agent/__tests__/phase-criteria.test.js +133 -0
  97. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.d.ts +4 -0
  98. package/dist/services/lifecycle-agent/__tests__/transition-rules.test.js +336 -0
  99. package/dist/services/lifecycle-agent/index.d.ts +24 -0
  100. package/dist/services/lifecycle-agent/index.js +25 -0
  101. package/dist/services/lifecycle-agent/phase-criteria.d.ts +57 -0
  102. package/dist/services/lifecycle-agent/phase-criteria.js +335 -0
  103. package/dist/services/lifecycle-agent/transition-rules.d.ts +60 -0
  104. package/dist/services/lifecycle-agent/transition-rules.js +184 -0
  105. package/dist/services/lifecycle-agent/types.d.ts +190 -0
  106. package/dist/services/lifecycle-agent/types.js +12 -0
  107. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.d.ts +1 -0
  108. package/dist/services/phase-hooks/__tests__/bindings-fetcher.test.js +122 -0
  109. package/dist/services/phase-hooks/__tests__/hook-executor.test.d.ts +1 -0
  110. package/dist/services/phase-hooks/__tests__/hook-executor.test.js +321 -0
  111. package/dist/services/phase-hooks/__tests__/hook-runner.test.d.ts +1 -0
  112. package/dist/services/phase-hooks/__tests__/hook-runner.test.js +261 -0
  113. package/dist/services/phase-hooks/__tests__/plugin-loader.test.d.ts +1 -0
  114. package/dist/services/phase-hooks/__tests__/plugin-loader.test.js +158 -0
  115. package/dist/services/video/__tests__/video-pipeline.test.d.ts +6 -0
  116. package/dist/services/video/__tests__/video-pipeline.test.js +249 -0
  117. package/dist/workspace/__tests__/workspace-manager.test.d.ts +7 -0
  118. package/dist/workspace/__tests__/workspace-manager.test.js +52 -0
  119. package/dist/workspace/workspace-manager.js +17 -4
  120. package/package.json +1 -1
  121. package/.env.local +0 -12
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Unit tests for the pure helpers inside workspace-manager.
3
+ *
4
+ * syncRepoToRef / cloneFeatureRepo shell out to git and are exercised
5
+ * end-to-end; only the validator is cheap to unit-test here.
6
+ */
7
+ export {};
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Unit tests for the pure helpers inside workspace-manager.
3
+ *
4
+ * syncRepoToRef / cloneFeatureRepo shell out to git and are exercised
5
+ * end-to-end; only the validator is cheap to unit-test here.
6
+ */
7
+ import assert from 'node:assert';
8
+ import { describe, it } from 'node:test';
9
+ import { isSafeGitRef } from '../workspace-manager.js';
10
+ void describe('isSafeGitRef', () => {
11
+ void it('accepts common release / branch names', () => {
12
+ assert.strictEqual(isSafeGitRef('main'), true);
13
+ assert.strictEqual(isSafeGitRef('develop'), true);
14
+ assert.strictEqual(isSafeGitRef('v1.2.3'), true);
15
+ assert.strictEqual(isSafeGitRef('2024.01.15'), true);
16
+ assert.strictEqual(isSafeGitRef('release/2.0'), true);
17
+ assert.strictEqual(isSafeGitRef('v1.0.0-rc.1'), true);
18
+ assert.strictEqual(isSafeGitRef('v2@stable'), true);
19
+ assert.strictEqual(isSafeGitRef('feature/user-auth_v2'), true);
20
+ });
21
+ void it('rejects empty / overlong input', () => {
22
+ assert.strictEqual(isSafeGitRef(''), false);
23
+ assert.strictEqual(isSafeGitRef('x'.repeat(101)), false);
24
+ });
25
+ void it('rejects whitespace', () => {
26
+ assert.strictEqual(isSafeGitRef('v 1.0'), false);
27
+ assert.strictEqual(isSafeGitRef('main\n'), false);
28
+ assert.strictEqual(isSafeGitRef('\tmain'), false);
29
+ });
30
+ void it('rejects shell metacharacters', () => {
31
+ assert.strictEqual(isSafeGitRef('v1;rm -rf /'), false);
32
+ assert.strictEqual(isSafeGitRef('v1$PATH'), false);
33
+ assert.strictEqual(isSafeGitRef('v1`id`'), false);
34
+ assert.strictEqual(isSafeGitRef('v1|less'), false);
35
+ assert.strictEqual(isSafeGitRef('v1>out'), false);
36
+ assert.strictEqual(isSafeGitRef('v1*'), false);
37
+ });
38
+ void it('rejects refs that would confuse git itself', () => {
39
+ assert.strictEqual(isSafeGitRef('.hidden'), false);
40
+ assert.strictEqual(isSafeGitRef('-foo'), false);
41
+ assert.strictEqual(isSafeGitRef('v2..rc'), false);
42
+ assert.strictEqual(isSafeGitRef('HEAD@{1}'), false);
43
+ });
44
+ void it('rejects non-string input defensively', () => {
45
+ // @ts-expect-error testing runtime guard
46
+ assert.strictEqual(isSafeGitRef(null), false);
47
+ // @ts-expect-error testing runtime guard
48
+ assert.strictEqual(isSafeGitRef(undefined), false);
49
+ // @ts-expect-error testing runtime guard
50
+ assert.strictEqual(isSafeGitRef(123), false);
51
+ });
52
+ });
@@ -174,8 +174,16 @@ export function syncRepoToRef(repoPath, ref, token) {
174
174
  throw new Error(`Unsafe branch ref: ${JSON.stringify(ref.branch)}`);
175
175
  }
176
176
  const creds = buildCredentialArgs(token);
177
+ // Timeouts so a hung proxy / credential prompt can't wedge the CLI
178
+ // forever. Network op gets more headroom than local ones.
179
+ const NET_TIMEOUT_MS = 120_000;
180
+ const LOCAL_TIMEOUT_MS = 30_000;
177
181
  try {
178
- execFileSync('git', [...creds, 'fetch', 'origin', '--tags', '--prune'], { cwd: repoPath, stdio: 'pipe' });
182
+ execFileSync('git', [...creds, 'fetch', 'origin', '--tags', '--prune'], {
183
+ cwd: repoPath,
184
+ stdio: 'pipe',
185
+ timeout: NET_TIMEOUT_MS,
186
+ });
179
187
  }
180
188
  catch {
181
189
  logWarning('git fetch failed during sync; working tree may be stale');
@@ -186,20 +194,25 @@ export function syncRepoToRef(repoPath, ref, token) {
186
194
  execFileSync('git', ['reset', '--hard', 'HEAD'], {
187
195
  cwd: repoPath,
188
196
  stdio: 'pipe',
197
+ timeout: LOCAL_TIMEOUT_MS,
198
+ });
199
+ execFileSync('git', ['clean', '-fd'], {
200
+ cwd: repoPath,
201
+ stdio: 'pipe',
202
+ timeout: LOCAL_TIMEOUT_MS,
189
203
  });
190
- execFileSync('git', ['clean', '-fd'], { cwd: repoPath, stdio: 'pipe' });
191
204
  }
192
205
  catch {
193
206
  // Non-fatal; subsequent checkout will surface any real issue.
194
207
  }
195
208
  try {
196
209
  if (ref.tag) {
197
- execFileSync('git', ['-c', 'advice.detachedHead=false', 'checkout', `refs/tags/${ref.tag}`], { cwd: repoPath, stdio: 'pipe' });
210
+ execFileSync('git', ['-c', 'advice.detachedHead=false', 'checkout', `refs/tags/${ref.tag}`], { cwd: repoPath, stdio: 'pipe', timeout: LOCAL_TIMEOUT_MS });
198
211
  logInfo(`Checked out tag ${ref.tag}`);
199
212
  }
200
213
  else if (ref.branch) {
201
214
  // Create-or-reset local branch to origin tip.
202
- execFileSync('git', ['checkout', '-B', ref.branch, `origin/${ref.branch}`], { cwd: repoPath, stdio: 'pipe' });
215
+ execFileSync('git', ['checkout', '-B', ref.branch, `origin/${ref.branch}`], { cwd: repoPath, stdio: 'pipe', timeout: LOCAL_TIMEOUT_MS });
203
216
  logInfo(`Checked out branch ${ref.branch} at origin/${ref.branch}`);
204
217
  }
205
218
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "edsger",
3
- "version": "0.46.0",
3
+ "version": "0.48.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "edsger": "dist/index.js"
package/.env.local DELETED
@@ -1,12 +0,0 @@
1
- OPENAI_API_KEY=
2
- TRIGGER_SECRET_KEY=
3
- RECALL_AI_API_KEY=
4
- RECALL_WEBHOOK_SECRET=
5
- NEXT_PUBLIC_APP_URL=
6
- RESEND_API_KEY=
7
- EMAIL_FROM=
8
- GITHUB_APP_ID=
9
- GITHUB_APP_PRIVATE_KEY=
10
- GITHUB_APP_SLUG=
11
- DEEPGRAM_API_KEY=
12
- DEEPGRAM_PROJECT_ID=