MCPcopy Create free account
hub / github.com/codeaashu/claude-code / extractTeleportPlan

Function extractTeleportPlan

src/utils/ultraplan/ccrSession.ts:321–329  ·  view source on GitHub ↗
(
  content: ToolResultBlockParam['content'],
)

Source from the content-addressed store, hash-verified

319// Returns null when the sentinel is absent — callers treat null as a normal
320// user rejection (scanner falls through to { kind: 'rejected' }).
321function extractTeleportPlan(
322 content: ToolResultBlockParam['content'],
323): string | null {
324 const text = contentToText(content)
325 const marker = `${ULTRAPLAN_TELEPORT_SENTINEL}\n`
326 const idx = text.indexOf(marker)
327 if (idx === -1) return null
328 return text.slice(idx + marker.length).trimEnd()
329}
330
331// Plan is echoed in tool_result content as "## Approved Plan:\n<text>" or
332// "## Approved Plan (edited by user):\n<text>" (ExitPlanModeV2Tool).

Callers 1

ingestMethod · 0.85

Calls 1

contentToTextFunction · 0.85

Tested by

no test coverage detected