@wular/coder 0.1.10 → 0.1.12

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.
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "coder",
2
+ "name": "coder-plugins",
3
3
  "interface": {
4
4
  "displayName": "Coder"
5
5
  },
@@ -1,5 +1,5 @@
1
1
  {
2
- "name": "coder",
2
+ "name": "coder-plugins",
3
3
  "owner": {
4
4
  "name": "muzam1l"
5
5
  },
package/README.md CHANGED
@@ -25,7 +25,7 @@ Plugs into Claude Code or Codex to enable the harness with Coder instances.
25
25
  ```
26
26
  /plugin marketplace add muzam1l/coder
27
27
 
28
- /plugin install coder@coder
28
+ /plugin install coder@coder-plugins
29
29
 
30
30
  /reload-plugins
31
31
 
@@ -53,7 +53,7 @@ The work happens in the engine, and your session gets the result. Codex is the p
53
53
 
54
54
  ```
55
55
  codex plugin marketplace add muzam1l/coder
56
- codex plugin add coder@coder
56
+ codex plugin add coder@coder-plugins
57
57
  ```
58
58
 
59
59
  Or from the npm directly:
package/dist/cli.js CHANGED
@@ -96,7 +96,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
96
96
  `)}async function Qb(r){let{options:i,positionals:v}=nr(r,{valueOptions:["cwd","model","effort","permissions"],booleanOptions:["background","wait"]}),u=i.cwd?x.resolve(i.cwd):W.cwd(),[n,...$]=v,t=$.join(" ").trim();if(!n||!t)M('Usage: coder steer <job-id> "<follow-up instructions>" [--wait]');let g=Kn(u,n);if(!g.threadId)M(`Job ${g.id} has no thread to steer yet (status: ${g.status}).`);if(g.status==="running")M(`Job ${g.id} is still running. Stop it first (coder stop ${g.id}) or wait, then steer.`);let I=[t,"--resume",g.id,"--cwd",u,...g.agent?["--agent",g.agent]:[],...g.host&&g.host!=="claude"?["--host",g.host]:[],...i.model?["--model",i.model]:["--model",g.model].filter(()=>g.model),...i.effort?["--effort",i.effort]:g.effort?["--effort",g.effort]:[],...i.permissions?["--permissions",i.permissions]:g.permissions?["--permissions",g.permissions]:[],...i.wait?["--wait"]:[]];await Y6(I)}async function Hb(r){let{options:i,positionals:v}=nr(r,{valueOptions:["cwd"]}),u=i.cwd?x.resolve(i.cwd):W.cwd(),n=Kn(u,v[0]),$=n.agent==="claude"?{detail:"claude worker terminated"}:await s6(u,{threadId:n.threadId,turnId:n.turnId});if(n.pid&&n.status==="running")try{W.kill(n.pid,"SIGTERM")}catch{}ur(u,n.id,{status:"cancelled",completedAt:new Date().toISOString()}),f({jobId:n.id,status:"cancelled",interrupt:$.detail})}async function Ab(r){let{options:i}=nr(r,{valueOptions:["cwd"]}),v=i.cwd?x.resolve(i.cwd):W.cwd();f(g$(v).map((u)=>({jobId:u.id,status:u.status,agent:u.agent,threadId:u.threadId??null,prompt:String(u.prompt??"").slice(0,80),updatedAt:u.updatedAt})))}async function Eb(r){let{options:i,positionals:v}=nr(r,{valueOptions:["cwd"]}),u=i.cwd?x.resolve(i.cwd):W.cwd(),n=Kn(u,v[0]);f(V6(ir(u,n.id)).map(($)=>({id:$.id,summary:$.summary,createdAt:$.createdAt,answered:$.response?.decision??null})))}async function Bb(r){let{options:i,positionals:v}=nr(r,{valueOptions:["cwd"],booleanOptions:["deny"]}),u=i.cwd?x.resolve(i.cwd):W.cwd(),[n,$]=v;if(!n||!$)M("Usage: coder approve <job-id> <approval-id> [--deny]");let t=Kn(u,n);kU(ir(u,t.id),$,i.deny?"decline":"accept"),f({jobId:t.id,approvalId:$,decision:i.deny?"decline":"accept"})}async function Mb(r){let{options:i,positionals:v}=nr(r,{valueOptions:["cwd"],booleanOptions:["workspace"]}),u=i.cwd?x.resolve(i.cwd):W.cwd(),[n="list",$,...t]=v,g=i.workspace?x.join(fr(u),"coder.config.json"):zi(),I=(N,S)=>S.split(".").reduce((G,F)=>G==null?void 0:G[F],N);if(n==="list"){f(mr(u));return}if(n==="get"){if(!$)M("Usage: coder config get <key> (e.g. chain, agents.codex.model)");let N=I(mr(u),$);f(N===void 0?null:N);return}if(n!=="set"&&n!=="unset")M("Usage: coder config [get|set|unset] <key> [value] [--workspace]");if(!$||n==="set"&&t.length===0)M(`Usage: coder config ${n} <key>${n==="set"?" <value>":""}`);let o=t.join(" "),l;try{l=JSON.parse(o)}catch{l=o.includes(",")?o.split(",").map((N)=>N.trim()).filter(Boolean):o}let _=C.existsSync(g)?JSON.parse(C.readFileSync(g,"utf8")):{},b=$.split("."),k=_;for(let N of b.slice(0,-1)){if(typeof k[N]!=="object"||k[N]===null)k[N]={};k=k[N]}if(n==="set")k[b.at(-1)]=l;else delete k[b.at(-1)];let P=L6(_);if(P.length)M(`Refusing to write invalid config:
97
97
  ${P.join(`
98
98
  `)}`);C.mkdirSync(x.dirname(g),{recursive:!0}),C.writeFileSync(g,`${JSON.stringify(_,null,2)}
99
- `,"utf8"),f({file:g,key:$,...n==="set"?{value:l}:{unset:!0},effective:I(mr(u),$)??null})}function LU(){return t$(new URL("..",import.meta.url))}function GU(r){Yr("codex",["plugin","remove","coder@coder"],{encoding:"utf8"}),Yr("codex",["plugin","marketplace","remove","coder"],{encoding:"utf8"});let i=Yr("codex",["plugin","marketplace","add","."],{cwd:r,encoding:"utf8"}),v=Yr("codex",["plugin","add","coder@coder"],{encoding:"utf8"}),u=i.status===0&&v.status===0;return{marketplace:r,installed:u,note:u?"Plugin installed; restart any running codex session to load it.":`Automatic install failed (${(v.stderr||i.stderr||"codex not found").trim()}); run: codex plugin marketplace add "${r}" && codex plugin add coder@coder`}}function VU(r){Yr("claude",["plugin","marketplace","remove","coder"],{encoding:"utf8"});let i=Yr("claude",["plugin","marketplace","add",r],{encoding:"utf8"}),v=Yr("claude",["plugin","install","coder@coder"],{encoding:"utf8"}),u=i.status===0&&v.status===0;return{marketplace:r,installed:u,note:u?"Plugin installed; restart any running Claude Code session to load it.":`Automatic install failed (${(v.stderr||i.stderr||"claude not found").trim()}); run: claude plugin marketplace add "${r}" && claude plugin install coder@coder`}}async function Tb(r){let{options:i}=nr(r,{valueOptions:["cwd"],booleanOptions:["codex","claude","json"]}),v=i.cwd?x.resolve(i.cwd):W.cwd(),u=dr(v),n=u.available?await a6(v):{loggedIn:!1,detail:u.detail},$=u$(),t=zi();if(!C.existsSync(t)){let E=u.available?["codex","claude"]:$.available?["claude","codex"]:["codex","claude"];lU({...O6,chain:E})}let g=LU(),I=i.codex?GU(g):null,o=i.claude?VU(g):null,l=mr(v),_=u.available&&n.loggedIn;if(i.json){f({codex:{available:u.available,detail:u.detail,auth:n.detail,loggedIn:n.loggedIn},claude:{available:$.available,detail:$.detail},configFile:t,runtime:t$(new URL("../bin/coder.mjs",import.meta.url)),...I?{codexPlugin:I}:{},...o?{claudePlugin:o}:{},config:l,ready:_});return}let b=W.stdout.isTTY&&!W.env.NO_COLOR,k=(E,T)=>b?`\x1B[${E}m${T}\x1B[0m`:T,P=(E)=>` ${k("32","✔")} ${E}`,N=(E)=>` ${k("31","✘")} ${E}`,S=(E)=>k("1",E),G=(E)=>k("38;5;245",E),F=[S("Coder setup"),""],q=u.available?n.loggedIn?P(`codex ${G(`${u.detail}; ${n.detail}`)}`):N(`codex not logged in ${G(`(${n.detail})`)} - run: codex login`):N("codex not installed - run: npm install -g @openai/codex"),j=$.available?P(`claude ${G($.detail)}`):N("claude not installed - run: npm install -g @anthropic-ai/claude-code");F.push(S("Available Engines"),q,j,"");let K=(E)=>{let T=l.agents?.[E]??{};return[T.model,T.effort,T.permissions].filter(Boolean).join("/")};F.push(S("Config"),` chain: ${(l.chain??[]).join(" -> ")} codex: ${K("codex")} claude: ${K("claude")}`,` ${G(t)} ${G("(coder config set <key> <value> to change)")}`,"");let Nr=[["codex plugin ",I],["claude plugin",o]];for(let[E,T]of Nr)if(T)F.push(T.installed?P(`${E} ${G(T.note)}`):N(`${E} ${T.note}`),"");F.push(_?P(`ready - try: coder task --wait "explain this repo's layout"`):N("not ready - fix the engine issues above (tasks fall back to the claude engine meanwhile)")),W.stdout.write(`${F.join(`
99
+ `,"utf8"),f({file:g,key:$,...n==="set"?{value:l}:{unset:!0},effective:I(mr(u),$)??null})}function LU(){return t$(new URL("..",import.meta.url))}function GU(r){Yr("codex",["plugin","remove","coder@coder-plugins"],{encoding:"utf8"}),Yr("codex",["plugin","marketplace","remove","coder-plugins"],{encoding:"utf8"});let i=Yr("codex",["plugin","marketplace","add","."],{cwd:r,encoding:"utf8"}),v=Yr("codex",["plugin","add","coder@coder-plugins"],{encoding:"utf8"}),u=i.status===0&&v.status===0;return{marketplace:r,installed:u,note:u?"Plugin installed; restart any running codex session to load it.":`Automatic install failed (${(v.stderr||i.stderr||"codex not found").trim()}); run: codex plugin marketplace add "${r}" && codex plugin add coder@coder-plugins`}}function VU(r){Yr("claude",["plugin","marketplace","remove","coder-plugins"],{encoding:"utf8"});let i=Yr("claude",["plugin","marketplace","add",r],{encoding:"utf8"}),v=Yr("claude",["plugin","install","coder@coder-plugins"],{encoding:"utf8"}),u=i.status===0&&v.status===0;return{marketplace:r,installed:u,note:u?"Plugin installed; restart any running Claude Code session to load it.":`Automatic install failed (${(v.stderr||i.stderr||"claude not found").trim()}); run: claude plugin marketplace add "${r}" && claude plugin install coder@coder-plugins`}}async function Tb(r){let{options:i}=nr(r,{valueOptions:["cwd"],booleanOptions:["codex","claude","json"]}),v=i.cwd?x.resolve(i.cwd):W.cwd(),u=dr(v),n=u.available?await a6(v):{loggedIn:!1,detail:u.detail},$=u$(),t=zi();if(!C.existsSync(t)){let E=u.available?["codex","claude"]:$.available?["claude","codex"]:["codex","claude"];lU({...O6,chain:E})}let g=LU(),I=i.codex?GU(g):null,o=i.claude?VU(g):null,l=mr(v),_=u.available&&n.loggedIn;if(i.json){f({codex:{available:u.available,detail:u.detail,auth:n.detail,loggedIn:n.loggedIn},claude:{available:$.available,detail:$.detail},configFile:t,runtime:t$(new URL("../bin/coder.mjs",import.meta.url)),...I?{codexPlugin:I}:{},...o?{claudePlugin:o}:{},config:l,ready:_});return}let b=W.stdout.isTTY&&!W.env.NO_COLOR,k=(E,T)=>b?`\x1B[${E}m${T}\x1B[0m`:T,P=(E)=>` ${k("32","✔")} ${E}`,N=(E)=>` ${k("31","✘")} ${E}`,S=(E)=>k("1",E),G=(E)=>k("38;5;245",E),F=[S("Coder setup"),""],q=u.available?n.loggedIn?P(`codex ${G(`${u.detail}; ${n.detail}`)}`):N(`codex not logged in ${G(`(${n.detail})`)} - run: codex login`):N("codex not installed - run: npm install -g @openai/codex"),j=$.available?P(`claude ${G($.detail)}`):N("claude not installed - run: npm install -g @anthropic-ai/claude-code");F.push(S("Available Engines"),q,j,"");let K=(E)=>{let T=l.agents?.[E]??{};return[T.model,T.effort,T.permissions].filter(Boolean).join("/")};F.push(S("Config"),` chain: ${(l.chain??[]).join(" -> ")} codex: ${K("codex")} claude: ${K("claude")}`,` ${G(t)} ${G("(coder config set <key> <value> to change)")}`,"");let Nr=[["codex plugin ",I],["claude plugin",o]];for(let[E,T]of Nr)if(T)F.push(T.installed?P(`${E} ${G(T.note)}`):N(`${E} ${T.note}`),"");F.push(_?P(`ready - try: coder task --wait "explain this repo's layout"`):N("not ready - fix the engine issues above (tasks fall back to the claude engine meanwhile)")),W.stdout.write(`${F.join(`
100
100
  `)}
101
101
  `)}async function JU(r){let{options:i}=nr(r,{valueOptions:["pm"],booleanOptions:["cli-only","plugins-only","codex","claude"]}),v=!i["plugins-only"],u=!i["cli-only"],n=W.stdout.isTTY&&!W.env.NO_COLOR,$=(N,S)=>n?`\x1B[${N}m${S}\x1B[0m`:S,t=(N)=>$("1",N),g=(N)=>$("38;5;245",N),I=(N)=>` ${$("32","✔")} ${N}`,o=(N)=>` ${$("31","✘")} ${N}`,l=(N,S)=>S&&N&&S!==N?`${N} ${g("->")} ${t(S)}`:`${S??N??"?"} ${g("(unchanged)")}`,_=LU(),b=x.join(_,"plugins/codex/.codex-plugin/plugin.json"),k=x.join(_,"plugins/claude/.claude-plugin/plugin.json"),P={cli:Si(),codex:q6(b),claude:q6(k)};if(v){let N=OU(K6),[S,...G]=i.pm==="npm"?["npm","install","-g","@wular/coder@latest"]:i.pm==="pnpm"?["pnpm","add","-g","@wular/coder@latest"]:i.pm==="yarn"?["yarn","global","add","@wular/coder@latest"]:i.pm==="bun"?["bun","add","-g","@wular/coder@latest"]:N.command,F=i.pm??N.pm;W.stdout.write(`${t("Updating coder CLI")} ${g(`via ${F}...`)}
102
102
  `);let q=Yr(S,G,{encoding:"utf8"});if(q.error?.code==="ENOENT")M(`${F} not found on PATH. Re-run with --pm <npm|pnpm|yarn|bun>, or update manually: ${S} ${G.join(" ")}`);if(q.status!==0){let K=(q.stderr||q.stdout||"").trim();M(`CLI update failed (${F}).${K?`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wular/coder",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Delegating coding-agent runtime",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "description": "Delegate coding tasks to a Coder subagent. Codex first, Claude fallback; your main context stays clean.",
5
5
  "author": {
6
6
  "name": "muzam1l"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: handle
3
- description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, questions about the code. You are the orchestrator - never implement tasks yourself; dispatch them through the `coder` CLI exactly as this skill instructs, never via your own subagents. Give it one focused, self-contained goal with all context - overview, file paths, constraints e.g. read-only, git rules.
3
+ description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
4
  ---
5
5
 
6
6
  # Coder dispatch
@@ -11,6 +11,7 @@ If `coder` is not on PATH, install it yourself without asking (`npm install -g @
11
11
 
12
12
  ## Dispatching a task
13
13
 
14
+ - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own background `coder task` - fan out a wide web of coders running in parallel, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules). Run independent tasks concurrently; use `steer` to continue a single coder's thread.
14
15
  - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks.
15
16
  - Compose one self-contained task text (goal, relevant paths, constraints) and run it as a **background Bash call** so you are notified on completion instead of blocking or polling:
16
17
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coder",
3
- "version": "0.1.10",
3
+ "version": "0.1.12",
4
4
  "interface": {
5
5
  "displayName": "Coder (plugin)"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: handle
3
- description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, questions about the code. You are the orchestrator - never implement tasks yourself; dispatch them through the `coder` CLI exactly as this skill instructs, never via your own subagents. Give it one focused, self-contained goal with all context - overview, file paths, constraints e.g. read-only, git rules.
3
+ description: Use Coder for any coding, implementation, or investigation task - features, fixes, refactors, debugging, tests, code questions. You orchestrate, never implement yourself; dispatch through the `coder` CLI, one coder per focused goal, fanning out many coders in parallel as the work needs.
4
4
  ---
5
5
 
6
6
  # Coder dispatch (codex host)
@@ -12,6 +12,7 @@ If `coder` is not on PATH, install it yourself without asking: `npm install -g @
12
12
  ## Dispatching a task
13
13
 
14
14
  - Run every `coder` command with escalated permissions (outside your sandbox), justification: Coder is a supervisor - it spawns engines, keeps state in `~/.coder`, and enforces its own sandbox and approval policy on the task. Never retry a sandbox-blocked `coder` call sandboxed again or with HOME/state env workarounds.
15
+ - One coder per focused goal. When the work splits into independent parts, decompose it and dispatch each part as its own `coder task --host codex` call - fan out a wide web of coders, not one giant dispatch. Give each coder a self-contained goal with all context - overview, file paths, constraints (read-only, git rules); use `steer` to continue a single coder's thread.
15
16
  - Delegation is a hard gate for anything the engine can do itself: do not read source files, investigate, or write code first - no matter how simple the task. Fold into the task text whatever only you have - conversation context, results from tools the engine lacks.
16
17
  - Compose one self-contained task text (goal, relevant paths, constraints) and run:
17
18