# Repo Index (ast-grep 0.45.0)

Generated 2026-07-31T12:21:23.529Z — AST symbol index for ADR 0002 implementation planning.

Source: `integrations/`, `src/`, `scripts/`. Test/smoke files summarized in Tests section.

## integrations/common/components/TextOverlay.ts

| kind | symbol |
|---|---|
| type | `TextOverlayContent` |
| type | `TextOverlayOptions` |
| type | `ScrollableTextOverlayOptions` |
| const | `targetWidth` |
| const | `fitted` |
| const | `remaining` |
| const | `values` |
| const | `panelWidth` |
| const | `innerWidth` |
| const | `maxOffset` |
| const | `endIndex` |
| const | `visibleLines` |
| const | `hasScrollbar` |
| const | `scrollbarWidth` |
| const | `contentWidth` |
| const | `value` |
| const | `range` |
| const | `clampedOffset` |
| const | `maximumTitleWidth` |
| const | `title` |
| const | `titleSegment` |
| const | `usedWidth` |
| const | `trailingWidth` |
| const | `availableWidth` |
| const | `padding` |
| const | `content` |
| const | `scrollbar` |
| const | `thumbSize` |
| const | `availableTravel` |
| const | `thumbStart` |
| const | `thumbEnd` |
| const | `formattedContent` |
| const | `lines` |

## integrations/common/utils/generateHandle.ts

| kind | symbol |
|---|---|
| const | `pickRandomN` |
| const | `adjectives` |
| const | `nouns` |
| const | `adjective` |
| const | `noun` |
| const | `suffix` |

## integrations/pi-extension.ts

| kind | symbol |
|---|---|
| function | `splitArgs` |
| function | `parseOptionArgs` |
| function | `completeAmqBridgeArgs` |
| function | `loadConfig` |
| function | `bridgeRoot` |
| function | `bridgeDir` |
| function | `safeKey` |
| function | `statePath` |
| function | `inboxPath` |
| function | `injectedPath` |
| function | `run` |
| function | `readState` |
| function | `writeState` |
| function | `extraPeersPath` |
| function | `addExtraPeer` |
| function | `isUsableBridgeState` |
| function | `latestSessionBridgeState` |
| function | `currentBridgeState` |
| function | `hasStaleSessionBridgeState` |
| function | `persistBridgeState` |
| function | `addPeer` |
| function | `removePeer` |
| function | `setPrimaryPeer` |
| function | `summarizePeers` |
| function | `bridgeContextMessage` |
| function | `discoveryReport` |
| function | `discoveredAgents` |
| function | `formatDiscovery` |
| function | `readInboxBuffer` |
| function | `writeInboxBuffer` |
| function | `appendDedupeMessages` |
| function | `isHousekeepingMessage` |
| function | `actionableMessages` |
| function | `ambiguousReplyText` |
| function | `messageKey` |
| function | `readInjectedIds` |
| function | `writeInjectedIds` |
| function | `unseenActionableMessages` |
| function | `markInjected` |
| function | `isLiveAttachment` |
| function | `plainStatusLabel` |
| function | `styledStatusLabel` |
| function | `drainIntoBuffer` |
| function | `scheduleInboxLoop` |
| function | `startInboxLoop` |
| function | `attachSession` |
| function | `detachSession` |
| function | `currentKey` |
| function | `getBridgeState` |
| const arrow | `ensure` |
| type | `LegacyBridgeState` |
| type | `BridgePeer` |
| type | `BridgeState` |
| const | `packageRoot` |
| const | `watchers` |
| const | `SendParams` |
| const | `ReplyParams` |
| const | `InboxParams` |
| const | `COMMAND_COMPLETIONS` |
| const | `char` |
| const | `arg` |
| const | `key` |
| const | `next` |
| const | `trimmed` |
| const | `options` |
| const | `configPath` |
| const | `cfg` |
| const | `root` |
| const | `result` |
| const | `path` |
| const | `data` |
| const | `peers` |
| const | `extra` |
| const | `entries` |
| const | `entry` |
| const | `state` |
| const | `base` |
| const | `now` |
| const | `peerNames` |
| const | `primaryPeer` |
| const | `primary` |
| const | `source` |
| const | `seen` |
| const | `presence` |
| const | `whoResult` |
| const | `handles` |
| const | `ensure` |
| const | `connected` |
| const | `status` |
| const | `agents` |
| const | `content` |
| const | `marker` |
| const | `sources` |
| const | `summary` |
| const | `date` |
| const | `parsed` |
| const | `byId` |
| const | `id` |
| const | `lines` |
| const | `injected` |
| const | `raw` |
| const | `bold` |
| const | `fg` |
| const | `self` |
| const | `fresh` |
| const | `merged` |
| const | `watcherKey` |
| const | `controller` |
| const | `sessionRoot` |
| const | `peer` |
| const | `thread` |
| const | `messages` |
| const | `batch` |
| const | `batchMessages` |
| const | `sender` |
| const | `actionable` |
| const | `text` |
| const | `legacy` |
| const | `sessionId` |
| const | `sessionFile` |
| const | `sessionKey` |
| const | `bridgeState` |
| const | `to` |
| const | `msg` |
| const | `buffered` |
| const | `latest` |
| const | `messageId` |
| const | `limit` |
| const | `slice` |
| const | `label` |
| const | `randHandlr` |
| const | `len` |
| const | `isAgentsFound` |
| const | `currentState` |
| const | `candidates` |
| const | `labels` |
| const | `choice` |
| const | `selected` |
| const | `action` |
| const | `handle` |
| const | `body` |
| const | `connectedPeers` |
| pi.on | `'session_start', 'session_shutdown', 'context'` |
| pi.registerTool | `'amq_bridge_send', 'amq_bridge_reply', 'amq_bridge_inbox', 'amq_bridge_status'` |
| pi.registerCommand | `'amq-bridge'` |

