@volter/supercode-teams 0.2.72 → 0.2.74

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/bin/teams.mjs CHANGED
@@ -91,7 +91,7 @@ const die = (message, code = 2) => { process.stderr.write(`supercode teams: ${me
91
91
  if (!workspaceVerb) for (const flag of Object.keys(flags)) if (!KNOWN_FLAGS.has(flag)) die(`unknown flag: --${flag}`);
92
92
 
93
93
  /** Named keys (tmux's names) as the bytes a terminal sends for them: `panes.input` delivers
94
- * text without a trailing newline as a keystream, which every terminal host turns back into keys. */
94
+ * them (`keys`) as a keystream, which every terminal host turns back into keys. */
95
95
  const KEY_BYTES = { Escape: '\u001b', Enter: '\r', Tab: '\t', BTab: '\u001b[Z', BSpace: '\u007f', Space: ' ', Up: '\u001b[A', Down: '\u001b[B', Right: '\u001b[C', Left: '\u001b[D', Home: '\u001b[H', End: '\u001b[F', PPage: '\u001b[5~', NPage: '\u001b[6~', DC: '\u001b[3~' };
96
96
  function keyBytes(names) {
97
97
  return names.split(/[\s,]+/u).filter(Boolean).map((name) => {
@@ -212,7 +212,7 @@ async function main() {
212
212
  // (answers `delivered: false` with the reason when it holds a draft).
213
213
  if (flags.key !== undefined) {
214
214
  if (flags.key === true || rest.length) die('input <pane> --key NAMES: keys by tmux name, space- or comma-separated (Escape, Enter, Tab, BTab, BSpace, Space, Up, Down, Left, Right, Home, End, PPage, NPage, DC, C-a … C-z)');
215
- return withNode(async (rpc) => out(await rpc.call('panes.input', { pane: sub, text: keyBytes(String(flags.key)), submit: false })));
215
+ return withNode(async (rpc) => out(await rpc.call('panes.input', { pane: sub, text: keyBytes(String(flags.key)), submit: false, keys: true })));
216
216
  }
217
217
  if (flags['when-composer-empty']) return withNode(async (rpc) => out(await rpc.call('panes.turn', { pane: sub, text: rest.join(' ') })));
218
218
  return withNode(async (rpc) => out(await rpc.call('panes.input', { pane: sub, text: rest.join(' '), submit: !flags['no-enter'] })));
package/machine.mjs CHANGED
@@ -1114,7 +1114,7 @@ export class TeamsMachine extends MachineCore {
1114
1114
  const rows = await this.attentionEvidence();
1115
1115
  // `title` is what a viewer should show: the override if one is set, else the tmux label.
1116
1116
  return rows.filter((row) => row.session.id && shown(row.session.contextKey)).map(({ session: s, attention, rank, notify, evidence }) => ({
1117
- pane: s.contextKey, label: s.label, title: titles[`pane:${s.contextKey}`] ?? s.label, cwd: s.cwd, owned: s.owned, activeCommand: s.activeCommand, size: s.size, suspended: this.suspended.has(s.contextKey),
1117
+ pane: s.contextKey, label: s.label, title: titles[`pane:${s.contextKey}`] ?? s.label, cwd: s.cwd, owned: s.owned, activeCommand: s.activeCommand, pid: s.rootPid ?? null, size: s.size, suspended: this.suspended.has(s.contextKey),
1118
1118
  attention, rank, notify, evidence,
1119
1119
  }));
1120
1120
  }
@@ -1243,7 +1243,9 @@ export class TeamsMachine extends MachineCore {
1243
1243
  if (this.suspended.has(params.pane)) throw Object.assign(new Error(`pane ${params.pane} is suspended: remote input is refused until resume`), { code: 423 });
1244
1244
  // `deadlineMs` is how long the caller will wait (default 10 s, which covers `retry`'s 5.5 s of
1245
1245
  // submit presses; at most 30 s); the terminal host takes an absolute deadline.
1246
- const delivery = await this.host.sendInput(session.id, submission(params.text, params.submit !== false), { submitMode: params.submit === false ? 'single' : 'retry', deadlineMs: Date.now() + Math.min(Number(params.deadlineMs) || 10_000, 30_000) });
1246
+ // `keys`: the bytes of named keys, delivered as they are (a trailing Enter is a key, not a line ending).
1247
+ const data = params.keys ? String(params.text ?? '') : submission(params.text, params.submit !== false);
1248
+ const delivery = await this.host.sendInput(session.id, data, { submitMode: params.submit === false || params.keys ? 'single' : 'retry', deadlineMs: Date.now() + Math.min(Number(params.deadlineMs) || 10_000, 30_000) });
1247
1249
  act('control', `pane:${params.pane}`, 'input');
1248
1250
  return { delivered: true, delivery };
1249
1251
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@volter/supercode-teams",
3
- "version": "0.2.72",
3
+ "version": "0.2.74",
4
4
  "type": "module",
5
5
  "description": "A machine daemon serving this machine's doors, and a local or remote Teams server for shared session discovery, OpenTelemetry ingestion and access to enrolled machines.",
6
6
  "license": "MIT",