MCPcopy Create free account
hub / github.com/tiann/hapi / archiveAndClose

Function archiveAndClose

cli/src/agent/runnerLifecycle.ts:33–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

31 const logPrefix = `[${options.logTag}]`
32
33 const archiveAndClose = async () => {
34 options.session.updateMetadata((currentMetadata) => ({
35 ...currentMetadata,
36 lifecycleState: 'archived',
37 lifecycleStateSince: Date.now(),
38 archivedBy: 'cli',
39 archiveReason
40 }))
41
42 options.session.sendSessionDeath(sessionEndReason)
43 await options.session.flush()
44 await options.session.close()
45 }
46
47 const cleanup = async () => {
48 if (cleanupPromise) {

Callers 1

cleanupFunction · 0.85

Calls 4

updateMetadataMethod · 0.80
sendSessionDeathMethod · 0.80
closeMethod · 0.65
flushMethod · 0.45

Tested by

no test coverage detected