@volter/supercode-teams 0.2.116 → 0.2.118
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 +9 -2
- package/codex-startup.mjs +28 -0
- package/machine.mjs +2 -1
- package/package.json +1 -1
package/bin/teams.mjs
CHANGED
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
// title set <pane> <text> | title ls
|
|
20
20
|
// attention ls | rank | request <pane> [--urgency now|soon|whenever] [--reason text] | clear <pane>
|
|
21
21
|
// watch [--interval ms] [--for ms]
|
|
22
|
+
// launches get <key> | list operators: keyed node launch receipts
|
|
22
23
|
// rpc <harness.v1 method> [json-params] operators: one harness.v1 request
|
|
23
24
|
// log verify
|
|
24
25
|
//
|
|
@@ -44,7 +45,7 @@ import { moveWorkspace } from '../workspace-move.mjs';
|
|
|
44
45
|
import { teamsHome, paths, readJson, AccountLog, parseHostPort } from '@volter/teams/home';
|
|
45
46
|
import { NODE_PROTOCOL } from '@volter/teams/channel';
|
|
46
47
|
|
|
47
|
-
const MACHINE_VERBS = new Set(['machine', 'describe', 'panes', 'input', 'suspend', 'resume', 'files', 'ports', 'port', 'browser', 'stream', 'jobs', 'workspace', 'title', 'attention', 'watch', 'rpc', 'log', 'mail']);
|
|
48
|
+
const MACHINE_VERBS = new Set(['machine', 'describe', 'panes', 'input', 'suspend', 'resume', 'files', 'ports', 'port', 'browser', 'stream', 'jobs', 'workspace', 'title', 'attention', 'watch', 'rpc', 'launches', 'log', 'mail']);
|
|
48
49
|
// Every flag a machine verb reads; any other is refused rather than silently ignored.
|
|
49
50
|
const KNOWN_FLAGS = new Set(['home', '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']);
|
|
50
51
|
|
|
@@ -64,7 +65,7 @@ for (let i = 0; i < argv.length; i += 1) {
|
|
|
64
65
|
}
|
|
65
66
|
const [verb, sub, ...rest] = positional;
|
|
66
67
|
|
|
67
|
-
const MACHINE_HELP = 'machine verbs: machine start|status, describe, panes, input, suspend, resume, files, ports, port, stream, jobs, workspace, title, attention, watch, rpc, log, browser (add --machine NAME for an enrolled machine)';
|
|
68
|
+
const MACHINE_HELP = 'machine verbs: machine start|status, describe, panes, input, suspend, resume, files, ports, port, stream, jobs, workspace, title, attention, watch, rpc, launches, log, browser (add --machine NAME for an enrolled machine)';
|
|
68
69
|
|
|
69
70
|
if (verb === undefined || verb === 'help') {
|
|
70
71
|
process.stdout.write(`supercode teams: ${MACHINE_HELP}\n`);
|
|
@@ -312,6 +313,12 @@ async function main() {
|
|
|
312
313
|
case 'jobs':
|
|
313
314
|
// `jobs [--machine NAME]`: the execution jobs the machine's daemon owns now.
|
|
314
315
|
return withNode(async (rpc) => out(await rpc.call('jobs.list', {})));
|
|
316
|
+
case 'launches': {
|
|
317
|
+
if (sub === 'get' && rest[0]) return withNode(async (rpc) => out(await rpc.call('launches.get', { key: rest[0] })));
|
|
318
|
+
if (sub === 'list') return withNode(async (rpc) => out(await rpc.call('launches.list', {})));
|
|
319
|
+
die('launches get <key> | launches list [--machine NAME]');
|
|
320
|
+
return;
|
|
321
|
+
}
|
|
315
322
|
case 'rpc': {
|
|
316
323
|
const channel = await machineChannel();
|
|
317
324
|
const client = new SupercodeHarnessClient({ transport: harnessTransport(channel) });
|
package/codex-startup.mjs
CHANGED
|
@@ -1,8 +1,36 @@
|
|
|
1
1
|
// Codex can still show hook review on resume despite its invocation trust flag.
|
|
2
2
|
// Act only on this exact startup menu, and never submit without reading selection.
|
|
3
3
|
import { composerText } from '@volter/supercode-terminal';
|
|
4
|
+
import { realpathSync } from 'node:fs';
|
|
4
5
|
const pause = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
5
6
|
|
|
7
|
+
// CLI and portable SDK callers can name a directory through a filesystem alias.
|
|
8
|
+
// Resolve only on the executing machine, before the native seed/server is built.
|
|
9
|
+
export function canonicalCodexFolderTrust(cwd, args = []) {
|
|
10
|
+
if (typeof cwd !== 'string' || !cwd) return args;
|
|
11
|
+
const grant = `projects={${JSON.stringify(cwd)}={trust_level="trusted"}}`;
|
|
12
|
+
const projects = [];
|
|
13
|
+
for (let i = 0; i < args.length && args[i] !== '--'; i += 1) {
|
|
14
|
+
const arg = args[i];
|
|
15
|
+
if (arg === '-c' || arg === '--config') {
|
|
16
|
+
const value = args[++i];
|
|
17
|
+
if (value?.startsWith('projects')) projects.push({ index: i, value, prefix: '' });
|
|
18
|
+
} else if (arg.startsWith('--config=')) {
|
|
19
|
+
const value = arg.slice('--config='.length);
|
|
20
|
+
if (value.startsWith('projects')) projects.push({ index: i, value, prefix: '--config=' });
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
// A custom table, an untrusted grant or multiple overrides belongs to the caller.
|
|
24
|
+
if (projects.length !== 1 || projects[0].value !== grant) return args;
|
|
25
|
+
let effective;
|
|
26
|
+
try { effective = realpathSync(cwd); } catch { return args; }
|
|
27
|
+
if (effective === cwd) return args;
|
|
28
|
+
const out = [...args];
|
|
29
|
+
const { index, prefix } = projects[0];
|
|
30
|
+
out[index] = `${prefix}projects={${JSON.stringify(effective)}={trust_level="trusted"}}`;
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
|
|
6
34
|
function hookReview(screen) {
|
|
7
35
|
const lines = String(screen).split('\n').map((line) => line.trim()).filter(Boolean);
|
|
8
36
|
const start = lines.lastIndexOf('Hooks need review');
|
package/machine.mjs
CHANGED
|
@@ -50,7 +50,7 @@ import { DEFAULT_RANK, normalizeRank, judge } from './attention.mjs';
|
|
|
50
50
|
import { popupTerminal, openPopup } from './popup-terminals.mjs';
|
|
51
51
|
import { JobOwner, executionCapabilities, streamProgram, serveWorkspace } from './execution.mjs';
|
|
52
52
|
import { confirmNativeInitialInput } from './native-initial-input.mjs';
|
|
53
|
-
import { settleCodexHookReview } from './codex-startup.mjs';
|
|
53
|
+
import { canonicalCodexFolderTrust, settleCodexHookReview } from './codex-startup.mjs';
|
|
54
54
|
|
|
55
55
|
/** The preload every launched pane carries: it announces the ports a pane's node processes listen on. */
|
|
56
56
|
const PORTHOLE_HOOK = fileURLToPath(new URL('./porthole-hook.cjs', import.meta.url));
|
|
@@ -1326,6 +1326,7 @@ export class TeamsMachine extends MachineCore {
|
|
|
1326
1326
|
let session;
|
|
1327
1327
|
let nativeInput;
|
|
1328
1328
|
try {
|
|
1329
|
+
if (params.kind === 'codex') params = { ...params, arguments: canonicalCodexFolderTrust(params.cwd, params.arguments) };
|
|
1329
1330
|
session = await this.host.createSession({
|
|
1330
1331
|
command: this.#nativeQuestionCommand(params, contextKey, by, (value) => { nativeInput = value; }),
|
|
1331
1332
|
contextKey,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/supercode-teams",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.118",
|
|
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",
|