## scripts/agent.mjs

| kind | symbol |
|---|---|
| const | `runtime` |
| const | `transport` |

## scripts/attach-worker.mjs

| kind | symbol |
|---|---|
| const | `session` |
| const | `files` |
| const | `transport` |

## scripts/attach.mjs

| kind | symbol |
|---|---|
| const | `scriptDir` |
| const | `session` |
| const | `files` |
| const | `child` |

## scripts/demo.mjs

| kind | symbol |
|---|---|
| function | `run` |
| const | `root` |
| const | `child` |

## scripts/detach.mjs

| kind | symbol |
|---|---|
| const | `session` |
| const | `files` |
| const | `pid` |

## scripts/pi-agent.mjs

| kind | symbol |
|---|---|
| const | `runtime` |
| const | `prompt` |
| const | `child` |

## scripts/pi-demo.mjs

| kind | symbol |
|---|---|
| function | `run` |
| const | `root` |
| const | `transport` |
| const | `child` |

## scripts/status.mjs

| kind | symbol |
|---|---|
| function | `exists` |
| function | `pidAlive` |
| const | `session` |
| const | `files` |
| const | `pid` |
| const | `pidExists` |
| const | `logExists` |
| const | `attached` |
| const | `tail` |

## src/behaviors/echo-peer.mjs

| kind | symbol |
|---|---|
| export async fn | `runEchoPeer` |
| export function | `runEchoPeer` |
| function | `runEchoPeer` |
| const | `thread` |
| const | `messages` |
| const | `drained` |
| const | `inbox` |

## src/bridge/attachment.mjs

| kind | symbol |
|---|---|
| export async fn | `writeAttachmentState` |
| export async fn | `readAttachmentState` |
| export function | `attachmentDir` |
| export function | `attachmentFiles` |
| export function | `writeAttachmentState` |
| export function | `readAttachmentState` |
| function | `attachmentDir` |
| function | `attachmentFiles` |
| function | `writeAttachmentState` |
| function | `readAttachmentState` |
| const | `dir` |
| const | `files` |
| const | `raw` |

## src/bridge/session-store.mjs

| kind | symbol |
|---|---|
| export async fn | `writeSessionState` |
| export async fn | `readSessionState` |
| export async fn | `sessionAttached` |
| export function | `resolveSessionId` |
| export function | `sessionFiles` |
| export function | `writeSessionState` |
| export function | `readSessionState` |
| export function | `sessionAttached` |
| function | `resolveSessionId` |
| function | `sessionFiles` |
| function | `writeSessionState` |
| function | `readSessionState` |
| function | `sessionAttached` |
| const | `dir` |
| const | `files` |
| const | `raw` |
| const | `pid` |

