jazz-ai 0.13.5 → 0.13.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +2 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -64,7 +64,7 @@ Expecting one of '${Z.join("', '")}'`);if(this._lifeCycleHooks[I])this._lifeCycl
|
|
|
64
64
|
`),this.outputHelp({error:!0});let Z=G||{},b=Z.exitCode||1,W=Z.code||"commander.error";this._exit(b,W,I)}_parseOptionsEnv(){this.options.forEach((I)=>{if(I.envVar&&I.envVar in al.env){let G=I.attributeName();if(this.getOptionValue(G)===void 0||["default","config","env"].includes(this.getOptionValueSource(G)))if(I.required||I.optional)this.emit(`optionEnv:${I.name()}`,al.env[I.envVar]);else this.emit(`optionEnv:${I.name()}`)}})}_parseOptionsImplied(){let I=new mwI(this.options),G=(Z)=>{return this.getOptionValue(Z)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(Z))};this.options.filter((Z)=>Z.implied!==void 0&&G(Z.attributeName())&&I.valueFromOption(this.getOptionValue(Z.attributeName()),Z)).forEach((Z)=>{Object.keys(Z.implied).filter((b)=>!G(b)).forEach((b)=>{this.setOptionValueWithSource(b,Z.implied[b],"implied")})})}missingArgument(I){let G=`error: missing required argument '${I}'`;this.error(G,{code:"commander.missingArgument"})}optionMissingArgument(I){let G=`error: option '${I.flags}' argument missing`;this.error(G,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(I){let G=`error: required option '${I.flags}' not specified`;this.error(G,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(I,G){let Z=(l)=>{let Y=l.attributeName(),N=this.getOptionValue(Y),c=this.options.find((F)=>F.negate&&Y===F.attributeName()),X=this.options.find((F)=>!F.negate&&Y===F.attributeName());if(c&&(c.presetArg===void 0&&N===!1||c.presetArg!==void 0&&N===c.presetArg))return c;return X||l},b=(l)=>{let Y=Z(l),N=Y.attributeName();if(this.getOptionValueSource(N)==="env")return`environment variable '${Y.envVar}'`;return`option '${Y.flags}'`},W=`error: ${b(I)} cannot be used with ${b(G)}`;this.error(W,{code:"commander.conflictingOption"})}unknownOption(I){if(this._allowUnknownOption)return;let G="";if(I.startsWith("--")&&this._showSuggestionAfterError){let b=[],W=this;do{let l=W.createHelp().visibleOptions(W).filter((Y)=>Y.long).map((Y)=>Y.long);b=b.concat(l),W=W.parent}while(W&&!W._enablePositionalOptions);G=wwI(I,b)}let Z=`error: unknown option '${I}'${G}`;this.error(Z,{code:"commander.unknownOption"})}_excessArguments(I){if(this._allowExcessArguments)return;let G=this.registeredArguments.length,Z=G===1?"":"s",b=I.length,W=this.parent?` for '${this.name()}'`:"",l=I.join(", "),Y=`error: too many arguments${W}. Expected ${G} argument${Z} but got ${b}: ${l}.`;this.error(Y,{code:"commander.excessArguments"})}unknownCommand(){let I=this.args[0],G="";if(this._showSuggestionAfterError){let b=[];this.createHelp().visibleCommands(this).forEach((W)=>{if(b.push(W.name()),W.alias())b.push(W.alias())}),G=wwI(I,b)}let Z=`error: unknown command '${I}'${G}`;this.error(Z,{code:"commander.unknownCommand"})}version(I,G,Z){if(I===void 0)return this._version;this._version=I,G=G||"-V, --version",Z=Z||"output the version number";let b=this.createOption(G,Z);return this._versionOptionName=b.attributeName(),this._registerOption(b),this.on("option:"+b.name(),()=>{this._outputConfiguration.writeOut(`${I}
|
|
65
65
|
`),this._exit(0,"commander.version",I)}),this}description(I,G){if(I===void 0&&G===void 0)return this._description;if(this._description=I,G)this._argsDescription=G;return this}summary(I){if(I===void 0)return this._summary;return this._summary=I,this}alias(I){if(I===void 0)return this._aliases[0];let G=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler)G=this.commands[this.commands.length-1];if(I===G._name)throw Error("Command alias can't be the same as its name");let Z=this.parent?._findCommand(I);if(Z){let b=[Z.name()].concat(Z.aliases()).join("|");throw Error(`cannot add alias '${I}' to command '${this.name()}' as already have command '${b}'`)}return G._aliases.push(I),this}aliases(I){if(I===void 0)return this._aliases;return I.forEach((G)=>this.alias(G)),this}usage(I){if(I===void 0){if(this._usage)return this._usage;let G=this.registeredArguments.map((Z)=>{return Pr(Z)});return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?G:[]).join(" ")}return this._usage=I,this}name(I){if(I===void 0)return this._name;return this._name=I,this}helpGroup(I){if(I===void 0)return this._helpGroupHeading??"";return this._helpGroupHeading=I,this}commandsGroup(I){if(I===void 0)return this._defaultCommandGroup??"";return this._defaultCommandGroup=I,this}optionsGroup(I){if(I===void 0)return this._defaultOptionGroup??"";return this._defaultOptionGroup=I,this}_initOptionGroup(I){if(this._defaultOptionGroup&&!I.helpGroupHeading)I.helpGroup(this._defaultOptionGroup)}_initCommandGroup(I){if(this._defaultCommandGroup&&!I.helpGroup())I.helpGroup(this._defaultCommandGroup)}nameFromFilename(I){return this._name=JJ.basename(I,JJ.extname(I)),this}executableDir(I){if(I===void 0)return this._executableDir;return this._executableDir=I,this}helpInformation(I){let G=this.createHelp(),Z=this._getOutputContext(I);G.prepareContext({error:Z.error,helpWidth:Z.helpWidth,outputHasColors:Z.hasColors});let b=G.formatHelp(this,G);if(Z.hasColors)return b;return this._outputConfiguration.stripColor(b)}_getOutputContext(I){I=I||{};let G=!!I.error,Z,b,W;if(G)Z=(Y)=>this._outputConfiguration.writeErr(Y),b=this._outputConfiguration.getErrHasColors(),W=this._outputConfiguration.getErrHelpWidth();else Z=(Y)=>this._outputConfiguration.writeOut(Y),b=this._outputConfiguration.getOutHasColors(),W=this._outputConfiguration.getOutHelpWidth();return{error:G,write:(Y)=>{if(!b)Y=this._outputConfiguration.stripColor(Y);return Z(Y)},hasColors:b,helpWidth:W}}outputHelp(I){let G;if(typeof I==="function")G=I,I=void 0;let Z=this._getOutputContext(I),b={error:Z.error,write:Z.write,command:this};this._getCommandAndAncestors().reverse().forEach((l)=>l.emit("beforeAllHelp",b)),this.emit("beforeHelp",b);let W=this.helpInformation({error:Z.error});if(G){if(W=G(W),typeof W!=="string"&&!Buffer.isBuffer(W))throw Error("outputHelp callback must return a string or a Buffer")}if(Z.write(W),this._getHelpOption()?.long)this.emit(this._getHelpOption().long);this.emit("afterHelp",b),this._getCommandAndAncestors().forEach((l)=>l.emit("afterAllHelp",b))}helpOption(I,G){if(typeof I==="boolean"){if(I){if(this._helpOption===null)this._helpOption=void 0;if(this._defaultOptionGroup)this._initOptionGroup(this._getHelpOption())}else this._helpOption=null;return this}if(this._helpOption=this.createOption(I??"-h, --help",G??"display help for command"),I||G)this._initOptionGroup(this._helpOption);return this}_getHelpOption(){if(this._helpOption===void 0)this.helpOption(void 0,void 0);return this._helpOption}addHelpOption(I){return this._helpOption=I,this._initOptionGroup(I),this}help(I){this.outputHelp(I);let G=Number(al.exitCode??0);if(G===0&&I&&typeof I!=="function"&&I.error)G=1;this._exit(G,"commander.help","(outputHelp)")}addHelpText(I,G){let Z=["beforeAll","before","after","afterAll"];if(!Z.includes(I))throw Error(`Unexpected value for position to addHelpText.
|
|
66
66
|
Expecting one of '${Z.join("', '")}'`);let b=`${I}Help`;return this.on(b,(W)=>{let l;if(typeof G==="function")l=G({error:W.error,command:W.command});else l=G;if(l)W.write(`${l}
|
|
67
|
-
`)}),this}_outputHelpIfRequested(I){let G=this._getHelpOption();if(G&&I.find((b)=>G.is(b)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}});var BjW;var _2G=u(()=>{_r();P2G();eD();HwI();dwI();BjW=new ng});var o0;var G8=u(()=>{o0={name:"jazz-ai",version:"0.13.
|
|
67
|
+
`)}),this}_outputHelpIfRequested(I){let G=this._getHelpOption();if(G&&I.find((b)=>G.is(b)))this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)")}}});var BjW;var _2G=u(()=>{_r();P2G();eD();HwI();dwI();BjW=new ng});var o0;var G8=u(()=>{o0={name:"jazz-ai",version:"0.13.6",description:"Your terminal. Your agent. Your rules.",license:"MIT",main:"dist/main.js",types:"dist/main.d.ts",type:"module",bin:{jazz:"./dist/main.js"},author:{name:"lvndry",email:"lvndry@proton.me",url:"https://github.com/lvndry"},homepage:"https://github.com/lvndry/jazz",repository:{type:"git",url:"https://github.com/lvndry/jazz.git"},bugs:{url:"https://github.com/lvndry/jazz/issues"},keywords:["cli","agents","automation","agentic","typescript","effect-ts","ai","llm","workflow","email","git","productivity","assistant","task-automation","developer-tools","ai-assistant","ai-agent","mcp","mcp-server","agent-skills"],scripts:{build:"bun run scripts/build.ts",typecheck:"bun run tsc --noEmit && bun run tsc -p tsconfig.build.json","typecheck:evals":"tsc -p evals/tsconfig.json",evals:"bun run evals/cli.ts",dev:"bun --watch src/main.ts",start:"bun dist/main.js",cli:"bun src/main.ts",prepare:"git config core.hooksPath .githooks || true",lint:"bun eslint src scripts --cache","lint:fix":"bun eslint src scripts --fix --cache",format:"bun prettier --write src",test:"bun test","test:watch":"bun test --watch","test:typecheck":"bunx tsc --project tsconfig.test.json",clean:"rm -rf dist",prebuild:"bun run clean",prepublishOnly:"bun run build"},dependencies:{"@ai-sdk/alibaba":"^2.0.16","@ai-sdk/anthropic":"^4.0.18","@ai-sdk/cerebras":"^3.0.14","@ai-sdk/deepseek":"^3.0.13","@ai-sdk/fireworks":"^3.0.15","@ai-sdk/google":"^4.0.21","@ai-sdk/groq":"^4.0.13","@ai-sdk/mcp":"^2.0.16","@ai-sdk/mistral":"^4.0.14","@ai-sdk/moonshotai":"^3.0.17","@ai-sdk/openai":"^4.0.17","@ai-sdk/openai-compatible":"^3.0.14","@ai-sdk/togetherai":"^3.0.15","@ai-sdk/xai":"^4.0.18","@effect/cluster":"^0.59.0","@effect/platform":"^0.96.2","@effect/platform-node":"^0.107.0","@effect/rpc":"^0.75.1","@effect/sql":"^0.51.1","@modelcontextprotocol/sdk":"^1.29.0","@openrouter/ai-sdk-provider":"^3.0.0","@perplexity-ai/perplexity_ai":"^0.33.0","@tavily/core":"^0.7.6","@toon-format/toon":"^2.3.0",ai:"^7.0.34",chalk:"^5.6.2","cli-highlight":"^2.1.11",commander:"^15.0.0","cron-parser":"^5.5.0",cronstrue:"^3.20.0",diff:"^9.0.0",effect:"^3.21.4","exa-js":"^2.14.0","fast-glob":"^3.3.3","gpt-tokenizer":"^3.4.0","gray-matter":"^4.0.3",ink:"^7.1.0","ink-select-input":"^6.2.0","ink-spinner":"^5.0.0","linkup-sdk":"^3.2.5",marked:"^18.0.5","marked-terminal":"^7.3.0","node-emoji":"^2.2.0","ollama-ai-provider-v2":"^4.0.1","parallel-web":"^1.1.0","pdf-parse":"^2.4.5",plist:"^5.0.0",react:"^19.2.7",semver:"^7.8.4","short-uuid":"^6.0.3","vercel-minimax-ai-provider":"^0.0.2","wrap-ansi":"^10.0.0","zhipu-ai-provider":"^0.3.1",zod:"^4.4.3"},devDependencies:{"@eslint/js":"^10.0.1","@types/bun":"^1.3.14","@types/marked":"^6.0.0","@types/marked-terminal":"^6.1.1","@types/node":"^26.0.0","@types/react":"^19.2.17",eslint:"^10.5.0","eslint-config-prettier":"^10.1.8","eslint-plugin-import-x":"^4.16.2","eslint-plugin-n":"^18.1.0","eslint-plugin-prettier":"^5.5.6",prettier:"^3.8.4",typescript:"^6.0.3","typescript-eslint":"^8.61.1"},engines:{node:">=22.16.0",npm:">=10.0.0"},files:["dist/","vendor/terminal-notifier/","personas/","skills/","workflows/","README.md","LICENSE"]}});var $2G,n2G=()=>{return Object.assign((I)=>I,{[$2G]:$2G,option:(I)=>XI(I),either:(I)=>dG(I),is:(I)=>!0})};var f2G=u(()=>{qV();Vb();$2G=Symbol.for("effect/Brand/Refined")});var JwI,vwI,i2G;var o2G=u(()=>{UE();JwI=jI,vwI=sG,i2G=qI});var s2G,r2G,t2G;var e2G=u(()=>{fs();s2G=lD,r2G=VD,t2G=bWG});var EwI=(I,G)=>{switch(G._tag){case"StringKeyword":case"TemplateLiteral":return Object.keys(I);case"SymbolKeyword":return Object.getOwnPropertySymbols(I);case"Refinement":return EwI(I,G.from)}},Z8=(I)=>{let G=!1,Z;return()=>{if(G)return Z;return Z=I(),G=!0,Z}},CwI=(I)=>Array.isArray(I),GVG=(I)=>!Array.isArray(I),IVG=(I)=>`[${Hv(I)}]`,fr=(I)=>CwI(I)?I.map(IVG).join(""):IVG(I);var b8=u(()=>{uY()});var fE=(I,G,Z,b)=>{let W=I;if(Z&&fl(Z))W+=`
|
|
68
68
|
at path: ${fr(Z)}`;if(G!==void 0)W+=`
|
|
69
69
|
details: ${G}`;if(b)W+=`
|
|
70
70
|
schema (${b._tag}): ${b}`;return W},ywI=(I,G,Z)=>fE("Unsupported schema or overlapping types",`cannot extend ${I} with ${G}`,Z),ZVG=(I)=>fE("Unsupported key schema",void 0,void 0,I),bVG=(I)=>fE("Unsupported literal",`literal value: ${jQ(I)}`),AwI=(I)=>fE("Duplicate index signature",`${I} index signature`),WVG,lVG,LwI=(I)=>fE("Duplicate property signature transformation",`Duplicate key ${jQ(I)}`),or=(I)=>fE("Duplicate property signature",`Duplicate key ${jQ(I)}`);var pwI=u(()=>{BY();uY();b8();WVG=fE("Unsupported index signature parameter","An index signature parameter type must be `string`, `symbol`, a template literal type or a refinement of the previous types"),lVG=fE("Invalid element","A required element cannot follow an optional element. ts(1257)")});var NVG;var VVG=u(()=>{NVG=Symbol.for("effect/SchemaId/DateFromSelf")});class fg{typeParameters;decodeUnknown;encodeUnknown;annotations;_tag="Declaration";constructor(I,G,Z,b={}){this.typeParameters=I,this.decodeUnknown=G,this.encodeUnknown=Z,this.annotations=b}toString(){return zb(k5(this),()=>"<declaration schema>")}toJSON(){return{_tag:this._tag,typeParameters:this.typeParameters.map((I)=>I.toJSON()),annotations:Y2(this.annotations)}}}class ig{literal;annotations;_tag="Literal";constructor(I,G={}){this.literal=I,this.annotations=G}toString(){return zb(k5(this),()=>jQ(this.literal))}toJSON(){return{_tag:this._tag,literal:Rv(this.literal)?String(this.literal):this.literal,annotations:Y2(this.annotations)}}}class rr{symbol;annotations;_tag="UniqueSymbol";constructor(I,G={}){this.symbol=I,this.annotations=G}toString(){return zb(k5(this),()=>jQ(this.symbol))}toJSON(){return{_tag:this._tag,symbol:String(this.symbol),annotations:Y2(this.annotations)}}}class yVG{annotations;_tag="UndefinedKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class AVG{annotations;_tag="VoidKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class LVG{annotations;_tag="NeverKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class pVG{annotations;_tag="UnknownKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class zVG{annotations;_tag="AnyKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class gVG{annotations;_tag="StringKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class UVG{annotations;_tag="NumberKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class uVG{annotations;_tag="BooleanKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class BVG{annotations;_tag="BigIntKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class OVG{annotations;_tag="SymbolKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class xVG{annotations;_tag="ObjectKeyword";constructor(I={}){this.annotations=I}toString(){return Am(this)}toJSON(){return{_tag:this._tag,annotations:Y2(this.annotations)}}}class N8{type;annotations;constructor(I,G={}){this.type=I,this.annotations=G}toJSON(){return{type:this.type.toJSON(),annotations:Y2(this.annotations)}}toString(){return String(this.type)}}class bt{elements;rest;isReadonly;annotations;_tag="TupleType";constructor(I,G,Z,b={}){this.elements=I,this.rest=G,this.isReadonly=Z,this.annotations=b;let W=!1,l=!1;for(let Y of I)if(Y.isOptional)W=!0;else if(W){l=!0;break}if(l||W&&G.length>1)throw Error(lVG)}toString(){return zb(k5(this),()=>jnZ(this))}toJSON(){return{_tag:this._tag,elements:this.elements.map((I)=>I.toJSON()),rest:this.rest.map((I)=>I.toJSON()),isReadonly:this.isReadonly,annotations:Y2(this.annotations)}}}class og{type;isReadonly;parameter;constructor(I,G,Z){if(this.type=G,this.isReadonly=Z,jVG(I))this.parameter=I;else throw Error(WVG)}toString(){return(this.isReadonly?"readonly ":"")+`[x: ${this.parameter}]: ${this.type}`}toJSON(){return{parameter:this.parameter.toJSON(),type:this.type.toJSON(),isReadonly:this.isReadonly}}}class ym{annotations;_tag="TypeLiteral";propertySignatures;indexSignatures;constructor(I,G,Z={}){this.annotations=Z;let b={};for(let l=0;l<I.length;l++){let Y=I[l].name;if(Object.prototype.hasOwnProperty.call(b,Y))throw Error(or(Y));b[Y]=null}let W={string:!1,symbol:!1};for(let l=0;l<G.length;l++){let Y=ZhI(G[l].parameter);if(Gt(Y)){if(W.string)throw Error(AwI("string"));W.string=!0}else if(MVG(Y)){if(W.symbol)throw Error(AwI("symbol"));W.symbol=!0}}this.propertySignatures=I,this.indexSignatures=G}toString(){return zb(k5(this),()=>DnZ(this))}toJSON(){return{_tag:this._tag,propertySignatures:this.propertySignatures.map((I)=>I.toJSON()),indexSignatures:this.indexSignatures.map((I)=>I.toJSON()),annotations:Y2(this.annotations)}}}class s0{types;annotations;static make=(I,G)=>{return Wt(I)?new s0(I,G):I.length===1?I[0]:er};static unify=(I,G)=>{return s0.make(TnZ(DVG(I)),G)};_tag="Union";constructor(I,G={}){this.types=I,this.annotations=G}toString(){return zb(k5(this),()=>this.types.map(String).join(" | "))}toJSON(){return{_tag:this._tag,types:this.types.map((I)=>I.toJSON()),annotations:Y2(this.annotations)}}}class sg{f;annotations;_tag="Suspend";constructor(I,G={}){this.f=I,this.annotations=G,this.f=Z8(I)}toString(){return k5(this).pipe(wF(()=>Z2(gC(this.f)(),(I)=>k5(I))),zb(()=>"<suspended schema>"))}toJSON(){let I=this.f(),G=zwI.get(I);if(G)return G;return zwI.set(I,{_tag:this._tag}),G={_tag:this._tag,ast:I.toJSON(),annotations:Y2(this.annotations)},zwI.set(I,G),G}}class rg{from;filter;annotations;_tag="Refinement";constructor(I,G,Z={}){this.from=I,this.filter=G,this.annotations=Z}toString(){return Y8(this).pipe(zb(()=>fG(fVG(this),{onNone:()=>`{ ${this.from} | filter }`,onSome:(I)=>iE(this.from)?String(this.from)+" & "+I:I})))}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),annotations:Y2(this.annotations)}}}class oE{from;to;transformation;annotations;_tag="Transformation";constructor(I,G,Z,b={}){this.from=I,this.to=G,this.transformation=Z,this.annotations=b}toString(){return zb(k5(this),()=>`(${String(this.from)} <-> ${String(this.to)})`)}toJSON(){return{_tag:this._tag,from:this.from.toJSON(),to:this.to.toJSON(),annotations:Y2(this.annotations)}}}class Nt{decode;encode;_tag="FinalTransformation";constructor(I,G){this.decode=I,this.encode=G}}class TVG{_tag="ComposeTransformation"}class twI{from;to;decode;encode;constructor(I,G,Z,b){this.from=I,this.to=G,this.decode=Z,this.encode=b}}class V8{propertySignatureTransformations;_tag="TypeLiteralTransformation";constructor(I){this.propertySignatureTransformations=I;let G={},Z={};for(let b of I){let W=b.from;if(G[W])throw Error(LwI(W));G[W]=!0;let l=b.to;if(Z[l])throw Error(LwI(l));Z[l]=!0}}}function y1(I,G){let Z=!1,b=UC(I.length);for(let W=0;W<I.length;W++){let l=I[W],Y=G(l);if(Y!==l)Z=!0;b[W]=Y}return Z?b:I}function fnZ(I){return fG(mVG(I),{onNone:()=>"",onSome:(G)=>G.map((Z)=>` & Brand<${jQ(Z)}>`).join("")})}var XVG,FVG,QVG,gwI,sr,W8,qF,ry,vJ,UwI,uwI,BwI,OwI,MwI,xwI,RVG,KwI,jwI,DwI,qwI,awI,l8,HVG,r0,mVG,dVG,wVG,TwI,SwI,Y8,PwI,hVG,JVG,vVG,EVG,CVG,_wI,UnZ,$wI=(I)=>R0I(UnZ(I),(G)=>G===!0),nwI,unZ,BnZ=(I)=>wF(unZ(I),()=>Y8(I)),EJ=(I)=>(G)=>G._tag===I,ty,tr,OnZ,er,fwI,kVG,It,Gt,Zt,iwI,owI,swI,MnZ,xnZ,MVG,KnZ,ey,KVG=(I)=>I.map((G)=>G.type),jnZ=(I)=>{let G=I.elements.map(String).join(", ");return uqI(I.rest,{onEmpty:()=>`readonly [${G}]`,onNonEmpty:(Z,b)=>{let W=String(Z),l=W.includes(" | ")?`(${W})`:W;if(b.length>0){let Y=b.map(String).join(", ");if(I.elements.length>0)return`readonly [${G}, ...${l}[], ${Y}]`;else return`readonly [...${l}[], ${Y}]`}else if(I.elements.length>0)return`readonly [${G}, ...${l}[]]`;else return`ReadonlyArray<${W}>`}})},yV,jVG=(I)=>{switch(I._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return!0;case"Refinement":return jVG(I.from)}return!1},cVG=(I)=>I.map(String).join("; "),DnZ=(I)=>{if(I.propertySignatures.length>0){let G=I.propertySignatures.map(String).join("; ");if(I.indexSignatures.length>0)return`{ ${G}; ${cVG(I.indexSignatures)} }`;else return`{ ${G} }`}else if(I.indexSignatures.length>0)return`{ ${cVG(I.indexSignatures)} }`;else return"{}"},rwI,qnZ,anZ,DVG=(I)=>uC(I,(G)=>lt(G)?DVG(G.types):[G]),TnZ=(I)=>{let G=qnZ(I),Z=[],b={},W=[];for(let l of G)switch(l._tag){case"NeverKeyword":break;case"AnyKeyword":return[kVG];case"UnknownKeyword":return[fwI];case"ObjectKeyword":case"UndefinedKeyword":case"VoidKeyword":case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":{if(!b[l._tag])b[l._tag]=l,Z.push(l);break}case"Literal":{let Y=typeof l.literal;switch(Y){case"string":case"number":case"bigint":case"boolean":{let N=anZ[Y];if(!b[N]&&!W.includes(l.literal))W.push(l.literal),Z.push(l);break}case"object":{if(!W.includes(l.literal))W.push(l.literal),Z.push(l);break}}break}case"UniqueSymbol":{if(!b.SymbolKeyword&&!W.includes(l.symbol))W.push(l.symbol),Z.push(l);break}case"TupleType":{if(!b.ObjectKeyword)Z.push(l);break}case"TypeLiteral":{if(l.propertySignatures.length===0&&l.indexSignatures.length===0){if(!b["{}"])b["{}"]=l,Z.push(l)}else if(!b.ObjectKeyword)Z.push(l);break}default:Z.push(l)}return Z},qVG=(I,G)=>I.map(G),Wt=(I)=>I.length>1,lt,zwI,iE,Yt,aVG,SnZ=(I)=>(G)=>G._tag===I,SVG,ewI,Vt=(I,G)=>{let Z=Object.getOwnPropertyDescriptors(I),b={...I.annotations};delete b[W8];let W={...b,...G},l=_wI(I);if(VZ(l))W[l8]=Vt(l.value,G);return Z.annotations.value=W,Object.create(Object.getPrototypeOf(I),Z)},PnZ="[\\s\\S]*?",_nZ="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",PVG=(I,G)=>{switch(I._tag){case"Literal":return Ck(String(I.literal));case"StringKeyword":return PnZ;case"NumberKeyword":return _nZ;case"TemplateLiteral":return _VG(I,G,!1);case"Union":return I.types.map((Z)=>PVG(Z,G)).join("|")}},$nZ=(I,G,Z,b)=>{if(lt(I)){if(Z&&!b)return`(?:${G})`}else if(!Z||!b)return G;return`(${G})`},_VG=(I,G,Z)=>{let b="";if(I.head!==""){let W=Ck(I.head);b+=G&&Z?`(${W})`:W}for(let W of I.spans){let l=PVG(W.type,G);if(b+=$nZ(W.type,l,G,Z),W.literal!==""){let Y=Ck(W.literal);b+=G&&Z?`(${Y})`:Y}}return b},$VG=(I)=>new RegExp(`^${_VG(I,!1,!0)}$`),IhI=(I,G)=>{let Z=[],b=[],W=(l)=>{switch(l._tag){case"NeverKeyword":break;case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":case"Refinement":b.push(new og(l,G,!0));break;case"Literal":if(FV(l.literal)||vX(l.literal))Z.push(new yV(l.literal,G,!1,!0));else throw Error(bVG(l.literal));break;case"Enums":{for(let[Y,N]of l.enums)Z.push(new yV(N,G,!1,!0));break}case"UniqueSymbol":Z.push(new yV(l.symbol,G,!1,!0));break;case"Union":l.types.forEach(W);break;default:throw Error(ZVG(l))}};return W(I),{propertySignatures:Z,indexSignatures:b}},GhI=(I)=>(G)=>{let Z=void 0;for(let b of I)if(Object.prototype.hasOwnProperty.call(G.annotations,b)){if(Z===void 0)Z={};Z[b]=G.annotations[b]}return Z},nVG=(I)=>(G)=>{let Z={...G.annotations};for(let b of I)delete Z[b];return Z},nnZ,A2=(I)=>{switch(I._tag){case"Declaration":{let G=y1(I.typeParameters,A2);return G===I.typeParameters?I:new fg(G,I.decodeUnknown,I.encodeUnknown,I.annotations)}case"TupleType":{let G=y1(I.elements,(W)=>{let l=A2(W.type);return l===W.type?W:new ey(l,W.isOptional)}),Z=KVG(I.rest),b=y1(Z,A2);return G===I.elements&&b===Z?I:new bt(G,b.map((W)=>new N8(W)),I.isReadonly,I.annotations)}case"TypeLiteral":{let G=y1(I.propertySignatures,(b)=>{let W=A2(b.type);return W===b.type?b:new yV(b.name,W,b.isOptional,b.isReadonly)}),Z=y1(I.indexSignatures,(b)=>{let W=A2(b.type);return W===b.type?b:new og(b.parameter,W,b.isReadonly)});return G===I.propertySignatures&&Z===I.indexSignatures?I:new ym(G,Z,I.annotations)}case"Union":{let G=y1(I.types,A2);return G===I.types?I:s0.make(G,I.annotations)}case"Suspend":return new sg(()=>A2(I.f()),I.annotations);case"Refinement":{let G=A2(I.from);return G===I.from?I:new rg(G,I.filter,I.annotations)}case"Transformation":{let G=nnZ(I);return A2(G!==void 0?Vt(I.to,G):I.to)}}return I},kwI=(I)=>{switch(I._tag){case"Transformation":return I.from;case"Refinement":return kwI(I.from);case"Suspend":return kwI(I.f())}},z5=(I,G)=>{switch(I._tag){case"Declaration":{let Z=y1(I.typeParameters,(b)=>z5(b,G));return Z===I.typeParameters?I:new fg(Z,I.decodeUnknown,I.encodeUnknown)}case"TupleType":{let Z=y1(I.elements,(l)=>{let Y=z5(l.type,G);return Y===l.type?l:new ey(Y,l.isOptional)}),b=KVG(I.rest),W=y1(b,(l)=>z5(l,G));return Z===I.elements&&W===b?I:new bt(Z,W.map((l)=>new N8(l)),I.isReadonly)}case"TypeLiteral":{let Z=y1(I.propertySignatures,(W)=>{let l=z5(W.type,G);return l===W.type?W:new yV(W.name,l,W.isOptional,W.isReadonly)}),b=y1(I.indexSignatures,(W)=>{let l=z5(W.type,G);return l===W.type?W:new og(W.parameter,l,W.isReadonly)});return Z===I.propertySignatures&&b===I.indexSignatures?I:new ym(Z,b)}case"Union":{let Z=y1(I.types,(b)=>z5(b,G));return Z===I.types?I:s0.make(Z)}case"Suspend":{let Z=void 0,b=BnZ(I);if(VZ(b)){let W=G?"Bound":"";Z={[nwI]:`${b.value}Encoded${W}`}}return new sg(()=>z5(I.f(),G),Z)}case"Refinement":{let Z=z5(I.from,G);if(G){if(Z===I.from)return I;if(kwI(I.from)===void 0&&$wI(I))return new rg(Z,I.filter,I.annotations);return Z}else return Z}case"Transformation":return z5(I.from,G)}return I},c8=(I)=>z5(I,!1),Y2=(I)=>{let G={};for(let Z of Object.getOwnPropertySymbols(I))G[String(Z)]=I[Z];return G},ZhI=(I)=>{switch(I._tag){case"StringKeyword":case"SymbolKeyword":case"TemplateLiteral":return I;case"Refinement":return ZhI(I.from)}},Am=(I)=>zb(k5(I),()=>I._tag),fVG=(I)=>TwI(I).pipe(wF(()=>PwI(I)),wF(()=>SwI(I)),Zl((G)=>G+fnZ(I))),k5=(I)=>wF(Y8(I),()=>fVG(I));var bhI=u(()=>{BY();GG();uY();pwI();b8();GE();Vb();mv();eZ();OFI();XVG=Symbol.for("effect/annotation/TypeConstructor"),FVG=Symbol.for("effect/annotation/Brand"),QVG=Symbol.for("effect/annotation/SchemaId"),gwI=Symbol.for("effect/annotation/Message"),sr=Symbol.for("effect/annotation/MissingMessage"),W8=Symbol.for("effect/annotation/Identifier"),qF=Symbol.for("effect/annotation/Title"),ry=Symbol.for("effect/annotation/AutoTitle"),vJ=Symbol.for("effect/annotation/Description"),UwI=Symbol.for("effect/annotation/Examples"),uwI=Symbol.for("effect/annotation/Default"),BwI=Symbol.for("effect/annotation/JSONSchema"),OwI=Symbol.for("effect/annotation/Arbitrary"),MwI=Symbol.for("effect/annotation/Pretty"),xwI=Symbol.for("effect/annotation/Equivalence"),RVG=Symbol.for("effect/annotation/Documentation"),KwI=Symbol.for("effect/annotation/Concurrency"),jwI=Symbol.for("effect/annotation/Batching"),DwI=Symbol.for("effect/annotation/ParseIssueTitle"),qwI=Symbol.for("effect/annotation/ParseOptions"),awI=Symbol.for("effect/annotation/DecodingFallback"),l8=Symbol.for("effect/annotation/Surrogate"),HVG=Symbol.for("effect/annotation/StableFilter"),r0=k(2,(I,G)=>Object.prototype.hasOwnProperty.call(I.annotations,G)?XI(I.annotations[G]):mI()),mVG=r0(FVG),dVG=r0(gwI),wVG=r0(sr),TwI=r0(qF),SwI=r0(ry),Y8=r0(W8),PwI=r0(vJ),hVG=r0(KwI),JVG=r0(jwI),vVG=r0(DwI),EVG=r0(qwI),CVG=r0(awI),_wI=r0(l8),UnZ=r0(HVG),nwI=Symbol.for("effect/annotation/JSONIdentifier"),unZ=r0(nwI);ty=EJ("Literal");tr=new yVG({[qF]:"undefined"});OnZ=new AVG({[qF]:"void"});er=new LVG({[qF]:"never"});fwI=new pVG({[qF]:"unknown"});kVG=new zVG({[qF]:"any"});It=new gVG({[qF]:"string",[vJ]:"a string"}),Gt=EJ("StringKeyword");Zt=new UVG({[qF]:"number",[vJ]:"a number"}),iwI=EJ("NumberKeyword");owI=new uVG({[qF]:"boolean",[vJ]:"a boolean"}),swI=EJ("BooleanKeyword");MnZ=new BVG({[qF]:"bigint",[vJ]:"a bigint"});xnZ=new OVG({[qF]:"symbol",[vJ]:"a symbol"}),MVG=EJ("SymbolKeyword");KnZ=new xVG({[qF]:"object",[vJ]:"an object in the TypeScript meaning, i.e. the `object` type"});ey=class ey extends N8{isOptional;constructor(I,G,Z={}){super(I,Z);this.isOptional=G}toJSON(){return{type:this.type.toJSON(),isOptional:this.isOptional,annotations:Y2(this.annotations)}}toString(){return String(this.type)+(this.isOptional?"?":"")}};yV=class yV extends ey{name;isReadonly;constructor(I,G,Z,b,W){super(G,Z,W);this.name=I,this.isReadonly=b}toString(){return(this.isReadonly?"readonly ":"")+String(this.name)+(this.isOptional?"?":"")+": "+this.type}toJSON(){return{name:String(this.name),type:this.type.toJSON(),isOptional:this.isOptional,isReadonly:this.isReadonly,annotations:Y2(this.annotations)}}};rwI=EJ("TypeLiteral"),qnZ=nc(fd(JV,(I)=>{switch(I._tag){case"AnyKeyword":return 0;case"UnknownKeyword":return 1;case"ObjectKeyword":return 2;case"StringKeyword":case"NumberKeyword":case"BooleanKeyword":case"BigIntKeyword":case"SymbolKeyword":return 3}return 4})),anZ={string:"StringKeyword",number:"NumberKeyword",boolean:"BooleanKeyword",bigint:"BigIntKeyword"};lt=EJ("Union"),zwI=CZ(Symbol.for("effect/Schema/AST/toJSONMemoMap"),()=>new WeakMap);iE=EJ("Refinement"),Yt={};aVG=EJ("Transformation");SVG=new TVG;ewI=SnZ("TypeLiteralTransformation"),nnZ=GhI([UwI,uwI,BwI,OwI,MwI,xwI])});class eV{path;actual;issue;_tag="Pointer";constructor(I,G,Z){this.path=I,this.actual=G,this.issue=Z}}class YhI{actual;message;_tag="Unexpected";constructor(I,G){this.actual=I,this.message=G}}class tg{ast;message;_tag="Missing";actual=void 0;constructor(I,G){this.ast=I,this.message=G}}class N2{ast;actual;issues;output;_tag="Composite";constructor(I,G,Z,b){this.ast=I,this.actual=G,this.issues=Z,this.output=b}}class Xt{ast;actual;kind;issue;_tag="Refinement";constructor(I,G,Z,b){this.ast=I,this.actual=G,this.kind=Z,this.issue=b}}class Ft{ast;actual;kind;issue;_tag="Transformation";constructor(I,G,Z,b){this.ast=I,this.actual=G,this.kind=Z,this.issue=b}}class eQ{ast;actual;message;_tag="Type";constructor(I,G,Z){this.ast=I,this.actual=G,this.message=Z}}class NhI{ast;actual;message;_tag="Forbidden";constructor(I,G,Z){this.ast=I,this.actual=G,this.message=Z}}function Lm(I){return I.sort(IfZ).map((G)=>G[1])}function YfZ(I){return PwI(I).pipe(wF(()=>TwI(I)),wF(()=>SwI(I)),wF(()=>Y8(I)),zb(()=>`{ ${I.from} | filter }`))}function NfZ(I){if(I.message!==void 0)return I.message;return`Expected ${iE(I.ast)?YfZ(I.ast):String(I.ast)}, actual ${jQ(I.actual)}`}var oVG,tVG,eVG=(I)=>new tVG({issue:I}),IU,chI,aF,CJ,TF,Qt,IcG,Rt=(I,G)=>{if(G===void 0||vX(G))return I;if(I===void 0)return G;return{...I,...G}},inZ=(I,G,Z)=>{let b=Ac(I,G);return(W,l)=>b(W,Rt(Z,l))},onZ=(I,G,Z)=>{let b=inZ(I,G,Z);return(W,l)=>Dz(b(W,l),eVG)},snZ=(I,G,Z)=>{let b=Ac(I,G);return(W,l)=>b(W,{...Rt(Z,l),isEffectAllowed:!0})},GcG=(I,G)=>snZ(I.ast,!1,G),Ht=(I,G)=>onZ(A2(I.ast),!0,G),ZcG=(I,G)=>{let Z=Ac(A2(I.ast),!0);return(b,W)=>U0(Z(b,{exact:!0,...Rt(G,W)}))},rnZ,tnZ,Ac=(I,G)=>{let Z=G?rnZ:tnZ,b=Z.get(I);if(b)return b;let W=enZ(I,G),l=EVG(I),Y=VZ(l)?(X,F)=>W(X,Rt(F,l.value)):W,N=CVG(I),c=G&&VZ(N)?(X,F)=>F8(IcG(Y(X,F),N.value),I,X,F):Y;return Z.set(I,c),c},WhI=(I)=>XN(hVG(I)),lhI=(I)=>XN(JVG(I)),enZ=(I,G)=>{switch(I._tag){case"Refinement":if(G){let Z=Ac(I.from,!0);return(b,W)=>{W=W??Yt;let l=W?.errors==="all",Y=CJ(IcG(Z(b,W),(N)=>{let c=new Xt(I,b,"From",N);if(l&&$wI(I)&&NcG(N))return fG(I.filter(b,W,I),{onNone:()=>wG(c),onSome:(X)=>wG(new N2(I,b,[c,new Xt(I,b,"Predicate",X)]))});return wG(c)}),(N)=>fG(I.filter(N,W,I),{onNone:()=>dG(N),onSome:(c)=>wG(new Xt(I,b,"Predicate",c))}));return F8(Y,I,b,W)}}else{let Z=Ac(A2(I),!0),b=Ac(WcG(I.from),!1);return(W,l)=>F8(CJ(Z(W,l),(Y)=>b(Y,l)),I,W,l)}case"Transformation":{let Z=GfZ(I.transformation,G),b=G?Ac(I.from,!0):Ac(I.to,!1),W=G?Ac(I.to,!0):Ac(I.from,!1);return(l,Y)=>F8(CJ(Qt(b(l,Y),(N)=>new Ft(I,l,G?"Encoded":"Type",N)),(N)=>CJ(Qt(Z(N,Y??Yt,I,l),(c)=>new Ft(I,l,"Transformation",c)),(c)=>Qt(W(c,Y),(X)=>new Ft(I,l,G?"Type":"Encoded",X)))),I,l,Y)}case"Declaration":{let Z=G?I.decodeUnknown(...I.typeParameters):I.encodeUnknown(...I.typeParameters);return(b,W)=>F8(Z(b,W??Yt,I),I,b,W)}case"Literal":return tQ(I,(Z)=>Z===I.literal);case"UniqueSymbol":return tQ(I,(Z)=>Z===I.symbol);case"UndefinedKeyword":return tQ(I,P7I);case"NeverKeyword":return tQ(I,_7I);case"UnknownKeyword":case"AnyKeyword":case"VoidKeyword":return dG;case"StringKeyword":return tQ(I,FV);case"NumberKeyword":return tQ(I,vX);case"BooleanKeyword":return tQ(I,MQ);case"BigIntKeyword":return tQ(I,Rv);case"SymbolKeyword":return tQ(I,wC);case"ObjectKeyword":return tQ(I,Hc);case"Enums":return tQ(I,(Z)=>I.enums.some(([b,W])=>W===Z));case"TemplateLiteral":{let Z=$VG(I);return tQ(I,(b)=>FV(b)&&Z.test(b))}case"TupleType":{let Z=I.elements.map((X)=>Ac(X.type,G)),b=I.rest.map((X)=>Ac(X.type,G)),W=I.elements.filter((X)=>!X.isOptional);if(I.rest.length>0)W=W.concat(I.rest.slice(1));let l=W.length,Y=I.elements.length>0?I.elements.map((X,F)=>F).join(" | "):"never",N=WhI(I),c=lhI(I);return(X,F)=>{if(!w0I(X))return wG(new eQ(I,X));let Q=F?.errors==="all",R=[],H=0,m=[],d=X.length;for(let E=d;E<=l-1;E++){let v=new eV(E,X,new tg(W[E-d]));if(Q){R.push([H++,v]);continue}else return wG(new N2(I,X,v,m))}if(I.rest.length===0)for(let E=I.elements.length;E<=d-1;E++){let v=new eV(E,X,new YhI(X[E],`is unexpected, expected: ${Y}`));if(Q){R.push([H++,v]);continue}else return wG(new N2(I,X,v,m))}let w=0,y=void 0;for(;w<Z.length;w++)if(d<w+1){if(I.elements[w].isOptional)continue}else{let E=Z[w],v=E(X[w],F);if(aF(v)){if(UW(v)){let J=new eV(w,X,v.left);if(Q){R.push([H++,J]);continue}else return wG(new N2(I,X,J,Lm(m)))}m.push([H++,v.right])}else{let J=H++,C=w;if(!y)y=[];y.push(({es:L,output:z})=>SI(AE(v),(p)=>{if(UW(p)){let U=new eV(C,X,p.left);if(Q)return L.push([J,U]),DZ;else return wG(new N2(I,X,U,Lm(z)))}return z.push([J,p.right]),DZ}))}}if(fl(b)){let[E,...v]=b;for(;w<d-v.length;w++){let J=E(X[w],F);if(aF(J))if(UW(J)){let C=new eV(w,X,J.left);if(Q){R.push([H++,C]);continue}else return wG(new N2(I,X,C,Lm(m)))}else m.push([H++,J.right]);else{let C=H++,L=w;if(!y)y=[];y.push(({es:z,output:p})=>SI(AE(J),(U)=>{if(UW(U)){let B=new eV(L,X,U.left);if(Q)return z.push([C,B]),DZ;else return wG(new N2(I,X,B,Lm(p)))}else return p.push([C,U.right]),DZ}))}}for(let J=0;J<v.length;J++){let C=w+J;if(d<C+1)continue;else{let L=v[J](X[C],F);if(aF(L)){if(UW(L)){let z=new eV(C,X,L.left);if(Q){R.push([H++,z]);continue}else return wG(new N2(I,X,z,Lm(m)))}m.push([H++,L.right])}else{let z=H++;if(!y)y=[];y.push(({es:p,output:U})=>SI(AE(L),(B)=>{if(UW(B)){let M=new eV(C,X,B.left);if(Q)return p.push([z,M]),DZ;else return wG(new N2(I,X,M,Lm(U)))}return U.push([z,B.right]),DZ}))}}}}let A=({es:E,output:v})=>od(E)?wG(new N2(I,X,Lm(E),Lm(v))):dG(Lm(v));if(y&&y.length>0){let E=y;return $b(()=>{let v={es:az(R),output:az(m)};return SI(CV(E,(J)=>J(v),{concurrency:N,batching:c,discard:!0}),()=>A(v))})}return A({output:m,es:R})}}case"TypeLiteral":{if(I.propertySignatures.length===0&&I.indexSignatures.length===0)return tQ(I,$7I);let Z=[],b={},W=[];for(let F of I.propertySignatures)Z.push([Ac(F.type,G),F]),b[F.name]=null,W.push(F.name);let l=I.indexSignatures.map((F)=>[Ac(F.parameter,G),Ac(F.type,G),F.parameter]),Y=s0.make(I.indexSignatures.map((F)=>F.parameter).concat(W.map((F)=>wC(F)?new rr(F):new ig(F)))),N=Ac(Y,G),c=WhI(I),X=lhI(I);return(F,Q)=>{if(!TcI(F))return wG(new eQ(I,F));let R=Q?.errors==="all",H=[],m=0,d=Q?.onExcessProperty==="error",w=Q?.onExcessProperty==="preserve",y={},A;if(d||w){A=Reflect.ownKeys(F);for(let C of A){let L=N(C,Q);if(aF(L)&&UW(L))if(d){let z=new eV(C,F,new YhI(F[C],`is unexpected, expected: ${String(Y)}`));if(R){H.push([m++,z]);continue}else return wG(new N2(I,F,z,y))}else y[C]=F[C]}}let E=void 0,v=Q?.exact===!0;for(let C=0;C<Z.length;C++){let L=Z[C][1],z=L.name,p=Object.prototype.hasOwnProperty.call(F,z);if(!p){if(L.isOptional)continue;else if(v){let M=new eV(z,F,new tg(L));if(R){H.push([m++,M]);continue}else return wG(new N2(I,F,M,y))}}let U=Z[C][0],B=U(F[z],Q);if(aF(B)){if(UW(B)){let M=new eV(z,F,p?B.left:new tg(L));if(R){H.push([m++,M]);continue}else return wG(new N2(I,F,M,y))}y[z]=B.right}else{let M=m++,x=z;if(!E)E=[];E.push(({es:j,output:a})=>SI(AE(B),(q)=>{if(UW(q)){let D=new eV(x,F,p?q.left:new tg(L));if(R)return j.push([M,D]),DZ;else return wG(new N2(I,F,D,a))}return a[x]=q.right,DZ}))}}for(let C=0;C<l.length;C++){let L=l[C],z=L[0],p=L[1],U=EwI(F,L[2]);for(let B of U){let M=z(B,Q);if(aF(M)&&U0(M)){let x=p(F[B],Q);if(aF(x)){if(UW(x)){let j=new eV(B,F,x.left);if(R){H.push([m++,j]);continue}else return wG(new N2(I,F,j,y))}else if(!Object.prototype.hasOwnProperty.call(b,B))y[B]=x.right}else{let j=m++,a=B;if(!E)E=[];E.push(({es:q,output:D})=>SI(AE(x),(_)=>{if(UW(_)){let NI=new eV(a,F,_.left);if(R)return q.push([j,NI]),DZ;else return wG(new N2(I,F,NI,D))}else{if(!Object.prototype.hasOwnProperty.call(b,B))D[B]=_.right;return DZ}}))}}}}let J=({es:C,output:L})=>{if(od(C))return wG(new N2(I,F,Lm(C),L));if(Q?.propertyOrder==="original"){let z=A||Reflect.ownKeys(F);for(let U of W)if(z.indexOf(U)===-1)z.push(U);let p={};for(let U of z)if(Object.prototype.hasOwnProperty.call(L,U))p[U]=L[U];return dG(p)}return dG(L)};if(E&&E.length>0){let C=E;return $b(()=>{let L={es:az(H),output:Object.assign({},y)};return SI(CV(C,(z)=>z(L),{concurrency:c,batching:X,discard:!0}),()=>J(L))})}return J({es:H,output:y})}}case"Union":{let Z=bcG(I.types,G),b=Reflect.ownKeys(Z.keys),W=b.length,l=I.types.length,Y=new Map;for(let X=0;X<l;X++)Y.set(I.types[X],Ac(I.types[X],G));let N=WhI(I)??1,c=lhI(I);return(X,F)=>{let Q=[],R=0,H=[];if(W>0)if(nx(X))for(let w=0;w<W;w++){let y=b[w],A=Z.keys[y].buckets;if(Object.prototype.hasOwnProperty.call(X,y)){let E=String(X[y]);if(Object.prototype.hasOwnProperty.call(A,E))H=H.concat(A[E]);else{let{candidates:v,literals:J}=Z.keys[y],C=s0.make(J),L=v.length===l?new ym([new yV(y,C,!1,!0)],[]):s0.make(v);Q.push([R++,new N2(L,X,new eV(y,X,new eQ(C,X[y])))])}}else{let{candidates:E,literals:v}=Z.keys[y],J=new yV(y,s0.make(v),!1,!0),C=E.length===l?new ym([J],[]):s0.make(E);Q.push([R++,new N2(C,X,new eV(y,X,new tg(J)))])}}else{let w=Z.candidates.length===l?I:s0.make(Z.candidates);Q.push([R++,new eQ(w,X)])}if(Z.otherwise.length>0)H=H.concat(Z.otherwise);let m=void 0;for(let w=0;w<H.length;w++){let y=H[w],A=Y.get(y)(X,F);if(aF(A)&&(!m||m.length===0))if(U0(A))return A;else Q.push([R++,A.left]);else{let E=R++;if(!m)m=[];m.push((v)=>$b(()=>{if("finalResult"in v)return DZ;else return SI(AE(A),(J)=>{if(U0(J))v.finalResult=J;else v.es.push([E,J.left]);return DZ})}))}}let d=(w)=>od(w)?w.length===1&&w[0][1]._tag==="Type"?wG(w[0][1]):wG(new N2(I,X,Lm(w))):wG(new eQ(I,X));if(m&&m.length>0){let w=m;return $b(()=>{let y={es:az(Q)};return SI(CV(w,(A)=>A(y),{concurrency:N,batching:c,discard:!0}),()=>{if("finalResult"in y)return y.finalResult;return d(y.es)})})}return d(Q)}}case"Suspend":{let Z=Z8(()=>Ac(I.f(),G));return(b,W)=>Z()(b,W)}}},tQ=(I,G)=>(Z)=>G(Z)?dG(Z):wG(new eQ(I,Z)),X8=(I,G)=>{switch(I._tag){case"Declaration":{let Z=_wI(I);if(VZ(Z))return X8(Z.value,G);break}case"TypeLiteral":{let Z=[];for(let b=0;b<I.propertySignatures.length;b++){let W=I.propertySignatures[b],l=G?c8(W.type):A2(W.type);if(ty(l)&&!W.isOptional)Z.push([W.name,l])}return Z}case"TupleType":{let Z=[];for(let b=0;b<I.elements.length;b++){let W=I.elements[b],l=G?c8(W.type):A2(W.type);if(ty(l)&&!W.isOptional)Z.push([b,l])}return Z}case"Refinement":return X8(I.from,G);case"Suspend":return X8(I.f(),G);case"Transformation":return X8(G?I.from:I.to,G)}return[]},bcG=(I,G)=>{let Z={},b=[],W=[];for(let l=0;l<I.length;l++){let Y=I[l],N=X8(Y,G);if(N.length>0){W.push(Y);for(let c=0;c<N.length;c++){let[X,F]=N[c],Q=String(F.literal);Z[X]=Z[X]||{buckets:{},literals:[],candidates:[]};let R=Z[X].buckets;if(Object.prototype.hasOwnProperty.call(R,Q)){if(c<N.length-1)continue;R[Q].push(Y),Z[X].literals.push(F),Z[X].candidates.push(Y)}else{R[Q]=[Y],Z[X].literals.push(F),Z[X].candidates.push(Y);break}}}else b.push(Y)}return{keys:Z,otherwise:b,candidates:W}},WcG=(I)=>iE(I)?WcG(I.from):I,F8=(I,G,Z,b)=>{if(b?.isEffectAllowed===!0)return I;if(aF(I))return I;let W=new E6,l=xj(I,{scheduler:W});W.flush();let Y=l.unsafePoll();if(Y){if(c1(Y))return dG(Y.value);let N=Y.cause;if(hFI(N))return wG(N.error);return wG(new NhI(G,Z,CFI(N)))}return wG(new NhI(G,Z,"cannot be be resolved synchronously, this is caused by using runSync on an effect that performs async work"))},IfZ=([I],[G])=>I>G?1:I<G?-1:0,GfZ=(I,G)=>{switch(I._tag){case"FinalTransformation":return G?I.decode:I.encode;case"ComposeTransformation":return dG;case"TypeLiteralTransformation":return(Z)=>{let b=dG(Z);for(let W of I.propertySignatureTransformations){let[l,Y]=G?[W.from,W.to]:[W.to,W.from],N=G?W.decode:W.encode;b=TF(b,(X)=>{let F=N(Object.prototype.hasOwnProperty.call(X,l)?XI(X[l]):mI());if(delete X[l],VZ(F))X[Y]=F.value;return X})}return b}}},DX=(I,G=[])=>({value:I,forest:G}),Q8,ZfZ=(I)=>I.value+lcG(`
|
|
@@ -7624,4 +7624,4 @@ ${N.join(`
|
|
|
7624
7624
|
`);else process.stderr.write(`${Y}
|
|
7625
7625
|
`);process.exitCode=1;return}process.env.JAZZ_NO_TUI="1",w2($9Z(Z.agent,G,{json:W,...Z.approvalPolicy!==void 0&&C7I(Z.approvalPolicy)?{approvalPolicy:Z.approvalPolicy}:{},...Z.reasoning!==void 0&&y7I(Z.reasoning)?{reasoningEffort:Z.reasoning}:{},...Z.timeout!==void 0?{timeoutMs:Z.timeout}:{},...Z.maxIterations!==void 0?{maxIterations:Z.maxIterations}:{},...l?.ok?{eventTypes:l.types}:{},...Z.conversation!==void 0?{conversationId:Z.conversation}:{},...Z.noStream===!0?{stream:!1}:Z.stream===!0?{stream:!0}:{}}),{verbose:b.verbose,debug:b.debug,configPath:b.config},{skipCatchUp:!0,skipUpdateCheck:!0})})}function cpW(I){let G=I.command("agent").description("Manage agents");G.command("list").alias("ls").description("List all agents").action(()=>{let Z=I.opts();w2(vcI(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("create").description("Create a new agent (interactive mode)").action(()=>{let Z=I.opts();w2(kcI(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("show <agentId>").description("Get an agent details").action((Z)=>{let b=I.opts();w2(V9Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("edit <agentId>").description("Edit an existing agent").action((Z)=>{let b=I.opts();w2(UcI(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("delete <agentId>").alias("remove").alias("rm").description("Delete an agent").option("-y, --yes","Delete without asking for confirmation").option("-f, --force","Alias for --yes").action((Z,b)=>{let W=I.opts();w2(EcI(Z,{skipConfirmation:b.yes===!0||b.force===!0}),{verbose:W.verbose,debug:W.debug,configPath:W.config})}),G.command("chat <agentIdentifier>").description("Start a chat with an AI agent by ID or name").option("--stream","Force streaming mode (real-time output)").option("--no-stream","Disable streaming mode").option("--max-iterations <n>","Maximum agent reasoning iterations per turn (default 80)",qx("--max-iterations")).action((Z,b)=>{let W=I.opts(),l=b.noStream===!0?!1:b.stream===!0?!0:void 0;w2(c9Z(Z,{...l!==void 0?{stream:l}:{},...b.maxIterations!==void 0?{maxIterations:b.maxIterations}:{}}),{verbose:W.verbose,debug:W.debug,configPath:W.config})})}function XpW(I){let G=I.command("config").description("Manage configuration");G.command("get <key>").description("Get a configuration value").action((Z)=>{let b=I.opts();w2(d9Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("set <key> [value]").description("Set a configuration value").action((Z,b)=>{let W=I.opts();w2(w9Z(Z,b),{verbose:W.verbose,debug:W.debug,configPath:W.config})}),G.command("show").description("Show all configuration values").action(()=>{let Z=I.opts();w2(m9Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})})}function FpW(I){let G=I.command("mcp").description("Manage MCP servers"),Z=(b)=>{let W=I.opts();w2(b,{verbose:W.verbose,debug:W.debug,configPath:W.config})};G.command("add [json]").description("Add an MCP server from JSON (inline, --file, or interactive)").option("-f, --file <path>","Read MCP server JSON from a file").action((b,W)=>{Z(U9Z(b,W?.file))}),G.command("list").alias("ls").description("List all configured MCP servers").action(()=>Z(u9Z())),G.command("remove").alias("rm").description("Remove an MCP server").action(()=>Z(B9Z())),G.command("enable").description("Enable a disabled MCP server").action(()=>Z(O9Z())),G.command("disable").description("Disable an enabled MCP server").action(()=>Z(M9Z()))}function QpW(I){let G=I.command("persona").description("Manage personas"),Z=(b)=>{let W=I.opts();w2(b,{verbose:W.verbose,debug:W.debug,configPath:W.config})};G.command("create").description("Create a new custom persona (interactive)").action(()=>Z(K9Z())),G.command("list").alias("ls").description("List all personas (built-in + custom)").action(()=>Z(j9Z())),G.command("show <identifier>").description("Show details of a persona by name or ID").action((b)=>Z(D9Z(b))),G.command("edit <identifier>").description("Edit an existing custom persona").action((b)=>Z(q9Z(b))),G.command("delete <identifier>").alias("rm").description("Delete a custom persona").action((b)=>Z(a9Z(b)))}function RpW(I){I.command("update").alias("upgrade").description("Update Jazz to the latest version").option("--check","Check for updates without installing").action((G)=>{let Z=I.opts();w2(m0G(G),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})})}function HpW(I){let G=I.command("workflow").description("Manage and run workflows");G.command("list").alias("ls").description("List all available workflows").action(()=>{let Z=I.opts();w2(F3Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("show <name>").description("Show details of a workflow").action((Z)=>{let b=I.opts();w2(Q3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("run <name>").description("Run a workflow once").option("--auto-approve","Auto-approve tool executions based on workflow policy").option("--agent <agentId>","Agent ID or name to use for this workflow run").option("--max-iterations <n>","Maximum agent reasoning iterations (overrides the workflow's own setting)",qx("--max-iterations")).option("--scheduled","Indicates this run was triggered by the system scheduler (launchd/cron)").option("--json","Emit a single JSON envelope { ok, answer, costUSD, tokenUsage, toolCalls } on stdout (for scripts/gateways); all chatter is suppressed").option("--timeout <ms>","Abort the run after this many milliseconds",qx("--timeout")).option("--events <categories>","With --json: emit selected event categories as NDJSON to stderr during the run (comma-separated: tools,reasoning,text,usage,approval,subagent,all). stdout stays the clean payload.").action((Z,b,W)=>{let l=I.opts(),Y=b.json===!0,N=W.name()==="run"&&W.parent?.name()==="workflow";if(b.events!==void 0&&!Y){process.stderr.write(`--events requires --json.
|
|
7626
7626
|
`),process.exitCode=1;return}let c=b.events!==void 0?A7I(b.events):void 0;if(c!==void 0&&!c.ok){process.stdout.write(`${JSON.stringify({ok:!1,error:c.error,costUSD:0})}
|
|
7627
|
-
`),process.exitCode=1;return}if(Y)process.env.JAZZ_NO_TUI="1";w2(R3Z(Z,{...b,...b.timeout!==void 0?{timeoutMs:b.timeout}:{},...c?.ok?{eventTypes:c.types}:{}}),{verbose:l.verbose,debug:l.debug,configPath:l.config},{skipCatchUp:N,skipUpdateCheck:Y})}),G.command("schedule <name>").description("Enable scheduled execution for a workflow").action((Z)=>{let b=I.opts();w2(H3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("unschedule <name>").description("Disable scheduled execution for a workflow").action((Z)=>{let b=I.opts();w2(m3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("scheduled").description("List all scheduled workflows").action(()=>{let Z=I.opts();w2(w3Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("catchup").description("List workflows that missed a scheduled run, select which to run, then run them").action(()=>{let Z=I.opts();w2(d3Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("history [name]").description("Show workflow run history").action((Z)=>{let b=I.opts();w2(h3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})})}function E3Z(){return h.sync(()=>{let I=new ng;if(I.name("jazz").description("Create and manage autonomous AI agents that execute real-world tasks (email, git, web, shell, and more)").version(o0.version),I.option("-v, --verbose","Enable verbose logging").option("--debug","Enable debug level logging").option("--config <path>","Path to configuration file").option("--no-tui","Disable TUI; use plain terminal output (for CI, scripts, small terminals)").option("--output <mode>","Output mode: rendered, hybrid (default), raw (no formatting), or quiet (suppress output)"),I.hook("preAction",(G)=>{let Z=G.optsWithGlobals();if(Z.tui===!1)process.env.JAZZ_NO_TUI="1";if(Z.output)process.env.JAZZ_OUTPUT_MODE=Z.output}),VpW(I),cpW(I),QpW(I),XpW(I),FpW(I),RpW(I),HpW(I),process.argv.length<=2)I.action(()=>{let G=I.opts();w2(N3Z(),{verbose:G.verbose,debug:G.debug,configPath:G.config})});return I})}var C3Z=u(()=>{_2G();MI();G8();eEZ();X7I();X9Z();h9Z();H7I();d7I();x9Z();T9Z();L7I();shI();V3Z();v3Z()});var L3Z={};Xl(L3Z,{requestKey:()=>y3Z,isBypassHost:()=>A3Z,installWebCassette:()=>JpW});import{existsSync as mpW,readFileSync as dpW,writeFileSync as wpW}from"node:fs";function y3Z(I,G){let Z=typeof I==="string"?I:I instanceof URL?I.href:I.url,b=(G?.method??"GET").toUpperCase(),W="";if(typeof G?.body==="string")W=G.body;else if(G?.body instanceof URLSearchParams)W=G.body.toString();return`${b} ${Z} ${W}`}function A3Z(I){let G=typeof I==="string"?I:I instanceof URL?I.href:I.url,Z;try{Z=new URL(G).hostname}catch{return!1}return hpW.some((b)=>Z.includes(b))}function JpW(I,G){let Z=globalThis.fetch.bind(globalThis),b=mpW(I)?JSON.parse(dpW(I,"utf-8")):{};globalThis.fetch=async(W,l)=>{if(A3Z(W))return Z(W,l);let Y=y3Z(W,l);if(G==="replay"){let F=b[Y];if(!F)throw Error(`web-cassette replay miss: ${Y}`);return new Response(F.body,{status:F.status,headers:F.headers})}let N=await Z(W,l),c=await N.clone().text(),X={};return N.headers.forEach((F,Q)=>X[Q]=F),b[Y]={status:N.status,body:c,headers:X},wpW(I,JSON.stringify(b,null,2)),N}}var hpW;var p3Z=u(()=>{hpW=["openai.com","openrouter.ai","anthropic.com","googleapis.com","mistral.ai","groq.com","x.ai","together.xyz","together.ai","cohere.com","fireworks.ai","deepseek.com","moonshot","minimax","cerebras","dashscope","models.dev","localhost","127.0.0.1"]});var EpW={};function vpW(){return h.gen(function*(){if(process.env.JAZZ_WEB_CASSETTE){let{installWebCassette:G}=yield*h.promise(()=>Promise.resolve().then(() => (p3Z(),L3Z)));G(process.env.JAZZ_WEB_CASSETTE,process.env.JAZZ_WEB_MODE==="record"?"record":"replay")}(yield*E3Z()).parse()})}var z3Z=u(()=>{MI();C3Z();h.runPromise(vpW()).catch((I)=>{throw console.error("Fatal error:",I),I})});process.noDeprecation=!0;Promise.resolve().then(() => (z3Z(),EpW)).catch((I)=>{throw console.error("Fatal error:",I),I});
|
|
7627
|
+
`),process.exitCode=1;return}if(Y)process.env.JAZZ_NO_TUI="1";w2(R3Z(Z,{...b,...b.timeout!==void 0?{timeoutMs:b.timeout}:{},...c?.ok?{eventTypes:c.types}:{}}),{verbose:l.verbose,debug:l.debug,configPath:l.config},{skipCatchUp:N,skipUpdateCheck:Y})}),G.command("schedule <name>").description("Enable scheduled execution for a workflow").action((Z)=>{let b=I.opts();w2(H3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("unschedule <name>").description("Disable scheduled execution for a workflow").action((Z)=>{let b=I.opts();w2(m3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})}),G.command("scheduled").description("List all scheduled workflows").action(()=>{let Z=I.opts();w2(w3Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("catchup").description("List workflows that missed a scheduled run, select which to run, then run them").action(()=>{let Z=I.opts();w2(d3Z(),{verbose:Z.verbose,debug:Z.debug,configPath:Z.config})}),G.command("history [name]").description("Show workflow run history").action((Z)=>{let b=I.opts();w2(h3Z(Z),{verbose:b.verbose,debug:b.debug,configPath:b.config})})}function E3Z(){return h.sync(()=>{let I=new ng;if(I.name("jazz").description("Create and manage autonomous AI agents that execute real-world tasks (email, git, web, shell, and more)").version(o0.version),I.option("-v, --verbose","Enable verbose logging").option("--debug","Enable debug level logging").option("--config <path>","Path to configuration file").option("--no-tui","Disable TUI; use plain terminal output (for CI, scripts, small terminals)").option("--output <mode>","Output mode: rendered, hybrid (default), raw (no formatting), or quiet (suppress output)"),I.hook("preAction",(G)=>{let Z=G.optsWithGlobals();if(Z.tui===!1)process.env.JAZZ_NO_TUI="1";if(Z.output)process.env.JAZZ_OUTPUT_MODE=Z.output}),VpW(I),cpW(I),QpW(I),XpW(I),FpW(I),RpW(I),HpW(I),process.argv.length<=2)I.action(()=>{let G=I.opts();w2(N3Z(),{verbose:G.verbose,debug:G.debug,configPath:G.config})});return I})}var C3Z=u(()=>{_2G();MI();G8();eEZ();X7I();X9Z();h9Z();H7I();d7I();x9Z();T9Z();L7I();shI();V3Z();v3Z()});var L3Z={};Xl(L3Z,{requestKey:()=>y3Z,isBypassHost:()=>A3Z,installWebCassette:()=>JpW});import{existsSync as mpW,readFileSync as dpW,writeFileSync as wpW}from"node:fs";function y3Z(I,G){let Z=typeof I==="string"?I:I instanceof URL?I.href:I.url,b=(G?.method??"GET").toUpperCase(),W="";if(typeof G?.body==="string")W=G.body;else if(G?.body instanceof URLSearchParams)W=G.body.toString();return`${b} ${Z} ${W}`}function A3Z(I){let G=typeof I==="string"?I:I instanceof URL?I.href:I.url,Z;try{Z=new URL(G).hostname}catch{return!1}return hpW.some((b)=>Z.includes(b))}function JpW(I,G){let Z=globalThis.fetch.bind(globalThis),b=mpW(I)?JSON.parse(dpW(I,"utf-8")):{};globalThis.fetch=async(W,l)=>{if(A3Z(W))return Z(W,l);let Y=y3Z(W,l);if(G==="replay"){let F=b[Y];if(!F)throw Error(`web-cassette replay miss: ${Y}`);return new Response(F.body,{status:F.status,headers:F.headers})}let N=await Z(W,l),c=await N.clone().text(),X={};return N.headers.forEach((F,Q)=>X[Q]=F),b[Y]={status:N.status,body:c,headers:X},wpW(I,JSON.stringify(b,null,2)),N}}var hpW;var p3Z=u(()=>{hpW=["openai.com","openrouter.ai","anthropic.com","googleapis.com","mistral.ai","groq.com","x.ai","together.xyz","together.ai","cohere.com","fireworks.ai","deepseek.com","moonshot","minimax","cerebras","dashscope","models.dev","localhost","127.0.0.1"]});var EpW={};function vpW(){return h.gen(function*(){if(process.env.JAZZ_WEB_CASSETTE){let{installWebCassette:G}=yield*h.promise(()=>Promise.resolve().then(() => (p3Z(),L3Z)));G(process.env.JAZZ_WEB_CASSETTE,process.env.JAZZ_WEB_MODE==="record"?"record":"replay")}(yield*E3Z()).parse()})}var z3Z=u(()=>{MI();C3Z();globalThis.AI_SDK_LOG_WARNINGS=(I)=>{console.error("AI SDK warning:",JSON.stringify(I.warnings),I.provider,I.model)};h.runPromise(vpW()).catch((I)=>{throw console.error("Fatal error:",I),I})});process.noDeprecation=!0;Promise.resolve().then(() => (z3Z(),EpW)).catch((I)=>{throw console.error("Fatal error:",I),I});
|