@gh-symphony/cli 0.0.1 → 0.0.3
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/ansi.d.ts +15 -0
- package/dist/ansi.js +53 -0
- package/dist/commands/config-cmd.js +11 -27
- package/dist/commands/help.js +14 -6
- package/dist/commands/init.d.ts +29 -7
- package/dist/commands/init.js +292 -287
- package/dist/commands/logs.js +4 -4
- package/dist/commands/project.js +34 -34
- package/dist/commands/recover.js +14 -14
- package/dist/commands/repo.js +13 -13
- package/dist/commands/run.js +16 -16
- package/dist/commands/start.js +61 -37
- package/dist/commands/status.js +60 -63
- package/dist/commands/tenant.d.ts +3 -0
- package/dist/commands/tenant.js +402 -0
- package/dist/config.d.ts +20 -19
- package/dist/config.js +17 -17
- package/dist/context/context-types.d.ts +36 -0
- package/dist/context/context-types.js +1 -0
- package/dist/context/generate-context-yaml.d.ts +15 -0
- package/dist/context/generate-context-yaml.js +129 -0
- package/dist/dashboard/renderer.d.ts +9 -0
- package/dist/dashboard/renderer.js +220 -0
- package/dist/detection/environment-detector.d.ts +11 -0
- package/dist/detection/environment-detector.js +140 -0
- package/dist/github/client.d.ts +11 -0
- package/dist/github/client.js +59 -11
- package/dist/github/gh-auth.d.ts +34 -0
- package/dist/github/gh-auth.js +110 -0
- package/dist/index.js +1 -0
- package/dist/mapping/smart-defaults.d.ts +9 -25
- package/dist/mapping/smart-defaults.js +52 -125
- package/dist/orchestrator-runtime.d.ts +4 -4
- package/dist/orchestrator-runtime.js +27 -12
- package/dist/skills/skill-writer.d.ts +14 -0
- package/dist/skills/skill-writer.js +62 -0
- package/dist/skills/templates/commit.d.ts +2 -0
- package/dist/skills/templates/commit.js +45 -0
- package/dist/skills/templates/document.d.ts +7 -0
- package/dist/skills/templates/document.js +16 -0
- package/dist/skills/templates/gh-project.d.ts +2 -0
- package/dist/skills/templates/gh-project.js +88 -0
- package/dist/skills/templates/gh-symphony.d.ts +2 -0
- package/dist/skills/templates/gh-symphony.js +125 -0
- package/dist/skills/templates/index.d.ts +8 -0
- package/dist/skills/templates/index.js +28 -0
- package/dist/skills/templates/land.d.ts +2 -0
- package/dist/skills/templates/land.js +59 -0
- package/dist/skills/templates/pull.d.ts +2 -0
- package/dist/skills/templates/pull.js +41 -0
- package/dist/skills/templates/push.d.ts +2 -0
- package/dist/skills/templates/push.js +36 -0
- package/dist/skills/types.d.ts +23 -0
- package/dist/skills/types.js +1 -0
- package/dist/workflow/generate-reference-workflow.d.ts +9 -0
- package/dist/workflow/generate-reference-workflow.js +261 -0
- package/dist/workflow/generate-workflow-md.d.ts +12 -0
- package/dist/workflow/generate-workflow-md.js +134 -0
- package/package.json +5 -4
package/dist/ansi.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const ESC = "\u001B[";
|
|
2
|
+
export declare function bold(s: string): string;
|
|
3
|
+
export declare function dim(s: string): string;
|
|
4
|
+
export declare function green(s: string): string;
|
|
5
|
+
export declare function red(s: string): string;
|
|
6
|
+
export declare function yellow(s: string): string;
|
|
7
|
+
export declare function cyan(s: string): string;
|
|
8
|
+
export declare function magenta(s: string): string;
|
|
9
|
+
export declare function blue(s: string): string;
|
|
10
|
+
export declare function stripAnsi(s: string): string;
|
|
11
|
+
export declare function setNoColor(value: boolean): void;
|
|
12
|
+
export declare function getNoColor(): boolean;
|
|
13
|
+
export declare function clearScreen(): string;
|
|
14
|
+
export declare function hideCursor(): string;
|
|
15
|
+
export declare function showCursor(): string;
|
package/dist/ansi.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// ── ANSI color and formatting utilities ────────────────────────────────────
|
|
2
|
+
export const ESC = "\x1b[";
|
|
3
|
+
let noColor = false;
|
|
4
|
+
const _bold = (s) => `${ESC}1m${s}${ESC}0m`;
|
|
5
|
+
const _dim = (s) => `${ESC}2m${s}${ESC}0m`;
|
|
6
|
+
const _green = (s) => `${ESC}32m${s}${ESC}0m`;
|
|
7
|
+
const _red = (s) => `${ESC}31m${s}${ESC}0m`;
|
|
8
|
+
const _yellow = (s) => `${ESC}33m${s}${ESC}0m`;
|
|
9
|
+
const _cyan = (s) => `${ESC}36m${s}${ESC}0m`;
|
|
10
|
+
const _magenta = (s) => `${ESC}35m${s}${ESC}0m`;
|
|
11
|
+
const _blue = (s) => `${ESC}34m${s}${ESC}0m`;
|
|
12
|
+
export function bold(s) {
|
|
13
|
+
return noColor ? s : _bold(s);
|
|
14
|
+
}
|
|
15
|
+
export function dim(s) {
|
|
16
|
+
return noColor ? s : _dim(s);
|
|
17
|
+
}
|
|
18
|
+
export function green(s) {
|
|
19
|
+
return noColor ? s : _green(s);
|
|
20
|
+
}
|
|
21
|
+
export function red(s) {
|
|
22
|
+
return noColor ? s : _red(s);
|
|
23
|
+
}
|
|
24
|
+
export function yellow(s) {
|
|
25
|
+
return noColor ? s : _yellow(s);
|
|
26
|
+
}
|
|
27
|
+
export function cyan(s) {
|
|
28
|
+
return noColor ? s : _cyan(s);
|
|
29
|
+
}
|
|
30
|
+
export function magenta(s) {
|
|
31
|
+
return noColor ? s : _magenta(s);
|
|
32
|
+
}
|
|
33
|
+
export function blue(s) {
|
|
34
|
+
return noColor ? s : _blue(s);
|
|
35
|
+
}
|
|
36
|
+
export function stripAnsi(s) {
|
|
37
|
+
return s.replace(new RegExp(`${ESC}\\[[0-9;]*m`, "g"), "");
|
|
38
|
+
}
|
|
39
|
+
export function setNoColor(value) {
|
|
40
|
+
noColor = value;
|
|
41
|
+
}
|
|
42
|
+
export function getNoColor() {
|
|
43
|
+
return noColor;
|
|
44
|
+
}
|
|
45
|
+
export function clearScreen() {
|
|
46
|
+
return "\x1b[2J\x1b[H";
|
|
47
|
+
}
|
|
48
|
+
export function hideCursor() {
|
|
49
|
+
return "\x1b[?25l";
|
|
50
|
+
}
|
|
51
|
+
export function showCursor() {
|
|
52
|
+
return "\x1b[?25h";
|
|
53
|
+
}
|
|
@@ -26,29 +26,17 @@ async function configShow(options) {
|
|
|
26
26
|
process.exitCode = 1;
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
|
-
// Mask token for display
|
|
30
|
-
const display = {
|
|
31
|
-
...config,
|
|
32
|
-
token: config.token ? maskToken(config.token) : null,
|
|
33
|
-
};
|
|
34
29
|
if (options.json) {
|
|
35
|
-
process.stdout.write(JSON.stringify(
|
|
30
|
+
process.stdout.write(JSON.stringify(config, null, 2) + "\n");
|
|
36
31
|
return;
|
|
37
32
|
}
|
|
38
33
|
process.stdout.write(`Config: ${configFilePath(options.configDir)}\n\n`);
|
|
39
|
-
process.stdout.write(`Active
|
|
40
|
-
process.stdout.write(`
|
|
41
|
-
process.stdout.write(`Workspaces: ${config.workspaces.join(", ") || "none"}\n`);
|
|
42
|
-
}
|
|
43
|
-
function maskToken(token) {
|
|
44
|
-
if (token.length <= 8)
|
|
45
|
-
return "****";
|
|
46
|
-
return token.slice(0, 4) + "..." + token.slice(-4);
|
|
34
|
+
process.stdout.write(`Active tenant: ${config.activeTenant ?? "none"}\n`);
|
|
35
|
+
process.stdout.write(`Tenants: ${config.tenants.join(", ") || "none"}\n`);
|
|
47
36
|
}
|
|
48
37
|
// ── 7.2: config set ──────────────────────────────────────────────────────────
|
|
49
38
|
const VALID_KEYS = {
|
|
50
|
-
"active-
|
|
51
|
-
token: { type: "string" },
|
|
39
|
+
"active-tenant": { type: "string" },
|
|
52
40
|
};
|
|
53
41
|
async function configSet(args, options) {
|
|
54
42
|
const [key, value] = args;
|
|
@@ -66,25 +54,21 @@ async function configSet(args, options) {
|
|
|
66
54
|
}
|
|
67
55
|
const config = (await loadGlobalConfig(options.configDir)) ??
|
|
68
56
|
{
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
workspaces: [],
|
|
57
|
+
activeTenant: null,
|
|
58
|
+
tenants: [],
|
|
72
59
|
};
|
|
73
60
|
switch (key) {
|
|
74
|
-
case "active-
|
|
75
|
-
if (!config.
|
|
76
|
-
process.stderr.write(`
|
|
61
|
+
case "active-tenant":
|
|
62
|
+
if (!config.tenants.includes(value)) {
|
|
63
|
+
process.stderr.write(`Tenant "${value}" not found. Available: ${config.tenants.join(", ")}\n`);
|
|
77
64
|
process.exitCode = 1;
|
|
78
65
|
return;
|
|
79
66
|
}
|
|
80
|
-
config.
|
|
81
|
-
break;
|
|
82
|
-
case "token":
|
|
83
|
-
config.token = value;
|
|
67
|
+
config.activeTenant = value;
|
|
84
68
|
break;
|
|
85
69
|
}
|
|
86
70
|
await saveGlobalConfig(options.configDir, config);
|
|
87
|
-
process.stdout.write(`Set ${key} = ${
|
|
71
|
+
process.stdout.write(`Set ${key} = ${value}\n`);
|
|
88
72
|
}
|
|
89
73
|
// ── 7.3: config edit ─────────────────────────────────────────────────────────
|
|
90
74
|
async function configEdit(options) {
|
package/dist/commands/help.js
CHANGED
|
@@ -4,7 +4,7 @@ gh-symphony — AI Coding Agent Orchestrator
|
|
|
4
4
|
Usage: gh-symphony <command> [options]
|
|
5
5
|
|
|
6
6
|
Setup:
|
|
7
|
-
init Interactive
|
|
7
|
+
init Interactive tenant setup wizard
|
|
8
8
|
config show Show current configuration
|
|
9
9
|
config set Set a configuration value
|
|
10
10
|
config edit Open config in $EDITOR
|
|
@@ -18,10 +18,15 @@ Orchestration:
|
|
|
18
18
|
recover Recover stalled runs
|
|
19
19
|
logs View orchestrator logs
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
Tenant Management:
|
|
22
|
+
tenant add Add a new tenant (interactive wizard)
|
|
23
|
+
tenant list List all configured tenants
|
|
24
|
+
tenant remove Remove a tenant
|
|
25
|
+
|
|
26
|
+
Project / Repo:
|
|
27
|
+
project list List tenants
|
|
28
|
+
project switch Switch active tenant
|
|
29
|
+
project status Show active tenant details
|
|
25
30
|
repo list List configured repositories
|
|
26
31
|
repo add Add a repository
|
|
27
32
|
repo remove Remove a repository
|
|
@@ -35,7 +40,10 @@ Global Options:
|
|
|
35
40
|
--version, -V Show version
|
|
36
41
|
|
|
37
42
|
Examples:
|
|
38
|
-
gh-symphony
|
|
43
|
+
gh-symphony tenant add # Add a tenant (interactive)
|
|
44
|
+
gh-symphony tenant add --non-interactive --project <id>
|
|
45
|
+
gh-symphony tenant list # List all tenants
|
|
46
|
+
gh-symphony tenant remove <id> # Remove a tenant
|
|
39
47
|
gh-symphony start # Start orchestrator
|
|
40
48
|
gh-symphony start --daemon # Start in background
|
|
41
49
|
gh-symphony run org/repo#123 # Dispatch a specific issue
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
import type { GlobalOptions } from "../index.js";
|
|
2
|
-
import { type ProjectDetail, type LinkedRepository } from "../github/client.js";
|
|
3
|
-
import { type
|
|
2
|
+
import { type ProjectDetail, type ProjectStatusField, type LinkedRepository } from "../github/client.js";
|
|
3
|
+
import { type StateMapping } from "../config.js";
|
|
4
|
+
export declare function abortIfCancelled<T>(input: T | Promise<T>): Promise<Exclude<T, symbol>>;
|
|
4
5
|
declare const handler: (args: string[], options: GlobalOptions) => Promise<void>;
|
|
5
6
|
export default handler;
|
|
7
|
+
type EcosystemOptions = {
|
|
8
|
+
cwd: string;
|
|
9
|
+
projectDetail: ProjectDetail;
|
|
10
|
+
statusField: ProjectStatusField;
|
|
11
|
+
runtime: string;
|
|
12
|
+
skipSkills: boolean;
|
|
13
|
+
skipContext: boolean;
|
|
14
|
+
};
|
|
15
|
+
export type EcosystemResult = {
|
|
16
|
+
projectId: string;
|
|
17
|
+
projectTitle: string;
|
|
18
|
+
runtime: string;
|
|
19
|
+
skillsDir: string | null;
|
|
20
|
+
contextYamlWritten: boolean;
|
|
21
|
+
referenceWorkflowWritten: boolean;
|
|
22
|
+
skillsWritten: string[];
|
|
23
|
+
skillsSkipped: string[];
|
|
24
|
+
};
|
|
25
|
+
export declare function writeEcosystem(opts: EcosystemOptions): Promise<EcosystemResult>;
|
|
6
26
|
type WriteConfigInput = {
|
|
7
|
-
|
|
8
|
-
token: string;
|
|
27
|
+
tenantId: string;
|
|
9
28
|
project: ProjectDetail;
|
|
10
29
|
repos: LinkedRepository[];
|
|
11
30
|
statusField: {
|
|
31
|
+
id: string;
|
|
12
32
|
name: string;
|
|
13
33
|
options: Array<{
|
|
34
|
+
id: string;
|
|
14
35
|
name: string;
|
|
36
|
+
color?: string | null;
|
|
15
37
|
}>;
|
|
16
38
|
};
|
|
17
|
-
|
|
18
|
-
humanReviewMode: HumanReviewMode;
|
|
39
|
+
mappings: Record<string, StateMapping>;
|
|
19
40
|
runtime: string;
|
|
41
|
+
agentCommand?: string;
|
|
20
42
|
workerCommand?: string;
|
|
21
43
|
pollIntervalMs?: number;
|
|
22
44
|
concurrency?: number;
|
|
23
45
|
maxAttempts?: number;
|
|
24
46
|
};
|
|
25
47
|
export declare function writeConfig(configDir: string, input: WriteConfigInput): Promise<void>;
|
|
26
|
-
export declare function
|
|
48
|
+
export declare function generateTenantId(projectTitle: string, uniqueKey: string): string;
|