codowave 0.1.6 → 0.1.8
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/dist/index.d.ts +2 -1
- package/dist/index.js +12 -31
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/cli.js +0 -2
package/dist/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
export { }
|
package/dist/index.js
CHANGED
|
@@ -962,51 +962,32 @@ var init_connect = __esm({
|
|
|
962
962
|
// src/index.ts
|
|
963
963
|
init_config();
|
|
964
964
|
import { Command as Command7 } from "commander";
|
|
965
|
-
import
|
|
965
|
+
import { createRequire } from "module";
|
|
966
|
+
var require2 = createRequire(import.meta.url);
|
|
967
|
+
var { version } = require2("../package.json");
|
|
968
|
+
var VERSION = version;
|
|
969
|
+
var program = new Command7();
|
|
970
|
+
program.name("codowave").description("Codowave OSS CLI \u2014 AI-powered coding agent for your GitHub repositories").version(VERSION, "-v, --version", "Output the current version").option("--api-url <url>", "Override the Codowave API URL");
|
|
966
971
|
var { initCommand: initCommand2 } = await Promise.resolve().then(() => (init_init(), init_exports));
|
|
967
972
|
var { runCommand: runCommand2 } = await Promise.resolve().then(() => (init_run(), run_exports));
|
|
968
973
|
var { statusCommand: statusCommand2 } = await Promise.resolve().then(() => (init_status(), status_exports));
|
|
969
974
|
var { logsCommand: logsCommand2 } = await Promise.resolve().then(() => (init_logs(), logs_exports));
|
|
970
975
|
var { configCommand: configCommand2 } = await Promise.resolve().then(() => (init_config_cmd(), config_cmd_exports));
|
|
971
976
|
var { connectCommand: connectCommand2 } = await Promise.resolve().then(() => (init_connect(), connect_exports));
|
|
972
|
-
var VERSION = "0.1.4";
|
|
973
|
-
var program = new Command7();
|
|
974
|
-
program.name("codowave").description(
|
|
975
|
-
pc8.bold("Codowave") + " \u2014 AI-powered coding agent for your GitHub repositories"
|
|
976
|
-
).version(VERSION, "-v, --version", "Output the current version").helpOption("-h, --help", "Display help").addHelpText(
|
|
977
|
-
"beforeAll",
|
|
978
|
-
`
|
|
979
|
-
${pc8.cyan(" \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
980
|
-
${pc8.cyan(" \u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2554\u2550\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D")}
|
|
981
|
-
${pc8.cyan(" \u2588\u2588\u2551 \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2557 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551\u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2557 ")}
|
|
982
|
-
${pc8.cyan(" \u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u255A\u2588\u2588\u2588\u2554\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2551 \u2588\u2588\u2551\u255A\u2588\u2588\u2588\u2588\u2588\u2588\u2554\u255D\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
|
|
983
|
-
`
|
|
984
|
-
).option("--api-url <url>", "Override the Codowave API URL");
|
|
985
977
|
program.addCommand(initCommand2);
|
|
986
978
|
program.addCommand(runCommand2);
|
|
987
979
|
program.addCommand(statusCommand2);
|
|
988
980
|
program.addCommand(logsCommand2);
|
|
989
981
|
program.addCommand(configCommand2);
|
|
990
982
|
program.addCommand(connectCommand2);
|
|
991
|
-
program.configureOutput({
|
|
992
|
-
writeErr: (str) => process.stderr.write(pc8.red(str))
|
|
993
|
-
});
|
|
994
983
|
var args = process.argv.slice(2);
|
|
995
984
|
var isInitOrHelp = args[0] === "init" || args.includes("--help") || args.includes("-h") || args.includes("--version") || args.includes("-v") || args.length === 0;
|
|
996
985
|
if (!isInitOrHelp) {
|
|
997
|
-
const config = readConfig();
|
|
998
|
-
if (!config) {
|
|
999
|
-
console.
|
|
1000
|
-
|
|
1001
|
-
"\u26A0 No config found. Run " + pc8.bold("codowave init") + " to get started.\n"
|
|
1002
|
-
)
|
|
1003
|
-
);
|
|
986
|
+
const config = await readConfig();
|
|
987
|
+
if (!config?.apiUrl) {
|
|
988
|
+
console.log("\n\u274C Codowave not initialized. Run: codowave init\n");
|
|
989
|
+
process.exit(1);
|
|
1004
990
|
}
|
|
1005
991
|
}
|
|
1006
|
-
program.
|
|
1007
|
-
|
|
1008
|
-
\u2716 Error: ${err instanceof Error ? err.message : String(err)}
|
|
1009
|
-
`));
|
|
1010
|
-
process.exit(1);
|
|
1011
|
-
});
|
|
1012
|
-
//# sourceMappingURL=index.js.map
|
|
992
|
+
program.parse();
|
|
993
|
+
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts","../src/components/init/GithubAppStep.tsx","../src/commands/init.tsx","../src/commands/run.ts","../src/commands/status.ts","../src/commands/logs.ts","../src/commands/config-cmd.ts","../src/commands/connect.ts","../src/index.ts"],"sourcesContent":["import { readFileSync, writeFileSync, mkdirSync, existsSync } from \"fs\";\nimport { join } from \"path\";\nimport { homedir } from \"os\";\nimport { z } from \"zod\";\n\n// ── Schema ─────────────────────────────────────────────────────────────────\n\nexport const AIProviderSchema = z.object({\n provider: z.enum([\"openai\", \"anthropic\", \"minimax\", \"ollama\", \"custom\"]),\n apiKey: z.string().min(1),\n model: z.string().default(\"\"),\n baseUrl: z.string().url().optional(),\n});\n\nexport type AIProvider = z.infer<typeof AIProviderSchema>;\n\nexport const ConfigSchema = z.object({\n apiKey: z.string().min(1),\n apiUrl: z.string().url().default(\"https://api.codowave.com\"),\n repos: z\n .array(\n z.object({\n owner: z.string(),\n name: z.string(),\n id: z.string().optional(),\n })\n )\n .default([]),\n ai: AIProviderSchema.optional(),\n});\n\nexport type CodowaveConfig = z.infer<typeof ConfigSchema>;\n\n// ── Paths ──────────────────────────────────────────────────────────────────\n\nconst CONFIG_DIR = join(homedir(), \".codowave\");\nconst CONFIG_FILE = join(CONFIG_DIR, \"config.json\");\n\n// ── Read ───────────────────────────────────────────────────────────────────\n\nexport function readConfig(): CodowaveConfig | null {\n if (!existsSync(CONFIG_FILE)) {\n return null;\n }\n\n try {\n const raw = readFileSync(CONFIG_FILE, \"utf-8\");\n const json = JSON.parse(raw);\n const parsed = ConfigSchema.safeParse(json);\n\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n } catch (err) {\n console.warn(`[config] Failed to parse ${CONFIG_FILE}:`, err);\n return null;\n }\n}\n\nexport function readConfigOrThrow(): CodowaveConfig {\n const config = readConfig();\n if (!config) {\n throw new Error(\n `No Codowave config found. Run \\`codowave init\\` to get started.`\n );\n }\n return config;\n}\n\n// ── Write ──────────────────────────────────────────────────────────────────\n\nexport function writeConfig(config: CodowaveConfig): void {\n if (!existsSync(CONFIG_DIR)) {\n mkdirSync(CONFIG_DIR, { recursive: true });\n }\n\n writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + \"\\n\", \"utf-8\");\n}\n\nexport function updateConfig(\n updates: Partial<CodowaveConfig>\n): CodowaveConfig {\n const current = readConfig() ?? {\n apiKey: \"\",\n apiUrl: \"https://api.codowave.com\",\n repos: [],\n };\n\n const merged: CodowaveConfig = {\n ...current,\n ...updates,\n };\n\n writeConfig(merged);\n return merged;\n}\n\n// ── Config path getter (for display) ──────────────────────────────────────\n\nexport function getConfigPath(): string {\n return CONFIG_FILE;\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport {\n Box,\n Text,\n useInput,\n} from \"ink\";\nimport Spinner from \"ink-spinner\";\nimport pc from \"picocolors\";\n\ntype Repo = {\n\towner: string;\n\tname: string;\n\tid?: string;\n};\n\ntype Props = {\n\tapiUrl: string;\n\tonComplete: (apiKey: string, repos: Repo[]) => void;\n\tonCancel: () => void;\n};\n\ntype Step = \"api-key\" | \"repos\";\n\nexport const GithubAppStep: React.FC<Props> = ({ apiUrl, onComplete, onCancel }) => {\n\tconst [step, setStep] = useState<Step>(\"api-key\");\n\tconst [apiKey, setApiKey] = useState(\"\");\n\tconst [repos, setRepos] = useState<Repo[]>([]);\n\tconst [selectedRepos, setSelectedRepos] = useState<Set<number>>(new Set());\n\tconst [currentSelection, setCurrentSelection] = useState(0);\n\tconst [loading, setLoading] = useState(false);\n\tconst [error, setError] = useState<string | null>(null);\n\n\t// Fetch repos when API key is validated\n\tuseEffect(() => {\n\t\tif (step === \"repos\" && apiKey && repos.length === 0 && !loading) {\n\t\t\tfetchRepos();\n\t\t}\n\t}, [step, apiKey]);\n\n\tasync function fetchRepos() {\n\t\tsetLoading(true);\n\t\tsetError(null);\n\n\t\ttry {\n\t\t\t// Call the API to get repositories\n\t\t\t// This endpoint should return the repos associated with the API key\n\t\t\tconst response = await fetch(`${apiUrl}/api/v1/repos`, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`,\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status === 401) {\n\t\t\t\t\tthrow new Error(\"Invalid API key. Please check and try again.\");\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Failed to fetch repositories: ${response.status}`);\n\t\t\t}\n\n\t\t\tconst data = await response.json() as { repos?: Repo[]; repositories?: Repo[] };\n\t\t\t// Expected response format: { repos: [{ owner, name, id? }] }\n\t\t\tconst fetchedRepos = data.repos || data.repositories || [];\n\t\t\tsetRepos(fetchedRepos);\n\t\t\t// Select all by default\n\t\t\tif (fetchedRepos.length > 0) {\n\t\t\t\tconst allIndices = new Set<number>();\n\t\t\t\tfor (let i = 0; i < fetchedRepos.length; i++) {\n\t\t\t\t\tallIndices.add(i);\n\t\t\t\t}\n\t\t\t\tsetSelectedRepos(allIndices);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tsetError(err instanceof Error ? err.message : \"Failed to fetch repositories\");\n\t\t} finally {\n\t\t\tsetLoading(false);\n\t\t}\n\t}\n\n\tfunction handleApiKeySubmit() {\n\t\tif (!apiKey.trim()) {\n\t\t\tsetError(\"API key cannot be empty\");\n\t\t\treturn;\n\t\t}\n\t\tsetError(null);\n\t\tsetStep(\"repos\");\n\t}\n\n\tfunction handleConfirm() {\n\t\tconst selected = Array.from(selectedRepos)\n\t\t\t.map((i) => repos[i])\n\t\t\t.filter((repo): repo is Repo => repo !== undefined);\n\t\tonComplete(apiKey, selected);\n\t}\n\n\tfunction handleGoBack() {\n\t\tsetStep(\"api-key\");\n\t\tsetError(null);\n\t}\n\n\t// Handle keyboard input\n\tuseInput((input, key) => {\n\t\tif (step === \"api-key\") {\n\t\t\t// Handle Enter key\n\t\t\tif (key.return) {\n\t\t\t\thandleApiKeySubmit();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Escape key\n\t\t\tif (key.escape) {\n\t\t\t\tonCancel();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle backspace\n\t\t\tif (key.backspace || input === \"\\b\") {\n\t\t\t\tsetApiKey((prev) => prev.slice(0, -1));\n\t\t\t\tsetError(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle regular character input\n\t\t\tif (input && !key.ctrl && !key.meta) {\n\t\t\t\tsetApiKey((prev) => prev + input);\n\t\t\t\tsetError(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (step === \"repos\") {\n\t\t\t// Handle Escape key - go back\n\t\t\tif (key.escape) {\n\t\t\t\thandleGoBack();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Enter key - confirm\n\t\t\tif (key.return) {\n\t\t\t\thandleConfirm();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Space - toggle selection\n\t\t\tif (input === \" \") {\n\t\t\t\ttoggleRepo(currentSelection);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Up arrow - move selection up\n\t\t\tif (key.upArrow) {\n\t\t\t\tsetCurrentSelection((prev) => Math.max(0, prev - 1));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Down arrow - move selection down\n\t\t\tif (key.downArrow) {\n\t\t\t\tsetCurrentSelection((prev) => Math.min(repos.length - 1, prev + 1));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle 'a' key - select all\n\t\t\tif (input === \"a\" || input === \"A\") {\n\t\t\t\tconst allIndices = new Set<number>();\n\t\t\t\tfor (let i = 0; i < repos.length; i++) {\n\t\t\t\t\tallIndices.add(i);\n\t\t\t\t}\n\t\t\t\tsetSelectedRepos(allIndices);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle 'n' key - select none\n\t\t\tif (input === \"n\" || input === \"N\") {\n\t\t\t\tsetSelectedRepos(new Set());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction toggleRepo(index: number) {\n\t\tconst newSelected = new Set(selectedRepos);\n\t\tif (newSelected.has(index)) {\n\t\t\tnewSelected.delete(index);\n\t\t} else {\n\t\t\tnewSelected.add(index);\n\t\t}\n\t\tsetSelectedRepos(newSelected);\n\t}\n\n\t// Render API key input step\n\tif (step === \"api-key\") {\n\t\treturn (\n\t\t\t<Box flexDirection=\"column\" paddingY={1}>\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text bold color=\"cyan\">\n\t\t\t\t\t\t{\"═══ GitHub App Setup ═══\"}\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text>Enter your Codowave API key:</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t<Box>\n\t\t\t\t\t<Text color=\"gray\">{\"> \"}</Text>\n\t\t\t\t\t<Text>{apiKey}</Text>\n\t\t\t\t\t<Text color=\"cyan\">_</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t{error && (\n\t\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t\t<Text color=\"red\">{pc.red(\"✖ \" + error)}</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\tPress <Text bold>Enter</Text> to continue, <Text bold>Esc</Text> to cancel\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\t// Render repository selection step\n\tif (step === \"repos\") {\n\t\treturn (\n\t\t\t<Box flexDirection=\"column\" paddingY={1}>\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text bold color=\"cyan\">\n\t\t\t\t\t\t{\"═══ Select Repositories ═══\"}\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t{loading && (\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t<Text color=\"yellow\">\n\t\t\t\t\t\t\t<Spinner type=\"dots\" /> Loading repositories...\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{error && (\n\t\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t\t<Text color=\"red\">{pc.red(\"✖ \" + error)}</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && !error && repos.length === 0 && (\n\t\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t\t<Text color=\"yellow\">No repositories found for this API key.</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && repos.length > 0 && (\n\t\t\t\t\t<Box flexDirection=\"column\" marginBottom={1}>\n\t\t\t\t\t\t{repos.map((repo, index) => (\n\t\t\t\t\t\t\t<Box key={index}>\n\t\t\t\t\t\t\t\t<Text>{index === currentSelection ? \" > \" : \" \"}</Text>\n\t\t\t\t\t\t\t\t<Text color={selectedRepos.has(index) ? \"green\" : \"gray\"}>\n\t\t\t\t\t\t\t\t\t[{selectedRepos.has(index) ? \"✓\" : \" \"}]\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text> </Text>\n\t\t\t\t\t\t\t\t<Text bold={index === currentSelection}>\n\t\t\t\t\t\t\t\t\t<Text dimColor={!selectedRepos.has(index)}>\n\t\t\t\t\t\t\t\t\t\t{repo.owner}/{repo.name}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && repos.length > 0 && (\n\t\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\t\t<Text bold>↑/↓</Text> navigate | <Text bold>Space</Text> toggle | <Text bold>A</Text> all | <Text bold>N</Text> none\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\tSelected: <Text bold color=\"green\">{selectedRepos.size}</Text> / {repos.length} repos | <Text bold>Enter</Text> confirm | <Text bold>Esc</Text> back\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn null;\n};\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { render } from \"ink\";\nimport React from \"react\";\nimport { writeConfig, readConfig, getConfigPath } from \"../config.js\";\nimport { GithubAppStep } from \"../components/init/GithubAppStep.js\";\n\ntype Repo = {\n\towner: string;\n\tname: string;\n\tid?: string;\n};\n\nexport const initCommand = new Command(\"init\")\n\t.description(\"Initialize Codowave and connect your GitHub repositories\")\n\t.action(async () => {\n\t\tconst existingConfig = readConfig();\n\t\tconst defaultApiUrl = \"https://api.codowave.com\";\n\t\tconst apiUrl = existingConfig?.apiUrl || defaultApiUrl;\n\n\t\t// If already initialized, ask if they want to reconfigure\n\t\tif (existingConfig?.apiKey) {\n\t\t\tconsole.log(pc.yellow(\"\\n⚠ Codowave is already initialized.\\n\"));\n\t\t\tconsole.log(` API URL: ${pc.cyan(existingConfig.apiUrl)}`);\n\t\t\tconsole.log(` Config: ${getConfigPath()}`);\n\t\t\tconsole.log(pc.gray(\"\\n Run this command again to reconfigure.\\n\"));\n\t\t\treturn;\n\t\t}\n\n\t\tlet wizardComplete = false;\n\t\tlet capturedApiKey = \"\";\n\t\tlet capturedRepos: Repo[] = [];\n\n\t\tconst { waitUntilExit } = render(\n\t\t\t<GithubAppStep\n\t\t\t\tapiUrl={apiUrl}\n\t\t\t\tonComplete={(apiKey, repos) => {\n\t\t\t\t\tcapturedApiKey = apiKey;\n\t\t\t\t\tcapturedRepos = repos;\n\t\t\t\t\twizardComplete = true;\n\t\t\t\t}}\n\t\t\t\tonCancel={() => {\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\n\t\tawait waitUntilExit();\n\n\t\tif (!wizardComplete) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Save the configuration\n\t\twriteConfig({\n\t\t\tapiKey: capturedApiKey,\n\t\t\tapiUrl: apiUrl,\n\t\t\trepos: capturedRepos,\n\t\t});\n\n\t\tconsole.log(pc.green(\"\\n✓ Initialization complete!\"));\n\t\tconsole.log(`\\n Config saved to: ${pc.cyan(getConfigPath())}`);\n\t\tconsole.log(` API URL: ${pc.cyan(apiUrl)}`);\n\t\tconsole.log(` Repositories: ${pc.bold(capturedRepos.length)} configured\\n`);\n\t\tconsole.log(pc.gray(\" Run \") + pc.bold(\"codowave run\") + pc.gray(\" to start coding!\\n\"));\n\t});\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, type CodowaveConfig } from \"../config.js\";\nimport { getRun, type RunStatus, type RunStage } from \"./status.js\";\n\n// Demo runs store (in production, this would be from API)\nconst demoRuns: Map<string, RunStatus> = new Map();\n\nfunction parseIssue(input: string): { owner: string; repo: string; number: number } | null {\n // Match: https://github.com/owner/repo/issues/123\n const urlMatch = input.match(/github\\.com\\/([^/]+)\\/([^/]+)\\/issues\\/(\\d+)/);\n if (urlMatch && urlMatch[1] && urlMatch[2] && urlMatch[3]) {\n return { owner: urlMatch[1], repo: urlMatch[2], number: parseInt(urlMatch[3], 10) };\n }\n\n // Match: owner/repo#123\n const repoMatch = input.match(/([^/]+)\\/([^#]+)#(\\d+)/);\n if (repoMatch && repoMatch[1] && repoMatch[2] && repoMatch[3]) {\n return { owner: repoMatch[1], repo: repoMatch[2], number: parseInt(repoMatch[3], 10) };\n }\n\n // Match: just issue number (123)\n const numMatch = input.match(/^(\\d+)$/);\n if (numMatch && numMatch[1]) {\n return { owner: \"\", repo: \"\", number: parseInt(numMatch[1], 10) };\n }\n\n return null;\n}\n\nasync function triggerRun(\n config: CodowaveConfig,\n issue: { owner: string; repo: string; number: number }\n): Promise<string> {\n const apiUrl = config.apiUrl;\n const apiKey = config.apiKey;\n\n // Find repo in config\n const repoConfig = config.repos.find(\n (r) => r.owner === issue.owner && r.name === issue.repo\n );\n\n if (!repoConfig) {\n throw new Error(\n `Repository ${issue.owner}/${issue.repo} not configured. Run \\`codowave config add-repo ${issue.owner}/${issue.repo}\\``\n );\n }\n\n // Call the API to trigger a run\n const response = await fetch(`${apiUrl}/api/runs`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${apiKey}`,\n },\n body: JSON.stringify({\n repositoryId: repoConfig.id,\n issueNumber: issue.number,\n }),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Failed to trigger run: ${response.status} ${error}`);\n }\n\n const data = await response.json() as { runId: string };\n return data.runId;\n}\n\nfunction createDemoRun(issue: { owner: string; repo: string; number: number }): RunStatus {\n const runId = `run-${Date.now()}`;\n const run: RunStatus = {\n id: runId,\n repo: issue.owner && issue.repo ? `${issue.owner}/${issue.repo}` : \"CodowaveAI/Codowave\",\n status: \"in_progress\",\n issue: `#${issue.number}`,\n branchName: `agent/issue-${issue.number}`,\n startedAt: new Date().toISOString(),\n stages: [\n { name: \"context\", status: \"pending\" },\n { name: \"planning\", status: \"pending\" },\n { name: \"implementation\", status: \"pending\" },\n { name: \"testing\", status: \"pending\" },\n { name: \"pr-creation\", status: \"pending\" },\n ],\n };\n demoRuns.set(runId, run);\n return run;\n}\n\nfunction streamDemoRun(run: RunStatus) {\n // Simulate SSE streaming with demo data\n const stages = [\"context\", \"planning\", \"implementation\", \"testing\", \"pr-creation\"];\n let currentStage = 0;\n\n console.log(pc.bold(\"\\n=== Starting Run ===\\n\"));\n console.log(pc.bold(\"Run ID: \") + run.id);\n console.log(pc.bold(\"Repo: \") + run.repo);\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Branch: \") + run.branchName);\n console.log(\"\");\n\n const interval = setInterval(() => {\n if (currentStage >= stages.length) {\n clearInterval(interval);\n \n // Mark run as completed\n run.status = \"completed\";\n run.completedAt = new Date().toISOString();\n run.prNumber = 100 + Math.floor(Math.random() * 50);\n run.prTitle = `feat: Implement issue #${run.issue}`;\n \n console.log(pc.green(\"\\n✓ Run completed successfully!\"));\n console.log(pc.bold(\"\\n=== Result ===\\n\"));\n console.log(pc.bold(\"PR: \") + `#${run.prNumber} - ${run.prTitle}`);\n console.log(pc.bold(\"Branch: \") + run.branchName);\n console.log(\"\");\n process.exit(0);\n return;\n }\n\n const stageName = stages[currentStage];\n const stage = run.stages.find((s) => s.name === stageName);\n \n if (stage) {\n stage.status = \"running\";\n \n // Show stage progress\n console.log(pc.blue(`\\n--- ${stageName} ---`));\n \n // Simulate work and mark complete\n setTimeout(() => {\n stage.status = \"completed\";\n stage.logs = `${stageName} completed successfully`;\n \n // Move to next stage\n currentStage++;\n }, 1000 + Math.random() * 2000);\n } else {\n currentStage++;\n }\n }, 500);\n\n // Handle Ctrl+C\n process.on(\"SIGINT\", () => {\n clearInterval(interval);\n run.status = \"cancelled\";\n console.log(pc.yellow(\"\\n\\n⚠ Run cancelled\"));\n process.exit(1);\n });\n}\n\nexport const runCommand = new Command(\"run\")\n .description(\"Trigger Codowave to process a GitHub issue\")\n .argument(\"<issue>\", \"GitHub issue number, URL (https://github.com/owner/repo/issues/123), or owner/repo#123\")\n .option(\"-r, --repo <owner/repo>\", \"Target repository (e.g. owner/repo)\")\n .option(\"-s, --stream\", \"Stream run progress (SSE)\", false)\n .action(async (_issueArg: string, _options: { repo?: string; stream?: boolean }) => {\n try {\n // Parse the issue\n const parsed = parseIssue(_issueArg);\n \n if (!parsed) {\n console.error(pc.red(\"Invalid issue format. Use:\"));\n console.error(\" - Issue number: 123\");\n console.error(\" - Full URL: https://github.com/owner/repo/issues/123\");\n console.error(\" - Short form: owner/repo#123\");\n process.exit(1);\n }\n\n // If repo is specified via option, override\n if (_options.repo) {\n const parts = _options.repo.split(\"/\");\n const owner = parts[0] || \"\";\n const repo = parts[1] || \"\";\n parsed.owner = owner;\n parsed.repo = repo;\n }\n\n // Try to read config\n let config: CodowaveConfig | null = null;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n // Check if we have a real config (API mode) or running in demo mode\n if (config && config.apiKey && config.repos.length > 0) {\n // Real API mode\n console.log(pc.blue(\"Connecting to Codowave API...\"));\n \n // Validate repo is configured\n if (!parsed.owner || !parsed.repo) {\n console.error(pc.red(\"Repository required. Use -r option or include in issue URL.\"));\n process.exit(1);\n }\n\n const runId = await triggerRun(config, parsed);\n console.log(pc.green(`✓ Run triggered: ${runId}`));\n \n if (_options.stream) {\n console.log(pc.blue(\"\\nStreaming run progress...\"));\n // In production, this would connect to SSE endpoint\n // const eventSource = new EventSource(`${config.apiUrl}/api/runs/${runId}/events`);\n } else {\n console.log(pc.gray(`\\nRun started. Use \\`codowave status ${runId}\\` to check progress.`));\n }\n } else {\n // Demo mode\n console.log(pc.yellow(\"⚠ No config found. Running in demo mode.\\n\"));\n \n const run = createDemoRun(parsed);\n \n if (_options.stream || !process.stdout.isTTY) {\n // Stream mode\n streamDemoRun(run);\n } else {\n // Non-stream mode - just show the run info\n console.log(pc.green(`✓ Run started: ${run.id}`));\n console.log(pc.gray(`\\nUse \\`codowave status ${run.id}\\` to check progress.`));\n console.log(pc.gray(`Use \\`codowave logs ${run.id} -f\\` to follow logs.`));\n }\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(`\\n✖ Error: ${message}\\n`));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig } from \"../config.js\";\n\n// In-memory run store for demo (would be API calls in production)\nexport interface RunStatus {\n id: string;\n repo: string;\n status: \"pending\" | \"in_progress\" | \"completed\" | \"failed\" | \"cancelled\";\n issue: string;\n prNumber?: number;\n prTitle?: string;\n branchName?: string;\n startedAt?: string;\n completedAt?: string;\n errorMessage?: string;\n stages: RunStage[];\n}\n\nexport interface RunStage {\n name: string;\n status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n logs?: string;\n}\n\n// Demo data store (would be API in production)\nconst demoRuns: Map<string, RunStatus> = new Map();\n\n// Initialize with some demo data\nfunction initDemoData() {\n if (demoRuns.size === 0) {\n const demoRun: RunStatus = {\n id: \"latest\",\n repo: \"CodowaveAI/Codowave\",\n status: \"in_progress\",\n issue: \"#53: Implement CLI status and logs commands\",\n branchName: \"agent/issue-53\",\n startedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),\n stages: [\n { name: \"context\", status: \"completed\", logs: \"Loaded 12 files, 3 PRs context\" },\n { name: \"planning\", status: \"completed\", logs: \"Generated implementation plan\" },\n { name: \"implementation\", status: \"running\", logs: \"Implementing status command...\" },\n { name: \"testing\", status: \"pending\" },\n { name: \"pr-creation\", status: \"pending\" },\n ],\n };\n demoRuns.set(demoRun.id, demoRun);\n \n // Also add a completed run\n const completedRun: RunStatus = {\n id: \"abc-123-def\",\n repo: \"CodowaveAI/Codowave\",\n status: \"completed\",\n issue: \"#52: Add authentication flow\",\n prNumber: 78,\n prTitle: \"feat: Add OAuth authentication flow\",\n branchName: \"feat/auth-flow\",\n startedAt: new Date(Date.now() - 60 * 60 * 1000).toISOString(),\n completedAt: new Date(Date.now() - 45 * 60 * 1000).toISOString(),\n stages: [\n { name: \"context\", status: \"completed\" },\n { name: \"planning\", status: \"completed\" },\n { name: \"implementation\", status: \"completed\" },\n { name: \"testing\", status: \"completed\" },\n { name: \"pr-creation\", status: \"completed\" },\n ],\n };\n demoRuns.set(completedRun.id, completedRun);\n }\n}\n\nexport function getRun(runId?: string): RunStatus | undefined {\n initDemoData();\n if (!runId) {\n // Return most recent run\n return Array.from(demoRuns.values()).sort((a, b) => \n new Date(b.startedAt || 0).getTime() - new Date(a.startedAt || 0).getTime()\n )[0];\n }\n return demoRuns.get(runId);\n}\n\nfunction formatStatus(status: RunStatus[\"status\"]): string {\n switch (status) {\n case \"pending\":\n return pc.gray(\"pending\");\n case \"in_progress\":\n return pc.blue(\"in_progress\");\n case \"completed\":\n return pc.green(\"completed\");\n case \"failed\":\n return pc.red(\"failed\");\n case \"cancelled\":\n return pc.gray(\"cancelled\");\n default:\n return pc.gray(status);\n }\n}\n\nfunction formatStageStatus(status: RunStage[\"status\"]): string {\n switch (status) {\n case \"pending\":\n return pc.gray(\"[ ]\");\n case \"running\":\n return pc.blue(\"[~]\");\n case \"completed\":\n return pc.green(\"[+]\");\n case \"failed\":\n return pc.red(\"[x]\");\n case \"skipped\":\n return pc.gray(\"[-]\");\n default:\n return pc.gray(\"[?]\");\n }\n}\n\nfunction formatDuration(startedAt?: string, completedAt?: string): string {\n if (!startedAt) return \"\";\n const start = new Date(startedAt).getTime();\n const end = completedAt ? new Date(completedAt).getTime() : Date.now();\n const seconds = Math.floor((end - start) / 1000);\n \n if (seconds < 60) return `${seconds}s`;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) return `${minutes}m ${remainingSeconds}s`;\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${hours}h ${remainingMinutes}m`;\n}\n\nexport const statusCommand = new Command(\"status\")\n .description(\"Show the status of a Codowave run\")\n .argument(\"[run-id]\", \"Run ID (defaults to latest)\")\n .option(\"-r, --repo <owner/repo>\", \"Filter by repository\")\n .action(async (_runId?: string, _options?: { repo?: string }) => {\n try {\n // Try to read config (for future API integration)\n let config;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n const run = getRun(_runId);\n \n if (!run) {\n console.log(pc.yellow(\"No runs found. Run `codowave run <issue>` to start a new run.\"));\n return;\n }\n\n // Filter by repo if specified\n if (_options?.repo && run.repo !== _options.repo) {\n console.log(pc.yellow(\"No run found for repository \" + _options.repo));\n return;\n }\n\n console.log(pc.bold(\"\\n=== Run Status ===\\n\"));\n console.log(pc.bold(\"ID: \") + run.id);\n console.log(pc.bold(\"Repo: \") + run.repo);\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Status: \") + formatStatus(run.status));\n console.log(pc.bold(\"Branch: \") + (run.branchName || pc.gray(\"(none)\")));\n \n if (run.prNumber) {\n console.log(pc.bold(\"PR: \") + \"#\" + run.prNumber + \" - \" + (run.prTitle || \"\"));\n }\n \n if (run.startedAt) {\n console.log(pc.bold(\"Started: \") + new Date(run.startedAt).toLocaleString());\n }\n \n if (run.completedAt) {\n console.log(pc.bold(\"Duration: \") + formatDuration(run.startedAt, run.completedAt));\n } else if (run.startedAt) {\n console.log(pc.bold(\"Duration: \") + pc.blue(\"running... \") + formatDuration(run.startedAt));\n }\n \n if (run.errorMessage) {\n console.log(pc.bold(\"Error: \") + pc.red(run.errorMessage));\n }\n\n console.log(pc.bold(\"\\n=== Stages ===\\n\"));\n for (const stage of run.stages) {\n const statusIcon = formatStageStatus(stage.status);\n const statusText = pc.bold(\"[\" + stage.status + \"]\");\n console.log(\" \" + statusIcon + \" \" + pc.bold(stage.name.padEnd(20)) + \" \" + statusText);\n }\n\n console.log(\"\");\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(\"\\n=== Error: \" + message + \" ===\\n\"));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig } from \"../config.js\";\nimport { getRun, type RunStatus } from \"./status.js\";\n\nexport const logsCommand = new Command(\"logs\")\n .description(\"Stream logs for a Codowave run\")\n .argument(\"[run-id]\", \"Run ID (defaults to latest)\")\n .option(\"-f, --follow\", \"Follow log output (SSE stream)\")\n .option(\"-s, --stage <name>\", \"Show logs for a specific stage\")\n .option(\"--no-color\", \"Disable colored output\")\n .action(async (_runId?: string, _options?: { follow?: boolean; stage?: string; color?: boolean }) => {\n try {\n // Try to read config (for future API integration)\n let config;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n const run: RunStatus | undefined = getRun(_runId);\n \n if (!run) {\n console.log(pc.yellow(\"No runs found. Run `codowave run <issue>` to start a new run.\"));\n return;\n }\n\n // If --stage is specified, show only that stage's logs\n if (_options?.stage) {\n const stage = run.stages.find((s: { name: string }) => s.name === _options.stage);\n if (!stage) {\n console.log(pc.red(\"Stage \\\"\" + _options.stage + \"\\\" not found.\"));\n console.log(pc.gray(\"Available stages: \") + run.stages.map((s: { name: string }) => s.name).join(\", \"));\n return;\n }\n \n console.log(pc.bold(\"\\n=== Logs: \" + stage.name + \" ===\\n\"));\n console.log(pc.bold(\"Status: \") + stage.status);\n \n if (stage.logs) {\n console.log(pc.gray(\"\\n--- Output ---\\n\"));\n console.log(stage.logs);\n } else {\n console.log(pc.gray(\"\\n(no logs available yet)\"));\n }\n \n // If following and stage is still running, simulate live logs\n if (_options.follow && stage.status === \"running\") {\n console.log(pc.blue(\"\\n--- Following live logs (Ctrl+C to exit) ---\\n\"));\n // In production, this would connect to SSE endpoint\n // For demo, we'll show a message\n console.log(pc.gray(\"(Live streaming would connect to API SSE endpoint in production)\"));\n }\n console.log(\"\");\n return;\n }\n\n // Otherwise show all stage logs\n console.log(pc.bold(\"\\n=== Logs: \" + run.id + \" ===\\n\"));\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Status: \") + run.status);\n console.log(\"\");\n\n for (const stage of run.stages) {\n const statusIcon = stage.status === \"completed\" ? \"[+]\" : \n stage.status === \"failed\" ? \"[x]\" :\n stage.status === \"running\" ? \"[~]\" : \"[ ]\";\n \n console.log(pc.bold(\"\\n\" + statusIcon + \" \" + stage.name + \"\\n\"));\n \n if (stage.logs) {\n console.log(stage.logs);\n } else if (stage.status === \"pending\") {\n console.log(pc.gray(\"(pending)\"));\n } else if (stage.status === \"running\") {\n console.log(pc.blue(\"(running...)\"));\n } else if (stage.status === \"skipped\") {\n console.log(pc.gray(\"(skipped)\"));\n }\n }\n\n // If following and run is still in progress, simulate live output\n if (_options?.follow && run.status === \"in_progress\") {\n console.log(pc.blue(\"\\n--- Following live logs (Ctrl+C to exit) ---\\n\"));\n // In production, this would connect to SSE endpoint\n console.log(pc.gray(\"(Live streaming would connect to API SSE endpoint in production)\"));\n \n // Simulate periodic updates (for demo purposes)\n let dots = 0;\n const interval = setInterval(() => {\n dots = (dots + 1) % 4;\n process.stdout.write(pc.blue(\"\\r\" + \" \".repeat(dots) + \" waiting for updates...\"));\n }, 500);\n \n // Handle Ctrl+C\n process.on(\"SIGINT\", () => {\n clearInterval(interval);\n console.log(pc.gray(\"\\n\\n(Stopped following)\"));\n process.exit(0);\n });\n }\n\n console.log(\"\");\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(\"\\n=== Error: \" + message + \" ===\\n\"));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, readConfigOrThrow, updateConfig, getConfigPath } from \"../config.js\";\n\nexport const configCommand = new Command(\"config\")\n .description(\"Get or set Codowave configuration values\");\n\n// List all available config options\nconfigCommand\n .command(\"list\")\n .description(\"List all available config options\")\n .action(() => {\n console.log(pc.bold(\"\\n📋 Available Config Options:\\n\"));\n console.log(` ${pc.cyan(\"apiKey\")} ${pc.gray(\"— Your Codowave API key\")}`);\n console.log(` ${pc.cyan(\"apiUrl\")} ${pc.gray(\"— API endpoint URL (default: https://api.codowave.com)\")}`);\n console.log(` ${pc.cyan(\"repos\")} ${pc.gray(\"— List of configured repositories\")}`);\n console.log(` ${pc.cyan(\"configPath\")} ${pc.gray(\"— Path to the config file\")}`);\n console.log(\"\");\n });\n\n// Get a config value\nconfigCommand\n .command(\"get <key>\")\n .description(\"Get a config value\")\n .action((key: string) => {\n try {\n const config = readConfigOrThrow();\n \n // Special case for configPath\n if (key === \"configPath\") {\n console.log(pc.green(getConfigPath()));\n return;\n }\n \n // Special case for repos - show nicely formatted\n if (key === \"repos\") {\n if (config.repos.length === 0) {\n console.log(pc.yellow(\"No repos configured.\"));\n } else {\n console.log(pc.bold(\"\\n📦 Configured Repositories:\\n\"));\n config.repos.forEach((repo, index) => {\n console.log(` ${index + 1}. ${pc.cyan(`${repo.owner}/${repo.name}`)}`);\n if (repo.id) {\n console.log(` ${pc.gray(\"ID: \" + repo.id)}`);\n }\n });\n console.log(\"\");\n }\n return;\n }\n \n // Get a specific key\n const value = config[key as keyof typeof config];\n \n if (value === undefined) {\n console.error(pc.red(`✖ Unknown config key: ${key}`));\n console.log(pc.gray(` Run \\`codowave config list\\` to see available options.`));\n process.exit(1);\n }\n \n console.log(value);\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Set a config value\nconfigCommand\n .command(\"set <key> <value>\")\n .description(\"Set a config value\")\n .action((key: string, value: string) => {\n try {\n // Validate the key\n const validKeys = [\"apiKey\", \"apiUrl\"];\n if (!validKeys.includes(key)) {\n console.error(pc.red(`✖ Cannot set '${key}' directly.`));\n console.log(pc.gray(` For 'repos', use \\`codowave init\\` to manage repositories.`));\n console.log(pc.gray(` Run \\`codowave config list\\` to see available options.`));\n process.exit(1);\n }\n \n // Validate apiUrl if provided\n if (key === \"apiUrl\") {\n try {\n new URL(value);\n } catch {\n console.error(pc.red(`✖ Invalid URL: ${value}`));\n process.exit(1);\n }\n }\n \n const updates = { [key]: value };\n const newConfig = updateConfig(updates);\n \n console.log(pc.green(`✓ Updated ${key}`));\n \n // Show the new value\n console.log(pc.gray(` ${key} = ${newConfig[key as keyof typeof newConfig]}`));\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Show all current config values (alias for showing full config)\nconfigCommand\n .command(\"show\")\n .description(\"Show all current config values\")\n .action(() => {\n try {\n const config = readConfigOrThrow();\n \n console.log(pc.bold(\"\\n⚙️ Current Configuration:\\n\"));\n console.log(` ${pc.cyan(\"apiKey\")}: ${config.apiKey ? pc.green(\"••••••••\") + pc.gray(\" (hidden)\") : pc.yellow(\"not set\")}`);\n console.log(` ${pc.cyan(\"apiUrl\")}: ${config.apiUrl}`);\n console.log(` ${pc.cyan(\"repos\")}: ${config.repos.length} repository(s) configured`);\n console.log(` ${pc.cyan(\"configPath\")}: ${pc.gray(getConfigPath())}`);\n \n if (config.repos.length > 0) {\n console.log(pc.bold(pc.gray(\"\\n Repositories:\")));\n config.repos.forEach((repo) => {\n console.log(` • ${repo.owner}/${repo.name}${repo.id ? pc.gray(` (${repo.id})`) : \"\"}`);\n });\n }\n \n console.log(\"\");\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Default action when just 'config' is run - show help\nconfigCommand.action(() => {\n configCommand.help();\n});\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, updateConfig, getConfigPath } from \"../config.js\";\n\nconst PRO_API_URL = \"https://api.codowave.com\";\nconst PRO_AUTH_URL = \"https://codowave.com/api/auth/device\";\nconst PRO_TOKEN_URL = \"https://codowave.com/api/auth/token\";\n\nexport const connectCommand = new Command(\"connect\")\n .description(\"Connect to Codowave Pro (upgrade from OSS)\")\n .action(async () => {\n try {\n console.log(pc.bold(\"\\n🔗 Codowave Connect\\n\"));\n console.log(pc.gray(\"This command upgrades your OSS installation to Codowave Pro.\\n\"));\n\n // Check current config\n const config = readConfig();\n const isAlreadyPro = config?.apiUrl === PRO_API_URL;\n\n if (isAlreadyPro) {\n console.log(pc.green(\"✓ You are already connected to Codowave Pro!\"));\n console.log(pc.gray(` API URL: ${config?.apiUrl}`));\n console.log(\"\");\n return;\n }\n\n // Start OAuth device flow\n console.log(pc.blue(\"Starting OAuth device flow...\\n\"));\n\n // In a real implementation, this would:\n // 1. Call PRO_AUTH_URL to get device_code, user_code, verification_uri\n // 2. Display user_code and verification_uri for user to enter in browser\n // 3. Poll PRO_TOKEN_URL until user authorizes\n // 4. Get access_token and store in config\n\n // For now, simulate the flow\n console.log(pc.gray(\" 1. Requesting device code...\"));\n \n // Simulate API call (would be real fetch in production)\n const deviceCode = `CODOWAVE-${Date.now().toString(36).toUpperCase()}`;\n const verificationUri = \"https://codowave.com/activate\";\n \n console.log(pc.green(\"\\n ⚠️ Device Code: \") + pc.bold(deviceCode));\n console.log(pc.gray(\"\\n 2. Please visit: \") + pc.cyan(verificationUri));\n console.log(pc.gray(\" and enter the device code above.\\n\"));\n \n console.log(pc.yellow(\" ℹ️ This is a stub implementation.\"));\n console.log(pc.gray(\" In production, this would poll for OAuth completion.\\n\"));\n\n // For demo purposes, let's just show what would happen\n console.log(pc.blue(\" 3. Would save Pro token and switch API URL...\\n\"));\n \n // Actually, let's not modify config in demo mode - just show what would happen\n console.log(pc.bold(\"What would happen:\\n\"));\n console.log(` • Save Pro API token to ${getConfigPath()}`);\n console.log(` • Set apiUrl to ${PRO_API_URL}`);\n console.log(\"\");\n \n console.log(pc.gray(\"Run with \") + pc.cyan(\"CODOWAVE_CONNECT=1\") + pc.gray(\" to enable (not implemented yet)\"));\n console.log(\"\");\n\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(`\\n✖ Error: ${message}\\n`));\n process.exit(1);\n }\n });\n\n/**\n * Actually perform the connection (used after OAuth success)\n * This would be called internally after OAuth polling succeeds\n */\nexport async function performConnect(accessToken: string): Promise<void> {\n const config = updateConfig({\n apiKey: accessToken,\n apiUrl: PRO_API_URL,\n });\n \n console.log(pc.green(\"✓ Connected to Codowave Pro!\"));\n console.log(pc.gray(` API URL: ${config.apiUrl}`));\n}\n","#!/usr/bin/env node\nimport { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig } from \"./config.js\";\n\n// Dynamically imported to keep startup fast\nconst { initCommand } = await import(\"./commands/init.js\");\nconst { runCommand } = await import(\"./commands/run.js\");\nconst { statusCommand } = await import(\"./commands/status.js\");\nconst { logsCommand } = await import(\"./commands/logs.js\");\nconst { configCommand } = await import(\"./commands/config-cmd.js\");\nconst { connectCommand } = await import(\"./commands/connect.js\");\n\nconst VERSION = \"0.1.4\";\n\nconst program = new Command();\n\nprogram\n .name(\"codowave\")\n .description(\n pc.bold(\"Codowave\") +\n \" — AI-powered coding agent for your GitHub repositories\"\n )\n .version(VERSION, \"-v, --version\", \"Output the current version\")\n .helpOption(\"-h, --help\", \"Display help\")\n .addHelpText(\n \"beforeAll\",\n `\\n${pc.cyan(\" ██████╗ ██████╗ ██████╗ ██████╗ ██╗ ██╗ █████╗ ██╗ ██╗███████╗\")}\\n${pc.cyan(\" ██╔════╝██╔═══██╗██╔══██╗██╔═══██╗██║ ██║██╔══██╗██║ ██║██╔════╝\")}\\n${pc.cyan(\" ██║ ██║ ██║██║ ██║██║ ██║██║ █╗ ██║███████║██║ ██║█████╗ \")}\\n${pc.cyan(\" ╚██████╗╚██████╔╝██████╔╝╚██████╔╝╚███╔███╔╝██║ ██║╚██████╔╝███████╗\")}\\n`\n )\n // Global option: override API URL (useful for self-hosted deployments)\n .option(\"--api-url <url>\", \"Override the Codowave API URL\");\n\n// ── Subcommands ────────────────────────────────────────────────────────────\n\nprogram.addCommand(initCommand);\nprogram.addCommand(runCommand);\nprogram.addCommand(statusCommand);\nprogram.addCommand(logsCommand);\nprogram.addCommand(configCommand);\nprogram.addCommand(connectCommand);\n\n// ── Global error handler ───────────────────────────────────────────────────\n\nprogram.configureOutput({\n writeErr: (str) => process.stderr.write(pc.red(str)),\n});\n\n// Show warning if not initialized (except for init and help)\nconst args = process.argv.slice(2);\nconst isInitOrHelp =\n args[0] === \"init\" ||\n args.includes(\"--help\") ||\n args.includes(\"-h\") ||\n args.includes(\"--version\") ||\n args.includes(\"-v\") ||\n args.length === 0;\n\nif (!isInitOrHelp) {\n const config = readConfig();\n if (!config) {\n console.warn(\n pc.yellow(\n \"⚠ No config found. Run \" +\n pc.bold(\"codowave init\") +\n \" to get started.\\n\"\n )\n );\n }\n}\n\n// ── Parse ──────────────────────────────────────────────────────────────────\n\nprogram.parseAsync(process.argv).catch((err) => {\n console.error(pc.red(`\\n✖ Error: ${err instanceof Error ? err.message : String(err)}\\n`));\n process.exit(1);\n});\n"],"mappings":";;;;;;;;;;;;AAAA,SAAS,cAAc,eAAe,WAAW,kBAAkB;AACnE,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,SAAS;AAqCX,SAAS,aAAoC;AAClD,MAAI,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and","runCommand","statusCommand","logsCommand","configCommand","connectCommand"]}
|
|
1
|
+
{"version":3,"sources":["../src/config.ts","../src/components/init/GithubAppStep.tsx","../src/commands/init.tsx","../src/commands/run.ts","../src/commands/status.ts","../src/commands/logs.ts","../src/commands/config-cmd.ts","../src/commands/connect.ts","../src/index.ts"],"sourcesContent":["import { readFileSync, writeFileSync, mkdirSync, existsSync } from \"fs\";\nimport { join } from \"path\";\nimport { homedir } from \"os\";\nimport { z } from \"zod\";\n\n// ── Schema ─────────────────────────────────────────────────────────────────\n\nexport const AIProviderSchema = z.object({\n provider: z.enum([\"openai\", \"anthropic\", \"minimax\", \"ollama\", \"custom\"]),\n apiKey: z.string().min(1),\n model: z.string().default(\"\"),\n baseUrl: z.string().url().optional(),\n});\n\nexport type AIProvider = z.infer<typeof AIProviderSchema>;\n\nexport const ConfigSchema = z.object({\n apiKey: z.string().min(1),\n apiUrl: z.string().url().default(\"https://api.codowave.com\"),\n repos: z\n .array(\n z.object({\n owner: z.string(),\n name: z.string(),\n id: z.string().optional(),\n })\n )\n .default([]),\n ai: AIProviderSchema.optional(),\n});\n\nexport type CodowaveConfig = z.infer<typeof ConfigSchema>;\n\n// ── Paths ──────────────────────────────────────────────────────────────────\n\nconst CONFIG_DIR = join(homedir(), \".codowave\");\nconst CONFIG_FILE = join(CONFIG_DIR, \"config.json\");\n\n// ── Read ───────────────────────────────────────────────────────────────────\n\nexport function readConfig(): CodowaveConfig | null {\n if (!existsSync(CONFIG_FILE)) {\n return null;\n }\n\n try {\n const raw = readFileSync(CONFIG_FILE, \"utf-8\");\n const json = JSON.parse(raw);\n const parsed = ConfigSchema.safeParse(json);\n\n if (!parsed.success) {\n return null;\n }\n\n return parsed.data;\n } catch (err) {\n console.warn(`[config] Failed to parse ${CONFIG_FILE}:`, err);\n return null;\n }\n}\n\nexport function readConfigOrThrow(): CodowaveConfig {\n const config = readConfig();\n if (!config) {\n throw new Error(\n `No Codowave config found. Run \\`codowave init\\` to get started.`\n );\n }\n return config;\n}\n\n// ── Write ──────────────────────────────────────────────────────────────────\n\nexport function writeConfig(config: CodowaveConfig): void {\n if (!existsSync(CONFIG_DIR)) {\n mkdirSync(CONFIG_DIR, { recursive: true });\n }\n\n writeFileSync(CONFIG_FILE, JSON.stringify(config, null, 2) + \"\\n\", \"utf-8\");\n}\n\nexport function updateConfig(\n updates: Partial<CodowaveConfig>\n): CodowaveConfig {\n const current = readConfig() ?? {\n apiKey: \"\",\n apiUrl: \"https://api.codowave.com\",\n repos: [],\n };\n\n const merged: CodowaveConfig = {\n ...current,\n ...updates,\n };\n\n writeConfig(merged);\n return merged;\n}\n\n// ── Config path getter (for display) ──────────────────────────────────────\n\nexport function getConfigPath(): string {\n return CONFIG_FILE;\n}\n","import React, { useState, useEffect, useRef } from \"react\";\nimport {\n Box,\n Text,\n useInput,\n} from \"ink\";\nimport Spinner from \"ink-spinner\";\nimport pc from \"picocolors\";\n\ntype Repo = {\n\towner: string;\n\tname: string;\n\tid?: string;\n};\n\ntype Props = {\n\tapiUrl: string;\n\tonComplete: (apiKey: string, repos: Repo[]) => void;\n\tonCancel: () => void;\n};\n\ntype Step = \"api-key\" | \"repos\";\n\nexport const GithubAppStep: React.FC<Props> = ({ apiUrl, onComplete, onCancel }) => {\n\tconst [step, setStep] = useState<Step>(\"api-key\");\n\tconst [apiKey, setApiKey] = useState(\"\");\n\tconst [repos, setRepos] = useState<Repo[]>([]);\n\tconst [selectedRepos, setSelectedRepos] = useState<Set<number>>(new Set());\n\tconst [currentSelection, setCurrentSelection] = useState(0);\n\tconst [loading, setLoading] = useState(false);\n\tconst [error, setError] = useState<string | null>(null);\n\n\t// Fetch repos when API key is validated\n\tuseEffect(() => {\n\t\tif (step === \"repos\" && apiKey && repos.length === 0 && !loading) {\n\t\t\tfetchRepos();\n\t\t}\n\t}, [step, apiKey]);\n\n\tasync function fetchRepos() {\n\t\tsetLoading(true);\n\t\tsetError(null);\n\n\t\ttry {\n\t\t\t// Call the API to get repositories\n\t\t\t// This endpoint should return the repos associated with the API key\n\t\t\tconst response = await fetch(`${apiUrl}/api/v1/repos`, {\n\t\t\t\theaders: {\n\t\t\t\t\tAuthorization: `Bearer ${apiKey}`,\n\t\t\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\t},\n\t\t\t});\n\n\t\t\tif (!response.ok) {\n\t\t\t\tif (response.status === 401) {\n\t\t\t\t\tthrow new Error(\"Invalid API key. Please check and try again.\");\n\t\t\t\t}\n\t\t\t\tthrow new Error(`Failed to fetch repositories: ${response.status}`);\n\t\t\t}\n\n\t\t\tconst data = await response.json() as { repos?: Repo[]; repositories?: Repo[] };\n\t\t\t// Expected response format: { repos: [{ owner, name, id? }] }\n\t\t\tconst fetchedRepos = data.repos || data.repositories || [];\n\t\t\tsetRepos(fetchedRepos);\n\t\t\t// Select all by default\n\t\t\tif (fetchedRepos.length > 0) {\n\t\t\t\tconst allIndices = new Set<number>();\n\t\t\t\tfor (let i = 0; i < fetchedRepos.length; i++) {\n\t\t\t\t\tallIndices.add(i);\n\t\t\t\t}\n\t\t\t\tsetSelectedRepos(allIndices);\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tsetError(err instanceof Error ? err.message : \"Failed to fetch repositories\");\n\t\t} finally {\n\t\t\tsetLoading(false);\n\t\t}\n\t}\n\n\tfunction handleApiKeySubmit() {\n\t\tif (!apiKey.trim()) {\n\t\t\tsetError(\"API key cannot be empty\");\n\t\t\treturn;\n\t\t}\n\t\tsetError(null);\n\t\tsetStep(\"repos\");\n\t}\n\n\tfunction handleConfirm() {\n\t\tconst selected = Array.from(selectedRepos)\n\t\t\t.map((i) => repos[i])\n\t\t\t.filter((repo): repo is Repo => repo !== undefined);\n\t\tonComplete(apiKey, selected);\n\t}\n\n\tfunction handleGoBack() {\n\t\tsetStep(\"api-key\");\n\t\tsetError(null);\n\t}\n\n\t// Handle keyboard input\n\tuseInput((input, key) => {\n\t\tif (step === \"api-key\") {\n\t\t\t// Handle Enter key\n\t\t\tif (key.return) {\n\t\t\t\thandleApiKeySubmit();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Escape key\n\t\t\tif (key.escape) {\n\t\t\t\tonCancel();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle backspace\n\t\t\tif (key.backspace || input === \"\\b\") {\n\t\t\t\tsetApiKey((prev) => prev.slice(0, -1));\n\t\t\t\tsetError(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle regular character input\n\t\t\tif (input && !key.ctrl && !key.meta) {\n\t\t\t\tsetApiKey((prev) => prev + input);\n\t\t\t\tsetError(null);\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if (step === \"repos\") {\n\t\t\t// Handle Escape key - go back\n\t\t\tif (key.escape) {\n\t\t\t\thandleGoBack();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Enter key - confirm\n\t\t\tif (key.return) {\n\t\t\t\thandleConfirm();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Space - toggle selection\n\t\t\tif (input === \" \") {\n\t\t\t\ttoggleRepo(currentSelection);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Up arrow - move selection up\n\t\t\tif (key.upArrow) {\n\t\t\t\tsetCurrentSelection((prev) => Math.max(0, prev - 1));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle Down arrow - move selection down\n\t\t\tif (key.downArrow) {\n\t\t\t\tsetCurrentSelection((prev) => Math.min(repos.length - 1, prev + 1));\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle 'a' key - select all\n\t\t\tif (input === \"a\" || input === \"A\") {\n\t\t\t\tconst allIndices = new Set<number>();\n\t\t\t\tfor (let i = 0; i < repos.length; i++) {\n\t\t\t\t\tallIndices.add(i);\n\t\t\t\t}\n\t\t\t\tsetSelectedRepos(allIndices);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Handle 'n' key - select none\n\t\t\tif (input === \"n\" || input === \"N\") {\n\t\t\t\tsetSelectedRepos(new Set());\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t});\n\n\tfunction toggleRepo(index: number) {\n\t\tconst newSelected = new Set(selectedRepos);\n\t\tif (newSelected.has(index)) {\n\t\t\tnewSelected.delete(index);\n\t\t} else {\n\t\t\tnewSelected.add(index);\n\t\t}\n\t\tsetSelectedRepos(newSelected);\n\t}\n\n\t// Render API key input step\n\tif (step === \"api-key\") {\n\t\treturn (\n\t\t\t<Box flexDirection=\"column\" paddingY={1}>\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text bold color=\"cyan\">\n\t\t\t\t\t\t{\"═══ GitHub App Setup ═══\"}\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text>Enter your Codowave API key:</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t<Box>\n\t\t\t\t\t<Text color=\"gray\">{\"> \"}</Text>\n\t\t\t\t\t<Text>{apiKey}</Text>\n\t\t\t\t\t<Text color=\"cyan\">_</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t{error && (\n\t\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t\t<Text color=\"red\">{pc.red(\"✖ \" + error)}</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\tPress <Text bold>Enter</Text> to continue, <Text bold>Esc</Text> to cancel\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\t// Render repository selection step\n\tif (step === \"repos\") {\n\t\treturn (\n\t\t\t<Box flexDirection=\"column\" paddingY={1}>\n\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t<Text bold color=\"cyan\">\n\t\t\t\t\t\t{\"═══ Select Repositories ═══\"}\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\n\t\t\t\t{loading && (\n\t\t\t\t\t<Box>\n\t\t\t\t\t\t<Text color=\"yellow\">\n\t\t\t\t\t\t\t<Spinner type=\"dots\" /> Loading repositories...\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{error && (\n\t\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t\t<Text color=\"red\">{pc.red(\"✖ \" + error)}</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && !error && repos.length === 0 && (\n\t\t\t\t\t<Box marginBottom={1}>\n\t\t\t\t\t\t<Text color=\"yellow\">No repositories found for this API key.</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && repos.length > 0 && (\n\t\t\t\t\t<Box flexDirection=\"column\" marginBottom={1}>\n\t\t\t\t\t\t{repos.map((repo, index) => (\n\t\t\t\t\t\t\t<Box key={index}>\n\t\t\t\t\t\t\t\t<Text>{index === currentSelection ? \" > \" : \" \"}</Text>\n\t\t\t\t\t\t\t\t<Text color={selectedRepos.has(index) ? \"green\" : \"gray\"}>\n\t\t\t\t\t\t\t\t\t[{selectedRepos.has(index) ? \"✓\" : \" \"}]\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t<Text> </Text>\n\t\t\t\t\t\t\t\t<Text bold={index === currentSelection}>\n\t\t\t\t\t\t\t\t\t<Text dimColor={!selectedRepos.has(index)}>\n\t\t\t\t\t\t\t\t\t\t{repo.owner}/{repo.name}\n\t\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t\t</Text>\n\t\t\t\t\t\t\t</Box>\n\t\t\t\t\t\t))}\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t{!loading && repos.length > 0 && (\n\t\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\t\t<Text bold>↑/↓</Text> navigate | <Text bold>Space</Text> toggle | <Text bold>A</Text> all | <Text bold>N</Text> none\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</Box>\n\t\t\t\t)}\n\n\t\t\t\t<Box marginTop={1}>\n\t\t\t\t\t<Text color=\"gray\">\n\t\t\t\t\t\tSelected: <Text bold color=\"green\">{selectedRepos.size}</Text> / {repos.length} repos | <Text bold>Enter</Text> confirm | <Text bold>Esc</Text> back\n\t\t\t\t\t</Text>\n\t\t\t\t</Box>\n\t\t\t</Box>\n\t\t);\n\t}\n\n\treturn null;\n};\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { render } from \"ink\";\nimport React from \"react\";\nimport { writeConfig, readConfig, getConfigPath } from \"../config.js\";\nimport { GithubAppStep } from \"../components/init/GithubAppStep.js\";\n\ntype Repo = {\n\towner: string;\n\tname: string;\n\tid?: string;\n};\n\nexport const initCommand = new Command(\"init\")\n\t.description(\"Initialize Codowave and connect your GitHub repositories\")\n\t.action(async () => {\n\t\tconst existingConfig = readConfig();\n\t\tconst defaultApiUrl = \"https://api.codowave.com\";\n\t\tconst apiUrl = existingConfig?.apiUrl || defaultApiUrl;\n\n\t\t// If already initialized, ask if they want to reconfigure\n\t\tif (existingConfig?.apiKey) {\n\t\t\tconsole.log(pc.yellow(\"\\n⚠ Codowave is already initialized.\\n\"));\n\t\t\tconsole.log(` API URL: ${pc.cyan(existingConfig.apiUrl)}`);\n\t\t\tconsole.log(` Config: ${getConfigPath()}`);\n\t\t\tconsole.log(pc.gray(\"\\n Run this command again to reconfigure.\\n\"));\n\t\t\treturn;\n\t\t}\n\n\t\tlet wizardComplete = false;\n\t\tlet capturedApiKey = \"\";\n\t\tlet capturedRepos: Repo[] = [];\n\n\t\tconst { waitUntilExit } = render(\n\t\t\t<GithubAppStep\n\t\t\t\tapiUrl={apiUrl}\n\t\t\t\tonComplete={(apiKey, repos) => {\n\t\t\t\t\tcapturedApiKey = apiKey;\n\t\t\t\t\tcapturedRepos = repos;\n\t\t\t\t\twizardComplete = true;\n\t\t\t\t}}\n\t\t\t\tonCancel={() => {\n\t\t\t\t\tprocess.exit(0);\n\t\t\t\t}}\n\t\t\t/>\n\t\t);\n\n\t\tawait waitUntilExit();\n\n\t\tif (!wizardComplete) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Save the configuration\n\t\twriteConfig({\n\t\t\tapiKey: capturedApiKey,\n\t\t\tapiUrl: apiUrl,\n\t\t\trepos: capturedRepos,\n\t\t});\n\n\t\tconsole.log(pc.green(\"\\n✓ Initialization complete!\"));\n\t\tconsole.log(`\\n Config saved to: ${pc.cyan(getConfigPath())}`);\n\t\tconsole.log(` API URL: ${pc.cyan(apiUrl)}`);\n\t\tconsole.log(` Repositories: ${pc.bold(capturedRepos.length)} configured\\n`);\n\t\tconsole.log(pc.gray(\" Run \") + pc.bold(\"codowave run\") + pc.gray(\" to start coding!\\n\"));\n\t});\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, type CodowaveConfig } from \"../config.js\";\nimport { getRun, type RunStatus, type RunStage } from \"./status.js\";\n\n// Demo runs store (in production, this would be from API)\nconst demoRuns: Map<string, RunStatus> = new Map();\n\nfunction parseIssue(input: string): { owner: string; repo: string; number: number } | null {\n // Match: https://github.com/owner/repo/issues/123\n const urlMatch = input.match(/github\\.com\\/([^/]+)\\/([^/]+)\\/issues\\/(\\d+)/);\n if (urlMatch && urlMatch[1] && urlMatch[2] && urlMatch[3]) {\n return { owner: urlMatch[1], repo: urlMatch[2], number: parseInt(urlMatch[3], 10) };\n }\n\n // Match: owner/repo#123\n const repoMatch = input.match(/([^/]+)\\/([^#]+)#(\\d+)/);\n if (repoMatch && repoMatch[1] && repoMatch[2] && repoMatch[3]) {\n return { owner: repoMatch[1], repo: repoMatch[2], number: parseInt(repoMatch[3], 10) };\n }\n\n // Match: just issue number (123)\n const numMatch = input.match(/^(\\d+)$/);\n if (numMatch && numMatch[1]) {\n return { owner: \"\", repo: \"\", number: parseInt(numMatch[1], 10) };\n }\n\n return null;\n}\n\nasync function triggerRun(\n config: CodowaveConfig,\n issue: { owner: string; repo: string; number: number }\n): Promise<string> {\n const apiUrl = config.apiUrl;\n const apiKey = config.apiKey;\n\n // Find repo in config\n const repoConfig = config.repos.find(\n (r) => r.owner === issue.owner && r.name === issue.repo\n );\n\n if (!repoConfig) {\n throw new Error(\n `Repository ${issue.owner}/${issue.repo} not configured. Run \\`codowave config add-repo ${issue.owner}/${issue.repo}\\``\n );\n }\n\n // Call the API to trigger a run\n const response = await fetch(`${apiUrl}/api/runs`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: `Bearer ${apiKey}`,\n },\n body: JSON.stringify({\n repositoryId: repoConfig.id,\n issueNumber: issue.number,\n }),\n });\n\n if (!response.ok) {\n const error = await response.text();\n throw new Error(`Failed to trigger run: ${response.status} ${error}`);\n }\n\n const data = await response.json() as { runId: string };\n return data.runId;\n}\n\nfunction createDemoRun(issue: { owner: string; repo: string; number: number }): RunStatus {\n const runId = `run-${Date.now()}`;\n const run: RunStatus = {\n id: runId,\n repo: issue.owner && issue.repo ? `${issue.owner}/${issue.repo}` : \"CodowaveAI/Codowave\",\n status: \"in_progress\",\n issue: `#${issue.number}`,\n branchName: `agent/issue-${issue.number}`,\n startedAt: new Date().toISOString(),\n stages: [\n { name: \"context\", status: \"pending\" },\n { name: \"planning\", status: \"pending\" },\n { name: \"implementation\", status: \"pending\" },\n { name: \"testing\", status: \"pending\" },\n { name: \"pr-creation\", status: \"pending\" },\n ],\n };\n demoRuns.set(runId, run);\n return run;\n}\n\nfunction streamDemoRun(run: RunStatus) {\n // Simulate SSE streaming with demo data\n const stages = [\"context\", \"planning\", \"implementation\", \"testing\", \"pr-creation\"];\n let currentStage = 0;\n\n console.log(pc.bold(\"\\n=== Starting Run ===\\n\"));\n console.log(pc.bold(\"Run ID: \") + run.id);\n console.log(pc.bold(\"Repo: \") + run.repo);\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Branch: \") + run.branchName);\n console.log(\"\");\n\n const interval = setInterval(() => {\n if (currentStage >= stages.length) {\n clearInterval(interval);\n \n // Mark run as completed\n run.status = \"completed\";\n run.completedAt = new Date().toISOString();\n run.prNumber = 100 + Math.floor(Math.random() * 50);\n run.prTitle = `feat: Implement issue #${run.issue}`;\n \n console.log(pc.green(\"\\n✓ Run completed successfully!\"));\n console.log(pc.bold(\"\\n=== Result ===\\n\"));\n console.log(pc.bold(\"PR: \") + `#${run.prNumber} - ${run.prTitle}`);\n console.log(pc.bold(\"Branch: \") + run.branchName);\n console.log(\"\");\n process.exit(0);\n return;\n }\n\n const stageName = stages[currentStage];\n const stage = run.stages.find((s) => s.name === stageName);\n \n if (stage) {\n stage.status = \"running\";\n \n // Show stage progress\n console.log(pc.blue(`\\n--- ${stageName} ---`));\n \n // Simulate work and mark complete\n setTimeout(() => {\n stage.status = \"completed\";\n stage.logs = `${stageName} completed successfully`;\n \n // Move to next stage\n currentStage++;\n }, 1000 + Math.random() * 2000);\n } else {\n currentStage++;\n }\n }, 500);\n\n // Handle Ctrl+C\n process.on(\"SIGINT\", () => {\n clearInterval(interval);\n run.status = \"cancelled\";\n console.log(pc.yellow(\"\\n\\n⚠ Run cancelled\"));\n process.exit(1);\n });\n}\n\nexport const runCommand = new Command(\"run\")\n .description(\"Trigger Codowave to process a GitHub issue\")\n .argument(\"<issue>\", \"GitHub issue number, URL (https://github.com/owner/repo/issues/123), or owner/repo#123\")\n .option(\"-r, --repo <owner/repo>\", \"Target repository (e.g. owner/repo)\")\n .option(\"-s, --stream\", \"Stream run progress (SSE)\", false)\n .action(async (_issueArg: string, _options: { repo?: string; stream?: boolean }) => {\n try {\n // Parse the issue\n const parsed = parseIssue(_issueArg);\n \n if (!parsed) {\n console.error(pc.red(\"Invalid issue format. Use:\"));\n console.error(\" - Issue number: 123\");\n console.error(\" - Full URL: https://github.com/owner/repo/issues/123\");\n console.error(\" - Short form: owner/repo#123\");\n process.exit(1);\n }\n\n // If repo is specified via option, override\n if (_options.repo) {\n const parts = _options.repo.split(\"/\");\n const owner = parts[0] || \"\";\n const repo = parts[1] || \"\";\n parsed.owner = owner;\n parsed.repo = repo;\n }\n\n // Try to read config\n let config: CodowaveConfig | null = null;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n // Check if we have a real config (API mode) or running in demo mode\n if (config && config.apiKey && config.repos.length > 0) {\n // Real API mode\n console.log(pc.blue(\"Connecting to Codowave API...\"));\n \n // Validate repo is configured\n if (!parsed.owner || !parsed.repo) {\n console.error(pc.red(\"Repository required. Use -r option or include in issue URL.\"));\n process.exit(1);\n }\n\n const runId = await triggerRun(config, parsed);\n console.log(pc.green(`✓ Run triggered: ${runId}`));\n \n if (_options.stream) {\n console.log(pc.blue(\"\\nStreaming run progress...\"));\n // In production, this would connect to SSE endpoint\n // const eventSource = new EventSource(`${config.apiUrl}/api/runs/${runId}/events`);\n } else {\n console.log(pc.gray(`\\nRun started. Use \\`codowave status ${runId}\\` to check progress.`));\n }\n } else {\n // Demo mode\n console.log(pc.yellow(\"⚠ No config found. Running in demo mode.\\n\"));\n \n const run = createDemoRun(parsed);\n \n if (_options.stream || !process.stdout.isTTY) {\n // Stream mode\n streamDemoRun(run);\n } else {\n // Non-stream mode - just show the run info\n console.log(pc.green(`✓ Run started: ${run.id}`));\n console.log(pc.gray(`\\nUse \\`codowave status ${run.id}\\` to check progress.`));\n console.log(pc.gray(`Use \\`codowave logs ${run.id} -f\\` to follow logs.`));\n }\n }\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(`\\n✖ Error: ${message}\\n`));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig } from \"../config.js\";\n\n// In-memory run store for demo (would be API calls in production)\nexport interface RunStatus {\n id: string;\n repo: string;\n status: \"pending\" | \"in_progress\" | \"completed\" | \"failed\" | \"cancelled\";\n issue: string;\n prNumber?: number;\n prTitle?: string;\n branchName?: string;\n startedAt?: string;\n completedAt?: string;\n errorMessage?: string;\n stages: RunStage[];\n}\n\nexport interface RunStage {\n name: string;\n status: \"pending\" | \"running\" | \"completed\" | \"failed\" | \"skipped\";\n logs?: string;\n}\n\n// Demo data store (would be API in production)\nconst demoRuns: Map<string, RunStatus> = new Map();\n\n// Initialize with some demo data\nfunction initDemoData() {\n if (demoRuns.size === 0) {\n const demoRun: RunStatus = {\n id: \"latest\",\n repo: \"CodowaveAI/Codowave\",\n status: \"in_progress\",\n issue: \"#53: Implement CLI status and logs commands\",\n branchName: \"agent/issue-53\",\n startedAt: new Date(Date.now() - 5 * 60 * 1000).toISOString(),\n stages: [\n { name: \"context\", status: \"completed\", logs: \"Loaded 12 files, 3 PRs context\" },\n { name: \"planning\", status: \"completed\", logs: \"Generated implementation plan\" },\n { name: \"implementation\", status: \"running\", logs: \"Implementing status command...\" },\n { name: \"testing\", status: \"pending\" },\n { name: \"pr-creation\", status: \"pending\" },\n ],\n };\n demoRuns.set(demoRun.id, demoRun);\n \n // Also add a completed run\n const completedRun: RunStatus = {\n id: \"abc-123-def\",\n repo: \"CodowaveAI/Codowave\",\n status: \"completed\",\n issue: \"#52: Add authentication flow\",\n prNumber: 78,\n prTitle: \"feat: Add OAuth authentication flow\",\n branchName: \"feat/auth-flow\",\n startedAt: new Date(Date.now() - 60 * 60 * 1000).toISOString(),\n completedAt: new Date(Date.now() - 45 * 60 * 1000).toISOString(),\n stages: [\n { name: \"context\", status: \"completed\" },\n { name: \"planning\", status: \"completed\" },\n { name: \"implementation\", status: \"completed\" },\n { name: \"testing\", status: \"completed\" },\n { name: \"pr-creation\", status: \"completed\" },\n ],\n };\n demoRuns.set(completedRun.id, completedRun);\n }\n}\n\nexport function getRun(runId?: string): RunStatus | undefined {\n initDemoData();\n if (!runId) {\n // Return most recent run\n return Array.from(demoRuns.values()).sort((a, b) => \n new Date(b.startedAt || 0).getTime() - new Date(a.startedAt || 0).getTime()\n )[0];\n }\n return demoRuns.get(runId);\n}\n\nfunction formatStatus(status: RunStatus[\"status\"]): string {\n switch (status) {\n case \"pending\":\n return pc.gray(\"pending\");\n case \"in_progress\":\n return pc.blue(\"in_progress\");\n case \"completed\":\n return pc.green(\"completed\");\n case \"failed\":\n return pc.red(\"failed\");\n case \"cancelled\":\n return pc.gray(\"cancelled\");\n default:\n return pc.gray(status);\n }\n}\n\nfunction formatStageStatus(status: RunStage[\"status\"]): string {\n switch (status) {\n case \"pending\":\n return pc.gray(\"[ ]\");\n case \"running\":\n return pc.blue(\"[~]\");\n case \"completed\":\n return pc.green(\"[+]\");\n case \"failed\":\n return pc.red(\"[x]\");\n case \"skipped\":\n return pc.gray(\"[-]\");\n default:\n return pc.gray(\"[?]\");\n }\n}\n\nfunction formatDuration(startedAt?: string, completedAt?: string): string {\n if (!startedAt) return \"\";\n const start = new Date(startedAt).getTime();\n const end = completedAt ? new Date(completedAt).getTime() : Date.now();\n const seconds = Math.floor((end - start) / 1000);\n \n if (seconds < 60) return `${seconds}s`;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n if (minutes < 60) return `${minutes}m ${remainingSeconds}s`;\n const hours = Math.floor(minutes / 60);\n const remainingMinutes = minutes % 60;\n return `${hours}h ${remainingMinutes}m`;\n}\n\nexport const statusCommand = new Command(\"status\")\n .description(\"Show the status of a Codowave run\")\n .argument(\"[run-id]\", \"Run ID (defaults to latest)\")\n .option(\"-r, --repo <owner/repo>\", \"Filter by repository\")\n .action(async (_runId?: string, _options?: { repo?: string }) => {\n try {\n // Try to read config (for future API integration)\n let config;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n const run = getRun(_runId);\n \n if (!run) {\n console.log(pc.yellow(\"No runs found. Run `codowave run <issue>` to start a new run.\"));\n return;\n }\n\n // Filter by repo if specified\n if (_options?.repo && run.repo !== _options.repo) {\n console.log(pc.yellow(\"No run found for repository \" + _options.repo));\n return;\n }\n\n console.log(pc.bold(\"\\n=== Run Status ===\\n\"));\n console.log(pc.bold(\"ID: \") + run.id);\n console.log(pc.bold(\"Repo: \") + run.repo);\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Status: \") + formatStatus(run.status));\n console.log(pc.bold(\"Branch: \") + (run.branchName || pc.gray(\"(none)\")));\n \n if (run.prNumber) {\n console.log(pc.bold(\"PR: \") + \"#\" + run.prNumber + \" - \" + (run.prTitle || \"\"));\n }\n \n if (run.startedAt) {\n console.log(pc.bold(\"Started: \") + new Date(run.startedAt).toLocaleString());\n }\n \n if (run.completedAt) {\n console.log(pc.bold(\"Duration: \") + formatDuration(run.startedAt, run.completedAt));\n } else if (run.startedAt) {\n console.log(pc.bold(\"Duration: \") + pc.blue(\"running... \") + formatDuration(run.startedAt));\n }\n \n if (run.errorMessage) {\n console.log(pc.bold(\"Error: \") + pc.red(run.errorMessage));\n }\n\n console.log(pc.bold(\"\\n=== Stages ===\\n\"));\n for (const stage of run.stages) {\n const statusIcon = formatStageStatus(stage.status);\n const statusText = pc.bold(\"[\" + stage.status + \"]\");\n console.log(\" \" + statusIcon + \" \" + pc.bold(stage.name.padEnd(20)) + \" \" + statusText);\n }\n\n console.log(\"\");\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(\"\\n=== Error: \" + message + \" ===\\n\"));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig } from \"../config.js\";\nimport { getRun, type RunStatus } from \"./status.js\";\n\nexport const logsCommand = new Command(\"logs\")\n .description(\"Stream logs for a Codowave run\")\n .argument(\"[run-id]\", \"Run ID (defaults to latest)\")\n .option(\"-f, --follow\", \"Follow log output (SSE stream)\")\n .option(\"-s, --stage <name>\", \"Show logs for a specific stage\")\n .option(\"--no-color\", \"Disable colored output\")\n .action(async (_runId?: string, _options?: { follow?: boolean; stage?: string; color?: boolean }) => {\n try {\n // Try to read config (for future API integration)\n let config;\n try {\n config = readConfig();\n } catch {\n // Config not required for demo mode\n }\n\n const run: RunStatus | undefined = getRun(_runId);\n \n if (!run) {\n console.log(pc.yellow(\"No runs found. Run `codowave run <issue>` to start a new run.\"));\n return;\n }\n\n // If --stage is specified, show only that stage's logs\n if (_options?.stage) {\n const stage = run.stages.find((s: { name: string }) => s.name === _options.stage);\n if (!stage) {\n console.log(pc.red(\"Stage \\\"\" + _options.stage + \"\\\" not found.\"));\n console.log(pc.gray(\"Available stages: \") + run.stages.map((s: { name: string }) => s.name).join(\", \"));\n return;\n }\n \n console.log(pc.bold(\"\\n=== Logs: \" + stage.name + \" ===\\n\"));\n console.log(pc.bold(\"Status: \") + stage.status);\n \n if (stage.logs) {\n console.log(pc.gray(\"\\n--- Output ---\\n\"));\n console.log(stage.logs);\n } else {\n console.log(pc.gray(\"\\n(no logs available yet)\"));\n }\n \n // If following and stage is still running, simulate live logs\n if (_options.follow && stage.status === \"running\") {\n console.log(pc.blue(\"\\n--- Following live logs (Ctrl+C to exit) ---\\n\"));\n // In production, this would connect to SSE endpoint\n // For demo, we'll show a message\n console.log(pc.gray(\"(Live streaming would connect to API SSE endpoint in production)\"));\n }\n console.log(\"\");\n return;\n }\n\n // Otherwise show all stage logs\n console.log(pc.bold(\"\\n=== Logs: \" + run.id + \" ===\\n\"));\n console.log(pc.bold(\"Issue: \") + run.issue);\n console.log(pc.bold(\"Status: \") + run.status);\n console.log(\"\");\n\n for (const stage of run.stages) {\n const statusIcon = stage.status === \"completed\" ? \"[+]\" : \n stage.status === \"failed\" ? \"[x]\" :\n stage.status === \"running\" ? \"[~]\" : \"[ ]\";\n \n console.log(pc.bold(\"\\n\" + statusIcon + \" \" + stage.name + \"\\n\"));\n \n if (stage.logs) {\n console.log(stage.logs);\n } else if (stage.status === \"pending\") {\n console.log(pc.gray(\"(pending)\"));\n } else if (stage.status === \"running\") {\n console.log(pc.blue(\"(running...)\"));\n } else if (stage.status === \"skipped\") {\n console.log(pc.gray(\"(skipped)\"));\n }\n }\n\n // If following and run is still in progress, simulate live output\n if (_options?.follow && run.status === \"in_progress\") {\n console.log(pc.blue(\"\\n--- Following live logs (Ctrl+C to exit) ---\\n\"));\n // In production, this would connect to SSE endpoint\n console.log(pc.gray(\"(Live streaming would connect to API SSE endpoint in production)\"));\n \n // Simulate periodic updates (for demo purposes)\n let dots = 0;\n const interval = setInterval(() => {\n dots = (dots + 1) % 4;\n process.stdout.write(pc.blue(\"\\r\" + \" \".repeat(dots) + \" waiting for updates...\"));\n }, 500);\n \n // Handle Ctrl+C\n process.on(\"SIGINT\", () => {\n clearInterval(interval);\n console.log(pc.gray(\"\\n\\n(Stopped following)\"));\n process.exit(0);\n });\n }\n\n console.log(\"\");\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(\"\\n=== Error: \" + message + \" ===\\n\"));\n process.exit(1);\n }\n });\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, readConfigOrThrow, updateConfig, getConfigPath } from \"../config.js\";\n\nexport const configCommand = new Command(\"config\")\n .description(\"Get or set Codowave configuration values\");\n\n// List all available config options\nconfigCommand\n .command(\"list\")\n .description(\"List all available config options\")\n .action(() => {\n console.log(pc.bold(\"\\n📋 Available Config Options:\\n\"));\n console.log(` ${pc.cyan(\"apiKey\")} ${pc.gray(\"— Your Codowave API key\")}`);\n console.log(` ${pc.cyan(\"apiUrl\")} ${pc.gray(\"— API endpoint URL (default: https://api.codowave.com)\")}`);\n console.log(` ${pc.cyan(\"repos\")} ${pc.gray(\"— List of configured repositories\")}`);\n console.log(` ${pc.cyan(\"configPath\")} ${pc.gray(\"— Path to the config file\")}`);\n console.log(\"\");\n });\n\n// Get a config value\nconfigCommand\n .command(\"get <key>\")\n .description(\"Get a config value\")\n .action((key: string) => {\n try {\n const config = readConfigOrThrow();\n \n // Special case for configPath\n if (key === \"configPath\") {\n console.log(pc.green(getConfigPath()));\n return;\n }\n \n // Special case for repos - show nicely formatted\n if (key === \"repos\") {\n if (config.repos.length === 0) {\n console.log(pc.yellow(\"No repos configured.\"));\n } else {\n console.log(pc.bold(\"\\n📦 Configured Repositories:\\n\"));\n config.repos.forEach((repo, index) => {\n console.log(` ${index + 1}. ${pc.cyan(`${repo.owner}/${repo.name}`)}`);\n if (repo.id) {\n console.log(` ${pc.gray(\"ID: \" + repo.id)}`);\n }\n });\n console.log(\"\");\n }\n return;\n }\n \n // Get a specific key\n const value = config[key as keyof typeof config];\n \n if (value === undefined) {\n console.error(pc.red(`✖ Unknown config key: ${key}`));\n console.log(pc.gray(` Run \\`codowave config list\\` to see available options.`));\n process.exit(1);\n }\n \n console.log(value);\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Set a config value\nconfigCommand\n .command(\"set <key> <value>\")\n .description(\"Set a config value\")\n .action((key: string, value: string) => {\n try {\n // Validate the key\n const validKeys = [\"apiKey\", \"apiUrl\"];\n if (!validKeys.includes(key)) {\n console.error(pc.red(`✖ Cannot set '${key}' directly.`));\n console.log(pc.gray(` For 'repos', use \\`codowave init\\` to manage repositories.`));\n console.log(pc.gray(` Run \\`codowave config list\\` to see available options.`));\n process.exit(1);\n }\n \n // Validate apiUrl if provided\n if (key === \"apiUrl\") {\n try {\n new URL(value);\n } catch {\n console.error(pc.red(`✖ Invalid URL: ${value}`));\n process.exit(1);\n }\n }\n \n const updates = { [key]: value };\n const newConfig = updateConfig(updates);\n \n console.log(pc.green(`✓ Updated ${key}`));\n \n // Show the new value\n console.log(pc.gray(` ${key} = ${newConfig[key as keyof typeof newConfig]}`));\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Show all current config values (alias for showing full config)\nconfigCommand\n .command(\"show\")\n .description(\"Show all current config values\")\n .action(() => {\n try {\n const config = readConfigOrThrow();\n \n console.log(pc.bold(\"\\n⚙️ Current Configuration:\\n\"));\n console.log(` ${pc.cyan(\"apiKey\")}: ${config.apiKey ? pc.green(\"••••••••\") + pc.gray(\" (hidden)\") : pc.yellow(\"not set\")}`);\n console.log(` ${pc.cyan(\"apiUrl\")}: ${config.apiUrl}`);\n console.log(` ${pc.cyan(\"repos\")}: ${config.repos.length} repository(s) configured`);\n console.log(` ${pc.cyan(\"configPath\")}: ${pc.gray(getConfigPath())}`);\n \n if (config.repos.length > 0) {\n console.log(pc.bold(pc.gray(\"\\n Repositories:\")));\n config.repos.forEach((repo) => {\n console.log(` • ${repo.owner}/${repo.name}${repo.id ? pc.gray(` (${repo.id})`) : \"\"}`);\n });\n }\n \n console.log(\"\");\n } catch (err) {\n console.error(pc.red(`✖ ${err instanceof Error ? err.message : String(err)}`));\n process.exit(1);\n }\n });\n\n// Default action when just 'config' is run - show help\nconfigCommand.action(() => {\n configCommand.help();\n});\n","import { Command } from \"commander\";\nimport pc from \"picocolors\";\nimport { readConfig, updateConfig, getConfigPath } from \"../config.js\";\n\nconst PRO_API_URL = \"https://api.codowave.com\";\nconst PRO_AUTH_URL = \"https://codowave.com/api/auth/device\";\nconst PRO_TOKEN_URL = \"https://codowave.com/api/auth/token\";\n\nexport const connectCommand = new Command(\"connect\")\n .description(\"Connect to Codowave Pro (upgrade from OSS)\")\n .action(async () => {\n try {\n console.log(pc.bold(\"\\n🔗 Codowave Connect\\n\"));\n console.log(pc.gray(\"This command upgrades your OSS installation to Codowave Pro.\\n\"));\n\n // Check current config\n const config = readConfig();\n const isAlreadyPro = config?.apiUrl === PRO_API_URL;\n\n if (isAlreadyPro) {\n console.log(pc.green(\"✓ You are already connected to Codowave Pro!\"));\n console.log(pc.gray(` API URL: ${config?.apiUrl}`));\n console.log(\"\");\n return;\n }\n\n // Start OAuth device flow\n console.log(pc.blue(\"Starting OAuth device flow...\\n\"));\n\n // In a real implementation, this would:\n // 1. Call PRO_AUTH_URL to get device_code, user_code, verification_uri\n // 2. Display user_code and verification_uri for user to enter in browser\n // 3. Poll PRO_TOKEN_URL until user authorizes\n // 4. Get access_token and store in config\n\n // For now, simulate the flow\n console.log(pc.gray(\" 1. Requesting device code...\"));\n \n // Simulate API call (would be real fetch in production)\n const deviceCode = `CODOWAVE-${Date.now().toString(36).toUpperCase()}`;\n const verificationUri = \"https://codowave.com/activate\";\n \n console.log(pc.green(\"\\n ⚠️ Device Code: \") + pc.bold(deviceCode));\n console.log(pc.gray(\"\\n 2. Please visit: \") + pc.cyan(verificationUri));\n console.log(pc.gray(\" and enter the device code above.\\n\"));\n \n console.log(pc.yellow(\" ℹ️ This is a stub implementation.\"));\n console.log(pc.gray(\" In production, this would poll for OAuth completion.\\n\"));\n\n // For demo purposes, let's just show what would happen\n console.log(pc.blue(\" 3. Would save Pro token and switch API URL...\\n\"));\n \n // Actually, let's not modify config in demo mode - just show what would happen\n console.log(pc.bold(\"What would happen:\\n\"));\n console.log(` • Save Pro API token to ${getConfigPath()}`);\n console.log(` • Set apiUrl to ${PRO_API_URL}`);\n console.log(\"\");\n \n console.log(pc.gray(\"Run with \") + pc.cyan(\"CODOWAVE_CONNECT=1\") + pc.gray(\" to enable (not implemented yet)\"));\n console.log(\"\");\n\n } catch (err) {\n const message = err instanceof Error ? err.message : String(err);\n console.error(pc.red(`\\n✖ Error: ${message}\\n`));\n process.exit(1);\n }\n });\n\n/**\n * Actually perform the connection (used after OAuth success)\n * This would be called internally after OAuth polling succeeds\n */\nexport async function performConnect(accessToken: string): Promise<void> {\n const config = updateConfig({\n apiKey: accessToken,\n apiUrl: PRO_API_URL,\n });\n \n console.log(pc.green(\"✓ Connected to Codowave Pro!\"));\n console.log(pc.gray(` API URL: ${config.apiUrl}`));\n}\n","import { Command } from 'commander'\nimport { readConfig } from './config'\n\n// Read version from package.json\nimport { createRequire } from 'module'\nconst require = createRequire(import.meta.url)\nconst { version } = require('../package.json')\n\nconst VERSION = version\n\nconst program = new Command()\n\nprogram\n .name('codowave')\n .description('Codowave OSS CLI — AI-powered coding agent for your GitHub repositories')\n .version(VERSION, '-v, --version', 'Output the current version')\n .option('--api-url <url>', 'Override the Codowave API URL')\n\n// Lazy import commands for better performance\nconst { initCommand } = await import('./commands/init.js')\nconst { runCommand } = await import('./commands/run.js')\nconst { statusCommand } = await import('./commands/status.js')\nconst { logsCommand } = await import('./commands/logs.js')\nconst { configCommand } = await import('./commands/config-cmd.js')\nconst { connectCommand } = await import('./commands/connect.js')\n\nprogram.addCommand(initCommand)\nprogram.addCommand(runCommand)\nprogram.addCommand(statusCommand)\nprogram.addCommand(logsCommand)\nprogram.addCommand(configCommand)\nprogram.addCommand(connectCommand)\n\nconst args = process.argv.slice(2)\nconst isInitOrHelp = args[0] === 'init' || args.includes('--help') || args.includes('-h') || args.includes('--version') || args.includes('-v') || args.length === 0\n\nif (!isInitOrHelp) {\n const config = await readConfig()\n if (!config?.apiUrl) {\n console.log('\\n❌ Codowave not initialized. Run: codowave init\\n')\n process.exit(1)\n }\n}\n\nprogram.parse()\n"],"mappings":";;;;;;;;;;;AAAA,SAAS,cAAc,eAAe,WAAW,kBAAkB;AACnE,SAAS,YAAY;AACrB,SAAS,eAAe;AACxB,SAAS,SAAS;AAqCX,SAAS,aAAoC;AAClD,MAAI,CAAC,WAAW,WAAW,GAAG;AAC5B,WAAO;AAAA,EACT;AAEA,MAAI;AACF,UAAM,MAAM,aAAa,aAAa,OAAO;AAC7C,UAAM,OAAO,KAAK,MAAM,GAAG;AAC3B,UAAM,SAAS,aAAa,UAAU,IAAI;AAE1C,QAAI,CAAC,OAAO,SAAS;AACnB,aAAO;AAAA,IACT;AAEA,WAAO,OAAO;AAAA,EAChB,SAAS,KAAK;AACZ,YAAQ,KAAK,4BAA4B,WAAW,KAAK,GAAG;AAC5D,WAAO;AAAA,EACT;AACF;AAEO,SAAS,oBAAoC;AAClD,QAAM,SAAS,WAAW;AAC1B,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AACA,SAAO;AACT;AAIO,SAAS,YAAY,QAA8B;AACxD,MAAI,CAAC,WAAW,UAAU,GAAG;AAC3B,cAAU,YAAY,EAAE,WAAW,KAAK,CAAC;AAAA,EAC3C;AAEA,gBAAc,aAAa,KAAK,UAAU,QAAQ,M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AK,CAAC;AAAA,EAChB;AACF;AAEA,QAAQ,MAAM;","names":["pc","jsx","Command","pc","Command","pc","demoRuns","Command","pc","Command","pc","Command","pc","Command","require","initCommand","runCommand","statusCommand","logsCommand","configCommand","connectCommand"]}
|
package/package.json
CHANGED
package/dist/cli.js
DELETED