@gh-symphony/cli 0.4.3 → 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-OVE4KOBD.js → chunk-4ZHWEQQL.js} +294 -7
- package/dist/{chunk-QBBJMCNC.js → chunk-7KFCWMMW.js} +12 -51
- package/dist/{chunk-QHMT2V3X.js → chunk-I3CZXKS5.js} +2 -2
- package/dist/{doctor-KQNUOPYV.js → doctor-GHKE7TRO.js} +3 -3
- package/dist/index.js +9 -7
- package/dist/{repo-2NS2AU3D.js → repo-V72OM7JL.js} +1 -1
- package/dist/{setup-4ZBHGOXT.js → setup-DMYXHOCB.js} +1 -1
- package/dist/{upgrade-LQG3QBLC.js → upgrade-UZAGYCRJ.js} +2 -2
- package/dist/{version-TNOQD3SF.js → version-UUVKCGQA.js} +1 -1
- package/dist/worker-entry.js +1 -1
- package/dist/{workflow-R3G7IA3Z.js → workflow-L5UEE7JH.js} +3 -3
- package/package.json +3 -3
|
@@ -326,10 +326,19 @@ ${promptBody}
|
|
|
326
326
|
function buildFrontMatter(input) {
|
|
327
327
|
const lines = [];
|
|
328
328
|
lines.push("tracker:");
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
329
|
+
if (input.tracker?.kind === "linear") {
|
|
330
|
+
lines.push(" kind: linear");
|
|
331
|
+
lines.push(
|
|
332
|
+
` endpoint: ${input.tracker.endpoint ?? "https://api.linear.app/graphql"}`
|
|
333
|
+
);
|
|
334
|
+
lines.push(` api_key: ${input.tracker.apiKey ?? "$LINEAR_API_KEY"}`);
|
|
335
|
+
lines.push(` project_slug: ${input.tracker.projectSlug}`);
|
|
336
|
+
} else {
|
|
337
|
+
lines.push(" kind: github-project");
|
|
338
|
+
lines.push(` project_id: ${input.projectId}`);
|
|
339
|
+
lines.push(` state_field: ${input.stateFieldName}`);
|
|
340
|
+
lines.push(...buildPriorityFrontMatter(input));
|
|
341
|
+
}
|
|
333
342
|
if (input.lifecycle.activeStates.length > 0) {
|
|
334
343
|
lines.push(" active_states:");
|
|
335
344
|
for (const state of input.lifecycle.activeStates) {
|
|
@@ -342,6 +351,25 @@ function buildFrontMatter(input) {
|
|
|
342
351
|
lines.push(` - ${state}`);
|
|
343
352
|
}
|
|
344
353
|
}
|
|
354
|
+
if (input.tracker?.kind === "linear") {
|
|
355
|
+
const include = input.tracker.pickupLabels?.include ?? [];
|
|
356
|
+
const exclude = input.tracker.pickupLabels?.exclude ?? [];
|
|
357
|
+
if (include.length > 0 || exclude.length > 0) {
|
|
358
|
+
lines.push(" pickup_labels:");
|
|
359
|
+
if (include.length > 0) {
|
|
360
|
+
lines.push(" include:");
|
|
361
|
+
for (const label of include) {
|
|
362
|
+
lines.push(` - ${label}`);
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
if (exclude.length > 0) {
|
|
366
|
+
lines.push(" exclude:");
|
|
367
|
+
for (const label of exclude) {
|
|
368
|
+
lines.push(` - ${label}`);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
345
373
|
lines.push(
|
|
346
374
|
...buildStringListFrontMatter(
|
|
347
375
|
"blocker_check_states",
|
|
@@ -2152,6 +2180,14 @@ function parseInitFlags(args) {
|
|
|
2152
2180
|
flags.project = next;
|
|
2153
2181
|
i += 1;
|
|
2154
2182
|
break;
|
|
2183
|
+
case "--tracker":
|
|
2184
|
+
flags.tracker = next;
|
|
2185
|
+
i += 1;
|
|
2186
|
+
break;
|
|
2187
|
+
case "--linear-project-slug":
|
|
2188
|
+
flags.linearProjectSlug = next;
|
|
2189
|
+
i += 1;
|
|
2190
|
+
break;
|
|
2155
2191
|
case "--output":
|
|
2156
2192
|
flags.output = next;
|
|
2157
2193
|
i += 1;
|
|
@@ -2173,7 +2209,7 @@ function parseInitFlags(args) {
|
|
|
2173
2209
|
function warnDeprecatedSkipContext() {
|
|
2174
2210
|
p.log.warn(SKIP_CONTEXT_DEPRECATION);
|
|
2175
2211
|
}
|
|
2176
|
-
async function runInitRuntimePreflight(runtime) {
|
|
2212
|
+
async function runInitRuntimePreflight(runtime, opts = {}) {
|
|
2177
2213
|
if (!isClaudeRuntime(runtime)) {
|
|
2178
2214
|
return true;
|
|
2179
2215
|
}
|
|
@@ -2183,7 +2219,7 @@ async function runInitRuntimePreflight(runtime) {
|
|
|
2183
2219
|
env: process.env,
|
|
2184
2220
|
command: resolveClaudeCommandBinary(resolveRuntimeCommand(runtime)) ?? resolveRuntimeCommand(runtime),
|
|
2185
2221
|
authMode: "local-or-api-key",
|
|
2186
|
-
includeGhAuth: !hasGitHubGraphqlToken
|
|
2222
|
+
includeGhAuth: opts.includeGhAuth ?? !hasGitHubGraphqlToken
|
|
2187
2223
|
});
|
|
2188
2224
|
const message = formatClaudePreflightText(report);
|
|
2189
2225
|
if (report.ok) {
|
|
@@ -2202,6 +2238,27 @@ var handler = async (args, options) => {
|
|
|
2202
2238
|
await runNonInteractive(flags, options);
|
|
2203
2239
|
return;
|
|
2204
2240
|
}
|
|
2241
|
+
const trackerKind = resolveInitTrackerKind(flags);
|
|
2242
|
+
if (trackerKind instanceof Error) {
|
|
2243
|
+
process.stderr.write(`Error: ${trackerKind.message}
|
|
2244
|
+
`);
|
|
2245
|
+
process.exitCode = 1;
|
|
2246
|
+
return;
|
|
2247
|
+
}
|
|
2248
|
+
const trackerFlagError = validateInitTrackerFlags(flags, trackerKind);
|
|
2249
|
+
if (trackerFlagError) {
|
|
2250
|
+
process.stderr.write(`Error: ${trackerFlagError}
|
|
2251
|
+
`);
|
|
2252
|
+
process.exitCode = 1;
|
|
2253
|
+
return;
|
|
2254
|
+
}
|
|
2255
|
+
if (trackerKind === "linear") {
|
|
2256
|
+
process.stderr.write(
|
|
2257
|
+
"Error: Linear workflow init currently requires --non-interactive.\n"
|
|
2258
|
+
);
|
|
2259
|
+
process.exitCode = 1;
|
|
2260
|
+
return;
|
|
2261
|
+
}
|
|
2205
2262
|
await runInteractive(flags, options);
|
|
2206
2263
|
};
|
|
2207
2264
|
var workflow_init_default = handler;
|
|
@@ -2668,6 +2725,143 @@ async function planWorkflowArtifacts(opts) {
|
|
|
2668
2725
|
ecosystemPlan
|
|
2669
2726
|
};
|
|
2670
2727
|
}
|
|
2728
|
+
var LINEAR_DEFAULT_STATUS_FIELD = {
|
|
2729
|
+
id: "linear-state",
|
|
2730
|
+
name: "State",
|
|
2731
|
+
options: [
|
|
2732
|
+
{
|
|
2733
|
+
id: "linear-todo",
|
|
2734
|
+
name: "Todo",
|
|
2735
|
+
description: null,
|
|
2736
|
+
color: null
|
|
2737
|
+
},
|
|
2738
|
+
{
|
|
2739
|
+
id: "linear-in-progress",
|
|
2740
|
+
name: "In Progress",
|
|
2741
|
+
description: null,
|
|
2742
|
+
color: null
|
|
2743
|
+
},
|
|
2744
|
+
{
|
|
2745
|
+
id: "linear-rework",
|
|
2746
|
+
name: "Rework",
|
|
2747
|
+
description: null,
|
|
2748
|
+
color: null
|
|
2749
|
+
},
|
|
2750
|
+
{
|
|
2751
|
+
id: "linear-human-review",
|
|
2752
|
+
name: "Human Review",
|
|
2753
|
+
description: null,
|
|
2754
|
+
color: null
|
|
2755
|
+
},
|
|
2756
|
+
{
|
|
2757
|
+
id: "linear-done",
|
|
2758
|
+
name: "Done",
|
|
2759
|
+
description: null,
|
|
2760
|
+
color: null
|
|
2761
|
+
},
|
|
2762
|
+
{
|
|
2763
|
+
id: "linear-canceled",
|
|
2764
|
+
name: "Canceled",
|
|
2765
|
+
description: null,
|
|
2766
|
+
color: null
|
|
2767
|
+
},
|
|
2768
|
+
{
|
|
2769
|
+
id: "linear-cancelled",
|
|
2770
|
+
name: "Cancelled",
|
|
2771
|
+
description: null,
|
|
2772
|
+
color: null
|
|
2773
|
+
},
|
|
2774
|
+
{
|
|
2775
|
+
id: "linear-duplicate",
|
|
2776
|
+
name: "Duplicate",
|
|
2777
|
+
description: null,
|
|
2778
|
+
color: null
|
|
2779
|
+
}
|
|
2780
|
+
]
|
|
2781
|
+
};
|
|
2782
|
+
var LINEAR_DEFAULT_MAPPINGS = {
|
|
2783
|
+
Todo: { role: "active" },
|
|
2784
|
+
"In Progress": { role: "active" },
|
|
2785
|
+
Rework: { role: "active" },
|
|
2786
|
+
"Human Review": { role: "wait" },
|
|
2787
|
+
Done: { role: "terminal" },
|
|
2788
|
+
Canceled: { role: "terminal" },
|
|
2789
|
+
Cancelled: { role: "terminal" },
|
|
2790
|
+
Duplicate: { role: "terminal" }
|
|
2791
|
+
};
|
|
2792
|
+
function buildLinearProjectDetail(projectSlug) {
|
|
2793
|
+
return {
|
|
2794
|
+
id: projectSlug,
|
|
2795
|
+
title: `Linear project ${projectSlug}`,
|
|
2796
|
+
url: "",
|
|
2797
|
+
statusFields: [LINEAR_DEFAULT_STATUS_FIELD],
|
|
2798
|
+
textFields: [],
|
|
2799
|
+
linkedRepositories: []
|
|
2800
|
+
};
|
|
2801
|
+
}
|
|
2802
|
+
function buildLinearWorkflowLifecycle() {
|
|
2803
|
+
return toWorkflowLifecycleConfig("State", LINEAR_DEFAULT_MAPPINGS, {
|
|
2804
|
+
blockerCheckStates: [],
|
|
2805
|
+
planningStates: []
|
|
2806
|
+
});
|
|
2807
|
+
}
|
|
2808
|
+
async function planLinearWorkflowArtifacts(opts) {
|
|
2809
|
+
const environment = opts.environment ?? await detectEnvironment(opts.cwd);
|
|
2810
|
+
const projectDetail = buildLinearProjectDetail(opts.projectSlug);
|
|
2811
|
+
const lifecycle = buildLinearWorkflowLifecycle();
|
|
2812
|
+
const workflowMd = generateWorkflowMarkdown({
|
|
2813
|
+
projectId: opts.projectSlug,
|
|
2814
|
+
tracker: {
|
|
2815
|
+
kind: "linear",
|
|
2816
|
+
projectSlug: opts.projectSlug
|
|
2817
|
+
},
|
|
2818
|
+
stateFieldName: LINEAR_DEFAULT_STATUS_FIELD.name,
|
|
2819
|
+
priority: null,
|
|
2820
|
+
mappings: LINEAR_DEFAULT_MAPPINGS,
|
|
2821
|
+
lifecycle,
|
|
2822
|
+
runtime: opts.runtime,
|
|
2823
|
+
detectedEnvironment: environment
|
|
2824
|
+
});
|
|
2825
|
+
const workflowPlan = await planFileChange({
|
|
2826
|
+
path: opts.outputPath,
|
|
2827
|
+
label: "WORKFLOW.md",
|
|
2828
|
+
content: workflowMd,
|
|
2829
|
+
mode: "overwrite"
|
|
2830
|
+
});
|
|
2831
|
+
const ecosystemPlan = await planEcosystem({
|
|
2832
|
+
cwd: opts.cwd,
|
|
2833
|
+
projectDetail,
|
|
2834
|
+
statusField: LINEAR_DEFAULT_STATUS_FIELD,
|
|
2835
|
+
priorityField: null,
|
|
2836
|
+
priority: buildDisabledPriority(),
|
|
2837
|
+
lifecycle,
|
|
2838
|
+
includePriorityTemplates: false,
|
|
2839
|
+
runtime: opts.runtime,
|
|
2840
|
+
skipSkills: opts.skipSkills,
|
|
2841
|
+
skipContext: opts.skipContext,
|
|
2842
|
+
environment
|
|
2843
|
+
});
|
|
2844
|
+
return {
|
|
2845
|
+
outputPath: opts.outputPath,
|
|
2846
|
+
workflowMd,
|
|
2847
|
+
workflowPlan,
|
|
2848
|
+
ecosystemPlan
|
|
2849
|
+
};
|
|
2850
|
+
}
|
|
2851
|
+
async function writeLinearEcosystem(opts) {
|
|
2852
|
+
return writeEcosystem({
|
|
2853
|
+
cwd: opts.cwd,
|
|
2854
|
+
projectDetail: buildLinearProjectDetail(opts.projectSlug),
|
|
2855
|
+
statusField: LINEAR_DEFAULT_STATUS_FIELD,
|
|
2856
|
+
priorityField: null,
|
|
2857
|
+
priority: buildDisabledPriority(),
|
|
2858
|
+
lifecycle: buildLinearWorkflowLifecycle(),
|
|
2859
|
+
includePriorityTemplates: false,
|
|
2860
|
+
runtime: opts.runtime,
|
|
2861
|
+
skipSkills: opts.skipSkills,
|
|
2862
|
+
skipContext: opts.skipContext
|
|
2863
|
+
});
|
|
2864
|
+
}
|
|
2671
2865
|
async function writeWorkflowPlan(workflowPlan) {
|
|
2672
2866
|
return writePlannedFile(workflowPlan);
|
|
2673
2867
|
}
|
|
@@ -2948,10 +3142,30 @@ async function runNonInteractive(flags, options) {
|
|
|
2948
3142
|
process.exitCode = 1;
|
|
2949
3143
|
return;
|
|
2950
3144
|
}
|
|
2951
|
-
|
|
3145
|
+
const trackerKind = resolveInitTrackerKind(flags);
|
|
3146
|
+
if (trackerKind instanceof Error) {
|
|
3147
|
+
process.stderr.write(`Error: ${trackerKind.message}
|
|
3148
|
+
`);
|
|
3149
|
+
process.exitCode = 1;
|
|
3150
|
+
return;
|
|
3151
|
+
}
|
|
3152
|
+
const trackerFlagError = validateInitTrackerFlags(flags, trackerKind);
|
|
3153
|
+
if (trackerFlagError) {
|
|
3154
|
+
process.stderr.write(`Error: ${trackerFlagError}
|
|
3155
|
+
`);
|
|
2952
3156
|
process.exitCode = 1;
|
|
2953
3157
|
return;
|
|
2954
3158
|
}
|
|
3159
|
+
if (!await runInitRuntimePreflight(runtime, {
|
|
3160
|
+
includeGhAuth: trackerKind === "linear" ? false : void 0
|
|
3161
|
+
})) {
|
|
3162
|
+
process.exitCode = 1;
|
|
3163
|
+
return;
|
|
3164
|
+
}
|
|
3165
|
+
if (trackerKind === "linear") {
|
|
3166
|
+
await runLinearNonInteractive(flags, options, runtime);
|
|
3167
|
+
return;
|
|
3168
|
+
}
|
|
2955
3169
|
let token;
|
|
2956
3170
|
try {
|
|
2957
3171
|
token = getGhTokenWithSource().token;
|
|
@@ -3085,6 +3299,79 @@ Run without --non-interactive for manual mapping.
|
|
|
3085
3299
|
});
|
|
3086
3300
|
}
|
|
3087
3301
|
}
|
|
3302
|
+
function resolveInitTrackerKind(flags) {
|
|
3303
|
+
const rawTracker = flags.tracker?.trim();
|
|
3304
|
+
if (!rawTracker) {
|
|
3305
|
+
return flags.linearProjectSlug ? "linear" : "github-project";
|
|
3306
|
+
}
|
|
3307
|
+
if (rawTracker === "github-project") {
|
|
3308
|
+
if (flags.linearProjectSlug?.trim()) {
|
|
3309
|
+
return new Error(
|
|
3310
|
+
"--linear-project-slug is only supported for --tracker linear."
|
|
3311
|
+
);
|
|
3312
|
+
}
|
|
3313
|
+
return "github-project";
|
|
3314
|
+
}
|
|
3315
|
+
if (rawTracker === "linear") {
|
|
3316
|
+
return "linear";
|
|
3317
|
+
}
|
|
3318
|
+
return new Error(
|
|
3319
|
+
`Unsupported tracker '${rawTracker}'. Choose one of: github-project, linear.`
|
|
3320
|
+
);
|
|
3321
|
+
}
|
|
3322
|
+
function validateInitTrackerFlags(flags, trackerKind) {
|
|
3323
|
+
if (trackerKind === "linear") {
|
|
3324
|
+
if (!flags.linearProjectSlug?.trim()) {
|
|
3325
|
+
return "--linear-project-slug is required when --tracker linear is used.";
|
|
3326
|
+
}
|
|
3327
|
+
if (flags.project) {
|
|
3328
|
+
return "--project is only supported for --tracker github-project.";
|
|
3329
|
+
}
|
|
3330
|
+
}
|
|
3331
|
+
return null;
|
|
3332
|
+
}
|
|
3333
|
+
async function runLinearNonInteractive(flags, options, runtime) {
|
|
3334
|
+
const projectSlug = flags.linearProjectSlug.trim();
|
|
3335
|
+
const outputPath = resolve(flags.output ?? "WORKFLOW.md");
|
|
3336
|
+
const { workflowPlan, ecosystemPlan } = await planLinearWorkflowArtifacts({
|
|
3337
|
+
cwd: process.cwd(),
|
|
3338
|
+
outputPath,
|
|
3339
|
+
projectSlug,
|
|
3340
|
+
runtime,
|
|
3341
|
+
skipSkills: flags.skipSkills,
|
|
3342
|
+
skipContext: flags.skipContext
|
|
3343
|
+
});
|
|
3344
|
+
if (flags.dryRun) {
|
|
3345
|
+
if (options.json) {
|
|
3346
|
+
process.stdout.write(
|
|
3347
|
+
JSON.stringify(
|
|
3348
|
+
buildDryRunJsonResult(outputPath, workflowPlan, ecosystemPlan)
|
|
3349
|
+
) + "\n"
|
|
3350
|
+
);
|
|
3351
|
+
return;
|
|
3352
|
+
}
|
|
3353
|
+
printDryRunPreview(outputPath, workflowPlan, ecosystemPlan);
|
|
3354
|
+
return;
|
|
3355
|
+
}
|
|
3356
|
+
await writeWorkflowPlan(workflowPlan);
|
|
3357
|
+
const ecosystemResult = await writeLinearEcosystem({
|
|
3358
|
+
cwd: process.cwd(),
|
|
3359
|
+
projectSlug,
|
|
3360
|
+
runtime,
|
|
3361
|
+
skipSkills: flags.skipSkills,
|
|
3362
|
+
skipContext: flags.skipContext
|
|
3363
|
+
});
|
|
3364
|
+
if (options.json) {
|
|
3365
|
+
process.stdout.write(
|
|
3366
|
+
JSON.stringify({ output: outputPath, status: workflowPlan.status }) + "\n"
|
|
3367
|
+
);
|
|
3368
|
+
} else {
|
|
3369
|
+
printEcosystemSummary(ecosystemResult, outputPath, {
|
|
3370
|
+
interactive: false,
|
|
3371
|
+
nextSteps: "Run 'gh-symphony repo init' from the target repository."
|
|
3372
|
+
});
|
|
3373
|
+
}
|
|
3374
|
+
}
|
|
3088
3375
|
async function runInteractive(flags, options) {
|
|
3089
3376
|
p.intro("gh-symphony \u2014 WORKFLOW.md Setup");
|
|
3090
3377
|
await runInteractiveStandalone(flags, options);
|
|
@@ -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,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
workflow_init_default
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4ZHWEQQL.js";
|
|
5
5
|
import {
|
|
6
6
|
fetchGithubProjectIssueByRepositoryAndNumber,
|
|
7
7
|
inspectManagedProjectSelection,
|
|
@@ -377,7 +377,7 @@ Commands:
|
|
|
377
377
|
preview Render the final worker prompt from a sample or live issue
|
|
378
378
|
|
|
379
379
|
Options:
|
|
380
|
-
workflow init [--non-interactive] [--project <id>] [--output <path>] [--skip-skills] [--skip-context (deprecated no-op)] [--dry-run]
|
|
380
|
+
workflow init [--non-interactive] [--tracker <github-project|linear>] [--project <id>] [--linear-project-slug <slug>] [--output <path>] [--skip-skills] [--skip-context (deprecated no-op)] [--dry-run]
|
|
381
381
|
workflow validate [--file <path>]
|
|
382
382
|
workflow preview [issue] [--file <path>] [--issue <owner/repo#number|ENG-123>] [--project-id <projectId>] [--sample <json>] [--attempt <n>]
|
|
383
383
|
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
parseIssueReference,
|
|
6
6
|
readGitHubProjectBinding,
|
|
7
7
|
renderIssueWorkflowPreview
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-I3CZXKS5.js";
|
|
9
|
+
import "./chunk-4ZHWEQQL.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchGithubProjectIssueByRepositoryAndNumber,
|
|
12
12
|
fetchGithubProjectIssues,
|
|
13
13
|
inspectManagedProjectSelection
|
|
14
14
|
} from "./chunk-HHBXGE23.js";
|
|
15
|
-
import "./chunk-
|
|
15
|
+
import "./chunk-7KFCWMMW.js";
|
|
16
16
|
import {
|
|
17
17
|
resolveRuntimeRoot
|
|
18
18
|
} from "./chunk-3IRPSPAF.js";
|
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-
|
|
421
|
-
setup: () => import("./setup-
|
|
422
|
-
doctor: () => import("./doctor-
|
|
423
|
-
upgrade: () => import("./upgrade-
|
|
424
|
-
repo: () => import("./repo-
|
|
420
|
+
workflow: () => import("./workflow-L5UEE7JH.js"),
|
|
421
|
+
setup: () => import("./setup-DMYXHOCB.js"),
|
|
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");
|
|
@@ -525,7 +525,7 @@ function createProgram() {
|
|
|
525
525
|
);
|
|
526
526
|
});
|
|
527
527
|
addGlobalOptions(
|
|
528
|
-
workflow.command("init").description("Generate WORKFLOW.md and workflow support files").option("--non-interactive", "Run without prompts").option("--project <id>", "GitHub Project ID or URL").option("--output <path>", "Write WORKFLOW.md to a custom path").option(
|
|
528
|
+
workflow.command("init").description("Generate WORKFLOW.md and workflow support files").option("--non-interactive", "Run without prompts").option("--tracker <kind>", "Tracker kind: github-project or linear").option("--project <id>", "GitHub Project ID or URL").option("--linear-project-slug <slug>", "Linear project slug").option("--output <path>", "Write WORKFLOW.md to a custom path").option(
|
|
529
529
|
"--runtime <kind>",
|
|
530
530
|
"Runtime preset: codex-app-server or claude-print"
|
|
531
531
|
).option("--skip-skills", "Skip runtime skill generation").option("--skip-context", "Deprecated no-op").option("--dry-run", "Preview generated files without writing them").allowExcessArguments(false)
|
|
@@ -534,7 +534,9 @@ function createProgram() {
|
|
|
534
534
|
const values = this.optsWithGlobals();
|
|
535
535
|
const args = ["init"];
|
|
536
536
|
pushOption(args, "--non-interactive", values.nonInteractive);
|
|
537
|
+
pushOption(args, "--tracker", values.tracker);
|
|
537
538
|
pushOption(args, "--project", values.project);
|
|
539
|
+
pushOption(args, "--linear-project-slug", values.linearProjectSlug);
|
|
538
540
|
pushOption(args, "--output", values.output);
|
|
539
541
|
pushOption(args, "--runtime", values.runtime);
|
|
540
542
|
pushOption(args, "--skip-skills", values.skipSkills);
|
|
@@ -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
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
resetWorkflowCommandDependenciesForTest,
|
|
7
7
|
setWorkflowCommandDependenciesForTest,
|
|
8
8
|
workflow_default
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-I3CZXKS5.js";
|
|
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",
|
|
@@ -42,11 +42,11 @@
|
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"tsup": "^8.5.1",
|
|
44
44
|
"@gh-symphony/core": "0.0.14",
|
|
45
|
-
"@gh-symphony/dashboard": "0.0.14",
|
|
46
45
|
"@gh-symphony/control-plane": "0.0.15",
|
|
46
|
+
"@gh-symphony/dashboard": "0.0.14",
|
|
47
47
|
"@gh-symphony/orchestrator": "0.0.14",
|
|
48
|
-
"@gh-symphony/tracker-github": "0.0.14",
|
|
49
48
|
"@gh-symphony/runtime-claude": "0.0.14",
|
|
49
|
+
"@gh-symphony/tracker-github": "0.0.14",
|
|
50
50
|
"@gh-symphony/worker": "0.0.14"
|
|
51
51
|
},
|
|
52
52
|
"scripts": {
|