@longshot-harness/longshot 0.1.0-beta.4 → 0.1.0-beta.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longshot-harness/longshot",
3
- "version": "0.1.0-beta.4",
3
+ "version": "0.1.0-beta.6",
4
4
  "description": "Local orchestration daemon: a persistent coordinator agent that delegates work to Claude Code, Codex and Copilot CLI workers",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -15,12 +15,12 @@
15
15
  "node": ">=18"
16
16
  },
17
17
  "optionalDependencies": {
18
- "@longshot-harness/longshot-darwin-arm64": "0.1.0-beta.4",
19
- "@longshot-harness/longshot-darwin-x64": "0.1.0-beta.4",
20
- "@longshot-harness/longshot-linux-arm64": "0.1.0-beta.4",
21
- "@longshot-harness/longshot-linux-x64": "0.1.0-beta.4",
22
- "@longshot-harness/longshot-win32-arm64": "0.1.0-beta.4",
23
- "@longshot-harness/longshot-win32-x64": "0.1.0-beta.4"
18
+ "@longshot-harness/longshot-darwin-arm64": "0.1.0-beta.6",
19
+ "@longshot-harness/longshot-darwin-x64": "0.1.0-beta.6",
20
+ "@longshot-harness/longshot-linux-arm64": "0.1.0-beta.6",
21
+ "@longshot-harness/longshot-linux-x64": "0.1.0-beta.6",
22
+ "@longshot-harness/longshot-win32-arm64": "0.1.0-beta.6",
23
+ "@longshot-harness/longshot-win32-x64": "0.1.0-beta.6"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -190,6 +190,7 @@ export class Session {
190
190
  this.cwd = '';
191
191
  this.model = '';
192
192
  this.effort = '';
193
+ this.models = [];
193
194
  this.permissionMode = '';
194
195
  // The live connection: {q, input, state, loop}, or null when no CLI is
195
196
  // behind this session (never opened, closed, or the stream ended).
@@ -433,6 +434,7 @@ export class Session {
433
434
  this.#pending = conn;
434
435
  let ended = false;
435
436
  let loopError;
437
+ let init;
436
438
  try {
437
439
  conn.q = this.sdk.query({ prompt: input, options });
438
440
  // The loop starts before initialization is awaited (D07).
@@ -448,7 +450,7 @@ export class Session {
448
450
  if (this.conn === conn) this.#streamEnded(conn, loopError);
449
451
  })();
450
452
  const earlyEnd = () => loopError ?? new Error(EARLY_END);
451
- await Promise.race([
453
+ init = await Promise.race([
452
454
  conn.q.initializationResult(),
453
455
  conn.loop.then(() => { throw earlyEnd(); }),
454
456
  ]);
@@ -482,6 +484,7 @@ export class Session {
482
484
  this.model = params.model || '';
483
485
  this.effort = params.effort || '';
484
486
  this.permissionMode = params.permission_mode;
487
+ this.models = wireModels(init?.models);
485
488
  }
486
489
 
487
490
  /**
@@ -524,6 +527,7 @@ export class Session {
524
527
  model: this.model,
525
528
  effort: this.effort,
526
529
  permission_mode: this.permissionMode,
530
+ ...(this.models.length ? { models: this.models } : {}),
527
531
  };
528
532
  }
529
533
 
@@ -559,3 +563,20 @@ export class Session {
559
563
  return this.conn;
560
564
  }
561
565
  }
566
+
567
+ /**
568
+ * The models the CLI reports at initialize, in the wire shape. Absent or
569
+ * malformed input gives [] so Longshot falls back to its own list.
570
+ */
571
+ function wireModels(models) {
572
+ if (!Array.isArray(models)) return [];
573
+ return models
574
+ .filter((m) => m && typeof m.value === 'string' && m.value)
575
+ .map((m) => ({
576
+ value: m.value,
577
+ resolved_model: m.resolvedModel || '',
578
+ display_name: m.displayName || '',
579
+ description: m.description || '',
580
+ supported_effort_levels: m.supportsEffort ? (m.supportedEffortLevels ?? []) : [],
581
+ }));
582
+ }