MCPcopy Create free account
hub / github.com/Wirasm/kild / finish

Function finish

engine/src/cli.ts:305–316  ·  view source on GitHub ↗
(err?: Error)

Source from the content-addressed store, hash-verified

303): Promise<{ kildId?: string; handle?: string }> {
304 if (id && handle) return { kildId: id, handle };
305 const session = harnessSession();
306 // Deliberately NOT guarded. An unreadable record means "there may be an attachment and I
307 // cannot read it", and a `kild send` that swallowed that would post the message with no
308 // credential — silently unattributed, which is the exact bug this file exists to fix. The
309 // one caller allowed to degrade to silence is the turn-end hook, and it does so at its own
310 // call site where it knows it is a hook.
311 const record = session ? await findAttachment(session) : null;
312 return {
313 kildId: id ?? record?.kildId ?? process.env.KILD_KILD_ID ?? undefined,
314 handle: handle ?? record?.handle ?? process.env.KILD_HANDLE ?? undefined,
315 };
316}
317
318/** `kild attach <id> --as <handle>` — register an ATTACHED agent: a harness kild
319 * does not own (the Claude Code session you are driving) claiming a `@handle` in the

Callers 1

runViaEngineFunction · 0.85

Calls 2

sendMethod · 0.80
closeMethod · 0.45

Tested by

no test coverage detected