create-conductor-flow 0.0.2 → 1.0.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -63
- package/dist/conductor-init.js +62 -0
- package/dist/index.js +38 -33
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,36 +1,118 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
|
+
<a href="https://github.com/你的用户名/create-conductor-flow">
|
|
3
|
+
<img src="./conductor_flow_banner.png" alt="Conductor Scaffolding CLI Logo" width="512" height="384">
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
<h1>Conductor Scaffolding CLI</h1>
|
|
7
|
+
|
|
8
|
+
<p>
|
|
9
|
+
<a href="https://www.npmjs.com/package/create-conductor-flow">
|
|
10
|
+
<img src="https://img.shields.io/npm/v/create-conductor-flow?color=0470f2&label=npm+version" alt="NPM Version">
|
|
11
|
+
</a>
|
|
12
|
+
<a href="https://github.com/Jonkimi/create-conductor-flow/blob/main/LICENSE">
|
|
13
|
+
<img src="https://img.shields.io/npm/l/create-conductor-flow?color=blue" alt="License">
|
|
14
|
+
</a>
|
|
15
|
+
<a href="https://npmcharts.com/compare/create-conductor-flow?minimal=true">
|
|
16
|
+
<img src="https://img.shields.io/npm/dm/create-conductor-flow?color=orange" alt="Downloads">
|
|
17
|
+
</a>
|
|
18
|
+
</p>
|
|
19
|
+
|
|
20
|
+
<p>
|
|
21
|
+
<strong>English</strong> | <a href="./README.zh-CN.md">简体中文</a> | <a href="./README.ja.md">日本語</a> | <a href="./README_ko.md">한국어</a>
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<br>
|
|
25
|
+
<blockquote>
|
|
26
|
+
<strong>The scaffolding tool to generate spec-driven, portable <a href="https://github.com/gemini-cli-extensions/conductor">Gemini Conductor</a> workflows for any AI coding agent.</strong>
|
|
27
|
+
</blockquote>
|
|
28
|
+
<br>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
Get started immediately with:
|
|
2
32
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
[English](./README.md) | [中文](./README_zh.md) | [日本語](./README_ja.md) | [한국어](./README_ko.md)
|
|
33
|
+
```bash
|
|
34
|
+
npm create conductor-flow
|
|
35
|
+
```
|
|
8
36
|
|
|
9
|
-
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
**Conductor Scaffolding CLI** enables the **[context-first evolution of spec-driven development](https://blog.jonkimi.com/2026/02/01/en/Vibe-Coding-with-context-driven-development-using-Conductor-for-Gemini-CLI/)** by instantly setting up portable workflows compatible with leading AI Coding Assistants, including:
|
|
40
|
+
- **Opencode**
|
|
41
|
+
- **Claude Code**
|
|
42
|
+
- **Antigravity**
|
|
43
|
+
- **Cursor**
|
|
44
|
+
- **Github Copilot**,
|
|
45
|
+
- **Codex**
|
|
46
|
+
- **Windsurf**
|
|
47
|
+
- **Cline**,
|
|
48
|
+
- **Kilo Code**
|
|
49
|
+
- **Roo Code**
|
|
50
|
+
- **Qwen Code**
|
|
51
|
+
- **Factory Droid**
|
|
52
|
+
- **Gemini CLI**
|
|
10
53
|
|
|
11
54
|
Originally developed for the Gemini CLI, the **Conductor** is now decoupled by this project, **empowering developers to maintain context, manage tasks, and orchestrate complex features**. It serves as a bridge between human intent and AI execution, ensuring "Context is King" in the era of Agentic AI.
|
|
12
55
|
|
|
13
|
-
## 🎯 Goals
|
|
14
56
|
|
|
15
|
-
- **Universal Compatibility:** Enable the Conductor methodology outside of the Gemini CLI ecosystem.
|
|
16
|
-
- **Agent-Agnostic Setup:** Provide a mechanism to "install" Conductor commands and templates into a project, effectively "enabling" it for consumption by multiple different coding agents.
|
|
17
|
-
- **Standardization:** Create a unified interface for project orchestration that bridges the gap between human intent and AI execution.
|
|
18
57
|
|
|
19
58
|
## ✨ Key Features
|
|
20
59
|
|
|
21
|
-
- **
|
|
22
|
-
- **Context Management**: Structured artifacts (`spec.md`, `plan.md`) keep your AI agent focused and context-aware.
|
|
23
|
-
- **Spec-Driven Development**: Define *what* you want before asking the AI *how* to build it.
|
|
60
|
+
- **Agent-Agnostic Setup:** Provide a mechanism to "install" Conductor commands and templates into a project, effectively "enabling" it for consumption by multiple different coding agents.
|
|
24
61
|
- **Agent-Agnostic Workflows**: Switch between agents without losing project context or progress.
|
|
25
|
-
- **
|
|
62
|
+
- **Context Management**: Structured artifacts (`product.md`, `tech-stack.md`, `spec.md`, `plan.md`) keep your AI agent focused and context-aware.
|
|
63
|
+
- **Spec-Driven Development**: Define *what* you want before asking the AI *how* to build it.
|
|
26
64
|
- **Git Ignore Configuration**: Automatically configure `.gitignore` or `.git/info/exclude` to exclude agent configuration files from version control.
|
|
65
|
+
- **Easy Initialization**: Single command setup with `npm create conductor-flow`.
|
|
27
66
|
|
|
28
67
|
## 🚀 Usage
|
|
29
68
|
|
|
30
|
-
###
|
|
69
|
+
### Interactive Mode (Recommended)
|
|
70
|
+
|
|
71
|
+
The easiest way to start is to run the interactive setup. It will guide you through configuring your workflow spec, selecting your AI agent, and settings.
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
npm create conductor-flow
|
|
75
|
+
```
|
|
76
|
+
Or if you prefer the shorthand alias:
|
|
77
|
+
|
|
78
|
+
```bash
|
|
79
|
+
npx conductor-init
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
You will be prompted to select your target environment:
|
|
83
|
+
|
|
84
|
+
```text
|
|
85
|
+
? Select your coding agent:
|
|
86
|
+
❯ OpenCode (AGENTS.md, .opencode/commands)
|
|
87
|
+
Claude Code (CLAUDE.md, .claude/commands)
|
|
88
|
+
Antigravity (GEMINI.md, .agent/workflows)
|
|
89
|
+
Cursor (AGENTS.md, .cursor/commands)
|
|
90
|
+
VS Code Copilot (AGENTS.md, .github/prompts)
|
|
91
|
+
Codex (AGENTS.md, .codex/prompts)
|
|
92
|
+
Windsurf (AGENTS.md, .windsurf/workflows)
|
|
93
|
+
? Select installation method:
|
|
94
|
+
❯ Project (Current Directory)
|
|
95
|
+
? Configure git ignore for Conductor files?
|
|
96
|
+
Add to .gitignore
|
|
97
|
+
Add to .git/info/exclude
|
|
98
|
+
Remove existing entries
|
|
99
|
+
❯ Don't configure git ignore
|
|
100
|
+
```
|
|
101
|
+
### Arguments & Flags
|
|
102
|
+
|
|
103
|
+
For power users, you can pass arguments directly to skip prompts:
|
|
104
|
+
|
|
105
|
+
```bash
|
|
106
|
+
npm create conductor-flow -a claude-code
|
|
107
|
+
|
|
108
|
+
#specify a custom template repository and branch
|
|
109
|
+
npm create conductor-flow --repo https://github.com/your-org/custom-conductor --branch v2
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
### Common Options
|
|
31
113
|
|
|
32
114
|
```text
|
|
33
|
-
conductor-
|
|
115
|
+
npm create conductor-flow [path] [options]
|
|
34
116
|
|
|
35
117
|
Positionals:
|
|
36
118
|
path Directory to install Conductor [string] [default: "."]
|
|
@@ -55,65 +137,35 @@ Options:
|
|
|
55
137
|
-v, --version Show version number [boolean]
|
|
56
138
|
|
|
57
139
|
Examples:
|
|
58
|
-
conductor-
|
|
59
|
-
conductor-
|
|
60
|
-
|
|
61
|
-
conductor-
|
|
62
|
-
|
|
63
|
-
conductor-
|
|
64
|
-
|
|
140
|
+
npm create conductor-flow Install with interactive prompts
|
|
141
|
+
npm create conductor-flow --agent Install for Claude Code agent
|
|
142
|
+
claude-code
|
|
143
|
+
npm create conductor-flow --git-ignore Add Conductor files to .gitignore
|
|
144
|
+
gitignore
|
|
145
|
+
npm create conductor-flow --git-ignore Add Conductor files to
|
|
146
|
+
exclude .git/info/exclude
|
|
147
|
+
npm create conductor-flow --git-ignore Remove Conductor entries from git
|
|
148
|
+
none ignore
|
|
65
149
|
```
|
|
66
150
|
|
|
67
|
-
To initialize Conductor in your project, simply run the following command in your project root:
|
|
68
|
-
|
|
69
|
-
```bash
|
|
70
|
-
npx conductor-init
|
|
71
|
-
```
|
|
72
151
|
|
|
73
|
-
|
|
152
|
+
### 3. Shell Completion for Global Installation(Advanced Setup)
|
|
74
153
|
|
|
75
|
-
|
|
76
|
-
npx conductor-init --repo https://github.com/your-org/custom-conductor --branch v2
|
|
77
|
-
```
|
|
154
|
+
Enable tab completion for specific shells (Bash, Zsh) to make using `conductor-init` easier.
|
|
78
155
|
|
|
79
|
-
|
|
156
|
+
#### Global Installation
|
|
80
157
|
|
|
81
158
|
```bash
|
|
82
|
-
|
|
159
|
+
npm install -g create-conductor-flow
|
|
83
160
|
```
|
|
84
161
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
If you prefer to build from source:
|
|
162
|
+
Or, if you prefer the shorthand alias:
|
|
88
163
|
|
|
89
164
|
```bash
|
|
90
|
-
|
|
91
|
-
pnpm build
|
|
92
|
-
node dist/index.js
|
|
165
|
+
npm install -g conductor-init
|
|
93
166
|
```
|
|
94
167
|
|
|
95
|
-
|
|
96
|
-
- **Opencode**
|
|
97
|
-
- **Claude Code**
|
|
98
|
-
- **Antigravity**
|
|
99
|
-
- **Cursor**
|
|
100
|
-
- **VS Code Copilot**
|
|
101
|
-
- **Codex**
|
|
102
|
-
- **Windsurf**
|
|
103
|
-
- **Cline**
|
|
104
|
-
- **Kilo Code**
|
|
105
|
-
- **Roo Code**
|
|
106
|
-
- **Qwen Code**
|
|
107
|
-
- **Factory Droid**
|
|
108
|
-
- **Gemini CLI**
|
|
109
|
-
|
|
110
|
-
This will verify the environment and install the necessary Conductor files:
|
|
111
|
-
- **Commands:** Agent-specific prompt or command files (e.g., `.opencode/commands/conductor-setup.md` or `.gemini/commands/setup.toml`) that your agent can execute.
|
|
112
|
-
- **Templates:** Workflow guides and style guides (e.g., `.opencode/conductor/templates/`).
|
|
113
|
-
|
|
114
|
-
### 3. Shell Completion
|
|
115
|
-
|
|
116
|
-
Enable tab completion for specific shells (Bash, Zsh) to make using `conductor-init` easier.
|
|
168
|
+
After installation, you can use the `conductor-init completion` command to generate the completion script.
|
|
117
169
|
|
|
118
170
|
#### Zsh (Recommended)
|
|
119
171
|
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import Io from"yargs";import{hideBin as bo}from"yargs/helpers";import Se from"@inquirer/select";var D={agentType:"opencode",agentDir:".opencode",commandsDir:"commands",displayName:"OpenCode",protocolFilename:"AGENTS.md",description:"The open source AI coding agent"};var L={agentType:"claude-code",agentDir:".claude",commandsDir:"commands",displayName:"Claude Code",protocolFilename:"CLAUDE.md",description:"Anthropic's coding assistant"};var k={agentType:"antigravity",agentDir:".agent",commandsDir:"workflows",displayName:"Antigravity",protocolFilename:"GEMINI.md",description:"Google's agentic coding assistant"};var M={agentType:"cursor",agentDir:".cursor",commandsDir:"commands",displayName:"Cursor",protocolFilename:"AGENTS.md",description:"Cursor IDE's AI agent"};import{parse as Lt}from"smol-toml";import{readFile as $t}from"fs/promises";import{join as Be,resolve as Le}from"path";import{fileURLToPath as Ft}from"url";import{homedir as Rt}from"os";import{execSync as ke}from"child_process";import{createHash as Pt}from"crypto";import $ from"fs-extra";var Me=Ft(new URL(".",import.meta.url)),B="https://github.com/gemini-cli-extensions/conductor",U="main";function Ue(o=B,e=U){let t=Pt("md5").update(`${o}#${e}`).digest("hex");return Be(Rt(),".gemini/cache/conductor",t)}async function jt(o=B,e=U){let t=Ue(o,e);if($.existsSync(t))try{console.log(`Updating templates from ${o} [${e}]...`),ke("git pull --rebase",{cwd:t,stdio:["ignore","ignore","pipe"]})}catch(r){console.warn(`Failed to update templates (using cached version): ${r instanceof Error?r.message:String(r)}`)}else{await $.ensureDir(t),console.log(`Downloading templates from ${o} [${e}]...`);try{ke(`git clone ${o} --branch ${e} --depth 1 .`,{cwd:t,stdio:["ignore","ignore","pipe"]})}catch(r){throw await $.remove(t),new Error(`Failed to clone templates: ${r instanceof Error?r.message:String(r)}`)}}}function u(o,e){return o.replace(/\{(\w+)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:t)}function Dt(){let o=Le(Me,"conductor");return $.existsSync(o)?o:Le(Me,"../conductor")}async function Ve(o,e){if(!o){let t=Dt();if(await $.pathExists(t))return console.log("use bundled Conductor templates"),t}return await jt(o,e),Ue(o,e)}async function He(o,e){let t=Be(e,o);return $t(t,"utf-8")}var de=class{process(e,t){let{installPath:r,agentType:n,fixedAgent:s}=t,i=Lt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`---
|
|
3
|
+
description: ${i.description||""}
|
|
4
|
+
agent: ${s}
|
|
5
|
+
---
|
|
6
|
+
${l}`}},Ye=new de;var V={agentType:"vscode-copilot",agentDir:".github",commandsDir:"prompts",displayName:"VS Code Copilot",protocolFilename:"AGENTS.md",description:"VS Code Copilot's Prompt Files",extension:".prompt.md",fixedAgent:"agent",strategy:{content:Ye}};var H={agentType:"codex",agentDir:".codex",commandsDir:"prompts",displayName:"Codex",protocolFilename:"AGENTS.md",description:"OpenAI Codex Agent",extension:".md"};var Y={agentType:"windsurf",agentDir:".windsurf",commandsDir:"workflows",displayName:"Windsurf",protocolFilename:"AGENTS.md",description:"Windsurf Cascade AI Agent"};import{parse as kt}from"smol-toml";var ue=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=kt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
7
|
+
|
|
8
|
+
`+i.description+`
|
|
9
|
+
|
|
10
|
+
`:`
|
|
11
|
+
|
|
12
|
+
`}${l}`}},We=new ue;var W={agentType:"cline",agentDir:".clinerules",commandsDir:"workflows",displayName:"Cline",protocolFilename:"AGENTS.md",description:"Cline AI coding assistant",strategy:{content:We}};import{join as Mt}from"path";import Bt from"fs-extra";import{parse as Vt}from"smol-toml";var{writeFile:Ut}=Bt,ye=class{process(e,t){let{installPath:r,agentType:n}=t;if(!Vt(e).prompt)return null;let i=e.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);return u(i,{agent_type:n})}},Ce=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:s,extension:i,content:p}=e,l=`${s}${i}`;await Ut(Mt(t,r,n,l),p)}},qe=new ye,ze=new Ce;var q={agentType:"gemini",agentDir:".gemini",commandsDir:"commands/conductor",displayName:"Gemini CLI",protocolFilename:"GEMINI.md",description:"Google Gemini CLI agent",extension:".toml",usesPrefix:!1,strategy:{content:qe,file:ze}};import{parse as Ht}from"smol-toml";var xe=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=Ht(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
13
|
+
|
|
14
|
+
`+i.description+`
|
|
15
|
+
|
|
16
|
+
`:`
|
|
17
|
+
|
|
18
|
+
`}${l}`}},Ke=new xe;var z={agentType:"kilo-code",agentDir:".kilocode",commandsDir:"workflows",displayName:"Kilo Code",protocolFilename:"AGENTS.md",description:"Kilo Code AI coding assistant",strategy:{content:Ke}};import{parse as Yt}from"smol-toml";var _e=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=Yt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
19
|
+
|
|
20
|
+
`+i.description+`
|
|
21
|
+
|
|
22
|
+
`:`
|
|
23
|
+
|
|
24
|
+
`}${l}`}},Xe=new _e;var K={agentType:"roo-code",agentDir:".roo",commandsDir:"commands",displayName:"Roo Code",protocolFilename:"AGENTS.md",description:"Roo Code AI coding assistant",strategy:{content:Xe}};import{parse as Wt}from"smol-toml";var he=class{process(e,t){let{installPath:r,agentType:n}=t,s=Wt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(i,{agent_type:n}),l="";return s.description&&(l=`---
|
|
25
|
+
description: "${s.description.replace(/"/g,'\\"')}"
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
`),`${l}${p}`}},Je=new he;var X={agentType:"qwen-code",agentDir:".qwen",commandsDir:"commands",displayName:"Qwen Code",protocolFilename:"AGENTS.md",description:"Qwen Code AI coding assistant",strategy:{content:Je}};import{parse as qt}from"smol-toml";var Ae=class{process(e,t){let{installPath:r,agentType:n}=t,s=qt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(i,{agent_type:n}),l="";return s.description&&(l=`---
|
|
29
|
+
description: "${s.description.replace(/"/g,'\\"')}"
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
`),`${l}${p}`}},Qe=new Ae;var J={agentType:"factory-droid",agentDir:".factory",commandsDir:"commands",displayName:"Factory Droid",protocolFilename:"AGENTS.md",description:"Factory Droid AI coding assistant",strategy:{content:Qe}};var b=[D,L,k,M,V,H,Y,W,z,K,X,J,q];async function Ze(o){let e=o==="codex",t=o==="cline";return await Se({message:"Select installation method:",choices:e?[{name:"Global (User Home Directory)",value:"global"}]:[{name:"Project (Current Directory)",value:"project"}],default:e?"global":"project"})}async function et(){let o=b.map(t=>{let{displayName:r,agentType:n,protocolFilename:s,agentDir:i,commandsDir:p,description:l}=t,y=l||`${r} agent`,_=`\x1B[90m(${s}, ${i}/${p})\x1B[0m`;return{name:`${r} ${_}`,value:n,description:y}});return await Se({message:"Select your coding agent:",choices:o,default:"opencode",loop:!0})}async function tt(){return await Se({message:"Configure git ignore for Conductor files?",choices:[{name:"Add to .gitignore",value:"gitignore",description:"Add Conductor entries to the project's .gitignore file"},{name:"Add to .git/info/exclude",value:"exclude",description:"Add Conductor entries to .git/info/exclude (local only, not shared)"},{name:"Remove existing entries",value:"none",description:"Remove Conductor entries from both .gitignore and .git/info/exclude"},{name:"Don't configure git ignore",value:void 0,description:"Skip git ignore configuration"}],default:void 0})}import{join as zt}from"path";import Kt from"fs-extra";import{parse as Jt}from"smol-toml";var F="conductor-";var{writeFile:Xt}=Kt,we=class{process(e,t){let{installPath:r,agentType:n}=t,s=Jt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r),i=i.replace(/\/conductor:/g,`/${F}`);let p=u(i,{agent_type:n});return s.description?`---
|
|
33
|
+
description: ${s.description}
|
|
34
|
+
---
|
|
35
|
+
${p}`:p}},ve=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:s,extension:i,content:p}=e,l=`${F}${s}${i}`;await Xt(zt(t,r,n,l),p)}},ot=new we,rt=new ve;import{join as C}from"path";import Qt from"@inquirer/select";import it from"fs-extra";var{existsSync:T,ensureDir:nt,copy:Te}=it,v=class{constructor(e){this.config=e}async validate(e,t){if(!T(e))throw new Error(`Target directory does not exist: ${e}`);let{agentDir:r,commandsDir:n,displayName:s,extension:i,usesPrefix:p}=this.config,_=`${p!==!1?F:""}setup${i||".md"}`,h=C(e,r,n,_),A=C(e,r,"conductor");if(T(A)&&T(h))throw new Error(`Conductor (${s}) is already installed in: ${e}`);return e}async generate(e,t,r,n,s){let{agentDir:i,commandsDir:p,agentType:l}=this.config,y=C(e,i),_=C(y,p),h=C(i,"conductor");t==="global"&&(h=`~/${i}/conductor`),await nt(_),await nt(C(y,"conductor"));let A=await Ve(r,n);try{let f=C(A,"templates"),S=C(y,"conductor","templates");await Te(f,S)}catch(f){console.warn("Failed to copy templates directory:",f)}let{protocolFilename:N}=this.config;if(N)try{let f=C(A,"GEMINI.md"),S=C(e,N);if(T(f)){let I=!0;T(S)&&!s&&(I=await Qt({message:`The protocol file '${N}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),I&&await Te(f,S)}}catch(f){console.warn("Failed to handle protocol file:",f)}let G=[];try{let f=C(A,"commands/conductor");if(T(f)){let S=await it.readdir(f);Array.isArray(S)&&(G=S.filter(I=>I.endsWith(".toml")).map(I=>I.replace(/\.toml$/,"")))}}catch(f){console.warn("Failed to discover commands:",f)}G.length===0?(console.log("No commands discovered, using default commands"),G=["setup","newTrack","implement","status","revert","review"]):console.log(`Discovered commands: ${G.join(", ")}`);let Nt=this.config.extension||".md",Gt=this.config.fixedAgent;for(let f of G)try{let S=await He(C("commands","conductor",`${f}.toml`),A),De=(this.config.strategy?.content||ot).process(S,{installPath:h,agentType:l,fixedAgent:Gt,commandName:f});De&&await(this.config.strategy?.file||rt).write({targetDir:e,agentDir:i,commandsDir:p,commandName:f,extension:Nt,content:De})}catch(S){console.warn(`Failed to process ${f}:`,S)}let Pe=C(A,"templates/workflow.md"),je=C(e,"conductor/workflow.md");if(T(je)&&T(Pe))try{await Te(Pe,je),console.log("\u2714 conductor/workflow.md synced")}catch(f){console.warn("Failed to handle workflow file:",f)}else console.warn("Workflow template not found, skipping workflow file sync")}};function d(o){return new v(o)}var Q=class{generator=d(D);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var Z=class{generator=d(L);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ee=class{generator=d(k);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var te=class{generator=d(M);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var oe=class{generator=d(V);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};import{homedir as st}from"os";var re=class{generator=d(H);validate(e,t){return t==="global"&&(e=st()),this.generator.validate(e,t)}generate(e,t,r,n){return t==="global"&&(e=st()),this.generator.generate(e,t,r,n)}};var ne=class{generator=d(Y);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ie=class{generator=d(W);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var se=class{generator=d(q);async validate(e,t){if(t==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.validate(e,t)}async generate(e,t,r,n){if(t==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.generate(e,t,r,n)}};var ae=class{generator=d(z);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ce=class extends v{constructor(){super(K)}};var pe=class extends v{constructor(){super(X)}};var le=class extends v{constructor(){super(J)}};function at(o){switch(o){case"claude-code":return new Z;case"antigravity":return new ee;case"cursor":return new te;case"vscode-copilot":return new oe;case"codex":return new re;case"windsurf":return new ne;case"cline":return new ie;case"kilo-code":return new ae;case"roo-code":return new ce;case"qwen-code":return new pe;case"factory-droid":return new le;case"gemini":return new se;default:return new Q}}import{resolve as io}from"path";import so from"@inquirer/select";import{join as Ie}from"path";import{readFile as be,writeFile as ct,access as Zt,mkdir as eo}from"fs/promises";import{constants as to}from"fs";var pt="# Conductor";function lt(o){let e=b.find(r=>r.agentType===o);if(!e)return[];let t=[];return e.agentDir&&t.push(e.agentDir),e.protocolFilename&&t.push(e.protocolFilename),t}function R(o){return o.replace(/\/+$/,"")}async function Ee(o){try{return await Zt(o,to.F_OK),!0}catch{return!1}}async function oo(o,e){let t=[],r=[];if(!await Ee(o))return{existing:[],missing:[...e]};let s=(await be(o,"utf-8")).split(`
|
|
36
|
+
`).map(i=>R(i.trim()));for(let i of e){let p=R(i);s.includes(p)?t.push(i):r.push(i)}return{existing:t,missing:r}}async function mt(o,e){let{existing:t,missing:r}=await oo(o,e);if(r.length===0)return{added:[],skipped:t};let n="";await Ee(o)&&(n=await be(o,"utf-8")),n.length>0&&!n.endsWith(`
|
|
37
|
+
`)&&(n+=`
|
|
38
|
+
`),n+=`
|
|
39
|
+
${pt}
|
|
40
|
+
`;for(let i of r)n+=`${i}
|
|
41
|
+
`;let s=Ie(o,"..");return await eo(s,{recursive:!0}),await ct(o,n,"utf-8"),{added:r,skipped:t}}async function Oe(o,e){if(!await Ee(o))return{removed:[]};let r=(await be(o,"utf-8")).split(`
|
|
42
|
+
`),n=e.map(R),s=[],i=[];for(let _ of r){let h=R(_.trim());if(h!==pt){if(n.includes(h)){let A=e.find(N=>R(N)===h);A&&!s.includes(A)&&s.push(A);continue}i.push(_)}}let p=[],l=!1;for(let _ of i){let h=_.trim()==="";h&&l||(p.push(_),l=h)}for(;p.length>0&&p[p.length-1].trim()==="";)p.pop();let y=p.length>0?p.join(`
|
|
43
|
+
`)+`
|
|
44
|
+
`:"";return await ct(o,y,"utf-8"),{removed:s}}function me(o,e){return e==="gitignore"?Ie(o,".gitignore"):Ie(o,".git","info","exclude")}async function gt(o,e,t){let r=lt(t);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${t}`}:e==="none"?await no(o,r):await ro(o,e,r)}async function ro(o,e,t){let r=me(o,e),n=await mt(r,t);if(n.added.length===0)return{action:"skipped",entries:n.skipped,message:"Git ignore entries already present, skipping.",targetFiles:[r]};let s=e==="gitignore"?".gitignore":".git/info/exclude";return{action:"added",entries:n.added,message:`Added ${n.added.length} entries to ${s}: ${n.added.join(", ")}`,targetFiles:[r]}}async function no(o,e){let t=me(o,"gitignore"),r=me(o,"exclude"),n=await Oe(t,e),s=await Oe(r,e),i=[...new Set([...n.removed,...s.removed])];if(i.length===0)return{action:"none",entries:[],message:"No Conductor git ignore entries found."};let p=[],l=[];return n.removed.length>0&&(p.push(t),l.push(`.gitignore (${n.removed.length})`)),s.removed.length>0&&(p.push(r),l.push(`.git/info/exclude (${s.removed.length})`)),{action:"removed",entries:i,message:`Removed entries from: ${l.join(", ")}`,targetFiles:p}}async function ft(o){let e=io(process.cwd(),o.path),t=o.force??!1;try{console.log(`Initializing Conductor in: ${e}`);let r;o.agent?(r=o.agent,console.log(`Using provided agent: ${r}`)):(console.log("Step 1: Prompting for agent selection..."),r=await et(),console.log(`\u2714 Selected agent: ${r}`));let n;o.scope?(n=o.scope,console.log(`Using provided scope: ${n}`)):n=await Ze(r),console.log(`\u2714 Selected scope: ${n}`);let s=o.gitIgnore;o.gitIgnore&&n==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),s=void 0):!o.gitIgnore&&n==="project"&&(s=await tt());let i=at(r);console.log(`
|
|
45
|
+
Step 3: Validating project directory...`);let p;try{p=await i.validate(e,n)}catch(l){if(l instanceof Error&&l.message.includes("already installed"))if(t)console.log("\u26A0 Force mode: Overwriting existing installation"),p=e;else if(await so({message:`${l.message}
|
|
46
|
+
Do you want to overwrite the existing installation?`,choices:[{value:!0,name:"Yes, overwrite"},{value:!1,name:"No, cancel"}]}))console.log("Overwriting existing installation..."),p=e;else{console.log("Installation cancelled.");return}else throw l}if(console.log(`\u2714 Validation complete: ${p}`),console.log(`
|
|
47
|
+
Step 4: Generating files...`),await i.generate(p,n,o.repo,o.branch,t),console.log("\u2714 Files generated"),s){console.log(`
|
|
48
|
+
Step 5: Configuring git ignore...`);let l=await gt(p,s,r);console.log(`\u2714 ${l.message}`)}console.log(`
|
|
49
|
+
\u2714 Conductor initialized successfully!`)}catch(r){console.error(`
|
|
50
|
+
\u2718 Installation failed:`,r instanceof Error?r.message:r),process.exit(1)}}import wo from"gradient-string";var dt=(o=0)=>e=>`\x1B[${e+o}m`,ut=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,yt=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nc=Object.keys(m.modifier),ao=Object.keys(m.color),co=Object.keys(m.bgColor),ic=[...ao,...co];function po(){let o=new Map;for(let[e,t]of Object.entries(m)){for(let[r,n]of Object.entries(t))m[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=m[r],o.set(n[0],n[1]);Object.defineProperty(m,e,{value:t,enumerable:!1})}return Object.defineProperty(m,"codes",{value:o,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=dt(),m.color.ansi256=ut(),m.color.ansi16m=yt(),m.bgColor.ansi=dt(10),m.bgColor.ansi256=ut(10),m.bgColor.ansi16m=yt(10),Object.defineProperties(m,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>m.rgbToAnsi256(...m.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;let p=e%36;t=Math.floor(e/36)/5,r=Math.floor(p/6)/5,n=p%6/5}let s=Math.max(t,r,n)*2;if(s===0)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}var lo=po(),w=lo;import Ne from"process";import mo from"os";import Ct from"tty";function x(o,e=globalThis.Deno?globalThis.Deno.args:Ne.argv){let t=o.startsWith("-")?"":o.length===1?"-":"--",r=e.indexOf(t+o),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:g}=Ne,ge;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?ge=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(ge=1);function go(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function fo(o){return o===0?!1:{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3}}function uo(o,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=go();r!==void 0&&(ge=r);let n=t?ge:r;if(n===0)return 0;if(t){if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(o&&!e&&n===void 0)return 0;let s=n||0;if(g.TERM==="dumb")return s;if(Ne.platform==="win32"){let i=mo.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in g)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(i=>i in g)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in g)||g.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty"||g.TERM==="xterm-ghostty"||g.TERM==="wezterm")return 3;if("TERM_PROGRAM"in g){let i=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:s}function xt(o,e={}){let t=uo(o,{streamIsTTY:o&&o.isTTY,...e});return fo(t)}var yo={stdout:xt({isTTY:Ct.isatty(1)}),stderr:xt({isTTY:Ct.isatty(2)})},_t=yo;function ht(o,e,t){let r=o.indexOf(e);if(r===-1)return o;let n=e.length,s=0,i="";do i+=o.slice(s,r)+e+t,s=r+n,r=o.indexOf(e,s);while(r!==-1);return i+=o.slice(s),i}function At(o,e,t,r){let n=0,s="";do{let i=o[r-1]==="\r";s+=o.slice(n,i?r-1:r)+e+(i?`\r
|
|
51
|
+
`:`
|
|
52
|
+
`)+t,n=r+1,r=o.indexOf(`
|
|
53
|
+
`,n)}while(r!==-1);return s+=o.slice(n),s}var{stdout:St,stderr:wt}=_t,Ge=Symbol("GENERATOR"),E=Symbol("STYLER"),P=Symbol("IS_EMPTY"),vt=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null),Co=(o,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=St?St.level:0;o.level=e.level===void 0?t:e.level};var xo=o=>{let e=(...t)=>t.join(" ");return Co(e,o),Object.setPrototypeOf(e,j.prototype),e};function j(o){return xo(o)}Object.setPrototypeOf(j.prototype,Function.prototype);for(let[o,e]of Object.entries(w))O[o]={get(){let t=fe(this,Fe(e.open,e.close,this[E]),this[P]);return Object.defineProperty(this,o,{value:t}),t}};O.visible={get(){let o=fe(this,this[E],!0);return Object.defineProperty(this,"visible",{value:o}),o}};var $e=(o,e,t,...r)=>o==="rgb"?e==="ansi16m"?w[t].ansi16m(...r):e==="ansi256"?w[t].ansi256(w.rgbToAnsi256(...r)):w[t].ansi(w.rgbToAnsi(...r)):o==="hex"?$e("rgb",e,t,...w.hexToRgb(...r)):w[t][o](...r),_o=["rgb","hex","ansi256"];for(let o of _o){O[o]={get(){let{level:t}=this;return function(...r){let n=Fe($e(o,vt[t],"color",...r),w.color.close,this[E]);return fe(this,n,this[P])}}};let e="bg"+o[0].toUpperCase()+o.slice(1);O[e]={get(){let{level:t}=this;return function(...r){let n=Fe($e(o,vt[t],"bgColor",...r),w.bgColor.close,this[E]);return fe(this,n,this[P])}}}}var ho=Object.defineProperties(()=>{},{...O,level:{enumerable:!0,get(){return this[Ge].level},set(o){this[Ge].level=o}}}),Fe=(o,e,t)=>{let r,n;return t===void 0?(r=o,n=e):(r=t.openAll+o,n=e+t.closeAll),{open:o,close:e,openAll:r,closeAll:n,parent:t}},fe=(o,e,t)=>{let r=(...n)=>Ao(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,ho),r[Ge]=o,r[E]=e,r[P]=t,r},Ao=(o,e)=>{if(o.level<=0||!e)return o[P]?"":e;let t=o[E];if(t===void 0)return e;let{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=ht(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
54
|
+
`);return s!==-1&&(e=At(e,n,r,s)),r+e+n};Object.defineProperties(j.prototype,O);var So=j(),xc=j({level:wt?wt.level:0});var Tt=So;import It from"fs";import Re from"path";import{fileURLToPath as vo}from"url";var To=`
|
|
55
|
+
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
56
|
+
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
57
|
+
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
58
|
+
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
59
|
+
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
60
|
+
|
|
61
|
+
`;function bt(){let o=Re.dirname(vo(import.meta.url)),e=Re.join(o,"../package.json");It.existsSync(e)||(e=Re.join(o,"../../package.json"));let r=JSON.parse(It.readFileSync(e,"utf-8")).version;console.log(Tt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
62
|
+
`))}function Et(){console.log(wo("cyan","green")(To))}async function Eo(o){return await Io(bo(process.argv)).scriptName(o).usage("$0 [path] [options]").positional("path",{describe:"Directory to install Conductor",default:".",type:"string"}).option("agent",{alias:"a",describe:"Specify the coding agent",type:"string",choices:b.map(e=>e.agentType)}).option("repo",{alias:"r",describe:"Git repository URL for conductor. If used without value, defaults to official repository.",type:"string"}).coerce("repo",e=>e===""?B:e).option("branch",{alias:"b",describe:"Branch name for conductor repository",type:"string",default:U}).option("scope",{alias:"s",describe:"Installation scope (project or global)",type:"string",choices:["project","global"]}).option("git-ignore",{alias:"g",describe:"Configure git ignore for Conductor files (gitignore: add to .gitignore, exclude: add to .git/info/exclude, none: remove entries)",type:"string",choices:["gitignore","exclude","none"]}).coerce("git-ignore",e=>e===""?"exclude":e).option("force",{alias:"f",describe:"Force overwrite existing installation",type:"boolean",default:!1}).example("$0","Install with interactive prompts").example("$0 --agent claude-code","Install for Claude Code agent").example("$0 --git-ignore gitignore","Add Conductor files to .gitignore").example("$0 --git-ignore exclude","Add Conductor files to .git/info/exclude").example("$0 --git-ignore none","Remove Conductor entries from git ignore").help().alias("h","help").version().alias("v","version").completion("completion",!1).parseAsync()}async function Ot(o){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Et(),bt());let e=await Eo(o),t=e._[0];process.argv.includes("completion")||process.argv.includes("--get-yargs-completions")||await ft({...e,path:t||e.path||".",gitIgnore:e["git-ignore"],$0:"conductor-init",_:e._})}Ot("conductor-init").catch(o=>{console.error("Error:",o instanceof Error?o.message:o),process.exit(1)});
|
package/dist/index.js
CHANGED
|
@@ -1,57 +1,62 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import
|
|
3
|
-
description: ${
|
|
4
|
-
agent: ${
|
|
2
|
+
import Io from"yargs";import{hideBin as bo}from"yargs/helpers";import Se from"@inquirer/select";var D={agentType:"opencode",agentDir:".opencode",commandsDir:"commands",displayName:"OpenCode",protocolFilename:"AGENTS.md",description:"The open source AI coding agent"};var L={agentType:"claude-code",agentDir:".claude",commandsDir:"commands",displayName:"Claude Code",protocolFilename:"CLAUDE.md",description:"Anthropic's coding assistant"};var k={agentType:"antigravity",agentDir:".agent",commandsDir:"workflows",displayName:"Antigravity",protocolFilename:"GEMINI.md",description:"Google's agentic coding assistant"};var M={agentType:"cursor",agentDir:".cursor",commandsDir:"commands",displayName:"Cursor",protocolFilename:"AGENTS.md",description:"Cursor IDE's AI agent"};import{parse as Lt}from"smol-toml";import{readFile as $t}from"fs/promises";import{join as Be,resolve as Le}from"path";import{fileURLToPath as Ft}from"url";import{homedir as Rt}from"os";import{execSync as ke}from"child_process";import{createHash as Pt}from"crypto";import $ from"fs-extra";var Me=Ft(new URL(".",import.meta.url)),B="https://github.com/gemini-cli-extensions/conductor",U="main";function Ue(o=B,e=U){let t=Pt("md5").update(`${o}#${e}`).digest("hex");return Be(Rt(),".gemini/cache/conductor",t)}async function jt(o=B,e=U){let t=Ue(o,e);if($.existsSync(t))try{console.log(`Updating templates from ${o} [${e}]...`),ke("git pull --rebase",{cwd:t,stdio:["ignore","ignore","pipe"]})}catch(r){console.warn(`Failed to update templates (using cached version): ${r instanceof Error?r.message:String(r)}`)}else{await $.ensureDir(t),console.log(`Downloading templates from ${o} [${e}]...`);try{ke(`git clone ${o} --branch ${e} --depth 1 .`,{cwd:t,stdio:["ignore","ignore","pipe"]})}catch(r){throw await $.remove(t),new Error(`Failed to clone templates: ${r instanceof Error?r.message:String(r)}`)}}}function u(o,e){return o.replace(/\{(\w+)\}/g,(t,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:t)}function Dt(){let o=Le(Me,"conductor");return $.existsSync(o)?o:Le(Me,"../conductor")}async function Ve(o,e){if(!o){let t=Dt();if(await $.pathExists(t))return console.log("use bundled Conductor templates"),t}return await jt(o,e),Ue(o,e)}async function He(o,e){let t=Be(e,o);return $t(t,"utf-8")}var de=class{process(e,t){let{installPath:r,agentType:n,fixedAgent:s}=t,i=Lt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`---
|
|
3
|
+
description: ${i.description||""}
|
|
4
|
+
agent: ${s}
|
|
5
5
|
---
|
|
6
|
-
${
|
|
6
|
+
${l}`}},Ye=new de;var V={agentType:"vscode-copilot",agentDir:".github",commandsDir:"prompts",displayName:"VS Code Copilot",protocolFilename:"AGENTS.md",description:"VS Code Copilot's Prompt Files",extension:".prompt.md",fixedAgent:"agent",strategy:{content:Ye}};var H={agentType:"codex",agentDir:".codex",commandsDir:"prompts",displayName:"Codex",protocolFilename:"AGENTS.md",description:"OpenAI Codex Agent",extension:".md"};var Y={agentType:"windsurf",agentDir:".windsurf",commandsDir:"workflows",displayName:"Windsurf",protocolFilename:"AGENTS.md",description:"Windsurf Cascade AI Agent"};import{parse as kt}from"smol-toml";var ue=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=kt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
7
7
|
|
|
8
|
-
`+
|
|
8
|
+
`+i.description+`
|
|
9
9
|
|
|
10
10
|
`:`
|
|
11
11
|
|
|
12
|
-
`}${
|
|
12
|
+
`}${l}`}},We=new ue;var W={agentType:"cline",agentDir:".clinerules",commandsDir:"workflows",displayName:"Cline",protocolFilename:"AGENTS.md",description:"Cline AI coding assistant",strategy:{content:We}};import{join as Mt}from"path";import Bt from"fs-extra";import{parse as Vt}from"smol-toml";var{writeFile:Ut}=Bt,ye=class{process(e,t){let{installPath:r,agentType:n}=t;if(!Vt(e).prompt)return null;let i=e.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);return u(i,{agent_type:n})}},Ce=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:s,extension:i,content:p}=e,l=`${s}${i}`;await Ut(Mt(t,r,n,l),p)}},qe=new ye,ze=new Ce;var q={agentType:"gemini",agentDir:".gemini",commandsDir:"commands/conductor",displayName:"Gemini CLI",protocolFilename:"GEMINI.md",description:"Google Gemini CLI agent",extension:".toml",usesPrefix:!1,strategy:{content:qe,file:ze}};import{parse as Ht}from"smol-toml";var xe=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=Ht(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
13
13
|
|
|
14
|
-
`+
|
|
14
|
+
`+i.description+`
|
|
15
15
|
|
|
16
16
|
`:`
|
|
17
17
|
|
|
18
|
-
`}${
|
|
18
|
+
`}${l}`}},Ke=new xe;var z={agentType:"kilo-code",agentDir:".kilocode",commandsDir:"workflows",displayName:"Kilo Code",protocolFilename:"AGENTS.md",description:"Kilo Code AI coding assistant",strategy:{content:Ke}};import{parse as Yt}from"smol-toml";var _e=class{process(e,t){let{installPath:r,agentType:n,commandName:s}=t,i=Yt(e);if(!i.prompt)return null;let p=i.prompt;p=p.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=u(p,{agent_type:n});return`# Conductor ${s?s.charAt(0).toUpperCase()+s.slice(1):"Command"}${i.description?`
|
|
19
19
|
|
|
20
|
-
`+
|
|
20
|
+
`+i.description+`
|
|
21
21
|
|
|
22
22
|
`:`
|
|
23
23
|
|
|
24
|
-
`}${
|
|
25
|
-
description: "${
|
|
24
|
+
`}${l}`}},Xe=new _e;var K={agentType:"roo-code",agentDir:".roo",commandsDir:"commands",displayName:"Roo Code",protocolFilename:"AGENTS.md",description:"Roo Code AI coding assistant",strategy:{content:Xe}};import{parse as Wt}from"smol-toml";var he=class{process(e,t){let{installPath:r,agentType:n}=t,s=Wt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(i,{agent_type:n}),l="";return s.description&&(l=`---
|
|
25
|
+
description: "${s.description.replace(/"/g,'\\"')}"
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
`),`${
|
|
29
|
-
description: "${
|
|
28
|
+
`),`${l}${p}`}},Je=new he;var X={agentType:"qwen-code",agentDir:".qwen",commandsDir:"commands",displayName:"Qwen Code",protocolFilename:"AGENTS.md",description:"Qwen Code AI coding assistant",strategy:{content:Je}};import{parse as qt}from"smol-toml";var Ae=class{process(e,t){let{installPath:r,agentType:n}=t,s=qt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(i,{agent_type:n}),l="";return s.description&&(l=`---
|
|
29
|
+
description: "${s.description.replace(/"/g,'\\"')}"
|
|
30
30
|
---
|
|
31
31
|
|
|
32
|
-
`),`${
|
|
33
|
-
description: ${
|
|
32
|
+
`),`${l}${p}`}},Qe=new Ae;var J={agentType:"factory-droid",agentDir:".factory",commandsDir:"commands",displayName:"Factory Droid",protocolFilename:"AGENTS.md",description:"Factory Droid AI coding assistant",strategy:{content:Qe}};var b=[D,L,k,M,V,H,Y,W,z,K,X,J,q];async function Ze(o){let e=o==="codex",t=o==="cline";return await Se({message:"Select installation method:",choices:e?[{name:"Global (User Home Directory)",value:"global"}]:[{name:"Project (Current Directory)",value:"project"}],default:e?"global":"project"})}async function et(){let o=b.map(t=>{let{displayName:r,agentType:n,protocolFilename:s,agentDir:i,commandsDir:p,description:l}=t,y=l||`${r} agent`,_=`\x1B[90m(${s}, ${i}/${p})\x1B[0m`;return{name:`${r} ${_}`,value:n,description:y}});return await Se({message:"Select your coding agent:",choices:o,default:"opencode",loop:!0})}async function tt(){return await Se({message:"Configure git ignore for Conductor files?",choices:[{name:"Add to .gitignore",value:"gitignore",description:"Add Conductor entries to the project's .gitignore file"},{name:"Add to .git/info/exclude",value:"exclude",description:"Add Conductor entries to .git/info/exclude (local only, not shared)"},{name:"Remove existing entries",value:"none",description:"Remove Conductor entries from both .gitignore and .git/info/exclude"},{name:"Don't configure git ignore",value:void 0,description:"Skip git ignore configuration"}],default:void 0})}import{join as zt}from"path";import Kt from"fs-extra";import{parse as Jt}from"smol-toml";var F="conductor-";var{writeFile:Xt}=Kt,we=class{process(e,t){let{installPath:r,agentType:n}=t,s=Jt(e);if(!s.prompt)return null;let i=s.prompt;i=i.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r),i=i.replace(/\/conductor:/g,`/${F}`);let p=u(i,{agent_type:n});return s.description?`---
|
|
33
|
+
description: ${s.description}
|
|
34
34
|
---
|
|
35
|
-
${
|
|
36
|
-
`).map(
|
|
35
|
+
${p}`:p}},ve=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:s,extension:i,content:p}=e,l=`${F}${s}${i}`;await Xt(zt(t,r,n,l),p)}},ot=new we,rt=new ve;import{join as C}from"path";import Qt from"@inquirer/select";import it from"fs-extra";var{existsSync:T,ensureDir:nt,copy:Te}=it,v=class{constructor(e){this.config=e}async validate(e,t){if(!T(e))throw new Error(`Target directory does not exist: ${e}`);let{agentDir:r,commandsDir:n,displayName:s,extension:i,usesPrefix:p}=this.config,_=`${p!==!1?F:""}setup${i||".md"}`,h=C(e,r,n,_),A=C(e,r,"conductor");if(T(A)&&T(h))throw new Error(`Conductor (${s}) is already installed in: ${e}`);return e}async generate(e,t,r,n,s){let{agentDir:i,commandsDir:p,agentType:l}=this.config,y=C(e,i),_=C(y,p),h=C(i,"conductor");t==="global"&&(h=`~/${i}/conductor`),await nt(_),await nt(C(y,"conductor"));let A=await Ve(r,n);try{let f=C(A,"templates"),S=C(y,"conductor","templates");await Te(f,S)}catch(f){console.warn("Failed to copy templates directory:",f)}let{protocolFilename:N}=this.config;if(N)try{let f=C(A,"GEMINI.md"),S=C(e,N);if(T(f)){let I=!0;T(S)&&!s&&(I=await Qt({message:`The protocol file '${N}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),I&&await Te(f,S)}}catch(f){console.warn("Failed to handle protocol file:",f)}let G=[];try{let f=C(A,"commands/conductor");if(T(f)){let S=await it.readdir(f);Array.isArray(S)&&(G=S.filter(I=>I.endsWith(".toml")).map(I=>I.replace(/\.toml$/,"")))}}catch(f){console.warn("Failed to discover commands:",f)}G.length===0?(console.log("No commands discovered, using default commands"),G=["setup","newTrack","implement","status","revert","review"]):console.log(`Discovered commands: ${G.join(", ")}`);let Nt=this.config.extension||".md",Gt=this.config.fixedAgent;for(let f of G)try{let S=await He(C("commands","conductor",`${f}.toml`),A),De=(this.config.strategy?.content||ot).process(S,{installPath:h,agentType:l,fixedAgent:Gt,commandName:f});De&&await(this.config.strategy?.file||rt).write({targetDir:e,agentDir:i,commandsDir:p,commandName:f,extension:Nt,content:De})}catch(S){console.warn(`Failed to process ${f}:`,S)}let Pe=C(A,"templates/workflow.md"),je=C(e,"conductor/workflow.md");if(T(je)&&T(Pe))try{await Te(Pe,je),console.log("\u2714 conductor/workflow.md synced")}catch(f){console.warn("Failed to handle workflow file:",f)}else console.warn("Workflow template not found, skipping workflow file sync")}};function d(o){return new v(o)}var Q=class{generator=d(D);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var Z=class{generator=d(L);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ee=class{generator=d(k);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var te=class{generator=d(M);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var oe=class{generator=d(V);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};import{homedir as st}from"os";var re=class{generator=d(H);validate(e,t){return t==="global"&&(e=st()),this.generator.validate(e,t)}generate(e,t,r,n){return t==="global"&&(e=st()),this.generator.generate(e,t,r,n)}};var ne=class{generator=d(Y);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ie=class{generator=d(W);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var se=class{generator=d(q);async validate(e,t){if(t==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.validate(e,t)}async generate(e,t,r,n){if(t==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.generate(e,t,r,n)}};var ae=class{generator=d(z);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n){return this.generator.generate(e,t,r,n)}};var ce=class extends v{constructor(){super(K)}};var pe=class extends v{constructor(){super(X)}};var le=class extends v{constructor(){super(J)}};function at(o){switch(o){case"claude-code":return new Z;case"antigravity":return new ee;case"cursor":return new te;case"vscode-copilot":return new oe;case"codex":return new re;case"windsurf":return new ne;case"cline":return new ie;case"kilo-code":return new ae;case"roo-code":return new ce;case"qwen-code":return new pe;case"factory-droid":return new le;case"gemini":return new se;default:return new Q}}import{resolve as io}from"path";import so from"@inquirer/select";import{join as Ie}from"path";import{readFile as be,writeFile as ct,access as Zt,mkdir as eo}from"fs/promises";import{constants as to}from"fs";var pt="# Conductor";function lt(o){let e=b.find(r=>r.agentType===o);if(!e)return[];let t=[];return e.agentDir&&t.push(e.agentDir),e.protocolFilename&&t.push(e.protocolFilename),t}function R(o){return o.replace(/\/+$/,"")}async function Ee(o){try{return await Zt(o,to.F_OK),!0}catch{return!1}}async function oo(o,e){let t=[],r=[];if(!await Ee(o))return{existing:[],missing:[...e]};let s=(await be(o,"utf-8")).split(`
|
|
36
|
+
`).map(i=>R(i.trim()));for(let i of e){let p=R(i);s.includes(p)?t.push(i):r.push(i)}return{existing:t,missing:r}}async function mt(o,e){let{existing:t,missing:r}=await oo(o,e);if(r.length===0)return{added:[],skipped:t};let n="";await Ee(o)&&(n=await be(o,"utf-8")),n.length>0&&!n.endsWith(`
|
|
37
37
|
`)&&(n+=`
|
|
38
38
|
`),n+=`
|
|
39
|
-
${
|
|
40
|
-
`;for(let
|
|
41
|
-
`;let
|
|
42
|
-
`),n=e.map(
|
|
39
|
+
${pt}
|
|
40
|
+
`;for(let i of r)n+=`${i}
|
|
41
|
+
`;let s=Ie(o,"..");return await eo(s,{recursive:!0}),await ct(o,n,"utf-8"),{added:r,skipped:t}}async function Oe(o,e){if(!await Ee(o))return{removed:[]};let r=(await be(o,"utf-8")).split(`
|
|
42
|
+
`),n=e.map(R),s=[],i=[];for(let _ of r){let h=R(_.trim());if(h!==pt){if(n.includes(h)){let A=e.find(N=>R(N)===h);A&&!s.includes(A)&&s.push(A);continue}i.push(_)}}let p=[],l=!1;for(let _ of i){let h=_.trim()==="";h&&l||(p.push(_),l=h)}for(;p.length>0&&p[p.length-1].trim()==="";)p.pop();let y=p.length>0?p.join(`
|
|
43
43
|
`)+`
|
|
44
|
-
`:"";return await
|
|
45
|
-
Step 3: Validating project directory...`);let
|
|
46
|
-
Do you want to overwrite the existing installation?`,choices:[{value:!0,name:"Yes, overwrite"},{value:!1,name:"No, cancel"}]}))console.log("Overwriting existing installation..."),
|
|
47
|
-
Step 4: Generating files...`),await
|
|
48
|
-
Step 5: Configuring git ignore...`);let
|
|
44
|
+
`:"";return await ct(o,y,"utf-8"),{removed:s}}function me(o,e){return e==="gitignore"?Ie(o,".gitignore"):Ie(o,".git","info","exclude")}async function gt(o,e,t){let r=lt(t);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${t}`}:e==="none"?await no(o,r):await ro(o,e,r)}async function ro(o,e,t){let r=me(o,e),n=await mt(r,t);if(n.added.length===0)return{action:"skipped",entries:n.skipped,message:"Git ignore entries already present, skipping.",targetFiles:[r]};let s=e==="gitignore"?".gitignore":".git/info/exclude";return{action:"added",entries:n.added,message:`Added ${n.added.length} entries to ${s}: ${n.added.join(", ")}`,targetFiles:[r]}}async function no(o,e){let t=me(o,"gitignore"),r=me(o,"exclude"),n=await Oe(t,e),s=await Oe(r,e),i=[...new Set([...n.removed,...s.removed])];if(i.length===0)return{action:"none",entries:[],message:"No Conductor git ignore entries found."};let p=[],l=[];return n.removed.length>0&&(p.push(t),l.push(`.gitignore (${n.removed.length})`)),s.removed.length>0&&(p.push(r),l.push(`.git/info/exclude (${s.removed.length})`)),{action:"removed",entries:i,message:`Removed entries from: ${l.join(", ")}`,targetFiles:p}}async function ft(o){let e=io(process.cwd(),o.path),t=o.force??!1;try{console.log(`Initializing Conductor in: ${e}`);let r;o.agent?(r=o.agent,console.log(`Using provided agent: ${r}`)):(console.log("Step 1: Prompting for agent selection..."),r=await et(),console.log(`\u2714 Selected agent: ${r}`));let n;o.scope?(n=o.scope,console.log(`Using provided scope: ${n}`)):n=await Ze(r),console.log(`\u2714 Selected scope: ${n}`);let s=o.gitIgnore;o.gitIgnore&&n==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),s=void 0):!o.gitIgnore&&n==="project"&&(s=await tt());let i=at(r);console.log(`
|
|
45
|
+
Step 3: Validating project directory...`);let p;try{p=await i.validate(e,n)}catch(l){if(l instanceof Error&&l.message.includes("already installed"))if(t)console.log("\u26A0 Force mode: Overwriting existing installation"),p=e;else if(await so({message:`${l.message}
|
|
46
|
+
Do you want to overwrite the existing installation?`,choices:[{value:!0,name:"Yes, overwrite"},{value:!1,name:"No, cancel"}]}))console.log("Overwriting existing installation..."),p=e;else{console.log("Installation cancelled.");return}else throw l}if(console.log(`\u2714 Validation complete: ${p}`),console.log(`
|
|
47
|
+
Step 4: Generating files...`),await i.generate(p,n,o.repo,o.branch,t),console.log("\u2714 Files generated"),s){console.log(`
|
|
48
|
+
Step 5: Configuring git ignore...`);let l=await gt(p,s,r);console.log(`\u2714 ${l.message}`)}console.log(`
|
|
49
49
|
\u2714 Conductor initialized successfully!`)}catch(r){console.error(`
|
|
50
|
-
\u2718 Installation failed:`,r instanceof Error?r.message:r),process.exit(1)}}import
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
50
|
+
\u2718 Installation failed:`,r instanceof Error?r.message:r),process.exit(1)}}import wo from"gradient-string";var dt=(o=0)=>e=>`\x1B[${e+o}m`,ut=(o=0)=>e=>`\x1B[${38+o};5;${e}m`,yt=(o=0)=>(e,t,r)=>`\x1B[${38+o};2;${e};${t};${r}m`,m={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}},nc=Object.keys(m.modifier),ao=Object.keys(m.color),co=Object.keys(m.bgColor),ic=[...ao,...co];function po(){let o=new Map;for(let[e,t]of Object.entries(m)){for(let[r,n]of Object.entries(t))m[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=m[r],o.set(n[0],n[1]);Object.defineProperty(m,e,{value:t,enumerable:!1})}return Object.defineProperty(m,"codes",{value:o,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=dt(),m.color.ansi256=ut(),m.color.ansi16m=yt(),m.bgColor.ansi=dt(10),m.bgColor.ansi256=ut(10),m.bgColor.ansi16m=yt(10),Object.defineProperties(m,{rgbToAnsi256:{value(e,t,r){return e===t&&t===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(t/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let t=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!t)return[0,0,0];let[r]=t;r.length===3&&(r=[...r].map(s=>s+s).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>m.rgbToAnsi256(...m.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let t,r,n;if(e>=232)t=((e-232)*10+8)/255,r=t,n=t;else{e-=16;let p=e%36;t=Math.floor(e/36)/5,r=Math.floor(p/6)/5,n=p%6/5}let s=Math.max(t,r,n)*2;if(s===0)return 30;let i=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return s===2&&(i+=60),i},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}var lo=po(),w=lo;import Ne from"process";import mo from"os";import Ct from"tty";function x(o,e=globalThis.Deno?globalThis.Deno.args:Ne.argv){let t=o.startsWith("-")?"":o.length===1?"-":"--",r=e.indexOf(t+o),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:g}=Ne,ge;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?ge=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(ge=1);function go(){if("FORCE_COLOR"in g)return g.FORCE_COLOR==="true"?1:g.FORCE_COLOR==="false"?0:g.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(g.FORCE_COLOR,10),3)}function fo(o){return o===0?!1:{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3}}function uo(o,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=go();r!==void 0&&(ge=r);let n=t?ge:r;if(n===0)return 0;if(t){if(x("color=16m")||x("color=full")||x("color=truecolor"))return 3;if(x("color=256"))return 2}if("TF_BUILD"in g&&"AGENT_NAME"in g)return 1;if(o&&!e&&n===void 0)return 0;let s=n||0;if(g.TERM==="dumb")return s;if(Ne.platform==="win32"){let i=mo.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in g)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(i=>i in g)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(i=>i in g)||g.CI_NAME==="codeship"?1:s;if("TEAMCITY_VERSION"in g)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(g.TEAMCITY_VERSION)?1:0;if(g.COLORTERM==="truecolor"||g.TERM==="xterm-kitty"||g.TERM==="xterm-ghostty"||g.TERM==="wezterm")return 3;if("TERM_PROGRAM"in g){let i=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(g.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(g.TERM)||"COLORTERM"in g?1:s}function xt(o,e={}){let t=uo(o,{streamIsTTY:o&&o.isTTY,...e});return fo(t)}var yo={stdout:xt({isTTY:Ct.isatty(1)}),stderr:xt({isTTY:Ct.isatty(2)})},_t=yo;function ht(o,e,t){let r=o.indexOf(e);if(r===-1)return o;let n=e.length,s=0,i="";do i+=o.slice(s,r)+e+t,s=r+n,r=o.indexOf(e,s);while(r!==-1);return i+=o.slice(s),i}function At(o,e,t,r){let n=0,s="";do{let i=o[r-1]==="\r";s+=o.slice(n,i?r-1:r)+e+(i?`\r
|
|
51
|
+
`:`
|
|
52
|
+
`)+t,n=r+1,r=o.indexOf(`
|
|
53
|
+
`,n)}while(r!==-1);return s+=o.slice(n),s}var{stdout:St,stderr:wt}=_t,Ge=Symbol("GENERATOR"),E=Symbol("STYLER"),P=Symbol("IS_EMPTY"),vt=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null),Co=(o,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3))throw new Error("The `level` option should be an integer from 0 to 3");let t=St?St.level:0;o.level=e.level===void 0?t:e.level};var xo=o=>{let e=(...t)=>t.join(" ");return Co(e,o),Object.setPrototypeOf(e,j.prototype),e};function j(o){return xo(o)}Object.setPrototypeOf(j.prototype,Function.prototype);for(let[o,e]of Object.entries(w))O[o]={get(){let t=fe(this,Fe(e.open,e.close,this[E]),this[P]);return Object.defineProperty(this,o,{value:t}),t}};O.visible={get(){let o=fe(this,this[E],!0);return Object.defineProperty(this,"visible",{value:o}),o}};var $e=(o,e,t,...r)=>o==="rgb"?e==="ansi16m"?w[t].ansi16m(...r):e==="ansi256"?w[t].ansi256(w.rgbToAnsi256(...r)):w[t].ansi(w.rgbToAnsi(...r)):o==="hex"?$e("rgb",e,t,...w.hexToRgb(...r)):w[t][o](...r),_o=["rgb","hex","ansi256"];for(let o of _o){O[o]={get(){let{level:t}=this;return function(...r){let n=Fe($e(o,vt[t],"color",...r),w.color.close,this[E]);return fe(this,n,this[P])}}};let e="bg"+o[0].toUpperCase()+o.slice(1);O[e]={get(){let{level:t}=this;return function(...r){let n=Fe($e(o,vt[t],"bgColor",...r),w.bgColor.close,this[E]);return fe(this,n,this[P])}}}}var ho=Object.defineProperties(()=>{},{...O,level:{enumerable:!0,get(){return this[Ge].level},set(o){this[Ge].level=o}}}),Fe=(o,e,t)=>{let r,n;return t===void 0?(r=o,n=e):(r=t.openAll+o,n=e+t.closeAll),{open:o,close:e,openAll:r,closeAll:n,parent:t}},fe=(o,e,t)=>{let r=(...n)=>Ao(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,ho),r[Ge]=o,r[E]=e,r[P]=t,r},Ao=(o,e)=>{if(o.level<=0||!e)return o[P]?"":e;let t=o[E];if(t===void 0)return e;let{openAll:r,closeAll:n}=t;if(e.includes("\x1B"))for(;t!==void 0;)e=ht(e,t.close,t.open),t=t.parent;let s=e.indexOf(`
|
|
54
|
+
`);return s!==-1&&(e=At(e,n,r,s)),r+e+n};Object.defineProperties(j.prototype,O);var So=j(),xc=j({level:wt?wt.level:0});var Tt=So;import It from"fs";import Re from"path";import{fileURLToPath as vo}from"url";var To=`
|
|
55
|
+
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
56
|
+
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
57
|
+
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
58
|
+
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
59
|
+
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
56
60
|
|
|
57
|
-
`;function
|
|
61
|
+
`;function bt(){let o=Re.dirname(vo(import.meta.url)),e=Re.join(o,"../package.json");It.existsSync(e)||(e=Re.join(o,"../../package.json"));let r=JSON.parse(It.readFileSync(e,"utf-8")).version;console.log(Tt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
62
|
+
`))}function Et(){console.log(wo("cyan","green")(To))}async function Eo(o){return await Io(bo(process.argv)).scriptName(o).usage("$0 [path] [options]").positional("path",{describe:"Directory to install Conductor",default:".",type:"string"}).option("agent",{alias:"a",describe:"Specify the coding agent",type:"string",choices:b.map(e=>e.agentType)}).option("repo",{alias:"r",describe:"Git repository URL for conductor. If used without value, defaults to official repository.",type:"string"}).coerce("repo",e=>e===""?B:e).option("branch",{alias:"b",describe:"Branch name for conductor repository",type:"string",default:U}).option("scope",{alias:"s",describe:"Installation scope (project or global)",type:"string",choices:["project","global"]}).option("git-ignore",{alias:"g",describe:"Configure git ignore for Conductor files (gitignore: add to .gitignore, exclude: add to .git/info/exclude, none: remove entries)",type:"string",choices:["gitignore","exclude","none"]}).coerce("git-ignore",e=>e===""?"exclude":e).option("force",{alias:"f",describe:"Force overwrite existing installation",type:"boolean",default:!1}).example("$0","Install with interactive prompts").example("$0 --agent claude-code","Install for Claude Code agent").example("$0 --git-ignore gitignore","Add Conductor files to .gitignore").example("$0 --git-ignore exclude","Add Conductor files to .git/info/exclude").example("$0 --git-ignore none","Remove Conductor entries from git ignore").help().alias("h","help").version().alias("v","version").completion("completion",!1).parseAsync()}async function Ot(o){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Et(),bt());let e=await Eo(o),t=e._[0];process.argv.includes("completion")||process.argv.includes("--get-yargs-completions")||await ft({...e,path:t||e.path||".",gitIgnore:e["git-ignore"],$0:"conductor-init",_:e._})}Ot("npm create conductor-flow").catch(o=>{console.error("Error:",o instanceof Error?o.message:o),process.exit(1)});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-conductor-flow",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "1.0.0-2",
|
|
4
4
|
"description": "Conductor Scaffolding CLI - Generate spec-driven, portable Gemini Conductor workflows for any coding agent",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"type": "module",
|
|
47
47
|
"bin": {
|
|
48
48
|
"create-conductor-flow": "dist/index.js",
|
|
49
|
-
"conductor-init": "dist/
|
|
49
|
+
"conductor-init": "dist/conductor-init.js"
|
|
50
50
|
},
|
|
51
51
|
"files": [
|
|
52
52
|
"dist",
|