@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.
@@ -1,41 +1,26 @@
1
- import { copyFile, mkdir, writeFile } from "node:fs/promises";
1
+ import { mkdir, writeFile } from "node:fs/promises";
2
2
  import { dirname, join, resolve } from "node:path";
3
- import { loadGlobalConfig, loadTenantConfig, } from "./config.js";
3
+ import { loadGlobalConfig, loadProjectConfig, } from "./config.js";
4
4
  export function resolveRuntimeRoot(configDir) {
5
5
  return resolve(configDir);
6
6
  }
7
- export async function resolveTenantConfig(configDir, requestedTenantId) {
8
- if (requestedTenantId) {
9
- return loadTenantConfig(configDir, requestedTenantId);
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?.activeTenant) {
12
+ if (!global?.activeProject) {
13
13
  return null;
14
14
  }
15
- return loadTenantConfig(configDir, global.activeTenant);
15
+ return loadProjectConfig(configDir, global.activeProject);
16
16
  }
17
- export function orchestratorTenantConfigPath(runtimeRoot, tenantId) {
18
- return join(runtimeRoot, "orchestrator", "tenants", tenantId, "config.json");
17
+ export function orchestratorProjectConfigPath(runtimeRoot, projectId) {
18
+ return join(runtimeRoot, "orchestrator", "projects", projectId, "config.json");
19
19
  }
20
- export async function syncTenantToRuntime(configDir, tenantConfig) {
20
+ export async function syncProjectToRuntime(configDir, projectConfig) {
21
21
  const runtimeRoot = resolveRuntimeRoot(configDir);
22
- const configPath = orchestratorTenantConfigPath(runtimeRoot, tenantConfig.tenantId);
22
+ const configPath = orchestratorProjectConfigPath(runtimeRoot, projectConfig.projectId);
23
23
  await mkdir(dirname(configPath), { recursive: true });
24
- await writeFile(configPath, JSON.stringify(tenantConfig, null, 2) + "\n");
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,5 @@
1
+ export declare function resolveProjectOrchestratorStatusBaseUrl(input: {
2
+ configDir: string;
3
+ projectId: string;
4
+ env?: NodeJS.ProcessEnv;
5
+ }): Promise<string | null>;
@@ -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
+ }
@@ -2,7 +2,7 @@ export type SkillRuntime = "claude-code" | "codex";
2
2
  export type SkillTemplateContext = {
3
3
  runtime: SkillRuntime | string;
4
4
  projectId: string;
5
- projectTitle: string;
5
+ githubProjectTitle: string;
6
6
  repositories: Array<{
7
7
  owner: string;
8
8
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gh-symphony/cli",
3
- "version": "0.0.5",
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/core": "0.0.5",
40
- "@gh-symphony/orchestrator": "0.0.5",
41
- "@gh-symphony/tracker-github": "0.0.5",
42
- "@gh-symphony/worker": "0.0.5"
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",