@vm0/cli 9.81.0 → 9.82.1
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/{chunk-3EOIDO3I.js → chunk-2KN52BP2.js} +402 -85
- package/chunk-2KN52BP2.js.map +1 -0
- package/index.js +10 -10
- package/package.json +1 -1
- package/zero.js +132 -102
- package/zero.js.map +1 -1
- package/chunk-3EOIDO3I.js.map +0 -1
|
@@ -47,7 +47,7 @@ if (DSN) {
|
|
|
47
47
|
Sentry.init({
|
|
48
48
|
dsn: DSN,
|
|
49
49
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
50
|
-
release: "9.
|
|
50
|
+
release: "9.82.1",
|
|
51
51
|
sendDefaultPii: false,
|
|
52
52
|
tracesSampleRate: 0,
|
|
53
53
|
shutdownTimeout: 500,
|
|
@@ -66,7 +66,7 @@ if (DSN) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Sentry.setContext("cli", {
|
|
69
|
-
version: "9.
|
|
69
|
+
version: "9.82.1",
|
|
70
70
|
command: process.argv.slice(2).join(" ")
|
|
71
71
|
});
|
|
72
72
|
Sentry.setContext("runtime", {
|
|
@@ -139,6 +139,27 @@ function configureGlobalProxyFromEnv() {
|
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
|
|
142
|
+
// src/lib/api/zero-token.ts
|
|
143
|
+
function decodeZeroTokenPayload(token) {
|
|
144
|
+
const raw = token ?? process.env.ZERO_TOKEN;
|
|
145
|
+
if (!raw) return void 0;
|
|
146
|
+
const prefix = "vm0_sandbox_";
|
|
147
|
+
if (!raw.startsWith(prefix)) return void 0;
|
|
148
|
+
const jwt = raw.slice(prefix.length);
|
|
149
|
+
const parts = jwt.split(".");
|
|
150
|
+
if (parts.length !== 3) return void 0;
|
|
151
|
+
try {
|
|
152
|
+
const payload = JSON.parse(
|
|
153
|
+
Buffer.from(parts[1], "base64url").toString()
|
|
154
|
+
);
|
|
155
|
+
if (payload.scope === "zero" && Array.isArray(payload.capabilities)) {
|
|
156
|
+
return payload;
|
|
157
|
+
}
|
|
158
|
+
} catch {
|
|
159
|
+
}
|
|
160
|
+
return void 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
142
163
|
// src/lib/api/config.ts
|
|
143
164
|
import { homedir } from "os";
|
|
144
165
|
import { join } from "path";
|
|
@@ -187,23 +208,6 @@ async function getApiUrl() {
|
|
|
187
208
|
}
|
|
188
209
|
return config.apiUrl ?? "https://www.vm0.ai";
|
|
189
210
|
}
|
|
190
|
-
function decodeZeroTokenPayload() {
|
|
191
|
-
const token = process.env.ZERO_TOKEN;
|
|
192
|
-
if (!token) return void 0;
|
|
193
|
-
const prefix = "vm0_sandbox_";
|
|
194
|
-
if (!token.startsWith(prefix)) return void 0;
|
|
195
|
-
const jwt = token.slice(prefix.length);
|
|
196
|
-
const parts = jwt.split(".");
|
|
197
|
-
if (parts.length !== 3) return void 0;
|
|
198
|
-
try {
|
|
199
|
-
const payload = JSON.parse(
|
|
200
|
-
Buffer.from(parts[1], "base64url").toString()
|
|
201
|
-
);
|
|
202
|
-
if (payload.scope === "zero") return payload;
|
|
203
|
-
} catch {
|
|
204
|
-
}
|
|
205
|
-
return void 0;
|
|
206
|
-
}
|
|
207
211
|
async function getActiveOrg() {
|
|
208
212
|
const zeroPayload = decodeZeroTokenPayload();
|
|
209
213
|
if (zeroPayload) return zeroPayload.orgId;
|
|
@@ -1717,6 +1721,32 @@ var firefliesFirewall = {
|
|
|
1717
1721
|
]
|
|
1718
1722
|
};
|
|
1719
1723
|
|
|
1724
|
+
// ../../packages/core/src/firewalls/garmin-connect.generated.ts
|
|
1725
|
+
var garminConnectFirewall = {
|
|
1726
|
+
name: "garmin-connect",
|
|
1727
|
+
description: "Garmin Connect API",
|
|
1728
|
+
placeholders: {
|
|
1729
|
+
GARMIN_CONNECT_TOKEN: "vm0placeholderGarminConnectToken000000000000000000000a"
|
|
1730
|
+
},
|
|
1731
|
+
apis: [
|
|
1732
|
+
{
|
|
1733
|
+
base: "https://apis.garmin.com",
|
|
1734
|
+
auth: {
|
|
1735
|
+
headers: {
|
|
1736
|
+
Authorization: "Bearer ${{ secrets.GARMIN_CONNECT_TOKEN }}"
|
|
1737
|
+
}
|
|
1738
|
+
},
|
|
1739
|
+
permissions: [
|
|
1740
|
+
{
|
|
1741
|
+
name: "unrestricted",
|
|
1742
|
+
description: "Allow all Garmin Connect API endpoints",
|
|
1743
|
+
rules: ["ANY /{path*}"]
|
|
1744
|
+
}
|
|
1745
|
+
]
|
|
1746
|
+
}
|
|
1747
|
+
]
|
|
1748
|
+
};
|
|
1749
|
+
|
|
1720
1750
|
// ../../packages/core/src/firewalls/github.generated.ts
|
|
1721
1751
|
var githubFirewall = {
|
|
1722
1752
|
name: "github",
|
|
@@ -5407,6 +5437,32 @@ var intercomFirewall = {
|
|
|
5407
5437
|
]
|
|
5408
5438
|
};
|
|
5409
5439
|
|
|
5440
|
+
// ../../packages/core/src/firewalls/intervals-icu.generated.ts
|
|
5441
|
+
var intervalsIcuFirewall = {
|
|
5442
|
+
name: "intervals-icu",
|
|
5443
|
+
description: "Intervals.icu Training API",
|
|
5444
|
+
placeholders: {
|
|
5445
|
+
INTERVALS_ICU_TOKEN: "vm0placeholderIntervalsIcuToken0000000000000000000000a"
|
|
5446
|
+
},
|
|
5447
|
+
apis: [
|
|
5448
|
+
{
|
|
5449
|
+
base: "https://intervals.icu",
|
|
5450
|
+
auth: {
|
|
5451
|
+
headers: {
|
|
5452
|
+
Authorization: "Bearer ${{ secrets.INTERVALS_ICU_TOKEN }}"
|
|
5453
|
+
}
|
|
5454
|
+
},
|
|
5455
|
+
permissions: [
|
|
5456
|
+
{
|
|
5457
|
+
name: "unrestricted",
|
|
5458
|
+
description: "Allow all Intervals.icu API endpoints",
|
|
5459
|
+
rules: ["ANY /{path*}"]
|
|
5460
|
+
}
|
|
5461
|
+
]
|
|
5462
|
+
}
|
|
5463
|
+
]
|
|
5464
|
+
};
|
|
5465
|
+
|
|
5410
5466
|
// ../../packages/core/src/firewalls/jira.generated.ts
|
|
5411
5467
|
var jiraFirewall = {
|
|
5412
5468
|
name: "jira",
|
|
@@ -6241,6 +6297,32 @@ var loopsFirewall = {
|
|
|
6241
6297
|
]
|
|
6242
6298
|
};
|
|
6243
6299
|
|
|
6300
|
+
// ../../packages/core/src/firewalls/mailsac.generated.ts
|
|
6301
|
+
var mailsacFirewall = {
|
|
6302
|
+
name: "mailsac",
|
|
6303
|
+
description: "Mailsac Email API",
|
|
6304
|
+
placeholders: {
|
|
6305
|
+
MAILSAC_TOKEN: "vm0placeholderMailsacToken0000000000000000000000000000a"
|
|
6306
|
+
},
|
|
6307
|
+
apis: [
|
|
6308
|
+
{
|
|
6309
|
+
base: "https://mailsac.com",
|
|
6310
|
+
auth: {
|
|
6311
|
+
headers: {
|
|
6312
|
+
"Mailsac-Key": "${{ secrets.MAILSAC_TOKEN }}"
|
|
6313
|
+
}
|
|
6314
|
+
},
|
|
6315
|
+
permissions: [
|
|
6316
|
+
{
|
|
6317
|
+
name: "unrestricted",
|
|
6318
|
+
description: "Allow all Mailsac API endpoints",
|
|
6319
|
+
rules: ["ANY /{path*}"]
|
|
6320
|
+
}
|
|
6321
|
+
]
|
|
6322
|
+
}
|
|
6323
|
+
]
|
|
6324
|
+
};
|
|
6325
|
+
|
|
6244
6326
|
// ../../packages/core/src/firewalls/mercury.generated.ts
|
|
6245
6327
|
var mercuryFirewall = {
|
|
6246
6328
|
name: "mercury",
|
|
@@ -6464,6 +6546,32 @@ var openaiFirewall = {
|
|
|
6464
6546
|
]
|
|
6465
6547
|
};
|
|
6466
6548
|
|
|
6549
|
+
// ../../packages/core/src/firewalls/pdf4me.generated.ts
|
|
6550
|
+
var pdf4meFirewall = {
|
|
6551
|
+
name: "pdf4me",
|
|
6552
|
+
description: "PDF4me Document API",
|
|
6553
|
+
placeholders: {
|
|
6554
|
+
PDF4ME_TOKEN: "vm0placeholderPdf4meToken000000000000000000000000000a"
|
|
6555
|
+
},
|
|
6556
|
+
apis: [
|
|
6557
|
+
{
|
|
6558
|
+
base: "https://api.pdf4me.com",
|
|
6559
|
+
auth: {
|
|
6560
|
+
headers: {
|
|
6561
|
+
Authorization: "${{ secrets.PDF4ME_TOKEN }}"
|
|
6562
|
+
}
|
|
6563
|
+
},
|
|
6564
|
+
permissions: [
|
|
6565
|
+
{
|
|
6566
|
+
name: "unrestricted",
|
|
6567
|
+
description: "Allow all PDF4me API endpoints",
|
|
6568
|
+
rules: ["ANY /{path*}"]
|
|
6569
|
+
}
|
|
6570
|
+
]
|
|
6571
|
+
}
|
|
6572
|
+
]
|
|
6573
|
+
};
|
|
6574
|
+
|
|
6467
6575
|
// ../../packages/core/src/firewalls/pdfco.generated.ts
|
|
6468
6576
|
var pdfcoFirewall = {
|
|
6469
6577
|
name: "pdfco",
|
|
@@ -6490,6 +6598,32 @@ var pdfcoFirewall = {
|
|
|
6490
6598
|
]
|
|
6491
6599
|
};
|
|
6492
6600
|
|
|
6601
|
+
// ../../packages/core/src/firewalls/pdforge.generated.ts
|
|
6602
|
+
var pdforgeFirewall = {
|
|
6603
|
+
name: "pdforge",
|
|
6604
|
+
description: "PDForge PDF Generation API",
|
|
6605
|
+
placeholders: {
|
|
6606
|
+
PDFORGE_API_KEY: "vm0placeholderPdforgeApiKey00000000000000000000000000a"
|
|
6607
|
+
},
|
|
6608
|
+
apis: [
|
|
6609
|
+
{
|
|
6610
|
+
base: "https://api.pdforge.com",
|
|
6611
|
+
auth: {
|
|
6612
|
+
headers: {
|
|
6613
|
+
Authorization: "Bearer ${{ secrets.PDFORGE_API_KEY }}"
|
|
6614
|
+
}
|
|
6615
|
+
},
|
|
6616
|
+
permissions: [
|
|
6617
|
+
{
|
|
6618
|
+
name: "unrestricted",
|
|
6619
|
+
description: "Allow all PDForge API endpoints",
|
|
6620
|
+
rules: ["ANY /{path*}"]
|
|
6621
|
+
}
|
|
6622
|
+
]
|
|
6623
|
+
}
|
|
6624
|
+
]
|
|
6625
|
+
};
|
|
6626
|
+
|
|
6493
6627
|
// ../../packages/core/src/firewalls/perplexity.generated.ts
|
|
6494
6628
|
var perplexityFirewall = {
|
|
6495
6629
|
name: "perplexity",
|
|
@@ -6542,6 +6676,32 @@ var plausibleFirewall = {
|
|
|
6542
6676
|
]
|
|
6543
6677
|
};
|
|
6544
6678
|
|
|
6679
|
+
// ../../packages/core/src/firewalls/podchaser.generated.ts
|
|
6680
|
+
var podchaserFirewall = {
|
|
6681
|
+
name: "podchaser",
|
|
6682
|
+
description: "Podchaser Podcast API",
|
|
6683
|
+
placeholders: {
|
|
6684
|
+
PODCHASER_TOKEN: "vm0placeholderPodchaserToken00000000000000000000000000a"
|
|
6685
|
+
},
|
|
6686
|
+
apis: [
|
|
6687
|
+
{
|
|
6688
|
+
base: "https://api.podchaser.com",
|
|
6689
|
+
auth: {
|
|
6690
|
+
headers: {
|
|
6691
|
+
Authorization: "Bearer ${{ secrets.PODCHASER_TOKEN }}"
|
|
6692
|
+
}
|
|
6693
|
+
},
|
|
6694
|
+
permissions: [
|
|
6695
|
+
{
|
|
6696
|
+
name: "unrestricted",
|
|
6697
|
+
description: "Allow all Podchaser API endpoints",
|
|
6698
|
+
rules: ["ANY /{path*}"]
|
|
6699
|
+
}
|
|
6700
|
+
]
|
|
6701
|
+
}
|
|
6702
|
+
]
|
|
6703
|
+
};
|
|
6704
|
+
|
|
6545
6705
|
// ../../packages/core/src/firewalls/posthog.generated.ts
|
|
6546
6706
|
var posthogFirewall = {
|
|
6547
6707
|
name: "posthog",
|
|
@@ -6583,6 +6743,32 @@ var posthogFirewall = {
|
|
|
6583
6743
|
]
|
|
6584
6744
|
};
|
|
6585
6745
|
|
|
6746
|
+
// ../../packages/core/src/firewalls/productlane.generated.ts
|
|
6747
|
+
var productlaneFirewall = {
|
|
6748
|
+
name: "productlane",
|
|
6749
|
+
description: "Productlane API",
|
|
6750
|
+
placeholders: {
|
|
6751
|
+
PRODUCTLANE_TOKEN: "vm0placeholderProductlaneToken0000000000000000000000a"
|
|
6752
|
+
},
|
|
6753
|
+
apis: [
|
|
6754
|
+
{
|
|
6755
|
+
base: "https://productlane.com",
|
|
6756
|
+
auth: {
|
|
6757
|
+
headers: {
|
|
6758
|
+
Authorization: "Bearer ${{ secrets.PRODUCTLANE_TOKEN }}"
|
|
6759
|
+
}
|
|
6760
|
+
},
|
|
6761
|
+
permissions: [
|
|
6762
|
+
{
|
|
6763
|
+
name: "unrestricted",
|
|
6764
|
+
description: "Allow all Productlane API endpoints",
|
|
6765
|
+
rules: ["ANY /{path*}"]
|
|
6766
|
+
}
|
|
6767
|
+
]
|
|
6768
|
+
}
|
|
6769
|
+
]
|
|
6770
|
+
};
|
|
6771
|
+
|
|
6586
6772
|
// ../../packages/core/src/firewalls/pushinator.generated.ts
|
|
6587
6773
|
var pushinatorFirewall = {
|
|
6588
6774
|
name: "pushinator",
|
|
@@ -6661,6 +6847,32 @@ var redditFirewall = {
|
|
|
6661
6847
|
]
|
|
6662
6848
|
};
|
|
6663
6849
|
|
|
6850
|
+
// ../../packages/core/src/firewalls/reportei.generated.ts
|
|
6851
|
+
var reporteiFirewall = {
|
|
6852
|
+
name: "reportei",
|
|
6853
|
+
description: "Reportei API",
|
|
6854
|
+
placeholders: {
|
|
6855
|
+
REPORTEI_TOKEN: "vm0placeholderReporteiToken00000000000000000000000000a"
|
|
6856
|
+
},
|
|
6857
|
+
apis: [
|
|
6858
|
+
{
|
|
6859
|
+
base: "https://app.reportei.com",
|
|
6860
|
+
auth: {
|
|
6861
|
+
headers: {
|
|
6862
|
+
Authorization: "Bearer ${{ secrets.REPORTEI_TOKEN }}"
|
|
6863
|
+
}
|
|
6864
|
+
},
|
|
6865
|
+
permissions: [
|
|
6866
|
+
{
|
|
6867
|
+
name: "unrestricted",
|
|
6868
|
+
description: "Allow all Reportei API endpoints",
|
|
6869
|
+
rules: ["ANY /{path*}"]
|
|
6870
|
+
}
|
|
6871
|
+
]
|
|
6872
|
+
}
|
|
6873
|
+
]
|
|
6874
|
+
};
|
|
6875
|
+
|
|
6664
6876
|
// ../../packages/core/src/firewalls/resend.generated.ts
|
|
6665
6877
|
var resendFirewall = {
|
|
6666
6878
|
name: "resend",
|
|
@@ -8554,14 +8766,14 @@ var xFirewall = {
|
|
|
8554
8766
|
name: "x",
|
|
8555
8767
|
description: "X (Twitter) API",
|
|
8556
8768
|
placeholders: {
|
|
8557
|
-
|
|
8769
|
+
X_TOKEN: "AAAAAAAAAAAAAAAAAAAAAAVm0PlaceHolder0000000000000000000000000000000000000000000000000000000000000000000000"
|
|
8558
8770
|
},
|
|
8559
8771
|
apis: [
|
|
8560
8772
|
{
|
|
8561
8773
|
base: "https://api.x.com",
|
|
8562
8774
|
auth: {
|
|
8563
8775
|
headers: {
|
|
8564
|
-
Authorization: "Bearer ${{ secrets.
|
|
8776
|
+
Authorization: "Bearer ${{ secrets.X_TOKEN }}"
|
|
8565
8777
|
}
|
|
8566
8778
|
},
|
|
8567
8779
|
permissions: [
|
|
@@ -8738,6 +8950,7 @@ var builtinFirewalls = {
|
|
|
8738
8950
|
figma: figmaFirewall,
|
|
8739
8951
|
firecrawl: firecrawlFirewall,
|
|
8740
8952
|
fireflies: firefliesFirewall,
|
|
8953
|
+
"garmin-connect": garminConnectFirewall,
|
|
8741
8954
|
github: githubFirewall,
|
|
8742
8955
|
gitlab: gitlabFirewall,
|
|
8743
8956
|
gmail: gmailFirewall,
|
|
@@ -8753,25 +8966,32 @@ var builtinFirewalls = {
|
|
|
8753
8966
|
imgur: imgurFirewall,
|
|
8754
8967
|
instantly: instantlyFirewall,
|
|
8755
8968
|
intercom: intercomFirewall,
|
|
8969
|
+
"intervals-icu": intervalsIcuFirewall,
|
|
8756
8970
|
jira: jiraFirewall,
|
|
8757
8971
|
jotform: jotformFirewall,
|
|
8758
8972
|
lark: larkFirewall,
|
|
8759
8973
|
line: lineFirewall,
|
|
8760
8974
|
linear: linearFirewall,
|
|
8761
8975
|
loops: loopsFirewall,
|
|
8976
|
+
mailsac: mailsacFirewall,
|
|
8762
8977
|
mercury: mercuryFirewall,
|
|
8763
8978
|
minimax: minimaxFirewall,
|
|
8764
8979
|
monday: mondayFirewall,
|
|
8765
8980
|
neon: neonFirewall,
|
|
8766
8981
|
notion: notionFirewall,
|
|
8767
8982
|
openai: openaiFirewall,
|
|
8983
|
+
pdf4me: pdf4meFirewall,
|
|
8768
8984
|
pdfco: pdfcoFirewall,
|
|
8985
|
+
pdforge: pdforgeFirewall,
|
|
8769
8986
|
perplexity: perplexityFirewall,
|
|
8770
8987
|
plausible: plausibleFirewall,
|
|
8988
|
+
podchaser: podchaserFirewall,
|
|
8771
8989
|
posthog: posthogFirewall,
|
|
8990
|
+
productlane: productlaneFirewall,
|
|
8772
8991
|
pushinator: pushinatorFirewall,
|
|
8773
8992
|
qiita: qiitaFirewall,
|
|
8774
8993
|
reddit: redditFirewall,
|
|
8994
|
+
reportei: reporteiFirewall,
|
|
8775
8995
|
resend: resendFirewall,
|
|
8776
8996
|
revenuecat: revenuecatFirewall,
|
|
8777
8997
|
runway: runwayFirewall,
|
|
@@ -11567,8 +11787,6 @@ var storedExecutionContextSchema = z19.object({
|
|
|
11567
11787
|
apiStartTime: z19.number().optional(),
|
|
11568
11788
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
11569
11789
|
userTimezone: z19.string().optional(),
|
|
11570
|
-
// Org slug for agent — used for VM0_ACTIVE_ORG
|
|
11571
|
-
agentOrgSlug: z19.string().optional(),
|
|
11572
11790
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
11573
11791
|
memoryName: z19.string().optional(),
|
|
11574
11792
|
// Experimental firewall for proxy-side token replacement
|
|
@@ -11607,8 +11825,6 @@ var executionContextSchema = z19.object({
|
|
|
11607
11825
|
apiStartTime: z19.number().optional(),
|
|
11608
11826
|
// User's timezone preference (IANA format, e.g., "Asia/Shanghai")
|
|
11609
11827
|
userTimezone: z19.string().optional(),
|
|
11610
|
-
// Org slug for agent — used for VM0_ACTIVE_ORG
|
|
11611
|
-
agentOrgSlug: z19.string().optional(),
|
|
11612
11828
|
// Memory storage name (for first-run when manifest.memory is null)
|
|
11613
11829
|
memoryName: z19.string().optional(),
|
|
11614
11830
|
// Experimental firewall for proxy-side token replacement
|
|
@@ -12948,9 +13164,55 @@ var CONNECTOR_TYPES_DEF = {
|
|
|
12948
13164
|
oauth: {
|
|
12949
13165
|
authorizationUrl: "https://twitter.com/i/oauth2/authorize",
|
|
12950
13166
|
tokenUrl: "https://api.twitter.com/2/oauth2/token",
|
|
12951
|
-
|
|
13167
|
+
// https://docs.x.com/fundamentals/authentication/oauth-2-0/authorization-code
|
|
13168
|
+
scopes: [
|
|
13169
|
+
"tweet.read",
|
|
13170
|
+
// All the Tweets you can view, including Tweets from protected accounts.
|
|
13171
|
+
"tweet.write",
|
|
13172
|
+
// Tweet and Retweet for you.
|
|
13173
|
+
"tweet.moderate.write",
|
|
13174
|
+
// Hide and unhide replies to your Tweets.
|
|
13175
|
+
"users.email",
|
|
13176
|
+
// Email from an authenticated user.
|
|
13177
|
+
"users.read",
|
|
13178
|
+
// Any account you can view, including protected accounts.
|
|
13179
|
+
"follows.read",
|
|
13180
|
+
// People who follow you and people who you follow.
|
|
13181
|
+
"follows.write",
|
|
13182
|
+
// Follow and unfollow people for you.
|
|
13183
|
+
"offline.access",
|
|
13184
|
+
// Stay connected to your account until you revoke access.
|
|
13185
|
+
"space.read",
|
|
13186
|
+
// All the Spaces you can view.
|
|
13187
|
+
"mute.read",
|
|
13188
|
+
// Accounts you've muted.
|
|
13189
|
+
"mute.write",
|
|
13190
|
+
// Mute and unmute accounts for you.
|
|
13191
|
+
"like.read",
|
|
13192
|
+
// Tweets you've liked and likes you can view.
|
|
13193
|
+
"like.write",
|
|
13194
|
+
// Like and un-like Tweets for you.
|
|
13195
|
+
"list.read",
|
|
13196
|
+
// Lists, list members, and list followers of lists you've created or are a member of, including private lists.
|
|
13197
|
+
"list.write",
|
|
13198
|
+
// Create and manage Lists for you.
|
|
13199
|
+
"block.read",
|
|
13200
|
+
// Accounts you've blocked.
|
|
13201
|
+
"block.write",
|
|
13202
|
+
// Block and unblock accounts for you.
|
|
13203
|
+
"bookmark.read",
|
|
13204
|
+
// Get Bookmarked Tweets from an authenticated user.
|
|
13205
|
+
"bookmark.write",
|
|
13206
|
+
// Bookmark and remove Bookmarks from Tweets.
|
|
13207
|
+
"dm.read",
|
|
13208
|
+
// All the Direct Messages you can view, including Direct Messages from protected accounts.
|
|
13209
|
+
"dm.write",
|
|
13210
|
+
// Send and manage Direct Messages for you.
|
|
13211
|
+
"media.write"
|
|
13212
|
+
// Upload media.
|
|
13213
|
+
],
|
|
12952
13214
|
environmentMapping: {
|
|
12953
|
-
|
|
13215
|
+
X_TOKEN: "$secrets.X_ACCESS_TOKEN"
|
|
12954
13216
|
}
|
|
12955
13217
|
}
|
|
12956
13218
|
},
|
|
@@ -14941,19 +15203,15 @@ var c14 = initContract();
|
|
|
14941
15203
|
var sendModeSchema = z22.enum(["enter", "cmd-enter"]);
|
|
14942
15204
|
var userPreferencesResponseSchema = z22.object({
|
|
14943
15205
|
timezone: z22.string().nullable(),
|
|
14944
|
-
notifyEmail: z22.boolean(),
|
|
14945
|
-
notifySlack: z22.boolean(),
|
|
14946
15206
|
pinnedAgentIds: z22.array(z22.string()),
|
|
14947
15207
|
sendMode: sendModeSchema
|
|
14948
15208
|
});
|
|
14949
15209
|
var updateUserPreferencesRequestSchema = z22.object({
|
|
14950
15210
|
timezone: z22.string().min(1).optional(),
|
|
14951
|
-
notifyEmail: z22.boolean().optional(),
|
|
14952
|
-
notifySlack: z22.boolean().optional(),
|
|
14953
15211
|
pinnedAgentIds: z22.array(z22.string()).optional(),
|
|
14954
15212
|
sendMode: sendModeSchema.optional()
|
|
14955
15213
|
}).refine(
|
|
14956
|
-
(data) => data.timezone !== void 0 || data.
|
|
15214
|
+
(data) => data.timezone !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0,
|
|
14957
15215
|
{
|
|
14958
15216
|
message: "At least one preference must be provided"
|
|
14959
15217
|
}
|
|
@@ -15098,6 +15356,7 @@ var zeroAgentsMainContract = c17.router({
|
|
|
15098
15356
|
201: zeroAgentResponseSchema,
|
|
15099
15357
|
400: apiErrorSchema,
|
|
15100
15358
|
401: apiErrorSchema,
|
|
15359
|
+
403: apiErrorSchema,
|
|
15101
15360
|
422: apiErrorSchema
|
|
15102
15361
|
},
|
|
15103
15362
|
summary: "Create zero agent"
|
|
@@ -15108,7 +15367,8 @@ var zeroAgentsMainContract = c17.router({
|
|
|
15108
15367
|
headers: authHeadersSchema,
|
|
15109
15368
|
responses: {
|
|
15110
15369
|
200: z26.array(zeroAgentResponseSchema),
|
|
15111
|
-
401: apiErrorSchema
|
|
15370
|
+
401: apiErrorSchema,
|
|
15371
|
+
403: apiErrorSchema
|
|
15112
15372
|
},
|
|
15113
15373
|
summary: "List zero agents"
|
|
15114
15374
|
}
|
|
@@ -15122,6 +15382,7 @@ var zeroAgentsByIdContract = c17.router({
|
|
|
15122
15382
|
responses: {
|
|
15123
15383
|
200: zeroAgentResponseSchema,
|
|
15124
15384
|
401: apiErrorSchema,
|
|
15385
|
+
403: apiErrorSchema,
|
|
15125
15386
|
404: apiErrorSchema
|
|
15126
15387
|
},
|
|
15127
15388
|
summary: "Get zero agent by id"
|
|
@@ -15136,6 +15397,7 @@ var zeroAgentsByIdContract = c17.router({
|
|
|
15136
15397
|
200: zeroAgentResponseSchema,
|
|
15137
15398
|
400: apiErrorSchema,
|
|
15138
15399
|
401: apiErrorSchema,
|
|
15400
|
+
403: apiErrorSchema,
|
|
15139
15401
|
404: apiErrorSchema,
|
|
15140
15402
|
422: apiErrorSchema
|
|
15141
15403
|
},
|
|
@@ -15150,6 +15412,7 @@ var zeroAgentsByIdContract = c17.router({
|
|
|
15150
15412
|
responses: {
|
|
15151
15413
|
200: zeroAgentResponseSchema,
|
|
15152
15414
|
401: apiErrorSchema,
|
|
15415
|
+
403: apiErrorSchema,
|
|
15153
15416
|
404: apiErrorSchema
|
|
15154
15417
|
},
|
|
15155
15418
|
summary: "Update zero agent metadata"
|
|
@@ -15163,6 +15426,7 @@ var zeroAgentsByIdContract = c17.router({
|
|
|
15163
15426
|
responses: {
|
|
15164
15427
|
204: c17.noBody(),
|
|
15165
15428
|
401: apiErrorSchema,
|
|
15429
|
+
403: apiErrorSchema,
|
|
15166
15430
|
404: apiErrorSchema
|
|
15167
15431
|
},
|
|
15168
15432
|
summary: "Delete zero agent by id"
|
|
@@ -15197,6 +15461,7 @@ var zeroAgentInstructionsContract = c17.router({
|
|
|
15197
15461
|
responses: {
|
|
15198
15462
|
200: zeroAgentInstructionsResponseSchema,
|
|
15199
15463
|
401: apiErrorSchema,
|
|
15464
|
+
403: apiErrorSchema,
|
|
15200
15465
|
404: apiErrorSchema
|
|
15201
15466
|
},
|
|
15202
15467
|
summary: "Get zero agent instructions"
|
|
@@ -15210,6 +15475,7 @@ var zeroAgentInstructionsContract = c17.router({
|
|
|
15210
15475
|
responses: {
|
|
15211
15476
|
200: zeroAgentResponseSchema,
|
|
15212
15477
|
401: apiErrorSchema,
|
|
15478
|
+
403: apiErrorSchema,
|
|
15213
15479
|
404: apiErrorSchema,
|
|
15214
15480
|
422: apiErrorSchema
|
|
15215
15481
|
},
|
|
@@ -16061,23 +16327,25 @@ var zeroSessionsByIdContract = c27.router({
|
|
|
16061
16327
|
// ../../packages/core/src/contracts/integrations.ts
|
|
16062
16328
|
import { z as z35 } from "zod";
|
|
16063
16329
|
var c28 = initContract();
|
|
16330
|
+
var sendSlackMessageBodySchema = z35.object({
|
|
16331
|
+
channel: z35.string().min(1, "Channel ID is required"),
|
|
16332
|
+
text: z35.string().optional(),
|
|
16333
|
+
threadTs: z35.string().optional(),
|
|
16334
|
+
blocks: z35.array(z35.object({ type: z35.string() }).passthrough()).optional()
|
|
16335
|
+
});
|
|
16336
|
+
var sendSlackMessageResponseSchema = z35.object({
|
|
16337
|
+
ok: z35.literal(true),
|
|
16338
|
+
ts: z35.string().optional(),
|
|
16339
|
+
channel: z35.string().optional()
|
|
16340
|
+
});
|
|
16064
16341
|
var integrationsSlackMessageContract = c28.router({
|
|
16065
16342
|
sendMessage: {
|
|
16066
16343
|
method: "POST",
|
|
16067
16344
|
path: "/api/zero/integrations/slack/message",
|
|
16068
16345
|
headers: authHeadersSchema,
|
|
16069
|
-
body:
|
|
16070
|
-
channel: z35.string().min(1, "Channel ID is required"),
|
|
16071
|
-
text: z35.string().optional(),
|
|
16072
|
-
threadTs: z35.string().optional(),
|
|
16073
|
-
blocks: z35.array(z35.object({ type: z35.string() }).passthrough()).optional()
|
|
16074
|
-
}),
|
|
16346
|
+
body: sendSlackMessageBodySchema,
|
|
16075
16347
|
responses: {
|
|
16076
|
-
200:
|
|
16077
|
-
ok: z35.literal(true),
|
|
16078
|
-
ts: z35.string().optional(),
|
|
16079
|
-
channel: z35.string().optional()
|
|
16080
|
-
}),
|
|
16348
|
+
200: sendSlackMessageResponseSchema,
|
|
16081
16349
|
400: apiErrorSchema,
|
|
16082
16350
|
401: apiErrorSchema,
|
|
16083
16351
|
403: apiErrorSchema,
|
|
@@ -16292,11 +16560,16 @@ var STAFF_USER_HASHES = [
|
|
|
16292
16560
|
"67a65740246389d7fecf7702f8b7d6914ad38dc5",
|
|
16293
16561
|
"55651a8b2c85b35ff0629fa3d4718b9476069d0f"
|
|
16294
16562
|
];
|
|
16563
|
+
var STAFF_ORG_ID_HASHES = [
|
|
16564
|
+
"65de87977d6d1712cd88d7768209f33f7ed12e0b"
|
|
16565
|
+
// org_3ANttyrbWYJk6JKRSTRLEsbsDLe
|
|
16566
|
+
];
|
|
16295
16567
|
var FEATURE_SWITCHES = {
|
|
16296
16568
|
["pricing" /* Pricing */]: {
|
|
16297
16569
|
maintainer: "ethan@vm0.ai",
|
|
16298
16570
|
enabled: false,
|
|
16299
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16571
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16572
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16300
16573
|
},
|
|
16301
16574
|
["dummy" /* Dummy */]: {
|
|
16302
16575
|
maintainer: "ethan@vm0.ai",
|
|
@@ -16321,152 +16594,183 @@ var FEATURE_SWITCHES = {
|
|
|
16321
16594
|
["ahrefsConnector" /* AhrefsConnector */]: {
|
|
16322
16595
|
maintainer: "ethan@vm0.ai",
|
|
16323
16596
|
enabled: false,
|
|
16324
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16597
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16598
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16325
16599
|
},
|
|
16326
16600
|
["canvaConnector" /* CanvaConnector */]: {
|
|
16327
16601
|
maintainer: "ethan@vm0.ai",
|
|
16328
16602
|
enabled: false,
|
|
16329
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16603
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16604
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16330
16605
|
},
|
|
16331
16606
|
["computerConnector" /* ComputerConnector */]: {
|
|
16332
16607
|
maintainer: "ethan@vm0.ai",
|
|
16333
16608
|
enabled: false,
|
|
16334
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16609
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16610
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16335
16611
|
},
|
|
16336
16612
|
["deelConnector" /* DeelConnector */]: {
|
|
16337
16613
|
maintainer: "ethan@vm0.ai",
|
|
16338
16614
|
enabled: false,
|
|
16339
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16615
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16616
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16340
16617
|
},
|
|
16341
16618
|
["docusignConnector" /* DocuSignConnector */]: {
|
|
16342
16619
|
maintainer: "ethan@vm0.ai",
|
|
16343
16620
|
enabled: false,
|
|
16344
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16621
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16622
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16345
16623
|
},
|
|
16346
16624
|
["dropboxConnector" /* DropboxConnector */]: {
|
|
16347
16625
|
maintainer: "ethan@vm0.ai",
|
|
16348
16626
|
enabled: false,
|
|
16349
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16627
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16628
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16350
16629
|
},
|
|
16351
16630
|
["figmaConnector" /* FigmaConnector */]: {
|
|
16352
16631
|
maintainer: "ethan@vm0.ai",
|
|
16353
16632
|
enabled: false,
|
|
16354
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16633
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16634
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16355
16635
|
},
|
|
16356
16636
|
["mercuryConnector" /* MercuryConnector */]: {
|
|
16357
16637
|
maintainer: "ethan@vm0.ai",
|
|
16358
16638
|
enabled: false,
|
|
16359
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16639
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16640
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16360
16641
|
},
|
|
16361
16642
|
["neonConnector" /* NeonConnector */]: {
|
|
16362
16643
|
maintainer: "ethan@vm0.ai",
|
|
16363
16644
|
enabled: false,
|
|
16364
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16645
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16646
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16365
16647
|
},
|
|
16366
16648
|
["garminConnectConnector" /* GarminConnectConnector */]: {
|
|
16367
16649
|
maintainer: "ethan@vm0.ai",
|
|
16368
16650
|
enabled: false,
|
|
16369
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16651
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16652
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16370
16653
|
},
|
|
16371
16654
|
["redditConnector" /* RedditConnector */]: {
|
|
16372
16655
|
maintainer: "ethan@vm0.ai",
|
|
16373
16656
|
enabled: false,
|
|
16374
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16657
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16658
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16375
16659
|
},
|
|
16376
16660
|
["intervalsIcuConnector" /* IntervalsIcuConnector */]: {
|
|
16377
16661
|
maintainer: "ethan@vm0.ai",
|
|
16378
16662
|
enabled: false,
|
|
16379
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16663
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16664
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16380
16665
|
},
|
|
16381
16666
|
["supabaseConnector" /* SupabaseConnector */]: {
|
|
16382
16667
|
maintainer: "ethan@vm0.ai",
|
|
16383
16668
|
enabled: false,
|
|
16384
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16669
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16670
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16385
16671
|
},
|
|
16386
16672
|
["closeConnector" /* CloseConnector */]: {
|
|
16387
16673
|
maintainer: "ethan@vm0.ai",
|
|
16388
16674
|
enabled: false,
|
|
16389
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16675
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16676
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16390
16677
|
},
|
|
16391
16678
|
["webflowConnector" /* WebflowConnector */]: {
|
|
16392
16679
|
maintainer: "ethan@vm0.ai",
|
|
16393
16680
|
enabled: false,
|
|
16394
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16681
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16682
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16395
16683
|
},
|
|
16396
16684
|
["outlookMailConnector" /* OutlookMailConnector */]: {
|
|
16397
16685
|
maintainer: "ethan@vm0.ai",
|
|
16398
16686
|
enabled: false,
|
|
16399
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16687
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16688
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16400
16689
|
},
|
|
16401
16690
|
["outlookCalendarConnector" /* OutlookCalendarConnector */]: {
|
|
16402
16691
|
maintainer: "ethan@vm0.ai",
|
|
16403
16692
|
enabled: false,
|
|
16404
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16693
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16694
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16405
16695
|
},
|
|
16406
16696
|
["metaAdsConnector" /* MetaAdsConnector */]: {
|
|
16407
16697
|
maintainer: "ethan@vm0.ai",
|
|
16408
16698
|
enabled: false,
|
|
16409
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16699
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16700
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16410
16701
|
},
|
|
16411
16702
|
["stripeConnector" /* StripeConnector */]: {
|
|
16412
16703
|
maintainer: "ethan@vm0.ai",
|
|
16413
16704
|
enabled: false,
|
|
16414
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16705
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16706
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16415
16707
|
},
|
|
16416
16708
|
["posthogConnector" /* PosthogConnector */]: {
|
|
16417
16709
|
maintainer: "ethan@vm0.ai",
|
|
16418
16710
|
enabled: false,
|
|
16419
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16711
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16712
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16420
16713
|
},
|
|
16421
16714
|
["mailchimpConnector" /* MailchimpConnector */]: {
|
|
16422
16715
|
maintainer: "ethan@vm0.ai",
|
|
16423
16716
|
enabled: false,
|
|
16424
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16717
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16718
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16425
16719
|
},
|
|
16426
16720
|
["resendConnector" /* ResendConnector */]: {
|
|
16427
16721
|
maintainer: "ethan@vm0.ai",
|
|
16428
16722
|
enabled: false,
|
|
16429
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16723
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16724
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16430
16725
|
},
|
|
16431
16726
|
["githubIntegration" /* GitHubIntegration */]: {
|
|
16432
16727
|
maintainer: "ethan@vm0.ai",
|
|
16433
16728
|
enabled: false,
|
|
16434
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16729
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16730
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16435
16731
|
},
|
|
16436
16732
|
["telegramIntegration" /* TelegramIntegration */]: {
|
|
16437
16733
|
maintainer: "ethan@vm0.ai",
|
|
16438
16734
|
enabled: false,
|
|
16439
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16735
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16736
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16440
16737
|
},
|
|
16441
16738
|
["dataExport" /* DataExport */]: {
|
|
16442
16739
|
maintainer: "ethan@vm0.ai",
|
|
16443
16740
|
enabled: false,
|
|
16444
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16741
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16742
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16445
16743
|
},
|
|
16446
16744
|
["showSystemPrompt" /* ShowSystemPrompt */]: {
|
|
16447
16745
|
maintainer: "ethan@vm0.ai",
|
|
16448
16746
|
enabled: false,
|
|
16449
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16747
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16748
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16450
16749
|
},
|
|
16451
16750
|
["usage" /* Usage */]: {
|
|
16452
16751
|
maintainer: "ethan@vm0.ai",
|
|
16453
16752
|
enabled: false,
|
|
16454
|
-
enabledUserHashes: STAFF_USER_HASHES
|
|
16753
|
+
enabledUserHashes: STAFF_USER_HASHES,
|
|
16754
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
16455
16755
|
}
|
|
16456
16756
|
};
|
|
16457
|
-
async function isFeatureEnabled(key,
|
|
16757
|
+
async function isFeatureEnabled(key, ctx) {
|
|
16458
16758
|
const featureSwitch = FEATURE_SWITCHES[key];
|
|
16459
16759
|
if (featureSwitch.enabled) {
|
|
16460
16760
|
return true;
|
|
16461
16761
|
}
|
|
16462
|
-
if (userId && featureSwitch.enabledUserHashes?.length) {
|
|
16463
|
-
const hash = await sha1(userId);
|
|
16762
|
+
if (ctx?.userId && featureSwitch.enabledUserHashes?.length) {
|
|
16763
|
+
const hash = await sha1(ctx.userId);
|
|
16464
16764
|
if (featureSwitch.enabledUserHashes.includes(hash)) return true;
|
|
16465
16765
|
}
|
|
16466
|
-
if (email && featureSwitch.enabledEmailHashes?.length) {
|
|
16467
|
-
const hash = await sha1(email.toLowerCase());
|
|
16766
|
+
if (ctx?.email && featureSwitch.enabledEmailHashes?.length) {
|
|
16767
|
+
const hash = await sha1(ctx.email.toLowerCase());
|
|
16468
16768
|
if (featureSwitch.enabledEmailHashes.includes(hash)) return true;
|
|
16469
16769
|
}
|
|
16770
|
+
if (ctx?.orgId && featureSwitch.enabledOrgIdHashes?.length) {
|
|
16771
|
+
const hash = await sha1(ctx.orgId);
|
|
16772
|
+
if (featureSwitch.enabledOrgIdHashes.includes(hash)) return true;
|
|
16773
|
+
}
|
|
16470
16774
|
return false;
|
|
16471
16775
|
}
|
|
16472
16776
|
|
|
@@ -17297,11 +17601,23 @@ async function updateZeroAgentInstructions(id, content) {
|
|
|
17297
17601
|
handleError(result, `Failed to update instructions for zero agent "${id}"`);
|
|
17298
17602
|
}
|
|
17299
17603
|
|
|
17300
|
-
// src/lib/api/domains/
|
|
17604
|
+
// src/lib/api/domains/integrations-slack.ts
|
|
17301
17605
|
import { initClient as initClient14 } from "@ts-rest/core";
|
|
17606
|
+
async function sendSlackMessage(body) {
|
|
17607
|
+
const config = await getClientConfig();
|
|
17608
|
+
const client = initClient14(integrationsSlackMessageContract, config);
|
|
17609
|
+
const result = await client.sendMessage({ body, headers: {} });
|
|
17610
|
+
if (result.status === 200) {
|
|
17611
|
+
return result.body;
|
|
17612
|
+
}
|
|
17613
|
+
handleError(result, "Failed to send Slack message");
|
|
17614
|
+
}
|
|
17615
|
+
|
|
17616
|
+
// src/lib/api/domains/zero-schedules.ts
|
|
17617
|
+
import { initClient as initClient15 } from "@ts-rest/core";
|
|
17302
17618
|
async function deployZeroSchedule(body) {
|
|
17303
17619
|
const config = await getClientConfig();
|
|
17304
|
-
const client =
|
|
17620
|
+
const client = initClient15(zeroSchedulesMainContract, config);
|
|
17305
17621
|
const result = await client.deploy({ body });
|
|
17306
17622
|
if (result.status === 200 || result.status === 201) {
|
|
17307
17623
|
return result.body;
|
|
@@ -17310,7 +17626,7 @@ async function deployZeroSchedule(body) {
|
|
|
17310
17626
|
}
|
|
17311
17627
|
async function listZeroSchedules() {
|
|
17312
17628
|
const config = await getClientConfig();
|
|
17313
|
-
const client =
|
|
17629
|
+
const client = initClient15(zeroSchedulesMainContract, config);
|
|
17314
17630
|
const result = await client.list({ headers: {} });
|
|
17315
17631
|
if (result.status === 200) {
|
|
17316
17632
|
return result.body;
|
|
@@ -17319,7 +17635,7 @@ async function listZeroSchedules() {
|
|
|
17319
17635
|
}
|
|
17320
17636
|
async function deleteZeroSchedule(params) {
|
|
17321
17637
|
const config = await getClientConfig();
|
|
17322
|
-
const client =
|
|
17638
|
+
const client = initClient15(zeroSchedulesByNameContract, config);
|
|
17323
17639
|
const result = await client.delete({
|
|
17324
17640
|
params: { name: params.name },
|
|
17325
17641
|
query: { agentId: params.agentId }
|
|
@@ -17331,7 +17647,7 @@ async function deleteZeroSchedule(params) {
|
|
|
17331
17647
|
}
|
|
17332
17648
|
async function enableZeroSchedule(params) {
|
|
17333
17649
|
const config = await getClientConfig();
|
|
17334
|
-
const client =
|
|
17650
|
+
const client = initClient15(zeroSchedulesEnableContract, config);
|
|
17335
17651
|
const result = await client.enable({
|
|
17336
17652
|
params: { name: params.name },
|
|
17337
17653
|
body: { agentId: params.agentId }
|
|
@@ -17343,7 +17659,7 @@ async function enableZeroSchedule(params) {
|
|
|
17343
17659
|
}
|
|
17344
17660
|
async function disableZeroSchedule(params) {
|
|
17345
17661
|
const config = await getClientConfig();
|
|
17346
|
-
const client =
|
|
17662
|
+
const client = initClient15(zeroSchedulesEnableContract, config);
|
|
17347
17663
|
const result = await client.disable({
|
|
17348
17664
|
params: { name: params.name },
|
|
17349
17665
|
body: { agentId: params.agentId }
|
|
@@ -17467,12 +17783,12 @@ async function promptPassword(message) {
|
|
|
17467
17783
|
|
|
17468
17784
|
export {
|
|
17469
17785
|
configureGlobalProxyFromEnv,
|
|
17786
|
+
decodeZeroTokenPayload,
|
|
17470
17787
|
loadConfig,
|
|
17471
17788
|
saveConfig,
|
|
17472
17789
|
getToken,
|
|
17473
17790
|
getActiveToken,
|
|
17474
17791
|
getApiUrl,
|
|
17475
|
-
decodeZeroTokenPayload,
|
|
17476
17792
|
getActiveOrg,
|
|
17477
17793
|
clearConfig,
|
|
17478
17794
|
extractAndGroupVariables,
|
|
@@ -17584,6 +17900,7 @@ export {
|
|
|
17584
17900
|
getZeroConnectorSession,
|
|
17585
17901
|
createZeroComputerConnector,
|
|
17586
17902
|
deleteZeroComputerConnector,
|
|
17903
|
+
sendSlackMessage,
|
|
17587
17904
|
deployZeroSchedule,
|
|
17588
17905
|
listZeroSchedules,
|
|
17589
17906
|
deleteZeroSchedule,
|
|
@@ -17596,4 +17913,4 @@ export {
|
|
|
17596
17913
|
promptSelect,
|
|
17597
17914
|
promptPassword
|
|
17598
17915
|
};
|
|
17599
|
-
//# sourceMappingURL=chunk-
|
|
17916
|
+
//# sourceMappingURL=chunk-2KN52BP2.js.map
|