ServiceDeps
Defined in: src/service.ts:85
Properties
Section titled “Properties”agentIngressPort?
Section titled “agentIngressPort?”
optionalagentIngressPort?: () =>number|undefined
Defined in: src/service.ts:132
Restricted agent-ingress listener port accessor (lazy: the listener starts after this service is constructed; see src/index.ts). Returns undefined when not wired (tests) or not yet started; resolveSpawnBaseUrl/prepareSpawn fall back to the loopback main port then.
Returns
Section titled “Returns”number | undefined
beforeArchive?
Section titled “beforeArchive?”
optionalbeforeArchive?: (s) =>Promise<void>
Defined in: src/service.ts:140
Best-effort pre-teardown hook (recap generation) — runs while the worktree still exists; bounded + swallowed so it can never block teardown. Absent → no hook.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<void>
beforeArchiveTimeoutMs?
Section titled “beforeArchiveTimeoutMs?”
optionalbeforeArchiveTimeoutMs?:number
Defined in: src/service.ts:143
Hard cap on the beforeArchive hook (ms) so a stuck git can never permanently stall teardown / the merge train. Defaults to 15_000; tests inject a tiny value.
detectBackend?
Section titled “detectBackend?”
optionaldetectBackend?: () =>SandboxBackend
Defined in: src/service.ts:124
Sandbox backend probe seam (tests inject () => "bwrap" / () => null so no real
bwrap is spawned); defaults to the cached real self-test in sandbox.ts.
Returns
Section titled “Returns”detectEgressBackend?
Section titled “detectEgressBackend?”
optionaldetectEgressBackend?: () =>EgressBackend
Defined in: src/service.ts:128
Egress-firewall backend probe seam (tests inject () => "slirp4netns" / () => null
so no real netns/dnsmasq stack is spawned); defaults to the cached real self-test in
egress.ts. Probed only for an autonomous spawn that already has an FS backend.
Returns
Section titled “Returns”detectEgressHostLoopback?
Section titled “detectEgressHostLoopback?”
optionaldetectEgressHostLoopback?: () =>boolean
Defined in: src/service.ts:135
slirp host-loopback capability probe seam (tests inject () => true / () => false); defaults
to the cached real version probe in egress.ts. Gates reaching Shepherd via 10.0.2.2.
Returns
Section titled “Returns”boolean
egressWatcher?
Section titled “egressWatcher?”
optionalegressWatcher?:Pick<EgressWatcher,"start"|"stop">
Defined in: src/service.ts:137
Per-session DNS-drop watcher; absent in tests that don’t care → no-op.
events?
Section titled “events?”
optionalevents?:Pick<EventHub,"emit">
Defined in: src/service.ts:103
Event bus for live state pushes (e.g. session:ready); absent in tests that skip it.
herdr:
Pick<HerdrDriver,"start"|"list"|"stop"|"send"|"relabel">
Defined in: src/service.ts:98
moveUploads?
Section titled “moveUploads?”
optionalmoveUploads?: (images,worktreePath) =>string[]
Defined in: src/service.ts:105
Inject point for tests; defaults to the real fs move.
Parameters
Section titled “Parameters”images
Section titled “images”string[]
worktreePath
Section titled “worktreePath”string
Returns
Section titled “Returns”string[]
namer: (
prompt) =>string|Promise<string>
Defined in: src/service.ts:99
Parameters
Section titled “Parameters”prompt
Section titled “prompt”string
Returns
Section titled “Returns”string | Promise<string>
pluginIds?
Section titled “pluginIds?”
optionalpluginIds?: () =>Promise<string[]>
Defined in: src/service.ts:121
Plugin ids to disable on trimmed auto spawns; defaults to the memoized read of
~/.claude/settings.json enabledPlugins (installedPluginIds). Inject point for tests.
Returns
Section titled “Returns”Promise<string[]>
preview?
Section titled “preview?”
optionalpreview?:Pick<PreviewService,"devPortFor">
Defined in: src/service.ts:109
Live preview service; provides devPortFor for stopPreview. Absent → stopPreview returns not_found.
prSnapshot?
Section titled “prSnapshot?”
optionalprSnapshot?: () =>Record<string,GitState>
Defined in: src/service.ts:118
Live PR-state map keyed by session id (= prPoller.snapshot), the source the merge-train reconcile reads to derive which active sessions hold a selected, still-open PR. Absent → reconcile sees an empty snapshot (marks nothing). Wired from the poller in src/index.ts.
Returns
Section titled “Returns”Record<string, GitState>
reaper?
Section titled “reaper?”
optionalreaper?:Pick<ProcessReaper,"detect"|"reap"|"stopListenersOnPort">
Defined in: src/service.ts:107
Detects/terminates leftover subprocesses at close; absent in tests that skip it.
refineName?
Section titled “refineName?”
optionalrefineName?: (args) =>Promise<string|null>
Defined in: src/service.ts:101
Background namer: comprehends the prompt into a slug (null = keep heuristic). Absent → no refine.
Parameters
Section titled “Parameters”string
taskText
Section titled “taskText”string
Returns
Section titled “Returns”Promise<string | null>
refreshPr?
Section titled “refreshPr?”
optionalrefreshPr?: (id) =>void
Defined in: src/service.ts:113
Fast-poll one session’s PR (= prPoller.pollSession), to nudge merge detection when a merge train archives before the 120s sweep surfaces its members’ merges. Fire-and-forget, debounced, no-ops on archived sessions. Absent → no nudge.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”void
store:
SessionStore
Defined in: src/service.ts:86
worktree
Section titled “worktree”worktree:
Pick<WorktreeMgr,"create"|"ensureBaseRef"|"remove"|"renameBranch"|"branchExists"|"commitsAhead"|"currentBranch"|"gitCommonDir">
Defined in: src/service.ts:87