@bike4mind/cli 0.2.38-fix-remove-unused-sharp-dependency.20166 → 0.2.38-fix-delegate-agent-timeout.20159

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.
@@ -3,7 +3,7 @@
3
3
  // package.json
4
4
  var package_default = {
5
5
  name: "@bike4mind/cli",
6
- version: "0.2.38-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
6
+ version: "0.2.38-fix-delegate-agent-timeout.20159+f9dcbadd4",
7
7
  type: "module",
8
8
  description: "Interactive CLI tool for Bike4Mind with ReAct agents",
9
9
  license: "UNLICENSED",
@@ -117,10 +117,10 @@ var package_default = {
117
117
  },
118
118
  devDependencies: {
119
119
  "@bike4mind/agents": "0.1.0",
120
- "@bike4mind/common": "2.58.1-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
121
- "@bike4mind/mcp": "1.32.6-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
122
- "@bike4mind/services": "2.54.2-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
123
- "@bike4mind/utils": "2.11.1-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
120
+ "@bike4mind/common": "2.58.1-fix-delegate-agent-timeout.20159+f9dcbadd4",
121
+ "@bike4mind/mcp": "1.32.6-fix-delegate-agent-timeout.20159+f9dcbadd4",
122
+ "@bike4mind/services": "2.54.2-fix-delegate-agent-timeout.20159+f9dcbadd4",
123
+ "@bike4mind/utils": "2.11.1-fix-delegate-agent-timeout.20159+f9dcbadd4",
124
124
  "@types/better-sqlite3": "^7.6.13",
125
125
  "@types/diff": "^5.0.9",
126
126
  "@types/jsonwebtoken": "^9.0.4",
@@ -138,7 +138,7 @@ var package_default = {
138
138
  optionalDependencies: {
139
139
  "@vscode/ripgrep": "^1.17.0"
140
140
  },
141
- gitHead: "24ec79c7fc8a7534bb5f38b842064006f0453264"
141
+ gitHead: "f9dcbadd4b2b22f860ced2edae7065406077e359"
142
142
  };
143
143
 
144
144
  // src/utils/updateChecker.ts
@@ -13324,7 +13324,241 @@ var generateMcpToolsFromCache = (serverName, cachedTools, callTool) => {
13324
13324
  };
13325
13325
 
13326
13326
  // ../../b4m-core/packages/services/dist/src/llm/agents/ServerSubagentOrchestrator.js
13327
- var SUBAGENT_TIMEOUT_MS = 5 * 60 * 1e3;
13327
+ var SUBAGENT_TIMEOUT_BY_THOROUGHNESS = {
13328
+ quick: 2 * 60 * 1e3,
13329
+ // 2 minutes
13330
+ medium: 5 * 60 * 1e3,
13331
+ // 5 minutes
13332
+ very_thorough: 10 * 60 * 1e3
13333
+ // 10 minutes
13334
+ };
13335
+
13336
+ // ../../b4m-core/packages/services/dist/src/llm/agents/CodeReviewAgent.js
13337
+ var CodeReviewAgent = (config) => ({
13338
+ name: "code_review",
13339
+ description: "Code review specialist for analyzing code quality, bugs, and improvements",
13340
+ model: config?.model ?? ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
13341
+ fallbackModels: [ChatModels.GPT4_1, ChatModels.GPT4_1_MINI],
13342
+ defaultThoroughness: config?.defaultThoroughness ?? "medium",
13343
+ maxIterations: { quick: 3, medium: 8, very_thorough: 15 },
13344
+ deniedTools: ["image_generation", "edit_image", "delegate_to_agent", ...config?.extraDeniedTools ?? []],
13345
+ allowedTools: config?.extraAllowedTools,
13346
+ systemPrompt: `You are a code review specialist. Your job is to analyze code for quality, correctness, security, and maintainability.
13347
+
13348
+ ## Focus Areas
13349
+ - Bugs, logic errors, and edge cases
13350
+ - Security vulnerabilities (injection, auth issues, data exposure)
13351
+ - Code quality and readability
13352
+ - Performance concerns
13353
+ - Adherence to project patterns and conventions
13354
+
13355
+ ## Review Process
13356
+ 1. Understand the context and intent of the code changes
13357
+ 2. Check for bugs, logic errors, and unhandled edge cases
13358
+ 3. Identify security vulnerabilities and data handling issues
13359
+ 4. Evaluate code clarity, naming, and structure
13360
+ 5. Look for performance problems or unnecessary complexity
13361
+
13362
+ ## Output Format
13363
+ Provide actionable feedback:
13364
+
13365
+ ### Critical Issues
13366
+ - Bugs, security vulnerabilities, or correctness problems that must be fixed
13367
+
13368
+ ### Suggestions
13369
+ - Code quality improvements with rationale
13370
+
13371
+ ### Positive Observations
13372
+ - Well-implemented patterns worth noting (optional)
13373
+
13374
+ Focus on actionable, specific feedback referencing exact code locations. Your review will be used by the main agent.`
13375
+ });
13376
+
13377
+ // ../../b4m-core/packages/services/dist/src/llm/agents/ProjectManagerAgent.js
13378
+ var ProjectManagerAgent = (config) => ({
13379
+ name: "project_manager",
13380
+ description: "Project management via Jira and Confluence (create issues, search, update status, manage attachments, write docs). ALWAYS delegate Jira/Confluence requests to this agent \u2014 you do not have direct access to these tools",
13381
+ model: config?.model ?? ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
13382
+ fallbackModels: [ChatModels.GPT4_1, ChatModels.GPT4_1_MINI],
13383
+ defaultThoroughness: config?.defaultThoroughness ?? "medium",
13384
+ maxIterations: { quick: 3, medium: 8, very_thorough: 15 },
13385
+ allowedTools: [...config?.extraAllowedTools ?? []],
13386
+ deniedTools: [...config?.extraDeniedTools ?? []],
13387
+ exclusiveMcpServers: ["atlassian"],
13388
+ systemPrompt: `You are a project management specialist with access to Jira and Confluence. Your job is to help manage projects, issues, documentation, and team workflows.
13389
+
13390
+ ## Capabilities
13391
+
13392
+ ### Jira
13393
+ - Search for issues using JQL
13394
+ - Create, update, and transition issues
13395
+ - Add comments and manage watchers
13396
+ - List projects and issue types
13397
+ - List, upload, download, and delete attachments on issues
13398
+
13399
+ ### Confluence
13400
+ - Search for documentation
13401
+ - Create and update pages
13402
+ - Browse spaces and page hierarchies
13403
+ - List, upload, download, and delete attachments on pages
13404
+
13405
+ ### Account & Identity
13406
+ - Check connected Jira account using \`atlassian__jira_get_current_user\`
13407
+ - Check connected Confluence account using \`atlassian__confluence_get_current_user\`
13408
+ - Look up users by name or email using \`atlassian__jira_search_users\`
13409
+
13410
+ ## Best Practices
13411
+ 1. When searching Jira, use precise JQL queries (e.g., \`project = PROJ AND status = "In Progress"\`)
13412
+ 2. When creating issues, always check available issue types first with \`atlassian__jira_list_issue_types\`
13413
+ 3. When updating issue status, use \`atlassian__jira_update_issue_transition\` with the target status name
13414
+ 4. When creating Confluence pages, use the user's personal space if no space is specified
13415
+ 5. Always confirm destructive operations (delete) with the user before proceeding
13416
+ 6. When asked about the connected Atlassian account call BOTH \`atlassian__jira_get_current_user\` and \`atlassian__confluence_get_current_user\` to show the full picture. Present results clearly labeled by product, and note if either service is not connected. NEVER say you don't have access to account information \u2014 you DO have these tools.
13417
+ 7. When asked specifically about "Jira account" or "Confluence account" only, use the respective tool alone.
13418
+ 8. When asked about attachments, ALWAYS use the attachment tools \u2014 never guess or fabricate attachment details. For uploading files shared in Slack, pass the \`fabFileId\` from the message context to \`atlassian__jira_upload_attachment\` or \`atlassian__confluence_upload_attachment\`.
13419
+
13420
+ ## Output Format
13421
+ Provide a clear summary of actions taken:
13422
+ 1. What was done (created, updated, searched, etc.)
13423
+ 2. Links or keys to relevant items (e.g., PROJ-123)
13424
+ 3. Any issues or warnings encountered
13425
+
13426
+ Be precise with issue keys and project names. Your results will be used by the main agent.`
13427
+ });
13428
+
13429
+ // ../../b4m-core/packages/services/dist/src/llm/agents/GithubManagerAgent.js
13430
+ var GithubManagerAgent = (config) => ({
13431
+ name: "github_manager",
13432
+ description: "GitHub operations (issues, pull requests, code search, branches, workflows, reviews). ALWAYS delegate GitHub requests to this agent \u2014 you do not have direct access to these tools",
13433
+ model: config?.model ?? ChatModels.CLAUDE_4_6_SONNET_BEDROCK,
13434
+ defaultThoroughness: config?.defaultThoroughness ?? "medium",
13435
+ maxIterations: { quick: 3, medium: 8, very_thorough: 15 },
13436
+ allowedTools: [...config?.extraAllowedTools ?? []],
13437
+ deniedTools: [...config?.extraDeniedTools ?? []],
13438
+ exclusiveMcpServers: ["github"],
13439
+ systemPrompt: `You are a GitHub specialist with access to GitHub's API. Your job is to help manage repositories, issues, pull requests, code search, branches, and CI/CD workflows.
13440
+
13441
+ ## First Step: ALWAYS Resolve Repository Context Automatically
13442
+ Before doing ANYTHING else, call the \`github__current_user\` tool. The response includes:
13443
+ - **selected_repositories**: The list of repositories the user has enabled for AI access (in \`owner/repo\` format)
13444
+ - **user**: The authenticated user's profile (login, name, etc.)
13445
+
13446
+ ### Repository Resolution Rules (CRITICAL)
13447
+ You MUST use the selected_repositories list to automatically resolve the owner and repo. NEVER ask the user for the org, owner, or full repository path. Instead:
13448
+
13449
+ 1. **Exact match**: If the user says a repo name that exactly matches a repo name in selected_repositories, use it immediately.
13450
+ 2. **Partial/fuzzy match**: If the user provides a partial name, match it against any repo in selected_repositories whose name contains that term (e.g., if the user says "lumina" and selected_repositories contains \`SomeOrg/lumina5\`, use that).
13451
+ 3. **Single repo shortcut**: If only one repository is selected, ALWAYS default to it \u2014 no questions asked.
13452
+ 4. **Multiple matches**: Only if multiple selected repos match the user's term AND you truly cannot disambiguate, list the matching repos and ask which one. Do NOT list repos that don't match.
13453
+ 5. **No match**: If nothing in selected_repositories matches, tell the user which repos are available and ask them to clarify.
13454
+
13455
+ **NEVER ask the user to "paste the GitHub URL" or provide the org/owner name.** You already have this information from \`github__current_user\`. The owner and repo are embedded in the \`owner/repo\` format of each selected repository entry.
13456
+
13457
+ ### Defaults for Ambiguous Requests
13458
+ - **Timezone**: Default to UTC unless the user specifies otherwise.
13459
+ - **PR/Issue state**: Default to \`open\` unless the user specifies otherwise.
13460
+ - **Scope**: All matching repos unless the user narrows it down.
13461
+ - **When in doubt, act**: Prefer making reasonable assumptions and proceeding over asking clarifying questions. You can always note your assumptions in the response.
13462
+
13463
+ ## Capabilities
13464
+
13465
+ ### Issues
13466
+ - Create, update, and search issues
13467
+ - Add comments and manage labels
13468
+ - List and filter issues by state, assignee, labels
13469
+
13470
+ ### Pull Requests
13471
+ - Create, update, and list pull requests
13472
+ - Get PR diffs, files changed, and review status
13473
+ - Merge pull requests and manage reviews
13474
+ - Request reviews from team members
13475
+
13476
+ ### Code & Repository
13477
+ - Search code across repositories
13478
+ - Get file contents and commit history
13479
+ - Create and list branches and tags
13480
+ - Fork repositories
13481
+
13482
+ ### CI/CD & Workflows
13483
+ - List and monitor workflow runs
13484
+ - Get job logs for debugging failures
13485
+ - Re-run failed jobs or entire workflows
13486
+ - Download workflow artifacts
13487
+
13488
+ ### Notifications
13489
+ - List and manage GitHub notifications
13490
+ - Mark notifications as read/done
13491
+
13492
+ ## Performance Tips
13493
+ 1. **Use \`search_pull_requests\` for date-filtered queries**: When asked for PRs within a date range (e.g., "PRs closed in the last 7 days"), use \`search_pull_requests\` with the \`since\` parameter instead of paginating through \`list_pull_requests\`. This returns filtered results in a single call.
13494
+ 2. **Always use per_page: 100**: When listing PRs, issues, or any paginated endpoint, always set \`per_page: 100\` to minimize the number of API calls needed.
13495
+ 3. **Avoid fetching individual PR details unless necessary**: The list/search endpoints include title, state, labels, dates, and branch info. Only call \`get_pull_request\` if you need body, mergeable status, or review details.
13496
+
13497
+ ## Best Practices
13498
+ 1. When searching issues or PRs, use GitHub search syntax (e.g., \`is:open label:bug assignee:username\`)
13499
+ 2. When creating PRs, always include a clear title and description
13500
+ 3. When reviewing PR changes, use \`get_pull_request_diff\` or \`get_pull_request_files\` for context
13501
+ 4. For CI/CD debugging, use \`get_job_logs\` with \`failed_only=true\` to focus on failures
13502
+ 5. Always include links to issues/PRs in your responses (e.g., owner/repo#123)
13503
+
13504
+ ## Output Format
13505
+ Provide a clear summary of actions taken:
13506
+ 1. What was done (created, searched, merged, etc.)
13507
+ 2. Always provide links to relevant items (e.g., owner/repo#123, PR URLs)
13508
+ 3. Any issues or warnings encountered
13509
+
13510
+ Be precise with repository names, issue numbers, and PR numbers. Your results will be used by the main agent.
13511
+
13512
+ ## Write Operations & Confirmation
13513
+ Write tools (create issue, update issue, comment, merge PR, etc.) have a built-in confirmation system. When you call them, they return a preview with Confirm/Cancel buttons \u2014 the user clicks to execute. **NEVER ask the user for text confirmation before calling a write tool.** Just call the tool immediately. The tool handles confirmation automatically.
13514
+
13515
+ **CRITICAL: When a write tool returns \`"confirmation_required": true\`, the action has NOT been executed yet.** It is a preview awaiting user confirmation via buttons. Your summary MUST say the action is **awaiting confirmation**, NOT that it was completed. Example:
13516
+ - \u2705 "A comment preview is ready on PR #123. Click Confirm below to post it."
13517
+ - \u274C "Done! The comment has been posted on PR #123." (WRONG \u2014 it hasn't been posted yet)`
13518
+ });
13519
+
13520
+ // ../../b4m-core/packages/services/dist/src/llm/agents/ServerAgentStore.js
13521
+ var ServerAgentStore = class {
13522
+ constructor() {
13523
+ const builtInAgents = [
13524
+ // For now disable explore and plan agents as it is much faster if the parent llm handles this.
13525
+ // ExploreAgent(),
13526
+ // PlanAgent(),
13527
+ CodeReviewAgent(),
13528
+ ProjectManagerAgent(),
13529
+ GithubManagerAgent()
13530
+ ];
13531
+ this.agents = new Map(builtInAgents.map((a) => [a.name, a]));
13532
+ }
13533
+ getAgent(name) {
13534
+ return this.agents.get(name);
13535
+ }
13536
+ getAllAgents() {
13537
+ return Array.from(this.agents.values());
13538
+ }
13539
+ getAgentNames() {
13540
+ return Array.from(this.agents.keys());
13541
+ }
13542
+ hasAgent(name) {
13543
+ return this.agents.has(name);
13544
+ }
13545
+ /**
13546
+ * Get the deduplicated list of MCP server names that are exclusive to agents.
13547
+ * Derived from each agent's `exclusiveMcpServers` field.
13548
+ */
13549
+ getExclusiveMcpServers() {
13550
+ const servers = /* @__PURE__ */ new Set();
13551
+ for (const agent of this.agents.values()) {
13552
+ if (agent.exclusiveMcpServers) {
13553
+ for (const s of agent.exclusiveMcpServers) {
13554
+ servers.add(s);
13555
+ }
13556
+ }
13557
+ }
13558
+ return Array.from(servers);
13559
+ }
13560
+ };
13561
+ var serverAgentStore = new ServerAgentStore();
13328
13562
 
13329
13563
  // ../../b4m-core/packages/services/dist/src/llm/ChatCompletionProcess.js
13330
13564
  import throttle2 from "lodash/throttle.js";
@@ -15079,7 +15313,7 @@ var MCPClient = class {
15079
15313
  onStderrLine;
15080
15314
  tools = [];
15081
15315
  serverName;
15082
- constructor({ envVariables, name, command, args, suppressStderr = false, onStderrLine }) {
15316
+ constructor({ envVariables, name, selectedRepositories, command, args, suppressStderr = false, onStderrLine }) {
15083
15317
  this.mcp = new Client2({ name: "mcp-client-cli", version: "1.0.0" });
15084
15318
  this.envVariables = [...envVariables];
15085
15319
  this.serverName = name;
@@ -15087,6 +15321,13 @@ var MCPClient = class {
15087
15321
  this.customArgs = args;
15088
15322
  this.suppressStderr = suppressStderr;
15089
15323
  this.onStderrLine = onStderrLine;
15324
+ if (name === "github" && selectedRepositories) {
15325
+ const reposJson = JSON.stringify(selectedRepositories);
15326
+ this.envVariables.push({
15327
+ key: "SELECTED_REPOSITORIES",
15328
+ value: reposJson
15329
+ });
15330
+ }
15090
15331
  }
15091
15332
  async connectToServer() {
15092
15333
  try {
@@ -3,7 +3,7 @@ import {
3
3
  fetchLatestVersion,
4
4
  forceCheckForUpdate,
5
5
  package_default
6
- } from "../chunk-VKY5MM7G.js";
6
+ } from "../chunk-4KXRKTAG.js";
7
7
 
8
8
  // src/commands/doctorCommand.ts
9
9
  import { execSync } from "child_process";
@@ -36,7 +36,7 @@ import {
36
36
  isReadOnlyTool,
37
37
  loadContextFiles,
38
38
  setWebSocketToolExecutor
39
- } from "../chunk-4KRFJ4XO.js";
39
+ } from "../chunk-AIXD7O5A.js";
40
40
  import "../chunk-BDQBOLYG.js";
41
41
  import "../chunk-J3YSVA6W.js";
42
42
  import "../chunk-GQGOWACU.js";
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  forceCheckForUpdate,
4
4
  package_default
5
- } from "../chunk-VKY5MM7G.js";
5
+ } from "../chunk-4KXRKTAG.js";
6
6
 
7
7
  // src/commands/updateCommand.ts
8
8
  import { execSync } from "child_process";
package/dist/index.js CHANGED
@@ -46,7 +46,7 @@ import {
46
46
  setWebSocketToolExecutor,
47
47
  substituteArguments,
48
48
  warmFileCache
49
- } from "./chunk-4KRFJ4XO.js";
49
+ } from "./chunk-AIXD7O5A.js";
50
50
  import "./chunk-BDQBOLYG.js";
51
51
  import "./chunk-J3YSVA6W.js";
52
52
  import "./chunk-GQGOWACU.js";
@@ -62,7 +62,7 @@ import {
62
62
  import {
63
63
  checkForUpdate,
64
64
  package_default
65
- } from "./chunk-VKY5MM7G.js";
65
+ } from "./chunk-4KXRKTAG.js";
66
66
  import {
67
67
  selectActiveBackgroundAgents,
68
68
  useCliStore
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bike4mind/cli",
3
- "version": "0.2.38-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
3
+ "version": "0.2.38-fix-delegate-agent-timeout.20159+f9dcbadd4",
4
4
  "type": "module",
5
5
  "description": "Interactive CLI tool for Bike4Mind with ReAct agents",
6
6
  "license": "UNLICENSED",
@@ -114,10 +114,10 @@
114
114
  },
115
115
  "devDependencies": {
116
116
  "@bike4mind/agents": "0.1.0",
117
- "@bike4mind/common": "2.58.1-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
118
- "@bike4mind/mcp": "1.32.6-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
119
- "@bike4mind/services": "2.54.2-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
120
- "@bike4mind/utils": "2.11.1-fix-remove-unused-sharp-dependency.20166+24ec79c7f",
117
+ "@bike4mind/common": "2.58.1-fix-delegate-agent-timeout.20159+f9dcbadd4",
118
+ "@bike4mind/mcp": "1.32.6-fix-delegate-agent-timeout.20159+f9dcbadd4",
119
+ "@bike4mind/services": "2.54.2-fix-delegate-agent-timeout.20159+f9dcbadd4",
120
+ "@bike4mind/utils": "2.11.1-fix-delegate-agent-timeout.20159+f9dcbadd4",
121
121
  "@types/better-sqlite3": "^7.6.13",
122
122
  "@types/diff": "^5.0.9",
123
123
  "@types/jsonwebtoken": "^9.0.4",
@@ -135,5 +135,5 @@
135
135
  "optionalDependencies": {
136
136
  "@vscode/ripgrep": "^1.17.0"
137
137
  },
138
- "gitHead": "24ec79c7fc8a7534bb5f38b842064006f0453264"
138
+ "gitHead": "f9dcbadd4b2b22f860ced2edae7065406077e359"
139
139
  }