@systemfsoftware/omp-agent-discipline 1.5.2 → 2.1.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/CHANGELOG.md +54 -0
- package/README.md +43 -0
- package/dist/Cause-CU3CumyG.js +1 -0
- package/dist/DispatchDoctrineHandler-DxQYHIi6.js +11 -0
- package/dist/Effect-BSMJns2T.js +1 -0
- package/dist/Exit-CV9u1RPk.js +1 -0
- package/dist/Match-JxLwaSI5.js +1 -0
- package/dist/NoSkillDelegationExecutor-D4XtBj2A.js +2 -0
- package/dist/NoSkillDelegationHandler-C7HxwmLG.js +1 -0
- package/dist/RunSafePolicy-CYAsAXQR.js +1 -0
- package/dist/Runtime-CxXrOYpO.js +1 -0
- package/dist/XdRetryGuardMiddleware-CjuvaTYr.js +3 -0
- package/dist/api.js +1 -0
- package/dist/dist-B6yj6a-9.js +17 -0
- package/dist/effect-Cx0dl_A6.js +13 -0
- package/dist/index.js +1 -1
- package/package.json +24 -22
- package/dist/Cause-BrqBsgxk.js +0 -1
- package/dist/Effect-CCZY2K2R.js +0 -14
- package/dist/Exit-B080fRO2.js +0 -1
- package/dist/Match-SF0Pl-Dg.js +0 -1
- package/dist/core-CKCFGJ7r.js +0 -13
- package/dist/dispatch-doctrine.handler-C0Qzn9_X.js +0 -11
- package/dist/dist-BRe2qsvA.js +0 -16
- package/dist/no-skill-delegation.handler-DAviKGeB.js +0 -2
- package/dist/runtime.kernel-D3rhEYjH.js +0 -1
- package/dist/xd-retry-guard.middleware-CY-8-JSN.js +0 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# @systemfsoftware/omp-agent-discipline
|
|
2
|
+
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The packages now publish an `/api` entry with the named handlers and constants that tests and other in-process callers import. The host entry stays the default export only, so startup still pays only for registration.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- The peer requirements for `effect` and for the Effect test-runner integration now accept any compatible `4.0.0-rc` release, instead of demanding one exact release candidate.
|
|
12
|
+
|
|
13
|
+
Installing alongside a newer release candidate no longer reports an unmet peer dependency or resolves a second copy of `effect` into the dependency tree.
|
|
14
|
+
|
|
15
|
+
## 2.0.0
|
|
16
|
+
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- Collapse projection tags into the ports they projected
|
|
20
|
+
|
|
21
|
+
A `*ExecutorDeps` tag whose service type was indexed off other ports recorded which members
|
|
22
|
+
one operation happened to reach for. Exporting it turned internal composition into a surface
|
|
23
|
+
commitment: a consumer had to discover and provide an aggregator for each operation, where the
|
|
24
|
+
port it came from already served. The tags rode the `R` channel of exported signatures, so a
|
|
25
|
+
consumer met them only at their own call site.
|
|
26
|
+
|
|
27
|
+
Each was removed the way its evidence directed — no tag was renamed, and none was replaced:
|
|
28
|
+
|
|
29
|
+
- `AttwCliExecutorDeps`, `CheckPackageExecutorDeps` — deleted. Zero consumers, no Live layer;
|
|
30
|
+
callers already required the real capabilities directly.
|
|
31
|
+
- `HookDispatcherExecutorDeps` — was a 1:1 alias of `Scope.Scope`. Requiring `Scope` names the
|
|
32
|
+
same service.
|
|
33
|
+
- `InjectInstructionsExecutorDeps` — packed `FileSystem`, `Path` and `TomlLoader` with no logic.
|
|
34
|
+
Consumers require the three ports.
|
|
35
|
+
- `EffectVitestDeps` → `EffectVitestBindings`. Never a `Context.Tag`: a plain type alias already
|
|
36
|
+
passed as an ordinary parameter, so only the name misdescribed it. A stale api report that no
|
|
37
|
+
`api-extractor` regenerates was deleted with it.
|
|
38
|
+
|
|
39
|
+
A consumer providing a port instead of an aggregator provides no more than before, since a
|
|
40
|
+
service `{ a, b }` is assignable to a requirement `{ a }`.
|
|
41
|
+
|
|
42
|
+
### Minor Changes
|
|
43
|
+
|
|
44
|
+
- cut over to effect v4 (4.0.0-rc.108): public surface derives from effect types; peers flip effect ^3→^4
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
|
|
49
|
+
|
|
50
|
+
- Each of these packages now has a README, so its registry page says what the package is, how
|
|
51
|
+
to install it, and what to import or register — previously the page was blank. The lint
|
|
52
|
+
plugins show the configuration line that enables what they recommend.
|
|
53
|
+
|
|
54
|
+
`@systemfsoftware/stryker-js-mutation-report` also carries its licence text
|
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# @systemfsoftware/omp-agent-discipline
|
|
2
|
+
|
|
3
|
+
Mechanical harness discipline for Oh My Pi agents.
|
|
4
|
+
|
|
5
|
+
Enforces execution constraints and dispatch doctrine at the tool call boundary rather than relying on LLM compliance with prose system prompts.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Dispatch Doctrine Enforcement:** Blocks prohibited tool calls and invalid delegation before execution.
|
|
10
|
+
- **XD Device Retry Guard:** Prevents agents from endlessly looping on broken dynamic device tool calls.
|
|
11
|
+
- **Lazy Runtime Initialization:** Defers heavy Effect runtimes to avoid penalizing initial CLI startup latency.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
Add the extension to your Oh My Pi configuration:
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"plugins": [
|
|
20
|
+
"@systemfsoftware/omp-agent-discipline"
|
|
21
|
+
]
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or install manually via package manager:
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
pnpm add @systemfsoftware/omp-agent-discipline
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## How It Works
|
|
32
|
+
|
|
33
|
+
1. **Pre-flight Tool Validation:** Intercepts `emitToolCall` events across registered sessions.
|
|
34
|
+
2. **Short-Circuit Rejection:** If an agent attempts an unauthorized tool invocation or invalid pattern, the extension immediately cancels the action and injects remediation guidance back to the model.
|
|
35
|
+
3. **Session Lifecycle Hooking:** Warms required background resources on `session_start` without blocking extension registration.
|
|
36
|
+
|
|
37
|
+
## API Reference
|
|
38
|
+
|
|
39
|
+
The exported TypeScript definitions are published with the package: [`etc/omp-agent-discipline.api.md`](./etc/omp-agent-discipline.api.md).
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
Apache-2.0
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as ee,$t as t,Bn as te,Co as ne,Dn as re,En as ie,Fn as ae,Gn as oe,J as se,Ja as ce,K as n,Ln as r,Pn as i,Q as a,Qa as o,Qt as s,So as c,Tn as l,X as u,Xa as d,Y as f,Ya as p,Z as m,Za as h,Zt as g,_o as _,a as v,c as y,co as b,d as x,do as S,en as C,eo as w,et as T,f as E,go as D,in as O,kr as k,l as A,la as j,lo as M,n as N,no as P,o as F,oo as I,q as L,s as R,so as z,t as B,tn as V,to as H,u as U,uo as W,vo as G,wn as le,wo as ue,yo as de,zn as fe}from"./effect-Cx0dl_A6.js";var pe=e({AsyncFiberError:()=>nt,AsyncFiberErrorTypeId:()=>et,Done:()=>Ge,DoneTypeId:()=>We,ExceededCapacityError:()=>$e,ExceededCapacityErrorTypeId:()=>Qe,IllegalArgumentError:()=>$,IllegalArgumentErrorTypeId:()=>Ye,InterruptorStackTrace:()=>ut,NoSuchElementError:()=>Ue,NoSuchElementErrorTypeId:()=>He,ReasonTypeId:()=>me,StackTrace:()=>lt,TimeoutError:()=>Je,TimeoutErrorTypeId:()=>Ke,TypeId:()=>K,UnknownError:()=>at,UnknownErrorTypeId:()=>rt,annotate:()=>ot,annotations:()=>ct,combine:()=>Ee,die:()=>be,done:()=>Q,empty:()=>ye,fail:()=>Y,filterInterruptors:()=>Re,findDefect:()=>Pe,findDie:()=>Ne,findError:()=>Ae,findErrorOption:()=>je,findFail:()=>ke,findInterrupt:()=>Ie,fromReasons:()=>J,hasDies:()=>Me,hasFails:()=>Oe,hasInterrupts:()=>Fe,hasInterruptsOnly:()=>Te,interrupt:()=>xe,interruptors:()=>Le,isAsyncFiberError:()=>tt,isCause:()=>he,isDieReason:()=>_e,isDone:()=>Z,isExceededCapacityError:()=>Ze,isFailReason:()=>q,isIllegalArgumentError:()=>Xe,isInterruptReason:()=>ve,isNoSuchElementError:()=>Ve,isReason:()=>ge,isTimeoutError:()=>qe,isUnknownError:()=>it,makeDieReason:()=>Ce,makeFailReason:()=>Se,makeInterruptReason:()=>we,map:()=>X,pretty:()=>Be,prettyErrors:()=>ze,reasonAnnotations:()=>st,squash:()=>De});const K=p,me=ce,he=D,ge=_,q=c,_e=G,ve=ne,J=W,ye=b,Y=M,be=z,xe=f,Se=e=>new w(e),Ce=e=>new d(e),we=oe,Te=re,X=m,Ee=L,De=T,Oe=l,ke=V,Ae=t,je=C,Me=le,Ne=s,Pe=g,Fe=ie,Ie=O,Le=u,Re=se,ze=ee,Be=a,Ve=ue,He=P,Ue=H,Z=de,We=o,Ge=h,Q=S,Ke=U,qe=fe,Je=A,Ye=y,Xe=r,$=R,Ze=ae,Qe=F,$e=v,et=N,tt=i,nt=B,rt=E,it=te,at=x,ot=I,st=k,ct=n;var lt=class extends j()(`effect/Cause/StackTrace`){},ut=class extends j()(`effect/Cause/InterruptorStackTrace`){};export{J as a,X as c,Y as i,$ as n,Z as o,Q as r,q as s,pe as t};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{b as t,m as n,t as r,v as i,x as a}from"./dist-B6yj6a-9.js";import{Ca as o}from"./effect-Cx0dl_A6.js";import{C as s,M as c}from"./Effect-BSMJns2T.js";import{a as l,i as u,r as d,t as f}from"./Match-JxLwaSI5.js";const p={task:!0,agent:!0},m=e=>p[e.trim().toLowerCase()]===!0,h=e=>{let t=e.slice(8);if(t.length===0)return null;let n=t.search(/[:/]/);return n===-1?t:t.slice(0,n)},g=e=>e.split(`\\`).join(`/`),_=(e,t)=>{let n=`/skills/`+t+`/SKILL.md`;return e.endsWith(n)},v=(e,t)=>{if(e.startsWith(`skill://`)){let n=h(e);return n!==null&&t.includes(n)}let n=g(e);for(let e of t)if(_(n,e))return!0;return!1},y={hasObjective:/\bobjective\b/i,hasWriteScope:/\bwrite_scope\b/i,hasVerifyCommands:/\bverify_commands\b/i},b=e=>({hasObjective:y.hasObjective.test(e),hasWriteScope:y.hasWriteScope.test(e),hasVerifyCommands:y.hasVerifyCommands.test(e)}),x=Symbol.for(`@systemfsoftware/omp-agent-discipline/CheckDispatchCommand`);var S=class extends t()(`CheckDispatchCommand`,{toolName:i,doctrineLoaded:n,gateEnabled:n}){[x]=x};const C=Symbol.for(`@systemfsoftware/omp-agent-discipline/DispatchDoctrineVerdict`);var w=class extends t()(`Allow`,{}){[C]=C},T=class extends t()(`DeliverDoctrine`,{reason:i}){[C]=C};a([w,T]);const E=`Refuse monolithic dispatches: size the unit, specify it completely, then dispatch — or do the work inline.
|
|
2
|
+
|
|
3
|
+
rules:
|
|
4
|
+
- GATE: decomposition is mandatory when ANY hold — multi-subsystem; exceeds one focused session for the worker's model class; irreversible side effects; verification longer than the work; incompatible reasoning modes. Dispatching monolithically anyway is an invalid dispatch: split, or do it yourself.
|
|
5
|
+
- SPEC: every dispatched unit carries objective, write_scope, verify_commands, acceptance, size_estimate, context_paths, rollback, dependencies — written before work starts. Missing any field is undispatchable.
|
|
6
|
+
- CHECK: verifier is not the maker. Run each unit's verify commands fresh in your own context; never accept a worker's reported output or completeness claims. A verify failure rejects the unit: record the failure, re-dispatch with the evidence.
|
|
7
|
+
- FENCE: parallel units need disjoint write scopes, confirmed by comparing write_scope declarations literally — never inferred from topic. Overlap forces serialization.
|
|
8
|
+
|
|
9
|
+
Full doctrine: skill://task-decomposition — sizing calibration, the dispatch contract, rejection rules, repair-retry. Refuse monolithic dispatches: size, specify, then dispatch or refuse.`,D=e=>e.gateEnabled&&m(e.toolName)&&!e.doctrineLoaded,O=e=>u(D(e)).pipe(l(!0,()=>new T({reason:E})),l(!1,()=>new w),f),k=e=>u(e).pipe(d(`DeliverDoctrine`,e=>({block:!0,reason:e.reason})),d(`Allow`,()=>void 0),f),A=e=>s(function*(){return(yield*(yield*r).load(e)).dispatch_doctrine_skills??[]});function j(e,t,n){return s(function*(){let r=yield*A(e),i=new S({toolName:t,doctrineLoaded:n,gateEnabled:r.length>0});return{skills:r,gate:k(O(i))}})}const M={extractSpecShape:b,matchesDoctrineSkillPath:v};var N=e({DispatchDoctrineExtension:()=>Y});const P=new Map,F=new Map,I=new Map,L=new Map,R=e=>{let t=e.sessionManager.getSessionId();return typeof t==`string`?t:``},z=e=>typeof e==`object`&&!!e&&!Array.isArray(e),B=e=>z(e)?e:{},V=(e,...t)=>{for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}return``},H=(e,t)=>{if(e!==``){if(P.has(e)){P.set(e,!0);return}if(P.size<50){P.set(e,!0);return}for(let n of P.keys())if(n!==t){P.delete(n),P.set(e,!0);return}P.set(e,!0)}},U=(e,t)=>{if(F.size>=200){let e=F.keys().next().value;typeof e==`string`&&F.delete(e)}F.set(e,t)},W=(e,t)=>{let n=e(j(t,`read`,!1)).then(({skills:e})=>{I.set(t,e)}).catch(()=>{I.set(t,[])}).finally(()=>{L.get(t)===n&&L.delete(t)});return L.set(t,n),n},G=(e,t,n)=>{if(e!==void 0)try{let r=e.info;typeof r==`function`&&r.call(e,t,n)}catch{}},K=e=>e===null?1:e.length,q=e=>{let t=V(e,`task`,`description`,`prompt`),n=e.tasks;if(!Array.isArray(n))return t;let r=n.map(e=>typeof e==`string`?e:V(B(e),`task`,`description`,`prompt`)).filter(e=>e.length>0).join(`
|
|
10
|
+
`);return t.length===0?r:t+`
|
|
11
|
+
`+r},J=e=>{let t=e.tasks;return Array.isArray(t)?t:null},Y=(e,t)=>{e.on(`tool_call`,async(n,r)=>{let i=R(r),a=B(n.input),s=i===``?!1:P.get(i)??!1,l=await t(c(j(r.cwd,n.toolName,s)));if(o(l))throw l.failure;let{skills:u,gate:d}=l.success;I.set(r.cwd,u);let f=K(J(a)),p=M.extractSpecShape(q(a));if(d!==void 0)return H(i,i),G(e.logger,`agent_discipline.dispatch.blocked`,{plugin:`agent_discipline`,session_id:i,tool:n.toolName,reason:`kernel_delivered`,batch_size:f,has_objective:p.hasObjective,has_write_scope:p.hasWriteScope,has_verify_commands:p.hasVerifyCommands}),{block:!0,reason:d.reason};G(e.logger,`agent_discipline.dispatch.observed`,{plugin:`agent_discipline`,session_id:i,tool:n.toolName,batch_size:f,has_objective:p.hasObjective,has_write_scope:p.hasWriteScope,has_verify_commands:p.hasVerifyCommands})}),e.on(`tool_execution_start`,(e,n)=>{if(e.toolName!==`read`)return;let r=e.toolCallId;if(typeof r!=`string`||r.length===0)return;let i=B(e.args).path;typeof i==`string`&&(U(r,i),I.has(n.cwd)||W(t,n.cwd))}),e.on(`tool_execution_end`,async(t,n)=>{if(t.toolName!==`read`)return;let r=t.toolCallId;if(typeof r!=`string`||r.length===0)return;let i=F.get(r);if(F.delete(r),i===void 0||t.isError)return;let a=L.get(n.cwd);a!==void 0&&await a;let o=I.get(n.cwd);if(o===void 0||!M.matchesDoctrineSkillPath(i,o))return;let s=R(n);s!==``&&(H(s,s),G(e.logger,`agent_discipline.doctrine.loaded`,{plugin:`agent_discipline`,session_id:s,tool:t.toolName}))}),e.on(`session_start`,(e,n)=>{W(t,n.cwd)})};export{N as n,E as r,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$a as t,$n as n,$o as r,$r as i,A as a,Ai as o,An as s,Ar as c,B as ee,Bi as te,Br as ne,Bt as re,C as ie,Ca as ae,Ci as oe,Cn as se,Cr as l,D as ce,Da as le,Di as ue,Dr as de,E as fe,Ei as pe,Eo as u,Er as me,F as he,Fi as ge,Fr as _e,G as d,Gi as ve,Gr as ye,Gt as be,H as xe,Hi as Se,Hn as Ce,Ho as we,Hr as Te,Ht as Ee,I as De,Ii as f,In as Oe,Ir as ke,It as p,Ji as Ae,Jn as m,Jr as je,Jt as Me,Ki as Ne,Kn as Pe,Kr as Fe,Kt as Ie,L as Le,Li as Re,Lr as ze,Lt as h,M as g,Mi as _,Mn as Be,Mr as Ve,N as He,Ni as Ue,Nn as We,No as Ge,Nr as Ke,O as qe,Oi as Je,On as Ye,Or as Xe,P as Ze,Pi as Qe,Pr as $e,Qn as et,Qo as tt,Qr as nt,R as rt,Ra as it,Ri as v,Rn as at,Rr as ot,Rt as st,S as ct,Sa as lt,Si as ut,Sn as dt,Sr as ft,T as pt,Ti as mt,To as ht,Tr as gt,U as _t,Ui as vt,Un as yt,Ur as bt,V as xt,Vi as St,Vr as Ct,W as wt,Wi as Tt,Wn as y,Wr as Et,Wt as Dt,Xi as Ot,Xn as kt,Xr as At,Xt as jt,Yi as Mt,Yn as Nt,Yr as Pt,Yt as Ft,Zi as It,Zn as Lt,Zr as Rt,_ as zt,_i as Bt,_n as Vt,_r as Ht,aa as Ut,ai as Wt,an as Gt,ar as Kt,at as qt,b as Jt,bi as Yt,bn as Xt,bo as b,br as Zt,ca as Qt,ci as $t,cn as en,cr as tn,ct as nn,da as rn,di as x,dn as an,dr as S,dt as on,ei as sn,er as cn,es as C,fa as ln,fi as un,fn as dn,fo as fn,fr as pn,ft as mn,g as hn,gi as gn,gn as _n,gr as vn,h as yn,ha as bn,hi as xn,hn as Sn,hr as Cn,i as wn,ia as w,ii as Tn,io as En,ir as Dn,it as On,j as kn,ji as An,jn,jr as Mn,k as Nn,ki as Pn,kn as Fn,la as In,li as Ln,ln as Rn,lr as zn,m as Bn,ma as Vn,mi as Hn,mn as Un,mr as Wn,ni as Gn,nn as Kn,nr as qn,nt as Jn,oa as Yn,oi as Xn,on as T,or as Zn,os as E,ot as Qn,p as $n,pa as er,pi as tr,pn as nr,pr as rr,qi as ir,qn as ar,qr as or,qt as sr,r as cr,ra as lr,ri as ur,rn as dr,rr as fr,rt as pr,sa as mr,si as D,sn as hr,sr as gr,st as _r,ti as vr,tr as yr,ts as O,tt as k,ua as br,ui as A,un as xr,ur as Sr,ut as Cr,v as wr,vi as Tr,vn as Er,vr as Dr,w as Or,wi as kr,wr as Ar,x as jr,xi as Mr,xn as j,xr as M,y as Nr,yi as Pr,yn as Fr,yo as Ir,yr as Lr,z as Rr,za as zr,zi as Br,zr as Vr,zt as Hr}from"./effect-Cx0dl_A6.js";import{a as Ur,o as Wr,r as Gr}from"./Cause-CU3CumyG.js";import{i as Kr}from"./Exit-CV9u1RPk.js";const qr={"~effect/Deferred":{_A:O,_E:O},pipe(){return E(this,arguments)}},Jr=()=>{let e=Object.create(qr);return e.resumes=void 0,e.effect=void 0,e},Yr=e=>g(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),x(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),Xr=C(2,(e,t)=>x(()=>Zr(e,t))),Zr=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){let n=e.resumes;e.resumes=void 0;for(let e=0;e<n.length;e++)n[e](t)}return!0},Qr=Ot,$r=It,ei=nt,ti=ft,ni=je,N=Rt,ri=At,ii=`~effect/Layer/MemoMap`,ai=(e,t)=>(e.observers++,Nr(Pt(t,t=>e.finalizer(t)),e.effect)),oi={"~effect/Layer":{_ROut:O,_E:O,_RIn:O},pipe(){return E(this,arguments)}},si=e=>{let t=Object.create(oi);return t.build=e,t},ci=e=>si((t,n)=>{let r=N(n);return S(e(t,r),e=>e._tag===`Failure`?ri(r,e):f)}),li=e=>{let t=ci((n,r)=>n.getOrElseMemoize(t,r,e));return t},ui=(e,t,n,r)=>{let i=ei(),a=Jr(),o={observers:1,effect:Yr(a),finalizer:n=>A(()=>(o.observers--,o.observers===0?(e.map.delete(t),ri(i,n)):f))};return e.map.set(t,o),Pt(n,o.finalizer).pipe(T(()=>r(e,i)),S(e=>(o.effect=e,Xr(a,e))))};var di=class{get[ii](){return ii}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?ai(n,t):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return A(()=>this.get(e,t)||ui(this,e,t,n))}};const fi=()=>new di,pi=e=>new di(e);var P=class e extends In()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=ln(t,e);return n?pi(n):fi()}};const F=C(3,(e,t,n)=>l(m(e.build(t,n),br(P,t)),P,t)),mi=C(2,(e,t)=>ht(n=>F(e,P.forkOrCreate(n.context),t))),hi=function(){return arguments.length===1?e=>gi(Vn(arguments[0],e)):gi(Vn(arguments[0],arguments[1]))},gi=e=>si(r(D(e))),_i=function(){return arguments.length===1?e=>vi(arguments[0],e):vi(arguments[0],arguments[1])},vi=(e,t)=>yi(m(t,t=>Vn(e,t))),yi=e=>li((t,n)=>ti(e,n)),bi=(e,t,n)=>{let r=N(n,`parallel`);return nr(e,e=>e.build(t,N(r,`sequential`)),{concurrency:e.length}).pipe(m(e=>bn(...e)))},xi=(...e)=>ci((t,n)=>bi(e,t,n)),Si=(e,t,n)=>ci((r,i)=>T(Array.isArray(t)?bi(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(M(t),m(e=>n(e,t))))),Ci=C(2,(e,t)=>Si(e,t,O)),wi=Qt(`effect/ExecutionPlan/CurrentMetadata`,{defaultValue:r({attempt:0,stepIndex:0})}),Ti=C(2,(e,t)=>Ze(e,Oi,e=>t(e))),Ei=e=>e.reasons.some(I),I=e=>e._tag===`Fail`&&Wr(e.error),Di=e=>{let t,n=!1;for(let r of e.reasons)I(r)?t??=r.error:r._tag!==`Interrupt`&&(n=!0);return t===void 0?lt(e):n?lt(Ur(e.reasons.filter(e=>!I(e)))):le(t)},Oi=e=>{let t=Di(e);return ae(t)?t:le(t.success.value)},ki=C(2,(e,t)=>fr(e,{onSuccess:t.onSuccess,onFailure:e=>{let n=Di(e);return ae(n)?t.onFailure(n.failure):t.onDone(n.success.value)}})),Ai=`~effect/Schedule`,L=Qt(`effect/Schedule/CurrentMetadata`,{defaultValue:r({input:void 0,output:void 0,duration:mr,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),ji={[Ai]:{_Out:O,_In:O,_Env:O},pipe(){return E(this,arguments)}},Mi=e=>we(e,Ai),R=e=>{let t=Object.create(ji);return t.step=e,t},z=()=>{let e=0,t,n;return(r,i)=>{n===void 0&&(n=r);let a=r-n,o=t===void 0?0:r-t;return t=r,{input:i,attempt:++e,start:n,now:r,elapsed:a,elapsedSincePrevious:o}}},Ni=e=>R(m(e,e=>{let t=z();return(n,r)=>e(t(n,r))})),B=e=>He(e.step,e=>D(()=>h(e))),V=e=>k(t=>m(B(e),e=>{let n=z();return r=>A(()=>{let i=t.currentTimeMillisUnsafe();return T(e(i,r),([e,t])=>{let a=n(i,r);return a.output=e,a.duration=t,ie(Tn(t),a)})})})),Pi=e=>R(m(B(e),e=>(t,n)=>ki(e(t,n),{onSuccess:e=>D([n,e[1]]),onFailure:h,onDone:()=>Gr(n)}))),Fi=e=>H(Li,({attempt:t})=>D(t<=e)),Ii=e=>{let t=w(e);return Ni(D(e=>D([e.attempt-1,t])))},H=C(2,(e,t)=>R(m(B(e),e=>{let n=z();return(r,i)=>T(e(r,i),e=>{let[a,o]=e,s=t({...n(r,i),output:a,duration:o});return T(b(s)?s:D(s),t=>t?D(e):Gr(a))})}))),Li=Ii(mr),Ri=(e,t,n)=>sn(r=>T(n?.local?F(t,fi(),r):mi(t,r),t=>M(e,t))),zi=C(e=>b(e[0]),(e,t,n)=>er(t)?M(e,t):Ri(e,Array.isArray(t)?xi(...t):t,n)),Bi=C(3,(e,t,n)=>T(V(t),t=>{let r=L.defaultValue();return d(Un(un(T(A(()=>l(e,L,r)),t),e=>x(()=>{r=e})),{disableYield:!0}),e=>Ir(e)?D(e.value):n(e,r.attempt===0?it():zr(r)))})),Vi=C(3,(e,t,n)=>T(V(t),t=>{let r=L.defaultValue(),i,a=d(A(()=>l(e,L,r)),e=>(i=e,T(t(e),e=>(r=e,a))));return Ti(a,e=>u(()=>n(i,e)))})),Hi=C(2,(e,t)=>{let n=typeof t==`function`?t(O):Mi(t)?t:W(t);return Bi(e,n,p)}),U=C(2,(e,t)=>{let n=typeof t==`function`?t(O):Mi(t)?t:W(t);return Vi(e,n,p)}),Ui=C(3,(e,t,n)=>T(V(n),n=>{let i=L.defaultValue(),a=A(()=>l(e,L,i));return d(T(n(t),e=>{i=e;let t=r(T(a,n));return v({while:tt,body:t,step(e){i=e}})}),e=>Ir(e)?D(e.value):p(e))})),Wi=Pi(Li),W=e=>{let t=e.schedule?Pi(e.schedule):Wi;return e.while&&(t=H(t,({input:t})=>{let n=e.while(t);return b(n)?n:D(n)})),e.until&&(t=H(t,({input:t})=>{let n=e.until(t);return b(n)?m(n,e=>!e):D(!n)})),e.times!==void 0&&(t=H(t,({attempt:t})=>D(t<=e.times))),t},Gi=(e,t)=>{let n=-1,r=0,i=t=>s(e(t));return{begin:k(e=>A(()=>{let a=t();a.stepIndex!==n&&(n=a.stepIndex,r=0),r++;let o={attempt:a.attempt,stepAttempt:r,stepIndex:a.stepIndex,startNanos:e.monotonicTimeNanosUnsafe()};return ie(i({_tag:`AttemptStart`,attempt:o.attempt,stepAttempt:o.stepAttempt,stepIndex:o.stepIndex}),o)})),end:(e,t)=>k(n=>{let r=Ut(n.monotonicTimeNanosUnsafe()-e.startNanos);return i(t._tag===`Success`?{_tag:`AttemptSuccess`,attempt:e.attempt,stepAttempt:e.stepAttempt,stepIndex:e.stepIndex,duration:r}:{_tag:`AttemptFailure`,attempt:e.attempt,stepAttempt:e.stepAttempt,stepIndex:e.stepIndex,duration:r,cause:t.cause})})}},Ki=C(e=>b(e[0]),(e,t,n)=>A(()=>{let r=0,i={attempt:0,stepIndex:0},a=Ar(wi,x(()=>(i={attempt:i.attempt+1,stepIndex:r},i))),o=n?.onEvent===void 0?void 0:Gi(n.onEvent,()=>i),s=o===void 0?O:e=>Pn(t=>T(o.begin,n=>S(t(e),e=>o.end(n,e)))),c;return T(v({while:()=>r<t.steps.length&&(c===void 0||ae(c)),body(){let n=t.steps[r],i=a(s(zi(e,n.provide)));if(c){let e=!1,t=i;i=A(()=>e?t:(e=!0,j(c))),i=U(i,qi(n,!1))}else{let e=qi(n,!0);i=e?U(i,e):i}return Ke(i)},step(e){c=e,r++}}),()=>j(c))})),qi=(e,t)=>t?e.attempts===1||!(e.schedule||e.attempts)?void 0:W({schedule:e.schedule,while:e.while,times:e.attempts?e.attempts-1:void 0}):W({schedule:e.schedule?e.schedule:e.attempts?void 0:Ji,times:e.attempts,while:e.while}),Ji=Fi(1);({...En});const Yi=e=>e,Xi=C(2,(e,t)=>{let n=t=>g(n=>{let r=Qi(t,e,n,se());return ea(t,r)});return b(t)?T(t,n):n(t)}),Zi=(e,t)=>{let n=Qi(t.resolver,e,t.onExit,{context:t.context,currentScheduler:rn(t.context,lr)});return()=>$i(t.resolver,n)},G=[],K=new WeakMap,Qi=(e,t,n,r)=>{let i=K.get(e);i||(i=new Map,K.set(e,i));let a,o=!1,s=Yi({request:t,context:r.context,uninterruptible:!1,completeUnsafe(e){o||(o=!0,n(e),a?.entrySet.delete(s))}});if(e.preCheck!==void 0&&!e.preCheck(s))return s;let c=e.batchKey(s);if(a=i.get(c),!a){if(G.length>0)a=G.pop(),a.key=c,a.resolver=e,a.map=i;else{let t={key:c,resolver:e,map:i,entrySet:new Set,entries:new Set,delayEffect:T(A(()=>t.resolver.delay),e=>ta(t)),run:S(A(()=>t.resolver.runAll(Array.from(t.entries),t.key)),e=>{for(let n of t.entrySet)n.completeUnsafe(e._tag===`Success`?fn(Error(`Effect.request: RequestResolver did not complete request`,{cause:n.request})):e);return t.entries.clear(),G.length<128&&(t.entrySet.clear(),t.key=void 0,t.fiber=void 0,t.resolver=void 0,t.map=void 0,G.push(t)),f})};a=t}i.set(c,a),a.fiber=ze(r.context)(a.delayEffect,{scheduler:r.currentScheduler})}return a.entrySet.add(s),a.entries.add(s),a.resolver.collectWhile(a.entries)?s:(a.fiber.interruptUnsafe(r.id),a.fiber=ze(r.context)(ta(a),{scheduler:r.currentScheduler}),s)},$i=(e,t)=>{if(t.uninterruptible)return;let n=K.get(e);if(!n)return;let r=e.batchKey(t),i=n.get(r);i&&(i.entries.delete(t),i.entrySet.delete(t),i.entries.size===0&&(n.delete(r),i.fiber?.interruptUnsafe()))},ea=(e,t)=>x(()=>$i(e,t));function ta(e){return e.map.has(e.key)?(e.map.delete(e.key),e.run):f}const q=C(2,(e,t)=>pr(n=>x(()=>e.updateUnsafe(t,n))));var na=e({Do:()=>Sa,Transaction:()=>$,TypeId:()=>ra,abortSignal:()=>Bs,acquireDisposable:()=>bs,acquireRelease:()=>ys,acquireUseRelease:()=>xs,addFinalizer:()=>Ss,all:()=>ia,andThen:()=>Ba,annotateCurrentSpan:()=>$s,annotateLogs:()=>Wc,annotateLogsScoped:()=>Gc,annotateSpans:()=>Qs,as:()=>Ka,asSome:()=>qa,asVoid:()=>Ja,awaitAllChildren:()=>_c,bind:()=>Ta,bindTo:()=>Ca,cached:()=>js,cachedInvalidateWithTTL:()=>Ns,cachedWithTTL:()=>Ms,callback:()=>X,catch:()=>Qa,catchCause:()=>io,catchCauseFilter:()=>uo,catchCauseIf:()=>lo,catchDefect:()=>ao,catchEager:()=>fl,catchFilter:()=>so,catchIf:()=>oo,catchNoSuchElement:()=>co,catchReason:()=>to,catchReasons:()=>no,catchTag:()=>$a,catchTags:()=>eo,clockWith:()=>Pc,context:()=>is,contextWith:()=>as,currentParentSpan:()=>tc,currentSpan:()=>ec,delay:()=>Po,die:()=>Aa,effectify:()=>il,ensuring:()=>Cs,eventually:()=>xo,exit:()=>Wa,fail:()=>Z,failCause:()=>Oa,failCauseSync:()=>ka,failSync:()=>Da,fiber:()=>vc,fiberId:()=>yc,filter:()=>Vo,filterMap:()=>Ho,filterMapEffect:()=>Uo,filterMapOrElse:()=>Go,filterMapOrFail:()=>qo,filterOrElse:()=>Wo,filterOrFail:()=>Ko,findFirst:()=>ca,findFirstFilter:()=>la,firstSuccessOf:()=>Ao,flatMap:()=>Q,flatMapEager:()=>dl,flatten:()=>za,flip:()=>Ya,fn:()=>Nc,fnUntraced:()=>Mc,fnUntracedEager:()=>pl,forEach:()=>ua,forever:()=>Vs,forkChild:()=>pc,forkDetach:()=>gc,forkIn:()=>mc,forkScoped:()=>hc,fromNullishOr:()=>Ra,fromOption:()=>Ia,fromResult:()=>Fa,gen:()=>Ea,head:()=>da,ignore:()=>To,ignoreCause:()=>Eo,interrupt:()=>Ps,interruptible:()=>Fs,interruptibleMask:()=>zs,isEffect:()=>J,isFailure:()=>ns,isSuccess:()=>rs,let:()=>wa,linkSpans:()=>ic,log:()=>Ic,logDebug:()=>Vc,logError:()=>zc,logFatal:()=>Lc,logInfo:()=>Bc,logTrace:()=>Hc,logWarning:()=>Rc,logWithLevel:()=>Fc,makeSpan:()=>ac,makeSpanScoped:()=>oc,map:()=>Ga,mapBoth:()=>po,mapBothEager:()=>ul,mapEager:()=>cl,mapError:()=>fo,mapErrorEager:()=>ll,match:()=>Yo,matchCause:()=>Zo,matchCauseEager:()=>Qo,matchCauseEffect:()=>es,matchCauseEffectEager:()=>$o,matchEager:()=>Xo,matchEffect:()=>ts,never:()=>xa,onError:()=>ws,onErrorFilter:()=>Es,onErrorIf:()=>Ts,onExit:()=>Os,onExitFilter:()=>As,onExitIf:()=>ks,onExitPrimitive:()=>Ds,onInterrupt:()=>Is,option:()=>Ua,orDie:()=>mo,orElseSucceed:()=>ko,partition:()=>aa,promise:()=>pa,provide:()=>os,provideContext:()=>ss,provideService:()=>ms,provideServiceEffect:()=>hs,race:()=>zo,raceAll:()=>Lo,raceAllFirst:()=>Ro,raceFirst:()=>Bo,reduce:()=>oa,repeat:()=>Hs,repeatOrElse:()=>Us,replicate:()=>Ws,replicateEffect:()=>Gs,request:()=>dc,requestUnsafe:()=>fc,result:()=>Ha,retry:()=>So,retryOrElse:()=>Co,runCallback:()=>Cc,runCallbackWith:()=>Sc,runFork:()=>bc,runForkWith:()=>xc,runPromise:()=>wc,runPromiseExit:()=>Ec,runPromiseExitWith:()=>Dc,runPromiseWith:()=>Tc,runSync:()=>Oc,runSyncExit:()=>Ac,runSyncExitWith:()=>jc,runSyncWith:()=>kc,sandbox:()=>wo,satisfiesErrorType:()=>ol,satisfiesServicesType:()=>sl,satisfiesSuccessType:()=>al,schedule:()=>Ks,scheduleFrom:()=>qs,scope:()=>gs,scoped:()=>_s,scopedWith:()=>vs,service:()=>ls,serviceOption:()=>us,setContext:()=>cs,sleep:()=>Fo,spanAnnotations:()=>nc,spanLinks:()=>rc,succeed:()=>ha,succeedNone:()=>ga,succeedSome:()=>_a,suspend:()=>va,sync:()=>ya,tap:()=>Va,tapCause:()=>_o,tapCauseFilter:()=>yo,tapCauseIf:()=>vo,tapDefect:()=>bo,tapError:()=>ho,tapErrorTag:()=>go,timed:()=>Io,timeout:()=>jo,timeoutOption:()=>Mo,timeoutOrElse:()=>No,tracer:()=>Js,track:()=>qc,trackDefects:()=>Xc,trackDuration:()=>Zc,trackErrors:()=>Yc,trackSuccesses:()=>Jc,transposeOption:()=>La,try:()=>ja,tryPromise:()=>ma,tx:()=>Qc,txRetry:()=>rl,undefined:()=>ba,uninterruptible:()=>Ls,uninterruptibleMask:()=>Rs,unwrapReason:()=>ro,updateContext:()=>ds,updateService:()=>fs,updateServiceScoped:()=>ps,useSpan:()=>sc,validate:()=>sa,void:()=>Y,when:()=>Jo,whileLoop:()=>fa,withErrorReporting:()=>Oo,withExecutionPlan:()=>Do,withFiber:()=>Pa,withLogSpan:()=>Kc,withLogger:()=>Uc,withParentSpan:()=>uc,withSpan:()=>cc,withSpanScoped:()=>lc,withTracer:()=>Ys,withTracerEnabled:()=>Xs,withTracerTiming:()=>Zs,yieldNow:()=>Ma,yieldNowWith:()=>Na,zip:()=>Xa,zipWith:()=>Za});const ra=t,J=b,ia=wr,aa=Lr,oa=c,sa=ge,ca=Kn,la=dr,ua=nr,da=Ye,fa=v,pa=Zt,ma=mt,ha=D,ga=$t,_a=Ln,va=A,ya=x,Y=f,ba=ue,X=g,xa=gr,Sa=wn,Ca=qe,wa=Ce,Ta=ce,Ea=dt,Z=p,Da=Hr,Oa=h,ka=st,Aa=nn,ja=pe,Ma=Ne,Na=ir,Pa=ht,Fa=j,Ia=Xt,La=kr,Ra=Fr,Q=T,za=en,Ba=Nr,Va=un,Ha=Ke,Ua=vn,Wa=mn,Ga=m,Ka=ie,qa=Or,Ja=pt,Ya=Rn,Xa=Ae,Za=Mt,Qa=d,$a=_t,eo=wt,to=xt,no=xe,ro=o,io=He,ao=De,oo=Rr,so=rt,co=ee,lo=he,uo=Ze,fo=et,po=Nt,mo=Ht,ho=Bt,go=Tr,_o=tr,vo=xn,yo=Hn,bo=gn,xo=on,So=U,Co=Vi,wo=Fe,To=Fn,Eo=s,Do=Ki,Oo=Br,ko=Dr,Ao=Gt,jo=Yt,Mo=Mr,No=ut,Po=_r,Fo=Tn,Io=Pr,Lo=me,Ro=de,zo=gt,Bo=Xe,Vo=Dt,Ho=be,Uo=Ie,Wo=Ft,Go=sr,Ko=jt,qo=Me,Jo=Re,Yo=cn,Xo=Kt,Zo=yr,Qo=qn,$o=Dn,es=fr,ts=Zn,ns=Oe,rs=at,is=Jn,as=pr,os=zi,ss=M,cs=ur,ls=vr,us=Gn,ds=An,fs=_,ps=Ue,ms=l,hs=Ar,gs=or,_s=i,vs=sn,ys=yn,bs=Bn,xs=hn,Ss=zt,Cs=Cr,ws=tn,Ts=Sr,Es=zn,Ds=Wn,Os=S,ks=rr,As=pn,js=Nn,Ms=kn,Ns=a,Ps=jn,Fs=Be,Is=Cn,Ls=Je,Rs=Pn,zs=We,Bs=$n,Vs=Un,Hs=Hi,Us=Bi,Ws=Mn,Gs=Ve,Ks=C(2,(e,t)=>qs(e,void 0,t)),qs=Ui,Js=oe,Ys=vt,Xs=Tt,Zs=ve,Qs=ct,$s=Jt,ec=qt,tc=On,nc=Wt,rc=Xn,ic=yt,ac=Pe,oc=ar,sc=Qe,cc=St,lc=Se,uc=te,dc=Xi,fc=Zi,pc=Sn,mc=Vt,hc=Er,gc=_n,_c=fe,vc=re,yc=Ee,bc=ke,xc=ze,Sc=_e,Cc=$e,wc=ot,Tc=Ct,Ec=Vr,Dc=ne,Oc=Te,kc=ye,Ac=bt,jc=Et,Mc=an,Nc=xr,Pc=k,Fc=y,Ic=y(),Lc=y(`Fatal`),Rc=y(`Warn`),zc=y(`Error`),Bc=y(`Info`),Vc=y(`Debug`),Hc=y(`Trace`),Uc=C(2,(e,t)=>_(e,cr,e=>new Set([...e,t]))),Wc=C(e=>J(e[0]),(e,...t)=>_(e,Qr,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||Ge(n,t[0],t[1]),n})),Gc=jr,Kc=C(2,(e,t)=>T(Qn,n=>_(e,$r,e=>[[t,n],...e]))),qc=C(e=>J(e[0]),(e,t,n)=>Os(e,e=>{let r=n===void 0?e:u(()=>n(e));return q(t,r)})),Jc=C(e=>J(e[0]),(e,t,n)=>Va(e,e=>{let r=n===void 0?e:n(e);return q(t,r)})),Yc=C(e=>J(e[0]),(e,t,n)=>ho(e,e=>{let r=n===void 0?e:u(()=>n(e));return q(t,r)})),Xc=C(e=>J(e[0]),(e,t,n)=>bo(e,e=>{let r=n===void 0?e:u(()=>n(e));return q(t,r)})),Zc=C(e=>J(e[0]),(e,t,n)=>Pc(r=>{let i=r.monotonicTimeNanosUnsafe();return Os(e,()=>{let e=r.monotonicTimeNanosUnsafe(),a=Yn(w(e),w(i)),o=n===void 0?a:u(()=>n(a));return q(t,o)})}));var $=class extends In()(`effect/Effect/Transaction`){};const Qc=e=>Pa(t=>{let n=ln(t.context,$);if(n)return e;n={journal:new Map,retry:!1};let i;return Rs(a=>Q(fa({while:()=>!i,body:r(a(e).pipe(ms($,n),_o(()=>n.retry?a(el(n)):Y),Wa)),step(e){if(n.retry||!$c(n))return nl(n);Kr(e)?tl(t,n):nl(n),i=e}}),()=>i))}),$c=e=>{for(let[t,{version:n}]of e.journal)if(t.version!==n)return!1;return!0},el=e=>va(()=>{let t={},n=Array.from(e.journal.keys()),r=()=>{for(let e of n)e.pending.delete(t)};return X(e=>{let i=()=>{r(),e(Y)};for(let e of n)e.pending.set(t,i);return ya(r)})});function tl(e,t){for(let[n,{value:r}]of t.journal){r!==n.value&&(n.version+=1,n.value=r);for(let t of n.pending.values())e.currentDispatcher.scheduleTask(t,0);n.pending.clear()}}function nl(e){e.retry=!1,e.journal.clear()}const rl=Q($,e=>(e.retry=!0,Ps)),il=(e,t,n)=>(...r)=>X(i=>{try{e(...r,(e,n)=>{i(e?Z(t?t(e,r):e):ha(n))})}catch(e){i(n?Z(n(e,r)):Aa(e))}}),al=()=>e=>e,ol=()=>e=>e,sl=()=>e=>e,cl=Lt,ll=n,ul=kt,dl=hr,fl=Le,pl=dn;export{Y as $,ko as A,Tc as B,Ea as C,ll as D,fo as E,bc as F,us as G,Ac as H,xc as I,va as J,ha as K,wc as L,Ha as M,Cc as N,ts as O,Sc as P,ja as Q,Ec as R,Fa as S,cl as T,jc as U,Oc as V,kc as W,Va as X,ya as Y,ma as Z,Mc as _,io as a,fi as at,Vs as b,il as c,hi as ct,Oa as d,N as dt,Pa as et,ka as f,ei as ft,Nc as g,za as h,X as i,_i as it,ss as j,mo as k,Wa as l,ni as lt,dl as m,ys as n,Ei as nt,$a as o,xi as ot,Q as p,ti as pt,ga as q,Ka as r,F as rt,Aa as s,Ci as st,na as t,Ti as tt,Z as u,ri as ut,pl as v,Ga as w,mc as x,ua as y,Dc as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{At as t,Ct as ee,Dt as n,Et as r,Mt as i,Nt as a,Ot as o,Pt as s,St as c,Tt as l,_t as u,bt as d,fo as f,gt as p,ho as m,ht as h,jt as g,kt as _,mo as v,mt as y,po as b,pt as x,vt as S,wt as C,xo as w,xt as T,yt as E}from"./effect-Cx0dl_A6.js";var D=e({asVoid:()=>X,asVoidAll:()=>Z,die:()=>M,fail:()=>j,failCause:()=>A,filterCause:()=>U,filterFailure:()=>H,filterSuccess:()=>B,filterValue:()=>V,findDefect:()=>G,findError:()=>W,findErrorOption:()=>te,getCause:()=>$,getSuccess:()=>Q,hasDies:()=>R,hasFails:()=>L,hasInterrupts:()=>z,interrupt:()=>N,isExit:()=>O,isFailure:()=>I,isSuccess:()=>F,map:()=>q,mapBoth:()=>Y,mapError:()=>J,match:()=>K,succeed:()=>k,void:()=>P});const O=w,k=m,A=v,j=b,M=f,N=n,P=s,F=_,I=o,L=l,R=C,z=r,B=u,V=S,H=p,U=h,W=d,G=E,K=a,q=t,J=i,Y=g,X=x,Z=y,Q=ee,$=c,te=T;export{k as a,F as i,j as n,P as o,A as r,D as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Da as e,Sa as t,Ta as n,os as r,ts as i,wa as a}from"./effect-Cx0dl_A6.js";const o={"~effect/match/Match/Matcher":{_input:i,_filters:i,_result:i,_return:i,_flavor:i},_tag:`ValueMatcher`,add(t){return n(this.value)?this:t._tag===`When`&&t.guard(this.provided)===!0||t._tag===`Not`&&t.guard(this.provided)===!1?s(this.provided,e(t.evaluate(this.provided))):this},pipe(){return r(this,arguments)}};function s(e,t){let n=Object.create(o);return n.provided=e,n.value=t,n}const c=(e,t)=>({_tag:`When`,guard:e,evaluate:t}),l=e=>{if(typeof e==`function`)return e;if(Array.isArray(e)){let t=e.map(l),n=t.length;return e=>{if(!Array.isArray(e))return!1;for(let r=0;r<n;r++)if(t[r](e[r])===!1)return!1;return!0}}if(typeof e==`object`&&e){let t=Reflect.ownKeys(e).map(t=>[t,l(e[t])]),n=t.length;return e=>{if(typeof e!=`object`||!e)return!1;for(let r=0;r<n;r++){let[n,i]=t[r];if(!(n in e)||i(e[n])===!1)return!1}return!0}}return t=>t===e},u=e=>s(e,t(e)),d=(e,t)=>n=>n.add(c(l(e),t)),f=(e=>(...t)=>{let n=t[t.length-1],r=t.slice(0,-1),i=r.length===1?t=>t!=null&&t[e]===r[0]:t=>t!=null&&r.includes(t[e]);return e=>e.add(c(i,n))})(`_tag`),p=e=>t=>{let r=m(t);return a(r)?r._tag===`Success`?r.success:e(r.failure):(...t)=>{let i=r(...t);return n(i)?i.success:e(i.failure,...t)}},m=n=>{if(n._tag===`ValueMatcher`)return n.value;let r=n.cases.length;if(r===1){let r=n.cases[0];return(...i)=>{let a=n.select(...i);return r._tag===`When`&&r.guard(a)===!0||r._tag===`Not`&&r.guard(a)===!1?e(r.evaluate(a,...i)):t(a)}}return(...i)=>{let a=n.select(...i);for(let t=0;t<r;t++){let r=n.cases[t];if(r._tag===`When`&&r.guard(a)===!0||r._tag===`Not`&&r.guard(a)===!1)return e(r.evaluate(a,...i))}return t(a)}},h=`effect/match/Match/exhaustive: absurd`,g=e=>{let t=m(e);if(a(t)){if(n(t))return t.success;throw Error(h)}return(...e)=>{let r=t(...e);if(n(r))return r.success;throw Error(h)}},_=u,v=d,y=f,b=p,x=g;export{v as a,_ as i,b as n,y as r,x as t};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{S as e,_ as t,b as n,g as r,h as i,p as a,t as o,v as s,x as c,y as l}from"./dist-B6yj6a-9.js";import{Aa as u,Ia as d,Pa as f}from"./effect-Cx0dl_A6.js";import{C as p}from"./Effect-BSMJns2T.js";import{a as m,i as h,n as g,r as _,t as v}from"./Match-JxLwaSI5.js";const y=i([`subagent_type`,`prompt`]),b=Symbol.for(`@systemfsoftware/omp-agent-discipline/DelegationVerdict`);var x=class extends n()(`Allow`,{}){[b]=b},S=class extends n()(`Block`,{reason:s,how:y,skill:s}){[b]=b};c([x,S]);const C=l({protectedSkills:a(s),delegationVerbs:a(s),referenceVerbs:a(s),mentionPatterns:t(s,s)}).pipe(e({toArbitrary:()=>e=>e.constant({protectedSkills:[`ce-work`],delegationVerbs:["\\binvoke\\s+(?:the\\s+)?[`/]?ce-work\\b","\\bdispatch\\s+(?:to\\s+)?(?:the\\s+)?[`/]?ce-work\\b","\\buse\\s+(?:the\\s+)?[`/]?ce-work\\b","\\bspawn\\s+(?:a\\s+)?(?:task|agent|subagent|worker)\\s+(?:with|using)\\s+(?:the\\s+)?[`/]?ce-work\\b","\\bcall\\s+(?:the\\s+)?[`/]?ce-work\\b","\\brun\\s+(?:the\\s+)?[`/]?ce-work\\b"],referenceVerbs:["\\bsee\\s+(?:the\\s+)?[`/]?ce-work\\b","\\bread\\s+(?:the\\s+)?[`/]?ce-work\\b"],mentionPatterns:{"ce-work":'(?:^|[\\s/.`"])ce-work(?=$|[\\s/.`"]|\\b)'}})})),w=c([C,r]),T=Symbol.for(`@systemfsoftware/omp-agent-discipline/CheckDelegationCommand`);var E=class extends n()(`CheckDelegationCommand`,{toolName:s,subagentType:s,prompt:s,guard:w}){[T]=T};const D=Symbol.for(`@systemfsoftware/omp-agent-discipline/ClassifiedInput`);var O=class extends n()(`NoGuard`,{}){[D]=D},k=class extends n()(`NonDelegatedTool`,{}){[D]=D},A=class extends n()(`ProtectedSubagent`,{skill:s}){[D]=D},j=class extends n()(`EmptyPrompt`,{}){[D]=D},M=class extends n()(`Prompted`,{guard:C,prompt:s}){[D]=D};c([O,k,A,j,M]);const N=Symbol.for(`@systemfsoftware/omp-agent-discipline/PromptAnalysis`);var P=class extends n()(`Delegated`,{skill:s,excerpt:s}){[N]=N},F=class extends n()(`Referenced`,{}){[N]=N},I=class extends n()(`NoDelegation`,{}){[N]=N};c([P,F,I]);function L(e,t,n){return[`⛔ BLOCKED: "`+e+`" must not be delegated to a subagent.`,`Detected in `+t+`: `+n,``,`REQUIRED: invoke `+e+` directly in THIS session via the host Skill / Tool call,`,`then pass its return envelope to the next step. Do NOT wrap it in a task / Agent dispatch.`,``,`WHY: a subagent reproduces the shape but loses the skill protocol — plan-path gate,`,`headless review contract, and pipeline-vs-chat mode. The contract does not survive the hop.`,``,`RULE: root AGENTS.md §"Skill invocations" (SK1/SK2).`].join(`
|
|
2
|
+
`)}function R(e,t){return new RegExp(e,`i`).test(t)}function z(e,t){return e.map(e=>new RegExp(e,`i`).exec(t)).find(e=>e!==null)??null}const B=e=>f(e=>e!==``)(e),V=(e,t)=>h(B(e.prompt)).pipe(_(`Some`,({value:e})=>new M({guard:t,prompt:e})),_(`None`,()=>new j),v),H=(e,t)=>f(e=>e!==``&&t.protectedSkills.includes(e))(e.subagentType),U=(e,t)=>h(H(e,t)).pipe(_(`Some`,({value:e})=>new A({skill:e})),_(`None`,()=>V(e,t)),v),W=e=>u(e.guard),G=(e,t)=>f(e=>e===`task`||e===`agent`)(e.toolName.toLowerCase()).pipe(d(()=>U(e,t))),K=e=>h(W(e)).pipe(_(`None`,()=>new O),_(`Some`,({value:t})=>h(G(e,t)).pipe(_(`None`,()=>new k),_(`Some`,({value:e})=>e),v)),v),q=(e,t)=>{let n=Object.entries(e.mentionPatterns).filter(([,e])=>R(e,t)).map(([e])=>e);return f(e=>e.length>0)(n)},J=(e,t)=>h(q(e,t)).pipe(_(`None`,()=>new I),_(`Some`,({value:n})=>{let r=n[0],i=e.referenceVerbs.some(e=>R(e,t)),a=e.delegationVerbs.some(e=>R(e,t));return h({hasReference:i,hasDelegation:a}).pipe(m({hasReference:!0},()=>new F),m({hasDelegation:!1},()=>new I),g(()=>{let n=z(e.delegationVerbs,t),i=n===null?t.slice(0,120):n[0];return new P({skill:r,excerpt:i})}))}),v),Y=e=>h(K(e)).pipe(_(`NoGuard`,()=>new x),_(`NonDelegatedTool`,()=>new x),_(`ProtectedSubagent`,({skill:e})=>new S({reason:L(e,`subagent_type`,e),how:`subagent_type`,skill:e})),_(`EmptyPrompt`,()=>new x),_(`Prompted`,({guard:e,prompt:t})=>h(J(e,t)).pipe(_(`Delegated`,({skill:e,excerpt:t})=>new S({reason:L(e,`prompt`,t),how:`prompt`,skill:e})),_(`Referenced`,()=>new x),_(`NoDelegation`,()=>new x),v)),v);function X(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Z(e){if(e.length===0)return null;let t=`(?:`+e.map(X).join(`|`)+`)`;return{protectedSkills:e.slice(),delegationVerbs:["\\binvoke\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bdispatch\\s+(?:to\\s+)?(?:the\\s+)?[`/]?"+t+`\\b`,"\\bwrap\\s+(?:the\\s+)?[`/]?"+t+`\\s+in\\s+(?:a\\s+)?(?:task|agent|subagent)\\b`,"\\bdelegate\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\brun\\s+(?:the\\s+)?[`/]?"+t+`\\s+(?:via|in)\\s+(?:a\\s+)?(?:subagent|task|agent)\\b`,"\\b(?:run|execute|launch)\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bskill:\\s*[`/]?"+t+`\\b`,`\\bskill:\\/\\/`+t+`\\b`,`(?:^|\\W)/`+t+`(?=$|\\b|\\W)`,"\\buse\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bload\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bspawn\\s+(?:a\\s+)?(?:task|agent|subagent|worker)\\s+(?:with|using)\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bcall\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bsend\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bcreate\\s+(?:a\\s+)?(?:task|agent|subagent)\\s+(?:with|using)\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bstart\\s+(?:the\\s+)?[`/]?"+t+`\\b`],referenceVerbs:["\\bsee\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bper\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\bread\\s+(?:the\\s+)?[`/]?"+t+`\\b`,"\\baccording\\s+to\\s+(?:the\\s+)?[`/]?"+t+`\\b`],mentionPatterns:Object.fromEntries(e.map(e=>[e,'(?:^|[\\s/.`"])'+X(e)+'(?=$|[\\s/.`"]|\\b)']))}}function Q(e){return h(e).pipe(_(`Block`,e=>({block:!0,reason:e.reason,how:e.how,skill:e.skill})),_(`Allow`,()=>void 0),v)}function $(e){return p(function*(){return Z((yield*(yield*o).load(e)).no_delegate_skills??[])})}function ee(e,t,n,r){return p(function*(){let i=new E({toolName:t,subagentType:n,prompt:r,guard:yield*$(e)});return Q(Y(i))})}export{ee as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Ca as e}from"./effect-Cx0dl_A6.js";import{M as t}from"./Effect-BSMJns2T.js";import{t as n}from"./NoSkillDelegationExecutor-D4XtBj2A.js";const r=e=>typeof e==`object`&&!!e&&!Array.isArray(e),i=e=>r(e)?e:{};function a(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}return``}const o=(r,o)=>{r.on(`tool_call`,async(r,s)=>{let c=i(r.input),l=a(c,`subagent_type`,`agent`),u=a(c,`prompt`,`task`,`description`),d=await o(t(n(s.cwd,r.toolName,l,u)));if(e(d))throw d.failure;return d.success})};export{o as NoSkillDelegationExtension};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=async e=>{let[t,n,r,i]=await Promise.all([import(`./Runtime-CxXrOYpO.js`).then(e=>e.default),import(`./Cause-CU3CumyG.js`).then(e=>e.t),import(`./Effect-BSMJns2T.js`).then(e=>e.t),import(`./Exit-CV9u1RPk.js`).then(e=>e.t)]),a=e.pipe(r.exit),o=await t.runPromise(a);if(i.isFailure(o))throw n.squash(o.cause);return o.value};export{e as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as e,E as t,T as n,a as r,c as i,d as a,f as o,i as s,l as c,n as l,o as u,r as d,s as f,u as p,w as ee}from"./dist-B6yj6a-9.js";import{Aa as m,Ra as h,Ut as te,Vt as ne,is as re,ja as ie,ka as g,za as _}from"./effect-Cx0dl_A6.js";import{i as v}from"./Cause-CU3CumyG.js";import{o as ae}from"./Exit-CV9u1RPk.js";import{$ as y,B as oe,F as b,G as se,H as ce,I as le,J as x,K as ue,L as S,N as de,O as fe,P as pe,R as me,U as he,V as ge,W as _e,X as ve,Y as C,Z as ye,_ as w,at as T,c as E,dt as D,et as O,ft as k,h as A,i as j,it as M,j as N,k as P,n as F,ot as be,p as I,rt as xe,s as Se,st as L,u as R,ut as Ce,w as z,z as we}from"./Effect-BSMJns2T.js";import*as Te from"node:os";import*as Ee from"node:crypto";import*as B from"node:fs";import*as V from"node:path";const De=ne,Oe=te,H=`~effect/ManagedRuntime`,ke=(e,t)=>{let n=t?.memoMap??T(),r=k(`parallel`),i=D(r,`sequential`),a={onFiberStart:Oe(r)},o=e=>e?{...e,onFiberStart:e.onFiberStart?t=>{a.onFiberStart(t),e.onFiberStart(t)}:a.onFiberStart}:a,s,c=O(t=>(s||=b(ve(xe(e,n,i),e=>C(()=>{l.cachedContext=e})),{...a,scheduler:t.currentScheduler}),A(De(s)))),l={[H]:H,memoMap:n,scope:r,contextEffect:c,cachedContext:void 0,context(){return l.cachedContext===void 0?S(l.contextEffect):Promise.resolve(l.cachedContext)},dispose(){return S(l.disposeEffect)},[Symbol.asyncDispose](){return l.dispose()},disposeEffect:x(()=>(l.contextEffect=Se(`ManagedRuntime disposed`),l.cachedContext=void 0,Ce(l.scope,ae))),runFork(e,t){return l.cachedContext===void 0?b(U(l,e),o(t)):le(l.cachedContext)(e,o(t))},runCallback(e,t){return l.cachedContext===void 0?de(U(l,e),o(t)):pe(l.cachedContext)(e,o(t))},runSyncExit(e){return l.cachedContext===void 0?ce(U(l,e)):he(l.cachedContext)(e)},runSync(e){return l.cachedContext===void 0?ge(U(l,e)):_e(l.cachedContext)(e)},runPromiseExit(e,t){return l.cachedContext===void 0?me(U(l,e),o(t)):we(l.cachedContext)(e,o(t))},runPromise(e,t){return l.cachedContext===void 0?S(U(l,e),o(t)):oe(l.cachedContext)(e,o(t))}};return l};function U(e,t){return I(e.contextEffect,e=>N(t,e))}const W=(e,t)=>(n,[r])=>{let i=`Unknown`;switch(n.code){case`ENOENT`:i=`NotFound`;break;case`EACCES`:i=`PermissionDenied`;break;case`EEXIST`:i=`AlreadyExists`;break;case`EISDIR`:i=`BadResource`;break;case`ENOTDIR`:i=`BadResource`;break;case`EBUSY`:i=`Busy`;break;case`ELOOP`:i=`BadResource`}return o({_tag:i,module:e,method:t,pathOrDescriptor:r,syscall:n.syscall,cause:n})},G=e=>t=>a({module:`FileSystem`,method:e,description:t.message??String(t)}),Ae=(()=>{let e=E(B.access,W(`FileSystem`,`access`),G(`access`));return(t,n)=>{let r=B.constants.F_OK;return n?.readable&&(r|=B.constants.R_OK),n?.writable&&(r|=B.constants.W_OK),e(t,r)}})(),je=(()=>{let e=E(B.cp,W(`FileSystem`,`copy`),G(`copy`));return(t,n,r)=>e(t,n,{force:r?.overwrite??!1,preserveTimestamps:r?.preserveTimestamps??!1,recursive:!0})})(),Me=(()=>{let e=E(B.copyFile,W(`FileSystem`,`copyFile`),G(`copyFile`));return(t,n)=>e(t,n)})(),Ne=(()=>{let e=E(B.chmod,W(`FileSystem`,`chmod`),G(`chmod`));return(t,n)=>e(t,n)})(),Pe=(()=>{let e=E(B.chown,W(`FileSystem`,`chown`),G(`chown`));return(t,n,r)=>e(t,n,r)})(),Fe=(()=>{let e=E(B.glob,W(`FileSystem`,`glob`),G(`glob`));return(t,n)=>e(t,{cwd:n?.root,exclude:n?.exclude})})(),Ie=(()=>{let e=E(B.link,W(`FileSystem`,`link`),G(`link`));return(t,n)=>e(t,n)})(),Le=(()=>{let e=E(B.mkdir,W(`FileSystem`,`makeDirectory`),G(`makeDirectory`));return(t,n)=>e(t,{recursive:n?.recursive??!1,mode:n?.mode})})(),K=e=>{let t=E(B.mkdtemp,W(`FileSystem`,e),G(e));return e=>x(()=>{let n=e?.prefix??``,r=typeof e?.directory==`string`?V.join(e.directory,`.`):Te.tmpdir();return t(n?V.join(r,n):r+`/`)})},Re=K(`makeTempDirectory`),q=e=>{let t=E(B.rm,W(`FileSystem`,e),G(e));return(e,n)=>t(e,{recursive:n?.recursive??!1,force:n?.force??!1})},ze=q(`remove`),Be=(()=>{let e=K(`makeTempDirectoryScoped`),t=q(`makeTempDirectoryScoped`);return n=>F(e(n),e=>P(t(e,{recursive:!0})))})(),Ve=(e=>{let t=E(B.open,W(`FileSystem`,e),G(e)),n=E(B.close,W(`FileSystem`,e),G(e));return(e,r)=>re(F(t(e,r?.flag??`r`,r?.mode),e=>P(n(e))),z(e=>He(e,r?.flag?.startsWith(`a`)??!1)))})(`open`),He=(()=>{let e=e=>E(B.read,W(`FileSystem`,e),G(e)),t=e(`read`),n=e(`readAlloc`),i=E(B.fstat,W(`FileSystem`,`stat`),G(`stat`)),a=E(B.ftruncate,W(`FileSystem`,`truncate`),G(`truncate`)),s=E(B.fsync,W(`FileSystem`,`sync`),G(`sync`)),c=e=>E(B.write,W(`FileSystem`,e),G(e)),l=c(`write`),d=c(`writeAll`);class f{[r];fd;append;position=BigInt(0);constructor(e,t){this[r]=r,this.fd=e,this.append=t}get stat(){return z(i(this.fd),X)}get sync(){return s(this.fd)}seek(e,t){let n=u(e);return C(()=>(t===`start`?this.position=n:t===`current`&&(this.position+=n),u(this.position)))}read(e){return x(()=>{let n=this.position;return z(t(this.fd,{buffer:e,position:n}),e=>{let t=u(e);return this.position=n+t,t})})}readAlloc(e){let t=Number(e);return x(()=>{let e=Buffer.allocUnsafeSlow(t),r=this.position;return z(n(this.fd,{buffer:e,position:r}),n=>{if(n===0)return h();if(this.position=r+BigInt(n),n===t)return _(e);let i=Buffer.allocUnsafeSlow(n);return e.copy(i,0,0,n),_(i)})})}truncate(e){return z(a(this.fd,e?Number(e):void 0),()=>{if(!this.append){let t=BigInt(e??0);this.position>t&&(this.position=t)}})}write(e){return x(()=>{let t=this.position;return z(l(this.fd,e,void 0,void 0,this.append?void 0:Number(t)),e=>{let n=u(e);return this.append||(this.position=t+n),n})})}writeAllChunk(e){return x(()=>{let t=this.position;return I(d(this.fd,e,void 0,void 0,this.append?void 0:Number(t)),n=>n===0?R(o({module:`FileSystem`,method:`writeAll`,_tag:`WriteZero`,pathOrDescriptor:this.fd,description:`write returned 0 bytes written`})):(this.append||(this.position=t+BigInt(n)),n<e.length?this.writeAllChunk(e.subarray(n)):y))})}writeAll(e){return this.writeAllChunk(e)}}return(e,t)=>new f(e,t)})(),J=e=>{let t=K(e);return w(function*(e){let n=yield*t(e),r=Ee.randomBytes(6).toString(`hex`),i=V.join(n,e?.suffix?`${r}${e.suffix}`:r);return yield*Q(i,new Uint8Array),i})},Ue=J(`makeTempFile`),We=(()=>{let e=J(`makeTempFileScoped`),t=q(`makeTempFileScoped`);return n=>F(e(n),e=>P(t(V.dirname(e),{recursive:!0})))})(),Ge=(e,t)=>ye({try:()=>B.promises.readdir(e,t),catch:t=>W(`FileSystem`,`readDirectory`)(t,[e])}),Ke=e=>j((t,n)=>{try{B.readFile(e,{signal:n},(n,r)=>{t(n?R(W(`FileSystem`,`readFile`)(n,[e])):ue(r))})}catch(e){t(R(G(`readFile`)(e)))}}),qe=(()=>{let e=E(B.readlink,W(`FileSystem`,`readLink`),G(`readLink`));return t=>e(t)})(),Je=(()=>{let e=E(B.realpath,W(`FileSystem`,`realPath`),G(`realPath`));return t=>e(t)})(),Y=(()=>{let e=E(B.rename,W(`FileSystem`,`rename`),G(`rename`));return(t,n)=>e(t,n)})(),X=e=>({type:e.isFile()?`File`:e.isDirectory()?`Directory`:e.isSymbolicLink()?`SymbolicLink`:e.isBlockDevice()?`BlockDevice`:e.isCharacterDevice()?`CharacterDevice`:e.isFIFO()?`FIFO`:e.isSocket()?`Socket`:`Unknown`,mtime:m(e.mtime),atime:m(e.atime),birthtime:m(e.birthtime),dev:e.dev,rdev:m(e.rdev),ino:m(e.ino),mode:e.mode,nlink:m(e.nlink),uid:m(e.uid),gid:m(e.gid),size:u(e.size),blksize:e.blksize===void 0?h():_(u(e.blksize)),blocks:m(e.blocks)}),Z=(()=>{let e=E(B.stat,W(`FileSystem`,`stat`),G(`stat`));return t=>z(e(t),X)})(),Ye=(()=>{let e=E(B.symlink,W(`FileSystem`,`symlink`),G(`symlink`));return(t,n)=>e(t,n)})(),Xe=(()=>{let e=E(B.truncate,W(`FileSystem`,`truncate`),G(`truncate`));return(t,n)=>e(t,n===void 0?void 0:Number(n))})(),Ze=(()=>{let e=E(B.utimes,W(`FileSystem`,`utime`),G(`utime`));return(t,n,r)=>e(t,n,r)})(),Qe=(r,i)=>c(a=>F(C(()=>{let s=B.watch(r,{recursive:i?.recursive??!1},(e,r)=>{if(r)switch(e){case`rename`:b(fe(Z(r),{onSuccess:e=>n(a,{_tag:`Create`,path:r}),onFailure:e=>n(a,{_tag:`Remove`,path:r})}));return;case`change`:t(a,{_tag:`Update`,path:r});return}});return s.on(`error`,e=>{ee(a,v(o({module:`FileSystem`,_tag:`Unknown`,method:`watch`,pathOrDescriptor:r,cause:e})))}),s.on(`close`,()=>{e(a)}),s}),e=>C(()=>e.close()))),$e=(e,t,n)=>Z(t).pipe(z(r=>e.pipe(g(e=>e.register(t,r,n)),ie(()=>Qe(t,n)))),p),Q=(e,t,n)=>j((r,i)=>{try{B.writeFile(e,t,{signal:i,flag:n?.flag,mode:n?.mode},t=>{r(t?R(W(`FileSystem`,`writeFile`)(t,[e])):y)})}catch(e){r(R(G(`writeFile`)(e)))}}),et=z(se(f),e=>i({access:Ae,chmod:Ne,chown:Pe,copy:je,copyFile:Me,glob:Fe,link:Ie,makeDirectory:Le,makeTempDirectory:Re,makeTempDirectoryScoped:Be,makeTempFile:Ue,makeTempFileScoped:We,open:Ve,readDirectory:Ge,readFile:Ke,readLink:qe,realPath:Je,remove:ze,rename:Y,stat:Z,symlink:Ye,truncate:Xe,utimes:Ze,watch(t,n){return $e(e,t,n)},writeFile:Q})),$=M(s)(et),tt=ke(be($,d,l.pipe(L($),L(d))));export{tt as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";var t=e({XdRetryGuardExtension:()=>s});const n=/Tool ([A-Za-z0-9_:-]+) not found/i,r=new Map;function i(e){return typeof e==`object`&&!!e&&`text`in e&&typeof e.text==`string`}function a(e){if(typeof e!=`object`||!e||!(`content`in e))return``;let t=e.content;return Array.isArray(t)?t.filter(i).map(e=>e.text).join(`
|
|
2
|
+
`):``}function o(e){return[``,`---`,`### ⚠️ Unresolved Tool Calls`,``,"The following xd:// tools were not found but have NOT yet been retried via `write` to `xd://`:",``,...e.map((e,t)=>`${t+1}. **\`${e.tool}\`** — failed ${e.failures} time${e.failures>1?`s`:``}. Your first attempt to use \`${e.tool}\` returned \`Tool not found\`. Write to \`xd://${e.tool}\` (JSON args) to retry — do NOT concede the tool is unavailable.`),``,"Each unresolved entry will repeat here until you retry by writing to the `xd://` device.",`---`].join(`
|
|
3
|
+
`)}const s=e=>{e.on(`tool_execution_end`,(e,t)=>{if(!e.isError)return;let i=n.exec(a(e.result));if(!i)return;let o=i[1];if(o===void 0)return;let s=r.get(o);if(s)s.failures+=1;else{if(r.size>=50){let e=r.keys().next().value;e!==void 0&&r.delete(e)}r.set(o,{tool:o,failures:1,remindedAtFailure:0})}}),e.on(`tool_execution_start`,(e,t)=>{if(e.toolName!==`write`||typeof e.args!=`object`||e.args===null||!(`path`in e.args))return;let n=e.args.path;if(typeof n!=`string`||!n.startsWith(`xd://`))return;let i=n.slice(5).split(/[/?#]/)[0];i!==void 0&&i.length!==0&&r.delete(i)}),e.on(`context`,e=>{if(r.size===0)return;let t=[...r.values()].filter(e=>e.failures>e.remindedAtFailure);if(t.length===0)return;let n=o(t);for(let e of t)e.remindedAtFailure=e.failures;return{messages:[...e.messages,{role:`user`,content:[{type:`text`,text:n}],timestamp:Date.now()}]}})};export{t as n,s as t};
|
package/dist/api.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./RunSafePolicy-CYAsAXQR.js";import{r as t,t as n}from"./DispatchDoctrineHandler-DxQYHIi6.js";import{t as r}from"./NoSkillDelegationExecutor-D4XtBj2A.js";import{t as i}from"./XdRetryGuardMiddleware-CjuvaTYr.js";export{t as DOCTRINE_KERNEL,n as DispatchDoctrineExtension,i as XdRetryGuardExtension,r as runNoSkillDelegation,e as runSafe};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import{Do as e,Dt as t,Fo as n,Ft as r,Go as i,Ho as a,Ia as o,Io as s,Jo as c,Ko as l,La as u,Lo as d,M as f,Ma as ee,Mo as p,Na as m,No as te,Oa as h,Oo as ne,Pt as re,Ra as g,Ro as _,To as ie,Uo as ae,Vn as oe,Vo as se,Wo as ce,Xo as le,Yo as ue,Za as de,Zo as fe,_a as pe,ao as v,as as me,ba as he,di as ge,ea as _e,es as ve,ga as ye,ho as y,is as be,jo as xe,ko as Se,la as Ce,lo as we,lt as b,mo as Te,na as Ee,ns as x,os as S,po as De,qo as Oe,ro as ke,rs as Ae,si as je,ta as Me,ts as C,ui as Ne,va as Pe,xa as Fe,y as Ie,ya as Le,za as w,zo as Re}from"./effect-Cx0dl_A6.js";import{c as ze,r as Be,s as Ve}from"./Cause-CU3CumyG.js";import{a as He,i as Ue,n as We,o as Ge,r as Ke}from"./Exit-CV9u1RPk.js";import{A as qe,C as Je,E as Ye,H as Xe,J as Ze,K as T,Q as Qe,T as $e,X as et,Y as tt,_ as nt,a as rt,b as it,ct as at,d as ot,f as st,g as ct,it as lt,k as ut,l as dt,lt as ft,m as E,nt as pt,o as mt,p as D,pt as ht,q as gt,r as _t,tt as vt,u as O,v as yt,w as bt,x as xt,y as St}from"./Effect-BSMJns2T.js";import Ct from"node:os";function wt(e){return e.map(e=>e.length===0||e.match(/[^A-Za-z0-9_-]/)?JSON.stringify(e):e).join(`.`)}var Tt=class{maxPad=0;srcObject;output=[];#e=new Map;constructor(e){this.srcObject=e}dump(e={}){return this.output=this.#t(this.srcObject),this.output=this.#g(e),this.output}#t(e,t=[]){let n=[],r=Object.keys(e),i=[],a=[];for(let t of r)this.#o(e[t])?i.push(t):a.push(t);let o=i.concat(a);for(let r of o){let i=e[r];if(i instanceof Date)n.push(this.#h([r],i));else if(typeof i==`string`||i instanceof RegExp)n.push(this.#d([r],i.toString()));else if(typeof i==`number`)n.push(this.#f([r],i));else if(typeof i==`boolean`)n.push(this.#p([r],i));else if(i instanceof Array){let e=this.#r(i);if(e===`ONLY_PRIMITIVE`)n.push(this.#u([r],i));else if(e===`ONLY_OBJECT_EXCLUDING_ARRAY`)for(let e=0;e<i.length;e++)n.push(``),n.push(this.#c([...t,r])),n.push(...this.#t(i[e],[...t,r]));else{let e=i.map(e=>this.#a(e)).join(`,`);n.push(`${this.#l([r])}[${e}]`)}}else if(typeof i==`object`&&(n.push(``),n.push(this.#s([...t,r])),i)){let e=i;n.push(...this.#t(e,[...t,r]))}}return n.push(``),n}#n(e){return e instanceof Date||e instanceof RegExp||[`string`,`number`,`boolean`].includes(typeof e)}#r(e){if(this.#e.has(e))return this.#e.get(e);let t=this.#i(e);return this.#e.set(e,t),t}#i(e){if(!e.length)return`ONLY_PRIMITIVE`;let t=this.#n(e[0]);if(e[0]instanceof Array)return`MIXED`;for(let n=1;n<e.length;n++)if(t!==this.#n(e[n])||e[n]instanceof Array)return`MIXED`;return t?`ONLY_PRIMITIVE`:`ONLY_OBJECT_EXCLUDING_ARRAY`}#a(e){if(e instanceof Date)return`"${this.#m(e)}"`;if(typeof e==`string`||e instanceof RegExp)return JSON.stringify(e.toString());if(typeof e==`number`)return e;if(typeof e==`boolean`)return e.toString();if(e instanceof Array)return`[${e.map(e=>this.#a(e)).join(`,`)}]`;if(typeof e==`object`){if(!e)throw Error(`Should never reach`);return`{${Object.keys(e).map(t=>`${wt([t])} = ${this.#a(e[t])}`).join(`,`)}}`}throw Error(`Should never reach`)}#o(e){return typeof e==`string`||typeof e==`number`||typeof e==`boolean`||e instanceof RegExp||e instanceof Date||e instanceof Array&&this.#r(e)!==`ONLY_OBJECT_EXCLUDING_ARRAY`}#s(e){return`[${wt(e)}]`}#c(e){return`[[${wt(e)}]]`}#l(e){let t=wt(e);return t.length>this.maxPad&&(this.maxPad=t.length),`${t} = `}#u(e,t){return`${this.#l(e)}${JSON.stringify(t)}`}#d(e,t){return`${this.#l(e)}${JSON.stringify(t)}`}#f(e,t){if(Number.isNaN(t))return`${this.#l(e)}nan`;switch(t){case 1/0:return`${this.#l(e)}inf`;case-1/0:return`${this.#l(e)}-inf`;default:return`${this.#l(e)}${t}`}}#p(e,t){return`${this.#l(e)}${t}`}#m(e){function t(e,t=2){return e.padStart(t,`0`)}let n=t((e.getUTCMonth()+1).toString()),r=t(e.getUTCDate().toString()),i=t(e.getUTCHours().toString()),a=t(e.getUTCMinutes().toString()),o=t(e.getUTCSeconds().toString()),s=t(e.getUTCMilliseconds().toString(),3);return`${e.getUTCFullYear()}-${n}-${r}T${i}:${a}:${o}.${s}`}#h(e,t){return`${this.#l(e)}${this.#m(t)}`}#g(e={}){let{keyAlignment:t=!1}=e,n=/^(\".*\"|[^=]*)\s=/,r=[];for(let e=0;e<this.output.length;e++){let i=this.output[e];if(i[0]===`[`&&i[1]!==`[`){if(this.output[e+1]===``&&this.output[e+2]?.slice(0,i.length)===i.slice(0,-1)+`.`){e+=1;continue}r.push(i)}else if(t){let e=n.exec(i);e&&e[1]?r.push(i.replace(e[1],e[1].padEnd(this.maxPad))):r.push(i)}else r.push(i)}let i=[];for(let e=0;e<r.length;e++){let t=r[e];(t!==``||r[e+1]!==``)&&i.push(t)}return i}};function Et(e,t){return new Tt(e).dump(t).join(`
|
|
2
|
+
`)}const Dt={arrays:`merge`,sets:`merge`,maps:`merge`};function Ot(e,t,n){return kt(e,t,new Set,n??Dt)}function kt(e,t,n,r){let i={},a=new Set([...Pt(e),...Pt(t)]);for(let o of a){if(o===`__proto__`)continue;let a=e[o];if(!Object.hasOwn(t,o)){i[o]=a;continue}let s=t[o];if(Nt(a)&&Nt(s)&&!n.has(a)&&!n.has(s)){n.add(a),n.add(s),i[o]=At(a,s,n,r);continue}i[o]=s}return i}function At(e,t,n,r){if(jt(e)&&jt(t))return kt(e,t,n,r);if(Mt(e)&&Mt(t)){if(Array.isArray(e)&&Array.isArray(t))return r.arrays===`merge`?e.concat(t):t;if(e instanceof Map&&t instanceof Map){if(r.maps===`merge`){let n=new Map(e);for(let[e,r]of t)n.set(e,r);return n}return t}if(e instanceof Set&&t instanceof Set){if(r.sets===`merge`){let n=new Set(e);for(let e of t)n.add(e);return n}return t}}return t}function jt(e){return Object.getPrototypeOf(e)===Object.prototype}function Mt(e){return typeof e[Symbol.iterator]==`function`}function Nt(e){return typeof e==`object`&&!!e}function Pt(e){let t=Object.keys(e),n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;for(let r of n)Object.prototype.propertyIsEnumerable.call(e,r)&&t.push(r);return t}function Ft(e){return e%4==0&&e%100!=0||e%400==0}var It=class{#e=/[ \t]/;#t=0;#n;constructor(e){this.#n=e}get position(){return this.#t}get source(){return this.#n}char(e=0){return this.#n[this.#t+e]??``}slice(e,t){return this.#n.slice(this.#t+e,this.#t+t)}next(e=1){this.#t+=e}skipWhitespaces(){for(;this.#e.test(this.char())&&!this.eof();)this.next();if(!this.isCurrentCharEOL()&&/\s/.test(this.char())){let e=`\\u`+this.char().charCodeAt(0).toString(16),t=this.#t;throw SyntaxError(`Cannot parse the TOML: It contains invalid whitespace at position '${t}': \`${e}\``)}}nextUntilChar(e={skipComments:!0}){for(;!this.eof();){let t=this.char();if(this.#e.test(t)||this.isCurrentCharEOL())this.next();else if(e.skipComments&&this.char()===`#`)for(;!this.isCurrentCharEOL()&&!this.eof();)this.next();else break}}eof(){return this.#t>=this.#n.length}isCurrentCharEOL(){return this.char()===`
|
|
3
|
+
`||this.startsWith(`\r
|
|
4
|
+
`)}startsWith(e){return this.#n.startsWith(e,this.#t)}match(e){if(!e.sticky)throw Error(`RegExp ${e} does not have a sticky 'y' flag`);return e.lastIndex=this.#t,this.#n.match(e)}};function k(e){return{ok:!0,body:e}}function A(){return{ok:!1}}function Lt(e,t={__proto__:null}){return e.reduceRight((e,t)=>({[t]:e}),t)}function Rt(e){return typeof e==`object`&&!!e}function zt(e,t){let n=t[0];if(!n)throw Error(`Cannot parse the TOML: key length is not a positive number`);return e[n]}function Bt(e,t){let{keys:n,type:r,value:i}=t,a=zt(e,n);if(a===void 0)return Object.assign(e,Lt(n,i));if(Array.isArray(a))return Ht(a.at(-1),{type:r,keys:n.slice(1),value:i}),e;if(Rt(a))return Ht(a,{type:r,keys:n.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function Vt(e,t){let{type:n,keys:r,value:i}=t,a=zt(e,r);if(a===void 0)return Object.assign(e,Lt(r,[i]));if(Array.isArray(a))return t.keys.length===1?a.push(i):Ht(a.at(-1),{type:t.type,keys:t.keys.slice(1),value:t.value}),e;if(Rt(a))return Ht(a,{type:n,keys:r.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function Ht(e,t){switch(t.type){case`Block`:return Ot(e,t.value);case`Table`:return Bt(e,t);case`TableArray`:return Vt(e,t)}}function Ut(e){return t=>{for(let n of e){let e=n(t);if(e.ok)return e}return A()}}function Wt(e,t){let n=Xt(t);return r=>{let i=[],a=e(r);if(!a.ok)return k(i);for(i.push(a.body);!r.eof()&&n(r).ok;){let n=e(r);if(!n.ok)throw SyntaxError(`Invalid token after "${t}"`);i.push(n.body)}return k(i)}}function Gt(e,t){let n=Xt(t);return r=>{let i=e(r);if(!i.ok)return A();let a=[i.body];for(;!r.eof()&&n(r).ok;){let n=e(r);if(!n.ok)throw SyntaxError(`Invalid token after "${t}"`);a.push(n.body)}return k(a)}}function Kt(e,t,n){let r=Xt(t);return i=>{let a=i.position,o=e(i);if(!o.ok)return A();if(!r(i).ok)throw SyntaxError(`key/value pair doesn't have "${t}"`);let s=n(i);if(!s.ok){let e=i.source.indexOf(`
|
|
5
|
+
`,i.position),t=e>0?e:i.source.length,n=i.source.slice(a,t);throw SyntaxError(`Cannot parse value on line '${n}'`)}return k(Lt(o.body,s.body))}}function qt(e){return t=>{let n=e(t);if(!n.ok)return A();let r={__proto__:null};for(let e of n.body)typeof e==`object`&&e&&(r=Ot(r,e));return k(r)}}function Jt(e){return t=>{let n=[];for(;!t.eof();){let r=e(t);if(!r.ok)break;n.push(r.body),t.nextUntilChar()}return n.length===0?A():k(n)}}function Yt(e,t,n){let r=Xt(e),i=Xt(n);return a=>{if(!r(a).ok)return A();let o=t(a);if(!o.ok)throw SyntaxError(`Invalid token after "${e}"`);if(!i(a).ok)throw SyntaxError(`Not closed by "${n}" after started with "${e}"`);return k(o.body)}}function Xt(e){return t=>(t.skipWhitespaces(),t.startsWith(e)?(t.next(e.length),t.skipWhitespaces(),k(void 0)):A())}const Zt=/[A-Za-z0-9_-]+/y;function Qt(e){e.skipWhitespaces();let t=e.match(Zt)?.[0];return t?(e.next(t.length),k(t)):A()}function $t(e){if(e.char()!==`\\`)return A();switch(e.next(),e.char()){case`b`:return e.next(),k(`\b`);case`t`:return e.next(),k(` `);case`n`:return e.next(),k(`
|
|
6
|
+
`);case`f`:return e.next(),k(`\f`);case`r`:return e.next(),k(`\r`);case`u`:case`U`:{let t=e.char()===`u`?4:6,n=parseInt(`0x`+e.slice(1,1+t),16),r=String.fromCodePoint(n);return e.next(t+1),k(r)}case`"`:return e.next(),k(`"`);case`\\`:return e.next(),k(`\\`);default:throw SyntaxError(`Invalid escape sequence: \\${e.char()}`)}}function en(e){if(e.skipWhitespaces(),e.char()!==`"`)return A();e.next();let t=[];for(;e.char()!==`"`&&!e.eof();){if(e.char()===`
|
|
7
|
+
`)throw SyntaxError(`Single-line string cannot contain EOL`);let n=$t(e);n.ok?t.push(n.body):(t.push(e.char()),e.next())}if(e.eof())throw SyntaxError(`Single-line string is not closed:\n${t.join(``)}`);return e.next(),k(t.join(``))}function tn(e){if(e.skipWhitespaces(),e.char()!==`'`)return A();e.next();let t=[];for(;e.char()!==`'`&&!e.eof();){if(e.char()===`
|
|
8
|
+
`)throw SyntaxError(`Single-line string cannot contain EOL`);t.push(e.char()),e.next()}if(e.eof())throw SyntaxError(`Single-line string is not closed:\n${t.join(``)}`);return e.next(),k(t.join(``))}function nn(e){if(e.skipWhitespaces(),!e.startsWith(`"""`))return A();e.next(3),e.char()===`
|
|
9
|
+
`?e.next():e.startsWith(`\r
|
|
10
|
+
`)&&e.next(2);let t=[];for(;!e.startsWith(`"""`)&&!e.eof();){if(e.startsWith(`\\
|
|
11
|
+
`)){e.next(),e.nextUntilChar({skipComments:!1});continue}if(e.startsWith(`\\\r
|
|
12
|
+
`)){e.next(),e.nextUntilChar({skipComments:!1});continue}let n=$t(e);n.ok?t.push(n.body):(t.push(e.char()),e.next())}if(e.eof())throw SyntaxError(`Multi-line string is not closed:\n${t.join(``)}`);return e.char(3)===`"`&&(t.push(`"`),e.next()),e.next(3),k(t.join(``))}function rn(e){if(e.skipWhitespaces(),!e.startsWith(`'''`))return A();e.next(3),e.char()===`
|
|
13
|
+
`?e.next():e.startsWith(`\r
|
|
14
|
+
`)&&e.next(2);let t=[];for(;!e.startsWith(`'''`)&&!e.eof();)t.push(e.char()),e.next();if(e.eof())throw SyntaxError(`Multi-line string is not closed:\n${t.join(``)}`);return e.char(3)===`'`&&(t.push(`'`),e.next()),e.next(3),k(t.join(``))}const an=/(?:true|false)\b/y;function on(e){e.skipWhitespaces();let t=e.match(an);if(!t)return A();let n=t[0];return e.next(n.length),k(n===`true`)}const sn=new Map([[`inf`,1/0],[`+inf`,1/0],[`-inf`,-1/0]]),cn=/[+-]?inf\b/y;function ln(e){e.skipWhitespaces();let t=e.match(cn);if(!t)return A();let n=t[0];return e.next(n.length),k(sn.get(n))}const un=/[+-]?nan\b/y;function dn(e){e.skipWhitespaces();let t=e.match(un);if(!t)return A();let n=t[0];return e.next(n.length),k(NaN)}const fn=Gt(Ut([Qt,en,tn]),`.`),pn=/0b[01]+(?:_[01]+)*\b/y;function mn(e){e.skipWhitespaces();let t=e.match(pn)?.[0];if(!t)return A();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,2);return isNaN(r)?A():k(r)}const hn=/0o[0-7]+(?:_[0-7]+)*\b/y;function gn(e){e.skipWhitespaces();let t=e.match(hn)?.[0];if(!t)return A();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,8);return isNaN(r)?A():k(r)}const _n=/0x[0-9a-f]+(?:_[0-9a-f]+)*\b/iy;function vn(e){e.skipWhitespaces();let t=e.match(_n)?.[0];if(!t)return A();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,16);return isNaN(r)?A():k(r)}const yn=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)\b/y;function bn(e){e.skipWhitespaces();let t=e.match(yn)?.[0];if(!t)return A();e.next(t.length);let n=t.replaceAll(`_`,``);return k(parseInt(n,10))}const xn=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)(?:\.[0-9]+(?:_[0-9]+)*)?(?:e[+-]?[0-9]+(?:_[0-9]+)*)?\b/iy;function Sn(e){e.skipWhitespaces();let t=e.match(xn)?.[0];if(!t)return A();e.next(t.length);let n=t.replaceAll(`_`,``),r=parseFloat(n);return isNaN(r)?A():k(r)}const Cn=/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})(?:[ 0-9TZ.:+-]+)?\b/y;function wn(e){e.skipWhitespaces();let t=e.match(Cn);if(!t)return A();let n=t[0];e.next(n.length);let r=t.groups;if(r.month==`02`){let e=parseInt(r.day);if(e>29)throw SyntaxError(`Invalid date string "${t}"`);let n=parseInt(r.year);if(e>28&&!Ft(n))throw SyntaxError(`Invalid date string "${t}"`)}let i=new Date(n.trim());if(isNaN(i.getTime()))throw SyntaxError(`Invalid date string "${t}"`);return k(i)}const Tn=/(\d{2}):(\d{2}):(\d{2})(?:\.[0-9]+)?\b/y;function En(e){e.skipWhitespaces();let t=e.match(Tn)?.[0];return t?(e.next(t.length),k(t)):A()}function Dn(e){if(e.skipWhitespaces(),e.char()!==`[`)return A();e.next();let t=[];for(;!e.eof();){e.nextUntilChar();let n=kn(e);if(!n.ok||(t.push(n.body),e.skipWhitespaces(),e.char()!==`,`))break;e.next()}if(e.nextUntilChar(),e.char()!==`]`)throw SyntaxError(`Array is not closed`);return e.next(),k(t)}function On(e){if(e.nextUntilChar(),e.char(1)===`}`)return e.next(2),k({__proto__:null});let t=Yt(`{`,Wt(An,`,`),`}`)(e);if(!t.ok)return A();let n={__proto__:null};for(let e of t.body)n=Ot(n,e);return k(n)}const kn=Ut([nn,rn,en,tn,on,ln,dn,wn,En,mn,gn,vn,Sn,bn,Dn,On]),An=Kt(fn,`=`,kn);function jn(e){e.nextUntilChar();let t=qt(Jt(An))(e);return t.ok?k({type:`Block`,value:t.body}):A()}const Mn=Yt(`[`,fn,`]`);function Nn(e){e.nextUntilChar();let t=Mn(e);if(!t.ok)return A();e.nextUntilChar();let n=jn(e);return k({type:`Table`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}const Pn=Yt(`[[`,fn,`]]`);function Fn(e){e.nextUntilChar();let t=Pn(e);if(!t.ok)return A();e.nextUntilChar();let n=jn(e);return k({type:`TableArray`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}function In(e){let t=Jt(Ut([jn,Fn,Nn]))(e);return t.ok?k(t.body.reduce(Ht,{__proto__:null})):k({__proto__:null})}function Ln(e,t){let n=e.source.slice(0,e.position).split(`
|
|
15
|
+
`);return`Parse error on line ${n.length}, column ${n.at(-1)?.length??0}: ${t}`}function Rn(e){return t=>{let n=new It(t);try{let t=e(n);if(t.ok&&n.eof())return t.body;let r=`Unexpected character: "${n.char()}"`;throw SyntaxError(Ln(n,r))}catch(e){throw e instanceof Error?SyntaxError(Ln(n,e.message)):SyntaxError(Ln(n,`Invalid error type caught`))}}}function zn(e){return Rn(In)(e)}const Bn=e=>(t,n)=>t===n||e(t,n),Vn=`~effect/BigDecimal`,Hn={[Vn]:Vn,[se](){let e=Jn(this);return d(_(e.value),Re(e.scale))},[s](e){return Un(e)&&Qn(this,e)},toString(){return`BigDecimal(${$n(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[e](){return this.toJSON()},pipe(){return S(this,arguments)}},Un=e=>a(e,Vn),Wn=(e,t)=>{let n=Object.create(Hn);return n.value=e,n.scale=t,n},Gn=(e,t)=>{if(e!==j&&e%Kn===j)throw RangeError(`Value must be normalized`);let n=Wn(e,t);return n.normalized=n,n},j=BigInt(0),Kn=BigInt(10),qn=Gn(j,0),Jn=e=>{if(e.normalized===void 0){if(e.value===j)e.normalized=qn;else{let t=`${e.value}`,n=0;for(let e=t.length-1;e>=0&&t[e]===`0`;e--)n++;n===0&&(e.normalized=e);let r=BigInt(t.substring(0,t.length-n)),i=e.scale-n;e.normalized=Gn(r,i)}}return e.normalized},Yn=ve(2,(e,t)=>t>e.scale?Wn(e.value*Kn**BigInt(t-e.scale),t):t<e.scale?Wn(e.value/Kn**BigInt(e.scale-t),t):e),Xn=e=>e.value<j?Wn(-e.value,e.scale):e,Zn=Bn((e,t)=>e.scale>t.scale?Yn(t,e.scale).value===e.value:e.scale<t.scale?Yn(e,t.scale).value===t.value:e.value===t.value),Qn=ve(2,(e,t)=>Zn(e,t)),$n=e=>{let t=Jn(e);if(Math.abs(t.scale)>=16)return er(t);let n=t.value<j,r=n?`${t.value}`.substring(1):`${t.value}`,i,a;if(t.scale>=r.length)i=`0`,a=`0`.repeat(t.scale-r.length)+r;else{let e=r.length-t.scale;if(e>r.length){let t=e-r.length;i=`${r}${`0`.repeat(t)}`,a=``}else a=r.slice(e),i=r.slice(0,e)}let o=a===``?i:`${i}.${a}`;return n?`-${o}`:o},er=e=>{if(tr(e))return`0e+0`;let t=Jn(e),n=`${Xn(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${nr(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},tr=e=>e.value===j,nr=e=>e.value<j,rr=`~effect/time/DateTime`,ir=`~effect/time/DateTime/TimeZone`,ar={[rr]:rr,pipe(){return S(this,arguments)},[e](){return this.toString()},toJSON(){return sr(this).toJSON()}};({...ar}),{...ar};const or={[ir]:ir,[e](){return this.toString()}};({...or}),{...or};const sr=e=>new Date(e.epochMilliseconds);function cr(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function lr(e){return t=>cr(t)?.[e]}const ur=`~sentinels`,dr=`~constructor`,fr=lr(`brands`),pr=x(e=>{let t=cr(e)?.identifier;return typeof t==`string`?t:e.getExpected(pr)}),M=Symbol(),N=He,P=N(M),F=N(M),mr=e=>e===M?g():w(e),hr=e=>e._tag===`None`?P:N(e.value),gr=`~effect/SchemaIssue/Issue`;function _r(e){return a(e,gr)&&e[gr]===gr}function vr(e){return Object.hasOwn(e,`input`)}var I=class{[gr]=gr;constructor(e,t){t?.reportInput===!0&&e!==M&&(this.input=e)}},yr=class extends I{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},br=class extends I{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},L=class extends I{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},xr=class extends I{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},Sr=class extends I{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},R=class extends I{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Cr=class extends I{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},z=class extends I{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},wr=class extends I{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},Tr=class extends I{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function Er(e,t,n){if(_r(e))return e;if(typeof e==`string`)return new z({message:e},t,n);let r=typeof e.issue==`string`?new z({message:e.issue},t,n):e.issue;return new L(e.path,r)}function Dr(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new z(void 0,t,n):Er(e,t,n)}function Or(e,t,n,r){return Array.isArray(t)?Le(t)?t.length===1?Er(t[0],n,r):new R(e,he(t,e=>Er(e,n,r)),n,r):void 0:Dr(t,n,r)}const kr=e=>{let t=Rr(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Nr(pr(e.ast),e);case`InvalidValue`:{let t=Mr(e);if(t!==void 0)return Nr(t,e);let n=jr(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=jr(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=jr(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},Ar=e=>Rr(e.issue)??Rr(e);function jr(e){return vr(e)?Se(e.input):void 0}function Mr(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Nr(e,t){let n=jr(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Pr(e){let t=e.annotations?.expected;if(typeof t==`string`)return t;switch(e._tag){case`Filter`:return`<filter>`;case`FilterGroup`:return e.checks.map(e=>Pr(e)).join(` & `)}}function Fr(){return e=>Lr(e,``)}const Ir=Fr();function Lr(e,t){let n;switch(e._tag){case`Filter`:{let r=Ar(e);if(r!==void 0)n=r;else{if(e.issue._tag!==`InvalidValue`)return Lr(e.issue,t);let r=Mr(e.issue);n=r===void 0?Nr(Pr(e.filter),e):Nr(r,e.issue)}break}case`Encoding`:return Lr(e.issue,t);case`Pointer`:return Lr(e.issue,t+xe(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>Lr(e,t)).join(`
|
|
16
|
+
`);n=Rr(e)??Nr(pr(e.ast),e);break;default:n=kr(e)}return t?`${n}\n at ${t}`:n}function Rr(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Rr(e.issue);let t=(e._tag===`Filter`?e.filter.annotations:`annotations`in e?e.annotations:e.ast.annotations)?.[e._tag===`MissingKey`?`messageMissingKey`:e._tag===`UnexpectedKey`?`messageUnexpectedKey`:`message`];if(typeof t==`string`)return t}function zr(e){let t;for(let n of e.reasons){if(!Ve(n)||!_r(n.error))return;t??=n.error}return t}function Br(e,t){let n=zr(e);if(n===void 0)throw Error(t,{cause:e});return n}Ce()(`effect/DateTime/CurrentTimeZone`);var Vr=class e extends me{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe($e(o(t))))}compose(t){return Ur(this)?t:Ur(t)?this:new e((e,n)=>this.run(e,n).pipe(E(e=>t.run(e,n))))}};const Hr=new Vr(T);function Ur(e){return e.run===Hr.run}function Wr(){return Hr}function Gr(e){return new Vr((t,n)=>ee(t)?gt:e(t.value,n))}function B(e){return qr(o(e))}function Kr(e){return Gr((t,n)=>e(t,n).pipe($e(w)))}function qr(e){return new Vr(t=>T(e(t)))}function Jr(e){return new Vr(t=>{let n=h(t,l);return m(n)?T(n):$e(e,w)})}function Yr(){return B(globalThis.String)}function Xr(){return B(globalThis.Number)}const Zr=`~effect/SchemaTransformation/Transformation`;var V=class e{[Zr]=Zr;_tag=`Transformation`;decode;encode;constructor(e,t){this.decode=e,this.encode=t}flip(){return new e(this.encode,this.decode)}compose(t){return new e(this.decode.compose(t.decode),t.encode.compose(this.encode))}};function Qr(e){return a(e,Zr)&&e[Zr]===Zr}const $r=e=>Qr(e)?e:new V(e.decode,e.encode),ei=new V(Wr(),Wr());function ti(){return ei}const ni=new V(Xr(),Yr());function H(e){return t=>t._tag===e}const ri=H(`Declaration`),ii=H(`Never`),U=H(`Literal`),ai=H(`UniqueSymbol`),oi=H(`Arrays`),si=H(`Objects`),ci=H(`Suspend`);var W=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}};const li={};var G=class{isOptional;isMutable;constructorDefault;annotations;constructor(e,t,n=void 0,r=void 0){this.isOptional=e,this.isMutable=t,this.constructorDefault=n,this.annotations=r}};const ui=`~effect/Schema`;var K=class{[ui]=ui;annotations;checks;encoding;context;constructor(e=void 0,t=void 0,n=void 0,r=void 0){this.annotations=e,this.checks=t,this.encoding=n,this.context=r}toString(){return`<${this._tag}>`}},di=class e extends K{_tag=`Declaration`;typeParameters;run;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.typeParameters=e,this.run=t,this.encodingChecks=o}getParser(){let e;return(t,n)=>t===M?P:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r){let i=J(this.typeParameters,t);return i===this.typeParameters&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.run,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){let e=this.annotations?.expected;return typeof e==`string`?e:`<Declaration>`}};const fi=new class extends K{_tag=`Null`;getParser(){return Pa(this,null)}getExpected(){return`null`}};var pi=class extends K{_tag=`Undefined`;getParser(){return Pa(this,void 0)}toCodecJson(){return q(this,[mi])}getExpected(){return`undefined`}};const mi=new W(fi,new V(B(()=>void 0),B(()=>null))),hi=new pi,gi=new class extends K{_tag=`Unknown`;getParser(){return Fa(this,fe)}getExpected(){return`unknown`}};var _i=class extends K{_tag=`Literal`;literal;constructor(e,t,n,r,i){if(super(t,n,r,i),typeof e==`number`&&!globalThis.Number.isFinite(e))throw Error(`A numeric literal must be finite, got ${Se(e)}`);this.literal=e}getParser(){return Pa(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?vi(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:vi(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function vi(e){let t=globalThis.String(e.literal);return q(e,[new W(new _i(t),new V(B(()=>e.literal),B(()=>t)))])}const yi=new class extends K{_tag=`String`;getParser(){return Fa(this,le)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&X(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}};var bi=class extends K{_tag=`Number`;getParser(){return Fa(this,Oe)}matchKey(e,t){return this._match(Ra,e,t)}matchPart(e,t){return this._match(La,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:X(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(xi(this.checks,`effect/schema/isFinite`)||xi(this.checks,`effect/schema/isInt`))?this:q(this,[ia])}toCodecStringTree(){return this.toCodecJson()===this?q(this,[Va]):q(this,[Ha])}getExpected(){return`number`}};function xi(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&xi(e.checks,t))}const Si=new bi,Ci=new class extends K{_tag=`Boolean`;getParser(){return Fa(this,ae)}getExpected(){return`boolean`}};var wi=class e extends K{_tag=`Arrays`;isMutable;elements;rest;encodingChecks;constructor(e,t,n,r,i,a,o,s){super(r,i,a,o),this.isMutable=e,this.elements=t,this.rest=n,this.encodingChecks=s;let c=!1;for(let e=0;e<t.length;e++)if(Y(t[e]))c=!0;else if(c)throw Error(`A required element cannot follow an optional element. ts(1257)`);if(c&&n.length>1)throw Error(`A required element cannot follow an optional element. ts(1257)`);for(let e=1;e<n.length;e++)if(Y(n[e]))throw Error(`An optional element cannot follow a rest element. ts(1266)`)}getParser(e,t=e){let n=this,r,i,a=n.elements.length,o=Math.max(0,n.rest.length-1);function s(e,t){return t<a?r[t]:t>=e?i[t-e+1]:i[0]}return yt(function*(e,c){if(e===M)return M;if(!Array.isArray(e))return yield*O(new Cr(n,e,c));r||(r=n.elements.map(e=>({ast:e,parser:t(e)})),i=n.rest.map(e=>({ast:e,parser:t(e)})));let l=e.length,u={ast:n,getParser:s,input:e,len:l,tailThreshold:Math.max(a,l-o),output:new globalThis.Array(l),issues:void 0,options:c},d=Ei(c?.concurrency),f=Ti(u,e,{concurrency:d?.concurrency,end:n.rest.length===0?a:Math.max(l,a+o)});if(f&&(yield*f),n.rest.length===0&&l>a)for(let t=a;t<=l-1;t++){let r=new Sr(n,e[t],c),i=new L([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*O(new R(n,[i],e,c))}return u.issues?yield*O(new R(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=J(this.elements,t),a=J(this.rest,t);return i===this.elements&&a===this.rest&&n===this.checks&&r===this.encodingChecks?this:new e(this.isMutable,i,a,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}getExpected(){return`array`}};const Ti=oe()({onItem(e,t,n){let r=n<e.len?t:M;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return Di(e,e.ast,r,n);let i=n===F?t:n[v];if(i!==M)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(Y(t.ast))return;let n=new L([r],new xr(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return We(new R(e.ast,[n],e.input,e.options))}}}),Ei=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),Di=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=zr(r.cause);if(i===void 0)return Ke(ze(r.cause,r=>new R(t,[new L([n],r)],e.input,e.options)));let a=new L([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return We(new R(t,[a],e.input,e.options))},Oi=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function ki(e,t,n=li){let r,i;function a(t){switch(t._tag){case`String`:case`TemplateLiteral`:return(r??=Object.keys(e)).filter(e=>t.matchPart(e,n)!==void 0);case`Number`:return(r??=Object.keys(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Symbol`:return(i??=Object.getOwnPropertySymbols(e)).filter(e=>t.matchKey(e,n)!==void 0);case`Union`:return[...new Set(t.types.flatMap(a))];default:return[]}}return a(Ia(Aa(t)))}var Ai=class{name;type;constructor(e,t){this.name=e,this.type=t}};function ji(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(ji);default:return!1}}function Mi(e){return ji(e)&&ji(Aa(e))}var Ni=class{parameter;type;constructor(e,t){if(!Mi(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,Y(t)&&!Na(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},Pi=class e extends K{_tag=`Objects`;propertySignatures;indexSignatures;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.propertySignatures=e,this.indexSignatures=t,this.encodingChecks=o;let s=e.map(e=>e.name).filter((e,t,n)=>n.indexOf(e)!==t);if(s.length>0)throw Error(`Duplicate identifiers: ${JSON.stringify(s)}. ts(2300)`)}getParser(e,t=e){let n=this,r=[];for(let e of n.propertySignatures)r.push(e.name);let a=r.length,o=n.indexSignatures.length,s=a&&o?new Set(r):void 0;if(!a&&!o)return Fa(n,i);let c,l,u=(e,t,r,i,o)=>{if(o._tag===`Failure`)return Di(e,n,t,o)??Ge;let c=o===F?i:o[v];if(r!==M&&c!==M){if(a&&(s.has(t)||s.has(r)))return Ge;te(e.out,r,c)}return Ge},d=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!b(n))return D(dt(n),n=>d(e,t,r,n));i=n}if(i._tag===`Failure`)return Di(e,n,t,i)??Ge;let a=i===F?t:i[v],o=e.input[t],s=r.parserValue(o,e.options);return b(s)?u(e,t,a,o,s):D(dt(s),n=>u(e,t,a,o,n))},f=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return b(i)?u(e,t,t,r,i):D(dt(i),n=>u(e,t,t,r,n))},ee=o?oe()({onItem:(e,[t,n])=>d(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return yt(function*(i,u){if(i===M)return M;if(!(typeof i==`object`&&i&&!Array.isArray(i)))return yield*O(new Cr(n,i,u));c||(c=n.propertySignatures.map(e=>({parser:t(e.type),name:e.name,type:e.type})),l=o?n.indexSignatures.map(n=>({is:n,parserKey:e(Ia(n.parameter)),parserValue:t(n.type)})):void 0);let p=i,m={},h={ast:n,input:p,out:m,issues:void 0,options:u},ne=u.errors===`all`,re=u.onExcessProperty===`error`,g=u.onExcessProperty===`preserve`,_;if(!o&&(re||g)){s??=new Set(r),_=Reflect.ownKeys(p);for(let e=0;e<_.length;e++){let t=_[e];if(!s.has(t)){if(re){let e=new Sr(n,p[t],u),r=new L([t],e);if(ne){h.issues?h.issues.push(r):h.issues=[r];continue}return yield*O(new R(n,[r],i,u))}te(m,t,p[t])}}}let ie=Ei(u?.concurrency);if(a){let e=Fi(h,c,ie);e&&(yield*e)}if(o&&!ie)for(let e=0;e<o;e++){let t=l[e],n=t.is.parameter===yi?f:d,r=t.is.parameter===yi?Object.keys(p):ki(p,t.is.parameter,u);for(let e=0;e<r.length;e++){let i=n(h,r[e],t);if(!b(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(ee){let e=pe();for(let t=0;t<o;t++){let n=l[t],r=ki(p,n.is.parameter,u);for(let t=0;t<r.length;t++)e.push([r[t],n])}let t=ee(h,e,ie);t&&(yield*t)}if(h.issues)return yield*O(new R(n,h.issues,i,u));if(u.propertyOrder===`original`){let e=(_??Reflect.ownKeys(p)).concat(r),t={};for(let n of e)Object.hasOwn(m,n)&&te(t,n,m[n]);return t}return m})}_rebuild(t,n,r,i){let a=J(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new Ai(e.name,n)}),o=J(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Ni(r,i)});return a===this.propertySignatures&&o===this.indexSignatures&&r===this.checks&&i===this.encodingChecks?this:new e(a,o,this.annotations,r,void 0,this.context,i)}flip(e){return this._rebuild(e,e,this.encodingChecks,this.checks)}recur(e,t=e){return this._rebuild(e,t,this.checks,this.encodingChecks)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?`object | array`:`object`}};const Fi=oe()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(M,e.options);let n=e.input[t.name];return te(e.out,t.name,n),t.parser(n,e.options)},step(e,t,n){if(n._tag===`Failure`)return Di(e,e.ast,t.name,n);if(n===F)return;let r=n[v];if(r!==M){te(e.out,t.name,r);return}if(delete e.out[t.name],!Y(t.type)){let n=new L([t.name],new xr(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return We(new R(e.ast,[n],e.input,e.options))}}});function Ii(e,t){return e?t?[...e,...t]:e:t}function Li(e,t,n){return new Pi(Reflect.ownKeys(e).map(t=>new Ai(t,e[t].ast)),[],n,t)}function Ri(e){return e.ast}function zi(e,t,n){return new Ji(e.map(Ri),t,void 0,n)}const Bi=Ae(e=>{for(;;){if(ci(e))return gi;let t=e.encoding;if(!t)return e.recur?.(Bi,C)??e;if(t.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==C))return gi;e=t[t.length-1].to}});function Vi(e){switch(e._tag){case`Null`:return[`null`];case`Undefined`:return[`undefined`];case`String`:case`TemplateLiteral`:return[`string`];case`Number`:return[`number`];case`Boolean`:return[`boolean`];case`Symbol`:case`UniqueSymbol`:return[`symbol`];case`BigInt`:return[`bigint`];case`Arrays`:return[`array`];case`ObjectKeyword`:return[`object`,`array`,`function`];case`Objects`:return e.propertySignatures.length||e.indexSignatures.length?[`object`]:[`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`];case`Enum`:return Array.from(new Set(e.enums.map(([,e])=>typeof e)));case`Literal`:return[typeof e.literal];case`Union`:return Array.from(new Set(e.types.flatMap(Vi)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Hi(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[ur];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!Y(t)){if(U(t))return[{key:e.name,literal:t.literal}];if(ai(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!Y(e)){if(U(e))return[{key:t,literal:e.literal}];if(ai(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Hi(Bi(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Hi(e.thunk())}}const Ui=new WeakMap,Wi=Object.freeze([]);function Gi(e){let t=Ui.get(e);if(t)return t;let n,r=0,i,a,o=!0;for(let t=0;t<e.length;t++){let s=e[t],c=Bi(s);if(ii(c))continue;if(o){if(U(c)||ai(c)){a??=new Map;let e=U(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Hi(c);if(l.length){n??=new Map,r++;for(let{key:e,literal:r}of l){let i=n.get(e);i||n.set(e,i=[new Map,new Set]),i[1].add(t);let a=i[0].get(r);a||i[0].set(r,a=new Set),a.add(t)}}else{i??={};let e=Vi(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Wi;else if(n?.size===1&&!i){let[r,[i]]=n.entries().next().value,a=i;for(let[t,n]of i)a.set(t,Object.freeze(Array.from(n,t=>e[t])));t=(t,n)=>{if(c(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Wi;if(n)return e}return Wi}}else if(n){let a;for(let e of n)(!a||e[1][0].size>a[1][0].size)&&e[1][1].size===r&&(a=e);t=(t,r)=>{let o=i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Wi;if(!c(t))return o.map(t=>e[t]);let s=new Set(o),l;if(a){let[n,[i]]=a,c=Object.hasOwn(t,n),u=c?t[n]:void 0;if(c&&(!r||u!==void 0)){let t=i.get(u);if(!t)return o.map(t=>e[t]);for(let e of t)s.add(e);l=n}}if(l===void 0)for(let[e,[i,a]]of n){let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);if(e)for(let t of e)s.add(t)}else if(r)for(let e of a)s.add(e)}for(let[e,[i,a]]of n){if(e===l)continue;let n=Object.hasOwn(t,e),o=n?t[e]:void 0;if(n&&(!r||o!==void 0)){let e=i.get(o);for(let t of s)a.has(t)&&!e?.has(t)&&s.delete(t)}}return Array.from(s).sort((e,t)=>e-t).map(t=>e[t])}}else t=t=>(i?.[t===null?`null`:Array.isArray(t)?`array`:typeof t]??Wi).map(t=>e[t]).filter(Ki(t));return Ui.set(e,t),t}function Ki(e){return t=>{let n=Bi(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function qi(e,t,n=!1){return Gi(t)(e,n)}var Ji=class e extends K{_tag=`Union`;types;mode;encodingChecks;constructor(e,t,n,r,i,a,o){super(n,r,i,a),this.types=e,this.mode=t,this.encodingChecks=o}getParser(e,t){let n=this;return(r,i)=>{if(r===M)return P;let a=qi(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:b(t)?Yi(n,t.cause,r,i):rt(t,e=>Yi(n,e,r,i))}let o={ast:n,compile:e,input:r,out:void 0,successes:n.mode===`oneOf`?[]:void 0,issues:void 0,options:i},s=Ei(i?.concurrency),c=Xi(o,a,s?{...s,orderedStep:!0}:void 0);return c?E(c,e=>o.out===F?T(r):o.out?o.out:O(new wr(n,o.issues??[],r,i))):o.out?o.out:O(new wr(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=J(this.types,t);return i===this.types&&n===this.checks&&r===this.encodingChecks?this:new e(i,this.mode,this.annotations,n,void 0,this.context,r)}recur(e){return this._rebuild(e,this.checks,this.encodingChecks)}flip(e){return this._rebuild(e,this.encodingChecks,this.checks)}matchPart(e,t){for(let n of this.types){let r=n.matchPart(e,t);if(r!==void 0)return r}}getExpected(e){let t=this.annotations?.expected;if(typeof t==`string`)return t;if(this.types.length===0)return`never`;let n=this.types.map(t=>{let n=Aa(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(U);if(t.length>0)return`${Qi(n.isMutable)}[ ${t.map(t=>e(t)+$i(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>U(e.type));if(t.length>0)return`{ ${t.map(t=>`${Qi(t.type.context?.isMutable)}${p(t.name)}${$i(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function Yi(e,t,n,r){let i=zr(t);return i?We(new wr(e,[i],n,r)):Ke(t)}const Xi=oe()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=zr(n.cause);if(t===void 0)return n;e.issues?e.issues.push(t):e.issues=[t]}else{if(e.out&&e.successes)return e.successes.push(t),We(new Tr(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Ge}}}),Zi=new Ji([new _i(`Infinity`),new _i(`-Infinity`),new _i(`NaN`)],`anyOf`);function Qi(e){return e?``:`readonly `}function $i(e){return e?`?`:``}var ea=class e extends me{_tag=`Filter`;run;annotations;aborted;constructor(e,t=void 0,n=!1){super(),this.run=e,this.annotations=t,this.aborted=n}annotate(t){return new e(this.run,{...this.annotations,...t},this.aborted)}abort(){return new e(this.run,this.annotations,!0)}and(e,t){return new ta([this,e],t)}},ta=class e extends me{_tag=`FilterGroup`;checks;annotations;constructor(e,t=void 0){super(),this.checks=e,this.annotations=t}annotate(t){return new e(this.checks,{...this.annotations,...t})}and(t,n){return new e([this,t],n)}};function na(e,t,n=!1){return new ea((t,n,r)=>Or(n,e(t,n,r),t,r),t,n)}function ra(e){return na(e=>globalThis.Number.isFinite(e),{expected:`a finite number`,representation:{id:`effect/schema/isFinite`,payload:null},toJsonSchema:()=>({type:`number`}),toCode:()=>({runtime:`Schema.isFinite()`}),arbitrary:{constraint:{noInfinity:!0,noNaN:!0}},...e})}const ia=new W(new Ji([fa(Si,[ra()]),Zi],`anyOf`),new V(Xr(),B(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function aa(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return na(e=>(r.lastIndex=0,r.test(e)),{expected:`a string matching the RegExp ${n}`,representation:{id:`effect/schema/isPattern`,payload:{source:n,flags:e.flags}},toJsonSchema:()=>({pattern:n}),arbitrary:{constraint:{patterns:[e.source]}},...t})}function oa(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}const sa=new WeakMap;function ca(e){return sa.get(e)??e}function q(e,t){return e.encoding===t?e:oa(e,e=>{e.encoding.value=t})}function la(e,t){if(e.context===t)return e;let n=ca(e);if(n.context===t)return n;let r=oa(e,e=>{e.context.value=t});return sa.set(r,n),r}function ua(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return da(e,ye(e.checks.slice(0,-1),n.annotate(t)))}return oa(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function da(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:oa(e,e=>{e.checks.value=t})}function fa(e,t){return da(e,Ii(e.checks,t))}function pa(e,t){let n=t(e.to);return n===e.to?e:new W(n,e.transformation)}function ma(e,t){let n=e,r=n[n.length-1],i=pa(r,t);return i===r?e:ye(e.slice(0,e.length-1),i)}function ha(e){return t=>t.encoding?q(t,ma(t.encoding,e)):t}function ga(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:q(r,ma(r.encoding,n))}return e(r)}return Ae(n)}function _a(e,t,n){let r=new W(e,t);return q(n,n.encoding?[...n.encoding,r]:[r])}function va(e,t){let n=fr(e);return ua(e,{brands:n?[...n,t]:[t]})}function J(e,t){let n=!1,r=Array(e.length);for(let i=0;i<e.length;i++){let a=e[i],o=t(a);o!==a&&(n=!0),r[i]=o}return n?r:e}function ya(e,t){return la(e,e.context?new G(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new G(!1,!1,void 0,t))}const ba=Ae(e=>{let t=e.context?e.context.isOptional===!1?new G(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new G(!0,!1);return xa(la(e,t))}),xa=ha(ba),Sa=x(e=>ba(new Ji([e,hi],`anyOf`)));function Ca(e,t){let n=new V(Jr(t),Wr()),r=new W(gi,n);return la(e,e.context?new G(e.context.isOptional,e.context.isMutable,r,e.context.annotations):new G(!1,!1,r))}function wa(e,t,n){return _a(e,n,t)}function Ta(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:ue(e.literal)&&t.push(e.literal);return;case`UniqueSymbol`:t.push(e.symbol);return;case`Never`:return;case`Union`:for(let t=0;t<e.types.length;t++)r(e.types[t]);return;default:n.push(e)}}return r(e),{literals:t,parameters:n}}function Ea(e,t){let{literals:n,parameters:r}=Ta(e);return new Pi(n.map(e=>new Ai(e,t)),r.map(e=>new Ni(e,t)))}function Y(e){return e.context?.isOptional??!1}function Da(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(Da)}function Oa(e){function t(e){return Da(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return Pe(n)?n:void 0}const ka=Ae(e=>{if(e.encoding)return ka(q(e,void 0));let t=e,n=t.recur?.(ka)??t,r=n.encodingChecks;if(r){let t=n===e?r:oi(n)||si(n)||ri(n)&&n.typeParameters.length>0?Oa(r):void 0;return oa(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Ii(n.checks,t)})}return n}),Aa=Ae(e=>ka(Ma(e)));function ja(e,t){let n=t,r=n.length,i=n[r-1],a=[new W(Ma(q(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new W(Ma(n[e-1].to),n[e].transformation.flip()));let o=Ma(i.to);return o.encoding?q(o,[...o.encoding,...a]):q(o,a)}const Ma=x(e=>{if(e.encoding)return ja(e,e.encoding);let t=e;return t.flip?.(Ma)??t.recur?.(Ma)??t});function Na(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(Na);default:return!1}}function Pa(e,t){let n=N(t);return(r,i)=>r===M?P:r===t?n:O(new Cr(e,r,i))}function Fa(e,t){return(n,r)=>n===M?P:t(n)?F:O(new Cr(e,n,r))}const Ia=ga(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(Ia)}}),La=new globalThis.RegExp(`^${Oi}$`),Ra=new globalThis.RegExp(`^(?:${Oi}|Infinity|-Infinity|NaN)$`);function za(e){return aa(La,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:La.source}),...e})}const Ba=fa(yi,[za()]),Va=new W(Ba,ni),Ha=new W(new Ji([Ba,Zi],`anyOf`),ni);function X(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=X(o.checks,t,n,r,i),n&&(i.errors!==`all`||n[n.length-1].filter.aborted))return n}else{let e=o.run(t,r,i);if(e){let r=new yr(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function Ua(e){if(!ri(e))return;let t=e.annotations?.[dr];return ce(t)?t(e.typeParameters):void 0}const Wa=`~effect/collections/MutableHashMap`,Ga={[Wa]:Wa,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${Se(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:ne(Array.from(this))}},[e](){return this.toJSON()},pipe(){return S(this,arguments)}},Ka=()=>{let e=Object.create(Ga);return e.backing=new Map,e.buckets=new Map,e},qa=ve(2,(e,t)=>{if(e.backing.has(t))return w(e.backing.get(t));if(Ya(t))return g();let n=Ja.get(e);if(n!==void 0)return e.backing.has(n)?w(e.backing.get(n)):g();let r=_(t),i=e.buckets.get(r);return i===void 0?g():Xa(e,i,t)}),Ja=new WeakMap,Ya=e=>typeof e!=`object`&&typeof e!=`function`,Xa=(e,t,r)=>{for(let i=0,a=t.length;i<a;i++)if(n(r,t[i])){let n=t[i];return Ja.set(r,n),w(e.backing.get(n))}return g()},Za=ve(3,(e,t,n)=>{if(e.backing.has(t)||Ya(t))return e.backing.set(t,n),e;let r=Ja.get(e);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=_(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=Qa(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),Qa=(e,t)=>{for(let r=0,i=e.length;r<i;r++)if(n(t,e[r]))return Ja.set(t,e[r]),e[r]},$a=`~effect/MutableRef`,eo={[$a]:$a,...ke,toJSON(){return{_id:`MutableRef`,current:ne(this.current)}}},to=e=>{let t=Object.create(eo);return t.current=e,t},no=Symbol.for(`effect/MutableList/Empty`),ro=()=>({head:void 0,tail:void 0,length:0}),io=()=>({array:[],mutable:!0,offset:0,next:void 0}),Z=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=io(),e.tail=e.tail.next):e.head=e.tail=io(),e.tail.array.push(t),e.length++},ao=e=>{e.head=e.tail=void 0,e.length=0},oo=(e,t)=>{if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&e.head?.offset===0&&!e.head.next){let t=e.head.array;return ao(e),t}let n=Array(t),r=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[r++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,r===t)return e.head=i,e.length-=t,e.length===0&&ao(e),n;i=i.next}return ao(e),n},so=e=>{if(!e.head)return no;let t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:ao(e)),t},co={_A:C,_E:C},lo={"~effect/Queue":co,"~effect/Queue/Enqueue":co,"~effect/Queue/Dequeue":co,...ke,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:yo(this)}}},uo=e=>ie(t=>{let n=Object.create(lo);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=ro(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},je(n)}),fo=(e,t)=>Ne(()=>{if(e.state._tag!==`Open`)return bo;if(e.messages.length>=e.capacity)switch(e.strategy){case`dropping`:return bo;case`suspend`:return e.capacity<=0&&e.state.takers.size>0?(Z(e.messages,t),wo(e),xo):Do(e,t);case`sliding`:return so(e.messages),Z(e.messages,t),xo}return Z(e.messages,t),To(e),xo}),po=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(so(e.messages),Z(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(Z(e.messages,t),wo(e),!0):(Z(e.messages,t),To(e),!0):!1,mo=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=Te(t),i=r(n,So);return e.state.offers.size===0&&e.messages.length===0?(Ao(e,i),!0):(e.state={...e.state,_tag:`Closing`,exit:i},!0)},ho=e=>mo(e,we(de())),go=e=>ge(()=>{if(e.state._tag===`Done`)return!0;ao(e.messages);let t=e.state.offers;if(Ao(e,e.state._tag===`Open`?Co:e.state.exit),t.size>0){for(let e of t)e._tag===`Single`?e.resume(bo):e.resume(y(e.remaining.slice(e.offset)));t.clear()}return!0}),_o=e=>vo(e,1,1/0),vo=(e,t,n)=>Ne(()=>Eo(e,t,n)??Ie(ko(e),vo(e,1,n))),yo=e=>e.state._tag===`Done`?0:e.messages.length,bo=y(!1),xo=y(!0),So=De(de()),Co=t(),wo=e=>{if(e.scheduleRunning=!1,e.state._tag!==`Done`&&e.state.takers.size!==0){for(let t of e.state.takers)if(e.state.takers.delete(t),t(re),e.messages.length===0)break}},To=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>wo(e),0))},Eo=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return y([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,Oo(e),e.capacity=0;let t=[so(e.messages)];return Oo(e),y(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=oo(e.messages,n);return Oo(e),y(t)}},Do=(e,t)=>f(n=>{if(e.state._tag!==`Open`)return n(bo);let r={_tag:`Single`,message:t,resume:n};return e.state.offers.add(r),ge(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),Oo=e=>{if(e.state._tag===`Done`)return pt(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(Ao(e,e.state.exit),pt(e.state.exit.cause));let t=e.capacity-e.messages.length;for(let n of e.state.offers)if(t===0)break;else if(n._tag===`Single`)Z(e.messages,n.message),t--,n.resume(xo),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;Z(e.messages,n.remaining[n.offset]),t--}n.resume(y([])),e.state.offers.delete(n)}return!1},ko=e=>f(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),ge(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),Ao=(e,t)=>{if(e.state._tag===`Done`)return;let n=e.state;e.state={_tag:`Done`,exit:t};for(let e of n.takers)e(t);n.takers.clear();for(let e of n.awaiters)e(t);n.awaiters.clear()},jo={"~effect/Channel":{_Env:C,_InErr:C,_InElem:C,_OutErr:C,_OutElem:C},pipe(){return S(this,arguments)}},Mo=e=>{let t=Object.create(jo);return t.transform=(t,n)=>rt(e(t,n),e=>T(ot(e))),t},No=e=>Mo((t,n)=>e),Po=e=>e.transform,Fo=(e,t,n)=>uo({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(et(t=>ft(e,go(t))),et(n=>xt(ht(t(n),e),e))),Io=(e,t)=>Mo((n,r)=>bt(Fo(r,e,t),_o)),Lo=e=>Mo((t,n)=>{let r;return T(Ze(()=>r||e.pipe(ht(n),D(e=>Po(e)(t,n)),D(e=>r=e))))});function Ro(e){let t=Jo(Qo,ka(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function zo(e){let t=Ro(e);return(e,n)=>{let r=Xe(t(e,n));return Ue(r)?w(r.value):(Br(r.cause,`Option adapter can only return none for schema issues`),g())}}function Bo(e){let t=Ro(e);return(e,n)=>{let r=Xe(t(e,n));if(Ue(r))return r.value;let i=Br(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function Vo(e){return Ho(e.ast)}function Ho(e){let t=Yo(qo(ka(e)));return e=>{let n=t(e,li);return Ue(n)?!0:(Br(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}function Uo(e,t){let n=qo(e.ast);return t===void 0?n:(e,r)=>n(e,Go(t,r))}function Wo(e,t){return Xo(Uo(e,t))}const Go=(e,t)=>t?{...e,...t}:e,Ko=e=>e===M?O(new z):T(e);function qo(e){return Jo(Zo,e)}function Jo(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??li);return a===F?T(r):b(a)?a[v]===M?Ko(M):a:E(a,Ko)}}function Yo(e){return(t,n)=>Xe(e(t,n))}function Xo(e){let t=Yo(e);return(e,n)=>{let r=t(e,n);return Ue(r)?w(r.value):(Br(r.cause,`Option adapter can only return none for schema issues`),g())}}const Zo=x(e=>rs(e,Zo)),Qo=x(e=>rs(e,Qo,es)),$o=x(e=>rs(e,Qo,es,e.context?.constructorDefault));function es(e){return e.context?.constructorDefault?$o(e):Qo(e)}function ts(e,t,n,r){let i;if(b(e)&&e._tag===`Success`){let a=mr(e===F?t:e[v]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(N(a),r)}else i=n._tag===`Transformation`?E(e,e=>n.decode.run(mr(e),r)):n.decode($e(e,mr),r);return b(i)&&i._tag===`Success`?hr(i[v]):E(i,hr)}function ns(e,t){let n;return(r,i)=>r===M?P:e.isConstructed(r)?F:ts((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function rs(e,t,n,r){let i=n?Ua(e):void 0,a=i?ns(i,t):e.getParser(t,n),o=e.checks,s=r?e.encoding?[...e.encoding,r]:[r]:e.encoding,c=e.encodingChecks,l=(o?o[o.length-1].annotations:e.annotations)?.parseOptions;if(!s&&!o&&!c)return l?(e,t)=>a(e,Go(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(b(r)){if(r._tag===`Success`){let i=r===F?t:r[v];if(t!==M&&i!==M){let i=X(c,t,void 0,e,n);i&&(r=O(new R(e,i,t,n)))}}}else r=D(r,r=>{if(t!==M&&r!==M){let r=X(c,t,void 0,e,n);if(r)return O(new R(e,r,t,n))}return T(r)})}if(o&&!n.disableChecks){if(b(r)){if(r._tag===`Success`){let i=r===F?t:r[v];if(i===M)return r;let a=X(o,i,void 0,e,n);a&&(r=O(new R(e,a,i,n)))}}else r=D(r,t=>{if(t!==M){let r=X(o,t,void 0,e,n);if(r)return O(new R(e,r,t,n))}return T(t)})}return r};return s?(n,r)=>{l&&(r=Go(r,l));let i=u??=s.map(e=>t(e.to)),a=n,o=i[i.length-1](n,r);for(let e=s.length-1;e>=0;e--)if(o=ts(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[v],o=t(a,r)):o=E(o,e=>{let n=t(e,r);return n===F?N(e):n})}if(o._tag===`Success`){let e=o[v],t=d(e,r);return t===F?o:t}return o=rt(o,t=>st(()=>ze(t,t=>new br(e,t,n,r)))),E(o,e=>{let t=d(e,r);return t===F?N(e):t})}:l?(e,t)=>d(e,Go(t,l)):d}const is=`~effect/Schema/Schema`,as={[is]:is,pipe(){return S(this,arguments)},annotate(e){return this.rebuild(ua(this.ast,e))},annotateKey(e){return this.rebuild(ya(this.ast,e))},check(...e){return this.rebuild(fa(this.ast,e))}};function os(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,as),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>os(e,t),r.makeEffect=Ro(r),r.make=Bo(r),r.makeOption=zo(r),r}const ss=e=>e,cs=is;function ls(e){return t=>t.annotate(e)}const us=`~effect/SchemaError/SchemaError`;var ds=class extends Ee(`SchemaError`){[us]=us;constructor(e){super({issue:e})}get message(){return Ir(this.issue)}toString(){return`SchemaError(${this.message})`}};function fs(e){return a(e,us)&&e[us]===us}const ps=Vo;function ms(e,t){let n=Uo(e,t);return(e,t)=>hs(n(e,t))}function hs(e){return rt(e,e=>st(()=>ze(e,e=>new ds(e))))}const gs=ms;function _s(e,t){let n;for(let r of e.reasons){if(!Ve(r)||!fs(r.error))throw new globalThis.Error(t,{cause:e});n??=r.error}if(n===void 0)throw new globalThis.Error(t,{cause:e});return n}function vs(e){let t=Xe(e);if(Ue(t))return t.value;throw _s(t.cause,`Sync adapter can only throw schema errors`)}const ys=Wo;function bs(e,t){let n=ms(e,t);return(e,t)=>vs(n(e,t))}const xs=bs,Q=os;function Ss(e){return a(e,cs)&&e[cs]===cs}const Cs=ss(e=>{let t=Ls(e);return Q(Sa(e.ast),{schema:t})}),ws=ss(e=>Q(ka(e.ast),{schema:e}));function Ts(e){let t=Q(new _i(e),{literal:e,transform(n){return t.pipe(Bs(Ts(n),{decode:B(()=>n),encode:B(()=>e)}))}});return t}const Es=Q(gi),Ds=Q(fi),Os=Q(hi),ks=Q(yi),As=Q(Ci);function js(e,t){return Q(e,{fields:t,mapFields(e,t){let n=e(this.fields);return js(Li(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function $(e){return js(Li(e,void 0),e)}function Ms(e,t){return Q(Ea(e.ast,t.ast),{key:e,value:t})}const Ns=ss(e=>Q(new wi(!1,[],[e.ast]),{value:e}));function Ps(e,t){return Q(e,{members:t,mapMembers(e,t){let n=e(this.members);return Ps(zi(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function Fs(e,t){return Ps(zi(e,t?.mode??`anyOf`,void 0),e)}function Is(e){let t=e.map(Ts);return Q(zi(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return Fs(e(this.members))},pick(e){return Is(e)},transform(e){return Fs(t.map((t,n)=>t.transform(e[n])))}})}const Ls=ss(e=>Fs([e,Os]));function Rs(...e){return t=>t.check(...e)}function zs(e){return t=>Q(va(t.ast,e),{schema:t,identifier:e})}function Bs(e,t){return n=>Q(wa(n.ast,e.ast,t?$r(t):ti()),{from:n,to:e})}function Vs(e){return t=>Q(Ca(t.ast,e),{schema:t})}function Hs(e){return Ts(e).pipe(Vs(T(e)))}function Us(e,t){return $({_tag:Hs(e),...t})}const Ws=na;function Gs(e,t){return e=Math.max(0,Math.floor(e)),Ws(t=>t.length>=e,{expected:`a value with a length of at least ${e}`,representation:{id:`effect/schema/isMinLength`,payload:{minLength:e}},toJsonSchema:({type:t})=>t===`array`?{minItems:e}:{minLength:e},toCode:()=>({runtime:`Schema.isMinLength(${e})`}),"~structural":!0,arbitrary:{constraint:{minLength:e}},...t})}function Ks(e){return Gs(1,e)}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;const qs=globalThis.Symbol.for(`immer-draftable`),Js={};function Ys(e,t,n,r,i){let a=Qs(n,t,r),o=Zs(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Js?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Js,value:i}})}static[cs]=cs;get[o](){return o}static[qs]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return S(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return zo(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(ua(this.ast,e))}static annotateKey(e){return this.rebuild(ya(this.ast,e))}static check(...e){return this.rebuild(fa(this.ast,e))}static extend(e){return(t,r)=>{let a=$s(t)?t:$(t),o={...n.fields,...a.fields},s=Li(o,n.ast.checks,{identifier:e});return Ys(this,e,js(fa(s,a.ast.checks),o),r,i)}}static mapFields(e,t){return n.mapFields(e,t)}};return i!==void 0&&Object.assign(s.prototype,i(t)),s}function Xs(e){return new V(B(t=>new e(t,{"~payload":{token:Js,value:t}})),Wr())}function Zs(e){return`~effect/Schema/Class/${e}`}function Qs(e,t,n){let r;return i=>{if(r!==void 0)return r;let o=Zs(t),s=e=>e instanceof i||a(e,o),c=Xs(i);return r=Bs(Q(new di([e.ast],()=>(e,t,n)=>s(e)?T(e):O(new Cr(t,e,n)),{identifier:t,[dr]:([e])=>({isConstructed:s,link:new W(e,c)}),toCodec:([e])=>new W(e.ast,c),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>new i(e)),terminal:e.terminal?.map(e=>new i(e))}),toFormatter:([e])=>t=>`${i.identifier}(${e(t)})`,[ur]:Hi(e.ast),...n})),c)(e)}}function $s(e){return Ss(e)}const ec=e=>(t,n)=>{let r=$s(t)?t:$(t);return Ys(_e,e,r,n,e=>({toString(){return`${e}(${Se({...this})})`}}))},tc=e=>(t,n,r)=>{let i=$s(n)?n.mapFields(e=>({_tag:Hs(t),...e}),{unsafePreserveChecks:!0}):Us(t,n);return ec(e??t)(i,r)},nc=`~effect/platform/PlatformError`;var rc=class extends Ee(`BadArgument`){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:``}`}},ic=class extends Me{get message(){return`${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor===void 0?``:` (${this.pathOrDescriptor})`}${this.description?`: ${this.description}`:``}`}},ac=class extends Ee(`PlatformError`){constructor(e){`cause`in e?super({reason:e,cause:e.cause}):super({reason:e})}[nc]=nc;get message(){return this.reason.message}};const oc=e=>new ac(new ic(e)),sc=e=>new ac(new rc(e)),cc={"~effect/Stream":{_R:C,_E:C,_A:C},pipe(){return S(this,arguments)}},lc=e=>{let t=Object.create(cc);return t.channel=e,t},uc=T([void 0]),dc={"~effect/Sink":{_A:C,_In:C,_L:C,_E:C,_R:C},pipe(){return S(this,arguments)}},fc=e=>pc((t,n)=>Po(e)(t,n).pipe(D(it({disableYield:!0})),vt(T))),pc=e=>{let t=Object.create(dc);return t.transform=e,t},mc=e=>Mo((t,n)=>T(D(e.transform(t,n),Be))),hc=e=>gc(St(t=>e(t),{discard:!0})),gc=e=>pc(t=>t.pipe(D(e),it({disableYield:!0}),vt(()=>uc))),_c=e=>fc(Lo(bt(e,mc))),vc=lc,yc=e=>vc(No(e)),bc=e=>e.channel,xc=(e,t)=>vc(Io(e,t)),Sc=e=>vc(Lo(bt(e,bc))),Cc=`~effect/platform/FileSystem`,wc=e=>typeof e==`bigint`?e:BigInt(e),Tc=BigInt(1024);Tc*Tc*Tc*Tc*Tc;const Ec=Ce(`effect/platform/FileSystem`),Dc=e=>Ec.of({...e,[Cc]:Cc,exists:t=>be(e.access(t),_t(!0),mt(`PlatformError`,e=>e.reason._tag===`NotFound`?T(!1):O(e))),readFileString:(t,n)=>D(e.readFile(t),e=>Qe({try:()=>new TextDecoder(n).decode(e),catch:e=>sc({module:`FileSystem`,method:`readFileString`,description:`invalid encoding`,cause:e})})),stream:nt(function*(t,n){let r=yield*e.open(t,{flag:`r`});n?.offset&&(yield*r.seek(n.offset,`start`));let i=n?.bytesToRead===void 0?void 0:wc(n.bytesToRead),a=BigInt(0),o=wc(n?.chunkSize??65536),s=r.readAlloc(o);return yc(T(D(Ze(()=>i!==void 0&&i<=a?Be():i!==void 0&&i-a<o?r.readAlloc(i-a):s),u({onNone:()=>Be(),onSome:e=>(a+=BigInt(e.length),T(Fe(e)))}))))},Sc),sink:(t,n)=>be(e.open(t,{flag:`w`,...n}),bt(e=>hc(t=>e.writeAll(t))),_c),writeFileString:(t,n,r)=>D(Qe({try:()=>new TextEncoder().encode(n),catch:e=>sc({module:`FileSystem`,method:`writeFileString`,description:`could not encode string`,cause:e})}),n=>e.writeFile(t,n,r))}),Oc=`~effect/platform/FileSystem/File`;var kc=class extends Ce()(`effect/platform/FileSystem/WatchBackend`){};const Ac=`~effect/platform/Path`,jc=Ce(`effect/Path`);function Mc(e,t){let n=``,r=0,i=-1,a=0,o;for(let s=0;s<=e.length;++s){if(s<e.length)o=e.charCodeAt(s);else if(o===47)break;else o=47;if(o===47){if(i!==s-1&&a!==1){if(i!==s-1&&a===2){if(n.length<2||r!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){let e=n.lastIndexOf(`/`);if(e!==n.length-1){e===-1?(n=``,r=0):(n=n.slice(0,e),r=n.length-1-n.lastIndexOf(`/`)),i=s,a=0;continue}}else if(n.length===2||n.length===1){n=``,r=0,i=s,a=0;continue}}t&&(n.length>0?n+=`/..`:n=`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,s):n=e.slice(i+1,s),r=s-i-1}i=s,a=0}else o===46&&a!==-1?++a:a=-1}return n}function Nc(e,t){let n=t.dir||t.root,r=t.base||(t.name||``)+(t.ext||``);return n?n===t.root?n+r:n+e+r:r}function Pc(e){if(e.protocol!==`file:`)return O(new rc({module:`Path`,method:`fromFileUrl`,description:`URL must be of scheme file`}));if(e.hostname!==``)return O(new rc({module:`Path`,method:`fromFileUrl`,description:`Invalid file URL host`}));let t=e.pathname;for(let e=0;e<t.length;e++)if(t[e]===`%`){let n=t.codePointAt(e+2)|32;if(t[e+1]===`2`&&n===102)return O(new rc({module:`Path`,method:`fromFileUrl`,description:`must not include encoded / characters`}))}return T(decodeURIComponent(t))}const Fc=function(){let e=``,t=!1,n;for(let r=arguments.length-1;r>=-1&&!t;r--){let i;if(r>=0)i=arguments[r];else{let e=globalThis.process;n===void 0&&`process`in globalThis&&typeof e==`object`&&e&&typeof e.cwd==`function`&&(n=e.cwd()),i=n}i.length!==0&&(e=i+`/`+e,t=i.charCodeAt(0)===47)}return e=Mc(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`};function Ic(e){let t=new URL(`file://`),n=Fc(e);return e.charCodeAt(e.length-1)===47&&n[n.length-1]!==`/`&&(n+=`/`),t.pathname=Hc(n),T(t)}const Lc=/%/g,Rc=/\\/g,zc=/\n/g,Bc=/\r/g,Vc=/\t/g;function Hc(e){return e.includes(`%`)&&(e=e.replace(Lc,`%25`)),e.includes(`\\`)&&(e=e.replace(Rc,`%5C`)),e.includes(`
|
|
17
|
+
`)&&(e=e.replace(zc,`%0A`)),e.includes(`\r`)&&(e=e.replace(Bc,`%0D`)),e.includes(` `)&&(e=e.replace(Vc,`%09`)),e}const Uc=jc.of({[Ac]:Ac,resolve:Fc,normalize(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=Mc(e,!t),e.length===0&&!t&&(e=`.`),e.length>0&&n&&(e+=`/`),t?`/`+e:e},isAbsolute(e){return e.length>0&&e.charCodeAt(0)===47},join(){if(arguments.length===0)return`.`;let e;for(let t=0;t<arguments.length;++t){let n=arguments[t];n.length>0&&(e===void 0?e=n:e+=`/`+n)}return e===void 0?`.`:Uc.normalize(e)},relative(e,t){if(e===t||(e=Uc.resolve(e),t=Uc.resolve(t),e===t))return``;let n=1;for(;n<e.length&&e.charCodeAt(n)===47;++n);let r=e.length,i=r-n,a=1;for(;a<t.length&&t.charCodeAt(a)===47;++a);let o=t.length-a,s=i<o?i:o,c=-1,l=0;for(;l<=s;++l){if(l===s){if(o>s){if(t.charCodeAt(a+l)===47)return t.slice(a+l+1);if(l===0)return t.slice(a+l)}else i>s&&(e.charCodeAt(n+l)===47?c=l:l===0&&(c=0));break}let r=e.charCodeAt(n+l);if(r!==t.charCodeAt(a+l))break;r===47&&(c=l)}let u=``;for(l=n+c+1;l<=r;++l)(l===r||e.charCodeAt(l)===47)&&(u.length===0?u+=`..`:u+=`/..`);return u.length>0?u+t.slice(a+c):(a+=c,t.charCodeAt(a)===47&&++a,t.slice(a))},dirname(e){if(e.length===0)return`.`;let t=e.charCodeAt(0),n=t===47,r=-1,i=!0;for(let n=e.length-1;n>=1;--n)if(t=e.charCodeAt(n),t===47){if(!i){r=n;break}}else i=!1;return r===-1?n?`/`:`.`:n&&r===1?`//`:e.slice(0,r)},basename(e,t){let n=0,r=-1,i=!0,a;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return``;let o=t.length-1,s=-1;for(a=e.length-1;a>=0;--a){let c=e.charCodeAt(a);if(c===47){if(!i){n=a+1;break}}else s===-1&&(i=!1,s=a+1),o>=0&&(c===t.charCodeAt(o)?--o===-1&&(r=a):(o=-1,r=s))}return n===r?r=s:r===-1&&(r=e.length),e.slice(n,r)}for(a=e.length-1;a>=0;--a)if(e.charCodeAt(a)===47){if(!i){n=a+1;break}}else r===-1&&(i=!1,r=a+1);return r===-1?``:e.slice(n,r)},extname(e){let t=-1,n=0,r=-1,i=!0,a=0;for(let o=e.length-1;o>=0;--o){let s=e.charCodeAt(o);if(s===47){if(!i){n=o+1;break}continue}r===-1&&(i=!1,r=o+1),s===46?t===-1?t=o:a!==1&&(a=1):t!==-1&&(a=-1)}return t===-1||r===-1||a===0||a===1&&t===r-1&&t===n+1?``:e.slice(t,r)},format:function(e){if(typeof e!=`object`||!e)throw TypeError(`The "pathObject" argument must be of type Object. Received type `+typeof e);return Nc(`/`,e)},parse(e){let t={root:``,dir:``,base:``,ext:``,name:``};if(e.length===0)return t;let n=e.charCodeAt(0),r=n===47,i;r?(t.root=`/`,i=1):i=0;let a=-1,o=0,s=-1,c=!0,l=e.length-1,u=0;for(;l>=i;--l){if(n=e.charCodeAt(l),n===47){if(!c){o=l+1;break}continue}s===-1&&(c=!1,s=l+1),n===46?a===-1?a=l:u!==1&&(u=1):a!==-1&&(u=-1)}return a===-1||s===-1||u===0||u===1&&a===s-1&&a===o+1?s!==-1&&(t.base=t.name=o===0&&r?e.slice(1,s):e.slice(o,s)):(o===0&&r?(t.name=e.slice(1,a),t.base=e.slice(1,s)):(t.name=e.slice(o,a),t.base=e.slice(o,s)),t.ext=e.slice(a,s)),o>0?t.dir=e.slice(0,o-1):r&&(t.dir=`/`),t},sep:`/`,fromFileUrl:Pc,toFileUrl:Ic,toNamespacedPath:C}),Wc=at(jc)(Uc),Gc={"~effect/Ref":{_A:C},...ke,toJSON(){return{_id:`Ref`,ref:this.ref}}},Kc=e=>{let t=Object.create(Gc);return t.ref=to(e),t},qc=e=>tt(()=>Kc(e)),Jc=e=>tt(()=>e.ref.current),Yc=ve(2,(e,t)=>tt(()=>{e.ref.current=t(e.ref.current)})),Xc=Ms(ks.pipe(Rs(Ws(e=>e!==`__proto__`))),Ns(ks)).pipe(zs(`TomlConfig`)),Zc=e=>new z({message:e instanceof Error?`TOML parse error: ${e.message}`:`TOML parse error`});ks.pipe(Bs(ws(Xc),{decode:Kr(e=>Qe({try:()=>zn(e),catch:Zc}).pipe(D(e=>ms(Xc)(e)),Ye(e=>fs(e)?e.issue:e))),encode:B(e=>Et(e))}));const Qc=`systemfsoftware.toml`,$c=xs(Xc)({});var el=class extends Ce()(`@systemfsoftware/omp-utils/TomlLoader`){};const tl=e=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]=r;return t},nl=e=>Qe({try:()=>zn(e),catch:e=>new z({message:e instanceof Error?`TOML parse error: ${e.message}`:`TOML parse error`})}).pipe(D(e=>ms(Xc)(e))),rl=(e,t,n)=>e.exists(n).pipe(D(t=>t?e.readFileString(n).pipe(D(nl),qe(()=>$c)):T($c))),il=lt(el,D(tt(()=>{let e=process.env.OMP_USER_CONFIG_HOME;return typeof e==`string`&&e.length>0?e:Ct.homedir()}),e=>Je(function*(){let t=yield*qc(Ka()),n=yield*Ec,r=yield*jc,i=r.join(e,`.config/systemfsoftware`,Qc);return el.of({load:ct(`TomlLoader.load`)(function*(e){let a=yield*Jc(t),o=qa(a,e);if(m(o))return o.value;let s=r.join(e,Qc),c=r.join(e,`systemfsoftware.local.toml`),l=yield*rl(n,r,i),u=yield*rl(n,r,s),d=yield*rl(n,r,c),f=yield*gs(Xc)(tl([l,u,d])).pipe(ut);return yield*Yc(t,t=>(Za(t,e,f),t)),f})})}))),al=Ns($({old_text:Cs(Es),new_text:Cs(Es)}).pipe(Rs(Ws(e=>`old_text`in e||`new_text`in e)))).pipe(Rs(Ks())),ol=Ns($({old_string:Cs(Es),new_string:Cs(Es)}).pipe(Rs(Ws(e=>`old_string`in e||`new_string`in e))));ps(al),ps(ol),ys(Ms(ks,Es));export{ho as C,po as E,ls as S,fo as T,Ms as _,Oc as a,tc as b,Dc as c,sc as d,oc as f,Ds as g,Is as h,Ec as i,xc as l,As as m,il as n,wc as o,Ns as p,Wc as r,kc as s,el as t,Sc as u,ks as v,mo as w,Fs as x,$ as y};
|