conductor-init 1.1.0 → 1.3.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 +50 -4
- package/dist/chunk-DA5XSRR7.js +62 -0
- package/dist/conductor-init.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-SFEQONKN.js +0 -61
package/README.md
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<div align="center">
|
|
2
|
-
<a href="https://github.com
|
|
2
|
+
<a href="https://github.com/Jonkimi/create-conductor-flow">
|
|
3
3
|
<img src="./conductor_flow_banner.png" alt="Conductor Scaffolding CLI Logo" width="512" height="384">
|
|
4
4
|
</a>
|
|
5
5
|
|
|
6
6
|
<h1>Conductor Scaffolding CLI</h1>
|
|
7
7
|
|
|
8
|
-
<p>
|
|
8
|
+
<p align="center">
|
|
9
9
|
<a href="https://www.npmjs.com/package/create-conductor-flow">
|
|
10
10
|
<img src="https://img.shields.io/npm/v/create-conductor-flow?color=0470f2&label=npm+version" alt="NPM Version">
|
|
11
11
|
</a>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<img src="https://img.shields.io/npm/dm/create-conductor-flow?color=orange" alt="Downloads">
|
|
17
17
|
</a>
|
|
18
18
|
</p>
|
|
19
|
-
<p>
|
|
19
|
+
<p align="center">
|
|
20
20
|
<strong>English</strong> | <a href="./README_zh.md">简体中文</a> | <a href="./README_ja.md">日本語</a> | <a href="./README_ko.md">한국어</a>
|
|
21
21
|
</p>
|
|
22
22
|
<br>
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
</blockquote>
|
|
26
26
|
<br>
|
|
27
27
|
</div>
|
|
28
|
+
|
|
28
29
|
Get started immediately with:
|
|
29
30
|
|
|
30
31
|
```bash
|
|
@@ -154,12 +155,13 @@ Options:
|
|
|
154
155
|
entries) [string] [choices: "gitignore", "exclude", "none"]
|
|
155
156
|
-f, --force Force overwrite existing installation
|
|
156
157
|
[boolean] [default: false]
|
|
158
|
+
--reset Clear saved preferences and show all prompts
|
|
159
|
+
[boolean] [default: false]
|
|
157
160
|
-h, --help Show help [boolean]
|
|
158
161
|
-v, --version Show version number [boolean]
|
|
159
162
|
|
|
160
163
|
Examples:
|
|
161
164
|
npm create conductor-flow Install with interactive prompts
|
|
162
|
-
(template source selection)
|
|
163
165
|
npm create conductor-flow --agent Install for Claude Code agent
|
|
164
166
|
claude-code
|
|
165
167
|
npm create conductor-flow --repo Use custom template repository
|
|
@@ -170,11 +172,55 @@ Examples:
|
|
|
170
172
|
exclude .git/info/exclude
|
|
171
173
|
npm create conductor-flow --git-ignore Remove Conductor entries from git
|
|
172
174
|
none ignore
|
|
175
|
+
npm create conductor-flow --reset Clear saved preferences and show all
|
|
176
|
+
prompts
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
### Configuration Persistence
|
|
181
|
+
|
|
182
|
+
The CLI remembers your preferences between runs, so you don't have to specify the same options every time.
|
|
183
|
+
|
|
184
|
+
**What's Saved:**
|
|
185
|
+
- Agent selection (`--agent`)
|
|
186
|
+
- Template source (`--repo`, `--branch`)
|
|
187
|
+
- Git ignore preference (`--git-ignore`)
|
|
188
|
+
|
|
189
|
+
**How It Works:**
|
|
190
|
+
1. On first run, select your preferences interactively or via flags
|
|
191
|
+
2. On subsequent runs, saved preferences are automatically applied
|
|
192
|
+
3. CLI flags always override saved preferences
|
|
193
|
+
|
|
194
|
+
**Example:**
|
|
195
|
+
|
|
196
|
+
```bash
|
|
197
|
+
# First run - specify your preferences
|
|
198
|
+
npm create conductor-flow --agent claude-code --git-ignore exclude
|
|
199
|
+
|
|
200
|
+
# Future runs - automatically uses claude-code and exclude
|
|
201
|
+
npm create conductor-flow
|
|
202
|
+
# Output: [Config] Using saved agent: claude-code
|
|
203
|
+
# Output: [Config] Using saved git-ignore: exclude
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
**Reset Preferences:**
|
|
207
|
+
|
|
208
|
+
To clear saved preferences and start fresh with all prompts:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm create conductor-flow --reset
|
|
173
212
|
```
|
|
174
213
|
|
|
214
|
+
**Configuration Location:**
|
|
215
|
+
|
|
216
|
+
Preferences are stored following the XDG Base Directory Specification:
|
|
217
|
+
- **macOS**: `~/Library/Application Support/create-conductor-flow/config.json`
|
|
218
|
+
- **Linux**: `~/.config/create-conductor-flow/config.json`
|
|
219
|
+
- **Windows**: `%APPDATA%\create-conductor-flow\config.json`
|
|
175
220
|
|
|
176
221
|
### 3. Shell Completion for Global Installation(Advanced Setup)
|
|
177
222
|
|
|
223
|
+
|
|
178
224
|
Enable tab completion for specific shells (Bash, Zsh) to make using `conductor-init` easier.
|
|
179
225
|
|
|
180
226
|
#### Global Installation
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import nr from"yargs";import{hideBin as ir}from"yargs/helpers";import Fe from"@inquirer/select";var q={agentType:"opencode",agentDir:".opencode",commandsDir:"commands",displayName:"OpenCode",protocolFilename:"AGENTS.md",description:"The open source AI coding agent"};var K={agentType:"claude-code",agentDir:".claude",commandsDir:"commands",displayName:"Claude Code",protocolFilename:"CLAUDE.md",description:"Anthropic's coding assistant"};var X={agentType:"antigravity",agentDir:".agent",commandsDir:"workflows",displayName:"Antigravity",protocolFilename:"GEMINI.md",description:"Google's agentic coding assistant"};var z={agentType:"cursor",agentDir:".cursor",commandsDir:"commands",displayName:"Cursor",protocolFilename:"AGENTS.md",description:"Cursor IDE's AI agent"};import{parse as mo}from"smol-toml";import{readFile as so}from"fs/promises";import{join as at,resolve as nt}from"path";import{fileURLToPath as ao}from"url";import{execSync as it}from"child_process";import{createHash as co}from"crypto";import B from"fs-extra";import{join as ot}from"path";import{homedir as to}from"os";import j from"fs-extra";import{join as T}from"path";import{homedir as ze,platform as Je}from"os";import L from"fs-extra";var N="create-conductor-flow",eo="config.json";function Qe(){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,N);let t=ze();switch(Je()){case"win32":return T(process.env.APPDATA||T(t,"AppData","Roaming"),N);case"darwin":return T(t,".config",N);default:return T(t,".config",N)}}function Ze(){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,N);let t=ze();switch(Je()){case"win32":return T(process.env.LOCALAPPDATA||T(t,"AppData","Local"),N);case"darwin":return T(t,".cache",N);default:return T(t,".cache",N)}}function Ie(){return T(Qe(),eo)}async function Te(){try{let t=Ie();if(!await L.pathExists(t))return{};let e=await L.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 et(t){let e=Ie(),o=Qe();await L.ensureDir(o);let n={...await Te(),...t};await L.writeJson(e,n,{spaces:2})}async function tt(){let t=Ie();await L.pathExists(t)&&await L.remove(t)}var oo=".gemini/cache/conductor",ro="templates";function no(){return process.env.CONDUCTOR_LEGACY_CACHE_DIR?process.env.CONDUCTOR_LEGACY_CACHE_DIR:ot(to(),oo)}function we(){return ot(Ze(),ro)}async function io(t){return await j.pathExists(t)?(await j.readdir(t)).length===0:!0}async function rt(){let t=no(),e=we();try{return await j.pathExists(t)?await io(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 st=ao(new URL(".",import.meta.url)),R="https://github.com/gemini-cli-extensions/conductor",O="main";function lo(t=R,e=O){let o=co("md5").update(`${t}#${e}`).digest("hex");return at(we(),o)}function ct(t=R,e=O){return lo(t,e)}async function po(t=R,e=O){let o=ct(t,e);if(B.existsSync(o))try{console.log(`Updating templates from ${t} [${e}]...`),it("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 B.ensureDir(o),console.log(`Downloading templates from ${t} [${e}]...`);try{it(`git clone ${t} --branch ${e} --depth 1 .`,{cwd:o,stdio:["ignore","ignore","pipe"]})}catch(r){throw await B.remove(o),new Error(`Failed to clone templates: ${r instanceof Error?r.message:String(r)}`)}}}function _(t,e){return t.replace(/\{(\w+)\}/g,(o,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:o)}function go(){let t=nt(st,"conductor");return B.existsSync(t)?t:nt(st,"../conductor")}async function lt(t,e){if(!t){let o=go();if(await B.pathExists(o))return console.log("use bundled Conductor templates"),o}return await po(t,e),ct(t,e)}async function pt(t,e){let o=at(e,t);return so(o,"utf-8")}var k="conductor-",h="~/.gemini/extensions/conductor";var Ee=class{process(e,o){let{installPath:r,agentType:n,fixedAgent:i}=o,s=mo(e);if(!s.prompt)return null;let l=s.prompt;l=l.replaceAll(h,r);let p=_(l,{agent_type:n});return`---
|
|
2
|
+
description: ${s.description||""}
|
|
3
|
+
agent: ${i}
|
|
4
|
+
---
|
|
5
|
+
${p}`}},gt=new Ee;var J={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:gt}};var Q={agentType:"codex",agentDir:".codex",commandsDir:"prompts",displayName:"Codex",protocolFilename:"AGENTS.md",description:"OpenAI Codex Agent",extension:".md"};var Z={agentType:"windsurf",agentDir:".windsurf",commandsDir:"workflows",displayName:"Windsurf",protocolFilename:"AGENTS.md",description:"Windsurf Cascade AI Agent"};import{parse as fo}from"smol-toml";var ve=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=fo(e);if(!s.prompt)return null;let l=s.prompt;l=l.replaceAll(h,r);let p=_(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}`}},mt=new ve;var ee={agentType:"cline",agentDir:".clinerules",commandsDir:"workflows",displayName:"Cline",protocolFilename:"AGENTS.md",description:"Cline AI coding assistant",strategy:{content:mt}};import{join as uo}from"path";import yo from"fs-extra";import{parse as ho}from"smol-toml";var{writeFile:Co}=yo,Oe=class{process(e,o){let{installPath:r,agentType:n}=o;if(!ho(e).prompt)return null;let s=e.replaceAll(h,r);return _(s,{agent_type:n})}},be=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${i}${s}`;await Co(uo(o,r,n,p),l)}},ft=new Oe,dt=new be;var te={agentType:"gemini",agentDir:".gemini",commandsDir:"commands/conductor",displayName:"Gemini CLI",protocolFilename:"GEMINI.md",description:"Google Gemini CLI agent",extension:".toml",usesPrefix:!1,strategy:{content:ft,file:dt}};import{parse as _o}from"smol-toml";var Ne=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=_o(e);if(!s.prompt)return null;let l=s.prompt;l=l.replaceAll(h,r);let p=_(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}`}},ut=new Ne;var oe={agentType:"kilo-code",agentDir:".kilocode",commandsDir:"workflows",displayName:"Kilo Code",protocolFilename:"AGENTS.md",description:"Kilo Code AI coding assistant",strategy:{content:ut}};import{parse as xo}from"smol-toml";var De=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=xo(e);if(!s.prompt)return null;let l=s.prompt;l=l.replaceAll(h,r);let p=_(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}`}},yt=new De;var re={agentType:"roo-code",agentDir:".roo",commandsDir:"commands",displayName:"Roo Code",protocolFilename:"AGENTS.md",description:"Roo Code AI coding assistant",strategy:{content:yt}};import{parse as Ao}from"smol-toml";var Ge=class{process(e,o){let{installPath:r,agentType:n}=o,i=Ao(e);if(!i.prompt)return null;let s=i.prompt;s=s.replaceAll(h,r);let l=_(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
24
|
+
description: "${i.description.replace(/"/g,'\\"')}"
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
`),`${p}${l}`}},Ct=new Ge;var ne={agentType:"qwen-code",agentDir:".qwen",commandsDir:"commands",displayName:"Qwen Code",protocolFilename:"AGENTS.md",description:"Qwen Code AI coding assistant",strategy:{content:Ct}};import{parse as So}from"smol-toml";var Re=class{process(e,o){let{installPath:r,agentType:n}=o,i=So(e);if(!i.prompt)return null;let s=i.prompt;s=s.replaceAll(h,r);let l=_(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
28
|
+
description: "${i.description.replace(/"/g,'\\"')}"
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
`),`${p}${l}`}},ht=new Re;var ie={agentType:"factory-droid",agentDir:".factory",commandsDir:"commands",displayName:"Factory Droid",protocolFilename:"AGENTS.md",description:"Factory Droid AI coding assistant",strategy:{content:ht}};var P=[q,K,X,z,J,Q,Z,ee,oe,re,ne,ie,te];async function _t(t){let e=t==="codex",o=t==="cline";return await Fe({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 xt(){let t=P.map(o=>{let{displayName:r,agentType:n,protocolFilename:i,agentDir:s,commandsDir:l,description:p}=o,f=p||`${r} agent`,x=`\x1B[90m(${i}, ${s}/${l})\x1B[0m`;return{name:`${r} ${x}`,value:n,description:f}});return await Fe({message:"Select your coding agent:",choices:t,default:"opencode",loop:!0})}async function At(){return await Fe({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 Io}from"path";import To from"fs-extra";import{parse as Eo}from"smol-toml";var{writeFile:wo}=To,Le=class{process(e,o){let{installPath:r,agentType:n}=o,i=Eo(e);if(!i.prompt)return null;let s=i.prompt;console.log(h,r),s=s.replaceAll(h,r),s=s.replace(/\/conductor:/g,`/${k}`);let l=_(s,{agent_type:n});return i.description?`---
|
|
32
|
+
description: ${i.description}
|
|
33
|
+
---
|
|
34
|
+
${l}`:l}},Pe=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${k}${i}${s}`;await wo(Io(o,r,n,p),l)}},St=new Le,It=new Pe;import{join as A}from"path";import vo from"@inquirer/select";import wt from"fs-extra";var{existsSync:D,ensureDir:Tt,copy:Ue}=wt,E=class{constructor(e){this.config=e}async validate(e,o){if(!D(e))throw new Error(`Target directory does not exist: ${e}`);let{agentDir:r,commandsDir:n,displayName:i,extension:s,usesPrefix:l}=this.config,x=`${l!==!1?k:""}setup${s||".md"}`,C=A(e,r,n,x),d=A(e,r,"conductor");if(D(d)&&D(C))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,f=A(e,s),x=A(f,l),C=A(s,"conductor");o==="global"&&(C=`~/${s}/conductor`),await Tt(x),await Tt(A(f,"conductor"));let d=await lt(r,n);try{let u=A(d,"templates"),I=A(f,"conductor","templates");await Ue(u,I)}catch(u){console.warn("Failed to copy templates directory:",u)}let{protocolFilename:v}=this.config;if(v)try{let u=A(d,"GEMINI.md"),I=A(e,v);if(D(u)){let G=!0;D(I)&&!i&&(G=await vo({message:`The protocol file '${v}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),G&&await Ue(u,I)}}catch(u){console.warn("Failed to handle protocol file:",u)}let $=[];try{let u=A(d,"commands/conductor");if(D(u)){let I=await wt.readdir(u);Array.isArray(I)&&($=I.filter(G=>G.endsWith(".toml")).map(G=>G.replace(/\.toml$/,"")))}}catch(u){console.warn("Failed to discover commands:",u)}$.length===0?(console.log("No commands discovered, using default commands"),$=["setup","newTrack","implement","status","revert","review"]):console.log(`Discovered commands: ${$.join(", ")}`);let Qt=this.config.extension||".md",Zt=this.config.fixedAgent;for(let u of $)try{let I=await pt(A("commands","conductor",`${u}.toml`),d),Xe=(this.config.strategy?.content||St).process(I,{installPath:C,agentType:p,fixedAgent:Zt,commandName:u});Xe&&await(this.config.strategy?.file||It).write({targetDir:e,agentDir:s,commandsDir:l,commandName:u,extension:Qt,content:Xe})}catch(I){console.warn(`Failed to process ${u}:`,I)}let qe=A(d,"templates/workflow.md"),Ke=A(e,"conductor/workflow.md");if(D(Ke)&&D(qe))try{await Ue(qe,Ke),console.log("\u2714 conductor/workflow.md synced")}catch(u){console.warn("Failed to handle workflow file:",u)}else console.warn("Workflow template not found, skipping workflow file sync")}};function y(t){return new E(t)}var se=class{generator=y(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=y(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 ce=class{generator=y(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)}};var le=class{generator=y(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 pe=class{generator=y(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)}};import{homedir as Et}from"os";var ge=class{generator=y(Q);validate(e,o){return o==="global"&&(e=Et()),this.generator.validate(e,o)}generate(e,o,r,n,i){return o==="global"&&(e=Et()),this.generator.generate(e,o,r,n,i)}};var me=class{generator=y(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{generator=y(ee);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 de=class{generator=y(te);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 ue=class{generator=y(oe);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 ye=class extends E{constructor(){super(re)}};var Ce=class extends E{constructor(){super(ne)}};var he=class extends E{constructor(){super(ie)}};function vt(t){switch(t){case"claude-code":return new ae;case"antigravity":return new ce;case"cursor":return new le;case"github-copilot":return new pe;case"codex":return new ge;case"windsurf":return new me;case"cline":return new fe;case"kilo-code":return new ue;case"roo-code":return new ye;case"qwen-code":return new Ce;case"factory-droid":return new he;case"gemini":return new de;default:return new se}}import{resolve as Mo}from"path";import $o from"@inquirer/select";import{join as Me}from"path";import{readFile as $e,writeFile as Ot,access as Oo,mkdir as bo}from"fs/promises";import{constants as No}from"fs";var bt="# Conductor";function Nt(t){let e=P.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 H(t){return t.replace(/\/+$/,"")}async function je(t){try{return await Oo(t,No.F_OK),!0}catch{return!1}}async function Do(t,e){let o=[],r=[];if(!await je(t))return{existing:[],missing:[...e]};let i=(await $e(t,"utf-8")).split(`
|
|
35
|
+
`).map(s=>H(s.trim()));for(let s of e){let l=H(s);i.includes(l)?o.push(s):r.push(s)}return{existing:o,missing:r}}async function Dt(t,e){let{existing:o,missing:r}=await Do(t,e);if(r.length===0)return{added:[],skipped:o};let n="";await je(t)&&(n=await $e(t,"utf-8")),n.length>0&&!n.endsWith(`
|
|
36
|
+
`)&&(n+=`
|
|
37
|
+
`),n+=`
|
|
38
|
+
${bt}
|
|
39
|
+
`;for(let s of r)n+=`${s}
|
|
40
|
+
`;let i=Me(t,"..");return await bo(i,{recursive:!0}),await Ot(t,n,"utf-8"),{added:r,skipped:o}}async function Be(t,e){if(!await je(t))return{removed:[]};let r=(await $e(t,"utf-8")).split(`
|
|
41
|
+
`),n=e.map(H),i=[],s=[];for(let x of r){let C=H(x.trim());if(C!==bt){if(n.includes(C)){let d=e.find(v=>H(v)===C);d&&!i.includes(d)&&i.push(d);continue}s.push(x)}}let l=[],p=!1;for(let x of s){let C=x.trim()==="";C&&p||(l.push(x),p=C)}for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();let f=l.length>0?l.join(`
|
|
42
|
+
`)+`
|
|
43
|
+
`:"";return await Ot(t,f,"utf-8"),{removed:i}}function _e(t,e){return e==="gitignore"?Me(t,".gitignore"):Me(t,".git","info","exclude")}async function Gt(t,e,o){let r=Nt(o);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${o}`}:e==="none"?await Ro(t,r):await Go(t,e,r)}async function Go(t,e,o){let r=_e(t,e),n=await Dt(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 Ro(t,e){let o=_e(t,"gitignore"),r=_e(t,"exclude"),n=await Be(o,e),i=await Be(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 Lo from"@inquirer/select";import Rt from"@inquirer/input";import{execSync as Fo}from"child_process";var V;function xe(){if(V!==void 0)return V;try{Fo("git --version",{stdio:"ignore"}),V=!0}catch{V=!1}return V}var b={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:"},F={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.",GIT_NOT_FOUND_INFO:"\u2139 Remote templates require git. Install git to enable remote options.",GIT_NOT_FOUND_FALLBACK:"\u26A0 git not found, falling back to bundled templates",GIT_NOT_FOUND_SKIP_GITIGNORE:"\u26A0 git not found, skipping git ignore configuration"};function Po(){return!(process.env.CI==="true"||!process.stdin.isTTY)}function Uo(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 Ft(){if(!Po())return console.log(F.NON_INTERACTIVE_BUNDLED),{source:"bundled"};let t=xe();t||console.log(F.GIT_NOT_FOUND_INFO);let e=[{name:b.BUNDLED_LABEL,value:"bundled",description:b.BUNDLED_DESCRIPTION},...t?[{name:b.OFFICIAL_LABEL,value:"official",description:b.OFFICIAL_DESCRIPTION},{name:b.CUSTOM_LABEL,value:"custom",description:b.CUSTOM_DESCRIPTION}]:[]];switch(await Lo({message:b.SELECT_SOURCE_MESSAGE,choices:e,default:"bundled"})){case"bundled":return{source:"bundled"};case"official":return{source:"official",repo:R,branch:O};case"custom":{let r=await Rt({message:b.CUSTOM_REPO_PROMPT,validate:Uo}),n=await Rt({message:b.CUSTOM_BRANCH_PROMPT,default:O});return{source:"custom",repo:r.trim(),branch:n.trim()||O}}default:return{source:"bundled"}}}function Lt(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 Pt(t){let e=Mo(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 xt(),console.log(`\u2714 Selected agent: ${n}`));let i;t.scope?(i=t.scope,console.log(`Using provided scope: ${i}`)):i=await _t(n),console.log(`\u2714 Selected scope: ${i}`);let s=xe(),l=t.gitIgnore;!s&&(t.gitIgnore||r.gitIgnore)?(console.warn(F.GIT_NOT_FOUND_SKIP_GITIGNORE),l=void 0):t.gitIgnore&&i==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),l=void 0):!t.gitIgnore&&i==="project"&&s&&(r.gitIgnore?(l=r.gitIgnore,console.log(`[Config] Using saved git-ignore: ${l}`)):l=await At());let p=t.repo,f=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)p=r.repo,f=r.branch??f,console.log(`[Config] Using saved template source: ${p} [${f}]`);else{let d=await Ft(),v=Lt(d);p=v.repo,f=v.branch,d.source==="bundled"?console.log(`\u2714 ${F.USING_BUNDLED}`):p&&console.log(`\u2714 ${F.DOWNLOADING_FROM(p,f||"main")}`)}p&&!s&&(console.warn(F.GIT_NOT_FOUND_FALLBACK),p=void 0,f=void 0);let x=vt(n);console.log(`
|
|
44
|
+
Step 3: Validating project directory...`);let C;try{C=await x.validate(e,i)}catch(d){if(d instanceof Error&&d.message.includes("already installed"))if(o)console.log("\u26A0 Force mode: Overwriting existing installation"),C=e;else if(await $o({message:`${d.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..."),C=e;else{console.log("Installation cancelled.");return}else throw d}if(console.log(`\u2714 Validation complete: ${C}`),console.log(`
|
|
46
|
+
Step 4: Generating files...`),await x.generate(C,i,p,f,o),console.log("\u2714 Files generated"),l){console.log(`
|
|
47
|
+
Step 5: Configuring git ignore...`);let d=await Gt(C,l,n);console.log(`\u2714 ${d.message}`)}console.log(`
|
|
48
|
+
Saving preferences...`),await et({agent:n,repo:p,branch:f,gitIgnore:l}),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 tr from"gradient-string";var Ut=(t=0)=>e=>`\x1B[${e+t}m`,Mt=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,$t=(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]}},fl=Object.keys(g.modifier),jo=Object.keys(g.color),Bo=Object.keys(g.bgColor),dl=[...jo,...Bo];function ko(){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=Ut(),g.color.ansi256=Mt(),g.color.ansi16m=$t(),g.bgColor.ansi=Ut(10),g.bgColor.ansi256=Mt(10),g.bgColor.ansi16m=$t(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 Ho=ko(),w=Ho;import ke from"process";import Vo from"os";import jt from"tty";function S(t,e=globalThis.Deno?globalThis.Deno.args:ke.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}=ke,Ae;S("no-color")||S("no-colors")||S("color=false")||S("color=never")?Ae=0:(S("color")||S("colors")||S("color=true")||S("color=always"))&&(Ae=1);function Yo(){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 Wo(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function qo(t,{streamIsTTY:e,sniffFlags:o=!0}={}){let r=Yo();r!==void 0&&(Ae=r);let n=o?Ae:r;if(n===0)return 0;if(o){if(S("color=16m")||S("color=full")||S("color=truecolor"))return 3;if(S("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(ke.platform==="win32"){let s=Vo.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 Bt(t,e={}){let o=qo(t,{streamIsTTY:t&&t.isTTY,...e});return Wo(o)}var Ko={stdout:Bt({isTTY:jt.isatty(1)}),stderr:Bt({isTTY:jt.isatty(2)})},kt=Ko;function Ht(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 Vt(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:Yt,stderr:Wt}=kt,He=Symbol("GENERATOR"),U=Symbol("STYLER"),Y=Symbol("IS_EMPTY"),qt=["ansi","ansi","ansi256","ansi16m"],M=Object.create(null),Xo=(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=Yt?Yt.level:0;t.level=e.level===void 0?o:e.level};var zo=t=>{let e=(...o)=>o.join(" ");return Xo(e,t),Object.setPrototypeOf(e,W.prototype),e};function W(t){return zo(t)}Object.setPrototypeOf(W.prototype,Function.prototype);for(let[t,e]of Object.entries(w))M[t]={get(){let o=Se(this,Ye(e.open,e.close,this[U]),this[Y]);return Object.defineProperty(this,t,{value:o}),o}};M.visible={get(){let t=Se(this,this[U],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Ve=(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"?Ve("rgb",e,o,...w.hexToRgb(...r)):w[o][t](...r),Jo=["rgb","hex","ansi256"];for(let t of Jo){M[t]={get(){let{level:o}=this;return function(...r){let n=Ye(Ve(t,qt[o],"color",...r),w.color.close,this[U]);return Se(this,n,this[Y])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);M[e]={get(){let{level:o}=this;return function(...r){let n=Ye(Ve(t,qt[o],"bgColor",...r),w.bgColor.close,this[U]);return Se(this,n,this[Y])}}}}var Qo=Object.defineProperties(()=>{},{...M,level:{enumerable:!0,get(){return this[He].level},set(t){this[He].level=t}}}),Ye=(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}},Se=(t,e,o)=>{let r=(...n)=>Zo(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,Qo),r[He]=t,r[U]=e,r[Y]=o,r},Zo=(t,e)=>{if(t.level<=0||!e)return t[Y]?"":e;let o=t[U];if(o===void 0)return e;let{openAll:r,closeAll:n}=o;if(e.includes("\x1B"))for(;o!==void 0;)e=Ht(e,o.close,o.open),o=o.parent;let i=e.indexOf(`
|
|
54
|
+
`);return i!==-1&&(e=Vt(e,n,r,i)),r+e+n};Object.defineProperties(W.prototype,M);var er=W(),vl=W({level:Wt?Wt.level:0});var Kt=er;import Xt from"fs";import We from"path";import{fileURLToPath as or}from"url";var rr=`
|
|
55
|
+
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
56
|
+
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
57
|
+
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
58
|
+
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
59
|
+
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
60
|
+
|
|
61
|
+
`;function zt(){let t=We.dirname(or(import.meta.url)),e=We.join(t,"../package.json");Xt.existsSync(e)||(e=We.join(t,"../../package.json"));let r=JSON.parse(Xt.readFileSync(e,"utf-8")).version;console.log(Kt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
62
|
+
`))}function Jt(){console.log(tr("cyan","green")(rr))}async function sr(t){let e=nr(ir(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:P.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===""?R:o).option("branch",{alias:"b",describe:"Branch name for template repository",type:"string",default:O}).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").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 Yl(t){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Jt(),zt());let e=await sr(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 tt()):(r=await Te(),Object.keys(r).length>0&&console.log("[Config] Loaded saved preferences")),await rt(),await Pt({...e,path:o||e.path||".",gitIgnore:e["git-ignore"],$0:"conductor-init",_:e._,config:r})}export{Yl as a};
|
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-DA5XSRR7.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-DA5XSRR7.js";r("npm create conductor-flow").catch(o=>{console.error("Error:",o instanceof Error?o.message:o),process.exit(1)});
|
package/package.json
CHANGED
package/dist/chunk-SFEQONKN.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import Go from"yargs";import{hideBin as Fo}from"yargs/helpers";import Ie from"@inquirer/select";var M={agentType:"opencode",agentDir:".opencode",commandsDir:"commands",displayName:"OpenCode",protocolFilename:"AGENTS.md",description:"The open source AI coding agent"};var B={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 V={agentType:"cursor",agentDir:".cursor",commandsDir:"commands",displayName:"Cursor",protocolFilename:"AGENTS.md",description:"Cursor IDE's AI agent"};import{parse as kt}from"smol-toml";import{readFile as Pt}from"fs/promises";import{join as Ve,resolve as Me}from"path";import{fileURLToPath as Lt}from"url";import{homedir as jt}from"os";import{execSync as Be}from"child_process";import{createHash as Ut}from"crypto";import $ from"fs-extra";var ke=Lt(new URL(".",import.meta.url)),v="https://github.com/gemini-cli-extensions/conductor",b="main";function He(t=v,e=b){let o=Ut("md5").update(`${t}#${e}`).digest("hex");return Ve(jt(),".gemini/cache/conductor",o)}async function Mt(t=v,e=b){let o=He(t,e);if($.existsSync(o))try{console.log(`Updating templates from ${t} [${e}]...`),Be("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 $.ensureDir(o),console.log(`Downloading templates from ${t} [${e}]...`);try{Be(`git clone ${t} --branch ${e} --depth 1 .`,{cwd:o,stdio:["ignore","ignore","pipe"]})}catch(r){throw await $.remove(o),new Error(`Failed to clone templates: ${r instanceof Error?r.message:String(r)}`)}}}function C(t,e){return t.replace(/\{(\w+)\}/g,(o,r)=>Object.prototype.hasOwnProperty.call(e,r)?e[r]:o)}function Bt(){let t=Me(ke,"conductor");return $.existsSync(t)?t:Me(ke,"../conductor")}async function We(t,e){if(!t){let o=Bt();if(await $.pathExists(o))return console.log("use bundled Conductor templates"),o}return await Mt(t,e),He(t,e)}async function Ye(t,e){let o=Ve(e,t);return Pt(o,"utf-8")}var ye=class{process(e,o){let{installPath:r,agentType:n,fixedAgent:i}=o,s=kt(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=C(l,{agent_type:n});return`---
|
|
2
|
-
description: ${s.description||""}
|
|
3
|
-
agent: ${i}
|
|
4
|
-
---
|
|
5
|
-
${p}`}},qe=new ye;var H={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:qe}};var W={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 Vt}from"smol-toml";var Ce=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=Vt(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=C(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}`}},ze=new Ce;var q={agentType:"cline",agentDir:".clinerules",commandsDir:"workflows",displayName:"Cline",protocolFilename:"AGENTS.md",description:"Cline AI coding assistant",strategy:{content:ze}};import{join as Ht}from"path";import Wt from"fs-extra";import{parse as qt}from"smol-toml";var{writeFile:Yt}=Wt,_e=class{process(e,o){let{installPath:r,agentType:n}=o;if(!qt(e).prompt)return null;let s=e.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);return C(s,{agent_type:n})}},he=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${i}${s}`;await Yt(Ht(o,r,n,p),l)}},Ke=new _e,Xe=new he;var z={agentType:"gemini",agentDir:".gemini",commandsDir:"commands/conductor",displayName:"Gemini CLI",protocolFilename:"GEMINI.md",description:"Google Gemini CLI agent",extension:".toml",usesPrefix:!1,strategy:{content:Ke,file:Xe}};import{parse as zt}from"smol-toml";var xe=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=zt(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace(/__\$\$CODE_AGENT_INSTALL_PATH\$\$__/g,r);let p=C(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}`}},Je=new xe;var K={agentType:"kilo-code",agentDir:".kilocode",commandsDir:"workflows",displayName:"Kilo Code",protocolFilename:"AGENTS.md",description:"Kilo Code AI coding assistant",strategy:{content:Je}};import{parse as Kt}from"smol-toml";var Ae=class{process(e,o){let{installPath:r,agentType:n,commandName:i}=o,s=Kt(e);if(!s.prompt)return null;let l=s.prompt;l=l.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let p=C(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}`}},Qe=new Ae;var X={agentType:"roo-code",agentDir:".roo",commandsDir:"commands",displayName:"Roo Code",protocolFilename:"AGENTS.md",description:"Roo Code AI coding assistant",strategy:{content:Qe}};import{parse as Xt}from"smol-toml";var Se=class{process(e,o){let{installPath:r,agentType:n}=o,i=Xt(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=C(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
24
|
-
description: "${i.description.replace(/"/g,'\\"')}"
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
`),`${p}${l}`}},Ze=new Se;var J={agentType:"qwen-code",agentDir:".qwen",commandsDir:"commands",displayName:"Qwen Code",protocolFilename:"AGENTS.md",description:"Qwen Code AI coding assistant",strategy:{content:Ze}};import{parse as Jt}from"smol-toml";var Te=class{process(e,o){let{installPath:r,agentType:n}=o,i=Jt(e);if(!i.prompt)return null;let s=i.prompt;s=s.replace("__$$CODE_AGENT_INSTALL_PATH$$__",r);let l=C(s,{agent_type:n}),p="";return i.description&&(p=`---
|
|
28
|
-
description: "${i.description.replace(/"/g,'\\"')}"
|
|
29
|
-
---
|
|
30
|
-
|
|
31
|
-
`),`${p}${l}`}},et=new Te;var Q={agentType:"factory-droid",agentDir:".factory",commandsDir:"commands",displayName:"Factory Droid",protocolFilename:"AGENTS.md",description:"Factory Droid AI coding assistant",strategy:{content:et}};var N=[M,B,k,V,H,W,Y,q,K,X,J,Q,z];async function tt(t){let e=t==="codex",o=t==="cline";return await Ie({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 ot(){let t=N.map(o=>{let{displayName:r,agentType:n,protocolFilename:i,agentDir:s,commandsDir:l,description:p}=o,d=p||`${r} agent`,f=`\x1B[90m(${i}, ${s}/${l})\x1B[0m`;return{name:`${r} ${f}`,value:n,description:d}});return await Ie({message:"Select your coding agent:",choices:t,default:"opencode",loop:!0})}async function rt(){return await Ie({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 to}from"smol-toml";var P="conductor-";var{writeFile:eo}=Zt,we=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,`/${P}`);let l=C(s,{agent_type:n});return i.description?`---
|
|
32
|
-
description: ${i.description}
|
|
33
|
-
---
|
|
34
|
-
${l}`:l}},be=class{async write(e){let{targetDir:o,agentDir:r,commandsDir:n,commandName:i,extension:s,content:l}=e,p=`${P}${i}${s}`;await eo(Qt(o,r,n,p),l)}},nt=new we,it=new be;import{join as h}from"path";import oo from"@inquirer/select";import at from"fs-extra";var{existsSync:E,ensureDir:st,copy:Ee}=at,I=class{constructor(e){this.config=e}async validate(e,o){if(!E(e))throw new Error(`Target directory does not exist: ${e}`);let{agentDir:r,commandsDir:n,displayName:i,extension:s,usesPrefix:l}=this.config,f=`${l!==!1?P:""}setup${s||".md"}`,_=h(e,r,n,f),A=h(e,r,"conductor");if(E(A)&&E(_))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,d=h(e,s),f=h(d,l),_=h(s,"conductor");o==="global"&&(_=`~/${s}/conductor`),await st(f),await st(h(d,"conductor"));let A=await We(r,n);try{let u=h(A,"templates"),S=h(d,"conductor","templates");await Ee(u,S)}catch(u){console.warn("Failed to copy templates directory:",u)}let{protocolFilename:G}=this.config;if(G)try{let u=h(A,"GEMINI.md"),S=h(e,G);if(E(u)){let O=!0;E(S)&&!i&&(O=await oo({message:`The protocol file '${G}' already exists. Do you want to overwrite it?`,choices:[{value:!0,name:"Overwrite"},{value:!1,name:"Skip"}]})),O&&await Ee(u,S)}}catch(u){console.warn("Failed to handle protocol file:",u)}let F=[];try{let u=h(A,"commands/conductor");if(E(u)){let S=await at.readdir(u);Array.isArray(S)&&(F=S.filter(O=>O.endsWith(".toml")).map(O=>O.replace(/\.toml$/,"")))}}catch(u){console.warn("Failed to discover commands:",u)}F.length===0?(console.log("No commands discovered, using default commands"),F=["setup","newTrack","implement","status","revert","review"]):console.log(`Discovered commands: ${F.join(", ")}`);let Ft=this.config.extension||".md",$t=this.config.fixedAgent;for(let u of F)try{let S=await Ye(h("commands","conductor",`${u}.toml`),A),Ue=(this.config.strategy?.content||nt).process(S,{installPath:_,agentType:p,fixedAgent:$t,commandName:u});Ue&&await(this.config.strategy?.file||it).write({targetDir:e,agentDir:s,commandsDir:l,commandName:u,extension:Ft,content:Ue})}catch(S){console.warn(`Failed to process ${u}:`,S)}let Le=h(A,"templates/workflow.md"),je=h(e,"conductor/workflow.md");if(E(je)&&E(Le))try{await Ee(Le,je),console.log("\u2714 conductor/workflow.md synced")}catch(u){console.warn("Failed to handle workflow file:",u)}else console.warn("Workflow template not found, skipping workflow file sync")}};function y(t){return new I(t)}var Z=class{generator=y(M);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 ee=class{generator=y(B);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 te=class{generator=y(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 oe=class{generator=y(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 re=class{generator=y(H);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 ct}from"os";var ne=class{generator=y(W);validate(e,o){return o==="global"&&(e=ct()),this.generator.validate(e,o)}generate(e,o,r,n,i){return o==="global"&&(e=ct()),this.generator.generate(e,o,r,n,i)}};var ie=class{generator=y(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 se=class{generator=y(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=y(z);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 ce=class{generator=y(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 le=class extends I{constructor(){super(X)}};var pe=class extends I{constructor(){super(J)}};var me=class extends I{constructor(){super(Q)}};function lt(t){switch(t){case"claude-code":return new ee;case"antigravity":return new te;case"cursor":return new oe;case"github-copilot":return new re;case"codex":return new ne;case"windsurf":return new ie;case"cline":return new se;case"kilo-code":return new ce;case"roo-code":return new le;case"qwen-code":return new pe;case"factory-droid":return new me;case"gemini":return new ae;default:return new Z}}import{resolve as go}from"path";import fo from"@inquirer/select";import{join as Oe}from"path";import{readFile as ve,writeFile as pt,access as ro,mkdir as no}from"fs/promises";import{constants as io}from"fs";var mt="# Conductor";function gt(t){let e=N.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 L(t){return t.replace(/\/+$/,"")}async function Ne(t){try{return await ro(t,io.F_OK),!0}catch{return!1}}async function so(t,e){let o=[],r=[];if(!await Ne(t))return{existing:[],missing:[...e]};let i=(await ve(t,"utf-8")).split(`
|
|
35
|
-
`).map(s=>L(s.trim()));for(let s of e){let l=L(s);i.includes(l)?o.push(s):r.push(s)}return{existing:o,missing:r}}async function ft(t,e){let{existing:o,missing:r}=await so(t,e);if(r.length===0)return{added:[],skipped:o};let n="";await Ne(t)&&(n=await ve(t,"utf-8")),n.length>0&&!n.endsWith(`
|
|
36
|
-
`)&&(n+=`
|
|
37
|
-
`),n+=`
|
|
38
|
-
${mt}
|
|
39
|
-
`;for(let s of r)n+=`${s}
|
|
40
|
-
`;let i=Oe(t,"..");return await no(i,{recursive:!0}),await pt(t,n,"utf-8"),{added:r,skipped:o}}async function Re(t,e){if(!await Ne(t))return{removed:[]};let r=(await ve(t,"utf-8")).split(`
|
|
41
|
-
`),n=e.map(L),i=[],s=[];for(let f of r){let _=L(f.trim());if(_!==mt){if(n.includes(_)){let A=e.find(G=>L(G)===_);A&&!i.includes(A)&&i.push(A);continue}s.push(f)}}let l=[],p=!1;for(let f of s){let _=f.trim()==="";_&&p||(l.push(f),p=_)}for(;l.length>0&&l[l.length-1].trim()==="";)l.pop();let d=l.length>0?l.join(`
|
|
42
|
-
`)+`
|
|
43
|
-
`:"";return await pt(t,d,"utf-8"),{removed:i}}function ge(t,e){return e==="gitignore"?Oe(t,".gitignore"):Oe(t,".git","info","exclude")}async function dt(t,e,o){let r=gt(o);return r.length===0?{action:"none",entries:[],message:`No git ignore entries found for agent ${o}`}:e==="none"?await co(t,r):await ao(t,e,r)}async function ao(t,e,o){let r=ge(t,e),n=await ft(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 co(t,e){let o=ge(t,"gitignore"),r=ge(t,"exclude"),n=await Re(o,e),i=await Re(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 lo from"@inquirer/select";import ut from"@inquirer/input";var w={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:"},fe={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 po(){return!(process.env.CI==="true"||!process.stdin.isTTY)}function mo(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 yt(){if(!po())return console.log(fe.NON_INTERACTIVE_BUNDLED),{source:"bundled"};switch(await lo({message:w.SELECT_SOURCE_MESSAGE,choices:[{name:w.BUNDLED_LABEL,value:"bundled",description:w.BUNDLED_DESCRIPTION},{name:w.OFFICIAL_LABEL,value:"official",description:w.OFFICIAL_DESCRIPTION},{name:w.CUSTOM_LABEL,value:"custom",description:w.CUSTOM_DESCRIPTION}],default:"bundled"})){case"bundled":return{source:"bundled"};case"official":return{source:"official",repo:v,branch:b};case"custom":{let e=await ut({message:w.CUSTOM_REPO_PROMPT,validate:mo}),o=await ut({message:w.CUSTOM_BRANCH_PROMPT,default:b});return{source:"custom",repo:e.trim(),branch:o.trim()||b}}default:return{source:"bundled"}}}function Ct(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 _t(t){let e=go(process.cwd(),t.path),o=t.force??!1;try{console.log(`Initializing Conductor in: ${e}`);let r;t.agent?(r=t.agent,console.log(`Using provided agent: ${r}`)):(console.log("Step 1: Prompting for agent selection..."),r=await ot(),console.log(`\u2714 Selected agent: ${r}`));let n;t.scope?(n=t.scope,console.log(`Using provided scope: ${n}`)):n=await tt(r),console.log(`\u2714 Selected scope: ${n}`);let i=t.gitIgnore;t.gitIgnore&&n==="global"?(console.warn("\u26A0 --git-ignore flag is only supported for project scope. Skipping git ignore configuration."),i=void 0):!t.gitIgnore&&n==="project"&&(i=await rt());let s=t.repo,l=t.branch;if(t.repo)console.log(`Using provided repository: ${t.repo}`),t.branch&&console.log(`Using provided branch: ${t.branch}`);else{let f=await yt(),_=Ct(f);s=_.repo,l=_.branch,f.source==="bundled"?console.log(`\u2714 ${fe.USING_BUNDLED}`):s&&console.log(`\u2714 ${fe.DOWNLOADING_FROM(s,l||"main")}`)}let p=lt(r);console.log(`
|
|
44
|
-
Step 3: Validating project directory...`);let d;try{d=await p.validate(e,n)}catch(f){if(f instanceof Error&&f.message.includes("already installed"))if(o)console.log("\u26A0 Force mode: Overwriting existing installation"),d=e;else if(await fo({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..."),d=e;else{console.log("Installation cancelled.");return}else throw f}if(console.log(`\u2714 Validation complete: ${d}`),console.log(`
|
|
46
|
-
Step 4: Generating files...`),await p.generate(d,n,s,l,o),console.log("\u2714 Files generated"),i){console.log(`
|
|
47
|
-
Step 5: Configuring git ignore...`);let f=await dt(d,i,r);console.log(`\u2714 ${f.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 No from"gradient-string";var ht=(t=0)=>e=>`\x1B[${e+t}m`,xt=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,At=(t=0)=>(e,o,r)=>`\x1B[${38+t};2;${e};${o};${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]}},hc=Object.keys(m.modifier),uo=Object.keys(m.color),yo=Object.keys(m.bgColor),xc=[...uo,...yo];function Co(){let t=new Map;for(let[e,o]of Object.entries(m)){for(let[r,n]of Object.entries(o))m[r]={open:`\x1B[${n[0]}m`,close:`\x1B[${n[1]}m`},o[r]=m[r],t.set(n[0],n[1]);Object.defineProperty(m,e,{value:o,enumerable:!1})}return Object.defineProperty(m,"codes",{value:t,enumerable:!1}),m.color.close="\x1B[39m",m.bgColor.close="\x1B[49m",m.color.ansi=ht(),m.color.ansi256=xt(),m.color.ansi16m=At(),m.bgColor.ansi=ht(10),m.bgColor.ansi256=xt(10),m.bgColor.ansi16m=At(10),Object.defineProperties(m,{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=>m.rgbToAnsi256(...m.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)=>m.ansi256ToAnsi(m.rgbToAnsi256(e,o,r)),enumerable:!1},hexToAnsi:{value:e=>m.ansi256ToAnsi(m.hexToAnsi256(e)),enumerable:!1}}),m}var _o=Co(),T=_o;import De from"process";import ho from"os";import St from"tty";function x(t,e=globalThis.Deno?globalThis.Deno.args:De.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:g}=De,de;x("no-color")||x("no-colors")||x("color=false")||x("color=never")?de=0:(x("color")||x("colors")||x("color=true")||x("color=always"))&&(de=1);function xo(){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 Ao(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function So(t,{streamIsTTY:e,sniffFlags:o=!0}={}){let r=xo();r!==void 0&&(de=r);let n=o?de:r;if(n===0)return 0;if(o){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(t&&!e&&n===void 0)return 0;let i=n||0;if(g.TERM==="dumb")return i;if(De.platform==="win32"){let s=ho.release().split(".");return Number(s[0])>=10&&Number(s[2])>=10586?Number(s[2])>=14931?3:2:1}if("CI"in g)return["GITHUB_ACTIONS","GITEA_ACTIONS","CIRCLECI"].some(s=>s in g)?3:["TRAVIS","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some(s=>s in g)||g.CI_NAME==="codeship"?1:i;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 s=Number.parseInt((g.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(g.TERM_PROGRAM){case"iTerm.app":return s>=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:i}function Tt(t,e={}){let o=So(t,{streamIsTTY:t&&t.isTTY,...e});return Ao(o)}var To={stdout:Tt({isTTY:St.isatty(1)}),stderr:Tt({isTTY:St.isatty(2)})},It=To;function wt(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
|
|
50
|
-
`:`
|
|
51
|
-
`)+o,n=r+1,r=t.indexOf(`
|
|
52
|
-
`,n)}while(r!==-1);return i+=t.slice(n),i}var{stdout:Et,stderr:Ot}=It,Ge=Symbol("GENERATOR"),R=Symbol("STYLER"),j=Symbol("IS_EMPTY"),vt=["ansi","ansi","ansi256","ansi16m"],D=Object.create(null),Io=(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=Et?Et.level:0;t.level=e.level===void 0?o:e.level};var wo=t=>{let e=(...o)=>o.join(" ");return Io(e,t),Object.setPrototypeOf(e,U.prototype),e};function U(t){return wo(t)}Object.setPrototypeOf(U.prototype,Function.prototype);for(let[t,e]of Object.entries(T))D[t]={get(){let o=ue(this,$e(e.open,e.close,this[R]),this[j]);return Object.defineProperty(this,t,{value:o}),o}};D.visible={get(){let t=ue(this,this[R],!0);return Object.defineProperty(this,"visible",{value:t}),t}};var Fe=(t,e,o,...r)=>t==="rgb"?e==="ansi16m"?T[o].ansi16m(...r):e==="ansi256"?T[o].ansi256(T.rgbToAnsi256(...r)):T[o].ansi(T.rgbToAnsi(...r)):t==="hex"?Fe("rgb",e,o,...T.hexToRgb(...r)):T[o][t](...r),bo=["rgb","hex","ansi256"];for(let t of bo){D[t]={get(){let{level:o}=this;return function(...r){let n=$e(Fe(t,vt[o],"color",...r),T.color.close,this[R]);return ue(this,n,this[j])}}};let e="bg"+t[0].toUpperCase()+t.slice(1);D[e]={get(){let{level:o}=this;return function(...r){let n=$e(Fe(t,vt[o],"bgColor",...r),T.bgColor.close,this[R]);return ue(this,n,this[j])}}}}var Eo=Object.defineProperties(()=>{},{...D,level:{enumerable:!0,get(){return this[Ge].level},set(t){this[Ge].level=t}}}),$e=(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}},ue=(t,e,o)=>{let r=(...n)=>Oo(r,n.length===1?""+n[0]:n.join(" "));return Object.setPrototypeOf(r,Eo),r[Ge]=t,r[R]=e,r[j]=o,r},Oo=(t,e)=>{if(t.level<=0||!e)return t[j]?"":e;let o=t[R];if(o===void 0)return e;let{openAll:r,closeAll:n}=o;if(e.includes("\x1B"))for(;o!==void 0;)e=wt(e,o.close,o.open),o=o.parent;let i=e.indexOf(`
|
|
53
|
-
`);return i!==-1&&(e=bt(e,n,r,i)),r+e+n};Object.defineProperties(U.prototype,D);var vo=U(),Gc=U({level:Ot?Ot.level:0});var Nt=vo;import Rt from"fs";import Pe from"path";import{fileURLToPath as Ro}from"url";var Do=`
|
|
54
|
-
__________ _ ______ __ __________________ ____ ________ ____ _ __
|
|
55
|
-
/ ____/ __ \\/ | / / __ \\/ / / / ____/_ __/ __ \\/ __ \\ / ____/ / / __ \\| | / /
|
|
56
|
-
/ / / / / / |/ / / / / / / / / / / / / / / /_/ / / /_ / / / / / /| | /| / /
|
|
57
|
-
/ /___/ /_/ / /| / /_/ / /_/ / /___ / / / /_/ / _, _/ / __/ / /___/ /_/ / | |/ |/ /
|
|
58
|
-
\\____/\\____/_/ |_/_____/\\____/\\____/ /_/ \\____/_/ |_| /_/ /_____/\\____/ |__/|__/
|
|
59
|
-
|
|
60
|
-
`;function Dt(){let t=Pe.dirname(Ro(import.meta.url)),e=Pe.join(t,"../package.json");Rt.existsSync(e)||(e=Pe.join(t,"../../package.json"));let r=JSON.parse(Rt.readFileSync(e,"utf-8")).version;console.log(Nt.dim(` v${r} | Scaffolding for Gemini Conductor
|
|
61
|
-
`))}function Gt(){console.log(No("cyan","green")(Do))}async function $o(t){return await Go(Fo(process.argv)).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:N.map(e=>e.agentType)}).option("repo",{alias:"r",describe:"Git repository URL for templates. Without this flag, interactive template source selection is shown.",type:"string"}).coerce("repo",e=>e===""?v:e).option("branch",{alias:"b",describe:"Branch name for template repository",type:"string",default:b}).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 (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").help().alias("h","help").version().alias("v","version").completion("completion",!1).parseAsync()}async function Kc(t){!process.env.CONDUCTOR_NO_BANNER&&!process.argv.includes("completion")&&!process.argv.includes("--get-yargs-completions")&&(Gt(),Dt());let e=await $o(t),o=e._[0];process.argv.includes("completion")||process.argv.includes("--get-yargs-completions")||await _t({...e,path:o||e.path||".",gitIgnore:e["git-ignore"],$0:"conductor-init",_:e._})}export{Kc as a};
|