MCPcopy Create free account
hub / github.com/Kilo-Org/cloud / writeManifest

Function writeManifest

dev/local/cli.ts:497–515  ·  view source on GitHub ↗
(
  repoRoot: string,
  sessionName: string,
  wranglerRegistryPath: string,
  serviceNames: string[]
)

Source from the content-addressed store, hash-verified

495 // hash/persisted offset's ports are held by a foreign occupant (another
496 // worktree's stack, macOS AirPlay on 5000/7000), probe +100 candidate
497 // offsets and take the first whose full computed port set is free. Never
498 // silently share. The chosen offset is persisted before startup so later
499 // port-computing commands agree even if startup is interrupted.
500 const offsetIsExplicit =
501 process.env.KILO_PORT_OFFSET !== undefined && process.env.KILO_PORT_OFFSET !== 'auto';
502 let reusedHostServices = new Set<string>();
503 if (!sessionAlreadyRunning) {
504 const originalOffset = portOffset;
505 // Read before the lease writes over it: it names the offset whose compose
506 // project holds this worktree's containers right now.
507 const previousOffset = readPersistedPortOffset(repoRoot);
508 reusedHostServices = await acquirePortOffsetLease(
509 serviceNames,
510 offsetIsExplicit,
511 repoRoot,
512 sessionName,
513 undefined,
514 undefined,
515 previousOffset
516 );
517 if (portOffset !== originalOffset)
518 console.log(`${DIM}Auto-selected port offset ${portOffset}${RESET}`);

Callers 1

cmdUpFunction · 0.85

Calls 3

getServiceFunction · 0.90
readNextjsDevPortFunction · 0.85
joinMethod · 0.80

Tested by

no test coverage detected