@kumori/kdsl 0.0.44 → 0.0.45

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.
@@ -91,9 +91,16 @@ export const Dependency = async (log, cwd, module, options, configPath) => {
91
91
  // Options shortcuts
92
92
  const alias = options.alias;
93
93
  const remove = options.remove;
94
+ // If the module starts with a registry selector, check if it exists in the config registries
95
+ let target = url.Location;
96
+ const manager = new RegistryManager(configPath);
97
+ const reg = manager.list().find((r) => module.startsWith(r.selector));
98
+ if (reg !== undefined) {
99
+ target = module.slice(0, module.indexOf("@"));
100
+ }
94
101
  if (remove) {
95
102
  // Find the dependency in the module requires list and remove it
96
- const idx = manifest.requires.findIndex((dep) => dep.target === url.Location && dep.version === url.Version);
103
+ const idx = manifest.requires.findIndex((dep) => dep.target === target && dep.version === url.Version);
97
104
  if (idx === -1) {
98
105
  throw new Error(`Dependency ${url} not found`);
99
106
  }
@@ -104,10 +111,10 @@ export const Dependency = async (log, cwd, module, options, configPath) => {
104
111
  }
105
112
  // Check for duplicate aliases in dependencies
106
113
  if (alias &&
107
- manifest.requires.some((dep) => dep.alias === alias && dep.target !== url.Location)) {
114
+ manifest.requires.some((dep) => dep.alias === alias && dep.target !== target)) {
108
115
  throw new Error(`Alias '${alias}' is already used by another dependency`);
109
116
  }
110
- const dep = manifest.requires.find((dep) => dep.target === url.Location);
117
+ const dep = manifest.requires.find((dep) => dep.target === target);
111
118
  if (dep) {
112
119
  if (alias)
113
120
  dep.alias = alias;
@@ -135,13 +142,6 @@ export const Dependency = async (log, cwd, module, options, configPath) => {
135
142
  else {
136
143
  // Not found? Then build a new dependency object and add it to the manifest
137
144
  const version = url.Version;
138
- // If the module starts with a registry selector, check if it exists in the config registries
139
- let target = url.Location;
140
- const manager = new RegistryManager(configPath);
141
- const reg = manager.list().find((r) => url.Location.startsWith(r.selector));
142
- if (reg !== undefined) {
143
- target = module;
144
- }
145
145
  const depObj = {
146
146
  target: target,
147
147
  version,
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,OAAO,CAAC,QAAQ,EAAE,CAAC;YACrB,MAAM,KAAK,GAAG,MAAM,QAAQ,CAC1B,GAAG,EACH,IAAI,EACJ,GAAG,CAAC,MAAM,EACV,EAAE,EACF,EAAE,KAAK,EAAE,IAAI,EAAE,EACf,UAAU,CACX,CAAA;YAED,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBACxB,MAAM,IAAI,KAAK,CACb,kCAAkC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzD,CAAA;YACH,CAAC;QACH,CAAC;QAED,GAAG,CAAC,IAAI,CACN,oBAAoB,GAAG,CAAC,QAAQ,EAAE,EAAE;YAClC,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACnC,CAAC,OAAO,CAAC,CAAC,CAAC,cAAc,OAAO,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,qBAAqB,CACxB,CAAA;IACH,CAAC;AACH,CAAC,CAAA"}
package/out/main.cjs CHANGED
@@ -399,7 +399,7 @@ To remove a dependency:
399
399
 
400
400
  To add a dependency and download it immediately:
401
401
  kdsl mod dep github.com/org/repo@v1.0.0 --download
402
- `.trim(),l3e={Register:mnt};function mnt(t,e){return t.command("dependency").alias("dep").argument("<module>","Module URL with @<tag> (e.g. https://github.com/org/repo@v1.2.3)").option("--alias <alias>","Alias for the dependency").option("--headers <module>","Specify a separate location for the headers module").option("--remove","Remove the dependency").option("--download","Download the dependency after adding it").summary(hnt).description(_U).helpOption(!0).showHelpAfterError(!0).action(gnt(e))}function gnt(t){return async(e,r,n)=>{var a;let i=(a=n==null?void 0:n.optsWithGlobals())==null?void 0:a.config;await new zn(i).ensureIndexes();try{await ynt(t,De.file(process.cwd()),e,r,i)}catch(s){throw t.error(`Failed to manage dependency: ${s}`),s}}}var ynt=async(t,e,r,n,i)=>{let o=Oi(In,i).Kumori,a=o.shared.workspace.FileSystemProvider,s=await tn(a,e,i);if(V.isErr(s))throw new Error(s.err);let u=s.value.Current.Manifest,c=Js(r,s.value.Locations.Config());if(V.isErr(c))throw new Error(`invalid query '${r}': invalid format`);let l=null;if(n.headers&&(l=Js(n.headers,s.value.Locations.Config()),V.isErr(l)))throw new Error(`invalid query '${n.headers}': invalid format`);let f=l?l.value:null,d=c.value;d.Location.endsWith("/")&&(d.Location=d.Location.replace(/\/+$/,""));let p=n.alias;if(n.remove){let g=u.requires.findIndex(b=>b.target===d.Location&&b.version===d.Version);if(g===-1)throw new Error(`Dependency ${d} not found`);u.requires.splice(g,1),await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),t.info(`Removed dependency ${d.toString()}`);return}if(p&&u.requires.some(g=>g.alias===p&&g.target!==d.Location))throw new Error(`Alias '${p}' is already used by another dependency`);let m=u.requires.find(g=>g.target===d.Location);if(m){if(p?m.alias=p:delete m.alias,f&&(m.headers={target:f.Location,version:f.Version}),n.download){let g=await X0(t,o,e.fsPath,[],{quiet:!0},i);if(V.isErr(g))throw new Error(`Failed to download dependency: ${g.err.join(", ")}`)}m.version=d.Version,await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),t.info(`Updated dependency ${d.Location} to version ${d.Version}`+(p?` (alias: ${p})`:"")+(f?` (headers: ${f})`:""))}else{let g=d.Version,b=d.Location;new zn(i).list().find(x=>d.Location.startsWith(x.selector))!==void 0&&(b=r);let w=E(E({target:b,version:g},p?{alias:p}:{}),f?{headers:{target:f.Location,version:f.Version}}:{});if(u.requires.push(w),await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),n.download){let x=await X0(t,o,e.fsPath,[],{quiet:!0},i);if(V.isErr(x))throw new Error(`Failed to download dependency: ${x.err.join(", ")}`)}t.info(`Added dependency ${d.toString()}`+(p?` (alias: ${p})`:"")+(f?` (headers: ${f})`:"")+" to module manifest")}};var f3e=["mod dep",async()=>{console.log(_U)}];var d3e=["mod dl",async()=>{console.log(hU),console.log(`
402
+ `.trim(),l3e={Register:mnt};function mnt(t,e){return t.command("dependency").alias("dep").argument("<module>","Module URL with @<tag> (e.g. https://github.com/org/repo@v1.2.3)").option("--alias <alias>","Alias for the dependency").option("--headers <module>","Specify a separate location for the headers module").option("--remove","Remove the dependency").option("--download","Download the dependency after adding it").summary(hnt).description(_U).helpOption(!0).showHelpAfterError(!0).action(gnt(e))}function gnt(t){return async(e,r,n)=>{var a;let i=(a=n==null?void 0:n.optsWithGlobals())==null?void 0:a.config;await new zn(i).ensureIndexes();try{await ynt(t,De.file(process.cwd()),e,r,i)}catch(s){throw t.error(`Failed to manage dependency: ${s}`),s}}}var ynt=async(t,e,r,n,i)=>{let o=Oi(In,i).Kumori,a=o.shared.workspace.FileSystemProvider,s=await tn(a,e,i);if(V.isErr(s))throw new Error(s.err);let u=s.value.Current.Manifest,c=Js(r,s.value.Locations.Config());if(V.isErr(c))throw new Error(`invalid query '${r}': invalid format`);let l=null;if(n.headers&&(l=Js(n.headers,s.value.Locations.Config()),V.isErr(l)))throw new Error(`invalid query '${n.headers}': invalid format`);let f=l?l.value:null,d=c.value;d.Location.endsWith("/")&&(d.Location=d.Location.replace(/\/+$/,""));let p=n.alias,h=n.remove,m=d.Location;if(new zn(i).list().find(y=>r.startsWith(y.selector))!==void 0&&(m=r.slice(0,r.indexOf("@"))),h){let y=u.requires.findIndex(w=>w.target===m&&w.version===d.Version);if(y===-1)throw new Error(`Dependency ${d} not found`);u.requires.splice(y,1),await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),t.info(`Removed dependency ${d.toString()}`);return}if(p&&u.requires.some(y=>y.alias===p&&y.target!==m))throw new Error(`Alias '${p}' is already used by another dependency`);let v=u.requires.find(y=>y.target===m);if(v){if(p?v.alias=p:delete v.alias,f&&(v.headers={target:f.Location,version:f.Version}),n.download){let y=await X0(t,o,e.fsPath,[],{quiet:!0},i);if(V.isErr(y))throw new Error(`Failed to download dependency: ${y.err.join(", ")}`)}v.version=d.Version,await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),t.info(`Updated dependency ${d.Location} to version ${d.Version}`+(p?` (alias: ${p})`:"")+(f?` (headers: ${f})`:""))}else{let y=d.Version,w=E(E({target:m,version:y},p?{alias:p}:{}),f?{headers:{target:f.Location,version:f.Version}}:{});if(u.requires.push(w),await(0,v$.writeFile)(ue.joinPath(s.value.Current.Root,Br).fsPath,JSON.stringify(u,void 0,4)),n.download){let x=await X0(t,o,e.fsPath,[],{quiet:!0},i);if(V.isErr(x))throw new Error(`Failed to download dependency: ${x.err.join(", ")}`)}t.info(`Added dependency ${d.toString()}`+(p?` (alias: ${p})`:"")+(f?` (headers: ${f})`:"")+" to module manifest")}};var f3e=["mod dep",async()=>{console.log(_U)}];var d3e=["mod dl",async()=>{console.log(hU),console.log(`
403
403
  kdsl mod download
404
404
  kdsl mod dl
405
405
 
@@ -761,7 +761,7 @@ Use "kdsl help -a" for a list of available topics.
761
761
  `.trim(),xq=new Map,pi=(t,e)=>xq.set(t,e),qut=async(t,e,r)=>{if(e.all)return Pbe();if(!t.length){r.outputHelp();return}let n=t.join(" "),i=xq.get(n);if(!i)return console.error(`unknown topic '${n}'
762
762
  `),Pbe();await i()},Pbe=()=>{console.log(`Available topics:
763
763
  `),console.log(Array.from(xq.keys()).sort().map(t=>" "+t).join(`
764
- `))};pi(...f3e);pi(...d3e);pi(...p3e);pi(...b3e);pi(...T3e);pi(...ube);pi(...hbe);pi(...mbe);pi(...gbe);pi(...ybe);pi(...vbe);pi(...bbe);pi(..._be);pi(...wbe);pi(...xbe);pi(...Sbe);pi(...$be);pi(...kbe);pi(...Ebe);pi(...Tbe);var Cbe={name:"@kumori/kdsl",version:"0.0.44",private:!1,files:["bin","out","dist"],type:"module",description:"Kumori DSL command line interface and library",bin:{kdsl:"bin/cli.js"},main:"./out/lib/index.cjs",module:"./dist/lib/index.js",types:"./dist/lib/index.d.ts",exports:{".":{import:"./dist/lib/index.js",require:"./out/lib/index.cjs",types:"./dist/lib/index.d.ts"},"./build":{import:"./dist/lib/build.js",require:"./out/lib/build.cjs",types:"./dist/lib/build.d.ts"},"./deployment":{import:"./dist/lib/deployment.js",require:"./out/lib/deployment.cjs",types:"./dist/lib/deployment.d.ts"},"./check":{import:"./dist/lib/check.js",require:"./out/lib/check.cjs",types:"./dist/lib/check.d.ts"},"./clean":{import:"./dist/lib/clean.js",require:"./out/lib/clean.cjs",types:"./dist/lib/clean.d.ts"},"./mod":{import:"./dist/lib/mod.js",require:"./out/lib/mod.cjs",types:"./dist/lib/mod.d.ts"},"./registry":{import:"./dist/lib/registry.js",require:"./out/lib/registry.cjs",types:"./dist/lib/registry.d.ts"},"./index-cmd":{import:"./dist/lib/index-cmd.js",require:"./out/lib/index-cmd.cjs",types:"./dist/lib/index-cmd.d.ts"}},scripts:{build:"npm run fix && npm run build:types && npm run build:cli && npm run copy-loader","build:types":"tsc -b tsconfig.json","build:cli":"node esbuild.mjs --minify","build:lib":"node esbuild.mjs --minify --target=cjs && node esbuild.mjs --minify --target=esm","copy-loader":"mkdir -p out/lib dist/lib && rsync -av --include='*/' --include='*.kumori' --exclude='*' src/ out/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' src/ dist/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' ../lsp/dist/language/builtin/lib/ out/lib/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' ../lsp/dist/language/builtin/lib/ dist/lib/ && bash -c 'shopt -s globstar && cp src/**/*.kumori out/'",test:"vitest run",clean:"rm -rf dist/ out/ tsconfig.tsbuildinfo",prepublishOnly:"npm run build",lint:"eslint .",prettier:"prettier src/ test/ --write",fix:"npm run lint && npm run prettier"},dependencies:{"@commander-js/extra-typings":"^14.0.0","@inquirer/prompts":"^8.0.2","@kumori/kdsl-lsp":"0.0.1-alpha.20",ajv:"^8.17.1",chalk:"~5.6.2",commander:"~14.0.2",zod:"^4.1.13"},license:"EUPL",keywords:["cli","tool","automation","kumori","dsl"],gitHead:"89bea74c68de5f90f37ccc0e64b340408c90b76d",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",globals:"^16.5.0",jiti:"^2.6.1",prettier:"3.7.3","typescript-eslint":"^8.48.0"}};var Vut="<unknown>",Abe,Wut=(Abe=Cbe.version)!=null?Abe:Vut,Ibe=Wut;var rt=(function(t){return t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t})({}),Md={[rt.trace]:10,[rt.debug]:20,[rt.info]:30,[rt.warn]:40,[rt.error]:50,[rt.fatal]:60},Gut={10:rt.trace,20:rt.debug,30:rt.info,40:rt.warn,50:rt.error,60:rt.fatal};var $o=(function(t){return t.transformLogLevel="transformLogLevel",t.onBeforeDataOut="onBeforeDataOut",t.shouldSendToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t})({});var Obe=class Nbe{constructor(){At(this,"context",{});At(this,"hasContext",!1)}setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context=E(E({},this.context),e),this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:e,childContextManager:r}){if(e.hasContextData()){let n=e.getContext();r.setContext(E({},n))}}clone(){let e=new Nbe;return e.setContext(E({},this.context)),e.hasContext=this.hasContext,e}};var Dbe=class Sq{constructor(){At(this,"logLevelEnabledStatus",{info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0})}setLevel(e){let r=Md[e];for(let n of Object.values(rt)){let i=n,o=Md[n];this.logLevelEnabledStatus[i]=o>=r}}enableIndividualLevel(e){let r=e;r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!0)}disableIndividualLevel(e){let r=e;r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!1)}isLevelEnabled(e){let r=e;return this.logLevelEnabledStatus[r]}enableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0}disableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1}onChildLoggerCreated({parentLogLevelManager:e,childLogLevelManager:r}){let n=e.logLevelEnabledStatus;r instanceof Sq&&(r.logLevelEnabledStatus=E({},n))}clone(){let e=new Sq;return e.logLevelEnabledStatus=E({},this.logLevelEnabledStatus),e}};var $q=class{constructor(t){At(this,"id");At(this,"logger");At(this,"enabled");At(this,"consoleDebug");At(this,"level");var e,r,n,i;this.id=(e=t.id)!=null?e:Date.now().toString()+Math.random().toString(),this.logger=t.logger,this.enabled=(r=t.enabled)!=null?r:!0,this.consoleDebug=(n=t.consoleDebug)!=null?n:!1,this.level=(i=t.level)!=null?i:"trace"}_sendToLogger(t){if(!this.enabled||Md[t.logLevel]<Md[this.level])return;let e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case rt.info:console.info(...e);break;case rt.warn:console.warn(...e);break;case rt.error:console.error(...e);break;case rt.trace:console.debug(...e);break;case rt.debug:console.debug(...e);break;case rt.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){return this.logger}};var Hut=[$o.onBeforeDataOut,$o.onMetadataCalled,$o.onBeforeMessageOut,$o.transformLogLevel,$o.shouldSendToLogger,$o.onContextCalled],Lbe=class{constructor(t){At(this,"idToPlugin");At(this,"transformLogLevel",[]);At(this,"onBeforeDataOut",[]);At(this,"shouldSendToLogger",[]);At(this,"onMetadataCalled",[]);At(this,"onBeforeMessageOut",[]);At(this,"onContextCalled",[]);this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(let e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.transformLogLevel=[],this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let t=Object.values(this.idToPlugin).sort((e,r)=>e.registeredAt-r.registeredAt);for(let e of t){if(e.disabled)return;for(let r of Hut)e[r]&&e.id&&this[r].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runTransformLogLevel(t,e){let r=null;for(let n of this.transformLogLevel){let i=this.idToPlugin[n];if(i.transformLogLevel){let o=i.transformLogLevel({data:t.data,logLevel:t.logLevel,messages:t.messages,error:t.error,metadata:t.metadata,context:t.context},e);o!=null&&o!==!1&&(r=o)}}return r!=null&&r!==!1?r:t.logLevel}runOnBeforeDataOut(t,e){let r=E({},t);for(let n of this.onBeforeDataOut){let i=this.idToPlugin[n];if(i.onBeforeDataOut){let o=i.onBeforeDataOut({data:r.data,logLevel:r.logLevel,error:r.error,metadata:r.metadata,context:r.context},e);o&&(r.data||(r.data={}),Object.assign(r.data,o))}}return r.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(r=>{var n,i;return!((i=(n=this.idToPlugin[r]).shouldSendToLogger)!=null&&i.call(n,t,e))})}runOnMetadataCalled(t,e){var n,i;let r=E({},t);for(let o of this.onMetadataCalled){let a=(i=(n=this.idToPlugin[o]).onMetadataCalled)==null?void 0:i.call(n,r,e);if(a)r=a;else return null}return r}runOnBeforeMessageOut(t,e){var n,i;let r=[...t.messages];for(let o of this.onBeforeMessageOut){let a=(i=(n=this.idToPlugin[o]).onBeforeMessageOut)==null?void 0:i.call(n,{messages:r,logLevel:t.logLevel},e);a&&(r=a)}return r}runOnContextCalled(t,e){var n,i;let r=E({},t);for(let o of this.onContextCalled){let a=(i=(n=this.idToPlugin[o]).onContextCalled)==null?void 0:i.call(n,r,e);if(a)r=a;else return null}return r}},jbe=class Fbe{constructor(e){At(this,"pluginManager");At(this,"idToTransport");At(this,"hasMultipleTransports");At(this,"singleTransport");At(this,"contextManager");At(this,"logLevelManager");At(this,"_config");var r;this._config=J(E({},e),{enabled:(r=e.enabled)!=null?r:!0}),this.contextManager=new Obe,this.logLevelManager=new Dbe,this._config.enabled||this.disableLogging(),this.pluginManager=new Lbe([...e.plugins||[],...Q6.pluginsToInit]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport),Q6.logLayerHandlers.length>0&&Q6.logLayerHandlers.forEach(n=>{n.onConstruct&&n.onConstruct(this,e)})}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this}getContextManager(){return this.contextManager}withLogLevelManager(e){return this.logLevelManager&&typeof this.logLevelManager[Symbol.dispose]=="function"&&this.logLevelManager[Symbol.dispose](),this.logLevelManager=e,this}getLogLevelManager(){return this.logLevelManager}getConfig(){return this._config}_initializeTransports(e){if(this.idToTransport)for(let r in this.idToTransport)this.idToTransport[r]&&typeof this.idToTransport[r][Symbol.dispose]=="function"&&this.idToTransport[r][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((r,n)=>(r[n.id]=n,r),{}):this.idToTransport={[e.id]:e}}withPrefix(e){let r=this.child();return r._config.prefix=e,r}withContext(e){let r=e;return e?this.pluginManager.hasPlugins($o.onContextCalled)&&(r=this.pluginManager.runOnContextCalled(e,this),!r)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(r),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new Mbe(this).withMetadata(e)}withError(e){return new Mbe(this).withError(e)}child(){let e=new Fbe(J(E({},this._config),{transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport})).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:e.contextManager,parentLogger:this,childLogger:e}),this.logLevelManager.onChildLoggerCreated({parentLogLevelManager:this.logLevelManager,childLogLevelManager:e.logLevelManager,parentLogger:this,childLogger:e}),e}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new Lbe(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,r){let n=(r==null?void 0:r.logLevel)||rt.error;if(!this.isLevelEnabled(n))return;let{copyMsgOnOnlyError:i}=this._config,o={logLevel:n,err:e};(i&&(r==null?void 0:r.copyMsg)!==!1||(r==null?void 0:r.copyMsg)===!0)&&(e!=null&&e.message)&&(o.params=[e.message]),this._formatLog(o)}metadataOnly(e,r=rt.info){if(!this.isLevelEnabled(r))return;let{muteMetadata:n,consoleDebug:i}=this._config;if(n)return;if(!e){i&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let o=e;if(this.pluginManager.hasPlugins($o.onMetadataCalled)&&(o=this.pluginManager.runOnMetadataCalled(e,this),!o)){i&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}let a={logLevel:r,metadata:o};this._formatLog(a)}info(...e){this.isLevelEnabled(rt.info)&&(this._formatMessage(e),this._formatLog({logLevel:rt.info,params:e}))}warn(...e){this.isLevelEnabled(rt.warn)&&(this._formatMessage(e),this._formatLog({logLevel:rt.warn,params:e}))}error(...e){this.isLevelEnabled(rt.error)&&(this._formatMessage(e),this._formatLog({logLevel:rt.error,params:e}))}debug(...e){this.isLevelEnabled(rt.debug)&&(this._formatMessage(e),this._formatLog({logLevel:rt.debug,params:e}))}trace(...e){this.isLevelEnabled(rt.trace)&&(this._formatMessage(e),this._formatLog({logLevel:rt.trace,params:e}))}fatal(...e){this.isLevelEnabled(rt.fatal)&&(this._formatMessage(e),this._formatLog({logLevel:rt.fatal,params:e}))}raw(e){if(!this.isLevelEnabled(e.logLevel))return;let r={logLevel:e.logLevel,params:e.messages,metadata:e.metadata,err:e.error,context:e.context};this._formatMessage(e.messages),this._formatLog(r)}disableLogging(){return this.logLevelManager.disableLogging(),this}enableLogging(){return this.logLevelManager.enableLogging(),this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){return this.logLevelManager.enableIndividualLevel(e),this}disableIndividualLevel(e){return this.logLevelManager.disableIndividualLevel(e),this}setLevel(e){return this.logLevelManager.setLevel(e),this}isLevelEnabled(e){return this.logLevelManager.isLevelEnabled(e)}formatContext(e){let{contextFieldName:r,muteContext:n}=this._config;return e&&Object.keys(e).length>0&&!n?r?{[r]:E({},e)}:E({},e):{}}formatMetadata(e=null){let{metadataFieldName:r,muteMetadata:n}=this._config;return e&&!n?r?{[r]:E({},e)}:E({},e):{}}getLoggerInstance(e){let r=this.idToTransport[e];if(r)return r.getLoggerInstance()}_formatMessage(e=[]){let{prefix:r}=this._config;r&&typeof e[0]=="string"&&(e[0]=`${r} ${e[0]}`)}_formatLog({logLevel:e,params:r=[],metadata:n=null,err:i,context:o=null}){var m;let{errorSerializer:a,errorFieldInMetadata:s,muteContext:u,contextFieldName:c,metadataFieldName:l,errorFieldName:f}=this._config,d=o!==null?o:this.contextManager.getContext(),p=!!n||(u?!1:o!==null?Object.keys(o).length>0:this.contextManager.hasContextData()),h={};if(p)if(c&&c===l){let g=this.formatContext(d)[c],b=this.formatMetadata(n)[l];h={[c]:E(E({},g),b)}}else h=E(E({},this.formatContext(d)),this.formatMetadata(n));if(i){let g=a?a(i):i;s&&n&&l?h!=null&&h[l]?h[l][f]=g:h=J(E({},h),{[l]:{[f]:g}}):s&&!n&&l?h=J(E({},h),{[l]:{[f]:g}}):h=J(E({},h),{[f]:g}),p=!0}if(this.pluginManager.hasPlugins($o.onBeforeDataOut)&&(h=this.pluginManager.runOnBeforeDataOut({data:p?h:void 0,logLevel:e,error:i,metadata:n,context:d},this),h&&!p&&(p=!0)),this.pluginManager.hasPlugins($o.onBeforeMessageOut)&&(r=this.pluginManager.runOnBeforeMessageOut({messages:[...r],logLevel:e},this)),this.pluginManager.hasPlugins($o.transformLogLevel)&&(e=this.pluginManager.runTransformLogLevel({data:p?h:void 0,logLevel:e,messages:[...r],error:i,metadata:n,context:d},this)),this.hasMultipleTransports){let g=this._config.transport.filter(b=>b.enabled).map(async b=>{let v=e;if(!(this.pluginManager.hasPlugins($o.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:p?h:void 0,logLevel:v,transportId:b.id,error:i,metadata:n,context:d},this)))return b._sendToLogger({logLevel:v,messages:[...r],data:p?h:void 0,hasData:p,error:i,metadata:n,context:d})});Promise.all(g).catch(b=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",b)})}else{if(!((m=this.singleTransport)!=null&&m.enabled)||this.pluginManager.hasPlugins($o.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:p?h:void 0,logLevel:e,transportId:this.singleTransport.id,error:i,metadata:n,context:d},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...r],data:p?h:void 0,hasData:p,error:i,metadata:n,context:d})}}};var Q6={logLayerHandlers:[],pluginsToInit:[],logBuilderHandlers:[]};var Mbe=class{constructor(t){At(this,"err");At(this,"metadata");At(this,"structuredLogger");At(this,"hasMetadata");At(this,"pluginManager");this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager,Q6.logBuilderHandlers.length>0&&Q6.logBuilderHandlers.forEach(e=>{e.onConstruct&&e.onConstruct(this,t)})}withMetadata(t){let{pluginManager:e,structuredLogger:{_config:{consoleDebug:r}}}=this;if(!t)return r&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let n=t;return e.hasPlugins($o.onMetadataCalled)&&(n=e.runOnMetadataCalled(t,this.structuredLogger),!n)?(r&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata=E(E({},this.metadata),n),this.hasMetadata=!0,this)}withError(t){return this.err=t,this}info(...t){this.structuredLogger.isLevelEnabled(rt.info)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.info,t))}warn(...t){this.structuredLogger.isLevelEnabled(rt.warn)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.warn,t))}error(...t){this.structuredLogger.isLevelEnabled(rt.error)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.error,t))}debug(...t){this.structuredLogger.isLevelEnabled(rt.debug)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.debug,t))}trace(...t){this.structuredLogger.isLevelEnabled(rt.trace)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.trace,t))}fatal(...t){this.structuredLogger.isLevelEnabled(rt.fatal)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.fatal,t))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){let{muteMetadata:r}=this.structuredLogger._config,n=r?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:t,params:e,metadata:n?this.metadata:null,err:this.err})}};var Ube=class extends $q{constructor(t){super(t),t.stackDepthLevel!==void 0?this.logger.stackDepthLevel=t.stackDepthLevel:this.logger.stackDepthLevel=9}shipToLogger({logLevel:t,messages:e,data:r,hasData:n}){switch(r&&n&&e.push(r),t){case rt.info:this.logger.info(...e);break;case rt.warn:this.logger.warn(...e);break;case rt.error:this.logger.error(...e);break;case rt.trace:this.logger.trace(...e);break;case rt.debug:this.logger.debug(...e);break;case rt.fatal:this.logger.fatal(...e);break}return e}};function zbe(t){return{href:t.href,protocol:t.protocol,username:t.username,password:t.password,host:t.host,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search,searchParams:[...t.searchParams].map(([e,r])=>({key:e,value:r})),hash:t.hash,origin:t.origin}}var eb={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function tb(t,e,r,n=!1){let i=String(e),o=(u,c)=>`\x1B[${c[0]}m${u}\x1B[${c[1]}m`,a=(u,c)=>c!=null&&typeof c=="string"?o(u,eb[c]):c!=null&&Array.isArray(c)?c.reduce((l,f)=>a(l,f),u):c!=null&&c[u.trim()]!=null?a(u,c[u.trim()]):c!=null&&c["*"]!=null?a(u,c["*"]):u,s=null;return i.replace(/{{(.+?)}}/g,(u,c)=>{var f,d;let l=r[c]!=null?String(r[c]):n?"":u;return t.stylePrettyLogs?a(l,(d=(f=t==null?void 0:t.prettyLogStyles)==null?void 0:f[c])!=null?d:s)+o("",eb.reset):l})}function gs(t,e=2,r=0){return t!=null&&isNaN(t)?"":(t=t!=null?t+r:t,e===2?t==null?"--":t<10?"0"+t:t.toString():t==null?"---":t<10?"00"+t:t<100?"0"+t:t.toString())}function kq(t,e){var s,u,c,l,f,d,p,h,m,g,b,v,y,w,x,P,S,O,T,M,R,D,k,C,L,z,j;if(e==null)return{text:"",template:t.prettyLogTemplate,placeholders:{}};let r=t.prettyLogTemplate,n={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):t.prettyLogTimeZone==="UTC"?(n.yyyy=(u=(s=e.date)==null?void 0:s.getUTCFullYear())!=null?u:"----",n.mm=gs((c=e.date)==null?void 0:c.getUTCMonth(),2,1),n.dd=gs((l=e.date)==null?void 0:l.getUTCDate(),2),n.hh=gs((f=e.date)==null?void 0:f.getUTCHours(),2),n.MM=gs((d=e.date)==null?void 0:d.getUTCMinutes(),2),n.ss=gs((p=e.date)==null?void 0:p.getUTCSeconds(),2),n.ms=gs((h=e.date)==null?void 0:h.getUTCMilliseconds(),3)):(n.yyyy=(g=(m=e.date)==null?void 0:m.getFullYear())!=null?g:"----",n.mm=gs((b=e.date)==null?void 0:b.getMonth(),2,1),n.dd=gs((v=e.date)==null?void 0:v.getDate(),2),n.hh=gs((y=e.date)==null?void 0:y.getHours(),2),n.MM=gs((w=e.date)==null?void 0:w.getMinutes(),2),n.ss=gs((x=e.date)==null?void 0:x.getSeconds(),2),n.ms=gs((P=e.date)==null?void 0:P.getMilliseconds(),3));let i=t.prettyLogTimeZone==="UTC"?e.date:e.date!=null?new Date(e.date.getTime()-e.date.getTimezoneOffset()*6e4):void 0;n.rawIsoStr=(S=i==null?void 0:i.toISOString())!=null?S:"",n.dateIsoStr=(O=i==null?void 0:i.toISOString().replace("T"," ").replace("Z",""))!=null?O:"",n.logLevelName=e.logLevelName,n.fileNameWithLine=(M=(T=e.path)==null?void 0:T.fileNameWithLine)!=null?M:"",n.filePathWithLine=(D=(R=e.path)==null?void 0:R.filePathWithLine)!=null?D:"",n.fullFilePath=(C=(k=e.path)==null?void 0:k.fullFilePath)!=null?C:"";let o=(L=t.parentNames)==null?void 0:L.join(t.prettyErrorParentNamesSeparator);o=o!=null&&e.name!=null?o+t.prettyErrorParentNamesSeparator:void 0;let a=e.name!=null||o!=null?`${o!=null?o:""}${(z=e.name)!=null?z:""}`:"";return n.name=a,n.nameWithDelimiterPrefix=a.length>0?t.prettyErrorLoggerNameDelimiter+a:"",n.nameWithDelimiterSuffix=a.length>0?a+t.prettyErrorLoggerNameDelimiter:"",((j=t.overwrite)==null?void 0:j.addPlaceholders)!=null&&t.overwrite.addPlaceholders(e,n),{text:tb(t,r,n),template:r,placeholders:n}}var qbe=[/(?:^|[\\/])node_modules[\\/].*tslog/i,/(?:^|[\\/])deps[\\/].*tslog/i,/tslog[\\/]+src[\\/]+internal[\\/]/i,/tslog[\\/]+src[\\/]BaseLogger/i,/tslog[\\/]+src[\\/]index/i];function Kut(t){let e=typeof(t==null?void 0:t.stack)=="string"?t.stack:void 0;return e==null||e.length===0?[]:e.split(`
764
+ `))};pi(...f3e);pi(...d3e);pi(...p3e);pi(...b3e);pi(...T3e);pi(...ube);pi(...hbe);pi(...mbe);pi(...gbe);pi(...ybe);pi(...vbe);pi(...bbe);pi(..._be);pi(...wbe);pi(...xbe);pi(...Sbe);pi(...$be);pi(...kbe);pi(...Ebe);pi(...Tbe);var Cbe={name:"@kumori/kdsl",version:"0.0.45",private:!1,files:["bin","out","dist"],type:"module",description:"Kumori DSL command line interface and library",bin:{kdsl:"bin/cli.js"},main:"./out/lib/index.cjs",module:"./dist/lib/index.js",types:"./dist/lib/index.d.ts",exports:{".":{import:"./dist/lib/index.js",require:"./out/lib/index.cjs",types:"./dist/lib/index.d.ts"},"./build":{import:"./dist/lib/build.js",require:"./out/lib/build.cjs",types:"./dist/lib/build.d.ts"},"./deployment":{import:"./dist/lib/deployment.js",require:"./out/lib/deployment.cjs",types:"./dist/lib/deployment.d.ts"},"./check":{import:"./dist/lib/check.js",require:"./out/lib/check.cjs",types:"./dist/lib/check.d.ts"},"./clean":{import:"./dist/lib/clean.js",require:"./out/lib/clean.cjs",types:"./dist/lib/clean.d.ts"},"./mod":{import:"./dist/lib/mod.js",require:"./out/lib/mod.cjs",types:"./dist/lib/mod.d.ts"},"./registry":{import:"./dist/lib/registry.js",require:"./out/lib/registry.cjs",types:"./dist/lib/registry.d.ts"},"./index-cmd":{import:"./dist/lib/index-cmd.js",require:"./out/lib/index-cmd.cjs",types:"./dist/lib/index-cmd.d.ts"}},scripts:{build:"npm run fix && npm run build:types && npm run build:cli && npm run copy-loader","build:types":"tsc -b tsconfig.json","build:cli":"node esbuild.mjs --minify","build:lib":"node esbuild.mjs --minify --target=cjs && node esbuild.mjs --minify --target=esm","copy-loader":"mkdir -p out/lib dist/lib && rsync -av --include='*/' --include='*.kumori' --exclude='*' src/ out/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' src/ dist/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' ../lsp/dist/language/builtin/lib/ out/lib/ && rsync -av --include='*/' --include='*.kumori' --exclude='*' ../lsp/dist/language/builtin/lib/ dist/lib/ && bash -c 'shopt -s globstar && cp src/**/*.kumori out/'",test:"vitest run",clean:"rm -rf dist/ out/ tsconfig.tsbuildinfo",prepublishOnly:"npm run build",lint:"eslint .",prettier:"prettier src/ test/ --write",fix:"npm run lint && npm run prettier"},dependencies:{"@commander-js/extra-typings":"^14.0.0","@inquirer/prompts":"^8.0.2","@kumori/kdsl-lsp":"0.0.1-alpha.20",ajv:"^8.17.1",chalk:"~5.6.2",commander:"~14.0.2",zod:"^4.1.13"},license:"EUPL",keywords:["cli","tool","automation","kumori","dsl"],gitHead:"89bea74c68de5f90f37ccc0e64b340408c90b76d",devDependencies:{"@eslint/js":"^9.39.1",eslint:"^9.39.1",globals:"^16.5.0",jiti:"^2.6.1",prettier:"3.7.3","typescript-eslint":"^8.48.0"}};var Vut="<unknown>",Abe,Wut=(Abe=Cbe.version)!=null?Abe:Vut,Ibe=Wut;var rt=(function(t){return t.info="info",t.warn="warn",t.error="error",t.debug="debug",t.trace="trace",t.fatal="fatal",t})({}),Md={[rt.trace]:10,[rt.debug]:20,[rt.info]:30,[rt.warn]:40,[rt.error]:50,[rt.fatal]:60},Gut={10:rt.trace,20:rt.debug,30:rt.info,40:rt.warn,50:rt.error,60:rt.fatal};var $o=(function(t){return t.transformLogLevel="transformLogLevel",t.onBeforeDataOut="onBeforeDataOut",t.shouldSendToLogger="shouldSendToLogger",t.onMetadataCalled="onMetadataCalled",t.onBeforeMessageOut="onBeforeMessageOut",t.onContextCalled="onContextCalled",t})({});var Obe=class Nbe{constructor(){At(this,"context",{});At(this,"hasContext",!1)}setContext(e){if(!e){this.context={},this.hasContext=!1;return}this.context=e,this.hasContext=!0}appendContext(e){this.context=E(E({},this.context),e),this.hasContext=!0}getContext(){return this.context}hasContextData(){return this.hasContext}onChildLoggerCreated({parentContextManager:e,childContextManager:r}){if(e.hasContextData()){let n=e.getContext();r.setContext(E({},n))}}clone(){let e=new Nbe;return e.setContext(E({},this.context)),e.hasContext=this.hasContext,e}};var Dbe=class Sq{constructor(){At(this,"logLevelEnabledStatus",{info:!0,warn:!0,error:!0,debug:!0,trace:!0,fatal:!0})}setLevel(e){let r=Md[e];for(let n of Object.values(rt)){let i=n,o=Md[n];this.logLevelEnabledStatus[i]=o>=r}}enableIndividualLevel(e){let r=e;r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!0)}disableIndividualLevel(e){let r=e;r in this.logLevelEnabledStatus&&(this.logLevelEnabledStatus[r]=!1)}isLevelEnabled(e){let r=e;return this.logLevelEnabledStatus[r]}enableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!0}disableLogging(){for(let e of Object.keys(this.logLevelEnabledStatus))this.logLevelEnabledStatus[e]=!1}onChildLoggerCreated({parentLogLevelManager:e,childLogLevelManager:r}){let n=e.logLevelEnabledStatus;r instanceof Sq&&(r.logLevelEnabledStatus=E({},n))}clone(){let e=new Sq;return e.logLevelEnabledStatus=E({},this.logLevelEnabledStatus),e}};var $q=class{constructor(t){At(this,"id");At(this,"logger");At(this,"enabled");At(this,"consoleDebug");At(this,"level");var e,r,n,i;this.id=(e=t.id)!=null?e:Date.now().toString()+Math.random().toString(),this.logger=t.logger,this.enabled=(r=t.enabled)!=null?r:!0,this.consoleDebug=(n=t.consoleDebug)!=null?n:!1,this.level=(i=t.level)!=null?i:"trace"}_sendToLogger(t){if(!this.enabled||Md[t.logLevel]<Md[this.level])return;let e=this.shipToLogger(t);if(this.consoleDebug)switch(t.logLevel){case rt.info:console.info(...e);break;case rt.warn:console.warn(...e);break;case rt.error:console.error(...e);break;case rt.trace:console.debug(...e);break;case rt.debug:console.debug(...e);break;case rt.fatal:console.debug(...e);break;default:console.log(...e)}}getLoggerInstance(){return this.logger}};var Hut=[$o.onBeforeDataOut,$o.onMetadataCalled,$o.onBeforeMessageOut,$o.transformLogLevel,$o.shouldSendToLogger,$o.onContextCalled],Lbe=class{constructor(t){At(this,"idToPlugin");At(this,"transformLogLevel",[]);At(this,"onBeforeDataOut",[]);At(this,"shouldSendToLogger",[]);At(this,"onMetadataCalled",[]);At(this,"onBeforeMessageOut",[]);At(this,"onContextCalled",[]);this.idToPlugin={},this.mapPlugins(t),this.indexPlugins()}mapPlugins(t){for(let e of t){if(e.id||(e.id=Date.now().toString()+Math.random().toString()),this.idToPlugin[e.id])throw new Error(`[LogLayer] Plugin with id ${e.id} already exists.`);e.registeredAt=Date.now(),this.idToPlugin[e.id]=e}}indexPlugins(){this.transformLogLevel=[],this.onBeforeDataOut=[],this.shouldSendToLogger=[],this.onMetadataCalled=[],this.onBeforeMessageOut=[],this.onContextCalled=[];let t=Object.values(this.idToPlugin).sort((e,r)=>e.registeredAt-r.registeredAt);for(let e of t){if(e.disabled)return;for(let r of Hut)e[r]&&e.id&&this[r].push(e.id)}}hasPlugins(t){return this[t].length>0}countPlugins(t){return t?this[t].length:Object.keys(this.idToPlugin).length}addPlugins(t){this.mapPlugins(t),this.indexPlugins()}enablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!1),this.indexPlugins()}disablePlugin(t){let e=this.idToPlugin[t];e&&(e.disabled=!0),this.indexPlugins()}removePlugin(t){delete this.idToPlugin[t],this.indexPlugins()}runTransformLogLevel(t,e){let r=null;for(let n of this.transformLogLevel){let i=this.idToPlugin[n];if(i.transformLogLevel){let o=i.transformLogLevel({data:t.data,logLevel:t.logLevel,messages:t.messages,error:t.error,metadata:t.metadata,context:t.context},e);o!=null&&o!==!1&&(r=o)}}return r!=null&&r!==!1?r:t.logLevel}runOnBeforeDataOut(t,e){let r=E({},t);for(let n of this.onBeforeDataOut){let i=this.idToPlugin[n];if(i.onBeforeDataOut){let o=i.onBeforeDataOut({data:r.data,logLevel:r.logLevel,error:r.error,metadata:r.metadata,context:r.context},e);o&&(r.data||(r.data={}),Object.assign(r.data,o))}}return r.data}runShouldSendToLogger(t,e){return!this.shouldSendToLogger.some(r=>{var n,i;return!((i=(n=this.idToPlugin[r]).shouldSendToLogger)!=null&&i.call(n,t,e))})}runOnMetadataCalled(t,e){var n,i;let r=E({},t);for(let o of this.onMetadataCalled){let a=(i=(n=this.idToPlugin[o]).onMetadataCalled)==null?void 0:i.call(n,r,e);if(a)r=a;else return null}return r}runOnBeforeMessageOut(t,e){var n,i;let r=[...t.messages];for(let o of this.onBeforeMessageOut){let a=(i=(n=this.idToPlugin[o]).onBeforeMessageOut)==null?void 0:i.call(n,{messages:r,logLevel:t.logLevel},e);a&&(r=a)}return r}runOnContextCalled(t,e){var n,i;let r=E({},t);for(let o of this.onContextCalled){let a=(i=(n=this.idToPlugin[o]).onContextCalled)==null?void 0:i.call(n,r,e);if(a)r=a;else return null}return r}},jbe=class Fbe{constructor(e){At(this,"pluginManager");At(this,"idToTransport");At(this,"hasMultipleTransports");At(this,"singleTransport");At(this,"contextManager");At(this,"logLevelManager");At(this,"_config");var r;this._config=J(E({},e),{enabled:(r=e.enabled)!=null?r:!0}),this.contextManager=new Obe,this.logLevelManager=new Dbe,this._config.enabled||this.disableLogging(),this.pluginManager=new Lbe([...e.plugins||[],...Q6.pluginsToInit]),this._config.errorFieldName||(this._config.errorFieldName="err"),this._config.copyMsgOnOnlyError||(this._config.copyMsgOnOnlyError=!1),this._initializeTransports(this._config.transport),Q6.logLayerHandlers.length>0&&Q6.logLayerHandlers.forEach(n=>{n.onConstruct&&n.onConstruct(this,e)})}withContextManager(e){return this.contextManager&&typeof this.contextManager[Symbol.dispose]=="function"&&this.contextManager[Symbol.dispose](),this.contextManager=e,this}getContextManager(){return this.contextManager}withLogLevelManager(e){return this.logLevelManager&&typeof this.logLevelManager[Symbol.dispose]=="function"&&this.logLevelManager[Symbol.dispose](),this.logLevelManager=e,this}getLogLevelManager(){return this.logLevelManager}getConfig(){return this._config}_initializeTransports(e){if(this.idToTransport)for(let r in this.idToTransport)this.idToTransport[r]&&typeof this.idToTransport[r][Symbol.dispose]=="function"&&this.idToTransport[r][Symbol.dispose]();this.hasMultipleTransports=Array.isArray(e)&&e.length>1,this.singleTransport=this.hasMultipleTransports?null:Array.isArray(e)?e[0]:e,Array.isArray(e)?this.idToTransport=e.reduce((r,n)=>(r[n.id]=n,r),{}):this.idToTransport={[e.id]:e}}withPrefix(e){let r=this.child();return r._config.prefix=e,r}withContext(e){let r=e;return e?this.pluginManager.hasPlugins($o.onContextCalled)&&(r=this.pluginManager.runOnContextCalled(e,this),!r)?(this._config.consoleDebug&&console.debug("[LogLayer] Context was dropped due to plugin returning falsy value."),this):(this.contextManager.appendContext(r),this):(this._config.consoleDebug&&console.debug("[LogLayer] withContext was called with no context; dropping."),this)}clearContext(){return this.contextManager.setContext(void 0),this}getContext(){return this.contextManager.getContext()}addPlugins(e){this.pluginManager.addPlugins(e)}enablePlugin(e){this.pluginManager.enablePlugin(e)}disablePlugin(e){this.pluginManager.disablePlugin(e)}removePlugin(e){this.pluginManager.removePlugin(e)}withMetadata(e){return new Mbe(this).withMetadata(e)}withError(e){return new Mbe(this).withError(e)}child(){let e=new Fbe(J(E({},this._config),{transport:Array.isArray(this._config.transport)?[...this._config.transport]:this._config.transport})).withPluginManager(this.pluginManager).withContextManager(this.contextManager.clone()).withLogLevelManager(this.logLevelManager.clone());return this.contextManager.onChildLoggerCreated({parentContextManager:this.contextManager,childContextManager:e.contextManager,parentLogger:this,childLogger:e}),this.logLevelManager.onChildLoggerCreated({parentLogLevelManager:this.logLevelManager,childLogLevelManager:e.logLevelManager,parentLogger:this,childLogger:e}),e}withFreshTransports(e){return this._config.transport=e,this._initializeTransports(e),this}withFreshPlugins(e){return this._config.plugins=e,this.pluginManager=new Lbe(e),this}withPluginManager(e){return this.pluginManager=e,this}errorOnly(e,r){let n=(r==null?void 0:r.logLevel)||rt.error;if(!this.isLevelEnabled(n))return;let{copyMsgOnOnlyError:i}=this._config,o={logLevel:n,err:e};(i&&(r==null?void 0:r.copyMsg)!==!1||(r==null?void 0:r.copyMsg)===!0)&&(e!=null&&e.message)&&(o.params=[e.message]),this._formatLog(o)}metadataOnly(e,r=rt.info){if(!this.isLevelEnabled(r))return;let{muteMetadata:n,consoleDebug:i}=this._config;if(n)return;if(!e){i&&console.debug("[LogLayer] metadataOnly was called with no metadata; dropping.");return}let o=e;if(this.pluginManager.hasPlugins($o.onMetadataCalled)&&(o=this.pluginManager.runOnMetadataCalled(e,this),!o)){i&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value.");return}let a={logLevel:r,metadata:o};this._formatLog(a)}info(...e){this.isLevelEnabled(rt.info)&&(this._formatMessage(e),this._formatLog({logLevel:rt.info,params:e}))}warn(...e){this.isLevelEnabled(rt.warn)&&(this._formatMessage(e),this._formatLog({logLevel:rt.warn,params:e}))}error(...e){this.isLevelEnabled(rt.error)&&(this._formatMessage(e),this._formatLog({logLevel:rt.error,params:e}))}debug(...e){this.isLevelEnabled(rt.debug)&&(this._formatMessage(e),this._formatLog({logLevel:rt.debug,params:e}))}trace(...e){this.isLevelEnabled(rt.trace)&&(this._formatMessage(e),this._formatLog({logLevel:rt.trace,params:e}))}fatal(...e){this.isLevelEnabled(rt.fatal)&&(this._formatMessage(e),this._formatLog({logLevel:rt.fatal,params:e}))}raw(e){if(!this.isLevelEnabled(e.logLevel))return;let r={logLevel:e.logLevel,params:e.messages,metadata:e.metadata,err:e.error,context:e.context};this._formatMessage(e.messages),this._formatLog(r)}disableLogging(){return this.logLevelManager.disableLogging(),this}enableLogging(){return this.logLevelManager.enableLogging(),this}muteContext(){return this._config.muteContext=!0,this}unMuteContext(){return this._config.muteContext=!1,this}muteMetadata(){return this._config.muteMetadata=!0,this}unMuteMetadata(){return this._config.muteMetadata=!1,this}enableIndividualLevel(e){return this.logLevelManager.enableIndividualLevel(e),this}disableIndividualLevel(e){return this.logLevelManager.disableIndividualLevel(e),this}setLevel(e){return this.logLevelManager.setLevel(e),this}isLevelEnabled(e){return this.logLevelManager.isLevelEnabled(e)}formatContext(e){let{contextFieldName:r,muteContext:n}=this._config;return e&&Object.keys(e).length>0&&!n?r?{[r]:E({},e)}:E({},e):{}}formatMetadata(e=null){let{metadataFieldName:r,muteMetadata:n}=this._config;return e&&!n?r?{[r]:E({},e)}:E({},e):{}}getLoggerInstance(e){let r=this.idToTransport[e];if(r)return r.getLoggerInstance()}_formatMessage(e=[]){let{prefix:r}=this._config;r&&typeof e[0]=="string"&&(e[0]=`${r} ${e[0]}`)}_formatLog({logLevel:e,params:r=[],metadata:n=null,err:i,context:o=null}){var m;let{errorSerializer:a,errorFieldInMetadata:s,muteContext:u,contextFieldName:c,metadataFieldName:l,errorFieldName:f}=this._config,d=o!==null?o:this.contextManager.getContext(),p=!!n||(u?!1:o!==null?Object.keys(o).length>0:this.contextManager.hasContextData()),h={};if(p)if(c&&c===l){let g=this.formatContext(d)[c],b=this.formatMetadata(n)[l];h={[c]:E(E({},g),b)}}else h=E(E({},this.formatContext(d)),this.formatMetadata(n));if(i){let g=a?a(i):i;s&&n&&l?h!=null&&h[l]?h[l][f]=g:h=J(E({},h),{[l]:{[f]:g}}):s&&!n&&l?h=J(E({},h),{[l]:{[f]:g}}):h=J(E({},h),{[f]:g}),p=!0}if(this.pluginManager.hasPlugins($o.onBeforeDataOut)&&(h=this.pluginManager.runOnBeforeDataOut({data:p?h:void 0,logLevel:e,error:i,metadata:n,context:d},this),h&&!p&&(p=!0)),this.pluginManager.hasPlugins($o.onBeforeMessageOut)&&(r=this.pluginManager.runOnBeforeMessageOut({messages:[...r],logLevel:e},this)),this.pluginManager.hasPlugins($o.transformLogLevel)&&(e=this.pluginManager.runTransformLogLevel({data:p?h:void 0,logLevel:e,messages:[...r],error:i,metadata:n,context:d},this)),this.hasMultipleTransports){let g=this._config.transport.filter(b=>b.enabled).map(async b=>{let v=e;if(!(this.pluginManager.hasPlugins($o.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:p?h:void 0,logLevel:v,transportId:b.id,error:i,metadata:n,context:d},this)))return b._sendToLogger({logLevel:v,messages:[...r],data:p?h:void 0,hasData:p,error:i,metadata:n,context:d})});Promise.all(g).catch(b=>{this._config.consoleDebug&&console.error("[LogLayer] Error executing transports:",b)})}else{if(!((m=this.singleTransport)!=null&&m.enabled)||this.pluginManager.hasPlugins($o.shouldSendToLogger)&&!this.pluginManager.runShouldSendToLogger({messages:[...r],data:p?h:void 0,logLevel:e,transportId:this.singleTransport.id,error:i,metadata:n,context:d},this))return;this.singleTransport._sendToLogger({logLevel:e,messages:[...r],data:p?h:void 0,hasData:p,error:i,metadata:n,context:d})}}};var Q6={logLayerHandlers:[],pluginsToInit:[],logBuilderHandlers:[]};var Mbe=class{constructor(t){At(this,"err");At(this,"metadata");At(this,"structuredLogger");At(this,"hasMetadata");At(this,"pluginManager");this.err=null,this.metadata={},this.structuredLogger=t,this.hasMetadata=!1,this.pluginManager=t.pluginManager,Q6.logBuilderHandlers.length>0&&Q6.logBuilderHandlers.forEach(e=>{e.onConstruct&&e.onConstruct(this,t)})}withMetadata(t){let{pluginManager:e,structuredLogger:{_config:{consoleDebug:r}}}=this;if(!t)return r&&console.debug("[LogLayer] withMetadata was called with no metadata; dropping."),this;let n=t;return e.hasPlugins($o.onMetadataCalled)&&(n=e.runOnMetadataCalled(t,this.structuredLogger),!n)?(r&&console.debug("[LogLayer] Metadata was dropped due to plugin returning falsy value."),this):(this.metadata=E(E({},this.metadata),n),this.hasMetadata=!0,this)}withError(t){return this.err=t,this}info(...t){this.structuredLogger.isLevelEnabled(rt.info)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.info,t))}warn(...t){this.structuredLogger.isLevelEnabled(rt.warn)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.warn,t))}error(...t){this.structuredLogger.isLevelEnabled(rt.error)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.error,t))}debug(...t){this.structuredLogger.isLevelEnabled(rt.debug)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.debug,t))}trace(...t){this.structuredLogger.isLevelEnabled(rt.trace)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.trace,t))}fatal(...t){this.structuredLogger.isLevelEnabled(rt.fatal)&&(this.structuredLogger._formatMessage(t),this.formatLog(rt.fatal,t))}disableLogging(){return this.structuredLogger.disableLogging(),this}enableLogging(){return this.structuredLogger.enableLogging(),this}formatLog(t,e){let{muteMetadata:r}=this.structuredLogger._config,n=r?!1:this.hasMetadata;this.structuredLogger._formatLog({logLevel:t,params:e,metadata:n?this.metadata:null,err:this.err})}};var Ube=class extends $q{constructor(t){super(t),t.stackDepthLevel!==void 0?this.logger.stackDepthLevel=t.stackDepthLevel:this.logger.stackDepthLevel=9}shipToLogger({logLevel:t,messages:e,data:r,hasData:n}){switch(r&&n&&e.push(r),t){case rt.info:this.logger.info(...e);break;case rt.warn:this.logger.warn(...e);break;case rt.error:this.logger.error(...e);break;case rt.trace:this.logger.trace(...e);break;case rt.debug:this.logger.debug(...e);break;case rt.fatal:this.logger.fatal(...e);break}return e}};function zbe(t){return{href:t.href,protocol:t.protocol,username:t.username,password:t.password,host:t.host,hostname:t.hostname,port:t.port,pathname:t.pathname,search:t.search,searchParams:[...t.searchParams].map(([e,r])=>({key:e,value:r})),hash:t.hash,origin:t.origin}}var eb={reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]};function tb(t,e,r,n=!1){let i=String(e),o=(u,c)=>`\x1B[${c[0]}m${u}\x1B[${c[1]}m`,a=(u,c)=>c!=null&&typeof c=="string"?o(u,eb[c]):c!=null&&Array.isArray(c)?c.reduce((l,f)=>a(l,f),u):c!=null&&c[u.trim()]!=null?a(u,c[u.trim()]):c!=null&&c["*"]!=null?a(u,c["*"]):u,s=null;return i.replace(/{{(.+?)}}/g,(u,c)=>{var f,d;let l=r[c]!=null?String(r[c]):n?"":u;return t.stylePrettyLogs?a(l,(d=(f=t==null?void 0:t.prettyLogStyles)==null?void 0:f[c])!=null?d:s)+o("",eb.reset):l})}function gs(t,e=2,r=0){return t!=null&&isNaN(t)?"":(t=t!=null?t+r:t,e===2?t==null?"--":t<10?"0"+t:t.toString():t==null?"---":t<10?"00"+t:t<100?"0"+t:t.toString())}function kq(t,e){var s,u,c,l,f,d,p,h,m,g,b,v,y,w,x,P,S,O,T,M,R,D,k,C,L,z,j;if(e==null)return{text:"",template:t.prettyLogTemplate,placeholders:{}};let r=t.prettyLogTemplate,n={};r.includes("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}")?r=r.replace("{{yyyy}}.{{mm}}.{{dd}} {{hh}}:{{MM}}:{{ss}}:{{ms}}","{{dateIsoStr}}"):t.prettyLogTimeZone==="UTC"?(n.yyyy=(u=(s=e.date)==null?void 0:s.getUTCFullYear())!=null?u:"----",n.mm=gs((c=e.date)==null?void 0:c.getUTCMonth(),2,1),n.dd=gs((l=e.date)==null?void 0:l.getUTCDate(),2),n.hh=gs((f=e.date)==null?void 0:f.getUTCHours(),2),n.MM=gs((d=e.date)==null?void 0:d.getUTCMinutes(),2),n.ss=gs((p=e.date)==null?void 0:p.getUTCSeconds(),2),n.ms=gs((h=e.date)==null?void 0:h.getUTCMilliseconds(),3)):(n.yyyy=(g=(m=e.date)==null?void 0:m.getFullYear())!=null?g:"----",n.mm=gs((b=e.date)==null?void 0:b.getMonth(),2,1),n.dd=gs((v=e.date)==null?void 0:v.getDate(),2),n.hh=gs((y=e.date)==null?void 0:y.getHours(),2),n.MM=gs((w=e.date)==null?void 0:w.getMinutes(),2),n.ss=gs((x=e.date)==null?void 0:x.getSeconds(),2),n.ms=gs((P=e.date)==null?void 0:P.getMilliseconds(),3));let i=t.prettyLogTimeZone==="UTC"?e.date:e.date!=null?new Date(e.date.getTime()-e.date.getTimezoneOffset()*6e4):void 0;n.rawIsoStr=(S=i==null?void 0:i.toISOString())!=null?S:"",n.dateIsoStr=(O=i==null?void 0:i.toISOString().replace("T"," ").replace("Z",""))!=null?O:"",n.logLevelName=e.logLevelName,n.fileNameWithLine=(M=(T=e.path)==null?void 0:T.fileNameWithLine)!=null?M:"",n.filePathWithLine=(D=(R=e.path)==null?void 0:R.filePathWithLine)!=null?D:"",n.fullFilePath=(C=(k=e.path)==null?void 0:k.fullFilePath)!=null?C:"";let o=(L=t.parentNames)==null?void 0:L.join(t.prettyErrorParentNamesSeparator);o=o!=null&&e.name!=null?o+t.prettyErrorParentNamesSeparator:void 0;let a=e.name!=null||o!=null?`${o!=null?o:""}${(z=e.name)!=null?z:""}`:"";return n.name=a,n.nameWithDelimiterPrefix=a.length>0?t.prettyErrorLoggerNameDelimiter+a:"",n.nameWithDelimiterSuffix=a.length>0?a+t.prettyErrorLoggerNameDelimiter:"",((j=t.overwrite)==null?void 0:j.addPlaceholders)!=null&&t.overwrite.addPlaceholders(e,n),{text:tb(t,r,n),template:r,placeholders:n}}var qbe=[/(?:^|[\\/])node_modules[\\/].*tslog/i,/(?:^|[\\/])deps[\\/].*tslog/i,/tslog[\\/]+src[\\/]+internal[\\/]/i,/tslog[\\/]+src[\\/]BaseLogger/i,/tslog[\\/]+src[\\/]index/i];function Kut(t){let e=typeof(t==null?void 0:t.stack)=="string"?t.stack:void 0;return e==null||e.length===0?[]:e.split(`
765
765
  `).map(r=>r.trimEnd())}function Zut(t){return t.filter(e=>e.length>0&&!/^\s*Error\b/.test(e))}function Jut(t,e){let r=[];for(let n of t){let i=e(n);i!=null&&r.push(i)}return r}function Bbe(t,e=qbe){var r,n;for(let i=0;i<t.length;i+=1){let o=t[i],a=(r=o.filePath)!=null?r:"",s=(n=o.fullFilePath)!=null?n:"";if(!e.some(u=>u.test(a)||u.test(s)))return i}return 0}function Xut(t){return Zut(Kut(t))}function sk(t,e){return Jut(Xut(t),e)}function Eq(t,e){return t<0?0:t>=e?Math.max(0,e-1):t}function Tq(){return[...qbe]}var Yut=5;function Vbe(t,e={}){var s;let r=(s=e.maxDepth)!=null?s:Yut,n=[],i=new Set,o=t,a=0;for(;o!=null&&a<r;){let u=o==null?void 0:o.cause;if(u==null||i.has(u))break;i.add(u),n.push(Pq(u)),o=u,a+=1}return n}function Pq(t){if(t instanceof Error)return t;let e=new Error(typeof t=="string"?t:JSON.stringify(t));return typeof t=="object"&&t!=null&&Object.assign(e,t),e}function ck(t){let e=new Set;return JSON.stringify(t,(r,n)=>{if(typeof n=="object"&&n!==null){if(e.has(n))return"[Circular]";e.add(n)}return typeof n=="bigint"?`${n}`:typeof n=="undefined"?"[undefined]":n})}function ko(t,e){let r={seen:[],stylize:Gbe};return e!=null&&Jbe(r,e),hy(r.showHidden)&&(r.showHidden=!1),hy(r.depth)&&(r.depth=2),hy(r.colors)&&(r.colors=!0),hy(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=elt),lk(r,t,r.depth)}ko.colors=eb;ko.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function Qut(t){return typeof t=="boolean"}function hy(t){return t===void 0}function Gbe(t){return t}function elt(t,e){var n,i,o,a;let r=ko.styles[e];return r!=null&&((i=(n=ko==null?void 0:ko.colors)==null?void 0:n[r])==null?void 0:i[0])!=null&&((a=(o=ko==null?void 0:ko.colors)==null?void 0:o[r])==null?void 0:a[1])!=null?"\x1B["+ko.colors[r][0]+"m"+t+"\x1B["+ko.colors[r][1]+"m":t}function uk(t){return typeof t=="function"}function Hbe(t){return typeof t=="string"}function tlt(t){return typeof t=="number"}function Kbe(t){return t===null}function Zbe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Rq(t){return fk(t)&&Oq(t)==="[object RegExp]"}function fk(t){return typeof t=="object"&&t!==null}function Cq(t){return fk(t)&&(Oq(t)==="[object Error]"||t instanceof Error)}function Wbe(t){return fk(t)&&Oq(t)==="[object Date]"}function Oq(t){return Object.prototype.toString.call(t)}function rlt(t){let e={};return t.forEach(r=>{e[r]=!0}),e}function nlt(t,e,r,n,i){let o=[];for(let a=0,s=e.length;a<s;++a)Zbe(e,String(a))?o.push(Iq(t,e,r,n,String(a),!0)):o.push("");return i.forEach(a=>{a.match(/^\d+$/)||o.push(Iq(t,e,r,n,a,!0))}),o}function Aq(t){return"["+Error.prototype.toString.call(t)+"]"}function lk(t,e,r=0){if(t.customInspect&&e!=null&&uk(e)&&(e==null?void 0:e.inspect)!==ko&&!(e!=null&&e.constructor&&(e==null?void 0:e.constructor.prototype)===e)){if(typeof e.inspect!="function"&&e.toString!=null)return e.toString();let l=e==null?void 0:e.inspect(r,t);return Hbe(l)||(l=lk(t,l,r)),l}let n=jd(t,e);if(n)return n;let i=Object.keys(e),o=rlt(i);try{t.showHidden&&Object.getOwnPropertyNames&&(i=Object.getOwnPropertyNames(e))}catch(l){}if(Cq(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Aq(e);if(i.length===0)if(uk(t.stylize)){if(uk(e)){let l=e.name?": "+e.name:"";return t.stylize("[Function"+l+"]","special")}if(Rq(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Wbe(e))return t.stylize(Date.prototype.toISOString.call(e),"date");if(Cq(e))return Aq(e)}else return e;let a="",s=!1,u=[`{
766
766
  `,`
767
767
  }`];if(Array.isArray(e)&&(s=!0,u=[`[
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kumori/kdsl",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "private": false,
5
5
  "files": [
6
6
  "bin",