@h-rig/supervisor-plugin 0.0.6-alpha.139 → 0.0.6-alpha.140

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.
package/dist/src/cli.js CHANGED
@@ -1,12 +1,5 @@
1
1
  // @bun
2
- // packages/supervisor-plugin/src/cli.ts
3
- import {
4
- dispatchRun,
5
- listRuns,
6
- listTasks,
7
- runSupervisorLoop,
8
- unblockTask
9
- } from "@rig/client";
2
+ var __require = import.meta.require;
10
3
 
11
4
  // packages/supervisor-plugin/src/awaiter.ts
12
5
  var TERMINAL_RUN_STATUSES = {
@@ -112,17 +105,21 @@ function delay(ms) {
112
105
  setTimeout(resolve, ms);
113
106
  return promise;
114
107
  }
108
+ async function loadSupervisorClient() {
109
+ return await import("@rig/client");
110
+ }
115
111
  function supervisorDeps(timeoutMs) {
116
112
  return {
117
- listTasks,
118
- listRuns,
119
- dispatchRun,
113
+ listTasks: async (projectRoot) => (await loadSupervisorClient()).listTasks(projectRoot),
114
+ listRuns: async (projectRoot) => (await loadSupervisorClient()).listRuns(projectRoot),
115
+ dispatchRun: async (...args) => (await loadSupervisorClient()).dispatchRun(...args),
120
116
  awaitRunTerminal: async (projectRoot, runId) => {
121
117
  const awaitedRunId = runId;
122
118
  return awaitTerminalRun({
123
119
  runId: awaitedRunId,
124
120
  timeoutMs,
125
121
  readStatus: async (id) => {
122
+ const { listRuns } = await loadSupervisorClient();
126
123
  const run = (await listRuns(projectRoot)).find((candidate) => candidate.runId === id);
127
124
  return run ? { runId: id, status: asRunStatus(run.status), ...run.errorSummary ? { diagnostic: run.errorSummary } : {} } : null;
128
125
  },
@@ -151,7 +148,8 @@ async function executeLoop(context, args) {
151
148
  const stopWhen = takeOption(concurrency.rest, "--stop-when");
152
149
  const timeout = takeOption(stopWhen.rest, "--timeout-ms");
153
150
  requireNoExtraArgs(timeout.rest, "rig loop [--max-tasks <n>] [--concurrency <n>] [--stop-when <csv>] [--dry-run] [--json]");
154
- const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), {
151
+ const { runSupervisorLoop } = await loadSupervisorClient();
152
+ const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), {
155
153
  maxTasks: parsePositiveInt(maxTasks.value, "--max-tasks", 1),
156
154
  concurrency: parsePositiveInt(concurrency.value, "--concurrency", 1),
157
155
  dryRun: dry.value || context.dryRun
@@ -171,7 +169,8 @@ async function executeUnblock(context, args) {
171
169
  const timeout = takeOption(json.rest, "--timeout-ms");
172
170
  const taskId = timeout.rest[0]?.startsWith("-") ? undefined : timeout.rest[0];
173
171
  requireNoExtraArgs(taskId ? timeout.rest.slice(1) : timeout.rest, "rig unblock [task-id] [--dry-run] [--json]");
174
- const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), { dryRun: dry.value || context.dryRun });
172
+ const { unblockTask } = await loadSupervisorClient();
173
+ const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), { dryRun: dry.value || context.dryRun });
175
174
  if (context.outputMode === "text") {
176
175
  if (json.value)
177
176
  printJson(result);
package/dist/src/index.js CHANGED
@@ -94,13 +94,6 @@ var supervisorClosureStageMutation = {
94
94
  }
95
95
  };
96
96
  // packages/supervisor-plugin/src/cli.ts
97
- import {
98
- dispatchRun,
99
- listRuns,
100
- listTasks,
101
- runSupervisorLoop,
102
- unblockTask
103
- } from "@rig/client";
104
97
  var SUPERVISOR_LOOP_CLI_ID = "supervisor.loop";
105
98
  var SUPERVISOR_UNBLOCK_CLI_ID = "supervisor.unblock";
106
99
  function printJson(value) {
@@ -168,17 +161,21 @@ function delay(ms) {
168
161
  setTimeout(resolve, ms);
169
162
  return promise;
170
163
  }
164
+ async function loadSupervisorClient() {
165
+ return await import("@rig/client");
166
+ }
171
167
  function supervisorDeps(timeoutMs) {
172
168
  return {
173
- listTasks,
174
- listRuns,
175
- dispatchRun,
169
+ listTasks: async (projectRoot) => (await loadSupervisorClient()).listTasks(projectRoot),
170
+ listRuns: async (projectRoot) => (await loadSupervisorClient()).listRuns(projectRoot),
171
+ dispatchRun: async (...args) => (await loadSupervisorClient()).dispatchRun(...args),
176
172
  awaitRunTerminal: async (projectRoot, runId) => {
177
173
  const awaitedRunId = runId;
178
174
  return awaitTerminalRun({
179
175
  runId: awaitedRunId,
180
176
  timeoutMs,
181
177
  readStatus: async (id) => {
178
+ const { listRuns } = await loadSupervisorClient();
182
179
  const run = (await listRuns(projectRoot)).find((candidate) => candidate.runId === id);
183
180
  return run ? { runId: id, status: asRunStatus(run.status), ...run.errorSummary ? { diagnostic: run.errorSummary } : {} } : null;
184
181
  },
@@ -207,7 +204,8 @@ async function executeLoop(context, args) {
207
204
  const stopWhen = takeOption(concurrency.rest, "--stop-when");
208
205
  const timeout = takeOption(stopWhen.rest, "--timeout-ms");
209
206
  requireNoExtraArgs(timeout.rest, "rig loop [--max-tasks <n>] [--concurrency <n>] [--stop-when <csv>] [--dry-run] [--json]");
210
- const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), {
207
+ const { runSupervisorLoop } = await loadSupervisorClient();
208
+ const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), {
211
209
  maxTasks: parsePositiveInt(maxTasks.value, "--max-tasks", 1),
212
210
  concurrency: parsePositiveInt(concurrency.value, "--concurrency", 1),
213
211
  dryRun: dry.value || context.dryRun
@@ -227,7 +225,8 @@ async function executeUnblock(context, args) {
227
225
  const timeout = takeOption(json.rest, "--timeout-ms");
228
226
  const taskId = timeout.rest[0]?.startsWith("-") ? undefined : timeout.rest[0];
229
227
  requireNoExtraArgs(taskId ? timeout.rest.slice(1) : timeout.rest, "rig unblock [task-id] [--dry-run] [--json]");
230
- const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), { dryRun: dry.value || context.dryRun });
228
+ const { unblockTask } = await loadSupervisorClient();
229
+ const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), { dryRun: dry.value || context.dryRun });
231
230
  if (context.outputMode === "text") {
232
231
  if (json.value)
233
232
  printJson(result);
@@ -49,15 +49,6 @@ var supervisorClosureStageMutation = {
49
49
  }
50
50
  };
51
51
 
52
- // packages/supervisor-plugin/src/cli.ts
53
- import {
54
- dispatchRun,
55
- listRuns,
56
- listTasks,
57
- runSupervisorLoop,
58
- unblockTask
59
- } from "@rig/client";
60
-
61
52
  // packages/supervisor-plugin/src/awaiter.ts
62
53
  var TERMINAL_RUN_STATUSES = {
63
54
  created: false,
@@ -162,17 +153,21 @@ function delay(ms) {
162
153
  setTimeout(resolve, ms);
163
154
  return promise;
164
155
  }
156
+ async function loadSupervisorClient() {
157
+ return await import("@rig/client");
158
+ }
165
159
  function supervisorDeps(timeoutMs) {
166
160
  return {
167
- listTasks,
168
- listRuns,
169
- dispatchRun,
161
+ listTasks: async (projectRoot) => (await loadSupervisorClient()).listTasks(projectRoot),
162
+ listRuns: async (projectRoot) => (await loadSupervisorClient()).listRuns(projectRoot),
163
+ dispatchRun: async (...args) => (await loadSupervisorClient()).dispatchRun(...args),
170
164
  awaitRunTerminal: async (projectRoot, runId) => {
171
165
  const awaitedRunId = runId;
172
166
  return awaitTerminalRun({
173
167
  runId: awaitedRunId,
174
168
  timeoutMs,
175
169
  readStatus: async (id) => {
170
+ const { listRuns } = await loadSupervisorClient();
176
171
  const run = (await listRuns(projectRoot)).find((candidate) => candidate.runId === id);
177
172
  return run ? { runId: id, status: asRunStatus(run.status), ...run.errorSummary ? { diagnostic: run.errorSummary } : {} } : null;
178
173
  },
@@ -201,7 +196,8 @@ async function executeLoop(context, args) {
201
196
  const stopWhen = takeOption(concurrency.rest, "--stop-when");
202
197
  const timeout = takeOption(stopWhen.rest, "--timeout-ms");
203
198
  requireNoExtraArgs(timeout.rest, "rig loop [--max-tasks <n>] [--concurrency <n>] [--stop-when <csv>] [--dry-run] [--json]");
204
- const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), {
199
+ const { runSupervisorLoop } = await loadSupervisorClient();
200
+ const result = await runSupervisorLoop(context.projectRoot, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), {
205
201
  maxTasks: parsePositiveInt(maxTasks.value, "--max-tasks", 1),
206
202
  concurrency: parsePositiveInt(concurrency.value, "--concurrency", 1),
207
203
  dryRun: dry.value || context.dryRun
@@ -221,7 +217,8 @@ async function executeUnblock(context, args) {
221
217
  const timeout = takeOption(json.rest, "--timeout-ms");
222
218
  const taskId = timeout.rest[0]?.startsWith("-") ? undefined : timeout.rest[0];
223
219
  requireNoExtraArgs(taskId ? timeout.rest.slice(1) : timeout.rest, "rig unblock [task-id] [--dry-run] [--json]");
224
- const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 30 * 60 * 1000)), { dryRun: dry.value || context.dryRun });
220
+ const { unblockTask } = await loadSupervisorClient();
221
+ const result = await unblockTask(context.projectRoot, taskId ?? null, supervisorDeps(parsePositiveInt(timeout.value, "--timeout-ms", 1800000)), { dryRun: dry.value || context.dryRun });
225
222
  if (context.outputMode === "text") {
226
223
  if (json.value)
227
224
  printJson(result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/supervisor-plugin",
3
- "version": "0.0.6-alpha.139",
3
+ "version": "0.0.6-alpha.140",
4
4
  "type": "module",
5
5
  "description": "First-party autonomous supervisor loop plugin for Rig.",
6
6
  "license": "UNLICENSED",
@@ -41,9 +41,9 @@
41
41
  "module": "./dist/src/index.js",
42
42
  "types": "./dist/src/index.d.ts",
43
43
  "dependencies": {
44
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.139",
45
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.139",
46
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.139",
44
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.140",
45
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.140",
46
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.140",
47
47
  "effect": "4.0.0-beta.90"
48
48
  }
49
49
  }