@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.
Files changed (102) hide show
  1. package/dist/chunk-5NV3LSAJ.js +11 -0
  2. package/dist/chunk-6HBZC3BE.js +468 -0
  3. package/dist/chunk-76QPITKI.js +109 -0
  4. package/dist/chunk-EFMFGOWM.js +3575 -0
  5. package/dist/chunk-IWR4UQEJ.js +2250 -0
  6. package/dist/chunk-JO3AXHQI.js +130 -0
  7. package/dist/chunk-MHIWAIVD.js +876 -0
  8. package/dist/chunk-MVRF7BES.js +68 -0
  9. package/dist/chunk-ROGRTUFI.js +108 -0
  10. package/dist/chunk-TF3QNWNC.js +1121 -0
  11. package/dist/chunk-TH5QPO3Y.js +67 -0
  12. package/dist/config-cmd-AZ7POMAA.js +110 -0
  13. package/dist/index.d.ts +5 -4
  14. package/dist/index.js +568 -356
  15. package/dist/init-EZXQAXZM.js +17 -0
  16. package/dist/logs-6LNGT2GF.js +188 -0
  17. package/dist/project-557FE2GD.js +679 -0
  18. package/dist/recover-LVBI2TGH.js +131 -0
  19. package/dist/repo-R3XBIVAX.js +121 -0
  20. package/dist/run-WITYAYFZ.js +108 -0
  21. package/dist/start-JUFKNL3N.js +16 -0
  22. package/dist/status-3WK5BWRZ.js +11 -0
  23. package/dist/stop-AA3AP5M6.js +9 -0
  24. package/dist/version-VBB62JWI.js +30 -0
  25. package/dist/worker-entry.js +1828 -0
  26. package/package.json +9 -4
  27. package/dist/ansi.d.ts +0 -15
  28. package/dist/ansi.js +0 -53
  29. package/dist/commands/config-cmd.d.ts +0 -3
  30. package/dist/commands/config-cmd.js +0 -90
  31. package/dist/commands/help.d.ts +0 -3
  32. package/dist/commands/help.js +0 -55
  33. package/dist/commands/init.d.ts +0 -34
  34. package/dist/commands/init.js +0 -477
  35. package/dist/commands/logs.d.ts +0 -3
  36. package/dist/commands/logs.js +0 -184
  37. package/dist/commands/project.d.ts +0 -3
  38. package/dist/commands/project.js +0 -649
  39. package/dist/commands/recover.d.ts +0 -3
  40. package/dist/commands/recover.js +0 -119
  41. package/dist/commands/repo.d.ts +0 -3
  42. package/dist/commands/repo.js +0 -103
  43. package/dist/commands/run.d.ts +0 -3
  44. package/dist/commands/run.js +0 -95
  45. package/dist/commands/start.d.ts +0 -20
  46. package/dist/commands/start.js +0 -344
  47. package/dist/commands/status-refresh.d.ts +0 -9
  48. package/dist/commands/status-refresh.js +0 -27
  49. package/dist/commands/status.d.ts +0 -3
  50. package/dist/commands/status.js +0 -237
  51. package/dist/commands/stop.d.ts +0 -3
  52. package/dist/commands/stop.js +0 -92
  53. package/dist/commands/version.d.ts +0 -3
  54. package/dist/commands/version.js +0 -21
  55. package/dist/completion.d.ts +0 -1
  56. package/dist/completion.js +0 -204
  57. package/dist/config.d.ts +0 -38
  58. package/dist/config.js +0 -82
  59. package/dist/context/context-types.d.ts +0 -36
  60. package/dist/context/context-types.js +0 -1
  61. package/dist/context/generate-context-yaml.d.ts +0 -15
  62. package/dist/context/generate-context-yaml.js +0 -129
  63. package/dist/dashboard/renderer.d.ts +0 -9
  64. package/dist/dashboard/renderer.js +0 -220
  65. package/dist/detection/environment-detector.d.ts +0 -11
  66. package/dist/detection/environment-detector.js +0 -140
  67. package/dist/github/client.d.ts +0 -71
  68. package/dist/github/client.js +0 -348
  69. package/dist/github/gh-auth.d.ts +0 -34
  70. package/dist/github/gh-auth.js +0 -110
  71. package/dist/mapping/smart-defaults.d.ts +0 -17
  72. package/dist/mapping/smart-defaults.js +0 -86
  73. package/dist/orchestrator-runtime.d.ts +0 -1
  74. package/dist/orchestrator-runtime.js +0 -4
  75. package/dist/orchestrator-status-endpoint.d.ts +0 -5
  76. package/dist/orchestrator-status-endpoint.js +0 -27
  77. package/dist/project-selection.d.ts +0 -8
  78. package/dist/project-selection.js +0 -56
  79. package/dist/skills/skill-writer.d.ts +0 -14
  80. package/dist/skills/skill-writer.js +0 -62
  81. package/dist/skills/templates/commit.d.ts +0 -2
  82. package/dist/skills/templates/commit.js +0 -45
  83. package/dist/skills/templates/document.d.ts +0 -7
  84. package/dist/skills/templates/document.js +0 -16
  85. package/dist/skills/templates/gh-project.d.ts +0 -2
  86. package/dist/skills/templates/gh-project.js +0 -88
  87. package/dist/skills/templates/gh-symphony.d.ts +0 -2
  88. package/dist/skills/templates/gh-symphony.js +0 -125
  89. package/dist/skills/templates/index.d.ts +0 -8
  90. package/dist/skills/templates/index.js +0 -28
  91. package/dist/skills/templates/land.d.ts +0 -2
  92. package/dist/skills/templates/land.js +0 -59
  93. package/dist/skills/templates/pull.d.ts +0 -2
  94. package/dist/skills/templates/pull.js +0 -41
  95. package/dist/skills/templates/push.d.ts +0 -2
  96. package/dist/skills/templates/push.js +0 -36
  97. package/dist/skills/types.d.ts +0 -23
  98. package/dist/skills/types.js +0 -1
  99. package/dist/workflow/generate-reference-workflow.d.ts +0 -9
  100. package/dist/workflow/generate-reference-workflow.js +0 -261
  101. package/dist/workflow/generate-workflow-md.d.ts +0 -12
  102. package/dist/workflow/generate-workflow-md.js +0 -134
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/ansi.ts
4
+ var ESC = "\x1B[";
5
+ var noColor = false;
6
+ var _bold = (s) => `${ESC}1m${s}${ESC}0m`;
7
+ var _dim = (s) => `${ESC}2m${s}${ESC}0m`;
8
+ var _green = (s) => `${ESC}32m${s}${ESC}0m`;
9
+ var _red = (s) => `${ESC}31m${s}${ESC}0m`;
10
+ var _yellow = (s) => `${ESC}33m${s}${ESC}0m`;
11
+ var _cyan = (s) => `${ESC}36m${s}${ESC}0m`;
12
+ var _magenta = (s) => `${ESC}35m${s}${ESC}0m`;
13
+ var _blue = (s) => `${ESC}34m${s}${ESC}0m`;
14
+ function bold(s) {
15
+ return noColor ? s : _bold(s);
16
+ }
17
+ function dim(s) {
18
+ return noColor ? s : _dim(s);
19
+ }
20
+ function green(s) {
21
+ return noColor ? s : _green(s);
22
+ }
23
+ function red(s) {
24
+ return noColor ? s : _red(s);
25
+ }
26
+ function yellow(s) {
27
+ return noColor ? s : _yellow(s);
28
+ }
29
+ function cyan(s) {
30
+ return noColor ? s : _cyan(s);
31
+ }
32
+ function magenta(s) {
33
+ return noColor ? s : _magenta(s);
34
+ }
35
+ function blue(s) {
36
+ return noColor ? s : _blue(s);
37
+ }
38
+ function stripAnsi(s) {
39
+ return s.replace(new RegExp(`${ESC}\\[[0-9;]*m`, "g"), "");
40
+ }
41
+ function setNoColor(value) {
42
+ noColor = value;
43
+ }
44
+ function clearScreen() {
45
+ return "\x1B[2J\x1B[H";
46
+ }
47
+ function hideCursor() {
48
+ return "\x1B[?25l";
49
+ }
50
+ function showCursor() {
51
+ return "\x1B[?25h";
52
+ }
53
+
54
+ export {
55
+ bold,
56
+ dim,
57
+ green,
58
+ red,
59
+ yellow,
60
+ cyan,
61
+ magenta,
62
+ blue,
63
+ stripAnsi,
64
+ setNoColor,
65
+ clearScreen,
66
+ hideCursor,
67
+ showCursor
68
+ };
@@ -0,0 +1,108 @@
1
+ #!/usr/bin/env node
2
+
3
+ // src/config.ts
4
+ import { readFile, writeFile, mkdir } from "fs/promises";
5
+ import { dirname, join } from "path";
6
+ import { homedir } from "os";
7
+ var DEFAULT_CONFIG_DIR = join(homedir(), ".gh-symphony");
8
+ var CONFIG_FILE = "config.json";
9
+ var DAEMON_PID_FILE = "daemon.pid";
10
+ var ORCHESTRATOR_LOG_FILE = "orchestrator.log";
11
+ var HTTP_STATUS_FILE = "http.json";
12
+ function resolveConfigDir(override) {
13
+ return override ?? process.env.GH_SYMPHONY_CONFIG_DIR ?? DEFAULT_CONFIG_DIR;
14
+ }
15
+ function configFilePath(configDir) {
16
+ return join(configDir, CONFIG_FILE);
17
+ }
18
+ function projectConfigDir(configDir, projectId) {
19
+ return join(configDir, "projects", projectId);
20
+ }
21
+ function projectConfigPath(configDir, projectId) {
22
+ return join(projectConfigDir(configDir, projectId), "project.json");
23
+ }
24
+ function daemonPidPath(configDir, projectId) {
25
+ return join(projectConfigDir(configDir, projectId), DAEMON_PID_FILE);
26
+ }
27
+ function orchestratorLogPath(configDir, projectId) {
28
+ return join(projectConfigDir(configDir, projectId), ORCHESTRATOR_LOG_FILE);
29
+ }
30
+ function orchestratorWorkspaceRuntimeDir(configDir, projectId) {
31
+ return join(configDir, "orchestrator", "workspaces", projectId);
32
+ }
33
+ function httpStatusPath(configDir, projectId) {
34
+ return join(
35
+ orchestratorWorkspaceRuntimeDir(configDir, projectId),
36
+ HTTP_STATUS_FILE
37
+ );
38
+ }
39
+ async function loadGlobalConfig(configDir) {
40
+ const raw = await readJsonFile(
41
+ configFilePath(configDir)
42
+ );
43
+ if (!raw) {
44
+ return null;
45
+ }
46
+ return {
47
+ activeProject: typeof raw.activeProject === "string" ? raw.activeProject : null,
48
+ projects: Array.isArray(raw.projects) ? raw.projects.filter(
49
+ (projectId) => typeof projectId === "string"
50
+ ) : []
51
+ };
52
+ }
53
+ async function saveGlobalConfig(configDir, config) {
54
+ await writeJsonFile(configFilePath(configDir), config);
55
+ }
56
+ async function loadProjectConfig(configDir, projectId) {
57
+ return readJsonFile(
58
+ projectConfigPath(configDir, projectId)
59
+ );
60
+ }
61
+ async function saveProjectConfig(configDir, projectId, config) {
62
+ await writeJsonFile(projectConfigPath(configDir, projectId), config);
63
+ }
64
+ async function loadActiveProjectConfig(configDir) {
65
+ const global = await loadGlobalConfig(configDir);
66
+ if (!global?.activeProject) {
67
+ return null;
68
+ }
69
+ return loadProjectConfig(configDir, global.activeProject);
70
+ }
71
+ async function readJsonFile(path) {
72
+ try {
73
+ const raw = await readFile(path, "utf8");
74
+ return JSON.parse(raw);
75
+ } catch (error) {
76
+ if (isFileMissing(error)) {
77
+ return null;
78
+ }
79
+ throw error;
80
+ }
81
+ }
82
+ async function writeJsonFile(path, value) {
83
+ await mkdir(dirname(path), { recursive: true });
84
+ const temporaryPath = `${path}.tmp`;
85
+ await writeFile(temporaryPath, JSON.stringify(value, null, 2) + "\n", "utf8");
86
+ const { rename } = await import("fs/promises");
87
+ await rename(temporaryPath, path);
88
+ }
89
+ function isFileMissing(error) {
90
+ return Boolean(
91
+ error && typeof error === "object" && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR")
92
+ );
93
+ }
94
+
95
+ export {
96
+ resolveConfigDir,
97
+ configFilePath,
98
+ projectConfigDir,
99
+ daemonPidPath,
100
+ orchestratorLogPath,
101
+ httpStatusPath,
102
+ loadGlobalConfig,
103
+ saveGlobalConfig,
104
+ loadProjectConfig,
105
+ saveProjectConfig,
106
+ loadActiveProjectConfig,
107
+ writeJsonFile
108
+ };