bootstrap_internal_agent
Initialize development workflows by converting triggers from GitHub, Slack, or Linear into structured context, creating recall packs, preparing sandbox environments, and generating execution plans.
Instructions
Normalize a GitHub/Slack/Linear trigger into startup context, construct a recall pack, prepare a git worktree sandbox, and emit an execution plus reviewer-lane plan.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source | Yes | ||
| repoPath | No | ||
| prepareSandbox | No | ||
| sandboxRoot | No | ||
| intentId | No | ||
| context | No | ||
| mcpProfile | No | ||
| partnerProfile | No | ||
| delegationMode | No | ||
| approved | No | ||
| trigger | No | ||
| thread | No | ||
| task | No | ||
| comments | No | ||
| messages | No |
Implementation Reference
- The core implementation of the bootstrapInternalAgent function, which handles context normalization, sandbox preparation, and intent planning.
function bootstrapInternalAgent(options = {}) { const invocation = normalizeInvocation(options); const startupContext = buildStartupContext(invocation); ensureContextFs(); const recallPack = constructContextPack({ query: buildRecallQuery(invocation), maxItems: 6, maxChars: 5000, }); const sandbox = invocation.prepareSandbox ? ensureWorktreeSandbox({ repoPath: invocation.repoPath, sandboxRoot: invocation.sandboxRoot, threadId: invocation.threadId, }) : { ready: false, kind: 'none', path: null, reused: false, baseRef: null, }; const plan = planIntent({ intentId: invocation.intentId, context: startupContext.text, mcpProfile: invocation.mcpProfile, partnerProfile: invocation.partnerProfile, delegationMode: invocation.delegationMode, approved: invocation.approved, repoPath: sandbox.path || invocation.repoPath || undefined, }); const reviewerLane = buildReviewerLane(plan); const codeGraphSection = formatCodeGraphRecallSection(plan.codegraphImpact); const middlewarePlan = buildMiddlewarePlan({ sandbox, recallPack, plan, reviewerLane, }); const payload = { generatedAt: new Date().toISOString(), invocation: { source: invocation.source, trigger: invocation.trigger, thread: invocation.thread, threadId: invocation.threadId, task: invocation.task, repoPath: invocation.repoPath, prepareSandbox: invocation.prepareSandbox, intentId: invocation.intentId, mcpProfile: invocation.mcpProfile || 'default', delegationMode: invocation.delegationMode, }, startupContext, recallPack: summarizePack(recallPack), sandbox, intentPlan: plan, reviewerLane, middlewarePlan, codeGraph: { enabled: Boolean(codeGraphSection), section: codeGraphSection, }, }; recordProvenance({ type: 'internal_agent_bootstrap_created', source: invocation.source, threadId: invocation.threadId, sandboxPath: sandbox.path, intentId: plan.intent.id, delegationEligible: plan.delegationEligible, packId: recallPack.packId, }); return payload; } - scripts/tool-registry.js:217-218 (registration)Registration of the 'bootstrap_internal_agent' tool in the tool registry.
name: 'bootstrap_internal_agent', description: 'Normalize a GitHub/Slack/Linear trigger into startup context, construct a recall pack, prepare a git worktree sandbox, and emit an execution plus reviewer-lane plan.', - adapters/mcp/server-stdio.js:444-445 (handler)MCP server request handler route for 'bootstrap_internal_agent'.
case 'bootstrap_internal_agent': return toTextResult(bootstrapInternalAgent(args));