runpane 2.4.237 → 2.4.239

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 (45) hide show
  1. package/README.md +3 -1
  2. package/dist/checkedCopy.d.ts +20 -0
  3. package/dist/checkedCopy.d.ts.map +1 -0
  4. package/dist/checkedCopy.js +42 -0
  5. package/dist/checkedCopy.js.map +1 -0
  6. package/dist/cli.d.ts.map +1 -1
  7. package/dist/cli.js +5 -0
  8. package/dist/cli.js.map +1 -1
  9. package/dist/commands.d.ts +14 -0
  10. package/dist/commands.d.ts.map +1 -1
  11. package/dist/commands.js +79 -2
  12. package/dist/commands.js.map +1 -1
  13. package/dist/devices.d.ts.map +1 -1
  14. package/dist/devices.js +2 -1
  15. package/dist/devices.js.map +1 -1
  16. package/dist/docs-index.json +1 -1
  17. package/dist/generated/contract.d.ts +550 -21
  18. package/dist/generated/contract.d.ts.map +1 -1
  19. package/dist/generated/contract.js +982 -61
  20. package/dist/generated/contract.js.map +1 -1
  21. package/dist/handoff.d.ts.map +1 -1
  22. package/dist/handoff.js +7 -7
  23. package/dist/handoff.js.map +1 -1
  24. package/dist/localControl.d.ts +6 -3
  25. package/dist/localControl.d.ts.map +1 -1
  26. package/dist/localControl.js +24 -7
  27. package/dist/localControl.js.map +1 -1
  28. package/dist/nativeSession.d.ts +6 -0
  29. package/dist/nativeSession.d.ts.map +1 -1
  30. package/dist/nativeSession.js +12 -1
  31. package/dist/nativeSession.js.map +1 -1
  32. package/dist/profiles.d.ts +6 -0
  33. package/dist/profiles.d.ts.map +1 -0
  34. package/dist/profiles.js +217 -0
  35. package/dist/profiles.js.map +1 -0
  36. package/dist/updateCapacity.d.ts +2 -2
  37. package/dist/updateCapacity.d.ts.map +1 -1
  38. package/dist/updateCapacity.js +5 -1
  39. package/dist/updateCapacity.js.map +1 -1
  40. package/dist/updateOperation.d.ts +2 -2
  41. package/dist/watchLines.d.ts +1 -0
  42. package/dist/watchLines.d.ts.map +1 -1
  43. package/dist/watchLines.js +1 -0
  44. package/dist/watchLines.js.map +1 -1
  45. package/package.json +1 -1
@@ -93,9 +93,12 @@ const repoAddPreviewSchema = boundaryDecoder_1.boundary.object({
93
93
  });
94
94
  const pausedMarkSchema = boundaryDecoder_1.boundary.object({
95
95
  at: boundaryDecoder_1.boundary.string,
96
- by: boundaryDecoder_1.boundary.enumeration('manual', 'auto'),
96
+ by: boundaryDecoder_1.boundary.enumeration('manual', 'auto', 'move'),
97
97
  idleHours: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.number),
98
98
  runScript: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
99
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
100
+ arriving: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
101
+ interrupted: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.boolean),
99
102
  });
