MCPcopy Create free account
hub / github.com/apache/maka / snapshotAtCut

Method snapshotAtCut

packages/runtime/src/shell-run-manager.ts:1169–1187  ·  view source on GitHub ↗
(live: LiveShellRun, allowLastGood: boolean)

Source from the content-addressed store, hash-verified

1167 }
1168
1169 private snapshotAtCut(live: LiveShellRun, allowLastGood: boolean): Promise<SnapshotAtCut> {
1170 if (live.mode === 'pipes') {
1171 const output = live.collector.snapshot();
1172 if (live.driverExit?.mode === 'pipes') {
1173 output.stdoutTruncated ||= live.driverExit.value.stdoutTruncated;
1174 output.stderrTruncated ||= live.driverExit.value.stderrTruncated;
1175 }
1176 return Promise.resolve({
1177 output,
1178 generation: live.collector.currentGeneration(),
1179 });
1180 }
1181 const snapshot = live.collector.snapshotAtCut();
1182 if (!allowLastGood) return snapshot;
1183 return snapshot.catch(() => ({
1184 output: live.collector.lastGoodSnapshot(),
1185 generation: live.collector.currentGeneration(),
1186 }));
1187 }
1188
1189 private onNativeRootExit(live: LiveShellRun): void {
1190 if (live.rootExited) return;

Callers 3

markRunningMethod · 0.95
queuePersistMethod · 0.95
finalizeLiveMethod · 0.95

Calls 4

lastGoodSnapshotMethod · 0.80
snapshotMethod · 0.65
resolveMethod · 0.65
currentGenerationMethod · 0.45

Tested by

no test coverage detected