conductor-remote 1.78.0 → 1.79.0

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.
@@ -578,6 +578,36 @@ return "ok"`.trim();
578
578
  return { ok: false, strategy: 'applescript', error: osaError(err) };
579
579
  }
580
580
  }
581
+ /**
582
+ * Star one picker row as Conductor's user-wide default model.
583
+ *
584
+ * The desktop exposes this as a child button named "Set … as default and select",
585
+ * so this deliberately has both effects: it changes the global default and selects
586
+ * that model for `target`. The AppleScript reopens the picker and reads the unique
587
+ * starred row back before this reports success.
588
+ */
589
+ export async function setDefaultModel(target, model) {
590
+ const script = `
591
+ ${CONDUCTOR_HANDLERS}
592
+
593
+ my activateConductor()
594
+ my focusWorkspace()
595
+ my selectChatTab()
596
+ return my setDefaultModel(system attribute "RELAY_DEFAULT_MODEL")`.trim();
597
+ try {
598
+ const { stdout } = await withTargetEnvironment(target, targetEnvironment => uiTurn(() => exec('osascript', ['-e', script], {
599
+ env: { ...process.env, ...targetEnvironment, RELAY_DEFAULT_MODEL: model },
600
+ timeout: SEND_ATTEMPT_MS
601
+ })));
602
+ const selected = modelPickerLabel(stdout.trim());
603
+ if (!selected)
604
+ return { ok: false, strategy: 'applescript', error: 'Conductor returned no default model' };
605
+ return { ok: true, strategy: 'applescript', model: selected };
606
+ }
607
+ catch (err) {
608
+ return { ok: false, strategy: 'applescript', error: osaError(err) };
609
+ }
610
+ }
581
611
  /**
582
612
  * Put a workspace away — Conductor's own "Archive workspace" (Command-Shift-A),
583
613
  * pressed on the workspace this run has just focused and asserted.
@@ -674,7 +704,24 @@ return "ok"`.trim();
674
704
  return { ok: false, strategy: 'applescript', error: osaError(err) };
675
705
  }
676
706
  }
677
- /** The model labels Conductor is currently offering, read off the live picker. */
707
+ const DEFAULT_MODEL_LINE = '__CONDUCTOR_DEFAULT_MODEL__\t';
708
+ /** Turn listModels' tagged line protocol into the live picker state. Exported for its parser tests. */
709
+ export function parseModelMenuOutput(stdout) {
710
+ let defaultModel;
711
+ const models = [];
712
+ for (const raw of stdout.split('\n')) {
713
+ const line = raw.trim();
714
+ if (!line)
715
+ continue;
716
+ if (line.startsWith(DEFAULT_MODEL_LINE)) {
717
+ defaultModel = modelPickerLabel(line.slice(DEFAULT_MODEL_LINE.length).trim()) || undefined;
718
+ continue;
719
+ }
720
+ models.push(modelPickerLabel(line));
721
+ }
722
+ return { models: [...new Set(models.filter(Boolean))], defaultModel };
723
+ }
724
+ /** The model labels Conductor is currently offering, plus its starred default. */
678
725
  export async function listAgentModels(target) {
679
726
  const script = `
680
727
  ${CONDUCTOR_HANDLERS}
@@ -688,12 +735,7 @@ return my listModels()`.trim();
688
735
  env: { ...process.env, ...targetEnvironment },
689
736
  timeout: SEND_ATTEMPT_MS
690
737
  })));
691
- const models = stdout
692
- .split('\n')
693
- .map(s => s.trim())
694
- .map(modelPickerLabel)
695
- .filter(Boolean);
696
- return { ok: true, models: [...new Set(models)] };
738
+ return { ok: true, ...parseModelMenuOutput(stdout) };
697
739
  }
698
740
  catch (err) {
699
741
  return { ok: false, error: osaError(err) };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conductor-remote",
3
- "version": "1.78.0",
3
+ "version": "1.79.0",
4
4
  "type": "module",
5
5
  "packageManager": "yarn@4.15.0",
6
6
  "description": "Phone control panel for local Conductor agents. Reads ride SQLite + git; prompts ride Conductor's own dispatch path.",