edsger 0.53.0 → 0.54.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 (148) hide show
  1. package/README.md +20 -0
  2. package/dist/api/financing.d.ts +47 -0
  3. package/dist/api/financing.js +37 -0
  4. package/dist/api/issues/approval-checker.d.ts +11 -9
  5. package/dist/api/issues/approval-checker.js +30 -41
  6. package/dist/api/issues/status-updater.d.ts +47 -20
  7. package/dist/api/issues/status-updater.js +114 -46
  8. package/dist/api/issues/update-issue.d.ts +5 -0
  9. package/dist/api/issues/update-issue.js +6 -0
  10. package/dist/commands/agent-workflow/processor.js +5 -1
  11. package/dist/commands/checklists/index.d.ts +5 -2
  12. package/dist/commands/checklists/index.js +73 -12
  13. package/dist/commands/checklists/tools.d.ts +14 -7
  14. package/dist/commands/checklists/tools.js +15 -208
  15. package/dist/commands/financing-deck/index.d.ts +8 -0
  16. package/dist/commands/financing-deck/index.js +66 -0
  17. package/dist/commands/find-architecture/index.d.ts +13 -0
  18. package/dist/commands/find-architecture/index.js +41 -0
  19. package/dist/commands/sync-github-issues/index.d.ts +11 -0
  20. package/dist/commands/sync-github-issues/index.js +42 -0
  21. package/dist/commands/sync-sentry-issues/index.d.ts +14 -0
  22. package/dist/commands/sync-sentry-issues/index.js +73 -0
  23. package/dist/commands/workflow/executors/phase-executor.js +6 -4
  24. package/dist/commands/workflow/phase-orchestrator.js +0 -1
  25. package/dist/config/issue-status.d.ts +18 -45
  26. package/dist/config/issue-status.js +21 -107
  27. package/dist/index.js +97 -3
  28. package/dist/phases/app-store-generation/agent.js +2 -1
  29. package/dist/phases/app-store-generation/index.js +11 -3
  30. package/dist/phases/autonomous/index.js +9 -6
  31. package/dist/phases/branch-planning/index.js +1 -2
  32. package/dist/phases/branch-planning/prompts.d.ts +1 -1
  33. package/dist/phases/branch-planning/prompts.js +3 -2
  34. package/dist/phases/bug-fixing/analyzer.js +6 -3
  35. package/dist/phases/bug-fixing/mcp-server.d.ts +18 -1
  36. package/dist/phases/bug-fixing/mcp-server.js +19 -76
  37. package/dist/phases/chat-processor/product-tools.d.ts +5 -8
  38. package/dist/phases/chat-processor/product-tools.js +6 -512
  39. package/dist/phases/chat-processor/tools.d.ts +5 -9
  40. package/dist/phases/chat-processor/tools.js +6 -704
  41. package/dist/phases/code-implementation/branch-pr-creator.js +7 -5
  42. package/dist/phases/code-implementation/index.js +6 -3
  43. package/dist/phases/code-implementation-verification/agent.js +6 -1
  44. package/dist/phases/code-refine/index.js +8 -6
  45. package/dist/phases/code-refine/refine-iteration.js +2 -1
  46. package/dist/phases/code-review/index.js +8 -6
  47. package/dist/phases/code-testing/analyzer.js +11 -8
  48. package/dist/phases/financing-deck/agent.d.ts +1 -0
  49. package/dist/phases/financing-deck/agent.js +96 -0
  50. package/dist/phases/financing-deck/context.d.ts +13 -0
  51. package/dist/phases/financing-deck/context.js +69 -0
  52. package/dist/phases/financing-deck/index.d.ts +15 -0
  53. package/dist/phases/financing-deck/index.js +89 -0
  54. package/dist/phases/financing-deck/prompts.d.ts +2 -0
  55. package/dist/phases/financing-deck/prompts.js +94 -0
  56. package/dist/phases/find-architecture/index.d.ts +44 -0
  57. package/dist/phases/find-architecture/index.js +248 -0
  58. package/dist/phases/find-architecture/prompts.d.ts +31 -0
  59. package/dist/phases/find-architecture/prompts.js +128 -0
  60. package/dist/phases/find-architecture/state.d.ts +21 -0
  61. package/dist/phases/find-architecture/state.js +17 -0
  62. package/dist/phases/find-architecture/types.d.ts +55 -0
  63. package/dist/phases/find-architecture/types.js +69 -0
  64. package/dist/phases/find-bugs/index.js +13 -4
  65. package/dist/phases/find-features/index.js +10 -5
  66. package/dist/phases/find-smells/index.js +10 -3
  67. package/dist/phases/functional-testing/analyzer.js +27 -17
  68. package/dist/phases/functional-testing/http-fallback.d.ts +1 -1
  69. package/dist/phases/functional-testing/http-fallback.js +32 -16
  70. package/dist/phases/functional-testing/mcp-server.d.ts +9 -1
  71. package/dist/phases/functional-testing/mcp-server.js +13 -132
  72. package/dist/phases/growth-analysis/agent.js +2 -2
  73. package/dist/phases/growth-analysis/index.js +9 -3
  74. package/dist/phases/intelligence-analysis/agent.js +2 -2
  75. package/dist/phases/intelligence-analysis/index.js +9 -2
  76. package/dist/phases/issue-analysis/agent.d.ts +9 -1
  77. package/dist/phases/issue-analysis/agent.js +68 -27
  78. package/dist/phases/issue-analysis/context.d.ts +5 -9
  79. package/dist/phases/issue-analysis/context.js +31 -76
  80. package/dist/phases/issue-analysis/index.js +32 -84
  81. package/dist/phases/issue-analysis/outcome.d.ts +3 -33
  82. package/dist/phases/issue-analysis/outcome.js +15 -253
  83. package/dist/phases/issue-analysis/prompts.d.ts +3 -5
  84. package/dist/phases/issue-analysis/prompts.js +45 -158
  85. package/dist/phases/issue-analysis-verification/agent.d.ts +4 -4
  86. package/dist/phases/issue-analysis-verification/agent.js +5 -5
  87. package/dist/phases/issue-analysis-verification/index.d.ts +4 -2
  88. package/dist/phases/issue-analysis-verification/index.js +9 -22
  89. package/dist/phases/issue-analysis-verification/prompts.d.ts +1 -2
  90. package/dist/phases/issue-analysis-verification/prompts.js +21 -46
  91. package/dist/phases/output-contracts.js +66 -78
  92. package/dist/phases/pr-execution/context.d.ts +2 -0
  93. package/dist/phases/pr-execution/context.js +1 -0
  94. package/dist/phases/pr-execution/index.js +28 -19
  95. package/dist/phases/pr-execution/prompts.d.ts +2 -1
  96. package/dist/phases/pr-execution/prompts.js +12 -10
  97. package/dist/phases/pr-resolve/index.js +2 -8
  98. package/dist/phases/pr-splitting/index.js +3 -3
  99. package/dist/phases/pr-splitting/prompts.d.ts +1 -1
  100. package/dist/phases/pr-splitting/prompts.js +3 -2
  101. package/dist/phases/pull-request/creator.js +10 -7
  102. package/dist/phases/pull-request/handler.js +3 -1
  103. package/dist/phases/release-sync/index.js +52 -43
  104. package/dist/phases/run-sheet/index.js +2 -1
  105. package/dist/phases/smoke-test/agent.js +2 -1
  106. package/dist/phases/smoke-test/index.js +4 -1
  107. package/dist/phases/sync-github-issues/index.d.ts +41 -0
  108. package/dist/phases/sync-github-issues/index.js +187 -0
  109. package/dist/phases/sync-github-issues/state.d.ts +26 -0
  110. package/dist/phases/sync-github-issues/state.js +18 -0
  111. package/dist/phases/sync-github-issues/types.d.ts +35 -0
  112. package/dist/phases/sync-github-issues/types.js +6 -0
  113. package/dist/phases/sync-sentry-issues/index.d.ts +29 -0
  114. package/dist/phases/sync-sentry-issues/index.js +153 -0
  115. package/dist/phases/sync-sentry-issues/sentry-client.d.ts +66 -0
  116. package/dist/phases/sync-sentry-issues/sentry-client.js +221 -0
  117. package/dist/phases/sync-sentry-issues/state.d.ts +23 -0
  118. package/dist/phases/sync-sentry-issues/state.js +18 -0
  119. package/dist/phases/sync-sentry-issues/types.d.ts +46 -0
  120. package/dist/phases/sync-sentry-issues/types.js +6 -0
  121. package/dist/phases/sync-shared/mcp.d.ts +81 -0
  122. package/dist/phases/sync-shared/mcp.js +111 -0
  123. package/dist/phases/technical-design/index.js +0 -1
  124. package/dist/phases/test-cases-analysis/agent.js +2 -1
  125. package/dist/phases/test-cases-analysis/index.js +0 -1
  126. package/dist/phases/user-stories-analysis/agent.js +2 -1
  127. package/dist/phases/user-stories-analysis/index.js +0 -1
  128. package/dist/services/coaching/coaching-agent.js +29 -4
  129. package/dist/services/feedbacks.d.ts +1 -1
  130. package/dist/services/repo-config.d.ts +17 -0
  131. package/dist/services/repo-config.js +50 -0
  132. package/dist/skills/phase/issue-analysis/SKILL.md +48 -92
  133. package/dist/skills/phase/issue-analysis-verification/SKILL.md +46 -31
  134. package/dist/tools/bootstrap.d.ts +45 -0
  135. package/dist/tools/bootstrap.js +50 -0
  136. package/dist/types/external-sources.d.ts +22 -0
  137. package/dist/types/external-sources.js +23 -0
  138. package/dist/types/index.d.ts +5 -10
  139. package/dist/types/issues.d.ts +2 -0
  140. package/dist/types/llm-responses.d.ts +1 -14
  141. package/dist/utils/formatters.js +1 -7
  142. package/dist/utils/git-branch-manager-async.js +9 -5
  143. package/dist/utils/git-branch-manager.js +17 -7
  144. package/dist/workspace/workspace-manager.d.ts +10 -0
  145. package/dist/workspace/workspace-manager.js +22 -1
  146. package/package.json +6 -2
  147. package/vitest.config.ts +4 -0
  148. package/.env.local +0 -12
