@shadowclone/cli 0.0.34 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/shadowclone.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
|
-
var d2=Object.defineProperty;var u2=(e)=>e;function p2(e,t){this[e]=u2.bind(null,t)}var am=(e,t)=>{for(var r in t)d2(e,r,{get:t[r],enumerable:!0,configurable:!0,set:p2.bind(t,r)})};var y=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Ek=(e)=>JSON.parse(e);var kr;var fi=y(()=>{kr={name:"@shadowclone/cli",version:"0.0.34"}});function _s(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function cm(e,t="|"){return e.map((r)=>pm(r)).join(t)}function Is(e,t){if(typeof t==="bigint")return t.toString();return t}class $k{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Os(e){return new $k(e)}function Ck(e){return e===null||e===void 0}function Ic(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _k(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function It(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function As(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Mr(e){return As(e._zod.def)??e._zod.def.shape}function Ik(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return It(this,t,n),n},enumerable:!0,configurable:!0})}function Ok(e,t,r){if(t in e)It(e,t,r);else e[t]=r}function Qn(e,t,r,n){let o=Mr(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)Ik(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a});else Ok(e,i,n?n(s.value,i):s.value)}}function f2(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)Ik(e,r,()=>t[r]);else Ok(e,r,n.value)}}function Ot(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Ak(e){return JSON.stringify(e)}function Lk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function gi(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function eo(e){if(gi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(gi(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function um(e){if(eo(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xr(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function q(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function pm(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Tk(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function g2(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return Qn(i,e,Ac(e,t)),xr(e,Ot(r,{shape:i,checks:[]}))}function Ac(e,t){let r=Mr(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function y2(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Ac(e,t)),s={};return Qn(s,e,Reflect.ownKeys(Mr(e)).filter((a)=>!i.has(a))),xr(e,Ot(r,{shape:s,checks:[]}))}function h2(e,t){if(!eo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Mr(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xr(e,Ot(e._zod.def,{shape:Nk(e,t)}))}function Nk(e,t){let r={};return Qn(r,e,Reflect.ownKeys(Mr(e))),f2(r,t),r}function w2(e,t){if(!eo(t))throw Error("Invalid input to safeExtend: expected a plain object");return xr(e,Ot(e._zod.def,{shape:Nk(e,t)}))}function b2(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Qn(r,e,Reflect.ownKeys(Mr(e))),Qn(r,t,Reflect.ownKeys(Mr(t)));let n=Ot(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xr(e,n)}function zk(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Ac(t,r)):void 0,l={};return Qn(l,t,Reflect.ownKeys(Mr(t)),e&&((c,d)=>a&&!a.has(d)?c:new e({type:"optional",innerType:c}))),xr(t,Ot(t._zod.def,{shape:l,checks:[]}))}function v2(e,t,r){let n=r?new Set(Ac(t,r)):void 0,o={};return Qn(o,t,Reflect.ownKeys(Mr(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),xr(t,Ot(t._zod.def,{shape:o}))}function Vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Fk(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Sr(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Cs(e){return typeof e==="string"?e:e?.message}function fm(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Pr(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Cs(e.inst?._zod.def?.error?.(e))??Cs(i?.(e))??Cs(t?.error?.(e))??Cs(r.customError?.(e))??Cs(r.localeError?.(e))??"Invalid input",a={};for(let l of Object.keys(e)){if(l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__")continue;a[l]=e[l]}if(a.path??(a.path=[]),a.message=s,t?.reportInput)a.input=e.input;return a}function Lc(e){let t=e.length;if(!k2.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function jc(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Mk(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function to(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Bk(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else x2(e,r,n.value)}}function Br(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Dc(e,t,r){return Br(e,t,r,!1)}function Uk(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Br(this,r,n(this))},set(o){Br(this,r,o)}})}return t}function x2(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Br(this,t,r.bind(this))},set(n){Br(this,t,n)}})}function S2(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function oe(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&lm!==e._zod){lm=void 0;return}lm=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,P2);let o=mn;mn=!1;try{let i=r(this);if(mn)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return mn=mn||o,i}catch(i){throw delete this[t],mn=mn||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function R2(e,t,r,n){let o=S2(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}function qk(e){let t=()=>e;return t[E2]=!0,t}var dm,jk,Dk,Oc,mm,k2,lm,mn=!1,P2,E2="~constantCatch";var ht=y(()=>{ro();dm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};jk=Os(()=>{if(at.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});Dk=new Set(["string","number","symbol"]);Oc=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),mm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};k2=/[\uD800-\uDBFF]/;P2={configurable:!0,get(){mn=!0;return}}});function $2(e){let t=Gk;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Gk=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function R(e,t,r,n){let o={};function i(m){this.def=m,this.constr=u,this.traits=new Set}i.prototype=o;let s=r,a=s&&new WeakSet;function l(m,f){if(!m._zod){gm.value=new i(f);try{Object.defineProperty(m,"_zod",gm)}finally{gm.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,f),a){let h=Object.getPrototypeOf(m),w=m._zod.constr.prototype,x=h;while(x&&x!==w)x=Object.getPrototypeOf(x);let C=x??h;if(!a.has(C))a.add(C),Bk(C,s)}let g=u.prototype;for(let h in g){if(!Object.prototype.hasOwnProperty.call(g,h))continue;if(!(h in m))m[h]=g[h].bind(m)}}let c=n?.Parent??Object;class d extends c{}Object.defineProperty(d,"name",{value:e});function u(m){let f=n?.Parent?$2(d):this;l(f,m);let g=f._zod.deferred;if(g){for(let w of g)w();f._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;if(h)h(f);return f}return Object.defineProperty(u,"init",{value:l}),Object.defineProperty(u,Symbol.hasInstance,{value:(m)=>{if(n?.Parent&&m instanceof n.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}function At(e){if(e)Object.assign(at,e);return at}var Hk,gm,Gk,Rr,Ls,at;var ro=y(()=>{ht();gm={value:void 0,enumerable:!1},Gk="captureStackTrace"in Error?Error:null;Rr=class Rr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};Ls=class Ls extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}};(Hk=globalThis).__zod_globalConfig??(Hk.__zod_globalConfig={});at=globalThis.__zod_globalConfig});function C2(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Is,2)),e.message}function _2(e){this._zod.message=e}function O2(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Vk(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)O2(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Jk(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let l=r,c=0;while(c<a.length){let d=a[c],u=c===a.length-1;if(d==="_errors"){if(u)l._errors.push(t(s));c++;continue}if(!Object.prototype.hasOwnProperty.call(l,d))Object.defineProperty(l,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=l[d];if(u)m._errors.push(t(s));l=m,c++}}}};return n(e),r}var I2,hm,Wk,Zk=(e,t)=>{e.name="$ZodError",hm.value=t,Object.defineProperty(e,"issues",hm),hm.value=void 0,Object.defineProperty(e,"message",I2);let r=Object.getPrototypeOf(e);if(!Wk.has(r))Wk.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Kk,lY;var Yk=y(()=>{ro();ht();I2={get:C2,set:_2,enumerable:!0,configurable:!0},hm={value:void 0,enumerable:!1},Wk=new WeakSet([Object.prototype,Error.prototype]),Kk=R("$ZodError",Zk),lY=R("$ZodError",Zk,void 0,{Parent:Error})});function Tc(e,t){return{callee:t?.callee??e,Err:t?.Err}}function Xk(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>Pr(o,r,At()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}function j2(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[L2]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new Rr;return i.issues.length===0}var Nc=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new Rr;if(a.issues.length){let l=new(i?.Err??e)(a.issues.map((c)=>Pr(c,s,At())));throw dm(l,i?.callee??t),l}return a.value};return t},zc=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let l=new(i?.Err??e)(a.issues.map((c)=>Pr(c,s,At())));throw dm(l,i?.callee??t),l}return a.value};return t},Fc=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Rr;return i.issues.length?Xk(e,i.issues,o):{success:!0,data:i.value}},Mc=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Xk(e,i.issues,o):{success:!0,data:i.value}},A2,L2,wm=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==A2)return!0;if(n.definite===!0&&r===void 0)return!1}return j2(e,t,r)},bm=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Qk=(e)=>{let t=Nc(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Tc(r,s))};return r},ex=(e)=>{let t=Nc(e),r=(n,o,i,s)=>t(n,o,i,Tc(r,s));return r},tx=(e)=>{let t=zc(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Tc(r,s))};return r},rx=(e)=>{let t=zc(e),r=async(n,o,i,s)=>await t(n,o,i,Tc(r,s));return r},nx=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Fc(e)(t,r,o)},ox=(e)=>(t,r,n)=>Fc(e)(t,r,n),ix=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Mc(e)(t,r,o)},sx=(e)=>async(t,r,n)=>Mc(e)(t,r,n);var ax=y(()=>{ro();ht();A2=Symbol.for("zod.compile.invalid"),L2=Symbol.for("zod.compile.fallback")});function fx(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function wx(){return new RegExp(D2,"u")}function T2(e){return new RegExp(`^${e}$`)}function vm(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _x(e){return new RegExp(`^${vm(e)}$`)}function Ix(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${vm({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${vm({precision:e.precision})}`:r;return new RegExp(`^${$x}T(?:${n})$`)}var lx,cx,dx,ux,px,mx,gx,yx,km=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},hx,D2="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",bx,vx,kx,xx,Sx,Px,Rx,Ex,$x="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Cx,Ox,xm,js,Ax,Lx,jx,Dx;var Ts=y(()=>{lx=/^[cC][0-9a-z]{6,}$/,cx=/^[0-9a-z]+$/,dx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ux=/^[0-9a-vA-V]{20}$/,px=/^[A-Za-z0-9]{27}$/,mx=/^[a-zA-Z0-9_-]{21}$/;gx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yx=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;bx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,kx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Px=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rx=/^https?$/,Ex=/^\+[1-9]\d{6,14}$/;Cx=T2($x);Ox=/^[\s\S]{0,}$/,xm=/^-?\d+$/,js=/^-?\d+(?:\.\d+)?$/,Ax=/^(?:true|false)$/i,Lx=/^null$/i,jx=/^[^A-Z]*$/,Dx=/^[^a-z]*$/});var Ge,Sm=(e)=>{let t=e.value;return!Ck(t)&&t.length!==void 0},Bc,Pm,Rm,Tx,Nx,zx,Fx,Mx,Ns,Bx,Ux,qx,Hx,Gx,Wx,Zx;var Uc=y(()=>{ro();Ts();ht();Ge=R("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Bc={number:"number",bigint:"bigint",object:"date"},Pm=R("$ZodCheckLessThan",(e,t)=>{Ge.init(e,t);let r=Bc[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Bc[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rm=R("$ZodCheckGreaterThan",(e,t)=>{Ge.init(e,t);let r=Bc[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Bc[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tx=R("$ZodCheckMultipleOf",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):_k(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Nx=R("$ZodCheckNumberFormat",(e,t)=>{Ge.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Oc[t.format];e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(a<o)s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),zx=R("$ZodCheckMaxLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Lc(o):i)<=t.maximum)return;let a=jc(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fx=R("$ZodCheckMinLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Lc(o):i)>=t.minimum)return;let a=jc(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mx=R("$ZodCheckLengthEquals",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Lc(o):i;if(s===t.length)return;let a=jc(o),l=s>t.length;n.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ns=R("$ZodCheckStringFormat",(e,t)=>{var r,n;if(Ge.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Bx=R("$ZodCheckRegex",(e,t)=>{Ns.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ux=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jx),Ns.init(e,t)}),qx=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Dx),Ns.init(e,t)}),Hx=R("$ZodCheckIncludes",(e,t)=>{Ge.init(e,t);let r=fn(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Gx=R("$ZodCheckStartsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`^${fn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Wx=R("$ZodCheckEndsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`.*${fn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zx=R("$ZodCheckOverwrite",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}})});class Em{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
3
|
+
var d2=Object.defineProperty;var u2=(e)=>e;function p2(e,t){this[e]=u2.bind(null,t)}var am=(e,t)=>{for(var r in t)d2(e,r,{get:t[r],enumerable:!0,configurable:!0,set:p2.bind(t,r)})};var y=(e,t,r)=>()=>{if(e)try{t=e(e=0)}catch(n){r=[n]}if(r)throw r[0];return t};var Ek=(e)=>JSON.parse(e);var kr;var fi=y(()=>{kr={name:"@shadowclone/cli",version:"0.0.35"}});function _s(e){let t=Object.values(e).filter((n)=>typeof n==="number");return Object.entries(e).filter(([n,o])=>t.indexOf(+n)===-1).map(([n,o])=>o)}function cm(e,t="|"){return e.map((r)=>pm(r)).join(t)}function Is(e,t){if(typeof t==="bigint")return t.toString();return t}class $k{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;if(e!==void 0)this._value=e(),this._getter=void 0;return this._value}}function Os(e){return new $k(e)}function Ck(e){return e===null||e===void 0}function Ic(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function _k(e,t){let r=e/t,n=Math.round(r),o=4*Number.EPSILON*Math.max(Math.abs(r),1);if(Math.abs(r-n)<o)return 0;return r-n}function It(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function As(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Mr(e){return As(e._zod.def)??e._zod.def.shape}function Ik(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return It(this,t,n),n},enumerable:!0,configurable:!0})}function Ok(e,t,r){if(t in e)It(e,t,r);else e[t]=r}function Qn(e,t,r,n){let o=Mr(t);for(let i of r){let s=Object.getOwnPropertyDescriptor(o,i);if(!s.enumerable)continue;if(s.get)Ik(e,i,()=>{let a=t._zod.def.shape[i];return n?n(a,i):a});else Ok(e,i,n?n(s.value,i):s.value)}}function f2(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)Ik(e,r,()=>t[r]);else Ok(e,r,n.value)}}function Ot(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function Ak(e){return JSON.stringify(e)}function Lk(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function gi(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}function eo(e){if(gi(e)===!1)return!1;let t=e.constructor;if(t===void 0)return!0;if(typeof t!=="function")return!0;let r=t.prototype;if(gi(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function um(e){if(eo(e))return{...e};if(Array.isArray(e))return[...e];if(e instanceof Map)return new Map(e);if(e instanceof Set)return new Set(e);return e}function fn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function xr(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function q(e){let t=e;if(!t)return{};if(typeof t==="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}if(delete t.message,typeof t.error==="string")return{...t,error:()=>t.error};return t}function pm(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function Tk(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}function g2(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i={};return Qn(i,e,Ac(e,t)),xr(e,Ot(r,{shape:i,checks:[]}))}function Ac(e,t){let r=Mr(e),n=[];for(let o of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(r,o)?.enumerable)throw Error(`Unrecognized key: "${String(o)}"`);if(t[o])n.push(o)}return n}function y2(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=new Set(Ac(e,t)),s={};return Qn(s,e,Reflect.ownKeys(Mr(e)).filter((a)=>!i.has(a))),xr(e,Ot(r,{shape:s,checks:[]}))}function h2(e,t){if(!eo(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Mr(e);for(let i of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,i)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return xr(e,Ot(e._zod.def,{shape:Nk(e,t)}))}function Nk(e,t){let r={};return Qn(r,e,Reflect.ownKeys(Mr(e))),f2(r,t),r}function w2(e,t){if(!eo(t))throw Error("Invalid input to safeExtend: expected a plain object");return xr(e,Ot(e._zod.def,{shape:Nk(e,t)}))}function b2(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let r={};Qn(r,e,Reflect.ownKeys(Mr(e))),Qn(r,t,Reflect.ownKeys(Mr(t)));let n=Ot(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return xr(e,n)}function zk(e,t,r,n="partial"){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Ac(t,r)):void 0,l={};return Qn(l,t,Reflect.ownKeys(Mr(t)),e&&((c,d)=>a&&!a.has(d)?c:new e({type:"optional",innerType:c}))),xr(t,Ot(t._zod.def,{shape:l,checks:[]}))}function v2(e,t,r){let n=r?new Set(Ac(t,r)):void 0,o={};return Qn(o,t,Reflect.ownKeys(Mr(t)),(i,s)=>n&&!n.has(s)?i:new e({type:"nonoptional",innerType:i})),xr(t,Ot(t._zod.def,{shape:o}))}function Vt(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function Fk(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue===!1)return!0;return!1}function Sr(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function Cs(e){return typeof e==="string"?e:e?.message}function fm(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Pr(e,t,r){var n;let o=e.inst?._zod?.traits;if(o?.has("$ZodType"))if(o.has("$ZodCheck"))(n=e).schema??(n.schema=e.inst);else e.schema=e.inst;let i=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,s=e.message?e.message:Cs(e.inst?._zod.def?.error?.(e))??Cs(i?.(e))??Cs(t?.error?.(e))??Cs(r.customError?.(e))??Cs(r.localeError?.(e))??"Invalid input",a={};for(let l of Object.keys(e)){if(l==="inst"||l==="schema"||l==="continue"||l==="input"||l==="__proto__")continue;a[l]=e[l]}if(a.path??(a.path=[]),a.message=s,t?.reportInput)a.input=e.input;return a}function Lc(e){let t=e.length;if(!k2.test(e))return t;let r=t;for(let n=0;n<t-1;n++)if((e.charCodeAt(n)&64512)===55296&&(e.charCodeAt(n+1)&64512)===56320)r--,n++;return r}function jc(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function Mk(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let r=e;if(r&&Object.getPrototypeOf(r)!==Object.prototype&&"constructor"in r&&r.constructor)return r.constructor.name}}return t}function to(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function Bk(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else x2(e,r,n.value)}}function Br(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Dc(e,t,r){return Br(e,t,r,!1)}function Uk(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Br(this,r,n(this))},set(o){Br(this,r,o)}})}return t}function x2(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Br(this,t,r.bind(this))},set(n){Br(this,t,n)}})}function S2(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}function oe(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&lm!==e._zod){lm=void 0;return}lm=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,P2);let o=mn;mn=!1;try{let i=r(this);if(mn)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:i});return mn=mn||o,i}catch(i){throw delete this[t],mn=mn||o,i}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function R2(e,t,r,n){let o=S2(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let i={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,i),i.value=r(this),Object.defineProperty(this,t,i),i.value},set(i){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:i})}})}function qk(e){let t=()=>e;return t[E2]=!0,t}var dm,jk,Dk,Oc,mm,k2,lm,mn=!1,P2,E2="~constantCatch";var ht=y(()=>{ro();dm="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};jk=Os(()=>{if(at.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});Dk=new Set(["string","number","symbol"]);Oc=(()=>({safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-340282346638528860000000000000000000000,340282346638528860000000000000000000000],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]}))(),mm={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};k2=/[\uD800-\uDBFF]/;P2={configurable:!0,get(){mn=!0;return}}});function $2(e){let t=Gk;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return Gk=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function R(e,t,r,n){let o={};function i(m){this.def=m,this.constr=u,this.traits=new Set}i.prototype=o;let s=r,a=s&&new WeakSet;function l(m,f){if(!m._zod){gm.value=new i(f);try{Object.defineProperty(m,"_zod",gm)}finally{gm.value=void 0}}else if(m._zod.traits.has(e))return;if(m._zod.traits.add(e),t(m,f),a){let h=Object.getPrototypeOf(m),w=m._zod.constr.prototype,x=h;while(x&&x!==w)x=Object.getPrototypeOf(x);let C=x??h;if(!a.has(C))a.add(C),Bk(C,s)}let g=u.prototype;for(let h in g){if(!Object.prototype.hasOwnProperty.call(g,h))continue;if(!(h in m))m[h]=g[h].bind(m)}}let c=n?.Parent??Object;class d extends c{}Object.defineProperty(d,"name",{value:e});function u(m){let f=n?.Parent?$2(d):this;l(f,m);let g=f._zod.deferred;if(g){for(let w of g)w();f._zod.deferred=void 0}let h=globalThis.__zod_globalConfig?.postProcessor;if(h)h(f);return f}return Object.defineProperty(u,"init",{value:l}),Object.defineProperty(u,Symbol.hasInstance,{value:(m)=>{if(n?.Parent&&m instanceof n.Parent)return!0;return m?._zod?.traits?.has(e)}}),Object.defineProperty(u,"name",{value:e}),u}function At(e){if(e)Object.assign(at,e);return at}var Hk,gm,Gk,Rr,Ls,at;var ro=y(()=>{ht();gm={value:void 0,enumerable:!1},Gk="captureStackTrace"in Error?Error:null;Rr=class Rr extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}};Ls=class Ls extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}};(Hk=globalThis).__zod_globalConfig??(Hk.__zod_globalConfig={});at=globalThis.__zod_globalConfig});function C2(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,Is,2)),e.message}function _2(e){this._zod.message=e}function O2(e,t,r){if(!Object.prototype.hasOwnProperty.call(e,t))if(t==="__proto__")Object.defineProperty(e,t,{value:r(),writable:!0,enumerable:!0,configurable:!0});else e[t]=r();return e[t]}function Vk(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)O2(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function Jk(e,t=(r)=>r.message){let r={_errors:[]},n=(o,i=[])=>{for(let s of o.issues)if(s.code==="invalid_union"&&s.errors.length)s.errors.map((a)=>n({issues:a},[...i,...s.path]));else if(s.code==="invalid_key")n({issues:s.issues},[...i,...s.path]);else if(s.code==="invalid_element")n({issues:s.issues},[...i,...s.path]);else{let a=[...i,...s.path];if(a.length===0)r._errors.push(t(s));else{let l=r,c=0;while(c<a.length){let d=a[c],u=c===a.length-1;if(d==="_errors"){if(u)l._errors.push(t(s));c++;continue}if(!Object.prototype.hasOwnProperty.call(l,d))Object.defineProperty(l,d,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let m=l[d];if(u)m._errors.push(t(s));l=m,c++}}}};return n(e),r}var I2,hm,Wk,Zk=(e,t)=>{e.name="$ZodError",hm.value=t,Object.defineProperty(e,"issues",hm),hm.value=void 0,Object.defineProperty(e,"message",I2);let r=Object.getPrototypeOf(e);if(!Wk.has(r))Wk.add(r),Object.defineProperty(r,"toString",{configurable:!0,enumerable:!1,get(){let n=()=>this.message;return Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0}),n},set(n){Object.defineProperty(this,"toString",{value:n,configurable:!0,writable:!0})}})},Kk,lY;var Yk=y(()=>{ro();ht();I2={get:C2,set:_2,enumerable:!0,configurable:!0},hm={value:void 0,enumerable:!1},Wk=new WeakSet([Object.prototype,Error.prototype]),Kk=R("$ZodError",Zk),lY=R("$ZodError",Zk,void 0,{Parent:Error})});function Tc(e,t){return{callee:t?.callee??e,Err:t?.Err}}function Xk(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>Pr(o,r,At()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}function j2(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,i;if(o)n[L2]=!0,i=o({value:t,issues:[]},n);else i=e._zod.run({value:t,issues:[]},n);if(i instanceof Promise)throw new Rr;return i.issues.length===0}var Nc=(e)=>{let t=(r,n,o,i)=>{let s=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)throw new Rr;if(a.issues.length){let l=new(i?.Err??e)(a.issues.map((c)=>Pr(c,s,At())));throw dm(l,i?.callee??t),l}return a.value};return t},zc=(e)=>{let t=async(r,n,o,i)=>{let s=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},s);if(a instanceof Promise)a=await a;if(a.issues.length){let l=new(i?.Err??e)(a.issues.map((c)=>Pr(c,s,At())));throw dm(l,i?.callee??t),l}return a.value};return t},Fc=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new Rr;return i.issues.length?Xk(e,i.issues,o):{success:!0,data:i.value}},Mc=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},i=t._zod.run({value:r,issues:[]},o);if(i instanceof Promise)i=await i;return i.issues.length?Xk(e,i.issues,o):{success:!0,data:i.value}},A2,L2,wm=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==A2)return!0;if(n.definite===!0&&r===void 0)return!1}return j2(e,t,r)},bm=async(e,t,r)=>{let n=r?{...r,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},o=e._zod.run({value:t,issues:[]},n);if(o instanceof Promise)o=await o;return o.issues.length===0},Qk=(e)=>{let t=Nc(e),r=(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return t(n,o,a,Tc(r,s))};return r},ex=(e)=>{let t=Nc(e),r=(n,o,i,s)=>t(n,o,i,Tc(r,s));return r},tx=(e)=>{let t=zc(e),r=async(n,o,i,s)=>{let a=i?{...i,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Tc(r,s))};return r},rx=(e)=>{let t=zc(e),r=async(n,o,i,s)=>await t(n,o,i,Tc(r,s));return r},nx=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Fc(e)(t,r,o)},ox=(e)=>(t,r,n)=>Fc(e)(t,r,n),ix=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return Mc(e)(t,r,o)},sx=(e)=>async(t,r,n)=>Mc(e)(t,r,n);var ax=y(()=>{ro();ht();A2=Symbol.for("zod.compile.invalid"),L2=Symbol.for("zod.compile.fallback")});function fx(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}function wx(){return new RegExp(D2,"u")}function T2(e){return new RegExp(`^${e}$`)}function vm(e){return typeof e.precision==="number"?e.precision===-1?"(?:[01]\\d|2[0-3]):[0-5]\\d":e.precision===0?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d":`(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?"(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?":"(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?"}function _x(e){return new RegExp(`^${vm(e)}$`)}function Ix(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${vm({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${vm({precision:e.precision})}`:r;return new RegExp(`^${$x}T(?:${n})$`)}var lx,cx,dx,ux,px,mx,gx,yx,km=(e)=>{if(!e)return/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`)},hx,D2="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$",bx,vx,kx,xx,Sx,Px,Rx,Ex,$x="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",Cx,Ox,xm,js,Ax,Lx,jx,Dx;var Ts=y(()=>{lx=/^[cC][0-9a-z]{6,}$/,cx=/^[0-9a-z]+$/,dx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,ux=/^[0-9a-vA-V]{20}$/,px=/^[A-Za-z0-9]{27}$/,mx=/^[a-zA-Z0-9_-]{21}$/;gx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,yx=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,hx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;bx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,vx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,kx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,xx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Sx=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Px=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Rx=/^https?$/,Ex=/^\+[1-9]\d{6,14}$/;Cx=T2($x);Ox=/^[\s\S]{0,}$/,xm=/^-?\d+$/,js=/^-?\d+(?:\.\d+)?$/,Ax=/^(?:true|false)$/i,Lx=/^null$/i,jx=/^[^A-Z]*$/,Dx=/^[^a-z]*$/});var Ge,Sm=(e)=>{let t=e.value;return!Ck(t)&&t.length!==void 0},Bc,Pm,Rm,Tx,Nx,zx,Fx,Mx,Ns,Bx,Ux,qx,Hx,Gx,Wx,Zx;var Uc=y(()=>{ro();Ts();ht();Ge=R("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),Bc={number:"number",bigint:"bigint",object:"date"},Pm=R("$ZodCheckLessThan",(e,t)=>{Ge.init(e,t);let r=Bc[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:Bc[typeof n.value]??r,code:"too_big",maximum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Rm=R("$ZodCheckGreaterThan",(e,t)=>{Ge.init(e,t);let r=Bc[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:Bc[typeof n.value]??r,code:"too_small",minimum:typeof t.value==="object"?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),Tx=R("$ZodCheckMultipleOf",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{if(typeof r.value!==typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");if(typeof r.value==="bigint"?t.value!==BigInt(0)&&r.value%t.value===BigInt(0):_k(r.value,t.value)===0)return;r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),Nx=R("$ZodCheckNumberFormat",(e,t)=>{Ge.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,i]=Oc[t.format];e._zod.check=(s)=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});else s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}if(a<o)s.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>i)s.issues.push({origin:"number",input:a,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),zx=R("$ZodCheckMaxLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>t.maximum?Lc(o):i)<=t.maximum)return;let a=jc(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Fx=R("$ZodCheckMinLength",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length;if((typeof o==="string"&&i>=t.minimum&&i<t.minimum*2?Lc(o):i)>=t.minimum)return;let a=jc(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),Mx=R("$ZodCheckLengthEquals",(e,t)=>{var r;Ge.init(e,t),(r=e._zod.def).when??(r.when=Sm),e._zod.check=(n)=>{let o=n.value,i=o.length,s=typeof o==="string"&&i>=t.length&&i<=t.length*2?Lc(o):i;if(s===t.length)return;let a=jc(o),l=s>t.length;n.issues.push({origin:a,...l?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Ns=R("$ZodCheckStringFormat",(e,t)=>{var r,n;if(Ge.init(e,t),t.pattern)(r=e._zod).check??(r.check=(o)=>{if(t.pattern.lastIndex=0,t.pattern.test(o.value))return;o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})});else(n=e._zod).check??(n.check=()=>{})}),Bx=R("$ZodCheckRegex",(e,t)=>{Ns.init(e,t),e._zod.check=(r)=>{if(t.pattern.lastIndex=0,t.pattern.test(r.value))return;r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Ux=R("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=jx),Ns.init(e,t)}),qx=R("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Dx),Ns.init(e,t)}),Hx=R("$ZodCheckIncludes",(e,t)=>{Ge.init(e,t);let r=fn(t.includes),n=new RegExp(typeof t.position==="number"?`^.{${t.position},}${r}`:r);t.pattern=n,e._zod.check=(o)=>{if(o.value.includes(t.includes,t.position))return;o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),Gx=R("$ZodCheckStartsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`^${fn(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.startsWith(t.prefix))return;n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Wx=R("$ZodCheckEndsWith",(e,t)=>{Ge.init(e,t);let r=new RegExp(`.*${fn(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.check=(n)=>{if(n.value.endsWith(t.suffix))return;n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zx=R("$ZodCheckOverwrite",(e,t)=>{Ge.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}})});class Em{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{this.indent-=1}}write(e){if(typeof e==="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let r=e.split(`
|
|
4
4
|
`).filter((i)=>i),n=Math.min(...r.map((i)=>i.length-i.trimStart().length)),o=r.map((i)=>i.slice(n)).map((i)=>" ".repeat(this.indent*2)+i);for(let i of o)this.content.push(i)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|
|
5
5
|
${t.join(`
|
|
6
6
|
`)}
|
|
@@ -746,7 +746,7 @@ export default function (pi) {
|
|
|
746
746
|
await bridge?.close();
|
|
747
747
|
});
|
|
748
748
|
}
|
|
749
|
-
`}var z_=y(()=>{T_()});function F_(e){switch(e.agent){case"pi":return N_(e);case"opencode":return L_(e);case"claude-code":case"codex":case"cursor":case"antigravity":throw Error(`${e.agent} has no shadowclone extension`)}}var M_=y(()=>{j_();z_()});import jy from"path";function f9(e){return new Set([...e.text.matchAll(/(?:^|\s)@(~\/\S+|\/\S+|\.{1,2}\/\S+)/g)].flatMap(([,t])=>{if(!t)return[];let r=t.startsWith("~/")?jy.join(e.homeDirectory,t.slice(2)):jy.resolve(jy.dirname(e.filePath),t),n=Hr(r);return n?[n]:[]}))}function B_(e){if(e.integration.agent!=="claude-code"||e.integration.scope!=="global"||e.text===null)return!1;let t=f9({text:e.text,filePath:e.filePath,homeDirectory:e.integration.userDirectory});return e.peers.some((r)=>r.scope==="global"&&r.agent!=="claude-code"&&Yr(r).some((n)=>n.kind==="instructions"&&t.has(Hr(Ne({integration:r,file:n}))??"")))}var U_=y(()=>{b();Xr()});function q_(){return["---","name: shadowclone-context","description: Use when asked to remember, explain, undo, or maintain learned skills and agent instructions.","---","","# Maintain learned skills","","Use shadowclone remember --repo <guidance> or --global for an explicitly global preference. Learning updates the applicable skills and native routing.","Use shadowclone context --explain and shadowclone doctor to inspect delivery. Read the selected skill files for behavioral guidance.","Use shadowclone skills update to reconcile supported learning, shadowclone history to inspect revisions, and shadowclone undo <id> to reverse an unchanged revision.","Current requests take precedence. Learned skills do not authorize additional actions. Native memory is never modified.","","## Review proposals with the user","","When session start says that shadowclone proposals wait for a decision,
|
|
749
|
+
`}var z_=y(()=>{T_()});function F_(e){switch(e.agent){case"pi":return N_(e);case"opencode":return L_(e);case"claude-code":case"codex":case"cursor":case"antigravity":throw Error(`${e.agent} has no shadowclone extension`)}}var M_=y(()=>{j_();z_()});import jy from"path";function f9(e){return new Set([...e.text.matchAll(/(?:^|\s)@(~\/\S+|\/\S+|\.{1,2}\/\S+)/g)].flatMap(([,t])=>{if(!t)return[];let r=t.startsWith("~/")?jy.join(e.homeDirectory,t.slice(2)):jy.resolve(jy.dirname(e.filePath),t),n=Hr(r);return n?[n]:[]}))}function B_(e){if(e.integration.agent!=="claude-code"||e.integration.scope!=="global"||e.text===null)return!1;let t=f9({text:e.text,filePath:e.filePath,homeDirectory:e.integration.userDirectory});return e.peers.some((r)=>r.scope==="global"&&r.agent!=="claude-code"&&Yr(r).some((n)=>n.kind==="instructions"&&t.has(Hr(Ne({integration:r,file:n}))??"")))}var U_=y(()=>{b();Xr()});function q_(){return["---","name: shadowclone-context","description: Use when asked to remember, explain, undo, or maintain learned skills and agent instructions.","---","","# Maintain learned skills","","Use shadowclone remember --repo <guidance> or --global for an explicitly global preference. Learning updates the applicable skills and native routing.","Use shadowclone context --explain and shadowclone doctor to inspect delivery. Read the selected skill files for behavioral guidance.","Use shadowclone skills update to reconcile supported learning, shadowclone history to inspect revisions, and shadowclone undo <id> to reverse an unchanged revision.","Current requests take precedence. Learned skills do not authorize additional actions. Native memory is never modified.","","## Review proposals with the user","","When session start says that shadowclone proposals wait for a decision, finish the user's task first. The task is done when you delivered its result and have no open question about it.","","- Do not mention the proposals while the task is in progress.","- Never add a proposal to a question about the user's task.","- If the user asks about the proposals, answer at once.","",'1. When the task is done, ask one question with your multiple-choice question tool, such as `AskUserQuestion` in Claude Code or `request_user_input` in Codex: "shadowclone proposed learnings from its findings. Do you want to review and approve them in this session?" Offer yes and no.',"2. If the user says no or does not answer, do not mention the proposals again in this session.","3. If the user says yes, run `shadowclone skills pending`. Read each item with `shadowclone learning show <key>` or `shadowclone skills show <id>`.","4. For each item, state in two or three lines what it changes, which file it targets, and why it waits.","5. Ask with your multiple-choice question tool. Ask about at most four items in each round.","6. Offer apply, reword, reject, and decide later. Put your recommended option first with one reason. Group items that need the same decision, such as conflicts between two third-party skills.",'7. Run the command for each answer: `shadowclone learning apply <key>`, `shadowclone learning replace <key> "<text>"`, `shadowclone learning reject <key>`, `shadowclone skills apply <id>`, or `shadowclone skills reject <id>`.',"8. Report each change with its revision, so the user can reverse it with `shadowclone undo <revision>`."].join(`
|
|
750
750
|
`)}function $n(e){return e.flatMap((t)=>t.retired?[]:[t.record])}async function Ht(e){let t=[],r=await ae(Tf({homeDirectory:e.integration.userDirectory,platform:process.platform}));for(let n of Yr(e.integration)){let o=Ne({integration:e.integration,file:n}),i=await S(o),s=r.flatMap((d)=>d.id===e.integration.id?[]:d.files.filter((u)=>Ne({integration:d,file:u})===o)),a=e.integration.files.find((d)=>d.relativePath===n.relativePath)??s[0];if(e.remove&&s.length>0)continue;if(e.remove&&(!a||i===null))continue;let l,c;if(n.kind==="hooks"){if(a&&i!==null&&!cu({text:i,integration:e.integration}))throw Error(Qr.editedHooks);let d=__({previous:i,integration:e.integration,remove:e.remove});if(l=d.text,c=d.fingerprint,e.remove&&a?.created&&I_(l))l=null}else if(n.kind==="skill"||n.kind==="extension"){if(i!==null&&(!a||E(i)!==a.fingerprint&&!s.some((d)=>d.kind===n.kind&&d.fingerprint===E(i))))throw Error(Qr.editedIntegrationFile);l=e.remove?null:n.kind==="extension"?F_(e.integration):`${q_()}
|
|
751
751
|
`,c=E(l??"")}else{let d=i===null&&e.integration.agent==="cursor"?`---
|
|
752
752
|
description: Personal engineering preferences from shadowclone
|
|
@@ -817,7 +817,7 @@ Learned guidance sets defaults for choices the request leaves open. An explicit
|
|
|
817
817
|
`)}${i}`)}async function ll(e){let t=0;for(let n of e.artifacts){let o=await Wi({root:e.directory,relativePath:sn[n]});if(o===null||!await Dh({directory:e.directory,artifact:n,installation:e.installation}))continue;if(await Bun.file(o).exists())t+=1;await g5(o,{force:!0})}let r=await Wi({root:e.directory,relativePath:h5});if(r!==null)await y5(r).catch(()=>{return});return t}var aO,h5;var Mh=y(()=>{zh();b();Eu();Pu();Pu();Xr();za();aO=new Set([...Object.values(Gi),...dr.options.flatMap((e)=>Yr({agent:e,scope:"repository",directory:"/",userDirectory:"/",codexInstructions:"AGENTS.override.md"}).map(({relativePath:t})=>Fh(t)))]),h5=Uo.join(".claude","skills","shadowclone")});import Bh from"path";function b5(e){return`'${e.replaceAll("'","'\\''")}'`}async function Ho(e){let t=e.paths,r=Bh.join(t.shadowcloneDirectory,"bin","shadowclone"),n=Bh.join(t.shadowcloneDirectory,"bin","shadowclone-owner.json"),o=await S(r),i=await S(n),s=i===null?null:w5.parse(JSON.parse(i));if(o!==null&&s?.fingerprint!==E(o))throw Error("The private hook launcher was edited; preserving it");let a=e.entry??process.argv[1],l=e.executable??process.execPath,d=`exec ${(a&&Bh.isAbsolute(a)&&/\.(?:mjs|js|ts)$/u.test(a)?[l,a]:[l]).map(b5).join(" ")} "$@"
|
|
818
818
|
`;if(o===d)return;await ut({paths:t,root:t.shadowcloneDirectory,kind:"environment",updates:[{filePath:r,previous:o,next:d},{filePath:n,previous:i,next:`${JSON.stringify({fingerprint:E(d)})}
|
|
819
819
|
`}]})}var w5,$u;var Cu=y(()=>{I();cr();b();w5=O({fingerprint:p()}),$u=["claude-code","codex","pi","opencode"]});import cl from"path";function cO(e){let t=cl.dirname(e.paths.shadowcloneDirectory);switch(e.agent){case"claude-code":return cl.join(t,".claude");case"codex":return cl.dirname(e.paths.codexSessionsDirectory);case"cursor":return cl.join(t,".cursor");case"antigravity":return cl.join(t,".gemini/config");case"pi":return e.paths.piAgentDirectory;case"opencode":return e.paths.opencodeConfigDirectory}}var dO=()=>{};import uO from"path";async function pO(e){let t=uO.join(e.directory,"AGENTS.override.md"),r=uO.join(e.directory,"AGENTS.md"),n=e.previous?.files.some((o)=>o.relativePath==="AGENTS.override.md"&&o.created)??!1;if(await Bun.file(r).exists()&&(n||!await Bun.file(t).exists()))throw new dl({override:t,hidden:r,installed:n})}var dl;var Uh=y(()=>{dl=class dl extends Error{override;hidden;installed;constructor(e){super(e.installed?`${e.override}, which shadowclone created, hides ${e.hidden} from Codex`:`${e.override} would hide ${e.hidden} from Codex`);this.name="HiddenInstructionsError",this.override=e.override,this.hidden=e.hidden,this.installed=e.installed}}});import mO from"path";async function qh(e){let t=e.paths??P,r=A(e.cwd??process.cwd()),n=mO.dirname(t.shadowcloneDirectory),o=e.scope==="repository"?r:A(cO({agent:e.agent,paths:t})),s=(await ae(t)).find((f)=>f.agent===e.agent&&f.scope===e.scope&&f.directory===o);if(e.agent==="codex"&&e.scope==="repository")await pO({directory:o,previous:s});if($u.includes(e.agent))await Ho({paths:t});let a=s??{id:crypto.randomUUID(),agent:e.agent,scope:e.scope,directory:o,userDirectory:n,codexInstructions:e.agent==="codex"&&(e.scope==="repository"||await Bun.file(mO.join(o,"AGENTS.override.md")).exists())?"AGENTS.override.md":"AGENTS.md",files:[],excludes:[],deliveredAt:null},l=await Ue({...e,paths:t,cwd:r,scope:e.scope==="global"?"global":"combined"});if(l===null)throw Error("Managed policy blocks this integration");let c=await Ht({integration:a,profile:l}),d={...a,files:$n(c)};await Lr({paths:t,integration:d});try{await Ua(c)}catch(f){throw await Lr({paths:t,integration:a,remove:s===void 0}),f}let u=e.scope==="repository"?await al({cwd:r,patterns:c.filter((f)=>f.record.created&&!f.retired).map((f)=>Fh(f.record.relativePath))}):[],m={...d,excludes:[...new Set([...d.excludes,...u])]};return await Lr({paths:t,integration:m}),m}async function ul(e){let t=e.paths??P,r=(await ae(t)).find((o)=>o.id===e.integration.id);if(!r)return;let n=await Ht({integration:r,profile:"",remove:!0});if(await Ua(n),r.scope==="repository")await qo({cwd:r.directory,patterns:r.excludes});await Lr({paths:t,integration:r,remove:!0})}var fO=y(()=>{Mh();b();il();Ni();jr();Cu();dO();Uh()});function gO(e){if(typeof e==="number"&&Number.isFinite(e))return e<10000000000?e*1000:e;if(typeof e==="string"){let t=Date.parse(e);if(!Number.isNaN(t))return t}return Date.now()}async function yO(e){let t=e.paths;if(t===void 0)throw Error("Session binding requires project paths");let{config:r,policy:n}=await j({configPath:e.configPath??t.configFile,managedConfigPath:e.managedConfigPath===void 0?t.managedConfigFile:e.managedConfigPath});if(!n.enabled||!r.sources["git-metadata"])return;if((e.integration.agent==="pi"||e.integration.agent==="opencode")&&!r.sources[e.integration.agent])return;let o=await le({cwd:e.cwd,enabled:!0,readRemote:e.readRemote}),i=await xt(t.indexDatabase);try{i.bindSessionOrigin({source:v5[e.integration.agent],sessionId:e.sessionId,timestamp:e.timestamp,repository:o})}finally{i.close()}}var v5;var hO=y(()=>{b();ie();v5={"claude-code":"claude-code",codex:"codex",cursor:"cursor",antigravity:"antigravity",pi:"pi",opencode:"opencode"}});import k5 from"path";function P5(e){return k5.join(e.shadowcloneDirectory,"review-notice.json")}function R5(e){if(e===null)return null;try{let t=S5.safeParse(JSON.parse(e));return t.success?t.data.fingerprint:null}catch{return null}}async function wO(e){let t=await B(e),r=t===null?[]:Zt({paths:e,state:t}).filter((l)=>x5.has(l.status)).map((l)=>`learning:${l.key}:${l.status}`),n=(await Ye(e)).filter(({status:l})=>l==="pending").map(({id:l})=>`proposal:${l}`),o=[...new Set([...r,...n])].sort();if(o.length===0)return"";let i=E(JSON.stringify(o)),s=P5(e),a=await S(s);if(R5(a)===i)return"";return await J({filePath:s,previous:a,next:`${JSON.stringify({fingerprint:i})}
|
|
820
|
-
`}),[`shadowclone has ${o.length} proposal(s) that need the user's decision.`,"
|
|
820
|
+
`}),[`shadowclone has ${o.length} proposal(s) that need the user's decision.`,"Do not mention them while the user's task is in progress.","When the task is done, load the shadowclone-context skill and follow its steps to review proposals."].join(" ")}var x5,S5;var bO=y(()=>{I();b();K();Oh();Pt();x5=new Set(["pending","conflicting-evidence","retirement-review"]),S5=O({fingerprint:p()})});function Hh(e){return E(`${e.agent}:${e.nativeSessionId}`)}var Gh=y(()=>{b()});import E5 from"path";function vO(e){try{return $5.parse(JSON.parse(e||"{}"))}catch{throw Error("Invalid native hook input")}}function kO(e){return e.session_id??e.sessionId??e.conversationId??e.conversation_id??null}function xO(e){let t=e.integrations.filter((r)=>r.agent===e.integration.agent&&r.scope==="repository"&&(e.cwd===r.directory||e.cwd.startsWith(`${r.directory}${E5.sep}`))).sort((r,n)=>n.directory.length-r.directory.length)[0];return e.integration.scope==="repository"?t?.id===e.integration.id:t===void 0}async function Wh(e){let t=e.paths??P,r=await ae(t),n=r.find((f)=>f.id===e.id);if(!n)return{};let o=vO(e.input),i=A(o.cwd??o.workspace_roots?.[0]??o.workspacePaths?.[0]??process.cwd());if(!xO({integration:n,integrations:r,cwd:i}))return{};let s=C5.includes(n.agent),a=await Ue({...e,paths:t,cwd:i,...s?{scope:n.scope==="global"?"scoped":"global"}:{}});if(a===null)return{};let l=kO(o);if(l!==null)await yO({...e,paths:t,integration:n,sessionId:l,cwd:i,timestamp:gO(o.timestamp)});if(s&&n.scope==="repository")return{};let c=o.hook_event_name!=="SubagentStart",d=c?await kh(t):"",u=c?await wO(t):"",m=[a,d,u].filter((f)=>f.length>0).join(`
|
|
821
821
|
|
|
822
822
|
`);if(m.length===0)return{};if(await Lr({paths:t,integration:{...n,deliveredAt:Date.now()}}),n.agent==="pi"||n.agent==="opencode")return{additionalContext:m};if(n.agent==="cursor")return{additional_context:m};if(n.agent==="antigravity")return{decision:"allow",hookSpecificOutput:{hookEventName:"PreInvocation",ephemeralMessage:m}};return n.agent,{hookSpecificOutput:{hookEventName:n.agent==="claude-code"?o.hook_event_name??"SessionStart":"SessionStart",additionalContext:m}}}async function Zh(e){let t=e.paths??P,r=(await ae(t)).find((i)=>i.id===e.id);if(!r)return null;let n=vO(e.input);if(r.agent==="pi"||r.agent==="opencode"){let i=await ae(t);if(!xO({integration:r,integrations:i,cwd:A(n.cwd??process.cwd())}))return null;let{config:s}=await j({configPath:e.configPath??t.configFile,managedConfigPath:e.managedConfigPath===void 0?t.managedConfigFile:e.managedConfigPath});if(!s.sources[r.agent])return null}let o=kO(n);if(!o)return null;return Hh({agent:r.agent,nativeSessionId:o})}var $5,C5;var SO=y(()=>{I();b();il();jr();hO();xh();bO();Gh();$5=v({cwd:p().optional(),workspace_roots:k(p()).optional(),workspacePaths:k(p()).optional(),session_id:p().optional(),sessionId:p().optional(),conversationId:p().optional(),conversation_id:p().optional(),hook_event_name:p().optional()}).passthrough(),C5=["claude-code","codex","pi","opencode"]});async function $t(e={}){let t=e.paths??P,r=0,n=0;for(let o of await ae(t)){if($u.includes(o.agent))await Ho({paths:t});let i=await Ue({...e,paths:t,cwd:o.directory,scope:o.scope==="global"?"global":"combined"});if(i===null)continue;try{let s=await Ht({integration:o,profile:i});await Ua(s),await Lr({paths:t,integration:{...o,files:$n(s)}}),r+=1}catch{n+=1}}return{refreshed:r,preserved:n}}async function Kh(e={}){let t=e.paths??P,r=[];for(let n of await ae(t)){let o="installed";for(let i of n.files)try{let s=await S(Ne({integration:n,file:i}));if(s===null){o="missing files";break}if(i.kind==="hooks"?!cu({text:s,integration:n}):E(i.kind==="instructions"?Dr(s)??"":s)!==i.fingerprint){o="edited managed content";break}}catch{o="invalid destination";break}if(o==="installed"){let i=await Ue({...e,paths:t,cwd:n.directory,scope:n.scope==="global"?"global":"combined"});if(i===null)o="blocked by policy";else if((await Ht({integration:n,profile:i})).some((a)=>a.next!==a.previous))o="stale"}r.push(`${n.agent} (${n.scope}): ${o}; ${n.deliveredAt===null?"hook not observed":"hook delivery observed"}`)}return r}var PO=y(()=>{b();il();Ni();Iy();Ba();jr();Xr();Cu()});var RO=()=>{};import _5 from"path";async function Go(e){if(!await Bun.file(e).exists())return Vh;try{let r=await Dt({filePath:e,roots:[_5.dirname(e)],maximumBytes:1048576});if(r===null)throw Error("Installation state could not be read safely");let n=I5.safeParse(JSON.parse(r));return n.success?n.data:Vh}catch{return Vh}}async function pl(e){await Te({path:e.filePath,content:`${JSON.stringify(e.state,null,2)}
|
|
823
823
|
`})}function Zi(e){return e.state.installations.find((t)=>t.directory===e.directory)??null}function EO(e,t){return[...new Set([...e,...t])].sort()}function Jh(e){let t=Zi({state:e.state,directory:e.installation.directory}),r={directory:e.installation.directory,fingerprints:{...t?.fingerprints,...e.installation.fingerprints},artifacts:EO(t?.artifacts??[],e.installation.artifacts),excludes:EO(t?.excludes??[],e.installation.excludes)};return{version:1,installations:[...e.state.installations.filter((n)=>n.directory!==r.directory),r]}}function Yh(e){return{version:1,installations:e.state.installations.filter((t)=>t.directory!==e.directory)}}var I5,Vh;var $O=y(()=>{b();I();I5=O({version:pe(1),installations:k(O({directory:p().min(1),artifacts:k(T(["agent","delegation-skill"])),excludes:k(p().min(1)),fingerprints:v({agent:p().optional(),"delegation-skill":p().optional()}).optional()}))}),Vh={version:1,installations:[]}});var CO=y(()=>{il();fO();SO();PO();jr();Ba();za();RO();Ni();Uh();Cu();zh();Mh();$O();Eu();Gh();Xr()});var F=y(()=>{nO();CO()});async function _u(e){let t=new Map,r=[];for(let n of e.signals){let o=[];for(let s of n.textRefs){if(e.authorizeRef&&!await e.authorizeRef(s))continue;let a=await kt({ref:s,roots:e.sourceRoots}),l=n.kind==="user-steering"?Py(a)??"":a;if(l.includes(tr)||l.trimStart().startsWith("# Shadowclone profile"))continue;let c=Ly(l);if(c===null||!c.trim())continue;t.set(Ae(s),c),o.push(s)}if(o.length===0)continue;if(e.requireSteeringCue===!0&&n.kind==="user-steering"&&!o.some((s)=>Ig(t.get(Ae(s))??""))){for(let s of o)t.delete(Ae(s));continue}for(let s of n.contextRefs??[]){if(e.authorizeRef&&!await e.authorizeRef(s))continue;let a=await kt({ref:s,roots:e.sourceRoots});t.set(Ae(s),n.kind==="user-steering"?Py(a)??"":a)}r.push({...n,textRefs:o})}return{signals:r,excerpts:t}}var tr="SHADOWCLONE_INTERNAL_LEARNING";var jn=y(()=>{b_();F();ie()});function _O(e){let t=new Set(e.output.assessments?.filter((r)=>r.intent==="correction"&&r.durable).map((r)=>r.evidenceToken));return e.output.existingRules.flatMap((r)=>{let n=e.context.rules.find((o)=>o.token===r.ruleToken);if(!n)return[];return e.context.evidence.filter((o)=>t.has(o.token)&&r.evidenceTokens.includes(o.token)).map((o)=>({key:n.snapshot.rule.key,evidenceId:o.evidenceId,timestamp:o.signal.timestamp,sessionId:o.signal.sessionId}))})}function Xh(e,t){return[...new Set([...e,...t])]}function Iu(e){let t=new Map(e.context.evidence.map((r)=>[r.token,r.evidenceId]));return[...new Set(e.tokens.flatMap((r)=>{let n=t.get(r);return n?[e.explicitTokens.has(r)?_a(n):n]:[]}))]}var Qh=y(()=>{je()});function IO(e){let t=e.promptRule.axisOptions.find((o)=>o.token===e.result.axisChoiceToken),r=t?.title??e.result.proposedTitle,n=t?.body??e.result.proposedBody;if(!r||!n)return e.promptRule.snapshot.rule.proposal;return{kind:e.result.verdict==="narrows"?"narrow":"revise",text:t?`${r}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json",
|
|
3
3
|
"name": "shadowclone",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.35",
|
|
5
5
|
"description": "Set up and maintain portable coding-agent skills with explicit local consent.",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "shadowclone",
|