@indigoai-us/hq-cli 5.345.234 → 5.345.236

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.
Files changed (100) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/dist/command-catalog.generated.d.ts +311 -7
  3. package/dist/command-catalog.generated.js +383 -7
  4. package/dist/command-registration-plan.d.ts +30 -0
  5. package/dist/command-registration-plan.js +5 -0
  6. package/dist/commands/bot-companies.d.ts +4 -1
  7. package/dist/commands/bot-companies.js +5 -1
  8. package/dist/commands/bot.d.ts +10 -0
  9. package/dist/commands/bot.js +165 -36
  10. package/dist/commands/capacity.js +1 -1
  11. package/dist/commands/core-handoff.js +2 -2
  12. package/dist/commands/core-ontology-native.js +5 -4
  13. package/dist/commands/core-pipeline-workflow-runner-native.js +4 -9
  14. package/dist/commands/deploy-app-db.d.ts +3 -0
  15. package/dist/commands/deploy-app-db.js +79 -0
  16. package/dist/commands/deploy-app-upload.d.ts +3 -0
  17. package/dist/commands/deploy-app-upload.js +120 -0
  18. package/dist/commands/deploy-comments.js +46 -1
  19. package/dist/commands/deploy-mutations.js +71 -5
  20. package/dist/commands/deploy-runtime-bindings.d.ts +3 -0
  21. package/dist/commands/deploy-runtime-bindings.js +135 -0
  22. package/dist/commands/deploy-ssr.d.ts +3 -0
  23. package/dist/commands/deploy-ssr.js +74 -0
  24. package/dist/commands/dm.d.ts +7 -1
  25. package/dist/commands/dm.js +39 -9
  26. package/dist/commands/doctor.js +2 -10
  27. package/dist/commands/fingerprint.js +4 -9
  28. package/dist/commands/lanes-accounts.js +5 -5
  29. package/dist/commands/lanes-hold.js +1 -1
  30. package/dist/commands/lanes-message.js +3 -3
  31. package/dist/commands/lanes-move.js +1 -1
  32. package/dist/commands/lanes-resume.js +6 -6
  33. package/dist/commands/lanes-watch.js +2 -2
  34. package/dist/commands/lanes.js +21 -21
  35. package/dist/commands/work-env.d.ts +90 -0
  36. package/dist/commands/work-env.js +304 -0
  37. package/dist/lazy-commands.js +2 -10
  38. package/dist/lib/bot/api.d.ts +27 -0
  39. package/dist/lib/bot/api.js +28 -2
  40. package/dist/lib/bot/cloud-create.d.ts +46 -0
  41. package/dist/lib/bot/cloud-create.js +128 -0
  42. package/dist/lib/bot/fleet-daemon.js +4 -1
  43. package/dist/lib/bot/fleet-local.d.ts +7 -0
  44. package/dist/lib/bot/fleet-local.js +39 -3
  45. package/dist/lib/bot/fleet-owner-companies.js +2 -2
  46. package/dist/lib/bot/promote.d.ts +81 -2
  47. package/dist/lib/bot/promote.js +425 -51
  48. package/dist/lib/bot/promotion-hold.d.ts +9 -0
  49. package/dist/lib/bot/promotion-hold.js +29 -0
  50. package/dist/lib/bot/promotion-receipt.d.ts +10 -0
  51. package/dist/lib/bot/promotion-receipt.js +41 -1
  52. package/dist/lib/bot/promotion-upload.d.ts +6 -1
  53. package/dist/lib/bot/promotion-upload.js +3 -1
  54. package/dist/lib/bot/readiness.d.ts +9 -0
  55. package/dist/lib/bot/readiness.js +16 -0
  56. package/dist/lib/capacity/route.js +4 -4
  57. package/dist/lib/capacity/sign-in.js +1 -1
  58. package/dist/lib/checkpoint-ontology/entity-file.js +15 -17
  59. package/dist/lib/daemon/catalog.d.ts +2 -0
  60. package/dist/lib/daemon/catalog.js +2 -0
  61. package/dist/lib/daemon/hook-requests.js +23 -3
  62. package/dist/lib/daemon/run.d.ts +14 -0
  63. package/dist/lib/daemon/run.js +24 -14
  64. package/dist/lib/deploy-api.d.ts +3 -1
  65. package/dist/lib/deploy-api.js +11 -1
  66. package/dist/lib/environment/work-requirements.js +1 -1
  67. package/dist/lib/hot-channels/signals-pass.d.ts +0 -76
  68. package/dist/lib/hot-channels/signals-pass.js +81 -4
  69. package/dist/lib/lanes/account-company.js +1 -1
  70. package/dist/lib/lanes/account-ownership.js +1 -1
  71. package/dist/lib/lanes/accounts.js +1 -1
  72. package/dist/lib/lanes/delivery.js +7 -7
  73. package/dist/lib/lanes/dropbox.js +1 -1
  74. package/dist/lib/lanes/grants.js +3 -3
  75. package/dist/lib/lanes/hq-root.js +1 -1
  76. package/dist/lib/lanes/keep-alive-audit.js +2 -2
  77. package/dist/lib/lanes/links.js +4 -4
  78. package/dist/lib/lanes/monitor.js +3 -3
  79. package/dist/lib/lanes/quota-notice.js +1 -1
  80. package/dist/lib/lanes/reconcile.js +22 -12
  81. package/dist/lib/lanes/signal-brief-template.js +1 -1
  82. package/dist/lib/lanes/worker-continuity.js +1 -1
  83. package/dist/lib/mesh/live/direct-drain.d.ts +1 -0
  84. package/dist/lib/mesh/live/direct-drain.js +12 -1
  85. package/dist/lib/mesh/live/emit.d.ts +1 -1
  86. package/dist/lib/mesh/live/emit.js +10 -5
  87. package/dist/lib/mesh/live/flush.js +19 -4
  88. package/dist/lib/mesh/live/reporting-privacy.d.ts +9 -3
  89. package/dist/lib/mesh/live/reporting-privacy.js +27 -7
  90. package/dist/lib/mesh/live/spool.d.ts +2 -0
  91. package/dist/lib/mesh/live/spool.js +41 -0
  92. package/dist/lib/signals/sanitize.js +5 -4
  93. package/dist/lib/signals/steps/garden.js +5 -4
  94. package/dist/utils/frontmatter.d.ts +8 -0
  95. package/dist/utils/frontmatter.js +11 -2
  96. package/dist/utils/hq-roots-core.d.ts +5 -0
  97. package/dist/utils/hq-roots-core.js +18 -9
  98. package/dist/utils/owner-session.d.ts +13 -0
  99. package/dist/utils/owner-session.js +28 -0
  100. package/package.json +7 -7
