@systemfsoftware/omp-agent-discipline 1.5.1 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,42 @@
1
+ # @systemfsoftware/omp-agent-discipline
2
+
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - Collapse projection tags into the ports they projected
8
+
9
+ A `*ExecutorDeps` tag whose service type was indexed off other ports recorded which members
10
+ one operation happened to reach for. Exporting it turned internal composition into a surface
11
+ commitment: a consumer had to discover and provide an aggregator for each operation, where the
12
+ port it came from already served. The tags rode the `R` channel of exported signatures, so a
13
+ consumer met them only at their own call site.
14
+
15
+ Each was removed the way its evidence directed — no tag was renamed, and none was replaced:
16
+
17
+ - `AttwCliExecutorDeps`, `CheckPackageExecutorDeps` — deleted. Zero consumers, no Live layer;
18
+ callers already required the real capabilities directly.
19
+ - `HookDispatcherExecutorDeps` — was a 1:1 alias of `Scope.Scope`. Requiring `Scope` names the
20
+ same service.
21
+ - `InjectInstructionsExecutorDeps` — packed `FileSystem`, `Path` and `TomlLoader` with no logic.
22
+ Consumers require the three ports.
23
+ - `EffectVitestDeps` → `EffectVitestBindings`. Never a `Context.Tag`: a plain type alias already
24
+ passed as an ordinary parameter, so only the name misdescribed it. A stale api report that no
25
+ `api-extractor` regenerates was deleted with it.
26
+
27
+ A consumer providing a port instead of an aggregator provides no more than before, since a
28
+ service `{ a, b }` is assignable to a requirement `{ a }`.
29
+
30
+ ### Minor Changes
31
+
32
+ - cut over to effect v4 (4.0.0-rc.108): public surface derives from effect types; peers flip effect ^3→^4
33
+
34
+ ### Patch Changes
35
+
36
+ - New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
37
+
38
+ - Each of these packages now has a README, so its registry page says what the package is, how
39
+ to install it, and what to import or register — previously the page was blank. The lint
40
+ plugins show the configuration line that enables what they recommend.
41
+
42
+ `@systemfsoftware/stryker-js-mutation-report` also carries its licence text
package/LICENSE CHANGED
@@ -1,21 +1,203 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Ryan Lee
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Copyright (c) 2026 Ryan Lee (systemfsoftware)
2
+
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright 2026 Ryan Lee (systemfsoftware)
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,23 @@
1
+ # @systemfsoftware/omp-agent-discipline
2
+
3
+ OMP agent discipline: mechanical enforcement of rules prose can't hold (xd:// retry guard, ...)
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm add @systemfsoftware/omp-agent-discipline '@effect/platform-node@catalog:' '@oh-my-pi/pi-coding-agent@catalog:' 'effect@4.0.0-rc.108'
9
+ ```
10
+
11
+ Those are peer dependencies: this package declares them but does not install them, so one copy is shared with the rest of your project.
12
+
13
+ ## Entry points
14
+
15
+ - `@systemfsoftware/omp-agent-discipline`
16
+
17
+ ## API
18
+
19
+ The public surface is generated from the source and versioned with the package: [`etc/omp-agent-discipline.api.md`](./etc/omp-agent-discipline.api.md).
20
+
21
+ ## License
22
+
23
+ Apache-2.0. Part of [systemfsoftware](https://github.com/systemfsoftware/systemfsoftware).
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$ as ee,$t as t,Dn as te,En as ne,Ga as re,In as ie,J as ae,K as oe,Ka as se,Nn as ce,Or as n,Pn as r,Q as i,Qa as a,Qt as o,Rn as s,Tn as c,Ua as l,Wa as u,Wn as d,X as f,Xa as p,Y as m,Z as h,Za as g,Zt as _,a as v,ao as y,bo as b,c as x,co as S,d as C,en as w,et as T,f as E,ga as D,go as O,ho as k,in as A,io as j,l as M,mo as N,n as P,o as F,oo as I,po as L,q as R,qa as z,ro as B,s as V,so as H,t as U,tn as W,u as G,wn as le,xo as ue,yo as de,zn as fe}from"./effect-BoxserXC.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:()=>De,die:()=>xe,done:()=>Q,empty:()=>be,fail:()=>J,filterInterruptors:()=>Re,findDefect:()=>Pe,findDie:()=>Ne,findError:()=>X,findErrorOption:()=>je,findFail:()=>Ae,findInterrupt:()=>Ie,fromReasons:()=>ye,hasDies:()=>Me,hasFails:()=>ke,hasInterrupts:()=>Fe,hasInterruptsOnly:()=>Ee,interrupt:()=>Se,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:()=>we,makeFailReason:()=>Ce,makeInterruptReason:()=>Te,map:()=>Y,pretty:()=>Be,prettyErrors:()=>ze,reasonAnnotations:()=>st,squash:()=>Oe});const K=u,me=l,he=L,ge=N,q=de,_e=k,ve=b,ye=H,be=y,J=I,xe=j,Se=m,Ce=e=>new p(e),we=e=>new re(e),Te=d,Ee=te,Y=h,De=R,Oe=T,ke=c,Ae=W,X=t,je=w,Me=le,Ne=o,Pe=_,Fe=ne,Ie=A,Le=f,Re=ae,ze=ee,Be=i,Ve=ue,He=a,Ue=g,Z=O,We=z,Ge=se,Q=S,Ke=G,qe=s,Je=M,Ye=x,Xe=ie,$=V,Ze=r,Qe=F,$e=v,et=P,tt=ce,nt=U,rt=E,it=fe,at=C,ot=B,st=n,ct=oe;var lt=class extends D()(`effect/Cause/StackTrace`){},ut=class extends D()(`effect/Cause/InterruptorStackTrace`){};export{X as a,Y as c,J as i,$ as n,Z as o,Q as r,q as s,pe as t};
@@ -0,0 +1,11 @@
1
+ import{ua as e}from"./effect-BoxserXC.js";import{b as t,m as n,t as r,v as i,x as a}from"./dist-Cl6FTVNh.js";import{C as o,M as s}from"./Effect-CZxGnFfU.js";import{a as c,i as l,r as u,t as d}from"./Match-BM1Os2Yz.js";const f={task:!0,agent:!0},p=e=>f[e.trim().toLowerCase()]===!0,m=e=>{let t=e.slice(8);if(t.length===0)return null;let n=t.search(/[:/]/);return n===-1?t:t.slice(0,n)},h=e=>e.split(`\\`).join(`/`),g=(e,t)=>{let n=`/skills/`+t+`/SKILL.md`;return e.endsWith(n)},_=(e,t)=>{if(e.startsWith(`skill://`)){let n=m(e);return n!==null&&t.includes(n)}let n=h(e);for(let e of t)if(g(n,e))return!0;return!1},v={hasObjective:/\bobjective\b/i,hasWriteScope:/\bwrite_scope\b/i,hasVerifyCommands:/\bverify_commands\b/i},y=e=>({hasObjective:v.hasObjective.test(e),hasWriteScope:v.hasWriteScope.test(e),hasVerifyCommands:v.hasVerifyCommands.test(e)}),b=Symbol.for(`@systemfsoftware/omp-agent-discipline/CheckDispatchCommand`);var x=class extends t()(`CheckDispatchCommand`,{toolName:i,doctrineLoaded:n,gateEnabled:n}){[b]=b};const S=Symbol.for(`@systemfsoftware/omp-agent-discipline/DispatchDoctrineVerdict`);var C=class extends t()(`Allow`,{}){[S]=S},w=class extends t()(`DeliverDoctrine`,{reason:i}){[S]=S};a([C,w]);const T=e=>e.gateEnabled&&p(e.toolName)&&!e.doctrineLoaded,E=e=>l(T(e)).pipe(c(!0,()=>new w({reason:`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.`})),c(!1,()=>new C),d),D=e=>l(e).pipe(u(`DeliverDoctrine`,e=>({block:!0,reason:e.reason})),u(`Allow`,()=>void 0),d),O=e=>o(function*(){return(yield*(yield*r).load(e)).dispatch_doctrine_skills??[]});function k(e,t,n){return o(function*(){let r=yield*O(e),i=new x({toolName:t,doctrineLoaded:n,gateEnabled:r.length>0});return{skills:r,gate:D(E(i))}})}const A={extractSpecShape:y,matchesDoctrineSkillPath:_},j=new Map,M=new Map,N=new Map,P=new Map,F=e=>{let t=e.sessionManager.getSessionId();return typeof t==`string`?t:``},I=e=>typeof e==`object`&&!!e&&!Array.isArray(e),L=e=>I(e)?e:{},R=(e,...t)=>{for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}return``},z=(e,t)=>{if(e!==``){if(j.has(e)){j.set(e,!0);return}if(j.size<50){j.set(e,!0);return}for(let n of j.keys())if(n!==t){j.delete(n),j.set(e,!0);return}j.set(e,!0)}},B=(e,t)=>{if(M.size>=200){let e=M.keys().next().value;typeof e==`string`&&M.delete(e)}M.set(e,t)},V=(e,t)=>{let n=e(k(t,`read`,!1)).then(({skills:e})=>{N.set(t,e)}).catch(()=>{N.set(t,[])}).finally(()=>{P.get(t)===n&&P.delete(t)});return P.set(t,n),n},H=(e,t,n)=>{if(e!==void 0)try{let r=e.info;typeof r==`function`&&r.call(e,t,n)}catch{}},U=e=>e===null?1:e.length,W=e=>{let t=R(e,`task`,`description`,`prompt`),n=e.tasks;if(!Array.isArray(n))return t;let r=n.map(e=>typeof e==`string`?e:R(L(e),`task`,`description`,`prompt`)).filter(e=>e.length>0).join(`
10
+ `);return t.length===0?r:t+`
11
+ `+r},G=e=>{let t=e.tasks;return Array.isArray(t)?t:null},K=(t,n)=>{t.on(`tool_call`,async(r,i)=>{let a=F(i),o=L(r.input),c=a===``?!1:j.get(a)??!1,l=await n(s(k(i.cwd,r.toolName,c)));if(e(l))throw l.failure;let{skills:u,gate:d}=l.success;N.set(i.cwd,u);let f=U(G(o)),p=A.extractSpecShape(W(o));if(d!==void 0)return z(a,a),H(t.logger,`agent_discipline.dispatch.blocked`,{plugin:`agent_discipline`,session_id:a,tool:r.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};H(t.logger,`agent_discipline.dispatch.observed`,{plugin:`agent_discipline`,session_id:a,tool:r.toolName,batch_size:f,has_objective:p.hasObjective,has_write_scope:p.hasWriteScope,has_verify_commands:p.hasVerifyCommands})}),t.on(`tool_execution_start`,(e,t)=>{if(e.toolName!==`read`)return;let r=e.toolCallId;if(typeof r!=`string`||r.length===0)return;let i=L(e.args).path;typeof i==`string`&&(B(r,i),N.has(t.cwd)||V(n,t.cwd))}),t.on(`tool_execution_end`,async(e,n)=>{if(e.toolName!==`read`)return;let r=e.toolCallId;if(typeof r!=`string`||r.length===0)return;let i=M.get(r);if(M.delete(r),i===void 0||e.isError)return;let a=P.get(n.cwd);a!==void 0&&await a;let o=N.get(n.cwd);if(o===void 0||!A.matchesDoctrineSkillPath(i,o))return;let s=F(n);s!==``&&(z(s,s),H(t.logger,`agent_discipline.doctrine.loaded`,{plugin:`agent_discipline`,session_id:s,tool:e.toolName}))}),t.on(`session_start`,(e,t)=>{V(n,t.cwd)})};export{K as DispatchDoctrineExtension};
@@ -0,0 +1 @@
1
+ import{t as e}from"./rolldown-runtime-DK3Fl9T5.js";import{$i 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 l,Bi as ee,Bo as te,Br as ne,Bt as re,C as u,Ci as ie,Cn as ae,Cr as oe,D as se,Di as ce,Dr as le,E as ue,Ei as de,Er as fe,F as pe,Fi as d,Fn as me,Fr as he,G as f,Gi as ge,Gn as _e,Gr as ve,Gt as ye,H as be,Hi as xe,Hn as Se,Hr as Ce,Ht as we,I as Te,Ii as Ee,Ir as De,It as p,Ja as Oe,Ji as ke,Jn as Ae,Jr as je,Jt as Me,Ki as Ne,Kn as Pe,Kr as Fe,Kt as Ie,L as Le,Li as m,Ln as Re,Lr as ze,Lt as h,M as g,Mi as Be,Mn as Ve,Mr as He,N as Ue,Na as We,Ni as Ge,Nr as Ke,O as qe,Oi as Je,On as Ye,P as Xe,Pa as Ze,Pi as Qe,Pr as $e,Qi as et,Qn as tt,Qo as _,Qr as nt,R as rt,Ri as it,Rr as at,Rt as ot,S as st,Sa as ct,Si as lt,Sn as ut,So as dt,Sr as v,T as ft,Ti as pt,To as y,Tr as mt,U as ht,Ui as gt,Un as b,Ur as _t,V as vt,Vi as yt,Vn as bt,Vr as xt,W as St,Wi as Ct,Wr as wt,Wt as Tt,Xi as Et,Xn as Dt,Xo as Ot,Xr as kt,Xt as At,Yi as jt,Yn as Mt,Yr as Nt,Yt as Pt,Zi as Ft,Zn as It,Zo as x,Zr as Lt,_ as Rt,_a as zt,_i as Bt,_n as Vt,_o as S,_r as Ht,ai as Ut,an as Wt,ar as Gt,at as Kt,b as qt,ba as Jt,bi as Yt,bn as Xt,br as C,ci as Zt,cn as Qt,cr as $t,ct as en,di as tn,dn as nn,dr as rn,dt as an,ea as on,ei as sn,eo as cn,er as ln,fi as un,fn as dn,fr as fn,ft as pn,g as mn,ga as hn,gi as gn,gn as _n,go as vn,gr as yn,h as bn,ha as xn,hi as Sn,hn as Cn,hr as wn,i as Tn,ii as En,ir as Dn,is as On,it as kn,j as An,ji as w,jn,jr as Mn,k as Nn,ki as Pn,kn as Fn,kr as In,la as Ln,li as T,ln as Rn,lo as zn,lr as Bn,m as Vn,ma as Hn,mi as Un,mn as Wn,mr as Gn,na as Kn,ni as qn,nn as Jn,nr as Yn,nt as Xn,oi as E,on as D,or as Zn,ot as Qn,p as $n,pi as er,pn as tr,pr as nr,qi as rr,qn as O,qr as ir,qt as ar,r as or,ri as sr,rn as cr,rr as lr,rt as ur,si as dr,sn as fr,sr as pr,st as mr,ta as hr,ti as gr,tr as _r,tt as k,ua as vr,ui as A,un as yr,ur as j,ut as br,v as xr,va as Sr,vi as Cr,vn as wr,vr as Tr,w as Er,wi as Dr,wo as Or,wr as kr,x as Ar,xa as M,xi as jr,xn as N,xr as Mr,y as Nr,ya as Pr,yi as Fr,yn as Ir,yr as Lr,z as Rr,zi as zr,zr as Br,zt as Vr}from"./effect-BoxserXC.js";import{a as Hr,o as Ur,r as Wr}from"./Cause-Daq_jwhV.js";import{i as Gr}from"./Exit-CMCdU7HJ.js";const Kr={"~effect/Deferred":{_A:r,_E:r},pipe(){return On(this,arguments)}},qr=()=>{let e=Object.create(Kr);return e.resumes=void 0,e.effect=void 0,e},Jr=e=>g(t=>e.effect?t(e.effect):(e.resumes??=[],e.resumes.push(t),A(()=>{let n=e.resumes;if(n===void 0)return;let r=n.indexOf(t);r>=0&&n.splice(r,1)}))),Yr=_(2,(e,t)=>A(()=>Xr(e,t))),Xr=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){for(let n=0;n<e.resumes.length;n++)e.resumes[n](t);e.resumes=void 0}return!0},Zr=jt,Qr=Et,$r=Lt,ei=Mr,ti=ir,P=kt,ni=Nt,ri=`~effect/Layer/MemoMap`,ii=(e,t)=>(e.observers++,Nr(je(t,t=>e.finalizer(t)),e.effect)),ai={"~effect/Layer":{_ROut:r,_E:r,_RIn:r},pipe(){return On(this,arguments)}},oi=e=>{let t=Object.create(ai);return t.build=e,t},si=e=>oi((t,n)=>{let r=P(n);return j(e(t,r),e=>e._tag===`Failure`?ni(r,e):d)}),ci=e=>{let t=si((n,r)=>n.getOrElseMemoize(t,r,e));return t},li=(e,t,n,r)=>{let i=$r(),a=qr(),o={observers:1,effect:Jr(a),finalizer:n=>T(()=>(o.observers--,o.observers===0?(e.map.delete(t),ni(i,n)):d))};return e.map.set(t,o),je(n,o.finalizer).pipe(D(()=>r(e,i)),j(e=>(o.effect=e,Yr(a,e))))};var ui=class{get[ri](){return ri}parent;constructor(e){this.parent=e}map=new Map;get(e,t){let n=this.map.get(e);return n?ii(n,t):this.parent?.get(e,t)}getOrElseMemoize(e,t,n){return T(()=>this.get(e,t)||li(this,e,t,n))}};const di=()=>new ui,fi=e=>new ui(e);var F=class e extends hn()(`effect/Layer/CurrentMemoMap`){static forkOrCreate(t){let n=Pr(t,e);return n?fi(n):di()}};const I=_(3,(e,t,n)=>v(O(e.build(t,n),zt(F,t)),F,t)),pi=_(2,(e,t)=>dt(n=>I(e,F.forkOrCreate(n.context),t))),mi=function(){return arguments.length===1?e=>hi(M(arguments[0],e)):hi(M(arguments[0],arguments[1]))},hi=e=>oi(x(E(e))),gi=function(){return arguments.length===1?e=>_i(arguments[0],e):_i(arguments[0],arguments[1])},_i=(e,t)=>vi(O(t,t=>M(e,t))),vi=e=>ci((t,n)=>ei(e,n)),yi=(e,t,n)=>{let r=P(n,`parallel`);return tr(e,e=>e.build(t,P(r,`sequential`)),{concurrency:e.length}).pipe(O(e=>ct(...e)))},bi=(...e)=>si((t,n)=>yi(e,t,n)),xi=(e,t,n)=>si((r,i)=>D(Array.isArray(t)?yi(t,r,i):t.build(r,i),t=>e.build(r,i).pipe(C(t),O(e=>n(e,t))))),Si=_(2,(e,t)=>xi(e,t,r)),Ci=xn(`effect/ExecutionPlan/CurrentMetadata`,{defaultValue:x({attempt:0,stepIndex:0})}),wi=_(2,(e,t)=>Xe(e,Oi,e=>t(e))),Ti=e=>e.reasons.some(Ei),Ei=e=>e._tag===`Fail`&&Ur(e.error),Di=et(Hr,e=>Ur(e)?Hn(e):Ln(e)),Oi=et(Hr,e=>Ur(e)?Hn(e.value):Ln(e)),ki=_(2,(e,t)=>Yn(e,{onSuccess:t.onSuccess,onFailure:e=>{let n=Di(e);return vr(n)?t.onFailure(n.failure):t.onDone(n.success.value)}})),Ai=`~effect/Schedule`,L=xn(`effect/Schedule/CurrentMetadata`,{defaultValue:x({input:void 0,output:void 0,duration:Kn,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),ji={[Ai]:{_Out:r,_In:r,_Env:r},pipe(){return On(this,arguments)}},Mi=e=>te(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(O(e,e=>{let t=z();return(n,r)=>e(t(n,r))})),B=e=>Ue(e.step,e=>E(()=>h(e))),V=e=>k(t=>O(B(e),e=>{let n=z();return r=>T(()=>{let i=t.currentTimeMillisUnsafe();return D(e(i,r),([e,t])=>{let a=n(i,r);return a.output=e,a.duration=t,u(sr(t),a)})})})),Pi=e=>R(O(B(e),e=>(t,n)=>ki(e(t,n),{onSuccess:e=>E([n,e[1]]),onFailure:h,onDone:()=>Wr(n)}))),Fi=e=>H(Li,({attempt:t})=>E(t<=e)),Ii=e=>{let n=t(e);return Ni(E(e=>E([e.attempt-1,n])))},H=_(2,(e,t)=>R(O(B(e),e=>{let n=z();return(r,i)=>D(e(r,i),e=>{let[a,o]=e,s=t({...n(r,i),output:a,duration:o});return D(S(s)?s:E(s),t=>t?E(e):Wr(a))})}))),Li=Ii(Kn),Ri=(e,t,n)=>i(r=>D(n?.local?I(t,di(),r):pi(t,r),t=>C(e,t))),zi=_(e=>S(e[0]),(e,t,n)=>Jt(t)?C(e,t):Ri(e,Array.isArray(t)?bi(...t):t,n)),Bi=_(3,(e,t,n)=>D(V(t),t=>{let r=L.defaultValue();return f(Wn(tn(D(T(()=>v(e,L,r)),t),e=>A(()=>{r=e})),{disableYield:!0}),e=>vn(e)?E(e.value):n(e,r.attempt===0?We():Ze(r)))})),Vi=_(3,(e,t,n)=>D(V(t),t=>{let r=L.defaultValue(),i,a=f(T(()=>v(e,L,r)),e=>(i=e,D(t(e),e=>(r=e,a))));return wi(a,e=>y(()=>n(i,e)))})),Hi=_(2,(e,t)=>{let n=typeof t==`function`?t(r):Mi(t)?t:W(t);return Bi(e,n,p)}),U=_(2,(e,t)=>{let n=typeof t==`function`?t(r):Mi(t)?t:W(t);return Vi(e,n,p)}),Ui=_(3,(e,t,n)=>D(V(n),n=>{let r=L.defaultValue(),i=T(()=>v(e,L,r));return f(D(n(t),e=>{r=e;let t=x(D(i,n));return m({while:Ot,body:t,step(e){r=e}})}),e=>vn(e)?E(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 S(n)?n:E(n)})),e.until&&(t=H(t,({input:t})=>{let n=e.until(t);return S(n)?O(n,e=>!e):E(!n)})),e.times!==void 0&&(t=H(t,({attempt:t})=>E(t<=e.times))),t},Gi=(e,t)=>{let n=-1,r=0,i=t=>Fn(e(t));return{begin:k(e=>T(()=>{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 u(i({_tag:`AttemptStart`,attempt:o.attempt,stepAttempt:o.stepAttempt,stepIndex:o.stepIndex}),o)})),end:(e,t)=>k(n=>{let r=on(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=_(e=>S(e[0]),(e,t,n)=>T(()=>{let i=0,a={attempt:0,stepIndex:0},o=oe(Ci,A(()=>(a={attempt:a.attempt+1,stepIndex:i},a))),s=n?.onEvent===void 0?void 0:Gi(n.onEvent,()=>a),c=s===void 0?r:e=>Je(t=>D(s.begin,n=>j(t(e),e=>s.end(n,e)))),l;return D(m({while:()=>i<t.steps.length&&(l===void 0||vr(l)),body(){let n=t.steps[i],r=o(c(zi(e,n.provide)));if(l){let e=!1,t=r;r=T(()=>e?t:(e=!0,N(l))),r=U(r,qi(n,!1))}else{let e=qi(n,!0);r=e?U(r,e):r}return He(r)},step(e){l=e,i++}}),()=>N(l))})),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);({...cn});const Yi=e=>e,Xi=_(2,(e,t)=>{let n=t=>g(n=>{let r=Qi(t,e,n,ae());return ea(t,r)});return S(t)?D(t,n):n(t)}),Zi=(e,t)=>{let n=Qi(t.resolver,e,t.onExit,{context:t.context,currentScheduler:Sr(t.context,Ft)});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:D(T(()=>t.resolver.delay),e=>ta(t)),run:j(T(()=>t.resolver.runAll(Array.from(t.entries),t.key)),e=>{for(let n of t.entrySet)n.completeUnsafe(e._tag===`Success`?zn(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)),d})};a=t}i.set(c,a),a.fiber=De(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=De(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)=>A(()=>$i(e,t));function ta(e){return e.map.has(e.key)?(e.map.delete(e.key),e.run):d}const q=_(2,(e,t)=>ur(n=>A(()=>e.updateUnsafe(t,n))));var na=e({Do:()=>xa,Transaction:()=>$,TypeId:()=>ra,abortSignal:()=>zs,acquireDisposable:()=>ys,acquireRelease:()=>vs,acquireUseRelease:()=>bs,addFinalizer:()=>xs,all:()=>ia,andThen:()=>za,annotateCurrentSpan:()=>Qs,annotateLogs:()=>Uc,annotateLogsScoped:()=>Wc,annotateSpans:()=>Zs,as:()=>Ga,asSome:()=>Ka,asVoid:()=>qa,awaitAllChildren:()=>gc,bind:()=>wa,bindTo:()=>Sa,cached:()=>As,cachedInvalidateWithTTL:()=>Ms,cachedWithTTL:()=>js,callback:()=>X,catch:()=>Za,catchCause:()=>ro,catchCauseFilter:()=>lo,catchCauseIf:()=>co,catchDefect:()=>io,catchEager:()=>dl,catchFilter:()=>oo,catchIf:()=>ao,catchNoSuchElement:()=>so,catchReason:()=>eo,catchReasons:()=>to,catchTag:()=>Qa,catchTags:()=>$a,clockWith:()=>Nc,context:()=>rs,contextWith:()=>is,currentParentSpan:()=>ec,currentSpan:()=>$s,delay:()=>No,die:()=>ka,effectify:()=>rl,ensuring:()=>Ss,eventually:()=>bo,exit:()=>Ua,fail:()=>Z,failCause:()=>Da,failCauseSync:()=>Oa,failSync:()=>Ea,fiber:()=>_c,fiberId:()=>vc,filter:()=>Bo,filterMap:()=>Vo,filterMapEffect:()=>Ho,filterMapOrElse:()=>Wo,filterMapOrFail:()=>Ko,filterOrElse:()=>Uo,filterOrFail:()=>Go,findFirst:()=>ca,findFirstFilter:()=>la,firstSuccessOf:()=>ko,flatMap:()=>Q,flatMapEager:()=>ul,flatten:()=>Ra,flip:()=>Ja,fn:()=>Mc,fnUntraced:()=>jc,fnUntracedEager:()=>fl,forEach:()=>ua,forever:()=>Bs,forkChild:()=>fc,forkDetach:()=>hc,forkIn:()=>pc,forkScoped:()=>mc,fromNullishOr:()=>La,fromOption:()=>Fa,fromResult:()=>Pa,gen:()=>Ta,ignore:()=>wo,ignoreCause:()=>To,interrupt:()=>Ns,interruptible:()=>Ps,interruptibleMask:()=>Rs,isEffect:()=>J,isFailure:()=>ts,isSuccess:()=>ns,let:()=>Ca,linkSpans:()=>rc,log:()=>Fc,logDebug:()=>Bc,logError:()=>Rc,logFatal:()=>Ic,logInfo:()=>zc,logTrace:()=>Vc,logWarning:()=>Lc,logWithLevel:()=>Pc,makeSpan:()=>ic,makeSpanScoped:()=>ac,map:()=>Wa,mapBoth:()=>fo,mapBothEager:()=>ll,mapEager:()=>sl,mapError:()=>uo,mapErrorEager:()=>cl,match:()=>Jo,matchCause:()=>Xo,matchCauseEager:()=>Zo,matchCauseEffect:()=>$o,matchCauseEffectEager:()=>Qo,matchEager:()=>Yo,matchEffect:()=>es,never:()=>ba,onError:()=>Cs,onErrorFilter:()=>Ts,onErrorIf:()=>ws,onExit:()=>Ds,onExitFilter:()=>ks,onExitIf:()=>Os,onExitPrimitive:()=>Es,onInterrupt:()=>Fs,option:()=>Ha,orDie:()=>po,orElseSucceed:()=>Oo,partition:()=>aa,promise:()=>fa,provide:()=>as,provideContext:()=>os,provideService:()=>ps,provideServiceEffect:()=>ms,race:()=>Ro,raceAll:()=>Io,raceAllFirst:()=>Lo,raceFirst:()=>zo,reduce:()=>oa,repeat:()=>Vs,repeatOrElse:()=>Hs,replicate:()=>Us,replicateEffect:()=>Ws,request:()=>uc,requestUnsafe:()=>dc,result:()=>Va,retry:()=>xo,retryOrElse:()=>So,runCallback:()=>Sc,runCallbackWith:()=>xc,runFork:()=>yc,runForkWith:()=>bc,runPromise:()=>Cc,runPromiseExit:()=>Tc,runPromiseExitWith:()=>Ec,runPromiseWith:()=>wc,runSync:()=>Dc,runSyncExit:()=>kc,runSyncExitWith:()=>Ac,runSyncWith:()=>Oc,sandbox:()=>Co,satisfiesErrorType:()=>al,satisfiesServicesType:()=>ol,satisfiesSuccessType:()=>il,schedule:()=>Gs,scheduleFrom:()=>Ks,scope:()=>hs,scoped:()=>gs,scopedWith:()=>_s,service:()=>cs,serviceOption:()=>ls,setContext:()=>ss,sleep:()=>Po,spanAnnotations:()=>tc,spanLinks:()=>nc,succeed:()=>ma,succeedNone:()=>ha,succeedSome:()=>ga,suspend:()=>_a,sync:()=>va,tap:()=>Ba,tapCause:()=>go,tapCauseFilter:()=>vo,tapCauseIf:()=>_o,tapDefect:()=>yo,tapError:()=>mo,tapErrorTag:()=>ho,timed:()=>Fo,timeout:()=>Ao,timeoutOption:()=>jo,timeoutOrElse:()=>Mo,tracer:()=>qs,track:()=>Kc,trackDefects:()=>Yc,trackDuration:()=>Xc,trackErrors:()=>Jc,trackSuccesses:()=>qc,transposeOption:()=>Ia,try:()=>Aa,tryPromise:()=>pa,tx:()=>Zc,txRetry:()=>nl,undefined:()=>ya,uninterruptible:()=>Is,uninterruptibleMask:()=>Ls,unwrapReason:()=>no,updateContext:()=>us,updateService:()=>ds,updateServiceScoped:()=>fs,useSpan:()=>oc,validate:()=>sa,void:()=>Y,when:()=>qo,whileLoop:()=>da,withErrorReporting:()=>Do,withExecutionPlan:()=>Eo,withFiber:()=>Na,withLogSpan:()=>Gc,withLogger:()=>Hc,withParentSpan:()=>lc,withSpan:()=>sc,withSpanScoped:()=>cc,withTracer:()=>Js,withTracerEnabled:()=>Ys,withTracerTiming:()=>Xs,yieldNow:()=>ja,yieldNowWith:()=>Ma,zip:()=>Ya,zipWith:()=>Xa});const ra=Oe,J=S,ia=xr,aa=Tr,oa=In,sa=Qe,ca=Jn,la=cr,ua=tr,da=m,fa=Lr,pa=Dr,ma=E,ha=dr,ga=Zt,_a=T,va=A,Y=d,ya=de,X=g,ba=Zn,xa=Tn,Sa=qe,Ca=bt,wa=se,Ta=ut,Z=p,Ea=Vr,Da=h,Oa=ot,ka=en,Aa=pt,ja=ge,Ma=Ne,Na=dt,Pa=N,Fa=Xt,Ia=ie,La=Ir,Q=D,Ra=Qt,za=Nr,Ba=tn,Va=He,Ha=wn,Ua=pn,Wa=O,Ga=u,Ka=Er,qa=ft,Ja=Rn,Ya=rr,Xa=ke,Za=f,Qa=ht,$a=St,eo=vt,to=be,no=Pn,ro=Ue,io=Te,ao=Rr,oo=rt,so=l,co=pe,lo=Xe,uo=It,fo=Ae,po=yn,mo=gn,ho=Bt,go=un,_o=Un,vo=er,yo=Sn,bo=an,xo=U,So=Vi,Co=ve,wo=Ye,To=Fn,Eo=Ki,Do=it,Oo=Ht,ko=Wt,Ao=Fr,jo=Yt,Mo=jr,No=mr,Po=sr,Fo=Cr,Io=mt,Lo=fe,Ro=kr,zo=le,Bo=Tt,Vo=ye,Ho=Ie,Uo=Pt,Wo=ar,Go=At,Ko=Me,qo=Ee,Jo=n,Yo=Dn,Xo=ln,Zo=_r,Qo=lr,$o=Yn,es=Gt,ts=me,ns=Re,rs=Xn,is=ur,as=zi,os=C,ss=qn,cs=sn,ls=gr,us=o,ds=w,fs=Be,ps=v,ms=oe,hs=Fe,gs=nt,_s=i,vs=bn,ys=Vn,bs=mn,xs=Rt,Ss=br,Cs=pr,ws=Bn,Ts=$t,Es=nr,Ds=j,Os=fn,ks=rn,As=Nn,js=An,Ms=a,Ns=s,Ps=jn,Fs=Gn,Is=ce,Ls=Je,Rs=Ve,zs=$n,Bs=Wn,Vs=Hi,Hs=Bi,Us=c,Ws=Mn,Gs=_(2,(e,t)=>Ks(e,void 0,t)),Ks=Ui,qs=lt,Js=xe,Ys=gt,Xs=Ct,Zs=st,Qs=qt,$s=Kt,ec=kn,tc=En,nc=Ut,rc=Se,ic=_e,ac=Pe,oc=Ge,sc=ee,cc=yt,lc=zr,uc=Xi,dc=Zi,fc=Cn,pc=Vt,mc=wr,hc=_n,gc=ue,_c=re,vc=we,yc=he,bc=De,xc=$e,Sc=Ke,Cc=ze,wc=ne,Tc=at,Ec=Br,Dc=xt,Oc=wt,kc=Ce,Ac=_t,jc=nn,Mc=yr,Nc=k,Pc=b,Fc=b(),Ic=b(`Fatal`),Lc=b(`Warn`),Rc=b(`Error`),zc=b(`Info`),Bc=b(`Debug`),Vc=b(`Trace`),Hc=_(2,(e,t)=>w(e,or,e=>new Set([...e,t]))),Uc=_(e=>J(e[0]),(e,...t)=>w(e,Zr,e=>{let n=t.length===1?{...e,...t[0]}:{...e};return t.length===1||Or(n,t[0],t[1]),n})),Wc=Ar,Gc=_(2,(e,t)=>D(Qn,n=>w(e,Qr,e=>[[t,n],...e]))),Kc=_(e=>J(e[0]),(e,t,n)=>Ds(e,e=>{let r=n===void 0?e:y(()=>n(e));return q(t,r)})),qc=_(e=>J(e[0]),(e,t,n)=>Ba(e,e=>{let r=n===void 0?e:n(e);return q(t,r)})),Jc=_(e=>J(e[0]),(e,t,n)=>mo(e,e=>{let r=n===void 0?e:y(()=>n(e));return q(t,r)})),Yc=_(e=>J(e[0]),(e,t,n)=>yo(e,e=>{let r=n===void 0?e:y(()=>n(e));return q(t,r)})),Xc=_(e=>J(e[0]),(e,n,r)=>Nc(i=>{let a=i.monotonicTimeNanosUnsafe();return Ds(e,()=>{let e=i.monotonicTimeNanosUnsafe(),o=hr(t(e),t(a)),s=r===void 0?o:y(()=>r(o));return q(n,s)})}));var $=class extends hn()(`effect/Effect/Transaction`){};const Zc=e=>Na(t=>{if(t.context.mapUnsafe.has($.key))return e;let n={journal:new Map,retry:!1},r;return Ls(i=>Q(da({while:()=>!r,body:x(i(e).pipe(ps($,n),go(()=>n.retry?i($c(n)):Y),Ua)),step(e){if(n.retry||!Qc(n))return tl(n);Gr(e)?el(t,n):tl(n),r=e}}),()=>r))}),Qc=e=>{for(let[t,{version:n}]of e.journal)if(t.version!==n)return!1;return!0},$c=e=>_a(()=>{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 va(r)})});function el(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 tl(e){e.retry=!1,e.journal.clear()}const nl=Q($,e=>(e.retry=!0,Ns)),rl=(e,t,n)=>(...r)=>X(i=>{try{e(...r,(e,n)=>{i(e?Z(t?t(e,r):e):ma(n))})}catch(e){i(n?Z(n(e,r)):ka(e))}}),il=()=>e=>e,al=()=>e=>e,ol=()=>e=>e,sl=Dt,cl=tt,ll=Mt,ul=fr,dl=Le,fl=dn;export{Y as $,Oo as A,wc as B,Ta as C,cl as D,uo as E,yc as F,ls as G,kc as H,bc as I,_a as J,ma as K,Cc as L,Va as M,Sc as N,es as O,xc as P,Aa as Q,Tc as R,Pa as S,sl as T,Ac as U,Dc as V,Oc as W,Ba as X,va as Y,pa as Z,jc as _,ro as a,di as at,Bs as b,rl as c,mi as ct,Da as d,P as dt,Na as et,Oa as f,$r as ft,Mc as g,Ra as h,X as i,gi as it,os as j,po as k,Ua as l,ti as lt,ul as m,vs as n,Ti as nt,Qa as o,bi as ot,Q as p,ei as pt,ha as q,Ga as r,I as rt,ka as s,Si as st,na as t,wi as tt,Z as u,ni as ut,fl as v,Wa as w,pc as x,ua as y,Ec 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,do as f,fo as p,gt as m,ht as h,jt as g,kt as _,lo as v,mt as y,pt as b,uo as x,vo as S,vt as C,wt as w,xt as T,yt as E}from"./effect-BoxserXC.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=S,k=p,A=f,j=x,M=v,N=n,P=s,F=_,I=o,L=l,R=w,z=r,B=u,V=C,H=m,U=h,W=d,G=E,K=a,q=t,J=i,Y=g,X=b,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{$o as e,da as t,fa as n,is as r,la as i,ma as a}from"./effect-BoxserXC.js";const o={"~effect/match/Match/Matcher":{_input:e,_filters:e,_result:e,_return:e},_tag:`ValueMatcher`,add(e){return n(this.value)?this:e._tag===`When`&&e.guard(this.provided)===!0||e._tag===`Not`&&e.guard(this.provided)===!1?s(this.provided,a(e.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,i(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=>r=>{let i=m(r);return t(i)?i._tag===`Success`?i.success:e(i.failure):t=>{let r=i(t);return n(r)?r.success:e(r.failure)}},m=e=>{if(e._tag===`ValueMatcher`)return e.value;let t=e.cases.length;if(t===1){let t=e.cases[0];return e=>t._tag===`When`&&t.guard(e)===!0||t._tag===`Not`&&t.guard(e)===!1?a(t.evaluate(e)):i(e)}return n=>{for(let r=0;r<t;r++){let t=e.cases[r];if(t._tag===`When`&&t.guard(n)===!0||t._tag===`Not`&&t.guard(n)===!1)return a(t.evaluate(n))}return i(n)}},h=`effect/match/Match/exhaustive: absurd`,g=e=>{let r=m(e);if(t(r)){if(n(r))return r.success;throw Error(h)}return e=>{let t=r(e);if(n(t))return t.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{Ta as e,ja as t,ka as n,ua as r}from"./effect-BoxserXC.js";import{S as i,_ as a,b as o,g as s,h as c,p as l,t as u,v as d,x as f,y as p}from"./dist-Cl6FTVNh.js";import{C as m,M as ee}from"./Effect-CZxGnFfU.js";import{a as h,i as g,n as _,r as v,t as y}from"./Match-BM1Os2Yz.js";const b=c([`subagent_type`,`prompt`]),x=Symbol.for(`@systemfsoftware/omp-agent-discipline/DelegationVerdict`);var S=class extends o()(`Allow`,{}){[x]=x},C=class extends o()(`Block`,{reason:d,how:b,skill:d}){[x]=x};f([S,C]);const w=p({protectedSkills:l(d),delegationVerbs:l(d),referenceVerbs:l(d),mentionPatterns:a(d,d)}).pipe(i({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)'}})})),T=f([w,s]),E=Symbol.for(`@systemfsoftware/omp-agent-discipline/CheckDelegationCommand`);var D=class extends o()(`CheckDelegationCommand`,{toolName:d,subagentType:d,prompt:d,guard:T}){[E]=E};const O=Symbol.for(`@systemfsoftware/omp-agent-discipline/ClassifiedInput`);var k=class extends o()(`NoGuard`,{}){[O]=O},A=class extends o()(`NonDelegatedTool`,{}){[O]=O},j=class extends o()(`ProtectedSubagent`,{skill:d}){[O]=O},M=class extends o()(`EmptyPrompt`,{}){[O]=O},N=class extends o()(`Prompted`,{guard:w,prompt:d}){[O]=O};f([k,A,j,M,N]);const P=Symbol.for(`@systemfsoftware/omp-agent-discipline/PromptAnalysis`);var F=class extends o()(`Delegated`,{skill:d,excerpt:d}){[P]=P},I=class extends o()(`Referenced`,{}){[P]=P},L=class extends o()(`NoDelegation`,{}){[P]=P};f([F,I,L]);function R(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 z(e,t){return new RegExp(e,`i`).test(t)}function B(e,t){return e.map(e=>new RegExp(e,`i`).exec(t)).find(e=>e!==null)??null}const V=e=>n(e=>e!==``)(e),H=(e,t)=>g(V(e.prompt)).pipe(v(`Some`,({value:e})=>new N({guard:t,prompt:e})),v(`None`,()=>new M),y),U=(e,t)=>n(e=>e!==``&&t.protectedSkills.includes(e))(e.subagentType),W=(e,t)=>g(U(e,t)).pipe(v(`Some`,({value:e})=>new j({skill:e})),v(`None`,()=>H(e,t)),y),G=t=>e(t.guard),K=(e,r)=>n(e=>e===`task`||e===`agent`)(e.toolName.toLowerCase()).pipe(t(()=>W(e,r))),q=e=>g(G(e)).pipe(v(`None`,()=>new k),v(`Some`,({value:t})=>g(K(e,t)).pipe(v(`None`,()=>new A),v(`Some`,({value:e})=>e),y)),y),J=(e,t)=>{let r=Object.entries(e.mentionPatterns).filter(([,e])=>z(e,t)).map(([e])=>e);return n(e=>e.length>0)(r)},Y=(e,t)=>g(J(e,t)).pipe(v(`None`,()=>new L),v(`Some`,({value:n})=>{let r=n[0],i=e.referenceVerbs.some(e=>z(e,t)),a=e.delegationVerbs.some(e=>z(e,t));return g({hasReference:i,hasDelegation:a}).pipe(h({hasReference:!0},()=>new I),h({hasDelegation:!1},()=>new L),_(()=>{let n=B(e.delegationVerbs,t),i=n===null?t.slice(0,120):n[0];return new F({skill:r,excerpt:i})}))}),y),X=e=>g(q(e)).pipe(v(`NoGuard`,()=>new S),v(`NonDelegatedTool`,()=>new S),v(`ProtectedSubagent`,({skill:e})=>new C({reason:R(e,`subagent_type`,e),how:`subagent_type`,skill:e})),v(`EmptyPrompt`,()=>new S),v(`Prompted`,({guard:e,prompt:t})=>g(Y(e,t)).pipe(v(`Delegated`,({skill:e,excerpt:t})=>new C({reason:R(e,`prompt`,t),how:`prompt`,skill:e})),v(`Referenced`,()=>new S),v(`NoDelegation`,()=>new S),y)),y);function Z(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Q(e){if(e.length===0)return null;let t=`(?:`+e.map(Z).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/.`"])'+Z(e)+'(?=$|[\\s/.`"]|\\b)']))}}function te(e){return g(e).pipe(v(`Block`,e=>({block:!0,reason:e.reason,how:e.how,skill:e.skill})),v(`Allow`,()=>void 0),y)}function ne(e){return m(function*(){return Q((yield*(yield*u).load(e)).no_delegate_skills??[])})}function re(e,t,n,r){return m(function*(){let i=new D({toolName:t,subagentType:n,prompt:r,guard:yield*ne(e)});return te(X(i))})}const ie=e=>typeof e==`object`&&!!e&&!Array.isArray(e),ae=e=>ie(e)?e:{};function $(e,...t){for(let n of t){let t=e[n];if(typeof t==`string`&&t.length>0)return t}return``}const oe=(e,t)=>{e.on(`tool_call`,async(e,n)=>{let i=ae(e.input),a=$(i,`subagent_type`,`agent`),o=$(i,`prompt`,`task`,`description`),s=await t(ee(re(n.cwd,e.toolName,a,o)));if(r(s))throw s.failure;return s.success})};export{oe as NoSkillDelegationExtension};
@@ -0,0 +1 @@
1
+ import{Ea as e,Na as t,Pa as n,Ta as r,Ut as i,Vt as a,ns as o,wa as s}from"./effect-BoxserXC.js";import{C as c,E as l,T as u,a as d,c as f,d as ee,f as p,i as te,l as ne,n as re,o as m,r as h,s as ie,u as g,w as _}from"./dist-Cl6FTVNh.js";import{i as v}from"./Cause-Daq_jwhV.js";import{o as ae}from"./Exit-CMCdU7HJ.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-CZxGnFfU.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=a,Oe=i,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 p({_tag:i,module:e,method:t,pathOrDescriptor:r,syscall:n.syscall,cause:n})},G=e=>t=>ee({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)=>o(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)),r=e(`read`),i=e(`readAlloc`),a=E(B.fstat,W(`FileSystem`,`stat`),G(`stat`)),o=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`),u=c(`writeAll`);class f{[d];fd;append;position=BigInt(0);constructor(e,t){this[d]=d,this.fd=e,this.append=t}get stat(){return z(a(this.fd),X)}get sync(){return s(this.fd)}seek(e,t){let n=m(e);return C(()=>(t===`start`?this.position=n:t===`current`&&(this.position+=n),m(this.position)))}read(e){return x(()=>{let t=this.position;return z(r(this.fd,{buffer:e,position:t}),e=>{let n=m(e);return this.position=t+n,n})})}readAlloc(e){let r=Number(e);return x(()=>{let e=Buffer.allocUnsafeSlow(r),a=this.position;return z(i(this.fd,{buffer:e,position:a}),i=>{if(i===0)return t();if(this.position=a+BigInt(i),i===r)return n(e);let o=Buffer.allocUnsafeSlow(i);return e.copy(o,0,0,i),n(o)})})}truncate(e){return z(o(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=m(e);return this.append||(this.position=t+n),n})})}writeAllChunk(e){return x(()=>{let t=this.position;return I(u(this.fd,e,void 0,void 0,this.append?void 0:Number(t)),n=>n===0?R(p({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:r(e.mtime),atime:r(e.atime),birthtime:r(e.birthtime),dev:e.dev,rdev:r(e.rdev),ino:r(e.ino),mode:e.mode,nlink:r(e.nlink),uid:r(e.uid),gid:r(e.gid),size:m(e.size),blksize:e.blksize===void 0?t():n(m(e.blksize)),blocks:r(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=(e,t)=>ne(n=>F(C(()=>{let r=B.watch(e,{recursive:t?.recursive??!1},(e,t)=>{if(t)switch(e){case`rename`:b(fe(Z(t),{onSuccess:e=>u(n,{_tag:`Create`,path:t}),onFailure:e=>u(n,{_tag:`Remove`,path:t})}));return;case`change`:l(n,{_tag:`Update`,path:t});return}});return r.on(`error`,t=>{_(n,v(p({module:`FileSystem`,_tag:`Unknown`,method:`watch`,pathOrDescriptor:e,cause:t})))}),r.on(`close`,()=>{c(n)}),r}),e=>C(()=>e.close()))),$e=(t,n,r)=>Z(n).pipe(z(i=>t.pipe(s(e=>e.register(n,i,r)),e(()=>Qe(n,r)))),g),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(ie),e=>f({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(te)(et),tt=ke(be($,h,re.pipe(L($),L(h))));export{tt as default};
@@ -0,0 +1,17 @@
1
+ import{$a as e,$o as t,Ao as n,Bn as r,Bo as i,Ca as a,Co as o,Da as s,Do as c,Dt as l,Eo as u,Fo as d,Ft as f,Go as ee,Ho as p,Io as m,Jo as h,Ka as te,Ko as ne,Lo as re,M as g,Ma as ie,Na as _,No as ae,Oa as oe,Oo as se,Pa as v,Po as ce,Pt as le,Qo as ue,So as de,Uo as fe,Vo as pe,Wo as me,Ya as he,Yo as ge,aa as _e,ca as ve,do as ye,es as y,fo as b,ga as be,ia as xe,is as x,ja as Se,jo as Ce,li as we,lt as S,no as C,ns as Te,oa as Ee,oi as De,oo as Oe,qo as ke,ra as Ae,rs as je,sa as Me,to as Ne,ts as Pe,ui as Fe,uo as Ie,wo as Le,y as Re,zo as ze}from"./effect-BoxserXC.js";import{c as Be,r as Ve,s as He}from"./Cause-Daq_jwhV.js";import{a as Ue,i as We,n as Ge,o as Ke,r as qe}from"./Exit-CMCdU7HJ.js";import{A as Je,C as Ye,E as Xe,H as Ze,J as Qe,K as w,Q as $e,T as et,X as tt,Y as nt,_ as rt,a as it,b as at,ct as ot,d as st,f as ct,g as lt,it as ut,k as dt,l as ft,lt as pt,m as T,nt as mt,o as ht,p as E,pt as gt,q as _t,r as vt,tt as yt,u as D,v as bt,w as xt,x as St,y as Ct}from"./Effect-CZxGnFfU.js";import wt from"node:os";const Tt=e=>(t,n)=>t===n||e(t,n),Et=class extends je{constructor(e){super(),e&&o(this,e)}},Dt=he,Ot=Ne,kt=`~effect/time/DateTime`,At=`~effect/time/DateTime/TimeZone`,jt={[kt]:kt,pipe(){return x(this,arguments)},[u](){return this.toString()},toJSON(){return Nt(this).toJSON()}};({...jt}),{...jt};const Mt={[At]:At,[u](){return this.toString()}};({...Mt}),{...Mt};const Nt=e=>new Date(e.epochMilliseconds),Pt=`~effect/BigDecimal`,Ft={[Pt]:Pt,[ze](){let e=Vt(this);return d(m(e.value),re(e.scale))},[ce](e){return It(e)&&Gt(this,e)},toString(){return`BigDecimal(${Kt(this)})`},toJSON(){return{_id:`BigDecimal`,value:String(this.value),scale:this.scale}},[u](){return this.toJSON()},pipe(){return x(this,arguments)}},It=e=>i(e,Pt),Lt=(e,t)=>{let n=Object.create(Ft);return n.value=e,n.scale=t,n},Rt=(e,t)=>{if(e!==O&&e%zt===O)throw RangeError(`Value must be normalized`);let n=Lt(e,t);return n.normalized=n,n},O=BigInt(0),zt=BigInt(10),Bt=Rt(O,0),Vt=e=>{if(e.normalized===void 0){if(e.value===O)e.normalized=Bt;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=Rt(r,i)}}return e.normalized},Ht=ue(2,(e,t)=>t>e.scale?Lt(e.value*zt**BigInt(t-e.scale),t):t<e.scale?Lt(e.value/zt**BigInt(e.scale-t),t):e),Ut=e=>e.value<O?Lt(-e.value,e.scale):e,Wt=Tt((e,t)=>e.scale>t.scale?Ht(t,e.scale).value===e.value:e.scale<t.scale?Ht(e,t.scale).value===t.value:e.value===t.value),Gt=ue(2,(e,t)=>Wt(e,t)),Kt=e=>{let t=Vt(e);if(Math.abs(t.scale)>=16)return qt(t);let n=t.value<O,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},qt=e=>{if(Jt(e))return`0e+0`;let t=Vt(e),n=`${Ut(t).value}`,r=n.slice(0,1),i=n.slice(1),a=`${Yt(t)?`-`:``}${r}`;i!==``&&(a+=`.${i}`);let o=i.length-t.scale;return`${a}e${o>=0?`+`:``}${o}`},Jt=e=>e.value===O,Yt=e=>e.value<O;function Xt(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function Zt(e){return t=>Xt(t)?.[e]}const Qt=`~sentinels`,$t=`~constructor`,en=Zt(`brands`),tn=y(e=>{let t=Xt(e)?.identifier;return typeof t==`string`?t:e.getExpected(tn)}),k=Symbol(),A=Ue,j=A(k),M=A(k),nn=e=>e===k?_():v(e),rn=e=>e._tag===`None`?j:A(e.value),an=`~effect/SchemaIssue/Issue`;function on(e){return i(e,an)&&e[an]===an}function sn(e){return Object.hasOwn(e,`input`)}var N=class{[an]=an;constructor(e,t){t?.reportInput===!0&&e!==k&&(this.input=e)}},cn=class extends N{_tag=`Filter`;filter;issue;constructor(e,t,n,r){super(n,r),this.filter=e,this.issue=t}},ln=class extends N{_tag=`Encoding`;ast;issue;constructor(e,t,n,r){super(n,r),this.ast=e,this.issue=t}},P=class extends N{_tag=`Pointer`;path;issue;constructor(e,t){super(),this.path=e,this.issue=t}},un=class extends N{_tag=`MissingKey`;annotations;constructor(e){super(),this.annotations=e}},dn=class extends N{_tag=`UnexpectedKey`;ast;constructor(e,t,n){super(t,n),this.ast=e}},F=class extends N{_tag=`Composite`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},fn=class extends N{_tag=`InvalidType`;ast;constructor(e,t,n){super(t,n),this.ast=e}},I=class extends N{_tag=`InvalidValue`;annotations;constructor(e,t,n){super(t,n),this.annotations=e}},pn=class extends N{_tag=`AnyOf`;ast;issues;constructor(e,t,n,r){super(n,r),this.ast=e,this.issues=t}},mn=class extends N{_tag=`OneOf`;ast;successes;constructor(e,t,n,r){super(n,r),this.ast=e,this.successes=t}};function hn(e,t,n){if(on(e))return e;if(typeof e==`string`)return new I({message:e},t,n);let r=typeof e.issue==`string`?new I({message:e.issue},t,n):e.issue;return new P(e.path,r)}function gn(e,t,n){if(e!==void 0)return typeof e==`boolean`?e?void 0:new I(void 0,t,n):hn(e,t,n)}function _n(e,t,n,r){return Array.isArray(t)?Ee(t)?t.length===1?hn(t[0],n,r):new F(e,Me(t,e=>hn(e,n,r)),n,r):void 0:gn(t,n,r)}const vn=e=>{let t=Dn(e);if(t!==void 0)return t;switch(e._tag){case`InvalidType`:return Sn(tn(e.ast),e);case`InvalidValue`:{let t=xn(e);if(t!==void 0)return Sn(t,e);let n=bn(e);return n===void 0?`Expected a valid value`:`Invalid data ${n}`}case`MissingKey`:return`Missing key`;case`UnexpectedKey`:{let t=bn(e);return t===void 0?`Expected no excess property`:`Unexpected key with value ${t}`}case`Forbidden`:return`Forbidden operation`;case`OneOf`:{let t=bn(e);return t===void 0?`Expected exactly one member to match`:`Expected exactly one member to match the input ${t}`}}},yn=e=>Dn(e.issue)??Dn(e);function bn(e){return sn(e)?se(e.input):void 0}function xn(e){let t=e.annotations?.expected;return typeof t==`string`?t:void 0}function Sn(e,t){let n=bn(t);return n===void 0?`Expected ${e}`:`Expected ${e}, got ${n}`}function Cn(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=>Cn(e)).join(` & `)}}function wn(){return e=>En(e,``)}const Tn=wn();function En(e,t){let r;switch(e._tag){case`Filter`:{let n=yn(e);if(n!==void 0)r=n;else{if(e.issue._tag!==`InvalidValue`)return En(e.issue,t);let n=xn(e.issue);r=n===void 0?Sn(Cn(e.filter),e):Sn(n,e.issue)}break}case`Encoding`:return En(e.issue,t);case`Pointer`:return En(e.issue,t+n(e.path));case`Composite`:case`AnyOf`:if(e._tag===`Composite`||e.issues.length>0)return e.issues.map(e=>En(e,t)).join(`
2
+ `);r=Dn(e)??Sn(tn(e.ast),e);break;default:r=vn(e)}return t?`${r}\n at ${t}`:r}function Dn(e){if(e._tag===`Pointer`)return;if(e._tag===`Encoding`)return Dn(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 On(e){let t;for(let n of e.reasons){if(!He(n)||!on(n.error))return;t??=n.error}return t}function kn(e,t){let n=On(e);if(n===void 0)throw Error(t,{cause:e});return n}be()(`effect/DateTime/CurrentTimeZone`),Ot(`EncodingError`);var An=class e extends je{run;constructor(e){super(),this.run=e}map(t){return new e((e,n)=>this.run(e,n).pipe(et(Se(t))))}compose(t){return Mn(this)?t:Mn(t)?this:new e((e,n)=>this.run(e,n).pipe(T(e=>t.run(e,n))))}};const jn=new An(w);function Mn(e){return e.run===jn.run}function Nn(){return jn}function Pn(e){return new An((t,n)=>s(t)?_t:e(t.value,n))}function L(e){return In(Se(e))}function Fn(e){return Pn((t,n)=>e(t,n).pipe(et(v)))}function In(e){return new An(t=>w(e(t)))}function Ln(e){return new An(t=>{let n=a(t,me);return oe(n)?w(n):et(e,v)})}function Rn(){return L(globalThis.String)}function zn(){return L(globalThis.Number)}const Bn=`~effect/SchemaTransformation/Transformation`;var R=class e{[Bn]=Bn;_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 Vn(e){return i(e,Bn)&&e[Bn]===Bn}const Hn=e=>Vn(e)?e:new R(e.decode,e.encode),Un=new R(Nn(),Nn());function Wn(){return Un}const Gn=new R(zn(),Rn());function z(e){return t=>t._tag===e}const Kn=z(`Declaration`),qn=z(`Never`),B=z(`Literal`),Jn=z(`UniqueSymbol`),Yn=z(`Arrays`),Xn=z(`Objects`),Zn=z(`Suspend`);var V=class{to;transformation;constructor(e,t){this.to=e,this.transformation=t}};const Qn={};var H=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 $n=`~effect/Schema`;var U=class{[$n]=$n;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}>`}},er=class e extends U{_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===k?j:(e??=this.run(this.typeParameters))(t,this,n)}_rebuild(t,n,r){let i=K(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 tr=new class extends U{_tag=`Null`;getParser(){return Si(this,null)}getExpected(){return`null`}};var nr=class extends U{_tag=`Undefined`;getParser(){return Si(this,void 0)}toCodecJson(){return W(this,[rr])}getExpected(){return`undefined`}};const rr=new V(tr,new R(L(()=>void 0),L(()=>null))),ir=new nr,ar=new class extends U{_tag=`Unknown`;getParser(){return Ci(this,ge)}getExpected(){return`unknown`}};var or=class extends U{_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 Si(this,this.literal)}matchPart(e,t){return e===globalThis.String(this.literal)?this.literal:void 0}toCodecJson(){return typeof this.literal==`bigint`?sr(this):this}toCodecStringTree(){return typeof this.literal==`string`?this:sr(this)}getExpected(){return typeof this.literal==`string`?JSON.stringify(this.literal):globalThis.String(this.literal)}};function sr(e){let t=globalThis.String(e.literal);return W(e,[new V(new or(t),new R(L(()=>e.literal),L(()=>t)))])}const cr=new class extends U{_tag=`String`;getParser(){return Ci(this,h)}matchPart(e,t){let n=this.checks;return n&&!t.disableChecks&&Y(n,e,void 0,this,t)?void 0:e}getExpected(){return`string`}};var lr=class extends U{_tag=`Number`;getParser(){return Ci(this,ee)}matchKey(e,t){return this._match(Ei,e,t)}matchPart(e,t){return this._match(Ti,e,t)}_match(e,t,n){if(!e.test(t))return;let r=globalThis.Number(t);return n.disableChecks||!this.checks?r:Y(this.checks,r,void 0,this,n)?void 0:r}toCodecJson(){return this.checks&&(ur(this.checks,`effect/schema/isFinite`)||ur(this.checks,`effect/schema/isInt`))?this:W(this,[dr(this.checks)])}toCodecStringTree(){return this.toCodecJson()===this?W(this,[ki]):W(this,[Ai])}getExpected(){return`number`}};function ur(e,t){return e.some(e=>e.annotations?.representation?.id===t||e._tag===`FilterGroup`&&ur(e.checks,t))}function dr(e){return new V(new Rr([e?G(Jr,e):Jr,Vr],`anyOf`),new R(zn(),L(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))))}const fr=new lr,pr=new class extends U{_tag=`Boolean`;getParser(){return Ci(this,pe)}getExpected(){return`boolean`}};var mr=class e extends U{_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(q(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(q(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 bt(function*(e,c){if(e===k)return k;if(!Array.isArray(e))return yield*D(new fn(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=gr(c?.concurrency),f=hr(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 dn(n,e[t],c),i=new P([t],r);if(c.errors===`all`)u.issues?u.issues.push(i):u.issues=[i];else return yield*D(new F(n,[i],e,c))}return u.issues?yield*D(new F(n,u.issues,e,c)):u.output})}_rebuild(t,n,r){let i=K(this.elements,t),a=K(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 hr=r()({onItem(e,t,n){let r=n<e.len?t:k;return e.getParser(e.tailThreshold,n).parser(r,e.options)},step(e,t,n,r){if(n._tag===`Failure`)return _r(e,e.ast,r,n);let i=n===M?t:n[C];if(i!==k)e.output[r]=i;else{let t=e.getParser(e.tailThreshold,r);if(q(t.ast))return;let n=new P([r],new un(t.ast.context?.annotations));if(e.options.errors===`all`)e.issues?e.issues.push(n):e.issues=[n];else return Ge(new F(e.ast,[n],e.input,e.options))}}}),gr=e=>(e=e===`unbounded`?1/0:e??1,e>1?{concurrency:e}:void 0),_r=(e,t,n,r)=>{if(r.cause.reasons.length===0)return r;let i=On(r.cause);if(i===void 0)return qe(Be(r.cause,r=>new F(t,[new P([n],r)],e.input,e.options)));let a=new P([n],i);if(e.options.errors===`all`)e.issues?e.issues.push(a):e.issues=[a];else return Ge(new F(t,[a],e.input,e.options))},vr=`[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?`;function yr(e,t,n=Qn){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(wi(vi(t)))}var br=class{name;type;constructor(e,t){this.name=e,this.type=t}};function xr(e){switch(e._tag){case`String`:case`Number`:case`Symbol`:case`TemplateLiteral`:return!0;case`Union`:return e.types.every(xr);default:return!1}}function Sr(e){return xr(e)&&xr(vi(e))}var Cr=class{parameter;type;constructor(e,t){if(!Sr(e))throw Error(`Invalid index signature parameter ${e._tag}`);if(this.parameter=e,this.type=t,q(t)&&!xi(t))throw Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}},wr=class e extends U{_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,i=[];for(let e of n.propertySignatures)i.push(e.name);let a=i.length,o=n.indexSignatures.length,s=a&&o?new Set(i):void 0;if(!a&&!o)return Ci(n,fe);let c,l,u=(e,t,r,i,o)=>{if(o._tag===`Failure`)return _r(e,n,t,o)??Ke;let c=o===M?i:o[C];if(r!==k&&c!==k){if(a&&(s.has(t)||s.has(r)))return Ke;Le(e.out,r,c)}return Ke},d=(e,t,r,i)=>{if(!i){let n=r.parserKey(t,e.options);if(!S(n))return E(ft(n),n=>d(e,t,r,n));i=n}if(i._tag===`Failure`)return _r(e,n,t,i)??Ke;let a=i===M?t:i[C],o=e.input[t],s=r.parserValue(o,e.options);return S(s)?u(e,t,a,o,s):E(ft(s),n=>u(e,t,a,o,n))},f=(e,t,n)=>{let r=e.input[t],i=n.parserValue(r,e.options);return S(i)?u(e,t,t,r,i):E(ft(i),n=>u(e,t,t,r,n))},ee=o?r()({onItem:(e,[t,n])=>d(e,t,n),step:(e,t,n)=>n._tag===`Failure`?n:void 0}):void 0;return bt(function*(r,u){if(r===k)return k;if(!(typeof r==`object`&&r&&!Array.isArray(r)))return yield*D(new fn(n,r,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(wi(n.parameter)),parserValue:t(n.type)})):void 0);let p=r,m={},h={ast:n,input:p,out:m,issues:void 0,options:u},te=u.errors===`all`,ne=u.onExcessProperty===`error`,re=u.onExcessProperty===`preserve`,g;if(!o&&(ne||re)){s??=new Set(i),g=Reflect.ownKeys(p);for(let e=0;e<g.length;e++){let t=g[e];if(!s.has(t)){if(ne){let e=new dn(n,p[t],u),i=new P([t],e);if(te){h.issues?h.issues.push(i):h.issues=[i];continue}return yield*D(new F(n,[i],r,u))}Le(m,t,p[t])}}}let ie=gr(u?.concurrency);if(a){let e=Tr(h,c,ie);e&&(yield*e)}if(o&&!ie)for(let e=0;e<o;e++){let t=l[e],n=t.is.parameter===cr?f:d,r=t.is.parameter===cr?Object.keys(p):yr(p,t.is.parameter,u);for(let e=0;e<r.length;e++){let i=n(h,r[e],t);if(!S(i))yield*i;else if(i._tag===`Failure`)return yield*i}}else if(ee){let e=xe();for(let t=0;t<o;t++){let n=l[t],r=yr(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*D(new F(n,h.issues,r,u));if(u.propertyOrder===`original`){let e=(g??Reflect.ownKeys(p)).concat(i),t={};for(let n of e)Object.hasOwn(m,n)&&Le(t,n,m[n]);return t}return m})}_rebuild(t,n,r,i){let a=K(this.propertySignatures,e=>{let n=t(e.type);return n===e.type?e:new br(e.name,n)}),o=K(this.indexSignatures,e=>{let r=n(e.parameter),i=t(e.type);return r===e.parameter&&i===e.type?e:new Cr(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 Tr=r()({onItem(e,t){if(!Object.hasOwn(e.input,t.name))return t.parser(k,e.options);let n=e.input[t.name];return Le(e.out,t.name,n),t.parser(n,e.options)},step(e,t,n){if(n._tag===`Failure`)return _r(e,e.ast,t.name,n);if(n===M)return;let r=n[C];if(r!==k){Le(e.out,t.name,r);return}if(delete e.out[t.name],!q(t.type)){let n=new P([t.name],new un(t.type.context?.annotations));if(e.options.errors===`all`){e.issues?e.issues.push(n):e.issues=[n];return}return Ge(new F(e.ast,[n],e.input,e.options))}}});function Er(e,t){return e?t?[...e,...t]:e:t}function Dr(e,t,n){return new wr(Reflect.ownKeys(e).map(t=>new br(t,e[t].ast)),[],n,t)}function Or(e){return e.ast}function kr(e,t,n){return new Rr(e.map(Or),t,void 0,n)}const Ar=Pe(e=>{for(;;){if(Zn(e))return ar;let n=e.encoding;if(!n)return e.recur?.(Ar,t)??e;if(n.some(e=>e.transformation._tag===`Middleware`&&e.transformation.decode!==t))return ar;e=n[n.length-1].to}});function jr(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(jr)));default:return[`null`,`undefined`,`string`,`number`,`boolean`,`symbol`,`bigint`,`object`,`array`,`function`]}}function Mr(e){switch(e._tag){default:return[];case`Declaration`:{let t=e.annotations?.[Qt];return Array.isArray(t)?t:[]}case`Objects`:return e.propertySignatures.flatMap(e=>{let t=e.type;if(!q(t)){if(B(t))return[{key:e.name,literal:t.literal}];if(Jn(t))return[{key:e.name,literal:t.symbol}]}return[]});case`Arrays`:return e.elements.flatMap((e,t)=>{if(!q(e)){if(B(e))return[{key:t,literal:e.literal}];if(Jn(e))return[{key:t,literal:e.symbol}]}return[]});case`Union`:{if(e.types.length===0)return[];let t=e.types.map(e=>Mr(Ar(e)));return t[0].filter(e=>t.every(t=>t.some(t=>t.key===e.key&&t.literal===e.literal)))}case`Suspend`:return Mr(e.thunk())}}const Nr=new WeakMap,Pr=Object.freeze([]);function Fr(e){let t=Nr.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=Ar(s);if(qn(c))continue;if(o){if(B(c)||Jn(c)){a??=new Map;let e=B(c)?c.literal:c.symbol,t=a.get(e);t||a.set(e,t=[]),t.push(s)}else o=!1}let l=Mr(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=jr(c);for(let n of e)(i[n]??=[]).push(t)}}if(o&&a)a.forEach(Object.freeze),t=e=>a.get(e)??Pr;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(ne(t)){let i=Object.hasOwn(t,r)?t[r]:void 0;if(i!==void 0)return a.get(i)??Pr;if(n)return e}return Pr}}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]??Pr;if(!ne(t))return o.map(t=>e[t]);let s=new Set(o),c;if(a){let[n,[i]]=a,l=Object.hasOwn(t,n),u=l?t[n]:void 0;if(l&&(!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);c=n}}if(c===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===c)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]??Pr).map(t=>e[t]).filter(Ir(t));return Nr.set(e,t),t}function Ir(e){return t=>{let n=Ar(t);return n._tag===`Literal`?n.literal===e:n._tag!==`UniqueSymbol`||n.symbol===e}}function Lr(e,t,n=!1){return Fr(t)(e,n)}var Rr=class e extends U{_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===k)return j;let a=Lr(r,n.types,t!==void 0);if(a.length===1){let t=e(a[0])(r,i);return t._tag===`Success`?t:S(t)?zr(n,t.cause,r,i):it(t,e=>zr(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=gr(i?.concurrency),c=Br(o,a,s?{...s,orderedStep:!0}:void 0);return c?T(c,e=>o.out===M?w(r):o.out?o.out:D(new pn(n,o.issues??[],r,i))):o.out?o.out:D(new pn(n,o.issues??[],r,i))}}_rebuild(t,n,r){let i=K(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=vi(t);switch(n._tag){case`Arrays`:{let t=n.elements.filter(B);if(t.length>0)return`${Hr(n.isMutable)}[ ${t.map(t=>e(t)+Ur(t.context?.isOptional)).join(`, `)}, ... ]`;break}case`Objects`:{let t=n.propertySignatures.filter(e=>B(e.type));if(t.length>0)return`{ ${t.map(t=>`${Hr(t.type.context?.isMutable)}${Ce(t.name)}${Ur(t.type.context?.isOptional)}: ${e(t.type)}`).join(`, `)}, ... }`;break}}return e(n)});return Array.from(new Set(n)).join(` | `)}};function zr(e,t,n,r){let i=On(t);return i?Ge(new pn(e,[i],n,r)):qe(t)}const Br=r()({onItem(e,t){return e.compile(t)(e.input,e.options)},step(e,t,n){if(n._tag===`Failure`){let t=On(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),Ge(new mn(e.ast,e.successes,e.input,e.options));if(e.out=n,e.successes)e.successes.push(t);else return Ke}}}),Vr=new Rr([new or(`Infinity`),new or(`-Infinity`),new or(`NaN`)],`anyOf`);function Hr(e){return e?``:`readonly `}function Ur(e){return e?`?`:``}var Wr=class e extends je{_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 Gr([this,e],t)}},Gr=class e extends je{_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 Kr(e,t,n=!1){return new Wr((t,n,r)=>_n(n,e(t,n,r),t,r),t,n)}function qr(e){return Kr(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 Jr=G(fr,[qr()]);function Yr(e,t){let n=e.source,r=new globalThis.RegExp(n,e.flags);return Kr(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 Xr(e,t){let n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}const Zr=new WeakMap;function Qr(e){return Zr.get(e)??e}function W(e,t){return e.encoding===t?e:Xr(e,e=>{e.encoding.value=t})}function $r(e,t){if(e.context===t)return e;let n=Qr(e);if(n.context===t)return n;let r=Xr(e,e=>{e.context.value=t});return Zr.set(r,n),r}function ei(e,t){if(e.checks){let n=e.checks[e.checks.length-1];return ti(e,Ae(e.checks.slice(0,-1),n.annotate(t)))}return Xr(e,e=>{e.annotations.value={...e.annotations.value,...t}})}function ti(e,t){if(e._tag===`Suspend`&&t)throw Error(`Cannot add checks to Suspend`);return e.checks===t?e:Xr(e,e=>{e.checks.value=t})}function G(e,t){return ti(e,Er(e.checks,t))}function ni(e,t){let n=t(e.to);return n===e.to?e:new V(n,e.transformation)}function ri(e,t){let n=e,r=n[n.length-1],i=ni(r,t);return i===r?e:Ae(e.slice(0,e.length-1),i)}function ii(e){return t=>t.encoding?W(t,ri(t.encoding,e)):t}function ai(e,t){function n(r){if(r.encoding){let e=r.encoding[r.encoding.length-1];return t?.stopAt?.(e)?r:W(r,ri(r.encoding,n))}return e(r)}return Pe(n)}function oi(e,t,n){let r=new V(e,t);return W(n,n.encoding?[...n.encoding,r]:[r])}function si(e,t){let n=en(e);return ei(e,{brands:n?[...n,t]:[t]})}function K(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 ci(e,t){return $r(e,e.context?new H(e.context.isOptional,e.context.isMutable,e.context.constructorDefault,{...e.context.annotations,...t}):new H(!1,!1,void 0,t))}const li=Pe(e=>{let t=e.context?e.context.isOptional===!1?new H(!0,e.context.isMutable,e.context.constructorDefault,e.context.annotations):e.context:new H(!0,!1);return ui($r(e,t))}),ui=ii(li),di=y(e=>li(new Rr([e,ir],`anyOf`)));function fi(e,t){let n=new R(Ln(t),Nn()),r=new V(ar,n);return $r(e,e.context?new H(e.context.isOptional,e.context.isMutable,r,e.context.annotations):new H(!1,!1,r))}function pi(e,t,n){return oi(e,n,t)}function mi(e){let t=[],n=[];function r(e){switch(e._tag){case`Literal`:ke(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 hi(e,t){let{literals:n,parameters:r}=mi(e);return new wr(n.map(e=>new br(e,t)),r.map(e=>new Cr(e,t)))}function q(e){return e.context?.isOptional??!1}function gi(e){return e.annotations?.[`~structural`]===!0||e._tag===`FilterGroup`&&e.checks.every(gi)}function _i(e){function t(e){return gi(e)?[e]:e._tag===`FilterGroup`?e.checks.flatMap(t):[]}let n=e.flatMap(t);return _e(n)?n:void 0}const J=Pe(e=>{if(e.encoding)return J(W(e,void 0));let t=e,n=t.recur?.(J)??t,r=n.encodingChecks;if(r){let t=n===e?r:Yn(n)||Xn(n)||Kn(n)&&n.typeParameters.length>0?_i(r):void 0;return Xr(n,e=>{e.encodingChecks.value=void 0,e.checks.value=Er(n.checks,t)})}return n}),vi=Pe(e=>J(bi(e)));function yi(e,t){let n=t,r=n.length,i=n[r-1],a=[new V(bi(W(e,void 0)),n[0].transformation.flip())];for(let e=1;e<r;e++)a.unshift(new V(bi(n[e-1].to),n[e].transformation.flip()));let o=bi(i.to);return o.encoding?W(o,[...o.encoding,...a]):W(o,a)}const bi=y(e=>{if(e.encoding)return yi(e,e.encoding);let t=e;return t.flip?.(bi)??t.recur?.(bi)??t});function xi(e){switch(e._tag){case`Undefined`:return!0;case`Union`:return e.types.some(xi);default:return!1}}function Si(e,t){let n=A(t);return(r,i)=>r===k?j:r===t?n:D(new fn(e,r,i))}function Ci(e,t){return(n,r)=>n===k?j:t(n)?M:D(new fn(e,n,r))}const wi=ai(e=>{switch(e._tag){default:return e;case`Number`:return e.toCodecStringTree();case`Union`:return e.recur(wi)}}),Ti=new globalThis.RegExp(`^${vr}$`),Ei=new globalThis.RegExp(`^(?:${vr}|Infinity|-Infinity|NaN)$`);function Di(e){return Yr(Ti,{expected:`a string representing a finite number`,representation:{id:`effect/schema/isStringFinite`,payload:null},toJsonSchema:()=>({pattern:Ti.source}),...e})}const Oi=G(cr,[Di()]),ki=new V(Oi,Gn),Ai=new V(new Rr([Oi,Vr],`anyOf`),Gn);function Y(e,t,n,r,i){for(let a=0;a<e.length;a++){let o=e[a];if(o._tag===`FilterGroup`){if(n=Y(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 cn(o,e,t,i);if(n?n.push(r):n=[r],i.errors!==`all`||o.aborted)return n}}}return n}function ji(e){if(!Kn(e))return;let t=e.annotations?.[$t];return p(t)?t(e.typeParameters):void 0}const Mi=`~effect/collections/MutableHashMap`,Ni={[Mi]:Mi,[Symbol.iterator](){return this.backing[Symbol.iterator]()},toString(){return`MutableHashMap(${se(Array.from(this))})`},toJSON(){return{_id:`MutableHashMap`,values:c(Array.from(this))}},[u](){return this.toJSON()},pipe(){return x(this,arguments)}},Pi=()=>{let e=Object.create(Ni);return e.backing=new Map,e.buckets=new Map,e},Fi=ue(2,(e,t)=>{if(e.backing.has(t))return v(e.backing.get(t));if(Li(t))return _();let n=Ii.get(e);if(n!==void 0)return e.backing.has(n)?v(e.backing.get(n)):_();let r=m(t),i=e.buckets.get(r);return i===void 0?_():Ri(e,i,t)}),Ii=new WeakMap,Li=e=>typeof e!=`object`&&typeof e!=`function`,Ri=(e,t,n)=>{for(let r=0,i=t.length;r<i;r++)if(ae(n,t[r])){let i=t[r];return Ii.set(n,i),v(e.backing.get(i))}return _()},zi=ue(3,(e,t,n)=>{if(e.backing.has(t)||Li(t))return e.backing.set(t,n),e;let r=Ii.get(e);if(r!==void 0&&e.backing.has(r))return e.backing.set(r,n),e;let i=m(t),a=e.buckets.get(i);return a===void 0?(e.buckets.set(i,[t]),e.backing.set(t,n),e):(r=Bi(a,t),r===void 0&&(a.push(t),r=t),e.backing.set(r,n),e)}),Bi=(e,t)=>{for(let n=0,r=e.length;n<r;n++)if(ae(t,e[n]))return Ii.set(t,e[n]),e[n]},Vi=`~effect/MutableRef`,Hi={[Vi]:Vi,...e,toJSON(){return{_id:`MutableRef`,current:c(this.current)}}},Ui=e=>{let t=Object.create(Hi);return t.current=e,t},Wi=Symbol.for(`effect/MutableList/Empty`),Gi=()=>({head:void 0,tail:void 0,length:0}),Ki=()=>({array:[],mutable:!0,offset:0,next:void 0}),X=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=Ki(),e.tail=e.tail.next):e.head=e.tail=Ki(),e.tail.array.push(t),e.length++},qi=e=>{e.head=e.tail=void 0,e.length=0},Ji=(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 qi(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&&qi(e),n;i=i.next}return qi(e),n},Yi=e=>{if(!e.head)return Wi;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:qi(e)),t},Xi={_A:t,_E:t},Zi={"~effect/Queue":Xi,"~effect/Queue/Enqueue":Xi,"~effect/Queue/Dequeue":Xi,...e,toJSON(){return{_id:`effect/Queue`,state:this.state._tag,size:oa(this)}}},Qi=e=>de(t=>{let n=Object.create(Zi);return n.dispatcher=t.currentDispatcher,n.capacity=e?.capacity??1/0,n.strategy=e?.strategy??`suspend`,n.messages=Gi(),n.scheduleRunning=!1,n.state={_tag:`Open`,takers:new Set,offers:new Set,awaiters:new Set},De(n)}),$i=(e,t)=>we(()=>{if(e.state._tag!==`Open`)return sa;if(e.messages.length>=e.capacity)switch(e.strategy){case`dropping`:return sa;case`suspend`:return e.capacity<=0&&e.state.takers.size>0?(X(e.messages,t),da(e),ca):ma(e,t);case`sliding`:return Yi(e.messages),X(e.messages,t),ca}return X(e.messages,t),fa(e),ca}),ea=(e,t)=>e.state._tag===`Open`?e.messages.length>=e.capacity?e.strategy===`sliding`?(Yi(e.messages),X(e.messages,t),!0):e.capacity<=0&&e.state.takers.size>0&&(X(e.messages,t),da(e),!0):(X(e.messages,t),fa(e),!0):!1,ta=(e,t)=>{if(e.state._tag!==`Open`)return!1;let n=ye(t),r=f(n,la);return e.state.offers.size===0&&e.messages.length===0?(_a(e,r),!0):(e.state={...e.state,_tag:`Closing`,exit:r},!0)},na=e=>ta(e,Oe(te())),ra=e=>Fe(()=>{if(e.state._tag===`Done`)return!0;qi(e.messages);let t=e.state.offers;if(_a(e,e.state._tag===`Open`?ua:e.state.exit),t.size>0){for(let e of t)e._tag===`Single`?e.resume(sa):e.resume(b(e.remaining.slice(e.offset)));t.clear()}return!0}),ia=e=>aa(e,1,1/0),aa=(e,t,n)=>we(()=>pa(e,t,n)??Re(ga(e),aa(e,1,n))),oa=e=>e.state._tag===`Done`?0:e.messages.length,sa=b(!1),ca=b(!0),la=Ie(te()),ua=l(),da=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(le),e.messages.length===0)break}},fa=e=>{e.scheduleRunning||e.state._tag===`Done`||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>da(e),0))},pa=(e,t,n)=>{if(e.state._tag===`Done`)return e.state.exit;if(n<=0||t<=0)return b([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,ha(e),e.capacity=0;let t=[Yi(e.messages)];return ha(e),b(t)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){let t=Ji(e.messages,n);return ha(e),b(t)}},ma=(e,t)=>g(n=>{if(e.state._tag!==`Open`)return n(sa);let r={_tag:`Single`,message:t,resume:n};return e.state.offers.add(r),Fe(()=>{e.state._tag===`Open`&&e.state.offers.delete(r)})}),ha=e=>{if(e.state._tag===`Done`)return mt(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag===`Closing`&&e.messages.length===0&&(_a(e,e.state.exit),mt(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`)X(e.messages,n.message),t--,n.resume(ca),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;X(e.messages,n.remaining[n.offset]),t--}n.resume(b([])),e.state.offers.delete(n)}return!1},ga=e=>g(t=>e.state._tag===`Done`?t(e.state.exit):(e.state.takers.add(t),Fe(()=>{e.state._tag!==`Done`&&e.state.takers.delete(t)}))),_a=(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()},va={"~effect/Channel":{_Env:t,_InErr:t,_InElem:t,_OutErr:t,_OutElem:t},pipe(){return x(this,arguments)}},ya=e=>{let t=Object.create(va);return t.transform=(t,n)=>it(e(t,n),e=>w(st(e))),t},ba=e=>ya((t,n)=>e),xa=e=>e.transform,Sa=(e,t,n)=>Qi({capacity:n?.bufferSize,strategy:n?.strategy}).pipe(tt(t=>pt(e,ra(t))),tt(n=>St(gt(t(n),e),e))),Ca=(e,t)=>ya((n,r)=>xt(Sa(r,e,t),ia)),wa=e=>ya((t,n)=>{let r;return w(Qe(()=>r||e.pipe(gt(n),E(e=>xa(e)(t,n)),E(e=>r=e))))});function Ta(e){let t=Fa(za,J(e.ast));return(e,n)=>t(e,n?.disableChecks?n?.parseOptions?{...n.parseOptions,disableChecks:!0}:{disableChecks:!0}:n?.parseOptions)}function Ea(e){let t=Ta(e);return(e,n)=>{let r=Ze(t(e,n));return We(r)?v(r.value):(kn(r.cause,`Option adapter can only return none for schema issues`),_())}}function Da(e){let t=Ta(e);return(e,n)=>{let r=Ze(t(e,n));if(We(r))return r.value;let i=kn(r.cause,`Constructor adapter can only throw schema issues`);throw Error(`Schema validation failed`,{cause:i})}}function Oa(e){return ka(e.ast)}function ka(e){let t=Ia(Pa(J(e)));return e=>{let n=t(e,Qn);return We(n)?!0:(kn(n.cause,`Type guard adapter can only return false for schema issues`),!1)}}function Aa(e,t){let n=Pa(e.ast);return t===void 0?n:(e,r)=>n(e,Ma(t,r))}function ja(e,t){return La(Aa(e,t))}const Ma=(e,t)=>t?{...e,...t}:e,Na=e=>e===k?D(new I):w(e);function Pa(e){return Fa(Ra,e)}function Fa(e,t){let n;return(r,i)=>{let a=(n??=e(t))(r,i??Qn);return a===M?w(r):S(a)?a[C]===k?Na(k):a:T(a,Na)}}function Ia(e){return(t,n)=>Ze(e(t,n))}function La(e){let t=Ia(e);return(e,n)=>{let r=t(e,n);return We(r)?v(r.value):(kn(r.cause,`Option adapter can only return none for schema issues`),_())}}const Ra=y(e=>Wa(e,Ra)),za=y(e=>Wa(e,za,Va)),Ba=y(e=>Wa(e,za,Va,e.context?.constructorDefault));function Va(e){return e.context?.constructorDefault?Ba(e):za(e)}function Ha(e,t,n,r){let i;if(S(e)&&e._tag===`Success`){let a=nn(e===M?t:e[C]);i=n._tag===`Transformation`?n.decode.run(a,r):n.decode(A(a),r)}else i=n._tag===`Transformation`?T(e,e=>n.decode.run(nn(e),r)):n.decode(et(e,nn),r);return S(i)&&i._tag===`Success`?rn(i[C]):T(i,rn)}function Ua(e,t){let n;return(r,i)=>r===k?j:e.isConstructed(r)?M:Ha((n??=t(e.link.to))(r,i),r,e.link.transformation,i)}function Wa(e,t,n,r){let i=n?ji(e):void 0,a=i?Ua(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,Ma(t,l)):a;let u,d=(t,n)=>{let r=a(t,n);if(c&&!n.disableChecks){if(S(r)){if(r._tag===`Success`){let i=r===M?t:r[C];if(t!==k&&i!==k){let i=Y(c,t,void 0,e,n);i&&(r=D(new F(e,i,t,n)))}}}else r=E(r,r=>{if(t!==k&&r!==k){let r=Y(c,t,void 0,e,n);if(r)return D(new F(e,r,t,n))}return w(r)})}if(o&&!n.disableChecks){if(S(r)){if(r._tag===`Success`){let i=r===M?t:r[C];if(i===k)return r;let a=Y(o,i,void 0,e,n);a&&(r=D(new F(e,a,i,n)))}}else r=E(r,t=>{if(t!==k){let r=Y(o,t,void 0,e,n);if(r)return D(new F(e,r,t,n))}return w(t)})}return r};return s?(n,r)=>{l&&(r=Ma(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=Ha(o,a,s[e].transformation,r),e!==0){let t=i[e-1];o._tag===`Success`?(a=o[C],o=t(a,r)):o=T(o,e=>{let n=t(e,r);return n===M?A(e):n})}if(o._tag===`Success`){let e=o[C],t=d(e,r);return t===M?o:t}return o=it(o,t=>ct(()=>Be(t,t=>new ln(e,t,n,r)))),T(o,e=>{let t=d(e,r);return t===M?A(e):t})}:l?(e,t)=>d(e,Ma(t,l)):d}const Ga=`~effect/Schema/Schema`,Ka={[Ga]:Ga,pipe(){return x(this,arguments)},annotate(e){return this.rebuild(ei(this.ast,e))},annotateKey(e){return this.rebuild(ci(this.ast,e))},check(...e){return this.rebuild(G(this.ast,e))}};function qa(e,t){function n(){}let r=Object.defineProperties(Object.setPrototypeOf(n,Ka),Object.getOwnPropertyDescriptors({...t}));return r.ast=e,r.rebuild=e=>qa(e,t),r.makeEffect=Ta(r),r.make=Da(r),r.makeOption=Ea(r),r}const Ja=e=>e,Ya=Ga;function Xa(e){return t=>t.annotate(e)}const Za=`~effect/SchemaError/SchemaError`;var Qa=class extends Ot(`SchemaError`){[Za]=Za;constructor(e){super({issue:e})}get message(){return Tn(this.issue)}toString(){return`SchemaError(${this.message})`}};function $a(e){return i(e,Za)&&e[Za]===Za}const eo=Oa;function to(e,t){let n=Aa(e,t);return(e,t)=>no(n(e,t))}function no(e){return it(e,e=>ct(()=>Be(e,e=>new Qa(e))))}const ro=to;function io(e,t){let n;for(let r of e.reasons){if(!He(r)||!$a(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 ao(e){let t=Ze(e);if(We(t))return t.value;throw io(t.cause,`Sync adapter can only throw schema errors`)}const oo=ja;function so(e,t){let n=to(e,t);return(e,t)=>ao(n(e,t))}const co=so,Z=qa;function lo(e){return i(e,Ya)&&e[Ya]===Ya}const uo=Ja(e=>{let t=Eo(e);return Z(di(e.ast),{schema:t})}),fo=Ja(e=>Z(J(e.ast),{schema:e}));function po(e){let t=Z(new or(e),{literal:e,transform(n){return t.pipe(ko(po(n),{decode:L(()=>n),encode:L(()=>e)}))}});return t}const mo=Z(ar),ho=Z(tr),go=Z(ir),_o=Z(cr),vo=Z(pr);function yo(e,t){return Z(e,{fields:t,mapFields(e,t){let n=e(this.fields);return yo(Dr(n,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function bo(e){return yo(Dr(e,void 0),e)}function xo(e,t){return Z(hi(e.ast,t.ast),{key:e,value:t})}const So=Ja(e=>Z(new mr(!1,[],[e.ast]),{value:e}));function Co(e,t){return Z(e,{members:t,mapMembers(e,t){let n=e(this.members);return Co(kr(n,this.ast.mode,t?.unsafePreserveChecks?this.ast.checks:void 0),n)}})}function wo(e,t){return Co(kr(e,t?.mode??`anyOf`,void 0),e)}function To(e){let t=e.map(po);return Z(kr(t,`anyOf`,void 0),{literals:e,members:t,mapMembers(e){return wo(e(this.members))},pick(e){return To(e)},transform(e){return wo(t.map((t,n)=>t.transform(e[n])))}})}const Eo=Ja(e=>wo([e,go]));function Do(...e){return t=>t.check(...e)}function Oo(e){return t=>Z(si(t.ast,e),{schema:t,identifier:e})}function ko(e,t){return n=>Z(pi(n.ast,e.ast,t?Hn(t):Wn()),{from:n,to:e})}function Ao(e){return t=>Z(fi(t.ast,e),{schema:t})}function jo(e){return po(e).pipe(Ao(w(e)))}function Mo(e,t){return bo({_tag:jo(e),...t})}const No=Kr;function Po(e,t){return e=Math.max(0,Math.floor(e)),No(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 Fo(e){return Po(1,e)}globalThis.RegExp,globalThis.URL,globalThis.File,globalThis.FormData,globalThis.URLSearchParams,globalThis.Uint8Array;const Io=globalThis.Symbol.for(`immer-draftable`),Lo={};function Ro(e,t,n,r,i){let a=Vo(n,t,r),o=Bo(t),s=class extends e{constructor(...[e,t]){let r=t?.[`~payload`],i=r?.token===Lo?r.value:n.make(e??{},t);super(i,{...t,disableChecks:!0,"~payload":{token:Lo,value:i}})}static[Ya]=Ya;get[o](){return o}static[Io]=!0;static identifier=t;static fields=n.fields;static get ast(){return a(this).ast}static pipe(){return x(this,arguments)}static rebuild(e){return a(this).rebuild(e)}static make(e,t){return new this(e,t)}static makeOption(e,t){return Ea(a(this))(e??{},t)}static makeEffect(e,t){return a(this).makeEffect(e??{},t)}static annotate(e){return this.rebuild(ei(this.ast,e))}static annotateKey(e){return this.rebuild(ci(this.ast,e))}static check(...e){return this.rebuild(G(this.ast,e))}static extend(e){return(t,r)=>{let a=Ho(t)?t:bo(t),o={...n.fields,...a.fields},s=Dr(o,n.ast.checks,{identifier:e});return Ro(this,e,yo(G(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 zo(e){return new R(L(t=>new e(t,{"~payload":{token:Lo,value:t}})),Nn())}function Bo(e){return`~effect/Schema/Class/${e}`}function Vo(e,t,n){let r;return a=>{if(r!==void 0)return r;let o=Bo(t),s=e=>e instanceof a||i(e,o),c=zo(a);return r=ko(Z(new er([e.ast],()=>(e,t,n)=>s(e)?w(e):D(new fn(t,e,n)),{identifier:t,[$t]:([e])=>({isConstructed:s,link:new V(e,c)}),toCodec:([e])=>new V(e.ast,c),toArbitrary:([e])=>()=>({arbitrary:e.arbitrary.map(e=>new a(e)),terminal:e.terminal?.map(e=>new a(e))}),toFormatter:([e])=>t=>`${a.identifier}(${e(t)})`,[Qt]:Mr(e.ast),...n})),c)(e)}}function Ho(e){return lo(e)}const Uo=e=>(t,n)=>{let r=Ho(t)?t:bo(t);return Ro(Et,e,r,n,e=>({toString(){return`${e}(${se({...this})})`}}))},Wo=e=>(t,n,r)=>{let i=Ho(n)?n.mapFields(e=>({_tag:jo(t),...e}),{unsafePreserveChecks:!0}):Mo(t,n);return Uo(e??t)(i,r)},Go=`~effect/platform/PlatformError`;var Ko=class extends Ot(`BadArgument`){get message(){return`${this.module}.${this.method}${this.description?`: ${this.description}`:``}`}},qo=class extends Dt{get message(){return`${this._tag}: ${this.module}.${this.method}${this.pathOrDescriptor===void 0?``:` (${this.pathOrDescriptor})`}${this.description?`: ${this.description}`:``}`}},Jo=class extends Ot(`PlatformError`){constructor(e){`cause`in e?super({reason:e,cause:e.cause}):super({reason:e})}[Go]=Go;get message(){return this.reason.message}};const Yo=e=>new Jo(new qo(e)),Xo=e=>new Jo(new Ko(e)),Zo={"~effect/Stream":{_R:t,_E:t,_A:t},pipe(){return x(this,arguments)}},Qo=e=>{let t=Object.create(Zo);return t.channel=e,t},$o=w([void 0]),es={"~effect/Sink":{_A:t,_In:t,_L:t,_E:t,_R:t},pipe(){return x(this,arguments)}},ts=e=>ns((t,n)=>xa(e)(t,n).pipe(E(at({disableYield:!0})),yt(w))),ns=e=>{let t=Object.create(es);return t.transform=e,t},rs=e=>ya((t,n)=>w(E(e.transform(t,n),Ve))),is=e=>as(Ct(t=>e(t),{discard:!0})),as=e=>ns(t=>t.pipe(E(e),at({disableYield:!0}),yt(()=>$o))),os=e=>ts(wa(xt(e,rs))),ss=Qo,cs=e=>ss(ba(e)),ls=e=>e.channel,us=(e,t)=>ss(Ca(e,t)),ds=e=>ss(wa(xt(e,ls))),fs=`~effect/platform/FileSystem`,ps=e=>typeof e==`bigint`?e:BigInt(e),ms=BigInt(1024);ms*ms*ms*ms*ms;const hs=be(`effect/platform/FileSystem`),gs=e=>hs.of({...e,[fs]:fs,exists:t=>Te(e.access(t),vt(!0),ht(`PlatformError`,e=>e.reason._tag===`NotFound`?w(!1):D(e))),readFileString:(t,n)=>E(e.readFile(t),e=>$e({try:()=>new TextDecoder(n).decode(e),catch:e=>Xo({module:`FileSystem`,method:`readFileString`,description:`invalid encoding`,cause:e})})),stream:rt(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:ps(n.bytesToRead),a=BigInt(0),o=ps(n?.chunkSize??65536),s=r.readAlloc(o);return cs(w(E(Qe(()=>i!==void 0&&i<=a?Ve():i!==void 0&&i-a<o?r.readAlloc(i-a):s),ie({onNone:()=>Ve(),onSome:e=>(a+=BigInt(e.length),w(ve(e)))}))))},ds),sink:(t,n)=>Te(e.open(t,{flag:`w`,...n}),xt(e=>is(t=>e.writeAll(t))),os),writeFileString:(t,n,r)=>E($e({try:()=>new TextEncoder().encode(n),catch:e=>Xo({module:`FileSystem`,method:`writeFileString`,description:`could not encode string`,cause:e})}),n=>e.writeFile(t,n,r))}),_s=`~effect/platform/FileSystem/File`;var vs=class extends be()(`effect/platform/FileSystem/WatchBackend`){};const ys=`~effect/platform/Path`,bs=be(`effect/Path`);function xs(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 Ss(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 Cs(e){if(e.protocol!==`file:`)return D(new Ko({module:`Path`,method:`fromFileUrl`,description:`URL must be of scheme file`}));if(e.hostname!==``)return D(new Ko({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 D(new Ko({module:`Path`,method:`fromFileUrl`,description:`must not include encoded / characters`}))}return w(decodeURIComponent(t))}const ws=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=xs(e,!t),t?e.length>0?`/`+e:`/`:e.length>0?e:`.`};function Ts(e){let t=new URL(`file://`),n=ws(e);return e.charCodeAt(e.length-1)===47&&n[n.length-1]!==`/`&&(n+=`/`),t.pathname=js(n),w(t)}const Es=/%/g,Ds=/\\/g,Os=/\n/g,ks=/\r/g,As=/\t/g;function js(e){return e.includes(`%`)&&(e=e.replace(Es,`%25`)),e.includes(`\\`)&&(e=e.replace(Ds,`%5C`)),e.includes(`
3
+ `)&&(e=e.replace(Os,`%0A`)),e.includes(`\r`)&&(e=e.replace(ks,`%0D`)),e.includes(` `)&&(e=e.replace(As,`%09`)),e}const Ms=bs.of({[ys]:ys,resolve:ws,normalize(e){if(e.length===0)return`.`;let t=e.charCodeAt(0)===47,n=e.charCodeAt(e.length-1)===47;return e=xs(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?`.`:Ms.normalize(e)},relative(e,t){if(e===t||(e=Ms.resolve(e),t=Ms.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 Ss(`/`,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:Cs,toFileUrl:Ts,toNamespacedPath:t}),Ns=ot(bs)(Ms),Ps={"~effect/Ref":{_A:t},...e,toJSON(){return{_id:`Ref`,ref:this.ref}}},Fs=e=>{let t=Object.create(Ps);return t.ref=Ui(e),t},Is=e=>nt(()=>Fs(e)),Ls=e=>nt(()=>e.ref.current),Rs=ue(2,(e,t)=>nt(()=>{e.ref.current=t(e.ref.current)}));function zs(e){return e.map(e=>e.length===0||e.match(/[^A-Za-z0-9_-]/)?JSON.stringify(e):e).join(`.`)}var Bs=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=>`${zs([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`[${zs(e)}]`}#c(e){return`[[${zs(e)}]]`}#l(e){let t=zs(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 Vs(e,t){return new Bs(e).dump(t).join(`
4
+ `)}const Hs={arrays:`merge`,sets:`merge`,maps:`merge`};function Us(e,t,n){return Ws(e,t,new Set,n??Hs)}function Ws(e,t,n,r){let i={},a=new Set([...Ys(e),...Ys(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(Js(a)&&Js(s)&&!n.has(a)&&!n.has(s)){n.add(a),n.add(s),i[o]=Gs(a,s,n,r);continue}i[o]=s}return i}function Gs(e,t,n,r){if(Ks(e)&&Ks(t))return Ws(e,t,n,r);if(qs(e)&&qs(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 Ks(e){return Object.getPrototypeOf(e)===Object.prototype}function qs(e){return typeof e[Symbol.iterator]==`function`}function Js(e){return typeof e==`object`&&!!e}function Ys(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 Xs(e){return e%4==0&&e%100!=0||e%400==0}var Zs=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()===`
5
+ `||this.startsWith(`\r
6
+ `)}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 Q(e){return{ok:!0,body:e}}function $(){return{ok:!1}}function Qs(e,t={__proto__:null}){return e.reduceRight((e,t)=>({[t]:e}),t)}function $s(e){return typeof e==`object`&&!!e}function ec(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 tc(e,t){let{keys:n,type:r,value:i}=t,a=ec(e,n);if(a===void 0)return Object.assign(e,Qs(n,i));if(Array.isArray(a))return rc(a.at(-1),{type:r,keys:n.slice(1),value:i}),e;if($s(a))return rc(a,{type:r,keys:n.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function nc(e,t){let{type:n,keys:r,value:i}=t,a=ec(e,r);if(a===void 0)return Object.assign(e,Qs(r,[i]));if(Array.isArray(a))return t.keys.length===1?a.push(i):rc(a.at(-1),{type:t.type,keys:t.keys.slice(1),value:t.value}),e;if($s(a))return rc(a,{type:n,keys:r.slice(1),value:i}),e;throw Error(`Unexpected assign`)}function rc(e,t){switch(t.type){case`Block`:return Us(e,t.value);case`Table`:return tc(e,t);case`TableArray`:return nc(e,t)}}function ic(e){return t=>{for(let n of e){let e=n(t);if(e.ok)return e}return $()}}function ac(e,t){let n=dc(t);return r=>{let i=[],a=e(r);if(!a.ok)return Q(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 Q(i)}}function oc(e,t){let n=dc(t);return r=>{let i=e(r);if(!i.ok)return $();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 Q(a)}}function sc(e,t,n){let r=dc(t);return i=>{let a=i.position,o=e(i);if(!o.ok)return $();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(`
7
+ `,i.position),t=e>0?e:i.source.length,n=i.source.slice(a,t);throw SyntaxError(`Cannot parse value on line '${n}'`)}return Q(Qs(o.body,s.body))}}function cc(e){return t=>{let n=e(t);if(!n.ok)return $();let r={__proto__:null};for(let e of n.body)typeof e==`object`&&e&&(r=Us(r,e));return Q(r)}}function lc(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?$():Q(n)}}function uc(e,t,n){let r=dc(e),i=dc(n);return a=>{if(!r(a).ok)return $();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 Q(o.body)}}function dc(e){return t=>(t.skipWhitespaces(),t.startsWith(e)?(t.next(e.length),t.skipWhitespaces(),Q(void 0)):$())}const fc=/[A-Za-z0-9_-]+/y;function pc(e){e.skipWhitespaces();let t=e.match(fc)?.[0];return t?(e.next(t.length),Q(t)):$()}function mc(e){if(e.char()!==`\\`)return $();switch(e.next(),e.char()){case`b`:return e.next(),Q(`\b`);case`t`:return e.next(),Q(` `);case`n`:return e.next(),Q(`
8
+ `);case`f`:return e.next(),Q(`\f`);case`r`:return e.next(),Q(`\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),Q(r)}case`"`:return e.next(),Q(`"`);case`\\`:return e.next(),Q(`\\`);default:throw SyntaxError(`Invalid escape sequence: \\${e.char()}`)}}function hc(e){if(e.skipWhitespaces(),e.char()!==`"`)return $();e.next();let t=[];for(;e.char()!==`"`&&!e.eof();){if(e.char()===`
9
+ `)throw SyntaxError(`Single-line string cannot contain EOL`);let n=mc(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(),Q(t.join(``))}function gc(e){if(e.skipWhitespaces(),e.char()!==`'`)return $();e.next();let t=[];for(;e.char()!==`'`&&!e.eof();){if(e.char()===`
10
+ `)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(),Q(t.join(``))}function _c(e){if(e.skipWhitespaces(),!e.startsWith(`"""`))return $();e.next(3),e.char()===`
11
+ `?e.next():e.startsWith(`\r
12
+ `)&&e.next(2);let t=[];for(;!e.startsWith(`"""`)&&!e.eof();){if(e.startsWith(`\\
13
+ `)){e.next(),e.nextUntilChar({skipComments:!1});continue}if(e.startsWith(`\\\r
14
+ `)){e.next(),e.nextUntilChar({skipComments:!1});continue}let n=mc(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),Q(t.join(``))}function vc(e){if(e.skipWhitespaces(),!e.startsWith(`'''`))return $();e.next(3),e.char()===`
15
+ `?e.next():e.startsWith(`\r
16
+ `)&&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),Q(t.join(``))}const yc=/(?:true|false)\b/y;function bc(e){e.skipWhitespaces();let t=e.match(yc);if(!t)return $();let n=t[0];return e.next(n.length),Q(n===`true`)}const xc=new Map([[`inf`,1/0],[`+inf`,1/0],[`-inf`,-1/0]]),Sc=/[+-]?inf\b/y;function Cc(e){e.skipWhitespaces();let t=e.match(Sc);if(!t)return $();let n=t[0];return e.next(n.length),Q(xc.get(n))}const wc=/[+-]?nan\b/y;function Tc(e){e.skipWhitespaces();let t=e.match(wc);if(!t)return $();let n=t[0];return e.next(n.length),Q(NaN)}const Ec=oc(ic([pc,hc,gc]),`.`),Dc=/0b[01]+(?:_[01]+)*\b/y;function Oc(e){e.skipWhitespaces();let t=e.match(Dc)?.[0];if(!t)return $();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,2);return isNaN(r)?$():Q(r)}const kc=/0o[0-7]+(?:_[0-7]+)*\b/y;function Ac(e){e.skipWhitespaces();let t=e.match(kc)?.[0];if(!t)return $();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,8);return isNaN(r)?$():Q(r)}const jc=/0x[0-9a-f]+(?:_[0-9a-f]+)*\b/iy;function Mc(e){e.skipWhitespaces();let t=e.match(jc)?.[0];if(!t)return $();e.next(t.length);let n=t.slice(2).replaceAll(`_`,``),r=parseInt(n,16);return isNaN(r)?$():Q(r)}const Nc=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)\b/y;function Pc(e){e.skipWhitespaces();let t=e.match(Nc)?.[0];if(!t)return $();e.next(t.length);let n=t.replaceAll(`_`,``);return Q(parseInt(n,10))}const Fc=/[+-]?(?:0|[1-9][0-9]*(?:_[0-9]+)*)(?:\.[0-9]+(?:_[0-9]+)*)?(?:e[+-]?[0-9]+(?:_[0-9]+)*)?\b/iy;function Ic(e){e.skipWhitespaces();let t=e.match(Fc)?.[0];if(!t)return $();e.next(t.length);let n=t.replaceAll(`_`,``),r=parseFloat(n);return isNaN(r)?$():Q(r)}const Lc=/(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})(?:[ 0-9TZ.:+-]+)?\b/y;function Rc(e){e.skipWhitespaces();let t=e.match(Lc);if(!t)return $();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&&!Xs(n))throw SyntaxError(`Invalid date string "${t}"`)}let i=new Date(n.trim());if(isNaN(i.getTime()))throw SyntaxError(`Invalid date string "${t}"`);return Q(i)}const zc=/(\d{2}):(\d{2}):(\d{2})(?:\.[0-9]+)?\b/y;function Bc(e){e.skipWhitespaces();let t=e.match(zc)?.[0];return t?(e.next(t.length),Q(t)):$()}function Vc(e){if(e.skipWhitespaces(),e.char()!==`[`)return $();e.next();let t=[];for(;!e.eof();){e.nextUntilChar();let n=Uc(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(),Q(t)}function Hc(e){if(e.nextUntilChar(),e.char(1)===`}`)return e.next(2),Q({__proto__:null});let t=uc(`{`,ac(Wc,`,`),`}`)(e);if(!t.ok)return $();let n={__proto__:null};for(let e of t.body)n=Us(n,e);return Q(n)}const Uc=ic([_c,vc,hc,gc,bc,Cc,Tc,Rc,Bc,Oc,Ac,Mc,Ic,Pc,Vc,Hc]),Wc=sc(Ec,`=`,Uc);function Gc(e){e.nextUntilChar();let t=cc(lc(Wc))(e);return t.ok?Q({type:`Block`,value:t.body}):$()}const Kc=uc(`[`,Ec,`]`);function qc(e){e.nextUntilChar();let t=Kc(e);if(!t.ok)return $();e.nextUntilChar();let n=Gc(e);return Q({type:`Table`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}const Jc=uc(`[[`,Ec,`]]`);function Yc(e){e.nextUntilChar();let t=Jc(e);if(!t.ok)return $();e.nextUntilChar();let n=Gc(e);return Q({type:`TableArray`,keys:t.body,value:n.ok?n.body.value:{__proto__:null}})}function Xc(e){let t=lc(ic([Gc,Yc,qc]))(e);return t.ok?Q(t.body.reduce(rc,{__proto__:null})):Q({__proto__:null})}function Zc(e,t){let n=e.source.slice(0,e.position).split(`
17
+ `);return`Parse error on line ${n.length}, column ${n.at(-1)?.length??0}: ${t}`}function Qc(e){return t=>{let n=new Zs(t);try{let t=e(n);if(t.ok&&n.eof())return t.body;let r=`Unexpected character: "${n.char()}"`;throw SyntaxError(Zc(n,r))}catch(e){throw e instanceof Error?SyntaxError(Zc(n,e.message)):SyntaxError(Zc(n,`Invalid error type caught`))}}}function $c(e){return Qc(Xc)(e)}const el=xo(_o.pipe(Do(No(e=>e!==`__proto__`))),So(_o)).pipe(Oo(`TomlConfig`)),tl=e=>new I({message:e instanceof Error?`TOML parse error: ${e.message}`:`TOML parse error`});_o.pipe(ko(fo(el),{decode:Fn(e=>$e({try:()=>$c(e),catch:tl}).pipe(E(e=>to(el)(e)),Xe(e=>$a(e)?e.issue:e))),encode:L(e=>Vs(e))}));const nl=`systemfsoftware.toml`,rl=co(el)({});var il=class extends be()(`@systemfsoftware/omp-utils/TomlLoader`){};const al=e=>{let t={};for(let n of e)for(let[e,r]of Object.entries(n))t[e]=r;return t},ol=e=>$e({try:()=>$c(e),catch:e=>new I({message:e instanceof Error?`TOML parse error: ${e.message}`:`TOML parse error`})}).pipe(E(e=>to(el)(e))),sl=(e,t,n)=>e.exists(n).pipe(E(t=>t?e.readFileString(n).pipe(E(ol),Je(()=>rl)):w(rl))),cl=ut(il,E(nt(()=>{let e=process.env.OMP_USER_CONFIG_HOME;return typeof e==`string`&&e.length>0?e:wt.homedir()}),e=>Ye(function*(){let t=yield*Is(Pi()),n=yield*hs,r=yield*bs,i=r.join(e,`.config/systemfsoftware`,nl);return il.of({load:lt(`TomlLoader.load`)(function*(e){let a=yield*Ls(t),o=Fi(a,e);if(oe(o))return o.value;let s=r.join(e,nl),c=r.join(e,`systemfsoftware.local.toml`),l=yield*sl(n,r,i),u=yield*sl(n,r,s),d=yield*sl(n,r,c),f=yield*ro(el)(al([l,u,d])).pipe(dt);return yield*Rs(t,t=>(zi(t,e,f),t)),f})})}))),ll=So(bo({old_text:uo(mo),new_text:uo(mo)}).pipe(Do(No(e=>`old_text`in e||`new_text`in e)))).pipe(Do(Fo())),ul=So(bo({old_string:uo(mo),new_string:uo(mo)}).pipe(Do(No(e=>`old_string`in e||`new_string`in e))));eo(ll),eo(ul),oo(xo(_o,mo));export{na as C,ea as E,Xa as S,$i as T,xo as _,_s as a,Wo as b,gs as c,Xo as d,Yo as f,ho as g,To as h,hs as i,us as l,vo as m,cl as n,ps as o,So as p,Ns as r,vs as s,il as t,ds as u,_o as v,ta as w,wo as x,bo as y};