alchemylab-opencode 1.0.25 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NODE_COMPAT.md +23 -174
- package/dist/20260127222353_familiar_lady_ursula-KV747FJX.js +14 -0
- package/dist/{chunk-LTCXIXYM.js → 20260211171708_add_project_commands-GDOHPDPF.js} +3 -1
- package/dist/20260213144116_wakeful_the_professor-ZVDD54AK.js +14 -0
- package/dist/20260225215848_workspace-ZMSOZSPA.js +14 -0
- package/dist/20260227213759_add_session_workspace_id-ROENWPKA.js +14 -0
- package/dist/20260228203230_blue_harpoon-IW3Z4TQZ.js +14 -0
- package/dist/20260303231226_add_workspace_fields-OUVZMNAG.js +14 -0
- package/dist/20260309230000_move_org_to_state-NOXAPU5V.js +14 -0
- package/dist/20260312043431_session_message_cursor-DJ4T3T4R.js +14 -0
- package/dist/20260323234822_events-72GIKJ2A.js +14 -0
- package/dist/20260410174513_workspace-name-JXSWFBJN.js +14 -0
- package/dist/20260413175956_chief_energizer-4HEWZ6U3.js +14 -0
- package/dist/20260423070820_add_icon_url_override-X5SHFGTI.js +14 -0
- package/dist/20260427172553_slow_nightmare-PS5T2AH2.js +14 -0
- package/dist/{chunk-YRY5Y3QL.js → 20260428004200_add_session_path-LGW75WYA.js} +3 -1
- package/dist/{valibot--1zFm7rT-FSYJNYJ6.js → 20260501142318_next_venus-J3TLVXZ6.js} +3 -1
- package/dist/20260504145000_add_sync_owner-3R52GB4C.js +14 -0
- package/dist/20260507164347_add_workspace_time-JHDRCZAR.js +14 -0
- package/dist/20260510033149_session_usage-UGBVOXZB.js +53 -0
- package/dist/20260511000411_data_migration_state-FB4LBFSE.js +14 -0
- package/dist/20260511173437_session-metadata-T2XHGWHS.js +14 -0
- package/dist/20260601010001_normalize_storage_paths-5MAY5GT3.js +14 -0
- package/dist/{chunk-PWFRMDDF.js → 20260601202201_amazing_prowler-PET224YG.js} +3 -0
- package/dist/20260602002951_lowly_union_jack-PG6XDMGL.js +14 -0
- package/dist/20260602182828_add_project_directories-ZCH2ACGG.js +14 -0
- package/dist/20260603001617_session_message_projection_indexes-XVLJTUF2.js +14 -0
- package/dist/20260603040000_session_message_projection_order-XG6RACZQ.js +14 -0
- package/dist/20260603141458_session_input_inbox-K2VQ7V6E.js +14 -0
- package/dist/20260603160727_jittery_ezekiel_stane-WKJLRDO7.js +14 -0
- package/dist/20260604172448_event_sourced_session_input-NTXOECR7.js +14 -0
- package/dist/20260605003541_add_session_context_snapshot-DXMQEXMT.js +14 -0
- package/dist/{zod-Bwrt9trS-HVDOFWRP.js → 20260605042240_add_context_epoch_agent-W6IQYZXE.js} +3 -1
- package/dist/20260611035744_credential-XTMSYTJD.js +14 -0
- package/dist/20260611192811_lush_chimera-XPLIQMJD.js +14 -0
- package/dist/20260612174303_project_dir_strategy-FR2NGQKK.js +14 -0
- package/dist/20260622142730_simplify_session_context_epoch-NTQZR3RE.js +14 -0
- package/dist/20260622170816_reset_v2_session_state-5JPHJTZG.js +14 -0
- package/dist/20260622202450_simplify_session_input-2EXF2HMV.js +14 -0
- package/dist/app-runtime-6NGO2HRS.js +14 -0
- package/dist/chunk-4K2RXRZL.js +14 -0
- package/dist/chunk-BM2C7NHL.js +41 -0
- package/dist/chunk-E47SMIVL.js +186 -0
- package/dist/chunk-OMDJ6ZZ2.js +684 -0
- package/dist/chunk-PLQOF3WF.js +393 -0
- package/dist/chunk-QRABYJKL.js +14 -0
- package/dist/chunk-RHIWAYN5.js +14 -0
- package/dist/{arktype-aI7TBD0R-TFNARRIP.js → chunk-VURLSDCB.js} +3 -1
- package/dist/chunk-Z5TLIUAI.js +28 -0
- package/dist/chunk-ZMHNE2MU.js +865 -0
- package/dist/chunk-ZWLTE2TM.js +1455 -0
- package/dist/code-mode-YFX4N2VN.js +40 -0
- package/dist/copilot-provider-TX4YFKJZ.js +14 -0
- package/dist/photon-VQS5F5BI.js +14 -0
- package/dist/pty.node-Y3N2XKYG.js +14 -0
- package/dist/run.js +3 -1
- package/dist/serve.js +3 -1
- package/dist/server-TI57TGPO.js +17 -0
- package/dist/session-6RNXZNG6.js +14 -0
- package/dist/{chunk-2ANK3QEN.js → worktree-3RZQEGVC.js} +3 -1
- package/package.json +83 -50
- package/patches/@ai-sdk%2Famazon-bedrock@4.0.166.patch +164 -0
- package/patches/@ai-sdk%2Fanthropic@3.0.111.patch +528 -0
- package/patches/@ai-sdk%2Fgoogle@3.0.73.patch +69 -0
- package/patches/@ai-sdk%2Fgroq@3.0.31.patch +79 -0
- package/patches/@ai-sdk%2Fmistral@3.0.51.patch +714 -0
- package/patches/@ai-sdk%2Fopenai-compatible@2.0.41.patch +39 -0
- package/patches/@ai-sdk%2Fopenai@3.0.88.patch +280 -0
- package/patches/@ai-sdk%2Fxai@3.0.139.patch +296 -0
- package/patches/@modelcontextprotocol%2Fsdk@1.29.0.patch +647 -0
- package/patches/@npmcli%2Fagent@4.0.2.patch +13 -0
- package/patches/@silvia-odwyer%2Fphoton-node@0.3.4.patch +285 -0
- package/patches/effect@4.0.0-beta.83.patch +57 -0
- package/patches/gcp-metadata@8.1.2.patch +14 -0
- package/patches/pacote@21.5.0.patch +18 -0
- package/postinstall.cjs +146 -0
- package/dist/chunk-26PYOYAY.js +0 -13
- package/dist/chunk-7KKA6WBY.js +0 -12
- package/dist/chunk-CZVKIDQZ.js +0 -12
- package/dist/chunk-FXLFZ5DL.js +0 -12
- package/dist/chunk-GXWCFXGG.js +0 -12
- package/dist/chunk-M4CB72HE.js +0 -13
- package/dist/chunk-MBZTOEAD.js +0 -12
- package/dist/chunk-NLFNI3VW.js +0 -18
- package/dist/chunk-XJGIPERR.js +0 -2187
- package/dist/chunk-YDTJPTBK.js +0 -18
- package/dist/default-u_dwuiYb-652AQZKX.js +0 -12
- package/dist/effect-QlVUlMFu-JVYEXAZL.js +0 -12
- package/dist/log-MVJ7H4K5.js +0 -12
- package/dist/pty.node-X2EITEZ4.js +0 -12
- package/dist/registry-4BBWPCYV.js +0 -12
- package/dist/run-XDEC53H6.js +0 -20
- package/dist/run-service-6DJSRAIA.js +0 -12
- package/dist/schema-YWIVP7UR.js +0 -12
- package/dist/server-IT7ZVNR2.js +0 -12
- package/dist/session-HPEX3PLB.js +0 -12
- package/dist/share-next-3FDGRL3C.js +0 -12
- package/dist/sury-CWZTCd75-3YHH6KVI.js +0 -12
- package/dist/typebox-Dei93FPO-GLI7OCTY.js +0 -12
- package/dist/valibot-D_HTw1Gn-E5NKVIOV.js +0 -12
- package/dist/worktree-INBHVVO4.js +0 -12
- package/dist/zod-DSgpEGAE-DSH6V7MG.js +0 -12
- package/packages/opencode/migration/20260127222353_familiar_lady_ursula/migration.sql +0 -90
- package/packages/opencode/migration/20260127222353_familiar_lady_ursula/snapshot.json +0 -796
- package/packages/opencode/migration/20260211171708_add_project_commands/migration.sql +0 -1
- package/packages/opencode/migration/20260211171708_add_project_commands/snapshot.json +0 -806
- package/packages/opencode/migration/20260213144116_wakeful_the_professor/migration.sql +0 -11
- package/packages/opencode/migration/20260213144116_wakeful_the_professor/snapshot.json +0 -897
- package/packages/opencode/migration/20260225215848_workspace/migration.sql +0 -7
- package/packages/opencode/migration/20260225215848_workspace/snapshot.json +0 -959
- package/packages/opencode/migration/20260227213759_add_session_workspace_id/migration.sql +0 -2
- package/packages/opencode/migration/20260227213759_add_session_workspace_id/snapshot.json +0 -983
- package/packages/opencode/migration/20260228203230_blue_harpoon/migration.sql +0 -17
- package/packages/opencode/migration/20260228203230_blue_harpoon/snapshot.json +0 -1102
- package/packages/opencode/migration/20260303231226_add_workspace_fields/migration.sql +0 -5
- package/packages/opencode/migration/20260303231226_add_workspace_fields/snapshot.json +0 -1013
- package/packages/opencode/migration/20260309230000_move_org_to_state/migration.sql +0 -3
- package/packages/opencode/migration/20260309230000_move_org_to_state/snapshot.json +0 -1156
- package/packages/opencode/migration/20260312043431_session_message_cursor/migration.sql +0 -4
- package/packages/opencode/migration/20260312043431_session_message_cursor/snapshot.json +0 -1168
- package/packages/opencode/migration/20260323234822_events/migration.sql +0 -13
- package/packages/opencode/migration/20260323234822_events/snapshot.json +0 -1271
- package/packages/opencode/migration/20260409000000_add_session_metadata/migration.sql +0 -1
package/dist/chunk-YDTJPTBK.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as Me}from"./chunk-GXWCFXGG.js";import{E as Ge,F as Z,G as Le,L as le,P as Ue,S as ze,e as fe,h as V,l as pe,n as O,o as De,p as Be}from"./chunk-XJGIPERR.js";import{A as Y,a as Q,d as D,h as S,j as Ce,k as ae,m as de,s as q,u as Re,v as A,w as Pe,x as T,y as g}from"./chunk-26PYOYAY.js";import{d as je,e as z}from"./chunk-M4CB72HE.js";import{a as m}from"./chunk-MBZTOEAD.js";import p from"zod";import{Effect as h,Layer as ee,ServiceMap as Ke,Stream as Ae}from"effect";import Qe from"path";import $ from"zod";var ue;(P=>{let E=z.create({service:"vcs"}),G=m(d=>d?d.endsWith(`
|
|
13
|
-
`)?d.slice(0,-1).split(`
|
|
14
|
-
`).length:d.split(`
|
|
15
|
-
`).length:0,"count"),te=h.fnUntraced(function*(d,s,u){let r=Qe.join(s,u);if(!(yield*d.exists(r).pipe(h.orDie)))return"";let i=yield*d.readFile(r).pipe(h.catch(()=>h.succeed(new Uint8Array)));return Buffer.from(i).includes(0)?"":Buffer.from(i).toString("utf8")}),re=m(d=>new Map(d.map(s=>[s.file,{additions:s.additions,deletions:s.deletions}])),"nums"),me=m((...d)=>{let s=new Map;return d.flat().forEach(u=>{s.has(u.file)||s.set(u.file,u)}),[...s.values()]},"merge"),J=h.fnUntraced(function*(d,s,u,r,i,a){let w=r?yield*s.prefix(u):"";return(yield*h.forEach(i,y=>h.gen(function*(){let x=y.status==="added"||!r?"":yield*s.show(u,r,y.file,w),j=y.status==="deleted"?"":yield*te(d,u,y.file),K=a.get(y.file);return{file:y.file,before:x,after:j,additions:K?.additions??(y.status==="added"?G(j):0),deletions:K?.deletions??(y.status==="deleted"?G(x):0),status:y.status}}),{concurrency:8})).toSorted((y,x)=>y.file.localeCompare(x.file))}),W=h.fnUntraced(function*(d,s,u,r){if(!r)return yield*J(d,s,u,r,yield*s.status(u),new Map);let[i,a]=yield*h.all([s.status(u),s.stats(u,r)],{concurrency:2});return yield*J(d,s,u,r,i,re(a))}),ne=h.fnUntraced(function*(d,s,u,r){let[i,a,w]=yield*h.all([s.diff(u,r),s.stats(u,r),s.status(u)],{concurrency:3});return yield*J(d,s,u,r,me(i,w.filter(F=>F.code==="??")),re(a))});P.Mode=$.enum(["git","branch"]),P.Event={BranchUpdated:q.define("vcs.branch.updated",$.object({branch:$.string().optional()}))},P.Info=$.object({branch:$.string().optional(),default_branch:$.string().optional()}).meta({ref:"VcsInfo"});class I extends Ke.Service()("@opencode/Vcs"){static{m(this,"Service")}}P.Service=I,P.layer=ee.effect(I,h.gen(function*(){let d=yield*A.Service,s=yield*O.Service,u=yield*V.Service,r=yield*S.make(h.fn("Vcs.state")(i=>h.gen(function*(){if(i.project.vcs!=="git")return{current:void 0,root:void 0};let a=h.fnUntraced(function*(){return yield*s.branch(i.directory)}),[w,F]=yield*h.all([s.branch(i.directory),s.defaultBranch(i.directory)],{concurrency:2}),y={current:w,root:F};return E.info("initialized",{branch:y.current,default_branch:y.root?.name}),yield*u.subscribe(Z.Event.Updated).pipe(Ae.filter(x=>x.properties.file.endsWith("HEAD")),Ae.runForEach(x=>h.gen(function*(){let j=yield*a();j!==y.current&&(E.info("branch changed",{from:y.current,to:j}),y.current=j,yield*u.publish(P.Event.BranchUpdated,{branch:j}))})),h.forkScoped),y})));return I.of({init:h.fn("Vcs.init")(function*(){yield*S.get(r)}),branch:h.fn("Vcs.branch")(function*(){return yield*S.use(r,i=>i.current)}),defaultBranch:h.fn("Vcs.defaultBranch")(function*(){return yield*S.use(r,i=>i.root?.name)}),diff:h.fn("Vcs.diff")(function*(i){let a=yield*S.get(r);if(g.project.vcs!=="git")return[];if(i==="git")return yield*W(d,s,g.directory,(yield*s.hasHead(g.directory))?"HEAD":void 0);if(!a.root)return[];if(a.current&&a.current===a.root.name)return[];let w=yield*s.mergeBase(g.directory,a.root.ref);return w?yield*ne(d,s,g.directory,w):[]})})}));let ie=P.layer.pipe(ee.provide(O.defaultLayer),ee.provide(A.defaultLayer),ee.provide(V.layer)),{runPromise:C}=Y(I,ie);async function he(){return C(d=>d.init())}P.init=he,m(he,"init");async function we(){return C(d=>d.branch())}P.branch=we,m(we,"branch");async function U(){return C(d=>d.defaultBranch())}P.defaultBranch=U,m(U,"defaultBranch");async function Ne(d){return C(s=>s.diff(d))}P.diff=Ne,m(Ne,"diff")})(ue||={});async function Te(){z.Default.info("bootstrapping",{directory:g.directory}),await ze.init(),Me.init(),Le.init(),await De.init(),Ge.init(),Z.init(),ue.init(),Be.init(),V.subscribe(le.Event.Executed,async E=>{E.properties.name===le.Default.INIT&&T.setInitialized(g.project.id)})}m(Te,"InstanceBootstrap");import{Effect as o,Layer as X,Path as Ye,Scope as Ze,ServiceMap as et,Stream as B}from"effect";import{ChildProcess as $e,ChildProcessSpawner as tt}from"effect/unstable/process";import{NodePath as rt}from"@effect/platform-node";var nt;(r=>{let E=z.create({service:"worktree"});r.Event={Ready:q.define("worktree.ready",p.object({name:p.string(),branch:p.string()})),Failed:q.define("worktree.failed",p.object({message:p.string()}))},r.Info=p.object({name:p.string(),branch:p.string(),directory:p.string()}).meta({ref:"Worktree"}),r.CreateInput=p.object({name:p.string().optional(),startCommand:p.string().optional().describe("Additional startup script to run after the project's start command")}).meta({ref:"WorktreeCreateInput"}),r.RemoveInput=p.object({directory:p.string()}).meta({ref:"WorktreeRemoveInput"}),r.ResetInput=p.object({directory:p.string()}).meta({ref:"WorktreeResetInput"}),r.NotGitError=D.create("WorktreeNotGitError",p.object({message:p.string()})),r.NameGenerationFailedError=D.create("WorktreeNameGenerationFailedError",p.object({message:p.string()})),r.CreateFailedError=D.create("WorktreeCreateFailedError",p.object({message:p.string()})),r.StartCommandFailedError=D.create("WorktreeStartCommandFailedError",p.object({message:p.string()})),r.RemoveFailedError=D.create("WorktreeRemoveFailedError",p.object({message:p.string()})),r.ResetFailedError=D.create("WorktreeResetFailedError",p.object({message:p.string()}));function oe(i){return i.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+/,"").replace(/-+$/,"")}m(oe,"slugify");function ie(...i){return i.filter(Boolean).flatMap(a=>a.split(`
|
|
16
|
-
`).map(w=>w.trim()).flatMap(w=>{let F=w.match(/^warning:\s+failed to remove\s+(.+):\s+/i);if(!F)return[];let y=F[1]?.trim().replace(/^['"]|['"]$/g,"");return y?[y]:[]}))}m(ie,"failedRemoves");class C extends et.Service()("@opencode/Worktree"){static{m(this,"Service")}}r.Service=C,r.layer=X.effect(C,o.gen(function*(){let i=yield*Ze.Scope,a=yield*A.Service,w=yield*Ye.Path,F=yield*tt.ChildProcessSpawner,y=yield*T.Service,x=o.fnUntraced(function*(t,e){let n=yield*F.spawn($e.make("git",t,{cwd:e?.cwd,extendEnv:!0,stdin:"ignore"})),[c,f]=yield*o.all([B.mkString(B.decodeText(n.stdout)),B.mkString(B.decodeText(n.stderr))],{concurrency:2});return{code:yield*n.exitCode,text:c,stderr:f}},o.scoped,o.catch(t=>o.succeed({code:1,text:"",stderr:t instanceof Error?t.message:String(t)}))),j=26,K=o.fn("Worktree.candidate")(function*(t,e){let n=yield*S.context;for(let c of Array.from({length:j},(f,l)=>l)){let f=e?c===0?e:`${e}-${pe.create()}`:pe.create(),l=`opencode/${f}`,b=w.join(t,f);if(yield*a.exists(b).pipe(o.orDie))continue;let v=`refs/heads/${l}`;if((yield*x(["show-ref","--verify","--quiet",v],{cwd:n.worktree})).code!==0)return r.Info.parse({name:f,branch:l,directory:b})}throw new r.NameGenerationFailedError({message:"Failed to generate a unique worktree name"})}),xe=o.fn("Worktree.makeWorktreeInfo")(function*(t){let e=yield*S.context;if(e.project.vcs!=="git")throw new r.NotGitError({message:"Worktrees are only supported for git projects"});let n=w.join(je.Path.data,"worktree",e.project.id);yield*a.makeDirectory(n,{recursive:!0}).pipe(o.orDie);let c=t?oe(t):"";return yield*K(n,c||void 0)}),ve=o.fnUntraced(function*(t){let e=yield*S.context,n=yield*x(["worktree","add","--no-checkout","-b",t.branch,t.directory],{cwd:e.worktree});if(n.code!==0)throw new r.CreateFailedError({message:n.stderr||n.text||"Failed to create git worktree"});yield*y.addSandbox(e.project.id,t.directory).pipe(o.catch(()=>o.void))}),be=o.fnUntraced(function*(t,e){let c=(yield*S.context).project.id,f=e?.trim(),l=yield*x(["reset","--hard"],{cwd:t.directory});if(l.code!==0){let v=l.stderr||l.text||"Failed to populate worktree";E.error("worktree checkout failed",{directory:t.directory,message:v}),Q.emit("event",{directory:t.directory,payload:{type:r.Event.Failed.type,properties:{message:v}}});return}(yield*o.promise(()=>g.provide({directory:t.directory,init:Te,fn:m(()=>{},"fn")}).then(()=>!0).catch(v=>{let R=fe(v);return E.error("worktree bootstrap failed",{directory:t.directory,message:R}),Q.emit("event",{directory:t.directory,payload:{type:r.Event.Failed.type,properties:{message:R}}}),!1})))&&(Q.emit("event",{directory:t.directory,payload:{type:r.Event.Ready.type,properties:{name:t.name,branch:t.branch}}}),yield*Ee(t.directory,{projectID:c,extra:f}))}),We=o.fn("Worktree.createFromInfo")(function*(t,e){yield*ve(t),yield*be(t,e)}),_e=o.fn("Worktree.create")(function*(t){let e=yield*xe(t?.name);return yield*ve(e),yield*be(e,t?.startCommand).pipe(o.catchCause(n=>o.sync(()=>E.error("worktree bootstrap failed",{cause:n}))),o.forkIn(i)),e}),M=o.fnUntraced(function*(t){let e=w.resolve(t),n=yield*a.realPath(e).pipe(o.catch(()=>o.succeed(e))),c=w.normalize(n);return process.platform==="win32"?c.toLowerCase():c});function se(t){return t.split(`
|
|
17
|
-
`).map(e=>e.trim()).reduce((e,n)=>{if(!n)return e;if(n.startsWith("worktree "))return e.push({path:n.slice(9).trim()}),e;let c=e[e.length-1];return c&&n.startsWith("branch ")&&(c.branch=n.slice(7).trim()),e},[])}m(se,"parseWorktreeList");let ce=o.fnUntraced(function*(t,e){for(let n of t){if(!n.path)continue;if((yield*M(n.path))===e)return n}});function Ie(t){return a.exists(t).pipe(o.orDie,o.flatMap(e=>e?x(["fsmonitor--daemon","stop"],{cwd:t}):o.void))}m(Ie,"stopFsmonitor");function ke(t){return o.promise(()=>import("fs/promises").then(e=>e.rm(t,{recursive:!0,force:!0,maxRetries:5,retryDelay:100})).catch(e=>{let n=fe(e);throw new r.RemoveFailedError({message:n||"Failed to remove git worktree directory"})}))}m(ke,"cleanDirectory");let He=o.fn("Worktree.remove")(function*(t){if(g.project.vcs!=="git")throw new r.NotGitError({message:"Worktrees are only supported for git projects"});let e=yield*M(t.directory),n=yield*x(["worktree","list","--porcelain"],{cwd:g.worktree});if(n.code!==0)throw new r.RemoveFailedError({message:n.stderr||n.text||"Failed to read git worktrees"});let c=se(n.text),f=yield*ce(c,e);if(!f?.path)return(yield*a.exists(e).pipe(o.orDie))&&(yield*Ie(e),yield*ke(e)),!0;yield*Ie(f.path);let l=yield*x(["worktree","remove","--force",f.path],{cwd:g.worktree});if(l.code!==0){let v=yield*x(["worktree","list","--porcelain"],{cwd:g.worktree});if(v.code!==0)throw new r.RemoveFailedError({message:l.stderr||l.text||v.stderr||v.text||"Failed to remove git worktree"});if((yield*ce(se(v.text),e))?.path)throw new r.RemoveFailedError({message:l.stderr||l.text||"Failed to remove git worktree"})}yield*ke(f.path);let b=f.branch?.replace(/^refs\/heads\//,"");if(b){let v=yield*x(["branch","-D",b],{cwd:g.worktree});if(v.code!==0)throw new r.RemoveFailedError({message:v.stderr||v.text||"Failed to delete worktree branch"})}return!0}),_=o.fnUntraced(function*(t,e,n){let c=yield*x(t,e);if(c.code!==0)throw n(c);return c}),qe=o.fnUntraced(function*(t,e){let[n,c]=process.platform==="win32"?["cmd",["/c",e]]:["bash",["-lc",e]],f=yield*F.spawn($e.make(n,c,{cwd:t,extendEnv:!0,stdin:"ignore"})),[,l]=yield*o.all([B.runDrain(f.stdout),B.mkString(B.decodeText(f.stderr))],{concurrency:2}).pipe(o.orDie);return{code:yield*f.exitCode,stderr:l}},o.scoped,o.catch(()=>o.succeed({code:1,stderr:""}))),Se=o.fnUntraced(function*(t,e,n){let c=e.trim();if(!c)return!0;let f=yield*qe(t,c);return f.code===0?!0:(E.error("worktree start command failed",{kind:n,directory:t,message:f.stderr}),!1)}),Ee=o.fnUntraced(function*(t,e){let n=yield*o.sync(()=>Ce.use(b=>b.select().from(de).where((0,ae.eq)(de.id,e.projectID)).get())),f=(n?T.fromRow(n):void 0)?.commands?.start?.trim()??"";return(yield*Se(t,f,"project"))?(yield*Se(t,e.extra??"","worktree"),!0):!1}),Ve=o.fnUntraced(function*(t,e){let n=yield*M(t);yield*o.forEach(e,c=>o.gen(function*(){let f=yield*M(w.resolve(t,c));f!==n&&f.startsWith(`${n}${w.sep}`)&&(yield*a.remove(f,{recursive:!0}).pipe(o.ignore))}),{concurrency:"unbounded"})}),Oe=o.fnUntraced(function*(t){let e=yield*x(["clean","-ffdx"],{cwd:t});if(e.code===0)return e;let n=ie(e.stderr,e.text);return n.length?(yield*Ve(t,n),yield*x(["clean","-ffdx"],{cwd:t})):e}),Xe=o.fn("Worktree.reset")(function*(t){if(g.project.vcs!=="git")throw new r.NotGitError({message:"Worktrees are only supported for git projects"});let e=yield*M(t.directory),n=yield*M(g.worktree);if(e===n)throw new r.ResetFailedError({message:"Cannot reset the primary workspace"});let c=yield*x(["worktree","list","--porcelain"],{cwd:g.worktree});if(c.code!==0)throw new r.ResetFailedError({message:c.stderr||c.text||"Failed to read git worktrees"});let f=yield*ce(se(c.text),e);if(!f?.path)throw new r.ResetFailedError({message:"Worktree not found"});let l=f.path,b=yield*o.promise(()=>O.defaultBranch(g.worktree));if(!b)throw new r.ResetFailedError({message:"Default branch not found"});let v=b.ref.indexOf("/");if(b.ref!==b.name&&v>0){let k=b.ref.slice(0,v),Je=b.ref.slice(v+1);yield*_(["fetch",k,Je],{cwd:g.worktree},Fe=>new r.ResetFailedError({message:Fe.stderr||Fe.text||`Failed to fetch ${b.ref}`}))}yield*_(["reset","--hard",b.ref],{cwd:l},k=>new r.ResetFailedError({message:k.stderr||k.text||"Failed to reset worktree to target"}));let R=yield*Oe(l);if(R.code!==0)throw new r.ResetFailedError({message:R.stderr||R.text||"Failed to clean worktree"});yield*_(["submodule","update","--init","--recursive","--force"],{cwd:l},k=>new r.ResetFailedError({message:k.stderr||k.text||"Failed to update submodules"})),yield*_(["submodule","foreach","--recursive","git","reset","--hard"],{cwd:l},k=>new r.ResetFailedError({message:k.stderr||k.text||"Failed to reset submodules"})),yield*_(["submodule","foreach","--recursive","git","clean","-fdx"],{cwd:l},k=>new r.ResetFailedError({message:k.stderr||k.text||"Failed to clean submodules"}));let H=yield*x(["-c","core.fsmonitor=false","status","--porcelain=v1"],{cwd:l});if(H.code!==0)throw new r.ResetFailedError({message:H.stderr||H.text||"Failed to read git status"});if(H.text.trim())throw new r.ResetFailedError({message:`Worktree reset left local changes:
|
|
18
|
-
${H.text.trim()}`});return yield*Ee(l,{projectID:g.project.id}).pipe(o.catchCause(k=>o.sync(()=>E.error("worktree start task failed",{cause:k}))),o.forkIn(i)),!0});return C.of({makeWorktreeInfo:xe,createFromInfo:We,create:_e,remove:He,reset:Xe})}));let we=r.layer.pipe(X.provide(Pe),X.provide(T.defaultLayer),X.provide(A.defaultLayer),X.provide(rt.layer)),{runPromise:U}=Y(C,we);async function Ne(i){return U(a=>a.makeWorktreeInfo(i))}r.makeWorktreeInfo=Ne,m(Ne,"makeWorktreeInfo");async function P(i,a){return U(w=>w.createFromInfo(i,a))}r.createFromInfo=P,m(P,"createFromInfo");async function d(i){return U(a=>a.create(i))}r.create=d,m(d,"create");async function s(i){return U(a=>a.remove(i))}r.remove=s,m(s,"remove");async function u(i){return U(a=>a.reset(i))}r.reset=u,m(u,"reset")})(nt||={});import N from"zod";var ir=N.object({id:Ue.zod,type:N.string(),branch:N.string().nullable(),name:N.string().nullable(),directory:N.string().nullable(),extra:N.unknown().nullable(),projectID:Re.zod});export{ue as a,Te as b,nt as c,ir as d};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a}from"./chunk-YRY5Y3QL.js";import"./chunk-FXLFZ5DL.js";import"./chunk-PWFRMDDF.js";import"./chunk-CZVKIDQZ.js";import"./chunk-MBZTOEAD.js";export{a as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as e}from"./chunk-CZVKIDQZ.js";import{a as t}from"./chunk-MBZTOEAD.js";async function a(){try{let{JSONSchema:r}=await import("effect");return n=>r.make(n)}catch{throw new e("effect")}}t(a,"getToJsonSchemaFn");export{a as default};
|
package/dist/log-MVJ7H4K5.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{e as a}from"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as Log};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as p}from"./chunk-MBZTOEAD.js";import*as i from"@lydell/node-pty";function a(o,n,e){let r=i.spawn(o,n,e);return{pid:r.pid,onData(t){return r.onData(t)},onExit(t){return r.onExit(t)},write(t){r.write(t)},resize(t,s){r.resize(t,s)},kill(t){r.kill(t)}}}p(a,"spawn");export{a as spawn};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{I as a}from"./chunk-XJGIPERR.js";import"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as ToolRegistry};
|
package/dist/run-XDEC53H6.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as He}from"./chunk-NLFNI3VW.js";import{b as Xe}from"./chunk-YDTJPTBK.js";import"./chunk-2ANK3QEN.js";import"./chunk-PWFRMDDF.js";import"./chunk-GXWCFXGG.js";import{t as Ge,x as Be}from"./chunk-XJGIPERR.js";import{d as Fe,e as We,y as V}from"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import{c as H}from"./chunk-M4CB72HE.js";import"./chunk-CZVKIDQZ.js";import{a as s,b as lr}from"./chunk-MBZTOEAD.js";import B from"path";import{pathToFileURL as Sr}from"url";import ur from"zod";import{EOL as J}from"os";var Q={left:[" ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584","\u2588__\u2588 \u2588__\u2588 \u2588^^^ \u2588__\u2588","\u2580\u2580\u2580\u2580 \u2588\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580~~\u2580"],right:[" \u2584 ","\u2588\u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588","\u2588___ \u2588__\u2588 \u2588__\u2588 \u2588^^^","\u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580"]};var f;(c=>{let n=["\u2800 \u2584 ","\u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2584 \u2588\u2580\u2580\u2580 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588 \u2588\u2580\u2580\u2588","\u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580\u2580 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588 \u2588\u2580\u2580\u2580","\u2580\u2580\u2580\u2580 \u2588\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580 \u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580 \u2580\u2580\u2580\u2580"];c.CancelledError=Fe.create("UICancelledError",ur.void()),c.Style={TEXT_HIGHLIGHT:"\x1B[96m",TEXT_HIGHLIGHT_BOLD:"\x1B[96m\x1B[1m",TEXT_DIM:"\x1B[90m",TEXT_DIM_BOLD:"\x1B[90m\x1B[1m",TEXT_NORMAL:"\x1B[0m",TEXT_NORMAL_BOLD:"\x1B[1m",TEXT_WARNING:"\x1B[93m",TEXT_WARNING_BOLD:"\x1B[93m\x1B[1m",TEXT_DANGER:"\x1B[91m",TEXT_DANGER_BOLD:"\x1B[91m\x1B[1m",TEXT_SUCCESS:"\x1B[92m",TEXT_SUCCESS_BOLD:"\x1B[92m\x1B[1m",TEXT_INFO:"\x1B[94m",TEXT_INFO_BOLD:"\x1B[94m\x1B[1m"};function t(...h){a(...h),process.stderr.write(J)}c.println=t,s(t,"println");function a(...h){u=!1,process.stderr.write(h.join(" "))}c.print=a,s(a,"print");let u=!1;function d(){u||(t(""+c.Style.TEXT_NORMAL),u=!0)}c.empty=d,s(d,"empty");function l(h){if(!process.stdout.isTTY&&!process.stderr.isTTY){let p=[];for(let T of n)h&&p.push(h),p.push(T),p.push(J);return p.join("").trimEnd()}let w=[],v="\x1B[0m",b={fg:"\x1B[90m",shadow:"\x1B[38;5;235m",bg:"\x1B[48;5;235m"},O={fg:v,shadow:"\x1B[38;5;238m",bg:"\x1B[48;5;238m"},g=" ",E=s((p,T,R,S)=>{let x=[];for(let D of p){if(D==="_"){x.push(S," ",v);continue}if(D==="^"){x.push(T,S,"\u2580",v);continue}if(D==="~"){x.push(R,"\u2580",v);continue}if(D===" "){x.push(" ");continue}x.push(T,D,v)}return x.join("")},"draw");return Q.left.forEach((p,T)=>{h&&w.push(h),w.push(E(p,b.fg,b.shadow,b.bg)),w.push(g);let R=Q.right[T]??"";w.push(E(R,O.fg,O.shadow,O.bg)),w.push(J)}),w.join("").trimEnd()}c.logo=l,s(l,"logo");async function m(h){let v=lr("readline").createInterface({input:process.stdin,output:process.stdout});return new Promise(b=>{v.question(h,O=>{v.close(),b(O.trim())})})}c.input=m,s(m,"input");function y(h){h.startsWith("Error: ")&&(h=h.slice(7)),t(c.Style.TEXT_DANGER_BOLD+"Error: "+c.Style.TEXT_NORMAL+h)}c.error=y,s(y,"error");function o(h){return h}c.markdown=o,s(o,"markdown")})(f||={});async function Ve(n,r){return V.provide({directory:n,init:Xe,fn:s(async()=>{try{return await r()}finally{await V.dispose()}},"fn")})}s(Ve,"bootstrap");import{EOL as G}from"os";var Qe=s(({onRequest:n,onSseError:r,onSseEvent:e,responseTransformer:t,responseValidator:a,sseDefaultRetryDelay:u,sseMaxRetryAttempts:d,sseMaxRetryDelay:l,sseSleepFn:m,url:y,...o})=>{let c,h=m??(b=>new Promise(O=>setTimeout(O,b)));return{stream:s(async function*(){let b=u??3e3,O=0,g=o.signal??new AbortController().signal;for(;!g.aborted;){O++;let E=o.headers instanceof Headers?o.headers:new Headers(o.headers);c!==void 0&&E.set("Last-Event-ID",c);try{let p={redirect:"follow",...o,body:o.serializedBody,headers:E,signal:g},T=new Request(y,p);n&&(T=await n(y,p));let S=await(o.fetch??globalThis.fetch)(T);if(!S.ok)throw new Error(`SSE failed: ${S.status} ${S.statusText}`);if(!S.body)throw new Error("No body in SSE response");let x=S.body.pipeThrough(new TextDecoderStream).getReader(),D="",Me=s(()=>{try{x.cancel()}catch{}},"abortHandler");g.addEventListener("abort",Me);try{for(;;){let{done:ir,value:ar}=await x.read();if(ir)break;D+=ar,D=D.replace(/\r\n/g,`
|
|
13
|
-
`).replace(/\r/g,`
|
|
14
|
-
`);let $e=D.split(`
|
|
15
|
-
|
|
16
|
-
`);D=$e.pop()??"";for(let cr of $e){let pr=cr.split(`
|
|
17
|
-
`),$=[],Le;for(let C of pr)if(C.startsWith("data:"))$.push(C.replace(/^data:\s*/,""));else if(C.startsWith("event:"))Le=C.replace(/^event:\s*/,"");else if(C.startsWith("id:"))c=C.replace(/^id:\s*/,"");else if(C.startsWith("retry:")){let Ue=Number.parseInt(C.replace(/^retry:\s*/,""),10);Number.isNaN(Ue)||(b=Ue)}let P,Ne=!1;if($.length){let C=$.join(`
|
|
18
|
-
`);try{P=JSON.parse(C),Ne=!0}catch{P=C}}Ne&&(a&&await a(P),t&&(P=await t(P))),e?.({data:P,event:Le,id:c,retry:b}),$.length&&(yield P)}}}finally{g.removeEventListener("abort",Me),x.releaseLock()}break}catch(p){if(r?.(p),d!==void 0&&O>=d)break;let T=Math.min(b*2**(O-1),l??3e4);await h(T)}}},"createStream")()}},"createSseClient");var dr=s(n=>{switch(n){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorArrayExplode"),yr=s(n=>{switch(n){case"form":return",";case"pipeDelimited":return"|";case"spaceDelimited":return"%20";default:return","}},"separatorArrayNoExplode"),hr=s(n=>{switch(n){case"label":return".";case"matrix":return";";case"simple":return",";default:return"&"}},"separatorObjectExplode"),L=s(({allowReserved:n,explode:r,name:e,style:t,value:a})=>{if(!r){let l=(n?a:a.map(m=>encodeURIComponent(m))).join(yr(t));switch(t){case"label":return`.${l}`;case"matrix":return`;${e}=${l}`;case"simple":return l;default:return`${e}=${l}`}}let u=dr(t),d=a.map(l=>t==="label"||t==="simple"?n?l:encodeURIComponent(l):A({allowReserved:n,name:e,value:l})).join(u);return t==="label"||t==="matrix"?u+d:d},"serializeArrayParam"),A=s(({allowReserved:n,name:r,value:e})=>{if(e==null)return"";if(typeof e=="object")throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");return`${r}=${n?e:encodeURIComponent(e)}`},"serializePrimitiveParam"),N=s(({allowReserved:n,explode:r,name:e,style:t,value:a,valueOnly:u})=>{if(a instanceof Date)return u?a.toISOString():`${e}=${a.toISOString()}`;if(t!=="deepObject"&&!r){let m=[];Object.entries(a).forEach(([o,c])=>{m=[...m,o,n?c:encodeURIComponent(c)]});let y=m.join(",");switch(t){case"form":return`${e}=${y}`;case"label":return`.${y}`;case"matrix":return`;${e}=${y}`;default:return y}}let d=hr(t),l=Object.entries(a).map(([m,y])=>A({allowReserved:n,name:t==="deepObject"?`${e}[${m}]`:m,value:y})).join(d);return t==="label"||t==="matrix"?d+l:l},"serializeObjectParam");var gr=/\{[^{}]+\}/g,mr=s(({path:n,url:r})=>{let e=r,t=r.match(gr);if(t)for(let a of t){let u=!1,d=a.substring(1,a.length-1),l="simple";d.endsWith("*")&&(u=!0,d=d.substring(0,d.length-1)),d.startsWith(".")?(d=d.substring(1),l="label"):d.startsWith(";")&&(d=d.substring(1),l="matrix");let m=n[d];if(m==null)continue;if(Array.isArray(m)){e=e.replace(a,L({explode:u,name:d,style:l,value:m}));continue}if(typeof m=="object"){e=e.replace(a,N({explode:u,name:d,style:l,value:m,valueOnly:!0}));continue}if(l==="matrix"){e=e.replace(a,`;${A({name:d,value:m})}`);continue}let y=encodeURIComponent(l==="label"?`.${m}`:m);e=e.replace(a,y)}return e},"defaultPathSerializer"),Je=s(({baseUrl:n,path:r,query:e,querySerializer:t,url:a})=>{let u=a.startsWith("/")?a:`/${a}`,d=(n??"")+u;r&&(d=mr({path:r,url:d}));let l=e?t(e):"";return l.startsWith("?")&&(l=l.substring(1)),l&&(d+=`?${l}`),d},"getUrl");function K(n){let r=n.body!==void 0;if(r&&n.bodySerializer)return"serializedBody"in n?n.serializedBody!==void 0&&n.serializedBody!==""?n.serializedBody:null:n.body!==""?n.body:null;if(r)return n.body}s(K,"getValidRequestBody");var Ke=s(async(n,r)=>{let e=typeof r=="function"?await r(n):r;if(e)return n.scheme==="bearer"?`Bearer ${e}`:n.scheme==="basic"?`Basic ${btoa(e)}`:e},"getAuthToken");var Y={bodySerializer:s(n=>JSON.stringify(n,(r,e)=>typeof e=="bigint"?e.toString():e),"bodySerializer")};var Ye=s(({parameters:n={},...r}={})=>s(t=>{let a=[];if(t&&typeof t=="object")for(let u in t){let d=t[u];if(d==null)continue;let l=n[u]||r;if(Array.isArray(d)){let m=L({allowReserved:l.allowReserved,explode:!0,name:u,style:"form",value:d,...l.array});m&&a.push(m)}else if(typeof d=="object"){let m=N({allowReserved:l.allowReserved,explode:!0,name:u,style:"deepObject",value:d,...l.object});m&&a.push(m)}else{let m=A({allowReserved:l.allowReserved,name:u,value:d});m&&a.push(m)}}return a.join("&")},"querySerializer"),"createQuerySerializer"),Ze=s(n=>{if(!n)return"stream";let r=n.split(";")[0]?.trim();if(r){if(r.startsWith("application/json")||r.endsWith("+json"))return"json";if(r==="multipart/form-data")return"formData";if(["application/","audio/","image/","video/"].some(e=>r.startsWith(e)))return"blob";if(r.startsWith("text/"))return"text"}},"getParseAs"),fr=s((n,r)=>r?!!(n.headers.has(r)||n.query?.[r]||n.headers.get("Cookie")?.includes(`${r}=`)):!1,"checkForExistence"),er=s(async({security:n,...r})=>{for(let e of n){if(fr(r,e.name))continue;let t=await Ke(e,r.auth);if(!t)continue;let a=e.name??"Authorization";switch(e.in){case"query":r.query||(r.query={}),r.query[a]=t;break;case"cookie":r.headers.append("Cookie",`${a}=${t}`);break;default:r.headers.set(a,t);break}}},"setAuthParams"),Z=s(n=>Je({baseUrl:n.baseUrl,path:n.path,query:n.query,querySerializer:typeof n.querySerializer=="function"?n.querySerializer:Ye(n.querySerializer),url:n.url}),"buildUrl"),ee=s((n,r)=>{let e={...n,...r};return e.baseUrl?.endsWith("/")&&(e.baseUrl=e.baseUrl.substring(0,e.baseUrl.length-1)),e.headers=U(n.headers,r.headers),e},"mergeConfigs"),wr=s(n=>{let r=[];return n.forEach((e,t)=>{r.push([t,e])}),r},"headersEntries"),U=s((...n)=>{let r=new Headers;for(let e of n){if(!e)continue;let t=e instanceof Headers?wr(e):Object.entries(e);for(let[a,u]of t)if(u===null)r.delete(a);else if(Array.isArray(u))for(let d of u)r.append(a,d);else u!==void 0&&r.set(a,typeof u=="object"?JSON.stringify(u):u)}return r},"mergeHeaders"),j=class{static{s(this,"Interceptors")}fns=[];clear(){this.fns=[]}eject(r){let e=this.getInterceptorIndex(r);this.fns[e]&&(this.fns[e]=null)}exists(r){let e=this.getInterceptorIndex(r);return!!this.fns[e]}getInterceptorIndex(r){return typeof r=="number"?this.fns[r]?r:-1:this.fns.indexOf(r)}update(r,e){let t=this.getInterceptorIndex(r);return this.fns[t]?(this.fns[t]=e,r):!1}use(r){return this.fns.push(r),this.fns.length-1}},rr=s(()=>({error:new j,request:new j,response:new j}),"createInterceptors"),kr=Ye({allowReserved:!1,array:{explode:!0,style:"form"},object:{explode:!0,style:"deepObject"}}),br={"Content-Type":"application/json"},z=s((n={})=>({...Y,headers:br,parseAs:"auto",querySerializer:kr,...n}),"createConfig");var M=s((n={})=>{let r=ee(z(),n),e=s(()=>({...r}),"getConfig"),t=s(y=>(r=ee(r,y),e()),"setConfig"),a=rr(),u=s(async y=>{let o={...r,...y,fetch:y.fetch??r.fetch??globalThis.fetch,headers:U(r.headers,y.headers),serializedBody:void 0};o.security&&await er({...o,security:o.security}),o.requestValidator&&await o.requestValidator(o),o.body!==void 0&&o.bodySerializer&&(o.serializedBody=o.bodySerializer(o.body)),(o.body===void 0||o.serializedBody==="")&&o.headers.delete("Content-Type");let c=Z(o);return{opts:o,url:c}},"beforeRequest"),d=s(async y=>{let{opts:o,url:c}=await u(y),h={redirect:"follow",...o,body:K(o)},w=new Request(c,h);for(let R of a.request.fns)R&&(w=await R(w,o));let v=o.fetch,b;try{b=await v(w)}catch(R){let S=R;for(let x of a.error.fns)x&&(S=await x(R,void 0,w,o));if(S=S||{},o.throwOnError)throw S;return o.responseStyle==="data"?void 0:{error:S,request:w,response:void 0}}for(let R of a.response.fns)R&&(b=await R(b,w,o));let O={request:w,response:b};if(b.ok){let R=(o.parseAs==="auto"?Ze(b.headers.get("Content-Type")):o.parseAs)??"json";if(b.status===204||b.headers.get("Content-Length")==="0"){let x;switch(R){case"arrayBuffer":case"blob":case"text":x=await b[R]();break;case"formData":x=new FormData;break;case"stream":x=b.body;break;default:x={};break}return o.responseStyle==="data"?x:{data:x,...O}}let S;switch(R){case"arrayBuffer":case"blob":case"formData":case"text":S=await b[R]();break;case"json":{let x=await b.text();S=x?JSON.parse(x):{};break}case"stream":return o.responseStyle==="data"?b.body:{data:b.body,...O}}return R==="json"&&(o.responseValidator&&await o.responseValidator(S),o.responseTransformer&&(S=await o.responseTransformer(S))),o.responseStyle==="data"?S:{data:S,...O}}let g=await b.text(),E;try{E=JSON.parse(g)}catch{}let p=E??g,T=p;for(let R of a.error.fns)R&&(T=await R(p,b,w,o));if(T=T||{},o.throwOnError)throw T;return o.responseStyle==="data"?void 0:{error:T,...O}},"request"),l=s(y=>o=>d({...o,method:y}),"makeMethodFn"),m=s(y=>async o=>{let{opts:c,url:h}=await u(o);return Qe({...c,body:c.body,headers:c.headers,method:y,onRequest:s(async(w,v)=>{let b=new Request(w,v);for(let O of a.request.fns)O&&(b=await O(b,c));return b},"onRequest"),serializedBody:K(c),url:h})},"makeSseFn");return{buildUrl:Z,connect:l("CONNECT"),delete:l("DELETE"),get:l("GET"),getConfig:e,head:l("HEAD"),interceptors:a,options:l("OPTIONS"),patch:l("PATCH"),post:l("POST"),put:l("PUT"),request:d,setConfig:t,sse:{connect:m("CONNECT"),delete:m("DELETE"),get:m("GET"),head:m("HEAD"),options:m("OPTIONS"),patch:m("PATCH"),post:m("POST"),put:m("PUT"),trace:m("TRACE")},trace:l("TRACE")}},"createClient");var Tr={$body_:"body",$headers_:"headers",$path_:"path",$query_:"query"},Or=Object.entries(Tr),tr=s((n,r)=>{r||(r=new Map);for(let e of n)"in"in e?e.key&&r.set(e.key,{in:e.in,map:e.map}):"key"in e?r.set(e.key,{map:e.map}):e.args&&tr(e.args,r);return r},"buildKeyMap"),Er=s(n=>{for(let[r,e]of Object.entries(n))e&&typeof e=="object"&&!Object.keys(e).length&&delete n[r]},"stripEmptySlots"),i=s((n,r)=>{let e={body:{},headers:{},path:{},query:{}},t=tr(r),a;for(let[u,d]of n.entries())if(r[u]&&(a=r[u]),!!a)if("in"in a)if(a.key){let l=t.get(a.key),m=l.map||a.key;l.in&&(e[l.in][m]=d)}else e.body=d;else for(let[l,m]of Object.entries(d??{})){let y=t.get(l);if(y)if(y.in){let o=y.map||l;e[y.in][o]=m}else e[y.map]=m;else{let o=Or.find(([c])=>l.startsWith(c));if(o){let[c,h]=o;e[h][l.slice(c.length)]=m}else if("allowExtra"in a&&a.allowExtra){for(let[c,h]of Object.entries(a.allowExtra))if(h){e[c][l]=m;break}}}}return Er(e),e},"buildClientParams");var nr=M(z({baseUrl:"http://localhost:4096"}));var k=class{static{s(this,"HeyApiClient")}client;constructor(r){this.client=r?.client??nr}},re=class{static{s(this,"HeyApiRegistry")}defaultKey="default";instances=new Map;get(r){let e=this.instances.get(r??this.defaultKey);if(!e)throw new Error('No SDK client found. Create one with "new OpencodeClient()" to fix this error.');return e}set(r,e){this.instances.set(e??this.defaultKey,r)}},te=class extends k{static{s(this,"SyncEvent")}subscribe(r){return(r?.client??this.client).sse.get({url:"/global/sync-event",...r})}},ne=class extends k{static{s(this,"Config")}get(r){return(r?.client??this.client).get({url:"/global/config",...r})}update(r,e){let t=i([r],[{args:[{key:"config",map:"body"}]}]);return(e?.client??this.client).patch({url:"/global/config",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},se=class extends k{static{s(this,"Global")}health(r){return(r?.client??this.client).get({url:"/global/health",...r})}event(r){return(r?.client??this.client).sse.get({url:"/global/event",...r})}dispose(r){return(r?.client??this.client).post({url:"/global/dispose",...r})}upgrade(r,e){let t=i([r],[{args:[{in:"body",key:"target"}]}]);return(e?.client??this.client).post({url:"/global/upgrade",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}_syncEvent;get syncEvent(){return this._syncEvent??=new te({client:this.client})}_config;get config(){return this._config??=new ne({client:this.client})}},oe=class extends k{static{s(this,"Auth")}remove(r,e){let t=i([r],[{args:[{in:"path",key:"providerID"}]}]);return(e?.client??this.client).delete({url:"/auth/{providerID}",...e,...t})}set(r,e){let t=i([r],[{args:[{in:"path",key:"providerID"},{key:"auth",map:"body"}]}]);return(e?.client??this.client).put({url:"/auth/{providerID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},ie=class extends k{static{s(this,"App")}log(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"service"},{in:"body",key:"level"},{in:"body",key:"message"},{in:"body",key:"extra"}]}]);return(e?.client??this.client).post({url:"/log",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}agents(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/agent",...e,...t})}skills(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/skill",...e,...t})}},ae=class extends k{static{s(this,"Project")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/project",...e,...t})}current(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/project/current",...e,...t})}initGit(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/project/git/init",...e,...t})}update(r,e){let t=i([r],[{args:[{in:"path",key:"projectID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"icon"},{in:"body",key:"commands"}]}]);return(e?.client??this.client).patch({url:"/project/{projectID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},ce=class extends k{static{s(this,"Pty")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/pty",...e,...t})}create(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"},{in:"body",key:"args"},{in:"body",key:"cwd"},{in:"body",key:"title"},{in:"body",key:"env"}]}]);return(e?.client??this.client).post({url:"/pty",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}remove(r,e){let t=i([r],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/pty/{ptyID}",...e,...t})}get(r,e){let t=i([r],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/pty/{ptyID}",...e,...t})}update(r,e){let t=i([r],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"size"}]}]);return(e?.client??this.client).put({url:"/pty/{ptyID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}connect(r,e){let t=i([r],[{args:[{in:"path",key:"ptyID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/pty/{ptyID}/connect",...e,...t})}},pe=class extends k{static{s(this,"Config2")}get(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/config",...e,...t})}update(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"config",map:"body"}]}]);return(e?.client??this.client).patch({url:"/config",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}providers(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/config/providers",...e,...t})}},le=class extends k{static{s(this,"Console")}get(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/console",...e,...t})}listOrgs(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/console/orgs",...e,...t})}switchOrg(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"accountID"},{in:"body",key:"orgID"}]}]);return(e?.client??this.client).post({url:"/experimental/console/switch",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},ue=class extends k{static{s(this,"Workspace")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/workspace",...e,...t})}create(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"id"},{in:"body",key:"type"},{in:"body",key:"branch"},{in:"body",key:"extra"}]}]);return(e?.client??this.client).post({url:"/experimental/workspace",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}remove(r,e){let t=i([r],[{args:[{in:"path",key:"id"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/experimental/workspace/{id}",...e,...t})}},de=class extends k{static{s(this,"Session")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"cursor"},{in:"query",key:"search"},{in:"query",key:"limit"},{in:"query",key:"archived"}]}]);return(e?.client??this.client).get({url:"/experimental/session",...e,...t})}},ye=class extends k{static{s(this,"Resource")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/resource",...e,...t})}},he=class extends k{static{s(this,"Experimental")}_console;get console(){return this._console??=new le({client:this.client})}_workspace;get workspace(){return this._workspace??=new ue({client:this.client})}_session;get session(){return this._session??=new de({client:this.client})}_resource;get resource(){return this._resource??=new ye({client:this.client})}},ge=class extends k{static{s(this,"Tool")}ids(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/tool/ids",...e,...t})}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"provider"},{in:"query",key:"model"}]}]);return(e?.client??this.client).get({url:"/experimental/tool",...e,...t})}},me=class extends k{static{s(this,"Worktree")}remove(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeRemoveInput",map:"body"}]}]);return(e?.client??this.client).delete({url:"/experimental/worktree",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/experimental/worktree",...e,...t})}create(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeCreateInput",map:"body"}]}]);return(e?.client??this.client).post({url:"/experimental/worktree",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}reset(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"worktreeResetInput",map:"body"}]}]);return(e?.client??this.client).post({url:"/experimental/worktree/reset",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},fe=class extends k{static{s(this,"Session2")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"roots"},{in:"query",key:"start"},{in:"query",key:"search"},{in:"query",key:"limit"}]}]);return(e?.client??this.client).get({url:"/session",...e,...t})}create(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"parentID"},{in:"body",key:"title"},{in:"body",key:"permission"},{in:"body",key:"workspaceID"}]}]);return(e?.client??this.client).post({url:"/session",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}status(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/session/status",...e,...t})}delete(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/session/{sessionID}",...e,...t})}get(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}",...e,...t})}update(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"time"}]}]);return(e?.client??this.client).patch({url:"/session/{sessionID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}children(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}/children",...e,...t})}todo(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}/todo",...e,...t})}init(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"modelID"},{in:"body",key:"providerID"},{in:"body",key:"messageID"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/init",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}fork(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/fork",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}abort(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/abort",...e,...t})}unshare(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/session/{sessionID}/share",...e,...t})}share(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/share",...e,...t})}diff(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"messageID"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}/diff",...e,...t})}summarize(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"providerID"},{in:"body",key:"modelID"},{in:"body",key:"auto"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/summarize",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}messages(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"limit"},{in:"query",key:"before"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}/message",...e,...t})}prompt(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/message",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}deleteMessage(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}",...e,...t})}message(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/session/{sessionID}/message/{messageID}",...e,...t})}promptAsync(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"model"},{in:"body",key:"agent"},{in:"body",key:"noReply"},{in:"body",key:"tools"},{in:"body",key:"format"},{in:"body",key:"system"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/prompt_async",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}command(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"arguments"},{in:"body",key:"command"},{in:"body",key:"variant"},{in:"body",key:"parts"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/command",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}shell(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"agent"},{in:"body",key:"model"},{in:"body",key:"command"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/shell",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}revert(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"messageID"},{in:"body",key:"partID"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/revert",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}unrevert(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/unrevert",...e,...t})}},we=class extends k{static{s(this,"Part")}delete(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...t})}update(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"messageID"},{in:"path",key:"partID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"part",map:"body"}]}]);return(e?.client??this.client).patch({url:"/session/{sessionID}/message/{messageID}/part/{partID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},ke=class extends k{static{s(this,"Permission")}respond(r,e){let t=i([r],[{args:[{in:"path",key:"sessionID"},{in:"path",key:"permissionID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"response"}]}]);return(e?.client??this.client).post({url:"/session/{sessionID}/permissions/{permissionID}",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}reply(r,e){let t=i([r],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"reply"},{in:"body",key:"message"}]}]);return(e?.client??this.client).post({url:"/permission/{requestID}/reply",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/permission",...e,...t})}},be=class extends k{static{s(this,"Question")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/question",...e,...t})}reply(r,e){let t=i([r],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"answers"}]}]);return(e?.client??this.client).post({url:"/question/{requestID}/reply",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}reject(r,e){let t=i([r],[{args:[{in:"path",key:"requestID"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/question/{requestID}/reject",...e,...t})}},Te=class extends k{static{s(this,"Oauth")}authorize(r,e){let t=i([r],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"inputs"}]}]);return(e?.client??this.client).post({url:"/provider/{providerID}/oauth/authorize",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}callback(r,e){let t=i([r],[{args:[{in:"path",key:"providerID"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"method"},{in:"body",key:"code"}]}]);return(e?.client??this.client).post({url:"/provider/{providerID}/oauth/callback",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},Oe=class extends k{static{s(this,"Provider")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/provider",...e,...t})}auth(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/provider/auth",...e,...t})}_oauth;get oauth(){return this._oauth??=new Te({client:this.client})}},Ee=class extends k{static{s(this,"Find")}text(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"pattern"}]}]);return(e?.client??this.client).get({url:"/find",...e,...t})}files(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"},{in:"query",key:"dirs"},{in:"query",key:"type"},{in:"query",key:"limit"}]}]);return(e?.client??this.client).get({url:"/find/file",...e,...t})}symbols(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"query"}]}]);return(e?.client??this.client).get({url:"/find/symbol",...e,...t})}},Re=class extends k{static{s(this,"File")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(e?.client??this.client).get({url:"/file",...e,...t})}read(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"path"}]}]);return(e?.client??this.client).get({url:"/file/content",...e,...t})}status(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/file/status",...e,...t})}},xe=class extends k{static{s(this,"Event")}subscribe(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).sse.get({url:"/event",...e,...t})}},Se=class extends k{static{s(this,"Auth2")}remove(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).delete({url:"/mcp/{name}/auth",...e,...t})}start(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/mcp/{name}/auth",...e,...t})}callback(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"code"}]}]);return(e?.client??this.client).post({url:"/mcp/{name}/auth/callback",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}authenticate(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/mcp/{name}/auth/authenticate",...e,...t})}},ve=class extends k{static{s(this,"Mcp")}status(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/mcp",...e,...t})}add(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"name"},{in:"body",key:"config"}]}]);return(e?.client??this.client).post({url:"/mcp",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}connect(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/mcp/{name}/connect",...e,...t})}disconnect(r,e){let t=i([r],[{args:[{in:"path",key:"name"},{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/mcp/{name}/disconnect",...e,...t})}_auth;get auth(){return this._auth??=new Se({client:this.client})}},qe=class extends k{static{s(this,"Control")}next(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/tui/control/next",...e,...t})}response(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(e?.client??this.client).post({url:"/tui/control/response",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}},Ie=class extends k{static{s(this,"Tui")}appendPrompt(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"text"}]}]);return(e?.client??this.client).post({url:"/tui/append-prompt",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}openHelp(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/open-help",...e,...t})}openSessions(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/open-sessions",...e,...t})}openThemes(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/open-themes",...e,...t})}openModels(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/open-models",...e,...t})}submitPrompt(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/submit-prompt",...e,...t})}clearPrompt(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/tui/clear-prompt",...e,...t})}executeCommand(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"command"}]}]);return(e?.client??this.client).post({url:"/tui/execute-command",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}showToast(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"title"},{in:"body",key:"message"},{in:"body",key:"variant"},{in:"body",key:"duration"}]}]);return(e?.client??this.client).post({url:"/tui/show-toast",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}publish(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{key:"body",map:"body"}]}]);return(e?.client??this.client).post({url:"/tui/publish",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}selectSession(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"body",key:"sessionID"}]}]);return(e?.client??this.client).post({url:"/tui/select-session",...e,...t,headers:{"Content-Type":"application/json",...e?.headers,...t.headers}})}_control;get control(){return this._control??=new qe({client:this.client})}},De=class extends k{static{s(this,"Instance")}dispose(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).post({url:"/instance/dispose",...e,...t})}},Ce=class extends k{static{s(this,"Path")}get(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/path",...e,...t})}},Pe=class extends k{static{s(this,"Vcs")}get(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/vcs",...e,...t})}diff(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"},{in:"query",key:"mode"}]}]);return(e?.client??this.client).get({url:"/vcs/diff",...e,...t})}},Ae=class extends k{static{s(this,"Command")}list(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/command",...e,...t})}},_e=class extends k{static{s(this,"Lsp")}status(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/lsp",...e,...t})}},je=class extends k{static{s(this,"Formatter")}status(r,e){let t=i([r],[{args:[{in:"query",key:"directory"},{in:"query",key:"workspace"}]}]);return(e?.client??this.client).get({url:"/formatter",...e,...t})}},F=class n extends k{static{s(this,"OpencodeClient")}static __registry=new re;constructor(r){super(r),n.__registry.set(this,r?.key)}_global;get global(){return this._global??=new se({client:this.client})}_auth;get auth(){return this._auth??=new oe({client:this.client})}_app;get app(){return this._app??=new ie({client:this.client})}_project;get project(){return this._project??=new ae({client:this.client})}_pty;get pty(){return this._pty??=new ce({client:this.client})}_config;get config(){return this._config??=new pe({client:this.client})}_experimental;get experimental(){return this._experimental??=new he({client:this.client})}_tool;get tool(){return this._tool??=new ge({client:this.client})}_worktree;get worktree(){return this._worktree??=new me({client:this.client})}_session;get session(){return this._session??=new fe({client:this.client})}_part;get part(){return this._part??=new we({client:this.client})}_permission;get permission(){return this._permission??=new ke({client:this.client})}_question;get question(){return this._question??=new be({client:this.client})}_provider;get provider(){return this._provider??=new Oe({client:this.client})}_find;get find(){return this._find??=new Ee({client:this.client})}_file;get file(){return this._file??=new Re({client:this.client})}_event;get event(){return this._event??=new xe({client:this.client})}_mcp;get mcp(){return this._mcp??=new ve({client:this.client})}_tui;get tui(){return this._tui??=new Ie({client:this.client})}_instance;get instance(){return this._instance??=new De({client:this.client})}_path;get path(){return this._path??=new Ce({client:this.client})}_vcs;get vcs(){return this._vcs??=new Pe({client:this.client})}_command;get command(){return this._command??=new Ae({client:this.client})}_lsp;get lsp(){return this._lsp??=new _e({client:this.client})}_formatter;get formatter(){return this._formatter??=new je({client:this.client})}};function Rr(n,r,e){if(n)return r&&(n===r||e&&n===e(r))?r:n}s(Rr,"pick");function xr(n,r){if(n.method!=="GET"&&n.method!=="HEAD")return n;let e=new URL(n.url),t=!1;for(let[u,d]of[["x-opencode-directory","directory"],["x-opencode-workspace","workspace"]]){let l=Rr(n.headers.get(u),d==="directory"?r.directory:r.workspace,d==="directory"?encodeURIComponent:void 0);l&&(e.searchParams.has(d)||e.searchParams.set(d,l),t=!0)}if(!t)return n;let a=new Request(e,n);return a.headers.delete("x-opencode-directory"),a.headers.delete("x-opencode-workspace"),a}s(xr,"rewrite");function W(n){n?.fetch||(n={...n,fetch:s(t=>(t.timeout=!1,fetch(t)),"customFetch")}),n?.directory&&(n.headers={...n.headers,"x-opencode-directory":encodeURIComponent(n.directory)}),n?.experimental_workspaceID&&(n.headers={...n.headers,"x-opencode-workspace":n.experimental_workspaceID});let r=M(n);return r.interceptors.request.use(e=>xr(e,{directory:n?.directory,workspace:n?.experimental_workspaceID})),new F({client:r})}s(W,"createOpencodeClient");import Ht from"cross-spawn";var ze;(y=>{function n(o){return o.replace(/\b\w/g,c=>c.toUpperCase())}y.titlecase=n,s(n,"titlecase");function r(o){return new Date(o).toLocaleTimeString(void 0,{timeStyle:"short"})}y.time=r,s(r,"time");function e(o){let c=new Date(o),h=r(o),w=c.toLocaleDateString();return`${h} \xB7 ${w}`}y.datetime=e,s(e,"datetime");function t(o){let c=new Date(o),h=new Date;return c.getFullYear()===h.getFullYear()&&c.getMonth()===h.getMonth()&&c.getDate()===h.getDate()?r(o):e(o)}y.todayTimeOrDateTime=t,s(t,"todayTimeOrDateTime");function a(o){return o>=1e6?(o/1e6).toFixed(1)+"M":o>=1e3?(o/1e3).toFixed(1)+"K":o.toString()}y.number=a,s(a,"number");function u(o){if(o<1e3)return`${o}ms`;if(o<6e4)return`${(o/1e3).toFixed(1)}s`;if(o<36e5){let w=Math.floor(o/6e4),v=Math.floor(o%6e4/1e3);return`${w}m ${v}s`}if(o<864e5){let w=Math.floor(o/36e5),v=Math.floor(o%36e5/6e4);return`${w}h ${v}m`}let c=Math.floor(o/36e5);return`${Math.floor(o%36e5/864e5)}d ${c}h`}y.duration=u,s(u,"duration");function d(o,c){return o.length<=c?o:o.slice(0,c-1)+"\u2026"}y.truncate=d,s(d,"truncate");function l(o,c=35){if(o.length<=c)return o;let h="\u2026",w=Math.ceil((c-h.length)/2),v=Math.floor((c-h.length)/2);return o.slice(0,w)+h+o.slice(-v)}y.truncateMiddle=l,s(l,"truncateMiddle");function m(o,c,h){return(o===1?c:h).replace("{}",o.toString())}y.pluralize=m,s(m,"pluralize")})(ze||={});function q(n){let r=n.state;return{input:r.input,metadata:"metadata"in r?r.metadata:{},part:n}}s(q,"props");function I(n){let r=n.description?f.Style.TEXT_DIM+` ${n.description}`+f.Style.TEXT_NORMAL:"";f.println(f.Style.TEXT_NORMAL+n.icon,f.Style.TEXT_NORMAL+n.title+r)}s(I,"inline");function X(n,r){f.empty(),I(n),r?.trim()&&(f.println(r),f.empty())}s(X,"block");function sr(n){let r=n.state,e="input"in r?r.input:void 0,t=("title"in r&&r.title?r.title:void 0)||(e&&typeof e=="object"&&Object.keys(e).length>0?JSON.stringify(e):"Unknown");I({icon:"\u2699",title:`${n.tool} ${t}`})}s(sr,"fallback");function vr(n){let r=n.input.path??"",e=`Glob "${n.input.pattern}"`,t=r?`in ${_(r)}`:"",a=n.metadata.count,u=a===void 0?t:`${t}${t?" \xB7 ":""}${a} ${a===1?"match":"matches"}`;I({icon:"\u2731",title:e,...u&&{description:u}})}s(vr,"glob");function qr(n){let r=n.input.path??"",e=`Grep "${n.input.pattern}"`,t=r?`in ${_(r)}`:"",a=n.metadata.matches,u=a===void 0?t:`${t}${t?" \xB7 ":""}${a} ${a===1?"match":"matches"}`;I({icon:"\u2731",title:e,...u&&{description:u}})}s(qr,"grep");function Ir(n){let r=n.input.path?_(n.input.path):"";I({icon:"\u2192",title:r?`List ${r}`:"List"})}s(Ir,"list");function Dr(n){let r=_(n.input.filePath),e=Object.entries(n.input).filter(([a,u])=>a==="filePath"?!1:typeof u=="string"||typeof u=="number"||typeof u=="boolean"),t=e.length?`[${e.map(([a,u])=>`${a}=${u}`).join(", ")}]`:void 0;I({icon:"\u2192",title:`Read ${r}`,...t&&{description:t}})}s(Dr,"read");function Cr(n){X({icon:"\u2190",title:`Write ${_(n.input.filePath)}`},n.part.state.status==="completed"?n.part.state.output:void 0)}s(Cr,"write");function Pr(n){I({icon:"%",title:`WebFetch ${n.input.url}`})}s(Pr,"webfetch");function Ar(n){let r=_(n.input.filePath),e=n.metadata.diff;X({icon:"\u2190",title:`Edit ${r}`},e)}s(Ar,"edit");function _r(n){I({icon:"\u25C7",title:`Exa Code Search "${n.input.query}"`})}s(_r,"codesearch");function jr(n){I({icon:"\u25C8",title:`Exa Web Search "${n.input.query}"`})}s(jr,"websearch");function or(n){let r=n.part.state.input,e=n.part.state.status,t=typeof r.subagent_type=="string"&&r.subagent_type.trim().length>0?r.subagent_type:"unknown",a=ze.titlecase(t),u=typeof r.description=="string"&&r.description.trim().length>0?r.description:void 0,d=e==="error"?"\u2717":e==="running"?"\u2022":"\u2713",l=u??`${a} Task`;I({icon:d,title:l,description:u?`${a} Agent`:void 0})}s(or,"task");function zr(n){I({icon:"\u2192",title:`Skill "${n.input.name}"`})}s(zr,"skill");function Mr(n){let r=n.part.state.status==="completed"?n.part.state.output?.trim():void 0;X({icon:"$",title:`${n.input.command}`},r)}s(Mr,"bash");function $r(n){X({icon:"#",title:"Todos"},n.input.todos.map(r=>`${r.status==="completed"?"[x]":"[ ]"} ${r.content}`).join(`
|
|
19
|
-
`))}s($r,"todo");function _(n){return n?B.isAbsolute(n)?B.relative(process.cwd(),n)||".":n:""}s(_,"normalizePath");var Tn={command:"run [message..]",describe:"run opencode with a message",builder:s(n=>n.positional("message",{describe:"message to send",type:"string",array:!0,default:[]}).option("command",{describe:"the command to run, use message for args",type:"string"}).option("continue",{alias:["c"],describe:"continue the last session",type:"boolean"}).option("session",{alias:["s"],describe:"session id to continue",type:"string"}).option("fork",{describe:"fork the session before continuing (requires --continue or --session)",type:"boolean"}).option("share",{type:"boolean",describe:"share the session"}).option("model",{type:"string",alias:["m"],describe:"model to use in the format of provider/model"}).option("agent",{type:"string",describe:"agent to use"}).option("format",{type:"string",choices:["default","json"],default:"default",describe:"format: default (formatted) or json (raw JSON events)"}).option("file",{alias:["f"],type:"string",array:!0,describe:"file(s) to attach to message"}).option("title",{type:"string",describe:"title for the session (uses truncated prompt if no value provided)"}).option("attach",{type:"string",describe:"attach to a running opencode server (e.g., http://localhost:4096)"}).option("password",{alias:["p"],type:"string",describe:"basic auth password (defaults to OPENCODE_SERVER_PASSWORD)"}).option("dir",{type:"string",describe:"directory to run in, path on remote server if attaching"}).option("port",{type:"number",describe:"port for the local server (defaults to random port if no value provided)"}).option("variant",{type:"string",describe:"model variant (provider-specific reasoning effort, e.g., high, max, minimal)"}).option("thinking",{type:"boolean",describe:"show thinking blocks",default:!1}).option("dangerously-skip-permissions",{type:"boolean",describe:"auto-approve permissions that are not explicitly denied (dangerous!)",default:!1}),"builder"),handler:s(async n=>{let r=[...n.message,...n["--"]||[]].map(y=>y.includes(" ")?`"${y.replace(/"/g,'\\"')}"`:y).join(" "),e=(()=>{if(n.dir){if(n.attach)return n.dir;try{return process.chdir(n.dir),process.cwd()}catch{f.error("Failed to change directory to "+n.dir),process.exit(1)}}})(),t=[];if(n.file){let y=Array.isArray(n.file)?n.file:[n.file];for(let o of y){let c=B.resolve(process.cwd(),o);await H.exists(c)||(f.error(`File not found: ${o}`),process.exit(1));let h=await H.isDir(c)?"application/x-directory":"text/plain";t.push({type:"file",url:Sr(c).href,filename:B.basename(c),mime:h})}}process.stdin.isTTY||(r+=`
|
|
20
|
-
`+await Bun.stdin.text()),r.trim().length===0&&!n.command&&(f.error("You must provide a message or a command"),process.exit(1)),n.fork&&!n.continue&&!n.session&&(f.error("--fork requires --continue or --session"),process.exit(1));let a=[{permission:"question",action:"deny",pattern:"*"},{permission:"plan_enter",action:"deny",pattern:"*"},{permission:"plan_exit",action:"deny",pattern:"*"}];function u(){if(n.title!==void 0)return n.title!==""?n.title:r.slice(0,50)+(r.length>50?"...":"")}s(u,"title");async function d(y){let o=n.continue?(await y.session.list()).data?.find(w=>!w.parentID)?.id:n.session;if(o&&n.fork)return(await y.session.fork({sessionID:o})).data?.id;if(o)return o;let c=u();return(await y.session.create({title:c,permission:a})).data?.id}s(d,"session");async function l(y,o){let c=await y.config.get();if(!c.data||c.data.share!=="auto"&&!We.OPENCODE_AUTO_SHARE&&!n.share)return;let h=await y.session.share({sessionID:o}).catch(w=>(w instanceof Error&&w.message.includes("disabled")&&f.println(f.Style.TEXT_DANGER_BOLD+"! "+w.message),{error:w}));!h.error&&"data"in h&&h.data?.share?.url&&f.println(f.Style.TEXT_INFO_BOLD+"~ "+h.data.share.url)}s(l,"share");async function m(y){function o(g){try{return g.tool==="bash"?Mr({input:g.state.input,part:g}):g.tool==="glob"?vr(q(g)):g.tool==="grep"?qr(q(g)):g.tool==="list"?Ir(q(g)):g.tool==="read"?Dr(q(g)):g.tool==="write"?Cr(q(g)):g.tool==="webfetch"?Pr(q(g)):g.tool==="edit"?Ar(q(g)):g.tool==="codesearch"?_r(q(g)):g.tool==="websearch"?jr(q(g)):g.tool==="task"?or(q(g)):g.tool==="todowrite"?$r(q(g)):g.tool==="skill"?zr(q(g)):sr(g)}catch{return sr(g)}}s(o,"tool");function c(g,E){return n.format==="json"?(process.stdout.write(JSON.stringify({type:g,timestamp:Date.now(),sessionID:O,...E})+G),!0):!1}s(c,"emit");let h=await y.event.subscribe(),w;async function v(){let g=new Map;for await(let E of h.stream){if(E.type==="message.updated"&&E.properties.info.role==="assistant"&&n.format!=="json"&&g.get("start")!==!0&&(f.empty(),f.println(`> ${E.properties.info.agent} \xB7 ${E.properties.info.modelID}`),f.empty(),g.set("start",!0)),E.type==="message.part.updated"){let p=E.properties.part;if(p.sessionID!==O)continue;if(p.type==="tool"&&(p.state.status==="completed"||p.state.status==="error")){if(c("tool_use",{part:p}))continue;if(p.state.status==="completed"){o(p);continue}I({icon:"\u2717",title:`${p.tool} failed`}),f.error(p.state.error)}if(p.type==="tool"&&p.tool==="task"&&p.state.status==="running"&&n.format!=="json"){if(g.get(p.id)===!0)continue;or(q(p)),g.set(p.id,!0)}if(p.type==="step-start"&&c("step_start",{part:p})||p.type==="step-finish"&&c("step_finish",{part:p}))continue;if(p.type==="text"&&p.time?.end){if(c("text",{part:p}))continue;let T=p.text.trim();if(!T)continue;if(!process.stdout.isTTY){process.stdout.write(T+G);continue}f.empty(),f.println(T),f.empty()}if(p.type==="reasoning"&&p.time?.end&&n.thinking){if(c("reasoning",{part:p}))continue;let T=p.text.trim();if(!T)continue;let R=`Thinking: ${T}`;if(process.stdout.isTTY){f.empty(),f.println(`${f.Style.TEXT_DIM}\x1B[3m${R}\x1B[0m${f.Style.TEXT_NORMAL}`),f.empty();continue}process.stdout.write(R+G)}}if(E.type==="session.error"){let p=E.properties;if(p.sessionID!==O||!p.error)continue;let T=String(p.error.name);if("data"in p.error&&p.error.data&&"message"in p.error.data&&(T=String(p.error.data.message)),w=w?w+G+T:T,c("error",{error:p.error}))continue;f.error(T)}if(E.type==="session.status"&&E.properties.sessionID===O&&E.properties.status.type==="idle")break;if(E.type==="permission.asked"){let p=E.properties;if(p.sessionID!==O)continue;n["dangerously-skip-permissions"]?await y.permission.reply({requestID:p.id,reply:"once"}):(f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL+`permission requested: ${p.permission} (${p.patterns.join(", ")}); auto-rejecting`),await y.permission.reply({requestID:p.id,reply:"reject"}))}}}s(v,"loop");let b=await(async()=>{if(!n.agent)return;if(n.attach){let E=await y.app.agents(void 0,{throwOnError:!0}).then(T=>T.data??[]).catch(()=>{});if(!E){f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL,`failed to list agents from ${n.attach}. Falling back to default agent`);return}let p=E.find(T=>T.name===n.agent);if(!p){f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL,`agent "${n.agent}" not found. Falling back to default agent`);return}if(p.mode==="subagent"){f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL,`agent "${n.agent}" is a subagent, not a primary agent. Falling back to default agent`);return}return n.agent}let g=await Be.get(n.agent);if(!g){f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL,`agent "${n.agent}" not found. Falling back to default agent`);return}if(g.mode==="subagent"){f.println(f.Style.TEXT_WARNING_BOLD+"!",f.Style.TEXT_NORMAL,`agent "${n.agent}" is a subagent, not a primary agent. Falling back to default agent`);return}return n.agent})(),O=await d(y);if(O||(f.error("Session not found"),process.exit(1)),await l(y,O),v().catch(g=>{console.error(g),process.exit(1)}),n.command)await y.session.command({sessionID:O,agent:b,model:n.model,command:n.command,arguments:r,variant:n.variant});else{let g=n.model?Ge.parseModel(n.model):void 0;await y.session.prompt({sessionID:O,agent:b,model:g,variant:n.variant,parts:[...t,{type:"text",text:r}]})}}if(s(m,"execute"),n.attach){let y=(()=>{let c=n.password??process.env.OPENCODE_SERVER_PASSWORD;if(!c)return;let h=process.env.OPENCODE_SERVER_USERNAME??"opencode";return{Authorization:`Basic ${Buffer.from(`${h}:${c}`).toString("base64")}`}})(),o=W({baseUrl:n.attach,directory:e,headers:y});return await m(o)}await Ve(process.cwd(),async()=>{let o=W({baseUrl:"http://opencode.internal",fetch:s((async(c,h)=>{let w=new Request(c,h);return He.Default().fetch(w)}),"fetchFn")});await m(o)})},"handler")};export{Tn as RunCommand};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{A as b,z as a}from"./chunk-26PYOYAY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{b as makeRuntime,a as memoMap};
|
package/dist/schema-YWIVP7UR.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{b as a,c as b,d as c}from"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-MBZTOEAD.js";export{b as MessageID,c as PartID,a as SessionID};
|
package/dist/server-IT7ZVNR2.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a}from"./chunk-NLFNI3VW.js";import"./chunk-YDTJPTBK.js";import"./chunk-2ANK3QEN.js";import"./chunk-PWFRMDDF.js";import"./chunk-GXWCFXGG.js";import"./chunk-XJGIPERR.js";import"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-CZVKIDQZ.js";import"./chunk-MBZTOEAD.js";export{a as Server};
|
package/dist/session-HPEX3PLB.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{Q as a}from"./chunk-XJGIPERR.js";import"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as Session};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a}from"./chunk-GXWCFXGG.js";import"./chunk-XJGIPERR.js";import"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as ShareNext};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as r}from"./chunk-CZVKIDQZ.js";import{a as t}from"./chunk-MBZTOEAD.js";async function e(){try{let{toJSONSchema:o}=await import("sury");return o}catch{throw new r("sury")}}t(e,"getToJsonSchemaFn");export{e as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as e}from"./chunk-MBZTOEAD.js";function t(){return n=>JSON.parse(JSON.stringify(n.Type()))}e(t,"getToJsonSchemaFn");export{t as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as t}from"./chunk-FXLFZ5DL.js";import"./chunk-PWFRMDDF.js";import{b as s}from"./chunk-CZVKIDQZ.js";import{a as o}from"./chunk-MBZTOEAD.js";function h(){return async(p,m)=>{let n=await s(p,{errorMode:"ignore",overrideAction:o(({valibotAction:r,jsonSchema:c})=>{let a=t(c,m);if(r.kind==="metadata"&&r.type==="metadata"&&!("$ref"in a)){let e=r.metadata;if(e.example!==void 0&&(a.example=e.example),e.examples&&e.examples.length>0&&(a.examples=e.examples),e.ref)return m.components.schemas={...m.components.schemas,[e.ref]:a},{$ref:`#/components/schemas/${e.ref}`}}return a},"overrideAction"),...m.options});return"$schema"in n&&delete n.$schema,n}}o(h,"getToOpenAPISchemaFn");export{h as default};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{c as n,d as o}from"./chunk-YDTJPTBK.js";import"./chunk-GXWCFXGG.js";import"./chunk-XJGIPERR.js";import"./chunk-26PYOYAY.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";var t=o.extend({name:o.shape.name.unwrap(),branch:o.shape.branch.unwrap(),directory:o.shape.directory.unwrap()}),i={async configure(e){let r=await n.makeWorktreeInfo(e.name??void 0);return{...e,name:r.name,branch:r.branch,directory:r.directory}},async create(e){let r=t.parse(e);await n.createFromInfo({name:r.name,directory:r.directory,branch:r.branch})},async remove(e){let r=t.parse(e);await n.remove({directory:r.directory})},target(e){return{type:"local",directory:t.parse(e).directory}}};export{i as WorktreeAdaptor};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Built by esbuild from opencode-server source
|
|
2
|
-
if (typeof globalThis.Bun === 'undefined') {
|
|
3
|
-
globalThis.Bun = {
|
|
4
|
-
version: '0.0.0-node-compat',
|
|
5
|
-
stdin: { async text() { const chunks = []; for await (const c of process.stdin) chunks.push(c); return Buffer.concat(chunks).toString(); } },
|
|
6
|
-
which(cmd) { try { return require('child_process').execFileSync('which', [cmd], { encoding: 'utf8' }).trim(); } catch { return null; } },
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
|
-
if (typeof globalThis.__export === 'undefined') { globalThis.__export = (t, a) => { for (const k in a) Object.defineProperty(t, k, { get: a[k], enumerable: true }); }; }
|
|
11
|
-
|
|
12
|
-
import{a as s}from"./chunk-2ANK3QEN.js";import{a as p}from"./chunk-YRY5Y3QL.js";import"./chunk-FXLFZ5DL.js";import"./chunk-PWFRMDDF.js";import"./chunk-CZVKIDQZ.js";import{a as r}from"./chunk-MBZTOEAD.js";function u(){return async(e,o)=>{if("_zod"in e)return p()(e,{components:o.components,options:{io:"input",...o.options}});try{let{createSchema:t}=await import("zod-openapi"),{schema:i,components:n}=t(e,{schemaType:"input",...o.options});return n&&(o.components.schemas={...o.components.schemas,...n}),i}catch{throw new Error(s('Missing dependencies "zod-openapi v4".'))}}}r(u,"getToOpenAPISchemaFn");export{u as default};
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
CREATE TABLE `project` (
|
|
2
|
-
`id` text PRIMARY KEY,
|
|
3
|
-
`worktree` text NOT NULL,
|
|
4
|
-
`vcs` text,
|
|
5
|
-
`name` text,
|
|
6
|
-
`icon_url` text,
|
|
7
|
-
`icon_color` text,
|
|
8
|
-
`time_created` integer NOT NULL,
|
|
9
|
-
`time_updated` integer NOT NULL,
|
|
10
|
-
`time_initialized` integer,
|
|
11
|
-
`sandboxes` text NOT NULL
|
|
12
|
-
);
|
|
13
|
-
--> statement-breakpoint
|
|
14
|
-
CREATE TABLE `message` (
|
|
15
|
-
`id` text PRIMARY KEY,
|
|
16
|
-
`session_id` text NOT NULL,
|
|
17
|
-
`time_created` integer NOT NULL,
|
|
18
|
-
`time_updated` integer NOT NULL,
|
|
19
|
-
`data` text NOT NULL,
|
|
20
|
-
CONSTRAINT `fk_message_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE
|
|
21
|
-
);
|
|
22
|
-
--> statement-breakpoint
|
|
23
|
-
CREATE TABLE `part` (
|
|
24
|
-
`id` text PRIMARY KEY,
|
|
25
|
-
`message_id` text NOT NULL,
|
|
26
|
-
`session_id` text NOT NULL,
|
|
27
|
-
`time_created` integer NOT NULL,
|
|
28
|
-
`time_updated` integer NOT NULL,
|
|
29
|
-
`data` text NOT NULL,
|
|
30
|
-
CONSTRAINT `fk_part_message_id_message_id_fk` FOREIGN KEY (`message_id`) REFERENCES `message`(`id`) ON DELETE CASCADE
|
|
31
|
-
);
|
|
32
|
-
--> statement-breakpoint
|
|
33
|
-
CREATE TABLE `permission` (
|
|
34
|
-
`project_id` text PRIMARY KEY,
|
|
35
|
-
`time_created` integer NOT NULL,
|
|
36
|
-
`time_updated` integer NOT NULL,
|
|
37
|
-
`data` text NOT NULL,
|
|
38
|
-
CONSTRAINT `fk_permission_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE
|
|
39
|
-
);
|
|
40
|
-
--> statement-breakpoint
|
|
41
|
-
CREATE TABLE `session` (
|
|
42
|
-
`id` text PRIMARY KEY,
|
|
43
|
-
`project_id` text NOT NULL,
|
|
44
|
-
`parent_id` text,
|
|
45
|
-
`slug` text NOT NULL,
|
|
46
|
-
`directory` text NOT NULL,
|
|
47
|
-
`title` text NOT NULL,
|
|
48
|
-
`version` text NOT NULL,
|
|
49
|
-
`share_url` text,
|
|
50
|
-
`summary_additions` integer,
|
|
51
|
-
`summary_deletions` integer,
|
|
52
|
-
`summary_files` integer,
|
|
53
|
-
`summary_diffs` text,
|
|
54
|
-
`revert` text,
|
|
55
|
-
`permission` text,
|
|
56
|
-
`time_created` integer NOT NULL,
|
|
57
|
-
`time_updated` integer NOT NULL,
|
|
58
|
-
`time_compacting` integer,
|
|
59
|
-
`time_archived` integer,
|
|
60
|
-
CONSTRAINT `fk_session_project_id_project_id_fk` FOREIGN KEY (`project_id`) REFERENCES `project`(`id`) ON DELETE CASCADE
|
|
61
|
-
);
|
|
62
|
-
--> statement-breakpoint
|
|
63
|
-
CREATE TABLE `todo` (
|
|
64
|
-
`session_id` text NOT NULL,
|
|
65
|
-
`content` text NOT NULL,
|
|
66
|
-
`status` text NOT NULL,
|
|
67
|
-
`priority` text NOT NULL,
|
|
68
|
-
`position` integer NOT NULL,
|
|
69
|
-
`time_created` integer NOT NULL,
|
|
70
|
-
`time_updated` integer NOT NULL,
|
|
71
|
-
CONSTRAINT `todo_pk` PRIMARY KEY(`session_id`, `position`),
|
|
72
|
-
CONSTRAINT `fk_todo_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE
|
|
73
|
-
);
|
|
74
|
-
--> statement-breakpoint
|
|
75
|
-
CREATE TABLE `session_share` (
|
|
76
|
-
`session_id` text PRIMARY KEY,
|
|
77
|
-
`id` text NOT NULL,
|
|
78
|
-
`secret` text NOT NULL,
|
|
79
|
-
`url` text NOT NULL,
|
|
80
|
-
`time_created` integer NOT NULL,
|
|
81
|
-
`time_updated` integer NOT NULL,
|
|
82
|
-
CONSTRAINT `fk_session_share_session_id_session_id_fk` FOREIGN KEY (`session_id`) REFERENCES `session`(`id`) ON DELETE CASCADE
|
|
83
|
-
);
|
|
84
|
-
--> statement-breakpoint
|
|
85
|
-
CREATE INDEX `message_session_idx` ON `message` (`session_id`);--> statement-breakpoint
|
|
86
|
-
CREATE INDEX `part_message_idx` ON `part` (`message_id`);--> statement-breakpoint
|
|
87
|
-
CREATE INDEX `part_session_idx` ON `part` (`session_id`);--> statement-breakpoint
|
|
88
|
-
CREATE INDEX `session_project_idx` ON `session` (`project_id`);--> statement-breakpoint
|
|
89
|
-
CREATE INDEX `session_parent_idx` ON `session` (`parent_id`);--> statement-breakpoint
|
|
90
|
-
CREATE INDEX `todo_session_idx` ON `todo` (`session_id`);
|