@tool-bridge/server 0.21.0 → 0.22.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/dist/admin.js +170 -0
- package/dist/airtable-ML2GIGCH.js +790 -0
- package/dist/{alt_text_generator_ai-RELFQ5FV.js → alt_text_generator_ai-FGYQAF2A.js} +12 -11
- package/dist/{amap-YSYEACKQ.js → amap-G7V65NGK.js} +221 -220
- package/dist/anthropic-6ZK24TBB.js +203 -0
- package/dist/apify-VDGYHP6W.js +248 -0
- package/dist/brave_search-TAATLZOS.js +302 -0
- package/dist/chunk-2IAI3XQM.js +302 -0
- package/dist/chunk-7ISGFRC6.js +161 -0
- package/dist/{chunk-Q74GLIDK.js → chunk-BNMLA2RC.js} +6 -5
- package/dist/chunk-HA4BGL6C.js +8429 -0
- package/dist/{chunk-MDY7K5CX.js → chunk-RMAWSG7E.js} +20135 -26920
- package/dist/{chunk-JEWFX6Z6.js → chunk-RTW5VRTK.js} +3 -3
- package/dist/chunk-U7PTOA3U.js +7320 -0
- package/dist/chunk-UY6ANCOY.js +378 -0
- package/dist/{chunk-QR4LK3HF.js → chunk-X7ZUTKHR.js} +4 -2
- package/dist/circleci-BQ2UWXL2.js +389 -0
- package/dist/clerk-2JYWQNOI.js +1019 -0
- package/dist/cohere-6MI7AQM4.js +185 -0
- package/dist/{confluence-52I37IUT.js → confluence-6Y6GDETF.js} +105 -104
- package/dist/{convertapi-3TRJ3WEO.js → convertapi-HBZCSWOX.js} +32 -31
- package/dist/{currencyapi-LWEANWVI.js → currencyapi-337U5TGI.js} +71 -71
- package/dist/deepseek-OSPASO7O.js +210 -0
- package/dist/docker_hub-3ATQOY5L.js +933 -0
- package/dist/dropbox-LSA4GM2Y.js +1305 -0
- package/dist/dub-VZPJSPI6.js +680 -0
- package/dist/e2b-6SDYQZL2.js +278 -0
- package/dist/exa-B6EUYDVP.js +332 -0
- package/dist/{fal_ai-VJPMCNRH.js → fal_ai-K4Q27IME.js} +81 -80
- package/dist/feishu-4TKXG4SU.js +11975 -0
- package/dist/{feishu_custom_bot-ADSE23KU.js → feishu_custom_bot-7CTEAKRB.js} +57 -53
- package/dist/figma-OUKSZLD5.js +777 -0
- package/dist/firehydrant-7MOYL7QH.js +563 -0
- package/dist/{fixer-OAMF4DKP.js → fixer-H2BV2NO4.js} +34 -33
- package/dist/fly-PXKY6PNH.js +469 -0
- package/dist/{front-6GTVYKUM.js → front-UZYIV5DW.js} +104 -104
- package/dist/geocodio-NSYO7TFP.js +213 -0
- package/dist/ghost-QBKKQQMF.js +338 -0
- package/dist/github-ENLSJ4CL.js +5421 -0
- package/dist/gmail-KQSDEB47.js +1887 -0
- package/dist/googlecalendar-5YCX4SZF.js +2524 -0
- package/dist/{googledocs-YNKKBM6Q.js → googledocs-SSWIVFKA.js} +343 -341
- package/dist/{grafana-353VSGXN.js → grafana-TF2LXDQA.js} +221 -220
- package/dist/graphhopper-CURBVHYK.js +325 -0
- package/dist/index.d.ts +1132 -332
- package/dist/index.js +31 -13
- package/dist/{ip2proxy-DBGRWH7S.js → ip2proxy-YNVMTZEM.js} +28 -27
- package/dist/ipgeolocation_io-NAU7VJ4J.js +315 -0
- package/dist/ipqualityscore-OT63L4TI.js +279 -0
- package/dist/{jina_ai-L5BH455V.js → jina_ai-6WBMBGWM.js} +23 -23
- package/dist/{jira-IGTILUZA.js → jira-DVDVTHNO.js} +118 -117
- package/dist/langsmith-IM5N4YAU.js +593 -0
- package/dist/lemlist-277SHUQF.js +289 -0
- package/dist/{linear-HLGOWISN.js → linear-AEPH7B5V.js} +329 -327
- package/dist/logsnag-VEWRAGBG.js +150 -0
- package/dist/main.js +57 -279
- package/dist/{mattermost-BONGXVC7.js → mattermost-Q3A2BIZA.js} +59 -58
- package/dist/mem0-AXS7GZGI.js +544 -0
- package/dist/memos-7TXG4ZTU.js +744 -0
- package/dist/{metabase-ZHXHRHZK.js → metabase-NSVACWQM.js} +90 -89
- package/dist/mistral_ai-YZ52RGD4.js +1196 -0
- package/dist/{mother_duck-TKVQM35M.js → mother_duck-XLLL6FVL.js} +94 -93
- package/dist/ngrok-4O4W3WZW.js +356 -0
- package/dist/{notes-KXRNNYDW.js → notes-YTB3TJOO.js} +11 -9
- package/dist/notion-4W4O7J7V.js +940 -0
- package/dist/open_exchange_rates-23QJXVO5.js +215 -0
- package/dist/openai-ZS7GLSLH.js +800 -0
- package/dist/opengraph_io-PMVH7OYI.js +362 -0
- package/dist/openrouter-ONRGFNB6.js +441 -0
- package/dist/outline-UCUYZZ7J.js +599 -0
- package/dist/paddle-35HTKTUL.js +454 -0
- package/dist/perplexity-NVOBYN24.js +220 -0
- package/dist/pinecone-55CJY73C.js +571 -0
- package/dist/{pipedrive-CW7HONYW.js → pipedrive-WMCAKS72.js} +99 -98
- package/dist/polar-SM4ZM53B.js +395 -0
- package/dist/posthog-NWCXVXNJ.js +3464 -0
- package/dist/postmark-QJV5PHUQ.js +427 -0
- package/dist/{prerender-5EAY7GDM.js → prerender-2W7UT4SC.js} +31 -30
- package/dist/{pubmed-GRQUBGVA.js → pubmed-VVV7XYLU.js} +241 -239
- package/dist/{railway-FTM75TMX.js → railway-KGI57S3O.js} +118 -117
- package/dist/readwise-AGHTQB42.js +470 -0
- package/dist/render-O4HBROCK.js +461 -0
- package/dist/{replicate-RJCMDB7H.js → replicate-KWBOMX7D.js} +81 -80
- package/dist/{resend-YYN22NIL.js → resend-DRH6Y6I4.js} +20 -16
- package/dist/rootly-XGCUDW6X.js +336 -0
- package/dist/{scrapfly-ZJJ6XM4Q.js → scrapfly-OIQ3OY6L.js} +62 -61
- package/dist/{scrapingbee-QNGEOD6D.js → scrapingbee-OCZO4FHX.js} +56 -56
- package/dist/{screenshot_fyi-SPZAABVD.js → screenshot_fyi-CUNGFZOC.js} +16 -16
- package/dist/semantic_scholar-3UJRLKES.js +611 -0
- package/dist/{sentry-SJ5NN4C4.js → sentry-5BWVZFJV.js} +208 -207
- package/dist/{shodan-YMGOY7KW.js → shodan-HI37CTEW.js} +62 -61
- package/dist/shopify-LJ2EV2HH.js +610 -0
- package/dist/stripe-3LHMV55K.js +585 -0
- package/dist/{supabase-GQ2OFVIL.js → supabase-H2KPX3Q2.js} +245 -244
- package/dist/tavily-FBEWGH3Z.js +326 -0
- package/dist/telegram-MYYO3JND.js +1767 -0
- package/dist/{telnyx-4JGMC3K7.js → telnyx-H4ALEGAX.js} +57 -56
- package/dist/todoist-OBWICA5Q.js +664 -0
- package/dist/trello-GUFUJRWO.js +1080 -0
- package/dist/turso-NIAK4UMS.js +416 -0
- package/dist/{twilio-VYF3HUU6.js → twilio-K6SLK2CX.js} +72 -70
- package/dist/umami-42RS2EPS.js +389 -0
- package/dist/unsplash-V7TOTETT.js +351 -0
- package/dist/{upstash_redis-IUM2HDLU.js → upstash_redis-AWQMB6Y3.js} +51 -50
- package/dist/uptimerobot-AZC2DHOT.js +483 -0
- package/dist/v2ex-4TVRNMLS.js +667 -0
- package/dist/vercel-DPHTJ3XR.js +1076 -0
- package/dist/{wolfram_alpha_api-6CRVUZOJ.js → wolfram_alpha_api-XAG7IXBW.js} +36 -35
- package/dist/wordpress-KMPKVGUX.js +812 -0
- package/dist/workos-PKB2YR7S.js +664 -0
- package/dist/zhihu-Y4H4XYPB.js +254 -0
- package/package.json +18 -9
- package/dist/airtable-DMJEEGJP.js +0 -789
- package/dist/anthropic-D5X5GSYE.js +0 -202
- package/dist/apify-5NVFU3IZ.js +0 -247
- package/dist/brave_search-X557FMGO.js +0 -301
- package/dist/chunk-MZCIPUNQ.js +0 -23424
- package/dist/chunk-ZTTN6AJG.js +0 -977
- package/dist/circleci-3P3QTUX2.js +0 -388
- package/dist/clerk-GNMZQ2MY.js +0 -1019
- package/dist/cloudflare_dns-VWZH3ZTR.js +0 -588
- package/dist/cohere-C7QVIIMG.js +0 -185
- package/dist/deepseek-5U24YG4P.js +0 -209
- package/dist/docker_hub-CMISLRSE.js +0 -932
- package/dist/dropbox-TW4QN6FT.js +0 -1304
- package/dist/dub-EFXGI5UH.js +0 -679
- package/dist/e2b-PHM63OVF.js +0 -277
- package/dist/exa-DYOQWURR.js +0 -331
- package/dist/feishu-TFIZXPIN.js +0 -231
- package/dist/figma-4AK47AYY.js +0 -773
- package/dist/firehydrant-RGPTW4EA.js +0 -562
- package/dist/fly-YB4AQD4O.js +0 -468
- package/dist/geocodio-YRT4K25M.js +0 -212
- package/dist/ghost-JCW6UIP2.js +0 -337
- package/dist/github-CEGVRMNX.js +0 -5420
- package/dist/gmail-JCMJD55P.js +0 -1886
- package/dist/googlecalendar-2EAW4MNM.js +0 -2522
- package/dist/graphhopper-H3IVJNDS.js +0 -324
- package/dist/ipgeolocation_io-5I2BDVMG.js +0 -315
- package/dist/ipqualityscore-ILV7TQCV.js +0 -277
- package/dist/langsmith-BYRX4AOF.js +0 -592
- package/dist/lemlist-ZGNYTIQO.js +0 -288
- package/dist/logsnag-5RGTMTU2.js +0 -150
- package/dist/mem0-RUVNUPTE.js +0 -543
- package/dist/memos-TED4HI54.js +0 -739
- package/dist/mistral_ai-NGP5SHU7.js +0 -1195
- package/dist/ngrok-BYCUJ7QV.js +0 -356
- package/dist/notion-2ILYKJOO.js +0 -936
- package/dist/open_exchange_rates-JU4DC6HZ.js +0 -214
- package/dist/openai-6SOT26ZK.js +0 -799
- package/dist/opengraph_io-ZEFHV2OL.js +0 -361
- package/dist/openrouter-R4P7JL5L.js +0 -437
- package/dist/outline-VCTQ5V2X.js +0 -595
- package/dist/paddle-AZOAKBJS.js +0 -453
- package/dist/perplexity-OMRLGVAT.js +0 -219
- package/dist/pinecone-DI62W3ZX.js +0 -570
- package/dist/polar-5DRGTXNR.js +0 -394
- package/dist/posthog-3DTHFCKE.js +0 -3463
- package/dist/postmark-ME2V2XXI.js +0 -426
- package/dist/readwise-IJQGV6IQ.js +0 -469
- package/dist/render-TMSPHRTY.js +0 -460
- package/dist/rootly-7RXE4K7L.js +0 -336
- package/dist/semantic_scholar-SDPVGDDI.js +0 -610
- package/dist/shopify-SU5ABP54.js +0 -609
- package/dist/stripe-JAC425KE.js +0 -584
- package/dist/tavily-Y7MDA5CI.js +0 -326
- package/dist/telegram-OIDT3ZLH.js +0 -1766
- package/dist/todoist-O7S2OUGX.js +0 -663
- package/dist/trello-3LDE4TAQ.js +0 -1079
- package/dist/turso-MUQ44KCA.js +0 -415
- package/dist/umami-SVQIK26J.js +0 -388
- package/dist/unsplash-333XYDCJ.js +0 -350
- package/dist/uptimerobot-7ZRU2NJV.js +0 -482
- package/dist/v2ex-AVSJCQPS.js +0 -666
- package/dist/vercel-J7RGXNSA.js +0 -1075
- package/dist/wordpress-THOJLPKA.js +0 -811
- package/dist/workos-ENTGRWF2.js +0 -663
- package/dist/zhihu-W2BXICTX.js +0 -253
package/dist/admin.js
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
BootstrapStateStore,
|
|
4
|
+
package_default
|
|
5
|
+
} from "./chunk-2IAI3XQM.js";
|
|
6
|
+
import "./chunk-HA4BGL6C.js";
|
|
7
|
+
import "./chunk-U67V476Y.js";
|
|
8
|
+
|
|
9
|
+
// src/admin.ts
|
|
10
|
+
import { chown, mkdir, readFile, writeFile } from "fs/promises";
|
|
11
|
+
import { CreateBucketCommand, S3Client } from "@aws-sdk/client-s3";
|
|
12
|
+
import writeFileAtomic from "write-file-atomic";
|
|
13
|
+
import { randomBytes } from "crypto";
|
|
14
|
+
import { Command } from "commander";
|
|
15
|
+
import { join } from "path";
|
|
16
|
+
import pRetry from "p-retry";
|
|
17
|
+
var program = new Command("tool-bridge-admin").version(package_default.version).description(
|
|
18
|
+
"Local installation and recovery; requires access to the protected bootstrap directory"
|
|
19
|
+
);
|
|
20
|
+
for (const mode of ["pair", "recover"]) {
|
|
21
|
+
program.command(mode).option(
|
|
22
|
+
"--directory <path>",
|
|
23
|
+
"Protected bootstrap directory",
|
|
24
|
+
process.env.TB_BOOTSTRAP_DIR ?? "/data/bootstrap"
|
|
25
|
+
).action(async (opts) => {
|
|
26
|
+
const store = new BootstrapStateStore(opts.directory);
|
|
27
|
+
const token = await store.createLocalPairing(
|
|
28
|
+
mode === "pair" ? "setup" : "recovery"
|
|
29
|
+
);
|
|
30
|
+
process.stdout.write(token + "\n");
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
program.command("init").option(
|
|
34
|
+
"--directory <path>",
|
|
35
|
+
"Protected bootstrap directory",
|
|
36
|
+
"/data/bootstrap"
|
|
37
|
+
).option(
|
|
38
|
+
"--pg-secrets <path>",
|
|
39
|
+
"PostgreSQL credential directory",
|
|
40
|
+
"/secrets/postgres"
|
|
41
|
+
).option("--s3-secrets <path>", "S3 credential directory", "/secrets/s3").action(
|
|
42
|
+
async (opts) => {
|
|
43
|
+
const store = new BootstrapStateStore(opts.directory);
|
|
44
|
+
await store.initialize();
|
|
45
|
+
await store.exclusive(async () => {
|
|
46
|
+
if (await store.defaults()) return;
|
|
47
|
+
const password = randomBytes(32).toString("hex");
|
|
48
|
+
const pgAdminPassword = randomBytes(32).toString("hex");
|
|
49
|
+
const appKey = randomBytes(24).toString("hex");
|
|
50
|
+
const appSecret = randomBytes(32).toString("hex");
|
|
51
|
+
const adminKey = randomBytes(24).toString("hex");
|
|
52
|
+
const adminSecret = randomBytes(32).toString("hex");
|
|
53
|
+
await mkdir(opts.pgSecrets, { recursive: true, mode: 493 });
|
|
54
|
+
await mkdir(opts.s3Secrets, { recursive: true, mode: 493 });
|
|
55
|
+
await writeFileAtomic(
|
|
56
|
+
join(opts.pgSecrets, "password"),
|
|
57
|
+
pgAdminPassword + "\n",
|
|
58
|
+
{ mode: 256 }
|
|
59
|
+
);
|
|
60
|
+
await chown(join(opts.pgSecrets, "password"), 999, 999);
|
|
61
|
+
await writeFileAtomic(
|
|
62
|
+
join(opts.pgSecrets, "01-app.sql"),
|
|
63
|
+
`CREATE ROLE toolbridge LOGIN PASSWORD '${password}';
|
|
64
|
+
ALTER DATABASE toolbridge OWNER TO toolbridge;
|
|
65
|
+
`,
|
|
66
|
+
{ mode: 256 }
|
|
67
|
+
);
|
|
68
|
+
await chown(join(opts.pgSecrets, "01-app.sql"), 999, 999);
|
|
69
|
+
const identities = [
|
|
70
|
+
{
|
|
71
|
+
name: "installer",
|
|
72
|
+
credentials: [{ accessKey: adminKey, secretKey: adminSecret }],
|
|
73
|
+
actions: ["Admin", "Read", "Write", "List", "Tagging"]
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
name: "tool-bridge",
|
|
77
|
+
credentials: [{ accessKey: appKey, secretKey: appSecret }],
|
|
78
|
+
actions: [
|
|
79
|
+
"Read:tb-objects",
|
|
80
|
+
"Write:tb-objects",
|
|
81
|
+
"List:tb-objects",
|
|
82
|
+
"Tagging:tb-objects"
|
|
83
|
+
]
|
|
84
|
+
}
|
|
85
|
+
];
|
|
86
|
+
await writeFileAtomic(
|
|
87
|
+
join(opts.s3Secrets, "s3.json"),
|
|
88
|
+
JSON.stringify({ identities }),
|
|
89
|
+
{ mode: 256 }
|
|
90
|
+
);
|
|
91
|
+
await chown(join(opts.s3Secrets, "s3.json"), 1e3, 1e3);
|
|
92
|
+
await writeFileAtomic(
|
|
93
|
+
join(opts.s3Secrets, "admin.json"),
|
|
94
|
+
JSON.stringify({
|
|
95
|
+
accessKeyId: adminKey,
|
|
96
|
+
secretAccessKey: adminSecret
|
|
97
|
+
}),
|
|
98
|
+
{ mode: 256 }
|
|
99
|
+
);
|
|
100
|
+
await store.write("install-defaults.json", {
|
|
101
|
+
databaseUrl: `postgres://toolbridge:${password}@postgres:5432/toolbridge`,
|
|
102
|
+
databaseAdminUrl: `postgres://postgres:${pgAdminPassword}@postgres:5432/toolbridge`,
|
|
103
|
+
storage: {
|
|
104
|
+
endpoint: "http://objects:8333",
|
|
105
|
+
bucket: "tb-objects",
|
|
106
|
+
region: "us-east-1",
|
|
107
|
+
accessKeyId: appKey,
|
|
108
|
+
secretAccessKey: appSecret
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
for (const name of [
|
|
112
|
+
"bootstrap.json",
|
|
113
|
+
"identity.json",
|
|
114
|
+
"keys.json",
|
|
115
|
+
"pairing.json",
|
|
116
|
+
"pairing-token",
|
|
117
|
+
"install-defaults.json"
|
|
118
|
+
]) {
|
|
119
|
+
await chown(store.path(name), 1e3, 1e3);
|
|
120
|
+
}
|
|
121
|
+
await chown(opts.directory, 1e3, 1e3);
|
|
122
|
+
await writeFile(join(opts.s3Secrets, "ready"), "ready\n", {
|
|
123
|
+
mode: 292
|
|
124
|
+
});
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
program.command("init-bucket").option(
|
|
129
|
+
"--credentials <path>",
|
|
130
|
+
"S3 installer credentials",
|
|
131
|
+
"/secrets/s3/admin.json"
|
|
132
|
+
).option("--endpoint <url>", "Exact local S3 endpoint", "http://objects:8333").action(async (opts) => {
|
|
133
|
+
const credentials = JSON.parse(
|
|
134
|
+
await readFile(opts.credentials, "utf8")
|
|
135
|
+
);
|
|
136
|
+
const client = new S3Client({
|
|
137
|
+
endpoint: opts.endpoint,
|
|
138
|
+
region: "us-east-1",
|
|
139
|
+
forcePathStyle: true,
|
|
140
|
+
credentials,
|
|
141
|
+
maxAttempts: 1
|
|
142
|
+
});
|
|
143
|
+
try {
|
|
144
|
+
await pRetry(
|
|
145
|
+
async () => {
|
|
146
|
+
try {
|
|
147
|
+
await client.send(
|
|
148
|
+
new CreateBucketCommand({ Bucket: "tb-objects" })
|
|
149
|
+
);
|
|
150
|
+
} catch (error) {
|
|
151
|
+
if (!["BucketAlreadyOwnedByYou", "BucketAlreadyExists"].includes(
|
|
152
|
+
error.name
|
|
153
|
+
))
|
|
154
|
+
throw error;
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{ retries: 30, minTimeout: 500, maxTimeout: 2e3 }
|
|
158
|
+
);
|
|
159
|
+
} finally {
|
|
160
|
+
client.destroy();
|
|
161
|
+
}
|
|
162
|
+
});
|
|
163
|
+
try {
|
|
164
|
+
await program.parseAsync();
|
|
165
|
+
} catch {
|
|
166
|
+
console.error(
|
|
167
|
+
"Local maintenance failed; check protected files and service connectivity."
|
|
168
|
+
);
|
|
169
|
+
process.exitCode = 1;
|
|
170
|
+
}
|