@@ -506,13 +506,13 @@ export function createLaneMessageHandlers(deps) {
506
506
  : [];
507
507
  if (pendingQuestions.length > 0) {
508
508
  const companySlug = lane.company?.slug ?? lane.mesh_company ?? "<company-slug>";
509
- const instructions = pendingQuestions.map(({ question_id, audience }) => `question ${question_id} awaits ${audience.kind}:${audience.id}; answer it with hq lanes questions answer ${question_id} --company ${companySlug} --freeform <answer>`);
509
+ const instructions = pendingQuestions.map(({ question_id, audience }) => `question ${question_id} awaits ${audience.kind}:${audience.id}; answer it with hq runners questions answer ${question_id} --company ${companySlug} --freeform <answer>`);
510
510
  const message = `Lane ${laneId} is awaiting input. ${instructions.join("; ")}`;
511
511
  throw new LanesError("lane_not_accepting_messages", message, {
512
512
  lane_id: laneId,
513
513
  state: lane.state,
514
514
  pending_questions: pendingQuestions,
515
- answer_commands: pendingQuestions.map(({ question_id }) => `hq lanes questions answer ${question_id} --company ${companySlug} --freeform <answer>`),
515
+ answer_commands: pendingQuestions.map(({ question_id }) => `hq runners questions answer ${question_id} --company ${companySlug} --freeform <answer>`),
516
516
  provider: lane.provider,
517
517
  message,
518
518
  });
@@ -543,7 +543,7 @@ export function createLaneMessageHandlers(deps) {
543
543
  ? resolveResumeProfile(ctx, lane, refreshWorker, refreshProfileSettings)
544
544
  : undefined;
545
545
  if (opts.model !== undefined && opts.account === undefined) {
546
- throw new LanesError("model_requires_account", "--model on hq lanes message is only accepted together with --account", {});
546
+ throw new LanesError("model_requires_account", "--model on hq runners message is only accepted together with --account", {});
547
547
  }
548
548
  let quotaHoldDeferred;
549
549
  let automaticAccountSelection = undefined;
@@ -247,7 +247,7 @@ export function createLaneMoveHandlers(deps) {
247
247
  const knownNoPersistence = (isLanesError(err) && err.error === "outpost_self_target") ||
248
248
  (dispatchDetails.done === true && dispatchDetails.pickup_persisted === false);
249
249
  if (!definitelyNotSubmitted && !knownNoPersistence) {
250
- const checkCommand = `hq lanes show ${laneId}`;
250
+ const checkCommand = `hq runners show ${laneId}`;
251
251
  const message = `Failed to dispatch lane ${laneId} to Outpost ${target.id}; outcome is unknown and the lane remains assigned to Outpost ${target.id}. ` +
252
252
  `Check the target copy by running \`${checkCommand}\` on Outpost ${target.id}. ` +
253
253
  dispatchErrorMessage(err);
@@ -105,7 +105,7 @@ export function createLaneResumeHandlers(deps) {
105
105
  }
106
106
  const failedResumeReason = opts.reason?.trim();
107
107
  if (opts.reason !== undefined && opts.fromFailed !== true) {
108
- throw new LanesError("failed_resume_reason_requires_flag", "--reason on hq lanes resume requires --from-failed", { lane_id: laneId });
108
+ throw new LanesError("failed_resume_reason_requires_flag", "--reason on hq runners resume requires --from-failed", { lane_id: laneId });
109
109
  }
110
110
  if (opts.fromFailed === true && !failedResumeReason) {
111
111
  throw new LanesError("failed_resume_reason_required", "--from-failed requires a non-empty --reason", { lane_id: laneId });
@@ -173,7 +173,7 @@ export function createLaneResumeHandlers(deps) {
173
173
  lane = casUpdateLane(hqRoot, laneId, (current) => ({ ...current, provider_session_id: opts.loopSessionId }));
174
174
  }
175
175
  if (opts.model !== undefined && opts.account === undefined) {
176
- throw new LanesError("model_requires_account", "--model on hq lanes resume is only accepted together with --account", {});
176
+ throw new LanesError("model_requires_account", "--model on hq runners resume is only accepted together with --account", {});
177
177
  }
178
178
  if (opts.account !== undefined && lane.state === "running") {
179
179
  throw new LanesError("lane_running", `Lane ${laneId} is running; stop it or wait for it to exit before moving its session`, {
@@ -186,7 +186,7 @@ export function createLaneResumeHandlers(deps) {
186
186
  }
187
187
  if (lane.state === "queued" &&
188
188
  (lane.queued_reason !== "worker_profile_changed" || opts.worker === undefined)) {
189
- throw new LanesError("lane_not_resumable", `Lane ${laneId} is queued; use hq lanes admit ${laneId} to request admission`, { lane_id: laneId, state: lane.state, admission_command: `hq lanes admit ${laneId}` });
189
+ throw new LanesError("lane_not_resumable", `Lane ${laneId} is queued; use hq runners admit ${laneId} to request admission`, { lane_id: laneId, state: lane.state, admission_command: `hq runners admit ${laneId}` });
190
190
  }
191
191
  const queuedProfileRecovery = lane.state === "queued" &&
192
192
  lane.queued_reason === "worker_profile_changed" &&
@@ -200,20 +200,20 @@ export function createLaneResumeHandlers(deps) {
200
200
  opts.keepAlive !== undefined ||
201
201
  opts.meshCompany !== undefined ||
202
202
  opts.compact === false)) {
203
- throw new LanesError("worker_profile_recovery_options_invalid", "Queued worker-profile recovery accepts only --worker; rerun hq lanes resume after reconcile admits the lane", { lane_id: laneId });
203
+ throw new LanesError("worker_profile_recovery_options_invalid", "Queued worker-profile recovery accepts only --worker; rerun hq runners resume after reconcile admits the lane", { lane_id: laneId });
204
204
  }
205
205
  const pendingQuestions = lane.state === "awaiting_input"
206
206
  ? await deps.pendingQuestionsForLane(ctx, lane)
207
207
  : [];
208
208
  if (pendingQuestions.length > 0 && !loopHandoffRepair) {
209
209
  const companySlug = lane.company?.slug ?? lane.mesh_company ?? "<company-slug>";
210
- const instructions = pendingQuestions.map(({ question_id, audience }) => `question ${question_id} awaits ${audience.kind}:${audience.id}; answer it with hq lanes questions answer ${question_id} --company ${companySlug} --freeform <answer>`);
210
+ const instructions = pendingQuestions.map(({ question_id, audience }) => `question ${question_id} awaits ${audience.kind}:${audience.id}; answer it with hq runners questions answer ${question_id} --company ${companySlug} --freeform <answer>`);
211
211
  const message = `Lane ${laneId} is awaiting input. ${instructions.join("; ")}`;
212
212
  throw new LanesError("lane_pending_questions", message, {
213
213
  lane_id: laneId,
214
214
  state: lane.state,
215
215
  pending_questions: pendingQuestions,
216
- answer_commands: pendingQuestions.map(({ question_id }) => `hq lanes questions answer ${question_id} --company ${companySlug} --freeform <answer>`),
216
+ answer_commands: pendingQuestions.map(({ question_id }) => `hq runners questions answer ${question_id} --company ${companySlug} --freeform <answer>`),
217
217
  });
218
218
  }
219
219
  const projectId = opts.project?.trim() || lane.project_id;
@@ -27,7 +27,7 @@ function monitorCallsForLaneIds(laneIds) {
27
27
  for (let offset = 0; offset < laneIds.length; offset += MAX_WATCHED_LANES) {
28
28
  const chunk = laneIds.slice(offset, offset + MAX_WATCHED_LANES);
29
29
  calls.push({
30
- command: `hq lanes watch ${chunk.join(" ")}`,
30
+ command: `hq runners watch ${chunk.join(" ")}`,
31
31
  timeout_ms: MONITOR_MAX_TIMEOUT_MS,
32
32
  persistent: false,
33
33
  });
@@ -151,7 +151,7 @@ export function createLaneWatchHandlers(deps) {
151
151
  }
152
152
  const sessionId = opts.session?.trim();
153
153
  if (!sessionId) {
154
- throw new LanesError("monitor_session_required", "hq lanes monitor-check requires --session <id> unless --reminder is used");
154
+ throw new LanesError("monitor_session_required", "hq runners monitor-check requires --session <id> unless --reminder is used");
155
155
  }
156
156
  const engine = resolveMonitorEngine(opts.engine, ctx.env);
157
157
  const activeLanes = loadAllLanes(ctx.hqRoot()).filter((lane) => lane.senior.kind === "session" &&
@@ -1527,7 +1527,7 @@ function outpostPickupTimeoutMessage(outpostId, waitMs, operation) {
1527
1527
  }
1528
1528
  function outpostIdentityUnknownError(message, expectedId, details = {}) {
1529
1529
  const expected = expectedId ?? "<expected-outpost-id>";
1530
- const command = `hq lanes outpost-identity backfill --id ${expected}`;
1530
+ const command = `hq runners outpost-identity backfill --id ${expected}`;
1531
1531
  return new LanesError("outpost_identity_unknown", message, {
1532
1532
  ...details,
1533
1533
  ...(expectedId !== undefined ? { expected_id: expectedId } : {}),
@@ -3234,7 +3234,7 @@ export function composeWorkerBrief(worker, taskBrief, hqRoot) {
3234
3234
  ? [
3235
3235
  "",
3236
3236
  "## Lane hiring grants",
3237
- "A child lane may hire only within its assigned grant. If you need more direct child lanes than your current grant allows, stop before creating them and write a decision=ask envelope. Include the total grant you want and why in the question and context. Use your lane id from HQ_LANE_ID so your senior can run `hq lanes grant <lane-id> --hire <n>`.",
3237
+ "A child lane may hire only within its assigned grant. If you need more direct child lanes than your current grant allows, stop before creating them and write a decision=ask envelope. Include the total grant you want and why in the question and context. Use your lane id from HQ_LANE_ID so your senior can run `hq runners grant <lane-id> --hire <n>`.",
3238
3238
  ]
3239
3239
  : [];
3240
3240
  return [
@@ -4865,7 +4865,7 @@ async function runCreate(ctx, opts) {
4865
4865
  assigned_child_grants: assignedChildHireGrants(children),
4866
4866
  requested_hire_grant: hireGrant,
4867
4867
  available_hire_grant: availableChildGrant,
4868
- ask_guidance: `Write an ask envelope with the desired total grant and reason; the senior runs hq lanes grant ${parent.lane_id} --hire <n>.`,
4868
+ ask_guidance: `Write an ask envelope with the desired total grant and reason; the senior runs hq runners grant ${parent.lane_id} --hire <n>.`,
4869
4869
  });
4870
4870
  }
4871
4871
  return createLane(hqRoot, laneInit);
@@ -5824,7 +5824,7 @@ async function dispatchOutpostLaneCommand(ctx, lane, action, options, behavior =
5824
5824
  });
5825
5825
  }
5826
5826
  if (action === "set" && outpostRejectedSetTargetCommand(dispatched)) {
5827
- throw new LanesError("outpost_cli_upgrade_required", `Outpost ${outpostId} needs an hq-cli release containing remote lane settings before hq lanes set can change lane ${lane.lane_id}`, {
5827
+ throw new LanesError("outpost_cli_upgrade_required", `Outpost ${outpostId} needs an hq-cli release containing remote lane settings before hq runners set can change lane ${lane.lane_id}`, {
5828
5828
  lane_id: lane.lane_id,
5829
5829
  outpost_id: outpostId,
5830
5830
  command_id: dispatched.commandId,
@@ -6383,7 +6383,7 @@ async function laneStatusFieldsForCommand(ctx, hqRoot, lane, now) {
6383
6383
  }
6384
6384
  async function runList(ctx, opts) {
6385
6385
  if (opts.json && opts.human) {
6386
- throw new LanesError("conflicting_output_format", "Use either --json or --human for hq lanes list", { json: true, human: true });
6386
+ throw new LanesError("conflicting_output_format", "Use either --json or --human for hq runners list", { json: true, human: true });
6387
6387
  }
6388
6388
  const requestedLaneIds = opts.lane ?? [];
6389
6389
  if (!Array.isArray(requestedLaneIds) ||
@@ -6700,17 +6700,17 @@ async function runLaneStatus(ctx, laneId, opts) {
6700
6700
  async function runStatus(ctx, opts, laneId) {
6701
6701
  if (laneId !== undefined) {
6702
6702
  if (opts.project !== undefined || opts.company !== undefined) {
6703
- throw new LanesError("invalid_args", "hq lanes status <lane-id> reports one lane; drop --project and --company", { lane_id: laneId });
6703
+ throw new LanesError("invalid_args", "hq runners status <lane-id> reports one lane; drop --project and --company", { lane_id: laneId });
6704
6704
  }
6705
6705
  await runLaneStatus(ctx, laneId, opts);
6706
6706
  return;
6707
6707
  }
6708
6708
  if (opts.project === undefined) {
6709
- throw new LanesError("invalid_args", "hq lanes status requires --project <slug>, or a lane id for one lane", {});
6709
+ throw new LanesError("invalid_args", "hq runners status requires --project <slug>, or a lane id for one lane", {});
6710
6710
  }
6711
6711
  const projectId = opts.project;
6712
6712
  if (!ctx.storyLedgerEnabled()) {
6713
- throw new LanesError("story_ledger_disabled", "hq lanes status requires the lanes.story-ledger flag", {
6713
+ throw new LanesError("story_ledger_disabled", "hq runners status requires the lanes.story-ledger flag", {
6714
6714
  flag: "lanes.story-ledger",
6715
6715
  });
6716
6716
  }
@@ -7409,7 +7409,7 @@ async function runSetOwnerTarget(ctx, laneId, opts) {
7409
7409
  }
7410
7410
  function parseLaneSetRequest(laneId, opts) {
7411
7411
  if (opts.model === undefined && opts.effort === undefined) {
7412
- throw new LanesError("lane_set_empty", "hq lanes set needs --company, --model, or --effort", { lane_id: laneId });
7412
+ throw new LanesError("lane_set_empty", "hq runners set needs --company, --model, or --effort", { lane_id: laneId });
7413
7413
  }
7414
7414
  const reason = opts.reason?.trim();
7415
7415
  if (opts.reason !== undefined && !reason) {
@@ -7442,7 +7442,7 @@ function applyLaneSettings(ctx, laneId, request, options) {
7442
7442
  const hqRoot = ctx.hqRoot();
7443
7443
  const lane = readLane(hqRoot, laneId);
7444
7444
  if (lane.host.kind === "outpost" && !laneRunsHereForOperatorMutation(ctx, lane)) {
7445
- throw new LanesError("set_remote_unsupported", `Lane ${laneId} runs on Outpost ${lane.host.id}; run hq lanes set on that Outpost`, { lane_id: laneId, outpost_id: lane.host.id });
7445
+ throw new LanesError("set_remote_unsupported", `Lane ${laneId} runs on Outpost ${lane.host.id}; run hq runners set on that Outpost`, { lane_id: laneId, outpost_id: lane.host.id });
7446
7446
  }
7447
7447
  assertLaneRunsHereForOperatorMutation(ctx, lane, "set");
7448
7448
  assertLaneSetSenior(lane, options.expectedSenior);
@@ -7471,7 +7471,7 @@ function applyLaneSettings(ctx, laneId, request, options) {
7471
7471
  const at = ctx.now().toISOString();
7472
7472
  return casUpdateLane(hqRoot, laneId, (current) => {
7473
7473
  if (current.version !== lane.version) {
7474
- throw new LanesError("lane_set_conflict", `Lane ${laneId} changed while the settings were checked; run hq lanes set again`, { lane_id: laneId, prepared_version: lane.version, version: current.version });
7474
+ throw new LanesError("lane_set_conflict", `Lane ${laneId} changed while the settings were checked; run hq runners set again`, { lane_id: laneId, prepared_version: lane.version, version: current.version });
7475
7475
  }
7476
7476
  const entry = { at, actor: options.actor, ...(reason !== undefined ? { reason } : {}) };
7477
7477
  const next = { ...current };
@@ -7577,7 +7577,7 @@ async function runLaneDoctor(ctx, pendingQuestionsForLane) {
7577
7577
  senior: lane.senior,
7578
7578
  terminal_reason: lane.terminal_reason,
7579
7579
  ...(isFailedQuotaKeepAliveLane(lane)
7580
- ? { suggested_command: `hq lanes resume ${lane.lane_id}` }
7580
+ ? { suggested_command: `hq runners resume ${lane.lane_id}` }
7581
7581
  : { suggested_action: "Inspect the quota reset details before authorizing a failed-lane resume." }),
7582
7582
  });
7583
7583
  }
@@ -7628,7 +7628,7 @@ async function runLaneDoctor(ctx, pendingQuestionsForLane) {
7628
7628
  question_id: question.question_id,
7629
7629
  asked_at: question.asked_at,
7630
7630
  audience: question.audience,
7631
- suggested_command: `hq lanes questions answer ${question.question_id} --company ${companySlug} --freeform <answer>`,
7631
+ suggested_command: `hq runners questions answer ${question.question_id} --company ${companySlug} --freeform <answer>`,
7632
7632
  });
7633
7633
  }
7634
7634
  }
@@ -7646,7 +7646,7 @@ function assertKeepAliveChangeAllowed(ctx, lane, laneId) {
7646
7646
  throw new LanesError("keep_alive_unauthorized", appendCallerSeniorReason("Only senior " + seniorKey(lane.senior) + " may change lane " + laneId + "'s keep-alive setting", callerAuthorization), { lane_id: laneId, senior: lane.senior, reason: callerAuthorization.reason });
7647
7647
  }
7648
7648
  if (!laneRunsHere(lane, reconcileHostFromCtx(ctx))) {
7649
- throw new LanesError("keep_alive_owner_host_required", "Run hq lanes keep-alive " + laneId + " on its owner host " + lane.host.kind + ":" + lane.host.id, { lane_id: laneId, host: lane.host });
7649
+ throw new LanesError("keep_alive_owner_host_required", "Run hq runners keep-alive " + laneId + " on its owner host " + lane.host.kind + ":" + lane.host.id, { lane_id: laneId, host: lane.host });
7650
7650
  }
7651
7651
  if (lane.state === "killed" || lane.state === "cancelled" || lane.state === "failed") {
7652
7652
  throw new LanesError("keep_alive_terminal_lane", "Cannot change keep-alive for lane " + laneId + " in terminal state " + lane.state, { lane_id: laneId, state: lane.state });
@@ -8358,7 +8358,7 @@ async function prepareAccountMove(ctx, lane, input) {
8358
8358
  });
8359
8359
  const block = quotaBlockFor(loadQuotaState(hqRoot), lane.provider, target, model, now);
8360
8360
  if (block.blocked) {
8361
- throw new LanesError("account_quota_held", `Account ${target} for ${lane.provider} cannot run model ${model ?? "(default)"}: the account's model needs credits${block.marker ? ` (${block.marker})` : ""}. Once credits are added, clear the marker with: hq lanes accounts clear-quota ${lane.provider} ${target}`, { provider: lane.provider, account: target, quota_reset_at: block.quota_reset_at ?? null, marker: block.marker ?? null, model: model ?? null, clear_command: `hq lanes accounts clear-quota ${lane.provider} ${target}` });
8361
+ throw new LanesError("account_quota_held", `Account ${target} for ${lane.provider} cannot run model ${model ?? "(default)"}: the account's model needs credits${block.marker ? ` (${block.marker})` : ""}. Once credits are added, clear the marker with: hq runners accounts clear-quota ${lane.provider} ${target}`, { provider: lane.provider, account: target, quota_reset_at: block.quota_reset_at ?? null, marker: block.marker ?? null, model: model ?? null, clear_command: `hq runners accounts clear-quota ${lane.provider} ${target}` });
8362
8362
  }
8363
8363
  if (model !== undefined) {
8364
8364
  validateLaneModel(lane.provider, model, targetHome, {
@@ -10076,7 +10076,7 @@ async function runStop(ctx, laneId, reason, quiet = false) {
10076
10076
  /** Stderr notice that `stop` ends a lane for good, naming the resumable path. */
10077
10077
  function stopTerminalWarning(laneId) {
10078
10078
  return `hq lanes: warning: stop kills lane ${laneId} and it cannot be resumed. ` +
10079
- `To pause it and keep it resumable, use hq lanes interrupt ${laneId}.\n`;
10079
+ `To pause it and keep it resumable, use hq runners interrupt ${laneId}.\n`;
10080
10080
  }
10081
10081
  /**
10082
10082
  * Stop a running lane's worker and leave it `interrupted`, keeping the provider
@@ -10105,7 +10105,7 @@ async function runInterrupt(ctx, laneId, reason, options = {}) {
10105
10105
  const hqRoot = ctx.hqRoot();
10106
10106
  const lane = readLane(hqRoot, laneId);
10107
10107
  if (lane.host.kind === "outpost" && !laneRunsHereForOperatorMutation(ctx, lane)) {
10108
- throw new LanesError("interrupt_remote_unsupported", `Lane ${laneId} runs on Outpost ${lane.host.id}; run hq lanes interrupt on that Outpost`, { lane_id: laneId, outpost_id: lane.host.id });
10108
+ throw new LanesError("interrupt_remote_unsupported", `Lane ${laneId} runs on Outpost ${lane.host.id}; run hq runners interrupt on that Outpost`, { lane_id: laneId, outpost_id: lane.host.id });
10109
10109
  }
10110
10110
  assertLaneRunsHereForOperatorMutation(ctx, lane, "interrupt");
10111
10111
  if (options.story !== undefined && lane.loop_mode !== true) {
@@ -10142,7 +10142,7 @@ async function runInterrupt(ctx, laneId, reason, options = {}) {
10142
10142
  const assertInterruptible = (current) => {
10143
10143
  if (current.state !== "running") {
10144
10144
  throw new LanesError("lane_not_running", current.state === "queued"
10145
- ? `Lane ${laneId} is queued and has no running turn; use hq lanes stop to cancel it`
10145
+ ? `Lane ${laneId} is queued and has no running turn; use hq runners stop to cancel it`
10146
10146
  : `Lane ${laneId} is ${current.state}; only a running lane can be interrupted`, { lane_id: laneId, state: current.state });
10147
10147
  }
10148
10148
  };
@@ -10212,7 +10212,7 @@ function persistInterruptedSession(hqRoot, lane) {
10212
10212
  /** Stderr notice when an interrupted lane has no session to resume from. */
10213
10213
  function interruptNotResumableWarning(laneId) {
10214
10214
  return `hq lanes: warning: lane ${laneId} was interrupted before its provider reported a session id, ` +
10215
- `so hq lanes resume cannot continue it. Start a new lane for the remaining work.\n`;
10215
+ `so hq runners resume cannot continue it. Start a new lane for the remaining work.\n`;
10216
10216
  }
10217
10217
  function parseQuestionPriority(value) {
10218
10218
  if (value === undefined) {
@@ -10234,7 +10234,7 @@ async function runAsk(ctx, opts) {
10234
10234
  const hqRoot = ctx.hqRoot();
10235
10235
  const laneId = ctx.env.HQ_LANE_ID?.trim();
10236
10236
  if (!laneId) {
10237
- throw new LanesError("missing_lane_id", "hq lanes ask requires HQ_LANE_ID in the environment", {});
10237
+ throw new LanesError("missing_lane_id", "hq runners ask requires HQ_LANE_ID in the environment", {});
10238
10238
  }
10239
10239
  const questionText = opts.question?.trim();
10240
10240
  if (!questionText) {
@@ -11669,7 +11669,7 @@ export function registerRunnersCommand(parent, deps = {}) {
11669
11669
  }));
11670
11670
  lanes
11671
11671
  .command("interrupt")
11672
- .description("Stop a running lane's turn and keep it resumable with hq lanes resume")
11672
+ .description("Stop a running lane's turn and keep it resumable with hq runners resume")
11673
11673
  .argument("<lane-id>", "Lane id")
11674
11674
  .option("--reason <text>", "Record the reason in the lane's stop history")
11675
11675
  .option("--story <id>", "Withdraw only this story's queued phases (loop lanes only)")
@@ -0,0 +1,90 @@
1
+ /**
2
+ * hq work-env: a thin launcher for the company-scoped work-env skill script
3
+ * at companies/<company>/skills/work-env/scripts/work-env.sh.
4
+ *
5
+ * The script owns every security rule (company lock, per-run key, teardown,
6
+ * leak scan). This command finds the script and runs it with `bash` from PATH
7
+ * (the script needs bash 4+), passing argv exactly as given, with no shell.
8
+ *
9
+ * Before choosing a script it checks the company against the session's locked
10
+ * company set, the same set the script checks, so no company's script runs
11
+ * from a session that is not locked to that company.
12
+ *
13
+ * Signals: the child shares the terminal's foreground process group, so a
14
+ * terminal Ctrl-C (SIGINT) or Ctrl-\ (SIGQUIT) already reaches it. The wrapper
15
+ * ignores those and does not forward them; forwarding would deliver a second
16
+ * signal that can cut the script's teardown short. SIGTERM and SIGHUP, which
17
+ * the terminal does not send to the child, are forwarded once each. The
18
+ * wrapper always waits for the child to exit and returns its exit code.
19
+ *
20
+ * Environment: nothing is added. WORK_ENV_* test seams are removed, and so
21
+ * are BASH_ENV, ENV and exported bash functions (BASH_FUNC_*), which bash
22
+ * would otherwise run before the script's first line.
23
+ */
24
+ import { type ChildProcess, type SpawnOptions } from "node:child_process";
25
+ import type { Command } from "commander";
26
+ export declare const WORK_ENV_COMMAND = "work-env";
27
+ export declare const WORK_ENV_SCRIPT_RELATIVE: string;
28
+ type SignalSource = {
29
+ on(event: string, listener: (...args: unknown[]) => void): unknown;
30
+ removeListener(event: string, listener: (...args: unknown[]) => void): unknown;
31
+ };
32
+ export interface WorkEnvDeps {
33
+ env?: NodeJS.ProcessEnv;
34
+ cwd?: string;
35
+ /** Where signals arrive from. Defaults to `process`. */
36
+ signals?: SignalSource;
37
+ spawn?: (file: string, args: readonly string[], options: SpawnOptions) => ChildProcess;
38
+ writeError?: (text: string) => void;
39
+ /** Called once the child has started. Defaults to releasing this process's package-use lease. */
40
+ onSpawn?: () => void;
41
+ /** Keep WORK_ENV_* in the child environment. Only this CLI's own tests set it. */
42
+ allowTestSeams?: boolean;
43
+ }
44
+ export type WorkEnvScriptResolution = {
45
+ ok: true;
46
+ path: string;
47
+ } | {
48
+ ok: false;
49
+ path: string;
50
+ message: string;
51
+ };
52
+ /**
53
+ * The script path for `company` under `hqRoot`, and whether it is installed.
54
+ * The script must be a regular file reached without symlinks below the HQ
55
+ * root, because the script derives its HQ root from its own resolved path.
56
+ */
57
+ export declare function resolveWorkEnvScript(hqRoot: string, company: string): WorkEnvScriptResolution;
58
+ /**
59
+ * The company named on the command line. Only tokens before the first `--`
60
+ * count (after it is the user's own command), and the last `--company` wins,
61
+ * as in the script's own option loop. `--company=<slug>` is reported so the
62
+ * caller can refuse it: the script does not accept that spelling.
63
+ */
64
+ export declare function workEnvCompanyFromArgs(args: readonly string[]): {
65
+ company?: string;
66
+ equalsForm: boolean;
67
+ };
68
+ /**
69
+ * The parent environment minus WORK_ENV_* test seams, BASH_ENV, ENV and
70
+ * exported bash functions. Nothing is added.
71
+ */
72
+ export declare function workEnvChildEnv(env: NodeJS.ProcessEnv, { allowTestSeams }?: {
73
+ allowTestSeams?: boolean;
74
+ }): NodeJS.ProcessEnv;
75
+ /** Find the script, check the lock, run it, and resolve with the exit code to use. */
76
+ export declare function runWorkEnv(args: readonly string[], deps?: WorkEnvDeps): Promise<number>;
77
+ /**
78
+ * The tokens after `work-env` exactly as typed. Commander can take a root
79
+ * option (`--verbose`) out of a child's arguments and drops a `--` that
80
+ * follows a plain argument, so the action reads the root's raw argv instead.
81
+ * Returns undefined when the raw argv does not line up; the caller refuses
82
+ * rather than fall back to Commander's parsed (lossy) arguments.
83
+ */
84
+ export declare function rawWorkEnvArgs(rawArgs: readonly string[] | undefined): string[] | undefined;
85
+ export interface WorkEnvCommandDeps extends WorkEnvDeps {
86
+ exit?: (code: number) => void;
87
+ }
88
+ export declare function registerWorkEnvCommand(program: Command, deps?: WorkEnvCommandDeps): Command;
89
+ export {};
90
+ //# sourceMappingURL=work-env.d.ts.map