@linzumi/cli 1.0.145 → 1.0.147
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/README.md +1 -1
- package/dist/impl-res/cloud-supervisor.mjs +2 -2
- package/dist/impl-res/crossHarnessFailover.mjs +2 -2
- package/dist/impl-res/index.js +105 -105
- package/dist/impl-res/mcp-server.mjs +2 -2
- package/dist/impl-ts/cloud-supervisor.mjs +2 -2
- package/dist/impl-ts/crossHarnessFailover.mjs +2 -2
- package/dist/impl-ts/index.js +370 -370
- package/dist/impl-ts/mcp-server.mjs +2 -2
- package/dist/mcp-server.mjs +2 -2
- package/package.json +1 -1
- package/scripts/build.mjs +11 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
|
-
const require =
|
|
1
|
+
import { createRequire as __linzumiBundleCreateRequire } from 'node:module';
|
|
2
|
+
const require = __linzumiBundleCreateRequire(import.meta.url);
|
|
3
3
|
var nv=Object.create;var Ii=Object.defineProperty;var ov=Object.getOwnPropertyDescriptor;var sv=Object.getOwnPropertyNames;var iv=Object.getPrototypeOf,av=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ei=(e,t)=>{for(var r in t)Ii(e,r,{get:t[r],enumerable:!0})},cv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sv(t))!av.call(e,o)&&o!==r&&Ii(e,o,{get:()=>t[o],enumerable:!(n=ov(t,o))||n.enumerable});return e};var Dl=(e,t,r)=>(r=e!=null?nv(iv(e)):{},cv(t||!e||!e.__esModule?Ii(r,"default",{value:e,enumerable:!0}):r,e));var eo=z(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.regexpCode=Q.getEsmExportName=Q.getProperty=Q.safeStringify=Q.stringify=Q.strConcat=Q.addCodeArg=Q.str=Q._=Q.nil=Q._Code=Q.Name=Q.IDENTIFIER=Q._CodeOrName=void 0;var Yn=class{};Q._CodeOrName=Yn;Q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Pr=class extends Yn{constructor(t){if(super(),!Q.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Q.Name=Pr;var tt=class extends Yn{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Pr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Q._Code=tt;Q.nil=new tt("");function Mf(e,...t){let r=[e[0]],n=0;for(;n<t.length;)mu(r,t[n]),r.push(e[++n]);return new tt(r)}Q._=Mf;var pu=new tt("+");function Nf(e,...t){let r=[Qn(e[0])],n=0;for(;n<t.length;)r.push(pu),mu(r,t[n]),r.push(pu,Qn(e[++n]));return i0(r),new tt(r)}Q.str=Nf;function mu(e,t){t instanceof tt?e.push(...t._items):t instanceof Pr?e.push(t):e.push(u0(t))}Q.addCodeArg=mu;function i0(e){let t=1;for(;t<e.length-1;){if(e[t]===pu){let r=a0(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function a0(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Pr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Pr))return`"${e}${t.slice(1)}`}function c0(e,t){return t.emptyStr()?e:e.emptyStr()?t:Nf`${e}${t}`}Q.strConcat=c0;function u0(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Qn(Array.isArray(e)?e.join(","):e)}function d0(e){return new tt(Qn(e))}Q.stringify=d0;function Qn(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Q.safeStringify=Qn;function l0(e){return typeof e=="string"&&Q.IDENTIFIER.test(e)?new tt(`.${e}`):Mf`[${e}]`}Q.getProperty=l0;function p0(e){if(typeof e=="string"&&Q.IDENTIFIER.test(e))return new tt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Q.getEsmExportName=p0;function m0(e){return new tt(e.toString())}Q.regexpCode=m0});var gu=z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ValueScope=qe.ValueScopeName=qe.Scope=qe.varKinds=qe.UsedValueState=void 0;var Ue=eo(),fu=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Cs;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Cs||(qe.UsedValueState=Cs={}));qe.varKinds={const:new Ue.Name("const"),let:new Ue.Name("let"),var:new Ue.Name("var")};var As=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ue.Name?t:this.name(t)}name(t){return new Ue.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};qe.Scope=As;var Ms=class extends Ue.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ue._)`.${new Ue.Name(r)}[${n}]`}};qe.ValueScopeName=Ms;var f0=(0,Ue._)`\n`,hu=class extends As{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?f0:Ue.nil}}get(){return this._scope}name(t){return new Ms(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let d=a.get(i);if(d)return d}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ue._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let s=Ue.nil;for(let i in t){let a=t[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Cs.Started);let d=r(u);if(d){let l=this.opts.es5?qe.varKinds.var:qe.varKinds.const;s=(0,Ue._)`${s}${l} ${u} = ${d};${this.opts._n}`}else if(d=o?.(u))s=(0,Ue._)`${s}${d}${this.opts._n}`;else throw new fu(u);c.set(u,Cs.Completed)})}return s}};qe.ValueScope=hu});var F=z(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var X=eo(),ut=gu(),Kt=eo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return Kt._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return Kt.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return Kt.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return Kt.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return Kt.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return Kt.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return Kt.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return Kt.Name}});var Zs=gu();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Zs.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Zs.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Zs.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Zs.varKinds}});V.operators={GT:new X._Code(">"),GTE:new X._Code(">="),LT:new X._Code("<"),LTE:new X._Code("<="),EQ:new X._Code("==="),NEQ:new X._Code("!=="),NOT:new X._Code("!"),OR:new X._Code("||"),AND:new X._Code("&&"),ADD:new X._Code("+")};var jt=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},yu=class extends jt{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ut.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=an(this.rhs,t,r)),this}get names(){return this.rhs instanceof X._CodeOrName?this.rhs.names:{}}},Ns=class extends jt{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof X.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=an(this.rhs,t,r),this}get names(){let t=this.lhs instanceof X.Name?{}:{...this.lhs.names};return Ds(t,this.rhs)}},_u=class extends Ns{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},vu=class extends jt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},bu=class extends jt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},wu=class extends jt{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},ku=class extends jt{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=an(this.code,t,r),this}get names(){return this.code instanceof X._CodeOrName?this.code.names:{}}},to=class extends jt{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(t,r)||(h0(t,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Ir(t,r.names),{})}},Ct=class extends to{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},xu=class extends to{},sn=class extends Ct{};sn.kind="else";var Tr=class e extends Ct{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new sn(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Lf(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=an(this.condition,t,r),this}get names(){let t=super.names;return Ds(t,this.condition),this.else&&Ir(t,this.else.names),t}};Tr.kind="if";var Rr=class extends Ct{};Rr.kind="for";var Su=class extends Rr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=an(this.iteration,t,r),this}get names(){return Ir(super.names,this.iteration.names)}},$u=class extends Rr{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?ut.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){let t=Ds(super.names,this.from);return Ds(t,this.to)}},Ls=class extends Rr{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=an(this.iterable,t,r),this}get names(){return Ir(super.names,this.iterable.names)}},ro=class extends Ct{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};ro.kind="func";var no=class extends to{render(t){return"return "+super.render(t)}};no.kind="return";var zu=class extends Ct{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Ir(t,this.catch.names),this.finally&&Ir(t,this.finally.names),t}},oo=class extends Ct{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};oo.kind="catch";var so=class extends Ct{render(t){return"finally"+super.render(t)}};so.kind="finally";var Pu=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
4
|
`:""},this._extScope=t,this._scope=new ut.Scope({parent:t}),this._nodes=[new xu]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new yu(t,s,n)),s}const(t,r,n){return this._def(ut.varKinds.const,t,r,n)}let(t,r,n){return this._def(ut.varKinds.let,t,r,n)}var(t,r,n){return this._def(ut.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Ns(t,r,n))}add(t,r){return this._leafNode(new _u(t,V.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==X.nil&&this._leafNode(new ku(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,X.addCodeArg)(r,o));return r.push("}"),new X._Code(r)}if(t,r,n){if(this._blockNode(new Tr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Tr(t))}else(){return this._elseNode(new sn)}endIf(){return this._endBlockNode(Tr,sn)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Su(t),r)}forRange(t,r,n,o,s=this.opts.es5?ut.varKinds.var:ut.varKinds.let){let i=this._scope.toName(t);return this._for(new $u(s,i,r,n),()=>o(i))}forOf(t,r,n,o=ut.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let i=r instanceof X.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,X._)`${i}.length`,a=>{this.var(s,(0,X._)`${i}[${a}]`),n(s)})}return this._for(new Ls("of",o,s,r),()=>n(s))}forIn(t,r,n,o=this.opts.es5?ut.varKinds.var:ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,X._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new Ls("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Rr)}label(t){return this._leafNode(new vu(t))}break(t){return this._leafNode(new bu(t))}return(t){let r=new no;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(no)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zu;if(this._blockNode(o),this.code(t),r){let s=this.name("e");this._currNode=o.catch=new oo(s),r(s)}return n&&(this._currNode=o.finally=new so,this.code(n)),this._endBlockNode(oo,so)}throw(t){return this._leafNode(new wu(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=X.nil,n,o){return this._blockNode(new ro(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ro)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Tr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};V.CodeGen=Pu;function Ir(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ds(e,t){return t instanceof X._CodeOrName?Ir(e,t.names):e}function an(e,t,r){if(e instanceof X.Name)return n(e);if(!o(e))return e;return new X._Code(e._items.reduce((s,i)=>(i instanceof X.Name&&(i=n(i)),i instanceof X._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||t[s.str]!==1?s:(delete t[s.str],i)}function o(s){return s instanceof X._Code&&s._items.some(i=>i instanceof X.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function h0(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,X._)`!${Tu(e)}`}V.not=Lf;var g0=Df(V.operators.AND);function y0(...e){return e.reduce(g0)}V.and=y0;var _0=Df(V.operators.OR);function v0(...e){return e.reduce(_0)}V.or=v0;function Df(e){return(t,r)=>t===X.nil?r:r===X.nil?t:(0,X._)`${Tu(t)} ${e} ${Tu(r)}`}function Tu(e){return e instanceof X.Name?e:(0,X._)`(${e})`}});var ee=z(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var se=F(),b0=eo();function w0(e){let t={};for(let r of e)t[r]=!0;return t}B.toHash=w0;function k0(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(qf(e,t),!Jf(t,e.self.RULES.all))}B.alwaysValidSchema=k0;function qf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let s in t)o[s]||Bf(e,`unknown keyword: "${s}"`)}B.checkUnknownRules=qf;function Jf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}B.schemaHasRules=Jf;function x0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}B.schemaHasRulesButRef=x0;function S0({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,se._)`${r}`}return(0,se._)`${e}${t}${(0,se.getProperty)(n)}`}B.schemaRefOrVal=S0;function $0(e){return Ff(decodeURIComponent(e))}B.unescapeFragment=$0;function z0(e){return encodeURIComponent(Iu(e))}B.escapeFragment=z0;function Iu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Iu;function Ff(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=Ff;function P0(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}B.eachItem=P0;function Zf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof se.Name?(s instanceof se.Name?e(o,s,i):t(o,s,i),i):s instanceof se.Name?(t(o,i,s),s):r(s,i);return a===se.Name&&!(c instanceof se.Name)?n(o,c):c}}B.mergeEvaluated={props:Zf({mergeNames:(e,t,r)=>e.if((0,se._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,se._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,se._)`${r} || {}`).code((0,se._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,se._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,se._)`${r} || {}`),Eu(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Vf}),items:Zf({mergeNames:(e,t,r)=>e.if((0,se._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,se._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,se._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,se._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,se._)`{}`);return t!==void 0&&Eu(e,r,t),r}B.evaluatedPropsToName=Vf;function Eu(e,t,r){Object.keys(r).forEach(n=>e.assign((0,se._)`${t}${(0,se.getProperty)(n)}`,!0))}B.setEvaluated=Eu;var Uf={};function T0(e,t){return e.scopeValue("func",{ref:t,code:Uf[t.code]||(Uf[t.code]=new b0._Code(t.code))})}B.useFunc=T0;var Ru;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ru||(B.Type=Ru={}));function R0(e,t,r){if(e instanceof se.Name){let n=t===Ru.Num;return r?n?(0,se._)`"[" + ${e} + "]"`:(0,se._)`"['" + ${e} + "']"`:n?(0,se._)`"/" + ${e}`:(0,se._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,se.getProperty)(e).toString():"/"+Iu(e)}B.getErrorPath=R0;function Bf(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}B.checkStrictMode=Bf});var At=z(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});var Re=F(),I0={data:new Re.Name("data"),valCxt:new Re.Name("valCxt"),instancePath:new Re.Name("instancePath"),parentData:new Re.Name("parentData"),parentDataProperty:new Re.Name("parentDataProperty"),rootData:new Re.Name("rootData"),dynamicAnchors:new Re.Name("dynamicAnchors"),vErrors:new Re.Name("vErrors"),errors:new Re.Name("errors"),this:new Re.Name("this"),self:new Re.Name("self"),scope:new Re.Name("scope"),json:new Re.Name("json"),jsonPos:new Re.Name("jsonPos"),jsonLen:new Re.Name("jsonLen"),jsonPart:new Re.Name("jsonPart")};Ou.default=I0});var io=z(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.extendErrors=Ie.resetErrorsCount=Ie.reportExtraError=Ie.reportError=Ie.keyword$DataError=Ie.keywordError=void 0;var Y=F(),Us=ee(),Ae=At();Ie.keywordError={message:({keyword:e})=>(0,Y.str)`must pass "${e}" keyword validation`};Ie.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,Y.str)`"${e}" keyword must be ${t} ($data)`:(0,Y.str)`"${e}" keyword is invalid ($data)`};function E0(e,t=Ie.keywordError,r,n){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=Kf(e,t,r);n??(i||a)?Hf(s,c):Wf(o,(0,Y._)`[${c}]`)}Ie.reportError=E0;function O0(e,t=Ie.keywordError,r){let{it:n}=e,{gen:o,compositeRule:s,allErrors:i}=n,a=Kf(e,t,r);Hf(o,a),s||i||Wf(n,Ae.default.vErrors)}Ie.reportExtraError=O0;function j0(e,t){e.assign(Ae.default.errors,t),e.if((0,Y._)`${Ae.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,Y._)`${Ae.default.vErrors}.length`,t),()=>e.assign(Ae.default.vErrors,null)))}Ie.resetErrorsCount=j0;function C0({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Ae.default.errors,a=>{e.const(i,(0,Y._)`${Ae.default.vErrors}[${a}]`),e.if((0,Y._)`${i}.instancePath === undefined`,()=>e.assign((0,Y._)`${i}.instancePath`,(0,Y.strConcat)(Ae.default.instancePath,s.errorPath))),e.assign((0,Y._)`${i}.schemaPath`,(0,Y.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,Y._)`${i}.schema`,r),e.assign((0,Y._)`${i}.data`,n))})}Ie.extendErrors=C0;function Hf(e,t){let r=e.const("err",t);e.if((0,Y._)`${Ae.default.vErrors} === null`,()=>e.assign(Ae.default.vErrors,(0,Y._)`[${r}]`),(0,Y._)`${Ae.default.vErrors}.push(${r})`),e.code((0,Y._)`${Ae.default.errors}++`)}function Wf(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,Y._)`new ${e.ValidationError}(${t})`):(r.assign((0,Y._)`${n}.errors`,t),r.return(!1))}var Er={keyword:new Y.Name("keyword"),schemaPath:new Y.Name("schemaPath"),params:new Y.Name("params"),propertyName:new Y.Name("propertyName"),message:new Y.Name("message"),schema:new Y.Name("schema"),parentSchema:new Y.Name("parentSchema")};function Kf(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,Y._)`{}`:A0(e,t,r)}function A0(e,t,r={}){let{gen:n,it:o}=e,s=[M0(o,r),N0(e,r)];return L0(e,t,s),n.object(...s)}function M0({errorPath:e},{instancePath:t}){let r=t?(0,Y.str)`${e}${(0,Us.getErrorPath)(t,Us.Type.Str)}`:e;return[Ae.default.instancePath,(0,Y.strConcat)(Ae.default.instancePath,r)]}function N0({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,Y.str)`${t}/${e}`;return r&&(o=(0,Y.str)`${o}${(0,Us.getErrorPath)(r,Us.Type.Str)}`),[Er.schemaPath,o]}function L0(e,{params:t,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;n.push([Er.keyword,o],[Er.params,typeof t=="function"?t(e):t||(0,Y._)`{}`]),c.messages&&n.push([Er.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Er.schema,i],[Er.parentSchema,(0,Y._)`${d}${l}`],[Ae.default.data,s]),u&&n.push([Er.propertyName,u])}});var Xf=z(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.boolOrEmptySchema=cn.topBoolOrEmptySchema=void 0;var D0=io(),Z0=F(),U0=At(),q0={message:"boolean schema is false"};function J0(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Gf(e,!1):typeof r=="object"&&r.$async===!0?t.return(U0.default.data):(t.assign((0,Z0._)`${n}.errors`,null),t.return(!0))}cn.topBoolOrEmptySchema=J0;function F0(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Gf(e)):r.var(t,!0)}cn.boolOrEmptySchema=F0;function Gf(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,D0.reportError)(o,q0,void 0,t)}});var ju=z(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.getRules=un.isJSONType=void 0;var V0=["string","number","integer","boolean","null","object","array"],B0=new Set(V0);function H0(e){return typeof e=="string"&&B0.has(e)}un.isJSONType=H0;function W0(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}un.getRules=W0});var Cu=z(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.shouldUseRule=Gt.shouldUseGroup=Gt.schemaHasRulesForType=void 0;function K0({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Yf(e,n)}Gt.schemaHasRulesForType=K0;function Yf(e,t){return t.rules.some(r=>Qf(e,r))}Gt.shouldUseGroup=Yf;function Qf(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Gt.shouldUseRule=Qf});var ao=z(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.reportTypeError=Ee.checkDataTypes=Ee.checkDataType=Ee.coerceAndCheckDataType=Ee.getJSONTypes=Ee.getSchemaTypes=Ee.DataType=void 0;var G0=ju(),X0=Cu(),Y0=io(),q=F(),eh=ee(),dn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(dn||(Ee.DataType=dn={}));function Q0(e){let t=th(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ee.getSchemaTypes=Q0;function th(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(G0.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ee.getJSONTypes=th;function eS(e,t){let{gen:r,data:n,opts:o}=e,s=tS(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,X0.schemaHasRulesForType)(e,t[0]));if(i){let a=Mu(t,n,o.strictNumbers,dn.Wrong);r.if(a,()=>{s.length?rS(e,t,s):Nu(e)})}return i}Ee.coerceAndCheckDataType=eS;var rh=new Set(["string","number","integer","boolean","null"]);function tS(e,t){return t?e.filter(r=>rh.has(r)||t==="array"&&r==="array"):[]}function rS(e,t,r){let{gen:n,data:o,opts:s}=e,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(Mu(t,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(rh.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Nu(e),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),nS(e,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
|
|
5
5
|
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,q._)`+${o}`);return;case"integer":n.elseIf((0,q._)`${i} === "boolean" || ${o} === null
|
package/dist/mcp-server.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';
|
|
2
|
-
const require =
|
|
1
|
+
import { createRequire as __linzumiBundleCreateRequire } from 'node:module';
|
|
2
|
+
const require = __linzumiBundleCreateRequire(import.meta.url);
|
|
3
3
|
var nv=Object.create;var Ii=Object.defineProperty;var ov=Object.getOwnPropertyDescriptor;var sv=Object.getOwnPropertyNames;var iv=Object.getPrototypeOf,av=Object.prototype.hasOwnProperty;var z=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Ei=(e,t)=>{for(var r in t)Ii(e,r,{get:t[r],enumerable:!0})},cv=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of sv(t))!av.call(e,o)&&o!==r&&Ii(e,o,{get:()=>t[o],enumerable:!(n=ov(t,o))||n.enumerable});return e};var Dl=(e,t,r)=>(r=e!=null?nv(iv(e)):{},cv(t||!e||!e.__esModule?Ii(r,"default",{value:e,enumerable:!0}):r,e));var eo=z(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.regexpCode=Q.getEsmExportName=Q.getProperty=Q.safeStringify=Q.stringify=Q.strConcat=Q.addCodeArg=Q.str=Q._=Q.nil=Q._Code=Q.Name=Q.IDENTIFIER=Q._CodeOrName=void 0;var Yn=class{};Q._CodeOrName=Yn;Q.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;var Pr=class extends Yn{constructor(t){if(super(),!Q.IDENTIFIER.test(t))throw new Error("CodeGen: name must be a valid identifier");this.str=t}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}};Q.Name=Pr;var tt=class extends Yn{constructor(t){super(),this._items=typeof t=="string"?[t]:t}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let t=this._items[0];return t===""||t==='""'}get str(){var t;return(t=this._str)!==null&&t!==void 0?t:this._str=this._items.reduce((r,n)=>`${r}${n}`,"")}get names(){var t;return(t=this._names)!==null&&t!==void 0?t:this._names=this._items.reduce((r,n)=>(n instanceof Pr&&(r[n.str]=(r[n.str]||0)+1),r),{})}};Q._Code=tt;Q.nil=new tt("");function Mf(e,...t){let r=[e[0]],n=0;for(;n<t.length;)mu(r,t[n]),r.push(e[++n]);return new tt(r)}Q._=Mf;var pu=new tt("+");function Nf(e,...t){let r=[Qn(e[0])],n=0;for(;n<t.length;)r.push(pu),mu(r,t[n]),r.push(pu,Qn(e[++n]));return i0(r),new tt(r)}Q.str=Nf;function mu(e,t){t instanceof tt?e.push(...t._items):t instanceof Pr?e.push(t):e.push(u0(t))}Q.addCodeArg=mu;function i0(e){let t=1;for(;t<e.length-1;){if(e[t]===pu){let r=a0(e[t-1],e[t+1]);if(r!==void 0){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function a0(e,t){if(t==='""')return e;if(e==='""')return t;if(typeof e=="string")return t instanceof Pr||e[e.length-1]!=='"'?void 0:typeof t!="string"?`${e.slice(0,-1)}${t}"`:t[0]==='"'?e.slice(0,-1)+t.slice(1):void 0;if(typeof t=="string"&&t[0]==='"'&&!(e instanceof Pr))return`"${e}${t.slice(1)}`}function c0(e,t){return t.emptyStr()?e:e.emptyStr()?t:Nf`${e}${t}`}Q.strConcat=c0;function u0(e){return typeof e=="number"||typeof e=="boolean"||e===null?e:Qn(Array.isArray(e)?e.join(","):e)}function d0(e){return new tt(Qn(e))}Q.stringify=d0;function Qn(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}Q.safeStringify=Qn;function l0(e){return typeof e=="string"&&Q.IDENTIFIER.test(e)?new tt(`.${e}`):Mf`[${e}]`}Q.getProperty=l0;function p0(e){if(typeof e=="string"&&Q.IDENTIFIER.test(e))return new tt(`${e}`);throw new Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}Q.getEsmExportName=p0;function m0(e){return new tt(e.toString())}Q.regexpCode=m0});var gu=z(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.ValueScope=qe.ValueScopeName=qe.Scope=qe.varKinds=qe.UsedValueState=void 0;var Ue=eo(),fu=class extends Error{constructor(t){super(`CodeGen: "code" for ${t} not defined`),this.value=t.value}},Cs;(function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"})(Cs||(qe.UsedValueState=Cs={}));qe.varKinds={const:new Ue.Name("const"),let:new Ue.Name("let"),var:new Ue.Name("var")};var As=class{constructor({prefixes:t,parent:r}={}){this._names={},this._prefixes=t,this._parent=r}toName(t){return t instanceof Ue.Name?t:this.name(t)}name(t){return new Ue.Name(this._newName(t))}_newName(t){let r=this._names[t]||this._nameGroup(t);return`${t}${r.index++}`}_nameGroup(t){var r,n;if(!((n=(r=this._parent)===null||r===void 0?void 0:r._prefixes)===null||n===void 0)&&n.has(t)||this._prefixes&&!this._prefixes.has(t))throw new Error(`CodeGen: prefix "${t}" is not allowed in this scope`);return this._names[t]={prefix:t,index:0}}};qe.Scope=As;var Ms=class extends Ue.Name{constructor(t,r){super(r),this.prefix=t}setValue(t,{property:r,itemIndex:n}){this.value=t,this.scopePath=(0,Ue._)`.${new Ue.Name(r)}[${n}]`}};qe.ValueScopeName=Ms;var f0=(0,Ue._)`\n`,hu=class extends As{constructor(t){super(t),this._values={},this._scope=t.scope,this.opts={...t,_n:t.lines?f0:Ue.nil}}get(){return this._scope}name(t){return new Ms(t,this._newName(t))}value(t,r){var n;if(r.ref===void 0)throw new Error("CodeGen: ref must be passed in value");let o=this.toName(t),{prefix:s}=o,i=(n=r.key)!==null&&n!==void 0?n:r.ref,a=this._values[s];if(a){let d=a.get(i);if(d)return d}else a=this._values[s]=new Map;a.set(i,o);let c=this._scope[s]||(this._scope[s]=[]),u=c.length;return c[u]=r.ref,o.setValue(r,{property:s,itemIndex:u}),o}getValue(t,r){let n=this._values[t];if(n)return n.get(r)}scopeRefs(t,r=this._values){return this._reduceValues(r,n=>{if(n.scopePath===void 0)throw new Error(`CodeGen: name "${n}" has no value`);return(0,Ue._)`${t}${n.scopePath}`})}scopeCode(t=this._values,r,n){return this._reduceValues(t,o=>{if(o.value===void 0)throw new Error(`CodeGen: name "${o}" has no value`);return o.value.code},r,n)}_reduceValues(t,r,n={},o){let s=Ue.nil;for(let i in t){let a=t[i];if(!a)continue;let c=n[i]=n[i]||new Map;a.forEach(u=>{if(c.has(u))return;c.set(u,Cs.Started);let d=r(u);if(d){let l=this.opts.es5?qe.varKinds.var:qe.varKinds.const;s=(0,Ue._)`${s}${l} ${u} = ${d};${this.opts._n}`}else if(d=o?.(u))s=(0,Ue._)`${s}${d}${this.opts._n}`;else throw new fu(u);c.set(u,Cs.Completed)})}return s}};qe.ValueScope=hu});var F=z(V=>{"use strict";Object.defineProperty(V,"__esModule",{value:!0});V.or=V.and=V.not=V.CodeGen=V.operators=V.varKinds=V.ValueScopeName=V.ValueScope=V.Scope=V.Name=V.regexpCode=V.stringify=V.getProperty=V.nil=V.strConcat=V.str=V._=void 0;var X=eo(),ut=gu(),Kt=eo();Object.defineProperty(V,"_",{enumerable:!0,get:function(){return Kt._}});Object.defineProperty(V,"str",{enumerable:!0,get:function(){return Kt.str}});Object.defineProperty(V,"strConcat",{enumerable:!0,get:function(){return Kt.strConcat}});Object.defineProperty(V,"nil",{enumerable:!0,get:function(){return Kt.nil}});Object.defineProperty(V,"getProperty",{enumerable:!0,get:function(){return Kt.getProperty}});Object.defineProperty(V,"stringify",{enumerable:!0,get:function(){return Kt.stringify}});Object.defineProperty(V,"regexpCode",{enumerable:!0,get:function(){return Kt.regexpCode}});Object.defineProperty(V,"Name",{enumerable:!0,get:function(){return Kt.Name}});var Zs=gu();Object.defineProperty(V,"Scope",{enumerable:!0,get:function(){return Zs.Scope}});Object.defineProperty(V,"ValueScope",{enumerable:!0,get:function(){return Zs.ValueScope}});Object.defineProperty(V,"ValueScopeName",{enumerable:!0,get:function(){return Zs.ValueScopeName}});Object.defineProperty(V,"varKinds",{enumerable:!0,get:function(){return Zs.varKinds}});V.operators={GT:new X._Code(">"),GTE:new X._Code(">="),LT:new X._Code("<"),LTE:new X._Code("<="),EQ:new X._Code("==="),NEQ:new X._Code("!=="),NOT:new X._Code("!"),OR:new X._Code("||"),AND:new X._Code("&&"),ADD:new X._Code("+")};var jt=class{optimizeNodes(){return this}optimizeNames(t,r){return this}},yu=class extends jt{constructor(t,r,n){super(),this.varKind=t,this.name=r,this.rhs=n}render({es5:t,_n:r}){let n=t?ut.varKinds.var:this.varKind,o=this.rhs===void 0?"":` = ${this.rhs}`;return`${n} ${this.name}${o};`+r}optimizeNames(t,r){if(t[this.name.str])return this.rhs&&(this.rhs=an(this.rhs,t,r)),this}get names(){return this.rhs instanceof X._CodeOrName?this.rhs.names:{}}},Ns=class extends jt{constructor(t,r,n){super(),this.lhs=t,this.rhs=r,this.sideEffects=n}render({_n:t}){return`${this.lhs} = ${this.rhs};`+t}optimizeNames(t,r){if(!(this.lhs instanceof X.Name&&!t[this.lhs.str]&&!this.sideEffects))return this.rhs=an(this.rhs,t,r),this}get names(){let t=this.lhs instanceof X.Name?{}:{...this.lhs.names};return Ds(t,this.rhs)}},_u=class extends Ns{constructor(t,r,n,o){super(t,n,o),this.op=r}render({_n:t}){return`${this.lhs} ${this.op}= ${this.rhs};`+t}},vu=class extends jt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`${this.label}:`+t}},bu=class extends jt{constructor(t){super(),this.label=t,this.names={}}render({_n:t}){return`break${this.label?` ${this.label}`:""};`+t}},wu=class extends jt{constructor(t){super(),this.error=t}render({_n:t}){return`throw ${this.error};`+t}get names(){return this.error.names}},ku=class extends jt{constructor(t){super(),this.code=t}render({_n:t}){return`${this.code};`+t}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(t,r){return this.code=an(this.code,t,r),this}get names(){return this.code instanceof X._CodeOrName?this.code.names:{}}},to=class extends jt{constructor(t=[]){super(),this.nodes=t}render(t){return this.nodes.reduce((r,n)=>r+n.render(t),"")}optimizeNodes(){let{nodes:t}=this,r=t.length;for(;r--;){let n=t[r].optimizeNodes();Array.isArray(n)?t.splice(r,1,...n):n?t[r]=n:t.splice(r,1)}return t.length>0?this:void 0}optimizeNames(t,r){let{nodes:n}=this,o=n.length;for(;o--;){let s=n[o];s.optimizeNames(t,r)||(h0(t,s.names),n.splice(o,1))}return n.length>0?this:void 0}get names(){return this.nodes.reduce((t,r)=>Ir(t,r.names),{})}},Ct=class extends to{render(t){return"{"+t._n+super.render(t)+"}"+t._n}},xu=class extends to{},sn=class extends Ct{};sn.kind="else";var Tr=class e extends Ct{constructor(t,r){super(r),this.condition=t}render(t){let r=`if(${this.condition})`+super.render(t);return this.else&&(r+="else "+this.else.render(t)),r}optimizeNodes(){super.optimizeNodes();let t=this.condition;if(t===!0)return this.nodes;let r=this.else;if(r){let n=r.optimizeNodes();r=this.else=Array.isArray(n)?new sn(n):n}if(r)return t===!1?r instanceof e?r:r.nodes:this.nodes.length?this:new e(Lf(t),r instanceof e?[r]:r.nodes);if(!(t===!1||!this.nodes.length))return this}optimizeNames(t,r){var n;if(this.else=(n=this.else)===null||n===void 0?void 0:n.optimizeNames(t,r),!!(super.optimizeNames(t,r)||this.else))return this.condition=an(this.condition,t,r),this}get names(){let t=super.names;return Ds(t,this.condition),this.else&&Ir(t,this.else.names),t}};Tr.kind="if";var Rr=class extends Ct{};Rr.kind="for";var Su=class extends Rr{constructor(t){super(),this.iteration=t}render(t){return`for(${this.iteration})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iteration=an(this.iteration,t,r),this}get names(){return Ir(super.names,this.iteration.names)}},$u=class extends Rr{constructor(t,r,n,o){super(),this.varKind=t,this.name=r,this.from=n,this.to=o}render(t){let r=t.es5?ut.varKinds.var:this.varKind,{name:n,from:o,to:s}=this;return`for(${r} ${n}=${o}; ${n}<${s}; ${n}++)`+super.render(t)}get names(){let t=Ds(super.names,this.from);return Ds(t,this.to)}},Ls=class extends Rr{constructor(t,r,n,o){super(),this.loop=t,this.varKind=r,this.name=n,this.iterable=o}render(t){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(t)}optimizeNames(t,r){if(super.optimizeNames(t,r))return this.iterable=an(this.iterable,t,r),this}get names(){return Ir(super.names,this.iterable.names)}},ro=class extends Ct{constructor(t,r,n){super(),this.name=t,this.args=r,this.async=n}render(t){return`${this.async?"async ":""}function ${this.name}(${this.args})`+super.render(t)}};ro.kind="func";var no=class extends to{render(t){return"return "+super.render(t)}};no.kind="return";var zu=class extends Ct{render(t){let r="try"+super.render(t);return this.catch&&(r+=this.catch.render(t)),this.finally&&(r+=this.finally.render(t)),r}optimizeNodes(){var t,r;return super.optimizeNodes(),(t=this.catch)===null||t===void 0||t.optimizeNodes(),(r=this.finally)===null||r===void 0||r.optimizeNodes(),this}optimizeNames(t,r){var n,o;return super.optimizeNames(t,r),(n=this.catch)===null||n===void 0||n.optimizeNames(t,r),(o=this.finally)===null||o===void 0||o.optimizeNames(t,r),this}get names(){let t=super.names;return this.catch&&Ir(t,this.catch.names),this.finally&&Ir(t,this.finally.names),t}},oo=class extends Ct{constructor(t){super(),this.error=t}render(t){return`catch(${this.error})`+super.render(t)}};oo.kind="catch";var so=class extends Ct{render(t){return"finally"+super.render(t)}};so.kind="finally";var Pu=class{constructor(t,r={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...r,_n:r.lines?`
|
|
4
4
|
`:""},this._extScope=t,this._scope=new ut.Scope({parent:t}),this._nodes=[new xu]}toString(){return this._root.render(this.opts)}name(t){return this._scope.name(t)}scopeName(t){return this._extScope.name(t)}scopeValue(t,r){let n=this._extScope.value(t,r);return(this._values[n.prefix]||(this._values[n.prefix]=new Set)).add(n),n}getScopeValue(t,r){return this._extScope.getValue(t,r)}scopeRefs(t){return this._extScope.scopeRefs(t,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(t,r,n,o){let s=this._scope.toName(r);return n!==void 0&&o&&(this._constants[s.str]=n),this._leafNode(new yu(t,s,n)),s}const(t,r,n){return this._def(ut.varKinds.const,t,r,n)}let(t,r,n){return this._def(ut.varKinds.let,t,r,n)}var(t,r,n){return this._def(ut.varKinds.var,t,r,n)}assign(t,r,n){return this._leafNode(new Ns(t,r,n))}add(t,r){return this._leafNode(new _u(t,V.operators.ADD,r))}code(t){return typeof t=="function"?t():t!==X.nil&&this._leafNode(new ku(t)),this}object(...t){let r=["{"];for(let[n,o]of t)r.length>1&&r.push(","),r.push(n),(n!==o||this.opts.es5)&&(r.push(":"),(0,X.addCodeArg)(r,o));return r.push("}"),new X._Code(r)}if(t,r,n){if(this._blockNode(new Tr(t)),r&&n)this.code(r).else().code(n).endIf();else if(r)this.code(r).endIf();else if(n)throw new Error('CodeGen: "else" body without "then" body');return this}elseIf(t){return this._elseNode(new Tr(t))}else(){return this._elseNode(new sn)}endIf(){return this._endBlockNode(Tr,sn)}_for(t,r){return this._blockNode(t),r&&this.code(r).endFor(),this}for(t,r){return this._for(new Su(t),r)}forRange(t,r,n,o,s=this.opts.es5?ut.varKinds.var:ut.varKinds.let){let i=this._scope.toName(t);return this._for(new $u(s,i,r,n),()=>o(i))}forOf(t,r,n,o=ut.varKinds.const){let s=this._scope.toName(t);if(this.opts.es5){let i=r instanceof X.Name?r:this.var("_arr",r);return this.forRange("_i",0,(0,X._)`${i}.length`,a=>{this.var(s,(0,X._)`${i}[${a}]`),n(s)})}return this._for(new Ls("of",o,s,r),()=>n(s))}forIn(t,r,n,o=this.opts.es5?ut.varKinds.var:ut.varKinds.const){if(this.opts.ownProperties)return this.forOf(t,(0,X._)`Object.keys(${r})`,n);let s=this._scope.toName(t);return this._for(new Ls("in",o,s,r),()=>n(s))}endFor(){return this._endBlockNode(Rr)}label(t){return this._leafNode(new vu(t))}break(t){return this._leafNode(new bu(t))}return(t){let r=new no;if(this._blockNode(r),this.code(t),r.nodes.length!==1)throw new Error('CodeGen: "return" should have one node');return this._endBlockNode(no)}try(t,r,n){if(!r&&!n)throw new Error('CodeGen: "try" without "catch" and "finally"');let o=new zu;if(this._blockNode(o),this.code(t),r){let s=this.name("e");this._currNode=o.catch=new oo(s),r(s)}return n&&(this._currNode=o.finally=new so,this.code(n)),this._endBlockNode(oo,so)}throw(t){return this._leafNode(new wu(t))}block(t,r){return this._blockStarts.push(this._nodes.length),t&&this.code(t).endBlock(r),this}endBlock(t){let r=this._blockStarts.pop();if(r===void 0)throw new Error("CodeGen: not in self-balancing block");let n=this._nodes.length-r;if(n<0||t!==void 0&&n!==t)throw new Error(`CodeGen: wrong number of nodes: ${n} vs ${t} expected`);return this._nodes.length=r,this}func(t,r=X.nil,n,o){return this._blockNode(new ro(t,r,n)),o&&this.code(o).endFunc(),this}endFunc(){return this._endBlockNode(ro)}optimize(t=1){for(;t-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(t){return this._currNode.nodes.push(t),this}_blockNode(t){this._currNode.nodes.push(t),this._nodes.push(t)}_endBlockNode(t,r){let n=this._currNode;if(n instanceof t||r&&n instanceof r)return this._nodes.pop(),this;throw new Error(`CodeGen: not in block "${r?`${t.kind}/${r.kind}`:t.kind}"`)}_elseNode(t){let r=this._currNode;if(!(r instanceof Tr))throw new Error('CodeGen: "else" without "if"');return this._currNode=r.else=t,this}get _root(){return this._nodes[0]}get _currNode(){let t=this._nodes;return t[t.length-1]}set _currNode(t){let r=this._nodes;r[r.length-1]=t}};V.CodeGen=Pu;function Ir(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function Ds(e,t){return t instanceof X._CodeOrName?Ir(e,t.names):e}function an(e,t,r){if(e instanceof X.Name)return n(e);if(!o(e))return e;return new X._Code(e._items.reduce((s,i)=>(i instanceof X.Name&&(i=n(i)),i instanceof X._Code?s.push(...i._items):s.push(i),s),[]));function n(s){let i=r[s.str];return i===void 0||t[s.str]!==1?s:(delete t[s.str],i)}function o(s){return s instanceof X._Code&&s._items.some(i=>i instanceof X.Name&&t[i.str]===1&&r[i.str]!==void 0)}}function h0(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function Lf(e){return typeof e=="boolean"||typeof e=="number"||e===null?!e:(0,X._)`!${Tu(e)}`}V.not=Lf;var g0=Df(V.operators.AND);function y0(...e){return e.reduce(g0)}V.and=y0;var _0=Df(V.operators.OR);function v0(...e){return e.reduce(_0)}V.or=v0;function Df(e){return(t,r)=>t===X.nil?r:r===X.nil?t:(0,X._)`${Tu(t)} ${e} ${Tu(r)}`}function Tu(e){return e instanceof X.Name?e:(0,X._)`(${e})`}});var ee=z(B=>{"use strict";Object.defineProperty(B,"__esModule",{value:!0});B.checkStrictMode=B.getErrorPath=B.Type=B.useFunc=B.setEvaluated=B.evaluatedPropsToName=B.mergeEvaluated=B.eachItem=B.unescapeJsonPointer=B.escapeJsonPointer=B.escapeFragment=B.unescapeFragment=B.schemaRefOrVal=B.schemaHasRulesButRef=B.schemaHasRules=B.checkUnknownRules=B.alwaysValidSchema=B.toHash=void 0;var se=F(),b0=eo();function w0(e){let t={};for(let r of e)t[r]=!0;return t}B.toHash=w0;function k0(e,t){return typeof t=="boolean"?t:Object.keys(t).length===0?!0:(qf(e,t),!Jf(t,e.self.RULES.all))}B.alwaysValidSchema=k0;function qf(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||typeof t=="boolean")return;let o=n.RULES.keywords;for(let s in t)o[s]||Bf(e,`unknown keyword: "${s}"`)}B.checkUnknownRules=qf;function Jf(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(t[r])return!0;return!1}B.schemaHasRules=Jf;function x0(e,t){if(typeof e=="boolean")return!e;for(let r in e)if(r!=="$ref"&&t.all[r])return!0;return!1}B.schemaHasRulesButRef=x0;function S0({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if(typeof r=="number"||typeof r=="boolean")return r;if(typeof r=="string")return(0,se._)`${r}`}return(0,se._)`${e}${t}${(0,se.getProperty)(n)}`}B.schemaRefOrVal=S0;function $0(e){return Ff(decodeURIComponent(e))}B.unescapeFragment=$0;function z0(e){return encodeURIComponent(Iu(e))}B.escapeFragment=z0;function Iu(e){return typeof e=="number"?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}B.escapeJsonPointer=Iu;function Ff(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}B.unescapeJsonPointer=Ff;function P0(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}B.eachItem=P0;function Zf({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,i,a)=>{let c=i===void 0?s:i instanceof se.Name?(s instanceof se.Name?e(o,s,i):t(o,s,i),i):s instanceof se.Name?(t(o,i,s),s):r(s,i);return a===se.Name&&!(c instanceof se.Name)?n(o,c):c}}B.mergeEvaluated={props:Zf({mergeNames:(e,t,r)=>e.if((0,se._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,se._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,se._)`${r} || {}`).code((0,se._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,se._)`${r} !== true`,()=>{t===!0?e.assign(r,!0):(e.assign(r,(0,se._)`${r} || {}`),Eu(e,r,t))}),mergeValues:(e,t)=>e===!0?!0:{...e,...t},resultToName:Vf}),items:Zf({mergeNames:(e,t,r)=>e.if((0,se._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,se._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,se._)`${r} !== true`,()=>e.assign(r,t===!0?!0:(0,se._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>e===!0?!0:Math.max(e,t),resultToName:(e,t)=>e.var("items",t)})};function Vf(e,t){if(t===!0)return e.var("props",!0);let r=e.var("props",(0,se._)`{}`);return t!==void 0&&Eu(e,r,t),r}B.evaluatedPropsToName=Vf;function Eu(e,t,r){Object.keys(r).forEach(n=>e.assign((0,se._)`${t}${(0,se.getProperty)(n)}`,!0))}B.setEvaluated=Eu;var Uf={};function T0(e,t){return e.scopeValue("func",{ref:t,code:Uf[t.code]||(Uf[t.code]=new b0._Code(t.code))})}B.useFunc=T0;var Ru;(function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"})(Ru||(B.Type=Ru={}));function R0(e,t,r){if(e instanceof se.Name){let n=t===Ru.Num;return r?n?(0,se._)`"[" + ${e} + "]"`:(0,se._)`"['" + ${e} + "']"`:n?(0,se._)`"/" + ${e}`:(0,se._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,se.getProperty)(e).toString():"/"+Iu(e)}B.getErrorPath=R0;function Bf(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,r===!0)throw new Error(t);e.self.logger.warn(t)}}B.checkStrictMode=Bf});var At=z(Ou=>{"use strict";Object.defineProperty(Ou,"__esModule",{value:!0});var Re=F(),I0={data:new Re.Name("data"),valCxt:new Re.Name("valCxt"),instancePath:new Re.Name("instancePath"),parentData:new Re.Name("parentData"),parentDataProperty:new Re.Name("parentDataProperty"),rootData:new Re.Name("rootData"),dynamicAnchors:new Re.Name("dynamicAnchors"),vErrors:new Re.Name("vErrors"),errors:new Re.Name("errors"),this:new Re.Name("this"),self:new Re.Name("self"),scope:new Re.Name("scope"),json:new Re.Name("json"),jsonPos:new Re.Name("jsonPos"),jsonLen:new Re.Name("jsonLen"),jsonPart:new Re.Name("jsonPart")};Ou.default=I0});var io=z(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.extendErrors=Ie.resetErrorsCount=Ie.reportExtraError=Ie.reportError=Ie.keyword$DataError=Ie.keywordError=void 0;var Y=F(),Us=ee(),Ae=At();Ie.keywordError={message:({keyword:e})=>(0,Y.str)`must pass "${e}" keyword validation`};Ie.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,Y.str)`"${e}" keyword must be ${t} ($data)`:(0,Y.str)`"${e}" keyword is invalid ($data)`};function E0(e,t=Ie.keywordError,r,n){let{it:o}=e,{gen:s,compositeRule:i,allErrors:a}=o,c=Kf(e,t,r);n??(i||a)?Hf(s,c):Wf(o,(0,Y._)`[${c}]`)}Ie.reportError=E0;function O0(e,t=Ie.keywordError,r){let{it:n}=e,{gen:o,compositeRule:s,allErrors:i}=n,a=Kf(e,t,r);Hf(o,a),s||i||Wf(n,Ae.default.vErrors)}Ie.reportExtraError=O0;function j0(e,t){e.assign(Ae.default.errors,t),e.if((0,Y._)`${Ae.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,Y._)`${Ae.default.vErrors}.length`,t),()=>e.assign(Ae.default.vErrors,null)))}Ie.resetErrorsCount=j0;function C0({gen:e,keyword:t,schemaValue:r,data:n,errsCount:o,it:s}){if(o===void 0)throw new Error("ajv implementation error");let i=e.name("err");e.forRange("i",o,Ae.default.errors,a=>{e.const(i,(0,Y._)`${Ae.default.vErrors}[${a}]`),e.if((0,Y._)`${i}.instancePath === undefined`,()=>e.assign((0,Y._)`${i}.instancePath`,(0,Y.strConcat)(Ae.default.instancePath,s.errorPath))),e.assign((0,Y._)`${i}.schemaPath`,(0,Y.str)`${s.errSchemaPath}/${t}`),s.opts.verbose&&(e.assign((0,Y._)`${i}.schema`,r),e.assign((0,Y._)`${i}.data`,n))})}Ie.extendErrors=C0;function Hf(e,t){let r=e.const("err",t);e.if((0,Y._)`${Ae.default.vErrors} === null`,()=>e.assign(Ae.default.vErrors,(0,Y._)`[${r}]`),(0,Y._)`${Ae.default.vErrors}.push(${r})`),e.code((0,Y._)`${Ae.default.errors}++`)}function Wf(e,t){let{gen:r,validateName:n,schemaEnv:o}=e;o.$async?r.throw((0,Y._)`new ${e.ValidationError}(${t})`):(r.assign((0,Y._)`${n}.errors`,t),r.return(!1))}var Er={keyword:new Y.Name("keyword"),schemaPath:new Y.Name("schemaPath"),params:new Y.Name("params"),propertyName:new Y.Name("propertyName"),message:new Y.Name("message"),schema:new Y.Name("schema"),parentSchema:new Y.Name("parentSchema")};function Kf(e,t,r){let{createErrors:n}=e.it;return n===!1?(0,Y._)`{}`:A0(e,t,r)}function A0(e,t,r={}){let{gen:n,it:o}=e,s=[M0(o,r),N0(e,r)];return L0(e,t,s),n.object(...s)}function M0({errorPath:e},{instancePath:t}){let r=t?(0,Y.str)`${e}${(0,Us.getErrorPath)(t,Us.Type.Str)}`:e;return[Ae.default.instancePath,(0,Y.strConcat)(Ae.default.instancePath,r)]}function N0({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:n}){let o=n?t:(0,Y.str)`${t}/${e}`;return r&&(o=(0,Y.str)`${o}${(0,Us.getErrorPath)(r,Us.Type.Str)}`),[Er.schemaPath,o]}function L0(e,{params:t,message:r},n){let{keyword:o,data:s,schemaValue:i,it:a}=e,{opts:c,propertyName:u,topSchemaRef:d,schemaPath:l}=a;n.push([Er.keyword,o],[Er.params,typeof t=="function"?t(e):t||(0,Y._)`{}`]),c.messages&&n.push([Er.message,typeof r=="function"?r(e):r]),c.verbose&&n.push([Er.schema,i],[Er.parentSchema,(0,Y._)`${d}${l}`],[Ae.default.data,s]),u&&n.push([Er.propertyName,u])}});var Xf=z(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.boolOrEmptySchema=cn.topBoolOrEmptySchema=void 0;var D0=io(),Z0=F(),U0=At(),q0={message:"boolean schema is false"};function J0(e){let{gen:t,schema:r,validateName:n}=e;r===!1?Gf(e,!1):typeof r=="object"&&r.$async===!0?t.return(U0.default.data):(t.assign((0,Z0._)`${n}.errors`,null),t.return(!0))}cn.topBoolOrEmptySchema=J0;function F0(e,t){let{gen:r,schema:n}=e;n===!1?(r.var(t,!1),Gf(e)):r.var(t,!0)}cn.boolOrEmptySchema=F0;function Gf(e,t){let{gen:r,data:n}=e,o={gen:r,keyword:"false schema",data:n,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,D0.reportError)(o,q0,void 0,t)}});var ju=z(un=>{"use strict";Object.defineProperty(un,"__esModule",{value:!0});un.getRules=un.isJSONType=void 0;var V0=["string","number","integer","boolean","null","object","array"],B0=new Set(V0);function H0(e){return typeof e=="string"&&B0.has(e)}un.isJSONType=H0;function W0(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}un.getRules=W0});var Cu=z(Gt=>{"use strict";Object.defineProperty(Gt,"__esModule",{value:!0});Gt.shouldUseRule=Gt.shouldUseGroup=Gt.schemaHasRulesForType=void 0;function K0({schema:e,self:t},r){let n=t.RULES.types[r];return n&&n!==!0&&Yf(e,n)}Gt.schemaHasRulesForType=K0;function Yf(e,t){return t.rules.some(r=>Qf(e,r))}Gt.shouldUseGroup=Yf;function Qf(e,t){var r;return e[t.keyword]!==void 0||((r=t.definition.implements)===null||r===void 0?void 0:r.some(n=>e[n]!==void 0))}Gt.shouldUseRule=Qf});var ao=z(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.reportTypeError=Ee.checkDataTypes=Ee.checkDataType=Ee.coerceAndCheckDataType=Ee.getJSONTypes=Ee.getSchemaTypes=Ee.DataType=void 0;var G0=ju(),X0=Cu(),Y0=io(),q=F(),eh=ee(),dn;(function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"})(dn||(Ee.DataType=dn={}));function Q0(e){let t=th(e.type);if(t.includes("null")){if(e.nullable===!1)throw new Error("type: null contradicts nullable: false")}else{if(!t.length&&e.nullable!==void 0)throw new Error('"nullable" cannot be used without "type"');e.nullable===!0&&t.push("null")}return t}Ee.getSchemaTypes=Q0;function th(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(G0.isJSONType))return t;throw new Error("type must be JSONType or JSONType[]: "+t.join(","))}Ee.getJSONTypes=th;function eS(e,t){let{gen:r,data:n,opts:o}=e,s=tS(t,o.coerceTypes),i=t.length>0&&!(s.length===0&&t.length===1&&(0,X0.schemaHasRulesForType)(e,t[0]));if(i){let a=Mu(t,n,o.strictNumbers,dn.Wrong);r.if(a,()=>{s.length?rS(e,t,s):Nu(e)})}return i}Ee.coerceAndCheckDataType=eS;var rh=new Set(["string","number","integer","boolean","null"]);function tS(e,t){return t?e.filter(r=>rh.has(r)||t==="array"&&r==="array"):[]}function rS(e,t,r){let{gen:n,data:o,opts:s}=e,i=n.let("dataType",(0,q._)`typeof ${o}`),a=n.let("coerced",(0,q._)`undefined`);s.coerceTypes==="array"&&n.if((0,q._)`${i} == 'object' && Array.isArray(${o}) && ${o}.length == 1`,()=>n.assign(o,(0,q._)`${o}[0]`).assign(i,(0,q._)`typeof ${o}`).if(Mu(t,o,s.strictNumbers),()=>n.assign(a,o))),n.if((0,q._)`${a} !== undefined`);for(let u of r)(rh.has(u)||u==="array"&&s.coerceTypes==="array")&&c(u);n.else(),Nu(e),n.endIf(),n.if((0,q._)`${a} !== undefined`,()=>{n.assign(o,a),nS(e,a)});function c(u){switch(u){case"string":n.elseIf((0,q._)`${i} == "number" || ${i} == "boolean"`).assign(a,(0,q._)`"" + ${o}`).elseIf((0,q._)`${o} === null`).assign(a,(0,q._)`""`);return;case"number":n.elseIf((0,q._)`${i} == "boolean" || ${o} === null
|
|
5
5
|
|| (${i} == "string" && ${o} && ${o} == +${o})`).assign(a,(0,q._)`+${o}`);return;case"integer":n.elseIf((0,q._)`${i} === "boolean" || ${o} === null
|
package/package.json
CHANGED
package/scripts/build.mjs
CHANGED
|
@@ -17,8 +17,18 @@ const packageVersion = JSON.parse(
|
|
|
17
17
|
|
|
18
18
|
await rm(join(packageRoot, 'dist'), { recursive: true, force: true });
|
|
19
19
|
|
|
20
|
+
// Renamed banner import (the build-auth-parity-oracle.mjs convention, made
|
|
21
|
+
// load-bearing by prod RCA 2026-07-20): esbuild injects banners VERBATIM -
|
|
22
|
+
// outside symbol renaming - so a bare `createRequire` here collides with any
|
|
23
|
+
// source module's own top-level `import { createRequire } from 'node:module'`
|
|
24
|
+
// (bundledCodexBin.ts) and the bundle dies at load with "Identifier
|
|
25
|
+
// 'createRequire' has already been declared". These bundles are currently
|
|
26
|
+
// minified (which renames the source-side binding and masks the collision),
|
|
27
|
+
// but the identically-bannered UNMINIFIED nix image bundles shipped exactly
|
|
28
|
+
// that SyntaxError on 2026-07-11 and crash-looped the hosted @linzumi runner
|
|
29
|
+
// for 9 days. Keep the banner symbol collision-proof, never rely on minify.
|
|
20
30
|
const banner = {
|
|
21
|
-
js: "import { createRequire } from 'node:module';\nconst require =
|
|
31
|
+
js: "import { createRequire as __linzumiBundleCreateRequire } from 'node:module';\nconst require = __linzumiBundleCreateRequire(import.meta.url);",
|
|
22
32
|
};
|
|
23
33
|
|
|
24
34
|
// M3 cluster 15 (entry/packaging/selector): ONE package ships BOTH commander
|