@gh-symphony/cli 0.4.4 → 0.4.5
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/dist/{chunk-QBBJMCNC.js → chunk-7KFCWMMW.js} +12 -51
- package/dist/{doctor-Y2AZZKGW.js → doctor-GHKE7TRO.js} +1 -1
- package/dist/index.js +5 -5
- package/dist/{repo-2NS2AU3D.js → repo-V72OM7JL.js} +1 -1
- package/dist/{upgrade-FJXX733J.js → upgrade-UZAGYCRJ.js} +2 -2
- package/dist/{version-FYAZ57WO.js → version-UUVKCGQA.js} +1 -1
- package/dist/worker-entry.js +1 -1
- package/dist/{workflow-TQ7UZPGP.js → workflow-L5UEE7JH.js} +1 -1
- package/package.json +5 -5
|
@@ -14,13 +14,10 @@ import {
|
|
|
14
14
|
|
|
15
15
|
// ../runtime-codex/src/runtime.ts
|
|
16
16
|
import { spawn } from "child_process";
|
|
17
|
-
import {
|
|
18
|
-
import { join } from "path";
|
|
19
|
-
import { homedir } from "os";
|
|
17
|
+
import { readFile, writeFile } from "fs/promises";
|
|
20
18
|
import { fileURLToPath } from "url";
|
|
21
19
|
var DEFAULT_GITHUB_GIT_HOST = "github.com";
|
|
22
20
|
var DEFAULT_GITHUB_GIT_USERNAME = "x-access-token";
|
|
23
|
-
var STAGED_CODEX_HOME_DIRNAME = ".codex-agent";
|
|
24
21
|
var DIRECT_AGENT_ENV_KEYS = [
|
|
25
22
|
"OPENAI_API_KEY",
|
|
26
23
|
"OPENAI_BASE_URL",
|
|
@@ -287,20 +284,13 @@ function normalizeCodexRuntimeEvents(message) {
|
|
|
287
284
|
}
|
|
288
285
|
return events;
|
|
289
286
|
}
|
|
290
|
-
function
|
|
291
|
-
return
|
|
292
|
-
}
|
|
293
|
-
function resolvePreparedAgentEnvironment(workingDirectory, env) {
|
|
294
|
-
const preparedEnv = Object.fromEntries(
|
|
287
|
+
function resolvePreparedAgentEnvironment(env) {
|
|
288
|
+
return Object.fromEntries(
|
|
295
289
|
DIRECT_AGENT_ENV_KEYS.flatMap((key) => {
|
|
296
290
|
const value = env?.[key];
|
|
297
291
|
return typeof value === "string" && value.length > 0 ? [[key, value]] : [];
|
|
298
292
|
})
|
|
299
293
|
);
|
|
300
|
-
return {
|
|
301
|
-
...preparedEnv,
|
|
302
|
-
CODEX_HOME: resolveStagedCodexHome(workingDirectory)
|
|
303
|
-
};
|
|
304
294
|
}
|
|
305
295
|
function buildCodexRuntimePlan(config) {
|
|
306
296
|
const githubTool = createGitHubGraphQLToolDefinition(config);
|
|
@@ -317,10 +307,7 @@ function buildCodexRuntimePlan(config) {
|
|
|
317
307
|
const cmd = config.agentCommand ?? "codex app-server";
|
|
318
308
|
return cmd.startsWith("bash -lc ") ? cmd.slice("bash -lc ".length) : cmd;
|
|
319
309
|
})();
|
|
320
|
-
const agentEnv = resolvePreparedAgentEnvironment(
|
|
321
|
-
config.workingDirectory,
|
|
322
|
-
config.agentEnv
|
|
323
|
-
);
|
|
310
|
+
const agentEnv = resolvePreparedAgentEnvironment(config.agentEnv);
|
|
324
311
|
const linearGraphqlEnv = config.enableLinearGraphqlTool ? {
|
|
325
312
|
LINEAR_GRAPHQL_TOOL_NAME: "linear_graphql",
|
|
326
313
|
LINEAR_GRAPHQL_URL: config.linearGraphqlUrl ?? DEFAULT_LINEAR_GRAPHQL_URL,
|
|
@@ -385,7 +372,6 @@ var CodexRuntimeAdapter = class {
|
|
|
385
372
|
this.dependencies,
|
|
386
373
|
this
|
|
387
374
|
);
|
|
388
|
-
await stageCodexHome(this.config, this.dependencies);
|
|
389
375
|
this.plan = buildCodexRuntimePlan({
|
|
390
376
|
...this.config,
|
|
391
377
|
agentEnv
|
|
@@ -418,10 +404,7 @@ var CodexRuntimeAdapter = class {
|
|
|
418
404
|
};
|
|
419
405
|
}
|
|
420
406
|
resolveCredentials(brokerResponse) {
|
|
421
|
-
return resolvePreparedAgentEnvironment(
|
|
422
|
-
this.config.workingDirectory,
|
|
423
|
-
brokerResponse.env
|
|
424
|
-
);
|
|
407
|
+
return resolvePreparedAgentEnvironment(brokerResponse.env);
|
|
425
408
|
}
|
|
426
409
|
async shutdown() {
|
|
427
410
|
terminateChildProcess(this.child);
|
|
@@ -477,10 +460,10 @@ function createGitCredentialHelperEnvironment(config) {
|
|
|
477
460
|
}
|
|
478
461
|
async function resolveAgentRuntimeEnvironment(config, dependencies = {}, adapter) {
|
|
479
462
|
if (config.agentEnv) {
|
|
480
|
-
return resolveRuntimeCredentials(
|
|
463
|
+
return resolveRuntimeCredentials({ env: config.agentEnv }, adapter);
|
|
481
464
|
}
|
|
482
465
|
if (!config.agentCredentialBrokerUrl || !config.agentCredentialBrokerSecret) {
|
|
483
|
-
return resolvePreparedAgentEnvironment(
|
|
466
|
+
return resolvePreparedAgentEnvironment();
|
|
484
467
|
}
|
|
485
468
|
const now = dependencies.now ?? /* @__PURE__ */ new Date();
|
|
486
469
|
const readFileImpl = dependencies.readFileImpl ?? readFile;
|
|
@@ -489,7 +472,7 @@ async function resolveAgentRuntimeEnvironment(config, dependencies = {}, adapter
|
|
|
489
472
|
readFileImpl
|
|
490
473
|
) : null;
|
|
491
474
|
if (cachedCredentials && shouldReuseAgentCredentialCache(cachedCredentials, now)) {
|
|
492
|
-
return resolveRuntimeCredentials(
|
|
475
|
+
return resolveRuntimeCredentials(cachedCredentials, adapter);
|
|
493
476
|
}
|
|
494
477
|
const fetchImpl = dependencies.fetchImpl ?? fetch;
|
|
495
478
|
const response = await fetchImpl(config.agentCredentialBrokerUrl, {
|
|
@@ -503,7 +486,7 @@ async function resolveAgentRuntimeEnvironment(config, dependencies = {}, adapter
|
|
|
503
486
|
const resolvedEnv = payload.env && response.ok ? adapter ? adapter.resolveCredentials({
|
|
504
487
|
env: payload.env,
|
|
505
488
|
expires_at: payload.expires_at
|
|
506
|
-
}) : resolvePreparedAgentEnvironment(
|
|
489
|
+
}) : resolvePreparedAgentEnvironment(payload.env) : null;
|
|
507
490
|
if (!response.ok || !payload.env || Object.keys(payload.env).length === 0 || !resolvedEnv) {
|
|
508
491
|
throw new AgentRuntimeResolutionError(
|
|
509
492
|
payload.error ?? `Agent credential broker request failed with status ${response.status}.`
|
|
@@ -520,31 +503,8 @@ async function resolveAgentRuntimeEnvironment(config, dependencies = {}, adapter
|
|
|
520
503
|
}
|
|
521
504
|
return resolvedEnv;
|
|
522
505
|
}
|
|
523
|
-
function resolveRuntimeCredentials(
|
|
524
|
-
return adapter ? adapter.resolveCredentials(brokerResponse) : resolvePreparedAgentEnvironment(
|
|
525
|
-
config.workingDirectory,
|
|
526
|
-
brokerResponse.env
|
|
527
|
-
);
|
|
528
|
-
}
|
|
529
|
-
async function stageCodexHome(config, dependencies = {}) {
|
|
530
|
-
const codexHomeDir = resolveStagedCodexHome(config.workingDirectory);
|
|
531
|
-
const mkdirImpl = dependencies.mkdirImpl ?? mkdir;
|
|
532
|
-
await mkdirImpl(codexHomeDir, { recursive: true });
|
|
533
|
-
const writeFileImpl = dependencies.writeFileImpl ?? writeFile;
|
|
534
|
-
await writeFileImpl(
|
|
535
|
-
join(codexHomeDir, "config.toml"),
|
|
536
|
-
"# Isolated agent config \u2014 no personal MCP servers\n",
|
|
537
|
-
"utf8"
|
|
538
|
-
);
|
|
539
|
-
const realCodexHome = process.env.CODEX_HOME ?? join(homedir(), ".codex");
|
|
540
|
-
const copyFileImpl = dependencies.copyFileImpl ?? copyFile;
|
|
541
|
-
try {
|
|
542
|
-
await copyFileImpl(
|
|
543
|
-
join(realCodexHome, "auth.json"),
|
|
544
|
-
join(codexHomeDir, "auth.json")
|
|
545
|
-
);
|
|
546
|
-
} catch {
|
|
547
|
-
}
|
|
506
|
+
function resolveRuntimeCredentials(brokerResponse, adapter) {
|
|
507
|
+
return adapter ? adapter.resolveCredentials(brokerResponse) : resolvePreparedAgentEnvironment(brokerResponse.env);
|
|
548
508
|
}
|
|
549
509
|
function hasRunningChild(child) {
|
|
550
510
|
return child !== null && child.exitCode === null && child.signalCode === null;
|
|
@@ -583,6 +543,7 @@ function resolveLocalRuntimeLaunchConfig(env = process.env) {
|
|
|
583
543
|
githubTokenBrokerSecret: env.GITHUB_TOKEN_BROKER_SECRET,
|
|
584
544
|
githubTokenCachePath: env.GITHUB_TOKEN_CACHE_PATH,
|
|
585
545
|
agentEnv: readDirectAgentEnvironment(env),
|
|
546
|
+
extraEnv: env.CODEX_HOME ? { CODEX_HOME: env.CODEX_HOME } : void 0,
|
|
586
547
|
agentCredentialBrokerUrl: env.AGENT_CREDENTIAL_BROKER_URL,
|
|
587
548
|
agentCredentialBrokerSecret: env.AGENT_CREDENTIAL_BROKER_SECRET,
|
|
588
549
|
agentCredentialCachePath: env.AGENT_CREDENTIAL_CACHE_PATH,
|
package/dist/index.js
CHANGED
|
@@ -417,13 +417,13 @@ function createRemovedCommandHandler(message) {
|
|
|
417
417
|
|
|
418
418
|
// src/index.ts
|
|
419
419
|
var COMMANDS = {
|
|
420
|
-
workflow: () => import("./workflow-
|
|
420
|
+
workflow: () => import("./workflow-L5UEE7JH.js"),
|
|
421
421
|
setup: () => import("./setup-DMYXHOCB.js"),
|
|
422
|
-
doctor: () => import("./doctor-
|
|
423
|
-
upgrade: () => import("./upgrade-
|
|
424
|
-
repo: () => import("./repo-
|
|
422
|
+
doctor: () => import("./doctor-GHKE7TRO.js"),
|
|
423
|
+
upgrade: () => import("./upgrade-UZAGYCRJ.js"),
|
|
424
|
+
repo: () => import("./repo-V72OM7JL.js"),
|
|
425
425
|
config: () => import("./config-cmd-OIVIUKG7.js"),
|
|
426
|
-
version: () => import("./version-
|
|
426
|
+
version: () => import("./version-UUVKCGQA.js")
|
|
427
427
|
};
|
|
428
428
|
function addGlobalOptions(command) {
|
|
429
429
|
return command.option("--config <dir>", "Config directory").addOption(new Option("--config-dir <dir>").hideHelp()).option("-v, --verbose", "Enable verbose output").option("--json", "Output in JSON format").option("--no-color", "Disable color output");
|
|
@@ -16,8 +16,8 @@ function execFileAsync(file, args, execFileImpl = execFileCallback) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
function resolveCurrentCliVersion() {
|
|
19
|
-
if ("0.4.
|
|
20
|
-
return "0.4.
|
|
19
|
+
if ("0.4.5".length > 0) {
|
|
20
|
+
return "0.4.5";
|
|
21
21
|
}
|
|
22
22
|
const pkg = JSON.parse(
|
|
23
23
|
readFileSync(new URL("../../package.json", import.meta.url), "utf8")
|
package/dist/worker-entry.js
CHANGED
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-I3CZXKS5.js";
|
|
10
10
|
import "./chunk-4ZHWEQQL.js";
|
|
11
11
|
import "./chunk-HHBXGE23.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-7KFCWMMW.js";
|
|
13
13
|
import "./chunk-SMNIGNS3.js";
|
|
14
14
|
import "./chunk-LJUEOVAQ.js";
|
|
15
15
|
import "./chunk-YZP5N5XP.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gh-symphony/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "hojinzs",
|
|
6
6
|
"description": "Interactive CLI for GitHub Symphony orchestration",
|
|
@@ -41,13 +41,13 @@
|
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsup": "^8.5.1",
|
|
44
|
+
"@gh-symphony/core": "0.0.14",
|
|
44
45
|
"@gh-symphony/control-plane": "0.0.15",
|
|
45
46
|
"@gh-symphony/dashboard": "0.0.14",
|
|
46
|
-
"@gh-symphony/
|
|
47
|
-
"@gh-symphony/core": "0.0.14",
|
|
48
|
-
"@gh-symphony/worker": "0.0.14",
|
|
47
|
+
"@gh-symphony/orchestrator": "0.0.14",
|
|
49
48
|
"@gh-symphony/runtime-claude": "0.0.14",
|
|
50
|
-
"@gh-symphony/
|
|
49
|
+
"@gh-symphony/tracker-github": "0.0.14",
|
|
50
|
+
"@gh-symphony/worker": "0.0.14"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|
|
53
53
|
"build": "tsup",
|