@@ -1,9 +1,10 @@
1
+ import { getDefaultBranchForIssue } from '../../services/repo-config.js';
1
2
  import { resolveSkill, substituteVariables, } from '../../services/skill-resolver.js';
2
3
  import { OUTPUT_CONTRACTS } from '../output-contracts.js';
3
4
  /**
4
5
  * Create the system prompt for branch planning
5
6
  */
6
- export async function createBranchPlanningSystemPrompt(config, issueId, projectDir) {
7
+ export async function createBranchPlanningSystemPrompt(config, issueId, projectDir, verbose) {
7
8
  const skill = await resolveSkill('phase/branch-planning', {
8
9
  projectDir,
9
10
  });
@@ -12,7 +13,7 @@ export async function createBranchPlanningSystemPrompt(config, issueId, projectD
12
13
  }
13
14
  let { prompt } = skill;
14
15
  prompt = substituteVariables(prompt, {
15
- BASE_BRANCH: 'main',
16
+ BASE_BRANCH: await getDefaultBranchForIssue(issueId, verbose),
16
17
  ISSUE_ID: issueId,
17
18
  });
18
19
  return `${prompt}\n\n${OUTPUT_CONTRACTS['branch-planning']}`;
@@ -1,6 +1,7 @@
1
1
  import { query } from '@anthropic-ai/claude-agent-sdk';
2
2
  import { DEFAULT_MODEL } from '../../constants.js';
3
3
  import { formatFeedbacksForContext, getFeedbacksForPhase, } from '../../services/feedbacks.js';
4
+ import { getDefaultBranchForIssue } from '../../services/repo-config.js';
4
5
  import { preparePhaseGitEnvironment } from '../../utils/git-branch-manager.js';
5
6
  import { extractJsonFromResponse } from '../../utils/json-extractor.js';
6
7
  import { logDebug, logError, logInfo } from '../../utils/logger.js';
@@ -32,14 +33,16 @@ async function* prompt(bugFixPrompt) {
32
33
  setTimeout(res, 10000);
33
34
  });
34
35
  }
