MCPcopy Create free account
hub / github.com/modem-dev/hunk / makeRegistration

Function makeRegistration

scripts/daemon-memory-check.ts:271–296  ·  view source on GitHub ↗
(
  sessionId: string,
  cycle: number,
  sessionIndex: number,
  options: CliOptions,
)

Source from the content-addressed store, hash-verified

269}
270
271function makeRegistration(
272 sessionId: string,
273 cycle: number,
274 sessionIndex: number,
275 options: CliOptions,
276) {
277 const cwd = `/tmp/hunk-daemon-memory/${cycle}/${sessionIndex}`;
278 const files = Array.from({ length: options.filesPerSession }, (_, fileIndex) =>
279 makeReviewFile(sessionId, fileIndex, options),
280 );
281
282 return {
283 registrationVersion: SESSION_BROKER_REGISTRATION_VERSION,
284 sessionId,
285 pid: process.pid,
286 cwd,
287 repoRoot: cwd,
288 launchedAt: new Date().toISOString(),
289 info: {
290 inputKind: "vcs",
291 title: `memory test ${sessionId}`,
292 sourceLabel: cwd,
293 files,
294 },
295 };
296}
297
298function makeSnapshot(sessionId: string, updateIndex = 0, options: CliOptions = defaultOptions) {
299 const fileIndex = updateIndex % Math.max(1, options.filesPerSession);

Callers 1

openRegisteredSocketFunction · 0.85

Calls 1

makeReviewFileFunction · 0.85

Tested by

no test coverage detected