ethanplusai/codex-on-crack / plugins/codex-on-crack/skills/crack
crack
UnverifiedLead substantial Codex builds with one configured implementation worker and lead acceptance. Use when the user requests codex-on-crack, names a model to delegate work to, asks to run subagents through Claude, or requests a lead/worker split. Keep host-only work direct; honor explicit external model choices. Workers must not invoke this orchestrator.
viewer/src/tail.mjs
View on GitHubimport fs from 'node:fs/promises';
import {realpathSync} from 'node:fs';
import path from 'node:path';
import {Adapter} from './adapter.mjs';
export class Tail {
constructor(file,index,details,normalized=false){this.normalized=normalized;this.file=file;try{this.file=path.join(realpathSync(path.dirname(file)),path.basename(file));}catch{}this.index=index;this.details=details;this.reset();this.status='Waiting'}
reset(){this.adapter=new Adapter({source:`source-${this.index}`,details:this.details,normalized:this.normalized});this.offset=0;this.pending=Buffer.alloc(0);this.line=0;this.ino=null;this.discard=false}
async poll(){
let handle;
try{
if(await fs.realpath(this.file)!==this.file)throw Error('Source path changed');
handle=await fs.open(this.file,fs.constants.O_RDONLY|fs.constants.O_NOFOLLOW|fs.constants.O_NONBLOCK);const st=await handle.stat();if(!st.isFile())throw Error('Not a file');
if(this.ino!==null&&(st.ino!==this.ino||st.size<this.offset))this.reset();this.ino=st.ino;
let budget=8*1024*1024;
while(this.offset<st.size&&budget>0){const length=Math.min(256*1024,st.size-this.offset,budget);const b=Buffer.alloc(length);const {bytesRead}=await handle.read(b,0,length,this.offset);if(!bytesRead)break;this.offset+=bytesRead;budget-=bytesRead;
const chunk=Buffer.concat([this.pending,b.subarray(0,bytesRead)]);let start=0,end;
while((end=chunk.indexOf(10,start))!==-1){this.line++;const line=chunk.subarray(start,end);if(!this.discard&&line.length){try{this.adapter.ingest(JSON.parse(line.toString('utf8')),this.line)}catch{this.adapter.errors++}}this.discard=false;start=end+1}
this.pending=chunk.subarray(start);if(this.pending.length>8*1024*1024){this.pending=Buffer.alloc(0);this.discard=true;this.adapter.errors++}
}
this.status=this.offset<st.size?'Loading':'Watching';this.checkedAt=new Date().toISOString();
}catch{this.status='Unavailable'}finally{await handle?.close()}
}
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Unverified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |