runpane 2.4.225 → 2.4.226

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 (52) hide show
  1. package/README.md +18 -0
  2. package/dist/agents.d.ts +5 -0
  3. package/dist/agents.d.ts.map +1 -1
  4. package/dist/agents.js +16 -0
  5. package/dist/agents.js.map +1 -1
  6. package/dist/ask.d.ts +16 -0
  7. package/dist/ask.d.ts.map +1 -0
  8. package/dist/ask.js +418 -0
  9. package/dist/ask.js.map +1 -0
  10. package/dist/cli.d.ts.map +1 -1
  11. package/dist/cli.js +11 -1
  12. package/dist/cli.js.map +1 -1
  13. package/dist/commands.d.ts +4 -0
  14. package/dist/commands.d.ts.map +1 -1
  15. package/dist/commands.js +18 -2
  16. package/dist/commands.js.map +1 -1
  17. package/dist/daemonClient.d.ts +5 -1
  18. package/dist/daemonClient.d.ts.map +1 -1
  19. package/dist/daemonClient.js +9 -2
  20. package/dist/daemonClient.js.map +1 -1
  21. package/dist/docs-index.json +1 -1
  22. package/dist/generated/contract.d.ts +542 -4
  23. package/dist/generated/contract.d.ts.map +1 -1
  24. package/dist/generated/contract.js +963 -104
  25. package/dist/generated/contract.js.map +1 -1
  26. package/dist/handoff.d.ts +1 -0
  27. package/dist/handoff.d.ts.map +1 -1
  28. package/dist/handoff.js +2 -8
  29. package/dist/handoff.js.map +1 -1
  30. package/dist/localControl.d.ts +17 -0
  31. package/dist/localControl.d.ts.map +1 -1
  32. package/dist/localControl.js +53 -3
  33. package/dist/localControl.js.map +1 -1
  34. package/dist/mcp.js +1 -1
  35. package/dist/mcp.js.map +1 -1
  36. package/dist/mcpTools.d.ts +2 -0
  37. package/dist/mcpTools.d.ts.map +1 -1
  38. package/dist/mcpTools.js +1 -1
  39. package/dist/mcpTools.js.map +1 -1
  40. package/dist/secrets.d.ts +7 -0
  41. package/dist/secrets.d.ts.map +1 -1
  42. package/dist/secrets.js +1 -0
  43. package/dist/secrets.js.map +1 -1
  44. package/dist/theme.d.ts +5 -0
  45. package/dist/theme.d.ts.map +1 -0
  46. package/dist/theme.js +104 -0
  47. package/dist/theme.js.map +1 -0
  48. package/dist/watchLines.d.ts +3 -0
  49. package/dist/watchLines.d.ts.map +1 -1
  50. package/dist/watchLines.js +2 -1
  51. package/dist/watchLines.js.map +1 -1
  52. package/package.json +1 -1
@@ -372,6 +372,8 @@ const orchestrationAssociationSchema = boundaryDecoder_1.boundary.object({
372
372
  paneId: boundaryDecoder_1.boundary.nonEmptyString,
373
373
  panelIds: boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.nonEmptyString),
374
374
  attachedAt: boundaryDecoder_1.boundary.nonEmptyString,
375
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({ id: boundaryDecoder_1.boundary.nonEmptyString, label: boundaryDecoder_1.boundary.nonEmptyString })),
376
+ name: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.nonEmptyString),
375
377
  });
376
378
  const orchestrationActivitySchema = boundaryDecoder_1.boundary.object({
377
379
  id: boundaryDecoder_1.boundary.nonEmptyString,
@@ -458,6 +460,11 @@ const orchestrationPaneOverviewSchema = boundaryDecoder_1.boundary.object({
458
460
  prState: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
459
461
  })),
460
462
  report: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({ ...agentReportFields, panelId: boundaryDecoder_1.boundary.nonEmptyString })),
