@gh-symphony/cli 0.0.5 → 0.0.7
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/README.md +13 -13
- package/dist/commands/config-cmd.js +9 -9
- package/dist/commands/help.js +12 -12
- package/dist/commands/init.d.ts +4 -19
- package/dist/commands/init.js +28 -65
- package/dist/commands/logs.js +11 -5
- package/dist/commands/parse-cli-args.d.ts +6 -0
- package/dist/commands/parse-cli-args.js +20 -0
- package/dist/commands/project.js +592 -62
- package/dist/commands/recover.js +13 -13
- package/dist/commands/repo.js +13 -13
- package/dist/commands/run.js +15 -15
- package/dist/commands/start.d.ts +11 -0
- package/dist/commands/start.js +162 -129
- package/dist/commands/status-refresh.d.ts +1 -0
- package/dist/commands/status-refresh.js +7 -1
- package/dist/commands/status.js +41 -48
- package/dist/commands/stop.js +37 -7
- package/dist/commands/tenant.js +18 -83
- package/dist/config.d.ts +18 -25
- package/dist/config.js +29 -28
- package/dist/dashboard/renderer.d.ts +2 -2
- package/dist/dashboard/renderer.js +5 -5
- package/dist/index.js +0 -1
- package/dist/orchestrator-runtime.d.ts +4 -4
- package/dist/orchestrator-runtime.js +12 -27
- package/dist/orchestrator-status-endpoint.d.ts +5 -0
- package/dist/orchestrator-status-endpoint.js +27 -0
- package/dist/skills/types.d.ts +1 -1
- package/package.json +5 -5
|
@@ -1,41 +1,26 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { loadGlobalConfig,
|
|
3
|
+
import { loadGlobalConfig, loadProjectConfig, } from "./config.js";
|
|
4
4
|
export function resolveRuntimeRoot(configDir) {
|
|
5
5
|
return resolve(configDir);
|
|
6
6
|
}
|
|
7
|
-
export async function
|
|
8
|
-
if (
|
|
9
|
-
return
|
|
7
|
+
export async function resolveProjectConfig(configDir, requestedProjectId) {
|
|
8
|
+
if (requestedProjectId) {
|
|
9
|
+
return loadProjectConfig(configDir, requestedProjectId);
|
|
10
10
|
}
|
|
11
11
|
const global = await loadGlobalConfig(configDir);
|
|
12
|
-
if (!global?.
|
|
12
|
+
if (!global?.activeProject) {
|
|
13
13
|
return null;
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return loadProjectConfig(configDir, global.activeProject);
|
|
16
16
|
}
|
|
17
|
-
export function
|
|
18
|
-
return join(runtimeRoot, "orchestrator", "
|
|
17
|
+
export function orchestratorProjectConfigPath(runtimeRoot, projectId) {
|
|
18
|
+
return join(runtimeRoot, "orchestrator", "projects", projectId, "config.json");
|
|
19
19
|
}
|
|
20
|
-
export async function
|
|
20
|
+
export async function syncProjectToRuntime(configDir, projectConfig) {
|
|
21
21
|
const runtimeRoot = resolveRuntimeRoot(configDir);
|
|
22
|
-
const configPath =
|
|
22
|
+
const configPath = orchestratorProjectConfigPath(runtimeRoot, projectConfig.projectId);
|
|
23
23
|
await mkdir(dirname(configPath), { recursive: true });
|
|
24
|
-
await writeFile(configPath, JSON.stringify(
|
|
25
|
-
// Copy tenant WORKFLOW.md to runtime if it exists
|
|
26
|
-
const workflowSrc = join(configDir, "tenants", tenantConfig.tenantId, "WORKFLOW.md");
|
|
27
|
-
const workflowDst = join(dirname(configPath), "WORKFLOW.md");
|
|
28
|
-
try {
|
|
29
|
-
await copyFile(workflowSrc, workflowDst);
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
// ENOENT is expected for tenants created before WORKFLOW.md scaffolding
|
|
33
|
-
if (!(error &&
|
|
34
|
-
typeof error === "object" &&
|
|
35
|
-
"code" in error &&
|
|
36
|
-
error.code === "ENOENT")) {
|
|
37
|
-
throw error;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
24
|
+
await writeFile(configPath, JSON.stringify(projectConfig, null, 2) + "\n");
|
|
40
25
|
return runtimeRoot;
|
|
41
26
|
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { orchestratorPortPath } from "./config.js";
|
|
3
|
+
export async function resolveProjectOrchestratorStatusBaseUrl(input) {
|
|
4
|
+
const env = input.env ?? process.env;
|
|
5
|
+
const explicitBaseUrl = env.ORCHESTRATOR_STATUS_BASE_URL;
|
|
6
|
+
if (explicitBaseUrl) {
|
|
7
|
+
return explicitBaseUrl;
|
|
8
|
+
}
|
|
9
|
+
const host = env.ORCHESTRATOR_STATUS_HOST ?? "127.0.0.1";
|
|
10
|
+
const port = env.ORCHESTRATOR_STATUS_PORT ??
|
|
11
|
+
(await readProjectStatusPort(input.configDir, input.projectId));
|
|
12
|
+
if (!port) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
const urlHost = host.includes(":") && !host.startsWith("[") ? `[${host}]` : host;
|
|
16
|
+
return `http://${urlHost}:${port}`;
|
|
17
|
+
}
|
|
18
|
+
async function readProjectStatusPort(configDir, projectId) {
|
|
19
|
+
try {
|
|
20
|
+
const raw = await readFile(orchestratorPortPath(configDir, projectId), "utf8");
|
|
21
|
+
const port = raw.trim();
|
|
22
|
+
return port.length > 0 ? port : null;
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
}
|
package/dist/skills/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gh-symphony/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "hojinzs",
|
|
6
6
|
"description": "Interactive CLI for GitHub Symphony orchestration",
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@clack/prompts": "^0.9.1",
|
|
39
|
-
"@gh-symphony/
|
|
40
|
-
"@gh-symphony/
|
|
41
|
-
"@gh-symphony/tracker-github": "0.0.
|
|
42
|
-
"@gh-symphony/worker": "0.0.
|
|
39
|
+
"@gh-symphony/orchestrator": "0.0.7",
|
|
40
|
+
"@gh-symphony/core": "0.0.7",
|
|
41
|
+
"@gh-symphony/tracker-github": "0.0.7",
|
|
42
|
+
"@gh-symphony/worker": "0.0.7"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc -p tsconfig.json",
|