kanban 0.1.13 → 0.1.14

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/cli.js CHANGED
@@ -182,7 +182,11 @@ async function tryOpenExistingServer(noOpen) {
182
182
  console.log(`Kanban already running at ${getKanbanRuntimeOrigin()}`);
183
183
  if (!noOpen) {
184
184
  try {
185
- openInBrowser(projectUrl);
185
+ openInBrowser(projectUrl, {
186
+ warn: (message) => {
187
+ console.warn(message);
188
+ },
189
+ });
186
190
  }
187
191
  catch (error) {
188
192
  const message = error instanceof Error ? error.message : String(error);
@@ -363,7 +367,11 @@ async function runMainCommand(options) {
363
367
  console.log(`Kanban running at ${runtime.url}`);
364
368
  if (!options.noOpen) {
365
369
  try {
366
- openInBrowser(runtime.url);
370
+ openInBrowser(runtime.url, {
371
+ warn: (message) => {
372
+ console.warn(message);
373
+ },
374
+ });
367
375
  }
368
376
  catch (error) {
369
377
  const message = error instanceof Error ? error.message : String(error);
package/dist/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2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awn, spawnSync } from \"node:child_process\";\nimport { stat } from \"node:fs/promises\";\nimport { createServer as createNetServer } from \"node:net\";\nimport { Command } from \"commander\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\nimport { registerHooksCommand } from \"./commands/hooks.js\";\nimport { registerTaskCommand } from \"./commands/task.js\";\nimport { loadRuntimeConfig, updateRuntimeConfig } from \"./config/runtime-config.js\";\nimport type { RuntimeAgentId, RuntimeCommandRunResponse } from \"./core/api-contract.js\";\nimport { createGitProcessEnv } from \"./core/git-process-env.js\";\nimport {\n\tbuildKanbanRuntimeUrl,\n\tDEFAULT_KANBAN_RUNTIME_PORT,\n\tgetKanbanRuntimeOrigin,\n\tgetKanbanRuntimePort,\n\tparseRuntimePort,\n\tsetKanbanRuntimePort,\n} from \"./core/runtime-endpoint.js\";\nimport { resolveProjectInputPath } from \"./projects/project-path.js\";\nimport { openInBrowser } from \"./server/browser.js\";\nimport { createRuntimeServer } from \"./server/runtime-server.js\";\nimport { createRuntimeStateHub } from \"./server/runtime-state-hub.js\";\nimport { resolveInteractiveShellCommand } from \"./server/shell.js\";\nimport { shutdownRuntimeServer } from \"./server/shutdown-coordinator.js\";\nimport { collectProjectWorktreeTaskIdsForRemoval, createWorkspaceRegistry } from \"./server/workspace-registry.js\";\nimport { installKanbanSkillFiles, resolveKanbanSkillCommandPrefix } from \"./skills/kanban-skill.js\";\nimport { loadWorkspaceContext } from \"./state/workspace-state.js\";\nimport { detectInstalledCommands } from \"./terminal/agent-registry.js\";\nimport type { TerminalSessionManager } from \"./terminal/session-manager.js\";\nimport { autoUpdateOnStartup, runPendingAutoUpdateOnShutdown } from \"./update/auto-update.js\";\n\ninterface CliOptions {\n\tnoOpen: boolean;\n\tskipShutdownCleanup: boolean;\n\tagent: RuntimeAgentId | null;\n\tport: { mode: \"fixed\"; value: number } | { mode: \"auto\" } | null;\n}\n\nconst CLI_AGENT_IDS: readonly RuntimeAgentId[] = [\"claude\", \"codex\", \"gemini\", \"opencode\", \"droid\", \"cline\"];\nconst KANBAN_VERSION = typeof packageJson.version === \"string\" ? packageJson.version : \"0.1.0\";\n\nfunction parseCliAgentId(value: string): RuntimeAgentId {\n\tconst normalized = value.trim().toLowerCase();\n\tif (\n\t\tnormalized === \"claude\" ||\n\t\tnormalized === \"codex\" ||\n\t\tnormalized === \"gemini\" ||\n\t\tnormalized === \"opencode\" ||\n\t\tnormalized === \"droid\" ||\n\t\tnormalized === \"cline\"\n\t) {\n\t\treturn normalized;\n\t}\n\tthrow new Error(`Invalid agent: ${value}. Expected one of: ${CLI_AGENT_IDS.join(\", \")}`);\n}\n\nfunction parseCliPortValue(rawValue: string): { mode: \"fixed\"; value: number } | { mode: \"auto\" } {\n\tconst normalized = rawValue.trim().toLowerCase();\n\tif (!normalized) {\n\t\tthrow new Error(\"Missing value for --port.\");\n\t}\n\tif (normalized === \"auto\") {\n\t\treturn { mode: \"auto\" };\n\t}\n\ttry {\n\t\treturn { mode: \"fixed\", value: parseRuntimePort(normalized) };\n\t} catch {\n\t\tthrow new Error(`Invalid port value: ${rawValue}. Expected an integer from 1-65535 or \"auto\".`);\n\t}\n}\n\ninterface RootCommandOptions {\n\tagent?: RuntimeAgentId;\n\tport?: { mode: \"fixed\"; value: number } | { mode: \"auto\" };\n\topen?: boolean;\n\tskipShutdownCleanup?: boolean;\n}\n\nasync function isPortAvailable(port: number): Promise<boolean> {\n\treturn await new Promise<boolean>((resolve) => {\n\t\tconst probe = createNetServer();\n\t\tprobe.once(\"error\", () => {\n\t\t\tresolve(false);\n\t\t});\n\t\tprobe.listen(port, \"127.0.0.1\", () => {\n\t\t\tprobe.close(() => {\n\t\t\t\tresolve(true);\n\t\t\t});\n\t\t});\n\t});\n}\n\nasync function findAvailableRuntimePort(startPort: number): Promise<number> {\n\tfor (let candidate = startPort; candidate <= 65535; candidate += 1) {\n\t\tif (await isPortAvailable(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\tthrow new Error(\"No available runtime port found.\");\n}\n\nasync function applyRuntimePortOption(portOption: CliOptions[\"port\"]): Promise<number | null> {\n\tif (!portOption) {\n\t\treturn null;\n\t}\n\tif (portOption.mode === \"fixed\") {\n\t\tsetKanbanRuntimePort(portOption.value);\n\t\treturn portOption.value;\n\t}\n\tconst autoPort = await findAvailableRuntimePort(DEFAULT_KANBAN_RUNTIME_PORT);\n\tsetKanbanRuntimePort(autoPort);\n\treturn autoPort;\n}\n\nasync function persistCliAgentSelection(cwd: string, selectedAgentId: RuntimeAgentId): Promise<boolean> {\n\tconst currentRuntimeConfig = await loadRuntimeConfig(cwd);\n\tif (currentRuntimeConfig.selectedAgentId === selectedAgentId) {\n\t\treturn false;\n\t}\n\tawait updateRuntimeConfig(cwd, { selectedAgentId });\n\treturn true;\n}\n\nasync function assertPathIsDirectory(path: string): Promise<void> {\n\tconst info = await stat(path);\n\tif (!info.isDirectory()) {\n\t\tthrow new Error(`Project path is not a directory: ${path}`);\n\t}\n}\n\nasync function pathIsDirectory(path: string): Promise<boolean> {\n\ttry {\n\t\tconst info = await stat(path);\n\t\treturn info.isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction hasGitRepository(path: string): boolean {\n\tconst result = spawnSync(\"git\", [\"rev-parse\", \"--is-inside-work-tree\"], {\n\t\tcwd: path,\n\t\tencoding: \"utf8\",\n\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\tenv: createGitProcessEnv(),\n\t});\n\treturn result.status === 0 && result.stdout.trim() === \"true\";\n}\n\nfunction pickDirectoryPathFromSystemDialog(): string | null {\n\tif (process.platform === \"darwin\") {\n\t\tconst result = spawnSync(\n\t\t\t\"osascript\",\n\t\t\t[\"-e\", 'POSIX path of (choose folder with prompt \"Select a project folder\")'],\n\t\t\t{\n\t\t\t\tencoding: \"utf8\",\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\t},\n\t\t);\n\t\tif (result.status !== 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst selected = typeof result.stdout === \"string\" ? result.stdout.trim() : \"\";\n\t\treturn selected || null;\n\t}\n\n\tif (process.platform === \"linux\") {\n\t\tconst result = spawnSync(\"zenity\", [\"--file-selection\", \"--directory\", \"--title=Select project folder\"], {\n\t\t\tencoding: \"utf8\",\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t});\n\t\tif (result.status !== 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst selected = typeof result.stdout === \"string\" ? result.stdout.trim() : \"\";\n\t\treturn selected || null;\n\t}\n\n\treturn null;\n}\n\nfunction isAddressInUseError(error: unknown): error is NodeJS.ErrnoException {\n\treturn (\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t\"code\" in error &&\n\t\t(error as NodeJS.ErrnoException).code === \"EADDRINUSE\"\n\t);\n}\n\nasync function canReachKanbanServer(workspaceId: string | null): Promise<boolean> {\n\ttry {\n\t\tconst headers: Record<string, string> = {};\n\t\tif (workspaceId) {\n\t\t\theaders[\"x-kanban-workspace-id\"] = workspaceId;\n\t\t}\n\t\tconst response = await fetch(buildKanbanRuntimeUrl(\"/api/trpc/projects.list\"), {\n\t\t\tmethod: \"GET\",\n\t\t\theaders,\n\t\t\tsignal: AbortSignal.timeout(1_500),\n\t\t});\n\t\tif (response.status === 404) {\n\t\t\treturn false;\n\t\t}\n\t\tconst payload = (await response.json().catch(() => null)) as {\n\t\t\tresult?: { data?: unknown };\n\t\t\terror?: unknown;\n\t\t} | null;\n\t\treturn Boolean(payload && (payload.result || payload.error));\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function tryOpenExistingServer(noOpen: boolean): Promise<boolean> {\n\tlet workspaceId: string | null = null;\n\tif (hasGitRepository(process.cwd())) {\n\t\tconst context = await loadWorkspaceContext(process.cwd());\n\t\tworkspaceId = context.workspaceId;\n\t}\n\tconst running = await canReachKanbanServer(workspaceId);\n\tif (!running) {\n\t\treturn false;\n\t}\n\tconst projectUrl = workspaceId\n\t\t? buildKanbanRuntimeUrl(`/${encodeURIComponent(workspaceId)}`)\n\t\t: getKanbanRuntimeOrigin();\n\tconsole.log(`Kanban already running at ${getKanbanRuntimeOrigin()}`);\n\tif (!noOpen) {\n\t\ttry {\n\t\t\topenInBrowser(projectUrl);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`Could not open browser automatically: ${message}`);\n\t\t}\n\t}\n\tconsole.log(`Project URL: ${projectUrl}`);\n\treturn true;\n}\n\nasync function runScopedCommand(command: string, cwd: string): Promise<RuntimeCommandRunResponse> {\n\tconst startedAt = Date.now();\n\tconst outputLimitBytes = 64 * 1024;\n\n\treturn await new Promise<RuntimeCommandRunResponse>((resolve, reject) => {\n\t\tconst child = spawn(command, {\n\t\t\tcwd,\n\t\t\tshell: true,\n\t\t\tenv: process.env,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t});\n\n\t\tif (!child.stdout || !child.stderr) {\n\t\t\treject(new Error(\"Shortcut process did not expose stdout/stderr.\"));\n\t\t\treturn;\n\t\t}\n\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\n\t\tconst appendOutput = (current: string, chunk: string): string => {\n\t\t\tconst next = current + chunk;\n\t\t\tif (next.length <= outputLimitBytes) {\n\t\t\t\treturn next;\n\t\t\t}\n\t\t\treturn next.slice(0, outputLimitBytes);\n\t\t};\n\n\t\tchild.stdout.on(\"data\", (chunk: Buffer | string) => {\n\t\t\tstdout = appendOutput(stdout, String(chunk));\n\t\t});\n\n\t\tchild.stderr.on(\"data\", (chunk: Buffer | string) => {\n\t\t\tstderr = appendOutput(stderr, String(chunk));\n\t\t});\n\n\t\tchild.on(\"error\", (error) => {\n\t\t\treject(error);\n\t\t});\n\n\t\tconst timeout = setTimeout(() => {\n\t\t\tchild.kill(\"SIGTERM\");\n\t\t}, 60_000);\n\n\t\tchild.on(\"close\", (code) => {\n\t\t\tclearTimeout(timeout);\n\t\t\tconst exitCode = typeof code === \"number\" ? code : 1;\n\t\t\tconst combinedOutput = [stdout.trim(), stderr.trim()].filter(Boolean).join(\"\\n\");\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tstdout: stdout.trim(),\n\t\t\t\tstderr: stderr.trim(),\n\t\t\t\tcombinedOutput,\n\t\t\t\tdurationMs: Date.now() - startedAt,\n\t\t\t});\n\t\t});\n\t});\n}\n\nasync function startServer(): Promise<{\n\turl: string;\n\tclose: () => Promise<void>;\n\tshutdown: (options?: { skipSessionCleanup?: boolean }) => Promise<void>;\n}> {\n\tlet runtimeStateHub: ReturnType<typeof createRuntimeStateHub> | undefined;\n\tconst workspaceRegistry = await createWorkspaceRegistry({\n\t\tcwd: process.cwd(),\n\t\tloadRuntimeConfig,\n\t\thasGitRepository,\n\t\tpathIsDirectory,\n\t\tonTerminalManagerReady: (workspaceId, manager) => {\n\t\t\truntimeStateHub?.trackTerminalManager(workspaceId, manager);\n\t\t},\n\t});\n\truntimeStateHub = createRuntimeStateHub({\n\t\tworkspaceRegistry,\n\t});\n\tconst runtimeHub = runtimeStateHub;\n\tfor (const { workspaceId, terminalManager } of workspaceRegistry.listManagedWorkspaces()) {\n\t\truntimeHub.trackTerminalManager(workspaceId, terminalManager);\n\t}\n\n\tconst disposeTrackedWorkspace = (\n\t\tworkspaceId: string,\n\t\toptions?: {\n\t\t\tstopTerminalSessions?: boolean;\n\t\t},\n\t): { terminalManager: TerminalSessionManager | null; workspacePath: string | null } => {\n\t\tconst disposed = workspaceRegistry.disposeWorkspace(workspaceId, {\n\t\t\tstopTerminalSessions: options?.stopTerminalSessions,\n\t\t});\n\t\truntimeHub.disposeWorkspace(workspaceId);\n\t\treturn disposed;\n\t};\n\n\tconst runtimeServer = await createRuntimeServer({\n\t\tworkspaceRegistry,\n\t\truntimeStateHub: runtimeHub,\n\t\twarn: (message) => {\n\t\t\tconsole.warn(`[kanban] ${message}`);\n\t\t},\n\t\tensureTerminalManagerForWorkspace: workspaceRegistry.ensureTerminalManagerForWorkspace,\n\t\tresolveInteractiveShellCommand,\n\t\trunCommand: runScopedCommand,\n\t\tresolveProjectInputPath,\n\t\tassertPathIsDirectory,\n\t\thasGitRepository,\n\t\tdisposeWorkspace: disposeTrackedWorkspace,\n\t\tcollectProjectWorktreeTaskIdsForRemoval,\n\t\tpickDirectoryPathFromSystemDialog,\n\t});\n\n\tconst close = async () => {\n\t\tawait runtimeServer.close();\n\t};\n\n\tconst shutdown = async (options?: { skipSessionCleanup?: boolean }) => {\n\t\tawait shutdownRuntimeServer({\n\t\t\tworkspaceRegistry,\n\t\t\twarn: (message) => {\n\t\t\t\tconsole.warn(`[kanban] ${message}`);\n\t\t\t},\n\t\t\tcloseRuntimeServer: close,\n\t\t\tskipSessionCleanup: options?.skipSessionCleanup ?? false,\n\t\t});\n\t};\n\n\treturn {\n\t\turl: runtimeServer.url,\n\t\tclose,\n\t\tshutdown,\n\t};\n}\n\nasync function startServerWithAutoPortRetry(options: CliOptions): Promise<Awaited<ReturnType<typeof startServer>>> {\n\tif (options.port?.mode !== \"auto\") {\n\t\treturn await startServer();\n\t}\n\n\twhile (true) {\n\t\ttry {\n\t\t\treturn await startServer();\n\t\t} catch (error) {\n\t\t\tif (!isAddressInUseError(error)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconst currentPort = getKanbanRuntimePort();\n\t\t\tconst retryPort = await findAvailableRuntimePort(currentPort + 1);\n\t\t\tsetKanbanRuntimePort(retryPort);\n\t\t\tconsole.warn(`Runtime port ${currentPort} became busy during startup, retrying on ${retryPort}.`);\n\t\t}\n\t}\n}\n\nasync function runMainCommand(options: CliOptions): Promise<void> {\n\tconst selectedPort = await applyRuntimePortOption(options.port);\n\tif (selectedPort !== null) {\n\t\tconsole.log(`Using runtime port ${selectedPort}.`);\n\t}\n\n\tautoUpdateOnStartup({\n\t\tcurrentVersion: KANBAN_VERSION,\n\t});\n\n\tif (options.agent) {\n\t\tconst didChange = await persistCliAgentSelection(process.cwd(), options.agent);\n\t\tif (didChange) {\n\t\t\tconsole.log(`Default agent set to ${options.agent}.`);\n\t\t}\n\t}\n\n\ttry {\n\t\tconst detectedCommands = detectInstalledCommands();\n\t\tconst commandPrefix = resolveKanbanSkillCommandPrefix({\n\t\t\tcurrentVersion: KANBAN_VERSION,\n\t\t});\n\t\tawait installKanbanSkillFiles({\n\t\t\tcommandPrefix,\n\t\t\tinstallClaudeSkill: detectedCommands.includes(\"claude\"),\n\t\t});\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`Could not install Kanban skill files: ${message}`);\n\t}\n\n\tlet runtime: Awaited<ReturnType<typeof startServer>>;\n\ttry {\n\t\truntime = await startServerWithAutoPortRetry(options);\n\t} catch (error) {\n\t\tif (\n\t\t\toptions.port?.mode !== \"auto\" &&\n\t\t\tisAddressInUseError(error) &&\n\t\t\t(await tryOpenExistingServer(options.noOpen))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthrow error;\n\t}\n\tconsole.log(`Kanban running at ${runtime.url}`);\n\tif (!options.noOpen) {\n\t\ttry {\n\t\t\topenInBrowser(runtime.url);\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`Could not open browser automatically: ${message}`);\n\t\t}\n\t}\n\tconsole.log(\"Press Ctrl+C to stop.\");\n\n\tlet isShuttingDown = false;\n\tconst shutdown = async (signal: \"SIGINT\" | \"SIGTERM\") => {\n\t\tif (isShuttingDown) {\n\t\t\tprocess.exit(130);\n\t\t\treturn;\n\t\t}\n\t\tisShuttingDown = true;\n\t\trunPendingAutoUpdateOnShutdown();\n\t\tconst forceExitTimer = setTimeout(() => {\n\t\t\tconsole.error(`Forced exit after ${signal} timeout.`);\n\t\t\tprocess.exit(130);\n\t\t}, 3000);\n\t\tforceExitTimer.unref();\n\t\ttry {\n\t\t\tif (options.skipShutdownCleanup) {\n\t\t\t\tconsole.warn(\"Skipping shutdown task cleanup for this instance.\");\n\t\t\t}\n\t\t\tawait runtime.shutdown({\n\t\t\t\tskipSessionCleanup: options.skipShutdownCleanup,\n\t\t\t});\n\t\t\tclearTimeout(forceExitTimer);\n\t\t\tprocess.exit(130);\n\t\t} catch (error) {\n\t\t\tclearTimeout(forceExitTimer);\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.error(`Shutdown failed: ${message}`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t};\n\tprocess.on(\"SIGINT\", () => {\n\t\tvoid shutdown(\"SIGINT\");\n\t});\n\tprocess.on(\"SIGTERM\", () => {\n\t\tvoid shutdown(\"SIGTERM\");\n\t});\n}\n\nfunction createProgram(): Command {\n\tconst program = new Command();\n\tprogram\n\t\t.name(\"kanban\")\n\t\t.description(\"Local orchestration board for coding agents.\")\n\t\t.version(KANBAN_VERSION, \"-v, --version\", \"Output the version number\")\n\t\t.option(\"--agent <id>\", `Default agent ID (${CLI_AGENT_IDS.join(\", \")}).`, parseCliAgentId)\n\t\t.option(\"--port <number|auto>\", \"Runtime port (1-65535) or auto.\", parseCliPortValue)\n\t\t.option(\"--no-open\", \"Do not open browser automatically.\")\n\t\t.option(\"--skip-shutdown-cleanup\", \"Do not move sessions to trash or delete task worktrees on shutdown.\")\n\t\t.showHelpAfterError()\n\t\t.addHelpText(\"after\", `\\nRuntime URL: ${getKanbanRuntimeOrigin()}\\nAgent IDs: ${CLI_AGENT_IDS.join(\", \")}`);\n\n\tregisterTaskCommand(program);\n\tregisterHooksCommand(program);\n\n\tprogram\n\t\t.command(\"mcp\")\n\t\t.description(\"Deprecated compatibility command.\")\n\t\t.action(() => {\n\t\t\tconsole.warn(\"Deprecated. Please uninstall Kanban MCP.\");\n\t\t});\n\n\tprogram.action(async (options: RootCommandOptions) => {\n\t\tawait runMainCommand({\n\t\t\tagent: options.agent ?? null,\n\t\t\tport: options.port ?? null,\n\t\t\tnoOpen: options.open === false,\n\t\t\tskipShutdownCleanup: options.skipShutdownCleanup === true,\n\t\t});\n\t});\n\n\treturn program;\n}\n\nasync function run(): Promise<void> {\n\tconst argv = process.argv.slice(2);\n\tconst program = createProgram();\n\tawait program.parseAsync(argv, { from: \"user\" });\n}\n\nrun().catch((error) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconsole.error(`Failed to start Kanban: ${message}`);\n\tprocess.exit(1);\n});\n"]}
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,YAAY,IAAI,eAAe,EAAE,MAAM,UAAU,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAEhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EACN,qBAAqB,EACrB,2BAA2B,EAC3B,sBAAsB,EACtB,oBAAoB,EACpB,gBAAgB,EAChB,oBAAoB,GACpB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,8BAA8B,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAA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AC,0CAA0C,CAAC,CAAC;IAC1D,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,OAA2B,EAAE,EAAE;QACpD,MAAM,cAAc,CAAC;YACpB,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,IAAI;YAC5B,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,IAAI;YAC1B,MAAM,EAAE,OAAO,CAAC,IAAI,KAAK,KAAK;YAC9B,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,KAAK,IAAI;SACzD,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AAChB,CAAC;AAED,KAAK,UAAU,GAAG;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,MAAM,OAAO,CAAC,UAAU,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;AAClD,CAAC;AAED,GAAG,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,2BAA2B,OAAO,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AACjB,CAAC,CAAC,CAAC","sourcesContent":["#!/usr/bin/env node\n\nimport { spawn, spawnSync } from \"node:child_process\";\nimport { stat } from \"node:fs/promises\";\nimport { createServer as createNetServer } from \"node:net\";\nimport { Command } from \"commander\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\nimport { registerHooksCommand } from \"./commands/hooks.js\";\nimport { registerTaskCommand } from \"./commands/task.js\";\nimport { loadRuntimeConfig, updateRuntimeConfig } from \"./config/runtime-config.js\";\nimport type { RuntimeAgentId, RuntimeCommandRunResponse } from \"./core/api-contract.js\";\nimport { createGitProcessEnv } from \"./core/git-process-env.js\";\nimport {\n\tbuildKanbanRuntimeUrl,\n\tDEFAULT_KANBAN_RUNTIME_PORT,\n\tgetKanbanRuntimeOrigin,\n\tgetKanbanRuntimePort,\n\tparseRuntimePort,\n\tsetKanbanRuntimePort,\n} from \"./core/runtime-endpoint.js\";\nimport { resolveProjectInputPath } from \"./projects/project-path.js\";\nimport { openInBrowser } from \"./server/browser.js\";\nimport { createRuntimeServer } from \"./server/runtime-server.js\";\nimport { createRuntimeStateHub } from \"./server/runtime-state-hub.js\";\nimport { resolveInteractiveShellCommand } from \"./server/shell.js\";\nimport { shutdownRuntimeServer } from \"./server/shutdown-coordinator.js\";\nimport { collectProjectWorktreeTaskIdsForRemoval, createWorkspaceRegistry } from \"./server/workspace-registry.js\";\nimport { installKanbanSkillFiles, resolveKanbanSkillCommandPrefix } from \"./skills/kanban-skill.js\";\nimport { loadWorkspaceContext } from \"./state/workspace-state.js\";\nimport { detectInstalledCommands } from \"./terminal/agent-registry.js\";\nimport type { TerminalSessionManager } from \"./terminal/session-manager.js\";\nimport { autoUpdateOnStartup, runPendingAutoUpdateOnShutdown } from \"./update/auto-update.js\";\n\ninterface CliOptions {\n\tnoOpen: boolean;\n\tskipShutdownCleanup: boolean;\n\tagent: RuntimeAgentId | null;\n\tport: { mode: \"fixed\"; value: number } | { mode: \"auto\" } | null;\n}\n\nconst CLI_AGENT_IDS: readonly RuntimeAgentId[] = [\"claude\", \"codex\", \"gemini\", \"opencode\", \"droid\", \"cline\"];\nconst KANBAN_VERSION = typeof packageJson.version === \"string\" ? packageJson.version : \"0.1.0\";\n\nfunction parseCliAgentId(value: string): RuntimeAgentId {\n\tconst normalized = value.trim().toLowerCase();\n\tif (\n\t\tnormalized === \"claude\" ||\n\t\tnormalized === \"codex\" ||\n\t\tnormalized === \"gemini\" ||\n\t\tnormalized === \"opencode\" ||\n\t\tnormalized === \"droid\" ||\n\t\tnormalized === \"cline\"\n\t) {\n\t\treturn normalized;\n\t}\n\tthrow new Error(`Invalid agent: ${value}. Expected one of: ${CLI_AGENT_IDS.join(\", \")}`);\n}\n\nfunction parseCliPortValue(rawValue: string): { mode: \"fixed\"; value: number } | { mode: \"auto\" } {\n\tconst normalized = rawValue.trim().toLowerCase();\n\tif (!normalized) {\n\t\tthrow new Error(\"Missing value for --port.\");\n\t}\n\tif (normalized === \"auto\") {\n\t\treturn { mode: \"auto\" };\n\t}\n\ttry {\n\t\treturn { mode: \"fixed\", value: parseRuntimePort(normalized) };\n\t} catch {\n\t\tthrow new Error(`Invalid port value: ${rawValue}. Expected an integer from 1-65535 or \"auto\".`);\n\t}\n}\n\ninterface RootCommandOptions {\n\tagent?: RuntimeAgentId;\n\tport?: { mode: \"fixed\"; value: number } | { mode: \"auto\" };\n\topen?: boolean;\n\tskipShutdownCleanup?: boolean;\n}\n\nasync function isPortAvailable(port: number): Promise<boolean> {\n\treturn await new Promise<boolean>((resolve) => {\n\t\tconst probe = createNetServer();\n\t\tprobe.once(\"error\", () => {\n\t\t\tresolve(false);\n\t\t});\n\t\tprobe.listen(port, \"127.0.0.1\", () => {\n\t\t\tprobe.close(() => {\n\t\t\t\tresolve(true);\n\t\t\t});\n\t\t});\n\t});\n}\n\nasync function findAvailableRuntimePort(startPort: number): Promise<number> {\n\tfor (let candidate = startPort; candidate <= 65535; candidate += 1) {\n\t\tif (await isPortAvailable(candidate)) {\n\t\t\treturn candidate;\n\t\t}\n\t}\n\tthrow new Error(\"No available runtime port found.\");\n}\n\nasync function applyRuntimePortOption(portOption: CliOptions[\"port\"]): Promise<number | null> {\n\tif (!portOption) {\n\t\treturn null;\n\t}\n\tif (portOption.mode === \"fixed\") {\n\t\tsetKanbanRuntimePort(portOption.value);\n\t\treturn portOption.value;\n\t}\n\tconst autoPort = await findAvailableRuntimePort(DEFAULT_KANBAN_RUNTIME_PORT);\n\tsetKanbanRuntimePort(autoPort);\n\treturn autoPort;\n}\n\nasync function persistCliAgentSelection(cwd: string, selectedAgentId: RuntimeAgentId): Promise<boolean> {\n\tconst currentRuntimeConfig = await loadRuntimeConfig(cwd);\n\tif (currentRuntimeConfig.selectedAgentId === selectedAgentId) {\n\t\treturn false;\n\t}\n\tawait updateRuntimeConfig(cwd, { selectedAgentId });\n\treturn true;\n}\n\nasync function assertPathIsDirectory(path: string): Promise<void> {\n\tconst info = await stat(path);\n\tif (!info.isDirectory()) {\n\t\tthrow new Error(`Project path is not a directory: ${path}`);\n\t}\n}\n\nasync function pathIsDirectory(path: string): Promise<boolean> {\n\ttry {\n\t\tconst info = await stat(path);\n\t\treturn info.isDirectory();\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nfunction hasGitRepository(path: string): boolean {\n\tconst result = spawnSync(\"git\", [\"rev-parse\", \"--is-inside-work-tree\"], {\n\t\tcwd: path,\n\t\tencoding: \"utf8\",\n\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\tenv: createGitProcessEnv(),\n\t});\n\treturn result.status === 0 && result.stdout.trim() === \"true\";\n}\n\nfunction pickDirectoryPathFromSystemDialog(): string | null {\n\tif (process.platform === \"darwin\") {\n\t\tconst result = spawnSync(\n\t\t\t\"osascript\",\n\t\t\t[\"-e\", 'POSIX path of (choose folder with prompt \"Select a project folder\")'],\n\t\t\t{\n\t\t\t\tencoding: \"utf8\",\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t\t},\n\t\t);\n\t\tif (result.status !== 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst selected = typeof result.stdout === \"string\" ? result.stdout.trim() : \"\";\n\t\treturn selected || null;\n\t}\n\n\tif (process.platform === \"linux\") {\n\t\tconst result = spawnSync(\"zenity\", [\"--file-selection\", \"--directory\", \"--title=Select project folder\"], {\n\t\t\tencoding: \"utf8\",\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t});\n\t\tif (result.status !== 0) {\n\t\t\treturn null;\n\t\t}\n\t\tconst selected = typeof result.stdout === \"string\" ? result.stdout.trim() : \"\";\n\t\treturn selected || null;\n\t}\n\n\treturn null;\n}\n\nfunction isAddressInUseError(error: unknown): error is NodeJS.ErrnoException {\n\treturn (\n\t\ttypeof error === \"object\" &&\n\t\terror !== null &&\n\t\t\"code\" in error &&\n\t\t(error as NodeJS.ErrnoException).code === \"EADDRINUSE\"\n\t);\n}\n\nasync function canReachKanbanServer(workspaceId: string | null): Promise<boolean> {\n\ttry {\n\t\tconst headers: Record<string, string> = {};\n\t\tif (workspaceId) {\n\t\t\theaders[\"x-kanban-workspace-id\"] = workspaceId;\n\t\t}\n\t\tconst response = await fetch(buildKanbanRuntimeUrl(\"/api/trpc/projects.list\"), {\n\t\t\tmethod: \"GET\",\n\t\t\theaders,\n\t\t\tsignal: AbortSignal.timeout(1_500),\n\t\t});\n\t\tif (response.status === 404) {\n\t\t\treturn false;\n\t\t}\n\t\tconst payload = (await response.json().catch(() => null)) as {\n\t\t\tresult?: { data?: unknown };\n\t\t\terror?: unknown;\n\t\t} | null;\n\t\treturn Boolean(payload && (payload.result || payload.error));\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nasync function tryOpenExistingServer(noOpen: boolean): Promise<boolean> {\n\tlet workspaceId: string | null = null;\n\tif (hasGitRepository(process.cwd())) {\n\t\tconst context = await loadWorkspaceContext(process.cwd());\n\t\tworkspaceId = context.workspaceId;\n\t}\n\tconst running = await canReachKanbanServer(workspaceId);\n\tif (!running) {\n\t\treturn false;\n\t}\n\tconst projectUrl = workspaceId\n\t\t? buildKanbanRuntimeUrl(`/${encodeURIComponent(workspaceId)}`)\n\t\t: getKanbanRuntimeOrigin();\n\tconsole.log(`Kanban already running at ${getKanbanRuntimeOrigin()}`);\n\tif (!noOpen) {\n\t\ttry {\n\t\t\topenInBrowser(projectUrl, {\n\t\t\t\twarn: (message) => {\n\t\t\t\t\tconsole.warn(message);\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`Could not open browser automatically: ${message}`);\n\t\t}\n\t}\n\tconsole.log(`Project URL: ${projectUrl}`);\n\treturn true;\n}\n\nasync function runScopedCommand(command: string, cwd: string): Promise<RuntimeCommandRunResponse> {\n\tconst startedAt = Date.now();\n\tconst outputLimitBytes = 64 * 1024;\n\n\treturn await new Promise<RuntimeCommandRunResponse>((resolve, reject) => {\n\t\tconst child = spawn(command, {\n\t\t\tcwd,\n\t\t\tshell: true,\n\t\t\tenv: process.env,\n\t\t\tstdio: [\"ignore\", \"pipe\", \"pipe\"],\n\t\t});\n\n\t\tif (!child.stdout || !child.stderr) {\n\t\t\treject(new Error(\"Shortcut process did not expose stdout/stderr.\"));\n\t\t\treturn;\n\t\t}\n\n\t\tlet stdout = \"\";\n\t\tlet stderr = \"\";\n\n\t\tconst appendOutput = (current: string, chunk: string): string => {\n\t\t\tconst next = current + chunk;\n\t\t\tif (next.length <= outputLimitBytes) {\n\t\t\t\treturn next;\n\t\t\t}\n\t\t\treturn next.slice(0, outputLimitBytes);\n\t\t};\n\n\t\tchild.stdout.on(\"data\", (chunk: Buffer | string) => {\n\t\t\tstdout = appendOutput(stdout, String(chunk));\n\t\t});\n\n\t\tchild.stderr.on(\"data\", (chunk: Buffer | string) => {\n\t\t\tstderr = appendOutput(stderr, String(chunk));\n\t\t});\n\n\t\tchild.on(\"error\", (error) => {\n\t\t\treject(error);\n\t\t});\n\n\t\tconst timeout = setTimeout(() => {\n\t\t\tchild.kill(\"SIGTERM\");\n\t\t}, 60_000);\n\n\t\tchild.on(\"close\", (code) => {\n\t\t\tclearTimeout(timeout);\n\t\t\tconst exitCode = typeof code === \"number\" ? code : 1;\n\t\t\tconst combinedOutput = [stdout.trim(), stderr.trim()].filter(Boolean).join(\"\\n\");\n\t\t\tresolve({\n\t\t\t\texitCode,\n\t\t\t\tstdout: stdout.trim(),\n\t\t\t\tstderr: stderr.trim(),\n\t\t\t\tcombinedOutput,\n\t\t\t\tdurationMs: Date.now() - startedAt,\n\t\t\t});\n\t\t});\n\t});\n}\n\nasync function startServer(): Promise<{\n\turl: string;\n\tclose: () => Promise<void>;\n\tshutdown: (options?: { skipSessionCleanup?: boolean }) => Promise<void>;\n}> {\n\tlet runtimeStateHub: ReturnType<typeof createRuntimeStateHub> | undefined;\n\tconst workspaceRegistry = await createWorkspaceRegistry({\n\t\tcwd: process.cwd(),\n\t\tloadRuntimeConfig,\n\t\thasGitRepository,\n\t\tpathIsDirectory,\n\t\tonTerminalManagerReady: (workspaceId, manager) => {\n\t\t\truntimeStateHub?.trackTerminalManager(workspaceId, manager);\n\t\t},\n\t});\n\truntimeStateHub = createRuntimeStateHub({\n\t\tworkspaceRegistry,\n\t});\n\tconst runtimeHub = runtimeStateHub;\n\tfor (const { workspaceId, terminalManager } of workspaceRegistry.listManagedWorkspaces()) {\n\t\truntimeHub.trackTerminalManager(workspaceId, terminalManager);\n\t}\n\n\tconst disposeTrackedWorkspace = (\n\t\tworkspaceId: string,\n\t\toptions?: {\n\t\t\tstopTerminalSessions?: boolean;\n\t\t},\n\t): { terminalManager: TerminalSessionManager | null; workspacePath: string | null } => {\n\t\tconst disposed = workspaceRegistry.disposeWorkspace(workspaceId, {\n\t\t\tstopTerminalSessions: options?.stopTerminalSessions,\n\t\t});\n\t\truntimeHub.disposeWorkspace(workspaceId);\n\t\treturn disposed;\n\t};\n\n\tconst runtimeServer = await createRuntimeServer({\n\t\tworkspaceRegistry,\n\t\truntimeStateHub: runtimeHub,\n\t\twarn: (message) => {\n\t\t\tconsole.warn(`[kanban] ${message}`);\n\t\t},\n\t\tensureTerminalManagerForWorkspace: workspaceRegistry.ensureTerminalManagerForWorkspace,\n\t\tresolveInteractiveShellCommand,\n\t\trunCommand: runScopedCommand,\n\t\tresolveProjectInputPath,\n\t\tassertPathIsDirectory,\n\t\thasGitRepository,\n\t\tdisposeWorkspace: disposeTrackedWorkspace,\n\t\tcollectProjectWorktreeTaskIdsForRemoval,\n\t\tpickDirectoryPathFromSystemDialog,\n\t});\n\n\tconst close = async () => {\n\t\tawait runtimeServer.close();\n\t};\n\n\tconst shutdown = async (options?: { skipSessionCleanup?: boolean }) => {\n\t\tawait shutdownRuntimeServer({\n\t\t\tworkspaceRegistry,\n\t\t\twarn: (message) => {\n\t\t\t\tconsole.warn(`[kanban] ${message}`);\n\t\t\t},\n\t\t\tcloseRuntimeServer: close,\n\t\t\tskipSessionCleanup: options?.skipSessionCleanup ?? false,\n\t\t});\n\t};\n\n\treturn {\n\t\turl: runtimeServer.url,\n\t\tclose,\n\t\tshutdown,\n\t};\n}\n\nasync function startServerWithAutoPortRetry(options: CliOptions): Promise<Awaited<ReturnType<typeof startServer>>> {\n\tif (options.port?.mode !== \"auto\") {\n\t\treturn await startServer();\n\t}\n\n\twhile (true) {\n\t\ttry {\n\t\t\treturn await startServer();\n\t\t} catch (error) {\n\t\t\tif (!isAddressInUseError(error)) {\n\t\t\t\tthrow error;\n\t\t\t}\n\t\t\tconst currentPort = getKanbanRuntimePort();\n\t\t\tconst retryPort = await findAvailableRuntimePort(currentPort + 1);\n\t\t\tsetKanbanRuntimePort(retryPort);\n\t\t\tconsole.warn(`Runtime port ${currentPort} became busy during startup, retrying on ${retryPort}.`);\n\t\t}\n\t}\n}\n\nasync function runMainCommand(options: CliOptions): Promise<void> {\n\tconst selectedPort = await applyRuntimePortOption(options.port);\n\tif (selectedPort !== null) {\n\t\tconsole.log(`Using runtime port ${selectedPort}.`);\n\t}\n\n\tautoUpdateOnStartup({\n\t\tcurrentVersion: KANBAN_VERSION,\n\t});\n\n\tif (options.agent) {\n\t\tconst didChange = await persistCliAgentSelection(process.cwd(), options.agent);\n\t\tif (didChange) {\n\t\t\tconsole.log(`Default agent set to ${options.agent}.`);\n\t\t}\n\t}\n\n\ttry {\n\t\tconst detectedCommands = detectInstalledCommands();\n\t\tconst commandPrefix = resolveKanbanSkillCommandPrefix({\n\t\t\tcurrentVersion: KANBAN_VERSION,\n\t\t});\n\t\tawait installKanbanSkillFiles({\n\t\t\tcommandPrefix,\n\t\t\tinstallClaudeSkill: detectedCommands.includes(\"claude\"),\n\t\t});\n\t} catch (error) {\n\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\tconsole.warn(`Could not install Kanban skill files: ${message}`);\n\t}\n\n\tlet runtime: Awaited<ReturnType<typeof startServer>>;\n\ttry {\n\t\truntime = await startServerWithAutoPortRetry(options);\n\t} catch (error) {\n\t\tif (\n\t\t\toptions.port?.mode !== \"auto\" &&\n\t\t\tisAddressInUseError(error) &&\n\t\t\t(await tryOpenExistingServer(options.noOpen))\n\t\t) {\n\t\t\treturn;\n\t\t}\n\t\tthrow error;\n\t}\n\tconsole.log(`Kanban running at ${runtime.url}`);\n\tif (!options.noOpen) {\n\t\ttry {\n\t\t\topenInBrowser(runtime.url, {\n\t\t\t\twarn: (message) => {\n\t\t\t\t\tconsole.warn(message);\n\t\t\t\t},\n\t\t\t});\n\t\t} catch (error) {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.warn(`Could not open browser automatically: ${message}`);\n\t\t}\n\t}\n\tconsole.log(\"Press Ctrl+C to stop.\");\n\n\tlet isShuttingDown = false;\n\tconst shutdown = async (signal: \"SIGINT\" | \"SIGTERM\") => {\n\t\tif (isShuttingDown) {\n\t\t\tprocess.exit(130);\n\t\t\treturn;\n\t\t}\n\t\tisShuttingDown = true;\n\t\trunPendingAutoUpdateOnShutdown();\n\t\tconst forceExitTimer = setTimeout(() => {\n\t\t\tconsole.error(`Forced exit after ${signal} timeout.`);\n\t\t\tprocess.exit(130);\n\t\t}, 3000);\n\t\tforceExitTimer.unref();\n\t\ttry {\n\t\t\tif (options.skipShutdownCleanup) {\n\t\t\t\tconsole.warn(\"Skipping shutdown task cleanup for this instance.\");\n\t\t\t}\n\t\t\tawait runtime.shutdown({\n\t\t\t\tskipSessionCleanup: options.skipShutdownCleanup,\n\t\t\t});\n\t\t\tclearTimeout(forceExitTimer);\n\t\t\tprocess.exit(130);\n\t\t} catch (error) {\n\t\t\tclearTimeout(forceExitTimer);\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\tconsole.error(`Shutdown failed: ${message}`);\n\t\t\tprocess.exit(1);\n\t\t}\n\t};\n\tprocess.on(\"SIGINT\", () => {\n\t\tvoid shutdown(\"SIGINT\");\n\t});\n\tprocess.on(\"SIGTERM\", () => {\n\t\tvoid shutdown(\"SIGTERM\");\n\t});\n}\n\nfunction createProgram(): Command {\n\tconst program = new Command();\n\tprogram\n\t\t.name(\"kanban\")\n\t\t.description(\"Local orchestration board for coding agents.\")\n\t\t.version(KANBAN_VERSION, \"-v, --version\", \"Output the version number\")\n\t\t.option(\"--agent <id>\", `Default agent ID (${CLI_AGENT_IDS.join(\", \")}).`, parseCliAgentId)\n\t\t.option(\"--port <number|auto>\", \"Runtime port (1-65535) or auto.\", parseCliPortValue)\n\t\t.option(\"--no-open\", \"Do not open browser automatically.\")\n\t\t.option(\"--skip-shutdown-cleanup\", \"Do not move sessions to trash or delete task worktrees on shutdown.\")\n\t\t.showHelpAfterError()\n\t\t.addHelpText(\"after\", `\\nRuntime URL: ${getKanbanRuntimeOrigin()}\\nAgent IDs: ${CLI_AGENT_IDS.join(\", \")}`);\n\n\tregisterTaskCommand(program);\n\tregisterHooksCommand(program);\n\n\tprogram\n\t\t.command(\"mcp\")\n\t\t.description(\"Deprecated compatibility command.\")\n\t\t.action(() => {\n\t\t\tconsole.warn(\"Deprecated. Please uninstall Kanban MCP.\");\n\t\t});\n\n\tprogram.action(async (options: RootCommandOptions) => {\n\t\tawait runMainCommand({\n\t\t\tagent: options.agent ?? null,\n\t\t\tport: options.port ?? null,\n\t\t\tnoOpen: options.open === false,\n\t\t\tskipShutdownCleanup: options.skipShutdownCleanup === true,\n\t\t});\n\t});\n\n\treturn program;\n}\n\nasync function run(): Promise<void> {\n\tconst argv = process.argv.slice(2);\n\tconst program = createProgram();\n\tawait program.parseAsync(argv, { from: \"user\" });\n}\n\nrun().catch((error) => {\n\tconst message = error instanceof Error ? error.message : String(error);\n\tconsole.error(`Failed to start Kanban: ${message}`);\n\tprocess.exit(1);\n});\n"]}
@@ -1,2 +1,9 @@
1
- export declare function openInBrowser(url: string): void;
1
+ import { spawn } from "node:child_process";
2
+ type BrowserOpenDeps = {
3
+ platform: NodeJS.Platform;
4
+ spawnProcess: typeof spawn;
5
+ warn: (message: string) => void;
6
+ };
7
+ export declare function openInBrowser(url: string, deps?: Partial<BrowserOpenDeps>): void;
8
+ export {};
2
9
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/server/browser.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAa/C"}
1
+ {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/server/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,KAAK,eAAe,GAAG;IACtB,QAAQ,EAAE,MAAM,CAAC,QAAQ,CAAC;IAC1B,YAAY,EAAE,OAAO,KAAK,CAAC;IAC3B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,CAAC;AAuBF,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAyChF"}
@@ -1,16 +1,55 @@
1
1
  import { spawn } from "node:child_process";
2
- export function openInBrowser(url) {
3
- if (process.platform === "darwin") {
4
- const child = spawn("open", [url], { detached: true, stdio: "ignore" });
5
- child.unref();
6
- return;
2
+ function getOpenCommandCandidates(platform, url) {
3
+ if (platform === "darwin") {
4
+ return [{ command: "open", args: [url] }];
7
5
  }
8
- if (process.platform === "win32") {
9
- const child = spawn("cmd", ["/c", "start", "", url], { detached: true, stdio: "ignore" });
10
- child.unref();
11
- return;
6
+ if (platform === "win32") {
7
+ return [{ command: "cmd", args: ["/c", "start", "", url] }];
12
8
  }
13
- const child = spawn("xdg-open", [url], { detached: true, stdio: "ignore" });
14
- child.unref();
9
+ return [
10
+ { command: "xdg-open", args: [url] },
11
+ { command: "gio", args: ["open", url] },
12
+ { command: "sensible-browser", args: [url] },
13
+ ];
14
+ }
15
+ function formatBrowserOpenError(error) {
16
+ if (error instanceof Error) {
17
+ return error.message;
18
+ }
19
+ return String(error);
20
+ }
21
+ export function openInBrowser(url, deps) {
22
+ const platform = deps?.platform ?? process.platform;
23
+ const spawnProcess = deps?.spawnProcess ?? spawn;
24
+ const warn = deps?.warn ?? (() => { });
25
+ const candidates = getOpenCommandCandidates(platform, url);
26
+ const launchCandidate = (index) => {
27
+ if (index >= candidates.length) {
28
+ warn(`Could not open browser automatically. Open this URL manually: ${url}`);
29
+ return;
30
+ }
31
+ const candidate = candidates[index];
32
+ try {
33
+ const child = spawnProcess(candidate.command, candidate.args, { detached: true, stdio: "ignore" });
34
+ child.once("error", (error) => {
35
+ const code = typeof error === "object" && error && "code" in error ? String(error.code) : null;
36
+ if (code === "ENOENT") {
37
+ launchCandidate(index + 1);
38
+ return;
39
+ }
40
+ warn(`Could not open browser automatically via ${candidate.command}: ${formatBrowserOpenError(error)}. Open this URL manually: ${url}`);
41
+ });
42
+ child.unref();
43
+ }
44
+ catch (error) {
45
+ const code = typeof error === "object" && error && "code" in error ? String(error.code) : null;
46
+ if (code === "ENOENT") {
47
+ launchCandidate(index + 1);
48
+ return;
49
+ }
50
+ warn(`Could not open browser automatically via ${candidate.command}: ${formatBrowserOpenError(error)}. Open this URL manually: ${url}`);
51
+ }
52
+ };
53
+ launchCandidate(0);
15
54
  }
16
55
  //# sourceMappingURL=browser.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/server/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,MAAM,UAAU,aAAa,CAAC,GAAW;IACxC,IAAI,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACnC,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QACxE,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO;IACR,CAAC;IACD,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE,CAAC;QAClC,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC1F,KAAK,CAAC,KAAK,EAAE,CAAC;QACd,OAAO;IACR,CAAC;IACD,MAAM,KAAK,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC5E,KAAK,CAAC,KAAK,EAAE,CAAC;AACf,CAAC","sourcesContent":["import { spawn } from \"node:child_process\";\n\nexport function openInBrowser(url: string): void {\n\tif (process.platform === \"darwin\") {\n\t\tconst child = spawn(\"open\", [url], { detached: true, stdio: \"ignore\" });\n\t\tchild.unref();\n\t\treturn;\n\t}\n\tif (process.platform === \"win32\") {\n\t\tconst child = spawn(\"cmd\", [\"/c\", \"start\", \"\", url], { detached: true, stdio: \"ignore\" });\n\t\tchild.unref();\n\t\treturn;\n\t}\n\tconst child = spawn(\"xdg-open\", [url], { detached: true, stdio: \"ignore\" });\n\tchild.unref();\n}\n"]}
1
+ {"version":3,"file":"browser.js","sourceRoot":"","sources":["../../src/server/browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EA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YACD,IAAI,CACH,4CAA4C,SAAS,CAAC,OAAO,KAAK,sBAAsB,CAAC,KAAK,CAAC,6BAA6B,GAAG,EAAE,CACjI,CAAC;QACH,CAAC;IACF,CAAC,CAAC;IAEF,eAAe,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC","sourcesContent":["import { spawn } from \"node:child_process\";\n\ntype BrowserOpenDeps = {\n\tplatform: NodeJS.Platform;\n\tspawnProcess: typeof spawn;\n\twarn: (message: string) => void;\n};\n\nfunction getOpenCommandCandidates(platform: NodeJS.Platform, url: string): Array<{ command: string; args: string[] }> {\n\tif (platform === \"darwin\") {\n\t\treturn [{ command: \"open\", args: [url] }];\n\t}\n\tif (platform === \"win32\") {\n\t\treturn [{ command: \"cmd\", args: [\"/c\", \"start\", \"\", url] }];\n\t}\n\treturn [\n\t\t{ command: \"xdg-open\", args: [url] },\n\t\t{ command: \"gio\", args: [\"open\", url] },\n\t\t{ command: \"sensible-browser\", args: [url] },\n\t];\n}\n\nfunction formatBrowserOpenError(error: unknown): string {\n\tif (error instanceof Error) {\n\t\treturn error.message;\n\t}\n\treturn String(error);\n}\n\nexport function openInBrowser(url: string, deps?: Partial<BrowserOpenDeps>): void {\n\tconst platform = deps?.platform ?? process.platform;\n\tconst spawnProcess = deps?.spawnProcess ?? spawn;\n\tconst warn = deps?.warn ?? (() => {});\n\n\tconst candidates = getOpenCommandCandidates(platform, url);\n\n\tconst launchCandidate = (index: number): void => {\n\t\tif (index >= candidates.length) {\n\t\t\twarn(`Could not open browser automatically. Open this URL manually: ${url}`);\n\t\t\treturn;\n\t\t}\n\n\t\tconst candidate = candidates[index];\n\n\t\ttry {\n\t\t\tconst child = spawnProcess(candidate.command, candidate.args, { detached: true, stdio: \"ignore\" });\n\t\t\tchild.once(\"error\", (error) => {\n\t\t\t\tconst code = typeof error === \"object\" && error && \"code\" in error ? String(error.code) : null;\n\t\t\t\tif (code === \"ENOENT\") {\n\t\t\t\t\tlaunchCandidate(index + 1);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\twarn(\n\t\t\t\t\t`Could not open browser automatically via ${candidate.command}: ${formatBrowserOpenError(error)}. Open this URL manually: ${url}`,\n\t\t\t\t);\n\t\t\t});\n\t\t\tchild.unref();\n\t\t} catch (error) {\n\t\t\tconst code = typeof error === \"object\" && error && \"code\" in error ? String(error.code) : null;\n\t\t\tif (code === \"ENOENT\") {\n\t\t\t\tlaunchCandidate(index + 1);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\twarn(\n\t\t\t\t`Could not open browser automatically via ${candidate.command}: ${formatBrowserOpenError(error)}. Open this URL manually: ${url}`,\n\t\t\t);\n\t\t}\n\t};\n\n\tlaunchCandidate(0);\n}\n"]}
@@ -16693,7 +16693,7 @@ function XH({ children: e, className: t }) {
16693
16693
  const ZH = "https://github.com/cline/kanban";
16694
16694
  function QH({ projects: e, isLoadingProjects: t = false, currentProjectId: n, removingProjectId: r, onSelectProject: o, onRemoveProject: i, onAddProject: l }) {
16695
16695
  const c = [...e].sort((g, x) => g.path.localeCompare(x.path)), [u, f] = v.useState(null), h = u !== null && r === u.id, p = u ? u.taskCounts.backlog + u.taskCounts.in_progress + u.taskCounts.review + u.taskCounts.trash : 0;
16696
- return m.jsxs("aside", { className: "flex flex-col min-h-0 overflow-hidden bg-surface-1", style: { width: "20%", borderRight: "1px solid var(--color-divider)" }, children: [m.jsx("div", { style: { padding: "12px 12px 8px" }, children: m.jsxs("div", { children: [m.jsxs("div", { className: "font-semibold text-base", children: ["kanban", " ", m.jsxs("span", { className: "text-text-secondary font-normal text-xs", children: ["v", "0.1.13"] })] }), m.jsx("a", { href: ZH, target: "_blank", rel: "noopener noreferrer", className: "text-accent-hover text-xs hover:underline", children: "View on GitHub" })] }) }), m.jsxs("div", { className: "flex items-center justify-between", style: { padding: "4px 12px" }, children: [m.jsx("span", { className: "text-text-tertiary text-xs font-medium uppercase tracking-wide", children: "Projects" }), m.jsx(Te, { variant: "ghost", size: "sm", icon: m.jsx(yl, { size: 14 }), onClick: l, "aria-label": "Add project", disabled: r !== null })] }), m.jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-1", style: { padding: "4px 0" }, children: [c.length === 0 ? t ? m.jsx("div", { style: { padding: "4px 0" }, children: Array.from({ length: 3 }).map((g, x) => m.jsx(rW, {}, `project-skeleton-${x}`)) }) : m.jsx("div", { className: "text-center", style: { padding: "24px 12px" }, children: m.jsx("span", { className: "text-text-secondary", children: "No projects yet" }) }) : null, c.map((g) => m.jsx(oW, { project: g, isCurrent: n === g.id, removingProjectId: r, onSelect: o, onRemove: (x) => {
16696
+ return m.jsxs("aside", { className: "flex flex-col min-h-0 overflow-hidden bg-surface-1", style: { width: "20%", borderRight: "1px solid var(--color-divider)" }, children: [m.jsx("div", { style: { padding: "12px 12px 8px" }, children: m.jsxs("div", { children: [m.jsxs("div", { className: "font-semibold text-base", children: ["kanban", " ", m.jsxs("span", { className: "text-text-secondary font-normal text-xs", children: ["v", "0.1.14"] })] }), m.jsx("a", { href: ZH, target: "_blank", rel: "noopener noreferrer", className: "text-accent-hover text-xs hover:underline", children: "View on GitHub" })] }) }), m.jsxs("div", { className: "flex items-center justify-between", style: { padding: "4px 12px" }, children: [m.jsx("span", { className: "text-text-tertiary text-xs font-medium uppercase tracking-wide", children: "Projects" }), m.jsx(Te, { variant: "ghost", size: "sm", icon: m.jsx(yl, { size: 14 }), onClick: l, "aria-label": "Add project", disabled: r !== null })] }), m.jsxs("div", { className: "flex-1 min-h-0 overflow-y-auto overscroll-contain flex flex-col gap-1", style: { padding: "4px 0" }, children: [c.length === 0 ? t ? m.jsx("div", { style: { padding: "4px 0" }, children: Array.from({ length: 3 }).map((g, x) => m.jsx(rW, {}, `project-skeleton-${x}`)) }) : m.jsx("div", { className: "text-center", style: { padding: "24px 12px" }, children: m.jsx("span", { className: "text-text-secondary", children: "No projects yet" }) }) : null, c.map((g) => m.jsx(oW, { project: g, isCurrent: n === g.id, removingProjectId: r, onSelect: o, onRemove: (x) => {
16697
16697
  const w = c.find((b) => b.id === x);
16698
16698
  w && f(w);
16699
16699
  } }, g.id))] }), m.jsx(nW, {}), m.jsxs("a", { href: "https://cline.bot", target: "_blank", rel: "noopener noreferrer", className: "text-text-tertiary hover:text-text-primary text-center block transition-colors", style: { padding: "6px 12px", fontSize: 10 }, children: ["Made with ", m.jsx(ID, { size: 10, fill: "currentColor", className: "inline-block" }), " by Cline"] }), m.jsxs(Lu, { open: u !== null, onOpenChange: (g) => {
@@ -8,7 +8,7 @@
8
8
  href='data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 16 16%22><path fill=%22%23AAB0B7%22 d=%22M15 0H1C.45 0 0 .45 0 1s.45 1 1 1h14c.55 0 1-.45 1-1s-.45-1-1-1zM6 4H3c-.55 0-1 .45-1 1v9c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1zm7 0h-3c-.55 0-1 .45-1 1v4c0 .55.45 1 1 1h3c.55 0 1-.45 1-1V5c0-.55-.45-1-1-1z%22/></svg>'
9
9
  />
10
10
  <title>Kanban</title>
11
- <script type="module" crossorigin src="/assets/index-CY5RDApA.js"></script>
11
+ <script type="module" crossorigin src="/assets/index-CcxOKLls.js"></script>
12
12
  <link rel="modulepreload" crossorigin href="/assets/xterm-vendor-x1-S2SBl.js">
13
13
  <link rel="stylesheet" crossorigin href="/assets/xterm-vendor-GVL3fBIr.css">
14
14
  <link rel="stylesheet" crossorigin href="/assets/index-0KAf_GGl.css">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kanban",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "A kanban foundation for coding agents",
5
5
  "publishConfig": {
6
6
  "access": "public",