@cotal-ai/connector-opencode 0.133.7 → 0.133.8
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.
|
Binary file
|
package/dist/plugin/index.js
CHANGED
|
@@ -128,7 +128,7 @@ ${tail}`)}if(history.length){blocks.push(`\u{1F4DA} Cotal \u2014 ${history.lengt
|
|
|
128
128
|
${history.map(format).join("\n")}
|
|
129
129
|
(This is replayed history, not new work. Do not act on or reply to these old requests unless the person explicitly asks.)`)}return blocks.join("\n\n")}function writeReply(sock,reply,awaitHandoff){return new Promise(resolve2=>{let settled=false;const done=ok3=>{if(settled)return;settled=true;resolve2(ok3)};sock.once("error",()=>done(false));sock.once("close",()=>done(false));if(!awaitHandoff){const stall=setTimeout(()=>done(false),LEGACY_WRITE_DEADLINE_MS);stall.unref?.();try{sock.end(JSON.stringify(reply)+"\n",(err3=>{clearTimeout(stall);done(!err3)}))}catch{clearTimeout(stall);done(false)}return}const deadline=setTimeout(()=>{sock.destroy();done(false)},HANDOFF_DEADLINE_MS);deadline.unref?.();let receipt="";sock.on("data",d=>{receipt+=d;if(!receipt.includes("\n"))return;clearTimeout(deadline);try{sock.end()}catch{}done(true)});try{sock.write(JSON.stringify(reply)+"\n",err3=>{if(!err3)return;clearTimeout(deadline);done(false)})}catch{clearTimeout(deadline);done(false)}})}function startControlServer(agent,endpoint,handle,opts={}){const{path}=endpoint;const digest=createHash9("sha256").update(endpoint.token).digest();const server=createServer(sock=>{let buf="";let handled=false;sock.setEncoding("utf8");const deadline=setTimeout(()=>sock.destroy(),AUTH_DEADLINE_MS);deadline.unref?.();sock.on("close",()=>clearTimeout(deadline));sock.on("data",async d=>{if(handled)return;buf+=d;if(buf.length>MAX_FRAME_BYTES){sock.destroy();return}const nl=buf.indexOf("\n");if(nl<0)return;handled=true;clearTimeout(deadline);let frame={};try{frame=JSON.parse(buf.slice(0,nl)||"{}")}catch{}if(!tokenMatches(frame.token,digest)){sock.destroy();return}const op=frame.op;if(op==="shutdown"){try{sock.end(JSON.stringify({ok:true})+"\n")}catch{}opts.onShutdown?.();return}if(op==="session"){const sessionId=opts.onSession?.();try{sock.end(JSON.stringify(sessionId?{ok:true,sessionId}:{ok:false,error:"session not ready"})+"\n")}catch{}return}const ev=frame.event??{};const awaitHandoff=frame.handoff===true;const reply=await handle(agent,ev);const delivered=await writeReply(sock,reply,awaitHandoff);opts.onReply?.(ev,delivered)});sock.on("error",()=>{})});let bound=false;let retried=false;const emit=server.emit.bind(server);server.emit=(event,...args)=>{const error51=args[0];if(event!=="error"||bound||retried||process.platform==="win32"||path.startsWith("\0")||error51?.code!=="EADDRINUSE")return emit(event,...args);retried=true;let original;try{original=lstatSync4(path);if(!original.isSocket())return emit(event,...args)}catch(e){if(e.code!=="ENOENT")return emit(event,...args)}const probe=connect2(path);let settled=false;const finish=stale=>{if(settled)return;settled=true;clearTimeout(deadline);probe.destroy();server.off("close",cancel);if(!stale){emit(event,...args);return}try{const current=lstatSync4(path);if(!original||!current.isSocket()||current.dev!==original.dev||current.ino!==original.ino){emit(event,...args);return}unlinkSync3(path)}catch(e){if(e.code!=="ENOENT"){emit("error",e);return}}server.listen(path)};const cancel=()=>{settled=true;clearTimeout(deadline);probe.destroy()};const deadline=setTimeout(()=>finish(false),250);server.once("close",cancel);probe.once("connect",()=>finish(false));probe.once("error",e=>finish(e.code==="ECONNREFUSED"||e.code==="ENOENT"));return true};server.on("error",e=>{process.stderr.write(`[cotal-connector] control server error: ${e.message}
|
|
130
130
|
`);if(opts.fatalBind&&!bound)process.exit(1)});server.listen(path,()=>{bound=true;process.stderr.write(`[cotal-connector] control socket: ${path}
|
|
131
|
-
`)});return server}var ok=text2=>({text:text2});var err=text2=>({text:text2,isError:true});async function submitFeedback(input,options={}){const url2=options.url??(options.key?FEEDBACK_URL:PUBLIC_FEEDBACK_URL);const headers3={"content-type":"application/json"};const body={...input};if(options.key){headers3.authorization=`Bearer ${options.key}`}else{if(!options.email)return err("Keyless feedback goes to the public cotal.ai intake, which requires a traceable contact email \u2014 ask the user for one and retry with the email argument (or set COTAL_FEEDBACK_EMAIL).");body.email=options.email}try{const res=await fetch(url2,{method:"POST",headers:headers3,body:JSON.stringify(body)});const raw=await res.text();let reply={};if(raw)try{reply=JSON.parse(raw)}catch{reply={error:raw}}if(!res.ok)return err(`Feedback rejected (${res.status}${reply.error?`: ${reply.error}`:""}).`);const note=reply.published===false?" (stored, but the internal feedback channel publish failed)":"";return ok(`Feedback sent${reply.id?` (id ${reply.id})`:""}${note}. Thanks!`)}catch(e){return err(`Couldn't reach the feedback intake at ${url2}: ${e.message}`)}}import{execFileSync as execFileSync2}from"node:child_process";init_external();init_external();import{createHash as createHash10}from"node:crypto";import{readFileSync as readFileSync5}from"node:fs";import{join as join7}from"node:path";import{gunzipSync}from"node:zlib";var DOCS_VERSION="0.133.7";function loadDocsMetadata(){return{"version":"0.133.7","pages":[{"slug":"what-is-cotal","title":"What is Cotal","kind":"Start here (informative)","category":"Start here","summary":"Cotal is an open pub/sub standard for AI agents and software services to work together."},{"slug":"getting-started","title":"Quickstart","kind":"Start here (informative)","category":"Start here","summary":"Paste this into any coding agent (Claude Code, OpenCode, Cursor, Codex) and it will do the whole page for you:"},{"slug":"architecture","title":"Architecture","kind":"Concept (informative)","category":"Concept","summary":"Cotal is built as a thin waist: the normative wire contract (subjects, message schemas, presence/discovery, delivery semantics, the auth grammar) is the standard (SPEC), and everything else is a pl\u2026"},{"slug":"mcp-tools","title":"MCP tool catalog","kind":"Reference: the `cotal_*` tool surface every connected agent gets.","category":"Reference","summary":"The tools are defined once, platform-neutrally, in @cotal-ai/connector-core and rendered onto each host's native tool API (an MCP server for Claude Code, Codex and Jcode, native plugin tools for Op\u2026"},{"slug":"channels-and-permissions","title":"Channel permissions","kind":"Reference (informative task card)","category":"Reference","summary":"Channel permissions decide who can read, who can post, and what each agent tunes into at boot."},{"slug":"identity-and-auth","title":"Identity","kind":"Concept (informative)","category":"Concept","summary":"Who can do what on a mesh, and how it is enforced."},{"slug":"agent-files","title":"Agent files","kind":"Reference (the persisted form of an agent's identity + persona, read by every launcher)","category":"Reference","summary":"An agent's identity and persona live in one Markdown file instead of being passed flag-by-flag, the same shape Claude Code uses for subagents:"},{"slug":"api-reference","title":"API reference","kind":"Reference (informative)","category":"Reference","summary":"Cotal exposes a wire protocol, TypeScript libraries, CLI commands and agent tools."},{"slug":"auth-api","title":"Auth HTTP API","kind":"Reference (informative)","category":"Reference","summary":"HTTP interface of the stock auth public listener: 11 paths and 12 operations."},{"slug":"authoring-a-connector","title":"Authoring a connector","kind":"Reference: describes the TypeScript reference implementation, not the wire contract.","category":"Reference","summary":"A connector teaches Cotal how to launch one agent harness (Claude Code, OpenCode, your own) as a mesh node."},{"slug":"build-a-client","title":"Build a Cotal client","kind":"Guide (informative)","category":"Guide","summary":"This page is the reading order for implementing a Cotal client in another language (Go, Python, Rust, or anything with a NATS client library) against the spec, without reimplementing the protocol."},{"slug":"cli","title":"`cotal` CLI reference","kind":"Reference: describes the TypeScript reference implementation (the `cotal` CLI), not the wire contract.","category":"Reference","summary":"cotal is the operator command line for the reference implementation: bring a mesh up, mint identities, launch agents, watch what they do, and tear it all down."},{"slug":"config","title":"Configuration","kind":"Reference: describes the TypeScript reference implementation (the `cotal` CLI and connectors), not the wire contract.","category":"Reference","summary":"Four things configure a Cotal workstation: the config file (per-connector settings, notably which of your MCP servers get shared with spawned agents), your preferences (the defaults your own comman\u2026"},{"slug":"connect-claude","title":"Connect Claude","kind":"Guide (informative)","category":"Guide","summary":"The Claude Code connector turns a real claude session into a Cotal mesh peer."},{"slug":"connect-codex","title":"Connect Codex (beta)","kind":"Guide (informative)","category":"Guide","summary":"OpenAI Codex joins a Cotal mesh as a lateral peer: the same cotal tool surface, the same message delivery and attention model as the other connectors, plus mid-turn steering: a directed peer messag\u2026"},{"slug":"connect-hermes","title":"Connect Hermes (alpha)","kind":"Guide (informative)","category":"Guide","summary":"Hermes (Nous Research) joins a Cotal mesh as a lateral peer, with the same shared cotal tool surface and delivery model as the other connectors."},{"slug":"connect-jcode","title":"Connect Jcode (beta)","kind":"Guide (informative)","category":"Guide","summary":"Jcode joins a Cotal mesh as a lateral peer."},{"slug":"connect-opencode","title":"Connect OpenCode (beta)","kind":"Guide (informative)","category":"Guide","summary":"OpenCode joins a Cotal mesh as a lateral peer, at parity with Claude Code: the same cotal tool surface, the same message delivery and attention model."},{"slug":"connect-pi","title":"Connect pi (alpha)","kind":"Guide (informative)","category":"Guide","summary":"@cotal-ai/pi is Cotal's first host-native framework adapter."},{"slug":"connectors","title":"Connectors","kind":"Guide (informative)","category":"Guide","summary":"Every connector puts a real agent session on the mesh with the same cotal tools, presence, and delivery model (MCP tools)."},{"slug":"control-surface","title":"The control surface","kind":"Concept (informative)","category":"Concept","summary":"Cotal once had a privileged control rail: a fixed set of named service tiers (self / manager / admin / delivery) on their own ctl."},{"slug":"dashboard-api","title":"Dashboard HTTP API","kind":"Reference (informative)","category":"Reference","summary":"HTTP interface of the @cotal-ai/web reference implementation."},{"slug":"define-a-team","title":"Define a team","kind":"Guide (informative)","category":"Guide","summary":"The Quickstart gives you one agent. To run a specific team (your own channels, your own agents, and the channel access for each agent), describe it once in a cotal.yaml and launch it with a single\u2026"},{"slug":"delivery-daemon","title":"The delivery daemon (Plane-3)","kind":"Concept (informative)","category":"Concept","summary":"Live channel delivery is at-most-once: a message reaches only the peers subscribed at the moment it is published (SPEC \xA74)."},{"slug":"deploy","title":"Deploying agent teams","kind":"Guide (informative)","category":"Guide","summary":"The deploy/ tree runs a team of agents in an isolated container that dials out to an existing Cotal broker."},{"slug":"embedding","title":"Embedding Cotal","kind":"Guide (informative)","category":"Guide","summary":"The cotal binary in this repo is one composition root: an operator CLI."},{"slug":"examples","title":"Examples","kind":"Guide (informative)","category":"Guide","summary":"Examples live in examples/, one self-contained folder each."},{"slug":"glossary","title":"Glossary","kind":"Reference (informative)","category":"Reference","summary":"One-line definitions of the terms used across these docs and the spec."},{"slug":"lang-card","title":"The cotal-lang card","kind":"Reference (informative)","category":"Reference","summary":"One page to write a correct workflow program."},{"slug":"manifest","title":"Mesh manifest (`cotal.yaml`)","kind":"Reference: every field of the mesh manifest.","category":"Reference","summary":"A manifest (cotal.yaml, kind: Mesh) describes a whole team (its channels, its agents, and who may read and post where) in one file."},{"slug":"mesh-view","title":"MeshView","kind":"Reference: TypeScript observer surfaces (`MeshView`)","category":"Reference","summary":"MeshView is the CLI's shared model for the terminal console and its plain stream."},{"slug":"presence-and-delivery","title":"Message flow","kind":"Concept (informative)","category":"Concept","summary":"How peers see each other and how messages reach them: the presence directory, the three delivery modes, and the two delivery guarantees."},{"slug":"release","title":"Publishing a release","kind":"Project (non-normative maintainer notes)","category":"Project","summary":"Cotal uses pnpm, Changesets and one GitHub Actions workflow."},{"slug":"roadmap","title":"Roadmap","kind":"Project (non-normative)","category":"Project","summary":"Cotal is pre-1.0. The wire contract (v0.x) may still change under the change process. This page tracks what is deliberately not built yet, and the direction each area is headed."},{"slug":"run-a-mesh","title":"Run a mesh","kind":"Guide (informative)","category":"Guide","summary":"Day-to-day operation of a local mesh: what cotal up actually runs, how spawning resolves personas, harnesses, and models, how to reach a mesh from any directory, and the operator-only maintenance v\u2026"},{"slug":"security","title":"Security model","kind":"Concept (informative threat model)","category":"Concept","summary":"Cotal v0 provides containment and sender authenticity for peers sharing one trusted NATS broker."},{"slug":"setup-internals","title":"Setup internals (maintainer notes)","kind":"Project (non-normative maintainer notes)","category":"Project","summary":"cotal setup (implementations/cli/src/commands/setup.ts) saves configuration by default: it checks prerequisites, sets up the chosen application and runtimes, and seeds persona files."},{"slug":"spaces","title":"Spaces","kind":"Concept (informative)","category":"Concept","summary":"The space concept, and why it is distinct from a channel."},{"slug":"stability","title":"Substrate stability","kind":"Project (informative)","category":"Project","summary":"Cotal's packages are pre-1.0 and publish in lockstep."},{"slug":"telemetry","title":"Telemetry","kind":"Reference","category":"Reference","summary":"The cotal CLI sends usage data about commands, failures and platforms."},{"slug":"transport","title":"Transport vs protocol","kind":"Concept (informative)","category":"Concept","summary":"What in Cotal is the protocol, what is the transport, and what a transport binding must provide."},{"slug":"upgrading","title":"Upgrading a running deployment","kind":"Guide (informative)","category":"Guide","summary":"Substrate stability tells you what the version numbers promise."},{"slug":"using-cotal","title":"Choose a workflow","kind":"Guide (informative)","category":"Guide","summary":"Cotal can run a local team, connect a session to a shared space, or expose a service to agents."},{"slug":"watch-a-mesh","title":"Watch a mesh","kind":"Guide (informative)","category":"Guide","summary":"Cotal's watch surfaces show who is present, their reported activity and the messages your credential permits you to read."},{"slug":"workflows","title":"Workflow runs","kind":"Concept (informative)","category":"Concept","summary":"A workflow run is a program that coordinates agents over hours or days and survives the process that started it."}],"spec":{"title":"Cotal Wire Specification"},"lang":{"title":"Cotal Lang: the workflow language"},"schema":{"title":"Cotal message schema (JSON Schema)"}}}var corpusPacked;function corpusData(){if(corpusPacked)return corpusPacked;const packed=readFileSync5(join7(import.meta.dirname,"docs-bundle.bin"));if(packed.length!==1011351||createHash10("sha256").update(packed).digest("hex")!=="45d8059ff86830e9a053c858a5ffb5d4bf111793201173a7fd012cac6a951b81")throw new Error("docs data file docs-bundle.bin beside this module is not the one built with it");return corpusPacked=packed}var sourceBounds=[[0,2452],[2452,9118],[9118,18828],[18828,34667],[34667,37458],[37458,66068],[66068,71569],[71569,74836],[74836,83632],[83632,87999],[87999,92168],[92168,359261],[359261,377346],[377346,409245],[409245,419225],[419225,425654],[425654,438203],[438203,444487],[444487,448952],[448952,452529],[452529,470986],[470986,475418],[475418,481608],[481608,489810],[489810,493097],[493097,545142],[545142,546999],[546999,550257],[550257,554004],[554004,558817],[558817,564741],[564741,574192],[574192,577871],[577871,581019],[581019,602007],[602007,608237],[608237,620119],[620119,622730],[622730,625211],[625211,629283],[629283,633478],[633478,692416],[692416,695540],[695540,704837],[704837,730325],[730325,968497],[968497,1006139],[1006139,1011351]];var sourceLengths=[5208,15763,23039,47651,6757,75407,12629,7832,76592,10114,9704,805600,47318,86254,24768,15562,32690,15114,9720,8073,49834,25032,15534,21252,7249,145145,3758,8366,8397,11335,13357,23090,8770,6525,55562,14726,29983,5486,5367,9775,9903,171720,6967,22142,68170,688894,106096,21676];var decodedBodies=[];function loadDocsSourceLengths(){corpusData();return sourceLengths.slice()}function decodeDocsSource(source){const bounds=sourceBounds[source];if(!Number.isInteger(source)||!bounds)throw new Error("docs source index is out of bounds");const body=JSON.parse(gunzipSync(corpusData().subarray(bounds[0],bounds[1])).toString("utf8"));if(typeof body!=="string"||body.length!==sourceLengths[source])throw new Error("docs source body does not match its generated bounds");return body}function loadDocsSource(source){return decodedBodies[source]??=decodeDocsSource(source)}function loadDocsIndex(){const packed=readFileSync5(join7(import.meta.dirname,"docs-index.bin"));if(packed.length!==437019||createHash10("sha256").update(packed).digest("hex")!=="4d72d0aca97aa34cdd95e9c3a3fc0b62f1727aa56b21941548cb1c2ac6a8b24e")throw new Error("docs data file docs-index.bin beside this module is not the one built with it");return gunzipSync(packed)}var TOKEN=/[a-z0-9_$.#>*-]+/gi;var EDGE=/^[.>*#-]+|[.>*#-]+$/g;function tokenize(s){const raw=s.toLowerCase().match(TOKEN);if(!raw)return[];const out=[];for(const r of raw){if(r.length>=2)out.push(r);const t=r.replace(EDGE,"");if(t.length>=2&&t!==r)out.push(t);if(t.includes(".")){for(const seg of t.split("."))if(seg.length>=2)out.push(seg)}}return out}var STOP=new Set("a an and are as at be by do for from has how in is it of on or that the this to use using was what when where which who with you your".split(" "));function decodeIndex(bytes,bodyLengths,version2){if(bytes.length<4)throw new Error("docs index is truncated or malformed");const headerLength=bytes.readUInt32LE(0);if(4+headerLength>bytes.length)throw new Error("docs index is truncated or malformed");const header=JSON.parse(bytes.toString("utf8",4,4+headerLength));if(header.version!==version2||header.bodyLengths.length!==bodyLengths.length||header.bodyLengths.some((length2,i)=>length2!==bodyLengths[i]))throw new Error("docs index does not match the docs bundle it is searching");const n=header.sections;const length=4*n+header.terms.length+1+2*header.postings;if(bytes.length-4-headerLength!==4*length)throw new Error("docs index is truncated or malformed");const columns=new Uint32Array(length);for(let i=0;i<length;i++)columns[i]=bytes.readUInt32LE(4+headerLength+4*i);const offsets=4*n;const sectionColumn=offsets+header.terms.length+1;let total=0;for(let i=0;i<n;i++)total+=columns[3*n+i];return{sections:n,terms:header.terms,headings:header.headings,source:columns.subarray(0,n),start:columns.subarray(n,2*n),end:columns.subarray(2*n,3*n),length:columns.subarray(3*n,4*n),offsets:columns.subarray(offsets,sectionColumn),postSection:columns.subarray(sectionColumn,sectionColumn+header.postings),postWeight:columns.subarray(sectionColumn+header.postings),avgdl:total/Math.max(1,n)}}var indexed;function metadata(){return indexed??=loadDocsMetadata()}var pages=new Map;function localPage(source){let page=pages.get(source);if(!page){page={...metadata().pages[source],body:loadDocsSource(source)};pages.set(source,page)}return page}function sourceBody(source){return source<metadata().pages.length?localPage(source).body:loadDocsSource(source)}var REMOTE_BASE="https://docs.cotal.ai";function resolvePage(page){const key=page.trim().toLowerCase().replace(/\.md$/,"");const meta3=metadata();loadDocsSourceLengths();const count=meta3.pages.length;if(key==="spec")return{slug:"spec",title:meta3.spec.title,kind:"normative",category:"normative",summary:"",body:loadDocsSource(count)};if(key==="lang"||key==="cotal-lang")return{slug:"lang",title:meta3.lang.title,kind:"normative",category:"normative",summary:"",body:loadDocsSource(count+1)};if(key==="schema")return{slug:"schema",title:meta3.schema.title,kind:"reference",category:"reference",summary:"",body:loadDocsSource(count+2)};const source=meta3.pages.findIndex((p,source2)=>(pages.get(source2)??p).slug===key);return source<0?void 0:localPage(source)}function remoteUrl(slug){const base=`${REMOTE_BASE}/v/${DOCS_VERSION}`;if(slug==="schema")return`${base}/cotal.schema.json`;if(slug==="lang")return`${base}/cotal-lang.md`;return`${base}/${slug}.md`}function renderDocsIndex(){const b=metadata();const rows=b.pages.map(p=>{const kind=p.kind?`: ${p.kind}`:"";return`- \`${p.slug}\`${kind}
|
|
131
|
+
`)});return server}var ok=text2=>({text:text2});var err=text2=>({text:text2,isError:true});async function submitFeedback(input,options={}){const url2=options.url??(options.key?FEEDBACK_URL:PUBLIC_FEEDBACK_URL);const headers3={"content-type":"application/json"};const body={...input};if(options.key){headers3.authorization=`Bearer ${options.key}`}else{if(!options.email)return err("Keyless feedback goes to the public cotal.ai intake, which requires a traceable contact email \u2014 ask the user for one and retry with the email argument (or set COTAL_FEEDBACK_EMAIL).");body.email=options.email}try{const res=await fetch(url2,{method:"POST",headers:headers3,body:JSON.stringify(body)});const raw=await res.text();let reply={};if(raw)try{reply=JSON.parse(raw)}catch{reply={error:raw}}if(!res.ok)return err(`Feedback rejected (${res.status}${reply.error?`: ${reply.error}`:""}).`);const note=reply.published===false?" (stored, but the internal feedback channel publish failed)":"";return ok(`Feedback sent${reply.id?` (id ${reply.id})`:""}${note}. Thanks!`)}catch(e){return err(`Couldn't reach the feedback intake at ${url2}: ${e.message}`)}}import{execFileSync as execFileSync2}from"node:child_process";init_external();init_external();import{createHash as createHash10}from"node:crypto";import{readFileSync as readFileSync5}from"node:fs";import{join as join7}from"node:path";import{gunzipSync}from"node:zlib";var DOCS_VERSION="0.133.8";function loadDocsMetadata(){return{"version":"0.133.8","pages":[{"slug":"what-is-cotal","title":"What is Cotal","kind":"Start here (informative)","category":"Start here","summary":"Cotal is an open pub/sub standard for AI agents and software services to work together."},{"slug":"getting-started","title":"Quickstart","kind":"Start here (informative)","category":"Start here","summary":"Paste this into any coding agent (Claude Code, OpenCode, Cursor, Codex) and it will do the whole page for you:"},{"slug":"architecture","title":"Architecture","kind":"Concept (informative)","category":"Concept","summary":"Cotal is built as a thin waist: the normative wire contract (subjects, message schemas, presence/discovery, delivery semantics, the auth grammar) is the standard (SPEC), and everything else is a pl\u2026"},{"slug":"mcp-tools","title":"MCP tool catalog","kind":"Reference: the `cotal_*` tool surface every connected agent gets.","category":"Reference","summary":"The tools are defined once, platform-neutrally, in @cotal-ai/connector-core and rendered onto each host's native tool API (an MCP server for Claude Code, Codex and Jcode, native plugin tools for Op\u2026"},{"slug":"channels-and-permissions","title":"Channel permissions","kind":"Reference (informative task card)","category":"Reference","summary":"Channel permissions decide who can read, who can post, and what each agent tunes into at boot."},{"slug":"identity-and-auth","title":"Identity","kind":"Concept (informative)","category":"Concept","summary":"Who can do what on a mesh, and how it is enforced."},{"slug":"agent-files","title":"Agent files","kind":"Reference (the persisted form of an agent's identity + persona, read by every launcher)","category":"Reference","summary":"An agent's identity and persona live in one Markdown file instead of being passed flag-by-flag, the same shape Claude Code uses for subagents:"},{"slug":"api-reference","title":"API reference","kind":"Reference (informative)","category":"Reference","summary":"Cotal exposes a wire protocol, TypeScript libraries, CLI commands and agent tools."},{"slug":"auth-api","title":"Auth HTTP API","kind":"Reference (informative)","category":"Reference","summary":"HTTP interface of the stock auth public listener: 11 paths and 12 operations."},{"slug":"authoring-a-connector","title":"Authoring a connector","kind":"Reference: describes the TypeScript reference implementation, not the wire contract.","category":"Reference","summary":"A connector teaches Cotal how to launch one agent harness (Claude Code, OpenCode, your own) as a mesh node."},{"slug":"build-a-client","title":"Build a Cotal client","kind":"Guide (informative)","category":"Guide","summary":"This page is the reading order for implementing a Cotal client in another language (Go, Python, Rust, or anything with a NATS client library) against the spec, without reimplementing the protocol."},{"slug":"cli","title":"`cotal` CLI reference","kind":"Reference: describes the TypeScript reference implementation (the `cotal` CLI), not the wire contract.","category":"Reference","summary":"cotal is the operator command line for the reference implementation: bring a mesh up, mint identities, launch agents, watch what they do, and tear it all down."},{"slug":"config","title":"Configuration","kind":"Reference: describes the TypeScript reference implementation (the `cotal` CLI and connectors), not the wire contract.","category":"Reference","summary":"Four things configure a Cotal workstation: the config file (per-connector settings, notably which of your MCP servers get shared with spawned agents), your preferences (the defaults your own comman\u2026"},{"slug":"connect-claude","title":"Connect Claude","kind":"Guide (informative)","category":"Guide","summary":"The Claude Code connector turns a real claude session into a Cotal mesh peer."},{"slug":"connect-codex","title":"Connect Codex (beta)","kind":"Guide (informative)","category":"Guide","summary":"OpenAI Codex joins a Cotal mesh as a lateral peer: the same cotal tool surface, the same message delivery and attention model as the other connectors, plus mid-turn steering: a directed peer messag\u2026"},{"slug":"connect-hermes","title":"Connect Hermes (alpha)","kind":"Guide (informative)","category":"Guide","summary":"Hermes (Nous Research) joins a Cotal mesh as a lateral peer, with the same shared cotal tool surface and delivery model as the other connectors."},{"slug":"connect-jcode","title":"Connect Jcode (beta)","kind":"Guide (informative)","category":"Guide","summary":"Jcode joins a Cotal mesh as a lateral peer."},{"slug":"connect-opencode","title":"Connect OpenCode (beta)","kind":"Guide (informative)","category":"Guide","summary":"OpenCode joins a Cotal mesh as a lateral peer, at parity with Claude Code: the same cotal tool surface, the same message delivery and attention model."},{"slug":"connect-pi","title":"Connect pi (alpha)","kind":"Guide (informative)","category":"Guide","summary":"@cotal-ai/pi is Cotal's first host-native framework adapter."},{"slug":"connectors","title":"Connectors","kind":"Guide (informative)","category":"Guide","summary":"Every connector puts a real agent session on the mesh with the same cotal tools, presence, and delivery model (MCP tools)."},{"slug":"control-surface","title":"The control surface","kind":"Concept (informative)","category":"Concept","summary":"Cotal once had a privileged control rail: a fixed set of named service tiers (self / manager / admin / delivery) on their own ctl."},{"slug":"dashboard-api","title":"Dashboard HTTP API","kind":"Reference (informative)","category":"Reference","summary":"HTTP interface of the @cotal-ai/web reference implementation."},{"slug":"define-a-team","title":"Define a team","kind":"Guide (informative)","category":"Guide","summary":"The Quickstart gives you one agent. To run a specific team (your own channels, your own agents, and the channel access for each agent), describe it once in a cotal.yaml and launch it with a single\u2026"},{"slug":"delivery-daemon","title":"The delivery daemon (Plane-3)","kind":"Concept (informative)","category":"Concept","summary":"Live channel delivery is at-most-once: a message reaches only the peers subscribed at the moment it is published (SPEC \xA74)."},{"slug":"deploy","title":"Deploying agent teams","kind":"Guide (informative)","category":"Guide","summary":"The deploy/ tree runs a team of agents in an isolated container that dials out to an existing Cotal broker."},{"slug":"embedding","title":"Embedding Cotal","kind":"Guide (informative)","category":"Guide","summary":"The cotal binary in this repo is one composition root: an operator CLI."},{"slug":"examples","title":"Examples","kind":"Guide (informative)","category":"Guide","summary":"Examples live in examples/, one self-contained folder each."},{"slug":"glossary","title":"Glossary","kind":"Reference (informative)","category":"Reference","summary":"One-line definitions of the terms used across these docs and the spec."},{"slug":"lang-card","title":"The cotal-lang card","kind":"Reference (informative)","category":"Reference","summary":"One page to write a correct workflow program."},{"slug":"manifest","title":"Mesh manifest (`cotal.yaml`)","kind":"Reference: every field of the mesh manifest.","category":"Reference","summary":"A manifest (cotal.yaml, kind: Mesh) describes a whole team (its channels, its agents, and who may read and post where) in one file."},{"slug":"mesh-view","title":"MeshView","kind":"Reference: TypeScript observer surfaces (`MeshView`)","category":"Reference","summary":"MeshView is the CLI's shared model for the terminal console and its plain stream."},{"slug":"presence-and-delivery","title":"Message flow","kind":"Concept (informative)","category":"Concept","summary":"How peers see each other and how messages reach them: the presence directory, the three delivery modes, and the two delivery guarantees."},{"slug":"release","title":"Publishing a release","kind":"Project (non-normative maintainer notes)","category":"Project","summary":"Cotal uses pnpm, Changesets and one GitHub Actions workflow."},{"slug":"roadmap","title":"Roadmap","kind":"Project (non-normative)","category":"Project","summary":"Cotal is pre-1.0. The wire contract (v0.x) may still change under the change process. This page tracks what is deliberately not built yet, and the direction each area is headed."},{"slug":"run-a-mesh","title":"Run a mesh","kind":"Guide (informative)","category":"Guide","summary":"Day-to-day operation of a local mesh: what cotal up actually runs, how spawning resolves personas, harnesses, and models, how to reach a mesh from any directory, and the operator-only maintenance v\u2026"},{"slug":"security","title":"Security model","kind":"Concept (informative threat model)","category":"Concept","summary":"Cotal v0 provides containment and sender authenticity for peers sharing one trusted NATS broker."},{"slug":"setup-internals","title":"Setup internals (maintainer notes)","kind":"Project (non-normative maintainer notes)","category":"Project","summary":"cotal setup (implementations/cli/src/commands/setup.ts) saves configuration by default: it checks prerequisites, sets up the chosen application and runtimes, and seeds persona files."},{"slug":"spaces","title":"Spaces","kind":"Concept (informative)","category":"Concept","summary":"The space concept, and why it is distinct from a channel."},{"slug":"stability","title":"Substrate stability","kind":"Project (informative)","category":"Project","summary":"Cotal's packages are pre-1.0 and publish in lockstep."},{"slug":"telemetry","title":"Telemetry","kind":"Reference","category":"Reference","summary":"The cotal CLI sends usage data about commands, failures and platforms."},{"slug":"transport","title":"Transport vs protocol","kind":"Concept (informative)","category":"Concept","summary":"What in Cotal is the protocol, what is the transport, and what a transport binding must provide."},{"slug":"upgrading","title":"Upgrading a running deployment","kind":"Guide (informative)","category":"Guide","summary":"Substrate stability tells you what the version numbers promise."},{"slug":"using-cotal","title":"Choose a workflow","kind":"Guide (informative)","category":"Guide","summary":"Cotal can run a local team, connect a session to a shared space, or expose a service to agents."},{"slug":"watch-a-mesh","title":"Watch a mesh","kind":"Guide (informative)","category":"Guide","summary":"Cotal's watch surfaces show who is present, their reported activity and the messages your credential permits you to read."},{"slug":"workflows","title":"Workflow runs","kind":"Concept (informative)","category":"Concept","summary":"A workflow run is a program that coordinates agents over hours or days and survives the process that started it."}],"spec":{"title":"Cotal Wire Specification"},"lang":{"title":"Cotal Lang: the workflow language"},"schema":{"title":"Cotal message schema (JSON Schema)"}}}var corpusPacked;function corpusData(){if(corpusPacked)return corpusPacked;const packed=readFileSync5(join7(import.meta.dirname,"docs-bundle.bin"));if(packed.length!==1011351||createHash10("sha256").update(packed).digest("hex")!=="45d8059ff86830e9a053c858a5ffb5d4bf111793201173a7fd012cac6a951b81")throw new Error("docs data file docs-bundle.bin beside this module is not the one built with it");return corpusPacked=packed}var sourceBounds=[[0,2452],[2452,9118],[9118,18828],[18828,34667],[34667,37458],[37458,66068],[66068,71569],[71569,74836],[74836,83632],[83632,87999],[87999,92168],[92168,359261],[359261,377346],[377346,409245],[409245,419225],[419225,425654],[425654,438203],[438203,444487],[444487,448952],[448952,452529],[452529,470986],[470986,475418],[475418,481608],[481608,489810],[489810,493097],[493097,545142],[545142,546999],[546999,550257],[550257,554004],[554004,558817],[558817,564741],[564741,574192],[574192,577871],[577871,581019],[581019,602007],[602007,608237],[608237,620119],[620119,622730],[622730,625211],[625211,629283],[629283,633478],[633478,692416],[692416,695540],[695540,704837],[704837,730325],[730325,968497],[968497,1006139],[1006139,1011351]];var sourceLengths=[5208,15763,23039,47651,6757,75407,12629,7832,76592,10114,9704,805600,47318,86254,24768,15562,32690,15114,9720,8073,49834,25032,15534,21252,7249,145145,3758,8366,8397,11335,13357,23090,8770,6525,55562,14726,29983,5486,5367,9775,9903,171720,6967,22142,68170,688894,106096,21676];var decodedBodies=[];function loadDocsSourceLengths(){corpusData();return sourceLengths.slice()}function decodeDocsSource(source){const bounds=sourceBounds[source];if(!Number.isInteger(source)||!bounds)throw new Error("docs source index is out of bounds");const body=JSON.parse(gunzipSync(corpusData().subarray(bounds[0],bounds[1])).toString("utf8"));if(typeof body!=="string"||body.length!==sourceLengths[source])throw new Error("docs source body does not match its generated bounds");return body}function loadDocsSource(source){return decodedBodies[source]??=decodeDocsSource(source)}function loadDocsIndex(){const packed=readFileSync5(join7(import.meta.dirname,"docs-index.bin"));if(packed.length!==437017||createHash10("sha256").update(packed).digest("hex")!=="db73f3b6e1e992bef914963404d96701c3b6e5af6decaf8e0bc483ef8e6700ef")throw new Error("docs data file docs-index.bin beside this module is not the one built with it");return gunzipSync(packed)}var TOKEN=/[a-z0-9_$.#>*-]+/gi;var EDGE=/^[.>*#-]+|[.>*#-]+$/g;function tokenize(s){const raw=s.toLowerCase().match(TOKEN);if(!raw)return[];const out=[];for(const r of raw){if(r.length>=2)out.push(r);const t=r.replace(EDGE,"");if(t.length>=2&&t!==r)out.push(t);if(t.includes(".")){for(const seg of t.split("."))if(seg.length>=2)out.push(seg)}}return out}var STOP=new Set("a an and are as at be by do for from has how in is it of on or that the this to use using was what when where which who with you your".split(" "));function decodeIndex(bytes,bodyLengths,version2){if(bytes.length<4)throw new Error("docs index is truncated or malformed");const headerLength=bytes.readUInt32LE(0);if(4+headerLength>bytes.length)throw new Error("docs index is truncated or malformed");const header=JSON.parse(bytes.toString("utf8",4,4+headerLength));if(header.version!==version2||header.bodyLengths.length!==bodyLengths.length||header.bodyLengths.some((length2,i)=>length2!==bodyLengths[i]))throw new Error("docs index does not match the docs bundle it is searching");const n=header.sections;const length=4*n+header.terms.length+1+2*header.postings;if(bytes.length-4-headerLength!==4*length)throw new Error("docs index is truncated or malformed");const columns=new Uint32Array(length);for(let i=0;i<length;i++)columns[i]=bytes.readUInt32LE(4+headerLength+4*i);const offsets=4*n;const sectionColumn=offsets+header.terms.length+1;let total=0;for(let i=0;i<n;i++)total+=columns[3*n+i];return{sections:n,terms:header.terms,headings:header.headings,source:columns.subarray(0,n),start:columns.subarray(n,2*n),end:columns.subarray(2*n,3*n),length:columns.subarray(3*n,4*n),offsets:columns.subarray(offsets,sectionColumn),postSection:columns.subarray(sectionColumn,sectionColumn+header.postings),postWeight:columns.subarray(sectionColumn+header.postings),avgdl:total/Math.max(1,n)}}var indexed;function metadata(){return indexed??=loadDocsMetadata()}var pages=new Map;function localPage(source){let page=pages.get(source);if(!page){page={...metadata().pages[source],body:loadDocsSource(source)};pages.set(source,page)}return page}function sourceBody(source){return source<metadata().pages.length?localPage(source).body:loadDocsSource(source)}var REMOTE_BASE="https://docs.cotal.ai";function resolvePage(page){const key=page.trim().toLowerCase().replace(/\.md$/,"");const meta3=metadata();loadDocsSourceLengths();const count=meta3.pages.length;if(key==="spec")return{slug:"spec",title:meta3.spec.title,kind:"normative",category:"normative",summary:"",body:loadDocsSource(count)};if(key==="lang"||key==="cotal-lang")return{slug:"lang",title:meta3.lang.title,kind:"normative",category:"normative",summary:"",body:loadDocsSource(count+1)};if(key==="schema")return{slug:"schema",title:meta3.schema.title,kind:"reference",category:"reference",summary:"",body:loadDocsSource(count+2)};const source=meta3.pages.findIndex((p,source2)=>(pages.get(source2)??p).slug===key);return source<0?void 0:localPage(source)}function remoteUrl(slug){const base=`${REMOTE_BASE}/v/${DOCS_VERSION}`;if(slug==="schema")return`${base}/cotal.schema.json`;if(slug==="lang")return`${base}/cotal-lang.md`;return`${base}/${slug}.md`}function renderDocsIndex(){const b=metadata();const rows=b.pages.map(p=>{const kind=p.kind?`: ${p.kind}`:"";return`- \`${p.slug}\`${kind}
|
|
132
132
|
${p.summary}`});return[`# Cotal v${b.version} documentation`,"","The authoritative docs bundled with this installed version. This index lists what","exists; it holds no answers itself. Your next call:",'- Know the page? Read it in full: `cotal_docs(page: "<slug>")` (e.g. "spec", "architecture").','- Not sure which page? Search: `cotal_docs(query: "\u2026")` returns the most relevant sections.',"Prefer these docs over training memory, and read the full page before writing code or wire","frames. Docs are bundled and version-exact; add `refresh: true` to also pull any patches","published to docs.cotal.ai for this same version.","","## The normative sources",`- \`spec\`: ${b.spec.title} (the wire contract; where a page disagrees, the spec wins)`,`- \`lang\`: ${b.lang.title} (the workflow language a durable run executes; spec \xA714)`,`- \`schema\`: ${b.schema.title} (authoritative for message shapes)`,"","## Pages",...rows].join("\n")}function renderPage(p,note){return`${note}
|
|
133
133
|
|
|
134
134
|
${p.body}`.trimStart()}var K1=1.2;var B=.75;function sources(){const b=metadata();return[...b.pages.map((page,source)=>pages.get(source)??page),{slug:"spec",...b.spec},{slug:"lang",...b.lang},{slug:"schema",...b.schema}]}var index;function searchIndex(){if(index)return index;const lengths=loadDocsSourceLengths();for(const[source,page]of pages)lengths[source]=page.body.length;return index=decodeIndex(loadDocsIndex(),lengths,DOCS_VERSION)}function termId(terms,term){let low=0;let high=terms.length-1;while(low<=high){const mid=low+high>>>1;const candidate2=terms[mid];if(candidate2===term)return mid;if(candidate2<term)low=mid+1;else high=mid-1}return-1}function searchDocs(query,limit=5){if(limit<=0)return[];let terms=tokenize(query).filter(t=>!STOP.has(t));if(!terms.length)terms=tokenize(query);const termSet=new Set(terms);if(!termSet.size)return[];const idx=searchIndex();const N=idx.sections;const scores=new Float64Array(N);for(const t of termSet){const id2=termId(idx.terms,t);if(id2<0)continue;const from=idx.offsets[id2];const to=idx.offsets[id2+1];const n=to-from;const idf=Math.log(1+(N-n+.5)/(n+.5));for(let p=from;p<to;p++){const s=idx.postSection[p];const f=idx.postWeight[p];scores[s]+=idf*(f*(K1+1)/(f+K1*(1-B+B*idx.length[s]/idx.avgdl)))}}const scored=[];for(let s=0;s<N;s++)if(scores[s]>0)scored.push({s,score:scores[s]});scored.sort((a,b)=>b.score-a.score);const all=sources();const perPage=new Map;const hits=[];for(const{s,score}of scored){const source=all[idx.source[s]];const seen=perPage.get(source.slug)??0;if(seen>=2)continue;perPage.set(source.slug,seen+1);hits.push({slug:source.slug,pageTitle:source.title,heading:idx.headings[s],text:sourceBody(idx.source[s]).slice(idx.start[s],idx.end[s]),score});if(hits.length>=limit)break}return hits}function capSection(text2,maxLines=48){const lines=text2.split("\n");if(lines.length<=maxLines)return text2.trim();return lines.slice(0,maxLines).join("\n").trimEnd()+"\n\n\u2026 (section continues; read the full page)"}function renderSearch(query,hits){loadDocsSourceLengths();if(!hits.length){return`No matches for "${query}" in the Cotal v${DOCS_VERSION} docs. Call cotal_docs() for the page index, or search an exact identifier (a subject, a cotal_* tool, a field name).`}const blocks=hits.map(h2=>`## ${h2.heading}
|
|
@@ -177,9 +177,9 @@ ${MESH_FIRST_STEER}
|
|
|
177
177
|
|
|
178
178
|
${WORKFLOW_STEER}`;if(!batch.surface(ids))return;busy=true;await opencodeApi(`/session/${encodeURIComponent(id2)}/prompt_async`,{method:"POST",body:JSON.stringify(body)},1e4);if(turnIds.length)agent.commitSurfacedTurns(turnIds);submittedWake=carried;if(boot!==void 0)bootPrompt=void 0;if(carried!==void 0&&wakeSeq===carriedSeq)pendingWake=void 0;briefed=true;primed=true}catch(e){busy=false;batch.abandon();log(`drive failed: ${e.message}`);scheduleErrorRetry()}finally{driving=false}}void(async()=>{if(bootPrompt===void 0)return;const id2=await sessionReady;while(!stopping&&!agent.connected)await new Promise(r=>setTimeout(r,100).unref?.());if(stopping||bootPrompt===void 0)return;if(!id2){log("initial prompt not submitted \u2014 this session was never created");bootPrompt=void 0;return}bootReady=true;await drive()})();const turnEnds=new Map;const turnEnded=async(session,close)=>{if(!close)return;if(session===void 0)return close;const settled=Promise.all([turnEnds.get(session),close]).then(()=>void 0);const barrier=settled.finally(()=>{if(turnEnds.get(session)===barrier)turnEnds.delete(session)});turnEnds.set(session,barrier);await barrier};function injectIntoPrompt(output){if(driving)return;const textPart=output.parts?.find(p=>typeof p==="object"&&p!==null&&p.type==="text"&&typeof p.text==="string");if(!textPart)return;const prefix=batch.inject();if(prefix===void 0)return;textPart.text=`${prefix}
|
|
179
179
|
|
|
180
|
-
${textPart.text}`;if(batch.open)busy=true}function completeTurn(){if(!busy&&!batch.open)return;busy=false;if(batch.open)batch.ack();submittedWake=void 0;clearInterruptIntent();clearErrorRetry(true);if(workPending())void drive()}agent.on("incoming",item=>{if(busy)return;const automatic=agent.inboxScope(item.recvKey)==="automatic";const directed=item.kind!=="channel"||item.mentionsMe;if(automatic&&(directed||agent.attention==="open"))void drive()});agent.on("mention-wake",item=>{pendingWake=`\u{1F4E8} You were mentioned by ${fmtFrom(item)} on #${fmtChannel(item.channel)} \u2014 read it with cotal_inbox.`;wakeSeq+=1;void drive()});agent.on("wake",()=>{if(!busy)void drive()});const ours=id2=>{if(!id2)return!sessionID;if(!sessionID)adoptSession(id2,"first event");return id2===sessionID};const fence=intake2=>Object.fromEntries(Object.entries(intake2).map(([name,hook])=>[name,async(...args)=>stopping?void 0:await hook(...args)]));const fenceTools=tools=>Object.fromEntries(Object.entries(tools).map(([name,def2])=>[name,{...def2,execute:async(...args)=>stopping?`\u26A0 ${name} was not run: this seat is shutting down`:await track(def2.execute(...args))}]));const intake={event:async({event})=>{if(event.type==="permission.asked"){const p=event.properties;if(!p.sessionID||ours(p.sessionID))await safeStatus("waiting",p.title);return}switch(event.type){case"session.created":{if(event.properties.info.parentID)break;const created=event.properties.info.id;const swap=swapChain.then(async()=>{swapping=true;try{adoptSession(created,"top-level session create");const previous=events;if(previous&&previous.path!==void 0&&previous.path!==created){previous.flush(previous.path);previous.closeRun(Date.now());const drained=await settleWithin(previous.settled(),SWAP_SETTLE_MS,`drain of ${previous.path}`);log(`${SESSION_RETIRED} ${previous.path} superseded by ${created}; ${drained?"drained before release":"ABANDONED UNDRAINED"}`);const retired=previous.path;await settleWithin(previous.close(),SWAP_SETTLE_MS,`release of ${retired}`);await reapRetiredWal(retired,drained);events=newEventHolder()}eventsFor(created)?.adopt(created)}finally{swapping=false}if(workPending())void drive()});swapChain=swap.catch(()=>void 0);await swap;break}case"session.idle":{const idleSession=event.properties.sessionID;if(!ours(idleSession))return;eventsFor(sessionID)?.flush(sessionID);await turnEnded(idleSession,eventsFor(sessionID)?.closeRun(Date.now()));await safeStatus("idle");completeTurn();break}case"session.status":{if(!ours(event.properties.sessionID))return;const s=event.properties.status;if(s.type==="busy"){busy=true;await safeStatus("working")}else if(s.type==="idle"){await safeStatus("idle")}else if(s.type==="retry"){await safeStatus("working",`retrying: ${s.message}`)}break}case"session.error":if(event.properties.sessionID&&!ours(event.properties.sessionID))return;if(!busy&&!batch.open)return;const interrupted=consumeInterruptIntent(event.properties.sessionID)||isMessageAbortedError(event.properties.error);const eventHolder=eventsFor(sessionID);eventHolder?.flush(sessionID);await turnEnded(sessionID,eventHolder?.closeRun(Date.now(),interrupted?void 0:runErrorOf(event.properties.error)));busy=false;if(batch.open){if(interrupted){batch.ack();submittedWake=void 0}else{batch.abandon();if(submittedWake!==void 0&&pendingWake===void 0){pendingWake=submittedWake;wakeSeq+=1}submittedWake=void 0}}await safeStatus("idle");if(!interrupted)scheduleErrorRetry();else
|
|
181
|
-
`)}var guard2=globalThis;var EVENTS_REFUSAL="opencode connector: the AG-UI event plane is not carried on OpenCode 2.x yet; spawn with --no-events";var MODEL_LIST_SETTLE_MS=1e4;async function verifyServerModel2(serverUrl,serverAuth,selectedModel,settleMs=MODEL_LIST_SETTLE_MS){const slash=selectedModel.indexOf("/");const provider=selectedModel.slice(0,slash);const model=selectedModel.slice(slash+1);const deadline=Date.now()+settleMs;for(;;){const response=await fetch(`${serverUrl}/api/model`,{headers:{authorization:serverAuth},signal:AbortSignal.timeout(1e4)});if(!response.ok)throw new Error(`opencode connector: server /api/model returned HTTP ${response.status} while checking model ${selectedModel}`);const listing=await response.json();if(slash<1||!model)throw new Error(modelRefusalSentence(selectedModel,"GET /api/model does not list it"));const data=listing.data??[];if(data.some(m=>m.providerID===provider&&m.modelID===model))return;if(data.some(m=>m.providerID===provider))throw new Error(modelRefusalSentence(selectedModel,"GET /api/model does not list it"));if(Date.now()>=deadline)throw new Error(modelRefusalSentence(selectedModel,`GET /api/model listed no provider within ${settleMs/1e3} s`));await new Promise(r=>setTimeout(r,200))}}var EVENT_QUIESCE_MS=1e4;async function setupCotal(ctx){if(!hasIdentity())return;if(guard2.__cotalOpencodeSetup)return;guard2.__cotalOpencodeSetup=true;const config2=configFromEnv();if(eventPlaneArmed(config2)){log2(EVENTS_REFUSAL);process.exit(1)}scrubLaunchMaterial();config2.connector="opencode";const serverUrl=process.env.COTAL_OPENCODE_SERVER_URL?.trim();const serverUsername=process.env.OPENCODE_SERVER_USERNAME?.trim()||"opencode";const serverPassword=process.env.OPENCODE_SERVER_PASSWORD?.trim();if(!serverUrl||!serverPassword)throw new Error("opencode connector: missing COTAL_OPENCODE_SERVER_URL/OPENCODE_SERVER_PASSWORD");const serverAuth=`Basic ${Buffer.from(`${serverUsername}:${serverPassword}`).toString("base64")}`;const selectedModel=process.env.COTAL_MODEL?.trim();const settleOverride=Number(process.env.COTAL_MODEL_LIST_SETTLE_MS);const settleMs=Number.isFinite(settleOverride)&&settleOverride>0?settleOverride:MODEL_LIST_SETTLE_MS;const modelReady=(async()=>{if(!selectedModel)return;await verifyServerModel2(serverUrl,serverAuth,selectedModel,settleMs)})();const agent=new MeshAgent(config2);const controller=new AbortController;void modelReady.then(()=>{if(controller.signal.aborted)return;return agent.start()},error51=>{if(controller.signal.aborted)return;log2(error51.message);process.exit(1)});async function opencodeApi(path,init,timeoutMs=1e4){const res=await fetch(`${serverUrl}${path}`,{...init,signal:init?.signal??AbortSignal.timeout(timeoutMs),headers:{authorization:serverAuth,"content-type":"application/json",...init?.headers??{}}});if(!res.ok)throw new Error(`OpenCode HTTP ${res.status} ${res.statusText} for ${path}`);if(res.status===204)return void 0;return await res.json()}const def=process.env.COTAL_AGENT_FILE?.trim()?loadAgentFile(process.env.COTAL_AGENT_FILE.trim()):void 0;const persona=def?.persona||void 0;let bootPrompt=process.env.COTAL_OPENCODE_PROMPT?.trim()||void 0;let bootReady=false;const bootPending=()=>bootReady&&bootPrompt!==void 0;let sessionID;let execution;let primed=false;let briefed=false;const batch=new SurfacedBatch(agent);let ended;let started;let submitting;const sessionReady=(async()=>{try{await modelReady;const res=await opencodeApi("/api/session",{method:"POST",body:JSON.stringify({title:`cotal:${config2.space}:${config2.name}`})},1e4);const id2=res.data?.id;if(id2){sessionID=id2;agent.setContextId(id2);process.stderr.write(`[cotal-session] ${id2}
|
|
182
|
-
`)}else log2("session.create returned no id")}catch(e){log2(`session.create failed: ${e.message}`)}return sessionID})();async function ensureSession(){return sessionID??await sessionReady}const safeStatus=async(status2,activity)=>{try{if(agent.connected)await agent.setStatus(status2,activity)}catch{}};async function drive(
|
|
180
|
+
${textPart.text}`;if(batch.open)busy=true}function completeTurn(){if(!busy&&!batch.open)return;busy=false;if(batch.open)batch.ack();submittedWake=void 0;clearInterruptIntent();clearErrorRetry(true);if(workPending())void drive()}agent.on("incoming",item=>{if(busy)return;const automatic=agent.inboxScope(item.recvKey)==="automatic";const directed=item.kind!=="channel"||item.mentionsMe;if(automatic&&(directed||agent.attention==="open"))void drive()});agent.on("mention-wake",item=>{pendingWake=`\u{1F4E8} You were mentioned by ${fmtFrom(item)} on #${fmtChannel(item.channel)} \u2014 read it with cotal_inbox.`;wakeSeq+=1;void drive()});agent.on("wake",()=>{if(!busy)void drive()});const ours=id2=>{if(!id2)return!sessionID;if(!sessionID)adoptSession(id2,"first event");return id2===sessionID};const fence=intake2=>Object.fromEntries(Object.entries(intake2).map(([name,hook])=>[name,async(...args)=>stopping?void 0:await hook(...args)]));const fenceTools=tools=>Object.fromEntries(Object.entries(tools).map(([name,def2])=>[name,{...def2,execute:async(...args)=>stopping?`\u26A0 ${name} was not run: this seat is shutting down`:await track(def2.execute(...args))}]));const intake={event:async({event})=>{if(event.type==="permission.asked"){const p=event.properties;if(!p.sessionID||ours(p.sessionID))await safeStatus("waiting",p.title);return}switch(event.type){case"session.created":{if(event.properties.info.parentID)break;const created=event.properties.info.id;const swap=swapChain.then(async()=>{swapping=true;try{adoptSession(created,"top-level session create");const previous=events;if(previous&&previous.path!==void 0&&previous.path!==created){previous.flush(previous.path);previous.closeRun(Date.now());const drained=await settleWithin(previous.settled(),SWAP_SETTLE_MS,`drain of ${previous.path}`);log(`${SESSION_RETIRED} ${previous.path} superseded by ${created}; ${drained?"drained before release":"ABANDONED UNDRAINED"}`);const retired=previous.path;await settleWithin(previous.close(),SWAP_SETTLE_MS,`release of ${retired}`);await reapRetiredWal(retired,drained);events=newEventHolder()}eventsFor(created)?.adopt(created)}finally{swapping=false}if(workPending())void drive()});swapChain=swap.catch(()=>void 0);await swap;break}case"session.idle":{const idleSession=event.properties.sessionID;if(!ours(idleSession))return;eventsFor(sessionID)?.flush(sessionID);await turnEnded(idleSession,eventsFor(sessionID)?.closeRun(Date.now()));await safeStatus("idle");completeTurn();break}case"session.status":{if(!ours(event.properties.sessionID))return;const s=event.properties.status;if(s.type==="busy"){busy=true;await safeStatus("working")}else if(s.type==="idle"){await safeStatus("idle")}else if(s.type==="retry"){await safeStatus("working",`retrying: ${s.message}`)}break}case"session.error":if(event.properties.sessionID&&!ours(event.properties.sessionID))return;if(!busy&&!batch.open)return;const interrupted=consumeInterruptIntent(event.properties.sessionID)||isMessageAbortedError(event.properties.error);const eventHolder=eventsFor(sessionID);eventHolder?.flush(sessionID);await turnEnded(sessionID,eventHolder?.closeRun(Date.now(),interrupted?void 0:runErrorOf(event.properties.error)));busy=false;if(batch.open){if(interrupted){batch.ack();submittedWake=void 0}else{batch.abandon();if(submittedWake!==void 0&&pendingWake===void 0){pendingWake=submittedWake;wakeSeq+=1}submittedWake=void 0}}await safeStatus("idle");if(!interrupted)scheduleErrorRetry();else{clearErrorRetry(true);if(workPending())void drive()}break;case"message.part.updated":{const partSession=event.properties.part?.sessionID;if(!ours(partSession))return;eventsFor(sessionID)?.flush(sessionID);break}case"tui.command.execute":{const p=event.properties;if(p.command==="session.interrupt")markInterruptIntent(p.sessionID);break}case"session.deleted":if(!ours(event.properties.info.id))return;await safeStatus("offline");break}},"tool.execute.before":async input=>{if(!ours(input.sessionID))return;await safeStatus("working",input.tool)}};const hooks={tool:fenceTools(buildCotalTools(agent,config2)),...fence(intake),"chat.message":async(input,output)=>{if(stopping)throw new Error("the prompt was not run: this seat is shutting down");if(!ours(input.sessionID))return;for(let barrier=turnEnds.get(input.sessionID);barrier!==void 0;barrier=turnEnds.get(input.sessionID))await barrier;if(input.model)await track(agent.setModel(`${input.model.providerID}/${input.model.modelID}`,input.variant));injectIntoPrompt(output)},dispose:shutdown};guard.__cotalOpencodeHooks=hooks;log(`opencode plugin ready \u2014 space="${config2.space}" name="${config2.name}"${config2.role?` role="${config2.role}"`:""}`);return hooks};function log2(msg){process.stderr.write(`[cotal-connector] ${msg}
|
|
181
|
+
`)}var guard2=globalThis;var EVENTS_REFUSAL="opencode connector: the AG-UI event plane is not carried on OpenCode 2.x yet; spawn with --no-events";var MODEL_LIST_SETTLE_MS=1e4;var MENTION_NUDGE="\u{1F4E8} You were mentioned \u2014 read it with cotal_inbox.";async function verifyServerModel2(serverUrl,serverAuth,selectedModel,settleMs=MODEL_LIST_SETTLE_MS){const slash=selectedModel.indexOf("/");const provider=selectedModel.slice(0,slash);const model=selectedModel.slice(slash+1);const deadline=Date.now()+settleMs;for(;;){const response=await fetch(`${serverUrl}/api/model`,{headers:{authorization:serverAuth},signal:AbortSignal.timeout(1e4)});if(!response.ok)throw new Error(`opencode connector: server /api/model returned HTTP ${response.status} while checking model ${selectedModel}`);const listing=await response.json();if(slash<1||!model)throw new Error(modelRefusalSentence(selectedModel,"GET /api/model does not list it"));const data=listing.data??[];if(data.some(m=>m.providerID===provider&&m.modelID===model))return;if(data.some(m=>m.providerID===provider))throw new Error(modelRefusalSentence(selectedModel,"GET /api/model does not list it"));if(Date.now()>=deadline)throw new Error(modelRefusalSentence(selectedModel,`GET /api/model listed no provider within ${settleMs/1e3} s`));await new Promise(r=>setTimeout(r,200))}}var EVENT_QUIESCE_MS=1e4;async function setupCotal(ctx){if(!hasIdentity())return;if(guard2.__cotalOpencodeSetup)return;guard2.__cotalOpencodeSetup=true;const config2=configFromEnv();if(eventPlaneArmed(config2)){log2(EVENTS_REFUSAL);process.exit(1)}scrubLaunchMaterial();config2.connector="opencode";const serverUrl=process.env.COTAL_OPENCODE_SERVER_URL?.trim();const serverUsername=process.env.OPENCODE_SERVER_USERNAME?.trim()||"opencode";const serverPassword=process.env.OPENCODE_SERVER_PASSWORD?.trim();if(!serverUrl||!serverPassword)throw new Error("opencode connector: missing COTAL_OPENCODE_SERVER_URL/OPENCODE_SERVER_PASSWORD");const serverAuth=`Basic ${Buffer.from(`${serverUsername}:${serverPassword}`).toString("base64")}`;const selectedModel=process.env.COTAL_MODEL?.trim();const settleOverride=Number(process.env.COTAL_MODEL_LIST_SETTLE_MS);const settleMs=Number.isFinite(settleOverride)&&settleOverride>0?settleOverride:MODEL_LIST_SETTLE_MS;const modelReady=(async()=>{if(!selectedModel)return;await verifyServerModel2(serverUrl,serverAuth,selectedModel,settleMs)})();const agent=new MeshAgent(config2);const controller=new AbortController;void modelReady.then(()=>{if(controller.signal.aborted)return;return agent.start()},error51=>{if(controller.signal.aborted)return;log2(error51.message);process.exit(1)});async function opencodeApi(path,init,timeoutMs=1e4){const res=await fetch(`${serverUrl}${path}`,{...init,signal:init?.signal??AbortSignal.timeout(timeoutMs),headers:{authorization:serverAuth,"content-type":"application/json",...init?.headers??{}}});if(!res.ok)throw new Error(`OpenCode HTTP ${res.status} ${res.statusText} for ${path}`);if(res.status===204)return void 0;return await res.json()}const def=process.env.COTAL_AGENT_FILE?.trim()?loadAgentFile(process.env.COTAL_AGENT_FILE.trim()):void 0;const persona=def?.persona||void 0;let bootPrompt=process.env.COTAL_OPENCODE_PROMPT?.trim()||void 0;let bootReady=false;const bootPending=()=>bootReady&&bootPrompt!==void 0;let sessionID;let execution;let primed=false;let briefed=false;const batch=new SurfacedBatch(agent);let ended;let started;let pendingMention=false;let submitting;const sessionReady=(async()=>{try{await modelReady;const res=await opencodeApi("/api/session",{method:"POST",body:JSON.stringify({title:`cotal:${config2.space}:${config2.name}`})},1e4);const id2=res.data?.id;if(id2){sessionID=id2;agent.setContextId(id2);process.stderr.write(`[cotal-session] ${id2}
|
|
182
|
+
`)}else log2("session.create returned no id")}catch(e){log2(`session.create failed: ${e.message}`)}return sessionID})();async function ensureSession(){return sessionID??await sessionReady}const safeStatus=async(status2,activity)=>{try{if(agent.connected)await agent.setStatus(status2,activity)}catch{}};async function drive(){if(execution||submitting||controller.signal.aborted)return;const id2=await ensureSession();if(!id2)return;if(execution||submitting||controller.signal.aborted)return;const boot=bootPending()?bootPrompt:void 0;const override=pendingMention?MENTION_NUDGE:void 0;if(bootPrompt!==void 0&&boot===void 0)return;const parts=[];let ids=[];let turnIds=[];const turnPeek=agent.peekPendingTurns();if(boot!==void 0){parts.push(boot)}else if(override!==void 0){parts.push(override)}else{const items=agent.peekInbox("automatic");if(items.length===0&&!turnPeek)return;if(items.length>0){ids=items.map(i=>i.recvKey);const inj=formatInjection(items);if(inj)parts.push(inj)}}if(turnPeek){turnIds=turnPeek.goalIds;parts.push(turnPeek.text)}const brief=briefed?void 0:agent.channelBriefing();if(brief)parts.unshift(brief);if(parts.length===0)return;const text2=parts.join("\n\n");const system=!primed&&persona?`${persona}
|
|
183
183
|
|
|
184
184
|
${ORIENTATION_BOOTSTRAP}
|
|
185
185
|
|
|
@@ -187,7 +187,7 @@ ${CHANNEL_GUIDANCE}
|
|
|
187
187
|
|
|
188
188
|
${MESH_FIRST_STEER}
|
|
189
189
|
|
|
190
|
-
${WORKFLOW_STEER}`:void 0;if(!batch.surface(ids))return;execution="submitted";briefed=true;submitting=(async()=>{try{await opencodeApi(`/api/session/${encodeURIComponent(id2)}/prompt`,{method:"POST",body:JSON.stringify({text:text2,...system?{system}:{}})},1e4);if(turnIds.length)agent.commitSurfacedTurns(turnIds);if(system)primed=true;if(boot!==void 0)bootPrompt=void 0}catch(e){if(execution==="submitted")execution=void 0;batch.abandon();log2(`drive failed: ${e.message}`)}finally{submitting=void 0}})();await submitting}function replayed(ev,mark=ended){const at=ev.durable;const seq=at?.seq;const ordered=typeof at?.aggregateID==="string"&&at.aggregateID.length>0&&typeof seq==="number"&&Number.isFinite(seq);if(!ordered)log2(`${ev.type} carries no durable log position; ignored`);return!ordered||at.aggregateID===mark?.aggregateID&&seq<=mark.seq}async function completeTurn(ev,settle){if(replayed(ev)||execution==="running"&&replayed(ev,started))return;ended=ev.durable;if(execution!=="running")return;execution=void 0;const carried=new Set(batch.keys);settle();await safeStatus("idle");void(async()=>{await submitting;if(ended!==ev.durable)return;if(bootPending()||agent.pendingWake(item=>carried.has(item.recvKey))>0)void drive()})()}agent.on("incoming",item=>{if(execution)return;const automatic=agent.inboxScope(item.recvKey)==="automatic";const directed=item.kind!=="channel"||item.mentionsMe;if(automatic&&(directed||agent.attention==="open"))void drive()});agent.on("mention-wake",()=>{void drive(
|
|
190
|
+
${WORKFLOW_STEER}`:void 0;if(!batch.surface(ids))return;execution="submitted";briefed=true;submitting=(async()=>{try{await opencodeApi(`/api/session/${encodeURIComponent(id2)}/prompt`,{method:"POST",body:JSON.stringify({text:text2,...system?{system}:{}})},1e4);if(turnIds.length)agent.commitSurfacedTurns(turnIds);if(system)primed=true;if(boot!==void 0)bootPrompt=void 0;else if(override!==void 0)pendingMention=false}catch(e){if(execution==="submitted")execution=void 0;batch.abandon();log2(`drive failed: ${e.message}`)}finally{submitting=void 0}})();await submitting}function replayed(ev,mark=ended){const at=ev.durable;const seq=at?.seq;const ordered=typeof at?.aggregateID==="string"&&at.aggregateID.length>0&&typeof seq==="number"&&Number.isFinite(seq);if(!ordered)log2(`${ev.type} carries no durable log position; ignored`);return!ordered||at.aggregateID===mark?.aggregateID&&seq<=mark.seq}async function completeTurn(ev,settle){if(replayed(ev)||execution==="running"&&replayed(ev,started))return;ended=ev.durable;if(execution!=="running")return;execution=void 0;const carried=new Set(batch.keys);settle();await safeStatus("idle");void(async()=>{await submitting;if(ended!==ev.durable)return;if(bootPending()||pendingMention||agent.pendingWake(item=>carried.has(item.recvKey))>0)void drive()})()}agent.on("incoming",item=>{if(execution)return;const automatic=agent.inboxScope(item.recvKey)==="automatic";const directed=item.kind!=="channel"||item.mentionsMe;if(automatic&&(directed||agent.attention==="open"))void drive()});agent.on("mention-wake",()=>{pendingMention=true;void drive()});agent.on("wake",()=>{if(!execution)void drive()});await ctx.session.hook("prompt",e=>{if(sessionID&&e.sessionID!==sessionID)return;const prefix=batch.inject();if(prefix!==void 0)e.prompt.text=`${prefix}
|
|
191
191
|
|
|
192
192
|
${e.prompt.text}`});await ctx.session.hook("model.request",e=>{if(e.kind!=="primary")return;void agent.setModel(`${e.model.providerID}/${e.model.id}`)});await ctx.tool.hook("execute.before",e=>{if(sessionID&&e.sessionID!==sessionID)return;void safeStatus("working",e.tool)});await ctx.tool.transform(ed=>{for(const t of buildCotalTools2(agent,config2))ed.add(t)});const eventLoop=(async()=>{try{for await(const ev of ctx.event.subscribe({signal:controller.signal})){const data=ev.data??{};switch(ev.type){case"session.created":{if(data.parentID)break;const id2=data.sessionID;if(id2&&!sessionID){sessionID=id2;agent.setContextId(id2)}break}case"session.execution.started":{if(sessionID&&data.sessionID!==sessionID||replayed(ev)||replayed(ev,started))break;execution="running";started=ev.durable;await safeStatus("working");break}case"session.execution.succeeded":{if(sessionID&&data.sessionID!==sessionID)break;await completeTurn(ev,()=>batch.ack());break}case"session.execution.failed":{if(sessionID&&data.sessionID!==sessionID)break;await completeTurn(ev,()=>batch.abandon());break}case"session.execution.interrupted":{if(sessionID&&data.sessionID!==sessionID)break;await completeTurn(ev,()=>batch.ack());break}case"permission.asked":{const p=data;if(!p.sessionID||!sessionID||p.sessionID===sessionID)await safeStatus("waiting",p.title);break}case"session.deleted":{const id2=data.info?.id;if(id2&&(!sessionID||id2===sessionID))await safeStatus("offline");break}}}}catch(e){if(!controller.signal.aborted)log2(`event loop ended: ${e.message}`)}})();void(async()=>{if(bootPrompt===void 0)return;const id2=await sessionReady;while(!controller.signal.aborted&&!agent.connected)await new Promise(r=>setTimeout(r,100).unref?.());if(controller.signal.aborted||bootPrompt===void 0)return;if(!id2){log2("initial prompt not submitted \u2014 this session was never created");bootPrompt=void 0;return}bootReady=true;await drive()})();return async()=>{controller.abort();await settleWithin(eventLoop,EVENT_QUIESCE_MS,"opencode 2.x event loop at teardown");await agent.stop()}}var plugin_entry_default={id:"cotal",server:cotal,setup:setupCotal};export{plugin_entry_default as default};
|
|
193
193
|
/*! Bundled license information:
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAuCA,OAAO,EAIL,SAAS,EAsBV,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,MAAM,EAAyB,MAAM,qBAAqB,CAAC;AAgBzE;;;0EAG0E;AAC1E,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAC5D;iEACiE;AACjE,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAChD;;gCAEgC;AAChC,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C;;0EAE0E;AAC1E,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElF;AACD,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnH;AA8BD;;;;GAIG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqB1G;AACD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,SAAS,CAQZ;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAa;IAIZ,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,MAAM,CAAS;gBAEM,KAAK,EAAE,SAAS;IAE7C,iDAAiD;IACjD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,0CAA0C;IAC1C,IAAI,IAAI,IAAI,SAAS,MAAM,EAAE,CAE5B;IAED;;;+EAG2E;IAC3E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO;IAQhC;;;qGAGiG;IACjG,MAAM,IAAI,MAAM,GAAG,SAAS;IAS5B;;8EAE0E;IAC1E,GAAG,IAAI,IAAI;IAKX;iDAC6C;IAC7C,OAAO,IAAI,IAAI;CAKhB;AAED,eAAO,MAAM,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAuCA,OAAO,EAIL,SAAS,EAsBV,MAAM,0BAA0B,CAAC;AAMlC,OAAO,KAAK,EAAE,MAAM,EAAyB,MAAM,qBAAqB,CAAC;AAgBzE;;;0EAG0E;AAC1E,eAAO,MAAM,eAAe,6BAA6B,CAAC;AAC1D,gGAAgG;AAChG,eAAO,MAAM,gBAAgB,8BAA8B,CAAC;AAC5D;iEACiE;AACjE,eAAO,MAAM,UAAU,wBAAwB,CAAC;AAChD;;gCAEgC;AAChC,eAAO,MAAM,QAAQ,sBAAsB,CAAC;AAC5C;;0EAE0E;AAC1E,wBAAgB,oBAAoB,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAElF;AACD,wBAAsB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAYnH;AA8BD;;;;GAIG;AACH,iBAAe,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,GAAG,SAAS,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAqB1G;AACD,OAAO,EAAE,YAAY,EAAE,CAAC;AAExB;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,SAAS,GAAG;IAClD,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,GAAG,SAAS,CAQZ;AAED;;;;;;;;GAQG;AACH,qBAAa,aAAa;IAIZ,OAAO,CAAC,QAAQ,CAAC,KAAK;IAHlC,OAAO,CAAC,OAAO,CAAgB;IAC/B,OAAO,CAAC,MAAM,CAAS;gBAEM,KAAK,EAAE,SAAS;IAE7C,iDAAiD;IACjD,IAAI,IAAI,IAAI,OAAO,CAElB;IAED,0CAA0C;IAC1C,IAAI,IAAI,IAAI,SAAS,MAAM,EAAE,CAE5B;IAED;;;+EAG2E;IAC3E,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO;IAQhC;;;qGAGiG;IACjG,MAAM,IAAI,MAAM,GAAG,SAAS;IAS5B;;8EAE0E;IAC1E,GAAG,IAAI,IAAI;IAKX;iDAC6C;IAC7C,OAAO,IAAI,IAAI;CAKhB;AAED,eAAO,MAAM,KAAK,EAAE,MA+xCnB,CAAC"}
|
package/dist/plugin2.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin2.d.ts","sourceRoot":"","sources":["../src/plugin2.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,sBAAsB,CAAC;AAgB7E;;;;8EAI8E;AAC9E,eAAO,MAAM,oBAAoB,QAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin2.d.ts","sourceRoot":"","sources":["../src/plugin2.ts"],"names":[],"mappings":"AA4BA,OAAO,KAAK,EAAE,gBAAgB,EAAkB,MAAM,sBAAsB,CAAC;AAgB7E;;;;8EAI8E;AAC9E,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAuC3C,4CAA4C;AAC5C,wBAAsB,UAAU,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,CAmW7F"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/connector-opencode",
|
|
3
3
|
"description": "Cotal connector for OpenCode: a native in-process plugin that joins a session to the mesh.",
|
|
4
|
-
"version": "0.133.
|
|
4
|
+
"version": "0.133.8",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"@cotal-ai/core": ">=0.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@cotal-ai/connector-core": "0.133.
|
|
25
|
-
"@cotal-ai/core": "0.133.
|
|
24
|
+
"@cotal-ai/connector-core": "0.133.8",
|
|
25
|
+
"@cotal-ai/core": "0.133.8",
|
|
26
26
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
27
27
|
"@nats-io/transport-node": "^3.4.0",
|
|
28
28
|
"@opencode-ai/plugin": "^1.16.2",
|