@volter/supercode-teams 0.2.116 → 0.2.117
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/codex-startup.mjs +28 -0
- package/machine.mjs +2 -1
- package/package.json +1 -1
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.117",
|
|
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",
|