conductor-init 1.0.0 → 1.2.0
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 +84 -27
- package/dist/chunk-J2Z6BQJV.js +62 -0
- package/dist/conductor/commands/conductor/review.toml +7 -4
- package/dist/conductor-init.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -1
- package/dist/chunk-FDWC7342.js +0 -61
package/README.md
CHANGED
|
@@ -94,7 +94,28 @@ You will be prompted to select your target environment:
|
|
|
94
94
|
Add to .git/info/exclude
|
|
95
95
|
Remove existing entries
|
|
96
96
|
❯ Don't configure git ignore
|
|
97
|
+
? Select template source:
|
|
98
|
+
❯ Bundled Templates (Offline) - Use built-in templates, no network required
|
|
99
|
+
Official Repository (Latest) - Fetch latest from official repository
|
|
100
|
+
Custom Repository - Specify your own repository and branch
|
|
97
101
|
```
|
|
102
|
+
|
|
103
|
+
### Template Source Options
|
|
104
|
+
|
|
105
|
+
The CLI provides three template sources to choose from:
|
|
106
|
+
|
|
107
|
+
| Option | Description | Best For |
|
|
108
|
+
|--------|-------------|----------|
|
|
109
|
+
| **Bundled Templates** | Use built-in templates that are packaged with the CLI. No network required. | Offline usage, quick setup, stable templates |
|
|
110
|
+
| **Official Repository** | Download the latest templates from the [official Conductor repository](https://github.com/gemini-cli-extensions/conductor). | Getting the latest features and updates |
|
|
111
|
+
| **Custom Repository** | Specify your own Git repository and branch for templates. | Custom workflows, enterprise templates |
|
|
112
|
+
|
|
113
|
+
**Non-Interactive Mode (CI/CD)**
|
|
114
|
+
|
|
115
|
+
In CI/CD environments or when stdin is not a TTY, the CLI automatically uses bundled templates without prompting:
|
|
116
|
+
- When `CI=true` environment variable is set
|
|
117
|
+
- When running in a non-interactive shell (piped input)
|
|
118
|
+
|
|
98
119
|
### Arguments & Flags
|
|
99
120
|
|
|
100
121
|
For power users, you can pass arguments directly to skip prompts:
|
|
@@ -102,7 +123,10 @@ For power users, you can pass arguments directly to skip prompts:
|
|
|
102
123
|
```bash
|
|
103
124
|
npm create conductor-flow -a claude-code
|
|
104
125
|
|
|
105
|
-
#
|
|
126
|
+
# Use official repository explicitly
|
|
127
|
+
npm create conductor-flow --repo
|
|
128
|
+
|
|
129
|
+
# Specify a custom template repository and branch
|
|
106
130
|
npm create conductor-flow --repo https://github.com/your-org/custom-conductor --branch v2
|
|
107
131
|
```
|
|
108
132
|
|
|
@@ -112,42 +136,75 @@ npm create conductor-flow --repo https://github.com/your-org/custom-conductor --
|
|
|
112
136
|
npm create conductor-flow [path] [options]
|
|
113
137
|
|
|
114
138
|
Positionals:
|
|
115
|
-
path Directory to install Conductor
|
|
139
|
+
path Directory to install Conductor [string] [default: "."]
|
|
116
140
|
|
|
117
141
|
Options:
|
|
118
142
|
-a, --agent Specify the coding agent
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
-
|
|
125
|
-
|
|
126
|
-
-
|
|
127
|
-
|
|
128
|
-
-g, --git-ignore Configure git ignore for Conductor files (gitignore: add to
|
|
129
|
-
.gitignore, exclude: add to .git/info/exclude, none: remove
|
|
130
|
-
entries) [string] [choices: "gitignore", "exclude", "none"]
|
|
131
|
-
-f, --force Force overwrite existing installation
|
|
132
|
-
[boolean] [default: false]
|
|
133
|
-
-h, --help Show help [boolean]
|
|
134
|
-
-v, --version Show version number [boolean]
|
|
143
|
+
[string] [choices: "opencode", "claude-code", "antigravity", "cursor", "github-copilot", "codex", "windsurf", "cline", "kilo-code", "roo-code", "qwen-code", "factory-droid", "gemini"]
|
|
144
|
+
-r, --repo Git repository URL for templates. Without this flag, interactive template source selection is shown. [string]
|
|
145
|
+
-b, --branch Branch name for template repository [string] [default: "main"]
|
|
146
|
+
-s, --scope Installation scope (project or global) [string] [choices: "project", "global"]
|
|
147
|
+
-g, --git-ignore Configure git ignore for Conductor files (gitignore: add to .gitignore, exclude: add to .git/info/exclude, none: remove entries) [string] [choices: "gitignore", "exclude", "none"]
|
|
148
|
+
-f, --force Force overwrite existing installation [boolean] [default: false]
|
|
149
|
+
--reset Clear saved preferences and show all prompts [boolean] [default: false]
|
|
150
|
+
-h, --help Show help [boolean]
|
|
151
|
+
-v, --version Show version number [boolean]
|
|
135
152
|
|
|
136
153
|
Examples:
|
|
137
|
-
npm create conductor-flow
|
|
138
|
-
npm create conductor-flow --agent
|
|
139
|
-
|
|
140
|
-
npm create conductor-flow --git-ignore
|
|
141
|
-
|
|
142
|
-
npm create conductor-flow --git-ignore
|
|
143
|
-
|
|
144
|
-
npm create conductor-flow --git-ignore Remove Conductor entries from git
|
|
145
|
-
none ignore
|
|
154
|
+
npm create conductor-flow Install with interactive prompts (template source selection)
|
|
155
|
+
npm create conductor-flow --agent claude-code Install for Claude Code agent
|
|
156
|
+
npm create conductor-flow --repo https://github.com/user/templates Use custom template repository
|
|
157
|
+
npm create conductor-flow --git-ignore gitignore Add Conductor files to .gitignore
|
|
158
|
+
npm create conductor-flow --git-ignore exclude Add Conductor files to .git/info/exclude
|
|
159
|
+
npm create conductor-flow --git-ignore none Remove Conductor entries from git ignore
|
|
160
|
+
npm create conductor-flow --reset Clear saved preferences and show all prompts
|
|
146
161
|
```
|
|
147
162
|
|
|
148
163
|
|
|
164
|
+
### Configuration Persistence
|
|
165
|
+
|
|
166
|
+
The CLI remembers your preferences between runs, so you don't have to specify the same options every time.
|
|
167
|
+
|
|
168
|
+
**What's Saved:**
|
|
169
|
+
- Agent selection (`--agent`)
|
|
170
|
+
- Template source (`--repo`, `--branch`)
|
|
171
|
+
- Git ignore preference (`--git-ignore`)
|
|
172
|
+
|
|
173
|
+
**How It Works:**
|
|
174
|
+
1. On first run, select your preferences interactively or via flags
|
|
175
|
+
2. On subsequent runs, saved preferences are automatically applied
|
|
176
|
+
3. CLI flags always override saved preferences
|
|
177
|
+
|
|
178
|
+
**Example:**
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
# First run - specify your preferences
|
|
182
|
+
npm create conductor-flow --agent claude-code --git-ignore exclude
|
|
183
|
+
|
|
184
|
+
# Future runs - automatically uses claude-code and exclude
|
|
185
|
+
npm create conductor-flow
|
|
186
|
+
# Output: [Config] Using saved agent: claude-code
|
|
187
|
+
# Output: [Config] Using saved git-ignore: exclude
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
**Reset Preferences:**
|
|
191
|
+
|
|
192
|
+
To clear saved preferences and start fresh with all prompts:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm create conductor-flow --reset
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
**Configuration Location:**
|
|
199
|
+
|
|
200
|
+
Preferences are stored following the XDG Base Directory Specification:
|
|
201
|
+
- **macOS**: `~/Library/Application Support/create-conductor-flow/config.json`
|
|
202
|
+
- **Linux**: `~/.config/create-conductor-flow/config.json`
|
|
203
|
+
- **Windows**: `%APPDATA%\create-conductor-flow\config.json`
|
|
204
|
+
|
|
149
205
|
### 3. Shell Completion for Global Installation(Advanced Setup)
|
|
150
206
|
|
|
207
|
+
|
|
151
208
|
Enable tab completion for specific shells (Bash, Zsh) to make using `conductor-init` easier.
|
|
152
209
|
|
|
153
210
|
#### Global Installation
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import er from"yargs";import{hideBin as tr}from"yargs/helpers";import De from"@inquirer/select";var V={agentType:"opencode",agentDir:".opencode",commandsDir:"commands",displayName:"OpenCode",protocolFilename:"AGENTS.md",description:"The open source AI coding agent"};var Y={agentType:"claude-code",agentDir:".claude",commandsDir:"commands",displayName:"Claude Code",protocolFilename:"CLAUDE.md",description:"Anthropic's coding assistant"};var W={agentType:"antigravity",agentDir:".agent",commandsDir:"workflows",displayName:"Antigravity",protocolFilename:"GEMINI.md",description:"Google's agentic coding assistant"};var q={agentType:"cursor",agentDir:".cursor",commandsDir:"commands",displayName:"Cursor",protocolFilename:"AGENTS.md",description:"Cursor IDE's AI agent"};import{parse as lo}from"smol-toml";import{readFile as ro}from"fs/promises";import{join as nt,resolve as tt}from"path";import{fileURLToPath as no}from"url";import{execSync as ot}from"child_process";import{createHash as io}from"crypto";import M from"fs-extra";import{join as Ze}from"path";import{homedir as Qt}from"os";import j from"fs-extra";import{join as T}from"path";import{homedir as qe,platform as Xe}from"os";import R from"fs-extra";var O="create-conductor-flow",Jt="config.json";function ze(){if(process.env.CONDUCTOR_CONFIG_DIR)return process.env.CONDUCTOR_CONFIG_DIR;if(process.env.XDG_CONFIG_HOME)return T(process.env.XDG_CONFIG_HOME,O);let t=qe();switch(Xe()){case"win32":return T(process.env.APPDATA||T(t,"AppData","Roaming"),O);case"darwin":return T(t,".config",O);default:return T(t,".config",O)}}function Ke(){if(process.env.CONDUCTOR_CACHE_DIR)return process.env.CONDUCTOR_CACHE_DIR;if(process.env.XDG_CACHE_HOME)return T(process.env.XDG_CACHE_HOME,O);let t=qe();switch(Xe()){case"win32":return T(process.env.LOCALAPPDATA||T(t,"AppData","Local"),O);case"darwin":return T(t,".cache",O);default:return T(t,".cache",O)}}function xe(){return T(ze(),Jt)}async function Ae(){try{let t=xe();if(!await R.pathExists(t))return{};let e=await R.readFile(t,"utf-8"),o=JSON.parse(e);return typeof o!="object"||o===null||Array.isArray(o)?(console.warn("[Config] Invalid config format, using defaults"),{}):o}catch(t){return t instanceof SyntaxError&&console.warn("[Config] Config file corrupted, using defaults"),{}}}async function Je(t){let e=xe(),o=ze();await R.ensureDir(o);let n={...await Ae(),...t};await R.writeJson(e,n,{spaces:2})}async function Qe(){let t=xe();await R.pathExists(t)&&await R.remove(t)}var Zt=".gemini/cache/conductor",eo="templates";function to(){return process.env.CONDUCTOR_LEGACY_CACHE_DIR?process.env.CONDUCTOR_LEGACY_CACHE_DIR:Ze(Qt(),Zt)}function Se(){return Ze(Ke(),eo)}async function oo(t){return await j.pathExists(t)?(await j.readdir(t)).length===0:!0}async function et(){let t=to(),e=Se();try{return await j.pathExists(t)?await oo(e)?(console.log(`[Migration] Migrating cache from ${t} to ${e}...`),await j.ensureDir(e),await j.copy(t,e,{overwrite:!1}),console.log("[Migration] Cache migration completed successfully"),console.log(`[Migration] You can safely remove the old cache at: ${t}`),!0):(console.log("[Migration] New cache already exists, skipping migration"),console.log(`[Migration] You can safely remove the old cache at: ${t}`),!1):!1}catch(o){return console.warn("[Migration] Failed to migrate cache:",o instanceof Error?o.message:o),!1}}var rt=no(new URL(".",import.meta.url)),D="https://github.com/gemini-cli-extensions/conductor",E="main";function so(t=D,e=E){let o=io("md5").update(`${t}#${e}`).digest("hex");return nt(Se(),o)}function it(t=D,e=E){return so(t,e)}async function ao(t=D,e=E){let o=it(t,e);if(M.existsSync(o))try{console.log(`Updating templates from ${t} [${e}]...`),ot("git pull --rebase",{cwd:o,stdio:["ignore","ignore","pipe"]})}catch(r){console.warn(`Failed to update templates (using cached version): ${r instanceof Error?r.message:String(r)}`)}else{await M.ensureDir(o),console.log(`Downloading templates from ${t} [${e}]...`);try{ot(`git clone ${t} --branch ${e} --depth 1 .`,{cwd:o,stdio:["ignore","ignore","pipe"]})}catch(r){throw await M.remove(o),new Error(`Failed to clone templates: ${r instanceof Error?r.message:String(r)}`)}}}function h(t,e){return t.replace(/\{(\w+)\}/g,(o,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:o)}function co(){let t=tt(rt,"conductor");return M.existsSync(t)?t:tt(rt,"../conductor")}async function st(t,e){if(!t){let o=co();if(await M.pathExists(o))return console.log("use bundled Conductor templates"),o}return await ao(t,e),it(t,e)}async function at(t,e){let o=nt(e,t);return ro(o,"utf-8")}var Te=class{process(e,o){let{installPath:r,agentType:n,fixedAgent:i}=o,s=lo(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=h(l,{agent_type:n});return`---
|
|
2
|
+
description: ${s.description||""}
|
|
3
|
+
agent: ${i}
|
|
4
|
+
---
|
|
5
|
+
${p}`}},ct=new Te;var X={agentType:"github-copilot",agentDir:".github",commandsDir:"prompts",displayName:"Github Copilot",protocolFilename:"AGENTS.md",description:"Github Copilot's Prompt Files",extension:".prompt.md",fixedAgent:"agent",strategy:{content:ct}};var z={agentType:"codex",agentDir:".codex",commandsDir:"prompts",displayName:"Codex",protocolFilename:"AGENTS.md",description:"OpenAI Codex Agent",extension:".md"};var K={agentType:"windsurf",agentDir:".windsurf",commandsDir:"workflows",displayName:"Windsurf",protocolFilename:"AGENTS.md",description:"Windsurf Cascade AI Agent"};import{parse as po}from"smol-toml";var we=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=po(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=h(l,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
6
|
+
|
|
7
|
+
`+s.description+`
|
|
8
|
+
|
|
9
|
+
`:`
|
|
10
|
+
|
|
11
|
+
`}${p}`}},lt=new we;var J={agentType:"cline",agentDir:".clinerules",commandsDir:"workflows",displayName:"Cline",protocolFilename:"AGENTS.md",description:"Cline AI coding assistant",strategy:{content:lt}};import{join as go}from"path";import mo from"fs-extra";import{parse as uo}from"smol-toml";var{writeFile:fo}=mo,Ie=class{process(e,o){let{installPath:r,agentType:n}=o;if(!uo(e).prompt)return null;let s=e.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);return h(s,{agent_type:n})}},Ee=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${i}${s}`;await fo(go(o,r,n,p),l)}},pt=new Ie,gt=new Ee;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:pt,file:gt}};import{parse as yo}from"smol-toml";var ve=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=yo(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=h(l,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
12
|
+
|
|
13
|
+
`+s.description+`
|
|
14
|
+
|
|
15
|
+
`:`
|
|
16
|
+
|
|
17
|
+
`}${p}`}},mt=new ve;var Z={agentType:"kilo-code",agentDir:".kilocode",commandsDir:"workflows",displayName:"Kilo Code",protocolFilename:"AGENTS.md",description:"Kilo Code AI coding assistant",strategy:{content:mt}};import{parse as Co}from"smol-toml";var Oe=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=Co(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=h(l,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
18
|
+
|
|
19
|
+
`+s.description+`
|
|
20
|
+
|
|
21
|
+
`:`
|
|
22
|
+
|
|
23
|
+
`}${p}`}},ft=new Oe;var ee={agentType:"roo-code",agentDir:".roo",commandsDir:"commands",displayName:"Roo Code",protocolFilename:"AGENTS.md",description:"Roo Code AI coding assistant",strategy:{content:ft}};import{parse as ho}from"smol-toml";var be=class{process(e,o){let{installPath:r,agentType:n}=o,i=ho(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=h(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
24
|
+
description: "${i.description.replace(/"/g,'\\"')}"
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`),`${p}${l}`}},dt=new be;var te={agentType:"qwen-code",agentDir:".qwen",commandsDir:"commands",displayName:"Qwen Code",protocolFilename:"AGENTS.md",description:"Qwen Code AI coding assistant",strategy:{content:dt}};import{parse as _o}from"smol-toml";var Ne=class{process(e,o){let{installPath:r,agentType:n}=o,i=_o(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=h(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
28
|
+
description: "${i.description.replace(/"/g,'\\"')}"
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
`),`${p}${l}`}},ut=new Ne;var oe={agentType:"factory-droid",agentDir:".factory",commandsDir:"commands",displayName:"Factory Droid",protocolFilename:"AGENTS.md",description:"Factory Droid AI coding assistant",strategy:{content:ut}};var G=[V,Y,W,q,X,z,K,J,Z,ee,te,oe,Q];async function yt(t){let e=t==="codex",o=t==="cline";return await De({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 Ct(){let t=G.map(o=>{let{displayName:r,agentType:n,protocolFilename:i,agentDir:s,commandsDir:l,description:p}=o,C=p||`${r} agent`,y=`\x1B[90m(${i}, ${s}/${l})\x1B[0m`;return{name:`${r} ${y}`,value:n,description:C}});return await De({message:"Select your coding agent:",choices:t,default:"opencode",loop:!0})}async function ht(){return await De({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 xo}from"path";import Ao from"fs-extra";import{parse as To}from"smol-toml";var U="conductor-";var{writeFile:So}=Ao,Re=class{process(e,o){let{installPath:r,agentType:n}=o,i=To(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r),s=s.replace(/\/conductor:/g,`/${U}`);let l=h(s,{agent_type:n});return i.description?`---
|
|
32
|
+
description: ${i.description}
|
|
33
|
+
---
|
|
34
|
+
${l}`:l}},Ge=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${U}${i}${s}`;await So(xo(o,r,n,p),l)}},_t=new Re,xt=new Ge;import{join as x}from"path";import wo from"@inquirer/select";import St from"fs-extra";var{existsSync:b,ensureDir:At,copy:Fe}=St,I=class{constructor(e){this.config=e}async validate(e,o){if(!b(e))throw new Error(`Target directory does not exist: ${e}`);let{agentDir:r,commandsDir:n,displayName:i,extension:s,usesPrefix:l}=this.config,y=`${l!==!1?U:""}setup${s||".md"}`,f=x(e,r,n,y),_=x(e,r,"conductor");if(b(_)&&b(f))throw new Error(`Conductor (${i}) is already installed in: ${e}`);return e}async generate(e,o,r,n,i){let{agentDir:s,commandsDir:l,agentType:p}=this.config,C=x(e,s),y=x(C,l),f=x(s,"conductor");o==="global"&&(f=`~/${s}/conductor`),await At(y),await At(x(C,"conductor"));let _=await st(r,n);try{let d=x(_,"templates"),S=x(C,"conductor","templates");await Fe(d,S)}catch(d){console.warn("Failed to copy templates directory:",d)}let{protocolFilename:P}=this.config;if(P)try{let d=x(_,"GEMINI.md"),S=x(e,P);if(b(d)){let N=!0;b(S)&&!i&&(N=await wo({message:`The protocol file '${P}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),N&&await Fe(d,S)}}catch(d){console.warn("Failed to handle protocol file:",d)}let L=[];try{let d=x(_,"commands/conductor");if(b(d)){let S=await St.readdir(d);Array.isArray(S)&&(L=S.filter(N=>N.endsWith(".toml")).map(N=>N.replace(/\.toml$/,"")))}}catch(d){console.warn("Failed to discover commands:",d)}L.length===0?(console.log("No commands discovered, using default commands"),L=["setup","newTrack","implement","status","revert","review"]):console.log(`Discovered commands: ${L.join(", ")}`);let zt=this.config.extension||".md",Kt=this.config.fixedAgent;for(let d of L)try{let S=await at(x("commands","conductor",`${d}.toml`),_),We=(this.config.strategy?.content||_t).process(S,{installPath:f,agentType:p,fixedAgent:Kt,commandName:d});We&&await(this.config.strategy?.file||xt).write({targetDir:e,agentDir:s,commandsDir:l,commandName:d,extension:zt,content:We})}catch(S){console.warn(`Failed to process ${d}:`,S)}let Ve=x(_,"templates/workflow.md"),Ye=x(e,"conductor/workflow.md");if(b(Ye)&&b(Ve))try{await Fe(Ve,Ye),console.log("\u2714 conductor/workflow.md synced")}catch(d){console.warn("Failed to handle workflow file:",d)}else console.warn("Workflow template not found, skipping workflow file sync")}};function u(t){return new I(t)}var re=class{generator=u(V);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var ne=class{generator=u(Y);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var ie=class{generator=u(W);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var se=class{generator=u(q);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var ae=class{generator=u(X);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};import{homedir as Tt}from"os";var ce=class{generator=u(z);validate(e,o){return o==="global"&&(e=Tt()),this.generator.validate(e,o)}generate(e,o,r,n,i){return o==="global"&&(e=Tt()),this.generator.generate(e,o,r,n,i)}};var le=class{generator=u(K);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var pe=class{generator=u(J);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var ge=class{generator=u(Q);async validate(e,o){if(o==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.validate(e,o)}async generate(e,o,r,n,i){if(o==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.generate(e,o,r,n,i)}};var me=class{generator=u(Z);validate(e,o){return this.generator.validate(e,o)}generate(e,o,r,n,i){return this.generator.generate(e,o,r,n,i)}};var fe=class extends I{constructor(){super(ee)}};var de=class extends I{constructor(){super(te)}};var ue=class extends I{constructor(){super(oe)}};function wt(t){switch(t){case"claude-code":return new ne;case"antigravity":return new ie;case"cursor":return new se;case"github-copilot":return new ae;case"codex":return new ce;case"windsurf":return new le;case"cline":return new pe;case"kilo-code":return new me;case"roo-code":return new fe;case"qwen-code":return new de;case"factory-droid":return new ue;case"gemini":return new ge;default:return new re}}import{resolve as Fo}from"path";import $o from"@inquirer/select";import{join as $e}from"path";import{readFile as Pe,writeFile as It,access as Io,mkdir as Eo}from"fs/promises";import{constants as vo}from"fs";var Et="# Conductor";function vt(t){let e=G.find(r=>r.agentType===t);if(!e)return[];let o=[];return e.agentDir&&o.push(e.agentDir),e.protocolFilename&&o.push(e.protocolFilename),o}function B(t){return t.replace(/\/+$/,"")}async function Le(t){try{return await Io(t,vo.F_OK),!0}catch{return!1}}async function Oo(t,e){let o=[],r=[];if(!await Le(t))return{existing:[],missing:[...e]};let i=(await Pe(t,"utf-8")).split(`
|
|
35
|
+
`).map(s=>B(s.trim()));for(let s of e){let l=B(s);i.includes(l)?o.push(s):r.push(s)}return{existing:o,missing:r}}async function Ot(t,e){let{existing:o,missing:r}=await Oo(t,e);if(r.length===0)return{added:[],skipped:o};let n="";await Le(t)&&(n=await Pe(t,"utf-8")),n.length>0&&!n.endsWith(`
|
|
36
|
+
`)&&(n+=`
|
|
37
|
+
`),n+=`
|
|
38
|
+
${Et}
|
|
39
|
+
`;for(let s of r)n+=`${s}
|
|
40
|
+
`;let i=$e(t,"..");return await Eo(i,{recursive:!0}),await It(t,n,"utf-8"),{added:r,skipped:o}}async function je(t,e){if(!await Le(t))return{removed:[]};let r=(await Pe(t,"utf-8")).split(`
|
|
41
|
+
`),n=e.map(B),i=[],s=[];for(let y of r){let f=B(y.trim());if(f!==Et){if(n.includes(f)){let _=e.find(P=>B(P)===f);_&&!i.includes(_)&&i.push(_);continue}s.push(y)}}let l=[],p=!1;for(let y of s){let f=y.trim()==="";f&&p||(l.push(y),p=f)}for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();let C=l.length>0?l.join(`
|
|
42
|
+
`)+`
|
|
43
|
+
`:"";return await It(t,C,"utf-8"),{removed:i}}function ye(t,e){return e==="gitignore"?$e(t,".gitignore"):$e(t,".git","info","exclude")}async function bt(t,e,o){let r=vt(o);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${o}`}:e==="none"?await No(t,r):await bo(t,e,r)}async function bo(t,e,o){let r=ye(t,e),n=await Ot(r,o);if(n.added.length===0)return{action:"skipped",entries:n.skipped,message:"Git ignore entries already present, skipping.",targetFiles:[r]};let i=e==="gitignore"?".gitignore":".git/info/exclude";return{action:"added",entries:n.added,message:`Added ${n.added.length} entries to ${i}: ${n.added.join(", ")}`,targetFiles:[r]}}async function No(t,e){let o=ye(t,"gitignore"),r=ye(t,"exclude"),n=await je(o,e),i=await je(r,e),s=[...new Set([...n.removed,...i.removed])];if(s.length===0)return{action:"none",entries:[],message:"No Conductor git ignore entries found."};let l=[],p=[];return n.removed.length>0&&(l.push(o),p.push(`.gitignore (${n.removed.length})`)),i.removed.length>0&&(l.push(r),p.push(`.git/info/exclude (${i.removed.length})`)),{action:"removed",entries:s,message:`Removed entries from: ${p.join(", ")}`,targetFiles:l}}import Do from"@inquirer/select";import Nt from"@inquirer/input";var v={SELECT_SOURCE_MESSAGE:"Select template source:",BUNDLED_LABEL:"Bundled Templates (Offline)",BUNDLED_DESCRIPTION:"Use built-in templates, no network required",OFFICIAL_LABEL:"Official Repository (Latest)",OFFICIAL_DESCRIPTION:"Fetch latest from official repository",CUSTOM_LABEL:"Custom Repository",CUSTOM_DESCRIPTION:"Specify your own repository and branch",CUSTOM_REPO_PROMPT:"Enter repository URL:",CUSTOM_BRANCH_PROMPT:"Enter branch name:"},Ce={USING_BUNDLED:"Using bundled Conductor templates",DOWNLOADING_FROM:(t,e)=>`Downloading templates from ${t} [${e}]...`,NON_INTERACTIVE_BUNDLED:"Non-interactive mode detected. Using bundled templates."};function Ro(){return!(process.env.CI==="true"||!process.stdin.isTTY)}function Go(t){if(!t||t.trim().length===0)return"Repository URL is required";let e=t.trim();return e.startsWith("https://")||e.startsWith("git@")||e.startsWith("/")||e.startsWith("./")||e.startsWith("../")?!0:"Invalid repository URL. Please provide an HTTPS URL, SSH URL, or local path."}async function Dt(){if(!Ro())return console.log(Ce.NON_INTERACTIVE_BUNDLED),{source:"bundled"};switch(await Do({message:v.SELECT_SOURCE_MESSAGE,choices:[{name:v.BUNDLED_LABEL,value:"bundled",description:v.BUNDLED_DESCRIPTION},{name:v.OFFICIAL_LABEL,value:"official",description:v.OFFICIAL_DESCRIPTION},{name:v.CUSTOM_LABEL,value:"custom",description:v.CUSTOM_DESCRIPTION}],default:"bundled"})){case"bundled":return{source:"bundled"};case"official":return{source:"official",repo:D,branch:E};case"custom":{let e=await Nt({message:v.CUSTOM_REPO_PROMPT,validate:Go}),o=await Nt({message:v.CUSTOM_BRANCH_PROMPT,default:E});return{source:"custom",repo:e.trim(),branch:o.trim()||E}}default:return{source:"bundled"}}}function Rt(t){switch(t.source){case"bundled":return{repo:void 0,branch:void 0};case"official":case"custom":return{repo:t.repo,branch:t.branch};default:return{repo:void 0,branch:void 0}}}async function Gt(t){let e=Fo(process.cwd(),t.path),o=t.force??!1,r=t.config??{};try{console.log(`Initializing Conductor in: ${e}`);let n;t.agent?(n=t.agent,console.log(`Using provided agent: ${n}`)):r.agent?(n=r.agent,console.log(`[Config] Using saved agent: ${n}`)):(console.log("Step 1: Prompting for agent selection..."),n=await Ct(),console.log(`\u2714 Selected agent: ${n}`));let i;t.scope?(i=t.scope,console.log(`Using provided scope: ${i}`)):i=await yt(n),console.log(`\u2714 Selected scope: ${i}`);let s=t.gitIgnore;t.gitIgnore&&i==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),s=void 0):!t.gitIgnore&&i==="project"&&(r.gitIgnore?(s=r.gitIgnore,console.log(`[Config] Using saved git-ignore: ${s}`)):s=await ht());let l=t.repo,p=t.branch;if(t.repo)console.log(`Using provided repository: ${t.repo}`),t.branch&&console.log(`Using provided branch: ${t.branch}`);else if(r.repo)l=r.repo,p=r.branch??p,console.log(`[Config] Using saved template source: ${l} [${p}]`);else{let f=await Dt(),_=Rt(f);l=_.repo,p=_.branch,f.source==="bundled"?console.log(`\u2714 ${Ce.USING_BUNDLED}`):l&&console.log(`\u2714 ${Ce.DOWNLOADING_FROM(l,p||"main")}`)}let C=wt(n);console.log(`
|
|
44
|
+
Step 3: Validating project directory...`);let y;try{y=await C.validate(e,i)}catch(f){if(f instanceof Error&&f.message.includes("already installed"))if(o)console.log("\u26A0 Force mode: Overwriting existing installation"),y=e;else if(await $o({message:`${f.message}
|
|
45
|
+
Do you want to overwrite the existing installation?`,choices:[{value:!0,name:"Yes, overwrite"},{value:!1,name:"No, cancel"}]}))console.log("Overwriting existing installation..."),y=e;else{console.log("Installation cancelled.");return}else throw f}if(console.log(`\u2714 Validation complete: ${y}`),console.log(`
|
|
46
|
+
Step 4: Generating files...`),await C.generate(y,i,l,p,o),console.log("\u2714 Files generated"),s){console.log(`
|
|
47
|
+
Step 5: Configuring git ignore...`);let f=await bt(y,s,n);console.log(`\u2714 ${f.message}`)}console.log(`
|
|
48
|
+
Saving preferences...`),await Je({agent:n,repo:l,branch:p,gitIgnore:s}),console.log("\u2714 Preferences saved"),console.log(`
|
|
49
|
+
\u2714 Conductor initialized successfully!`)}catch(n){console.error(`
|
|
50
|
+
\u2718 Installation failed:`,n instanceof Error?n.message:n),process.exit(1)}}import Jo from"gradient-string";var Ft=(t=0)=>e=>`\x1B[${e+t}m`,$t=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Pt=(t=0)=>(e,o,r)=>`\x1B[${38+t};2;${e};${o};${r}m`,g={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]}},Jc=Object.keys(g.modifier),Po=Object.keys(g.color),Lo=Object.keys(g.bgColor),Qc=[...Po,...Lo];function jo(){let t=new Map;for(let[e,o]of Object.entries(g)){for(let[r,n]of Object.entries(o))g[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[r]=g[r],t.set(n[0],n[1]);Object.defineProperty(g,e,{value:o,enumerable:!1})}return Object.defineProperty(g,"codes",{value:t,enumerable:!1}),g.color.close="\x1B[39m",g.bgColor.close="\x1B[49m",g.color.ansi=Ft(),g.color.ansi256=$t(),g.color.ansi16m=Pt(),g.bgColor.ansi=Ft(10),g.bgColor.ansi256=$t(10),g.bgColor.ansi16m=Pt(10),Object.defineProperties(g,{rgbToAnsi256:{value(e,o,r){return e===o&&o===r?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(o/255*5)+Math.round(r/255*5)},enumerable:!1},hexToRgb:{value(e){let o=/[a-f\d]{6}|[a-f\d]{3}/i.exec(e.toString(16));if(!o)return[0,0,0];let[r]=o;r.length===3&&(r=[...r].map(i=>i+i).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>g.rgbToAnsi256(...g.hexToRgb(e)),enumerable:!1},ansi256ToAnsi:{value(e){if(e<8)return 30+e;if(e<16)return 90+(e-8);let o,r,n;if(e>=232)o=((e-232)*10+8)/255,r=o,n=o;else{e-=16;let l=e%36;o=Math.floor(e/36)/5,r=Math.floor(l/6)/5,n=l%6/5}let i=Math.max(o,r,n)*2;if(i===0)return 30;let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(o));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,o,r)=>g.ansi256ToAnsi(g.rgbToAnsi256(e,o,r)),enumerable:!1},hexToAnsi:{value:e=>g.ansi256ToAnsi(g.hexToAnsi256(e)),enumerable:!1}}),g}var Mo=jo(),w=Mo;import Me from"process";import Uo from"os";import Lt from"tty";function A(t,e=globalThis.Deno?globalThis.Deno.args:Me.argv){let o=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(o+t),n=e.indexOf("--");return r!==-1&&(n===-1||r<n)}var{env:m}=Me,he;A("no-color")||A("no-colors")||A("color=false")||A("color=never")?he=0:(A("color")||A("colors")||A("color=true")||A("color=always"))&&(he=1);function Bo(){if("FORCE_COLOR"in m)return m.FORCE_COLOR==="true"?1:m.FORCE_COLOR==="false"?0:m.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(m.FORCE_COLOR,10),3)}function ko(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Ho(t,{streamIsTTY:e,sniffFlags:o=!0}={}){let r=Bo();r!==void 0&&(he=r);let n=o?he:r;if(n===0)return 0;if(o){if(A("color=16m")||A("color=full")||A("color=truecolor"))return 3;if(A("color=256"))return 2}if("TF_BUILD"in m&&"AGENT_NAME"in m)return 1;if(t&&!e&&n===void 0)return 0;let i=n||0;if(m.TERM==="dumb")return i;if(Me.platform==="win32"){let s=Uo.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in m)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in m)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in m)||m.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in m)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m.TEAMCITY_VERSION)?1:0;if(m.COLORTERM==="truecolor"||m.TERM==="xterm-kitty"||m.TERM==="xterm-ghostty"||m.TERM==="wezterm")return 3;if("TERM_PROGRAM"in m){let s=Number.parseInt((m.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m.TERM)||"COLORTERM"in m?1:i}function jt(t,e={}){let o=Ho(t,{streamIsTTY:t&&t.isTTY,...e});return ko(o)}var Vo={stdout:jt({isTTY:Lt.isatty(1)}),stderr:jt({isTTY:Lt.isatty(2)})},Mt=Vo;function Ut(t,e,o){let r=t.indexOf(e);if(r===-1)return t;let n=e.length,i=0,s="";do s+=t.slice(i,r)+e+o,i=r+n,r=t.indexOf(e,i);while(r!==-1);return s+=t.slice(i),s}function Bt(t,e,o,r){let n=0,i="";do{let s=t[r-1]==="\r";i+=t.slice(n,s?r-1:r)+e+(s?`\r
|
|
51
|
+
`:`
|
|
52
|
+
`)+o,n=r+1,r=t.indexOf(`
|
|
53
|
+
`,n)}while(r!==-1);return i+=t.slice(n),i}var{stdout:kt,stderr:Ht}=Mt,Ue=Symbol("GENERATOR"),F=Symbol("STYLER"),k=Symbol("IS_EMPTY"),Vt=["ansi","ansi","ansi256","ansi16m"],$=Object.create(null),Yo=(t,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 o=kt?kt.level:0;t.level=e.level===void 0?o:e.level};var Wo=t=>{let e=(...o)=>o.join(" ");return Yo(e,t),Object.setPrototypeOf(e,H.prototype),e};function H(t){return Wo(t)}Object.setPrototypeOf(H.prototype,Function.prototype);for(let[t,e]of Object.entries(w))$[t]={get(){let o=_e(this,ke(e.open,e.close,this[F]),this[k]);return Object.defineProperty(this,t,{value:o}),o}};$.visible={get(){let t=_e(this,this[F],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Be=(t,e,o,...r)=>t==="rgb"?e==="ansi16m"?w[o].ansi16m(...r):e==="ansi256"?w[o].ansi256(w.rgbToAnsi256(...r)):w[o].ansi(w.rgbToAnsi(...r)):t==="hex"?Be("rgb",e,o,...w.hexToRgb(...r)):w[o][t](...r),qo=["rgb","hex","ansi256"];for(let t of qo){$[t]={get(){let{level:o}=this;return function(...r){let n=ke(Be(t,Vt[o],"color",...r),w.color.close,this[F]);return _e(this,n,this[k])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);$[e]={get(){let{level:o}=this;return function(...r){let n=ke(Be(t,Vt[o],"bgColor",...r),w.bgColor.close,this[F]);return _e(this,n,this[k])}}}}var Xo=Object.defineProperties(()=>{},{...$,level:{enumerable:!0,get(){return this[Ue].level},set(t){this[Ue].level=t}}}),ke=(t,e,o)=>{let r,n;return o===void 0?(r=t,n=e):(r=o.openAll+t,n=e+o.closeAll),{open:t,close:e,openAll:r,closeAll:n,parent:o}},_e=(t,e,o)=>{let r=(...n)=>zo(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,Xo),r[Ue]=t,r[F]=e,r[k]=o,r},zo=(t,e)=>{if(t.level<=0||!e)return t[k]?"":e;let o=t[F];if(o===void 0)return e;let{openAll:r,closeAll:n}=o;if(e.includes("\x1B"))for(;o!==void 0;)e=Ut(e,o.close,o.open),o=o.parent;let i=e.indexOf(`
|
|
54
|
+
`);return i!==-1&&(e=Bt(e,n,r,i)),r+e+n};Object.defineProperties(H.prototype,$);var Ko=H(),gl=H({level:Ht?Ht.level:0});var Yt=Ko;import Wt from"fs";import He from"path";import{fileURLToPath as Qo}from"url";var Zo=`
|
|
55
|
+
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
56
|
+
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
57
|
+
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
58
|
+
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
59
|
+
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
60
|
+
|
|
61
|
+
`;function qt(){let t=He.dirname(Qo(import.meta.url)),e=He.join(t,"../package.json");Wt.existsSync(e)||(e=He.join(t,"../../package.json"));let r=JSON.parse(Wt.readFileSync(e,"utf-8")).version;console.log(Yt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
62
|
+
`))}function Xt(){console.log(Jo("cyan","green")(Zo))}async function or(t){let e=er(tr(process.argv));return process.env.COLUMNS&&e.wrap(parseInt(process.env.COLUMNS)),await e.scriptName(t).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:G.map(o=>o.agentType)}).option("repo",{alias:"r",describe:"Git repository URL for templates. Without this flag, interactive template source selection is shown.",type:"string"}).coerce("repo",o=>o===""?D:o).option("branch",{alias:"b",describe:"Branch name for template repository",type:"string",default:E}).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",o=>o===""?"exclude":o).option("force",{alias:"f",describe:"Force overwrite existing installation",type:"boolean",default:!1}).option("reset",{describe:"Clear saved preferences and show all prompts",type:"boolean",default:!1}).example("$0","Install with interactive prompts (template source selection)").example("$0 --agent claude-code","Install for Claude Code agent").example("$0 --repo https://github.com/user/templates","Use custom template repository").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").example("$0 --reset","Clear saved preferences and show all prompts").help().alias("h","help").version().alias("v","version").completion("completion",!1).parseAsync()}async function bl(t){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Xt(),qt());let e=await or(t),o=e._[0];if(process.argv.includes("completion")||process.argv.includes("--get-yargs-completions"))return;let r={};e.reset?(console.log("[Config] Clearing saved preferences..."),await Qe()):(r=await Ae(),Object.keys(r).length>0&&console.log("[Config] Loaded saved preferences")),await et(),await Gt({...e,path:o||e.path||".",gitIgnore:e["git-ignore"],$0:"conductor-init",_:e._,config:r})}export{bl as a};
|
|
@@ -115,10 +115,13 @@ CRITICAL: You must validate the success of every tool call. If any tool call fai
|
|
|
115
115
|
|
|
116
116
|
## 3.0 COMPLETION PHASE
|
|
117
117
|
1. **Review Decision:**
|
|
118
|
-
- **Determine Recommendation:**
|
|
119
|
-
- If **Critical** or **High** issues found:
|
|
120
|
-
|
|
121
|
-
- If
|
|
118
|
+
- **Determine Recommendation and announce it to the user:**
|
|
119
|
+
- If **Critical** or **High** issues found:
|
|
120
|
+
> "I recommend we fix the important issues I found before moving forward."
|
|
121
|
+
- If only **Medium/Low** issues found:
|
|
122
|
+
> "The changes look good overall, but I have a few suggestions to improve them."
|
|
123
|
+
- If no issues found:
|
|
124
|
+
> "Everything looks great! I don't see any issues."
|
|
122
125
|
- **Action:**
|
|
123
126
|
- **If issues found:** Ask:
|
|
124
127
|
> "Do you want me to apply the suggested fixes, fix them manually yourself, or proceed to complete the track?
|
package/dist/conductor-init.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-J2Z6BQJV.js";r("conductor-init").catch(o=>{console.error("Error:",o instanceof Error?o.message:o),process.exit(1)});
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{a as r}from"./chunk-
|
|
2
|
+
import{a as r}from"./chunk-J2Z6BQJV.js";r("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": "conductor-init",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
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": [
|
|
@@ -77,6 +77,7 @@
|
|
|
77
77
|
"vitest": "^4.0.18"
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
|
+
"@inquirer/input": "^5.0.4",
|
|
80
81
|
"@inquirer/select": "^5.0.4",
|
|
81
82
|
"fs-extra": "^11.3.3",
|
|
82
83
|
"gradient-string": "^3.0.0",
|
package/dist/chunk-FDWC7342.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import To from"yargs";import{hideBin as vo}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 Dt}from"smol-toml";import{readFile as Gt}from"fs/promises";import{join as Be,resolve as Le}from"path";import{fileURLToPath as $t}from"url";import{homedir as Ft}from"os";import{execSync as ke}from"child_process";import{createHash as Rt}from"crypto";import $ from"fs-extra";var Me=$t(new URL(".",import.meta.url)),B="https://github.com/gemini-cli-extensions/conductor",U="main";function Ue(o=B,e=U){let t=Rt("md5").update(`${o}#${e}`).digest("hex");return Be(Ft(),".gemini/cache/conductor",t)}async function Pt(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 jt(){let o=Le(Me,"conductor");return $.existsSync(o)?o:Le(Me,"../conductor")}async function Ve(o,e){if(!o){let t=jt();if(await $.pathExists(t))return console.log("use bundled Conductor templates"),t}return await Pt(o,e),Ue(o,e)}async function He(o,e){let t=Be(e,o);return Gt(t,"utf-8")}var de=class{process(e,t){let{installPath:r,agentType:n,fixedAgent:i}=t,s=Dt(e);if(!s.prompt)return null;let p=s.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let c=u(p,{agent_type:n});return`---
|
|
2
|
-
description: ${s.description||""}
|
|
3
|
-
agent: ${i}
|
|
4
|
-
---
|
|
5
|
-
${c}`}},Ye=new de;var V={agentType:"github-copilot",agentDir:".github",commandsDir:"prompts",displayName:"Github Copilot",protocolFilename:"AGENTS.md",description:"Github 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 Lt}from"smol-toml";var ue=class{process(e,t){let{installPath:r,agentType:n,commandName:i}=t,s=Lt(e);if(!s.prompt)return null;let p=s.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let c=u(p,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
6
|
-
|
|
7
|
-
`+s.description+`
|
|
8
|
-
|
|
9
|
-
`:`
|
|
10
|
-
|
|
11
|
-
`}${c}`}},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 kt}from"path";import Mt from"fs-extra";import{parse as Ut}from"smol-toml";var{writeFile:Bt}=Mt,ye=class{process(e,t){let{installPath:r,agentType:n}=t;if(!Ut(e).prompt)return null;let s=e.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);return u(s,{agent_type:n})}},Ce=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:i,extension:s,content:p}=e,c=`${i}${s}`;await Bt(kt(t,r,n,c),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 Vt}from"smol-toml";var xe=class{process(e,t){let{installPath:r,agentType:n,commandName:i}=t,s=Vt(e);if(!s.prompt)return null;let p=s.prompt;p=p.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let c=u(p,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
12
|
-
|
|
13
|
-
`+s.description+`
|
|
14
|
-
|
|
15
|
-
`:`
|
|
16
|
-
|
|
17
|
-
`}${c}`}},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 Ht}from"smol-toml";var _e=class{process(e,t){let{installPath:r,agentType:n,commandName:i}=t,s=Ht(e);if(!s.prompt)return null;let p=s.prompt;p=p.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let c=u(p,{agent_type:n});return`# Conductor ${i?i.charAt(0).toUpperCase()+i.slice(1):"Command"}${s.description?`
|
|
18
|
-
|
|
19
|
-
`+s.description+`
|
|
20
|
-
|
|
21
|
-
`:`
|
|
22
|
-
|
|
23
|
-
`}${c}`}},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 Yt}from"smol-toml";var he=class{process(e,t){let{installPath:r,agentType:n}=t,i=Yt(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(s,{agent_type:n}),c="";return i.description&&(c=`---
|
|
24
|
-
description: "${i.description.replace(/"/g,'\\"')}"
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
`),`${c}${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 Wt}from"smol-toml";var Ae=class{process(e,t){let{installPath:r,agentType:n}=t,i=Wt(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=u(s,{agent_type:n}),c="";return i.description&&(c=`---
|
|
28
|
-
description: "${i.description.replace(/"/g,'\\"')}"
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
`),`${c}${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 I=[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=I.map(t=>{let{displayName:r,agentType:n,protocolFilename:i,agentDir:s,commandsDir:p,description:c}=t,y=c||`${r} agent`,_=`\x1B[90m(${i}, ${s}/${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 qt}from"path";import zt from"fs-extra";import{parse as Xt}from"smol-toml";var F="conductor-";var{writeFile:Kt}=zt,we=class{process(e,t){let{installPath:r,agentType:n}=t,i=Xt(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r),s=s.replace(/\/conductor:/g,`/${F}`);let p=u(s,{agent_type:n});return i.description?`---
|
|
32
|
-
description: ${i.description}
|
|
33
|
-
---
|
|
34
|
-
${p}`:p}},be=class{async write(e){let{targetDir:t,agentDir:r,commandsDir:n,commandName:i,extension:s,content:p}=e,c=`${F}${i}${s}`;await Kt(qt(t,r,n,c),p)}},ot=new we,rt=new be;import{join as C}from"path";import Jt from"@inquirer/select";import it from"fs-extra";var{existsSync:T,ensureDir:nt,copy:Te}=it,b=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:i,extension:s,usesPrefix:p}=this.config,_=`${p!==!1?F:""}setup${s||".md"}`,h=C(e,r,n,_),A=C(e,r,"conductor");if(T(A)&&T(h))throw new Error(`Conductor (${i}) is already installed in: ${e}`);return e}async generate(e,t,r,n,i){let{agentDir:s,commandsDir:p,agentType:c}=this.config,y=C(e,s),_=C(y,p),h=C(s,"conductor");t==="global"&&(h=`~/${s}/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 v=!0;T(S)&&!i&&(v=await Jt({message:`The protocol file '${N}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),v&&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(v=>v.endsWith(".toml")).map(v=>v.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 Ot=this.config.extension||".md",Nt=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:c,fixedAgent:Nt,commandName:f});De&&await(this.config.strategy?.file||rt).write({targetDir:e,agentDir:s,commandsDir:p,commandName:f,extension:Ot,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 b(o)}var Q=class{generator=d(D);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var Z=class{generator=d(L);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var ee=class{generator=d(k);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var te=class{generator=d(M);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var oe=class{generator=d(V);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};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,i){return t==="global"&&(e=st()),this.generator.generate(e,t,r,n,i)}};var ne=class{generator=d(Y);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var ie=class{generator=d(W);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};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,i){if(t==="global")throw new Error("Gemini CLI agent only supports project-level installation");return this.generator.generate(e,t,r,n,i)}};var ae=class{generator=d(z);validate(e,t){return this.generator.validate(e,t)}generate(e,t,r,n,i){return this.generator.generate(e,t,r,n,i)}};var le=class extends b{constructor(){super(K)}};var pe=class extends b{constructor(){super(X)}};var ce=class extends b{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"github-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 le;case"qwen-code":return new pe;case"factory-droid":return new ce;case"gemini":return new se;default:return new Q}}import{resolve as no}from"path";import io from"@inquirer/select";import{join as ve}from"path";import{readFile as Ie,writeFile as lt,access as Qt,mkdir as Zt}from"fs/promises";import{constants as eo}from"fs";var pt="# Conductor";function ct(o){let e=I.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 Qt(o,eo.F_OK),!0}catch{return!1}}async function to(o,e){let t=[],r=[];if(!await Ee(o))return{existing:[],missing:[...e]};let i=(await Ie(o,"utf-8")).split(`
|
|
35
|
-
`).map(s=>R(s.trim()));for(let s of e){let p=R(s);i.includes(p)?t.push(s):r.push(s)}return{existing:t,missing:r}}async function gt(o,e){let{existing:t,missing:r}=await to(o,e);if(r.length===0)return{added:[],skipped:t};let n="";await Ee(o)&&(n=await Ie(o,"utf-8")),n.length>0&&!n.endsWith(`
|
|
36
|
-
`)&&(n+=`
|
|
37
|
-
`),n+=`
|
|
38
|
-
${pt}
|
|
39
|
-
`;for(let s of r)n+=`${s}
|
|
40
|
-
`;let i=ve(o,"..");return await Zt(i,{recursive:!0}),await lt(o,n,"utf-8"),{added:r,skipped:t}}async function Oe(o,e){if(!await Ee(o))return{removed:[]};let r=(await Ie(o,"utf-8")).split(`
|
|
41
|
-
`),n=e.map(R),i=[],s=[];for(let _ of r){let h=R(_.trim());if(h!==pt){if(n.includes(h)){let A=e.find(N=>R(N)===h);A&&!i.includes(A)&&i.push(A);continue}s.push(_)}}let p=[],c=!1;for(let _ of s){let h=_.trim()==="";h&&c||(p.push(_),c=h)}for(;p.length>0&&p[p.length-1].trim()==="";)p.pop();let y=p.length>0?p.join(`
|
|
42
|
-
`)+`
|
|
43
|
-
`:"";return await lt(o,y,"utf-8"),{removed:i}}function ge(o,e){return e==="gitignore"?ve(o,".gitignore"):ve(o,".git","info","exclude")}async function mt(o,e,t){let r=ct(t);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${t}`}:e==="none"?await ro(o,r):await oo(o,e,r)}async function oo(o,e,t){let r=ge(o,e),n=await gt(r,t);if(n.added.length===0)return{action:"skipped",entries:n.skipped,message:"Git ignore entries already present, skipping.",targetFiles:[r]};let i=e==="gitignore"?".gitignore":".git/info/exclude";return{action:"added",entries:n.added,message:`Added ${n.added.length} entries to ${i}: ${n.added.join(", ")}`,targetFiles:[r]}}async function ro(o,e){let t=ge(o,"gitignore"),r=ge(o,"exclude"),n=await Oe(t,e),i=await Oe(r,e),s=[...new Set([...n.removed,...i.removed])];if(s.length===0)return{action:"none",entries:[],message:"No Conductor git ignore entries found."};let p=[],c=[];return n.removed.length>0&&(p.push(t),c.push(`.gitignore (${n.removed.length})`)),i.removed.length>0&&(p.push(r),c.push(`.git/info/exclude (${i.removed.length})`)),{action:"removed",entries:s,message:`Removed entries from: ${c.join(", ")}`,targetFiles:p}}async function ft(o){let e=no(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 i=o.gitIgnore;o.gitIgnore&&n==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),i=void 0):!o.gitIgnore&&n==="project"&&(i=await tt());let s=at(r);console.log(`
|
|
44
|
-
Step 3: Validating project directory...`);let p;try{p=await s.validate(e,n)}catch(c){if(c instanceof Error&&c.message.includes("already installed"))if(t)console.log("\u26A0 Force mode: Overwriting existing installation"),p=e;else if(await io({message:`${c.message}
|
|
45
|
-
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 c}if(console.log(`\u2714 Validation complete: ${p}`),console.log(`
|
|
46
|
-
Step 4: Generating files...`),await s.generate(p,n,o.repo,o.branch,t),console.log("\u2714 Files generated"),i){console.log(`
|
|
47
|
-
Step 5: Configuring git ignore...`);let c=await mt(p,i,r);console.log(`\u2714 ${c.message}`)}console.log(`
|
|
48
|
-
\u2714 Conductor initialized successfully!`)}catch(r){console.error(`
|
|
49
|
-
\u2718 Installation failed:`,r instanceof Error?r.message:r),process.exit(1)}}import So 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`,g={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]}},rl=Object.keys(g.modifier),so=Object.keys(g.color),ao=Object.keys(g.bgColor),nl=[...so,...ao];function lo(){let o=new Map;for(let[e,t]of Object.entries(g)){for(let[r,n]of Object.entries(t))g[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},t[r]=g[r],o.set(n[0],n[1]);Object.defineProperty(g,e,{value:t,enumerable:!1})}return Object.defineProperty(g,"codes",{value:o,enumerable:!1}),g.color.close="\x1B[39m",g.bgColor.close="\x1B[49m",g.color.ansi=dt(),g.color.ansi256=ut(),g.color.ansi16m=yt(),g.bgColor.ansi=dt(10),g.bgColor.ansi256=ut(10),g.bgColor.ansi16m=yt(10),Object.defineProperties(g,{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(i=>i+i).join(""));let n=Number.parseInt(r,16);return[n>>16&255,n>>8&255,n&255]},enumerable:!1},hexToAnsi256:{value:e=>g.rgbToAnsi256(...g.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 i=Math.max(t,r,n)*2;if(i===0)return 30;let s=30+(Math.round(n)<<2|Math.round(r)<<1|Math.round(t));return i===2&&(s+=60),s},enumerable:!1},rgbToAnsi:{value:(e,t,r)=>g.ansi256ToAnsi(g.rgbToAnsi256(e,t,r)),enumerable:!1},hexToAnsi:{value:e=>g.ansi256ToAnsi(g.hexToAnsi256(e)),enumerable:!1}}),g}var po=lo(),w=po;import Ne from"process";import co 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:m}=Ne,me;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?me=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(me=1);function go(){if("FORCE_COLOR"in m)return m.FORCE_COLOR==="true"?1:m.FORCE_COLOR==="false"?0:m.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(m.FORCE_COLOR,10),3)}function mo(o){return o===0?!1:{level:o,hasBasic:!0,has256:o>=2,has16m:o>=3}}function fo(o,{streamIsTTY:e,sniffFlags:t=!0}={}){let r=go();r!==void 0&&(me=r);let n=t?me: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 m&&"AGENT_NAME"in m)return 1;if(o&&!e&&n===void 0)return 0;let i=n||0;if(m.TERM==="dumb")return i;if(Ne.platform==="win32"){let s=co.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in m)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in m)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in m)||m.CI_NAME==="codeship"?1:i;if("TEAMCITY_VERSION"in m)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(m.TEAMCITY_VERSION)?1:0;if(m.COLORTERM==="truecolor"||m.TERM==="xterm-kitty"||m.TERM==="xterm-ghostty"||m.TERM==="wezterm")return 3;if("TERM_PROGRAM"in m){let s=Number.parseInt((m.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(m.TERM_PROGRAM){case"iTerm.app":return s>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(m.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(m.TERM)||"COLORTERM"in m?1:i}function xt(o,e={}){let t=fo(o,{streamIsTTY:o&&o.isTTY,...e});return mo(t)}var uo={stdout:xt({isTTY:Ct.isatty(1)}),stderr:xt({isTTY:Ct.isatty(2)})},_t=uo;function ht(o,e,t){let r=o.indexOf(e);if(r===-1)return o;let n=e.length,i=0,s="";do s+=o.slice(i,r)+e+t,i=r+n,r=o.indexOf(e,i);while(r!==-1);return s+=o.slice(i),s}function At(o,e,t,r){let n=0,i="";do{let s=o[r-1]==="\r";i+=o.slice(n,s?r-1:r)+e+(s?`\r
|
|
50
|
-
`:`
|
|
51
|
-
`)+t,n=r+1,r=o.indexOf(`
|
|
52
|
-
`,n)}while(r!==-1);return i+=o.slice(n),i}var{stdout:St,stderr:wt}=_t,Ge=Symbol("GENERATOR"),E=Symbol("STYLER"),P=Symbol("IS_EMPTY"),bt=["ansi","ansi","ansi256","ansi16m"],O=Object.create(null),yo=(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 Co=o=>{let e=(...t)=>t.join(" ");return yo(e,o),Object.setPrototypeOf(e,j.prototype),e};function j(o){return Co(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),xo=["rgb","hex","ansi256"];for(let o of xo){O[o]={get(){let{level:t}=this;return function(...r){let n=Fe($e(o,bt[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,bt[t],"bgColor",...r),w.bgColor.close,this[E]);return fe(this,n,this[P])}}}}var _o=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)=>ho(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,_o),r[Ge]=o,r[E]=e,r[P]=t,r},ho=(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 i=e.indexOf(`
|
|
53
|
-
`);return i!==-1&&(e=At(e,n,r,i)),r+e+n};Object.defineProperties(j.prototype,O);var Ao=j(),Cl=j({level:wt?wt.level:0});var Tt=Ao;import vt from"fs";import Re from"path";import{fileURLToPath as wo}from"url";var bo=`
|
|
54
|
-
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
55
|
-
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
56
|
-
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
57
|
-
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
58
|
-
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
59
|
-
|
|
60
|
-
`;function It(){let o=Re.dirname(wo(import.meta.url)),e=Re.join(o,"../package.json");vt.existsSync(e)||(e=Re.join(o,"../../package.json"));let r=JSON.parse(vt.readFileSync(e,"utf-8")).version;console.log(Tt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
61
|
-
`))}function Et(){console.log(So("cyan","green")(bo))}async function Io(o){return await To(vo(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:I.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 Fl(o){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Et(),It());let e=await Io(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._})}export{Fl as a};
|