## src/bridge/sidecar.mjs

| kind | symbol |
|---|---|
| export async fn | `runBridgeSidecar` |
| export function | `runBridgeSidecar` |
| function | `runBridgeSidecar` |
| function | `shutdown` |
| const | `messages` |
| const | `drained` |

## src/mailbox.mjs

| kind | symbol |
|---|---|
| export async fn | `waitForMessages` |
| export function | `initProject` |
| export function | `hasAmq` |
| export function | `sendMessage` |
| export function | `listInbox` |
| export function | `drainInbox` |
| export function | `replyTo` |
| export function | `waitForMessages` |
| export function | `formatMessage` |
| function | `runAmq` |
| function | `addOption` |
| function | `initProject` |
| function | `parseJson` |
| function | `normalizeMessages` |
| function | `hasAmq` |
| function | `sendMessage` |
| function | `listInbox` |
| function | `drainInbox` |
| function | `replyTo` |
| function | `waitForMessages` |
| function | `formatMessage` |
| const | `stderr` |
| const | `message` |
| const | `args` |
| const | `started` |
| const | `messages` |
| const | `from` |
| const | `to` |
| const | `subject` |
| const | `body` |

## src/runtimes/pi.mjs

| kind | symbol |
|---|---|
| export function | `resolvePiRuntime` |
| export function | `buildBridgePrompt` |
| function | `resolvePiRuntime` |
| function | `buildBridgePrompt` |
| const arrow | `pick` |
| const | `pick` |
| const | `idx` |

## src/runtimes/session.mjs

| kind | symbol |
|---|---|
| export function | `resolveBridgeSession` |
| function | `resolveBridgeSession` |
| const arrow | `pick` |
| const | `pick` |
| const | `idx` |

## src/transports/amq-client.mjs

| kind | symbol |
|---|---|
| export async fn | `waitForMessages` |
| export function | `hasAmq` |
| export function | `initMailbox` |
| export function | `createAmqTransport` |
| export function | `sendMessage` |
| export function | `listInbox` |
| export function | `drainInbox` |
| export function | `replyTo` |
| export function | `waitForMessages` |
| export function | `listPresence` |
| export function | `who` |
| export function | `listReceipts` |
| export function | `waitReceipt` |
| export function | `monitorPeek` |
| export function | `readMessage` |
| export function | `threadMessages` |
| export function | `doctor` |
| export function | `formatMessage` |
| export function | `formatEvidence` |
| function | `runAmq` |
| function | `addOption` |
| function | `parseJson` |
| function | `normalizeMessages` |
| function | `hasAmq` |
| function | `initMailbox` |
| function | `createAmqTransport` |
| function | `sendMessage` |
| function | `listInbox` |
| function | `drainInbox` |
| function | `replyTo` |
| function | `waitForMessages` |
| function | `listPresence` |
| function | `who` |
| function | `listReceipts` |
| function | `waitReceipt` |
| function | `monitorPeek` |
| function | `readMessage` |
| function | `threadMessages` |
| function | `doctor` |
| function | `formatMessage` |
| function | `formatEvidence` |
| const | `stderr` |
| const | `message` |
| const | `args` |
| const | `started` |
| const | `messages` |
| const | `from` |
| const | `to` |
| const | `subject` |
| const | `body` |
| const | `preview` |

## src/transports/contract.mjs

| kind | symbol |
|---|---|
| export function | `assertBridgeTransport` |
| function | `assertBridgeTransport` |
| const | `required` |

## Tests & smoke harnesses

- `scripts/pi-extension-multipeer-smoke.mjs` — 5 functions
- `scripts/pi-extension-pty-smoke.mjs` — 11 functions
- `scripts/pi-extension-smoke.mjs` — 4 functions
- `scripts/pi-extension-tool-smoke.mjs` — 4 functions
- `tests/attach.test.mjs` — 0 functions
- `tests/install.test.mjs` — 0 functions
- `tests/mailbox.test.mjs` — 1 functions
- `tests/runtime-pi.test.mjs` — 0 functions
- `tests/transport-contract.test.mjs` — 0 functions
