@gh-symphony/cli 0.0.13 → 0.0.15

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 (100) 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-IWR4UQEJ.js +2250 -0
  5. package/dist/chunk-JO3AXHQI.js +130 -0
  6. package/dist/chunk-M7OSMUTN.js +874 -0
  7. package/dist/chunk-MVRF7BES.js +68 -0
  8. package/dist/chunk-RNWX7DQU.js +4617 -0
  9. package/dist/chunk-ROGRTUFI.js +108 -0
  10. package/dist/chunk-TH5QPO3Y.js +67 -0
  11. package/dist/config-cmd-AZ7POMAA.js +110 -0
  12. package/dist/index.d.ts +5 -4
  13. package/dist/index.js +568 -356
  14. package/dist/init-EZXQAXZM.js +17 -0
  15. package/dist/logs-6LNGT2GF.js +188 -0
  16. package/dist/project-3ELXQ35D.js +678 -0
  17. package/dist/recover-T6ME6C56.js +130 -0
  18. package/dist/repo-R3XBIVAX.js +121 -0
  19. package/dist/run-DYINRZHK.js +107 -0
  20. package/dist/start-PIFQMIC2.js +15 -0
  21. package/dist/status-3WK5BWRZ.js +11 -0
  22. package/dist/stop-AA3AP5M6.js +9 -0
  23. package/dist/version-VBB62JWI.js +30 -0
  24. package/package.json +11 -6
  25. package/dist/ansi.d.ts +0 -15
  26. package/dist/ansi.js +0 -53
  27. package/dist/commands/config-cmd.d.ts +0 -3
  28. package/dist/commands/config-cmd.js +0 -90
  29. package/dist/commands/help.d.ts +0 -3
  30. package/dist/commands/help.js +0 -55
  31. package/dist/commands/init.d.ts +0 -34
  32. package/dist/commands/init.js +0 -477
  33. package/dist/commands/logs.d.ts +0 -3
  34. package/dist/commands/logs.js +0 -184
  35. package/dist/commands/project.d.ts +0 -3
  36. package/dist/commands/project.js +0 -649
  37. package/dist/commands/recover.d.ts +0 -3
  38. package/dist/commands/recover.js +0 -119
  39. package/dist/commands/repo.d.ts +0 -3
  40. package/dist/commands/repo.js +0 -103
  41. package/dist/commands/run.d.ts +0 -3
  42. package/dist/commands/run.js +0 -95
  43. package/dist/commands/start.d.ts +0 -20
  44. package/dist/commands/start.js +0 -344
  45. package/dist/commands/status-refresh.d.ts +0 -9
  46. package/dist/commands/status-refresh.js +0 -27
  47. package/dist/commands/status.d.ts +0 -3
  48. package/dist/commands/status.js +0 -237
  49. package/dist/commands/stop.d.ts +0 -3
  50. package/dist/commands/stop.js +0 -92
  51. package/dist/commands/version.d.ts +0 -3
  52. package/dist/commands/version.js +0 -21
  53. package/dist/completion.d.ts +0 -1
  54. package/dist/completion.js +0 -204
  55. package/dist/config.d.ts +0 -38
  56. package/dist/config.js +0 -82
  57. package/dist/context/context-types.d.ts +0 -36
  58. package/dist/context/context-types.js +0 -1
  59. package/dist/context/generate-context-yaml.d.ts +0 -15
  60. package/dist/context/generate-context-yaml.js +0 -129
  61. package/dist/dashboard/renderer.d.ts +0 -9
  62. package/dist/dashboard/renderer.js +0 -220
  63. package/dist/detection/environment-detector.d.ts +0 -11
  64. package/dist/detection/environment-detector.js +0 -140
  65. package/dist/github/client.d.ts +0 -71
  66. package/dist/github/client.js +0 -348
  67. package/dist/github/gh-auth.d.ts +0 -34
  68. package/dist/github/gh-auth.js +0 -110
  69. package/dist/mapping/smart-defaults.d.ts +0 -17
  70. package/dist/mapping/smart-defaults.js +0 -86
  71. package/dist/orchestrator-runtime.d.ts +0 -1
  72. package/dist/orchestrator-runtime.js +0 -4
  73. package/dist/orchestrator-status-endpoint.d.ts +0 -5
  74. package/dist/orchestrator-status-endpoint.js +0 -27
  75. package/dist/project-selection.d.ts +0 -8
  76. package/dist/project-selection.js +0 -56
  77. package/dist/skills/skill-writer.d.ts +0 -14
  78. package/dist/skills/skill-writer.js +0 -62
  79. package/dist/skills/templates/commit.d.ts +0 -2
  80. package/dist/skills/templates/commit.js +0 -45
  81. package/dist/skills/templates/document.d.ts +0 -7
  82. package/dist/skills/templates/document.js +0 -16
  83. package/dist/skills/templates/gh-project.d.ts +0 -2
  84. package/dist/skills/templates/gh-project.js +0 -88
  85. package/dist/skills/templates/gh-symphony.d.ts +0 -2
  86. package/dist/skills/templates/gh-symphony.js +0 -125
  87. package/dist/skills/templates/index.d.ts +0 -8
  88. package/dist/skills/templates/index.js +0 -28
  89. package/dist/skills/templates/land.d.ts +0 -2
  90. package/dist/skills/templates/land.js +0 -59
  91. package/dist/skills/templates/pull.d.ts +0 -2
  92. package/dist/skills/templates/pull.js +0 -41
  93. package/dist/skills/templates/push.d.ts +0 -2
  94. package/dist/skills/templates/push.js +0 -36
  95. package/dist/skills/types.d.ts +0 -23
  96. package/dist/skills/types.js +0 -1
  97. package/dist/workflow/generate-reference-workflow.d.ts +0 -9
  98. package/dist/workflow/generate-reference-workflow.js +0 -261
  99. package/dist/workflow/generate-workflow-md.d.ts +0 -12
  100. package/dist/workflow/generate-workflow-md.js +0 -134
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ abortIfCancelled,
4
+ generateProjectId,
5
+ init_default,
6
+ writeConfig,
7
+ writeEcosystem
8
+ } from "./chunk-IWR4UQEJ.js";
9
+ import "./chunk-JO3AXHQI.js";
10
+ import "./chunk-ROGRTUFI.js";
11
+ export {
12
+ abortIfCancelled,
13
+ init_default as default,
14
+ generateProjectId,
15
+ writeConfig,
16
+ writeEcosystem
17
+ };
@@ -0,0 +1,188 @@
1
+ #!/usr/bin/env node
2
+ import {
3
+ handleMissingManagedProjectConfig,
4
+ resolveManagedProjectConfig
5
+ } from "./chunk-TH5QPO3Y.js";
6
+ import {
7
+ orchestratorLogPath
8
+ } from "./chunk-ROGRTUFI.js";
9
+
10
+ // src/commands/logs.ts
11
+ import { readFile, readdir, stat } from "fs/promises";
12
+ import { join, resolve } from "path";
13
+ import { createReadStream } from "fs";
14
+ import { createInterface } from "readline";
15
+ function parseLogsArgs(args) {
16
+ const parsed = { follow: false };
17
+ for (let i = 0; i < args.length; i += 1) {
18
+ const arg = args[i];
19
+ if (arg === "--follow" || arg === "-f") {
20
+ parsed.follow = true;
21
+ }
22
+ if (arg === "--issue") {
23
+ parsed.issue = args[i + 1];
24
+ i += 1;
25
+ }
26
+ if (arg === "--run") {
27
+ parsed.run = args[i + 1];
28
+ i += 1;
29
+ }
30
+ if (arg === "--level") {
31
+ parsed.level = args[i + 1];
32
+ i += 1;
33
+ }
34
+ if (arg === "--project" || arg === "--project-id") {
35
+ parsed.projectId = args[i + 1];
36
+ i += 1;
37
+ }
38
+ }
39
+ return parsed;
40
+ }
41
+ var handler = async (args, options) => {
42
+ const parsed = parseLogsArgs(args);
43
+ const runtimeRoot = resolve(options.configDir);
44
+ if (parsed.run) {
45
+ const eventsPath = parsed.projectId ? join(
46
+ runtimeRoot,
47
+ "projects",
48
+ parsed.projectId,
49
+ "runs",
50
+ parsed.run,
51
+ "events.ndjson"
52
+ ) : await resolveRunEventsPath(runtimeRoot, parsed.run);
53
+ if (!eventsPath) {
54
+ process.stderr.write(`No events found for run: ${parsed.run}
55
+ `);
56
+ process.exitCode = 1;
57
+ return;
58
+ }
59
+ try {
60
+ const content = await readFile(eventsPath, "utf8");
61
+ const lines = content.trim().split("\n").filter(Boolean);
62
+ for (const line of lines) {
63
+ const event = JSON.parse(line);
64
+ if (parsed.projectId && event.projectId !== parsed.projectId) continue;
65
+ if (parsed.level && event.level !== parsed.level) continue;
66
+ if (parsed.issue && event.issueIdentifier !== parsed.issue) continue;
67
+ process.stdout.write(formatEvent(event) + "\n");
68
+ }
69
+ } catch {
70
+ process.stderr.write(`No events found for run: ${parsed.run}
71
+ `);
72
+ process.exitCode = 1;
73
+ }
74
+ return;
75
+ }
76
+ if (parsed.follow) {
77
+ const projectConfig = await resolveManagedProjectConfig({
78
+ configDir: options.configDir,
79
+ requestedProjectId: parsed.projectId
80
+ });
81
+ if (!projectConfig) {
82
+ handleMissingManagedProjectConfig();
83
+ return;
84
+ }
85
+ const logPath = orchestratorLogPath(
86
+ options.configDir,
87
+ projectConfig.projectId
88
+ );
89
+ try {
90
+ const stream = createReadStream(logPath, { encoding: "utf8" });
91
+ const rl = createInterface({ input: stream });
92
+ for await (const line of rl) {
93
+ process.stdout.write(line + "\n");
94
+ }
95
+ const { watchFile } = await import("fs");
96
+ let lastSize = 0;
97
+ watchFile(logPath, { interval: 1e3 }, async (curr) => {
98
+ if (curr.size > lastSize) {
99
+ const fd = await import("fs/promises");
100
+ const handle = await fd.open(logPath, "r");
101
+ const buf = Buffer.alloc(curr.size - lastSize);
102
+ await handle.read(buf, 0, buf.length, lastSize);
103
+ await handle.close();
104
+ process.stdout.write(buf.toString("utf8"));
105
+ lastSize = curr.size;
106
+ }
107
+ });
108
+ await new Promise(() => {
109
+ });
110
+ } catch {
111
+ process.stderr.write(
112
+ "No log file found. Start the orchestrator first.\n"
113
+ );
114
+ process.exitCode = 1;
115
+ }
116
+ return;
117
+ }
118
+ const runRoots = parsed.projectId ? [join(runtimeRoot, "projects", parsed.projectId, "runs")] : await listProjectRunRoots(runtimeRoot);
119
+ let foundRuns = false;
120
+ try {
121
+ for (const runsDir of runRoots) {
122
+ const entries = await safeReadDir(runsDir);
123
+ if (entries.length === 0) {
124
+ continue;
125
+ }
126
+ foundRuns = true;
127
+ for (const entry of entries) {
128
+ const eventsPath = join(runsDir, entry, "events.ndjson");
129
+ try {
130
+ const content = await readFile(eventsPath, "utf8");
131
+ const lines = content.trim().split("\n").filter(Boolean);
132
+ for (const line of lines) {
133
+ const event = JSON.parse(line);
134
+ if (parsed.projectId && event.projectId !== parsed.projectId)
135
+ continue;
136
+ if (parsed.level && event.level !== parsed.level) continue;
137
+ if (parsed.issue && event.issueIdentifier !== parsed.issue) continue;
138
+ process.stdout.write(formatEvent(event) + "\n");
139
+ }
140
+ } catch {
141
+ }
142
+ }
143
+ }
144
+ } catch {
145
+ }
146
+ if (!foundRuns) {
147
+ process.stderr.write("No runs found. Start the orchestrator first.\n");
148
+ }
149
+ };
150
+ var logs_default = handler;
151
+ function formatEvent(event) {
152
+ const at = event.at ?? "";
153
+ const eventType = event.event ?? "unknown";
154
+ const issue = event.issueIdentifier ?? "";
155
+ const extra = event.error ? ` error=${event.error}` : "";
156
+ return `[${at}] ${eventType} ${issue}${extra}`;
157
+ }
158
+ async function listProjectRunRoots(runtimeRoot) {
159
+ try {
160
+ const projectIds = await readdir(join(runtimeRoot, "projects"));
161
+ return projectIds.map(
162
+ (projectId) => join(runtimeRoot, "projects", projectId, "runs")
163
+ );
164
+ } catch {
165
+ return [];
166
+ }
167
+ }
168
+ async function resolveRunEventsPath(runtimeRoot, runId) {
169
+ for (const runsDir of await listProjectRunRoots(runtimeRoot)) {
170
+ const eventsPath = join(runsDir, runId, "events.ndjson");
171
+ try {
172
+ await stat(eventsPath);
173
+ return eventsPath;
174
+ } catch {
175
+ }
176
+ }
177
+ return null;
178
+ }
179
+ async function safeReadDir(path) {
180
+ try {
181
+ return await readdir(path);
182
+ } catch {
183
+ return [];
184
+ }
185
+ }
186
+ export {
187
+ logs_default as default
188
+ };