@h-rig/server 0.0.6-alpha.3 → 0.0.6-alpha.31

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.
@@ -58,17 +58,23 @@ function patchRunRecord(projectRoot, runId, patch) {
58
58
  writeJsonFile(resolve2(resolveAuthorityRunDir2(projectRoot, runId), "run.json"), next);
59
59
  return next;
60
60
  }
61
+ function patchRunPiSessionMetadata(projectRoot, runId, metadata) {
62
+ return patchRunRecord(projectRoot, runId, {
63
+ piSession: metadata?.public ?? null,
64
+ piSessionPrivate: metadata
65
+ });
66
+ }
61
67
  function buildRunStartPatch(startedAt) {
62
68
  return {
63
69
  status: "preparing",
64
70
  startedAt,
65
71
  completedAt: null,
66
- errorText: null,
67
- serverPid: process.pid
72
+ errorText: null
68
73
  };
69
74
  }
70
75
  export {
71
76
  patchRunRecord,
77
+ patchRunPiSessionMetadata,
72
78
  buildRunStartPatch,
73
79
  appendRunTimelineEntry,
74
80
  appendRunLogEntry
@@ -14,7 +14,7 @@ import {
14
14
  RemoteWsClient as RemoteWsClient2
15
15
  } from "@rig/runtime/control-plane/remote";
16
16
  import { deleteRunState } from "@rig/runtime/control-plane/native/run-ops";
17
- import { readAuthorityRun as readAuthorityRun8 } from "@rig/runtime/control-plane/authority-files";
17
+ import { readAuthorityRun as readAuthorityRun9 } from "@rig/runtime/control-plane/authority-files";
18
18
 
19
19
  // packages/server/src/server.ts
20
20
  import {
@@ -376,6 +376,11 @@ import {
376
376
  buildTaskRunLifecycleComment,
377
377
  updateConfiguredTaskSourceTask
378
378
  } from "@rig/runtime/control-plane/tasks/source-lifecycle";
379
+ import {
380
+ closeIssueAfterMergedPr,
381
+ commitRunChanges,
382
+ runPrAutomation
383
+ } from "@rig/runtime/control-plane/native/pr-automation";
379
384
 
380
385
  // packages/server/src/scheduler.ts
381
386
  import { normalizeTaskLifecycleStatus } from "@rig/runtime/control-plane/state-sync/types";
@@ -403,12 +408,14 @@ var TERMINAL_RUN_STATUSES2 = new Set([
403
408
  "needs-attention",
404
409
  "stopped"
405
410
  ]);
406
- var ORPHANABLE_LOCAL_RUN_STATUSES = new Set(["preparing", "running"]);
411
+ var RESUMABLE_SERVER_CLOSEOUT_STATUSES = new Set(["pending", "running"]);
412
+ var EXPLICIT_RESUMABLE_SERVER_CLOSEOUT_STATUSES = new Set(["pending", "running", "needs_attention"]);
413
+ var ACTIVE_LOCAL_RUN_STATUSES = new Set(["created", "preparing", "running", "validating", "reviewing"]);
407
414
 
408
415
  // packages/server/src/server-helpers/http-router.ts
409
416
  import {
410
417
  listAuthorityRuns as listAuthorityRuns5,
411
- readAuthorityRun as readAuthorityRun6,
418
+ readAuthorityRun as readAuthorityRun7,
412
419
  resolveAuthorityPaths,
413
420
  writeJsonFile as writeJsonFile4
414
421
  } from "@rig/runtime/control-plane/authority-files";
@@ -428,8 +435,11 @@ import {
428
435
  RemoteWsClient
429
436
  } from "@rig/runtime/control-plane/remote";
430
437
 
438
+ // packages/server/src/server-helpers/pi-session-proxy.ts
439
+ import { readAuthorityRun as readAuthorityRun5 } from "@rig/runtime/control-plane/authority-files";
440
+
431
441
  // packages/server/src/server-helpers/run-steering.ts
432
- import { appendJsonlRecord as appendJsonlRecord2, readAuthorityRun as readAuthorityRun5, resolveAuthorityRunDir as resolveAuthorityRunDir4 } from "@rig/runtime/control-plane/authority-files";
442
+ import { appendJsonlRecord as appendJsonlRecord2, readAuthorityRun as readAuthorityRun6, resolveAuthorityRunDir as resolveAuthorityRunDir4 } from "@rig/runtime/control-plane/authority-files";
433
443
 
434
444
  // packages/server/src/server-helpers/http-router.ts
435
445
  import { buildRigInitConfigSource } from "@rig/core";
@@ -454,7 +464,7 @@ import {
454
464
  } from "@rig/runtime/control-plane/native/run-ops";
455
465
  import {
456
466
  listAuthorityRuns as listAuthorityRuns6,
457
- readAuthorityRun as readAuthorityRun7
467
+ readAuthorityRun as readAuthorityRun8
458
468
  } from "@rig/runtime/control-plane/authority-files";
459
469
 
460
470
  // packages/server/src/inspector/service.ts
@@ -780,7 +790,7 @@ async function routeWebSocketRequest(state, deps, request) {
780
790
  if (!runId || !messageId || text === null) {
781
791
  throw new Error("runId, messageId, and text are required");
782
792
  }
783
- const run = readAuthorityRun8(state.projectRoot, runId);
793
+ const run = readAuthorityRun9(state.projectRoot, runId);
784
794
  if (!run) {
785
795
  throw new Error(`Run not found: ${runId}`);
786
796
  }