463
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({
464
+ id: boundaryDecoder_1.boundary.nonEmptyString,
465
+ label: boundaryDecoder_1.boundary.nonEmptyString,
466
+ state: boundaryDecoder_1.boundary.enumeration('online', 'unreachable', 'older-pane'),
467
+ })),
461
468
  });
462
469
  const lockOwnerSchema = boundaryDecoder_1.boundary.object({
463
470
  kind: boundaryDecoder_1.boundary.enumeration('pane', 'external'),
@@ -624,6 +631,9 @@ exports.paneCreateResultSchema = boundaryDecoder_1.boundary.object({
624
631
  sessionId: boundaryDecoder_1.boundary.string,
625
632
  ok: boundaryDecoder_1.boundary.boolean,
626
633
  error: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
634
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
635
+ code: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
636
+ next: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
627
637
  })),
628
638
  promptFile: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
629
639
  attachments: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
@@ -995,6 +1005,7 @@ const workspaceEntrySchema = boundaryDecoder_1.boundary.object({
995
1005
  expectedSince: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
996
1006
  screenLines: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.array(boundaryDecoder_1.boundary.string)),
997
1007
  itemId: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.string),
1008
+ machine: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({ id: boundaryDecoder_1.boundary.string, label: boundaryDecoder_1.boundary.string, epoch: boundaryDecoder_1.boundary.string, gen: boundaryDecoder_1.boundary.number })),
998
1009
  });
