@volter/supercode-teams 0.3.11 → 0.3.12
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 +6 -2
- package/machine.mjs +12 -1
- package/package.json +1 -1
package/bin/teams.mjs
CHANGED
|
@@ -52,7 +52,7 @@ import { NODE_PROTOCOL } from '@volter/teams/channel';
|
|
|
52
52
|
|
|
53
53
|
const MACHINE_VERBS = new Set(['machine', 'slow', 'describe', 'panes', 'input', 'suspend', 'resume', 'files', 'ports', 'port', 'browser', 'stream', 'jobs', 'workspace', 'title', 'attention', 'watch', 'rpc', 'launches', 'log', 'mail', 'health']);
|
|
54
54
|
// Every flag a machine verb reads; any other is refused rather than silently ignored.
|
|
55
|
-
const KNOWN_FLAGS = new Set(['home', 'since', 'machine', 'context', 'floor', 'supercode', 'tmux-socket', 'verbose', 'lines', 'input', 'name', 'for', 'urgency', 'reason', 'interrupt', 'query', 'out', 'in', 'interval', 'no-enter', 'when-composer-empty', 'key', 'listen', 'list', 'from', 'to', 'path', 'to-path', 'repo', 'branch', 'solo', 'card', 'create', 'presence-only', 'clear-draft', 'message-ids', 'json', 'all']);
|
|
55
|
+
const KNOWN_FLAGS = new Set(['home', 'since', 'machine', 'context', 'floor', 'supercode', 'tmux-socket', 'verbose', 'lines', 'input', 'name', 'for', 'urgency', 'reason', 'interrupt', 'query', 'out', 'in', 'interval', 'no-enter', 'when-composer-empty', 'key', 'listen', 'list', 'from', 'to', 'path', 'to-path', 'repo', 'branch', 'solo', 'card', 'create', 'presence-only', 'processes', 'panes', 'clear-draft', 'message-ids', 'json', 'all']);
|
|
56
56
|
|
|
57
57
|
const argv = process.argv.slice(2);
|
|
58
58
|
const flags = {};
|
|
@@ -218,7 +218,11 @@ async function main() {
|
|
|
218
218
|
case 'describe':
|
|
219
219
|
return withNode(async (rpc) => out(await rpc.call('describe')));
|
|
220
220
|
case 'panes': {
|
|
221
|
-
|
|
221
|
+
// `--processes`: each pane and its root pid (no screens read); `--presence-only [--panes a,b]`: whether each pane's
|
|
222
|
+
// composer is idle, for the named panes only when named.
|
|
223
|
+
if (sub === 'ls') return withNode(async (rpc) => out(await rpc.call(
|
|
224
|
+
flags.processes ? 'panes.processes' : flags['presence-only'] ? 'panes.present' : 'panes.list',
|
|
225
|
+
flags['presence-only'] && typeof flags.panes === 'string' ? { panes: flags.panes.split(',').filter(Boolean) } : {})));
|
|
222
226
|
if (sub === 'capture') return withNode(async (rpc) => out((await rpc.call('panes.capture', { pane: rest[0], lines: Number(flags.lines ?? 200) })).text));
|
|
223
227
|
if (sub === 'close') return withNode(async (rpc) => out(await rpc.call('panes.close', { pane: rest[0] })));
|
|
224
228
|
die('panes ls|capture|close');
|
package/machine.mjs
CHANGED
|
@@ -1727,7 +1727,9 @@ export class TeamsMachine extends MachineCore {
|
|
|
1727
1727
|
// No harness callback: discovery may be the harness's own caller.
|
|
1728
1728
|
const whole = operator || holds(admitted, 'view', '*');
|
|
1729
1729
|
if (!whole && !observesPanes(admitted)) need('view', '*');
|
|
1730
|
-
|
|
1730
|
+
// `panes`: only these are read (a caller that needs some panes' composers does not pay a capture of every pane).
|
|
1731
|
+
const asked = Array.isArray(params.panes) ? new Set(params.panes.map(String)) : null;
|
|
1732
|
+
const sessions = (await this.host.listSessions()).filter(s => s.contextKey && !s.dead && (!asked || asked.has(s.contextKey)) && (whole || holds(admitted, 'observe', `pane:${s.contextKey}`)));
|
|
1731
1733
|
return Promise.all(sessions.map(async session => {
|
|
1732
1734
|
const screen = await Promise.resolve().then(() => this.host.capture(session.id, { lines: 100, preserveEscapes: true })).catch(() => null);
|
|
1733
1735
|
const kind = this.#paneKind(session.contextKey, session);
|
|
@@ -1735,6 +1737,15 @@ export class TeamsMachine extends MachineCore {
|
|
|
1735
1737
|
return { pane: session.contextKey, idleComposer: composer != null && !/\besc to (?:interrupt|cancel)\b/iu.test(screen) };
|
|
1736
1738
|
}));
|
|
1737
1739
|
}
|
|
1740
|
+
case 'panes.processes': {
|
|
1741
|
+
// Each pane and its root process, from the pane listing alone: what a caller that maps processes to panes
|
|
1742
|
+
// needs, without panes.list's screen capture of every pane (message list asked for that, t_23e47b73).
|
|
1743
|
+
const whole = operator || holds(admitted, 'view', '*');
|
|
1744
|
+
if (!whole && !observesPanes(admitted)) need('view', '*');
|
|
1745
|
+
return (await this.host.listSessions())
|
|
1746
|
+
.filter(s => s.contextKey && !s.dead && (whole || holds(admitted, 'observe', `pane:${s.contextKey}`)))
|
|
1747
|
+
.map(s => ({ pane: s.contextKey, pid: s.rootPid ?? null }));
|
|
1748
|
+
}
|
|
1738
1749
|
case 'harness.v1.panes.list':
|
|
1739
1750
|
case 'panes.list': {
|
|
1740
1751
|
// A participant lists the panes its grants let it observe; view on the whole
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.12",
|
|
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",
|