@h-rig/runtime 0.0.6-alpha.32 → 0.0.6-alpha.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9033,12 +9033,24 @@ async function ensureRigPiSessionDaemon(input) {
9033
9033
  stderr: "inherit"
9034
9034
  });
9035
9035
  proc.unref();
9036
+ let exitCode = null;
9037
+ proc.exited.then((code) => {
9038
+ exitCode = code;
9039
+ });
9036
9040
  const deadline = Date.now() + (input.timeoutMs ?? 15000);
9037
9041
  while (Date.now() < deadline) {
9038
9042
  const ready = readDaemonReadyFile(readyFile);
9039
9043
  const handle = ready ? await tryReady(ready) : null;
9040
9044
  if (handle)
9041
9045
  return handle;
9046
+ if (exitCode !== null) {
9047
+ throw new Error([
9048
+ `Rig Pi session daemon exited with code ${exitCode} before becoming ready (${binPath}).`,
9049
+ "Check the daemon stderr above. Run `rig doctor` to check Pi wiring,",
9050
+ "set RIG_PI_BINARY to a working Pi build, or run without Pi via RIG_RUNTIME_ADAPTER=claude-code."
9051
+ ].join(`
9052
+ `));
9053
+ }
9042
9054
  await sleep(100);
9043
9055
  }
9044
9056
  throw new Error([
@@ -6624,20 +6624,7 @@ function filterTaskChangedFiles(projectRoot, taskId, files, scoped) {
6624
6624
  if (!taskId) {
6625
6625
  return unique(uniqueFiles).sort();
6626
6626
  }
6627
- const filteredFiles = unique(uniqueFiles).filter((file) => !isGeneratedTaskChangePath(taskId, file));
6628
- if (!scoped) {
6629
- return filteredFiles.sort();
6630
- }
6631
- const paths = resolveHarnessPaths(projectRoot);
6632
- const monorepoRoot = resolveTaskMonorepoRoot(projectRoot);
6633
- const scopes = readTaskConfigForInvocation(projectRoot)[taskId]?.scope || [];
6634
- if (scopes.length === 0) {
6635
- return [];
6636
- }
6637
- return filteredFiles.filter((file) => {
6638
- const normalized = normalizePathToScope(projectRoot, monorepoRoot || paths.monorepoRoot, file);
6639
- return scopeMatches(file, scopes) || scopeMatches(normalized, scopes);
6640
- }).sort();
6627
+ return unique(uniqueFiles).filter((file) => !isGeneratedTaskChangePath(taskId, file)).sort();
6641
6628
  }
6642
6629
  function resolveTaskMonorepoRoot(projectRoot) {
6643
6630
  const runtimeWorkspace = loadRuntimeContextFromEnv()?.workspaceDir || process.env.RIG_TASK_WORKSPACE?.trim();
@@ -6688,6 +6675,17 @@ function resolveMonorepoBaseCommit(projectRoot, repo) {
6688
6675
  }
6689
6676
  function collectWorkingTreeFiles(projectRoot, repo, baseline) {
6690
6677
  const files = new Set;
6678
+ const nativeFiles = nativePendingFiles(repo);
6679
+ if (nativeFiles !== null) {
6680
+ for (const entry of nativeFiles) {
6681
+ const normalized = normalizeChangedFilePath(entry.path);
6682
+ if (!normalized || baseline.has(normalized)) {
6683
+ continue;
6684
+ }
6685
+ files.add(normalized);
6686
+ }
6687
+ return [...files].sort();
6688
+ }
6691
6689
  for (const args of [
6692
6690
  ["diff", "--name-only"],
6693
6691
  ["diff", "--cached", "--name-only"],
@@ -9301,12 +9301,24 @@ async function ensureRigPiSessionDaemon(input) {
9301
9301
  stderr: "inherit"
9302
9302
  });
9303
9303
  proc.unref();
9304
+ let exitCode = null;
9305
+ proc.exited.then((code) => {
9306
+ exitCode = code;
9307
+ });
9304
9308
  const deadline = Date.now() + (input.timeoutMs ?? 15000);
9305
9309
  while (Date.now() < deadline) {
9306
9310
  const ready = readDaemonReadyFile(readyFile);
9307
9311
  const handle = ready ? await tryReady(ready) : null;
9308
9312
  if (handle)
9309
9313
  return handle;
9314
+ if (exitCode !== null) {
9315
+ throw new Error([
9316
+ `Rig Pi session daemon exited with code ${exitCode} before becoming ready (${binPath}).`,
9317
+ "Check the daemon stderr above. Run `rig doctor` to check Pi wiring,",
9318
+ "set RIG_PI_BINARY to a working Pi build, or run without Pi via RIG_RUNTIME_ADAPTER=claude-code."
9319
+ ].join(`
9320
+ `));
9321
+ }
9310
9322
  await sleep(100);
9311
9323
  }
9312
9324
  throw new Error([