@cabane/companion 0.6.229 → 0.6.230

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/cli.js CHANGED
@@ -5937,6 +5937,7 @@ var init_protocol = __esm({
5937
5937
  });
5938
5938
  runnerSpecSchema = z13.object({
5939
5939
  deviceId: z13.string().optional(),
5940
+ deviceLabel: z13.string().optional(),
5940
5941
  // The launcher's boot id: the one its heartbeat carries, so a runner's lease
5941
5942
  // matches the device that holds it.
5942
5943
  bootId: z13.string(),
@@ -7202,6 +7203,10 @@ var init_turn_runtime_integrity = __esm({
7202
7203
  // src/turn-execution.ts
7203
7204
  import { createHash as createHash2, randomUUID as randomUUID4 } from "crypto";
7204
7205
  import { existsSync as existsSync11, mkdirSync as mkdirSync9 } from "fs";
7206
+ function harnessUnavailableNotice(deviceId, deviceLabel) {
7207
+ const name = deviceId && deviceLabel !== void 0 ? ` ([${deviceLabel.replace(/([\\[\]])/g, "\\$1")}](/settings/devices/${encodeURIComponent(deviceId)}))` : "";
7208
+ return "**This harness isn't available on the companion.** Check the harness on the device" + name + ", or choose another harness in the agent's settings. Then reply to try again.";
7209
+ }
7205
7210
  function resolveIdleTimeoutMs(override) {
7206
7211
  return override ?? DEFAULT_AGENT_IDLE_TIMEOUT_MS;
7207
7212
  }
@@ -7238,7 +7243,7 @@ function fingerprintSessionState(state) {
7238
7243
  }
7239
7244
  return createHash2("sha256").update(opaqueId).digest("hex").slice(0, 16);
7240
7245
  }
7241
- var PREPARING_TOOL_NAME, HARNESS_UNAVAILABLE_NOTICE, NO_TURN_TOKEN_REASON, UNEXPECTED_ROLE_REASON, DEFAULT_PREPARING_ROW_DELAY_MS, DEFAULT_AGENT_IDLE_TIMEOUT_MS, DEFAULT_AGENT_TOTAL_TIMEOUT_MS, DEFAULT_LEASE_RENEWAL_MS, TurnConcluded, RUNNER_SIGTERM, RUNNER_TERMINATED, TurnExecution;
7246
+ var PREPARING_TOOL_NAME, NO_TURN_TOKEN_REASON, UNEXPECTED_ROLE_REASON, DEFAULT_PREPARING_ROW_DELAY_MS, DEFAULT_AGENT_IDLE_TIMEOUT_MS, DEFAULT_AGENT_TOTAL_TIMEOUT_MS, DEFAULT_LEASE_RENEWAL_MS, TurnConcluded, RUNNER_SIGTERM, RUNNER_TERMINATED, TurnExecution;
7242
7247
  var init_turn_execution = __esm({
7243
7248
  "src/turn-execution.ts"() {
7244
7249
  "use strict";
@@ -7268,7 +7273,6 @@ var init_turn_execution = __esm({
7268
7273
  init_turn_committer();
7269
7274
  init_turn_runtime_integrity();
7270
7275
  PREPARING_TOOL_NAME = "preparing";
7271
- HARNESS_UNAVAILABLE_NOTICE = "**This harness isn't available on the companion.** Check the harness on the device, or choose another harness in the agent's settings. Then reply to try again.";
7272
7276
  NO_TURN_TOKEN_REASON = "no_turn_token: the server issued no turn credential for this turn";
7273
7277
  UNEXPECTED_ROLE_REASON = `refused the wake trigger (role "system" isn't dispatchable on this companion) \u2014 the companion is likely running outdated code; refresh it, then re-address the agent`;
7274
7278
  DEFAULT_PREPARING_ROW_DELAY_MS = 1500;
@@ -7964,7 +7968,7 @@ var init_turn_execution = __esm({
7964
7968
  );
7965
7969
  try {
7966
7970
  await this.opts.api.postTurnMessage(workspaceId, payload.conversationId, {
7967
- body: HARNESS_UNAVAILABLE_NOTICE,
7971
+ body: harnessUnavailableNotice(this.opts.deviceId, this.opts.deviceLabel),
7968
7972
  kind: "runtime_notice",
7969
7973
  turnId,
7970
7974
  parentMessageId: payload.messageId,
@@ -8789,6 +8793,7 @@ function runnerTurnOptions(input, log2, emit, extras = {}) {
8789
8793
  };
8790
8794
  return {
8791
8795
  ...spec.deviceId ? { deviceId: spec.deviceId } : {},
8796
+ deviceLabel: spec.deviceLabel,
8792
8797
  api,
8793
8798
  baseUrl: input.baseUrl,
8794
8799
  workspaceId: spec.workspaceId,
@@ -11114,6 +11119,7 @@ function runnerSpec(opts, launch, duties, runnerId) {
11114
11119
  return {
11115
11120
  runnerId,
11116
11121
  ...opts.deviceId ? { deviceId: opts.deviceId } : {},
11122
+ deviceLabel: opts.deviceLabel,
11117
11123
  bootId,
11118
11124
  workspaceId: opts.workspaceId,
11119
11125
  workspaceSlug: opts.workspaceSlug,
@@ -13304,6 +13310,7 @@ var CompanionSupervisor = class {
13304
13310
  return new Dispatcher({
13305
13311
  turn: {
13306
13312
  deviceId: this.deviceId ?? void 0,
13313
+ deviceLabel: this.config.deviceLabel,
13307
13314
  api: ctx2.api,
13308
13315
  baseUrl: ctx2.baseUrl,
13309
13316
  workspaceId: ctx2.workspaceId,
package/dist/runtime.js CHANGED
@@ -5495,6 +5495,7 @@ var runtimeHealthSchema = z13.object({
5495
5495
  });
5496
5496
  var runnerSpecSchema = z13.object({
5497
5497
  deviceId: z13.string().optional(),
5498
+ deviceLabel: z13.string().optional(),
5498
5499
  // The launcher's boot id: the one its heartbeat carries, so a runner's lease
5499
5500
  // matches the device that holds it.
5500
5501
  bootId: z13.string(),
@@ -5659,6 +5660,7 @@ function runnerSpec(opts, launch, duties, runnerId) {
5659
5660
  return {
5660
5661
  runnerId,
5661
5662
  ...opts.deviceId ? { deviceId: opts.deviceId } : {},
5663
+ deviceLabel: opts.deviceLabel,
5662
5664
  bootId,
5663
5665
  workspaceId: opts.workspaceId,
5664
5666
  workspaceSlug: opts.workspaceSlug,
@@ -8537,6 +8539,7 @@ var CompanionSupervisor = class {
8537
8539
  return new Dispatcher({
8538
8540
  turn: {
8539
8541
  deviceId: this.deviceId ?? void 0,
8542
+ deviceLabel: this.config.deviceLabel,
8540
8543
  api: ctx.api,
8541
8544
  baseUrl: ctx.baseUrl,
8542
8545
  workspaceId: ctx.workspaceId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cabane/companion",
3
- "version": "0.6.229",
3
+ "version": "0.6.230",
4
4
  "type": "module",
5
5
  "description": "The Cabane Companion (headless): connect an agent on your machine to your Cabane workspace as a responder — drive work against your own codebase, files, and MCP servers without putting any of it in Cabane.",
6
6
  "license": "UNLICENSED",