@activepieces/piece-cody 0.1.4 → 0.1.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/package.json CHANGED
@@ -1,27 +1,12 @@
1
1
  {
2
2
  "name": "@activepieces/piece-cody",
3
- "version": "0.1.4",
3
+ "version": "0.1.6",
4
4
  "type": "commonjs",
5
5
  "main": "./src/index.js",
6
- "types": "./src/index.d.ts",
7
- "dependencies": {
8
- "@sinclair/typebox": "0.34.11",
9
- "ai": "^6.0.0",
10
- "axios": "1.13.5",
11
- "axios-retry": "4.4.1",
12
- "deepmerge-ts": "7.1.0",
13
- "form-data": "4.0.4",
14
- "mime-types": "2.1.35",
15
- "nanoid": "3.3.8",
16
- "semver": "7.6.0",
17
- "socket.io-client": "4.8.1",
18
- "tslib": "^2.3.0",
19
- "zod": "4.1.13",
20
- "@activepieces/pieces-common": "0.11.6",
21
- "@activepieces/pieces-framework": "0.25.4",
22
- "@activepieces/shared": "0.37.0"
23
- },
24
- "resolutions": {
25
- "rollup": "npm:@rollup/wasm-node"
26
- }
6
+ "dependencies": {},
7
+ "files": [
8
+ "src/index.js",
9
+ "package.json",
10
+ "src/i18n"
11
+ ]
27
12
  }