999
1010
  exports.workspaceStateResultSchema = boundaryDecoder_1.boundary.object({
1000
1011
  ok: boundaryDecoder_1.boundary.literal(true),
@@ -1365,8 +1376,10 @@ async function runSessionsOverview(parsed) {
1365
1376
  }
1366
1377
  console.log(`${result.session.name}: ${result.status}`);
1367
1378
  for (const pane of result.panes) {
1368
- const details = pane.missing ? 'missing' : pane.archived ? 'archived' : pane.panels.map(panel => `${panel.title}=${panel.type === undefined || panel.type === 'terminal' ? panel.state : panel.type}`).join(', ') || 'no panels';
1369
- console.log(` ${pane.name}: ${details}`);
1379
+ const details = pane.machine?.state === 'unreachable' ? 'unreachable'
1380
+ : pane.machine?.state === 'older-pane' ? `older Pane on ${pane.machine.label}: update it there for its reports to reach this Session`
1381
+ : pane.missing ? 'missing' : pane.archived ? 'archived' : pane.panels.map(panel => `${panel.title}=${panel.type === undefined || panel.type === 'terminal' ? panel.state : panel.type}`).join(', ') || 'no panels';
1382
+ console.log(` ${pane.name}${pane.machine ? ` (${pane.machine.label})` : ''}: ${details}`);
1370
1383
  if (pane.panels.some(panel => panel.report)) {
1371
1384
  for (const panel of pane.panels)
1372
1385
  console.log(` ${describePanelOverview(panel)}`);
@@ -2069,10 +2082,17 @@ async function runPanesCreate(parsed) {
2069
2082
  if (parsed.expectReport !== undefined)
2070
2083
  request.expectReport = parsed.expectReport;
2071
2084
  await confirmPaneCreate(parsed, request);
2085
+ // Created on another machine for this machine's Session: that machine has no such Session, so this one records the member.
2086
+ const remoteMachine = (0, daemonClient_1.routedOtherMachine)();
2087
+ const joinSession = remoteMachine && !request.dryRun ? request.associateSession : undefined;
2088
+ if (joinSession)
2089
+ delete request.associateSession;
2072
2090
  const result = await (0, daemonClient_1.invokeDaemon)('runpane:panes:create', [request], exports.paneCreateResultSchema, {
2073
2091
  paneDir: parsed.paneDir,
2074
2092
  timeoutMs: (parsed.timeoutMs ?? 120_000) + (parsed.readyTimeoutMs ?? 30_000) + 10_000,
2075
2093
  });
2094
+ if (joinSession && remoteMachine)
2095
+ await joinRemoteMembers(parsed, result, joinSession, remoteMachine);
2076
2096
  if (parsed.waitForResult) {
2077
2097
  const [item] = result.items;
2078
2098
  if (result.items.length !== 1) {
@@ -2697,6 +2717,7 @@ function describeReportDelivery(result) {
2697
2717
  ? `No Session recorded this report. ${stored}, and only watchers that list agent.report receive it.`
2698
2718
  : `No Session recorded this report and no watcher was waiting for it. ${stored}, `
2699
2719
  + 'and a watch with a named cursor (runpane watch --as <name> --kinds agent.report) still receives it when it next waits.');
2720
+ lines.push('If this Pane belongs to a Session on another computer, that computer records it there.');
2700
2721
  return [...lines, ...warnings];
2701
2722
  }
2702
2723
  const inboxItemSchema = boundaryDecoder_1.boundary.object({
@@ -3257,6 +3278,32 @@ async function buildPaneCreateRequest(parsed) {
3257
3278
  };
3258
3279
  return request;
3259
3280
  }
3281
+ const remoteAssociationResultSchema = boundaryDecoder_1.boundary.object({
3282
+ machine: boundaryDecoder_1.boundary.object({ id: boundaryDecoder_1.boundary.string, label: boundaryDecoder_1.boundary.string }),
3283
+ warning: boundaryDecoder_1.boundary.optional(boundaryDecoder_1.boundary.object({ code: boundaryDecoder_1.boundary.string, message: boundaryDecoder_1.boundary.string, next: boundaryDecoder_1.boundary.string })),
3284
+ });
3285
+ /** Records each Pane created on `machine` as a member of this machine's Session, and says how it went on the item. */
3286
+ async function joinRemoteMembers(parsed, result, sessionId, machine) {
3287
+ for (const item of result.items) {
3288
+ if (!('pinned' in item) || !item.paneId)
3289
+ continue;
3290
+ try {
3291
+ const joined = await (0, daemonClient_1.invokeDaemon)('runpane:sessions:associate-remote', [{
3292
+ selector: { sessionId },
3293
+ machine,
3294
+ paneId: item.paneId,
3295
+ name: item.name ?? item.paneId,
3296
+ }], remoteAssociationResultSchema, { paneDir: parsed.paneDir, thisMachine: true });
3297
+ item.association = { sessionId, ok: true, machine: joined.machine.label };
3298
+ if (joined.warning)
3299
+ Object.assign(item.association, { error: joined.warning.message, code: joined.warning.code, next: joined.warning.next });
3300
+ }
3301
+ catch (error) {
3302
+ const failure = (0, errors_1.describeFailure)(error);
3303
+ item.association = { sessionId, ok: false, machine, error: failure.message, code: failure.code, next: failure.next };
3304
+ }
3305
+ }
3306
+ }
3260
3307
  /** Inside a Session orchestrator, new Panes join that Session unless --no-associate. */
3261
3308
  function resolveAssociateSession(parsed) {
3262
3309
  if (parsed.noAssociate)
@@ -3742,9 +3789,12 @@ function printPaneCreateResult(result, dryRun = false, action = 'create') {
3742
3789
  printReadiness(item.readiness, ' ');
3743
3790
  printInitialInputDelivery(item.initialInput, ' ');
3744
3791
  if (item.association) {
3792
+ const where = item.association.machine ? ` from ${item.association.machine}` : '';
3745
3793
  console.log(item.association.ok
3746
- ? ` Associated with Session ${item.association.sessionId}`
3794
+ ? ` Associated with Session ${item.association.sessionId}${where}${item.association.error ? `. ${item.association.error}` : ''}`
3747
3795
  : ` Not associated with Session ${item.association.sessionId}: ${item.association.error ?? 'unknown error'}`);
3796
+ if (item.association.next)
3797
+ console.log(` Next: ${item.association.next}`);
3748
3798
  }
3749
3799
  printPromptNotes(item, ' ');
3750
3800
  if (item.base?.notice) {