@opencode/console 0.1.2 → 0.1.3
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/chunk-0752rr1w.js +1 -0
- package/chunk-11wqcgnn.js +2 -0
- package/{chunk-b02r286p.js → chunk-1z17cm3w.js} +2 -2
- package/chunk-38zs2jre.js +1 -0
- package/chunk-3p7x3f0s.js +1 -0
- package/chunk-5a8bvcgq.js +15 -0
- package/chunk-6fqhbptf.js +1 -0
- package/chunk-6hmr86q5.js +3 -0
- package/{chunk-wd4mfvqy.js → chunk-6xs4y82y.js} +2 -2
- package/{chunk-rx6cjbq2.js → chunk-7qa618ad.js} +55 -55
- package/chunk-82p6vmpy.js +1 -0
- package/chunk-9dgq3xc0.js +32 -0
- package/chunk-9zpe1ry1.js +2 -0
- package/chunk-b4fde357.js +2 -0
- package/chunk-b6azftzw.js +254 -0
- package/chunk-bcmj4f7y.js +2 -0
- package/chunk-cd4h496v.js +2 -0
- package/chunk-g9f1r3v3.js +1 -0
- package/chunk-gcqbk8bn.js +149 -0
- package/chunk-ghvsrvdw.js +1 -0
- package/chunk-jpqmm6pm.js +2 -0
- package/chunk-jxh84gfh.js +1 -0
- package/chunk-kd1hjfpe.js +1 -0
- package/{chunk-dnepb5ke.js → chunk-m3m5harb.js} +2 -2
- package/chunk-mnjk01tj.js +1 -0
- package/chunk-nqk8n93s.js +1 -0
- package/chunk-qp7a49b3.js +1 -0
- package/chunk-r1adn0ka.js +11 -0
- package/chunk-tamzaefd.js +1 -0
- package/chunk-x65p26st.js +2 -0
- package/chunk-yb3fn5r1.js +2 -0
- package/{chunk-jem7z938.js → chunk-z5mqjw9r.js} +2 -2
- package/dsh-plugin.js +1 -1
- package/index.js +50 -50
- package/package.json +1 -1
- package/pi-extension.js +2 -2
- package/chunk-0067hzw7.js +0 -11
- package/chunk-0trayd9n.js +0 -2
- package/chunk-37whdg3n.js +0 -1
- package/chunk-6bc9ezw6.js +0 -1
- package/chunk-71rwyxw2.js +0 -2
- package/chunk-78cwb109.js +0 -162
- package/chunk-7k3ymrp6.js +0 -254
- package/chunk-83pr45e8.js +0 -1
- package/chunk-96f5c0tj.js +0 -2
- package/chunk-ak1n0cs7.js +0 -2
- package/chunk-cdc5arvh.js +0 -1
- package/chunk-et9y1sb5.js +0 -2
- package/chunk-g9bke322.js +0 -1
- package/chunk-gvywgb0d.js +0 -1
- package/chunk-gxedprvk.js +0 -32
- package/chunk-kpp48ne0.js +0 -1
- package/chunk-ktx666b5.js +0 -2
- package/chunk-m3n97pxp.js +0 -1
- package/chunk-n5bt7jzp.js +0 -3
- package/chunk-px1nqkzb.js +0 -2
- package/chunk-sbkpkav3.js +0 -1
- package/chunk-t8p1svd4.js +0 -1
- package/chunk-tx5wws16.js +0 -2
- package/chunk-vy3ahcaj.js +0 -2
- package/chunk-w6kmmxmz.js +0 -1
- package/chunk-wkrya350.js +0 -1
- package/chunk-ysgtje2z.js +0 -1
- package/chunk-zgcspk2g.js +0 -1
package/chunk-kpp48ne0.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{sr,is,xt,ir,Le,fi,as}from"./chunk-et9y1sb5.js";import"./chunk-rx6cjbq2.js";import"./chunk-71rwyxw2.js";import"./chunk-ktx666b5.js";import"./chunk-tx5wws16.js";import"./chunk-px1nqkzb.js";import"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{as as InProcess,Le as config,xt as decide,ir as decisions,is as refresh,fi as refreshStale,sr as session};
|
package/chunk-ktx666b5.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{zt}from"./chunk-px1nqkzb.js";import{Kt,J,be,W}from"./chunk-wd4mfvqy.js";import{jn}from"./chunk-tx5wws16.js";import{k,He,F,z,S,j,e,V,n,x,Z}from"./chunk-gxedprvk.js";var bs={};k(bs,{Info:()=>yi,MAX_AGE_MS:()=>xi,WorkspaceSnapshot:()=>bs,clear:()=>ys,models:()=>Sa,policies:()=>bi,read:()=>gs,stale:()=>mr,workspace:()=>hr,write:()=>xs});var xi=60000,yi=n({owner:e,organization:S(e),fetched:V,config:S(x(e,j)),status:S(n({message:e,url:S(e)}))}),c=z(Z(yi)),f=n({policies:S(j)}),s=x(e,n({models:S(x(e,j))}));function gs(o){return F(c(J(Kt(o))??""))}function xs(o,t){be(Kt(o),JSON.stringify(t))}function ys(o){W(Kt(o))}function mr(o,t){return t-o.fetched>=xi}function bi(o){if(!o)return;let t=o.config;if(!t)return o.status?void 0:[];let r=t.policies??F(z(f)(t.experimental))?.policies;if(r===void 0)return[];return F(z(zt.Policies)(r))}function hr(o,t){if(!o)return{policies:[]};return{organization:t?.organization??jn(o),policies:bi(t),status:t?.status}}function Sa(o){let t=o?.config?.providers;if(t===void 0)return 0;return Object.values(He(z(s)(t),()=>({}))).reduce((r,i)=>r+Object.keys(i.models??{}).length,0)}
|
|
2
|
-
export{xi,yi,gs,xs,ys,mr,bi,hr,Sa,bs};
|
package/chunk-m3n97pxp.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{xi,yi,gs,xs,ys,mr,bi,hr,Sa,bs}from"./chunk-ktx666b5.js";import"./chunk-tx5wws16.js";import"./chunk-px1nqkzb.js";import"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{yi as Info,xi as MAX_AGE_MS,bs as WorkspaceSnapshot,ys as clear,Sa as models,bi as policies,gs as read,mr as stale,hr as workspace,xs as write};
|
package/chunk-n5bt7jzp.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import"./chunk-dnepb5ke.js";import"./chunk-gvywgb0d.js";import{Ot}from"./chunk-0trayd9n.js";import{ke,J,be,W}from"./chunk-wd4mfvqy.js";import{ye,Be}from"./chunk-tx5wws16.js";import{ur,yt,bt,pr,$n,oo,ms,mi,Qe,fn,_,at,fr,je,Xe,It,Tt,dn}from"./chunk-78cwb109.js";import"./chunk-px1nqkzb.js";import"./chunk-ktx666b5.js";import{$e}from"./chunk-71rwyxw2.js";import{Ct,cr,lr}from"./chunk-96f5c0tj.js";import{le}from"./chunk-ak1n0cs7.js";import{k,F,I,D,z,S,e,v,n,x,u,Ze,Z}from"./chunk-gxedprvk.js";var R={};k(R,{ClaudeCode:()=>R,hookArgs:()=>O,manifest:()=>E,manifestFile:()=>C,models:()=>H,paths:()=>X,refresh:()=>ee,remove:()=>ne});import{createHash as V}from"node:crypto";import{existsSync as b,rmSync as q}from"node:fs";import Q from"node:os";import p from"node:path";function X(t=process.env,o=Q.homedir()){let s=t.CLAUDE_CONFIG_DIR?.trim(),i=s?p.resolve(s):p.join(o,".claude");return{config:i,settings:p.join(i,"settings.json"),global:s?p.join(i,".claude.json"):p.join(o,".claude.json"),skills:p.join(i,"skills"),memory:p.join(i,"CLAUDE.md")}}function H(t){let o=Ct(t),s=lr(o);if(o.length===0||s===void 0)return;let i=(r)=>r.provider==="opencode"?r.id:`${r.provider}/${r.id}`,a=(...r)=>i(cr(o,...r));return{baseURL:`${s}/anthropic`,options:o.map((r)=>({model:i(r),label:at(r.entry.name)??r.id,...r.provider==="opencode"||r.providerName===void 0?{}:{description:r.providerName}})),tiers:{opus:a("opus","sonnet","haiku"),sonnet:a("sonnet","opus","haiku"),haiku:a("haiku","sonnet","opus")}}}var Y=n({baseURL:e,options:u(n({model:e,label:e,description:S(e)})),tiers:n({opus:e,sonnet:e,haiku:e})}),P=n({paths:n({config:e,settings:e,global:e,skills:e,memory:e}),command:u(e),harness:S(e),...ur,servers:u(e),skills:x(e,e),memoryCreated:v,created:S(n({settings:v,global:v})),providers:S(e),models:S(Ze(Y))}),C=(t)=>p.join(t.data,"claude-code.json");function E(t){let o=C(t),s=J(o);if(s===void 0)return;let i=F(z(Z(P))(s));if(!i)throw Error(`${o} can't be read, so Claude Code was left as it is. Delete it and run setup again.`);return i}var ee=D("ClaudeCode.refresh")(function*(t,o){let s=E(t),i=o??s;if(!i)return;let a=yield*Be(t),r=a&&$e(t,ye(a));if(!a||!r?.config)return;let l=r.config,c=je(l),h=V("sha256").update(JSON.stringify(l.providers??null)).digest("hex"),g=!o&&s?.providers===h&&s.models!==void 0?s.models??void 0:H(yield*Ot(a)),A=yield*It(a,i.paths.skills,c.skills,s?.skills??{});return yield*ke(t,I(()=>oe(t,{paths:i.paths,command:i.command,harness:o?o.harness:s?.harness,models:g,servers:Object.fromEntries(Object.entries(Xe(l)).map(([w,f])=>[w,{url:f.url,gateway:f.headers!==void 0}])),instructions:c.instructions,skills:c.skills,bundles:A,providers:h,explicit:o!==void 0})))});function ne(t){let o=E(t);if(!o)return!1;let s=yt(o.paths.settings),i=yt(o.paths.global),a=J(o.paths.memory),r=o.created??{settings:!b(Qe(o.paths.settings)),global:!b(Qe(o.paths.global))};if(s)if(Object.keys(o.originals).forEach((l)=>$n(s,l,o)),B(s,void 0),G(s),Object.keys(s).length===0&&r.settings)W(o.paths.settings);else bt(o.paths.settings,s);if(i){let l=_(i.mcpServers);if(o.servers.forEach((c)=>delete l[c]),Object.keys(l).length===0)delete i.mcpServers;else i.mcpServers=l;if(Object.keys(i).length===0&&r.global)W(o.paths.global);else bt(o.paths.global,i,384)}return Object.keys(o.skills).forEach((l)=>q(p.join(o.paths.skills,l),{recursive:!0,force:!0})),dn(o.paths.memory,a,[],o.memoryCreated),[o.paths.settings,o.paths.global].forEach((l)=>W(Qe(l))),W(C(t)),!0}var O=["hook","claude-code"],T="x-opencode-plugin";function oe(t,o){let s=E(t),i=s===void 0,a=b(o.paths.settings),r=b(o.paths.global),l=yt(o.paths.settings)??{},c=yt(o.paths.global)??{},h=J(o.paths.memory),M=s?.created??{settings:!a,global:!r},g=[];if(i)[o.paths.settings,o.paths.global].forEach(fn);let{originals:A,written:w}=pr(l,te(o),s,o.explicit);B(l,o.models?`${T}: opencode-console/${le}`:void 0),G(l);let f=_(l.hooks);se(o.command).forEach(([d,y])=>{f[d]=[...Array.isArray(f[d])?f[d]:[],y]}),l.hooks=f;let L=new Set(s?.servers??[]),m=_(c.mcpServers);L.forEach((d)=>{if(!(d in o.servers))delete m[d]});let j=Object.entries(o.servers).flatMap(([d,y])=>{if(y.url===void 0||!/^[a-z0-9_-]+$/i.test(d))return[];if(d in m&&!L.has(d))return g.push(d),[];return m[d]={type:"http",url:y.url,...y.gateway?{headersHelper:fr([...o.command,"mcp-headers",d])}:{}},[d]});if(Object.keys(m).length>0)c.mcpServers=m;else delete c.mcpServers;if(bt(o.paths.settings,l,384),r||j.length>0)bt(o.paths.global,c,384);let U=Tt(o.paths.skills,o.skills,o.bundles,s?.skills??{});g.push(...U.skipped);let N=U.skills,K=dn(o.paths.memory,h,o.instructions,s?.memoryCreated??!1);return be(C(t),JSON.stringify(P.make({paths:o.paths,command:[...o.command],...o.harness===void 0?{}:{harness:o.harness},originals:A,written:w,servers:j,skills:N,memoryCreated:K,created:M,providers:o.providers,models:o.models??null}))),{models:o.models,servers:j,skills:Object.keys(N),instructions:o.instructions.length,skipped:g}}function te(t){let o=t.harness===void 0?{}:{"env.OPENCODE_CONSOLE_HARNESS":t.harness};if(!t.models)return o;return{...o,apiKeyHelper:fr([...t.command,"token"]),"env.ANTHROPIC_BASE_URL":t.models.baseURL,"env.ANTHROPIC_DEFAULT_OPUS_MODEL":t.models.tiers.opus,"env.ANTHROPIC_DEFAULT_SONNET_MODEL":t.models.tiers.sonnet,"env.ANTHROPIC_DEFAULT_HAIKU_MODEL":t.models.tiers.haiku,modelPicker:{options:t.models.options,replaceBuiltInOptions:!0}}}function B(t,o){let s=oo(t,"env.ANTHROPIC_CUSTOM_HEADERS"),a=[...(typeof s==="string"?s:"").split(`
|
|
2
|
-
`).filter((r)=>r.trim()!==""&&!r.toLowerCase().startsWith(`${T}:`)),...o===void 0?[]:[o]];if(a.length>0)ms(t,"env.ANTHROPIC_CUSTOM_HEADERS",a.join(`
|
|
3
|
-
`));else if(s!==void 0)mi(t,"env.ANTHROPIC_CUSTOM_HEADERS")}function se(t){let o={type:"command",command:t[0],args:[...t.slice(1),...O]},s={...o,timeout:30,onFailure:"block"};return[["PreToolUse",{matcher:"*",hooks:[s]}],["UserPromptSubmit",{hooks:[s]}],["UserPromptExpansion",{hooks:[s]}],["SessionStart",{hooks:[{...o,timeout:10}]}]]}function G(t){let o=_(t.hooks);if(Object.entries(o).forEach(([s,i])=>{if(!Array.isArray(i))return;let a=i.flatMap((r)=>{let l=_(r).hooks;if(!Array.isArray(l))return[r];let c=l.filter((h)=>!re(h));if(c.length===l.length)return[r];return c.length===0?[]:[{..._(r),hooks:c}]});if(a.length===0)delete o[s];else o[s]=a}),Object.keys(o).length===0)delete t.hooks;else t.hooks=o}function re(t){let o=_(t).args;return Array.isArray(o)&&o.slice(-O.length).join(" ")===O.join(" ")}export{R as ClaudeCode,O as hookArgs,E as manifest,C as manifestFile,H as models,X as paths,ee as refresh,ne as remove};
|
package/chunk-px1nqkzb.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{A,U,Vt,Kn,r,kn,On,Xn,xe,b,st,zr,qt,de,Kr,z,Ve,S,Te,d,na,ln,j,e,V,v,n,x,Pn,u,Wr,w,B,Ze,nr,ra,re,oa,h,ii,kt,Ye,Oe,rr,mt,sa,Jr,Ht,Q,ai,aa,Rn,jo,q,Mn}from"./chunk-gxedprvk.js";var wo=Object.defineProperty,Ro=(o)=>o;function Lo(o,i){this[o]=Ro.bind(null,i)}var Ne=(o,i)=>{for(var p in i)wo(o,p,{get:i[p],enumerable:!0,configurable:!0,set:Lo.bind(i,p)})};var m=Q.check(sa(0)),g=Q.check(Jr(0)),bn=e.pipe(re("RelativePath"),de({identifier:"RelativePath"})),M=e.pipe(re("AbsolutePath"),de({identifier:"AbsolutePath"})),t=(o)=>Ve(o).pipe(h(S(Te(o)),{decode:xe({strict:!1}),encode:st(Vt((i)=>i!==void 0))})),Uo=(o,i)=>Object.defineProperties(o,Object.getOwnPropertyDescriptors(i)),s=(o)=>(i)=>Uo(i,o(i)),vn=mt.pipe(h(Rn,{decode:b((o)=>On(o)),encode:b((o)=>Xn(o))}));var To=26,Fo="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",ze=0,pe=0;function y(){return $e(!1)}function je(){return $e(!0)}function $e(o,i=Date.now()){if(i!==ze)ze=i,pe=0;pe++;let p=BigInt(i)*0x1000n+BigInt(pe),f=o?~p:p,D=Array.from({length:6},(I,Po)=>Number(f>>BigInt(40-8*Po)&0xffn).toString(16).padStart(2,"0")).join(""),k=crypto.getRandomValues(new Uint8Array(To-12));return D+Array.from(k,(I)=>Fo[I%62]).join("")}var Ke=e.pipe(re("Project.ID"),de({identifier:"Project.ID"}),s((o)=>({global:o.make("global")})));var ce=e.check(rr("wrk")).pipe(re("Workspace.ID"),de({identifier:"Workspace.ID"}),s((o)=>{let i=()=>o.make("wrk_"+y());return{ascending:(p)=>{if(!p)return i();return o.make(p)},create:i}}));var Ge=n({directory:M,workspaceID:t(ce)}).annotate({identifier:"Location.Ref"}),qn=n(qt(Ge.fields,["workspaceID"])).annotate({identifier:"Location.PublicRef"});class Je extends q("Location.Info")({directory:M,workspaceID:t(ce),project:n({id:Ke,directory:M,canonical:M})}){}var zn=n(qt(Je.fields,["workspaceID"])).annotate({identifier:"Location.PublicInfo"});var _o=e.check(rr("evt_")).pipe(re("Event.ID"),de({identifier:"Event.ID"}),s((o)=>({create:()=>o.make("evt_"+y())}))),Bo=Q.check(Jr(0)).pipe(re("Event.Seq"),de({identifier:"Event.Seq"})),Oo=Q.check(Jr(1)).pipe(re("Event.Version"),de({identifier:"Event.Version"})),Hn=n({aggregateID:e,seq:Bo,version:Oo});function c(o){let i=n(o.schema);return n({id:_o,created:mt,metadata:t(x(e,j)),type:d(o.type),location:t(Ge),data:i}).annotate({identifier:o.identifier??o.type}).pipe(s(()=>({type:o.type,durability:"ephemeral",durable:void 0,data:i})))}function l(...o){return Object.freeze(o)}var me=e.check(rr("ses")).pipe(re("SessionID"),de({identifier:"Session.ID"}),s((o)=>({create:()=>o.make("ses_"+je())})));var et=e.check(rr("per")).pipe(re("Permission.ID"),de({identifier:"Permission.ID"}),s((o)=>({create:(i)=>o.make(i??"per_"+y())}))),No=w([n({type:d("tool"),messageID:e,id:e})]).annotate({identifier:"Permission.Source"}),qo={sessionID:me,action:e,resources:u(e),save:u(e).pipe(t),metadata:x(e,j).pipe(t),source:No.pipe(t),message:e.pipe(t)},zo=n({id:et,...qo}).annotate({identifier:"Permission.Request"}),Vo=B(["once","always","reject"]).annotate({identifier:"Permission.Reply"}),Qe=c({type:"permission.asked",schema:zo.fields}),Xe=c({type:"permission.replied",schema:{sessionID:me,requestID:et,reply:Vo}}),lr={Asked:Qe,Replied:Xe,Definitions:l(Qe,Xe)},$o=B(["allow","deny","ask"]).annotate({identifier:"Permission.Effect"}),Ko=n({action:e,resource:e,effect:$o}).annotate({identifier:"Permission.Rule"}),tt=u(Ko).annotate({identifier:"Permission.Ruleset"});var qe=e.pipe(re("Integration.ID"),de({identifier:"Integration.ID"})),E=e.pipe(re("Integration.MethodID"),de({identifier:"Integration.MethodID"}));var N=e.pipe(re("Credential.ID"),de({identifier:"Credential.ID"}),s((o)=>({create:()=>o.make("cred_"+y())}))),ot=c({type:"credential.updated",schema:{}}),it=c({type:"credential.switched",schema:{integrationID:qe,credentialID:Ze(N)}}),yr={Updated:ot,Switched:it,Definitions:l(ot,it)},Go=n({type:d("oauth"),methodID:E,refresh:e,access:e,expires:g,metadata:t(x(e,j))}).annotate({identifier:"Credential.OAuth"}),Yo=n({type:d("key"),key:e,metadata:t(x(e,j))}).annotate({identifier:"Credential.Key"}),Jo=n({type:d("external"),methodID:E,metadata:t(x(e,j))}).annotate({identifier:"Credential.External"}),nt=w([Go,Yo,Jo]).pipe(Ye("type")).annotate({identifier:"Credential.Value"}),Ir=n({id:N,integrationID:qe,label:e,active:v,value:nt}).annotate({identifier:"Credential.Entry"}),br=n({id:t(N),integrationID:qe,label:t(e),value:nt,activate:t(v)}).annotate({identifier:"Credential.CreateInput"});var at=n({status:B(["needs_auth"]),message:e,url:t(e)}).annotate({identifier:"Connection.Status"}),Ho=n({type:d("credential"),id:N,label:e,method:B(["key","oauth","external"]),status:t(at)}).annotate({identifier:"Connection.CredentialInfo"}),Qo=n({type:d("env"),name:e,status:t(at)}).annotate({identifier:"Connection.EnvInfo"}),pt=w([Ho,Qo]).pipe(Ye("type")).annotate({identifier:"Connection.Info"});var Xo=e.check(rr("frm_")).pipe(re("Form.ID"),de({identifier:"Form.ID"})),ge=Xo.pipe(s((o)=>({create:(i)=>o.make(i??"frm_"+y())}))),Zo=x(e,j).annotate({identifier:"Form.Metadata"}),ft=n({value:e,label:e,description:e.pipe(t)}).annotate({identifier:"Form.Option"}),ei=n({key:e,op:B(["eq","neq"]),value:w([e,V,v])}).annotate({identifier:"Form.When"}),_={key:e,title:e.pipe(t),description:e.pipe(t),required:v.pipe(t),hidden:v.pipe(t).annotate({description:"Skip the interactive authentication prompt and use the default unless an answer is supplied"}),when:u(ei).pipe(t)},ti=n({..._,type:d("string"),format:B(["email","uri","date","date-time"]).pipe(t),minLength:g.pipe(t),maxLength:g.pipe(t),pattern:e.pipe(t),placeholder:e.pipe(t),default:e.pipe(t),options:u(ft).pipe(t),custom:v.pipe(t)}).annotate({identifier:"Form.StringField"}),oi=n({..._,type:d("number"),minimum:V.pipe(t),maximum:V.pipe(t),default:V.pipe(t)}).annotate({identifier:"Form.NumberField"}),ni=n({..._,type:d("integer"),minimum:V.pipe(t),maximum:V.pipe(t),default:V.pipe(t)}).annotate({identifier:"Form.IntegerField"}),ri=n({..._,type:d("boolean"),default:v.pipe(t)}).annotate({identifier:"Form.BooleanField"}),si=n({..._,type:d("multiselect"),options:u(ft),minItems:g.pipe(t),maxItems:g.pipe(t),custom:v.pipe(t),default:u(e).pipe(t)}).annotate({identifier:"Form.MultiselectField"}),pi=n({key:e,type:d("external"),url:e,title:e.pipe(t),description:e.pipe(t)}).annotate({identifier:"Form.ExternalField"}),ci=w([ti,oi,ni,ri,si,pi]).pipe(Ye("type"),de({identifier:"Form.Field"})),K=Wr(ci).annotate({identifier:"Form.Fields"}),li={id:ge,sessionID:e,title:e,metadata:Zo.pipe(t)},ut=n({...li,fields:K}).annotate({identifier:"Form.Info"}),di=w([e,V,v,u(e)]).annotate({identifier:"Form.Value"}),Se=x(e,di).annotate({identifier:"Form.Answer"}),mi=w([n({status:d("pending")}),n({status:d("answered"),answer:Se}),n({status:d("cancelled"),message:e.pipe(t)})]).pipe(Ye("status")).annotate({identifier:"Form.State"}),Rr=n({...ut.fields,state:mi}).annotate({identifier:"Form.Detail"}),Lr=n({answer:Se}).annotate({identifier:"Form.Reply"}),ct=c({type:"form.created",schema:{form:ut}}),lt=c({type:"form.replied",schema:{id:ge,sessionID:e,answer:Se}}),dt=c({type:"form.cancelled",schema:{id:ge,sessionID:e}}),Ar={Created:ct,Replied:lt,Cancelled:dt,Definitions:l(ct,lt,dt)};var he=qe,ye=E,fi=n({id:ye,type:d("oauth"),label:e,form:t(K)}).annotate({identifier:"Integration.OAuthMethod"}),ui=n({id:ye,type:d("command"),label:e,command:u(e)}).annotate({identifier:"Integration.CommandMethod"}),gi=n({type:d("key"),label:t(e),form:t(K)}).annotate({identifier:"Integration.KeyMethod"}),Si=n({id:ye,type:d("external"),label:e,form:t(K)}).annotate({identifier:"Integration.ExternalMethod"}),hi=n({type:d("env"),names:u(e)}).annotate({identifier:"Integration.EnvMethod"}),xi=w([fi,ui,gi,Si,hi]).pipe(Ye("type")).annotate({identifier:"Integration.Method"}),St=c({type:"integration.updated",schema:{}}),qr={Updated:St,Definitions:l(St)},jr=n({id:he,name:e,metadata:t(x(e,ln))}).annotate({identifier:"Integration.Ref"}),Vr=n({id:he,name:e,metadata:t(x(e,ln)),methods:u(xi),connections:u(pt)}).annotate({identifier:"Integration.Info"}),ht=e.pipe(re("Integration.AttemptID"),de({identifier:"Integration.AttemptID"}),s((o)=>({create:()=>o.make("con_"+y())}))),C=n({created:V,expires:V});class yi extends q("Integration.Attempt")({attemptID:ht,url:e,instructions:e,mode:B(["auto","code"]),paste:Ve(d(!0)),time:C}){}var $r=w([n({status:d("pending"),time:C}),n({status:d("complete"),time:C}),n({status:d("failed"),message:e,time:C}),n({status:d("expired"),time:C})]).pipe(Ye("status")).annotate({identifier:"Integration.AttemptStatus"}),Gr=n({attemptID:ht,time:C}).annotate({identifier:"Integration.CommandAttempt"}),Yr=w([n({status:d("pending"),message:t(e),time:C}),n({status:d("complete"),time:C}),n({status:d("failed"),message:e,time:C}),n({status:d("expired"),time:C})]).pipe(Ye("status")).annotate({identifier:"Integration.CommandAttemptStatus"});var yt=w([B(["reasoning","reasoning_content","reasoning_text"]),e]).annotate({identifier:"Model.ReasoningField"}),It=B(["max_completion_tokens","max_tokens"]).annotate({identifier:"Model.MaxTokensField"}),bt=B(["assets","state","root"]).annotate({identifier:"Model.MediaInput"}),Ii=B(["anthropic","alibaba"]).annotate({identifier:"Model.CacheFormat"}),O=n({reasoningField:yt.pipe(t),requireReasoning:v.pipe(t),maxTokensField:It.pipe(t),requireFinishReason:v.pipe(t),requireAssistantAfterTool:v.pipe(t),supportsPromptCacheKey:v.pipe(t),streamUsage:v.pipe(t),cacheFormat:Ii.pipe(t),supportsThinkingBlockBinding:v.pipe(t),supportsEffortUpdates:v.pipe(t),mediaInput:bt.pipe(t)}).annotate({identifier:"Model.Compatibility"}),G=n(qt(O.fields,["supportsThinkingBlockBinding","supportsEffortUpdates"])).annotate({identifier:"Provider.Compatibility"});var P=e.pipe(re("Provider.ID"),de({identifier:"Provider.ID"}),s((o)=>({opencode:o.make("opencode"),anthropic:o.make("anthropic"),openai:o.make("openai"),google:o.make("google"),googleVertex:o.make("google-vertex"),githubCopilot:o.make("github-copilot"),claudeAgent:o.make("claude-agent"),amazonBedrock:o.make("amazon-bedrock"),azure:o.make("azure"),openrouter:o.make("openrouter"),mistral:o.make("mistral"),gitlab:o.make("gitlab")}))),vt=c({type:"provider.updated",schema:{}}),ca={Updated:vt,Definitions:l(vt)},Ct=e,vi=B(["auto","enabled","disabled"]),Ci=w([n({type:d("summary")}),n({type:d("native")})]).pipe(Ye("type")).annotate({identifier:"Provider.Compaction"}),Di=B(["http","websocket"]).annotate({identifier:"Provider.Transport"}),ki=na([V,B(["ms","s","m","h","d"])]).check(Oe(/^\d+(ms|s|m|h|d)$/)).annotate({identifier:"Provider.CacheTTL"}),Mi=w([v,n({interval:w([d("auto"),e]).pipe(t).annotate({description:`Duration such as "4 minutes", or "auto" for 90% of the model's cache.ttl`}),duration:e.pipe(t).annotate({description:'Duration such as "30 minutes"'})})]).annotate({identifier:"Provider.CacheWarming"}),Pi=n({ttl:ki.pipe(t),warming:Mi.pipe(t)}).annotate({identifier:"Provider.Cache"}),wi=B(["zstd","gzip","none"]).annotate({identifier:"Provider.Encoding"}),Ie=w([mt,d(!1)]).pipe(t),Y=Pn(n({timeout:Ie,headerTimeout:Ie,chunkTimeout:Ie,compaction:Ci.pipe(t),cache:Pi.pipe(t),transport:Di.pipe(t),encoding:wi.pipe(t)}),[x(e,ln)]).annotate({identifier:"Provider.Settings"}),Ri={settings:Y.pipe(t),headers:x(e,e).pipe(t),body:x(e,ln).pipe(t)},la=n({settings:Y.pipe(ii(r({}))),headers:x(e,e),body:x(e,ln)}).annotate({identifier:"Provider.Request"}),da=n({id:P,canonical:P.pipe(t),integrationID:he.pipe(t),name:e,activation:vi,package:Ct,compatibility:G.pipe(t),...Ri}).annotate({identifier:"Provider.Info"}).pipe(s(()=>({empty:(o)=>({id:o,name:o,activation:"auto",package:""})})));var ua=mt.pipe(re("Money.USD"),de({identifier:"Money.USD"}),s((o)=>({zero:o.make(0)}))),R=mt.pipe(re("Money.USDPerMillionTokens"),de({identifier:"Money.USDPerMillionTokens"}),s((o)=>({zero:o.make(0)})));var L=e.pipe(re("Model.ID")),Dt=c({type:"model.updated",schema:{}}),ba={Updated:Dt,Definitions:l(Dt)},T=e.pipe(re("Model.VariantID")),Li=n({id:L,providerID:P,variant:T.pipe(t)}).annotate({identifier:"Model.Ref"}).pipe(s((o)=>({parse:(i)=>{let p=i.indexOf("/");if(p<=0)throw Error(`Invalid model reference: ${i}`);let f=i.slice(0,p),D=i.indexOf("#",p+1),k=i.slice(p+1,D===-1?void 0:D),I=D===-1?void 0:i.slice(D+1);if(!k||f.includes("#")||I!==void 0&&(!I||I.includes("#")))throw Error(`Invalid model reference: ${i}`);return o.make({providerID:P.make(f),id:L.make(k),...I?{variant:T.make(I)}:{}})}})));var ve=e.pipe(re("Model.Family")),Ce=w([B(["chat","decision","image"]),e]).annotate({identifier:"Model.Type"}),H=Pn(n(zr(Y.schema.fields,["compaction","cache","encoding"])),[x(e,ln)]).annotate({identifier:"Model.Settings"}),Ai=Pn(n(qt(H.schema.fields,["cache"])),H.records).annotate({identifier:"Model.VariantSettings"}),Mt={settings:H.pipe(t),headers:x(e,e).pipe(t),body:x(e,ln).pipe(t)},X=n({tools:v,input:u(e),output:u(e),temperature:v.pipe(t)}).annotate({identifier:"Model.Capabilities"}).pipe(s(()=>({default:()=>({tools:!0,input:["text","image"],output:["text"]})}))),Ui=n({tier:n({type:kt("context"),size:Q}).pipe(t),input:R,output:R,cache:n({read:R,write:R})}).annotate({identifier:"Model.Cost"}),Ti=n({id:T,...Mt,settings:Ai.pipe(t)}).annotate({identifier:"Model.Variant"}),va=n({id:L,modelID:L,providerID:P,canonical:P.pipe(t),type:Ce.pipe(t),family:ve.pipe(t),name:e,compatibility:O.pipe(t),package:Ct.pipe(t),...Mt,capabilities:X,variants:u(Ti),time:n({released:mt}),cost:u(Ui),status:B(["alpha","beta","deprecated","active"]),enabled:v,limit:n({context:Q,input:Q.pipe(t),output:Q})}).annotate({identifier:"Model.Info"}).pipe(s(()=>({default:(o,i)=>({id:i,modelID:i,providerID:o,name:i,capabilities:X.default(),variants:[],time:{released:0},cost:[],status:"active",enabled:!0,limit:{context:200000,output:32000}})})));var Fi=P.check(Oe(/^[^/#]+$/u)),Ei=L.check(Oe(/^[^#]+$/u)),_i=T.check(Oe(/^[^#]+$/u)),Pt=n({providerID:Fi,model:Ei,variant:_i.pipe(t)}),Bi=e.check(Oe(/^[^/#]+\/[^#]+(?:#[^#]+)?$/u)),Z=w([Bi,Pt]).pipe(h(Pt,{decode:b((o)=>typeof o==="string"?Oi(o):o),encode:xe({strict:!1})})).annotate({identifier:"Config.ModelSelection"});function Oi(o){let i=Li.parse(o);return{providerID:i.providerID,model:i.id,...i.variant?{variant:i.variant}:{}}}var Wi=Pn(n(Y.schema.fields),[x(e,nr(Mn))]).annotate({identifier:"Config.Provider.Settings"}),ke=Pn(n(H.schema.fields),[x(e,nr(Mn))]).annotate({identifier:"Config.Model.Settings"}),Rt=x(e,Mn),Me={settings:Wi.pipe(t),headers:x(e,e).pipe(t),body:Rt.pipe(t)},wt={settings:ke.pipe(t),headers:x(e,e).pipe(t),body:Rt.pipe(t)};class Lt extends q("Config.Provider.Request")({headers:Me.headers,body:Me.body}){}class At extends q("Config.Model.Cost.Cache")({read:R.pipe(t),write:R.pipe(t)}){}class Pe extends q("Config.Model.Cost")({tier:n({type:d("context"),size:Q}).pipe(t),input:R,output:R,cache:At.pipe(t)}){}class Ut extends q("Config.Model.Limit")({context:Q.pipe(t),input:Q.pipe(t),output:Q.pipe(t)}){}var Ni=w([n({supported:d(!1)}),n({supported:d(!0),toggle:v.pipe(t),effort:e.pipe(u,t),budget:n({min:Q.pipe(t),max:Q.pipe(t)}).pipe(t)})]).annotate({identifier:"Config.Model.Reasoning"});class Tt extends q("Config.Model")({modelID:L.pipe(t),type:Ce.pipe(t),family:ve.pipe(t),name:e.pipe(t),releaseDate:e.check(Oe(/^\d{4}-\d{2}(-\d{2})?$/u)).annotate({description:"Release date as YYYY-MM-DD or YYYY-MM"}).pipe(t),compatibility:O.pipe(t),package:e.pipe(t),...wt,capabilities:X.mapFields((o)=>({tools:t(o.tools),input:t(o.input),output:t(o.output),temperature:o.temperature,reasoning:Ni.pipe(t)})).annotate({identifier:"Config.Model.Capabilities"}).pipe(t),variants:n({id:T,...wt,settings:Pn(n(qt(ke.schema.fields,["cache"])),ke.records).annotate({identifier:"Config.Model.VariantSettings"}).pipe(t)}).pipe(u,t),cost:w([Pe,Pe.pipe(u)]).pipe(t),disabled:v.pipe(t),limit:Ut.pipe(t)}){}class we extends q("Config.Provider")({canonical:P.pipe(t),name:e.pipe(t),env:e.pipe(u,t),package:e.pipe(t),compatibility:G.pipe(t),...Me,models:x(e,Tt).pipe(t)}){}var qi=e.check(Oe(/^#[0-9a-fA-F]{6}$/u));class Ft extends q("Config.Agent")({model:Z.pipe(t),request:Lt.pipe(t),system:e.pipe(t),description:e.pipe(t),mode:B(["subagent","primary","all"]).pipe(t),hidden:v.pipe(t),color:qi.pipe(oa(()=>kn),t),steps:m.pipe(t),disabled:v.pipe(t),permissions:tt.pipe(t)}){}class _t extends q("Config.Media.Image")({auto_resize:v.pipe(t),max_width:m.pipe(t),max_height:m.pipe(t),max_base64_bytes:m.pipe(t)}){}class Bt extends q("Config.Media")({image:_t.pipe(t)}){}class Wt extends q("Config.Compaction.Keep")({tokens:g.pipe(t)}){}var zi=e.check(Oe(/^([1-9]\d?(\.\d+)?)%$/u)).annotate({identifier:"Config.Compaction.Percent"});class Nt extends q("Config.Compaction")({auto:v.pipe(t),keep:Wt.pipe(t),buffer:w([zi,g]).pipe(t).annotate({description:`Room kept free below the model's context window before automatic compaction, as a share of the window from "1%" to "99%", such as "20%" to compact at 80% full. A token count is also accepted.`})}){}class $t extends q("Config.Command")({template:e,description:e.pipe(t),agent:e.pipe(t),model:Z.pipe(t),subagent:v.pipe(t),subtask:v.annotate({description:"Deprecated alias for subagent."}).pipe(t)}){}var ji={todo:"Enable the experimental todowrite tool.",background_compaction:"Enable experimental background compaction: summarize the conversation in the background as it nears the compaction threshold, so automatic compaction does not wait for the summary. Background summaries that are never used still cost tokens.",media_blob:"Store new session media once in a deduplicated blob table instead of inline in every message row.",schedules:"Enable experimental scheduled tasks that wake a session with a prompt.",artifacts:"Enable experimental artifacts backed by pluggable providers."};var Jt=B(["allow","deny"]),vs=B(["provider.use","tool.use","integration.connect","integration.use","mcp.use","skill.use","plugin.use","websearch.use"]),Yt=n({action:vs,resource:e,effect:Jt}),Vi=new Map([["mcp","mcp.use"],["skill","skill.use"],["plugin","plugin.use"]]),Re=Yt.pipe(h(Te(Yt),{decode:b((o)=>{if(o.action!=="integration.use")return o;let i=o.resource.indexOf(":"),p=i===-1?void 0:Vi.get(o.resource.slice(0,i));if(!p)return o;return{...o,action:p,resource:o.resource.slice(i+1)}}),encode:xe()}));class Qt extends q("ConfigExperimental.Info")({portable_shell_scanner:v.pipe(t).annotate({description:"Deprecated: the built-in shell permission scanner is now always enabled."}),all_flags:v.pipe(t).annotate({description:"Turn every feature flag on regardless of the build channel, like OPENCODE_FLAGS=all; explicit per-flag settings still win, and false is not a kill switch."}),...Kn(ji,(o)=>v.pipe(t).annotate({description:`${o} Defaults to on in local and dev builds and off in releases.`})),part_rows:v.pipe(t).annotate({description:"Write each assistant part as its own session_part row instead of rewriting the whole message on every event. Defaults to false."}),image_generate:w([v,n({model:Z.pipe(t).annotate({description:"Default model for the experimental_image_generate tool when the agent doesn't choose one, as providerID/modelID. Falls back to automatic selection when it isn't available."})})]).pipe(t).annotate({description:"Settings for the experimental_image_generate tool, which is offered while a connected provider has an image model."}),subagent_depth:g.pipe(t).annotate({description:"Maximum subagent nesting depth. Defaults to 1."}),location_idle_timeout:w([jo,d(!1)]).pipe(t).annotate({description:'How long a location can go without session activity before its services are unloaded. Running sessions and background jobs keep a location loaded. Set to false to never unload (default: "60 minutes")'}),policies:Re.pipe(u,t).annotate({description:"Deprecated: use top-level policies. Ordered policies controlling access to configured resources"})}){}class Zt extends q("Config.Formatter.Entry")({disabled:v.pipe(t),command:e.pipe(u,t),environment:x(e,e).pipe(t),extensions:e.pipe(u,t)}){}var $i=w([v,x(e,Zt)]);var Ki=n({disabled:d(!0)});class to extends q("Config.LSP.Server")({command:e.pipe(u),extensions:e.pipe(u,t),disabled:v.pipe(t),env:x(e,e).pipe(t),initialization:x(e,j).pipe(t)}){}var Gi=w([Ki,to]),Yi=w([v,x(e,Gi)]);class oe extends q("Mcp.TimeoutConfig")({startup:m.pipe(t).annotate({description:"Maximum time in milliseconds to establish and initialize the MCP server."}),catalog:m.pipe(t).annotate({description:"Maximum time in milliseconds to wait for MCP discovery requests such as tools/list and prompts/list."}),execution:m.pipe(t).annotate({description:"Maximum time in milliseconds to wait for MCP tool and prompt execution."})}){}var Le=B(["legacy","auto","2026-07-28"]).annotate({identifier:"Mcp.Protocol",description:'MCP protocol negotiation. "legacy" (default) opens with the initialize handshake and speaks protocol revisions up to 2025-11-25. "auto" probes for the 2026-07-28 revision and falls back to legacy when the server does not support it. "2026-07-28" requires that revision and fails otherwise.'});class Ae extends q("Mcp.LocalConfig")({type:d("local"),command:e.pipe(u),cwd:e.pipe(t).annotate({description:"Working directory for the MCP server process. Relative paths resolve from the workspace directory."}),environment:x(e,e).pipe(t),disabled:v.pipe(t),codemode:v.pipe(t).annotate({description:"Expose this server's tools through Code Mode. Defaults to true."}),timeout:oe.pipe(t),protocol:Le.pipe(t),pool:v.pipe(t).annotate({description:'Share one connection to this server across every directory that configures it identically, instead of one per directory. Only connections that negotiate the 2026-07-28 revision are shared; an unset "protocol" becomes "auto", and "legacy" never shares. Defaults to false.'})}){}class Ue extends q("Mcp.OAuthConfig")({client_id:e.pipe(t),client_secret:e.pipe(t),scope:e.pipe(t),callback_port:Q.check(Ht({minimum:1,maximum:65535})).pipe(t),redirect_uri:e.pipe(t),auth_server_metadata_url:e.pipe(t).annotate({description:"URL of the OAuth or OpenID Connect authorization server metadata document. Set when the MCP server does not publish protected resource metadata that names its authorization server."})}){}class Fe extends q("Mcp.RemoteConfig")({type:d("remote"),url:e,headers:x(e,e).pipe(t),oauth:w([Ue,d(!1)]).pipe(t),disabled:v.pipe(t),codemode:v.pipe(t).annotate({description:"Expose this server's tools through Code Mode. Defaults to true."}),timeout:oe.pipe(t),protocol:Le.pipe(t),pool:v.pipe(t).annotate({description:'Share one connection to this server across every directory that configures it identically, instead of one per directory. Only connections that negotiate the 2026-07-28 revision are shared; an unset "protocol" becomes "auto", and "legacy" never shares. Defaults to false.'})}){}var Ji=w([Ae,Fe]).pipe(Ye("type")),Hi=n({status:d("connected")}).annotate({identifier:"Mcp.Status.Connected"}),Qi=n({status:d("pending")}).annotate({identifier:"Mcp.Status.Pending"}),Xi=n({status:d("disabled")}).annotate({identifier:"Mcp.Status.Disabled"}),Zi=n({status:d("failed"),error:e}).annotate({identifier:"Mcp.Status.Failed"}),en=n({status:d("needs_auth"),error:e}).annotate({identifier:"Mcp.Status.NeedsAuth"}),tn=w([Hi,Qi,Xi,Zi,en]).pipe(Ye("status")),rs=n({name:e,status:tn,title:t(e),integrationID:t(qe)}).annotate({identifier:"Mcp.Server"}),on=n({server:e,name:e,uri:e,description:t(e),mimeType:t(e)}).annotate({identifier:"Mcp.Resource"}),nn=n({server:e,name:e,uriTemplate:e,description:t(e),mimeType:t(e)}).annotate({identifier:"Mcp.ResourceTemplate"}),as=n({resources:u(on),templates:u(nn)}).annotate({identifier:"Mcp.ResourceCatalog"}),rn=w([n({type:d("text"),uri:e,text:e,mimeType:t(e)}),n({type:d("blob"),uri:e,blob:e,mimeType:t(e)})]).pipe(Ye("type"),de({identifier:"Mcp.ResourceContentPart"})),ss=n({server:e,uri:e,contents:u(rn)}).annotate({identifier:"Mcp.ResourceContent"});var an=oe,ds=Ae,ms=Ue,fs=Fe,sn=Ji,us=Le;class Ee extends q("Config.MCP")({timeout:an.pipe(t),servers:x(e,sn).pipe(t)}){}class no extends q("Config.Plugin.Entry")({package:e,options:x(e,j).pipe(t)}){}var pn=w([e,no]),cn=pn.pipe(u);class ao extends q("Config.Reference.Git")({repository:e,branch:e.pipe(t),description:e.pipe(t),hidden:v.pipe(t)}){}class so extends q("Config.Reference.Local")({path:e,description:e.pipe(t),hidden:v.pipe(t)}){}var dn=w([e,ao,so]),mn=x(e,dn);var ie=e.pipe(re("WebSearch.ID"),de({identifier:"WebSearch.ID"})),Cs=n({id:ie,name:e}).annotate({identifier:"WebSearch.Provider"}),Ds=n({query:e,providerID:ie.pipe(t)}).annotate({identifier:"WebSearch.Input"}),fn=n({url:e,title:e.pipe(t),content:e.pipe(t),time:n({published:mt.pipe(t).annotate({description:"Publication time in milliseconds since the Unix epoch"})})}).annotate({identifier:"WebSearch.Result"});class un extends q("WebSearch.Response")({providerID:ie,results:u(fn)}){}var co=c({type:"websearch.updated",schema:{}}),ks={Updated:co,Definitions:l(co)};class mo extends q("ConfigWebSearch.Info")({provider:w([d("random").annotate({description:"Reuse a randomly selected provider until it is rate limited, then switch to another available provider."}),ie])}){}var gn=w([d(!1),mo]);class uo extends q("Config.ToolOutput")({max_lines:m.pipe(t),max_bytes:m.pipe(t)}){}class So extends q("Config.Watcher")({ignore:e.pipe(u,t)}){}class xo extends q("Config.Warming")({prompt:e.pipe(t).annotate({description:"Prompt sent for keep-alive requests"}),interval:w([d("auto"),jo]).pipe(t).annotate({description:`Idle time between keep-alive requests (default: "4 minutes"). "auto" uses 90% of the model's cache.ttl and skips models without one.`}),duration:jo.pipe(t).annotate({description:'Time after the last active request to keep a session warm (default: "30 minutes")'})}){}var Sn=w([v,xo]);var hn=n({directory:aa.pipe(ra(ai())).annotate({description:"Parent directory for new worktrees, relative to the project's primary checkout when not absolute"})}).annotate({identifier:"Config.Worktree"});class F extends q("Config.Info")({$schema:t(e).annotate({description:"JSON schema reference for configuration validation"}),shell:e.pipe(t).annotate({description:"Default shell to use for terminal and shell tool execution"}),model:Z.pipe(t).annotate({description:"Default model to use when no session or agent model is selected"}),default_agent:e.pipe(t).annotate({description:"Default primary agent to use when no session agent is selected"}),update:B(["disable","notify","auto"]).pipe(t).annotate({description:"Disable updates, notify when one is available, or install updates automatically"}),share:B(["manual","auto","disabled"]).pipe(t).annotate({description:"Control whether sessions may be shared manually, automatically, or not at all"}),enterprise:n({url:e.pipe(t)}).pipe(t).annotate({description:"Enterprise sharing service configuration"}),username:e.pipe(t).annotate({description:"Username displayed in conversations and used for telemetry identity"}),timezone:e.pipe(t).annotate({description:"IANA time zone for schedules, e.g. America/Los_Angeles. Defaults to the server's local zone"}),permissions:tt.pipe(t).annotate({description:"Ordered tool permission rules applied to agent tool use"}),policies:Re.pipe(u,t).annotate({description:"Ordered policies controlling access to providers, tools, and integrations"}),agents:x(e,Ft).pipe(t).annotate({description:"Named built-in agent overrides and custom agent definitions"}),snapshots:v.pipe(t).annotate({description:"Enable snapshots used for undo and revert behavior"}),watcher:So.pipe(t).annotate({description:"Filesystem watcher configuration"}),formatter:$i.pipe(t).annotate({description:"Enable built-in formatters or configure formatter overrides"}),lsp:Yi.pipe(t).annotate({description:"Enable built-in language servers or configure server overrides"}),media:Bt.pipe(t).annotate({description:"Media processing configuration"}),tool_output:uo.pipe(t).annotate({description:"Tool output truncation thresholds"}),mcp:Ee.pipe(t).annotate({description:"MCP server configuration"}),compaction:Nt.pipe(t).annotate({description:"Conversation compaction behavior"}),skills:e.pipe(u,t).annotate({description:"Additional paths or URLs to discover skills from"}),commands:x(e,$t).pipe(t).annotate({description:"Named slash command definitions"}),instructions:e.pipe(u,t).annotate({description:"Additional paths or URLs supplying ambient instructions"}),references:mn.pipe(t).annotate({description:"Named local directories or Git repositories available as external context"}),websearch:gn.pipe(t).annotate({description:"Web search provider selection"}),plugins:cn.pipe(t).annotate({description:"Ordered plugin enablement directives and external package declarations"}),worktree:hn.pipe(t).annotate({description:"Directory defaults for local worktree creation"}),warming:Sn.pipe(t).annotate({description:"Keep recently active sessions warm with transient model requests (default: false)"}),providers:x(e,we).pipe(t),experimental:Qt.pipe(t)}){}var ip=n({shell:Ze(e)}).annotate({identifier:"Config.Patch"});class ne extends q("Config.Document")({type:d("document"),path:M.pipe(t),info:F}){}class vo extends q("Config.Directory")({type:d("directory"),path:M}){}var np=w([ne,vo]).annotate({identifier:"Config.Entry"}),bo=c({type:"config.updated",schema:{}}),rp={Updated:bo,Definitions:l(bo)};var zt={};Ne(zt,{ConfigIntegration:()=>zt,Document:()=>Bn,Policies:()=>We,Remote:()=>Do,WellKnownDocument:()=>ae,make:()=>Mo,suppliers:()=>ko});var We=u(j).pipe(h(j,{decode:b((o)=>o.filter((i)=>{let p=z(n({action:e}))(i);if(U(p)&&!Kr(vs)(p.value.action))return!1;let f=z(n({effect:e}))(i);return A(f)||Kr(Jt)(f.value.effect)})),encode:xe({strict:!1})}),h(u(Re))),Do=n({providers:F.fields.providers,mcp:F.fields.mcp,policies:We.pipe(S),websearch:F.fields.websearch});class Bn extends ne.extend("Config.IntegrationDocument")({integrationID:qe,connection:pt,organization:S(e)}){}class ae extends ne.extend("Config.WellKnownDocument")({integrationID:qe}){}function ko(o){return new Map(o.filter((i)=>i instanceof ae).flatMap((i)=>Object.keys(i.info.providers??{}).map((p)=>[p,i.integrationID])))}function Mo(o){let i=o.info.mcp?.servers;return new Bn({type:"document",integrationID:o.integrationID,connection:o.connection,organization:o.organization,info:new F({providers:o.info.providers&&Object.fromEntries(Object.entries(o.info.providers).map(([p,f])=>[p,new we({...f,env:void 0,settings:Be(f.settings),models:f.models&&Object.fromEntries(Object.entries(f.models).map(([D,k])=>[D,{...k,settings:Be(k.settings),variants:k.variants?.map((I)=>({...I,settings:Be(I.settings)}))}]))})])),mcp:i&&new Ee({servers:Object.fromEntries(Object.entries(i).filter(([,p])=>p.type==="remote"))}),policies:o.info.policies,websearch:o.info.websearch})})}function Be(o){return o&&Object.fromEntries(Object.entries(o).filter(([i])=>!["apiKey","authToken","accessToken"].includes(i)))}
|
|
2
|
-
export{Ne,qe,vs,zt,Bn};
|
package/chunk-sbkpkav3.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ws,gr,xr,Si,vi,yr,qn,br,wi,Es,ks,io,Cs,Ot,ao,As,Is,Ts,Os,_s}from"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-dnepb5ke.js";export{_s as ConsoleClient,br as DeviceSignInFailed,xr as OAuth,qn as SignedOut,yr as SsoRequired,Es as authorize,gr as clientID,ao as codexModelsPath,ws as defaultServer,As as fetchCodexModels,Cs as fetchConfig,Ot as fetchModels,Is as fetchSkill,Ts as fetchSkillBlob,wi as headers,Os as normalizeServer,ks as refresh,io as revoke,Si as signedOutMessage,vi as ssoMessage};
|
package/chunk-t8p1svd4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ya,Xr,Xo,eo,Un,ui,es,pi,ts,Ln,ns,rs,to,pn,os,ba,ss}from"./chunk-0067hzw7.js";import"./chunk-96f5c0tj.js";import"./chunk-71rwyxw2.js";import"./chunk-78cwb109.js";import"./chunk-ktx666b5.js";import"./chunk-tx5wws16.js";import"./chunk-px1nqkzb.js";import"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{ss as DeepSeekHarness,Un as MCP_SERVICE,Xo as REALM,ui as Route,eo as SERVICE,Xr as TOKEN,Ln as Unreadable,ns as checks,pi as defaultModel,rs as invokedSkills,pn as manifest,to as manifestFile,ts as mcpConfig,ya as paths,os as refresh,ba as remove,es as routes};
|
package/chunk-tx5wws16.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{ws,xr,Es,ks,io,Os}from"./chunk-0trayd9n.js";import{gn,Kt,ke,J,be,W}from"./chunk-wd4mfvqy.js";import{k,F,ve,vt,I,G,g,en,Pr,qi,D,Fr,z,Z}from"./chunk-gxedprvk.js";var Ss={};k(Ss,{ConsoleCredentials:()=>Ss,fresh:()=>Be,login:()=>va,logout:()=>wa,organization:()=>jn,owner:()=>ye,read:()=>Ee,stored:()=>so});import{createHash as c}from"node:crypto";var d=z(Z(xr)),f=300000;function Ee(e){let n=e.env.OPENCODE_API_KEY;if(!n)return so(e);let o=e.env.OPENCODE_CONSOLE_SERVER?.trim();if(!o)return{type:"key",server:ws,key:n};let r=Os(o);if(!r)throw Error(`OPENCODE_CONSOLE_SERVER isn't a Console URL: ${o}. Use an https:// URL, or http:// only for localhost.`);return{type:"key",server:r,key:n}}function so(e){let n=i(e);if(n.corrupt)throw Error(`The sign-in in ${gn(e)} can't be read. Run \`npx @opencode/console login\` to replace it or \`npx @opencode/console logout\` to remove it.`);return n.credential}function ye(e){return JSON.stringify([e.server,e.type==="key"?c("sha256").update(e.key).digest("hex").slice(0,16):e.accountID,e.type==="oauth"?e.orgID:void 0])}function jn(e){return e.type==="oauth"?e.orgName:void 0}var va=D("ConsoleCredentials.login")(function*(e,n){let o=yield*Es(n.server);yield*n.prompt(o);let r=yield*o.callback,t=yield*ke(e,I(()=>{let l=i(e).credential;if(be(gn(e),JSON.stringify(r)),!l||ye(l)!==ye(r))W(Kt(e));return l}));if(t)yield*io(t).pipe(en);return r}),Be=D("ConsoleCredentials.fresh")(function*(e){let n=Ee(e);if(!n||n.type==="key"||!(yield*s(n)))return n;let o=yield*ke(e,G(function*(){let r=so(e);if(!r||!(yield*s(r)))return r;let t=yield*ks(r).pipe(Pr(ve(30)));if(i(e).credential?.refresh!==r.refresh)return so(e);return be(gn(e),JSON.stringify(t)),t})).pipe(qi);return yield*Fr(o)}),wa=D("ConsoleCredentials.logout")(function*(e){let n=yield*ke(e,I(()=>{let o=i(e).credential;return W(gn(e)),W(Kt(e)),o}));if(!n)return!1;return yield*io(n).pipe(en),!0});function s(e){return vt.pipe(g((n)=>e.expires-f<=n))}function i(e){let n=J(gn(e));if(n===void 0)return{};let o=F(d(n));return o?{credential:o}:{corrupt:!0}}
|
|
2
|
-
export{Ee,so,ye,jn,va,Be,wa,Ss};
|
package/chunk-vy3ahcaj.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Ot}from"./chunk-0trayd9n.js";import{ke,J,be,W,Pt}from"./chunk-wd4mfvqy.js";import{Ee,ye}from"./chunk-tx5wws16.js";import{Le}from"./chunk-et9y1sb5.js";import{ur,yt,bt,pr,$n,Qe,fn,_,at,je,It,Tt}from"./chunk-78cwb109.js";import{Ct,cr}from"./chunk-96f5c0tj.js";import{le}from"./chunk-ak1n0cs7.js";import{k,He,F,I,Tn,z,S,j,e,v,n,x,Z}from"./chunk-gxedprvk.js";var Qo={};k(Qo,{Pi:()=>Qo,Unreadable:()=>Zr,checks:()=>Wo,defaultModel:()=>Ko,directory:()=>Dn,manifest:()=>Vo,manifestFile:()=>Yr,models:()=>Zo,modelsFile:()=>Qr,paths:()=>ha,providers:()=>zo,remove:()=>xa,setup:()=>ga,skillCommand:()=>Go,skills:()=>Yo,userBash:()=>Jo});import{createHash as A}from"node:crypto";import{rmSync as R}from"node:fs";import P from"node:os";import u from"node:path";import{fileURLToPath as U}from"node:url";function ha(t=process.env,r=P.homedir()){let o=t.PI_CODING_AGENT_DIR?.trim(),s=o?u.resolve(o==="~"?r:o.startsWith("~/")?u.join(r,o.slice(2)):o):u.join(r,".pi","agent");return{agent:s,settings:u.join(s,"settings.json")}}function zo(t,r){return[...Map.groupBy(Ct(t).flatMap((s)=>E(s,r)??[]),(s)=>s.provider)].map(([s,i])=>({id:s,name:t[s]?.name??s,models:i}))}function Ko(t){let r=Ct(t).filter((s)=>M(s)!==void 0),o=cr(r,"sonnet","opus","haiku");return o&&{provider:o.provider,id:o.id}}var b={messages:"anthropic-messages",responses:"openai-responses","chat-completions":"openai-completions","generate-content":"google-generative-ai"};function M(t){let r=_(t.entry.api),o=Object.keys(b).find((i)=>(i in r)),s=o&&at(_(r[o]).base_url);return o&&s?{api:b[o],baseURL:s}:void 0}function E(t,r){let o=M(t);if(!o)return;let s=o.api,i=r(t.provider,t.id,s),c=i?.api===s?i:void 0,d=t.entry,p=_(d.limit),a=_(_(d.cost).text),l=_(a.input),g=_(l.cache),h=_(d.modalities).input,y=_(_(d.capabilities).reasoning).supported;return{...s==="openai-completions"?{compat:D}:{},...c,id:t.id,name:at(d.name)??c?.name??t.id,api:s,provider:t.provider,baseUrl:s==="anthropic-messages"?o.baseURL.replace(/\/v1\/?$/,""):o.baseURL,reasoning:typeof y==="boolean"?y:c?.reasoning??!1,input:Array.isArray(h)?h.some((w)=>typeof w==="string"&&w.startsWith("image"))?["text","image"]:["text"]:c?.input??["text"],cost:{input:f(l.price)??c?.cost.input??0,output:f(_(a.output).price)??c?.cost.output??0,cacheRead:f(g.read)??c?.cost.cacheRead??0,cacheWrite:f(C(g.write))??f(C(_(g.explicit).write))??c?.cost.cacheWrite??0},contextWindow:f(p.context)??c?.contextWindow??128000,maxTokens:f(p.output)??c?.maxTokens??16384,headers:{...c?.headers,"x-opencode-plugin":`opencode-console/${le}`}}}var D={supportsStore:!1,supportsDeveloperRole:!1,supportsStrictMode:!0,maxTokensField:"max_tokens"};function C(t){return typeof t==="object"&&t!==null?Object.values(t)[0]:t}function f(t){return typeof t==="number"&&Number.isFinite(t)?t:void 0}class Zr extends Error{}function Wo(t,r){let o=(a,l,g={})=>({action:a,resources:l,directory:r.cwd,...g}),s=t.toolName,i=(a)=>{let l=t.input[a];return typeof l==="string"&&l!==""?l:void 0},c=(a)=>{let l=i(a);if(l===void 0)throw new Zr(`${s}'s input has no ${a}`);return l},d=r.home??P.homedir(),p=(a)=>m(c(a),d);if(s.startsWith("mcp__"))return L(s,r.server).map((a)=>o(a.action,a.resources,a));switch(s){case"bash":return[o("shell",[c("command")],{shell:"bash"})];case"powershell":return[o("shell",[c("command")],{shell:"pwsh"})];case"read":{let a=p("path"),l=r.skills&&N(r.skills,u.resolve(r.cwd,a));return[l?o("skill",[l]):o("read",[a])]}case"write":case"edit":return[o("edit",[p("path")])];case"ls":return[o("read",[m(i("path")??".",d)])];case"grep":case"find":{let a=i("path");return[o(s==="find"?"glob":"grep",[c("pattern")],a===void 0?{}:{path:m(a,d)})]}case"read_mcp_resource":return[o("mcp.use",[c("server")])];case"list_mcp_resources":case"list_mcp_resource_templates":{let a=i("server"),l=r.servers??[];return[o("mcp.use",a?[a]:l.length>0?l:["*"])]}default:return[o(s.toLowerCase(),["*"])]}}function m(t,r){let o=t.replace(/[\u00A0\u2000-\u200A\u202F\u205F\u3000]/g," "),s=o.startsWith("@")?o.slice(1):o,i=s==="~"?r:s.startsWith("~/")?u.join(r,s.slice(2)):s;return i.startsWith("file://")?U(i):i}function N(t,r){let o=u.relative(u.resolve(t),r);if(o===""||o.startsWith("..")||u.isAbsolute(o))return;return o.split(u.sep)[0]}function L(t,r){let o=r&&`mcp__${r.replace(/[^A-Za-z0-9_]/g,"_")}__`,s=t.match(/^mcp__(.+?)__(.+)$/),i=r??s?.[1];if(!i)throw new Zr(`Can't tell which MCP server ${t} belongs to`);let c=o&&t.startsWith(o)?t.slice(o.length):r?void 0:s?.[2],d=r!==void 0,p=c===void 0||/_[0-9a-f]{8}$/.test(t);return[{action:"mcp.use",resources:[i],...d?{}:{folded:!0}},p?{action:`${i}_`,resources:["*"],truncated:!0,folded:!0}:{action:`${i}_${c}`,resources:["*"],folded:!0}]}function Jo(t){return{action:"shell",resources:[t.command],directory:t.cwd,shell:"bash"}}function Go(t){return t.match(/^\/skill:([^\s]+)/)?.[1]}var O=n({paths:n({agent:e,settings:e}),extension:e,created:v,...ur}),Yr=(t)=>u.join(t.data,"pi.json"),Dn=(t)=>u.join(t.data,"pi"),Qr=(t)=>u.join(t.cache,"pi-models.json");function Vo(t){let r=Yr(t),o=J(r);if(o===void 0)return;let s=F(z(Z(O))(o));if(!s)throw Error(`${r} can't be read, so Pi was left as it is. Delete it and run setup again.`);return s}function ga(t,r){let o=Vo(t),s=o?.created??J(r.paths.settings)===void 0,i=yt(r.paths.settings)??{};if(!o)fn(r.paths.settings);let c=Array.isArray(i.extensions)?i.extensions:[];i.extensions=[...c.filter((p)=>p!==o?.extension&&p!==r.extension),r.extension];let d=pr(i,r.model?{defaultProvider:r.model.provider,defaultModel:r.model.id}:{},o,!0);bt(r.paths.settings,i,384),be(Yr(t),JSON.stringify(O.make({paths:r.paths,extension:r.extension,created:s,...d})))}function xa(t){let r=Vo(t);if(!r)return!1;let o=yt(r.paths.settings);if(o){let i=(Array.isArray(o.extensions)?o.extensions:[]).filter((c)=>c!==r.extension);if(i.length>0)o.extensions=i;else delete o.extensions;if(Object.keys(r.originals).forEach((c)=>$n(o,c,r)),Object.keys(o).length===0&&r.created)W(r.paths.settings);else bt(r.paths.settings,o)}return W(Qe(r.paths.settings)),R(Dn(t),{recursive:!0,force:!0}),W(Qr(t)),W(Yr(t)),!0}var B=n({owner:e,providers:e,document:x(e,j)}),T=x(e,n({name:S(e),models:x(e,x(e,j))}));async function Zo(t){let r=Ee(t.store),o=await Le(t);if(!r||!o?.config)return;let s=ye(r),i=A("sha256").update(JSON.stringify(o.config.providers??null)).digest("hex"),c=F(z(Z(B))(J(Qr(t.store))??"")),d=c?.owner===s&&c.providers===i?c.document:void 0,p=d&&F(z(T)(d));if(p)return p;let a=await t.run(Ot(r));return be(Qr(t.store),JSON.stringify({owner:s,providers:i,document:a})),a}var G=x(e,e);async function Yo(t){let r=Ee(t.store),o=await Le(t),s=u.join(Dn(t.store),"skills"),i=u.join(Dn(t.store),"skills.json");if(!r||!o?.config)return s;let c=je(o.config).skills,d=He(z(Z(G))(J(i)??""),()=>({})),p=await t.run(It(r,s,c,d));return await Tn(ke(t.store,I(()=>{Pt(s),be(i,JSON.stringify(Tt(s,c,p,d).skills))}))),s}
|
|
2
|
-
export{ha,zo,Ko,Zr,Wo,Jo,Go,Yr,Dn,Qr,Vo,ga,xa,Zo,Yo,Qo};
|
package/chunk-w6kmmxmz.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Ee,so,ye,jn,va,Be,wa,Ss}from"./chunk-tx5wws16.js";import"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{Ss as ConsoleCredentials,Be as fresh,va as login,wa as logout,jn as organization,ye as owner,Ee as read,so as stored};
|
package/chunk-wkrya350.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{je,dr,Xe,It,Tt,dn,hi,gi,hs}from"./chunk-78cwb109.js";import"./chunk-0trayd9n.js";import"./chunk-gvywgb0d.js";import"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{hs as Library,It as fetchChanged,je as library,gi as namedSkillMarkdown,dr as prompt,Xe as servers,hi as skillMarkdown,Tt as write,dn as writeInstructions};
|
package/chunk-ysgtje2z.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_i,Ri}from"./chunk-dnepb5ke.js";import{Y,ae,X,go,ct,Nt,We,Qt,Hs,Xt,Li,ce,ni,Br,Hr,Lo,si,ka,Ca}from"./chunk-gxedprvk.js";export{_i as Brand,We as Cause,Li as Clock,ae as Context,Nt as Data,Br as DateTime,ct as Duration,ce as Effect,Qt as Exit,ni as Fiber,Ca as FileSystem,Xt as Layer,Y as Option,Ri as Path,go as Record,X as Result,ka as Schema,Hr as SchemaGetter,Lo as SchemaTransformation,Hs as Scope,si as Struct};
|
package/chunk-zgcspk2g.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{vr,gn,Kt,Ms,ke,J,Ns,be,W,mo,Pt,Fs}from"./chunk-wd4mfvqy.js";import"./chunk-dnepb5ke.js";export{Fs as ConsoleStore,gn as credentialFile,Pt as ensureDir,ke as locked,vr as make,Ns as modified,J as read,W as remove,Kt as snapshotFile,Ms as syncClaimFile,mo as unreachable,be as write};
|