@gh-symphony/cli 0.0.1 → 0.0.2

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.
Files changed (59) hide show
  1. package/dist/ansi.d.ts +15 -0
  2. package/dist/ansi.js +53 -0
  3. package/dist/commands/config-cmd.js +11 -27
  4. package/dist/commands/help.js +14 -6
  5. package/dist/commands/init.d.ts +30 -7
  6. package/dist/commands/init.js +421 -284
  7. package/dist/commands/logs.js +4 -4
  8. package/dist/commands/project.js +34 -34
  9. package/dist/commands/recover.js +14 -14
  10. package/dist/commands/repo.js +13 -13
  11. package/dist/commands/run.js +16 -16
  12. package/dist/commands/start.js +61 -37
  13. package/dist/commands/status.js +60 -63
  14. package/dist/commands/tenant.d.ts +3 -0
  15. package/dist/commands/tenant.js +402 -0
  16. package/dist/config.d.ts +20 -19
  17. package/dist/config.js +17 -17
  18. package/dist/context/context-types.d.ts +36 -0
  19. package/dist/context/context-types.js +1 -0
  20. package/dist/context/generate-context-yaml.d.ts +15 -0
  21. package/dist/context/generate-context-yaml.js +129 -0
  22. package/dist/dashboard/renderer.d.ts +9 -0
  23. package/dist/dashboard/renderer.js +220 -0
  24. package/dist/detection/environment-detector.d.ts +11 -0
  25. package/dist/detection/environment-detector.js +140 -0
  26. package/dist/github/client.d.ts +11 -0
  27. package/dist/github/client.js +59 -11
  28. package/dist/github/gh-auth.d.ts +34 -0
  29. package/dist/github/gh-auth.js +110 -0
  30. package/dist/index.js +1 -0
  31. package/dist/mapping/smart-defaults.d.ts +9 -25
  32. package/dist/mapping/smart-defaults.js +52 -125
  33. package/dist/orchestrator-runtime.d.ts +4 -4
  34. package/dist/orchestrator-runtime.js +27 -12
  35. package/dist/skills/skill-writer.d.ts +14 -0
  36. package/dist/skills/skill-writer.js +62 -0
  37. package/dist/skills/templates/commit.d.ts +2 -0
  38. package/dist/skills/templates/commit.js +45 -0
  39. package/dist/skills/templates/document.d.ts +7 -0
  40. package/dist/skills/templates/document.js +16 -0
  41. package/dist/skills/templates/gh-project.d.ts +2 -0
  42. package/dist/skills/templates/gh-project.js +88 -0
  43. package/dist/skills/templates/gh-symphony.d.ts +2 -0
  44. package/dist/skills/templates/gh-symphony.js +125 -0
  45. package/dist/skills/templates/index.d.ts +8 -0
  46. package/dist/skills/templates/index.js +28 -0
  47. package/dist/skills/templates/land.d.ts +2 -0
  48. package/dist/skills/templates/land.js +59 -0
  49. package/dist/skills/templates/pull.d.ts +2 -0
  50. package/dist/skills/templates/pull.js +41 -0
  51. package/dist/skills/templates/push.d.ts +2 -0
  52. package/dist/skills/templates/push.js +36 -0
  53. package/dist/skills/types.d.ts +23 -0
  54. package/dist/skills/types.js +1 -0
  55. package/dist/workflow/generate-reference-workflow.d.ts +9 -0
  56. package/dist/workflow/generate-reference-workflow.js +261 -0
  57. package/dist/workflow/generate-workflow-md.d.ts +12 -0
  58. package/dist/workflow/generate-workflow-md.js +134 -0
  59. 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(display, null, 2) + "\n");
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 workspace: ${config.activeWorkspace ?? "none"}\n`);
40
- process.stdout.write(`Token: ${display.token ?? "not set"}\n`);
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-workspace": { type: "string" },
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
- activeWorkspace: null,
70
- token: null,
71
- workspaces: [],
57
+ activeTenant: null,
58
+ tenants: [],
72
59
  };
73
60
  switch (key) {
74
- case "active-workspace":
75
- if (!config.workspaces.includes(value)) {
76
- process.stderr.write(`Workspace "${value}" not found. Available: ${config.workspaces.join(", ")}\n`);
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.activeWorkspace = value;
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} = ${key === "token" ? maskToken(value) : value}\n`);
71
+ process.stdout.write(`Set ${key} = ${value}\n`);
88
72
  }
89
73
  // ── 7.3: config edit ─────────────────────────────────────────────────────────
90
74
  async function configEdit(options) {
@@ -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 workspace setup wizard
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
- Workspace Management:
22
- project list List all workspaces
23
- project switch Switch active workspace
24
- project status Show workspace details
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 init # Set up a new workspace
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
@@ -1,26 +1,49 @@
1
1
  import type { GlobalOptions } from "../index.js";
2
- import { type ProjectDetail, type LinkedRepository } from "../github/client.js";
3
- import { type ColumnRole, type HumanReviewMode } from "../config.js";
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 resolveTenantRuntime(configDir: string, tenantId: string, tenantWorkerCommand?: string): Promise<string>;
26
+ export declare function writeEcosystem(opts: EcosystemOptions): Promise<EcosystemResult>;
6
27
  type WriteConfigInput = {
7
- workspaceId: string;
8
- token: string;
28
+ tenantId: string;
9
29
  project: ProjectDetail;
10
30
  repos: LinkedRepository[];
11
31
  statusField: {
32
+ id: string;
12
33
  name: string;
13
34
  options: Array<{
35
+ id: string;
14
36
  name: string;
37
+ color?: string | null;
15
38
  }>;
16
39
  };
17
- roles: Record<string, ColumnRole>;
18
- humanReviewMode: HumanReviewMode;
40
+ mappings: Record<string, StateMapping>;
19
41
  runtime: string;
42
+ agentCommand?: string;
20
43
  workerCommand?: string;
21
44
  pollIntervalMs?: number;
22
45
  concurrency?: number;
23
46
  maxAttempts?: number;
24
47
  };
25
48
  export declare function writeConfig(configDir: string, input: WriteConfigInput): Promise<void>;
26
- export declare function generateWorkspaceId(projectTitle: string, uniqueKey: string): string;
49
+ export declare function generateTenantId(projectTitle: string, uniqueKey: string): string;