alchemylab-opencode 1.0.22 → 1.0.23
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/dist/{chunk-WF7L36SZ.js → chunk-22MFGOA6.js} +1 -1
- package/dist/{chunk-X7PHY2B3.js → chunk-GCMAFSDE.js} +1 -1
- package/dist/{chunk-5FGJUXLI.js → chunk-MN5GIJ5E.js} +88 -88
- package/dist/{chunk-735MVPNG.js → chunk-SILEE7UA.js} +1 -1
- package/dist/{chunk-TECR6KUK.js → chunk-VREN4JVV.js} +1 -1
- package/dist/{mcp-JSKIR2KQ.js → mcp-3MLN7453.js} +1 -1
- package/dist/{registry-REVWYAGR.js → registry-HM2N65IE.js} +1 -1
- package/dist/{run-CPHBVDZ4.js → run-VQUBMRCD.js} +1 -1
- package/dist/run.js +1 -1
- package/dist/serve.js +1 -1
- package/dist/{server-VHCQ5HOC.js → server-TLPVN3ZL.js} +1 -1
- package/dist/{session-5BXSPMPJ.js → session-FWLEEJPX.js} +1 -1
- package/dist/{share-next-GSWCSZSC.js → share-next-PRCWHS3Z.js} +1 -1
- package/dist/{worktree-HPW4CL36.js → worktree-5G5VWN6L.js} +1 -1
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a as Me}from"./chunk-
|
|
12
|
+
import{a as Me}from"./chunk-GCMAFSDE.js";import{B as le,E as Ue,G as ze,c as pe,e as O,f as De,g as Be,w as Ge,x as Z,y as Le}from"./chunk-MN5GIJ5E.js";import{c as fe,n as V}from"./chunk-22MFGOA6.js";import{B 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,y as T,z as g}from"./chunk-N7PLTD3P.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
13
|
`)?d.slice(0,-1).split(`
|
|
14
14
|
`).length:d.split(`
|
|
15
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(`
|
|
@@ -9,7 +9,7 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a as Je,b as it,c as Ce,d as io}from"./chunk-
|
|
12
|
+
import{a as Je,b as it,c as Ce,d as io}from"./chunk-SILEE7UA.js";import{b as Rt}from"./chunk-2ANK3QEN.js";import{A as Gt,B as Ft,C as vt,D as de,E as ze,F as h,G as Ve,a as ce,b as yt,d as pe,f as rt,g as ht,h as Q,i as gt,j as nt,k as ve,l as bt,m as qe,n as zt,o as Be,p as _t,q as He,r as Ut,s as $e,t as It,u as no,v as Lt,w as Ae,y as Mt,z as Nt}from"./chunk-MN5GIJ5E.js";import{B as se,C as V,D as J,b as De,f as We,h as Et,n as W,o as so,p as ro,q as ot}from"./chunk-22MFGOA6.js";import{B as ft,a as Te,c as A,d as ge,e as tt,h as ne,i as ke,j as xe,k as F,m as to,n as we,o as Ge,p as Fe,s as ue,u as ut,y as fe,z as _}from"./chunk-N7PLTD3P.js";import{a as Ot,b as X,c as st,d as Tt}from"./chunk-7KKA6WBY.js";import{a as oo}from"./chunk-LTCXIXYM.js";import{c as Zt,d as lt,e as G}from"./chunk-M4CB72HE.js";import{b as eo}from"./chunk-CZVKIDQZ.js";import{a as c,e as Xt,f as Qt}from"./chunk-MBZTOEAD.js";import{validator as as}from"hono/validator";var ao={header:["cookie"]};function cs(e,t,o){if(!(o in ao))return e;let s=ao[o]||[];return t==="arktype"?ps(e,s):t==="valibot"?ds(e,s):e}c(cs,"sanitizeIssues");function ps(e,t){return e.map(o=>{if(o&&typeof o=="object"&&"data"in o&&typeof o.data=="object"&&o.data!==null&&!Array.isArray(o.data)){let s={...o.data};for(let n of t)delete s[n];let r=Object.create(Object.getPrototypeOf(o));return Object.assign(r,o,{data:s}),r}return o})}c(ps,"sanitizeArktypeIssues");function ds(e,t){return e.map(o=>{if(o&&typeof o=="object"&&"path"in o&&Array.isArray(o.path)){for(let s of o.path)if(typeof s=="object"&&"input"in s&&typeof s.input=="object"&&s.input!==null&&!Array.isArray(s.input))for(let r of t)delete s.input[r]}return o})}c(ds,"sanitizeValibotIssues");var co=c((e,t,o)=>as(e,async(s,r)=>{let n=await t["~standard"].validate(s);if(o){let d=await o(n.issues?{data:s,error:n.issues,success:!1,target:e}:{data:s,success:!0,target:e},r);if(d){if(d instanceof Response)return d;if("response"in d)return d.response}}if(n.issues){let d=cs(n.issues,t["~standard"].vendor,e);return r.json({data:s,error:d,success:!1},400)}return n.value}),"sValidator");var Wt=Symbol("openapi"),ls=["GET","PUT","POST","DELETE","OPTIONS","HEAD","PATCH","TRACE"],us=c(e=>e.split("/").map(t=>{let o=t;if(o.startsWith(":")){let s=o.match(/^:([^{?]+)(?:{(.+)})?(\?)?$/);s?o=`{${s[1]}}`:(o=o.slice(1,o.length),o.endsWith("?")&&(o=o.slice(0,-1)),o=`{${o}}`)}return o}).join("/"),"toOpenAPIPath"),po=c(e=>e.charAt(0).toUpperCase()+e.slice(1),"capitalize"),fs=c(e=>{let t=e.method.toLowerCase();if(e.path==="/")return`${t}Index`;for(let o of e.path.split("/"))o.charCodeAt(0)===123?t+=`By${po(o.slice(1,-1))}`:t+=po(o);return t},"generateOperationId"),ys=c(e=>"$ref"in e?e.$ref:`${e.in} ${e.name}`,"paramKey");function mo(...e){let t=e.flatMap(o=>o??[]).reduce((o,s)=>(o.set(ys(s),s),o),new Map);return Array.from(t.values())}c(mo,"mergeParameters");var Ye=new Map;function hs(e){let t=[];for(let[o,s]of Ye)s&&e.match(o)&&t.push(s);return t}c(hs,"getPathContext");function gs(){Ye.clear()}c(gs,"clearSpecsContext");function lo(e,...t){return t.reduce((o,s)=>{if(!s||!o)return o;for(let[r,n]of Object.entries(s))if(n!=null)if(r in o&&(typeof n=="object"||typeof n=="function"&&r==="operationId"))if(Array.isArray(n)){let d=[...o[r]??[],...n];r==="tags"?o[r]=Array.from(new Set(d)):r==="parameters"?o[r]=mo(d):o[r]=d}else typeof n=="function"?o[r]=n(e):r==="parameters"?o[r]=mo(o[r],n):o[r]={...o[r],...n};else o[r]=n;return o},{operationId:fs(e)})}c(lo,"mergeSpecs");function uo({route:e,specs:t,paths:o}){let s=us(e.path),r=e.method.toLowerCase();if(r==="all"){if(!t)return;if(Ye.has(s)){let n=Ye.get(s)??{};Ye.set(s,lo(e,n,t))}else Ye.set(s,t)}else{let n=hs(s);s in o||(o[s]={}),o[s]&&(o[s][r]=lo(e,...n,o[s]?.[r],t))}}c(uo,"registerSchemaPath");function bs(e,t){let{exclude:o,excludeStaticFile:s}=t.options,r={},n=Array.isArray(o)?o:[o];for(let[d,u]of Object.entries(e))if(!(u==null||n.some(k=>typeof k=="string"?d===k:k.test(d))||d.includes("*")&&!d.includes("{"))){if(s){let k=d.includes("{"),v=(d.split("/").pop()||"").includes(".");if(!k&&v)continue}for(let k of Object.keys(u)){let y=u[k];if(y!=null){if(d.includes("{")){y.parameters=y.parameters?[...y.parameters]:[];let v=d.split("/").filter(g=>g.startsWith("{")&&!y.parameters.find(m=>m.in==="path"&&m.name===g.slice(1,g.length-1)));for(let g of v){let m=g.slice(1,g.length-1);y.parameters.findIndex(w=>{if("$ref"in w){let M=w.$ref.split("/").pop();if(M){let ee=t.components.parameters?.[M];if(ee&&!("$ref"in ee))return ee.in==="path"&&ee.name===m}return!1}return w.in==="path"&&w.name===m})===-1&&y.parameters.push({schema:{type:"string"},in:"path",name:m,required:!0})}}y.responses||(y.responses={200:{}})}}r[d]=u}return r}c(bs,"removeExcludedPaths");var fo={documentation:{},excludeStaticFile:!0,exclude:[],excludeMethods:["OPTIONS"],excludeTags:[]};function ho(e,t){let o;return async s=>(o||(o=await Bt(e,t,s)),s.json(o))}c(ho,"openAPIRouteHandler");async function Bt(e,t=fo,o){let s={components:{},options:{...fo,...t}},r=s.options.documentation??{};gs();let n=await Is(e,s);for(let u in n)for(let f in n[u])vs({valueOrFunc:n[u][f]?.hide,method:f,path:u,c:o})&&(n[u][f]=void 0);let d=Ht(r.components,s.components);return{openapi:"3.1.0",...r,tags:r.tags?.filter(u=>!s.options.excludeTags?.includes(u?.name)),info:{title:"Hono Documentation",description:"Development documentation",version:"0.0.0",...r.info},paths:{...bs(n,s),...r.paths},components:d}}c(Bt,"generateSpecs");async function Is(e,t){let o={};for(let s of e.routes){let r=s.handler[Wt];if(!r){t.options.includeEmptyPaths&&uo({route:s,paths:o});continue}let n=s.method;if(n!=="ALL"&&(t.options.excludeMethods?.includes(n)||!ls.includes(n)))continue;let d=t.options.defaultOptions?.[n],{schema:u,components:f={}}=await js(r,d);t.components=Ht(t.components,f),uo({route:s,specs:u,paths:o})}return o}c(Is,"generatePaths");function vs(e){let{valueOrFunc:t,c:o,method:s,path:r}=e;if(t!=null){if(typeof t=="boolean")return t;if(typeof t=="function")return t({c:o,method:s,path:r})}return!1}c(vs,"getHiddenValue");async function js(e,t){if("spec"in e){let r={},n={...t,...e.spec,responses:{...t?.responses,...e.spec.responses}};if(n.responses)for(let d of Object.keys(n.responses)){let u=n.responses[d];if(!(!u||!("content"in u)))for(let f of Object.keys(u.content??{})){let x=u.content?.[f];if(x&&x.schema&&"toOpenAPISchema"in x.schema){let k=await x.schema.toOpenAPISchema();x.schema=k.schema,k.components&&(r=Ht(r,k.components))}}}return{schema:n,components:r}}let o=await e.toOpenAPISchema(),s=t??{};if(e.target==="form"||e.target==="json"){let r=e.options?.media??e.target==="json"?"application/json":"multipart/form-data";!s.requestBody||!("content"in s.requestBody)||!s.requestBody.content?s.requestBody={content:{[r]:{schema:o.schema}}}:s.requestBody.content[r]={schema:o.schema}}else{let r=[];if("$ref"in o.schema){let d=o.schema.$ref.split("/").pop();if(d&&o.components?.schemas?.[d]){let u=o.components.schemas[d],f=yo(e.target,u)[0];o.components.parameters||(o.components.parameters={}),o.components.parameters[d]=f,delete o.components.schemas[d],r.push({$ref:`#/components/parameters/${d}`})}}else r=yo(e.target,o.schema);s.parameters=r}return{schema:s,components:o.components}}c(js,"getSpec");function yo(e,t){let o=[];for(let[s,r]of Object.entries(t.properties??{})){let n={in:e==="param"?"path":e,name:s,schema:r};t.required?.includes(s)&&(n.required=!0),n.schema&&"description"in n.schema&&n.schema.description&&(n.description=n.schema.description,n.schema.description=void 0),o.push(n)}return o}c(yo,"generateParameters");function Ht(...e){return e.reduce((t,o,s)=>(o==null||s===0||((t.schemas&&Object.keys(t.schemas).length>0||o.schemas&&Object.keys(o.schemas).length>0)&&(t.schemas={...t.schemas,...o.schemas}),(t.parameters&&Object.keys(t.parameters).length>0||o.parameters&&Object.keys(o.parameters).length>0)&&(t.parameters={...t.parameters,...o.parameters})),t),e[0]??{})}c(Ht,"mergeComponentsObjects");function i(e,t){return{vendor:e["~standard"].vendor,validate:e["~standard"].validate,toJSONSchema:c(o=>eo(e,{...t,...o}),"toJSONSchema"),toOpenAPISchema:c(o=>Rt(e,{...t,...o}),"toOpenAPISchema")}}c(i,"resolver");function p(e,t,o,s){let r=co(e,t,o);return Object.assign(r,{[Wt]:{target:e,...i(t,s),options:s}})}c(p,"validator");function a(e){return Object.assign(c(async(o,s)=>{await s()},"middleware"),{[Wt]:{spec:e}})}c(a,"describeRoute");import{Hono as es}from"hono";import{compress as xr}from"hono/compress";import{cors as qr}from"hono/cors";import{basicAuth as Ar}from"hono/basic-auth";import ae from"zod";import{createAdaptorServer as Cr}from"@hono/node-server";import{createNodeWebSocket as Rr}from"@hono/node-ws";var ws={worktree:A(async()=>(await import("./worktree-5G5VWN6L.js")).WorktreeAdaptor)};function Ke(e){return ws[e]()}c(Ke,"getAdaptor");import at from"zod";import{setTimeout as bo}from"node:timers/promises";import{sqliteTable as Ds,text as _e}from"drizzle-orm/sqlite-core";var je=Ds("workspace",{id:_e().$type().primaryKey(),type:_e().notNull(),branch:_e(),name:_e(),directory:_e(),extra:_e({mode:"json"}),project_id:_e().$type().notNull().references(()=>to.id,{onDelete:"cascade"})});async function go(e,t,o){let s=e.getReader(),r=new TextDecoder,n="",d="",u=1e3,f=c(()=>{s.cancel().catch(()=>{})},"abort");t.addEventListener("abort",f);try{for(;!t.aborted;){let x=await s.read().catch(()=>({done:!0,value:void 0}));if(x.done)break;n+=r.decode(x.value,{stream:!0}),n=n.replace(/\r\n/g,`
|
|
13
13
|
`).replace(/\r/g,`
|
|
14
14
|
`);let k=n.split(`
|
|
15
15
|
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{C as a}from"./chunk-
|
|
12
|
+
import{C as a}from"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as MCP};
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{A as a}from"./chunk-
|
|
12
|
+
import{A as a}from"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as ToolRegistry};
|
|
@@ -9,7 +9,7 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a as He}from"./chunk-
|
|
12
|
+
import{a as He}from"./chunk-VREN4JVV.js";import{b as Xe}from"./chunk-SILEE7UA.js";import"./chunk-GCMAFSDE.js";import"./chunk-2ANK3QEN.js";import"./chunk-PWFRMDDF.js";import{k as Ge,o as Be}from"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import{d as Fe,e as We,z as V}from"./chunk-N7PLTD3P.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
13
|
`).replace(/\r/g,`
|
|
14
14
|
`);let $e=D.split(`
|
|
15
15
|
|
package/dist/run.js
CHANGED
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{homedir as o}from"node:os";import{join as a}from"node:path";var t=a(o(),".alchemy_lab","opencode");process.env.OPENCODE_DATA_DIR=process.env.OPENCODE_DATA_DIR||t;var{RunCommand:r}=await import("./run-
|
|
12
|
+
import{homedir as o}from"node:os";import{join as a}from"node:path";var t=a(o(),".alchemy_lab","opencode");process.env.OPENCODE_DATA_DIR=process.env.OPENCODE_DATA_DIR||t;var{RunCommand:r}=await import("./run-VQUBMRCD.js"),e=(await import("yargs")).default,{hideBin:i}=await import("yargs/helpers");e(i(process.argv)).command(r).strict().help().parse();
|
package/dist/serve.js
CHANGED
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a as s}from"./chunk-MBZTOEAD.js";import{Agent as i,setGlobalDispatcher as c}from"undici";import{homedir as p}from"node:os";import{join as l}from"node:path";c(new i({connect:{keepAlive:!0,keepAliveInitialDelay:5e3},headersTimeout:0,bodyTimeout:0}));function o(e,t){let r=process.argv.indexOf(`--${e}`);return r!==-1&&process.argv[r+1]?process.argv[r+1]:t}s(o,"arg");var m=l(p(),".alchemy_lab","opencode"),d=o("data-dir",m);process.env.OPENCODE_DATA_DIR=d;var{Log:a}=await import("./log-MVJ7H4K5.js"),v=o("log-level","INFO").toUpperCase(),n=a.Level.safeParse(v);a.init({print:!0,level:n.success?n.data:"INFO"});var{Server:g}=await import("./server-
|
|
12
|
+
import{a as s}from"./chunk-MBZTOEAD.js";import{Agent as i,setGlobalDispatcher as c}from"undici";import{homedir as p}from"node:os";import{join as l}from"node:path";c(new i({connect:{keepAlive:!0,keepAliveInitialDelay:5e3},headersTimeout:0,bodyTimeout:0}));function o(e,t){let r=process.argv.indexOf(`--${e}`);return r!==-1&&process.argv[r+1]?process.argv[r+1]:t}s(o,"arg");var m=l(p(),".alchemy_lab","opencode"),d=o("data-dir",m);process.env.OPENCODE_DATA_DIR=d;var{Log:a}=await import("./log-MVJ7H4K5.js"),v=o("log-level","INFO").toUpperCase(),n=a.Level.safeParse(v);a.init({print:!0,level:n.success?n.data:"INFO"});var{Server:g}=await import("./server-TLPVN3ZL.js"),u=parseInt(o("port","4096"),10),h=o("hostname","127.0.0.1");try{let e=await g.listen({port:u,hostname:h});console.log(`opencode server listening on http://${e.hostname}:${e.port}`);let t=s(async()=>{await e.stop(!0),process.exit(0)},"shutdown");process.on("SIGINT",t),process.on("SIGTERM",t),await new Promise(()=>{})}catch(e){console.error("Failed to start server:",e),process.exit(1)}
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a}from"./chunk-
|
|
12
|
+
import{a}from"./chunk-VREN4JVV.js";import"./chunk-SILEE7UA.js";import"./chunk-GCMAFSDE.js";import"./chunk-2ANK3QEN.js";import"./chunk-PWFRMDDF.js";import"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.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};
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{F as a}from"./chunk-
|
|
12
|
+
import{F as a}from"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as Session};
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{a}from"./chunk-
|
|
12
|
+
import{a}from"./chunk-GCMAFSDE.js";import"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.js";import"./chunk-7KKA6WBY.js";import"./chunk-LTCXIXYM.js";import"./chunk-M4CB72HE.js";import"./chunk-MBZTOEAD.js";export{a as ShareNext};
|
|
@@ -9,4 +9,4 @@ if (typeof globalThis.Bun === 'undefined') {
|
|
|
9
9
|
if (typeof globalThis.__name === 'undefined') { globalThis.__name = (t, n) => { Object.defineProperty(t, 'name', { value: n, configurable: true }); return t; }; }
|
|
10
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
11
|
|
|
12
|
-
import{c as n,d as o}from"./chunk-
|
|
12
|
+
import{c as n,d as o}from"./chunk-SILEE7UA.js";import"./chunk-GCMAFSDE.js";import"./chunk-MN5GIJ5E.js";import"./chunk-22MFGOA6.js";import"./chunk-N7PLTD3P.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};
|