@brainervirus/workit-claude-code 2.7.0 → 2.8.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/.claude-plugin/plugin.json +1 -1
- package/dist/workit-hook.js +3 -2
- package/dist/workit.js +16708 -34
- package/package.json +3 -3
- package/skills/bdd/SKILL.md +51 -0
- package/skills/behavioral-tdd/SKILL.md +2 -0
- package/skills/test-audit/SKILL.md +52 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "workit",
|
|
3
3
|
"displayName": "Workit",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.8.0",
|
|
5
5
|
"description": "Workflow rails for agentic coding: task context on every session, branch policy on shell commands, and the workit method skills",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "BrainerVirus"
|
package/dist/workit-hook.js
CHANGED
|
@@ -84,8 +84,9 @@ target result; a local commit alone is not evidence of a requested remote push.
|
|
|
84
84
|
Skill routing: slash aliases /wk-* load on demand. Use workit-steer for a
|
|
85
85
|
substantial interruption or change of direction, workit-deslop when relevant
|
|
86
86
|
to a PR-ready endpoint, workit-green-run for failing CI, workit-blast-radius
|
|
87
|
-
when impact is uncertain,
|
|
88
|
-
choices
|
|
87
|
+
when impact is uncertain, workit-challenge for genuinely open consequential
|
|
88
|
+
choices, workit-bdd to turn acceptance criteria into Given/When/Then tests, and
|
|
89
|
+
workit-test-audit to check tests for tautologies. Load workit-plan when dependencies or handoff need durable next actions.
|
|
89
90
|
Load the skill; never act from memory of it.
|
|
90
91
|
`.trim();import{createHash as ak,randomUUID as zd}from"node:crypto";function mr(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 fo(e,t="|"){return e.map((r)=>mo(r)).join(t)}function gr(e,t){if(typeof t==="bigint")return t.toString();return t}class Ui{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 kr(e){return new Ui(e)}function Ji(e){return e===null||e===void 0}function Hr(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function Ur(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 Ce(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function vr(e){let t=Object.getOwnPropertyDescriptor(e,"shape");return t?.get?t.get.raw:t?.value}function Ue(e){return vr(e._zod.def)??e._zod.def.shape}function Ki(e,t,r){Object.defineProperty(e,t,{get(){let n=r();return Ce(this,t,n),n},enumerable:!0,configurable:!0})}function Gi(e,t,r){if(t in e)Ce(e,t,r);else e[t]=r}function St(e,t,r,n){let o=Ue(t);for(let s of r){let i=Object.getOwnPropertyDescriptor(o,s);if(!i.enumerable)continue;if(i.get)Ki(e,s,()=>{let a=t._zod.def.shape[s];return n?n(a,s):a});else Gi(e,s,n?n(i.value,s):i.value)}}function kh(e,t){for(let r of Reflect.ownKeys(t)){let n=Object.getOwnPropertyDescriptor(t,r);if(!n.enumerable)continue;if(n.get)Ki(e,r,()=>t[r]);else Gi(e,r,n.value)}}function be(...e){let t={};for(let r of e){let n=Object.getOwnPropertyDescriptors(r);Object.assign(t,n)}return Object.defineProperties({},t)}function fe(e){return JSON.stringify(e)}function Xi(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}var ho="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Ut(e){return typeof e==="object"&&e!==null&&!Array.isArray(e)}var Yi=kr(()=>{if(he.jitless)return!1;if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return new Function(""),!0}catch(e){return!1}});function Ke(e){if(Ut(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(Ut(r)===!1)return!1;if(Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)return!1;return!0}function yr(e){if(Ke(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}var Qi=new Set(["string","number","symbol"]);function dt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _e(e,t,r){let n=new e._zod.constr(t??e._zod.def);if(!t||r?.parent)n._zod.parent=e;return n}function P(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 mo(e){if(typeof e==="bigint")return e.toString()+"n";if(typeof e==="string")return`"${e}"`;return`${e}`}function ea(e){return Object.keys(e).filter((t)=>e[t]._zod.optin!==void 0&&e[t]._zod.optout==="optional")}var Jr=(()=>({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]}))(),go={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function vh(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 s={};return St(s,e,Kr(e,t)),_e(e,be(r,{shape:s,checks:[]}))}function Kr(e,t){let r=Ue(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 yh(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 s=new Set(Kr(e,t)),i={};return St(i,e,Reflect.ownKeys(Ue(e)).filter((a)=>!s.has(a))),_e(e,be(r,{shape:i,checks:[]}))}function wh(e,t){if(!Ke(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let o=Ue(e);for(let s of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(o,s)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return _e(e,be(e._zod.def,{shape:ta(e,t)}))}function ta(e,t){let r={};return St(r,e,Reflect.ownKeys(Ue(e))),kh(r,t),r}function bh(e,t){if(!Ke(t))throw Error("Invalid input to safeExtend: expected a plain object");return _e(e,be(e._zod.def,{shape:ta(e,t)}))}function _h(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={};St(r,e,Reflect.ownKeys(Ue(e))),St(r,t,Reflect.ownKeys(Ue(t)));let n=be(e._zod.def,{shape:r,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return _e(e,n)}function ra(e,t,r,n="partial"){let s=t._zod.def.checks;if(s&&s.length>0)throw Error(`.${n}() cannot be used on object schemas containing refinements`);let a=r?new Set(Kr(t,r)):void 0,c={};return St(c,t,Reflect.ownKeys(Ue(t)),e&&((u,l)=>a&&!a.has(l)?u:new e({type:"optional",innerType:u}))),_e(t,be(t._zod.def,{shape:c,checks:[]}))}function xh(e,t,r){let n=r?new Set(Kr(t,r)):void 0,o={};return St(o,t,Reflect.ownKeys(Ue(t)),(s,i)=>n&&!n.has(i)?s:new e({type:"nonoptional",innerType:s})),_e(t,be(t._zod.def,{shape:o}))}function Ze(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 na(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 pt(e,t){return t.map((r)=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}function hr(e){return typeof e==="string"?e:e?.message}function ko(e,t,r){var n;for(let o=t;o<e.length;o++)(n=e[o]).schema??(n.schema=r)}function Fe(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 s=e.schema!==e.inst?e.schema?._zod.def?.error:void 0,i=e.message?e.message:hr(e.inst?._zod.def?.error?.(e))??hr(s?.(e))??hr(t?.error?.(e))??hr(r.customError?.(e))??hr(r.localeError?.(e))??"Invalid input",a={};for(let c of Object.keys(e)){if(c==="inst"||c==="schema"||c==="continue"||c==="input"||c==="__proto__")continue;a[c]=e[c]}if(a.path??(a.path=[]),a.message=i,t?.reportInput)a.input=e.input;return a}var Sh=/[\uD800-\uDBFF]/;function Jt(e){let t=e.length;if(!Sh.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 Gr(e){if(Array.isArray(e))return"array";if(typeof e==="string")return"string";return"unknown"}function oa(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 It(...e){let[t,r,n]=e;if(typeof t==="string")return{message:t,code:"custom",input:r,inst:n};return{...t}}function sa(e,t){for(let r in t){let n=Object.getOwnPropertyDescriptor(t,r);if(n.get)Object.defineProperty(e,r,{...n,enumerable:!1});else Ih(e,r,n.value)}}function Je(e,t,r,n=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:n,value:r}),r}function Xr(e,t,r){return Je(e,t,r,!1)}function ia(e,t){for(let r in e){let n=e[r];Object.defineProperty(t,r,{configurable:!0,enumerable:!0,get(){return Je(this,r,n(this))},set(o){Je(this,r,o)}})}return t}function Ih(e,t,r){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?r:Je(this,t,r.bind(this))},set(n){Je(this,t,n)}})}function $h(e,t){let r=Object.getPrototypeOf(e);return t in r?void 0:r}var po,lt=!1,Rh={configurable:!0,get(){lt=!0;return}};function F(e,t,r){let n=Object.getPrototypeOf(e._zod);if(t in n&&po!==e._zod){po=void 0;return}po=e._zod,Object.defineProperty(n,t,{configurable:!0,get(){Object.defineProperty(this,t,Rh);let o=lt;lt=!1;try{let s=r(this);if(lt)delete this[t];else Object.defineProperty(this,t,{configurable:!0,writable:!0,value:s});return lt=lt||o,s}catch(s){throw delete this[t],lt=lt||o,s}},set(o){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:o})}})}function zh(e,t,r,n){let o=$h(e,t);if(!o)return;Object.defineProperty(o,t,{configurable:!0,get(){let s={configurable:!0,writable:!0,enumerable:n,value:void 0};return Object.defineProperty(this,t,s),s.value=r(this),Object.defineProperty(this,t,s),s.value},set(s){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:n,value:s})}})}var vo="~constantCatch";function aa(e){let t=()=>e;return t[vo]=!0,t}var ca;var yo={value:void 0,enumerable:!1},ua="captureStackTrace"in Error?Error:null;function Ch(e){let t=ua;if(t){let r=t.stackTraceLimit;if(typeof r==="number"){try{t.stackTraceLimit=0}catch{return ua=null,new e}try{return new e}finally{t.stackTraceLimit=r}}}return new e}function w(e,t,r,n){let o={};function s(f){this.def=f,this.constr=d,this.traits=new Set}s.prototype=o;let i=r,a=i&&new WeakSet;function c(f,h){if(!f._zod){yo.value=new s(h);try{Object.defineProperty(f,"_zod",yo)}finally{yo.value=void 0}}else if(f._zod.traits.has(e))return;if(f._zod.traits.add(e),t(f,h),a){let k=Object.getPrototypeOf(f),y=f._zod.constr.prototype,_=k;while(_&&_!==y)_=Object.getPrototypeOf(_);let g=_??k;if(!a.has(g))a.add(g),sa(g,i)}let m=d.prototype;for(let k in m){if(!Object.prototype.hasOwnProperty.call(m,k))continue;if(!(k in f))f[k]=m[k].bind(f)}}let u=n?.Parent??Object;class l extends u{}Object.defineProperty(l,"name",{value:e});function d(f){let h=n?.Parent?Ch(l):this;c(h,f);let m=h._zod.deferred;if(m){for(let y of m)y();h._zod.deferred=void 0}let k=globalThis.__zod_globalConfig?.postProcessor;if(k)k(h);return h}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:(f)=>{if(n?.Parent&&f instanceof n.Parent)return!0;return f?._zod?.traits?.has(e)}}),Object.defineProperty(d,"name",{value:e}),d}class Pe extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class wr extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`);this.name="ZodEncodeError"}}(ca=globalThis).__zod_globalConfig??(ca.__zod_globalConfig={});var he=globalThis.__zod_globalConfig;function me(e){if(e)Object.assign(he,e);return he}function Ph(){let e=this._zod;return e.message??(e.message=JSON.stringify(e.def,gr,2)),e.message}function Ah(e){this._zod.message=e}var Oh={get:Ph,set:Ah,enumerable:!0,configurable:!0},bo={value:void 0,enumerable:!1},la=new WeakSet([Object.prototype,Error.prototype]),da=(e,t)=>{e.name="$ZodError",bo.value=t,Object.defineProperty(e,"issues",bo),bo.value=void 0,Object.defineProperty(e,"message",Oh);let r=Object.getPrototypeOf(e);if(!la.has(r))la.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})}})},pa=w("$ZodError",da),vb=w("$ZodError",da,void 0,{Parent:Error});function Th(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 _o(e,t=(r)=>r.message){let r={},n=[];for(let o of e.issues)if(o.path.length>0)Th(r,o.path[0],()=>[]).push(t(o));else n.push(t(o));return{formErrors:n,fieldErrors:r}}function xo(e,t=(r)=>r.message){let r={_errors:[]},n=(o,s=[])=>{for(let i of o.issues)if(i.code==="invalid_union"&&i.errors.length)i.errors.map((a)=>n({issues:a},[...s,...i.path]));else if(i.code==="invalid_key")n({issues:i.issues},[...s,...i.path]);else if(i.code==="invalid_element")n({issues:i.issues},[...s,...i.path]);else{let a=[...s,...i.path];if(a.length===0)r._errors.push(t(i));else{let c=r,u=0;while(u<a.length){let l=a[u],d=u===a.length-1;if(l==="_errors"){if(d)c._errors.push(t(i));u++;continue}if(!Object.prototype.hasOwnProperty.call(c,l))Object.defineProperty(c,l,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let f=c[l];if(d)f._errors.push(t(i));c=f,u++}}}};return n(e),r}function Yr(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Qr=(e)=>{let t=(r,n,o,s)=>{let i=o?{...o,async:!1}:{async:!1},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Pe;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Fe(u,i,me())));throw ho(c,s?.callee??t),c}return a.value};return t};var en=(e)=>{let t=async(r,n,o,s)=>{let i=o?{...o,async:!0}:{async:!0},a=r._zod.run({value:n,issues:[]},i);if(a instanceof Promise)a=await a;if(a.issues.length){let c=new(s?.Err??e)(a.issues.map((u)=>Fe(u,i,me())));throw ho(c,s?.callee??t),c}return a.value};return t};var tn=(e)=>(t,r,n)=>{let o=n?{...n,async:!1}:{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Pe;return s.issues.length?fa(e,s.issues,o):{success:!0,data:s.value}};function fa(e,t,r){let n;return{success:!1,get error(){if(!n)n=new e(t.map((o)=>Fe(o,r,me()))),t=void 0,r=void 0;return n},set error(o){n=o,t=void 0,r=void 0}}}var rn=(e)=>async(t,r,n)=>{let o=n?{...n,async:!0}:{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)s=await s;return s.issues.length?fa(e,s.issues,o):{success:!0,data:s.value}};var Eh=Symbol.for("zod.compile.invalid"),Nh=Symbol.for("zod.compile.fallback"),So=(e,t,r)=>{let n=e._zod.bag.validator;if(n!==void 0){if(n(t)!==Eh)return!0;if(n.definite===!0&&r===void 0)return!1}return Dh(e,t,r)};function Dh(e,t,r){let n=r?{...r,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},o=e._zod.bag.fallbackRun,s;if(o)n[Nh]=!0,s=o({value:t,issues:[]},n);else s=e._zod.run({value:t,issues:[]},n);if(s instanceof Promise)throw new Pe;return s.issues.length===0}var Io=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},ha=(e)=>{let t=Qr(e),r=(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return t(n,o,a,Yr(r,i))};return r};var ma=(e)=>{let t=Qr(e),r=(n,o,s,i)=>t(n,o,s,Yr(r,i));return r};var ga=(e)=>{let t=en(e),r=async(n,o,s,i)=>{let a=s?{...s,direction:"backward"}:{direction:"backward"};return await t(n,o,a,Yr(r,i))};return r};var ka=(e)=>{let t=en(e),r=async(n,o,s,i)=>await t(n,o,s,Yr(r,i));return r};var va=(e)=>(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return tn(e)(t,r,o)};var ya=(e)=>(t,r,n)=>tn(e)(t,r,n);var wa=(e)=>async(t,r,n)=>{let o=n?{...n,direction:"backward"}:{direction:"backward"};return rn(e)(t,r,o)};var ba=(e)=>async(t,r,n)=>rn(e)(t,r,n);var _a=/^[cC][0-9a-z]{6,}$/,xa=/^[0-9a-z]+$/,Sa=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Ia=/^[0-9a-vA-V]{20}$/,$a=/^[A-Za-z0-9]{27}$/,Ra=/^[a-zA-Z0-9_-]{21}$/;function za(e){return new RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Ca=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/;var Pa=/^([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})$/,Ro=(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})$`)};var Aa=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;var Lh="^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$";function Oa(){return new RegExp(Lh,"u")}var Ta=/^(?:(?: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])$/,Ea=/^(([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}|:))$/;var Na=/^((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])$/,Da=/^(([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])$/,La=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ja=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;var Wa=/^https?$/,Za=/^\+[1-9]\d{6,14}$/,Fa=/^\d(?:[ -]?\d){11,18}$/;var Ma=/^[A-Z]{2}(?!00|01|99)\d{2}[A-Z0-9]{11,30}$/,qa="(?:(?:\\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])))";function jh(e){return new RegExp(`^${e}$`)}var Ba=jh(qa);function $o(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 Va(e){return new RegExp(`^${$o(e)}$`)}function Ha(e){let t=["Z"];if(e.offset)t.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${$o({precision:e.precision,seconds:!0})}(?:${t.join("|")})`,n=e.local?`${r}|${$o({precision:e.precision})}`:r;return new RegExp(`^${qa}T(?:${n})$`)}var Ua=/^[\s\S]{0,}$/;var zo=/^-?\d+$/,$t=/^-?\d+(?:\.\d+)?$/,Ja=/^(?:true|false)$/i;var Ka=/^[^A-Z]*$/,Ga=/^[^a-z]*$/;var oe=w("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var Co=(e)=>{let t=e.value;return!Ji(t)&&t.length!==void 0},nn={number:"number",bigint:"bigint",object:"date"},Po=w("$ZodCheckLessThan",(e,t)=>{oe.init(e,t);let r=nn[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value<=t.value:n.value<t.value)return;n.issues.push({origin:nn[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})}}),Ao=w("$ZodCheckGreaterThan",(e,t)=>{oe.init(e,t);let r=nn[typeof t.value];e._zod.check=(n)=>{if(t.inclusive?n.value>=t.value:n.value>t.value)return;n.issues.push({origin:nn[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})}}),Xa=w("$ZodCheckMultipleOf",(e,t)=>{oe.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):Ur(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})}}),Ya=w("$ZodCheckNumberFormat",(e,t)=>{oe.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[o,s]=Jr[t.format];e._zod.check=(i)=>{let a=i.value;if(r){if(!Number.isInteger(a)){i.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){if(a>0)i.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 i.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)i.issues.push({origin:"number",input:a,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort});if(a>s)i.issues.push({origin:"number",input:a,code:"too_big",maximum:s,inclusive:!0,inst:e,continue:!t.abort})}});var Qa=w("$ZodCheckMaxLength",(e,t)=>{var r;oe.init(e,t),(r=e._zod.def).when??(r.when=Co),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>t.maximum?Jt(o):s)<=t.maximum)return;let a=Gr(o);n.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),ec=w("$ZodCheckMinLength",(e,t)=>{var r;oe.init(e,t),(r=e._zod.def).when??(r.when=Co),e._zod.check=(n)=>{let o=n.value,s=o.length;if((typeof o==="string"&&s>=t.minimum&&s<t.minimum*2?Jt(o):s)>=t.minimum)return;let a=Gr(o);n.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),tc=w("$ZodCheckLengthEquals",(e,t)=>{var r;oe.init(e,t),(r=e._zod.def).when??(r.when=Co),e._zod.check=(n)=>{let o=n.value,s=o.length,i=typeof o==="string"&&s>=t.length&&s<=t.length*2?Jt(o):s;if(i===t.length)return;let a=Gr(o),c=i>t.length;n.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),br=w("$ZodCheckStringFormat",(e,t)=>{var r,n;if(oe.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=()=>{})}),rc=w("$ZodCheckRegex",(e,t)=>{br.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})}}),nc=w("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=Ka),br.init(e,t)}),oc=w("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=Ga),br.init(e,t)}),sc=w("$ZodCheckIncludes",(e,t)=>{oe.init(e,t);let r=dt(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})}}),ic=w("$ZodCheckStartsWith",(e,t)=>{oe.init(e,t);let r=new RegExp(`^${dt(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})}}),ac=w("$ZodCheckEndsWith",(e,t)=>{oe.init(e,t);let r=new RegExp(`.*${dt(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})}});var cc=w("$ZodCheckOverwrite",(e,t)=>{oe.init(e,t),e._zod.check=(r)=>{r.value=t.tx(r.value)}});class _r{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(`
|
|
91
92
|
`).filter((s)=>s),n=Math.min(...r.map((s)=>s.length-s.trimStart().length)),o=r.map((s)=>s.slice(n)).map((s)=>" ".repeat(this.indent*2)+s);for(let s of o)this.content.push(s)}compile(){let e=Function,t=this?.content??[""];return new e(...Object.keys(this.closed),`return function (${this.args.join(", ")}) {
|