35
- // eslint-disable-next-line complexity
36
36
  export const fixTestFailures = async (options, config) => {
37
37
  const { issueId, testErrors, attemptNumber = 1, verbose } = options;
38
38
  if (verbose) {
39
39
  logInfo(`Starting bug fixing for issue ID: ${issueId} (Attempt ${attemptNumber})`);
40
40
  }
41
- // Prepare git environment: switch to issue branch and rebase with main
42
- const cleanupGit = preparePhaseGitEnvironment(issueId, 'main', verbose);
41
+ // Prepare git environment: switch to issue branch and rebase with the
42
+ // repo's default branch (resolved via GitHub API for consistency with
43
+ // other phases — same source of truth for forks where origin/HEAD may lag).
44
+ const defaultBranch = await getDefaultBranchForIssue(issueId, verbose);
45
+ const cleanupGit = preparePhaseGitEnvironment(issueId, defaultBranch, verbose);
43
46
  try {
44
47
  // Fetch all required context information via MCP endpoints
45
48
  if (verbose) {
@@ -1 +1,18 @@
1
- export declare const createBugFixingMcpServer: () => import("@anthropic-ai/claude-agent-sdk").McpSdkServerConfigWithInstance;
1
+ /**
2
+ * Bug-fixing MCP server — CLI entry point.
3
+ *
4
+ * The actual tool implementations live in `edsger-tools`. This file only
5
+ * adapts the CLI's `callMcpEndpoint` transport into the `ToolDeps`
6
+ * shape that `createBugFixingMcpServer` expects.
7
+ */
8
+ import type { McpSdkServerConfigWithInstance } from '@anthropic-ai/claude-agent-sdk';
9
+ /**
10
+ * Build the bug-fixing MCP server bound to the CLI's auth-store-backed
11
+ * MCP transport. Same return shape as the previous in-package
12
+ * implementation; existing callers do not need to change.
13
+ *
14
+ * Explicit return type pins the inferred type to the CLI's own copy of
15
+ * `@anthropic-ai/claude-agent-sdk` rather than the nested copy under
16
+ * `edsger-tools/node_modules`, which TS otherwise warns is non-portable.
17
+ */
18
+ export declare const createBugFixingMcpServer: () => McpSdkServerConfigWithInstance;
@@ -1,76 +1,19 @@
1
- import { createSdkMcpServer, tool } from '@anthropic-ai/claude-agent-sdk';
2
- import { z } from 'zod';
3
- import { callMcpEndpoint } from '../../api/mcp-client.js';
4
- import { logError } from '../../utils/logger.js';
5
- // Create an SDK MCP server with custom tools for bug fixing
6
- export const createBugFixingMcpServer = () => {
7
- return createSdkMcpServer({
8
- name: 'edsger-bug-fixing-mcp',
9
- version: '1.0.0',
10
- tools: [
11
- tool('get_issue_with_test_reports', 'Get issue information including technical design, implementation details, and test reports', {
12
- issue_id: z
13
- .string()
14
- .describe('Issue ID to get information and test results for'),
15
- }, async (args) => {
16
- try {
17
- // Get issue details
18
- const issueResult = (await callMcpEndpoint('issues/get', {
19
- issue_id: args.issue_id,
20
- }));
21
- if (!issueResult.issues || issueResult.issues.length === 0) {
22
- throw new Error('Issue not found');
23
- }
24
- const issue = issueResult.issues[0];
25
- // Get user stories to understand requirements
26
- const userStoriesResult = (await callMcpEndpoint('user_stories/list', { issue_id: args.issue_id }));
27
- // Get test cases to understand what needs to pass
28
- const testCasesResult = (await callMcpEndpoint('test_cases/list', {
29
- issue_id: args.issue_id,
30
- }));
31
- // Get latest test report to understand what has been tested
32
- const testReportResult = (await callMcpEndpoint('test_reports/latest', { issue_id: args.issue_id }));
33
- const completeInfo = {
34
- issue,
35
- user_stories: userStoriesResult.user_stories || [],
36
- test_cases: testCasesResult.test_cases || [],
37
- latest_test_report: testReportResult.test_report || null,
38
- technical_design: issue.technical_design || null,
39
- };
40
- return {
41
- content: [
42
- {
43
- type: 'text',
44
- text: JSON.stringify(completeInfo, null, 2),
45
- },
46
- ],
47
- };
48
- }
49
- catch (error) {
50
- logError(`Error in get_issue_with_test_reports: ${error}`);
51
- throw error;
52
- }
53
- }),
54
- tool('verify_fix', 'Verify that the bug fix addresses the test failures', {
55
- issue_id: z.string().describe('Issue ID to verify the fix for'),
56
- fix_summary: z.string().describe('Summary of the fixes applied'),
57
- files_modified: z
58
- .array(z.string())
59
- .describe('List of files that were modified'),
60
- }, (args) => Promise.resolve({
61
- content: [
62
- {
63
- type: 'text',
64
- text: JSON.stringify({
65
- verified: true,
66
- issue_id: args.issue_id,
67
- summary: args.fix_summary,
68
- files_modified: args.files_modified,
69
- message: 'Bug fix verification complete',
70
- }, null, 2),
71
- },
72
- ],
73
- })),
74
- ],
75
- });
76
- };
1
+ /**
2
+ * Bug-fixing MCP server — CLI entry point.
3
+ *
4
+ * The actual tool implementations live in `edsger-tools`. This file only
5
+ * adapts the CLI's `callMcpEndpoint` transport into the `ToolDeps`
6
+ * shape that `createBugFixingMcpServer` expects.
7
+ */
8
+ import { createBugFixingMcpServer as createBugFixingMcpServerCore } from 'edsger-tools';
9
+ import { getToolDeps } from '../../tools/bootstrap.js';
10
+ /**
11
+ * Build the bug-fixing MCP server bound to the CLI's auth-store-backed
12
+ * MCP transport. Same return shape as the previous in-package
13
+ * implementation; existing callers do not need to change.
14
+ *
15
+ * Explicit return type pins the inferred type to the CLI's own copy of
16
+ * `@anthropic-ai/claude-agent-sdk` rather than the nested copy under
17
+ * `edsger-tools/node_modules`, which TS otherwise warns is non-portable.
18
+ */
19
+ export const createBugFixingMcpServer = () => createBugFixingMcpServerCore(getToolDeps());
@@ -1,11 +1,8 @@
1
1
  /**
2
- * Product Chat MCP server — registers product-level tools with the Claude Agent SDK.
2
+ * Chat (product) MCP server — CLI entry point.
3
3
  *
4
- * Unlike the issue chat tools which operate on a single issue's lifecycle
5
- * (stories, tests, workflow), these tools operate at the product level:
6
- * listing issues, creating issues, managing tasks, and team coordination.
4
+ * Tool implementations live in `edsger-tools`. This shim adapts the
5
+ * CLI's `callMcpEndpoint` transport into `ToolDeps`.
7
6
  */
8
- /**
9
- * Create an in-process MCP server with product-level chat tools.
10
- */
11
- export declare function createProductChatMcpServer(): import("@anthropic-ai/claude-agent-sdk").McpSdkServerConfigWithInstance;
7
+ import type { McpSdkServerConfigWithInstance } from '@anthropic-ai/claude-agent-sdk';
8
+ export declare function createProductChatMcpServer(): McpSdkServerConfigWithInstance;