package/src/index.js CHANGED
@@ -1,72 +1,13 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.cody = exports.codyAuth = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const create_document_from_text_1 = require("./lib/actions/create-document-from-text");
7
- const upload_file_1 = require("./lib/actions/upload-file");
8
- const send_message_1 = require("./lib/actions/send-message");
9
- const create_conversation_1 = require("./lib/actions/create-conversation");
10
- const find_bot_1 = require("./lib/actions/find-bot");
11
- const find_conversation_1 = require("./lib/actions/find-conversation");
12
- const pieces_common_1 = require("@activepieces/pieces-common");
13
- const client_1 = require("./lib/common/client");
14
- const shared_1 = require("@activepieces/shared");
15
- // Define the authentication property using PieceAuth.SecretText
16
- // This will create a secure text input field in the UI for the user's API key.
17
- exports.codyAuth = pieces_framework_1.PieceAuth.SecretText({
18
- displayName: 'API Key',
19
- description: `Visit your Cody AI API Keys page to retrieve the API key.`,
20
- required: true,
21
- validate: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
22
- if (auth) {
23
- try {
24
- yield client_1.codyClient.listBots({
25
- secret_text: auth,
26
- type: shared_1.AppConnectionType.SECRET_TEXT,
27
- });
28
- return {
29
- valid: true,
30
- };
31
- }
32
- catch (error) {
33
- return {
34
- valid: false,
35
- error: 'Invalid Api Key'
36
- };
37
- }
38
- }
39
- return {
40
- valid: false,
41
- error: 'Invalid Api Key'
42
- };
43
- }),
44
- });
45
- exports.cody = (0, pieces_framework_1.createPiece)({
46
- displayName: "Cody",
47
- auth: exports.codyAuth,
48
- minimumSupportedRelease: '0.36.1',
49
- logoUrl: "https://cdn.activepieces.com/pieces/cody.png",
50
- authors: ['Pranith124', 'sanket-a11y'],
51
- actions: [
52
- create_document_from_text_1.createDocumentFromText,
53
- upload_file_1.uploadFileAction,
54
- send_message_1.sendMessageAction,
55
- create_conversation_1.createConversationAction,
56
- find_bot_1.findBotAction,
57
- find_conversation_1.findConversationAction,
58
- (0, pieces_common_1.createCustomApiCallAction)({
59
- auth: exports.codyAuth,
60
- baseUrl: () => 'https://getcody.ai/api/v1',
61
- authMapping: (auth) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
62
- return ({
63
- Authorization: `Bearer ${auth}`,
64
- });
65
- }),
66
- }),
67
- ],
68
- triggers: [
69
- // Your triggers will go here
70
- ],
71
- });
72
- //# sourceMappingURL=index.js.map
1
+ "use strict";var Bs=Object.create;var Ke=Object.defineProperty;var Zs=Object.getOwnPropertyDescriptor;var Vs=Object.getOwnPropertyNames;var Hs=Object.getPrototypeOf,Ws=Object.prototype.hasOwnProperty;var o=(e,t)=>Ke(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),gn=(e,t)=>{for(var r in t)Ke(e,r,{get:t[r],enumerable:!0})},yn=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Vs(t))!Ws.call(e,i)&&i!==r&&Ke(e,i,{get:()=>t[i],enumerable:!(n=Zs(t,i))||n.enumerable});return e};var ze=(e,t,r)=>(r=e!=null?Bs(Hs(e)):{},yn(t||!e||!e.__esModule?Ke(r,"default",{value:e,enumerable:!0}):r,e)),qs=e=>yn(Ke({},"__esModule",{value:!0}),e);var No=T((Ro,jt)=>{(function(e){"use strict";let t="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${t}\\.${t}\\.${t}\\.${t}$`,"i"),threeOctet:new RegExp(`^${t}\\.${t}\\.${t}$`,"i"),twoOctet:new RegExp(`^${t}\\.${t}$`,"i"),longValue:new RegExp(`^${t}$`,"i")},n=new RegExp("^0[0-7]+$","i"),i=new RegExp("^0x[a-f0-9]+$","i"),u="%[0-9a-z]{1,}",p="(?:[0-9a-f]+::?)+",d={zoneIndex:new RegExp(u,"i"),native:new RegExp(`^(::)?(${p})?([0-9a-f]+)?(::)?(${u})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${t}\\.${t}\\.${t}\\.${t}(${u})?)$`,"i"),transitional:new RegExp(`^((?:${p})|(?:::)(?:${p})?)${t}\\.${t}\\.${t}\\.${t}(${u})?$`,"i")};function y(s,l){if(s.indexOf("::")!==s.lastIndexOf("::"))return null;let f=0,m=-1,v=(s.match(d.zoneIndex)||[])[0],P,j;for(v&&(v=v.substring(1),s=s.replace(/%.+$/,""));(m=s.indexOf(":",m+1))>=0;)f++;if(s.substr(0,2)==="::"&&f--,s.substr(-2,2)==="::"&&f--,f>l)return null;for(j=l-f,P=":";j--;)P+="0:";return s=s.replace("::",P),s[0]===":"&&(s=s.slice(1)),s[s.length-1]===":"&&(s=s.slice(0,-1)),l=function(){let re=s.split(":"),se=[];for(let Ge=0;Ge<re.length;Ge++)se.push(parseInt(re[Ge],16));return se}(),{parts:l,zoneId:v}}o(y,"expandIPv6");function h(s,l,f,m){if(s.length!==l.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let v=0,P;for(;m>0;){if(P=f-m,P<0&&(P=0),s[v]>>P!==l[v]>>P)return!1;m-=f,v+=1}return!0}o(h,"matchCIDR");function _(s){if(i.test(s))return parseInt(s,16);if(s[0]==="0"&&!isNaN(parseInt(s[1],10))){if(n.test(s))return parseInt(s,8);throw new Error(`ipaddr: cannot parse ${s} as octal`)}return parseInt(s,10)}o(_,"parseIntAuto");function E(s,l){for(;s.length<l;)s=`0${s}`;return s}o(E,"padPart");let x={};x.IPv4=function(){function s(l){if(l.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let f,m;for(f=0;f<l.length;f++)if(m=l[f],!(0<=m&&m<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=l}return o(s,"IPv4"),s.prototype.SpecialRanges={unspecified:[[new s([0,0,0,0]),8]],broadcast:[[new s([255,255,255,255]),32]],multicast:[[new s([224,0,0,0]),4]],linkLocal:[[new s([169,254,0,0]),16]],loopback:[[new s([127,0,0,0]),8]],carrierGradeNat:[[new s([100,64,0,0]),10]],private:[[new s([10,0,0,0]),8],[new s([172,16,0,0]),12],[new s([192,168,0,0]),16]],reserved:[[new s([192,0,0,0]),24],[new s([192,0,2,0]),24],[new s([192,88,99,0]),24],[new s([198,18,0,0]),15],[new s([198,51,100,0]),24],[new s([203,0,113,0]),24],[new s([240,0,0,0]),4]],as112:[[new s([192,175,48,0]),24],[new s([192,31,196,0]),24]],amt:[[new s([192,52,193,0]),24]]},s.prototype.kind=function(){return"ipv4"},s.prototype.match=function(l,f){let m;if(f===void 0&&(m=l,l=m[0],f=m[1]),l.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return h(this.octets,l.octets,8,f)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,f=!1,m={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0},v,P,j;for(v=3;v>=0;v-=1)if(P=this.octets[v],P in m){if(j=m[P],f&&j!==0)return null;j!==8&&(f=!0),l+=j}else return null;return 32-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){return this.octets.slice(0)},s.prototype.toIPv4MappedAddress=function(){return x.IPv6.parse(`::ffff:${this.toString()}`)},s.prototype.toNormalizedString=function(){return this.toString()},s.prototype.toString=function(){return this.octets.join(".")},s}(),x.IPv4.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),f=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<4;)v.push(parseInt(f[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.isIPv4=function(s){return this.parser(s)!==null},x.IPv4.isValid=function(s){try{return new this(this.parser(s)),!0}catch{return!1}},x.IPv4.isValidCIDR=function(s){try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv4.isValidFourPartDecimal=function(s){return!!(x.IPv4.isValid(s)&&s.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},x.IPv4.isValidCIDRFourPartDecimal=function(s){let l=s.match(/^(.+)\/(\d+)$/);return!x.IPv4.isValidCIDR(s)||!l?!1:x.IPv4.isValidFourPartDecimal(l[1])},x.IPv4.networkAddressFromCIDR=function(s){let l,f,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],f=0;f<4;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},x.IPv4.parse=function(s){let l=this.parser(s);if(l===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(l)},x.IPv4.parseCIDR=function(s){let l;if(l=s.match(/^(.+)\/(\d+)$/)){let f=parseInt(l[2]);if(f>=0&&f<=32){let m=[this.parse(l[1]),f];return Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},x.IPv4.parser=function(s){let l,f,m;if(l=s.match(r.fourOctet))return function(){let v=l.slice(1,6),P=[];for(let j=0;j<v.length;j++)f=v[j],P.push(_(f));return P}();if(l=s.match(r.longValue)){if(m=_(l[1]),m>4294967295||m<0)throw new Error("ipaddr: address outside defined range");return function(){let v=[],P;for(P=0;P<=24;P+=8)v.push(m>>P&255);return v}().reverse()}else return(l=s.match(r.twoOctet))?function(){let v=l.slice(1,4),P=[];if(m=_(v[1]),m>16777215||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(m>>16&255),P.push(m>>8&255),P.push(m&255),P}():(l=s.match(r.threeOctet))?function(){let v=l.slice(1,5),P=[];if(m=_(v[2]),m>65535||m<0)throw new Error("ipaddr: address outside defined range");return P.push(_(v[0])),P.push(_(v[1])),P.push(m>>8&255),P.push(m&255),P}():null},x.IPv4.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>32)throw new Error("ipaddr: invalid IPv4 prefix length");let l=[0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)l[f]=255,f++;return m<4&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.IPv6=function(){function s(l,f){let m,v;if(l.length===16)for(this.parts=[],m=0;m<=14;m+=2)this.parts.push(l[m]<<8|l[m+1]);else if(l.length===8)this.parts=l;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(m=0;m<this.parts.length;m++)if(v=this.parts[m],!(0<=v&&v<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");f&&(this.zoneId=f)}return o(s,"IPv6"),s.prototype.SpecialRanges={unspecified:[new s([0,0,0,0,0,0,0,0]),128],linkLocal:[new s([65152,0,0,0,0,0,0,0]),10],multicast:[new s([65280,0,0,0,0,0,0,0]),8],loopback:[new s([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new s([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new s([0,0,0,0,0,65535,0,0]),96],discard:[new s([256,0,0,0,0,0,0,0]),64],rfc6145:[new s([0,0,0,0,65535,0,0,0]),96],rfc6052:[new s([100,65435,0,0,0,0,0,0]),96],"6to4":[new s([8194,0,0,0,0,0,0,0]),16],teredo:[new s([8193,0,0,0,0,0,0,0]),32],benchmarking:[new s([8193,2,0,0,0,0,0,0]),48],amt:[new s([8193,3,0,0,0,0,0,0]),32],as112v6:[[new s([8193,4,274,0,0,0,0,0]),48],[new s([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new s([8193,16,0,0,0,0,0,0]),28],orchid2:[new s([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new s([8193,48,0,0,0,0,0,0]),28],reserved:[[new s([8193,0,0,0,0,0,0,0]),23],[new s([8193,3512,0,0,0,0,0,0]),32]]},s.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},s.prototype.kind=function(){return"ipv6"},s.prototype.match=function(l,f){let m;if(f===void 0&&(m=l,l=m[0],f=m[1]),l.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return h(this.parts,l.parts,16,f)},s.prototype.prefixLengthFromSubnetMask=function(){let l=0,f=!1,m={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0},v,P;for(let j=7;j>=0;j-=1)if(v=this.parts[j],v in m){if(P=m[v],f&&P!==0)return null;P!==16&&(f=!0),l+=P}else return null;return 128-l},s.prototype.range=function(){return x.subnetMatch(this,this.SpecialRanges)},s.prototype.toByteArray=function(){let l,f=[],m=this.parts;for(let v=0;v<m.length;v++)l=m[v],f.push(l>>8),f.push(l&255);return f},s.prototype.toFixedLengthString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(E(this.parts[v].toString(16),4));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),l+f},s.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");let l=this.parts.slice(-2),f=l[0],m=l[1];return new x.IPv4([f>>8,f&255,m>>8,m&255])},s.prototype.toNormalizedString=function(){let l=function(){let m=[];for(let v=0;v<this.parts.length;v++)m.push(this.parts[v].toString(16));return m}.call(this).join(":"),f="";return this.zoneId&&(f=`%${this.zoneId}`),l+f},s.prototype.toRFC5952String=function(){let l=/((^|:)(0(:|$)){2,})/g,f=this.toNormalizedString(),m=0,v=-1,P;for(;P=l.exec(f);)P[0].length>v&&(m=P.index,v=P[0].length);return v<0?f:`${f.substring(0,m)}::${f.substring(m+v)}`},s.prototype.toString=function(){return this.toRFC5952String()},s}(),x.IPv6.broadcastAddressFromCIDR=function(s){try{let l=this.parseCIDR(s),f=l[0].toByteArray(),m=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],P=0;for(;P<16;)v.push(parseInt(f[P],10)|parseInt(m[P],10)^255),P++;return new this(v)}catch(l){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${l})`)}},x.IPv6.isIPv6=function(s){return this.parser(s)!==null},x.IPv6.isValid=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{let l=this.parser(s);return new this(l.parts,l.zoneId),!0}catch{return!1}},x.IPv6.isValidCIDR=function(s){if(typeof s=="string"&&s.indexOf(":")===-1)return!1;try{return this.parseCIDR(s),!0}catch{return!1}},x.IPv6.networkAddressFromCIDR=function(s){let l,f,m,v,P;try{for(l=this.parseCIDR(s),m=l[0].toByteArray(),P=this.subnetMaskFromPrefixLength(l[1]).toByteArray(),v=[],f=0;f<16;)v.push(parseInt(m[f],10)&parseInt(P[f],10)),f++;return new this(v)}catch(j){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${j})`)}},x.IPv6.parse=function(s){let l=this.parser(s);if(l.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(l.parts,l.zoneId)},x.IPv6.parseCIDR=function(s){let l,f,m;if((f=s.match(/^(.+)\/(\d+)$/))&&(l=parseInt(f[2]),l>=0&&l<=128))return m=[this.parse(f[1]),l],Object.defineProperty(m,"toString",{value:o(function(){return this.join("/")},"value")}),m;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},x.IPv6.parser=function(s){let l,f,m,v,P,j;if(m=s.match(d.deprecatedTransitional))return this.parser(`::ffff:${m[1]}`);if(d.native.test(s))return y(s,8);if((m=s.match(d.transitional))&&(j=m[6]||"",l=m[1],m[1].endsWith("::")||(l=l.slice(0,-1)),l=y(l+j,6),l.parts)){for(P=[parseInt(m[2]),parseInt(m[3]),parseInt(m[4]),parseInt(m[5])],f=0;f<P.length;f++)if(v=P[f],!(0<=v&&v<=255))return null;return l.parts.push(P[0]<<8|P[1]),l.parts.push(P[2]<<8|P[3]),{parts:l.parts,zoneId:l.zoneId}}return null},x.IPv6.subnetMaskFromPrefixLength=function(s){if(s=parseInt(s),s<0||s>128)throw new Error("ipaddr: invalid IPv6 prefix length");let l=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],f=0,m=Math.floor(s/8);for(;f<m;)l[f]=255,f++;return m<16&&(l[m]=Math.pow(2,s%8)-1<<8-s%8),new this(l)},x.fromByteArray=function(s){let l=s.length;if(l===4)return new x.IPv4(s);if(l===16)return new x.IPv6(s);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},x.isValid=function(s){return x.IPv6.isValid(s)||x.IPv4.isValid(s)},x.isValidCIDR=function(s){return x.IPv6.isValidCIDR(s)||x.IPv4.isValidCIDR(s)},x.parse=function(s){if(x.IPv6.isValid(s))return x.IPv6.parse(s);if(x.IPv4.isValid(s))return x.IPv4.parse(s);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},x.parseCIDR=function(s){try{return x.IPv6.parseCIDR(s)}catch{try{return x.IPv4.parseCIDR(s)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},x.process=function(s){let l=this.parse(s);return l.kind()==="ipv6"&&l.isIPv4MappedAddress()?l.toIPv4Address():l},x.subnetMatch=function(s,l,f){let m,v,P,j;f==null&&(f="unicast");for(v in l)if(Object.prototype.hasOwnProperty.call(l,v)){for(P=l[v],P[0]&&!(P[0]instanceof Array)&&(P=[P]),m=0;m<P.length;m++)if(j=P[m],s.kind()===j[0].kind()&&s.match.apply(s,j))return v}return f},typeof jt<"u"&&jt.exports?jt.exports=x:e.ipaddr=x})(Ro)});var zi=T((qS,Ai)=>{var Si=require("stream").Stream,bp=require("util");Ai.exports=ce;function ce(){this.source=null,this.dataSize=0,this.maxDataSize=1024*1024,this.pauseStream=!0,this._maxDataSizeExceeded=!1,this._released=!1,this._bufferedEvents=[]}o(ce,"DelayedStream");bp.inherits(ce,Si);ce.create=function(e,t){var r=new this;t=t||{};for(var n in t)r[n]=t[n];r.source=e;var i=e.emit;return e.emit=function(){return r._handleEmit(arguments),i.apply(e,arguments)},e.on("error",function(){}),r.pauseStream&&e.pause(),r};Object.defineProperty(ce.prototype,"readable",{configurable:!0,enumerable:!0,get:o(function(){return this.source.readable},"get")});ce.prototype.setEncoding=function(){return this.source.setEncoding.apply(this.source,arguments)};ce.prototype.resume=function(){this._released||this.release(),this.source.resume()};ce.prototype.pause=function(){this.source.pause()};ce.prototype.release=function(){this._released=!0,this._bufferedEvents.forEach(function(e){this.emit.apply(this,e)}.bind(this)),this._bufferedEvents=[]};ce.prototype.pipe=function(){var e=Si.prototype.pipe.apply(this,arguments);return this.resume(),e};ce.prototype._handleEmit=function(e){if(this._released){this.emit.apply(this,e);return}e[0]==="data"&&(this.dataSize+=e[1].length,this._checkIfMaxDataSizeExceeded()),this._bufferedEvents.push(e)};ce.prototype._checkIfMaxDataSizeExceeded=function(){if(!this._maxDataSizeExceeded&&!(this.dataSize<=this.maxDataSize)){this._maxDataSizeExceeded=!0;var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this.emit("error",new Error(e))}}});var Ri=T((KS,wi)=>{var Ip=require("util"),ki=require("stream").Stream,Oi=zi();wi.exports=q;function q(){this.writable=!1,this.readable=!0,this.dataSize=0,this.maxDataSize=2*1024*1024,this.pauseStreams=!0,this._released=!1,this._streams=[],this._currentStream=null,this._insideLoop=!1,this._pendingNext=!1}o(q,"CombinedStream");Ip.inherits(q,ki);q.create=function(e){var t=new this;e=e||{};for(var r in e)t[r]=e[r];return t};q.isStreamLike=function(e){return typeof e!="function"&&typeof e!="string"&&typeof e!="boolean"&&typeof e!="number"&&!Buffer.isBuffer(e)};q.prototype.append=function(e){var t=q.isStreamLike(e);if(t){if(!(e instanceof Oi)){var r=Oi.create(e,{maxDataSize:1/0,pauseStream:this.pauseStreams});e.on("data",this._checkDataSize.bind(this)),e=r}this._handleErrors(e),this.pauseStreams&&e.pause()}return this._streams.push(e),this};q.prototype.pipe=function(e,t){return ki.prototype.pipe.call(this,e,t),this.resume(),e};q.prototype._getNext=function(){if(this._currentStream=null,this._insideLoop){this._pendingNext=!0;return}this._insideLoop=!0;try{do this._pendingNext=!1,this._realGetNext();while(this._pendingNext)}finally{this._insideLoop=!1}};q.prototype._realGetNext=function(){var e=this._streams.shift();if(typeof e>"u"){this.end();return}if(typeof e!="function"){this._pipeNext(e);return}var t=e;t(function(r){var n=q.isStreamLike(r);n&&(r.on("data",this._checkDataSize.bind(this)),this._handleErrors(r)),this._pipeNext(r)}.bind(this))};q.prototype._pipeNext=function(e){this._currentStream=e;var t=q.isStreamLike(e);if(t){e.on("end",this._getNext.bind(this)),e.pipe(this,{end:!1});return}var r=e;this.write(r),this._getNext()};q.prototype._handleErrors=function(e){var t=this;e.on("error",function(r){t._emitError(r)})};q.prototype.write=function(e){this.emit("data",e)};q.prototype.pause=function(){this.pauseStreams&&(this.pauseStreams&&this._currentStream&&typeof this._currentStream.pause=="function"&&this._currentStream.pause(),this.emit("pause"))};q.prototype.resume=function(){this._released||(this._released=!0,this.writable=!0,this._getNext()),this.pauseStreams&&this._currentStream&&typeof this._currentStream.resume=="function"&&this._currentStream.resume(),this.emit("resume")};q.prototype.end=function(){this._reset(),this.emit("end")};q.prototype.destroy=function(){this._reset(),this.emit("close")};q.prototype._reset=function(){this.writable=!1,this._streams=[],this._currentStream=null};q.prototype._checkDataSize=function(){if(this._updateDataSize(),!(this.dataSize<=this.maxDataSize)){var e="DelayedStream#maxDataSize of "+this.maxDataSize+" bytes exceeded.";this._emitError(new Error(e))}};q.prototype._updateDataSize=function(){this.dataSize=0;var e=this;this._streams.forEach(function(t){t.dataSize&&(e.dataSize+=t.dataSize)}),this._currentStream&&this._currentStream.dataSize&&(this.dataSize+=this._currentStream.dataSize)};q.prototype._emitError=function(e){this._reset(),this.emit("error",e)}});var Di=T((XS,Ni)=>{"use strict";Ni.exports={"application/json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["json","map"]},"application/xml":{source:"iana",compressible:!0,extensions:["xml"]},"application/javascript":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["js","mjs"]},"application/pdf":{source:"iana",compressible:!1,extensions:["pdf"]},"application/zip":{source:"iana",compressible:!1,extensions:["zip"]},"application/gzip":{source:"iana",compressible:!1,extensions:["gz"]},"application/octet-stream":{source:"iana",compressible:!1,extensions:["bin","dat"]},"application/msword":{source:"iana",extensions:["doc"]},"application/vnd.openxmlformats-officedocument.wordprocessingml.document":{source:"iana",extensions:["docx"]},"application/vnd.ms-excel":{source:"iana",extensions:["xls"]},"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":{source:"iana",extensions:["xlsx"]},"application/vnd.ms-powerpoint":{source:"iana",extensions:["ppt"]},"application/vnd.openxmlformats-officedocument.presentationml.presentation":{source:"iana",extensions:["pptx"]},"application/csv":{compressible:!0,extensions:["csv"]},"application/rtf":{source:"iana",compressible:!0,extensions:["rtf"]},"application/x-tar":{source:"apache",compressible:!0,extensions:["tar"]},"application/x-7z-compressed":{source:"apache",compressible:!1,extensions:["7z"]},"application/wasm":{source:"iana",compressible:!0,extensions:["wasm"]},"text/plain":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["txt","text","log"]},"text/html":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["html","htm"]},"text/css":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["css"]},"text/csv":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["csv"]},"text/markdown":{source:"iana",compressible:!0,charset:"UTF-8",extensions:["md","markdown"]},"text/xml":{source:"iana",compressible:!0,extensions:["xml"]},"text/yaml":{compressible:!0,extensions:["yaml","yml"]},"image/png":{source:"iana",compressible:!1,extensions:["png"]},"image/jpeg":{source:"iana",compressible:!1,extensions:["jpeg","jpg","jpe"]},"image/gif":{source:"iana",compressible:!1,extensions:["gif"]},"image/webp":{source:"apache",compressible:!1,extensions:["webp"]},"image/svg+xml":{source:"iana",compressible:!0,extensions:["svg","svgz"]},"image/bmp":{source:"iana",compressible:!0,extensions:["bmp"]},"image/tiff":{source:"iana",compressible:!1,extensions:["tiff","tif"]},"image/x-icon":{source:"apache",compressible:!0,extensions:["ico"]},"image/heic":{source:"iana",compressible:!1,extensions:["heic"]},"image/avif":{source:"iana",compressible:!1,extensions:["avif"]},"audio/mpeg":{source:"iana",compressible:!1,extensions:["mp3","mpga"]},"audio/wav":{compressible:!1,extensions:["wav"]},"audio/ogg":{source:"iana",compressible:!1,extensions:["ogg","oga"]},"audio/webm":{source:"apache",compressible:!1,extensions:["weba"]},"audio/mp4":{source:"iana",compressible:!1,extensions:["m4a"]},"video/mp4":{source:"iana",compressible:!1,extensions:["mp4","m4v"]},"video/mpeg":{source:"iana",compressible:!1,extensions:["mpeg","mpg"]},"video/webm":{source:"iana",compressible:!1,extensions:["webm"]},"video/quicktime":{source:"iana",compressible:!1,extensions:["mov","qt"]},"video/x-msvideo":{source:"iana",compressible:!1,extensions:["avi"]},"font/woff":{source:"iana",compressible:!1,extensions:["woff"]},"font/woff2":{source:"iana",compressible:!1,extensions:["woff2"]},"font/ttf":{source:"iana",compressible:!0,extensions:["ttf"]},"font/otf":{source:"iana",compressible:!0,extensions:["otf"]},"application/ld+json":{source:"iana",compressible:!0,extensions:["jsonld"]},"application/x-www-form-urlencoded":{source:"iana",compressible:!0},"multipart/form-data":{source:"iana"},"application/vnd.api+json":{source:"iana",compressible:!0},"application/manifest+json":{source:"iana",charset:"UTF-8",compressible:!0,extensions:["webmanifest"]},"application/ics":{compressible:!0,extensions:["ics"]},"text/calendar":{source:"iana",compressible:!0,extensions:["ics","ifb"]},"application/x-ndjson":{compressible:!0,extensions:["ndjson"]}}});var Vr=T(te=>{"use strict";var Wt=Di(),Tp=require("path").extname,Ci=/^\s*([^;\s]*)(?:;|\s|$)/,Ep=/^text\//i;te.charset=Ui;te.charsets={lookup:Ui};te.contentType=$p;te.extension=Sp;te.extensions=Object.create(null);te.lookup=Ap;te.types=Object.create(null);zp(te.extensions,te.types);function Ui(e){if(!e||typeof e!="string")return!1;var t=Ci.exec(e),r=t&&Wt[t[1].toLowerCase()];return r&&r.charset?r.charset:t&&Ep.test(t[1])?"UTF-8":!1}o(Ui,"charset");function $p(e){if(!e||typeof e!="string")return!1;var t=e.indexOf("/")===-1?te.lookup(e):e;if(!t)return!1;if(t.indexOf("charset")===-1){var r=te.charset(t);r&&(t+="; charset="+r.toLowerCase())}return t}o($p,"contentType");function Sp(e){if(!e||typeof e!="string")return!1;var t=Ci.exec(e),r=t&&te.extensions[t[1].toLowerCase()];return!r||!r.length?!1:r[0]}o(Sp,"extension");function Ap(e){if(!e||typeof e!="string")return!1;var t=Tp("x."+e).toLowerCase().substr(1);return t&&te.types[t]||!1}o(Ap,"lookup");function zp(e,t){var r=["nginx","apache",void 0,"iana"];Object.keys(Wt).forEach(o(function(i){var u=Wt[i],p=u.extensions;if(!(!p||!p.length)){e[i]=p;for(var d=0;d<p.length;d++){var y=p[d];if(t[y]){var h=r.indexOf(Wt[t[y]].source),_=r.indexOf(u.source);if(t[y]!=="application/octet-stream"&&(h>_||h===_&&t[y].substr(0,12)==="application/"))continue}t[y]=i}}},"forEachMimeType"))}o(zp,"populateMaps")});var ji=T((eA,Mi)=>{Mi.exports=Op;function Op(e){var t=typeof setImmediate=="function"?setImmediate:typeof process=="object"&&typeof process.nextTick=="function"?process.nextTick:null;t?t(e):setTimeout(e,0)}o(Op,"defer")});var Hr=T((rA,Fi)=>{var Li=ji();Fi.exports=kp;function kp(e){var t=!1;return Li(function(){t=!0}),o(function(n,i){t?e(n,i):Li(o(function(){e(n,i)},"nextTick_callback"))},"async_callback")}o(kp,"async")});var Wr=T((oA,Bi)=>{Bi.exports=wp;function wp(e){Object.keys(e.jobs).forEach(Rp.bind(e)),e.jobs={}}o(wp,"abort");function Rp(e){typeof this.jobs[e]=="function"&&this.jobs[e]()}o(Rp,"clean")});var qr=T((aA,Vi)=>{var Zi=Hr(),Np=Wr();Vi.exports=Dp;function Dp(e,t,r,n){var i=r.keyedList?r.keyedList[r.index]:r.index;r.jobs[i]=Cp(t,i,e[i],function(u,p){i in r.jobs&&(delete r.jobs[i],u?Np(r):r.results[i]=p,n(u,r.results))})}o(Dp,"iterate");function Cp(e,t,r,n){var i;return e.length==2?i=e(r,Zi(n)):i=e(r,t,Zi(n)),i}o(Cp,"runJob")});var Gr=T((uA,Hi)=>{Hi.exports=Up;function Up(e,t){var r=!Array.isArray(e),n={index:0,keyedList:r||t?Object.keys(e):null,jobs:{},results:r?{}:[],size:r?Object.keys(e).length:e.length};return t&&n.keyedList.sort(r?t:function(i,u){return t(e[i],e[u])}),n}o(Up,"state")});var Kr=T((pA,Wi)=>{var Mp=Wr(),jp=Hr();Wi.exports=Lp;function Lp(e){Object.keys(this.jobs).length&&(this.index=this.size,Mp(this),jp(e)(null,this.results))}o(Lp,"terminator")});var Gi=T((dA,qi)=>{var Fp=qr(),Bp=Gr(),Zp=Kr();qi.exports=Vp;function Vp(e,t,r){for(var n=Bp(e);n.index<(n.keyedList||e).length;)Fp(e,t,n,function(i,u){if(i){r(i,u);return}if(Object.keys(n.jobs).length===0){r(null,n.results);return}}),n.index++;return Zp.bind(n,r)}o(Vp,"parallel")});var Jr=T((fA,qt)=>{var Ki=qr(),Hp=Gr(),Wp=Kr();qt.exports=qp;qt.exports.ascending=Ji;qt.exports.descending=Gp;function qp(e,t,r,n){var i=Hp(e,r);return Ki(e,t,i,o(function u(p,d){if(p){n(p,d);return}if(i.index++,i.index<(i.keyedList||e).length){Ki(e,t,i,u);return}n(null,i.results)},"iteratorHandler")),Wp.bind(i,n)}o(qp,"serialOrdered");function Ji(e,t){return e<t?-1:e>t?1:0}o(Ji,"ascending");function Gp(e,t){return-1*Ji(e,t)}o(Gp,"descending")});var Yi=T((yA,Xi)=>{var Kp=Jr();Xi.exports=Jp;function Jp(e,t,r){return Kp(e,t,null,r)}o(Jp,"serial")});var ea=T((vA,Qi)=>{Qi.exports={parallel:Gi(),serial:Yi(),serialOrdered:Jr()}});var Xr=T((xA,ta)=>{"use strict";ta.exports=Object});var na=T((_A,ra)=>{"use strict";ra.exports=Error});var ia=T((PA,oa)=>{"use strict";oa.exports=EvalError});var sa=T((bA,aa)=>{"use strict";aa.exports=RangeError});var ca=T((IA,ua)=>{"use strict";ua.exports=ReferenceError});var la=T((TA,pa)=>{"use strict";pa.exports=SyntaxError});var Gt=T((EA,da)=>{"use strict";da.exports=TypeError});var fa=T(($A,ma)=>{"use strict";ma.exports=URIError});var ya=T((SA,ga)=>{"use strict";ga.exports=Math.abs});var va=T((AA,ha)=>{"use strict";ha.exports=Math.floor});var _a=T((zA,xa)=>{"use strict";xa.exports=Math.max});var ba=T((OA,Pa)=>{"use strict";Pa.exports=Math.min});var Ta=T((kA,Ia)=>{"use strict";Ia.exports=Math.pow});var $a=T((wA,Ea)=>{"use strict";Ea.exports=Math.round});var Aa=T((RA,Sa)=>{"use strict";Sa.exports=Number.isNaN||o(function(t){return t!==t},"isNaN")});var Oa=T((DA,za)=>{"use strict";var Xp=Aa();za.exports=o(function(t){return Xp(t)||t===0?t:t<0?-1:1},"sign")});var wa=T((UA,ka)=>{"use strict";ka.exports=Object.getOwnPropertyDescriptor});var Yr=T((MA,Ra)=>{"use strict";var Kt=wa();if(Kt)try{Kt([],"length")}catch{Kt=null}Ra.exports=Kt});var Da=T((jA,Na)=>{"use strict";var Jt=Object.defineProperty||!1;if(Jt)try{Jt({},"a",{value:1})}catch{Jt=!1}Na.exports=Jt});var Qr=T((LA,Ca)=>{"use strict";Ca.exports=o(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;t[r]=i;for(var u in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var p=Object.getOwnPropertySymbols(t);if(p.length!==1||p[0]!==r||!Object.prototype.propertyIsEnumerable.call(t,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var d=Object.getOwnPropertyDescriptor(t,r);if(d.value!==i||d.enumerable!==!0)return!1}return!0},"hasSymbols")});var ja=T((BA,Ma)=>{"use strict";var Ua=typeof Symbol<"u"&&Symbol,Yp=Qr();Ma.exports=o(function(){return typeof Ua!="function"||typeof Symbol!="function"||typeof Ua("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:Yp()},"hasNativeSymbols")});var en=T((VA,La)=>{"use strict";La.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var tn=T((HA,Fa)=>{"use strict";var Qp=Xr();Fa.exports=Qp.getPrototypeOf||null});var Va=T((WA,Za)=>{"use strict";var el="Function.prototype.bind called on incompatible ",tl=Object.prototype.toString,rl=Math.max,nl="[object Function]",Ba=o(function(t,r){for(var n=[],i=0;i<t.length;i+=1)n[i]=t[i];for(var u=0;u<r.length;u+=1)n[u+t.length]=r[u];return n},"concatty"),ol=o(function(t,r){for(var n=[],i=r||0,u=0;i<t.length;i+=1,u+=1)n[u]=t[i];return n},"slicy"),il=o(function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r},"joiny");Za.exports=o(function(t){var r=this;if(typeof r!="function"||tl.apply(r)!==nl)throw new TypeError(el+r);for(var n=ol(arguments,1),i,u=o(function(){if(this instanceof i){var _=r.apply(this,Ba(n,arguments));return Object(_)===_?_:this}return r.apply(t,Ba(n,arguments))},"binder"),p=rl(0,r.length-n.length),d=[],y=0;y<p;y++)d[y]="$"+y;if(i=Function("binder","return function ("+il(d,",")+"){ return binder.apply(this,arguments); }")(u),r.prototype){var h=o(function(){},"Empty");h.prototype=r.prototype,i.prototype=new h,h.prototype=null}return i},"bind")});var Ze=T((GA,Ha)=>{"use strict";var al=Va();Ha.exports=Function.prototype.bind||al});var Xt=T((KA,Wa)=>{"use strict";Wa.exports=Function.prototype.call});var rn=T((JA,qa)=>{"use strict";qa.exports=Function.prototype.apply});var Ka=T((XA,Ga)=>{"use strict";Ga.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Xa=T((YA,Ja)=>{"use strict";var sl=Ze(),ul=rn(),cl=Xt(),pl=Ka();Ja.exports=pl||sl.call(cl,ul)});var Qa=T((QA,Ya)=>{"use strict";var ll=Ze(),dl=Gt(),ml=Xt(),fl=Xa();Ya.exports=o(function(t){if(t.length<1||typeof t[0]!="function")throw new dl("a function is required");return fl(ll,ml,t)},"callBindBasic")});var is=T((tz,os)=>{"use strict";var gl=Qa(),es=Yr(),rs;try{rs=[].__proto__===Array.prototype}catch(e){if(!e||typeof e!="object"||!("code"in e)||e.code!=="ERR_PROTO_ACCESS")throw e}var nn=!!rs&&es&&es(Object.prototype,"__proto__"),ns=Object,ts=ns.getPrototypeOf;os.exports=nn&&typeof nn.get=="function"?gl([nn.get]):typeof ts=="function"?o(function(t){return ts(t==null?t:ns(t))},"getDunder"):!1});var ps=T((nz,cs)=>{"use strict";var as=en(),ss=tn(),us=is();cs.exports=as?o(function(t){return as(t)},"getProto"):ss?o(function(t){if(!t||typeof t!="object"&&typeof t!="function")throw new TypeError("getProto: not an object");return ss(t)},"getProto"):us?o(function(t){return us(t)},"getProto"):null});var on=T((iz,ls)=>{"use strict";var yl=Function.prototype.call,hl=Object.prototype.hasOwnProperty,vl=Ze();ls.exports=vl.call(yl,hl)});var vs=T((az,hs)=>{"use strict";var M,xl=Xr(),_l=na(),Pl=ia(),bl=sa(),Il=ca(),qe=la(),We=Gt(),Tl=fa(),El=ya(),$l=va(),Sl=_a(),Al=ba(),zl=Ta(),Ol=$a(),kl=Oa(),gs=Function,an=o(function(e){try{return gs('"use strict"; return ('+e+").constructor;")()}catch{}},"getEvalledConstructor"),ht=Yr(),wl=Da(),sn=o(function(){throw new We},"throwTypeError"),Rl=ht?function(){try{return arguments.callee,sn}catch{try{return ht(arguments,"callee").get}catch{return sn}}}():sn,Ve=ja()(),Y=ps(),Nl=tn(),Dl=en(),ys=rn(),vt=Xt(),He={},Cl=typeof Uint8Array>"u"||!Y?M:Y(Uint8Array),Ne={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?M:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?M:ArrayBuffer,"%ArrayIteratorPrototype%":Ve&&Y?Y([][Symbol.iterator]()):M,"%AsyncFromSyncIteratorPrototype%":M,"%AsyncFunction%":He,"%AsyncGenerator%":He,"%AsyncGeneratorFunction%":He,"%AsyncIteratorPrototype%":He,"%Atomics%":typeof Atomics>"u"?M:Atomics,"%BigInt%":typeof BigInt>"u"?M:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?M:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?M:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?M:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":_l,"%eval%":eval,"%EvalError%":Pl,"%Float16Array%":typeof Float16Array>"u"?M:Float16Array,"%Float32Array%":typeof Float32Array>"u"?M:Float32Array,"%Float64Array%":typeof Float64Array>"u"?M:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?M:FinalizationRegistry,"%Function%":gs,"%GeneratorFunction%":He,"%Int8Array%":typeof Int8Array>"u"?M:Int8Array,"%Int16Array%":typeof Int16Array>"u"?M:Int16Array,"%Int32Array%":typeof Int32Array>"u"?M:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Ve&&Y?Y(Y([][Symbol.iterator]())):M,"%JSON%":typeof JSON=="object"?JSON:M,"%Map%":typeof Map>"u"?M:Map,"%MapIteratorPrototype%":typeof Map>"u"||!Ve||!Y?M:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":xl,"%Object.getOwnPropertyDescriptor%":ht,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?M:Promise,"%Proxy%":typeof Proxy>"u"?M:Proxy,"%RangeError%":bl,"%ReferenceError%":Il,"%Reflect%":typeof Reflect>"u"?M:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?M:Set,"%SetIteratorPrototype%":typeof Set>"u"||!Ve||!Y?M:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?M:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":Ve&&Y?Y(""[Symbol.iterator]()):M,"%Symbol%":Ve?Symbol:M,"%SyntaxError%":qe,"%ThrowTypeError%":Rl,"%TypedArray%":Cl,"%TypeError%":We,"%Uint8Array%":typeof Uint8Array>"u"?M:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?M:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?M:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?M:Uint32Array,"%URIError%":Tl,"%WeakMap%":typeof WeakMap>"u"?M:WeakMap,"%WeakRef%":typeof WeakRef>"u"?M:WeakRef,"%WeakSet%":typeof WeakSet>"u"?M:WeakSet,"%Function.prototype.call%":vt,"%Function.prototype.apply%":ys,"%Object.defineProperty%":wl,"%Object.getPrototypeOf%":Nl,"%Math.abs%":El,"%Math.floor%":$l,"%Math.max%":Sl,"%Math.min%":Al,"%Math.pow%":zl,"%Math.round%":Ol,"%Math.sign%":kl,"%Reflect.getPrototypeOf%":Dl};if(Y)try{null.error}catch(e){ds=Y(Y(e)),Ne["%Error.prototype%"]=ds}var ds,Ul=o(function e(t){var r;if(t==="%AsyncFunction%")r=an("async function () {}");else if(t==="%GeneratorFunction%")r=an("function* () {}");else if(t==="%AsyncGeneratorFunction%")r=an("async function* () {}");else if(t==="%AsyncGenerator%"){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(t==="%AsyncIteratorPrototype%"){var i=e("%AsyncGenerator%");i&&Y&&(r=Y(i.prototype))}return Ne[t]=r,r},"doEval"),ms={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},xt=Ze(),Yt=on(),Ml=xt.call(vt,Array.prototype.concat),jl=xt.call(ys,Array.prototype.splice),fs=xt.call(vt,String.prototype.replace),Qt=xt.call(vt,String.prototype.slice),Ll=xt.call(vt,RegExp.prototype.exec),Fl=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,Bl=/\\(\\)?/g,Zl=o(function(t){var r=Qt(t,0,1),n=Qt(t,-1);if(r==="%"&&n!=="%")throw new qe("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qe("invalid intrinsic syntax, expected opening `%`");var i=[];return fs(t,Fl,function(u,p,d,y){i[i.length]=d?fs(y,Bl,"$1"):p||u}),i},"stringToPath"),Vl=o(function(t,r){var n=t,i;if(Yt(ms,n)&&(i=ms[n],n="%"+i[0]+"%"),Yt(Ne,n)){var u=Ne[n];if(u===He&&(u=Ul(n)),typeof u>"u"&&!r)throw new We("intrinsic "+t+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:u}}throw new qe("intrinsic "+t+" does not exist!")},"getBaseIntrinsic");hs.exports=o(function(t,r){if(typeof t!="string"||t.length===0)throw new We("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new We('"allowMissing" argument must be a boolean');if(Ll(/^%?[^%]*%?$/,t)===null)throw new qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=Zl(t),i=n.length>0?n[0]:"",u=Vl("%"+i+"%",r),p=u.name,d=u.value,y=!1,h=u.alias;h&&(i=h[0],jl(n,Ml([0,1],h)));for(var _=1,E=!0;_<n.length;_+=1){var x=n[_],s=Qt(x,0,1),l=Qt(x,-1);if((s==='"'||s==="'"||s==="`"||l==='"'||l==="'"||l==="`")&&s!==l)throw new qe("property names with quotes must have matching quotes");if((x==="constructor"||!E)&&(y=!0),i+="."+x,p="%"+i+"%",Yt(Ne,p))d=Ne[p];else if(d!=null){if(!(x in d)){if(!r)throw new We("base intrinsic for "+t+" exists, but the property is not available.");return}if(ht&&_+1>=n.length){var f=ht(d,x);E=!!f,E&&"get"in f&&!("originalValue"in f.get)?d=f.get:d=d[x]}else E=Yt(d,x),d=d[x];E&&!y&&(Ne[p]=d)}}return d},"GetIntrinsic")});var _s=T((uz,xs)=>{"use strict";var Hl=Qr();xs.exports=o(function(){return Hl()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Is=T((pz,bs)=>{"use strict";var Wl=vs(),Ps=Wl("%Object.defineProperty%",!0),ql=_s()(),Gl=on(),Kl=Gt(),er=ql?Symbol.toStringTag:null;bs.exports=o(function(t,r){var n=arguments.length>2&&!!arguments[2]&&arguments[2].force,i=arguments.length>2&&!!arguments[2]&&arguments[2].nonConfigurable;if(typeof n<"u"&&typeof n!="boolean"||typeof i<"u"&&typeof i!="boolean")throw new Kl("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");er&&(n||!Gl(t,er))&&(Ps?Ps(t,er,{configurable:!i,enumerable:!1,value:r,writable:!1}):t[er]=r)},"setToStringTag")});var Es=T((dz,Ts)=>{"use strict";var Jl=Function.prototype.call,Xl=Object.prototype.hasOwnProperty,Yl=Ze();Ts.exports=Yl.call(Jl,Xl)});var Ss=T((mz,$s)=>{"use strict";$s.exports=function(e,t){return Object.keys(t).forEach(function(r){e[r]=e[r]||t[r]}),e}});var Os=T((fz,zs)=>{"use strict";var ln=Ri(),Ql=require("util"),un=require("path"),ed=require("http"),td=require("https"),rd=require("url").parse,nd=require("fs"),od=require("stream").Stream,id=require("crypto"),cn=Vr(),ad=ea(),sd=Is(),$e=Es(),pn=Ss();function As(e){return String(e).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22")}o(As,"escapeHeaderParam");function L(e){if(!(this instanceof L))return new L(e);this._overheadLength=0,this._valueLength=0,this._valuesToMeasure=[],ln.call(this),e=e||{};for(var t in e)this[t]=e[t]}o(L,"FormData");Ql.inherits(L,ln);L.LINE_BREAK=`\r
2
+ `;L.DEFAULT_CONTENT_TYPE="application/octet-stream";L.prototype.append=function(e,t,r){r=r||{},typeof r=="string"&&(r={filename:r});var n=ln.prototype.append.bind(this);if((typeof t=="number"||t==null)&&(t=String(t)),Array.isArray(t)){this._error(new Error("Arrays are not supported."));return}var i=this._multiPartHeader(e,t,r),u=this._multiPartFooter();n(i),n(t),n(u),this._trackLength(i,t,r)};L.prototype._trackLength=function(e,t,r){var n=0;r.knownLength!=null?n+=Number(r.knownLength):Buffer.isBuffer(t)?n=t.length:typeof t=="string"&&(n=Buffer.byteLength(t)),this._valueLength+=n,this._overheadLength+=Buffer.byteLength(e)+L.LINE_BREAK.length,!(!t||!t.path&&!(t.readable&&$e(t,"httpVersion"))&&!(t instanceof od))&&(r.knownLength||this._valuesToMeasure.push(t))};L.prototype._lengthRetriever=function(e,t){$e(e,"fd")?e.end!=null&&e.end!=1/0&&e.start!=null?t(null,e.end+1-(e.start?e.start:0)):nd.stat(e.path,function(r,n){if(r){t(r);return}var i=n.size-(e.start?e.start:0);t(null,i)}):$e(e,"httpVersion")?t(null,Number(e.headers["content-length"])):$e(e,"httpModule")?(e.on("response",function(r){e.pause(),t(null,Number(r.headers["content-length"]))}),e.resume()):t("Unknown stream")};L.prototype._multiPartHeader=function(e,t,r){if(typeof r.header=="string")return r.header;var n=this._getContentDisposition(t,r),i=this._getContentType(t,r),u="",p={"Content-Disposition":["form-data",'name="'+As(e)+'"'].concat(n||[]),"Content-Type":[].concat(i||[])};typeof r.header=="object"&&pn(p,r.header);var d;for(var y in p)if($e(p,y)){if(d=p[y],d==null)continue;Array.isArray(d)||(d=[d]),d.length&&(u+=y+": "+d.join("; ")+L.LINE_BREAK)}return"--"+this.getBoundary()+L.LINE_BREAK+u+L.LINE_BREAK};L.prototype._getContentDisposition=function(e,t){var r;if(typeof t.filepath=="string"?r=un.normalize(t.filepath).replace(/\\/g,"/"):t.filename||e&&(e.name||e.path)?r=un.basename(t.filename||e&&(e.name||e.path)):e&&e.readable&&$e(e,"httpVersion")&&(r=un.basename(e.client._httpMessage.path||"")),r)return'filename="'+As(r)+'"'};L.prototype._getContentType=function(e,t){var r=t.contentType;return!r&&e&&e.name&&(r=cn.lookup(e.name)),!r&&e&&e.path&&(r=cn.lookup(e.path)),!r&&e&&e.readable&&$e(e,"httpVersion")&&(r=e.headers["content-type"]),!r&&(t.filepath||t.filename)&&(r=cn.lookup(t.filepath||t.filename)),!r&&e&&typeof e=="object"&&(r=L.DEFAULT_CONTENT_TYPE),r};L.prototype._multiPartFooter=function(){return function(e){var t=L.LINE_BREAK,r=this._streams.length===0;r&&(t+=this._lastBoundary()),e(t)}.bind(this)};L.prototype._lastBoundary=function(){return"--"+this.getBoundary()+"--"+L.LINE_BREAK};L.prototype.getHeaders=function(e){var t,r={"content-type":"multipart/form-data; boundary="+this.getBoundary()};for(t in e)$e(e,t)&&(r[t.toLowerCase()]=e[t]);return r};L.prototype.setBoundary=function(e){if(typeof e!="string")throw new TypeError("FormData boundary must be a string");this._boundary=e};L.prototype.getBoundary=function(){return this._boundary||this._generateBoundary(),this._boundary};L.prototype.getBuffer=function(){for(var e=new Buffer.alloc(0),t=this.getBoundary(),r=0,n=this._streams.length;r<n;r++)typeof this._streams[r]!="function"&&(Buffer.isBuffer(this._streams[r])?e=Buffer.concat([e,this._streams[r]]):e=Buffer.concat([e,Buffer.from(this._streams[r])]),(typeof this._streams[r]!="string"||this._streams[r].substring(2,t.length+2)!==t)&&(e=Buffer.concat([e,Buffer.from(L.LINE_BREAK)])));return Buffer.concat([e,Buffer.from(this._lastBoundary())])};L.prototype._generateBoundary=function(){this._boundary="--------------------------"+id.randomBytes(12).toString("hex")};L.prototype.getLengthSync=function(){var e=this._overheadLength+this._valueLength;return this._streams.length&&(e+=this._lastBoundary().length),this.hasKnownLength()||this._error(new Error("Cannot calculate proper length in synchronous way.")),e};L.prototype.hasKnownLength=function(){var e=!0;return this._valuesToMeasure.length&&(e=!1),e};L.prototype.getLength=function(e){var t=this._overheadLength+this._valueLength;if(this._streams.length&&(t+=this._lastBoundary().length),!this._valuesToMeasure.length){process.nextTick(e.bind(this,null,t));return}ad.parallel(this._valuesToMeasure,this._lengthRetriever,function(r,n){if(r){e(r);return}n.forEach(function(i){t+=i}),e(null,t)})};L.prototype.submit=function(e,t){var r,n,i={method:"post"};return typeof e=="string"?(e=rd(e),n=pn({port:e.port,path:e.pathname,host:e.hostname,protocol:e.protocol},i)):(n=pn(e,i),n.port||(n.port=n.protocol==="https:"?443:80)),n.headers=this.getHeaders(e.headers),n.protocol==="https:"?r=td.request(n):r=ed.request(n),this.getLength(function(u,p){if(u&&u!=="Unknown stream"){this._error(u);return}if(p&&r.setHeader("Content-Length",p),this.pipe(r),t){var d,y=o(function(h,_){return r.removeListener("error",y),r.removeListener("response",d),t.call(this,h,_)},"callback");d=y.bind(this,null),r.on("error",y),r.on("response",d)}}.bind(this)),r};L.prototype._error=function(e){this.error||(this.error=e,this.pause(),this.emit("error",e))};L.prototype.toString=function(){return"[object FormData]"};sd(L.prototype,"FormData");zs.exports=L});var yd={};gn(yd,{cody:()=>gd,codyAuth:()=>X});module.exports=qs(yd);var Gs=Object.freeze({status:"aborted"});function b(e,t,r){function n(d,y){if(d._zod||Object.defineProperty(d,"_zod",{value:{def:y,constr:p,traits:new Set},enumerable:!1}),d._zod.traits.has(e))return;d._zod.traits.add(e),t(d,y);let h=p.prototype,_=Object.keys(h);for(let E=0;E<_.length;E++){let x=_[E];x in d||(d[x]=h[x].bind(d))}}o(n,"init");let i=r?.Parent??Object;class u extends i{static{o(this,"Definition")}}Object.defineProperty(u,"name",{value:e});function p(d){var y;let h=r?.Parent?new u:this;n(h,d),(y=h._zod).deferred??(y.deferred=[]);for(let _ of h._zod.deferred)_();return h}return o(p,"_"),Object.defineProperty(p,"init",{value:n}),Object.defineProperty(p,Symbol.hasInstance,{value:o(d=>r?.Parent&&d instanceof r.Parent?!0:d?._zod?.traits?.has(e),"value")}),Object.defineProperty(p,"name",{value:e}),p}o(b,"$constructor");var Ks=Symbol("zod_brand"),pe=class extends Error{static{o(this,"$ZodAsyncError")}constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},Pt=class extends Error{static{o(this,"$ZodEncodeError")}constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}},or={};function me(e){return e&&Object.assign(or,e),or}o(me,"config");function ar(e){let t=Object.values(e).filter(n=>typeof n=="number");return Object.entries(e).filter(([n,i])=>t.indexOf(+n)===-1).map(([n,i])=>i)}o(ar,"getEnumValues");function vn(e,t){return typeof t=="bigint"?t.toString():t}o(vn,"jsonStringifyReplacer");function It(e){return{get value(){{let r=e();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}o(It,"cached");function xn(e){return e==null}o(xn,"nullish");function Tt(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}o(Tt,"cleanRegex");var hn=Symbol("evaluating");function G(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==hn)return n===void 0&&(n=hn,n=r()),n},set(i){Object.defineProperty(e,t,{value:i})},configurable:!0})}o(G,"defineLazy");var sr="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function Je(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}o(Je,"isObject");var Js=It(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});function _n(e){if(Je(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let r=t.prototype;return!(Je(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}o(_n,"isPlainObject");var Pn=new Set(["string","number","symbol"]);function De(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}o(De,"escapeRegex");function Et(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}o(Et,"clone");function V(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:o(()=>t,"error")};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:o(()=>t.error,"error")}:t}o(V,"normalizeParams");function bn(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}o(bn,"optionalKeys");var Xs={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function Ce(e,t=0){if(e.aborted===!0)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}o(Ce,"aborted");function _e(e,t){return t.map(r=>{var n;return(n=r).path??(n.path=[]),r.path.unshift(e),r})}o(_e,"prefixIssues");function bt(e){return typeof e=="string"?e:e?.message}o(bt,"unwrapMessage");function Pe(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=bt(e.inst?._zod.def?.error?.(e))??bt(t?.error?.(e))??bt(r.customError?.(e))??bt(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}o(Pe,"finalizeIssue");function In(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}o(In,"getLengthableOrigin");function ur(...e){let[t,r,n]=e;return typeof t=="string"?{message:t,code:"custom",input:r,inst:n}:{...t}}o(ur,"issue");var Tn=o((e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,vn,2),Object.defineProperty(e,"toString",{value:o(()=>e.message,"value"),enumerable:!1})},"initializer"),En=b("$ZodError",Tn),Xe=b("$ZodError",Tn,{Parent:Error});var Qs=o(e=>(t,r,n,i)=>{let u=n?Object.assign(n,{async:!1}):{async:!1},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise)throw new pe;if(p.issues.length){let d=new(i?.Err??e)(p.issues.map(y=>Pe(y,u,me())));throw sr(d,i?.callee),d}return p.value},"_parse"),$t=Qs(Xe),eu=o(e=>async(t,r,n,i)=>{let u=n?Object.assign(n,{async:!0}):{async:!0},p=t._zod.run({value:r,issues:[]},u);if(p instanceof Promise&&(p=await p),p.issues.length){let d=new(i?.Err??e)(p.issues.map(y=>Pe(y,u,me())));throw sr(d,i?.callee),d}return p.value},"_parseAsync"),St=eu(Xe),tu=o(e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},u=t._zod.run({value:r,issues:[]},i);if(u instanceof Promise)throw new pe;return u.issues.length?{success:!1,error:new(e??En)(u.issues.map(p=>Pe(p,i,me())))}:{success:!0,data:u.value}},"_safeParse"),Ye=tu(Xe),ru=o(e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},u=t._zod.run({value:r,issues:[]},i);return u instanceof Promise&&(u=await u),u.issues.length?{success:!1,error:new e(u.issues.map(p=>Pe(p,i,me())))}:{success:!0,data:u.value}},"_safeParseAsync"),Qe=ru(Xe);var nu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",ou=new RegExp(`^${nu}$`);var $n=o(e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},"string"),Sn=/^-?\d+n?$/;var cr=/^-?\d+(?:\.\d+)?$/,An=/^(?:true|false)$/i;var Ue=b("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])});var zn=b("$ZodCheckMinLength",(e,t)=>{var r;Ue.init(e,t),(r=e._zod.def).when??(r.when=n=>{let i=n.value;return!xn(i)&&i.length!==void 0}),e._zod.onattach.push(n=>{let i=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>i&&(n._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let i=n.value;if(i.length>=t.minimum)return;let p=In(i);n.issues.push({origin:p,code:"too_small",minimum:t.minimum,inclusive:!0,input:i,inst:e,continue:!t.abort})}});var pr=b("$ZodCheckStringFormat",(e,t)=>{var r,n;Ue.init(e,t),e._zod.onattach.push(i=>{let u=i._zod.bag;u.format=t.format,t.pattern&&(u.patterns??(u.patterns=new Set),u.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=i=>{t.pattern.lastIndex=0,!t.pattern.test(i.value)&&i.issues.push({origin:"string",code:"invalid_format",format:t.format,input:i.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),On=b("$ZodCheckRegex",(e,t)=>{pr.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,!t.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}});var wn={major:4,minor:3,patch:6};var H=b("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wn;let n=[...e._zod.def.checks??[]];e._zod.traits.has("$ZodCheck")&&n.unshift(e);for(let i of n)for(let u of i._zod.onattach)u(e);if(n.length===0)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let i=o((p,d,y)=>{let h=Ce(p),_;for(let E of d){if(E._zod.def.when){if(!E._zod.def.when(p))continue}else if(h)continue;let x=p.issues.length,s=E._zod.check(p);if(s instanceof Promise&&y?.async===!1)throw new pe;if(_||s instanceof Promise)_=(_??Promise.resolve()).then(async()=>{await s,p.issues.length!==x&&(h||(h=Ce(p,x)))});else{if(p.issues.length===x)continue;h||(h=Ce(p,x))}}return _?_.then(()=>p):p},"runChecks"),u=o((p,d,y)=>{if(Ce(p))return p.aborted=!0,p;let h=i(d,n,y);if(h instanceof Promise){if(y.async===!1)throw new pe;return h.then(_=>e._zod.parse(_,y))}return e._zod.parse(h,y)},"handleCanaryResult");e._zod.run=(p,d)=>{if(d.skipChecks)return e._zod.parse(p,d);if(d.direction==="backward"){let h=e._zod.parse({value:p.value,issues:[]},{...d,skipChecks:!0});return h instanceof Promise?h.then(_=>u(_,p,d)):u(h,p,d)}let y=e._zod.parse(p,d);if(y instanceof Promise){if(d.async===!1)throw new pe;return y.then(h=>i(h,n,d))}return i(y,n,d)}}G(e,"~standard",()=>({validate:o(i=>{try{let u=Ye(e,i);return u.success?{value:u.data}:{issues:u.error?.issues}}catch{return Qe(e,i).then(p=>p.success?{value:p.data}:{issues:p.error?.issues})}},"validate"),vendor:"zod",version:1}))}),Ot=b("$ZodString",(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$n(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),lr=b("$ZodStringFormat",(e,t)=>{pr.init(e,t),Ot.init(e,t)});var Un=b("$ZodURL",(e,t)=>{lr.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}});var Mn=b("$ZodNumber",(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??cr,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch{}let i=r.value;if(typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i))return r;let u=typeof i=="number"?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...u?{received:u}:{}}),r}});var dr=b("$ZodBoolean",(e,t)=>{H.init(e,t),e._zod.pattern=An,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch{}let i=r.value;return typeof i=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),jn=b("$ZodBigInt",(e,t)=>{H.init(e,t),e._zod.pattern=Sn,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}});var Ln=b("$ZodAny",(e,t)=>{H.init(e,t),e._zod.parse=r=>r}),Fn=b("$ZodUnknown",(e,t)=>{H.init(e,t),e._zod.parse=r=>r});var Bn=b("$ZodVoid",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;return typeof i>"u"||r.issues.push({expected:"void",code:"invalid_type",input:i,inst:e}),r}}),Zn=b("$ZodDate",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch{}let i=r.value,u=i instanceof Date;return u&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...u?{received:"Invalid Date"}:{},inst:e}),r}});function Rn(e,t,r){e.issues.length&&t.issues.push(..._e(r,e.issues)),t.value[r]=e.value}o(Rn,"handleArrayResult");var Vn=b("$ZodArray",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let u=[];for(let p=0;p<i.length;p++){let d=i[p],y=t.element._zod.run({value:d,issues:[]},n);y instanceof Promise?u.push(y.then(h=>Rn(h,r,p))):Rn(y,r,p)}return u.length?Promise.all(u).then(()=>r):r}});function zt(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(..._e(r,e.issues))}e.value===void 0?r in n&&(t.value[r]=void 0):t.value[r]=e.value}o(zt,"handlePropertyResult");function iu(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has("$ZodType"))throw new Error(`Invalid element at key "${n}": expected a Zod schema`);let r=bn(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}o(iu,"normalizeDef");function au(e,t,r,n,i,u){let p=[],d=i.keySet,y=i.catchall._zod,h=y.def.type,_=y.optout==="optional";for(let E in t){if(d.has(E))continue;if(h==="never"){p.push(E);continue}let x=y.run({value:t[E],issues:[]},n);x instanceof Promise?e.push(x.then(s=>zt(s,r,E,t,_))):zt(x,r,E,t,_)}return p.length&&r.issues.push({code:"unrecognized_keys",keys:p,input:t,inst:u}),e.length?Promise.all(e).then(()=>r):r}o(au,"handleCatchall");var Hn=b("$ZodObject",(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,"shape")?.get){let d=t.shape;Object.defineProperty(t,"shape",{get:o(()=>{let y={...d};return Object.defineProperty(t,"shape",{value:y}),y},"get")})}let n=It(()=>iu(t));G(e._zod,"propValues",()=>{let d=t.shape,y={};for(let h in d){let _=d[h]._zod;if(_.values){y[h]??(y[h]=new Set);for(let E of _.values)y[h].add(E)}}return y});let i=Je,u=t.catchall,p;e._zod.parse=(d,y)=>{p??(p=n.value);let h=d.value;if(!i(h))return d.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),d;d.value={};let _=[],E=p.shape;for(let x of p.keys){let s=E[x],l=s._zod.optout==="optional",f=s._zod.run({value:h[x],issues:[]},y);f instanceof Promise?_.push(f.then(m=>zt(m,d,x,h,l))):zt(f,d,x,h,l)}return u?au(_,h,d,y,n.value,e):_.length?Promise.all(_).then(()=>d):d}});function Nn(e,t,r,n){for(let u of e)if(u.issues.length===0)return t.value=u.value,t;let i=e.filter(u=>!Ce(u));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(u=>u.issues.map(p=>Pe(p,n,me())))}),t)}o(Nn,"handleUnionResults");var mr=b("$ZodUnion",(e,t)=>{H.init(e,t),G(e._zod,"optin",()=>t.options.some(i=>i._zod.optin==="optional")?"optional":void 0),G(e._zod,"optout",()=>t.options.some(i=>i._zod.optout==="optional")?"optional":void 0),G(e._zod,"values",()=>{if(t.options.every(i=>i._zod.values))return new Set(t.options.flatMap(i=>Array.from(i._zod.values)))}),G(e._zod,"pattern",()=>{if(t.options.every(i=>i._zod.pattern)){let i=t.options.map(u=>u._zod.pattern);return new RegExp(`^(${i.map(u=>Tt(u.source)).join("|")})$`)}});let r=t.options.length===1,n=t.options[0]._zod.run;e._zod.parse=(i,u)=>{if(r)return n(i,u);let p=!1,d=[];for(let y of t.options){let h=y._zod.run({value:i.value,issues:[]},u);if(h instanceof Promise)d.push(h),p=!0;else{if(h.issues.length===0)return h;d.push(h)}}return p?Promise.all(d).then(y=>Nn(y,i,e,u)):Nn(d,i,e,u)}});var Wn=b("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,mr.init(e,t);let r=e._zod.parse;G(e._zod,"propValues",()=>{let i={};for(let u of t.options){let p=u._zod.propValues;if(!p||Object.keys(p).length===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(u)}"`);for(let[d,y]of Object.entries(p)){i[d]||(i[d]=new Set);for(let h of y)i[d].add(h)}}return i});let n=It(()=>{let i=t.options,u=new Map;for(let p of i){let d=p._zod.propValues?.[t.discriminator];if(!d||d.size===0)throw new Error(`Invalid discriminated union option at index "${t.options.indexOf(p)}"`);for(let y of d){if(u.has(y))throw new Error(`Duplicate discriminator value "${String(y)}"`);u.set(y,p)}}return u});e._zod.parse=(i,u)=>{let p=i.value;if(!Je(p))return i.issues.push({code:"invalid_type",expected:"object",input:p,inst:e}),i;let d=n.value.get(p?.[t.discriminator]);return d?d._zod.run(i,u):t.unionFallback?r(i,u):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:p,path:[t.discriminator],inst:e}),i)}});var qn=b("$ZodRecord",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!_n(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let u=[],p=t.keyType._zod.values;if(p){r.value={};let d=new Set;for(let h of p)if(typeof h=="string"||typeof h=="number"||typeof h=="symbol"){d.add(typeof h=="number"?h.toString():h);let _=t.valueType._zod.run({value:i[h],issues:[]},n);_ instanceof Promise?u.push(_.then(E=>{E.issues.length&&r.issues.push(..._e(h,E.issues)),r.value[h]=E.value})):(_.issues.length&&r.issues.push(..._e(h,_.issues)),r.value[h]=_.value)}let y;for(let h in i)d.has(h)||(y=y??[],y.push(h));y&&y.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:y})}else{r.value={};for(let d of Reflect.ownKeys(i)){if(d==="__proto__")continue;let y=t.keyType._zod.run({value:d,issues:[]},n);if(y instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(typeof d=="string"&&cr.test(d)&&y.issues.length){let E=t.keyType._zod.run({value:Number(d),issues:[]},n);if(E instanceof Promise)throw new Error("Async schemas not supported in object keys currently");E.issues.length===0&&(y=E)}if(y.issues.length){t.mode==="loose"?r.value[d]=i[d]:r.issues.push({code:"invalid_key",origin:"record",issues:y.issues.map(E=>Pe(E,n,me())),input:d,path:[d],inst:e});continue}let _=t.valueType._zod.run({value:i[d],issues:[]},n);_ instanceof Promise?u.push(_.then(E=>{E.issues.length&&r.issues.push(..._e(d,E.issues)),r.value[y.value]=E.value})):(_.issues.length&&r.issues.push(..._e(d,_.issues)),r.value[y.value]=_.value)}}return u.length?Promise.all(u).then(()=>r):r}});var Gn=b("$ZodEnum",(e,t)=>{H.init(e,t);let r=ar(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=new RegExp(`^(${r.filter(i=>Pn.has(typeof i)).map(i=>typeof i=="string"?De(i):i.toString()).join("|")})$`),e._zod.parse=(i,u)=>{let p=i.value;return n.has(p)||i.issues.push({code:"invalid_value",values:r,input:p,inst:e}),i}}),Kn=b("$ZodLiteral",(e,t)=>{if(H.init(e,t),t.values.length===0)throw new Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=new RegExp(`^(${t.values.map(n=>typeof n=="string"?De(n):n?De(n.toString()):String(n)).join("|")})$`),e._zod.parse=(n,i)=>{let u=n.value;return r.has(u)||n.issues.push({code:"invalid_value",values:t.values,input:u,inst:e}),n}});var Jn=b("$ZodTransform",(e,t)=>{H.init(e,t),e._zod.parse=(r,n)=>{if(n.direction==="backward")throw new Pt(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(p=>(r.value=p,r));if(i instanceof Promise)throw new pe;return r.value=i,r}});function Dn(e,t){return e.issues.length&&t===void 0?{issues:[],value:void 0}:e}o(Dn,"handleOptionalResult");var Xn=b("$ZodOptional",(e,t)=>{H.init(e,t),e._zod.optin="optional",e._zod.optout="optional",G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)})?$`):void 0}),e._zod.parse=(r,n)=>{if(t.innerType._zod.optin==="optional"){let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(u=>Dn(u,r.value)):Dn(i,r.value)}return r.value===void 0?r:t.innerType._zod.run(r,n)}});var Yn=b("$ZodNullable",(e,t)=>{H.init(e,t),G(e._zod,"optin",()=>t.innerType._zod.optin),G(e._zod,"optout",()=>t.innerType._zod.optout),G(e._zod,"pattern",()=>{let r=t.innerType._zod.pattern;return r?new RegExp(`^(${Tt(r.source)}|null)$`):void 0}),G(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(r,n)=>r.value===null?r:t.innerType._zod.run(r,n)});var Qn=b("$ZodPipe",(e,t)=>{H.init(e,t),G(e._zod,"values",()=>t.in._zod.values),G(e._zod,"optin",()=>t.in._zod.optin),G(e._zod,"optout",()=>t.out._zod.optout),G(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(r,n)=>{if(n.direction==="backward"){let u=t.out._zod.run(r,n);return u instanceof Promise?u.then(p=>At(p,t.in,n)):At(u,t.in,n)}let i=t.in._zod.run(r,n);return i instanceof Promise?i.then(u=>At(u,t.out,n)):At(i,t.out,n)}});function At(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}o(At,"handlePipeResult");var eo=b("$ZodCustom",(e,t)=>{Ue.init(e,t),H.init(e,t),e._zod.parse=(r,n)=>r,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(u=>Cn(u,r,n,e));Cn(i,r,n,e)}});function Cn(e,t,r,n){if(!e){let i={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(i.params=n._zod.def.params),t.issues.push(ur(i))}}o(Cn,"handleRefineResult");var ro,pu=Symbol("ZodOutput"),lu=Symbol("ZodInput"),fr=class{static{o(this,"$ZodRegistry")}constructor(){this._map=new WeakMap,this._idmap=new Map}add(t,...r){let n=r[0];return this._map.set(t,n),n&&typeof n=="object"&&"id"in n&&this._idmap.set(n.id,t),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(t){let r=this._map.get(t);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(t),this}get(t){let r=t._zod.parent;if(r){let n={...this.get(r)??{}};delete n.id;let i={...n,...this._map.get(t)};return Object.keys(i).length?i:void 0}return this._map.get(t)}has(t){return this._map.has(t)}};function no(){return new fr}o(no,"registry");(ro=globalThis).__zod_globalRegistry??(ro.__zod_globalRegistry=no());var gr=globalThis.__zod_globalRegistry;function oo(e,t){return new e({type:"string",...V(t)})}o(oo,"_string");function io(e,t){return new e({type:"string",coerce:!0,...V(t)})}o(io,"_coercedString");function ao(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...V(t)})}o(ao,"_url");function so(e,t){return new e({type:"number",checks:[],...V(t)})}o(so,"_number");function uo(e,t){return new e({type:"number",coerce:!0,checks:[],...V(t)})}o(uo,"_coercedNumber");function co(e,t){return new e({type:"boolean",...V(t)})}o(co,"_boolean");function po(e,t){return new e({type:"boolean",coerce:!0,...V(t)})}o(po,"_coercedBoolean");function lo(e,t){return new e({type:"bigint",coerce:!0,...V(t)})}o(lo,"_coercedBigint");function mo(e){return new e({type:"any"})}o(mo,"_any");function fo(e){return new e({type:"unknown"})}o(fo,"_unknown");function go(e,t){return new e({type:"void",...V(t)})}o(go,"_void");function yo(e,t){return new e({type:"date",coerce:!0,...V(t)})}o(yo,"_coercedDate");function ue(e,t){return new zn({check:"min_length",...V(t),minimum:e})}o(ue,"_minLength");function be(e,t){return new On({check:"string_format",format:"regex",...V(t),pattern:e})}o(be,"_regex");function ho(e,t,r){let n=V(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}o(ho,"_custom");var K=b("ZodMiniType",(e,t)=>{if(!e._zod)throw new Error("Uninitialized schema in ZodMiniType.");H.init(e,t),e.def=t,e.type=t.type,e.parse=(r,n)=>$t(e,r,n,{callee:e.parse}),e.safeParse=(r,n)=>Ye(e,r,n),e.parseAsync=async(r,n)=>St(e,r,n,{callee:e.parseAsync}),e.safeParseAsync=async(r,n)=>Qe(e,r,n),e.check=(...r)=>e.clone({...t,checks:[...t.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]},{parent:!0}),e.with=e.check,e.clone=(r,n)=>Et(e,r,n),e.brand=()=>e,e.register=(r,n)=>(r.add(e,n),e),e.apply=r=>r(e)}),wt=b("ZodMiniString",(e,t)=>{Ot.init(e,t),K.init(e,t)});function a(e){return oo(wt,e)}o(a,"string");var vo=b("ZodMiniStringFormat",(e,t)=>{lr.init(e,t),wt.init(e,t)});var Pu=b("ZodMiniURL",(e,t)=>{Un.init(e,t),vo.init(e,t)});function xo(e){return ao(Pu,e)}o(xo,"url");var yr=b("ZodMiniNumber",(e,t)=>{Mn.init(e,t),K.init(e,t)});function Q(e){return so(yr,e)}o(Q,"number");var hr=b("ZodMiniBoolean",(e,t)=>{dr.init(e,t),K.init(e,t)});function B(e){return co(hr,e)}o(B,"boolean");var _o=b("ZodMiniBigInt",(e,t)=>{jn.init(e,t),K.init(e,t)});var bu=b("ZodMiniAny",(e,t)=>{Ln.init(e,t),K.init(e,t)});function tt(){return mo(bu)}o(tt,"any");var Iu=b("ZodMiniUnknown",(e,t)=>{Fn.init(e,t),K.init(e,t)});function O(){return fo(Iu)}o(O,"unknown");var Tu=b("ZodMiniVoid",(e,t)=>{Bn.init(e,t),K.init(e,t)});function Po(e){return go(Tu,e)}o(Po,"_void");var bo=b("ZodMiniDate",(e,t)=>{Zn.init(e,t),K.init(e,t)});var Eu=b("ZodMiniArray",(e,t)=>{Vn.init(e,t),K.init(e,t)});function R(e,t){return new Eu({type:"array",element:e,...V(t)})}o(R,"array");var $u=b("ZodMiniObject",(e,t)=>{Hn.init(e,t),K.init(e,t),G(e,"shape",()=>t.shape)});function c(e,t){let r={type:"object",shape:e??{},...V(t)};return new $u(r)}o(c,"object");var Su=b("ZodMiniUnion",(e,t)=>{mr.init(e,t),K.init(e,t)});function N(e,t){return new Su({type:"union",options:e,...V(t)})}o(N,"union");var Au=b("ZodMiniDiscriminatedUnion",(e,t)=>{Wn.init(e,t),K.init(e,t)});function Me(e,t,r){return new Au({type:"union",options:t,discriminator:e,...V(r)})}o(Me,"discriminatedUnion");var zu=b("ZodMiniRecord",(e,t)=>{qn.init(e,t),K.init(e,t)});function k(e,t,r){return new zu({type:"record",keyType:e,valueType:t,...V(r)})}o(k,"record");var Ou=b("ZodMiniEnum",(e,t)=>{Gn.init(e,t),K.init(e,t),e.options=Object.values(t.entries)});function C(e,t){let r=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new Ou({type:"enum",entries:r,...V(t)})}o(C,"_enum");var ku=b("ZodMiniLiteral",(e,t)=>{Kn.init(e,t),K.init(e,t)});function $(e,t){return new ku({type:"literal",values:Array.isArray(e)?e:[e],...V(t)})}o($,"literal");var wu=b("ZodMiniTransform",(e,t)=>{Jn.init(e,t),K.init(e,t)});function Ie(e){return new wu({type:"transform",transform:e})}o(Ie,"transform");var Ru=b("ZodMiniOptional",(e,t)=>{Xn.init(e,t),K.init(e,t)});function g(e){return new Ru({type:"optional",innerType:e})}o(g,"optional");var Nu=b("ZodMiniNullable",(e,t)=>{Yn.init(e,t),K.init(e,t)});function rt(e){return new Nu({type:"nullable",innerType:e})}o(rt,"nullable");var Du=b("ZodMiniPipe",(e,t)=>{Qn.init(e,t),K.init(e,t)});function Te(e,t){return new Du({type:"pipe",in:e,out:t})}o(Te,"pipe");var Cu=b("ZodMiniCustom",(e,t)=>{eo.init(e,t),K.init(e,t)});function Rt(e,t){return ho(Cu,e??(()=>!0),t)}o(Rt,"custom");var nt={};gn(nt,{bigint:()=>Zu,boolean:()=>Bu,date:()=>Vu,number:()=>Fu,string:()=>Lu});function Lu(e){return io(wt,e)}o(Lu,"string");function Fu(e){return uo(yr,e)}o(Fu,"number");function Bu(e){return po(hr,e)}o(Bu,"boolean");function Zu(e){return lo(_o,e)}o(Zu,"bigint");function Vu(e){return yo(bo,e)}o(Vu,"date");var xr=c({retryOnFailure:c({defaultValue:g(B()),hide:g(B())}),continueOnFailure:c({defaultValue:g(B()),hide:g(B())})}),vr=class{constructor(t,r,n,i,u,p,d,y,h,_,E){this.name=t;this.displayName=r;this.description=n;this.props=i;this.run=u;this.test=p;this.requireAuth=d;this.errorHandlingOptions=y;this.outputSchema=h;this.audience=_;this.aiMetadata=E}static{o(this,"IAction")}},ee=o(e=>new vr(e.name,e.displayName,e.description,e.props,e.run,e.test??e.run,e.requireAuth??!0,e.errorHandlingOptions??{continueOnFailure:{defaultValue:!1},retryOnFailure:{defaultValue:!1}},e.outputSchema,e.audience,e.aiMetadata),"createAction");var F=c({displayName:a(),description:g(a())}),D=o((e,t)=>c({type:$(t),required:B(),defaultValue:g(tt())}),"TPropertyValue");var ne=c({...F.shape,...D(a(),"SHORT_TEXT").shape}),fe=c({...F.shape,...D(a(),"LONG_TEXT").shape});var To=c({label:a(),value:O()}),Nt=c({disabled:g(B()),placeholder:g(a()),options:R(To)});var oe=c({...F.shape,options:Nt,...D(O(),"STATIC_DROPDOWN").shape}),ge=c({...F.shape,options:Nt,...D(R(O()),"STATIC_MULTI_SELECT_DROPDOWN").shape});var _r=c({...F.shape,...D(O(),"DROPDOWN").shape,refreshers:R(a())}),ot=c({...F.shape,...D(R(O()),"MULTI_SELECT_DROPDOWN").shape,refreshers:R(a())});var ye=c({...F.shape,...D(B(),"CHECKBOX").shape});var he=c({...F.shape,...D(Q(),"NUMBER").shape});var it=c({...F.shape,...D(O(),"FILE").shape});var at=c({...F.shape,...D(a(),"DATE_TIME").shape});var Eo=k(a(),N([ne,fe,oe,ot,ge,ye,he,it,at])),st=c({...F.shape,properties:Eo,...D(R(O()),"ARRAY").shape});var ut=c({...F.shape,...D(N([k(a(),O())]),"JSON").shape});var $o=N([ne,oe,ut,st,ge]),Wu=k(a(),$o),Pr=c({refreshers:R(a()),...F.shape,...D(O(),"DYNAMIC").shape});var Dt=c({...F.shape,...D(Po(),"MARKDOWN").shape});var ct=(r=>(r.ARCHIVE="ARCHIVE",r.REGISTRY="REGISTRY",r))(ct||{}),je=(r=>(r.CUSTOM="CUSTOM",r.OFFICIAL="OFFICIAL",r))(je||{}),pt=(v=>(v.ARTIFICIAL_INTELLIGENCE="ARTIFICIAL_INTELLIGENCE",v.COMMUNICATION="COMMUNICATION",v.COMMERCE="COMMERCE",v.CORE="CORE",v.UNIVERSAL_AI="UNIVERSAL_AI",v.FLOW_CONTROL="FLOW_CONTROL",v.BUSINESS_INTELLIGENCE="BUSINESS_INTELLIGENCE",v.ACCOUNTING="ACCOUNTING",v.PRODUCTIVITY="PRODUCTIVITY",v.CONTENT_AND_FILES="CONTENT_AND_FILES",v.DEVELOPER_TOOLS="DEVELOPER_TOOLS",v.CUSTOMER_SUPPORT="CUSTOMER_SUPPORT",v.FORMS_AND_SURVEYS="FORMS_AND_SURVEYS",v.HUMAN_RESOURCES="HUMAN_RESOURCES",v.PAYMENT_PROCESSING="PAYMENT_PROCESSING",v.MARKETING="MARKETING",v.SALES_AND_CRM="SALES_AND_CRM",v))(pt||{});var lt=(r=>(r.AUTHORIZATION_CODE="authorization_code",r.CLIENT_CREDENTIALS="client_credentials",r))(lt||{}),br="both_client_credentials_and_authorization_code";var Oe=(i=>(i.POLLING="POLLING",i.WEBHOOK="WEBHOOK",i.APP_WEBHOOK="APP_WEBHOOK",i.MANUAL="MANUAL",i))(Oe||{}),dt=(u=>(u.NONE="NONE",u.HEADER_PRESENT="HEADER_PRESENT",u.QUERY_PRESENT="QUERY_PRESENT",u.BODY_PARAM_PRESENT="BODY_PARAM_PRESENT",u.HEAD_REQUEST="HEAD_REQUEST",u))(dt||{}),qu=c({strategy:C(dt),paramName:g(a())}),mt=(r=>(r.SIMULATION="SIMULATION",r.TEST_FUNCTION="TEST_FUNCTION",r))(mt||{});var Ct=(r=>(r.WEBSOCKET="WEBSOCKET",r.NONE="NONE",r))(Ct||{}),So=c({status:g(Q()),body:g(O()),headers:g(k(a(),a()))}),Ao=c({type:$("DELAY"),resumeDateTime:a(),requestIdToReply:g(a()),handlerId:g(a()),streamStepProgress:g(C(Ct))}),zo=c({type:$("WEBHOOK"),requestId:a(),requestIdToReply:g(a()),response:So,handlerId:g(a()),streamStepProgress:g(C(Ct))}),Gu=N([Ao,zo]);var Ku=c({body:O(),rawBody:g(O()),headers:k(a(),a()),queryParams:k(a(),a())});function ve(e){return e==null}o(ve,"isNil");function ft(e){return e==null?!0:typeof e=="string"||Array.isArray(e)?e.length===0:typeof e=="object"?Object.keys(e).length===0:!1}o(ft,"isEmpty");function Ut(e,t){if(e==null)throw new Error(`${t} is null or undefined`)}o(Ut,"assertNotNullOrUndefined");var Ir=ze(require("crypto"),1);var Ju=128,ke,Le,Xu=o(e=>{!ke||ke.length<e?(ke=Buffer.allocUnsafe(e*Ju),Ir.default.randomFillSync(ke),Le=0):Le+e>ke.length&&(Ir.default.randomFillSync(ke),Le=0),Le+=e},"fillPool"),Yu=o(e=>(Xu(e|=0),ke.subarray(Le-e,Le)),"random"),Qu=o((e,t,r)=>{let n=(2<<31-Math.clz32(e.length-1|1))-1,i=Math.ceil(1.6*n*t/e.length);return(u=t)=>{let p="";for(;;){let d=r(i),y=i;for(;y--;)if(p+=e[d[y]&n]||"",p.length===u)return p}}},"customRandom"),ko=o((e,t=21)=>Qu(e,t,Yu),"customAlphabet");var ec="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",wo=21,QP=a().check(be(new RegExp(`^[0-9a-zA-Z]{${wo}}$`))),tc=ko(ec,wo);var Ee=Te(Ie(e=>e instanceof Date?e.toISOString():e),a()),ie={id:a(),created:Ee,updated:Ee},Z=o(e=>g(rt(e)),"Nullable");function Tr(e){return g(rt(C(e)))}o(Tr,"NullableEnum");var rb=Te(Ie(e=>e==="true"||e===!0?!0:e==="false"||e===!1?!1:void 0),g(B())),Mt=o(e=>Te(Ie(t=>Array.isArray(t)?t:t!==void 0?[t]:void 0),g(R(e))),"OptionalArrayFromQuery");var ib=k(a(),O());var gt=(_=>(_.OPENAI="openai",_.OPENROUTER="openrouter",_.ANTHROPIC="anthropic",_.AZURE="azure",_.GOOGLE="google",_.ACTIVEPIECES="activepieces",_.CLOUDFLARE_GATEWAY="cloudflare-gateway",_.CUSTOM="custom",_.BEDROCK="bedrock",_.MISTRAL="mistral",_))(gt||{});var hb=a().check(be(/^#[0-9A-Fa-f]{6}$/));var xb=c({filename:a(),data:O(),type:$("file"),mimetype:g(a())});var rc=ze(No());var $b=c({...ie,name:a(),permissions:R(a()),platformId:Z(a()),type:a(),userCount:g(Q())});var Do=(n=>(n.AGENT_DECIDE="agent-decide",n.CHOOSE_YOURSELF="choose-yourself",n.LEAVE_EMPTY="leave-empty",n))(Do||{}),Er=(r=>(r.FILE="FILE",r.TABLE="TABLE",r))(Er||{}),$r=(n=>(n.SSE="sse",n.STREAMABLE_HTTP="streamable-http",n.SIMPLE_HTTP="http",n))($r||{});var Sr=(n=>(n.TEXT="text",n.NUMBER="number",n.BOOLEAN="boolean",n))(Sr||{});var Ar=(r=>(r.IN_PROGRESS="in-progress",r.COMPLETED="completed",r))(Ar||{});var nc=c({mode:C(Do),value:O()}),oc=c({auth:g(a()),fields:k(a(),nc)}),ic=c({pieceName:a(),pieceVersion:a(),actionName:a(),predefinedInput:g(oc)}),ac=c({type:$("PIECE"),toolName:a().check(ue(1)),pieceMetadata:ic}),sc=c({type:$("none")}),uc=c({type:$("access_token"),accessToken:a()}),cc=c({type:$("api_key"),apiKey:a(),apiKeyHeader:a()}),pc=c({type:$("headers"),headers:k(a(),a())}),lc=Me("type",[sc,uc,cc,pc]),Co=c({type:$("FLOW"),toolName:a().check(ue(1)),externalFlowId:a(),flowDisplayName:g(a())}),Uo=c({type:$("MCP"),toolName:a().check(ue(1)),serverUrl:xo(),protocol:C($r),auth:lc}),Mo=c({type:$("KNOWLEDGE_BASE"),toolName:a().check(ue(1)),sourceType:C(Er),sourceId:a(),sourceName:a()}),dc=Me("type",[ac,Co,Uo,Mo]),mc=c({displayName:a(),description:g(a()),type:C(Sr)}),jo=c({type:$("MARKDOWN"),markdown:a()}),Fe={type:$("TOOL_CALL"),input:Z(k(a(),O())),output:g(O()),toolName:a(),status:C(Ar),toolCallId:a(),startTime:a(),endTime:g(a())},Qb=c(Fe),Lo=Me("toolCallType",[c({...Fe,toolCallType:$("PIECE"),pieceName:a(),pieceVersion:a(),actionName:a()}),c({...Fe,toolCallType:$("FLOW"),displayName:a(),externalFlowId:a()}),c({...Fe,toolCallType:$("MCP"),displayName:a(),serverUrl:a()}),c({...Fe,toolCallType:$("KNOWLEDGE_BASE"),displayName:a(),sourceType:a()}),c({...Fe,toolCallType:$("UNKNOWN"),displayName:a()})]),fc=N([jo,Lo]);var zr=(r=>(r.IMAGE="image",r.TEXT="text",r))(zr||{}),xe=c({apiKey:a()}),gc=xe,yc=c({apiKey:a(),apiKeyHash:a()}),hc=xe,vc=xe,xc=xe,_c=xe,Pc=xe,bc=xe,Ic=xe,Fo=c({accessKeyId:a().check(ue(1)),secretAccessKey:a().check(ue(1))}),Tc=c({}),Ec=c({}),$c=c({}),Sc=c({}),Ac=c({}),zc=c({}),Bo=c({modelId:a(),modelName:a(),modelType:C(zr)}),Zo=c({apiKeyHeader:a(),baseUrl:a(),models:R(Bo),defaultHeaders:g(k(a(),a()))}),Vo=c({accountId:a(),gatewayId:a(),models:R(Bo),vertexProject:g(a()),vertexRegion:g(a())}),Ho=c({resourceName:a(),apiVersion:Te(Ie(e=>typeof e=="string"&&e.trim().length===0?void 0:e),g(a()))}),Wo=c({region:a().check(ue(1))}),Oc=N([gc,xc,_c,Pc,bc,vc,hc,yc,Fo,Ic]),qo=N([Zo,Vo,Ho,Wo,Tc,$c,Sc,Ac,Ec,zc]),kc=c({id:a(),name:a(),type:C(zr)}),wc=c({id:a(),name:a(),provider:C(gt),config:qo,enabledForChat:B()}),Rc=c({provider:C(gt),config:qo,auth:Oc,platformId:a()});var nI={openai:"openai",anthropic:"anthropic","google-ai-studio":"google","google-vertex-ai":"google"};var Nc=c({base64Url:a(),fileName:a(),extension:g(a())}),Dc=c({mimeType:a(),url:a(),fileName:g(a())}),Or=N([Nc,Dc]);var Cc=N([c({type:$("file"),value:Or}),c({type:$("markdown"),value:a(),files:g(R(Or))})]),Uc=c({sessionId:a(),message:a(),files:g(R(a()))});var Ko=(r=>(r.ON_NEW_RECORD="ON_NEW_RECORD",r.ON_UPDATE_RECORD="ON_UPDATE_RECORD",r))(Ko||{}),Jo=(r=>(r.ENABLED="ENABLED",r.DISABLED="DISABLED",r))(Jo||{}),kr=(n=>(n.RECORD_CREATED="RECORD_CREATED",n.RECORD_UPDATED="RECORD_UPDATED",n.RECORD_DELETED="RECORD_DELETED",n))(kr||{});var Mc=N([c({...ie,name:a(),externalId:a(),type:$("STATIC_DROPDOWN"),tableId:a(),projectId:a(),data:c({options:R(c({value:a()}))})}),c({...ie,name:a(),externalId:a(),type:N([$("TEXT"),$("NUMBER"),$("DATE")]),tableId:a(),projectId:a()})]),jc=c({...ie,name:a(),folderId:Z(a()),projectId:a(),externalId:a(),status:Tr(Jo),trigger:Tr(Ko)}),Lc=c({...ie,tableId:a(),projectId:a(),cells:k(a(),c({updated:a(),created:a(),value:O(),fieldName:a()}))}),Fc=c({events:R(C(kr)),webhookUrl:a(),flowId:a()}),Bc=c({fields:R(c({id:a(),name:a()})),rows:R(k(a(),a())),name:a()}),Zc=c({projectId:a(),limit:g(nt.number()),cursor:g(a()),name:g(a()),externalIds:Mt(a()),folderId:g(a()),folderIds:Mt(a())}),Vc=c({records:R(R(c({fieldId:a(),value:Yo()}))),tableId:a()}),Hc=c({cells:g(R(c({fieldId:a(),value:Yo()}))),tableId:a(),agentUpdate:g(B())}),Xo=Me("operator",[we("eq"),we("neq"),we("gt"),we("gte"),we("lt"),we("lte"),we("co"),Go("exists"),Go("not_exists")]),Wc=c({tableId:a(),limit:g(nt.number()),cursor:g(a()),filters:Mt(Xo)});function Yo(){return Te(Ie(e=>e==null?e:String(e)),rt(a()))}o(Yo,"coerceToString");function we(e){return c({fieldId:a(),operator:$(e),value:a()})}o(we,"valueFilter");function Go(e){return c({fieldId:a(),operator:$(e)})}o(Go,"existenceFilter");var qc=c({status:g(Q()),body:g(O()),headers:g(k(a(),a()))}),Gc=c({...ie,deleted:Z(Ee),ownerId:a(),displayName:a(),platformId:a(),externalId:Z(a())});var Qo=c({name:a(),description:g(a()),type:a(),required:B()}),Kc=c({pieceName:a(),triggerName:a(),input:c({toolName:a(),toolDescription:a(),inputSchema:R(Qo),returnsResponse:B()})});var ei="^[0-9]+\\.[0-9]+\\.[0-9]+$",bI=new RegExp(ei),Xc="^([~^])?[0-9]+\\.[0-9]+\\.[0-9]+$",II=a().check(be(new RegExp(ei))),TI=a().check(be(new RegExp(Xc))),Yc=c({packageType:$("ARCHIVE"),pieceType:C(je),pieceName:a(),pieceVersion:a(),archiveId:a(),platformId:a()}),ti=c({packageType:$("REGISTRY"),pieceType:$("OFFICIAL"),pieceName:a(),pieceVersion:a()}),ri=c({packageType:$("REGISTRY"),pieceType:$("CUSTOM"),pieceName:a(),pieceVersion:a(),platformId:a()}),EI=N([ti,ri]),$I=N([Yc,ti,ri]),ni=(t=>(t.CRON_EXPRESSION="CRON_EXPRESSION",t))(ni||{}),Qc=c({type:C(ni),cronExpression:a(),timezone:a()}),SI=c({...ie,type:C(Oe),projectId:a(),flowId:a(),triggerName:a(),schedule:Z(Qc),flowVersionId:a(),pieceName:a(),pieceVersion:a(),deleted:Z(a()),simulate:B()}),oi=(m=>(m.UNKNOWN="UNKNOWN",m.FLOW_RUN_LOG="FLOW_RUN_LOG",m.FLOW_RUN_LOG_SLICE="FLOW_RUN_LOG_SLICE",m.PACKAGE_ARCHIVE="PACKAGE_ARCHIVE",m.FLOW_STEP_FILE="FLOW_STEP_FILE",m.SAMPLE_DATA="SAMPLE_DATA",m.TRIGGER_PAYLOAD="TRIGGER_PAYLOAD",m.SAMPLE_DATA_INPUT="SAMPLE_DATA_INPUT",m.TRIGGER_EVENT_FILE="TRIGGER_EVENT_FILE",m.PROJECT_RELEASE="PROJECT_RELEASE",m.FLOW_VERSION_BACKUP="FLOW_VERSION_BACKUP",m.PLATFORM_ASSET="PLATFORM_ASSET",m.USER_PROFILE_PICTURE="USER_PROFILE_PICTURE",m.WEBHOOK_PAYLOAD="WEBHOOK_PAYLOAD",m.KNOWLEDGE_BASE="KNOWLEDGE_BASE",m.FLOW_BUNDLE="FLOW_BUNDLE",m))(oi||{}),ii=(r=>(r.NONE="NONE",r.ZSTD="ZSTD",r))(ii||{}),ai=(r=>(r.S3="S3",r.DB="DB",r))(ai||{}),AI=c({...ie,projectId:Z(a()),platformId:Z(a()),type:C(oi),compression:C(ii),data:g(O()),location:C(ai),size:Z(Q()),fileName:Z(a()),s3Key:Z(a()),metadata:Z(k(a(),a()))}),si=(n=>(n.ADMIN="ADMIN",n.MEMBER="MEMBER",n.OPERATOR="OPERATOR",n))(si||{}),ui=(r=>(r.ACTIVE="ACTIVE",r.INACTIVE="INACTIVE",r))(ui||{}),zI=c({id:a(),email:a(),firstName:a(),status:C(ui),externalId:Z(a()),platformId:Z(a()),platformRole:C(si),lastName:a(),created:Ee,updated:Ee,lastActiveDate:Z(Ee),imageUrl:Z(a())});var Rr=c({...F.shape,...D(k(a(),O()),"OBJECT").shape});var li=c({...F.shape,...D(a(),"COLOR").shape});var Nr=N([ne,fe,Dt,ye,oe,ge,_r,ot,Pr,he,st,Rr,ut,at,it,li]),U={ShortText(e){return{...e,valueSchema:void 0,type:"SHORT_TEXT"}},Checkbox(e){return{...e,valueSchema:void 0,type:"CHECKBOX"}},LongText(e){return{...e,valueSchema:void 0,type:"LONG_TEXT"}},MarkDown(e){return{displayName:"Markdown",required:!1,description:e.value,type:"MARKDOWN",valueSchema:void 0,variant:e.variant??"INFO"}},Number(e){return{...e,valueSchema:void 0,type:"NUMBER"}},Json(e){return{...e,valueSchema:void 0,type:"JSON"}},Array(e){return{...e,valueSchema:void 0,type:"ARRAY"}},Object(e){return{...e,valueSchema:void 0,type:"OBJECT"}},Dropdown(e){return{...e,valueSchema:void 0,type:"DROPDOWN"}},StaticDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_DROPDOWN"}},MultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"MULTI_SELECT_DROPDOWN"}},DynamicProperties(e){return{...e,valueSchema:void 0,type:"DYNAMIC"}},StaticMultiSelectDropdown(e){return{...e,valueSchema:void 0,type:"STATIC_MULTI_SELECT_DROPDOWN"}},DateTime(e){return{...e,valueSchema:void 0,type:"DATE_TIME"}},File(e){return{...e,valueSchema:void 0,type:"FILE"}},Custom(e){let t=e.code.toString();return{...e,code:t,valueSchema:void 0,type:"CUSTOM"}},Color(e){return{...e,valueSchema:void 0,type:"COLOR"}}};var le=c({displayName:a(),description:g(a())});var di=c({username:a(),password:a()}),Dr=c({...le.shape,username:c({displayName:a(),description:g(a())}),password:c({displayName:a(),description:g(a())}),...D(di,"BASIC_AUTH").shape});var np=k(a(),N([ne,fe,he,ye,oe])),Cr=c({...le.shape,props:np,...D(O(),"CUSTOM_AUTH").shape});var Re=c({...le.shape,...D(c({auth:a()}),"SECRET_TEXT").shape});var op=k(a(),N([ne,fe,Re,he,ye,oe,ge,Dt])),mi=c({...le.shape,props:op,...D(O(),"OIDC").shape});var Ur=(r=>(r.HEADER="HEADER",r.BODY="BODY",r))(Ur||{}),fi=N([ne,Re,oe]),gi=k(a(),fi),ip=c({props:g(k(a(),fi)),authUrl:a(),tokenUrl:a(),scope:R(a()),prompt:g(N([$("none"),$("consent"),$("login"),$("omit")])),pkce:g(B()),pkceMethod:g(N([$("plain"),$("S256")])),authorizationMethod:g(C(Ur)),grantType:g(N([C(lt),$(br)])),extra:g(k(a(),a()))}),yi=c({access_token:a(),props:g(gi),data:k(a(),tt())}),Mr=c({...le.shape,...ip.shape,...D(yi,"OAUTH2").shape});var Be=N([Dr,Cr,mi,Mr,Re]),yt="Connection",jr={SecretText(e){return{...e,valueSchema:void 0,type:"SECRET_TEXT"}},OAuth2(e){return{...e,valueSchema:void 0,type:"OAUTH2",displayName:e.displayName||yt}},BasicAuth(e){return{...e,valueSchema:void 0,type:"BASIC_AUTH",displayName:e.displayName||yt,required:!0}},CustomAuth(e){return{...e,valueSchema:void 0,type:"CUSTOM_AUTH",displayName:e.displayName||yt}},OIDC(e){return{...e,valueSchema:void 0,type:"OIDC",displayName:e.displayName||yt}},None(){}};var sE={OAUTH2:"OAUTH2",CLOUD_OAUTH2:"OAUTH2",PLATFORM_OAUTH2:"OAUTH2",BASIC_AUTH:"BASIC_AUTH",CUSTOM_AUTH:"CUSTOM_AUTH",OIDC:"OIDC",SECRET_TEXT:"SECRET_TEXT",NO_AUTH:void 0};var ap=c({...F.shape,...D(O(),"CUSTOM").shape,code:a()});var sp=N([Nr,Be]),Lr=k(a(),sp),SE=k(a(),Nr);var hi=N([c({strategy:$("CRON"),cronExpression:a()}),c({strategy:$("NONE")})]);var vi="2",Lt="0.82.0";var Fr=class{constructor(t,r,n,i,u,p,d,y,h=Lt,_,E=""){this.displayName=t;this.logoUrl=r;this.authors=n;this.events=i;this.categories=d;this.auth=y;this.minimumSupportedRelease=h;this.maximumSupportedRelease=_;this.description=E;this._actions={};this._triggers={};this.getContextInfo=o(()=>({version:vi}),"getContextInfo");(!up(h)||cp(h,Lt))&&(this.minimumSupportedRelease=Lt),u.forEach(x=>this._actions[x.name]=x),p.forEach(x=>this._triggers[x.name]=x)}static{o(this,"Piece")}metadata(){return{displayName:this.displayName,logoUrl:this.logoUrl,actions:this._actions,triggers:this._triggers,categories:this.categories,description:this.description,authors:this.authors,auth:this.auth,minimumSupportedRelease:this.minimumSupportedRelease,maximumSupportedRelease:this.maximumSupportedRelease,contextInfo:this.getContextInfo?.()}}getAction(t){return this._actions[t]}getTrigger(t){return this._triggers[t]}actions(){return this._actions}triggers(){return this._triggers}},xi=o(e=>{if(e.auth&&Array.isArray(e.auth)&&!e.auth.every((r,n,i)=>n===i.findIndex(u=>u.type===r.type)))throw new Error("Auth properties must be unique by type");return new Fr(e.displayName,e.logoUrl,e.authors??[],e.events,e.actions,e.triggers,e.categories??[],e.auth,e.minimumSupportedRelease,e.maximumSupportedRelease,e.description)},"createPiece");function up(e){return/^\d+\.\d+\.\d+$/.test(e)}o(up,"isValidSimpleSemver");function cp(e,t){let[r,n,i]=e.split(".").map(Number),[u,p,d]=t.split(".").map(Number);return r!==u?r<u:n!==p?n<p:i<d}o(cp,"isSemverLessThan");var pp=g(k(a(),k(a(),a()))),_i=c({id:g(a()),name:a(),displayName:a(),logoUrl:a(),description:a(),authors:R(a()),platformId:g(a()),directoryPath:g(a()),auth:g(N([Be,R(Be)])),version:a(),categories:g(R(C(pt))),minimumSupportedRelease:g(a()),maximumSupportedRelease:g(a()),i18n:pp}),lp=C(["human","ai","both"]),Pi=c({description:g(a()),idempotent:g(B())}),bi=c({name:a(),displayName:a(),description:a(),props:Lr,requireAuth:B(),errorHandlingOptions:g(xr),outputSchema:g(Rt()),audience:g(lp),aiMetadata:g(Pi)}),Ii=c({name:a(),displayName:a(),description:a(),props:Lr,errorHandlingOptions:g(xr),type:C(Oe),sampleData:O(),handshakeConfiguration:g(Rt()),renewConfiguration:g(hi),testStrategy:C(mt),outputSchema:g(Rt()),aiMetadata:g(Pi)}),dp=c({..._i.shape,actions:k(a(),bi),triggers:k(a(),Ii)}),mp=c({..._i.shape,actions:Q(),triggers:Q(),suggestedActions:g(R(Ii)),suggestedTriggers:g(R(bi))}),Ti=c({projectUsage:Q(),tags:g(R(a())),pieceType:C(je),packageType:C(ct),platformId:g(a()),archiveId:g(a())}),S$=c({...dp.shape,...Ti.shape}),A$=c({...mp.shape,...Ti.shape}),z$=c({name:a(),version:a()});var fp=ze(require("path")),gp=ze(require("fs/promises"));var Ft=class{constructor(t,r){this.baseUrl=t;this.authenticationConverter=r}static{o(this,"BaseHttpClient")}getUrl(t){let r=new URL(`${this.baseUrl}${t.url}`),n=`${r.origin}${r.pathname}`,i=new URLSearchParams;return r.searchParams.forEach((u,p)=>{i.append(p,u)}),{urlWithoutQueryParams:n,queryParams:i}}getHeaders(t){let r={Accept:"application/json"};if(t.authentication&&this.populateAuthentication(t.authentication,r),t.body)switch(t.headers?.["Content-Type"]){case"text/csv":r["Content-Type"]="text/csv";break;default:r["Content-Type"]="application/json";break}return t.headers&&(r={...r,...t.headers}),r}populateAuthentication(t,r){this.authenticationConverter.convert(t,r)}};var Bt=class{static{o(this,"DelegatingAuthenticationConverter")}constructor(t=new Br,r=new Zr){this.converters={BEARER_TOKEN:t,BASIC:r}}convert(t,r){return this.converters[t.type].convert(t,r)}},Br=class{static{o(this,"BearerTokenAuthenticationConverter")}convert(t,r){return r.Authorization=`Bearer ${t.token}`,r}},Zr=class{static{o(this,"BasicTokenAuthenticationConverter")}convert(t,r){let n=`${t.username}:${t.password}`,i=Buffer.from(n).toString("base64");return r.Authorization=`Basic ${i}`,r}};var Zt=class extends Error{constructor(r,n){let i=n.status||500,u=Buffer.isBuffer(n.responseBody)?n.responseBody.toString():n.responseBody;super(JSON.stringify({response:{status:i,body:u},request:{body:r}}));this.requestBody=r;this.status=i,this.responseBody=u}static{o(this,"HttpError")}errorMessage(){return{response:{status:this.status,body:this.responseBody},request:{body:this.requestBody}}}get response(){return{status:this.status,body:this.responseBody}}get request(){return{body:this.requestBody}}};var Vt=class extends Ft{static{o(this,"FetchHttpClient")}constructor(t="",r=new Bt){super(t,r)}async sendRequest(t,r){process.env.NODE_TLS_REJECT_UNAUTHORIZED="0";let{urlWithoutQueryParams:n,queryParams:i}=this.getUrl(t),u=this.getHeaders(t),p=t.queryParams??{};for(let[j,re]of Object.entries(p))i.append(j,re);let d=i.toString(),y=d?`${n}?${d}`:n,h=t.responseType??"json",_=t.followRedirects??!0,E=t.retries??0,{body:x,extraHeaders:s,isStream:l}=yp(t.body,u),f=vp({...u,...s}),m=await hp(async()=>{let j=new AbortController,re=t.timeout&&t.timeout>0?setTimeout(()=>j.abort(),t.timeout):void 0;try{let se={method:t.method.toString(),headers:f,body:x,redirect:_?"follow":"manual",signal:j.signal};return l&&(se.duplex="half"),r?.dispatcher!==void 0&&(se.dispatcher=r.dispatcher),await fetch(y,se)}finally{re!==void 0&&clearTimeout(re)}},E),v=_?300:400;if(m.status<200||m.status>=v){let j=await Ei(m,h),re=new Zt(t.body,{status:m.status,responseBody:j});throw console.error("[HttpClient#(sanitized error message)] Request failed:",re),re}let P=await Ei(m,h);return{status:m.status,headers:xp(m.headers),body:P}}};function yp(e,t){return Pp(e)?{body:void 0,extraHeaders:{},isStream:!1}:_p(e)?{body:e,extraHeaders:e.getHeaders(),isStream:!0}:typeof e=="string"||Buffer.isBuffer(e)||e instanceof URLSearchParams||e instanceof ArrayBuffer||typeof FormData<"u"&&e instanceof FormData||typeof Blob<"u"&&e instanceof Blob?{body:e,extraHeaders:{},isStream:!1}:(t["Content-Type"]??t["content-type"]??"").includes("application/x-www-form-urlencoded")?{body:new URLSearchParams(e).toString(),extraHeaders:{},isStream:!1}:{body:JSON.stringify(e),extraHeaders:{},isStream:!1}}o(yp,"serializeBody");async function Ei(e,t){switch(t){case"arraybuffer":return Buffer.from(await e.arrayBuffer());case"blob":return await e.blob();case"text":return await e.text();case"json":default:{let r=await e.text();if(r.length===0)return;try{return JSON.parse(r)}catch{return r}}}}o(Ei,"parseResponseBody");async function hp(e,t){let r;for(let n=0;n<=t;n++)try{let i=await e();if(i.status>=500&&n<t){await $i(n);continue}return i}catch(i){if(r=i,n<t){await $i(n);continue}throw i}throw r}o(hp,"sendWithRetries");function $i(e){let t=Math.min(1e3*2**e,3e4);return new Promise(r=>setTimeout(r,t))}o($i,"backoff");function vp(e){let t={};for(let[r,n]of Object.entries(e))n!==void 0&&(t[r]=Array.isArray(n)?n.join(", "):n);return t}o(vp,"normalizeHeaders");function xp(e){let t={};return e.forEach((r,n)=>{t[n]=r}),t}o(xp,"toHttpHeaders");function _p(e){return typeof e=="object"&&e!==null&&typeof e.getHeaders=="function"&&typeof e.pipe=="function"}o(_p,"isNodeFormData");function Pp(e){return e==null}o(Pp,"isNil");var ae=new Vt;var Ht=(p=>(p.GET="GET",p.POST="POST",p.PATCH="PATCH",p.PUT="PUT",p.DELETE="DELETE",p.HEAD="HEAD",p))(Ht||{});var ud=ze(require("fs")),ks=ze(Os());var cd={"application/json":"json","application/pdf":"pdf","application/xml":"xml","text/xml":"xml","application/zip":"zip","application/gzip":"gz","application/x-tar":"tar","application/octet-stream":"bin","application/msword":"doc","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.ms-excel":"xls","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.ms-powerpoint":"ppt","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/rtf":"rtf","application/javascript":"js","application/x-www-form-urlencoded":"bin","text/plain":"txt","text/html":"html","text/css":"css","text/csv":"csv","text/calendar":"ics","text/markdown":"md","image/png":"png","image/jpeg":"jpeg","image/jpg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/bmp":"bmp","image/tiff":"tiff","image/x-icon":"ico","image/vnd.microsoft.icon":"ico","image/heic":"heic","audio/mpeg":"mp3","audio/mp4":"m4a","audio/wav":"wav","audio/x-wav":"wav","audio/ogg":"ogg","audio/webm":"weba","video/mp4":"mp4","video/mpeg":"mpeg","video/webm":"webm","video/quicktime":"mov","video/x-msvideo":"avi","font/woff":"woff","font/woff2":"woff2","font/ttf":"ttf","font/otf":"otf"};function pd(e){let t=e.split(";")[0].trim().toLowerCase();return cd[t]??""}o(pd,"contentTypeToExtension");var ld=o(({baseUrl:e,relativePath:t})=>{let r=e.endsWith("/")?e:`${e}/`,n=t.startsWith("/")?t.slice(1):t;return`${r}${n}`},"joinBaseUrlWithRelativePath"),dd=o((e,t)=>{let r="https://api.example.com";try{let n=t?e(t):void 0;return(n?.endsWith("/")?n.slice(0,-1):n)??r}catch{return r}},"getBaseUrlForDescription");function ws({auth:e,baseUrl:t,authMapping:r,description:n,displayName:i,name:u,props:p,extraProps:d,authLocation:y="headers"}){return ee({audience:"human",name:u||"custom_api_call",displayName:i||"Custom API Call",description:n||"Make a custom API call to a specific endpoint",auth:e,requireAuth:!!e,props:{url:U.DynamicProperties({auth:e,displayName:"",required:!0,refreshers:[],props:o(async({auth:h})=>({url:U.ShortText({displayName:"URL",description:`You can either use the full URL or the relative path to the base URL
3
+ i.e ${dd(t,h)}/resource or /resource`,required:!0,defaultValue:h?t(h):"",...p?.url??{}})}),"props")}),method:U.StaticDropdown({displayName:"Method",required:!0,options:{options:Object.values(Ht).map(h=>({label:h,value:h}))},...p?.method??{}}),headers:U.Object({displayName:"Headers",description:"Authorization headers are injected automatically from your connection.",required:!0,...p?.headers??{}}),queryParams:U.Object({displayName:"Query Parameters",required:!0,...p?.queryParams??{}}),body_type:U.StaticDropdown({displayName:"Body Type",required:!1,defaultValue:"none",options:{disabled:!1,options:[{label:"None",value:"none"},{label:"JSON",value:"json"},{label:"Form Data",value:"form_data"},{label:"Raw",value:"raw"}]}}),body:U.DynamicProperties({auth:e,displayName:"Body",refreshers:["body_type"],required:!1,props:o(async({body_type:h})=>{if(!h)return{};let _=h,E={};switch(_){case"none":break;case"json":E.data=U.Json({displayName:"JSON Body",required:!0,...p?.body??{}});break;case"raw":E.data=U.LongText({displayName:"Raw Body",required:!0});break;case"form_data":E.data=U.Array({displayName:"Form Data",required:!0,properties:{fieldName:U.ShortText({displayName:"Field Name",required:!0}),fieldType:U.StaticDropdown({displayName:"Field Type",required:!0,options:{disabled:!1,options:[{label:"Text",value:"text"},{label:"File",value:"file"}]}}),textFieldValue:U.LongText({displayName:"Text Field Value",required:!1}),fileFieldValue:U.File({displayName:"File Field Value",required:!1})}});break}return E},"props")}),response_is_binary:U.Checkbox({displayName:"Response is Binary ?",description:"Enable for files like PDFs, images, etc.",required:!1,defaultValue:!1}),failsafe:U.Checkbox({displayName:"No Error on Failure",required:!1,...p?.failsafe??{}}),timeout:U.Number({displayName:"Timeout (in seconds)",required:!1,...p?.timeout??{}}),followRedirects:U.Checkbox({displayName:"Follow redirects",required:!1,defaultValue:!1}),...d},run:o(async h=>{let{method:_,url:E,headers:x,queryParams:s,body:l,body_type:f,failsafe:m,timeout:v,response_is_binary:P,followRedirects:j}=h.propsValue;Ut(_,"Method"),Ut(E,"URL");let re=ve(r)?{}:await r(h.auth,h.propsValue),se=E.url,Ge=se.startsWith("http://")||se.startsWith("https://")?se:ld({baseUrl:t(h.auth),relativePath:se}),Ae={method:_,url:Ge,headers:{...x??{},...y==="headers"||!ve(y)?re:{}},queryParams:{...y==="queryParams"?re:{},...s??{}},timeout:v?v*1e3:0,followRedirects:j};if(P&&(Ae.responseType="arraybuffer"),l)if(f&&f!=="none"){let de=l.data;if(f==="form_data"){let Fs=de,_t=new ks.default;for(let{fieldName:dn,fieldType:mn,textFieldValue:fn,fileFieldValue:nr}of Fs)mn==="text"&&!ft(fn)?_t.append(dn,fn):mn==="file"&&!ft(nr)&&_t.append(dn,nr.data,{filename:nr?.filename});Ae.body=_t,Ae.headers={...Ae.headers,..._t.getHeaders()}}else Ae.body=de}else f||(Ae.body=l);try{let de=await ae.sendRequest(Ae);return await md(h.files,de.body,de.status,de.headers,P)}catch(de){if(m)return de.errorMessage();throw de}},"run")})}o(ws,"createCustomApiCallAction");var md=o(async(e,t,r,n,i)=>{let u;if(i&&fd(t)){let p=Array.isArray(n?.["content-type"])?n["content-type"][0]:n?.["content-type"],d=pd(p??"")||"txt",y;t instanceof ArrayBuffer?y=Buffer.from(new Uint8Array(t)):Buffer.isBuffer(t)?y=t:y=Buffer.from(t),u=await e.write({fileName:`output.${d}`,data:y})}else u=t;return{status:r,headers:n,body:u}},"handleBinaryResponse"),fd=o(e=>e instanceof ArrayBuffer||Buffer.isBuffer(e),"isBinaryBody");var Se="https://getcody.ai/api/v1",J={async listFolders({secret_text:e}){return(await ae.sendRequest({method:"GET",url:`${Se}/folders`,authentication:{type:"BEARER_TOKEN",token:e}})).body.data},async createDocument({secret_text:e},t,r,n){let i={method:"POST",url:`${Se}/documents`,authentication:{type:"BEARER_TOKEN",token:e},body:{name:t,folder_id:r,content:n}};return(await ae.sendRequest(i)).body},async getSignedUrl({secret_text:e},t,r){return(await ae.sendRequest({method:"POST",url:`${Se}/uploads/signed-url`,authentication:{type:"BEARER_TOKEN",token:e},body:{file_name:t,content_type:r}})).body.data},async uploadFileToS3(e,t,r){await ae.sendRequest({method:"PUT",url:e,body:t,headers:{"Content-Type":r}})},async createDocumentFromFile({secret_text:e},t,r){await ae.sendRequest({method:"POST",url:`${Se}/documents/file`,authentication:{type:"BEARER_TOKEN",token:e},body:{folder_id:t,key:r}})},async listConversations({secret_text:e},t){let r={};return t?.botId&&(r.bot_id=t.botId),t?.keyword&&(r.keyword=t.keyword),(await ae.sendRequest({method:"GET",url:`${Se}/conversations`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:e}})).body.data},async sendMessage({secret_text:e},t,r){return(await ae.sendRequest({method:"POST",url:`${Se}/messages`,authentication:{type:"BEARER_TOKEN",token:e},body:{conversation_id:t,content:r}})).body},async listBots({secret_text:e},t){let r={};return t&&(r.keyword=t),(await ae.sendRequest({method:"GET",url:`${Se}/bots`,queryParams:r,authentication:{type:"BEARER_TOKEN",token:e}})).body.data},async createConversation({secret_text:e},t,r,n){return(await ae.sendRequest({method:"POST",url:`${Se}/conversations`,authentication:{type:"BEARER_TOKEN",token:e},body:{bot_id:t,name:r,document_ids:n}})).body}};var tr=U.Dropdown({auth:X,displayName:"Folder",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your Cody AI account first.",options:[]};try{let t=await J.listFolders(e);return t.length===0?{disabled:!0,options:[],placeholder:"No folders found. Please create a folder in Cody first."}:{disabled:!1,options:t.map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Error listing folders. Check connection or API key permissions."}}},"options")}),Rs=U.Dropdown({displayName:"Conversation",auth:X,required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your Cody AI account first.",options:[]};try{let t=await J.listConversations(e);return t.length===0?{disabled:!0,options:[],placeholder:"No conversations found. Please create one in Cody first."}:{disabled:!1,options:t.map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Error listing conversations."}}},"options")}),rr=U.Dropdown({auth:X,displayName:"Bot",required:!0,refreshers:[],options:o(async({auth:e})=>{if(!e)return{disabled:!0,placeholder:"Connect your Cody AI account first.",options:[]};try{let t=await J.listBots(e);return t.length===0?{disabled:!0,options:[],placeholder:"No bots found. Please create one in Cody first."}:{disabled:!1,options:t.map(r=>({label:r.name,value:r.id}))}}catch{return{disabled:!0,options:[],placeholder:"Error listing bots."}}},"options")});var Ns=ee({auth:X,name:"create_document_from_text",displayName:"Create Document From Text",description:"Upload text content to create a new document within the Cody knowledge base.",audience:"both",aiMetadata:{description:"Creates a new document in a Cody knowledge base folder from raw text or HTML content, so the bot can later answer from it. Use when ingesting inline/generated text (not a file upload). Requires a target folder ID and the content (max 768 KB); creates a new document on each call, so it is not idempotent.",idempotent:!1},props:{folder_id:tr,name:U.ShortText({displayName:"Document Name",description:"The name or title of the new document.",required:!0}),content:U.LongText({displayName:"Content",description:"The text or HTML content to be added to the document. Max 768 KB.",required:!0})},async run(e){let{folder_id:t,name:r,content:n}=e.propsValue,i=e.auth;return await J.createDocument(i,r,t,n)}});var Ds=ze(Vr()),Cs=ee({auth:X,name:"upload_file",displayName:"Upload File to Knowledge Base",description:"Add a file directly into a specific folder in the knowledge base.",audience:"both",aiMetadata:{description:"Uploads a binary file (e.g. txt, md, rtf, pdf, ppt, docx) into a Cody knowledge base folder via a signed URL, then registers it as a document. Use when ingesting an existing file rather than inline text. Requires a target folder ID and the file; creates a new document each call, so it is not idempotent.",idempotent:!1},props:{folder_id:tr,file:U.File({displayName:"File",description:"The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).",required:!0})},async run(e){let{folder_id:t,file:r}=e.propsValue,n=e.auth,i=Ds.default.lookup(r.filename)||"application/octet-stream",{url:u,key:p}=await J.getSignedUrl(n,r.filename,i);return await J.uploadFileToS3(u,r.data,i),await J.createDocumentFromFile(n,t,p),{success:!0,message:`File '${r.filename}' uploaded successfully and is being processed.`}}});var Us=ee({auth:X,name:"send_message",displayName:"Send Message",description:"Send your message and receive the AI-generated response.",audience:"both",aiMetadata:{description:"Posts a message to an existing Cody conversation and returns the bot AI-generated reply. Use to query a bot within an already-created conversation thread. Requires the conversation ID and message text (max 2000 characters); each call appends a new message, so it is not idempotent.",idempotent:!1},props:{conversation_id:Rs,content:U.LongText({displayName:"Message",description:"The message to send to the conversation. (Max 2000 characters)",required:!0})},async run(e){let{conversation_id:t,content:r}=e.propsValue,n=e.auth;return await J.sendMessage(n,t,r)}});var Ms=ee({auth:X,name:"create_conversation",displayName:"Create Conversation",description:"Creates a new conversation with a bot.",audience:"both",aiMetadata:{description:"Starts a new conversation thread with a specific Cody bot, returning a conversation ID to use with Send Message. Optionally pass a list of document IDs to scope the bot knowledge base to just those documents (focus mode). Requires a bot ID and a name; creates a new conversation each call, so it is not idempotent.",idempotent:!1},props:{bot_id:rr,name:U.ShortText({displayName:"Conversation Name",description:"The name for the new conversation.",required:!0}),document_ids:U.Array({displayName:"Document IDs (Focus Mode)",description:"A list of document IDs to limit the bot's knowledge base for this conversation.",required:!1})},async run(e){let{bot_id:t,name:r,document_ids:n}=e.propsValue,i=e.auth,u=n;return await J.createConversation(i,t,r,u)}});var js=ee({auth:X,name:"find_bot",displayName:"Find Bot",description:"Finds a bot based on its name.",audience:"both",aiMetadata:{description:"Searches Cody bots by name (case-insensitive partial match) and returns the matches. Use to resolve a bot name to its ID before creating a conversation. This is a read-only lookup and is idempotent.",idempotent:!0},props:{name:U.ShortText({displayName:"Bot Name",description:"The name of the bot to search for. The search is case-insensitive and partial.",required:!0})},async run(e){let{name:t}=e.propsValue,r=e.auth,n=await J.listBots(r,t);return{found:n.length>0,bots:n}}});var Ls=ee({auth:X,name:"find_conversation",displayName:"Find Conversation",description:"Finds a conversation based on its name and/or the bot it belongs to.",audience:"both",aiMetadata:{description:"Searches Cody conversations, filtering by owning bot ID and/or by name (partial match) and returns the matches. Use to resolve an existing conversation to its ID. At least one of bot or name must be provided. This is a read-only lookup and is idempotent.",idempotent:!0},props:{bot_id:{...rr,required:!1},name:U.ShortText({displayName:"Conversation Name",description:"The name of the conversation to search for (partial match).",required:!1})},async run(e){let{bot_id:t,name:r}=e.propsValue,n=e.auth;if(!t&&!r)throw new Error("To find a conversation, please provide a Bot or a Conversation Name to search.");let i=await J.listConversations(n,{botId:t,keyword:r});return{found:i.length>0,conversations:i}}});var X=jr.SecretText({displayName:"API Key",description:"Visit your Cody AI API Keys page to retrieve the API key.",required:!0,validate:o(async({auth:e})=>{if(e)try{return await J.listBots({secret_text:e,type:"SECRET_TEXT"}),{valid:!0}}catch{return{valid:!1,error:"Invalid Api Key"}}return{valid:!1,error:"Invalid Api Key"}},"validate")}),gd=xi({displayName:"Cody",auth:X,minimumSupportedRelease:"0.36.1",logoUrl:"https://cdn.activepieces.com/pieces/cody.png",authors:["Pranith124","sanket-a11y"],actions:[Ns,Cs,Us,Ms,js,Ls,ws({auth:X,baseUrl:o(()=>"https://getcody.ai/api/v1","baseUrl"),authMapping:o(async e=>({Authorization:`Bearer ${e}`}),"authMapping")})],triggers:[]});0&&(module.exports={cody,codyAuth});
4
+ /*! Bundled license information:
5
+
6
+ mime-types/index.js:
7
+ (*!
8
+ * mime-types
9
+ * Copyright(c) 2014 Jonathan Ong
10
+ * Copyright(c) 2015 Douglas Christopher Wilson
11
+ * MIT Licensed
12
+ *)
13
+ */
package/README.md DELETED
@@ -1,7 +0,0 @@
1
- # pieces-cody
2
-
3
- This library was generated with [Nx](https://nx.dev).
4
-
5
- ## Building
6
-
7
- Run `nx build pieces-cody` to build the library.
package/src/index.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const codyAuth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
2
- export declare const cody: import("@activepieces/pieces-framework").Piece<import("@activepieces/pieces-framework").SecretTextProperty<true>>;
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/community/cody/src/index.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,uFAAiF;AACjF,2DAA6D;AAC7D,6DAA+D;AAC/D,2EAA6E;AAC7E,qDAAuD;AACvD,uEAAyE;AACzE,+DAAwE;AACxE,gDAAiD;AACjD,iDAAyD;AAEzD,gEAAgE;AAChE,+EAA+E;AAClE,QAAA,QAAQ,GAAG,4BAAS,CAAC,UAAU,CAAC;IACzC,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,2DAA2D;IACxE,QAAQ,EAAE,IAAI;IACd,QAAQ,EAAE,KAAiB,EAAE,oDAAZ,EAAE,IAAI,EAAE;QACrB,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC;gBACD,MAAM,mBAAU,CAAC,QAAQ,CAAC;oBACtB,WAAW,EAAE,IAAI;oBACjB,IAAI,EAAE,0BAAiB,CAAC,WAAW;iBACtC,CAAC,CAAC;gBACH,OAAO;oBACH,KAAK,EAAE,IAAI;iBACd,CAAA;YACL,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,iBAAiB;iBAC3B,CAAA;YACL,CAAC;QAEL,CAAC;QACD,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,iBAAiB;SAC3B,CAAA;IAEL,CAAC,CAAA;CACJ,CAAC,CAAC;AAEU,QAAA,IAAI,GAAG,IAAA,8BAAW,EAAC;IAC5B,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,gBAAQ;IACd,uBAAuB,EAAE,QAAQ;IACjC,OAAO,EAAE,8CAA8C;IACvD,OAAO,EAAE,CAAE,YAAY,EAAC,aAAa,CAAE;IACvC,OAAO,EAAE;QACL,kDAAsB;QACtB,8BAAgB;QAChB,gCAAiB;QACjB,8CAAwB;QACxB,wBAAa;QACb,0CAAsB;QACtB,IAAA,yCAAyB,EAAC;YACpB,IAAI,EAAE,gBAAQ;YACd,OAAO,EAAE,GAAG,EAAE,CAAC,2BAA2B;YAC1C,WAAW,EAAE,CAAO,IAAI,EAAE,EAAE;gBAAC,OAAA,CAAC;oBAC5B,aAAa,EAAE,UAAU,IAAI,EAAE;iBAChC,CAAC,CAAA;cAAA;SACH,CAAC;KACP;IACH,QAAQ,EAAE;IACN,6BAA6B;KAChC;CACJ,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const createConversationAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- bot_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- document_ids: import("@activepieces/pieces-framework").ArrayProperty<false>;
5
- }>;
@@ -1,36 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createConversationAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- const props_1 = require("../common/props");
9
- exports.createConversationAction = (0, pieces_framework_1.createAction)({
10
- auth: __1.codyAuth,
11
- name: 'create_conversation',
12
- displayName: 'Create Conversation',
13
- description: 'Creates a new conversation with a bot.',
14
- props: {
15
- bot_id: props_1.botIdDropdown,
16
- name: pieces_framework_1.Property.ShortText({
17
- displayName: 'Conversation Name',
18
- description: 'The name for the new conversation.',
19
- required: true,
20
- }),
21
- document_ids: pieces_framework_1.Property.Array({
22
- displayName: 'Document IDs (Focus Mode)',
23
- description: "A list of document IDs to limit the bot's knowledge base for this conversation.",
24
- required: false,
25
- }),
26
- },
27
- run(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- const { bot_id, name, document_ids } = context.propsValue;
30
- const apiKey = context.auth;
31
- const docIds = document_ids;
32
- return yield client_1.codyClient.createConversation(apiKey, bot_id, name, docIds);
33
- });
34
- },
35
- });
36
- //# sourceMappingURL=create-conversation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/create-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAgD;AAEnC,QAAA,wBAAwB,GAAG,IAAA,+BAAY,EAAC;IACnD,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,qBAAqB;IAC3B,WAAW,EAAE,qBAAqB;IAClC,WAAW,EAAE,wCAAwC;IACrD,KAAK,EAAE;QACL,MAAM,EAAE,qBAAa;QACrB,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACvB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,oCAAoC;YACjD,QAAQ,EAAE,IAAI;SACf,CAAC;QACF,YAAY,EAAE,2BAAQ,CAAC,KAAK,CAAC;YAC3B,WAAW,EAAE,2BAA2B;YACxC,WAAW,EACT,iFAAiF;YACnF,QAAQ,EAAE,KAAK;SAChB,CAAC;KACH;IACK,GAAG,CAAC,OAAO;;YACf,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC1D,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,MAAM,MAAM,GAAG,YAAoC,CAAC;YAEpD,OAAO,MAAM,mBAAU,CAAC,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QAC3E,CAAC;KAAA;CACF,CAAC,CAAC"}
@@ -1,5 +0,0 @@
1
- export declare const createDocumentFromText: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
4
- content: import("@activepieces/pieces-framework").LongTextProperty<true>;
5
- }>;
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createDocumentFromText = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- const props_1 = require("../common/props");
9
- exports.createDocumentFromText = (0, pieces_framework_1.createAction)({
10
- auth: __1.codyAuth,
11
- name: 'create_document_from_text',
12
- displayName: 'Create Document From Text',
13
- description: 'Upload text content to create a new document within the Cody knowledge base.',
14
- props: {
15
- folder_id: props_1.folderIdDropdown,
16
- name: pieces_framework_1.Property.ShortText({
17
- displayName: 'Document Name',
18
- description: 'The name or title of the new document.',
19
- required: true,
20
- }),
21
- content: pieces_framework_1.Property.LongText({
22
- displayName: 'Content',
23
- description: 'The text or HTML content to be added to the document. Max 768 KB.',
24
- required: true,
25
- }),
26
- },
27
- run(context) {
28
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
29
- const { folder_id, name, content } = context.propsValue;
30
- const apiKey = context.auth;
31
- return yield client_1.codyClient.createDocument(apiKey, name, folder_id, content);
32
- });
33
- },
34
- });
35
- //# sourceMappingURL=create-document-from-text.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-document-from-text.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/create-document-from-text.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAmD;AAEtC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,2BAA2B;IACjC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,8EAA8E;IAC3F,KAAK,EAAE;QACH,SAAS,EAAE,wBAAgB;QAC3B,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,eAAe;YAC5B,WAAW,EAAE,wCAAwC;YACrD,QAAQ,EAAE,IAAI;SACjB,CAAC;QACF,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,mEAAmE;YAChF,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,OAAO,MAAM,mBAAU,CAAC,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC;QAC7E,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const findBotAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- name: import("@activepieces/pieces-framework").ShortTextProperty<true>;
3
- }>;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findBotAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- exports.findBotAction = (0, pieces_framework_1.createAction)({
9
- auth: __1.codyAuth,
10
- name: 'find_bot',
11
- displayName: 'Find Bot',
12
- description: 'Finds a bot based on its name.',
13
- props: {
14
- name: pieces_framework_1.Property.ShortText({
15
- displayName: 'Bot Name',
16
- description: 'The name of the bot to search for. The search is case-insensitive and partial.',
17
- required: true,
18
- })
19
- },
20
- run(context) {
21
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
22
- const { name } = context.propsValue;
23
- const apiKey = context.auth;
24
- const bots = yield client_1.codyClient.listBots(apiKey, name);
25
- // The API returns an array of matching bots.
26
- // We will return the full array to the user.
27
- return {
28
- found: bots.length > 0,
29
- bots: bots,
30
- };
31
- });
32
- },
33
- });
34
- //# sourceMappingURL=find-bot.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-bot.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/find-bot.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAEjC,QAAA,aAAa,GAAG,IAAA,+BAAY,EAAC;IACtC,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,UAAU;IAChB,WAAW,EAAE,UAAU;IACvB,WAAW,EAAE,gCAAgC;IAC7C,KAAK,EAAE;QACH,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,UAAU;YACvB,WAAW,EAAE,gFAAgF;YAC7F,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACpC,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,MAAM,IAAI,GAAG,MAAM,mBAAU,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;YAErD,6CAA6C;YAC7C,6CAA6C;YAC7C,OAAO;gBACH,KAAK,EAAE,IAAI,CAAC,MAAM,GAAG,CAAC;gBACtB,IAAI,EAAE,IAAI;aACb,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,17 +0,0 @@
1
- export declare const findConversationAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- bot_id: {
3
- required: false;
4
- description?: string | undefined;
5
- displayName: string;
6
- auth: import("@activepieces/pieces-framework").SecretTextProperty<true>;
7
- refreshers: string[];
8
- refreshOnSearch?: boolean;
9
- options: (propsValue: Record<string, unknown> & {
10
- auth?: import("dist/packages/shared/src").SecretTextConnectionValue | undefined;
11
- }, ctx: import("@activepieces/pieces-framework").PropertyContext) => Promise<import("@activepieces/pieces-framework").DropdownState<string>>;
12
- valueSchema: string;
13
- type: import("@activepieces/pieces-framework").PropertyType.DROPDOWN;
14
- defaultValue?: unknown;
15
- };
16
- name: import("@activepieces/pieces-framework").ShortTextProperty<false>;
17
- }>;
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findConversationAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- const props_1 = require("../common/props");
9
- exports.findConversationAction = (0, pieces_framework_1.createAction)({
10
- auth: __1.codyAuth,
11
- name: 'find_conversation',
12
- displayName: 'Find Conversation',
13
- description: 'Finds a conversation based on its name and/or the bot it belongs to.',
14
- props: {
15
- bot_id: Object.assign(Object.assign({}, props_1.botIdDropdown), { required: false }),
16
- name: pieces_framework_1.Property.ShortText({
17
- displayName: 'Conversation Name',
18
- description: 'The name of the conversation to search for (partial match).',
19
- required: false,
20
- })
21
- },
22
- run(context) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- const { bot_id, name } = context.propsValue;
25
- const apiKey = context.auth;
26
- if (!bot_id && !name) {
27
- throw new Error("To find a conversation, please provide a Bot or a Conversation Name to search.");
28
- }
29
- const conversations = yield client_1.codyClient.listConversations(apiKey, {
30
- botId: bot_id,
31
- keyword: name,
32
- });
33
- return {
34
- found: conversations.length > 0,
35
- conversations: conversations,
36
- };
37
- });
38
- },
39
- });
40
- //# sourceMappingURL=find-conversation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"find-conversation.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/find-conversation.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAgD;AAEnC,QAAA,sBAAsB,GAAG,IAAA,+BAAY,EAAC;IAC/C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,mBAAmB;IACzB,WAAW,EAAE,mBAAmB;IAChC,WAAW,EAAE,sEAAsE;IACnF,KAAK,EAAE;QAEH,MAAM,kCACC,qBAAa,KAChB,QAAQ,EAAE,KAAK,GAClB;QACD,IAAI,EAAE,2BAAQ,CAAC,SAAS,CAAC;YACrB,WAAW,EAAE,mBAAmB;YAChC,WAAW,EAAE,6DAA6D;YAC1E,QAAQ,EAAE,KAAK;SAClB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC5C,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,IAAI,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;YACtG,CAAC;YAED,MAAM,aAAa,GAAG,MAAM,mBAAU,CAAC,iBAAiB,CAAC,MAAM,EAAE;gBAC7D,KAAK,EAAE,MAAM;gBACb,OAAO,EAAE,IAAI;aAChB,CAAC,CAAC;YAEH,OAAO;gBACH,KAAK,EAAE,aAAa,CAAC,MAAM,GAAG,CAAC;gBAC/B,aAAa,EAAE,aAAa;aAC/B,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const sendMessageAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- conversation_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- content: import("@activepieces/pieces-framework").LongTextProperty<true>;
4
- }>;
@@ -1,30 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sendMessageAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- const props_1 = require("../common/props");
9
- exports.sendMessageAction = (0, pieces_framework_1.createAction)({
10
- auth: __1.codyAuth,
11
- name: 'send_message',
12
- displayName: 'Send Message',
13
- description: 'Send your message and receive the AI-generated response.',
14
- props: {
15
- conversation_id: props_1.conversationIdDropdown,
16
- content: pieces_framework_1.Property.LongText({
17
- displayName: 'Message',
18
- description: 'The message to send to the conversation. (Max 2000 characters)',
19
- required: true,
20
- }),
21
- },
22
- run(context) {
23
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
24
- const { conversation_id, content } = context.propsValue;
25
- const apiKey = context.auth;
26
- return yield client_1.codyClient.sendMessage(apiKey, conversation_id, content);
27
- });
28
- },
29
- });
30
- //# sourceMappingURL=send-message.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"send-message.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/send-message.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAyD;AAE5C,QAAA,iBAAiB,GAAG,IAAA,+BAAY,EAAC;IAC1C,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,cAAc;IACpB,WAAW,EAAE,cAAc;IAC3B,WAAW,EAAE,0DAA0D;IACvE,KAAK,EAAE;QACH,eAAe,EAAE,8BAAsB;QACvC,OAAO,EAAE,2BAAQ,CAAC,QAAQ,CAAC;YACvB,WAAW,EAAE,SAAS;YACtB,WAAW,EAAE,gEAAgE;YAC7E,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,eAAe,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YACxD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,OAAO,MAAM,mBAAU,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAC;QAC1E,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,4 +0,0 @@
1
- export declare const uploadFileAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").SecretTextProperty<true>, {
2
- folder_id: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- file: import("@activepieces/pieces-framework").FileProperty<true>;
4
- }>;
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadFileAction = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const __1 = require("../..");
7
- const client_1 = require("../common/client");
8
- const props_1 = require("../common/props");
9
- const mime_types_1 = tslib_1.__importDefault(require("mime-types"));
10
- exports.uploadFileAction = (0, pieces_framework_1.createAction)({
11
- auth: __1.codyAuth,
12
- name: 'upload_file',
13
- displayName: 'Upload File to Knowledge Base',
14
- description: 'Add a file directly into a specific folder in the knowledge base.',
15
- props: {
16
- folder_id: props_1.folderIdDropdown,
17
- file: pieces_framework_1.Property.File({
18
- displayName: 'File',
19
- description: 'The file to upload (e.g., txt, md, rtf, pdf, ppt, docx).',
20
- required: true,
21
- })
22
- },
23
- run(context) {
24
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
25
- const { folder_id, file } = context.propsValue;
26
- const apiKey = context.auth;
27
- // Step 1: Determine Content-Type from filename using the mime-types library
28
- const contentType = mime_types_1.default.lookup(file.filename) || 'application/octet-stream';
29
- // Step 2: Get a Signed URL from the Cody API
30
- const { url: signedUrl, key } = yield client_1.codyClient.getSignedUrl(apiKey, file.filename, contentType);
31
- // Step 3: Upload the actual file data to the signed URL
32
- yield client_1.codyClient.uploadFileToS3(signedUrl, file.data, contentType);
33
- // Step 4: Finalize the document creation in Cody
34
- yield client_1.codyClient.createDocumentFromFile(apiKey, folder_id, key);
35
- return {
36
- success: true,
37
- message: `File '${file.filename}' uploaded successfully and is being processed.`
38
- };
39
- });
40
- },
41
- });
42
- //# sourceMappingURL=upload-file.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"upload-file.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/actions/upload-file.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,6BAAiC;AACjC,6CAA8C;AAC9C,2CAAmD;AACnD,oEAA8B;AAEjB,QAAA,gBAAgB,GAAG,IAAA,+BAAY,EAAC;IACzC,IAAI,EAAE,YAAQ;IACd,IAAI,EAAE,aAAa;IACnB,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EAAE,mEAAmE;IAChF,KAAK,EAAE;QACH,SAAS,EAAE,wBAAgB;QAC3B,IAAI,EAAE,2BAAQ,CAAC,IAAI,CAAC;YAChB,WAAW,EAAE,MAAM;YACnB,WAAW,EAAE,0DAA0D;YACvE,QAAQ,EAAE,IAAI;SACjB,CAAC;KACL;IACK,GAAG,CAAC,OAAO;;YACb,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC;YAC/C,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;YAE5B,4EAA4E;YAC5E,MAAM,WAAW,GAAG,oBAAI,CAAC,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,0BAA0B,CAAC;YAE7E,6CAA6C;YAC7C,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,MAAM,mBAAU,CAAC,YAAY,CACzD,MAAM,EACN,IAAI,CAAC,QAAQ,EACb,WAAW,CACd,CAAC;YAEF,wDAAwD;YACxD,MAAM,mBAAU,CAAC,cAAc,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;YAEnE,iDAAiD;YACjD,MAAM,mBAAU,CAAC,sBAAsB,CAAC,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,CAAC;YAEhE,OAAO;gBACH,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE,SAAS,IAAI,CAAC,QAAQ,iDAAiD;aACnF,CAAC;QACN,CAAC;KAAA;CACJ,CAAC,CAAC"}
@@ -1,68 +0,0 @@
1
- import { AppConnectionValueForAuthProperty } from "@activepieces/pieces-framework";
2
- import { codyAuth } from "../..";
3
- export declare const CODY_BASE_URL = "https://getcody.ai/api/v1";
4
- export interface CodyFolder {
5
- id: string;
6
- name: string;
7
- }
8
- export interface CodyListFoldersResponse {
9
- data: CodyFolder[];
10
- }
11
- export interface CodyCreateDocumentResponse {
12
- data: {
13
- id: string;
14
- name: string;
15
- status: string;
16
- content_url: string;
17
- folder_id: string;
18
- created_at: number;
19
- };
20
- }
21
- export interface CodySignedUrlResponse {
22
- data: {
23
- url: string;
24
- key: string;
25
- };
26
- }
27
- export interface CodyConversation {
28
- id: string;
29
- name: string;
30
- }
31
- export interface CodyListConversationsResponse {
32
- data: CodyConversation[];
33
- }
34
- export interface CodyMessageResponse {
35
- data: {
36
- id: string;
37
- content: string;
38
- conversation_id: string;
39
- machine: boolean;
40
- failed_responding: boolean;
41
- flagged: boolean;
42
- created_at: number;
43
- };
44
- }
45
- export interface CodyBot {
46
- id: string;
47
- name: string;
48
- }
49
- export interface CodyListBotsResponse {
50
- data: CodyBot[];
51
- }
52
- export interface CodyCreateConversationResponse {
53
- data: CodyConversation;
54
- }
55
- export declare const codyClient: {
56
- listFolders({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>): Promise<CodyFolder[]>;
57
- createDocument({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, name: string, folderId: string, content: string): Promise<CodyCreateDocumentResponse>;
58
- getSignedUrl({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, fileName: string, contentType: string): Promise<CodySignedUrlResponse["data"]>;
59
- uploadFileToS3(signedUrl: string, fileBuffer: Buffer, contentType: string): Promise<void>;
60
- createDocumentFromFile({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, folderId: string, key: string): Promise<void>;
61
- listConversations({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, params?: {
62
- botId?: string;
63
- keyword?: string;
64
- }): Promise<CodyConversation[]>;
65
- sendMessage({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, conversationId: string, content: string): Promise<CodyMessageResponse>;
66
- listBots({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, keyword?: string): Promise<CodyBot[]>;
67
- createConversation({ secret_text }: AppConnectionValueForAuthProperty<typeof codyAuth>, botId: string, name: string, documentIds?: string[]): Promise<CodyCreateConversationResponse>;
68
- };
@@ -1,166 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.codyClient = exports.CODY_BASE_URL = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_common_1 = require("@activepieces/pieces-common");
6
- exports.CODY_BASE_URL = "https://getcody.ai/api/v1";
7
- exports.codyClient = {
8
- listFolders(_a) {
9
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }) {
10
- const response = yield pieces_common_1.httpClient.sendRequest({
11
- method: pieces_common_1.HttpMethod.GET,
12
- url: `${exports.CODY_BASE_URL}/folders`,
13
- authentication: {
14
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
15
- token: secret_text,
16
- },
17
- });
18
- return response.body.data;
19
- });
20
- },
21
- createDocument(_a, name_1, folderId_1, content_1) {
22
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, name, folderId, content) {
23
- const request = {
24
- method: pieces_common_1.HttpMethod.POST,
25
- url: `${exports.CODY_BASE_URL}/documents`,
26
- authentication: {
27
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
28
- token: secret_text,
29
- },
30
- body: {
31
- name,
32
- folder_id: folderId,
33
- content,
34
- },
35
- };
36
- const response = yield pieces_common_1.httpClient.sendRequest(request);
37
- return response.body;
38
- });
39
- },
40
- // New function to get the signed URL
41
- getSignedUrl(_a, fileName_1, contentType_1) {
42
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, fileName, contentType) {
43
- const response = yield pieces_common_1.httpClient.sendRequest({
44
- method: pieces_common_1.HttpMethod.POST,
45
- url: `${exports.CODY_BASE_URL}/uploads/signed-url`,
46
- authentication: {
47
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
48
- token: secret_text,
49
- },
50
- body: {
51
- file_name: fileName,
52
- content_type: contentType
53
- }
54
- });
55
- return response.body.data;
56
- });
57
- },
58
- // New function to upload the file buffer to S3
59
- uploadFileToS3(signedUrl, fileBuffer, contentType) {
60
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
61
- yield pieces_common_1.httpClient.sendRequest({
62
- method: pieces_common_1.HttpMethod.PUT,
63
- url: signedUrl,
64
- body: fileBuffer,
65
- headers: {
66
- 'Content-Type': contentType,
67
- },
68
- });
69
- });
70
- },
71
- // New function to finalize the document creation
72
- createDocumentFromFile(_a, folderId_1, key_1) {
73
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, folderId, key) {
74
- yield pieces_common_1.httpClient.sendRequest({
75
- method: pieces_common_1.HttpMethod.POST,
76
- // This endpoint was in your first documentation dump.
77
- url: `${exports.CODY_BASE_URL}/documents/file`,
78
- authentication: {
79
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
80
- token: secret_text,
81
- },
82
- body: {
83
- folder_id: folderId,
84
- key: key,
85
- },
86
- });
87
- });
88
- },
89
- listConversations(_a, params_1) {
90
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, params) {
91
- const queryParams = {};
92
- if (params === null || params === void 0 ? void 0 : params.botId) {
93
- queryParams['bot_id'] = params.botId;
94
- }
95
- if (params === null || params === void 0 ? void 0 : params.keyword) {
96
- queryParams['keyword'] = params.keyword;
97
- }
98
- const response = yield pieces_common_1.httpClient.sendRequest({
99
- method: pieces_common_1.HttpMethod.GET,
100
- url: `${exports.CODY_BASE_URL}/conversations`,
101
- queryParams: queryParams,
102
- authentication: {
103
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
104
- token: secret_text,
105
- },
106
- });
107
- return response.body.data;
108
- });
109
- },
110
- // New function to send a message
111
- sendMessage(_a, conversationId_1, content_1) {
112
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, conversationId, content) {
113
- const response = yield pieces_common_1.httpClient.sendRequest({
114
- method: pieces_common_1.HttpMethod.POST,
115
- url: `${exports.CODY_BASE_URL}/messages`,
116
- authentication: {
117
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
118
- token: secret_text,
119
- },
120
- body: {
121
- conversation_id: conversationId,
122
- content: content,
123
- }
124
- });
125
- return response.body;
126
- });
127
- },
128
- listBots(_a, keyword_1) {
129
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, keyword) {
130
- const queryParams = {};
131
- if (keyword) {
132
- queryParams['keyword'] = keyword;
133
- }
134
- const response = yield pieces_common_1.httpClient.sendRequest({
135
- method: pieces_common_1.HttpMethod.GET,
136
- url: `${exports.CODY_BASE_URL}/bots`,
137
- queryParams: queryParams, // Add queryParams to the request
138
- authentication: {
139
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
140
- token: secret_text,
141
- },
142
- });
143
- return response.body.data;
144
- });
145
- },
146
- // New function to create a conversation
147
- createConversation(_a, botId_1, name_1, documentIds_1) {
148
- return tslib_1.__awaiter(this, arguments, void 0, function* ({ secret_text }, botId, name, documentIds) {
149
- const response = yield pieces_common_1.httpClient.sendRequest({
150
- method: pieces_common_1.HttpMethod.POST,
151
- url: `${exports.CODY_BASE_URL}/conversations`,
152
- authentication: {
153
- type: pieces_common_1.AuthenticationType.BEARER_TOKEN,
154
- token: secret_text,
155
- },
156
- body: {
157
- bot_id: botId,
158
- name: name,
159
- document_ids: documentIds,
160
- }
161
- });
162
- return response.body;
163
- });
164
- },
165
- };
166
- //# sourceMappingURL=client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/client.ts"],"names":[],"mappings":"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"}
@@ -1,3 +0,0 @@
1
- export declare const folderIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
2
- export declare const conversationIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
3
- export declare const botIdDropdown: import("@activepieces/pieces-framework").DropdownProperty<string, true, import("@activepieces/pieces-framework").SecretTextProperty<true>>;
@@ -1,127 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.botIdDropdown = exports.conversationIdDropdown = exports.folderIdDropdown = void 0;
4
- const tslib_1 = require("tslib");
5
- const pieces_framework_1 = require("@activepieces/pieces-framework");
6
- const client_1 = require("./client");
7
- const __1 = require("../..");
8
- exports.folderIdDropdown = pieces_framework_1.Property.Dropdown({
9
- auth: __1.codyAuth,
10
- displayName: 'Folder',
11
- required: true,
12
- refreshers: [],
13
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
14
- if (!auth) {
15
- return {
16
- disabled: true,
17
- placeholder: 'Connect your Cody AI account first.',
18
- options: [],
19
- };
20
- }
21
- try {
22
- // Note: Comment removed as the endpoint is now confirmed.
23
- const folders = yield client_1.codyClient.listFolders(auth);
24
- if (folders.length === 0) {
25
- return {
26
- disabled: true,
27
- options: [],
28
- placeholder: "No folders found. Please create a folder in Cody first.",
29
- };
30
- }
31
- return {
32
- disabled: false,
33
- options: folders.map((folder) => ({
34
- label: folder.name,
35
- value: folder.id,
36
- })),
37
- };
38
- }
39
- catch (error) {
40
- return {
41
- disabled: true,
42
- options: [],
43
- placeholder: "Error listing folders. Check connection or API key permissions.",
44
- };
45
- }
46
- }),
47
- });
48
- exports.conversationIdDropdown = pieces_framework_1.Property.Dropdown({
49
- displayName: 'Conversation',
50
- auth: __1.codyAuth,
51
- required: true,
52
- refreshers: [],
53
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
54
- if (!auth) {
55
- return {
56
- disabled: true,
57
- placeholder: 'Connect your Cody AI account first.',
58
- options: [],
59
- };
60
- }
61
- try {
62
- const conversations = yield client_1.codyClient.listConversations(auth);
63
- if (conversations.length === 0) {
64
- return {
65
- disabled: true,
66
- options: [],
67
- placeholder: "No conversations found. Please create one in Cody first.",
68
- };
69
- }
70
- return {
71
- disabled: false,
72
- options: conversations.map((convo) => ({
73
- label: convo.name,
74
- value: convo.id,
75
- })),
76
- };
77
- }
78
- catch (error) {
79
- return {
80
- disabled: true,
81
- options: [],
82
- placeholder: "Error listing conversations.",
83
- };
84
- }
85
- }),
86
- });
87
- // Add the new dropdown for bots
88
- exports.botIdDropdown = pieces_framework_1.Property.Dropdown({
89
- auth: __1.codyAuth,
90
- displayName: 'Bot',
91
- required: true,
92
- refreshers: [],
93
- options: (_a) => tslib_1.__awaiter(void 0, [_a], void 0, function* ({ auth }) {
94
- if (!auth) {
95
- return {
96
- disabled: true,
97
- placeholder: 'Connect your Cody AI account first.',
98
- options: [],
99
- };
100
- }
101
- try {
102
- const bots = yield client_1.codyClient.listBots(auth);
103
- if (bots.length === 0) {
104
- return {
105
- disabled: true,
106
- options: [],
107
- placeholder: "No bots found. Please create one in Cody first.",
108
- };
109
- }
110
- return {
111
- disabled: false,
112
- options: bots.map((bot) => ({
113
- label: bot.name,
114
- value: bot.id,
115
- })),
116
- };
117
- }
118
- catch (error) {
119
- return {
120
- disabled: true,
121
- options: [],
122
- placeholder: "Error listing bots.",
123
- };
124
- }
125
- }),
126
- });
127
- //# sourceMappingURL=props.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"props.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/cody/src/lib/common/props.ts"],"names":[],"mappings":"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"}