@hasna/connectors 1.3.1 → 1.3.2
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/bin/index.js +248 -2116
- package/bin/mcp.js +176 -1690
- package/bin/serve.js +130 -1246
- package/connectors/connect-gmail/src/cli/index.ts +32 -3
- package/connectors/connect-huggingface/src/api/client.ts +0 -5
- package/connectors/connect-huggingface/src/api/example.ts +48 -0
- package/connectors/connect-huggingface/src/api/index.ts +19 -17
- package/connectors/connect-huggingface/src/cli/index.ts +36 -148
- package/connectors/connect-mercury/CLAUDE.md +1 -0
- package/connectors/connect-openai/src/api/images.ts +8 -52
- package/connectors/connect-yousign/CLAUDE.md +48 -0
- package/connectors/connect-yousign/bun.lock +32 -0
- package/connectors/connect-yousign/node_modules/@types/bun/LICENSE +21 -0
- package/connectors/connect-yousign/node_modules/@types/bun/README.md +20 -0
- package/connectors/connect-yousign/node_modules/@types/bun/index.d.ts +1 -0
- package/connectors/connect-yousign/node_modules/@types/bun/package.json +53 -0
- package/connectors/connect-yousign/node_modules/@types/node/LICENSE +21 -0
- package/connectors/connect-yousign/node_modules/@types/node/README.md +15 -0
- package/connectors/connect-yousign/node_modules/@types/node/assert/strict.d.ts +105 -0
- package/connectors/connect-yousign/node_modules/@types/node/assert.d.ts +955 -0
- package/connectors/connect-yousign/node_modules/@types/node/async_hooks.d.ts +623 -0
- package/connectors/connect-yousign/node_modules/@types/node/buffer.buffer.d.ts +466 -0
- package/connectors/connect-yousign/node_modules/@types/node/buffer.d.ts +1810 -0
- package/connectors/connect-yousign/node_modules/@types/node/child_process.d.ts +1433 -0
- package/connectors/connect-yousign/node_modules/@types/node/cluster.d.ts +486 -0
- package/connectors/connect-yousign/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/@types/node/console.d.ts +151 -0
- package/connectors/connect-yousign/node_modules/@types/node/constants.d.ts +20 -0
- package/connectors/connect-yousign/node_modules/@types/node/crypto.d.ts +4065 -0
- package/connectors/connect-yousign/node_modules/@types/node/dgram.d.ts +564 -0
- package/connectors/connect-yousign/node_modules/@types/node/diagnostics_channel.d.ts +576 -0
- package/connectors/connect-yousign/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/connectors/connect-yousign/node_modules/@types/node/dns.d.ts +922 -0
- package/connectors/connect-yousign/node_modules/@types/node/domain.d.ts +166 -0
- package/connectors/connect-yousign/node_modules/@types/node/events.d.ts +1047 -0
- package/connectors/connect-yousign/node_modules/@types/node/fs/promises.d.ts +1329 -0
- package/connectors/connect-yousign/node_modules/@types/node/fs.d.ts +4678 -0
- package/connectors/connect-yousign/node_modules/@types/node/globals.d.ts +150 -0
- package/connectors/connect-yousign/node_modules/@types/node/globals.typedarray.d.ts +101 -0
- package/connectors/connect-yousign/node_modules/@types/node/http.d.ts +2188 -0
- package/connectors/connect-yousign/node_modules/@types/node/http2.d.ts +2480 -0
- package/connectors/connect-yousign/node_modules/@types/node/https.d.ts +405 -0
- package/connectors/connect-yousign/node_modules/@types/node/index.d.ts +115 -0
- package/connectors/connect-yousign/node_modules/@types/node/inspector/promises.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/@types/node/inspector.d.ts +269 -0
- package/connectors/connect-yousign/node_modules/@types/node/inspector.generated.d.ts +4401 -0
- package/connectors/connect-yousign/node_modules/@types/node/module.d.ts +757 -0
- package/connectors/connect-yousign/node_modules/@types/node/net.d.ts +933 -0
- package/connectors/connect-yousign/node_modules/@types/node/os.d.ts +507 -0
- package/connectors/connect-yousign/node_modules/@types/node/package.json +155 -0
- package/connectors/connect-yousign/node_modules/@types/node/path/posix.d.ts +8 -0
- package/connectors/connect-yousign/node_modules/@types/node/path/win32.d.ts +8 -0
- package/connectors/connect-yousign/node_modules/@types/node/path.d.ts +187 -0
- package/connectors/connect-yousign/node_modules/@types/node/perf_hooks.d.ts +643 -0
- package/connectors/connect-yousign/node_modules/@types/node/process.d.ts +2175 -0
- package/connectors/connect-yousign/node_modules/@types/node/punycode.d.ts +117 -0
- package/connectors/connect-yousign/node_modules/@types/node/querystring.d.ts +152 -0
- package/connectors/connect-yousign/node_modules/@types/node/quic.d.ts +910 -0
- package/connectors/connect-yousign/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/connectors/connect-yousign/node_modules/@types/node/readline.d.ts +542 -0
- package/connectors/connect-yousign/node_modules/@types/node/repl.d.ts +415 -0
- package/connectors/connect-yousign/node_modules/@types/node/sea.d.ts +162 -0
- package/connectors/connect-yousign/node_modules/@types/node/sqlite.d.ts +1065 -0
- package/connectors/connect-yousign/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/connectors/connect-yousign/node_modules/@types/node/stream/promises.d.ts +211 -0
- package/connectors/connect-yousign/node_modules/@types/node/stream/web.d.ts +296 -0
- package/connectors/connect-yousign/node_modules/@types/node/stream.d.ts +1770 -0
- package/connectors/connect-yousign/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/connectors/connect-yousign/node_modules/@types/node/test/reporters.d.ts +96 -0
- package/connectors/connect-yousign/node_modules/@types/node/test.d.ts +2275 -0
- package/connectors/connect-yousign/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/connectors/connect-yousign/node_modules/@types/node/timers.d.ts +159 -0
- package/connectors/connect-yousign/node_modules/@types/node/tls.d.ts +1203 -0
- package/connectors/connect-yousign/node_modules/@types/node/trace_events.d.ts +197 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.6/index.d.ts +117 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
- package/connectors/connect-yousign/node_modules/@types/node/ts5.7/index.d.ts +117 -0
- package/connectors/connect-yousign/node_modules/@types/node/tty.d.ts +250 -0
- package/connectors/connect-yousign/node_modules/@types/node/url.d.ts +541 -0
- package/connectors/connect-yousign/node_modules/@types/node/util/types.d.ts +558 -0
- package/connectors/connect-yousign/node_modules/@types/node/util.d.ts +1687 -0
- package/connectors/connect-yousign/node_modules/@types/node/v8.d.ts +988 -0
- package/connectors/connect-yousign/node_modules/@types/node/vm.d.ts +1208 -0
- package/connectors/connect-yousign/node_modules/@types/node/wasi.d.ts +202 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/blob.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/console.d.ts +9 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/events.d.ts +106 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/performance.d.ts +45 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/streams.d.ts +115 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/timers.d.ts +44 -0
- package/connectors/connect-yousign/node_modules/@types/node/web-globals/url.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/@types/node/worker_threads.d.ts +717 -0
- package/connectors/connect-yousign/node_modules/@types/node/zlib.d.ts +682 -0
- package/connectors/connect-yousign/node_modules/bun-types/CLAUDE.md +105 -0
- package/connectors/connect-yousign/node_modules/bun-types/README.md +33 -0
- package/connectors/connect-yousign/node_modules/bun-types/bun.d.ts +8481 -0
- package/connectors/connect-yousign/node_modules/bun-types/bun.ns.d.ts +5 -0
- package/connectors/connect-yousign/node_modules/bun-types/bundle.d.ts +74 -0
- package/connectors/connect-yousign/node_modules/bun-types/deprecated.d.ts +184 -0
- package/connectors/connect-yousign/node_modules/bun-types/devserver.d.ts +187 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/README.md +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/bytecode.mdx +447 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/css.mdx +1024 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/esbuild.mdx +304 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/executables.mdx +1318 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/fullstack.mdx +1086 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/hot-reloading.mdx +229 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/html-static.mdx +498 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/index.mdx +1840 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/loaders.mdx +451 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/macros.mdx +328 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/minifier.mdx +1286 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/plugins.mdx +477 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/bundler/standalone-html.mdx +314 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/feedback.mdx +75 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-array.mdx +29 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-blob.mdx +26 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-buffer.mdx +27 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-string.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/arraybuffer-to-typedarray.mdx +41 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-arraybuffer.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-dataview.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-stream.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-string.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/blob-to-typedarray.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-arraybuffer.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-blob.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-readablestream.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-string.mdx +27 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/buffer-to-typedarray.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/dataview-to-string.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-arraybuffer.mdx +27 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-blob.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-buffer.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-dataview.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-readablestream.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/binary/typedarray-to-string.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/aws-lambda.mdx +204 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/digital-ocean.mdx +161 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/google-cloud-run.mdx +194 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/railway.mdx +145 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/render.mdx +82 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/deployment/vercel.mdx +97 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/astro.mdx +82 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/discordjs.mdx +80 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/docker.mdx +151 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/drizzle.mdx +195 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/elysia.mdx +31 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/express.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/gel.mdx +261 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/hono.mdx +47 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/mongoose.mdx +92 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/neon-drizzle.mdx +234 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/neon-serverless-postgres.mdx +60 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/nextjs.mdx +103 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/nuxt.mdx +96 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/pm2.mdx +55 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/prisma-postgres.mdx +169 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/prisma.mdx +164 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/qwik.mdx +114 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/react.mdx +52 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/remix.mdx +97 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/sentry.mdx +54 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/solidstart.mdx +62 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/ssr-react.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/stric.mdx +54 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/sveltekit.mdx +138 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/systemd.mdx +114 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/tanstack-start.mdx +791 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/upstash.mdx +87 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/ecosystem/vite.mdx +77 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/html-rewriter/extract-links.mdx +71 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/html-rewriter/extract-social-meta.mdx +97 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/cluster.mdx +69 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/fetch-unix.mdx +35 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/fetch.mdx +26 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/file-uploads.mdx +97 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/hot.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/proxy.mdx +50 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/server.mdx +48 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/simple.mdx +20 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-file.mdx +50 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-iterator.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/stream-node-streams-in-bun.mdx +22 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/http/tls.mdx +32 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/index.mdx +10 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-dev.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-git.mdx +40 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-optional.mdx +27 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-peer.mdx +45 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add-tarball.mdx +35 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/add.mdx +44 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/azure-artifacts.mdx +76 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/cicd.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/custom-registry.mdx +32 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/from-npm-install-to-bun-install.mdx +230 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/git-diff-bun-lockfile.mdx +48 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/jfrog-artifactory.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/npm-alias.mdx +25 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/registry-scope.mdx +40 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/trusted.mdx +52 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/workspaces.mdx +70 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/install/yarnlock.mdx +51 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/argv.mdx +66 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/ctrl-c.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/ipc.mdx +69 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/nanoseconds.mdx +15 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/os-signals.mdx +31 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn-stderr.mdx +34 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn-stdout.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/spawn.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/process/stdin.mdx +62 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/arraybuffer.mdx +30 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/buffer.mdx +21 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/exists.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/json.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/mime.mdx +22 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/stream.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/string.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/uint8array.mdx +23 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/read-file/watch.mdx +66 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/build-time-constants.mdx +295 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/cicd.mdx +45 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/codesign-macos-executable.mdx +61 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/define-constant.mdx +149 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/delete-directory.mdx +39 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/delete-file.mdx +21 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/heap-snapshot.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-html.mdx +15 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-json.mdx +46 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-json5.mdx +74 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-toml.mdx +32 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/import-yaml.mdx +104 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/read-env.mdx +37 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/set-env.mdx +51 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/shell.mdx +42 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/timezone.mdx +38 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/tsconfig-paths.mdx +31 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/typescript.mdx +51 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/vscode-debugger.mdx +47 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/runtime/web-debugger.mdx +103 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-arraybuffer.mdx +13 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-blob.mdx +13 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-json.mdx +14 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-string.mdx +14 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/node-readable-to-uint8array.mdx +13 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-array.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-arraybuffer.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-blob.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-buffer.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-json.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-string.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/streams/to-typedarray.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/bail.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/concurrent-test-glob.mdx +146 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/coverage-threshold.mdx +67 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/coverage.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/happy-dom.mdx +73 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/migrate-from-jest.mdx +125 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/mock-clock.mdx +50 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/mock-functions.mdx +70 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/rerun-each.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/run-tests.mdx +116 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/skip-tests.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/snapshot.mdx +102 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/spy-on.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/svelte-test.mdx +113 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/testing-library.mdx +93 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/timeout.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/todo-tests.mdx +74 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/update-snapshots.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/test/watch-mode.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/base64.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/deep-equals.mdx +41 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/deflate.mdx +20 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/detect-bun.mdx +28 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/entrypoint.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/escape-html.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/file-url-to-path.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/gzip.mdx +20 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/hash-a-password.mdx +56 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-dir.mdx +15 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-file.mdx +15 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/import-meta-path.mdx +15 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/javascript-uuid.mdx +25 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/main.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/path-to-file-url.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/sleep.mdx +24 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/upgrade.mdx +93 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/version.mdx +23 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/util/which-path-to-executable-bin.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/compression.mdx +33 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/context.mdx +79 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/pubsub.mdx +43 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/websocket/simple.mdx +38 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/append.mdx +54 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/basic.mdx +46 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/blob.mdx +30 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/cat.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/file-cp.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/filesink.mdx +54 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/response.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/stdout.mdx +23 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/stream.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/guides/write-file/unlink.mdx +18 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/index.mdx +133 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/installation.mdx +372 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/bunx.mdx +91 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/catalogs.mdx +292 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/add.mdx +179 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/audit.mdx +60 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/info.mdx +70 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/install.mdx +591 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/link.mdx +61 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/outdated.mdx +197 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/patch.mdx +69 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/pm.mdx +323 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/publish.mdx +131 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/remove.mdx +16 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/update.mdx +140 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/cli/why.mdx +84 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/filter.mdx +127 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/global-cache.mdx +72 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/isolated-installs.mdx +220 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/lifecycle.mdx +64 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/lockfile.mdx +64 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/npmrc.mdx +245 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/overrides.mdx +83 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/scopes-registries.mdx +35 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/security-scanner-api.mdx +95 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/pm/workspaces.mdx +115 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/benchmarking.mdx +296 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/bindgen.mdx +223 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/building-windows.mdx +143 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/contributing.mdx +366 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/feedback.mdx +20 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/license.mdx +78 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/project/roadmap.mdx +8 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/quickstart.mdx +251 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/archive.mdx +452 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/auto-install.mdx +97 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/binary-data.mdx +846 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/bun-apis.mdx +59 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/bunfig.mdx +754 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/c-compiler.mdx +204 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/child-process.mdx +659 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/color.mdx +267 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/console.mdx +67 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/cookies.mdx +454 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/debugger.mdx +335 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/environment-variables.mdx +231 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/ffi.mdx +567 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-io.mdx +306 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-system-router.mdx +118 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/file-types.mdx +482 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/glob.mdx +181 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/globals.mdx +72 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/hashing.mdx +315 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/html-rewriter.mdx +333 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/cookies.mdx +79 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/error-handling.mdx +40 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/metrics.mdx +36 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/routing.mdx +289 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/server.mdx +645 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/tls.mdx +101 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/http/websockets.mdx +414 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/index.mdx +223 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/json5.mdx +271 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/jsonl.mdx +188 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/jsx.mdx +115 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/markdown.mdx +344 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/module-resolution.mdx +374 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/dns.mdx +111 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/fetch.mdx +484 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/tcp.mdx +239 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/networking/udp.mdx +180 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/node-api.mdx +19 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/nodejs-compat.mdx +468 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/plugins.mdx +419 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/redis.mdx +583 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/repl.mdx +176 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/s3.mdx +881 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/secrets.mdx +340 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/semver.mdx +57 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/shell.mdx +637 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/sql.mdx +1404 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/sqlite.mdx +721 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/streams.mdx +232 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/templating/create.mdx +269 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/templating/init.mdx +58 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/transpiler.mdx +288 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/typescript.mdx +58 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/utils.mdx +1010 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/watch-mode.mdx +161 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/web-apis.mdx +29 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/workers.mdx +314 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/runtime/yaml.mdx +469 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/add.mdx +166 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/build.mdx +197 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/bunx.mdx +49 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/feedback.mdx +17 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/init.mdx +84 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/install.mdx +173 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/link.mdx +163 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/outdated.mdx +140 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/patch.mdx +171 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/publish.mdx +198 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/remove.mdx +146 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/run.mdx +305 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/test.mdx +105 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/snippets/cli/update.mdx +144 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/code-coverage.mdx +409 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/configuration.mdx +520 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/dates-times.mdx +129 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/discovery.mdx +90 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/dom.mdx +226 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/index.mdx +409 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/lifecycle.mdx +366 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/mocks.mdx +637 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/reporters.mdx +126 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/runtime-behavior.mdx +342 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/snapshots.mdx +434 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/test/writing-tests.mdx +672 -0
- package/connectors/connect-yousign/node_modules/bun-types/docs/typescript.mdx +54 -0
- package/connectors/connect-yousign/node_modules/bun-types/extensions.d.ts +40 -0
- package/connectors/connect-yousign/node_modules/bun-types/fetch.d.ts +79 -0
- package/connectors/connect-yousign/node_modules/bun-types/ffi.d.ts +1154 -0
- package/connectors/connect-yousign/node_modules/bun-types/globals.d.ts +2067 -0
- package/connectors/connect-yousign/node_modules/bun-types/html-rewriter.d.ts +186 -0
- package/connectors/connect-yousign/node_modules/bun-types/index.d.ts +32 -0
- package/connectors/connect-yousign/node_modules/bun-types/jsc.d.ts +233 -0
- package/connectors/connect-yousign/node_modules/bun-types/jsx.d.ts +11 -0
- package/connectors/connect-yousign/node_modules/bun-types/overrides.d.ts +376 -0
- package/connectors/connect-yousign/node_modules/bun-types/package.json +37 -0
- package/connectors/connect-yousign/node_modules/bun-types/redis.d.ts +3352 -0
- package/connectors/connect-yousign/node_modules/bun-types/s3.d.ts +1335 -0
- package/connectors/connect-yousign/node_modules/bun-types/security.d.ts +101 -0
- package/connectors/connect-yousign/node_modules/bun-types/serve.d.ts +1296 -0
- package/connectors/connect-yousign/node_modules/bun-types/shell.d.ts +380 -0
- package/connectors/connect-yousign/node_modules/bun-types/sql.d.ts +887 -0
- package/connectors/connect-yousign/node_modules/bun-types/sqlite.d.ts +1322 -0
- package/connectors/connect-yousign/node_modules/bun-types/test-globals.d.ts +22 -0
- package/connectors/connect-yousign/node_modules/bun-types/test.d.ts +2392 -0
- package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/branding.d.ts +283 -0
- package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/index.d.ts +1207 -0
- package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/messages.d.ts +395 -0
- package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/overloads.d.ts +669 -0
- package/connectors/connect-yousign/node_modules/bun-types/vendor/expect-type/utils.d.ts +431 -0
- package/connectors/connect-yousign/node_modules/bun-types/wasm.d.ts +193 -0
- package/connectors/connect-yousign/node_modules/chalk/license +9 -0
- package/connectors/connect-yousign/node_modules/chalk/package.json +83 -0
- package/connectors/connect-yousign/node_modules/chalk/readme.md +297 -0
- package/connectors/connect-yousign/node_modules/chalk/source/index.d.ts +325 -0
- package/connectors/connect-yousign/node_modules/chalk/source/index.js +225 -0
- package/connectors/connect-yousign/node_modules/chalk/source/utilities.js +33 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/ansi-styles/index.d.ts +236 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/ansi-styles/index.js +223 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/browser.d.ts +1 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/browser.js +34 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/index.d.ts +55 -0
- package/connectors/connect-yousign/node_modules/chalk/source/vendor/supports-color/index.js +190 -0
- package/connectors/connect-yousign/node_modules/commander/LICENSE +22 -0
- package/connectors/connect-yousign/node_modules/commander/Readme.md +1157 -0
- package/connectors/connect-yousign/node_modules/commander/esm.mjs +16 -0
- package/connectors/connect-yousign/node_modules/commander/index.js +24 -0
- package/connectors/connect-yousign/node_modules/commander/lib/argument.js +149 -0
- package/connectors/connect-yousign/node_modules/commander/lib/command.js +2509 -0
- package/connectors/connect-yousign/node_modules/commander/lib/error.js +39 -0
- package/connectors/connect-yousign/node_modules/commander/lib/help.js +520 -0
- package/connectors/connect-yousign/node_modules/commander/lib/option.js +330 -0
- package/connectors/connect-yousign/node_modules/commander/lib/suggestSimilar.js +101 -0
- package/connectors/connect-yousign/node_modules/commander/package-support.json +16 -0
- package/connectors/connect-yousign/node_modules/commander/package.json +84 -0
- package/connectors/connect-yousign/node_modules/commander/typings/esm.d.mts +3 -0
- package/connectors/connect-yousign/node_modules/commander/typings/index.d.ts +969 -0
- package/connectors/connect-yousign/node_modules/typescript/LICENSE.txt +55 -0
- package/connectors/connect-yousign/node_modules/typescript/README.md +50 -0
- package/connectors/connect-yousign/node_modules/typescript/SECURITY.md +41 -0
- package/connectors/connect-yousign/node_modules/typescript/ThirdPartyNoticeText.txt +193 -0
- package/connectors/connect-yousign/node_modules/typescript/bin/tsc +2 -0
- package/connectors/connect-yousign/node_modules/typescript/bin/tsserver +2 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/_tsc.js +133818 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/_tsserver.js +659 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/_typingsInstaller.js +222 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.d.ts +22 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.decorators.d.ts +384 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.decorators.legacy.d.ts +22 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.d.ts +39429 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.dom.iterable.d.ts +571 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.collection.d.ts +147 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.core.d.ts +597 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.d.ts +28 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.generator.d.ts +77 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.iterable.d.ts +605 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.promise.d.ts +81 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.proxy.d.ts +128 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.reflect.d.ts +144 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.symbol.d.ts +46 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +326 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.array.include.d.ts +116 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.full.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2016.intl.d.ts +31 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.d.ts +26 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.date.d.ts +31 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.full.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.intl.d.ts +44 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.object.d.ts +49 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +135 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.string.d.ts +45 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +53 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +77 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +53 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.intl.d.ts +83 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.promise.d.ts +30 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2018.regexp.d.ts +37 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.array.d.ts +79 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.intl.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.object.d.ts +33 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.string.d.ts +37 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2019.symbol.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.bigint.d.ts +765 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.d.ts +27 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.date.d.ts +42 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.intl.d.ts +474 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.number.d.ts +28 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.promise.d.ts +47 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +99 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.string.d.ts +44 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.intl.d.ts +166 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.promise.d.ts +48 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.string.d.ts +33 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2021.weakref.d.ts +78 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.array.d.ts +121 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.d.ts +25 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.error.d.ts +75 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.intl.d.ts +145 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.object.d.ts +26 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.regexp.d.ts +39 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2022.string.d.ts +25 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.array.d.ts +924 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.collection.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.d.ts +22 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2023.intl.d.ts +56 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts +65 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.collection.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.d.ts +26 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.object.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.promise.d.ts +35 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.regexp.d.ts +25 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts +68 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es2024.string.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es5.d.ts +4601 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.es6.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.array.d.ts +35 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.collection.d.ts +96 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.decorators.d.ts +28 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.disposable.d.ts +193 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.error.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.float16.d.ts +445 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.full.d.ts +24 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.intl.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.iterator.d.ts +148 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.promise.d.ts +34 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts +25 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.scripthost.d.ts +322 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.d.ts +13150 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +23 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/lib.webworker.iterable.d.ts +340 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/tsc.js +8 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/tsserver.js +8 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/tsserverlibrary.d.ts +17 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/tsserverlibrary.js +21 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/typesMap.json +497 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/typescript.d.ts +11437 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/typescript.js +200276 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/typingsInstaller.js +8 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/watchGuard.js +53 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
- package/connectors/connect-yousign/node_modules/typescript/package.json +120 -0
- package/connectors/connect-yousign/node_modules/undici-types/LICENSE +21 -0
- package/connectors/connect-yousign/node_modules/undici-types/README.md +6 -0
- package/connectors/connect-yousign/node_modules/undici-types/agent.d.ts +32 -0
- package/connectors/connect-yousign/node_modules/undici-types/api.d.ts +43 -0
- package/connectors/connect-yousign/node_modules/undici-types/balanced-pool.d.ts +30 -0
- package/connectors/connect-yousign/node_modules/undici-types/cache-interceptor.d.ts +173 -0
- package/connectors/connect-yousign/node_modules/undici-types/cache.d.ts +36 -0
- package/connectors/connect-yousign/node_modules/undici-types/client-stats.d.ts +15 -0
- package/connectors/connect-yousign/node_modules/undici-types/client.d.ts +108 -0
- package/connectors/connect-yousign/node_modules/undici-types/connector.d.ts +34 -0
- package/connectors/connect-yousign/node_modules/undici-types/content-type.d.ts +21 -0
- package/connectors/connect-yousign/node_modules/undici-types/cookies.d.ts +30 -0
- package/connectors/connect-yousign/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
- package/connectors/connect-yousign/node_modules/undici-types/dispatcher.d.ts +276 -0
- package/connectors/connect-yousign/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
- package/connectors/connect-yousign/node_modules/undici-types/errors.d.ts +161 -0
- package/connectors/connect-yousign/node_modules/undici-types/eventsource.d.ts +66 -0
- package/connectors/connect-yousign/node_modules/undici-types/fetch.d.ts +211 -0
- package/connectors/connect-yousign/node_modules/undici-types/formdata.d.ts +108 -0
- package/connectors/connect-yousign/node_modules/undici-types/global-dispatcher.d.ts +9 -0
- package/connectors/connect-yousign/node_modules/undici-types/global-origin.d.ts +7 -0
- package/connectors/connect-yousign/node_modules/undici-types/h2c-client.d.ts +73 -0
- package/connectors/connect-yousign/node_modules/undici-types/handlers.d.ts +15 -0
- package/connectors/connect-yousign/node_modules/undici-types/header.d.ts +160 -0
- package/connectors/connect-yousign/node_modules/undici-types/index.d.ts +88 -0
- package/connectors/connect-yousign/node_modules/undici-types/interceptors.d.ts +73 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-agent.d.ts +68 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-call-history.d.ts +111 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-client.d.ts +27 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-errors.d.ts +12 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-interceptor.d.ts +94 -0
- package/connectors/connect-yousign/node_modules/undici-types/mock-pool.d.ts +27 -0
- package/connectors/connect-yousign/node_modules/undici-types/package.json +55 -0
- package/connectors/connect-yousign/node_modules/undici-types/patch.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/undici-types/pool-stats.d.ts +19 -0
- package/connectors/connect-yousign/node_modules/undici-types/pool.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/undici-types/proxy-agent.d.ts +29 -0
- package/connectors/connect-yousign/node_modules/undici-types/readable.d.ts +68 -0
- package/connectors/connect-yousign/node_modules/undici-types/retry-agent.d.ts +8 -0
- package/connectors/connect-yousign/node_modules/undici-types/retry-handler.d.ts +125 -0
- package/connectors/connect-yousign/node_modules/undici-types/round-robin-pool.d.ts +41 -0
- package/connectors/connect-yousign/node_modules/undici-types/snapshot-agent.d.ts +109 -0
- package/connectors/connect-yousign/node_modules/undici-types/util.d.ts +18 -0
- package/connectors/connect-yousign/node_modules/undici-types/utility.d.ts +7 -0
- package/connectors/connect-yousign/node_modules/undici-types/webidl.d.ts +341 -0
- package/connectors/connect-yousign/node_modules/undici-types/websocket.d.ts +186 -0
- package/connectors/connect-yousign/package.json +52 -0
- package/connectors/connect-yousign/src/api/client.ts +119 -0
- package/connectors/connect-yousign/src/api/index.ts +221 -0
- package/connectors/connect-yousign/src/cli/index.ts +555 -0
- package/connectors/connect-yousign/src/index.ts +21 -0
- package/connectors/connect-yousign/src/types/index.ts +275 -0
- package/connectors/connect-yousign/src/utils/config.ts +121 -0
- package/connectors/connect-yousign/tsconfig.json +16 -0
- package/dashboard/dist/assets/index-CSlS3oNV.css +1 -0
- package/dashboard/dist/assets/index-sSIkMXYs.js +284 -0
- package/dashboard/dist/index.html +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +22 -312
- package/dist/lib/installer.d.ts +7 -6
- package/dist/lib/registry.d.ts +1 -22
- package/dist/mcp/index.d.ts +1 -1
- package/dist/server/auth.d.ts +2 -4
- package/package.json +1 -2
- package/connectors/connect-huggingface/src/api/datasets.ts +0 -73
- package/connectors/connect-huggingface/src/api/inference.ts +0 -100
- package/connectors/connect-huggingface/src/api/models.ts +0 -66
- package/connectors/connect-huggingface/src/api/spaces.ts +0 -42
- package/dashboard/dist/assets/index-DmR_QNtT.css +0 -1
- package/dashboard/dist/assets/index-Dp-apHbC.js +0 -284
- package/dist/db/agents.d.ts +0 -38
- package/dist/db/agents.test.d.ts +0 -1
- package/dist/db/database.d.ts +0 -7
- package/dist/db/jobs.d.ts +0 -53
- package/dist/db/jobs.test.d.ts +0 -1
- package/dist/db/locks.d.ts +0 -59
- package/dist/db/locks.test.d.ts +0 -1
- package/dist/db/promotions.d.ts +0 -5
- package/dist/db/promotions.test.d.ts +0 -1
- package/dist/db/rate.d.ts +0 -57
- package/dist/db/rate.test.d.ts +0 -1
- package/dist/db/usage.d.ts +0 -17
- package/dist/db/usage.test.d.ts +0 -1
- package/dist/db/workflows.d.ts +0 -26
- package/dist/db/workflows.test.d.ts +0 -1
- package/dist/lib/fuzzy.d.ts +0 -16
- package/dist/lib/fuzzy.test.d.ts +0 -1
- package/dist/lib/llm.d.ts +0 -38
- package/dist/lib/llm.test.d.ts +0 -1
- package/dist/lib/lock.d.ts +0 -22
- package/dist/lib/lock.test.d.ts +0 -1
- package/dist/lib/scheduler.d.ts +0 -20
- package/dist/lib/scheduler.test.d.ts +0 -1
- package/dist/lib/strip.d.ts +0 -20
- package/dist/lib/strip.test.d.ts +0 -1
- package/dist/lib/synonyms.d.ts +0 -12
- package/dist/lib/synonyms.test.d.ts +0 -1
- package/dist/lib/workflow-runner.d.ts +0 -22
package/bin/index.js
CHANGED
|
@@ -4,7 +4,6 @@ var __create = Object.create;
|
|
|
4
4
|
var __getProtoOf = Object.getPrototypeOf;
|
|
5
5
|
var __defProp = Object.defineProperty;
|
|
6
6
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
8
|
var __toESM = (mod, isNodeMode, target) => {
|
|
10
9
|
target = mod != null ? __create(__getProtoOf(mod)) : {};
|
|
@@ -17,20 +16,6 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
17
16
|
});
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
|
-
var __moduleCache = /* @__PURE__ */ new WeakMap;
|
|
21
|
-
var __toCommonJS = (from) => {
|
|
22
|
-
var entry = __moduleCache.get(from), desc;
|
|
23
|
-
if (entry)
|
|
24
|
-
return entry;
|
|
25
|
-
entry = __defProp({}, "__esModule", { value: true });
|
|
26
|
-
if (from && typeof from === "object" || typeof from === "function")
|
|
27
|
-
__getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
|
|
28
|
-
get: () => from[key],
|
|
29
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
30
|
-
}));
|
|
31
|
-
__moduleCache.set(from, entry);
|
|
32
|
-
return entry;
|
|
33
|
-
};
|
|
34
19
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
35
20
|
var __export = (target, all) => {
|
|
36
21
|
for (var name in all)
|
|
@@ -1883,820 +1868,16 @@ var require_commander = __commonJS((exports) => {
|
|
|
1883
1868
|
exports.InvalidOptionArgumentError = InvalidArgumentError;
|
|
1884
1869
|
});
|
|
1885
1870
|
|
|
1886
|
-
// src/lib/llm.ts
|
|
1887
|
-
import { existsSync, readFileSync, writeFileSync, mkdirSync } from "fs";
|
|
1888
|
-
import { join } from "path";
|
|
1889
|
-
import { homedir } from "os";
|
|
1890
|
-
function getLlmConfigPath() {
|
|
1891
|
-
return join(homedir(), ".connectors", "llm.json");
|
|
1892
|
-
}
|
|
1893
|
-
function getLlmConfig() {
|
|
1894
|
-
const path = getLlmConfigPath();
|
|
1895
|
-
if (!existsSync(path))
|
|
1896
|
-
return null;
|
|
1897
|
-
try {
|
|
1898
|
-
return JSON.parse(readFileSync(path, "utf-8"));
|
|
1899
|
-
} catch {
|
|
1900
|
-
return null;
|
|
1901
|
-
}
|
|
1902
|
-
}
|
|
1903
|
-
function saveLlmConfig(config) {
|
|
1904
|
-
const dir = join(homedir(), ".connectors");
|
|
1905
|
-
mkdirSync(dir, { recursive: true });
|
|
1906
|
-
writeFileSync(getLlmConfigPath(), JSON.stringify(config, null, 2));
|
|
1907
|
-
}
|
|
1908
|
-
function setLlmStrip(enabled) {
|
|
1909
|
-
const config = getLlmConfig();
|
|
1910
|
-
if (!config)
|
|
1911
|
-
throw new Error("No LLM config found. Run: connectors llm set --provider <provider> --key <key>");
|
|
1912
|
-
saveLlmConfig({ ...config, strip: enabled });
|
|
1913
|
-
}
|
|
1914
|
-
function maskKey(key) {
|
|
1915
|
-
if (key.length <= 8)
|
|
1916
|
-
return "***";
|
|
1917
|
-
return key.slice(0, 8) + "***";
|
|
1918
|
-
}
|
|
1919
|
-
|
|
1920
|
-
class LLMClient {
|
|
1921
|
-
config;
|
|
1922
|
-
constructor(config) {
|
|
1923
|
-
this.config = config;
|
|
1924
|
-
}
|
|
1925
|
-
static fromConfig() {
|
|
1926
|
-
const config = getLlmConfig();
|
|
1927
|
-
if (!config)
|
|
1928
|
-
return null;
|
|
1929
|
-
return new LLMClient(config);
|
|
1930
|
-
}
|
|
1931
|
-
async complete(prompt, content) {
|
|
1932
|
-
const start = Date.now();
|
|
1933
|
-
const { provider, model, api_key } = this.config;
|
|
1934
|
-
if (provider === "anthropic") {
|
|
1935
|
-
return this._anthropicComplete(prompt, content, start);
|
|
1936
|
-
}
|
|
1937
|
-
const baseUrl = PROVIDER_BASE_URLS[provider];
|
|
1938
|
-
const response = await fetch(`${baseUrl}/chat/completions`, {
|
|
1939
|
-
method: "POST",
|
|
1940
|
-
headers: {
|
|
1941
|
-
"Content-Type": "application/json",
|
|
1942
|
-
Authorization: `Bearer ${api_key}`
|
|
1943
|
-
},
|
|
1944
|
-
body: JSON.stringify({
|
|
1945
|
-
model,
|
|
1946
|
-
messages: [
|
|
1947
|
-
{ role: "system", content: prompt },
|
|
1948
|
-
{ role: "user", content }
|
|
1949
|
-
],
|
|
1950
|
-
temperature: 0,
|
|
1951
|
-
max_tokens: 4096
|
|
1952
|
-
})
|
|
1953
|
-
});
|
|
1954
|
-
if (!response.ok) {
|
|
1955
|
-
const error = await response.text();
|
|
1956
|
-
throw new Error(`LLM request failed (${provider} ${response.status}): ${error}`);
|
|
1957
|
-
}
|
|
1958
|
-
const data = await response.json();
|
|
1959
|
-
return {
|
|
1960
|
-
content: data.choices[0].message.content,
|
|
1961
|
-
provider,
|
|
1962
|
-
model,
|
|
1963
|
-
latency_ms: Date.now() - start
|
|
1964
|
-
};
|
|
1965
|
-
}
|
|
1966
|
-
async _anthropicComplete(prompt, content, start) {
|
|
1967
|
-
const { model, api_key } = this.config;
|
|
1968
|
-
const response = await fetch("https://api.anthropic.com/v1/messages", {
|
|
1969
|
-
method: "POST",
|
|
1970
|
-
headers: {
|
|
1971
|
-
"Content-Type": "application/json",
|
|
1972
|
-
"x-api-key": api_key,
|
|
1973
|
-
"anthropic-version": "2023-06-01"
|
|
1974
|
-
},
|
|
1975
|
-
body: JSON.stringify({
|
|
1976
|
-
model,
|
|
1977
|
-
system: prompt,
|
|
1978
|
-
messages: [{ role: "user", content }],
|
|
1979
|
-
max_tokens: 4096
|
|
1980
|
-
})
|
|
1981
|
-
});
|
|
1982
|
-
if (!response.ok) {
|
|
1983
|
-
const error = await response.text();
|
|
1984
|
-
throw new Error(`LLM request failed (anthropic ${response.status}): ${error}`);
|
|
1985
|
-
}
|
|
1986
|
-
const data = await response.json();
|
|
1987
|
-
return {
|
|
1988
|
-
content: data.content[0].text,
|
|
1989
|
-
provider: "anthropic",
|
|
1990
|
-
model,
|
|
1991
|
-
latency_ms: Date.now() - start
|
|
1992
|
-
};
|
|
1993
|
-
}
|
|
1994
|
-
}
|
|
1995
|
-
var PROVIDER_BASE_URLS, PROVIDER_DEFAULTS;
|
|
1996
|
-
var init_llm = __esm(() => {
|
|
1997
|
-
PROVIDER_BASE_URLS = {
|
|
1998
|
-
cerebras: "https://api.cerebras.ai/v1",
|
|
1999
|
-
groq: "https://api.groq.com/openai/v1",
|
|
2000
|
-
openai: "https://api.openai.com/v1"
|
|
2001
|
-
};
|
|
2002
|
-
PROVIDER_DEFAULTS = {
|
|
2003
|
-
cerebras: { model: "qwen-3-32b" },
|
|
2004
|
-
groq: { model: "llama-3.3-70b-versatile" },
|
|
2005
|
-
openai: { model: "gpt-4o-mini" },
|
|
2006
|
-
anthropic: { model: "claude-haiku-4-5-20251001" }
|
|
2007
|
-
};
|
|
2008
|
-
});
|
|
2009
|
-
|
|
2010
|
-
// src/db/database.ts
|
|
2011
|
-
var exports_database = {};
|
|
2012
|
-
__export(exports_database, {
|
|
2013
|
-
shortUuid: () => shortUuid,
|
|
2014
|
-
now: () => now,
|
|
2015
|
-
getDatabase: () => getDatabase,
|
|
2016
|
-
closeDatabase: () => closeDatabase
|
|
2017
|
-
});
|
|
2018
|
-
import { Database } from "bun:sqlite";
|
|
2019
|
-
import { join as join2 } from "path";
|
|
2020
|
-
import { homedir as homedir2 } from "os";
|
|
2021
|
-
import { mkdirSync as mkdirSync2 } from "fs";
|
|
2022
|
-
function getDatabase(path) {
|
|
2023
|
-
if (_db)
|
|
2024
|
-
return _db;
|
|
2025
|
-
const dbPath = path ?? DB_PATH;
|
|
2026
|
-
mkdirSync2(join2(dbPath, ".."), { recursive: true });
|
|
2027
|
-
_db = new Database(dbPath);
|
|
2028
|
-
_db.run("PRAGMA journal_mode = WAL");
|
|
2029
|
-
migrate(_db);
|
|
2030
|
-
return _db;
|
|
2031
|
-
}
|
|
2032
|
-
function closeDatabase() {
|
|
2033
|
-
_db?.close();
|
|
2034
|
-
_db = null;
|
|
2035
|
-
}
|
|
2036
|
-
function now() {
|
|
2037
|
-
return new Date().toISOString();
|
|
2038
|
-
}
|
|
2039
|
-
function shortUuid() {
|
|
2040
|
-
return crypto.randomUUID().slice(0, 8);
|
|
2041
|
-
}
|
|
2042
|
-
function migrate(db) {
|
|
2043
|
-
db.run(`
|
|
2044
|
-
CREATE TABLE IF NOT EXISTS agents (
|
|
2045
|
-
id TEXT PRIMARY KEY,
|
|
2046
|
-
name TEXT UNIQUE NOT NULL,
|
|
2047
|
-
session_id TEXT,
|
|
2048
|
-
role TEXT NOT NULL DEFAULT 'agent',
|
|
2049
|
-
last_seen_at TEXT NOT NULL,
|
|
2050
|
-
created_at TEXT NOT NULL
|
|
2051
|
-
)
|
|
2052
|
-
`);
|
|
2053
|
-
db.run(`
|
|
2054
|
-
CREATE TABLE IF NOT EXISTS resource_locks (
|
|
2055
|
-
id TEXT PRIMARY KEY,
|
|
2056
|
-
resource_type TEXT NOT NULL CHECK(resource_type IN ('connector', 'agent', 'profile', 'token')),
|
|
2057
|
-
resource_id TEXT NOT NULL,
|
|
2058
|
-
agent_id TEXT NOT NULL,
|
|
2059
|
-
lock_type TEXT NOT NULL DEFAULT 'exclusive' CHECK(lock_type IN ('advisory', 'exclusive')),
|
|
2060
|
-
locked_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
2061
|
-
expires_at TEXT NOT NULL
|
|
2062
|
-
)
|
|
2063
|
-
`);
|
|
2064
|
-
db.run(`
|
|
2065
|
-
CREATE UNIQUE INDEX IF NOT EXISTS idx_resource_locks_exclusive
|
|
2066
|
-
ON resource_locks(resource_type, resource_id)
|
|
2067
|
-
WHERE lock_type = 'exclusive'
|
|
2068
|
-
`);
|
|
2069
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_resource_locks_agent ON resource_locks(agent_id)`);
|
|
2070
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_resource_locks_expires ON resource_locks(expires_at)`);
|
|
2071
|
-
db.run(`
|
|
2072
|
-
CREATE TABLE IF NOT EXISTS connector_rate_usage (
|
|
2073
|
-
agent_id TEXT NOT NULL,
|
|
2074
|
-
connector TEXT NOT NULL,
|
|
2075
|
-
window_start TEXT NOT NULL,
|
|
2076
|
-
call_count INTEGER NOT NULL DEFAULT 0,
|
|
2077
|
-
PRIMARY KEY (agent_id, connector, window_start)
|
|
2078
|
-
)
|
|
2079
|
-
`);
|
|
2080
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_rate_usage_window ON connector_rate_usage(connector, window_start)`);
|
|
2081
|
-
db.run(`
|
|
2082
|
-
CREATE TABLE IF NOT EXISTS connector_jobs (
|
|
2083
|
-
id TEXT PRIMARY KEY,
|
|
2084
|
-
name TEXT UNIQUE NOT NULL,
|
|
2085
|
-
connector TEXT NOT NULL,
|
|
2086
|
-
command TEXT NOT NULL,
|
|
2087
|
-
args TEXT NOT NULL DEFAULT '[]',
|
|
2088
|
-
cron TEXT NOT NULL,
|
|
2089
|
-
enabled INTEGER NOT NULL DEFAULT 1,
|
|
2090
|
-
strip INTEGER NOT NULL DEFAULT 0,
|
|
2091
|
-
created_at TEXT NOT NULL,
|
|
2092
|
-
last_run_at TEXT
|
|
2093
|
-
)
|
|
2094
|
-
`);
|
|
2095
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_jobs_enabled ON connector_jobs(enabled)`);
|
|
2096
|
-
db.run(`
|
|
2097
|
-
CREATE TABLE IF NOT EXISTS connector_job_runs (
|
|
2098
|
-
id TEXT PRIMARY KEY,
|
|
2099
|
-
job_id TEXT NOT NULL REFERENCES connector_jobs(id) ON DELETE CASCADE,
|
|
2100
|
-
started_at TEXT NOT NULL,
|
|
2101
|
-
finished_at TEXT,
|
|
2102
|
-
exit_code INTEGER,
|
|
2103
|
-
raw_output TEXT,
|
|
2104
|
-
stripped_output TEXT
|
|
2105
|
-
)
|
|
2106
|
-
`);
|
|
2107
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_job_runs_job ON connector_job_runs(job_id, started_at DESC)`);
|
|
2108
|
-
db.run(`
|
|
2109
|
-
CREATE TABLE IF NOT EXISTS connector_workflows (
|
|
2110
|
-
id TEXT PRIMARY KEY,
|
|
2111
|
-
name TEXT UNIQUE NOT NULL,
|
|
2112
|
-
steps TEXT NOT NULL DEFAULT '[]',
|
|
2113
|
-
enabled INTEGER NOT NULL DEFAULT 1,
|
|
2114
|
-
created_at TEXT NOT NULL
|
|
2115
|
-
)
|
|
2116
|
-
`);
|
|
2117
|
-
db.run(`
|
|
2118
|
-
CREATE TABLE IF NOT EXISTS connector_usage (
|
|
2119
|
-
id TEXT PRIMARY KEY,
|
|
2120
|
-
connector TEXT NOT NULL,
|
|
2121
|
-
action TEXT NOT NULL,
|
|
2122
|
-
agent_id TEXT,
|
|
2123
|
-
timestamp TEXT NOT NULL
|
|
2124
|
-
)
|
|
2125
|
-
`);
|
|
2126
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_usage_connector ON connector_usage(connector, timestamp DESC)`);
|
|
2127
|
-
db.run(`
|
|
2128
|
-
CREATE TABLE IF NOT EXISTS connector_promotions (
|
|
2129
|
-
connector TEXT UNIQUE NOT NULL,
|
|
2130
|
-
promoted_at TEXT NOT NULL
|
|
2131
|
-
)
|
|
2132
|
-
`);
|
|
2133
|
-
}
|
|
2134
|
-
var DB_DIR, DB_PATH, _db = null;
|
|
2135
|
-
var init_database = __esm(() => {
|
|
2136
|
-
DB_DIR = join2(homedir2(), ".connectors");
|
|
2137
|
-
DB_PATH = join2(DB_DIR, "connectors.db");
|
|
2138
|
-
});
|
|
2139
|
-
|
|
2140
|
-
// src/db/jobs.ts
|
|
2141
|
-
function rowToJob(row) {
|
|
2142
|
-
return {
|
|
2143
|
-
...row,
|
|
2144
|
-
args: JSON.parse(row.args || "[]"),
|
|
2145
|
-
enabled: row.enabled === 1,
|
|
2146
|
-
strip: row.strip === 1
|
|
2147
|
-
};
|
|
2148
|
-
}
|
|
2149
|
-
function createJob(input, db) {
|
|
2150
|
-
const d = db ?? getDatabase();
|
|
2151
|
-
const id = shortUuid();
|
|
2152
|
-
const ts = now();
|
|
2153
|
-
d.run("INSERT INTO connector_jobs (id, name, connector, command, args, cron, enabled, strip, created_at) VALUES (?, ?, ?, ?, ?, ?, 1, ?, ?)", [id, input.name, input.connector, input.command, JSON.stringify(input.args ?? []), input.cron, input.strip ? 1 : 0, ts]);
|
|
2154
|
-
return getJob(id, d);
|
|
2155
|
-
}
|
|
2156
|
-
function getJob(id, db) {
|
|
2157
|
-
const d = db ?? getDatabase();
|
|
2158
|
-
const row = d.query("SELECT * FROM connector_jobs WHERE id = ?").get(id);
|
|
2159
|
-
return row ? rowToJob(row) : null;
|
|
2160
|
-
}
|
|
2161
|
-
function getJobByName(name, db) {
|
|
2162
|
-
const d = db ?? getDatabase();
|
|
2163
|
-
const row = d.query("SELECT * FROM connector_jobs WHERE name = ?").get(name);
|
|
2164
|
-
return row ? rowToJob(row) : null;
|
|
2165
|
-
}
|
|
2166
|
-
function listJobs(db) {
|
|
2167
|
-
const d = db ?? getDatabase();
|
|
2168
|
-
return d.query("SELECT * FROM connector_jobs ORDER BY name").all().map(rowToJob);
|
|
2169
|
-
}
|
|
2170
|
-
function listEnabledJobs(db) {
|
|
2171
|
-
const d = db ?? getDatabase();
|
|
2172
|
-
return d.query("SELECT * FROM connector_jobs WHERE enabled = 1").all().map(rowToJob);
|
|
2173
|
-
}
|
|
2174
|
-
function updateJob(id, input, db) {
|
|
2175
|
-
const d = db ?? getDatabase();
|
|
2176
|
-
const sets = [];
|
|
2177
|
-
const params = [];
|
|
2178
|
-
if (input.name !== undefined) {
|
|
2179
|
-
sets.push("name = ?");
|
|
2180
|
-
params.push(input.name);
|
|
2181
|
-
}
|
|
2182
|
-
if (input.connector !== undefined) {
|
|
2183
|
-
sets.push("connector = ?");
|
|
2184
|
-
params.push(input.connector);
|
|
2185
|
-
}
|
|
2186
|
-
if (input.command !== undefined) {
|
|
2187
|
-
sets.push("command = ?");
|
|
2188
|
-
params.push(input.command);
|
|
2189
|
-
}
|
|
2190
|
-
if (input.args !== undefined) {
|
|
2191
|
-
sets.push("args = ?");
|
|
2192
|
-
params.push(JSON.stringify(input.args));
|
|
2193
|
-
}
|
|
2194
|
-
if (input.cron !== undefined) {
|
|
2195
|
-
sets.push("cron = ?");
|
|
2196
|
-
params.push(input.cron);
|
|
2197
|
-
}
|
|
2198
|
-
if (input.enabled !== undefined) {
|
|
2199
|
-
sets.push("enabled = ?");
|
|
2200
|
-
params.push(input.enabled ? 1 : 0);
|
|
2201
|
-
}
|
|
2202
|
-
if (input.strip !== undefined) {
|
|
2203
|
-
sets.push("strip = ?");
|
|
2204
|
-
params.push(input.strip ? 1 : 0);
|
|
2205
|
-
}
|
|
2206
|
-
if (sets.length === 0)
|
|
2207
|
-
return getJob(id, d);
|
|
2208
|
-
params.push(id);
|
|
2209
|
-
d.run(`UPDATE connector_jobs SET ${sets.join(", ")} WHERE id = ?`, params);
|
|
2210
|
-
return getJob(id, d);
|
|
2211
|
-
}
|
|
2212
|
-
function deleteJob(id, db) {
|
|
2213
|
-
const d = db ?? getDatabase();
|
|
2214
|
-
return d.run("DELETE FROM connector_jobs WHERE id = ?", [id]).changes > 0;
|
|
2215
|
-
}
|
|
2216
|
-
function touchJobLastRun(id, db) {
|
|
2217
|
-
const d = db ?? getDatabase();
|
|
2218
|
-
d.run("UPDATE connector_jobs SET last_run_at = ? WHERE id = ?", [now(), id]);
|
|
2219
|
-
}
|
|
2220
|
-
function createJobRun(jobId, db) {
|
|
2221
|
-
const d = db ?? getDatabase();
|
|
2222
|
-
const id = shortUuid();
|
|
2223
|
-
const ts = now();
|
|
2224
|
-
d.run("INSERT INTO connector_job_runs (id, job_id, started_at) VALUES (?, ?, ?)", [id, jobId, ts]);
|
|
2225
|
-
return { id, job_id: jobId, started_at: ts, finished_at: null, exit_code: null, raw_output: null, stripped_output: null };
|
|
2226
|
-
}
|
|
2227
|
-
function finishJobRun(id, result, db) {
|
|
2228
|
-
const d = db ?? getDatabase();
|
|
2229
|
-
d.run("UPDATE connector_job_runs SET finished_at = ?, exit_code = ?, raw_output = ?, stripped_output = ? WHERE id = ?", [now(), result.exit_code, result.raw_output, result.stripped_output ?? null, id]);
|
|
2230
|
-
}
|
|
2231
|
-
function listJobRuns(jobId, limit = 20, db) {
|
|
2232
|
-
const d = db ?? getDatabase();
|
|
2233
|
-
return d.query("SELECT * FROM connector_job_runs WHERE job_id = ? ORDER BY started_at DESC LIMIT ?").all(jobId, limit);
|
|
2234
|
-
}
|
|
2235
|
-
var init_jobs = __esm(() => {
|
|
2236
|
-
init_database();
|
|
2237
|
-
});
|
|
2238
|
-
|
|
2239
|
-
// src/db/workflows.ts
|
|
2240
|
-
function rowToWorkflow(row) {
|
|
2241
|
-
return {
|
|
2242
|
-
...row,
|
|
2243
|
-
steps: JSON.parse(row.steps || "[]"),
|
|
2244
|
-
enabled: row.enabled === 1
|
|
2245
|
-
};
|
|
2246
|
-
}
|
|
2247
|
-
function createWorkflow(input, db) {
|
|
2248
|
-
const d = db ?? getDatabase();
|
|
2249
|
-
const id = shortUuid();
|
|
2250
|
-
d.run("INSERT INTO connector_workflows (id, name, steps, enabled, created_at) VALUES (?, ?, ?, 1, ?)", [id, input.name, JSON.stringify(input.steps), now()]);
|
|
2251
|
-
return getWorkflow(id, d);
|
|
2252
|
-
}
|
|
2253
|
-
function getWorkflow(id, db) {
|
|
2254
|
-
const d = db ?? getDatabase();
|
|
2255
|
-
const row = d.query("SELECT * FROM connector_workflows WHERE id = ?").get(id);
|
|
2256
|
-
return row ? rowToWorkflow(row) : null;
|
|
2257
|
-
}
|
|
2258
|
-
function getWorkflowByName(name, db) {
|
|
2259
|
-
const d = db ?? getDatabase();
|
|
2260
|
-
const row = d.query("SELECT * FROM connector_workflows WHERE name = ?").get(name);
|
|
2261
|
-
return row ? rowToWorkflow(row) : null;
|
|
2262
|
-
}
|
|
2263
|
-
function listWorkflows(db) {
|
|
2264
|
-
const d = db ?? getDatabase();
|
|
2265
|
-
return d.query("SELECT * FROM connector_workflows ORDER BY name").all().map(rowToWorkflow);
|
|
2266
|
-
}
|
|
2267
|
-
function deleteWorkflow(id, db) {
|
|
2268
|
-
const d = db ?? getDatabase();
|
|
2269
|
-
return d.run("DELETE FROM connector_workflows WHERE id = ?", [id]).changes > 0;
|
|
2270
|
-
}
|
|
2271
|
-
var init_workflows = __esm(() => {
|
|
2272
|
-
init_database();
|
|
2273
|
-
});
|
|
2274
|
-
|
|
2275
|
-
// src/lib/strip.ts
|
|
2276
|
-
async function maybeStrip(output, _type = "json") {
|
|
2277
|
-
const config = getLlmConfig();
|
|
2278
|
-
if (!config?.strip)
|
|
2279
|
-
return output;
|
|
2280
|
-
if (!output || output.trim().length === 0)
|
|
2281
|
-
return output;
|
|
2282
|
-
const client = LLMClient.fromConfig();
|
|
2283
|
-
if (!client)
|
|
2284
|
-
return output;
|
|
2285
|
-
try {
|
|
2286
|
-
const result = await client.complete(STRIP_PROMPT, output);
|
|
2287
|
-
return result.content.trim();
|
|
2288
|
-
} catch {
|
|
2289
|
-
return output;
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
var STRIP_PROMPT = `You are a data extraction assistant. Your job is to take raw API output and return ONLY the essential, structured data.
|
|
2293
|
-
|
|
2294
|
-
Rules:
|
|
2295
|
-
- Return valid JSON only (no markdown, no explanation)
|
|
2296
|
-
- Remove pagination metadata, rate limit headers, empty fields, null values
|
|
2297
|
-
- Keep all meaningful data fields
|
|
2298
|
-
- If the input is already minimal, return it unchanged
|
|
2299
|
-
- If input is not JSON, extract key facts as a JSON object
|
|
2300
|
-
- Never truncate actual data values`;
|
|
2301
|
-
var init_strip = __esm(() => {
|
|
2302
|
-
init_llm();
|
|
2303
|
-
});
|
|
2304
|
-
|
|
2305
|
-
// src/lib/scheduler.ts
|
|
2306
|
-
var exports_scheduler = {};
|
|
2307
|
-
__export(exports_scheduler, {
|
|
2308
|
-
triggerJob: () => triggerJob,
|
|
2309
|
-
stopScheduler: () => stopScheduler,
|
|
2310
|
-
startScheduler: () => startScheduler
|
|
2311
|
-
});
|
|
2312
|
-
import { spawn } from "child_process";
|
|
2313
|
-
function cronMatches(cron, d) {
|
|
2314
|
-
const parts = cron.trim().split(/\s+/);
|
|
2315
|
-
if (parts.length !== 5)
|
|
2316
|
-
return false;
|
|
2317
|
-
const [min, hour, dom, mon, dow] = parts;
|
|
2318
|
-
function matches(field, value, min_v, max_v) {
|
|
2319
|
-
if (field === "*")
|
|
2320
|
-
return true;
|
|
2321
|
-
if (field.startsWith("*/")) {
|
|
2322
|
-
const step = parseInt(field.slice(2));
|
|
2323
|
-
return value % step === 0;
|
|
2324
|
-
}
|
|
2325
|
-
if (field.includes("-")) {
|
|
2326
|
-
const [a, b] = field.split("-").map(Number);
|
|
2327
|
-
return value >= a && value <= b;
|
|
2328
|
-
}
|
|
2329
|
-
if (field.includes(",")) {
|
|
2330
|
-
return field.split(",").map(Number).includes(value);
|
|
2331
|
-
}
|
|
2332
|
-
return parseInt(field) === value;
|
|
2333
|
-
}
|
|
2334
|
-
return matches(min, d.getMinutes(), 0, 59) && matches(hour, d.getHours(), 0, 23) && matches(dom, d.getDate(), 1, 31) && matches(mon, d.getMonth() + 1, 1, 12) && matches(dow, d.getDay(), 0, 6);
|
|
2335
|
-
}
|
|
2336
|
-
async function runConnectorCommand(connector, command, args) {
|
|
2337
|
-
return new Promise((resolve) => {
|
|
2338
|
-
const cmdArgs = [connector, command, ...args, "--format", "json"];
|
|
2339
|
-
const proc = spawn("connectors", ["run", ...cmdArgs], { shell: false });
|
|
2340
|
-
let output = "";
|
|
2341
|
-
proc.stdout.on("data", (d) => {
|
|
2342
|
-
output += d.toString();
|
|
2343
|
-
});
|
|
2344
|
-
proc.stderr.on("data", (d) => {
|
|
2345
|
-
output += d.toString();
|
|
2346
|
-
});
|
|
2347
|
-
proc.on("close", (code) => resolve({ exitCode: code ?? 1, output }));
|
|
2348
|
-
proc.on("error", () => resolve({ exitCode: 1, output: `Failed to spawn connectors run` }));
|
|
2349
|
-
setTimeout(() => {
|
|
2350
|
-
proc.kill();
|
|
2351
|
-
resolve({ exitCode: 124, output: output + `
|
|
2352
|
-
[timeout]` });
|
|
2353
|
-
}, 60000);
|
|
2354
|
-
});
|
|
2355
|
-
}
|
|
2356
|
-
async function executeJob(job, db) {
|
|
2357
|
-
const run = createJobRun(job.id, db);
|
|
2358
|
-
try {
|
|
2359
|
-
const { exitCode, output } = await runConnectorCommand(job.connector, job.command, job.args);
|
|
2360
|
-
const stripped = job.strip ? await maybeStrip(output) : undefined;
|
|
2361
|
-
finishJobRun(run.id, { exit_code: exitCode, raw_output: output, stripped_output: stripped }, db);
|
|
2362
|
-
touchJobLastRun(job.id, db);
|
|
2363
|
-
} catch (e) {
|
|
2364
|
-
finishJobRun(run.id, { exit_code: 1, raw_output: String(e) }, db);
|
|
2365
|
-
}
|
|
2366
|
-
}
|
|
2367
|
-
function startScheduler(db) {
|
|
2368
|
-
if (_interval)
|
|
2369
|
-
return;
|
|
2370
|
-
_interval = setInterval(async () => {
|
|
2371
|
-
const now2 = new Date;
|
|
2372
|
-
const currentMinute = now2.getMinutes() + now2.getHours() * 60;
|
|
2373
|
-
if (currentMinute === _lastCheckedMinute)
|
|
2374
|
-
return;
|
|
2375
|
-
_lastCheckedMinute = currentMinute;
|
|
2376
|
-
const jobs = listEnabledJobs(db);
|
|
2377
|
-
for (const job of jobs) {
|
|
2378
|
-
if (cronMatches(job.cron, now2)) {
|
|
2379
|
-
executeJob(job, db).catch(() => {});
|
|
2380
|
-
}
|
|
2381
|
-
}
|
|
2382
|
-
}, 30000);
|
|
2383
|
-
}
|
|
2384
|
-
function stopScheduler() {
|
|
2385
|
-
if (_interval) {
|
|
2386
|
-
clearInterval(_interval);
|
|
2387
|
-
_interval = null;
|
|
2388
|
-
_lastCheckedMinute = -1;
|
|
2389
|
-
}
|
|
2390
|
-
}
|
|
2391
|
-
async function triggerJob(job, db) {
|
|
2392
|
-
const run = createJobRun(job.id, db);
|
|
2393
|
-
const { exitCode, output } = await runConnectorCommand(job.connector, job.command, job.args);
|
|
2394
|
-
const stripped = job.strip ? await maybeStrip(output) : undefined;
|
|
2395
|
-
finishJobRun(run.id, { exit_code: exitCode, raw_output: output, stripped_output: stripped }, db);
|
|
2396
|
-
touchJobLastRun(job.id, db);
|
|
2397
|
-
return { run_id: run.id, exit_code: exitCode, output: stripped ?? output };
|
|
2398
|
-
}
|
|
2399
|
-
var _interval = null, _lastCheckedMinute = -1;
|
|
2400
|
-
var init_scheduler = __esm(() => {
|
|
2401
|
-
init_jobs();
|
|
2402
|
-
init_strip();
|
|
2403
|
-
});
|
|
2404
|
-
|
|
2405
|
-
// src/lib/workflow-runner.ts
|
|
2406
|
-
import { spawn as spawn2 } from "child_process";
|
|
2407
|
-
async function runStep(step, previousOutput) {
|
|
2408
|
-
return new Promise((resolve) => {
|
|
2409
|
-
const args = [...step.args ?? []];
|
|
2410
|
-
if (previousOutput && previousOutput.trim()) {
|
|
2411
|
-
args.push("--input", previousOutput.trim().slice(0, 4096));
|
|
2412
|
-
}
|
|
2413
|
-
const cmdArgs = ["run", step.connector, step.command, ...args, "--format", "json"];
|
|
2414
|
-
const proc = spawn2("connectors", cmdArgs, { shell: false });
|
|
2415
|
-
let output = "";
|
|
2416
|
-
proc.stdout.on("data", (d) => {
|
|
2417
|
-
output += d.toString();
|
|
2418
|
-
});
|
|
2419
|
-
proc.stderr.on("data", (d) => {
|
|
2420
|
-
output += d.toString();
|
|
2421
|
-
});
|
|
2422
|
-
proc.on("close", (code) => resolve({ exitCode: code ?? 1, output }));
|
|
2423
|
-
proc.on("error", () => resolve({ exitCode: 1, output: "Failed to spawn connectors" }));
|
|
2424
|
-
setTimeout(() => {
|
|
2425
|
-
proc.kill();
|
|
2426
|
-
resolve({ exitCode: 124, output: output + `
|
|
2427
|
-
[timeout]` });
|
|
2428
|
-
}, 60000);
|
|
2429
|
-
});
|
|
2430
|
-
}
|
|
2431
|
-
async function runWorkflow(workflow) {
|
|
2432
|
-
const results = [];
|
|
2433
|
-
let previousOutput;
|
|
2434
|
-
let success = true;
|
|
2435
|
-
for (let i = 0;i < workflow.steps.length; i++) {
|
|
2436
|
-
const step = workflow.steps[i];
|
|
2437
|
-
const { exitCode, output } = await runStep(step, previousOutput);
|
|
2438
|
-
const stripped = await maybeStrip(output);
|
|
2439
|
-
results.push({ step: i + 1, connector: step.connector, command: step.command, exit_code: exitCode, output: stripped });
|
|
2440
|
-
if (exitCode !== 0) {
|
|
2441
|
-
success = false;
|
|
2442
|
-
break;
|
|
2443
|
-
}
|
|
2444
|
-
previousOutput = stripped;
|
|
2445
|
-
}
|
|
2446
|
-
return {
|
|
2447
|
-
workflow_id: workflow.id,
|
|
2448
|
-
workflow_name: workflow.name,
|
|
2449
|
-
steps: results,
|
|
2450
|
-
success,
|
|
2451
|
-
final_output: results[results.length - 1]?.output ?? ""
|
|
2452
|
-
};
|
|
2453
|
-
}
|
|
2454
|
-
var init_workflow_runner = __esm(() => {
|
|
2455
|
-
init_strip();
|
|
2456
|
-
});
|
|
2457
|
-
|
|
2458
|
-
// src/lib/fuzzy.ts
|
|
2459
|
-
function levenshtein(a, b) {
|
|
2460
|
-
const m = a.length;
|
|
2461
|
-
const n = b.length;
|
|
2462
|
-
if (m === 0)
|
|
2463
|
-
return n;
|
|
2464
|
-
if (n === 0)
|
|
2465
|
-
return m;
|
|
2466
|
-
let prev = new Array(n + 1);
|
|
2467
|
-
let curr = new Array(n + 1);
|
|
2468
|
-
for (let j = 0;j <= n; j++)
|
|
2469
|
-
prev[j] = j;
|
|
2470
|
-
for (let i = 1;i <= m; i++) {
|
|
2471
|
-
curr[0] = i;
|
|
2472
|
-
for (let j = 1;j <= n; j++) {
|
|
2473
|
-
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
2474
|
-
curr[j] = Math.min(curr[j - 1] + 1, prev[j] + 1, prev[j - 1] + cost);
|
|
2475
|
-
}
|
|
2476
|
-
[prev, curr] = [curr, prev];
|
|
2477
|
-
}
|
|
2478
|
-
return prev[n];
|
|
2479
|
-
}
|
|
2480
|
-
function bestFuzzyScore(token, candidates, maxDistance = 2) {
|
|
2481
|
-
if (token.length < 3)
|
|
2482
|
-
return 0;
|
|
2483
|
-
let bestDist = maxDistance + 1;
|
|
2484
|
-
for (const c of candidates) {
|
|
2485
|
-
if (Math.abs(token.length - c.length) > maxDistance)
|
|
2486
|
-
continue;
|
|
2487
|
-
const d = levenshtein(token, c);
|
|
2488
|
-
if (d < bestDist)
|
|
2489
|
-
bestDist = d;
|
|
2490
|
-
if (d === 0)
|
|
2491
|
-
return maxDistance + 1;
|
|
2492
|
-
}
|
|
2493
|
-
if (bestDist > maxDistance)
|
|
2494
|
-
return 0;
|
|
2495
|
-
return maxDistance - bestDist + 1;
|
|
2496
|
-
}
|
|
2497
|
-
|
|
2498
|
-
// src/lib/synonyms.ts
|
|
2499
|
-
function expandQuery(tokens) {
|
|
2500
|
-
const synonyms = new Set;
|
|
2501
|
-
for (const token of tokens) {
|
|
2502
|
-
const matches = SYNONYM_MAP[token];
|
|
2503
|
-
if (matches) {
|
|
2504
|
-
for (const syn of matches) {
|
|
2505
|
-
if (!tokens.includes(syn))
|
|
2506
|
-
synonyms.add(syn);
|
|
2507
|
-
}
|
|
2508
|
-
}
|
|
2509
|
-
for (const [key, values] of Object.entries(SYNONYM_MAP)) {
|
|
2510
|
-
if (values.includes(token) && !tokens.includes(key)) {
|
|
2511
|
-
synonyms.add(key);
|
|
2512
|
-
}
|
|
2513
|
-
}
|
|
2514
|
-
}
|
|
2515
|
-
return { original: tokens, expanded: [...synonyms] };
|
|
2516
|
-
}
|
|
2517
|
-
var SYNONYM_MAP;
|
|
2518
|
-
var init_synonyms = __esm(() => {
|
|
2519
|
-
SYNONYM_MAP = {
|
|
2520
|
-
email: ["smtp", "mail", "inbox", "resend", "ses"],
|
|
2521
|
-
chat: ["messaging", "im", "slack", "discord", "teams"],
|
|
2522
|
-
sms: ["text", "twilio", "messaging"],
|
|
2523
|
-
payment: ["billing", "invoicing", "commerce", "checkout", "stripe"],
|
|
2524
|
-
payments: ["billing", "invoicing", "commerce", "checkout", "stripe"],
|
|
2525
|
-
ecommerce: ["shop", "store", "commerce", "shopify"],
|
|
2526
|
-
finance: ["banking", "accounting", "invoicing"],
|
|
2527
|
-
crypto: ["blockchain", "web3", "wallet"],
|
|
2528
|
-
ai: ["llm", "ml", "model", "gpt", "claude", "anthropic", "openai"],
|
|
2529
|
-
llm: ["ai", "model", "gpt", "claude"],
|
|
2530
|
-
auth: ["oauth", "sso", "login", "identity", "authentication"],
|
|
2531
|
-
database: ["db", "sql", "nosql", "postgres", "mongo", "supabase"],
|
|
2532
|
-
deploy: ["hosting", "infrastructure", "ci", "cd", "vercel"],
|
|
2533
|
-
storage: ["files", "drive", "s3", "bucket", "upload"],
|
|
2534
|
-
cloud: ["aws", "gcp", "azure", "infrastructure"],
|
|
2535
|
-
api: ["rest", "graphql", "endpoint", "webhook"],
|
|
2536
|
-
monitoring: ["logs", "observability", "alerting", "datadog", "sentry"],
|
|
2537
|
-
ci: ["cd", "deploy", "pipeline", "github", "actions"],
|
|
2538
|
-
crm: ["sales", "leads", "contacts", "hubspot", "salesforce"],
|
|
2539
|
-
analytics: ["data", "metrics", "tracking", "mixpanel", "amplitude"],
|
|
2540
|
-
project: ["task", "issue", "board", "jira", "linear", "asana"],
|
|
2541
|
-
docs: ["documentation", "wiki", "notion", "confluence"],
|
|
2542
|
-
design: ["figma", "sketch", "ui", "ux"],
|
|
2543
|
-
security: ["auth", "encryption", "compliance", "vault"]
|
|
2544
|
-
};
|
|
2545
|
-
});
|
|
2546
|
-
|
|
2547
1871
|
// src/lib/registry.ts
|
|
2548
|
-
import { existsSync
|
|
2549
|
-
import { join
|
|
1872
|
+
import { existsSync, readFileSync } from "fs";
|
|
1873
|
+
import { join, dirname } from "path";
|
|
2550
1874
|
import { fileURLToPath } from "url";
|
|
2551
1875
|
function getConnectorsByCategory(category) {
|
|
2552
1876
|
return CONNECTORS.filter((c) => c.category === category);
|
|
2553
1877
|
}
|
|
2554
|
-
function searchConnectors(query
|
|
2555
|
-
const
|
|
2556
|
-
|
|
2557
|
-
return [];
|
|
2558
|
-
const limit = context?.limit ?? 20;
|
|
2559
|
-
const installed = new Set(context?.installed ?? []);
|
|
2560
|
-
const promoted = new Set(context?.promoted ?? []);
|
|
2561
|
-
const usage = context?.usage ?? new Map;
|
|
2562
|
-
const results = [];
|
|
2563
|
-
for (const c of CONNECTORS) {
|
|
2564
|
-
const nameLow = c.name.toLowerCase();
|
|
2565
|
-
const displayLow = c.displayName.toLowerCase();
|
|
2566
|
-
const descLow = c.description.toLowerCase();
|
|
2567
|
-
const tagsLow = c.tags.map((t) => t.toLowerCase());
|
|
2568
|
-
let score = 0;
|
|
2569
|
-
const matchReasons = [];
|
|
2570
|
-
let allTokensMatch = true;
|
|
2571
|
-
for (const token of tokens) {
|
|
2572
|
-
let tokenMatched = false;
|
|
2573
|
-
if (nameLow === token) {
|
|
2574
|
-
score += 100;
|
|
2575
|
-
matchReasons.push(`name="${token}"`);
|
|
2576
|
-
tokenMatched = true;
|
|
2577
|
-
} else if (nameLow.includes(token)) {
|
|
2578
|
-
score += 10;
|
|
2579
|
-
matchReasons.push(`name~${token}`);
|
|
2580
|
-
tokenMatched = true;
|
|
2581
|
-
}
|
|
2582
|
-
if (tagsLow.includes(token)) {
|
|
2583
|
-
score += 8;
|
|
2584
|
-
if (!tokenMatched)
|
|
2585
|
-
matchReasons.push(`tag="${token}"`);
|
|
2586
|
-
tokenMatched = true;
|
|
2587
|
-
} else if (tagsLow.some((t) => t.includes(token))) {
|
|
2588
|
-
score += 5;
|
|
2589
|
-
if (!tokenMatched)
|
|
2590
|
-
matchReasons.push(`tag~${token}`);
|
|
2591
|
-
tokenMatched = true;
|
|
2592
|
-
}
|
|
2593
|
-
if (displayLow.includes(token)) {
|
|
2594
|
-
score += 3;
|
|
2595
|
-
if (!tokenMatched)
|
|
2596
|
-
matchReasons.push(`display~${token}`);
|
|
2597
|
-
tokenMatched = true;
|
|
2598
|
-
}
|
|
2599
|
-
if (descLow.includes(token)) {
|
|
2600
|
-
score += 1;
|
|
2601
|
-
if (!tokenMatched)
|
|
2602
|
-
matchReasons.push(`desc~${token}`);
|
|
2603
|
-
tokenMatched = true;
|
|
2604
|
-
}
|
|
2605
|
-
if (!tokenMatched && token.length >= 3) {
|
|
2606
|
-
const nameFuzzy = bestFuzzyScore(token, [nameLow], 1);
|
|
2607
|
-
if (nameFuzzy > 0) {
|
|
2608
|
-
score += nameFuzzy * 6;
|
|
2609
|
-
matchReasons.push(`fuzzy:name\u2248${token}`);
|
|
2610
|
-
tokenMatched = true;
|
|
2611
|
-
}
|
|
2612
|
-
if (!tokenMatched) {
|
|
2613
|
-
const tagFuzzy = bestFuzzyScore(token, tagsLow, 2);
|
|
2614
|
-
if (tagFuzzy > 0) {
|
|
2615
|
-
score += tagFuzzy * 3;
|
|
2616
|
-
matchReasons.push(`fuzzy:tag\u2248${token}`);
|
|
2617
|
-
tokenMatched = true;
|
|
2618
|
-
}
|
|
2619
|
-
}
|
|
2620
|
-
if (!tokenMatched) {
|
|
2621
|
-
const displayFuzzy = bestFuzzyScore(token, [displayLow], 2);
|
|
2622
|
-
if (displayFuzzy > 0) {
|
|
2623
|
-
score += displayFuzzy * 2;
|
|
2624
|
-
matchReasons.push(`fuzzy:display\u2248${token}`);
|
|
2625
|
-
tokenMatched = true;
|
|
2626
|
-
}
|
|
2627
|
-
}
|
|
2628
|
-
}
|
|
2629
|
-
if (!tokenMatched) {
|
|
2630
|
-
allTokensMatch = false;
|
|
2631
|
-
break;
|
|
2632
|
-
}
|
|
2633
|
-
}
|
|
2634
|
-
if (!allTokensMatch)
|
|
2635
|
-
continue;
|
|
2636
|
-
const badges = [];
|
|
2637
|
-
if (installed.has(c.name)) {
|
|
2638
|
-
score += 50;
|
|
2639
|
-
badges.push("installed");
|
|
2640
|
-
}
|
|
2641
|
-
if (promoted.has(c.name)) {
|
|
2642
|
-
score += 30;
|
|
2643
|
-
badges.push("promoted");
|
|
2644
|
-
}
|
|
2645
|
-
const usageCount = usage.get(c.name) ?? 0;
|
|
2646
|
-
if (usageCount > 0) {
|
|
2647
|
-
score += Math.min(usageCount * 2, 40);
|
|
2648
|
-
if (usageCount >= 5)
|
|
2649
|
-
badges.push("hot");
|
|
2650
|
-
}
|
|
2651
|
-
results.push({ ...c, score, matchReasons, badges });
|
|
2652
|
-
}
|
|
2653
|
-
const matchedNames = new Set(results.map((r) => r.name));
|
|
2654
|
-
if (results.length < limit) {
|
|
2655
|
-
const { expanded } = expandQuery(tokens);
|
|
2656
|
-
if (expanded.length > 0) {
|
|
2657
|
-
for (const c of CONNECTORS) {
|
|
2658
|
-
if (matchedNames.has(c.name))
|
|
2659
|
-
continue;
|
|
2660
|
-
const nameLow2 = c.name.toLowerCase();
|
|
2661
|
-
const tagsLow2 = c.tags.map((t) => t.toLowerCase());
|
|
2662
|
-
const descLow2 = c.description.toLowerCase();
|
|
2663
|
-
let synScore = 0;
|
|
2664
|
-
const synReasons = [];
|
|
2665
|
-
for (const syn of expanded) {
|
|
2666
|
-
if (nameLow2.includes(syn)) {
|
|
2667
|
-
synScore += 2;
|
|
2668
|
-
synReasons.push(`syn:name~${syn}`);
|
|
2669
|
-
} else if (tagsLow2.some((t) => t.includes(syn))) {
|
|
2670
|
-
synScore += 1;
|
|
2671
|
-
synReasons.push(`syn:tag~${syn}`);
|
|
2672
|
-
} else if (descLow2.includes(syn)) {
|
|
2673
|
-
synScore += 1;
|
|
2674
|
-
synReasons.push(`syn:desc~${syn}`);
|
|
2675
|
-
}
|
|
2676
|
-
}
|
|
2677
|
-
if (synScore > 0) {
|
|
2678
|
-
const badges = [];
|
|
2679
|
-
if (installed.has(c.name)) {
|
|
2680
|
-
synScore += 50;
|
|
2681
|
-
badges.push("installed");
|
|
2682
|
-
}
|
|
2683
|
-
if (promoted.has(c.name)) {
|
|
2684
|
-
synScore += 30;
|
|
2685
|
-
badges.push("promoted");
|
|
2686
|
-
}
|
|
2687
|
-
const usageCount = usage.get(c.name) ?? 0;
|
|
2688
|
-
if (usageCount > 0) {
|
|
2689
|
-
synScore += Math.min(usageCount * 2, 40);
|
|
2690
|
-
if (usageCount >= 5)
|
|
2691
|
-
badges.push("hot");
|
|
2692
|
-
}
|
|
2693
|
-
results.push({ ...c, score: synScore, matchReasons: synReasons, badges });
|
|
2694
|
-
}
|
|
2695
|
-
}
|
|
2696
|
-
}
|
|
2697
|
-
}
|
|
2698
|
-
results.sort((a, b) => b.score - a.score);
|
|
2699
|
-
return results.slice(0, limit);
|
|
1878
|
+
function searchConnectors(query) {
|
|
1879
|
+
const q = query.toLowerCase();
|
|
1880
|
+
return CONNECTORS.filter((c) => c.name.toLowerCase().includes(q) || c.displayName.toLowerCase().includes(q) || c.description.toLowerCase().includes(q) || c.tags.some((t) => t.includes(q)));
|
|
2700
1881
|
}
|
|
2701
1882
|
function getConnector(name) {
|
|
2702
1883
|
return CONNECTORS.find((c) => c.name === name);
|
|
@@ -2707,17 +1888,17 @@ function loadConnectorVersions() {
|
|
|
2707
1888
|
versionsLoaded = true;
|
|
2708
1889
|
const thisDir = dirname(fileURLToPath(import.meta.url));
|
|
2709
1890
|
const candidates = [
|
|
2710
|
-
|
|
2711
|
-
|
|
1891
|
+
join(thisDir, "..", "connectors"),
|
|
1892
|
+
join(thisDir, "..", "..", "connectors")
|
|
2712
1893
|
];
|
|
2713
|
-
const connectorsDir = candidates.find((d) =>
|
|
1894
|
+
const connectorsDir = candidates.find((d) => existsSync(d));
|
|
2714
1895
|
if (!connectorsDir)
|
|
2715
1896
|
return;
|
|
2716
1897
|
for (const connector of CONNECTORS) {
|
|
2717
1898
|
try {
|
|
2718
|
-
const pkgPath =
|
|
2719
|
-
if (
|
|
2720
|
-
const pkg = JSON.parse(
|
|
1899
|
+
const pkgPath = join(connectorsDir, `connect-${connector.name}`, "package.json");
|
|
1900
|
+
if (existsSync(pkgPath)) {
|
|
1901
|
+
const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
|
|
2721
1902
|
connector.version = pkg.version || "0.0.0";
|
|
2722
1903
|
}
|
|
2723
1904
|
} catch {}
|
|
@@ -2725,7 +1906,6 @@ function loadConnectorVersions() {
|
|
|
2725
1906
|
}
|
|
2726
1907
|
var CATEGORIES, CONNECTORS, versionsLoaded = false;
|
|
2727
1908
|
var init_registry = __esm(() => {
|
|
2728
|
-
init_synonyms();
|
|
2729
1909
|
CATEGORIES = [
|
|
2730
1910
|
"AI & ML",
|
|
2731
1911
|
"Developer Tools",
|
|
@@ -7611,6 +6791,13 @@ var init_registry = __esm(() => {
|
|
|
7611
6791
|
category: "Business Tools",
|
|
7612
6792
|
tags: ["e-signature", "contracts", "digital", "documents", "legal"]
|
|
7613
6793
|
},
|
|
6794
|
+
{
|
|
6795
|
+
name: "yousign",
|
|
6796
|
+
displayName: "Yousign",
|
|
6797
|
+
description: "eIDAS-compliant electronic signature API for EU workflows",
|
|
6798
|
+
category: "Business Tools",
|
|
6799
|
+
tags: ["e-signature", "eidas", "contracts", "documents", "legal", "eu"]
|
|
6800
|
+
},
|
|
7614
6801
|
{
|
|
7615
6802
|
name: "signl4",
|
|
7616
6803
|
displayName: "SIGNL4",
|
|
@@ -10284,28 +9471,23 @@ var require_cli_spinners = __commonJS((exports, module) => {
|
|
|
10284
9471
|
});
|
|
10285
9472
|
|
|
10286
9473
|
// src/lib/installer.ts
|
|
10287
|
-
import { existsSync as
|
|
10288
|
-
import {
|
|
10289
|
-
import { join as join4, dirname as dirname2 } from "path";
|
|
9474
|
+
import { existsSync as existsSync2, readFileSync as readFileSync2, readdirSync, statSync } from "fs";
|
|
9475
|
+
import { join as join2, dirname as dirname2 } from "path";
|
|
10290
9476
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
10291
9477
|
function resolveConnectorsDir() {
|
|
10292
|
-
const fromBin =
|
|
10293
|
-
if (
|
|
9478
|
+
const fromBin = join2(__dirname2, "..", "connectors");
|
|
9479
|
+
if (existsSync2(fromBin))
|
|
10294
9480
|
return fromBin;
|
|
10295
|
-
const fromSrc =
|
|
10296
|
-
if (
|
|
9481
|
+
const fromSrc = join2(__dirname2, "..", "..", "connectors");
|
|
9482
|
+
if (existsSync2(fromSrc))
|
|
10297
9483
|
return fromSrc;
|
|
10298
9484
|
return fromBin;
|
|
10299
9485
|
}
|
|
10300
9486
|
function getConnectorPath(name) {
|
|
10301
9487
|
const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
|
|
10302
|
-
return
|
|
10303
|
-
}
|
|
10304
|
-
function connectorExists(name) {
|
|
10305
|
-
return existsSync3(getConnectorPath(name));
|
|
9488
|
+
return join2(CONNECTORS_DIR, connectorName);
|
|
10306
9489
|
}
|
|
10307
9490
|
function installConnector(name, options = {}) {
|
|
10308
|
-
const { targetDir = process.cwd(), overwrite = false } = options;
|
|
10309
9491
|
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
10310
9492
|
return {
|
|
10311
9493
|
connector: name,
|
|
@@ -10313,91 +9495,35 @@ function installConnector(name, options = {}) {
|
|
|
10313
9495
|
error: `Invalid connector name '${name}'`
|
|
10314
9496
|
};
|
|
10315
9497
|
}
|
|
10316
|
-
const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
|
|
10317
9498
|
const sourcePath = getConnectorPath(name);
|
|
10318
|
-
|
|
10319
|
-
const destPath = join4(destDir, connectorName);
|
|
10320
|
-
if (!existsSync3(sourcePath)) {
|
|
9499
|
+
if (!existsSync2(sourcePath)) {
|
|
10321
9500
|
return {
|
|
10322
9501
|
connector: name,
|
|
10323
9502
|
success: false,
|
|
10324
9503
|
error: `Connector '${name}' not found`
|
|
10325
9504
|
};
|
|
10326
9505
|
}
|
|
10327
|
-
|
|
10328
|
-
|
|
10329
|
-
|
|
10330
|
-
|
|
10331
|
-
|
|
10332
|
-
path: destPath
|
|
10333
|
-
};
|
|
10334
|
-
}
|
|
10335
|
-
try {
|
|
10336
|
-
if (!existsSync3(destDir)) {
|
|
10337
|
-
mkdirSync3(destDir, { recursive: true });
|
|
10338
|
-
}
|
|
10339
|
-
cpSync(sourcePath, destPath, { recursive: true });
|
|
10340
|
-
const homeCredDir = join4(homedir3(), ".connectors", connectorName);
|
|
10341
|
-
if (existsSync3(homeCredDir)) {
|
|
10342
|
-
const filesToCopy = ["credentials.json", "current_profile"];
|
|
10343
|
-
for (const file of filesToCopy) {
|
|
10344
|
-
const src = join4(homeCredDir, file);
|
|
10345
|
-
if (existsSync3(src)) {
|
|
10346
|
-
cpSync(src, join4(destPath, file));
|
|
10347
|
-
}
|
|
10348
|
-
}
|
|
10349
|
-
const profilesDir = join4(homeCredDir, "profiles");
|
|
10350
|
-
if (existsSync3(profilesDir)) {
|
|
10351
|
-
cpSync(profilesDir, join4(destPath, "profiles"), { recursive: true });
|
|
10352
|
-
}
|
|
10353
|
-
}
|
|
10354
|
-
updateConnectorsIndex(destDir);
|
|
10355
|
-
return {
|
|
10356
|
-
connector: name,
|
|
10357
|
-
success: true,
|
|
10358
|
-
path: destPath
|
|
10359
|
-
};
|
|
10360
|
-
} catch (error) {
|
|
10361
|
-
return {
|
|
10362
|
-
connector: name,
|
|
10363
|
-
success: false,
|
|
10364
|
-
error: error instanceof Error ? error.message : "Unknown error"
|
|
10365
|
-
};
|
|
10366
|
-
}
|
|
10367
|
-
}
|
|
10368
|
-
function updateConnectorsIndex(connectorsDir) {
|
|
10369
|
-
const indexPath = join4(connectorsDir, "index.ts");
|
|
10370
|
-
const connectors = readdirSync(connectorsDir).filter((f) => f.startsWith("connect-") && !f.includes("."));
|
|
10371
|
-
const exports = connectors.map((c) => {
|
|
10372
|
-
const name = c.replace("connect-", "");
|
|
10373
|
-
return `export * as ${name} from './${c}/src/index.js';`;
|
|
10374
|
-
}).join(`
|
|
10375
|
-
`);
|
|
10376
|
-
const content = `/**
|
|
10377
|
-
* Auto-generated index of installed connectors
|
|
10378
|
-
* Do not edit manually - run 'connectors install' to update
|
|
10379
|
-
*/
|
|
10380
|
-
|
|
10381
|
-
${exports}
|
|
10382
|
-
`;
|
|
10383
|
-
writeFileSync2(indexPath, content);
|
|
9506
|
+
return {
|
|
9507
|
+
connector: name,
|
|
9508
|
+
success: true,
|
|
9509
|
+
path: sourcePath
|
|
9510
|
+
};
|
|
10384
9511
|
}
|
|
10385
|
-
function getInstalledConnectors(
|
|
10386
|
-
|
|
10387
|
-
if (!existsSync3(connectorsDir)) {
|
|
9512
|
+
function getInstalledConnectors() {
|
|
9513
|
+
if (!existsSync2(CONNECTORS_DIR)) {
|
|
10388
9514
|
return [];
|
|
10389
9515
|
}
|
|
10390
|
-
return readdirSync(
|
|
10391
|
-
const fullPath =
|
|
9516
|
+
return readdirSync(CONNECTORS_DIR).filter((f) => {
|
|
9517
|
+
const fullPath = join2(CONNECTORS_DIR, f);
|
|
10392
9518
|
return f.startsWith("connect-") && statSync(fullPath).isDirectory();
|
|
10393
9519
|
}).map((f) => f.replace("connect-", ""));
|
|
10394
9520
|
}
|
|
10395
9521
|
function getConnectorDocs(name) {
|
|
10396
9522
|
const connectorPath = getConnectorPath(name);
|
|
10397
|
-
const claudeMdPath =
|
|
10398
|
-
if (!
|
|
9523
|
+
const claudeMdPath = join2(connectorPath, "CLAUDE.md");
|
|
9524
|
+
if (!existsSync2(claudeMdPath))
|
|
10399
9525
|
return null;
|
|
10400
|
-
const raw =
|
|
9526
|
+
const raw = readFileSync2(claudeMdPath, "utf-8");
|
|
10401
9527
|
return {
|
|
10402
9528
|
overview: extractSection(raw, "Project Overview"),
|
|
10403
9529
|
auth: extractSection(raw, "Authentication"),
|
|
@@ -10434,16 +9560,8 @@ function parseEnvVarsTable(section) {
|
|
|
10434
9560
|
}
|
|
10435
9561
|
return vars;
|
|
10436
9562
|
}
|
|
10437
|
-
function removeConnector(name
|
|
10438
|
-
|
|
10439
|
-
const connectorsDir = join4(targetDir, ".connectors");
|
|
10440
|
-
const connectorPath = join4(connectorsDir, connectorName);
|
|
10441
|
-
if (!existsSync3(connectorPath)) {
|
|
10442
|
-
return false;
|
|
10443
|
-
}
|
|
10444
|
-
rmSync(connectorPath, { recursive: true });
|
|
10445
|
-
updateConnectorsIndex(connectorsDir);
|
|
10446
|
-
return true;
|
|
9563
|
+
function removeConnector(name) {
|
|
9564
|
+
return false;
|
|
10447
9565
|
}
|
|
10448
9566
|
var __dirname2, CONNECTORS_DIR;
|
|
10449
9567
|
var init_installer = __esm(() => {
|
|
@@ -10451,77 +9569,11 @@ var init_installer = __esm(() => {
|
|
|
10451
9569
|
CONNECTORS_DIR = resolveConnectorsDir();
|
|
10452
9570
|
});
|
|
10453
9571
|
|
|
10454
|
-
// src/lib/lock.ts
|
|
10455
|
-
import { openSync, closeSync, unlinkSync, existsSync as existsSync4, statSync as statSync2 } from "fs";
|
|
10456
|
-
import { join as join5 } from "path";
|
|
10457
|
-
import { homedir as homedir4 } from "os";
|
|
10458
|
-
import { mkdirSync as mkdirSync4 } from "fs";
|
|
10459
|
-
function lockPath(connector) {
|
|
10460
|
-
const dir = join5(homedir4(), ".connectors", `connect-${connector}`);
|
|
10461
|
-
mkdirSync4(dir, { recursive: true });
|
|
10462
|
-
return join5(dir, ".write.lock");
|
|
10463
|
-
}
|
|
10464
|
-
function isStale(path) {
|
|
10465
|
-
try {
|
|
10466
|
-
const stat = statSync2(path);
|
|
10467
|
-
return Date.now() - stat.mtimeMs > STALE_LOCK_MS;
|
|
10468
|
-
} catch {
|
|
10469
|
-
return false;
|
|
10470
|
-
}
|
|
10471
|
-
}
|
|
10472
|
-
function tryAcquire(path) {
|
|
10473
|
-
if (existsSync4(path) && isStale(path)) {
|
|
10474
|
-
try {
|
|
10475
|
-
unlinkSync(path);
|
|
10476
|
-
} catch {}
|
|
10477
|
-
}
|
|
10478
|
-
try {
|
|
10479
|
-
const fd = openSync(path, "wx");
|
|
10480
|
-
closeSync(fd);
|
|
10481
|
-
return true;
|
|
10482
|
-
} catch (e) {
|
|
10483
|
-
if (e.code === "EEXIST")
|
|
10484
|
-
return false;
|
|
10485
|
-
throw e;
|
|
10486
|
-
}
|
|
10487
|
-
}
|
|
10488
|
-
function release(path) {
|
|
10489
|
-
try {
|
|
10490
|
-
unlinkSync(path);
|
|
10491
|
-
} catch {}
|
|
10492
|
-
}
|
|
10493
|
-
async function withWriteLock(connector, fn) {
|
|
10494
|
-
const path = lockPath(connector);
|
|
10495
|
-
const deadline = Date.now() + LOCK_TIMEOUT_MS;
|
|
10496
|
-
while (Date.now() < deadline) {
|
|
10497
|
-
if (tryAcquire(path)) {
|
|
10498
|
-
try {
|
|
10499
|
-
return await fn();
|
|
10500
|
-
} finally {
|
|
10501
|
-
release(path);
|
|
10502
|
-
}
|
|
10503
|
-
}
|
|
10504
|
-
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_MS));
|
|
10505
|
-
}
|
|
10506
|
-
throw new LockTimeoutError(connector);
|
|
10507
|
-
}
|
|
10508
|
-
var LOCK_TIMEOUT_MS = 5000, LOCK_RETRY_MS = 100, STALE_LOCK_MS = 30000, LockTimeoutError;
|
|
10509
|
-
var init_lock = __esm(() => {
|
|
10510
|
-
LockTimeoutError = class LockTimeoutError extends Error {
|
|
10511
|
-
connector;
|
|
10512
|
-
constructor(connector) {
|
|
10513
|
-
super(`Could not acquire write lock for connector "${connector}" within ${LOCK_TIMEOUT_MS}ms. Another agent may be writing. Try again shortly.`);
|
|
10514
|
-
this.connector = connector;
|
|
10515
|
-
this.name = "LockTimeoutError";
|
|
10516
|
-
}
|
|
10517
|
-
};
|
|
10518
|
-
});
|
|
10519
|
-
|
|
10520
9572
|
// src/server/auth.ts
|
|
10521
|
-
import { existsSync as
|
|
9573
|
+
import { existsSync as existsSync3, readFileSync as readFileSync3, writeFileSync, mkdirSync, readdirSync as readdirSync2, rmSync, statSync as statSync2 } from "fs";
|
|
10522
9574
|
import { randomBytes } from "crypto";
|
|
10523
|
-
import { homedir
|
|
10524
|
-
import { join as
|
|
9575
|
+
import { homedir } from "os";
|
|
9576
|
+
import { join as join3 } from "path";
|
|
10525
9577
|
function getAuthType(name) {
|
|
10526
9578
|
const docs = getConnectorDocs(name);
|
|
10527
9579
|
if (!docs?.auth)
|
|
@@ -10535,14 +9587,14 @@ function getAuthType(name) {
|
|
|
10535
9587
|
}
|
|
10536
9588
|
function getConnectorConfigDir(name) {
|
|
10537
9589
|
const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
|
|
10538
|
-
return
|
|
9590
|
+
return join3(homedir(), ".connectors", connectorName);
|
|
10539
9591
|
}
|
|
10540
9592
|
function getCurrentProfile(name) {
|
|
10541
9593
|
const configDir = getConnectorConfigDir(name);
|
|
10542
|
-
const currentProfileFile =
|
|
10543
|
-
if (
|
|
9594
|
+
const currentProfileFile = join3(configDir, "current_profile");
|
|
9595
|
+
if (existsSync3(currentProfileFile)) {
|
|
10544
9596
|
try {
|
|
10545
|
-
return
|
|
9597
|
+
return readFileSync3(currentProfileFile, "utf-8").trim() || "default";
|
|
10546
9598
|
} catch {
|
|
10547
9599
|
return "default";
|
|
10548
9600
|
}
|
|
@@ -10554,16 +9606,16 @@ function loadProfileConfig(name) {
|
|
|
10554
9606
|
const profile = getCurrentProfile(name);
|
|
10555
9607
|
let flatConfig = {};
|
|
10556
9608
|
let dirConfig = {};
|
|
10557
|
-
const profileFile =
|
|
10558
|
-
if (
|
|
9609
|
+
const profileFile = join3(configDir, "profiles", `${profile}.json`);
|
|
9610
|
+
if (existsSync3(profileFile)) {
|
|
10559
9611
|
try {
|
|
10560
|
-
flatConfig = JSON.parse(
|
|
9612
|
+
flatConfig = JSON.parse(readFileSync3(profileFile, "utf-8"));
|
|
10561
9613
|
} catch {}
|
|
10562
9614
|
}
|
|
10563
|
-
const profileDirConfig =
|
|
10564
|
-
if (
|
|
9615
|
+
const profileDirConfig = join3(configDir, "profiles", profile, "config.json");
|
|
9616
|
+
if (existsSync3(profileDirConfig)) {
|
|
10565
9617
|
try {
|
|
10566
|
-
dirConfig = JSON.parse(
|
|
9618
|
+
dirConfig = JSON.parse(readFileSync3(profileDirConfig, "utf-8"));
|
|
10567
9619
|
} catch {}
|
|
10568
9620
|
}
|
|
10569
9621
|
if (Object.keys(flatConfig).length === 0 && Object.keys(dirConfig).length === 0) {
|
|
@@ -10574,24 +9626,14 @@ function loadProfileConfig(name) {
|
|
|
10574
9626
|
function loadTokens(name) {
|
|
10575
9627
|
const configDir = getConnectorConfigDir(name);
|
|
10576
9628
|
const profile = getCurrentProfile(name);
|
|
10577
|
-
const tokensFile =
|
|
10578
|
-
if (
|
|
9629
|
+
const tokensFile = join3(configDir, "profiles", profile, "tokens.json");
|
|
9630
|
+
if (existsSync3(tokensFile)) {
|
|
10579
9631
|
try {
|
|
10580
|
-
return JSON.parse(
|
|
9632
|
+
return JSON.parse(readFileSync3(tokensFile, "utf-8"));
|
|
10581
9633
|
} catch {
|
|
10582
9634
|
return null;
|
|
10583
9635
|
}
|
|
10584
9636
|
}
|
|
10585
|
-
const profileConfig = loadProfileConfig(name);
|
|
10586
|
-
if (profileConfig.refreshToken || profileConfig.accessToken) {
|
|
10587
|
-
return {
|
|
10588
|
-
accessToken: profileConfig.accessToken,
|
|
10589
|
-
refreshToken: profileConfig.refreshToken,
|
|
10590
|
-
expiresAt: profileConfig.expiresAt,
|
|
10591
|
-
tokenType: profileConfig.tokenType,
|
|
10592
|
-
scope: profileConfig.scope
|
|
10593
|
-
};
|
|
10594
|
-
}
|
|
10595
9637
|
return null;
|
|
10596
9638
|
}
|
|
10597
9639
|
function getAuthStatus(name) {
|
|
@@ -10636,51 +9678,48 @@ function getEnvVars(name) {
|
|
|
10636
9678
|
const docs = getConnectorDocs(name);
|
|
10637
9679
|
return docs?.envVars || [];
|
|
10638
9680
|
}
|
|
10639
|
-
|
|
10640
|
-
return withWriteLock(name, () => _saveApiKey(name, key, field));
|
|
10641
|
-
}
|
|
10642
|
-
function _saveApiKey(name, key, field) {
|
|
9681
|
+
function saveApiKey(name, key, field) {
|
|
10643
9682
|
const configDir = getConnectorConfigDir(name);
|
|
10644
9683
|
const profile = getCurrentProfile(name);
|
|
10645
9684
|
const keyField = field || guessKeyField(name);
|
|
10646
9685
|
if (keyField === "clientId" || keyField === "clientSecret") {
|
|
10647
|
-
const credentialsFile =
|
|
10648
|
-
|
|
9686
|
+
const credentialsFile = join3(configDir, "credentials.json");
|
|
9687
|
+
mkdirSync(configDir, { recursive: true });
|
|
10649
9688
|
let creds = {};
|
|
10650
|
-
if (
|
|
9689
|
+
if (existsSync3(credentialsFile)) {
|
|
10651
9690
|
try {
|
|
10652
|
-
creds = JSON.parse(
|
|
9691
|
+
creds = JSON.parse(readFileSync3(credentialsFile, "utf-8"));
|
|
10653
9692
|
} catch {}
|
|
10654
9693
|
}
|
|
10655
9694
|
creds[keyField] = key;
|
|
10656
|
-
|
|
9695
|
+
writeFileSync(credentialsFile, JSON.stringify(creds, null, 2));
|
|
10657
9696
|
return;
|
|
10658
9697
|
}
|
|
10659
|
-
const profileFile =
|
|
10660
|
-
const profileDir =
|
|
10661
|
-
if (
|
|
9698
|
+
const profileFile = join3(configDir, "profiles", `${profile}.json`);
|
|
9699
|
+
const profileDir = join3(configDir, "profiles", profile);
|
|
9700
|
+
if (existsSync3(profileFile)) {
|
|
10662
9701
|
let config = {};
|
|
10663
9702
|
try {
|
|
10664
|
-
config = JSON.parse(
|
|
9703
|
+
config = JSON.parse(readFileSync3(profileFile, "utf-8"));
|
|
10665
9704
|
} catch {}
|
|
10666
9705
|
config[keyField] = key;
|
|
10667
|
-
|
|
9706
|
+
writeFileSync(profileFile, JSON.stringify(config, null, 2));
|
|
10668
9707
|
return;
|
|
10669
9708
|
}
|
|
10670
|
-
if (
|
|
10671
|
-
const configFile =
|
|
9709
|
+
if (existsSync3(profileDir)) {
|
|
9710
|
+
const configFile = join3(profileDir, "config.json");
|
|
10672
9711
|
let config = {};
|
|
10673
|
-
if (
|
|
9712
|
+
if (existsSync3(configFile)) {
|
|
10674
9713
|
try {
|
|
10675
|
-
config = JSON.parse(
|
|
9714
|
+
config = JSON.parse(readFileSync3(configFile, "utf-8"));
|
|
10676
9715
|
} catch {}
|
|
10677
9716
|
}
|
|
10678
9717
|
config[keyField] = key;
|
|
10679
|
-
|
|
9718
|
+
writeFileSync(configFile, JSON.stringify(config, null, 2));
|
|
10680
9719
|
return;
|
|
10681
9720
|
}
|
|
10682
|
-
|
|
10683
|
-
|
|
9721
|
+
mkdirSync(profileDir, { recursive: true });
|
|
9722
|
+
writeFileSync(join3(profileDir, "config.json"), JSON.stringify({ [keyField]: key }, null, 2));
|
|
10684
9723
|
}
|
|
10685
9724
|
function guessKeyField(name) {
|
|
10686
9725
|
const docs = getConnectorDocs(name);
|
|
@@ -10698,10 +9737,10 @@ function guessKeyField(name) {
|
|
|
10698
9737
|
}
|
|
10699
9738
|
function getOAuthConfig(name) {
|
|
10700
9739
|
const configDir = getConnectorConfigDir(name);
|
|
10701
|
-
const credentialsFile =
|
|
10702
|
-
if (
|
|
9740
|
+
const credentialsFile = join3(configDir, "credentials.json");
|
|
9741
|
+
if (existsSync3(credentialsFile)) {
|
|
10703
9742
|
try {
|
|
10704
|
-
const creds = JSON.parse(
|
|
9743
|
+
const creds = JSON.parse(readFileSync3(credentialsFile, "utf-8"));
|
|
10705
9744
|
return { clientId: creds.clientId, clientSecret: creds.clientSecret };
|
|
10706
9745
|
} catch {}
|
|
10707
9746
|
}
|
|
@@ -10780,15 +9819,12 @@ async function exchangeOAuthCode(name, code, redirectUri) {
|
|
|
10780
9819
|
function saveOAuthTokens(name, tokens) {
|
|
10781
9820
|
const configDir = getConnectorConfigDir(name);
|
|
10782
9821
|
const profile = getCurrentProfile(name);
|
|
10783
|
-
const profileDir =
|
|
10784
|
-
|
|
10785
|
-
const tokensFile =
|
|
10786
|
-
|
|
9822
|
+
const profileDir = join3(configDir, "profiles", profile);
|
|
9823
|
+
mkdirSync(profileDir, { recursive: true });
|
|
9824
|
+
const tokensFile = join3(profileDir, "tokens.json");
|
|
9825
|
+
writeFileSync(tokensFile, JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
10787
9826
|
}
|
|
10788
9827
|
async function refreshOAuthToken(name) {
|
|
10789
|
-
return withWriteLock(name, () => _refreshOAuthToken(name));
|
|
10790
|
-
}
|
|
10791
|
-
async function _refreshOAuthToken(name) {
|
|
10792
9828
|
const oauthConfig = getOAuthConfig(name);
|
|
10793
9829
|
const currentTokens = loadTokens(name);
|
|
10794
9830
|
if (!oauthConfig.clientId || !oauthConfig.clientSecret) {
|
|
@@ -10825,15 +9861,15 @@ async function _refreshOAuthToken(name) {
|
|
|
10825
9861
|
}
|
|
10826
9862
|
function listProfiles(name) {
|
|
10827
9863
|
const configDir = getConnectorConfigDir(name);
|
|
10828
|
-
const profilesDir =
|
|
10829
|
-
if (!
|
|
9864
|
+
const profilesDir = join3(configDir, "profiles");
|
|
9865
|
+
if (!existsSync3(profilesDir))
|
|
10830
9866
|
return ["default"];
|
|
10831
9867
|
const seen = new Set;
|
|
10832
9868
|
try {
|
|
10833
9869
|
const entries = readdirSync2(profilesDir);
|
|
10834
9870
|
for (const entry of entries) {
|
|
10835
|
-
const fullPath =
|
|
10836
|
-
const stat =
|
|
9871
|
+
const fullPath = join3(profilesDir, entry);
|
|
9872
|
+
const stat = statSync2(fullPath);
|
|
10837
9873
|
if (stat.isDirectory()) {
|
|
10838
9874
|
seen.add(entry);
|
|
10839
9875
|
} else if (entry.endsWith(".json")) {
|
|
@@ -10846,25 +9882,25 @@ function listProfiles(name) {
|
|
|
10846
9882
|
}
|
|
10847
9883
|
function switchProfile(name, profile) {
|
|
10848
9884
|
const configDir = getConnectorConfigDir(name);
|
|
10849
|
-
|
|
10850
|
-
|
|
9885
|
+
mkdirSync(configDir, { recursive: true });
|
|
9886
|
+
writeFileSync(join3(configDir, "current_profile"), profile);
|
|
10851
9887
|
}
|
|
10852
9888
|
function deleteProfile(name, profile) {
|
|
10853
9889
|
if (profile === "default")
|
|
10854
9890
|
return false;
|
|
10855
9891
|
const configDir = getConnectorConfigDir(name);
|
|
10856
|
-
const profilesDir =
|
|
10857
|
-
const profileFile =
|
|
10858
|
-
if (
|
|
10859
|
-
|
|
9892
|
+
const profilesDir = join3(configDir, "profiles");
|
|
9893
|
+
const profileFile = join3(profilesDir, `${profile}.json`);
|
|
9894
|
+
if (existsSync3(profileFile)) {
|
|
9895
|
+
rmSync(profileFile);
|
|
10860
9896
|
if (getCurrentProfile(name) === profile) {
|
|
10861
9897
|
switchProfile(name, "default");
|
|
10862
9898
|
}
|
|
10863
9899
|
return true;
|
|
10864
9900
|
}
|
|
10865
|
-
const profileDir =
|
|
10866
|
-
if (
|
|
10867
|
-
|
|
9901
|
+
const profileDir = join3(profilesDir, profile);
|
|
9902
|
+
if (existsSync3(profileDir)) {
|
|
9903
|
+
rmSync(profileDir, { recursive: true });
|
|
10868
9904
|
if (getCurrentProfile(name) === profile) {
|
|
10869
9905
|
switchProfile(name, "default");
|
|
10870
9906
|
}
|
|
@@ -10875,7 +9911,6 @@ function deleteProfile(name, profile) {
|
|
|
10875
9911
|
var FETCH_TIMEOUT = 1e4, oauthStateStore, GOOGLE_AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth", GOOGLE_TOKEN_URL = "https://oauth2.googleapis.com/token", GOOGLE_SCOPES;
|
|
10876
9912
|
var init_auth = __esm(() => {
|
|
10877
9913
|
init_installer();
|
|
10878
|
-
init_lock();
|
|
10879
9914
|
oauthStateStore = new Map;
|
|
10880
9915
|
GOOGLE_SCOPES = {
|
|
10881
9916
|
gmail: [
|
|
@@ -10917,222 +9952,15 @@ var init_auth = __esm(() => {
|
|
|
10917
9952
|
};
|
|
10918
9953
|
});
|
|
10919
9954
|
|
|
10920
|
-
// src/db/promotions.ts
|
|
10921
|
-
var exports_promotions = {};
|
|
10922
|
-
__export(exports_promotions, {
|
|
10923
|
-
promoteConnector: () => promoteConnector,
|
|
10924
|
-
isPromoted: () => isPromoted,
|
|
10925
|
-
getPromotedConnectors: () => getPromotedConnectors,
|
|
10926
|
-
demoteConnector: () => demoteConnector
|
|
10927
|
-
});
|
|
10928
|
-
function promoteConnector(name, db) {
|
|
10929
|
-
const d = db ?? getDatabase();
|
|
10930
|
-
d.run("INSERT OR REPLACE INTO connector_promotions (connector, promoted_at) VALUES (?, ?)", [name, now()]);
|
|
10931
|
-
}
|
|
10932
|
-
function demoteConnector(name, db) {
|
|
10933
|
-
const d = db ?? getDatabase();
|
|
10934
|
-
return d.run("DELETE FROM connector_promotions WHERE connector = ?", [name]).changes > 0;
|
|
10935
|
-
}
|
|
10936
|
-
function getPromotedConnectors(db) {
|
|
10937
|
-
const d = db ?? getDatabase();
|
|
10938
|
-
return d.query("SELECT connector FROM connector_promotions ORDER BY promoted_at DESC").all().map((r) => r.connector);
|
|
10939
|
-
}
|
|
10940
|
-
function isPromoted(name, db) {
|
|
10941
|
-
const d = db ?? getDatabase();
|
|
10942
|
-
const row = d.query("SELECT 1 FROM connector_promotions WHERE connector = ?").get(name);
|
|
10943
|
-
return !!row;
|
|
10944
|
-
}
|
|
10945
|
-
var init_promotions = __esm(() => {
|
|
10946
|
-
init_database();
|
|
10947
|
-
});
|
|
10948
|
-
|
|
10949
|
-
// src/db/usage.ts
|
|
10950
|
-
var exports_usage = {};
|
|
10951
|
-
__export(exports_usage, {
|
|
10952
|
-
logUsage: () => logUsage,
|
|
10953
|
-
getUsageStats: () => getUsageStats,
|
|
10954
|
-
getUsageMap: () => getUsageMap,
|
|
10955
|
-
getTopConnectors: () => getTopConnectors,
|
|
10956
|
-
cleanOldUsage: () => cleanOldUsage
|
|
10957
|
-
});
|
|
10958
|
-
function logUsage(connector, action, agentId, db) {
|
|
10959
|
-
const d = db ?? getDatabase();
|
|
10960
|
-
d.run("INSERT INTO connector_usage (id, connector, action, agent_id, timestamp) VALUES (?, ?, ?, ?, ?)", [shortUuid(), connector, action, agentId ?? null, now()]);
|
|
10961
|
-
}
|
|
10962
|
-
function getUsageStats(connector, db) {
|
|
10963
|
-
const d = db ?? getDatabase();
|
|
10964
|
-
const total = d.query("SELECT COUNT(*) as c FROM connector_usage WHERE connector = ?").get(connector).c;
|
|
10965
|
-
const d7 = new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString();
|
|
10966
|
-
const last7d = d.query("SELECT COUNT(*) as c FROM connector_usage WHERE connector = ? AND timestamp > ?").get(connector, d7).c;
|
|
10967
|
-
const d1 = new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString();
|
|
10968
|
-
const last24h = d.query("SELECT COUNT(*) as c FROM connector_usage WHERE connector = ? AND timestamp > ?").get(connector, d1).c;
|
|
10969
|
-
return { connector, total, last7d, last24h };
|
|
10970
|
-
}
|
|
10971
|
-
function getTopConnectors(limit = 10, days = 7, db) {
|
|
10972
|
-
const d = db ?? getDatabase();
|
|
10973
|
-
const since = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();
|
|
10974
|
-
return d.query("SELECT connector, COUNT(*) as count FROM connector_usage WHERE timestamp > ? GROUP BY connector ORDER BY count DESC LIMIT ?").all(since, limit);
|
|
10975
|
-
}
|
|
10976
|
-
function getUsageMap(days = 7, db) {
|
|
10977
|
-
const top = getTopConnectors(100, days, db);
|
|
10978
|
-
return new Map(top.map((t) => [t.connector, t.count]));
|
|
10979
|
-
}
|
|
10980
|
-
function cleanOldUsage(days = 30, db) {
|
|
10981
|
-
const d = db ?? getDatabase();
|
|
10982
|
-
const cutoff = new Date(Date.now() - days * 24 * 60 * 60 * 1000).toISOString();
|
|
10983
|
-
return d.run("DELETE FROM connector_usage WHERE timestamp < ?", [cutoff]).changes;
|
|
10984
|
-
}
|
|
10985
|
-
var init_usage = __esm(() => {
|
|
10986
|
-
init_database();
|
|
10987
|
-
});
|
|
10988
|
-
|
|
10989
|
-
// src/db/agents.ts
|
|
10990
|
-
function shortUuid2() {
|
|
10991
|
-
return crypto.randomUUID().slice(0, 8);
|
|
10992
|
-
}
|
|
10993
|
-
function isAgentConflict(result) {
|
|
10994
|
-
return result.conflict === true;
|
|
10995
|
-
}
|
|
10996
|
-
function registerAgent(input, db) {
|
|
10997
|
-
const d = db ?? getDatabase();
|
|
10998
|
-
const normalizedName = input.name.trim().toLowerCase();
|
|
10999
|
-
const existing = getAgentByName(normalizedName, d);
|
|
11000
|
-
if (existing) {
|
|
11001
|
-
const lastSeenMs = new Date(existing.last_seen_at).getTime();
|
|
11002
|
-
const isActive = Date.now() - lastSeenMs < AGENT_ACTIVE_WINDOW_MS;
|
|
11003
|
-
const sameSession = input.session_id && existing.session_id && input.session_id === existing.session_id;
|
|
11004
|
-
const differentSession = input.session_id && existing.session_id && input.session_id !== existing.session_id;
|
|
11005
|
-
if (isActive && differentSession) {
|
|
11006
|
-
const minutesAgo = Math.round((Date.now() - lastSeenMs) / 60000);
|
|
11007
|
-
return {
|
|
11008
|
-
conflict: true,
|
|
11009
|
-
existing_id: existing.id,
|
|
11010
|
-
existing_name: existing.name,
|
|
11011
|
-
last_seen_at: existing.last_seen_at,
|
|
11012
|
-
session_hint: existing.session_id ? existing.session_id.slice(0, 8) : null,
|
|
11013
|
-
working_dir: null,
|
|
11014
|
-
message: `Agent "${normalizedName}" is already active (last seen ${minutesAgo}m ago). Pass session_id="${existing.session_id}" to reclaim it, or choose a different name.`
|
|
11015
|
-
};
|
|
11016
|
-
}
|
|
11017
|
-
const updates = ["last_seen_at = ?"];
|
|
11018
|
-
const params = [now()];
|
|
11019
|
-
if (input.session_id && !sameSession) {
|
|
11020
|
-
updates.push("session_id = ?");
|
|
11021
|
-
params.push(input.session_id);
|
|
11022
|
-
}
|
|
11023
|
-
params.push(existing.id);
|
|
11024
|
-
d.run(`UPDATE agents SET ${updates.join(", ")} WHERE id = ?`, params);
|
|
11025
|
-
return getAgent(existing.id, d);
|
|
11026
|
-
}
|
|
11027
|
-
const id = shortUuid2();
|
|
11028
|
-
const ts = now();
|
|
11029
|
-
d.run(`INSERT INTO agents (id, name, session_id, role, last_seen_at, created_at)
|
|
11030
|
-
VALUES (?, ?, ?, ?, ?, ?)`, [id, normalizedName, input.session_id ?? null, input.role ?? "agent", ts, ts]);
|
|
11031
|
-
return getAgent(id, d);
|
|
11032
|
-
}
|
|
11033
|
-
function getAgent(id, db) {
|
|
11034
|
-
const d = db ?? getDatabase();
|
|
11035
|
-
return d.query("SELECT * FROM agents WHERE id = ?").get(id);
|
|
11036
|
-
}
|
|
11037
|
-
function getAgentByName(name, db) {
|
|
11038
|
-
const d = db ?? getDatabase();
|
|
11039
|
-
return d.query("SELECT * FROM agents WHERE LOWER(name) = ?").get(name.trim().toLowerCase());
|
|
11040
|
-
}
|
|
11041
|
-
function listAgents(db) {
|
|
11042
|
-
const d = db ?? getDatabase();
|
|
11043
|
-
return d.query("SELECT * FROM agents ORDER BY name").all();
|
|
11044
|
-
}
|
|
11045
|
-
function deleteAgent(id, db) {
|
|
11046
|
-
const d = db ?? getDatabase();
|
|
11047
|
-
return d.run("DELETE FROM agents WHERE id = ?", [id]).changes > 0;
|
|
11048
|
-
}
|
|
11049
|
-
var AGENT_ACTIVE_WINDOW_MS;
|
|
11050
|
-
var init_agents = __esm(() => {
|
|
11051
|
-
init_database();
|
|
11052
|
-
AGENT_ACTIVE_WINDOW_MS = 30 * 60 * 1000;
|
|
11053
|
-
});
|
|
11054
|
-
|
|
11055
|
-
// src/db/rate.ts
|
|
11056
|
-
function ensureRateTable(db) {
|
|
11057
|
-
db.run(`
|
|
11058
|
-
CREATE TABLE IF NOT EXISTS connector_rate_usage (
|
|
11059
|
-
agent_id TEXT NOT NULL,
|
|
11060
|
-
connector TEXT NOT NULL,
|
|
11061
|
-
window_start TEXT NOT NULL,
|
|
11062
|
-
call_count INTEGER NOT NULL DEFAULT 0,
|
|
11063
|
-
PRIMARY KEY (agent_id, connector, window_start)
|
|
11064
|
-
)
|
|
11065
|
-
`);
|
|
11066
|
-
db.run(`CREATE INDEX IF NOT EXISTS idx_rate_usage_window ON connector_rate_usage(connector, window_start)`);
|
|
11067
|
-
}
|
|
11068
|
-
function countActiveAgents(db) {
|
|
11069
|
-
const cutoff = new Date(Date.now() - AGENT_ACTIVE_WINDOW_MS2).toISOString();
|
|
11070
|
-
const row = db.query("SELECT COUNT(*) as count FROM agents WHERE last_seen_at > ?").get(cutoff);
|
|
11071
|
-
return Math.max(1, row?.count ?? 1);
|
|
11072
|
-
}
|
|
11073
|
-
function currentWindowStart() {
|
|
11074
|
-
const now3 = Date.now();
|
|
11075
|
-
const windowMs = WINDOW_SECONDS * 1000;
|
|
11076
|
-
return new Date(Math.floor(now3 / windowMs) * windowMs).toISOString();
|
|
11077
|
-
}
|
|
11078
|
-
function checkRateBudget(agentId, connector, connectorLimit, consume = true, db) {
|
|
11079
|
-
const d = db ?? getDatabase();
|
|
11080
|
-
ensureRateTable(d);
|
|
11081
|
-
const activeAgents = countActiveAgents(d);
|
|
11082
|
-
const budget = Math.max(1, Math.floor(connectorLimit / activeAgents));
|
|
11083
|
-
const windowStart = currentWindowStart();
|
|
11084
|
-
const windowMs = WINDOW_SECONDS * 1000;
|
|
11085
|
-
const windowEnd = new Date(Math.floor(Date.now() / windowMs) * windowMs + windowMs);
|
|
11086
|
-
const windowResetsIn = windowEnd.getTime() - Date.now();
|
|
11087
|
-
const row = d.query("SELECT call_count FROM connector_rate_usage WHERE agent_id = ? AND connector = ? AND window_start = ?").get(agentId, connector, windowStart);
|
|
11088
|
-
const used = row?.call_count ?? 0;
|
|
11089
|
-
if (used >= budget) {
|
|
11090
|
-
return {
|
|
11091
|
-
exceeded: true,
|
|
11092
|
-
connector,
|
|
11093
|
-
agent_id: agentId,
|
|
11094
|
-
budget,
|
|
11095
|
-
used,
|
|
11096
|
-
active_agents: activeAgents,
|
|
11097
|
-
window_resets_in_ms: windowResetsIn,
|
|
11098
|
-
message: `Rate budget exceeded for "${connector}" (${used}/${budget} calls used, ${activeAgents} active agent${activeAgents === 1 ? "" : "s"} sharing limit of ${connectorLimit}/min). Resets in ${Math.ceil(windowResetsIn / 1000)}s.`
|
|
11099
|
-
};
|
|
11100
|
-
}
|
|
11101
|
-
if (consume) {
|
|
11102
|
-
d.run(`INSERT INTO connector_rate_usage (agent_id, connector, window_start, call_count)
|
|
11103
|
-
VALUES (?, ?, ?, 1)
|
|
11104
|
-
ON CONFLICT(agent_id, connector, window_start) DO UPDATE SET call_count = call_count + 1`, [agentId, connector, windowStart]);
|
|
11105
|
-
}
|
|
11106
|
-
return {
|
|
11107
|
-
connector,
|
|
11108
|
-
agent_id: agentId,
|
|
11109
|
-
limit: connectorLimit,
|
|
11110
|
-
active_agents: activeAgents,
|
|
11111
|
-
budget,
|
|
11112
|
-
used: consume ? used + 1 : used,
|
|
11113
|
-
remaining: consume ? budget - used - 1 : budget - used,
|
|
11114
|
-
window_start: windowStart,
|
|
11115
|
-
window_resets_in_ms: windowResetsIn
|
|
11116
|
-
};
|
|
11117
|
-
}
|
|
11118
|
-
function getRateBudget(agentId, connector, connectorLimit, db) {
|
|
11119
|
-
return checkRateBudget(agentId, connector, connectorLimit, false, db);
|
|
11120
|
-
}
|
|
11121
|
-
var AGENT_ACTIVE_WINDOW_MS2, WINDOW_SECONDS = 60;
|
|
11122
|
-
var init_rate = __esm(() => {
|
|
11123
|
-
init_database();
|
|
11124
|
-
AGENT_ACTIVE_WINDOW_MS2 = 30 * 60 * 1000;
|
|
11125
|
-
});
|
|
11126
|
-
|
|
11127
9955
|
// src/server/serve.ts
|
|
11128
9956
|
var exports_serve = {};
|
|
11129
9957
|
__export(exports_serve, {
|
|
11130
9958
|
startServer: () => startServer
|
|
11131
9959
|
});
|
|
11132
|
-
import { existsSync as
|
|
11133
|
-
import { join as
|
|
9960
|
+
import { existsSync as existsSync5, readdirSync as readdirSync3, readFileSync as readFileSync4, writeFileSync as writeFileSync2, mkdirSync as mkdirSync2 } from "fs";
|
|
9961
|
+
import { join as join5, dirname as dirname4, extname, basename } from "path";
|
|
11134
9962
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
11135
|
-
import { homedir as
|
|
9963
|
+
import { homedir as homedir2 } from "os";
|
|
11136
9964
|
function logActivity(action, connector, detail) {
|
|
11137
9965
|
activityLog.unshift({ action, connector, timestamp: Date.now(), detail });
|
|
11138
9966
|
if (activityLog.length > MAX_ACTIVITY_LOG) {
|
|
@@ -11143,20 +9971,20 @@ function resolveDashboardDir() {
|
|
|
11143
9971
|
const candidates = [];
|
|
11144
9972
|
try {
|
|
11145
9973
|
const scriptDir = dirname4(fileURLToPath4(import.meta.url));
|
|
11146
|
-
candidates.push(
|
|
11147
|
-
candidates.push(
|
|
9974
|
+
candidates.push(join5(scriptDir, "..", "dashboard", "dist"));
|
|
9975
|
+
candidates.push(join5(scriptDir, "..", "..", "dashboard", "dist"));
|
|
11148
9976
|
} catch {}
|
|
11149
9977
|
if (process.argv[1]) {
|
|
11150
9978
|
const mainDir = dirname4(process.argv[1]);
|
|
11151
|
-
candidates.push(
|
|
11152
|
-
candidates.push(
|
|
9979
|
+
candidates.push(join5(mainDir, "..", "dashboard", "dist"));
|
|
9980
|
+
candidates.push(join5(mainDir, "..", "..", "dashboard", "dist"));
|
|
11153
9981
|
}
|
|
11154
|
-
candidates.push(
|
|
9982
|
+
candidates.push(join5(process.cwd(), "dashboard", "dist"));
|
|
11155
9983
|
for (const candidate of candidates) {
|
|
11156
|
-
if (
|
|
9984
|
+
if (existsSync5(candidate))
|
|
11157
9985
|
return candidate;
|
|
11158
9986
|
}
|
|
11159
|
-
return
|
|
9987
|
+
return join5(process.cwd(), "dashboard", "dist");
|
|
11160
9988
|
}
|
|
11161
9989
|
function json(data, status = 200, port) {
|
|
11162
9990
|
return new Response(JSON.stringify(data), {
|
|
@@ -11168,18 +9996,6 @@ function json(data, status = 200, port) {
|
|
|
11168
9996
|
}
|
|
11169
9997
|
});
|
|
11170
9998
|
}
|
|
11171
|
-
async function jsonStripped(data, status = 200, port) {
|
|
11172
|
-
const raw = JSON.stringify(data);
|
|
11173
|
-
const body = await maybeStrip(raw);
|
|
11174
|
-
return new Response(body, {
|
|
11175
|
-
status,
|
|
11176
|
-
headers: {
|
|
11177
|
-
"Content-Type": "application/json",
|
|
11178
|
-
"Access-Control-Allow-Origin": port ? `http://localhost:${port}` : "*",
|
|
11179
|
-
...SECURITY_HEADERS
|
|
11180
|
-
}
|
|
11181
|
-
});
|
|
11182
|
-
}
|
|
11183
9999
|
function htmlResponse(content, status = 200) {
|
|
11184
10000
|
return new Response(content, {
|
|
11185
10001
|
status,
|
|
@@ -11241,7 +10057,7 @@ function oauthPage(type, title, message, hint, extra) {
|
|
|
11241
10057
|
</body></html>`;
|
|
11242
10058
|
}
|
|
11243
10059
|
function serveStaticFile(filePath) {
|
|
11244
|
-
if (!
|
|
10060
|
+
if (!existsSync5(filePath))
|
|
11245
10061
|
return null;
|
|
11246
10062
|
const ext = extname(filePath);
|
|
11247
10063
|
const contentType = MIME_TYPES[ext] || "application/octet-stream";
|
|
@@ -11265,7 +10081,7 @@ async function startServer(requestedPort, options) {
|
|
|
11265
10081
|
const shouldOpen = options?.open ?? true;
|
|
11266
10082
|
loadConnectorVersions();
|
|
11267
10083
|
const dashboardDir = resolveDashboardDir();
|
|
11268
|
-
const dashboardExists =
|
|
10084
|
+
const dashboardExists = existsSync5(dashboardDir);
|
|
11269
10085
|
if (!dashboardExists) {
|
|
11270
10086
|
console.error(`
|
|
11271
10087
|
Dashboard not found at: ${dashboardDir}`);
|
|
@@ -11294,10 +10110,10 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11294
10110
|
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
11295
10111
|
const data = getAllConnectorsWithAuth();
|
|
11296
10112
|
if (compact) {
|
|
11297
|
-
return
|
|
10113
|
+
return json(data.map((c) => ({ name: c.name, category: c.category, installed: c.installed })), 200, port);
|
|
11298
10114
|
}
|
|
11299
10115
|
if (fields) {
|
|
11300
|
-
return
|
|
10116
|
+
return json(data.map((c) => {
|
|
11301
10117
|
const out = {};
|
|
11302
10118
|
for (const f of fields) {
|
|
11303
10119
|
if (f in c)
|
|
@@ -11306,7 +10122,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11306
10122
|
return out;
|
|
11307
10123
|
}), 200, port);
|
|
11308
10124
|
}
|
|
11309
|
-
return
|
|
10125
|
+
return json(data, 200, port);
|
|
11310
10126
|
}
|
|
11311
10127
|
const singleMatch = path.match(/^\/api\/connectors\/([^/]+)$/);
|
|
11312
10128
|
if (singleMatch && method === "GET") {
|
|
@@ -11340,7 +10156,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11340
10156
|
const body = await req.json();
|
|
11341
10157
|
if (!body.key)
|
|
11342
10158
|
return json({ error: "Missing 'key' in request body" }, 400, port);
|
|
11343
|
-
|
|
10159
|
+
saveApiKey(name, body.key, body.field);
|
|
11344
10160
|
logActivity("key_saved", name, body.field ? `Field: ${body.field}` : undefined);
|
|
11345
10161
|
return json({ success: true }, 200, port);
|
|
11346
10162
|
} catch (e) {
|
|
@@ -11385,10 +10201,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11385
10201
|
if (!isValidConnectorName(name))
|
|
11386
10202
|
return json({ error: "Invalid connector name" }, 400, port);
|
|
11387
10203
|
try {
|
|
11388
|
-
|
|
11389
|
-
if (!removed) {
|
|
11390
|
-
return json({ error: `Connector '${name}' is not installed` }, 404, port);
|
|
11391
|
-
}
|
|
10204
|
+
removeConnector(name);
|
|
11392
10205
|
logActivity("uninstalled", name);
|
|
11393
10206
|
return json({ success: true, name }, 200, port);
|
|
11394
10207
|
} catch (e) {
|
|
@@ -11414,167 +10227,6 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11414
10227
|
if (path === "/api/activity" && method === "GET") {
|
|
11415
10228
|
return json(activityLog, 200, port);
|
|
11416
10229
|
}
|
|
11417
|
-
if (path === "/api/hot" && method === "GET") {
|
|
11418
|
-
const { getTopConnectors: getTopConnectors2 } = await Promise.resolve().then(() => (init_usage(), exports_usage));
|
|
11419
|
-
const { getPromotedConnectors: getPromotedConnectors2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
11420
|
-
const limit = parseInt(url2.searchParams.get("limit") || "10", 10);
|
|
11421
|
-
const days = parseInt(url2.searchParams.get("days") || "7", 10);
|
|
11422
|
-
const db = getDatabase2();
|
|
11423
|
-
const top = getTopConnectors2(limit, days, db);
|
|
11424
|
-
const promoted = new Set(getPromotedConnectors2(db));
|
|
11425
|
-
return json(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) })), 200, port);
|
|
11426
|
-
}
|
|
11427
|
-
const promoteMatch = path.match(/^\/api\/connectors\/([^/]+)\/promote$/);
|
|
11428
|
-
if (promoteMatch && method === "POST") {
|
|
11429
|
-
const name = promoteMatch[1];
|
|
11430
|
-
if (!getConnector(name))
|
|
11431
|
-
return json({ error: "Connector not found" }, 404, port);
|
|
11432
|
-
const { promoteConnector: promoteConnector2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
11433
|
-
promoteConnector2(name, getDatabase2());
|
|
11434
|
-
return json({ success: true, connector: name }, 200, port);
|
|
11435
|
-
}
|
|
11436
|
-
if (promoteMatch && method === "DELETE") {
|
|
11437
|
-
const { demoteConnector: demoteConnector2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
11438
|
-
const removed = demoteConnector2(promoteMatch[1], getDatabase2());
|
|
11439
|
-
return json({ success: removed, connector: promoteMatch[1] }, 200, port);
|
|
11440
|
-
}
|
|
11441
|
-
if (path === "/api/llm" && method === "GET") {
|
|
11442
|
-
const config = getLlmConfig();
|
|
11443
|
-
if (!config)
|
|
11444
|
-
return json({ configured: false }, 200, port);
|
|
11445
|
-
return json({ configured: true, provider: config.provider, model: config.model, key: maskKey(config.api_key), strip: config.strip }, 200, port);
|
|
11446
|
-
}
|
|
11447
|
-
if (path === "/api/llm" && method === "POST") {
|
|
11448
|
-
const body = await req.json().catch(() => ({}));
|
|
11449
|
-
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
11450
|
-
const provider = body.provider;
|
|
11451
|
-
if (!provider || !validProviders.includes(provider))
|
|
11452
|
-
return json({ error: "provider must be one of: " + validProviders.join(", ") }, 400, port);
|
|
11453
|
-
const api_key = body.api_key;
|
|
11454
|
-
if (!api_key)
|
|
11455
|
-
return json({ error: "api_key is required" }, 400, port);
|
|
11456
|
-
const model = body.model || getLlmConfig()?.model || "qwen-3-32b";
|
|
11457
|
-
const strip = typeof body.strip === "boolean" ? body.strip : getLlmConfig()?.strip ?? false;
|
|
11458
|
-
saveLlmConfig({ provider, model, api_key, strip });
|
|
11459
|
-
return json({ success: true, provider, model, strip }, 200, port);
|
|
11460
|
-
}
|
|
11461
|
-
if (path === "/api/llm/test" && method === "POST") {
|
|
11462
|
-
const config = getLlmConfig();
|
|
11463
|
-
if (!config)
|
|
11464
|
-
return json({ error: "No LLM configured" }, 400, port);
|
|
11465
|
-
try {
|
|
11466
|
-
const client = new LLMClient(config);
|
|
11467
|
-
const result = await client.complete('Respond with exactly: {"status":"ok"}', "ping");
|
|
11468
|
-
return json({ success: true, provider: result.provider, model: result.model, latency_ms: result.latency_ms, response: result.content }, 200, port);
|
|
11469
|
-
} catch (e) {
|
|
11470
|
-
return json({ success: false, error: e instanceof Error ? e.message : String(e) }, 500, port);
|
|
11471
|
-
}
|
|
11472
|
-
}
|
|
11473
|
-
if (path === "/api/jobs" && method === "GET") {
|
|
11474
|
-
return json(listJobs(getDatabase2()), 200, port);
|
|
11475
|
-
}
|
|
11476
|
-
if (path === "/api/jobs" && method === "POST") {
|
|
11477
|
-
const body = await req.json().catch(() => ({}));
|
|
11478
|
-
if (!body.name || !body.connector || !body.command || !body.cron)
|
|
11479
|
-
return json({ error: "name, connector, command, cron required" }, 400, port);
|
|
11480
|
-
const job = createJob({ name: body.name, connector: body.connector, command: body.command, args: body.args ?? [], cron: body.cron, strip: !!body.strip }, getDatabase2());
|
|
11481
|
-
return json(job, 201, port);
|
|
11482
|
-
}
|
|
11483
|
-
const jobMatch = path.match(/^\/api\/jobs\/([^/]+)$/);
|
|
11484
|
-
if (jobMatch) {
|
|
11485
|
-
const db = getDatabase2();
|
|
11486
|
-
const job = getJobByName(jobMatch[1]) ?? getDatabase2().query("SELECT * FROM connector_jobs WHERE id = ?").get(jobMatch[1]);
|
|
11487
|
-
if (!job && method !== "DELETE")
|
|
11488
|
-
return json({ error: "Job not found" }, 404, port);
|
|
11489
|
-
if (method === "GET")
|
|
11490
|
-
return json(listJobRuns(job.id, 20, db), 200, port);
|
|
11491
|
-
if (method === "DELETE") {
|
|
11492
|
-
const j = getJobByName(jobMatch[1], db);
|
|
11493
|
-
if (!j)
|
|
11494
|
-
return json({ error: "Job not found" }, 404, port);
|
|
11495
|
-
deleteJob(j.id, db);
|
|
11496
|
-
return json({ success: true }, 200, port);
|
|
11497
|
-
}
|
|
11498
|
-
if (method === "PATCH") {
|
|
11499
|
-
const body = await req.json().catch(() => ({}));
|
|
11500
|
-
const j = getJobByName(jobMatch[1], db);
|
|
11501
|
-
const updated = updateJob(j.id, { enabled: typeof body.enabled === "boolean" ? body.enabled : undefined, strip: typeof body.strip === "boolean" ? body.strip : undefined }, db);
|
|
11502
|
-
return json(updated, 200, port);
|
|
11503
|
-
}
|
|
11504
|
-
}
|
|
11505
|
-
const jobRunMatch = path.match(/^\/api\/jobs\/([^/]+)\/run$/);
|
|
11506
|
-
if (jobRunMatch && method === "POST") {
|
|
11507
|
-
const db = getDatabase2();
|
|
11508
|
-
const job = getJobByName(jobRunMatch[1], db);
|
|
11509
|
-
if (!job)
|
|
11510
|
-
return json({ error: "Job not found" }, 404, port);
|
|
11511
|
-
const result = await triggerJob(job, db);
|
|
11512
|
-
return json(result, 200, port);
|
|
11513
|
-
}
|
|
11514
|
-
if (path === "/api/workflows" && method === "GET") {
|
|
11515
|
-
return json(listWorkflows(getDatabase2()), 200, port);
|
|
11516
|
-
}
|
|
11517
|
-
if (path === "/api/workflows" && method === "POST") {
|
|
11518
|
-
const body = await req.json().catch(() => ({}));
|
|
11519
|
-
if (!body.name || !body.steps)
|
|
11520
|
-
return json({ error: "name and steps required" }, 400, port);
|
|
11521
|
-
const wf = createWorkflow({ name: body.name, steps: body.steps }, getDatabase2());
|
|
11522
|
-
return json(wf, 201, port);
|
|
11523
|
-
}
|
|
11524
|
-
const wfMatch = path.match(/^\/api\/workflows\/([^/]+)$/);
|
|
11525
|
-
if (wfMatch) {
|
|
11526
|
-
const db = getDatabase2();
|
|
11527
|
-
const wf = getWorkflowByName(wfMatch[1], db);
|
|
11528
|
-
if (!wf)
|
|
11529
|
-
return json({ error: "Workflow not found" }, 404, port);
|
|
11530
|
-
if (method === "GET")
|
|
11531
|
-
return json(wf, 200, port);
|
|
11532
|
-
if (method === "DELETE") {
|
|
11533
|
-
deleteWorkflow(wf.id, db);
|
|
11534
|
-
return json({ success: true }, 200, port);
|
|
11535
|
-
}
|
|
11536
|
-
}
|
|
11537
|
-
const wfRunMatch = path.match(/^\/api\/workflows\/([^/]+)\/run$/);
|
|
11538
|
-
if (wfRunMatch && method === "POST") {
|
|
11539
|
-
const wf = getWorkflowByName(wfRunMatch[1], getDatabase2());
|
|
11540
|
-
if (!wf)
|
|
11541
|
-
return json({ error: "Workflow not found" }, 404, port);
|
|
11542
|
-
const result = await runWorkflow(wf);
|
|
11543
|
-
return json(result, 200, port);
|
|
11544
|
-
}
|
|
11545
|
-
if (path === "/api/agents" && method === "GET") {
|
|
11546
|
-
return json(listAgents(), 200, port);
|
|
11547
|
-
}
|
|
11548
|
-
if (path === "/api/agents/register" && method === "POST") {
|
|
11549
|
-
const body = await req.json().catch(() => ({}));
|
|
11550
|
-
const name = typeof body.name === "string" ? body.name : null;
|
|
11551
|
-
if (!name)
|
|
11552
|
-
return json({ error: "name is required" }, 400, port);
|
|
11553
|
-
const result = registerAgent({
|
|
11554
|
-
name,
|
|
11555
|
-
session_id: typeof body.session_id === "string" ? body.session_id : undefined,
|
|
11556
|
-
role: typeof body.role === "string" ? body.role : undefined
|
|
11557
|
-
});
|
|
11558
|
-
if (isAgentConflict(result))
|
|
11559
|
-
return json(result, 409, port);
|
|
11560
|
-
return json(result, 200, port);
|
|
11561
|
-
}
|
|
11562
|
-
if (path.startsWith("/api/agents/") && method === "DELETE") {
|
|
11563
|
-
const agentName = path.slice("/api/agents/".length);
|
|
11564
|
-
const agent = getAgentByName(agentName);
|
|
11565
|
-
if (!agent)
|
|
11566
|
-
return json({ error: "Agent not found" }, 404, port);
|
|
11567
|
-
deleteAgent(agent.id);
|
|
11568
|
-
return json({ success: true }, 200, port);
|
|
11569
|
-
}
|
|
11570
|
-
const rateMatch = path.match(/^\/api\/rate\/([^/]+)\/([^/]+)$/);
|
|
11571
|
-
if (rateMatch && method === "GET") {
|
|
11572
|
-
const [, agentId, connector] = rateMatch;
|
|
11573
|
-
const limit = parseInt(url2.searchParams.get("limit") || "60", 10);
|
|
11574
|
-
const consume = url2.searchParams.get("consume") === "true";
|
|
11575
|
-
const result = consume ? checkRateBudget(agentId, connector, limit) : getRateBudget(agentId, connector, limit);
|
|
11576
|
-
return json(result, 200, port);
|
|
11577
|
-
}
|
|
11578
10230
|
const profilesMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles$/);
|
|
11579
10231
|
if (profilesMatch && method === "GET") {
|
|
11580
10232
|
const name = profilesMatch[1];
|
|
@@ -11582,12 +10234,12 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11582
10234
|
return json({ error: "Invalid connector name" }, 400, port);
|
|
11583
10235
|
try {
|
|
11584
10236
|
const profiles = listProfiles(name);
|
|
11585
|
-
const configDir =
|
|
11586
|
-
const currentProfileFile =
|
|
10237
|
+
const configDir = join5(homedir2(), ".connectors", name.startsWith("connect-") ? name : `connect-${name}`);
|
|
10238
|
+
const currentProfileFile = join5(configDir, "current_profile");
|
|
11587
10239
|
let current = "default";
|
|
11588
|
-
if (
|
|
10240
|
+
if (existsSync5(currentProfileFile)) {
|
|
11589
10241
|
try {
|
|
11590
|
-
current =
|
|
10242
|
+
current = readFileSync4(currentProfileFile, "utf-8").trim() || "default";
|
|
11591
10243
|
} catch {}
|
|
11592
10244
|
}
|
|
11593
10245
|
return json({ current, profiles }, 200, port);
|
|
@@ -11634,16 +10286,16 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11634
10286
|
}
|
|
11635
10287
|
if (path === "/api/export" && method === "GET") {
|
|
11636
10288
|
try {
|
|
11637
|
-
const connectDir =
|
|
10289
|
+
const connectDir = join5(homedir2(), ".connectors");
|
|
11638
10290
|
const result = {};
|
|
11639
|
-
if (
|
|
10291
|
+
if (existsSync5(connectDir)) {
|
|
11640
10292
|
const entries = readdirSync3(connectDir, { withFileTypes: true });
|
|
11641
10293
|
for (const entry of entries) {
|
|
11642
10294
|
if (!entry.isDirectory() || !entry.name.startsWith("connect-"))
|
|
11643
10295
|
continue;
|
|
11644
10296
|
const connectorName = entry.name.replace(/^connect-/, "");
|
|
11645
|
-
const profilesDir =
|
|
11646
|
-
if (!
|
|
10297
|
+
const profilesDir = join5(connectDir, entry.name, "profiles");
|
|
10298
|
+
if (!existsSync5(profilesDir))
|
|
11647
10299
|
continue;
|
|
11648
10300
|
const profiles = {};
|
|
11649
10301
|
const profileEntries = readdirSync3(profilesDir, { withFileTypes: true });
|
|
@@ -11651,15 +10303,15 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11651
10303
|
if (pEntry.isFile() && pEntry.name.endsWith(".json")) {
|
|
11652
10304
|
const profileName = basename(pEntry.name, ".json");
|
|
11653
10305
|
try {
|
|
11654
|
-
const config = JSON.parse(
|
|
10306
|
+
const config = JSON.parse(readFileSync4(join5(profilesDir, pEntry.name), "utf-8"));
|
|
11655
10307
|
profiles[profileName] = config;
|
|
11656
10308
|
} catch {}
|
|
11657
10309
|
}
|
|
11658
10310
|
if (pEntry.isDirectory()) {
|
|
11659
|
-
const configPath =
|
|
11660
|
-
if (
|
|
10311
|
+
const configPath = join5(profilesDir, pEntry.name, "config.json");
|
|
10312
|
+
if (existsSync5(configPath)) {
|
|
11661
10313
|
try {
|
|
11662
|
-
const config = JSON.parse(
|
|
10314
|
+
const config = JSON.parse(readFileSync4(configPath, "utf-8"));
|
|
11663
10315
|
profiles[pEntry.name] = config;
|
|
11664
10316
|
} catch {}
|
|
11665
10317
|
}
|
|
@@ -11694,20 +10346,20 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11694
10346
|
return json({ error: "Invalid import format: missing 'connectors' object" }, 400, port);
|
|
11695
10347
|
}
|
|
11696
10348
|
let imported = 0;
|
|
11697
|
-
const connectDir =
|
|
10349
|
+
const connectDir = join5(homedir2(), ".connectors");
|
|
11698
10350
|
for (const [connectorName, data] of Object.entries(body.connectors)) {
|
|
11699
10351
|
if (!isValidConnectorName(connectorName))
|
|
11700
10352
|
continue;
|
|
11701
10353
|
if (!data.profiles || typeof data.profiles !== "object")
|
|
11702
10354
|
continue;
|
|
11703
|
-
const connectorDir =
|
|
11704
|
-
const profilesDir =
|
|
10355
|
+
const connectorDir = join5(connectDir, `connect-${connectorName}`);
|
|
10356
|
+
const profilesDir = join5(connectorDir, "profiles");
|
|
11705
10357
|
for (const [profileName, config] of Object.entries(data.profiles)) {
|
|
11706
10358
|
if (!config || typeof config !== "object")
|
|
11707
10359
|
continue;
|
|
11708
|
-
|
|
11709
|
-
const profileFile =
|
|
11710
|
-
|
|
10360
|
+
mkdirSync2(profilesDir, { recursive: true });
|
|
10361
|
+
const profileFile = join5(profilesDir, `${profileName}.json`);
|
|
10362
|
+
writeFileSync2(profileFile, JSON.stringify(config, null, 2));
|
|
11711
10363
|
imported++;
|
|
11712
10364
|
}
|
|
11713
10365
|
}
|
|
@@ -11762,12 +10414,12 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11762
10414
|
}
|
|
11763
10415
|
if (dashboardExists && (method === "GET" || method === "HEAD")) {
|
|
11764
10416
|
if (path !== "/") {
|
|
11765
|
-
const filePath =
|
|
10417
|
+
const filePath = join5(dashboardDir, path);
|
|
11766
10418
|
const res2 = serveStaticFile(filePath);
|
|
11767
10419
|
if (res2)
|
|
11768
10420
|
return res2;
|
|
11769
10421
|
}
|
|
11770
|
-
const indexPath =
|
|
10422
|
+
const indexPath = join5(dashboardDir, "index.html");
|
|
11771
10423
|
const res = serveStaticFile(indexPath);
|
|
11772
10424
|
if (res)
|
|
11773
10425
|
return res;
|
|
@@ -11781,9 +10433,6 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11781
10433
|
};
|
|
11782
10434
|
process.on("SIGINT", shutdown);
|
|
11783
10435
|
process.on("SIGTERM", shutdown);
|
|
11784
|
-
const { startScheduler: startScheduler2 } = await Promise.resolve().then(() => (init_scheduler(), exports_scheduler));
|
|
11785
|
-
const { getDatabase: getDatabase2 } = await Promise.resolve().then(() => (init_database(), exports_database));
|
|
11786
|
-
startScheduler2(getDatabase2());
|
|
11787
10436
|
const url = `http://localhost:${port}`;
|
|
11788
10437
|
console.log(`Connectors Dashboard running at ${url}`);
|
|
11789
10438
|
if (shouldOpen) {
|
|
@@ -11796,14 +10445,6 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
11796
10445
|
}
|
|
11797
10446
|
var activityLog, MAX_ACTIVITY_LOG = 100, MIME_TYPES, SECURITY_HEADERS, MAX_BODY_SIZE;
|
|
11798
10447
|
var init_serve = __esm(() => {
|
|
11799
|
-
init_agents();
|
|
11800
|
-
init_rate();
|
|
11801
|
-
init_strip();
|
|
11802
|
-
init_llm();
|
|
11803
|
-
init_jobs();
|
|
11804
|
-
init_workflows();
|
|
11805
|
-
init_scheduler();
|
|
11806
|
-
init_workflow_runner();
|
|
11807
10448
|
init_registry();
|
|
11808
10449
|
init_installer();
|
|
11809
10450
|
init_auth();
|
|
@@ -11848,101 +10489,6 @@ var {
|
|
|
11848
10489
|
|
|
11849
10490
|
// src/cli/index.tsx
|
|
11850
10491
|
import chalk2 from "chalk";
|
|
11851
|
-
// package.json
|
|
11852
|
-
var package_default = {
|
|
11853
|
-
name: "@hasna/connectors",
|
|
11854
|
-
version: "1.3.1",
|
|
11855
|
-
description: "Open source connector library - Install API connectors with a single command",
|
|
11856
|
-
type: "module",
|
|
11857
|
-
bin: {
|
|
11858
|
-
connectors: "./bin/index.js",
|
|
11859
|
-
"connectors-mcp": "./bin/mcp.js",
|
|
11860
|
-
"connectors-serve": "./bin/serve.js"
|
|
11861
|
-
},
|
|
11862
|
-
files: [
|
|
11863
|
-
"bin/",
|
|
11864
|
-
"dist/",
|
|
11865
|
-
"dashboard/dist/",
|
|
11866
|
-
"connectors/",
|
|
11867
|
-
"README.md"
|
|
11868
|
-
],
|
|
11869
|
-
exports: {
|
|
11870
|
-
".": {
|
|
11871
|
-
import: "./dist/index.js",
|
|
11872
|
-
types: "./dist/index.d.ts"
|
|
11873
|
-
}
|
|
11874
|
-
},
|
|
11875
|
-
main: "./dist/index.js",
|
|
11876
|
-
types: "./dist/index.d.ts",
|
|
11877
|
-
scripts: {
|
|
11878
|
-
build: "cd dashboard && bun run build && cd .. && bun build ./src/cli/index.tsx --outdir ./bin --target bun --external ink --external react --external chalk --external conf && bun build ./src/mcp/index.ts --outfile ./bin/mcp.js --target bun && bun build ./src/server/index.ts --outfile ./bin/serve.js --target bun && bun build ./src/index.ts --outdir ./dist --target bun && tsc --emitDeclarationOnly --outDir ./dist",
|
|
11879
|
-
"build:dashboard": "cd dashboard && bun run build",
|
|
11880
|
-
postinstall: '[ "$SKIP_DASHBOARD" = "1" ] || [ ! -f dashboard/package.json ] || [ -d dashboard/node_modules ] || (cd dashboard && bun install)',
|
|
11881
|
-
dev: "bun run ./src/cli/index.tsx",
|
|
11882
|
-
typecheck: "tsc --noEmit",
|
|
11883
|
-
test: "bun test",
|
|
11884
|
-
"sdk:build": "cd sdk && bun run build",
|
|
11885
|
-
prepublishOnly: "bun test && bun run build"
|
|
11886
|
-
},
|
|
11887
|
-
keywords: [
|
|
11888
|
-
"connectors",
|
|
11889
|
-
"api",
|
|
11890
|
-
"cli",
|
|
11891
|
-
"typescript",
|
|
11892
|
-
"bun",
|
|
11893
|
-
"figma",
|
|
11894
|
-
"stripe",
|
|
11895
|
-
"github",
|
|
11896
|
-
"openai",
|
|
11897
|
-
"mcp",
|
|
11898
|
-
"model-context-protocol"
|
|
11899
|
-
],
|
|
11900
|
-
author: "Hasna",
|
|
11901
|
-
license: "Apache-2.0",
|
|
11902
|
-
devDependencies: {
|
|
11903
|
-
"@types/bun": "latest",
|
|
11904
|
-
"@types/react": "^18.2.0",
|
|
11905
|
-
"ink-testing-library": "^4.0.0",
|
|
11906
|
-
typescript: "^5"
|
|
11907
|
-
},
|
|
11908
|
-
dependencies: {
|
|
11909
|
-
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
11910
|
-
chalk: "^5.3.0",
|
|
11911
|
-
commander: "^12.1.0",
|
|
11912
|
-
conf: "^13.0.1",
|
|
11913
|
-
"fast-xml-parser": "^5.5.3",
|
|
11914
|
-
ink: "^5.0.1",
|
|
11915
|
-
"ink-select-input": "^6.0.0",
|
|
11916
|
-
"ink-spinner": "^5.0.0",
|
|
11917
|
-
"ink-text-input": "^6.0.0",
|
|
11918
|
-
open: "^11.0.0",
|
|
11919
|
-
react: "^18.2.0",
|
|
11920
|
-
zod: "3"
|
|
11921
|
-
},
|
|
11922
|
-
engines: {
|
|
11923
|
-
bun: ">=1.0.0"
|
|
11924
|
-
},
|
|
11925
|
-
publishConfig: {
|
|
11926
|
-
registry: "https://registry.npmjs.org",
|
|
11927
|
-
access: "public"
|
|
11928
|
-
},
|
|
11929
|
-
repository: {
|
|
11930
|
-
type: "git",
|
|
11931
|
-
url: "git+https://github.com/hasna/connectors.git"
|
|
11932
|
-
},
|
|
11933
|
-
homepage: "https://github.com/hasna/connectors#readme",
|
|
11934
|
-
bugs: {
|
|
11935
|
-
url: "https://github.com/hasna/connectors/issues"
|
|
11936
|
-
}
|
|
11937
|
-
};
|
|
11938
|
-
|
|
11939
|
-
// src/cli/index.tsx
|
|
11940
|
-
init_llm();
|
|
11941
|
-
init_jobs();
|
|
11942
|
-
init_workflows();
|
|
11943
|
-
init_scheduler();
|
|
11944
|
-
init_workflow_runner();
|
|
11945
|
-
init_database();
|
|
11946
10492
|
|
|
11947
10493
|
// src/cli/components/App.tsx
|
|
11948
10494
|
import { useState as useState7 } from "react";
|
|
@@ -13416,9 +11962,9 @@ function App({ initialConnectors, overwrite = false }) {
|
|
|
13416
11962
|
init_registry();
|
|
13417
11963
|
init_installer();
|
|
13418
11964
|
init_auth();
|
|
13419
|
-
import { readdirSync as readdirSync4, existsSync as
|
|
13420
|
-
import { homedir as
|
|
13421
|
-
import { join as
|
|
11965
|
+
import { readdirSync as readdirSync4, existsSync as existsSync6, statSync as statSync3, readFileSync as readFileSync5, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
|
|
11966
|
+
import { homedir as homedir3 } from "os";
|
|
11967
|
+
import { join as join6, relative } from "path";
|
|
13422
11968
|
|
|
13423
11969
|
// src/lib/test-endpoints.ts
|
|
13424
11970
|
var TEST_ENDPOINTS = {
|
|
@@ -13619,17 +12165,17 @@ var TEST_ENDPOINTS = {
|
|
|
13619
12165
|
import { createInterface } from "readline";
|
|
13620
12166
|
|
|
13621
12167
|
// src/lib/runner.ts
|
|
13622
|
-
import { existsSync as
|
|
13623
|
-
import { join as
|
|
12168
|
+
import { existsSync as existsSync4 } from "fs";
|
|
12169
|
+
import { join as join4, dirname as dirname3 } from "path";
|
|
13624
12170
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
13625
|
-
import { spawn
|
|
12171
|
+
import { spawn } from "child_process";
|
|
13626
12172
|
var __dirname3 = dirname3(fileURLToPath3(import.meta.url));
|
|
13627
12173
|
function resolveConnectorsDir2() {
|
|
13628
|
-
const fromBin =
|
|
13629
|
-
if (
|
|
12174
|
+
const fromBin = join4(__dirname3, "..", "connectors");
|
|
12175
|
+
if (existsSync4(fromBin))
|
|
13630
12176
|
return fromBin;
|
|
13631
|
-
const fromSrc =
|
|
13632
|
-
if (
|
|
12177
|
+
const fromSrc = join4(__dirname3, "..", "..", "connectors");
|
|
12178
|
+
if (existsSync4(fromSrc))
|
|
13633
12179
|
return fromSrc;
|
|
13634
12180
|
return fromBin;
|
|
13635
12181
|
}
|
|
@@ -13669,13 +12215,13 @@ function buildEnvWithCredentials(connectorName, baseEnv) {
|
|
|
13669
12215
|
}
|
|
13670
12216
|
function getConnectorCliPath(name) {
|
|
13671
12217
|
const safeName = name.replace(/[^a-z0-9-]/g, "");
|
|
13672
|
-
const connectorDir =
|
|
13673
|
-
const cliPath =
|
|
13674
|
-
if (
|
|
12218
|
+
const connectorDir = join4(CONNECTORS_DIR2, `connect-${safeName}`);
|
|
12219
|
+
const cliPath = join4(connectorDir, "src", "cli", "index.ts");
|
|
12220
|
+
if (existsSync4(cliPath))
|
|
13675
12221
|
return cliPath;
|
|
13676
12222
|
return null;
|
|
13677
12223
|
}
|
|
13678
|
-
function
|
|
12224
|
+
function runConnectorCommand(name, args, timeoutMs = 30000) {
|
|
13679
12225
|
const cliPath = getConnectorCliPath(name);
|
|
13680
12226
|
if (!cliPath) {
|
|
13681
12227
|
return Promise.resolve({
|
|
@@ -13686,7 +12232,7 @@ function runConnectorCommand2(name, args, timeoutMs = 30000) {
|
|
|
13686
12232
|
});
|
|
13687
12233
|
}
|
|
13688
12234
|
return new Promise((resolve) => {
|
|
13689
|
-
const proc =
|
|
12235
|
+
const proc = spawn("bun", ["run", cliPath, ...args], {
|
|
13690
12236
|
timeout: timeoutMs,
|
|
13691
12237
|
env: buildEnvWithCredentials(name, process.env),
|
|
13692
12238
|
stdio: ["pipe", "pipe", "pipe"]
|
|
@@ -13722,7 +12268,7 @@ async function getConnectorOperations(name) {
|
|
|
13722
12268
|
if (!cliPath) {
|
|
13723
12269
|
return { commands: [], helpText: "", hasCli: false };
|
|
13724
12270
|
}
|
|
13725
|
-
const result = await
|
|
12271
|
+
const result = await runConnectorCommand(name, ["--help"]);
|
|
13726
12272
|
const helpText = result.stdout || result.stderr;
|
|
13727
12273
|
const commands = [];
|
|
13728
12274
|
const lines = helpText.split(`
|
|
@@ -13746,7 +12292,7 @@ async function getConnectorOperations(name) {
|
|
|
13746
12292
|
return { commands, helpText, hasCli: true };
|
|
13747
12293
|
}
|
|
13748
12294
|
async function getConnectorCommandHelp(name, command) {
|
|
13749
|
-
const result = await
|
|
12295
|
+
const result = await runConnectorCommand(name, [command, "--help"]);
|
|
13750
12296
|
return result.stdout || result.stderr;
|
|
13751
12297
|
}
|
|
13752
12298
|
|
|
@@ -13763,7 +12309,7 @@ var PRESETS = {
|
|
|
13763
12309
|
commerce: { description: "Commerce and finance", connectors: ["stripe", "shopify", "revolut", "mercury", "pandadoc"] }
|
|
13764
12310
|
};
|
|
13765
12311
|
var program2 = new Command;
|
|
13766
|
-
program2.name("connectors").description("Install API connectors for your project").version(
|
|
12312
|
+
program2.name("connectors").description("Install API connectors for your project").version("1.3.2").enablePositionalOptions();
|
|
13767
12313
|
program2.command("interactive", { isDefault: true }).alias("i").description("Interactive connector browser").action(() => {
|
|
13768
12314
|
if (!isTTY) {
|
|
13769
12315
|
console.log(`Non-interactive environment detected. Use a subcommand:
|
|
@@ -13784,8 +12330,8 @@ Run 'connectors --help' for full usage.`);
|
|
|
13784
12330
|
function listFilesRecursive(dir, base = dir) {
|
|
13785
12331
|
const files = [];
|
|
13786
12332
|
for (const entry of readdirSync4(dir)) {
|
|
13787
|
-
const fullPath =
|
|
13788
|
-
if (
|
|
12333
|
+
const fullPath = join6(dir, entry);
|
|
12334
|
+
if (statSync3(fullPath).isDirectory()) {
|
|
13789
12335
|
files.push(...listFilesRecursive(fullPath, base));
|
|
13790
12336
|
} else {
|
|
13791
12337
|
files.push(relative(base, fullPath));
|
|
@@ -13793,7 +12339,7 @@ function listFilesRecursive(dir, base = dir) {
|
|
|
13793
12339
|
}
|
|
13794
12340
|
return files;
|
|
13795
12341
|
}
|
|
13796
|
-
program2.command("install").alias("add").argument("[connectors...]", "Connectors to
|
|
12342
|
+
program2.command("install").alias("add").argument("[connectors...]", "Connectors to verify").option("-c, --category <category>", "Verify all connectors in a category").option("--preset <preset>", "Verify a preset bundle (e.g. ai, fullstack, google)").option("--json", "Output results as JSON", false).description("Verify connectors are available in the global package").action((connectors, options) => {
|
|
13797
12343
|
if (options.category) {
|
|
13798
12344
|
const category = CATEGORIES.find((c) => c.toLowerCase() === options.category.toLowerCase());
|
|
13799
12345
|
if (!category) {
|
|
@@ -13806,8 +12352,7 @@ program2.command("install").alias("add").argument("[connectors...]", "Connectors
|
|
|
13806
12352
|
process.exit(1);
|
|
13807
12353
|
return;
|
|
13808
12354
|
}
|
|
13809
|
-
|
|
13810
|
-
connectors.push(...categoryConnectors);
|
|
12355
|
+
connectors.push(...getConnectorsByCategory(category).map((c) => c.name));
|
|
13811
12356
|
}
|
|
13812
12357
|
if (options.preset) {
|
|
13813
12358
|
const preset = PRESETS[options.preset.toLowerCase()];
|
|
@@ -13825,133 +12370,25 @@ program2.command("install").alias("add").argument("[connectors...]", "Connectors
|
|
|
13825
12370
|
}
|
|
13826
12371
|
if (connectors.length === 0) {
|
|
13827
12372
|
if (!isTTY) {
|
|
13828
|
-
console.error("Error: specify connectors to
|
|
12373
|
+
console.error("Error: specify connectors to verify. Example: connectors install figma stripe");
|
|
13829
12374
|
process.exit(1);
|
|
13830
12375
|
}
|
|
13831
12376
|
render(/* @__PURE__ */ jsxDEV7(App, {}, undefined, false, undefined, this));
|
|
13832
12377
|
return;
|
|
13833
12378
|
}
|
|
13834
|
-
|
|
13835
|
-
const installed = getInstalledConnectors();
|
|
13836
|
-
const destDir = join9(process.cwd(), ".connectors");
|
|
13837
|
-
const actions = [];
|
|
13838
|
-
for (const name of connectors) {
|
|
13839
|
-
if (!/^[a-z0-9-]+$/.test(name)) {
|
|
13840
|
-
actions.push({ connector: name, action: "error", reason: `Invalid connector name '${name}'` });
|
|
13841
|
-
continue;
|
|
13842
|
-
}
|
|
13843
|
-
const meta = getConnector(name);
|
|
13844
|
-
if (!meta) {
|
|
13845
|
-
actions.push({ connector: name, action: "error", reason: `Connector '${name}' not found in registry` });
|
|
13846
|
-
continue;
|
|
13847
|
-
}
|
|
13848
|
-
if (!connectorExists(name)) {
|
|
13849
|
-
actions.push({ connector: name, action: "error", reason: `Connector '${name}' source files not found` });
|
|
13850
|
-
continue;
|
|
13851
|
-
}
|
|
13852
|
-
const connectorDirName = name.startsWith("connect-") ? name : `connect-${name}`;
|
|
13853
|
-
const sourcePath = getConnectorPath(name);
|
|
13854
|
-
const destPath = join9(destDir, connectorDirName);
|
|
13855
|
-
const alreadyInstalled = installed.includes(name);
|
|
13856
|
-
const files = listFilesRecursive(sourcePath);
|
|
13857
|
-
const importLine = `export * as ${name} from './${connectorDirName}/src/index.js';`;
|
|
13858
|
-
if (alreadyInstalled && !options.overwrite) {
|
|
13859
|
-
actions.push({
|
|
13860
|
-
connector: name,
|
|
13861
|
-
action: "skip",
|
|
13862
|
-
reason: "Already installed. Use --overwrite to replace.",
|
|
13863
|
-
sourcePath,
|
|
13864
|
-
destPath
|
|
13865
|
-
});
|
|
13866
|
-
} else {
|
|
13867
|
-
actions.push({
|
|
13868
|
-
connector: name,
|
|
13869
|
-
action: alreadyInstalled ? "overwrite" : "install",
|
|
13870
|
-
sourcePath,
|
|
13871
|
-
destPath,
|
|
13872
|
-
files,
|
|
13873
|
-
importLine
|
|
13874
|
-
});
|
|
13875
|
-
}
|
|
13876
|
-
}
|
|
13877
|
-
if (options.json) {
|
|
13878
|
-
console.log(JSON.stringify({ dryRun: true, actions }, null, 2));
|
|
13879
|
-
process.exit(actions.every((a) => a.action !== "error") ? 0 : 1);
|
|
13880
|
-
return;
|
|
13881
|
-
}
|
|
13882
|
-
console.log(chalk2.bold(`
|
|
13883
|
-
Dry run \u2014 no changes will be made
|
|
13884
|
-
`));
|
|
13885
|
-
for (const a of actions) {
|
|
13886
|
-
if (a.action === "error") {
|
|
13887
|
-
console.log(chalk2.red(` \u2717 ${a.connector}: ${a.reason}`));
|
|
13888
|
-
continue;
|
|
13889
|
-
}
|
|
13890
|
-
if (a.action === "skip") {
|
|
13891
|
-
console.log(chalk2.yellow(` \u2298 ${a.connector}: ${a.reason}`));
|
|
13892
|
-
continue;
|
|
13893
|
-
}
|
|
13894
|
-
const actionLabel = a.action === "overwrite" ? chalk2.yellow("overwrite") : chalk2.green("install");
|
|
13895
|
-
console.log(` ${actionLabel} ${chalk2.cyan(a.connector)}`);
|
|
13896
|
-
console.log(chalk2.dim(` source: ${a.sourcePath}`));
|
|
13897
|
-
console.log(chalk2.dim(` dest: ${a.destPath}`));
|
|
13898
|
-
if (a.files && a.files.length > 0) {
|
|
13899
|
-
console.log(chalk2.dim(` files (${a.files.length}):`));
|
|
13900
|
-
for (const f of a.files) {
|
|
13901
|
-
console.log(chalk2.dim(` ${f}`));
|
|
13902
|
-
}
|
|
13903
|
-
}
|
|
13904
|
-
if (a.importLine) {
|
|
13905
|
-
console.log(` ${chalk2.dim("index.ts:")} ${a.importLine}`);
|
|
13906
|
-
}
|
|
13907
|
-
console.log();
|
|
13908
|
-
}
|
|
13909
|
-
const installCount = actions.filter((a) => a.action === "install").length;
|
|
13910
|
-
const overwriteCount = actions.filter((a) => a.action === "overwrite").length;
|
|
13911
|
-
const skipCount = actions.filter((a) => a.action === "skip").length;
|
|
13912
|
-
const errorCount = actions.filter((a) => a.action === "error").length;
|
|
13913
|
-
const parts = [];
|
|
13914
|
-
if (installCount)
|
|
13915
|
-
parts.push(chalk2.green(`${installCount} to install`));
|
|
13916
|
-
if (overwriteCount)
|
|
13917
|
-
parts.push(chalk2.yellow(`${overwriteCount} to overwrite`));
|
|
13918
|
-
if (skipCount)
|
|
13919
|
-
parts.push(chalk2.yellow(`${skipCount} skipped`));
|
|
13920
|
-
if (errorCount)
|
|
13921
|
-
parts.push(chalk2.red(`${errorCount} failed`));
|
|
13922
|
-
console.log(` ${chalk2.bold("Summary:")} ${parts.join(", ")}`);
|
|
13923
|
-
console.log(chalk2.dim(`
|
|
13924
|
-
Run without --dry-run to apply.
|
|
13925
|
-
`));
|
|
13926
|
-
process.exit(errorCount > 0 ? 1 : 0);
|
|
13927
|
-
return;
|
|
13928
|
-
}
|
|
13929
|
-
const results = connectors.map((name) => installConnector(name, { overwrite: options.overwrite }));
|
|
12379
|
+
const results = connectors.map((name) => installConnector(name));
|
|
13930
12380
|
if (options.json) {
|
|
13931
12381
|
console.log(JSON.stringify(results, null, 2));
|
|
13932
12382
|
process.exit(results.every((r) => r.success) ? 0 : 1);
|
|
13933
12383
|
return;
|
|
13934
12384
|
}
|
|
13935
|
-
console.log(chalk2.bold(`
|
|
13936
|
-
Installing connectors...
|
|
13937
|
-
`));
|
|
13938
|
-
const succeeded = [];
|
|
13939
12385
|
for (const result of results) {
|
|
13940
12386
|
if (result.success) {
|
|
13941
|
-
console.log(chalk2.green(`\u2713 ${result.connector}`));
|
|
13942
|
-
succeeded.push(result.connector);
|
|
12387
|
+
console.log(chalk2.green(`\u2713 ${result.connector}`) + chalk2.dim(` \u2014 available at ${result.path}`));
|
|
13943
12388
|
} else {
|
|
13944
12389
|
console.log(chalk2.red(`\u2717 ${result.connector}: ${result.error}`));
|
|
13945
12390
|
}
|
|
13946
12391
|
}
|
|
13947
|
-
if (succeeded.length > 0) {
|
|
13948
|
-
console.log(chalk2.bold(`
|
|
13949
|
-
Next steps:`));
|
|
13950
|
-
const importNames = succeeded.join(", ");
|
|
13951
|
-
console.log(chalk2.dim(` 1. Import: `) + `import { ${importNames} } from './.connectors'`);
|
|
13952
|
-
console.log(chalk2.dim(` 2. Set key: `) + `connectors docs ${succeeded[0]}` + chalk2.dim(` (see env vars)`));
|
|
13953
|
-
console.log(chalk2.dim(` 3. Explore: `) + `connectors serve` + chalk2.dim(` (dashboard for auth management)`));
|
|
13954
|
-
}
|
|
13955
12392
|
process.exit(results.every((r) => r.success) ? 0 : 1);
|
|
13956
12393
|
});
|
|
13957
12394
|
program2.command("list").alias("ls").option("-c, --category <category>", "Filter by category").option("-a, --all", "Show all available connectors", false).option("-i, --installed", "Show only installed connectors", false).option("-b, --brief", "Output only connector names", false).option("--json", "Output as JSON", false).description("List available or installed connectors").action((options) => {
|
|
@@ -14105,18 +12542,10 @@ Available connectors (${CONNECTORS.length}):
|
|
|
14105
12542
|
console.log();
|
|
14106
12543
|
}
|
|
14107
12544
|
});
|
|
14108
|
-
program2.command("search").argument("<query>", "Search term").option("--json", "Output as JSON", false).
|
|
14109
|
-
const
|
|
14110
|
-
const { getPromotedConnectors: getPromotedConnectors2 } = (init_promotions(), __toCommonJS(exports_promotions));
|
|
14111
|
-
const { getUsageMap: getUsageMap2 } = (init_usage(), __toCommonJS(exports_usage));
|
|
14112
|
-
const results = searchConnectors(query, {
|
|
14113
|
-
installed,
|
|
14114
|
-
promoted: getPromotedConnectors2(),
|
|
14115
|
-
usage: getUsageMap2(),
|
|
14116
|
-
limit: parseInt(options.limit)
|
|
14117
|
-
});
|
|
12545
|
+
program2.command("search").argument("<query>", "Search term").option("--json", "Output as JSON", false).description("Search for connectors").action((query, options) => {
|
|
12546
|
+
const results = searchConnectors(query);
|
|
14118
12547
|
if (options.json) {
|
|
14119
|
-
console.log(JSON.stringify(results
|
|
12548
|
+
console.log(JSON.stringify(results));
|
|
14120
12549
|
return;
|
|
14121
12550
|
}
|
|
14122
12551
|
if (results.length === 0) {
|
|
@@ -14126,12 +12555,10 @@ program2.command("search").argument("<query>", "Search term").option("--json", "
|
|
|
14126
12555
|
console.log(chalk2.bold(`
|
|
14127
12556
|
Found ${results.length} connector(s):
|
|
14128
12557
|
`));
|
|
14129
|
-
console.log(` ${chalk2.dim("Name".padEnd(
|
|
14130
|
-
console.log(chalk2.dim(` ${"\u2500".repeat(
|
|
12558
|
+
console.log(` ${chalk2.dim("Name".padEnd(20))}${chalk2.dim("Version".padEnd(10))}${chalk2.dim("Category".padEnd(20))}${chalk2.dim("Description")}`);
|
|
12559
|
+
console.log(chalk2.dim(` ${"\u2500".repeat(70)}`));
|
|
14131
12560
|
for (const c of results) {
|
|
14132
|
-
|
|
14133
|
-
const badgeStr = badges ? " " + badges : "";
|
|
14134
|
-
console.log(` ${chalk2.cyan(c.name.padEnd(22))}${String(c.score).padEnd(7)}${chalk2.dim(c.category.padEnd(20))}${c.description}${badgeStr}`);
|
|
12561
|
+
console.log(` ${chalk2.cyan(c.name.padEnd(20))}${chalk2.dim((c.version || "-").padEnd(10))}${chalk2.dim(c.category.padEnd(20))}${c.description}`);
|
|
14135
12562
|
}
|
|
14136
12563
|
});
|
|
14137
12564
|
program2.command("info").argument("<connector>", "Connector name").option("--json", "Output as JSON", false).description("Show detailed info about a connector").action((connector, options) => {
|
|
@@ -14365,17 +12792,17 @@ Updating ${toUpdate.length} connector(s)...
|
|
|
14365
12792
|
});
|
|
14366
12793
|
program2.command("status").option("--json", "Output as JSON", false).description("Show auth status of all configured connectors (project + global)").action((options) => {
|
|
14367
12794
|
const installed = getInstalledConnectors();
|
|
14368
|
-
const configDir =
|
|
12795
|
+
const configDir = join6(homedir3(), ".connectors");
|
|
14369
12796
|
const seen = new Set;
|
|
14370
12797
|
const allStatuses = [];
|
|
14371
12798
|
function buildStatusEntry(name, source) {
|
|
14372
12799
|
const auth = getAuthStatus(name);
|
|
14373
12800
|
const connectorName = name.startsWith("connect-") ? name : `connect-${name}`;
|
|
14374
|
-
const currentProfileFile =
|
|
12801
|
+
const currentProfileFile = join6(configDir, connectorName, "current_profile");
|
|
14375
12802
|
let profile = "default";
|
|
14376
|
-
if (
|
|
12803
|
+
if (existsSync6(currentProfileFile)) {
|
|
14377
12804
|
try {
|
|
14378
|
-
profile =
|
|
12805
|
+
profile = readFileSync5(currentProfileFile, "utf-8").trim() || "default";
|
|
14379
12806
|
} catch {}
|
|
14380
12807
|
}
|
|
14381
12808
|
let expiryLabel = null;
|
|
@@ -14411,13 +12838,13 @@ program2.command("status").option("--json", "Output as JSON", false).description
|
|
|
14411
12838
|
seen.add(name);
|
|
14412
12839
|
allStatuses.push(buildStatusEntry(name, "project"));
|
|
14413
12840
|
}
|
|
14414
|
-
if (
|
|
12841
|
+
if (existsSync6(configDir)) {
|
|
14415
12842
|
try {
|
|
14416
12843
|
const globalDirs = readdirSync4(configDir).filter((f) => {
|
|
14417
12844
|
if (!f.startsWith("connect-"))
|
|
14418
12845
|
return false;
|
|
14419
12846
|
try {
|
|
14420
|
-
return
|
|
12847
|
+
return statSync3(join6(configDir, f)).isDirectory();
|
|
14421
12848
|
} catch {
|
|
14422
12849
|
return false;
|
|
14423
12850
|
}
|
|
@@ -14691,7 +13118,7 @@ Open this URL to authenticate:
|
|
|
14691
13118
|
return;
|
|
14692
13119
|
}
|
|
14693
13120
|
if (options.key) {
|
|
14694
|
-
|
|
13121
|
+
saveApiKey(connector, options.key, options.field || undefined);
|
|
14695
13122
|
const statusAfter2 = getAuthStatus(connector);
|
|
14696
13123
|
if (options.json) {
|
|
14697
13124
|
console.log(JSON.stringify({
|
|
@@ -14765,7 +13192,7 @@ Open this URL to authenticate:
|
|
|
14765
13192
|
process.exit(1);
|
|
14766
13193
|
return;
|
|
14767
13194
|
}
|
|
14768
|
-
|
|
13195
|
+
saveApiKey(connector, key.trim(), options.field || undefined);
|
|
14769
13196
|
const statusAfter = getAuthStatus(connector);
|
|
14770
13197
|
console.log(chalk2.green(`
|
|
14771
13198
|
\u2713 API key saved for ${meta.displayName}`));
|
|
@@ -14782,15 +13209,15 @@ program2.command("init").option("--json", "Output presets and suggestions as JSO
|
|
|
14782
13209
|
{ key: "commerce", emoji: "\uD83D\uDCB3", label: "Commerce", connectors: ["stripe", "shopify", "paypal", "revolut", "mercury"], description: "Commerce and finance" },
|
|
14783
13210
|
{ key: "google", emoji: "\uD83D\uDCC1", label: "Google Workspace", connectors: ["gmail", "googledrive", "googlecalendar", "googledocs", "googlesheets"], description: "Google Workspace suite" }
|
|
14784
13211
|
];
|
|
14785
|
-
const connectorsHome =
|
|
13212
|
+
const connectorsHome = join6(homedir3(), ".connectors");
|
|
14786
13213
|
let configuredCount = 0;
|
|
14787
13214
|
const configuredNames = [];
|
|
14788
13215
|
try {
|
|
14789
|
-
if (
|
|
14790
|
-
const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") &&
|
|
13216
|
+
if (existsSync6(connectorsHome)) {
|
|
13217
|
+
const entries = readdirSync4(connectorsHome).filter((e) => e.startsWith("connect-") && statSync3(join6(connectorsHome, e)).isDirectory());
|
|
14791
13218
|
for (const entry of entries) {
|
|
14792
|
-
const profilesDir =
|
|
14793
|
-
if (
|
|
13219
|
+
const profilesDir = join6(connectorsHome, entry, "profiles");
|
|
13220
|
+
if (existsSync6(profilesDir)) {
|
|
14794
13221
|
configuredCount++;
|
|
14795
13222
|
configuredNames.push(entry.replace(/^connect-/, ""));
|
|
14796
13223
|
}
|
|
@@ -14888,44 +13315,44 @@ function redactSecrets(obj) {
|
|
|
14888
13315
|
return obj;
|
|
14889
13316
|
}
|
|
14890
13317
|
program2.command("export").option("-o, --output <file>", "Write to file instead of stdout").option("--include-secrets", "Include secrets in plaintext (dangerous \u2014 use only for backup/restore)").description("Export all connector credentials as JSON backup").action((options) => {
|
|
14891
|
-
const connectDir =
|
|
13318
|
+
const connectDir = join6(homedir3(), ".connectors");
|
|
14892
13319
|
const result = {};
|
|
14893
|
-
if (
|
|
13320
|
+
if (existsSync6(connectDir)) {
|
|
14894
13321
|
for (const entry of readdirSync4(connectDir)) {
|
|
14895
|
-
const entryPath =
|
|
14896
|
-
if (!
|
|
13322
|
+
const entryPath = join6(connectDir, entry);
|
|
13323
|
+
if (!statSync3(entryPath).isDirectory() || !entry.startsWith("connect-"))
|
|
14897
13324
|
continue;
|
|
14898
13325
|
const connectorName = entry.replace(/^connect-/, "");
|
|
14899
13326
|
let credentials = undefined;
|
|
14900
|
-
const credentialsPath =
|
|
14901
|
-
if (
|
|
13327
|
+
const credentialsPath = join6(entryPath, "credentials.json");
|
|
13328
|
+
if (existsSync6(credentialsPath)) {
|
|
14902
13329
|
try {
|
|
14903
|
-
credentials = JSON.parse(
|
|
13330
|
+
credentials = JSON.parse(readFileSync5(credentialsPath, "utf-8"));
|
|
14904
13331
|
} catch {}
|
|
14905
13332
|
}
|
|
14906
|
-
const profilesDir =
|
|
14907
|
-
if (!
|
|
13333
|
+
const profilesDir = join6(entryPath, "profiles");
|
|
13334
|
+
if (!existsSync6(profilesDir) && !credentials)
|
|
14908
13335
|
continue;
|
|
14909
13336
|
const profiles = {};
|
|
14910
|
-
if (
|
|
13337
|
+
if (existsSync6(profilesDir)) {
|
|
14911
13338
|
for (const pEntry of readdirSync4(profilesDir)) {
|
|
14912
|
-
const pPath =
|
|
14913
|
-
if (
|
|
13339
|
+
const pPath = join6(profilesDir, pEntry);
|
|
13340
|
+
if (statSync3(pPath).isFile() && pEntry.endsWith(".json")) {
|
|
14914
13341
|
try {
|
|
14915
|
-
profiles[pEntry.replace(/\.json$/, "")] = JSON.parse(
|
|
13342
|
+
profiles[pEntry.replace(/\.json$/, "")] = JSON.parse(readFileSync5(pPath, "utf-8"));
|
|
14916
13343
|
} catch {}
|
|
14917
|
-
} else if (
|
|
14918
|
-
const configPath =
|
|
14919
|
-
const tokensPath =
|
|
13344
|
+
} else if (statSync3(pPath).isDirectory()) {
|
|
13345
|
+
const configPath = join6(pPath, "config.json");
|
|
13346
|
+
const tokensPath = join6(pPath, "tokens.json");
|
|
14920
13347
|
let merged = {};
|
|
14921
|
-
if (
|
|
13348
|
+
if (existsSync6(configPath)) {
|
|
14922
13349
|
try {
|
|
14923
|
-
merged = { ...merged, ...JSON.parse(
|
|
13350
|
+
merged = { ...merged, ...JSON.parse(readFileSync5(configPath, "utf-8")) };
|
|
14924
13351
|
} catch {}
|
|
14925
13352
|
}
|
|
14926
|
-
if (
|
|
13353
|
+
if (existsSync6(tokensPath)) {
|
|
14927
13354
|
try {
|
|
14928
|
-
merged = { ...merged, ...JSON.parse(
|
|
13355
|
+
merged = { ...merged, ...JSON.parse(readFileSync5(tokensPath, "utf-8")) };
|
|
14929
13356
|
} catch {}
|
|
14930
13357
|
}
|
|
14931
13358
|
if (Object.keys(merged).length > 0)
|
|
@@ -14946,7 +13373,7 @@ program2.command("export").option("-o, --output <file>", "Write to file instead
|
|
|
14946
13373
|
}
|
|
14947
13374
|
const exportData = JSON.stringify(exportPayload, null, 2);
|
|
14948
13375
|
if (options.output) {
|
|
14949
|
-
|
|
13376
|
+
writeFileSync3(options.output, exportData);
|
|
14950
13377
|
console.log(chalk2.green(`\u2713 Exported to ${options.output}`));
|
|
14951
13378
|
} else {
|
|
14952
13379
|
console.log(exportData);
|
|
@@ -14960,7 +13387,7 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
|
|
|
14960
13387
|
chunks.push(chunk.toString());
|
|
14961
13388
|
raw = chunks.join("");
|
|
14962
13389
|
} else {
|
|
14963
|
-
if (!
|
|
13390
|
+
if (!existsSync6(file)) {
|
|
14964
13391
|
if (options.json) {
|
|
14965
13392
|
console.log(JSON.stringify({ error: `File not found: ${file}` }));
|
|
14966
13393
|
} else {
|
|
@@ -14969,7 +13396,7 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
|
|
|
14969
13396
|
process.exit(1);
|
|
14970
13397
|
return;
|
|
14971
13398
|
}
|
|
14972
|
-
raw =
|
|
13399
|
+
raw = readFileSync5(file, "utf-8");
|
|
14973
13400
|
}
|
|
14974
13401
|
let data;
|
|
14975
13402
|
try {
|
|
@@ -14992,25 +13419,25 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
|
|
|
14992
13419
|
process.exit(1);
|
|
14993
13420
|
return;
|
|
14994
13421
|
}
|
|
14995
|
-
const connectDir =
|
|
13422
|
+
const connectDir = join6(homedir3(), ".connectors");
|
|
14996
13423
|
let imported = 0;
|
|
14997
13424
|
for (const [connectorName, connData] of Object.entries(data.connectors)) {
|
|
14998
13425
|
if (!/^[a-z0-9-]+$/.test(connectorName))
|
|
14999
13426
|
continue;
|
|
15000
|
-
const connectorDir =
|
|
13427
|
+
const connectorDir = join6(connectDir, `connect-${connectorName}`);
|
|
15001
13428
|
if (connData.credentials && typeof connData.credentials === "object") {
|
|
15002
|
-
|
|
15003
|
-
|
|
13429
|
+
mkdirSync3(connectorDir, { recursive: true });
|
|
13430
|
+
writeFileSync3(join6(connectorDir, "credentials.json"), JSON.stringify(connData.credentials, null, 2));
|
|
15004
13431
|
imported++;
|
|
15005
13432
|
}
|
|
15006
13433
|
if (!connData.profiles || typeof connData.profiles !== "object")
|
|
15007
13434
|
continue;
|
|
15008
|
-
const profilesDir =
|
|
13435
|
+
const profilesDir = join6(connectorDir, "profiles");
|
|
15009
13436
|
for (const [profileName, config] of Object.entries(connData.profiles)) {
|
|
15010
13437
|
if (!config || typeof config !== "object")
|
|
15011
13438
|
continue;
|
|
15012
|
-
|
|
15013
|
-
|
|
13439
|
+
mkdirSync3(profilesDir, { recursive: true });
|
|
13440
|
+
writeFileSync3(join6(profilesDir, `${profileName}.json`), JSON.stringify(config, null, 2));
|
|
15014
13441
|
imported++;
|
|
15015
13442
|
}
|
|
15016
13443
|
}
|
|
@@ -15021,9 +13448,9 @@ program2.command("import").argument("<file>", "JSON backup file to import (use -
|
|
|
15021
13448
|
}
|
|
15022
13449
|
});
|
|
15023
13450
|
program2.command("auth-import").option("--json", "Output as JSON", false).option("-d, --dry-run", "Preview what would be imported without copying", false).option("--force", "Overwrite existing files in ~/.connectors/", false).description("Migrate auth tokens from ~/.connect/ to ~/.connectors/").action((options) => {
|
|
15024
|
-
const oldBase =
|
|
15025
|
-
const newBase =
|
|
15026
|
-
if (!
|
|
13451
|
+
const oldBase = join6(homedir3(), ".connect");
|
|
13452
|
+
const newBase = join6(homedir3(), ".connectors");
|
|
13453
|
+
if (!existsSync6(oldBase)) {
|
|
15027
13454
|
if (options.json) {
|
|
15028
13455
|
console.log(JSON.stringify({ imported: [], skipped: [], error: null, message: "No ~/.connect/ directory found" }));
|
|
15029
13456
|
} else {
|
|
@@ -15035,7 +13462,7 @@ program2.command("auth-import").option("--json", "Output as JSON", false).option
|
|
|
15035
13462
|
if (!name.startsWith("connect-"))
|
|
15036
13463
|
return false;
|
|
15037
13464
|
try {
|
|
15038
|
-
return
|
|
13465
|
+
return statSync3(join6(oldBase, name)).isDirectory();
|
|
15039
13466
|
} catch {
|
|
15040
13467
|
return false;
|
|
15041
13468
|
}
|
|
@@ -15051,8 +13478,8 @@ program2.command("auth-import").option("--json", "Output as JSON", false).option
|
|
|
15051
13478
|
const imported = [];
|
|
15052
13479
|
const skipped = [];
|
|
15053
13480
|
for (const dirName of entries) {
|
|
15054
|
-
const oldDir =
|
|
15055
|
-
const newDir =
|
|
13481
|
+
const oldDir = join6(oldBase, dirName);
|
|
13482
|
+
const newDir = join6(newBase, dirName);
|
|
15056
13483
|
const connectorName = dirName.replace(/^connect-/, "");
|
|
15057
13484
|
const allFiles = listFilesRecursive(oldDir);
|
|
15058
13485
|
const authFiles = allFiles.filter((f) => {
|
|
@@ -15063,17 +13490,17 @@ program2.command("auth-import").option("--json", "Output as JSON", false).option
|
|
|
15063
13490
|
const copiedFiles = [];
|
|
15064
13491
|
const skippedFiles = [];
|
|
15065
13492
|
for (const relFile of authFiles) {
|
|
15066
|
-
const srcPath =
|
|
15067
|
-
const destPath =
|
|
15068
|
-
if (
|
|
13493
|
+
const srcPath = join6(oldDir, relFile);
|
|
13494
|
+
const destPath = join6(newDir, relFile);
|
|
13495
|
+
if (existsSync6(destPath) && !options.force) {
|
|
15069
13496
|
skippedFiles.push(relFile);
|
|
15070
13497
|
continue;
|
|
15071
13498
|
}
|
|
15072
13499
|
if (!options.dryRun) {
|
|
15073
|
-
const parentDir =
|
|
15074
|
-
|
|
15075
|
-
const content =
|
|
15076
|
-
|
|
13500
|
+
const parentDir = join6(destPath, "..");
|
|
13501
|
+
mkdirSync3(parentDir, { recursive: true });
|
|
13502
|
+
const content = readFileSync5(srcPath);
|
|
13503
|
+
writeFileSync3(destPath, content);
|
|
15077
13504
|
}
|
|
15078
13505
|
copiedFiles.push(relFile);
|
|
15079
13506
|
}
|
|
@@ -15318,7 +13745,7 @@ program2.command("env").option("-o, --output <file>", "Write to file instead of
|
|
|
15318
13745
|
`) + `
|
|
15319
13746
|
`;
|
|
15320
13747
|
if (options.output) {
|
|
15321
|
-
|
|
13748
|
+
writeFileSync3(options.output, output);
|
|
15322
13749
|
console.log(chalk2.green(`\u2713 Written to ${options.output} (${vars.length} variables)`));
|
|
15323
13750
|
} else {
|
|
15324
13751
|
console.log(output);
|
|
@@ -15346,7 +13773,7 @@ Available presets:
|
|
|
15346
13773
|
`));
|
|
15347
13774
|
});
|
|
15348
13775
|
program2.command("whoami").option("--json", "Output as JSON", false).description("Show current setup: config dir, installed connectors, auth status").action((options) => {
|
|
15349
|
-
const configDir =
|
|
13776
|
+
const configDir = join6(homedir3(), ".connectors");
|
|
15350
13777
|
const installed = getInstalledConnectors();
|
|
15351
13778
|
const version = "0.3.1";
|
|
15352
13779
|
let configured = 0;
|
|
@@ -15360,23 +13787,23 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
|
|
|
15360
13787
|
configured++;
|
|
15361
13788
|
else
|
|
15362
13789
|
unconfigured++;
|
|
15363
|
-
const connectorConfigDir =
|
|
15364
|
-
const currentProfileFile =
|
|
13790
|
+
const connectorConfigDir = join6(configDir, name.startsWith("connect-") ? name : `connect-${name}`);
|
|
13791
|
+
const currentProfileFile = join6(connectorConfigDir, "current_profile");
|
|
15365
13792
|
let profile = "default";
|
|
15366
|
-
if (
|
|
13793
|
+
if (existsSync6(currentProfileFile)) {
|
|
15367
13794
|
try {
|
|
15368
|
-
profile =
|
|
13795
|
+
profile = readFileSync5(currentProfileFile, "utf-8").trim() || "default";
|
|
15369
13796
|
} catch {}
|
|
15370
13797
|
}
|
|
15371
13798
|
connectorDetails.push({ name, configured: auth.configured, authType: auth.type, profile, source: "project" });
|
|
15372
13799
|
}
|
|
15373
|
-
if (
|
|
13800
|
+
if (existsSync6(configDir)) {
|
|
15374
13801
|
try {
|
|
15375
13802
|
const globalDirs = readdirSync4(configDir).filter((f) => {
|
|
15376
13803
|
if (!f.startsWith("connect-"))
|
|
15377
13804
|
return false;
|
|
15378
13805
|
try {
|
|
15379
|
-
return
|
|
13806
|
+
return statSync3(join6(configDir, f)).isDirectory();
|
|
15380
13807
|
} catch {
|
|
15381
13808
|
return false;
|
|
15382
13809
|
}
|
|
@@ -15390,11 +13817,11 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
|
|
|
15390
13817
|
continue;
|
|
15391
13818
|
seen.add(name);
|
|
15392
13819
|
configured++;
|
|
15393
|
-
const currentProfileFile =
|
|
13820
|
+
const currentProfileFile = join6(configDir, dir, "current_profile");
|
|
15394
13821
|
let profile = "default";
|
|
15395
|
-
if (
|
|
13822
|
+
if (existsSync6(currentProfileFile)) {
|
|
15396
13823
|
try {
|
|
15397
|
-
profile =
|
|
13824
|
+
profile = readFileSync5(currentProfileFile, "utf-8").trim() || "default";
|
|
15398
13825
|
} catch {}
|
|
15399
13826
|
}
|
|
15400
13827
|
connectorDetails.push({ name, configured: true, authType: auth.type, profile, source: "global" });
|
|
@@ -15405,7 +13832,7 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
|
|
|
15405
13832
|
console.log(JSON.stringify({
|
|
15406
13833
|
version,
|
|
15407
13834
|
configDir,
|
|
15408
|
-
configDirExists:
|
|
13835
|
+
configDirExists: existsSync6(configDir),
|
|
15409
13836
|
installed: installed.length,
|
|
15410
13837
|
configured,
|
|
15411
13838
|
unconfigured,
|
|
@@ -15417,7 +13844,7 @@ program2.command("whoami").option("--json", "Output as JSON", false).description
|
|
|
15417
13844
|
Connectors Setup
|
|
15418
13845
|
`));
|
|
15419
13846
|
console.log(` Version: ${chalk2.cyan(version)}`);
|
|
15420
|
-
console.log(` Config: ${configDir}${
|
|
13847
|
+
console.log(` Config: ${configDir}${existsSync6(configDir) ? "" : chalk2.dim(" (not created yet)")}`);
|
|
15421
13848
|
console.log(` Installed: ${installed.length} connector${installed.length !== 1 ? "s" : ""}`);
|
|
15422
13849
|
console.log(` Configured: ${chalk2.green(String(configured))} ready, ${unconfigured > 0 ? chalk2.red(String(unconfigured)) : chalk2.dim("0")} need auth`);
|
|
15423
13850
|
const projectConnectors = connectorDetails.filter((c) => c.source === "project");
|
|
@@ -15507,18 +13934,18 @@ Testing connector credentials...
|
|
|
15507
13934
|
}
|
|
15508
13935
|
}
|
|
15509
13936
|
if (!apiKey) {
|
|
15510
|
-
const connectorConfigDir =
|
|
13937
|
+
const connectorConfigDir = join6(homedir3(), ".connectors", name.startsWith("connect-") ? name : `connect-${name}`);
|
|
15511
13938
|
let currentProfile = "default";
|
|
15512
|
-
const currentProfileFile =
|
|
15513
|
-
if (
|
|
13939
|
+
const currentProfileFile = join6(connectorConfigDir, "current_profile");
|
|
13940
|
+
if (existsSync6(currentProfileFile)) {
|
|
15514
13941
|
try {
|
|
15515
|
-
currentProfile =
|
|
13942
|
+
currentProfile = readFileSync5(currentProfileFile, "utf-8").trim() || "default";
|
|
15516
13943
|
} catch {}
|
|
15517
13944
|
}
|
|
15518
|
-
const tokensFile =
|
|
15519
|
-
if (
|
|
13945
|
+
const tokensFile = join6(connectorConfigDir, "profiles", currentProfile, "tokens.json");
|
|
13946
|
+
if (existsSync6(tokensFile)) {
|
|
15520
13947
|
try {
|
|
15521
|
-
const tokens = JSON.parse(
|
|
13948
|
+
const tokens = JSON.parse(readFileSync5(tokensFile, "utf-8"));
|
|
15522
13949
|
const isExpired = tokens.expiresAt && Date.now() >= tokens.expiresAt - 60000;
|
|
15523
13950
|
if (isExpired && tokens.refreshToken) {
|
|
15524
13951
|
try {
|
|
@@ -15536,19 +13963,19 @@ Testing connector credentials...
|
|
|
15536
13963
|
} catch {}
|
|
15537
13964
|
}
|
|
15538
13965
|
if (!apiKey) {
|
|
15539
|
-
const profileFile =
|
|
15540
|
-
if (
|
|
13966
|
+
const profileFile = join6(connectorConfigDir, "profiles", `${currentProfile}.json`);
|
|
13967
|
+
if (existsSync6(profileFile)) {
|
|
15541
13968
|
try {
|
|
15542
|
-
const config = JSON.parse(
|
|
13969
|
+
const config = JSON.parse(readFileSync5(profileFile, "utf-8"));
|
|
15543
13970
|
apiKey = Object.values(config).find((v) => typeof v === "string" && v.length > 0);
|
|
15544
13971
|
} catch {}
|
|
15545
13972
|
}
|
|
15546
13973
|
}
|
|
15547
13974
|
if (!apiKey) {
|
|
15548
|
-
const profileDirConfig =
|
|
15549
|
-
if (
|
|
13975
|
+
const profileDirConfig = join6(connectorConfigDir, "profiles", currentProfile, "config.json");
|
|
13976
|
+
if (existsSync6(profileDirConfig)) {
|
|
15550
13977
|
try {
|
|
15551
|
-
const config = JSON.parse(
|
|
13978
|
+
const config = JSON.parse(readFileSync5(profileDirConfig, "utf-8"));
|
|
15552
13979
|
apiKey = Object.values(config).find((v) => typeof v === "string" && v.length > 0);
|
|
15553
13980
|
} catch {}
|
|
15554
13981
|
}
|
|
@@ -15685,7 +14112,7 @@ program2.command("run").description("Execute an API operation on a connector").a
|
|
|
15685
14112
|
console.error(chalk2.yellow(`No command specified. Run ${chalk2.white(`connectors ops ${name}`)} to see available operations.`));
|
|
15686
14113
|
process.exit(1);
|
|
15687
14114
|
}
|
|
15688
|
-
const result = await
|
|
14115
|
+
const result = await runConnectorCommand(name, args, parseInt(options.timeout));
|
|
15689
14116
|
if (result.stdout) {
|
|
15690
14117
|
console.log(result.stdout);
|
|
15691
14118
|
}
|
|
@@ -15715,7 +14142,7 @@ Setting up ${meta.displayName}...
|
|
|
15715
14142
|
const alreadyInstalled = installed.includes(meta.name);
|
|
15716
14143
|
let installResult;
|
|
15717
14144
|
if (alreadyInstalled && !options.overwrite) {
|
|
15718
|
-
installResult = { success: true, path:
|
|
14145
|
+
installResult = { success: true, path: join6(process.cwd(), ".connectors", `connect-${meta.name}`) };
|
|
15719
14146
|
if (!options.json) {
|
|
15720
14147
|
console.log(` ${chalk2.green("\u2713")} Already installed`);
|
|
15721
14148
|
}
|
|
@@ -15740,7 +14167,7 @@ Setting up ${meta.displayName}...
|
|
|
15740
14167
|
let authConfigured = false;
|
|
15741
14168
|
if (authType === "oauth") {
|
|
15742
14169
|
if (options.key) {
|
|
15743
|
-
|
|
14170
|
+
saveApiKey(name, options.key, options.field || undefined);
|
|
15744
14171
|
authConfigured = true;
|
|
15745
14172
|
if (!options.json) {
|
|
15746
14173
|
console.log(` ${chalk2.green("\u2713")} Token saved`);
|
|
@@ -15798,7 +14225,7 @@ Setting up ${meta.displayName}...
|
|
|
15798
14225
|
}
|
|
15799
14226
|
} else {
|
|
15800
14227
|
if (options.key) {
|
|
15801
|
-
|
|
14228
|
+
saveApiKey(name, options.key, options.field || undefined);
|
|
15802
14229
|
authConfigured = true;
|
|
15803
14230
|
if (!options.json) {
|
|
15804
14231
|
console.log(` ${chalk2.green("\u2713")} ${authType === "bearer" ? "Bearer token" : "API key"} saved`);
|
|
@@ -15841,299 +14268,4 @@ Setting up ${meta.displayName}...
|
|
|
15841
14268
|
}
|
|
15842
14269
|
process.exit(0);
|
|
15843
14270
|
});
|
|
15844
|
-
program2.command("hot").description("Show top connectors by usage").option("--limit <n>", "Max results", "10").option("--days <n>", "Time window in days", "7").option("--json", "Output as JSON").action((options) => {
|
|
15845
|
-
const { getTopConnectors: getTopConnectors2 } = (init_usage(), __toCommonJS(exports_usage));
|
|
15846
|
-
const { getPromotedConnectors: getPromotedConnectors2 } = (init_promotions(), __toCommonJS(exports_promotions));
|
|
15847
|
-
const top = getTopConnectors2(parseInt(options.limit), parseInt(options.days), getDatabase());
|
|
15848
|
-
const promoted = new Set(getPromotedConnectors2(getDatabase()));
|
|
15849
|
-
if (options.json) {
|
|
15850
|
-
console.log(JSON.stringify(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) }))));
|
|
15851
|
-
return;
|
|
15852
|
-
}
|
|
15853
|
-
if (top.length === 0) {
|
|
15854
|
-
console.log(chalk2.dim("No usage data yet. Use connectors to build up stats."));
|
|
15855
|
-
return;
|
|
15856
|
-
}
|
|
15857
|
-
console.log(chalk2.bold(`
|
|
15858
|
-
Top connectors (last ${options.days} days):
|
|
15859
|
-
`));
|
|
15860
|
-
console.log(` ${chalk2.dim("#".padEnd(4))}${chalk2.dim("Connector".padEnd(22))}${chalk2.dim("Usage".padEnd(8))}${chalk2.dim("Badges")}`);
|
|
15861
|
-
console.log(chalk2.dim(` ${"\u2500".repeat(45)}`));
|
|
15862
|
-
for (let i = 0;i < top.length; i++) {
|
|
15863
|
-
const t = top[i];
|
|
15864
|
-
const badges = [
|
|
15865
|
-
t.count >= 5 ? chalk2.red("[HOT]") : "",
|
|
15866
|
-
promoted.has(t.connector) ? chalk2.yellow("[PRO]") : ""
|
|
15867
|
-
].filter(Boolean).join(" ");
|
|
15868
|
-
console.log(` ${String(i + 1).padEnd(4)}${chalk2.cyan(t.connector.padEnd(22))}${String(t.count).padEnd(8)}${badges}`);
|
|
15869
|
-
}
|
|
15870
|
-
});
|
|
15871
|
-
program2.command("promote").argument("<connector>", "Connector to promote").description("Mark a connector as promoted (boosted in search)").action((connector) => {
|
|
15872
|
-
const meta = getConnector(connector);
|
|
15873
|
-
if (!meta) {
|
|
15874
|
-
console.error(chalk2.red(`Connector '${connector}' not found`));
|
|
15875
|
-
process.exit(1);
|
|
15876
|
-
}
|
|
15877
|
-
const { promoteConnector: promoteConnector2 } = (init_promotions(), __toCommonJS(exports_promotions));
|
|
15878
|
-
promoteConnector2(connector, getDatabase());
|
|
15879
|
-
console.log(chalk2.green("\u2713") + ` ${meta.displayName} promoted \u2014 will rank higher in search`);
|
|
15880
|
-
});
|
|
15881
|
-
program2.command("demote").argument("<connector>", "Connector to demote").description("Remove promotion from a connector").action((connector) => {
|
|
15882
|
-
const { demoteConnector: demoteConnector2 } = (init_promotions(), __toCommonJS(exports_promotions));
|
|
15883
|
-
const removed = demoteConnector2(connector, getDatabase());
|
|
15884
|
-
if (removed)
|
|
15885
|
-
console.log(chalk2.green("\u2713") + ` ${connector} demoted`);
|
|
15886
|
-
else
|
|
15887
|
-
console.log(chalk2.dim(`${connector} was not promoted`));
|
|
15888
|
-
});
|
|
15889
|
-
var jobsCmd = program2.command("jobs").description("Manage scheduled connector jobs");
|
|
15890
|
-
jobsCmd.command("add").description("Add a scheduled job").requiredOption("--name <name>", "Job name").requiredOption("--connector <connector>", "Connector name").requiredOption("--command <command>", "Command to run").requiredOption("--cron <cron>", "Cron expression (5-field)").option("--args <args>", "Command args (space-separated)").option("--strip", "Apply LLM stripping to output").option("--json", "Output as JSON").action((options) => {
|
|
15891
|
-
const db = getDatabase();
|
|
15892
|
-
const args = options.args ? options.args.split(" ") : [];
|
|
15893
|
-
const job = createJob({ name: options.name, connector: options.connector, command: options.command, args, cron: options.cron, strip: !!options.strip }, db);
|
|
15894
|
-
if (options.json) {
|
|
15895
|
-
console.log(JSON.stringify(job));
|
|
15896
|
-
return;
|
|
15897
|
-
}
|
|
15898
|
-
console.log(chalk2.green("\u2713") + ` Job created: ${job.name} (${job.cron})`);
|
|
15899
|
-
});
|
|
15900
|
-
jobsCmd.command("list").description("List all jobs").option("--json", "Output as JSON").action((options) => {
|
|
15901
|
-
const jobs = listJobs(getDatabase());
|
|
15902
|
-
if (options.json) {
|
|
15903
|
-
console.log(JSON.stringify(jobs));
|
|
15904
|
-
return;
|
|
15905
|
-
}
|
|
15906
|
-
if (jobs.length === 0) {
|
|
15907
|
-
console.log(chalk2.dim("No jobs configured."));
|
|
15908
|
-
return;
|
|
15909
|
-
}
|
|
15910
|
-
for (const j of jobs) {
|
|
15911
|
-
const status = j.enabled ? chalk2.green("enabled") : chalk2.dim("disabled");
|
|
15912
|
-
const strip = j.strip ? chalk2.cyan(" [strip]") : "";
|
|
15913
|
-
console.log(` ${j.name.padEnd(20)} ${j.connector}.${j.command.padEnd(16)} ${j.cron.padEnd(15)} ${status}${strip}`);
|
|
15914
|
-
}
|
|
15915
|
-
});
|
|
15916
|
-
jobsCmd.command("run").description("Manually trigger a job").argument("<name>", "Job name").option("--json", "Output as JSON").action(async (name, options) => {
|
|
15917
|
-
const db = getDatabase();
|
|
15918
|
-
const job = getJobByName(name, db);
|
|
15919
|
-
if (!job) {
|
|
15920
|
-
console.error(chalk2.red(`Job "${name}" not found`));
|
|
15921
|
-
process.exit(1);
|
|
15922
|
-
}
|
|
15923
|
-
if (!options.json)
|
|
15924
|
-
console.log(chalk2.dim(`Running ${job.connector} ${job.command}...`));
|
|
15925
|
-
const result = await triggerJob(job, db);
|
|
15926
|
-
if (options.json) {
|
|
15927
|
-
console.log(JSON.stringify(result));
|
|
15928
|
-
return;
|
|
15929
|
-
}
|
|
15930
|
-
const icon = result.exit_code === 0 ? chalk2.green("\u2713") : chalk2.red("\u2717");
|
|
15931
|
-
console.log(`${icon} Run ${result.run_id} \u2014 exit ${result.exit_code}`);
|
|
15932
|
-
if (result.output)
|
|
15933
|
-
console.log(result.output.slice(0, 2000));
|
|
15934
|
-
});
|
|
15935
|
-
jobsCmd.command("logs").description("Show recent runs for a job").argument("<name>", "Job name").option("--limit <n>", "Max results", "10").option("--json", "Output as JSON").action((name, options) => {
|
|
15936
|
-
const db = getDatabase();
|
|
15937
|
-
const job = getJobByName(name, db);
|
|
15938
|
-
if (!job) {
|
|
15939
|
-
console.error(chalk2.red(`Job "${name}" not found`));
|
|
15940
|
-
process.exit(1);
|
|
15941
|
-
}
|
|
15942
|
-
const runs = listJobRuns(job.id, parseInt(options.limit), db);
|
|
15943
|
-
if (options.json) {
|
|
15944
|
-
console.log(JSON.stringify(runs));
|
|
15945
|
-
return;
|
|
15946
|
-
}
|
|
15947
|
-
if (runs.length === 0) {
|
|
15948
|
-
console.log(chalk2.dim("No runs yet."));
|
|
15949
|
-
return;
|
|
15950
|
-
}
|
|
15951
|
-
for (const r of runs) {
|
|
15952
|
-
const icon = r.exit_code === 0 ? chalk2.green("\u2713") : chalk2.red("\u2717");
|
|
15953
|
-
console.log(` ${icon} ${r.started_at.slice(0, 19)} \u2014 exit ${r.exit_code ?? "?"}`);
|
|
15954
|
-
}
|
|
15955
|
-
});
|
|
15956
|
-
jobsCmd.command("enable").description("Enable a job").argument("<name>").action((name) => {
|
|
15957
|
-
const db = getDatabase();
|
|
15958
|
-
const job = getJobByName(name, db);
|
|
15959
|
-
if (!job) {
|
|
15960
|
-
console.error(chalk2.red(`Job "${name}" not found`));
|
|
15961
|
-
process.exit(1);
|
|
15962
|
-
}
|
|
15963
|
-
updateJob(job.id, { enabled: true }, db);
|
|
15964
|
-
console.log(chalk2.green("\u2713") + ` Job "${name}" enabled`);
|
|
15965
|
-
});
|
|
15966
|
-
jobsCmd.command("disable").description("Disable a job").argument("<name>").action((name) => {
|
|
15967
|
-
const db = getDatabase();
|
|
15968
|
-
const job = getJobByName(name, db);
|
|
15969
|
-
if (!job) {
|
|
15970
|
-
console.error(chalk2.red(`Job "${name}" not found`));
|
|
15971
|
-
process.exit(1);
|
|
15972
|
-
}
|
|
15973
|
-
updateJob(job.id, { enabled: false }, db);
|
|
15974
|
-
console.log(chalk2.green("\u2713") + ` Job "${name}" disabled`);
|
|
15975
|
-
});
|
|
15976
|
-
jobsCmd.command("delete").description("Delete a job").argument("<name>").action((name) => {
|
|
15977
|
-
const db = getDatabase();
|
|
15978
|
-
const job = getJobByName(name, db);
|
|
15979
|
-
if (!job) {
|
|
15980
|
-
console.error(chalk2.red(`Job "${name}" not found`));
|
|
15981
|
-
process.exit(1);
|
|
15982
|
-
}
|
|
15983
|
-
deleteJob(job.id, db);
|
|
15984
|
-
console.log(chalk2.green("\u2713") + ` Job "${name}" deleted`);
|
|
15985
|
-
});
|
|
15986
|
-
var workflowsCmd = program2.command("workflows").description("Manage connector workflows (sequential pipelines)");
|
|
15987
|
-
workflowsCmd.command("add").description("Create a workflow from a JSON steps array").requiredOption("--name <name>", "Workflow name").requiredOption("--steps <json>", `Steps JSON array, e.g. '[{"connector":"stripe","command":"products list"}]'`).option("--json", "Output as JSON").action((options) => {
|
|
15988
|
-
let steps;
|
|
15989
|
-
try {
|
|
15990
|
-
steps = JSON.parse(options.steps);
|
|
15991
|
-
} catch {
|
|
15992
|
-
console.error(chalk2.red("Invalid JSON for --steps"));
|
|
15993
|
-
process.exit(1);
|
|
15994
|
-
}
|
|
15995
|
-
const wf = createWorkflow({ name: options.name, steps }, getDatabase());
|
|
15996
|
-
if (options.json) {
|
|
15997
|
-
console.log(JSON.stringify(wf));
|
|
15998
|
-
return;
|
|
15999
|
-
}
|
|
16000
|
-
console.log(chalk2.green("\u2713") + ` Workflow "${wf.name}" created (${wf.steps.length} steps)`);
|
|
16001
|
-
});
|
|
16002
|
-
workflowsCmd.command("list").description("List all workflows").option("--json", "Output as JSON").action((options) => {
|
|
16003
|
-
const wfs = listWorkflows(getDatabase());
|
|
16004
|
-
if (options.json) {
|
|
16005
|
-
console.log(JSON.stringify(wfs));
|
|
16006
|
-
return;
|
|
16007
|
-
}
|
|
16008
|
-
if (wfs.length === 0) {
|
|
16009
|
-
console.log(chalk2.dim("No workflows configured."));
|
|
16010
|
-
return;
|
|
16011
|
-
}
|
|
16012
|
-
for (const wf of wfs) {
|
|
16013
|
-
const status = wf.enabled ? chalk2.green("enabled") : chalk2.dim("disabled");
|
|
16014
|
-
console.log(` ${wf.name.padEnd(20)} ${String(wf.steps.length).padStart(2)} steps ${status}`);
|
|
16015
|
-
}
|
|
16016
|
-
});
|
|
16017
|
-
workflowsCmd.command("run").description("Run a workflow").argument("<name>", "Workflow name").option("--json", "Output as JSON").action(async (name, options) => {
|
|
16018
|
-
const wf = getWorkflowByName(name, getDatabase());
|
|
16019
|
-
if (!wf) {
|
|
16020
|
-
console.error(chalk2.red(`Workflow "${name}" not found`));
|
|
16021
|
-
process.exit(1);
|
|
16022
|
-
}
|
|
16023
|
-
if (!options.json)
|
|
16024
|
-
console.log(chalk2.dim(`Running workflow "${wf.name}" (${wf.steps.length} steps)...`));
|
|
16025
|
-
const result = await runWorkflow(wf);
|
|
16026
|
-
if (options.json) {
|
|
16027
|
-
console.log(JSON.stringify(result));
|
|
16028
|
-
return;
|
|
16029
|
-
}
|
|
16030
|
-
for (const step of result.steps) {
|
|
16031
|
-
const icon = step.exit_code === 0 ? chalk2.green("\u2713") : chalk2.red("\u2717");
|
|
16032
|
-
console.log(` ${icon} Step ${step.step}: ${step.connector} ${step.command}`);
|
|
16033
|
-
}
|
|
16034
|
-
console.log(result.success ? chalk2.green(`
|
|
16035
|
-
Workflow completed`) : chalk2.red(`
|
|
16036
|
-
Workflow failed`));
|
|
16037
|
-
});
|
|
16038
|
-
workflowsCmd.command("delete").description("Delete a workflow").argument("<name>").action((name) => {
|
|
16039
|
-
const wf = getWorkflowByName(name, getDatabase());
|
|
16040
|
-
if (!wf) {
|
|
16041
|
-
console.error(chalk2.red(`Workflow "${name}" not found`));
|
|
16042
|
-
process.exit(1);
|
|
16043
|
-
}
|
|
16044
|
-
deleteWorkflow(wf.id, getDatabase());
|
|
16045
|
-
console.log(chalk2.green("\u2713") + ` Workflow "${name}" deleted`);
|
|
16046
|
-
});
|
|
16047
|
-
var llmCmd = program2.command("llm").description("Manage LLM provider for output stripping");
|
|
16048
|
-
llmCmd.command("set").description("Configure LLM provider and API key").requiredOption("--provider <provider>", "Provider: cerebras, groq, openai, anthropic").requiredOption("--key <key>", "API key").option("--model <model>", "Model name (defaults to provider default)").option("--json", "Output as JSON").action((options) => {
|
|
16049
|
-
const provider = options.provider;
|
|
16050
|
-
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
16051
|
-
if (!validProviders.includes(provider)) {
|
|
16052
|
-
console.error(chalk2.red(`Unknown provider "${provider}". Valid: ${validProviders.join(", ")}`));
|
|
16053
|
-
process.exit(1);
|
|
16054
|
-
}
|
|
16055
|
-
const model = options.model || PROVIDER_DEFAULTS[provider].model;
|
|
16056
|
-
const existing = getLlmConfig();
|
|
16057
|
-
saveLlmConfig({ provider, model, api_key: options.key, strip: existing?.strip ?? false });
|
|
16058
|
-
if (options.json) {
|
|
16059
|
-
console.log(JSON.stringify({ provider, model, key: maskKey(options.key), strip: existing?.strip ?? false }));
|
|
16060
|
-
} else {
|
|
16061
|
-
console.log(chalk2.green("\u2713") + ` LLM configured: ${provider} / ${model}`);
|
|
16062
|
-
console.log(` Key: ${maskKey(options.key)}`);
|
|
16063
|
-
console.log(` Strip: ${existing?.strip ? chalk2.green("enabled") : chalk2.dim("disabled")} (run 'connectors llm strip enable' to turn on)`);
|
|
16064
|
-
}
|
|
16065
|
-
});
|
|
16066
|
-
llmCmd.command("status").description("Show current LLM configuration").option("--json", "Output as JSON").action((options) => {
|
|
16067
|
-
const config = getLlmConfig();
|
|
16068
|
-
if (!config) {
|
|
16069
|
-
if (options.json)
|
|
16070
|
-
console.log(JSON.stringify({ configured: false }));
|
|
16071
|
-
else
|
|
16072
|
-
console.log(chalk2.dim("No LLM configured. Run: connectors llm set --provider <provider> --key <key>"));
|
|
16073
|
-
return;
|
|
16074
|
-
}
|
|
16075
|
-
if (options.json) {
|
|
16076
|
-
console.log(JSON.stringify({ configured: true, provider: config.provider, model: config.model, key: maskKey(config.api_key), strip: config.strip }));
|
|
16077
|
-
} else {
|
|
16078
|
-
console.log(chalk2.bold("LLM Configuration"));
|
|
16079
|
-
console.log(` Provider : ${config.provider}`);
|
|
16080
|
-
console.log(` Model : ${config.model}`);
|
|
16081
|
-
console.log(` Key : ${maskKey(config.api_key)}`);
|
|
16082
|
-
console.log(` Strip : ${config.strip ? chalk2.green("enabled") : chalk2.red("disabled")}`);
|
|
16083
|
-
}
|
|
16084
|
-
});
|
|
16085
|
-
llmCmd.command("strip").description("Enable or disable global output stripping").argument("<action>", "enable or disable").action((action) => {
|
|
16086
|
-
if (action !== "enable" && action !== "disable") {
|
|
16087
|
-
console.error(chalk2.red('Action must be "enable" or "disable"'));
|
|
16088
|
-
process.exit(1);
|
|
16089
|
-
}
|
|
16090
|
-
try {
|
|
16091
|
-
setLlmStrip(action === "enable");
|
|
16092
|
-
console.log(chalk2.green("\u2713") + ` Output stripping ${action}d`);
|
|
16093
|
-
} catch (e) {
|
|
16094
|
-
console.error(chalk2.red(String(e instanceof Error ? e.message : e)));
|
|
16095
|
-
process.exit(1);
|
|
16096
|
-
}
|
|
16097
|
-
});
|
|
16098
|
-
llmCmd.command("test").description("Test current LLM configuration with a sample prompt").option("--json", "Output as JSON").action(async (options) => {
|
|
16099
|
-
const config = getLlmConfig();
|
|
16100
|
-
if (!config) {
|
|
16101
|
-
console.error(chalk2.red("No LLM configured. Run: connectors llm set --provider <provider> --key <key>"));
|
|
16102
|
-
process.exit(1);
|
|
16103
|
-
}
|
|
16104
|
-
if (!options.json)
|
|
16105
|
-
console.log(chalk2.dim(`Testing ${config.provider} / ${config.model}...`));
|
|
16106
|
-
try {
|
|
16107
|
-
const client = new LLMClient(config);
|
|
16108
|
-
const result = await client.complete('You are a helpful assistant. Respond with exactly: {"status":"ok"}', "ping");
|
|
16109
|
-
if (options.json) {
|
|
16110
|
-
console.log(JSON.stringify({ success: true, provider: result.provider, model: result.model, latency_ms: result.latency_ms, response: result.content }));
|
|
16111
|
-
} else {
|
|
16112
|
-
console.log(chalk2.green("\u2713") + ` Response received in ${result.latency_ms}ms`);
|
|
16113
|
-
console.log(` ${result.content.trim()}`);
|
|
16114
|
-
}
|
|
16115
|
-
} catch (e) {
|
|
16116
|
-
if (options.json)
|
|
16117
|
-
console.log(JSON.stringify({ success: false, error: String(e instanceof Error ? e.message : e) }));
|
|
16118
|
-
else
|
|
16119
|
-
console.error(chalk2.red("\u2717 " + String(e instanceof Error ? e.message : e)));
|
|
16120
|
-
process.exit(1);
|
|
16121
|
-
}
|
|
16122
|
-
});
|
|
16123
|
-
llmCmd.command("providers").description("List supported LLM providers").option("--json", "Output as JSON").action((options) => {
|
|
16124
|
-
const providers = [
|
|
16125
|
-
{ name: "cerebras", baseUrl: "https://api.cerebras.ai/v1", defaultModel: PROVIDER_DEFAULTS.cerebras.model, compatible: "OpenAI" },
|
|
16126
|
-
{ name: "groq", baseUrl: "https://api.groq.com/openai/v1", defaultModel: PROVIDER_DEFAULTS.groq.model, compatible: "OpenAI" },
|
|
16127
|
-
{ name: "openai", baseUrl: "https://api.openai.com/v1", defaultModel: PROVIDER_DEFAULTS.openai.model, compatible: "OpenAI" },
|
|
16128
|
-
{ name: "anthropic", baseUrl: "https://api.anthropic.com/v1", defaultModel: PROVIDER_DEFAULTS.anthropic.model, compatible: "Anthropic" }
|
|
16129
|
-
];
|
|
16130
|
-
if (options.json) {
|
|
16131
|
-
console.log(JSON.stringify(providers));
|
|
16132
|
-
return;
|
|
16133
|
-
}
|
|
16134
|
-
console.log(chalk2.bold("Supported LLM Providers"));
|
|
16135
|
-
for (const p of providers) {
|
|
16136
|
-
console.log(` ${chalk2.cyan(p.name.padEnd(12))} ${p.defaultModel.padEnd(30)} ${chalk2.dim(p.baseUrl)}`);
|
|
16137
|
-
}
|
|
16138
|
-
});
|
|
16139
14271
|
program2.parse();
|