100
103
  const pauseResultSchema = boundaryDecoder_1.boundary.object({
101
104
  ok: boundaryDecoder_1.boundary.boolean,
@@ -2629,11 +2632,18 @@ async function runPanelsConversationHook(env = process.env, stdin = process.stdi
2629
2632
  }
2630
2633
  return 0;
2631
2634
  }
2635
+ /** The one argument Agent Farm's SessionStart hook passes to the host's `AGENT_FARM_SESSION_HOOK`. */
2636
+ const AGENT_FARM_SESSION_START = 'session-start';
2632
2637
  /**
2633
- * `runpane panels conversation --hook` straight from argv, before anything else in the CLI runs (no
2638
+ * `runpane panels conversation --hook` (or `runpane session-start`, its Agent Farm alias) straight from argv, before anything else in the CLI runs (no
2634
2639
  * managed-CLI handoff, no telemetry, no output). Returns null for any other command line.
2635
2640
  */
2636
- async function runConversationHookFromArgv(argv, env = process.env) {
2641
+ async function runConversationHookFromArgv(rawArgv, env = process.env) {
2642
+ // Agent Farm's host-neutral hook runs `"$AGENT_FARM_SESSION_HOOK" session-start`, and Pane points that at runpane (D-403).
2643
+ // The WSL Session bridge appends `--pane-dir <dir>`, so the alias keeps its other arguments.
2644
+ const argv = hookWords(rawArgv)[0] === AGENT_FARM_SESSION_START
2645
+ ? ['panels', 'conversation', '--hook', ...rawArgv.filter((_arg, index) => index !== rawArgv.indexOf(AGENT_FARM_SESSION_START))]
2646
+ : rawArgv;
2637
2647
  if (!isConversationHookArgv(argv))
2638
2648
  return null;
2639
2649
  let paneDir;
@@ -2648,8 +2658,12 @@ async function runConversationHookFromArgv(argv, env = process.env) {
2648
2658
  }
2649
2659
  return runPanelsConversationHook(env, process.stdin, paneDir);
2650
2660
  }
2661
+ /** The command words of an argv: everything but flags and the `--pane-dir` value. */
2662
+ function hookWords(argv) {
2663
+ return argv.filter((arg, index) => !arg.startsWith('-') && argv[index - 1] !== '--pane-dir');
2664
+ }
2651
2665
  function isConversationHookArgv(argv) {
2652
- const words = argv.filter((arg, index) => !arg.startsWith('-') && argv[index - 1] !== '--pane-dir');
2666
+ const words = hookWords(argv);
2653
2667
  return words[0] === 'panels' && words[1] === 'conversation' && argv.includes('--hook');
2654
2668
  }
2655
2669
  /** Reads a stream to its end, or null when it is a terminal, passes `maxBytes`, fails, or takes longer than `timeoutMs`. */
@@ -2708,6 +2722,7 @@ async function runReport(parsed, env = process.env) {
2708
2722
  summary: summaryText?.slice(0, MAX_SENT_SUMMARY_LENGTH),
2709
2723
  summaryPath,
2710
2724
  question: parsed.question,
2725
+ outcome: parsed.reportOutcome,
2711
2726
  ...options,
2712
2727
  }], reportResultSchema, {
2713
2728
  paneDir: parsed.paneDir,
@@ -2716,7 +2731,7 @@ async function runReport(parsed, env = process.env) {
2716
2731
  printJson(result);
2717
2732
  }
2718
2733
  else {
2719
- for (const line of describeReportDelivery(result))
2734
+ for (const line of describeReportDelivery(result, parsed.reportOutcome))
2720
2735
  console.log(line);
2721
2736
  }
2722
2737
  return 0;
@@ -2725,11 +2740,13 @@ async function runReport(parsed, env = process.env) {
2725
2740
  * What `runpane report` prints: the report, who recorded it, and how many watches were waiting.
2726
2741
  * Zero waiting watchers means nobody is waiting right now, not that the report is lost.
2727
2742
  */
2728
- function describeReportDelivery(result) {
2743
+ function describeReportDelivery(result, outcome) {
2729
2744
  const sessions = result.sessionIds.length > 0 ? ` Recorded on Session ${result.sessionIds.join(', ')}.` : '';
2730
2745
  const watchers = result.liveWatchers ?? 0;
2731
2746
  const delivered = watchers > 0 ? ` Delivered to ${watchers} waiting watcher${watchers === 1 ? '' : 's'}.` : '';
2732
- const lines = [`Reported ${(0, watchLines_1.describeReport)(result.report)} for panel ${result.panelId}.${sessions}${delivered}`];
2747
+ // A profile step's outcome is what moved its run, so the line names it.
2748
+ const reported = outcome ? `outcome "${(0, watchLines_1.sanitizeName)(outcome)}" (${(0, watchLines_1.describeReport)(result.report)})` : (0, watchLines_1.describeReport)(result.report);
2749
+ const lines = [`Reported ${reported} for panel ${result.panelId}.${sessions}${delivered}`];
2733
2750
  // The blocked question's card check: posted anyway, but worth fixing next time.
2734
2751
  const warnings = (result.warnings ?? []).map(warning => `Warning: ${warning}`);
2735
2752
  if (result.sessionIds.length > 0 || watchers > 0)