@gh-symphony/cli 0.0.14 → 0.0.16
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-5NV3LSAJ.js +11 -0
- package/dist/chunk-6HBZC3BE.js +468 -0
- package/dist/chunk-76QPITKI.js +109 -0
- package/dist/chunk-EFMFGOWM.js +3575 -0
- package/dist/chunk-IWR4UQEJ.js +2250 -0
- package/dist/chunk-JO3AXHQI.js +130 -0
- package/dist/chunk-MHIWAIVD.js +876 -0
- package/dist/chunk-MVRF7BES.js +68 -0
- package/dist/chunk-ROGRTUFI.js +108 -0
- package/dist/chunk-TF3QNWNC.js +1121 -0
- package/dist/chunk-TH5QPO3Y.js +67 -0
- package/dist/config-cmd-AZ7POMAA.js +110 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.js +568 -356
- package/dist/init-EZXQAXZM.js +17 -0
- package/dist/logs-6LNGT2GF.js +188 -0
- package/dist/project-557FE2GD.js +679 -0
- package/dist/recover-LVBI2TGH.js +131 -0
- package/dist/repo-R3XBIVAX.js +121 -0
- package/dist/run-WITYAYFZ.js +108 -0
- package/dist/start-JUFKNL3N.js +16 -0
- package/dist/status-3WK5BWRZ.js +11 -0
- package/dist/stop-AA3AP5M6.js +9 -0
- package/dist/version-VBB62JWI.js +30 -0
- package/dist/worker-entry.js +1828 -0
- package/package.json +9 -4
- package/dist/ansi.d.ts +0 -15
- package/dist/ansi.js +0 -53
- package/dist/commands/config-cmd.d.ts +0 -3
- package/dist/commands/config-cmd.js +0 -90
- package/dist/commands/help.d.ts +0 -3
- package/dist/commands/help.js +0 -55
- package/dist/commands/init.d.ts +0 -34
- package/dist/commands/init.js +0 -477
- package/dist/commands/logs.d.ts +0 -3
- package/dist/commands/logs.js +0 -184
- package/dist/commands/project.d.ts +0 -3
- package/dist/commands/project.js +0 -649
- package/dist/commands/recover.d.ts +0 -3
- package/dist/commands/recover.js +0 -119
- package/dist/commands/repo.d.ts +0 -3
- package/dist/commands/repo.js +0 -103
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/run.js +0 -95
- package/dist/commands/start.d.ts +0 -20
- package/dist/commands/start.js +0 -344
- package/dist/commands/status-refresh.d.ts +0 -9
- package/dist/commands/status-refresh.js +0 -27
- package/dist/commands/status.d.ts +0 -3
- package/dist/commands/status.js +0 -237
- package/dist/commands/stop.d.ts +0 -3
- package/dist/commands/stop.js +0 -92
- package/dist/commands/version.d.ts +0 -3
- package/dist/commands/version.js +0 -21
- package/dist/completion.d.ts +0 -1
- package/dist/completion.js +0 -204
- package/dist/config.d.ts +0 -38
- package/dist/config.js +0 -82
- package/dist/context/context-types.d.ts +0 -36
- package/dist/context/context-types.js +0 -1
- package/dist/context/generate-context-yaml.d.ts +0 -15
- package/dist/context/generate-context-yaml.js +0 -129
- package/dist/dashboard/renderer.d.ts +0 -9
- package/dist/dashboard/renderer.js +0 -220
- package/dist/detection/environment-detector.d.ts +0 -11
- package/dist/detection/environment-detector.js +0 -140
- package/dist/github/client.d.ts +0 -71
- package/dist/github/client.js +0 -348
- package/dist/github/gh-auth.d.ts +0 -34
- package/dist/github/gh-auth.js +0 -110
- package/dist/mapping/smart-defaults.d.ts +0 -17
- package/dist/mapping/smart-defaults.js +0 -86
- package/dist/orchestrator-runtime.d.ts +0 -1
- package/dist/orchestrator-runtime.js +0 -4
- package/dist/orchestrator-status-endpoint.d.ts +0 -5
- package/dist/orchestrator-status-endpoint.js +0 -27
- package/dist/project-selection.d.ts +0 -8
- package/dist/project-selection.js +0 -56
- package/dist/skills/skill-writer.d.ts +0 -14
- package/dist/skills/skill-writer.js +0 -62
- package/dist/skills/templates/commit.d.ts +0 -2
- package/dist/skills/templates/commit.js +0 -45
- package/dist/skills/templates/document.d.ts +0 -7
- package/dist/skills/templates/document.js +0 -16
- package/dist/skills/templates/gh-project.d.ts +0 -2
- package/dist/skills/templates/gh-project.js +0 -88
- package/dist/skills/templates/gh-symphony.d.ts +0 -2
- package/dist/skills/templates/gh-symphony.js +0 -125
- package/dist/skills/templates/index.d.ts +0 -8
- package/dist/skills/templates/index.js +0 -28
- package/dist/skills/templates/land.d.ts +0 -2
- package/dist/skills/templates/land.js +0 -59
- package/dist/skills/templates/pull.d.ts +0 -2
- package/dist/skills/templates/pull.js +0 -41
- package/dist/skills/templates/push.d.ts +0 -2
- package/dist/skills/templates/push.js +0 -36
- package/dist/skills/types.d.ts +0 -23
- package/dist/skills/types.js +0 -1
- package/dist/workflow/generate-reference-workflow.d.ts +0 -9
- package/dist/workflow/generate-reference-workflow.js +0 -261
- package/dist/workflow/generate-workflow-md.d.ts +0 -12
- package/dist/workflow/generate-workflow-md.js +0 -134
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
loadGlobalConfig,
|
|
4
|
+
loadProjectConfig
|
|
5
|
+
} from "./chunk-ROGRTUFI.js";
|
|
6
|
+
|
|
7
|
+
// src/project-selection.ts
|
|
8
|
+
import * as p from "@clack/prompts";
|
|
9
|
+
function isInteractiveTerminal() {
|
|
10
|
+
return process.stdin.isTTY === true && process.stdout.isTTY === true;
|
|
11
|
+
}
|
|
12
|
+
function explicitProjectRequiredMessage() {
|
|
13
|
+
return "Multiple projects are configured. Re-run with --project-id in non-interactive environments.\n";
|
|
14
|
+
}
|
|
15
|
+
async function resolveManagedProjectConfig(input) {
|
|
16
|
+
if (input.requestedProjectId) {
|
|
17
|
+
return loadProjectConfig(input.configDir, input.requestedProjectId);
|
|
18
|
+
}
|
|
19
|
+
const global = await loadGlobalConfig(input.configDir);
|
|
20
|
+
const projectIds = global?.projects ?? [];
|
|
21
|
+
if (projectIds.length === 0) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
if (projectIds.length === 1) {
|
|
25
|
+
return loadProjectConfig(input.configDir, projectIds[0]);
|
|
26
|
+
}
|
|
27
|
+
if (!isInteractiveTerminal()) {
|
|
28
|
+
process.stderr.write(explicitProjectRequiredMessage());
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const projects = await Promise.all(
|
|
33
|
+
projectIds.map(async (projectId) => ({
|
|
34
|
+
projectId,
|
|
35
|
+
config: await loadProjectConfig(input.configDir, projectId)
|
|
36
|
+
}))
|
|
37
|
+
);
|
|
38
|
+
const selected = await p.select({
|
|
39
|
+
message: "Select a project:",
|
|
40
|
+
options: projects.map(({ projectId, config }) => ({
|
|
41
|
+
value: projectId,
|
|
42
|
+
label: config?.displayName ?? config?.slug ?? projectId,
|
|
43
|
+
hint: projectId === global?.activeProject ? "current" : config && config.displayName && config.displayName !== projectId ? projectId : void 0
|
|
44
|
+
})),
|
|
45
|
+
maxItems: 10
|
|
46
|
+
});
|
|
47
|
+
if (p.isCancel(selected)) {
|
|
48
|
+
p.cancel("Cancelled.");
|
|
49
|
+
process.exitCode = 130;
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return loadProjectConfig(input.configDir, selected);
|
|
53
|
+
}
|
|
54
|
+
function handleMissingManagedProjectConfig() {
|
|
55
|
+
if (process.exitCode) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
process.stderr.write(
|
|
59
|
+
"No project configured. Run 'gh-symphony project add' first.\n"
|
|
60
|
+
);
|
|
61
|
+
process.exitCode = 1;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
resolveManagedProjectConfig,
|
|
66
|
+
handleMissingManagedProjectConfig
|
|
67
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
configFilePath,
|
|
4
|
+
loadGlobalConfig,
|
|
5
|
+
saveGlobalConfig
|
|
6
|
+
} from "./chunk-ROGRTUFI.js";
|
|
7
|
+
|
|
8
|
+
// src/commands/config-cmd.ts
|
|
9
|
+
import { spawn } from "child_process";
|
|
10
|
+
var handler = async (args, options) => {
|
|
11
|
+
const [subcommand, ...rest] = args;
|
|
12
|
+
switch (subcommand) {
|
|
13
|
+
case "show":
|
|
14
|
+
await configShow(options);
|
|
15
|
+
break;
|
|
16
|
+
case "set":
|
|
17
|
+
await configSet(rest, options);
|
|
18
|
+
break;
|
|
19
|
+
case "edit":
|
|
20
|
+
await configEdit(options);
|
|
21
|
+
break;
|
|
22
|
+
default:
|
|
23
|
+
process.stderr.write("Usage: gh-symphony config <show|set|edit>\n");
|
|
24
|
+
process.exitCode = 2;
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var config_cmd_default = handler;
|
|
28
|
+
async function configShow(options) {
|
|
29
|
+
const config = await loadGlobalConfig(options.configDir);
|
|
30
|
+
if (!config) {
|
|
31
|
+
process.stderr.write("No configuration found. Run 'gh-symphony init'.\n");
|
|
32
|
+
process.exitCode = 1;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (options.json) {
|
|
36
|
+
process.stdout.write(JSON.stringify(config, null, 2) + "\n");
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
process.stdout.write(`Config: ${configFilePath(options.configDir)}
|
|
40
|
+
|
|
41
|
+
`);
|
|
42
|
+
process.stdout.write(`Active project: ${config.activeProject ?? "none"}
|
|
43
|
+
`);
|
|
44
|
+
process.stdout.write(
|
|
45
|
+
`Projects: ${config.projects.join(", ") || "none"}
|
|
46
|
+
`
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
var VALID_KEYS = {
|
|
50
|
+
"active-project": { type: "string" }
|
|
51
|
+
};
|
|
52
|
+
async function configSet(args, options) {
|
|
53
|
+
const [key, value] = args;
|
|
54
|
+
if (!key || value === void 0) {
|
|
55
|
+
process.stderr.write("Usage: gh-symphony config set <key> <value>\n");
|
|
56
|
+
process.stderr.write(`Valid keys: ${Object.keys(VALID_KEYS).join(", ")}
|
|
57
|
+
`);
|
|
58
|
+
process.exitCode = 2;
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
const keyDef = VALID_KEYS[key];
|
|
62
|
+
if (!keyDef) {
|
|
63
|
+
process.stderr.write(
|
|
64
|
+
`Unknown config key: ${key}
|
|
65
|
+
Valid keys: ${Object.keys(VALID_KEYS).join(", ")}
|
|
66
|
+
`
|
|
67
|
+
);
|
|
68
|
+
process.exitCode = 2;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const config = await loadGlobalConfig(options.configDir) ?? {
|
|
72
|
+
activeProject: null,
|
|
73
|
+
projects: []
|
|
74
|
+
};
|
|
75
|
+
switch (key) {
|
|
76
|
+
case "active-project":
|
|
77
|
+
if (!config.projects.includes(value)) {
|
|
78
|
+
process.stderr.write(
|
|
79
|
+
`Project "${value}" not found. Available: ${config.projects.join(", ")}
|
|
80
|
+
`
|
|
81
|
+
);
|
|
82
|
+
process.exitCode = 1;
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
config.activeProject = value;
|
|
86
|
+
break;
|
|
87
|
+
}
|
|
88
|
+
await saveGlobalConfig(options.configDir, config);
|
|
89
|
+
process.stdout.write(`Set ${key} = ${value}
|
|
90
|
+
`);
|
|
91
|
+
}
|
|
92
|
+
async function configEdit(options) {
|
|
93
|
+
const editor = process.env.EDITOR || process.env.VISUAL || "vi";
|
|
94
|
+
const path = configFilePath(options.configDir);
|
|
95
|
+
const child = spawn(editor, [path], {
|
|
96
|
+
stdio: "inherit"
|
|
97
|
+
});
|
|
98
|
+
await new Promise((resolve, reject) => {
|
|
99
|
+
child.on("close", (code) => {
|
|
100
|
+
if (code === 0) {
|
|
101
|
+
resolve();
|
|
102
|
+
} else {
|
|
103
|
+
reject(new Error(`Editor exited with code ${code}`));
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
export {
|
|
109
|
+
config_cmd_default as default
|
|
110
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
export type GlobalOptions = {
|
|
1
|
+
type GlobalOptions = {
|
|
3
2
|
configDir: string;
|
|
4
3
|
verbose: boolean;
|
|
5
4
|
json: boolean;
|
|
6
5
|
noColor: boolean;
|
|
7
6
|
};
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
type CommandHandler = (args: string[], options: GlobalOptions) => Promise<void>;
|
|
8
|
+
declare function runCli(argv: string[]): Promise<void>;
|
|
9
|
+
|
|
10
|
+
export { type CommandHandler, type GlobalOptions, runCli };
|