@engineeros/connector 1.59.104 → 1.60.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 +38 -0
- package/bin/context-grep.mjs +6 -6
- package/bin/engineeros-connector.mjs +542 -519
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -37,6 +37,44 @@ Restart an already paired workspace with:
|
|
|
37
37
|
engineeros-connector start --workspace .
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
+
## Enable multiple agent runtimes
|
|
41
|
+
|
|
42
|
+
The paired agent remains the primary runtime, named `default`. Enable additional local runtimes for Auto routing or explicit runtime/model choices:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
engineeros-connector agent claude-acp install
|
|
46
|
+
engineeros-connector runtime add claude --agent claude-acp --workspace .
|
|
47
|
+
engineeros-connector runtime add codex-native --agent-protocol codex --workspace .
|
|
48
|
+
engineeros-connector runtime add forge --agent-protocol forge --workspace .
|
|
49
|
+
engineeros-connector runtime list --workspace .
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Use `--agent opencode` or another supported registry ID for additional ACP agents. Install the chosen agent and complete its provider sign-in locally. `runtime list` and `runtime refresh` inspect enabled agents and report their discovered models, reasoning settings and readiness; they do not ask models to complete engineering work. Credentials and executable configuration remain on this machine.
|
|
53
|
+
|
|
54
|
+
Existing organization and environment agent restrictions apply to every runtime using its local registry identity. Native Codex and Forge use their canonical identities. An unregistered ACP adapter cannot satisfy a restricted agent policy; display names do not grant agent access.
|
|
55
|
+
|
|
56
|
+
Restart the connector after configuration changes, or let its next idle refresh advertise them. A missing or signed-out runtime does not hide healthy peers. A pinned unavailable runtime blocks until its prerequisite is restored; it never silently becomes another provider. Remove an additional entry with `engineeros-connector runtime remove claude --workspace .`.
|
|
57
|
+
|
|
58
|
+
Runtime IDs identify stable installations/accounts. Removing an additional runtime retires its ID permanently within this pairing and removes only its native session mappings; choose a fresh ID for another installation/account. Use `runtime refresh` for sign-in recovery. Saved work, evidence, memory and execution budgets remain retained. Idle ACP resources for retired entries are released when the connector next refreshes safely; active work is not cancelled.
|
|
59
|
+
|
|
60
|
+
Goal checkpoints also retain the native session's pairing, protocol and agent owner. Re-pairing the same workspace to a different primary agent cannot reuse its old Goal session, even when the runtime is still named `default`. Changed or unverified historical owners stop with the original work and allowances retained; reconcile the original installation before continuing.
|
|
61
|
+
|
|
62
|
+
Runtime changes take effect at assignment/session boundaries. Native session IDs and warm processes belong to their runtime and role. Different stages can use different runtimes. Approved Goal plans may freeze up to two runtime transitions and explicit alternatives before approval. A completed writing turn can hand work to a fresh native session only after the previous process has stopped, the workspace checkpoint matches, and all observed effects are resolved. A runtime that never started may use an approved fallback. Started failures with uncertain effects block for reconciliation. Switching retains the same work, evidence, deadline, spend, repair and single formatting-correction allowances. Backend support is required; manual pins receive no unapproved alternatives.
|
|
63
|
+
|
|
64
|
+
Forge does not currently provide the qualified tool-effect observations needed for a handoff after a writing turn. Its effects remain unknown, even when its response lists no tools. Restore and reconcile that work before selecting another runtime; discovery and a successful completion alone cannot authorize the handoff.
|
|
65
|
+
|
|
66
|
+
Direct test automation freezes one approved writing profile for implementation, repairs and fresh rewrites, plus a separate triage profile. Its native contract counts all repair, rewrite and cleanup turns against the inherited total allowance. Use a governed Goal or workflow when the task requires independent review, a hard deadline or a hard dollar bound; direct assignments refuse those unsupported requirements.
|
|
67
|
+
|
|
68
|
+
Provider and model-family tags come from discovery when available. Configure missing tags and normalized reasoning levels locally, using exact model IDs and native settings that the runtime actually advertises:
|
|
69
|
+
|
|
70
|
+
```sh
|
|
71
|
+
engineeros-connector runtime configure claude --model-metadata ./model-metadata.json --workspace .
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The JSON object maps each raw model ID to optional `provider_id`, `model_family` and `reasoning_levels`. For example, a model that advertises `xhigh` can explicitly map `"max": {"reasoning_effort": "xhigh"}` under `reasoning_levels`. The connector does not infer this mapping or a model's family. Configured tags are labeled as configured and cannot grant tool, write, cancellation or data permissions. Runtime/model refresh changes discovery only; it does not change provider sign-in. Requested reasoning settings remain separate from provider-reported actual settings; missing observations stay unknown.
|
|
75
|
+
|
|
76
|
+
Read-only parallel workflow proposals use the existing workflow engine with separate native sessions and detached worktrees at the frozen source head. New-project proposals use separate empty workspaces. They return proposals through the workflow artifact owner and do not write implementation changes or copy ignored credentials. Required independent review receives bounded complete changed-source files, the diff and Proofs; retained file hashes and the actual reviewer usage/session bind its receipt to the final head. Missing or oversized safe source context blocks review rather than claiming inspection.
|
|
77
|
+
|
|
40
78
|
## Goal execution and recovery
|
|
41
79
|
|
|
42
80
|
Goal execution uses contract 4 and needs the matching EngineerOS backend. The server retains repair reservations across restarts and Resume, including planning, ticket and repository-quality repairs. Restoring a fresh worktree cannot reset those allowances; keep the original checkpoint and completed work.
|
package/bin/context-grep.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import ae from"node:path";import ce from"node:v8";import{Worker as le,isMainThread as ue,parentPort as L,workerData as v}from"node:worker_threads";import{constants as W}from"node:fs";import{lstat as Y,open as K,realpath as j}from"node:fs/promises";import h from"node:path";var R=10*1024*1024,N=(s,e)=>{let t=h.relative(s,e);return t&&!t.startsWith(`..${h.sep}`)&&t!==".."&&!h.isAbsolute(t)};async function M(s,e,{maxBytes:t=R}={}){let n=()=>Object.assign(new Error("Use a regular file inside the workspace without symlinks or redirected directories."),{code:"WORKSPACE_READ_UNSAFE"}),r=()=>Object.assign(new Error(`Workspace file exceeds the ${t} byte read limit. Provide a smaller file before retrying.`),{code:"WORKSPACE_READ_LIMIT"}),o=String(e||"").replaceAll("\\","/");if(!o||h.isAbsolute(o)||h.win32.isAbsolute(o))throw n();let p=await j(s),f=h.resolve(p,o);if(!N(p,f))throw n();let d=p,i;for(let c of h.relative(p,f).split(h.sep))if(d=h.join(d,c),i=await Y(d),i.isSymbolicLink())throw n();if(!i.isFile())throw n();if(i.size>t)throw r();if(!N(p,await j(f)))throw n();let m=await K(f,W.O_RDONLY|(W.O_NOFOLLOW||0));try{let c=await m.stat();if(!c.isFile()||c.ino!==i.ino||c.dev!==i.dev||!N(p,await j(f)))throw n();if(c.size>t)throw r();let b=Buffer.alloc(Math.min(t+1,64*1024)),x=[],g=0;for(;g<=t;){let{bytesRead:a}=await m.read(b,0,Math.min(b.length,t+1-g),null);if(!a)break;if(g+=a,g>t)throw r();x.push(Buffer.from(b.subarray(0,a)))}return Buffer.concat(x,g)}finally{await m.close()}}import{execFile as q}from"node:child_process";import{promisify as J}from"node:util";var Ce=J(q);var Ie=Object.freeze({"skills.include_instructions":!1,"skills.bundled.enabled":!1,"features.apps":!1,"features.plugins":!1,include_apps_instructions:!1}),ee=Object.freeze({"read-only":"read-only","workspace-write":"workspace-write"}),Le=Object.freeze({"codex-acp":ee,"claude-acp":Object.freeze({"read-only":"plan","workspace-write":"acceptEdits"}),opencode:Object.freeze({"read-only":"plan","workspace-write":"build"})});var te="engineeros-verifier",ne=Object.freeze({"*":"ask",read:"allow",glob:"allow",grep:"allow",list:"allow",bash:"allow",edit:"deny",task:"deny",external_directory:"deny",patch:"deny",apply_patch:"deny"});var se=Object.freeze({OPENCODE_CONFIG:"",OPENCODE_CONFIG_CONTENT:JSON.stringify({agent:{[te]:{mode:"primary",description:"Independent Goal verification with commands and no direct edits",permission:ne},plan:{permission:{"*":"ask",read:"allow",glob:"allow",grep:"allow",list:"allow",edit:"deny",bash:"deny",task:"deny",external_directory:"deny",patch:"deny",apply_patch:"deny"}}}}),OPENCODE_DISABLE_PROJECT_CONFIG:"true",OPENCODE_DISABLE_CLAUDE_CODE:"true",OPENCODE_DISABLE_EXTERNAL_SKILLS:"true"});var ze=String.raw`import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
4
|
|
|
@@ -215,16 +215,16 @@ export default {
|
|
|
215
215
|
return "Patch applied:\n" + summary.join("\n");
|
|
216
216
|
},
|
|
217
217
|
};
|
|
218
|
-
`;var
|
|
218
|
+
`;var He=10080*60*1e3;var Ke=new URL("../grammars/",import.meta.url);var I=`
|
|
219
219
|
(program (lexical_declaration (variable_declarator name: (identifier) @name) @definition.constant))
|
|
220
220
|
(program (variable_declaration (variable_declarator name: (identifier) @name) @definition.constant))
|
|
221
221
|
(program (export_statement declaration: (lexical_declaration (variable_declarator name: (identifier) @name) @definition.constant)))
|
|
222
222
|
`,B=`
|
|
223
223
|
(type_alias_declaration name: (type_identifier) @name) @definition.type
|
|
224
224
|
(enum_declaration name: (identifier) @name) @definition.enum
|
|
225
|
-
`,
|
|
226
|
-
`,$),Z=k<0?E.length:k,
|
|
225
|
+
`,qe={javascript:I,typescript:I+B,tsx:I+B};var Qe=40*1024*1024;var ot=768*1024;var re=new Set([".js",".jsx",".mjs",".cjs",".ts",".tsx"]),rt=new Set([...re,".py",".go",".java",".kt",".cs",".rb",".rs"]);var it=new RegExp([String.raw`\bassert\w*\b`,String.raw`\bexpect\w*\s*\(`,String.raw`\.should\b`,String.raw`\bpytest\.raises\b`,String.raw`\bself\.assert\w+`,String.raw`\bt\.(?:Error|Errorf|Fatal|Fatalf|Fail|FailNow)\b`,String.raw`\brequire\.\w+\(`,String.raw`\bAssert\.\w+`,String.raw`\bassert_(?:eq|ne)!`,String.raw`\bverify\s*\(`,String.raw`\bto(?:Have|Be|Equal|Contain|Match|Throw)\w*\s*\(`].join("|"),"g");var jt=512*1024,Nt=1024*1024;var Rt=10080*60*1e3,Mt=720*60*60*1e3;var It=new Set("a an and are as at be been being but by can could did do does done for from had has have how into is it its may might must need needs no not of on or our our should so than that the their them then there these they this those to too use used using very was were what when where which while who why will with would you your about after all also any before between both during each every here how just make made more most need next now once only other over same should some such take then through under until up upon via want wants well when work works".split(/\s+/));var Lt=256*1024;function _(s){return String(s||"").replace(/[\u0000-\u001f\u007f]/g,e=>`\\u${e.codePointAt(0).toString(16).padStart(4,"0")}`).replaceAll("`","'")}var ie={"claude.md":"Claude Code","gemini.md":"Gemini CLI"},Pt=new Set(["agents.md",...Object.keys(ie)]);var pe=50,D=4e3,G=1e3,U=8,P=1e3,fe=5e3,de=2,F=0;async function Xt(s,e,t){let n=String(e.pattern??""),r=String(e.glob??"");if(!n)throw new Error("Pass a non-empty pattern to engineeros_grep.");if(n.length>4096||r.length>1024)throw new Error("Grep pattern or glob is too long. Use a smaller pattern and narrower glob.");if(F>=de)throw new Error("Two workspace searches are already running. Retry after one finishes.");F+=1;let o,p;try{let f=await t();return o=new le(new URL("./context-grep.mjs",import.meta.url),{workerData:{kind:"context-grep",workspace:s,args:e,files:f},execArgv:[],env:{},resourceLimits:{maxOldGenerationSizeMb:128,maxYoungGenerationSizeMb:16,stackSizeMb:4}}),await new Promise((d,i)=>{p=setTimeout(()=>i(new Error("Workspace search exceeded its five-second limit. Narrow the glob or simplify the regular expression.")),fe),o.once("message",m=>m.error?i(new Error(m.error)):d(m.text)),o.once("error",()=>i(new Error("Workspace search worker failed or exceeded its memory limit. Narrow the glob or pattern."))),o.once("exit",()=>i(new Error("Workspace search stopped before returning a result. Narrow the glob or pattern.")))})}finally{clearTimeout(p);try{o&&await o.terminate()}finally{F-=1}}}!ue&&v?.kind==="context-grep"&&(ce.setFlagsFromString("--enable-experimental-regexp-engine-on-excessive-backtracks"),me(v.workspace,v.args,v.files).then(s=>L.postMessage({text:s}),s=>L.postMessage({error:s.message})).finally(()=>L.close()));async function me(s,e,t){let n=String(e.pattern??"");if(!n)throw new Error("Pass a non-empty pattern to engineeros_grep.");let r;try{r=new RegExp(e.regex===!0?n:n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),e.ignore_case===!0?"i":"")}catch(l){throw new Error(`The pattern is not a valid regular expression: ${l.message}`)}let o=String(e.glob||"").trim(),p=o?ge(o):()=>!0,f=t.filter(p),d=[],i=0,m=0,c=0;e:for(let l=0;l<f.length;l+=U){let S=f.slice(l,l+U),C=await Promise.all(S.map(async w=>{try{return await M(s,w)}catch(y){return y.code==="WORKSPACE_READ_LIMIT"?{tooLarge:!0}:null}}));for(let w=0;w<S.length;w+=1){m+=1;let y=C[w];if(y?.tooLarge){i+=1;continue}if(!y||y.subarray(0,8192).includes(0))continue;let E=y.toString("utf8"),O=[];for(let $=0,z=1;$<=E.length;z+=1){let k=E.indexOf(`
|
|
226
|
+
`,$),Z=k<0?E.length:k,T=E.slice($,Z).replace(/\r$/,"");if(r.test(T)&&(O.push({line:z,text:he(T,r),shortened:T.trimEnd().length>D}),c+=1),c===P||k<0)break;$=k+1}if(O.length&&d.push({path:S[w],lines:O}),c===P)break e}}let b=c===P,x=`${o?` in \`${_(o)}\``:""}`,g=`searched ${m.toLocaleString()} file(s)${i?`; ${i} file(s) over ${R/1024/1024} MB were not read`:""}`,a=["# EngineerOS Grep",""];if(o&&!f.length)return a.push(`The glob \`${_(o)}\` matched no file, so nothing was searched. A glob without a slash matches file names; name a directory as \`dir/\` or \`dir/**\`.`),a.join(`
|
|
227
227
|
`);if(!d.length)return a.push(`No file matches \`${_(n)}\`${x} (${g}).`),a.join(`
|
|
228
|
-
`);let H=e.output==="files"||e.output==="lines"?e.output:c<=
|
|
228
|
+
`);let H=e.output==="files"||e.output==="lines"?e.output:c<=pe?"lines":"files";if(a.push(`\`${_(n)}\`${x}: ${c.toLocaleString()} matching line(s) in ${d.length.toLocaleString()} file(s) (${g}).`),b&&a.push("Search reached the 1,000-line limit; counts may be partial. Narrow `glob` or the pattern to continue.",""),H==="files")return a.push('Narrow this with `glob`, or pass `output: "lines"` for the matching lines within the search limit.',"",...d.map(l=>`- \`${_(l.path)}\` (${l.lines.length})`)),a.join(`
|
|
229
229
|
`);let A=0;for(let l of d)a.push("",...l.lines.map(({line:S,text:C,shortened:w})=>(w&&(A+=1),`${l.path}:${S}: ${C}`)));return A&&a.push("",`${A} line(s) over ${D.toLocaleString()} characters (minified or generated code) are shown around their match; read the file for the rest.`),a.join(`
|
|
230
|
-
`)}function
|
|
230
|
+
`)}function he(s,e){let t=s.trimEnd();if(t.length<=D)return t;let n=Math.max(0,t.search(e)-Math.floor(G/3)),r=n+G;return`${n?"\u2026":""}${t.slice(n,r)}${r<t.length?"\u2026":""}`}function ge(s){let e=s.replaceAll("\\","/").replace(/^\.\//,"");e.endsWith("/")&&(e+="**");let t=new RegExp(`^${X(e)}$`),n=!e.includes("/"),r=/[*?{]/.test(e)?null:`${e}/`;return o=>t.test(n?ae.posix.basename(o):o)||r!==null&&o.startsWith(r)}function X(s){let e="";for(let t=0;t<s.length;t+=1){let n=s[t];if(n==="*"&&s[t+1]==="*")t+=1,s[t+1]==="/"?(t+=1,e+="(?:.*/)?"):e+=".*";else if(n==="*")e+="[^/]*";else if(n==="?")e+="[^/]";else if(n==="{"){let r=s.indexOf("}",t);if(r<0){e+="\\{";continue}e+=`(?:${s.slice(t+1,r).split(",").map(X).join("|")})`,t=r}else e+=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}return e}export{P as GREP_MAX_MATCHES,fe as GREP_TIMEOUT_MS,Xt as boundedGrep,ge as globMatcher};
|