@hasna/connectors 1.4.4 → 1.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -15
- package/bin/index.js +2076 -1601
- package/bin/mcp.js +757 -344
- package/bin/serve.js +960 -1206
- package/connectors/3scribe/package.json +1 -1
- package/connectors/7todos/package.json +1 -1
- package/connectors/ably/package.json +1 -1
- package/connectors/abstract/package.json +1 -1
- package/connectors/abuselpdb/package.json +1 -1
- package/connectors/accelo/package.json +1 -1
- package/connectors/accredible/package.json +1 -1
- package/connectors/accurai/package.json +1 -1
- package/connectors/accuranker/package.json +1 -1
- package/connectors/acquire/package.json +1 -1
- package/connectors/actionnetwork/package.json +1 -1
- package/connectors/activecampaign/package.json +1 -1
- package/connectors/activetrail/package.json +1 -1
- package/connectors/adalo/package.json +1 -1
- package/connectors/adobe/package.json +1 -1
- package/connectors/adroll/package.json +1 -1
- package/connectors/affinity/package.json +1 -1
- package/connectors/agent/package.json +1 -1
- package/connectors/agilecrm/package.json +1 -1
- package/connectors/aiagenttool/package.json +1 -1
- package/connectors/airbrake/package.json +1 -1
- package/connectors/airnow/package.json +1 -1
- package/connectors/airtable/package.json +1 -1
- package/connectors/airtop/package.json +1 -1
- package/connectors/aitableai/package.json +1 -1
- package/connectors/alchemy/package.json +1 -1
- package/connectors/alerty/package.json +1 -1
- package/connectors/alienvault/package.json +1 -1
- package/connectors/alphamoon/package.json +1 -1
- package/connectors/alttextai/package.json +1 -1
- package/connectors/amadeus/package.json +1 -1
- package/connectors/amazon/package.json +1 -1
- package/connectors/amilia/package.json +1 -1
- package/connectors/amplitude/package.json +1 -1
- package/connectors/amqpsender/package.json +1 -1
- package/connectors/announcekit/package.json +1 -1
- package/connectors/anthropic/package.json +1 -1
- package/connectors/anyscale/package.json +1 -1
- package/connectors/apiary/package.json +1 -1
- package/connectors/apiflash/package.json +1 -1
- package/connectors/apitemplateio/package.json +1 -1
- package/connectors/apptivegrid/package.json +1 -1
- package/connectors/arxiv/package.json +1 -1
- package/connectors/asana/package.json +1 -1
- package/connectors/assemblyai/package.json +1 -1
- package/connectors/auth0/package.json +1 -1
- package/connectors/autom/package.json +1 -1
- package/connectors/automizy/package.json +1 -1
- package/connectors/autopilot/package.json +1 -1
- package/connectors/aws/package.json +2 -2
- package/connectors/awscognito/package.json +1 -1
- package/connectors/azureaisearchvectorstore/package.json +1 -1
- package/connectors/azurecosmosdb/package.json +1 -1
- package/connectors/azureopenaichatmodel/package.json +1 -1
- package/connectors/azurestorage/package.json +1 -1
- package/connectors/badgermaps/package.json +1 -1
- package/connectors/bamboohr/package.json +1 -1
- package/connectors/bandwidth/package.json +1 -1
- package/connectors/bannerbear/package.json +1 -1
- package/connectors/baserow/package.json +1 -1
- package/connectors/baseten/package.json +1 -1
- package/connectors/beeminder/package.json +1 -1
- package/connectors/benchmarkemail/package.json +1 -1
- package/connectors/betterproposals/package.json +1 -1
- package/connectors/bigcartel/package.json +1 -1
- package/connectors/bigdatacloud/package.json +1 -1
- package/connectors/bigml/package.json +1 -1
- package/connectors/bitly/package.json +1 -1
- package/connectors/bitrix24/package.json +1 -1
- package/connectors/bitwarden/package.json +1 -1
- package/connectors/blaze/package.json +1 -1
- package/connectors/blockchainexchange/package.json +1 -1
- package/connectors/bloock/package.json +1 -1
- package/connectors/bluesky/package.json +1 -1
- package/connectors/bot9/package.json +1 -1
- package/connectors/botbaba/package.json +1 -1
- package/connectors/botifier/package.json +1 -1
- package/connectors/botiumbox/package.json +1 -1
- package/connectors/botsonic/package.json +1 -1
- package/connectors/botstar/package.json +1 -1
- package/connectors/box/package.json +1 -1
- package/connectors/brainpodai/package.json +1 -1
- package/connectors/brandblast/package.json +1 -1
- package/connectors/brandfetch/package.json +1 -1
- package/connectors/brandmentions/package.json +1 -1
- package/connectors/brandsight/package.json +1 -1
- package/connectors/breezyhr/package.json +1 -1
- package/connectors/brevo/package.json +1 -1
- package/connectors/brex/package.json +1 -1
- package/connectors/browseai/package.json +1 -1
- package/connectors/browserless/package.json +1 -1
- package/connectors/browserstack/package.json +1 -1
- package/connectors/browseruse/package.json +1 -1
- package/connectors/bubble/package.json +1 -1
- package/connectors/bugbug/package.json +1 -1
- package/connectors/bugfender/package.json +1 -1
- package/connectors/bugherd/package.json +1 -1
- package/connectors/bugpilot/package.json +1 -1
- package/connectors/bugreplay/package.json +1 -1
- package/connectors/bugshot/package.json +1 -1
- package/connectors/buildkite/package.json +1 -1
- package/connectors/bunnycdn/package.json +1 -1
- package/connectors/calendarhero/package.json +1 -1
- package/connectors/calendly/package.json +1 -1
- package/connectors/canvas/package.json +1 -1
- package/connectors/capsule/package.json +1 -1
- package/connectors/carbonblack/package.json +1 -1
- package/connectors/cerebras/package.json +1 -1
- package/connectors/chaindesk/package.json +1 -1
- package/connectors/chargebee/package.json +1 -1
- package/connectors/chargeover/package.json +1 -1
- package/connectors/chargify/package.json +1 -1
- package/connectors/chatbase/package.json +1 -1
- package/connectors/chatling/package.json +1 -1
- package/connectors/chatmasters/package.json +1 -1
- package/connectors/chatrace/package.json +1 -1
- package/connectors/chatsonic/package.json +1 -1
- package/connectors/chekhub/package.json +1 -1
- package/connectors/chromavectorstore/package.json +1 -1
- package/connectors/circleci/package.json +1 -1
- package/connectors/ciscomeraki/package.json +1 -1
- package/connectors/ciscosecureendpoint/package.json +1 -1
- package/connectors/ciscoumbrella/package.json +1 -1
- package/connectors/ciscowebex/package.json +1 -1
- package/connectors/citrixadc/package.json +1 -1
- package/connectors/clappia/package.json +1 -1
- package/connectors/clarifai/package.json +1 -1
- package/connectors/clearbit/package.json +1 -1
- package/connectors/cleverreach/package.json +1 -1
- package/connectors/clickbank/package.json +2 -2
- package/connectors/clicksendsms/package.json +1 -1
- package/connectors/clickup/package.json +1 -1
- package/connectors/clockify/package.json +1 -1
- package/connectors/cloozo/package.json +1 -1
- package/connectors/cloud66/package.json +1 -1
- package/connectors/cloudboost/package.json +1 -1
- package/connectors/cloudconvert/package.json +1 -1
- package/connectors/cloudflare/package.json +1 -1
- package/connectors/cloudflare-workers/package.json +1 -1
- package/connectors/cloudlayer/package.json +1 -1
- package/connectors/cloudshare/package.json +1 -1
- package/connectors/cloze/package.json +1 -1
- package/connectors/cockpit/package.json +1 -1
- package/connectors/coda/package.json +1 -1
- package/connectors/codeclimate/package.json +1 -1
- package/connectors/codefresh/package.json +1 -1
- package/connectors/cody/package.json +1 -1
- package/connectors/cohere/package.json +1 -1
- package/connectors/coinbase/package.json +1 -1
- package/connectors/coingecko/package.json +1 -1
- package/connectors/collegefootballdata/package.json +1 -1
- package/connectors/configcat/package.json +1 -1
- package/connectors/confluence/package.json +1 -1
- package/connectors/confluent/package.json +1 -1
- package/connectors/connect-twocaptcha/package.json +1 -1
- package/connectors/connect-voxel-energy/package.json +1 -1
- package/connectors/contactout/package.json +1 -1
- package/connectors/contentful/package.json +1 -1
- package/connectors/convertapi/package.json +1 -1
- package/connectors/convertkit/package.json +1 -1
- package/connectors/convi/package.json +1 -1
- package/connectors/copper/package.json +1 -1
- package/connectors/copyai/package.json +1 -1
- package/connectors/corsizio/package.json +1 -1
- package/connectors/cortex/package.json +1 -1
- package/connectors/cradlai/package.json +1 -1
- package/connectors/craftdraft/package.json +1 -1
- package/connectors/cratedb/package.json +1 -1
- package/connectors/crisp/package.json +1 -1
- package/connectors/cronly/package.json +1 -1
- package/connectors/crossmint/package.json +1 -1
- package/connectors/crowddev/package.json +1 -1
- package/connectors/crowdin/package.json +1 -1
- package/connectors/crowdpower/package.json +1 -1
- package/connectors/crowdstrike/package.json +1 -1
- package/connectors/cryptolens/package.json +1 -1
- package/connectors/currents/package.json +1 -1
- package/connectors/customerio/package.json +1 -1
- package/connectors/customeriq/package.json +1 -1
- package/connectors/daffy/package.json +1 -1
- package/connectors/danteai/package.json +1 -1
- package/connectors/darkskyapi/package.json +1 -1
- package/connectors/dasha/package.json +1 -1
- package/connectors/databox/package.json +1 -1
- package/connectors/databricks/package.json +1 -1
- package/connectors/datadog/package.json +1 -1
- package/connectors/datarobot/package.json +1 -1
- package/connectors/datasoap/package.json +1 -1
- package/connectors/datumbox/package.json +1 -1
- package/connectors/dayschedule/package.json +1 -1
- package/connectors/deepgram/package.json +1 -1
- package/connectors/deepinfra/package.json +1 -1
- package/connectors/deepl/package.json +1 -1
- package/connectors/deepseek/package.json +1 -1
- package/connectors/demio/package.json +1 -1
- package/connectors/descript/package.json +1 -1
- package/connectors/detrack/package.json +1 -1
- package/connectors/devcycle/package.json +1 -1
- package/connectors/dhl/package.json +1 -1
- package/connectors/dialzara/package.json +1 -1
- package/connectors/diddoai/package.json +1 -1
- package/connectors/diffy/package.json +1 -1
- package/connectors/digicert/package.json +1 -1
- package/connectors/digitalocean/package.json +1 -1
- package/connectors/discord/package.json +1 -1
- package/connectors/discourse/package.json +1 -1
- package/connectors/disqus/package.json +1 -1
- package/connectors/dockcerts/package.json +1 -1
- package/connectors/docker/package.json +1 -1
- package/connectors/docparser/package.json +1 -1
- package/connectors/docsbotai/package.json +1 -1
- package/connectors/docupilot/package.json +1 -1
- package/connectors/docusign/package.json +1 -1
- package/connectors/docuwriter/package.json +1 -1
- package/connectors/dokan/package.json +1 -1
- package/connectors/domo/package.json +1 -1
- package/connectors/draftable/package.json +1 -1
- package/connectors/drift/package.json +1 -1
- package/connectors/dropbox/package.json +1 -1
- package/connectors/dropcontact/package.json +1 -1
- package/connectors/droxy/package.json +1 -1
- package/connectors/dynatrace/package.json +1 -1
- package/connectors/e2b/package.json +1 -1
- package/connectors/eartho/package.json +1 -1
- package/connectors/easyship/package.json +1 -1
- package/connectors/echowin/package.json +1 -1
- package/connectors/ecwid/package.json +1 -1
- package/connectors/edenai/package.json +1 -1
- package/connectors/egoi/package.json +1 -1
- package/connectors/elasticsearch/package.json +1 -1
- package/connectors/elasticsecurity/package.json +1 -1
- package/connectors/elevenlabs/package.json +1 -1
- package/connectors/elmah/package.json +1 -1
- package/connectors/embedai/package.json +1 -1
- package/connectors/emelia/package.json +1 -1
- package/connectors/empsing/package.json +1 -1
- package/connectors/engati/package.json +1 -1
- package/connectors/enormail/package.json +1 -1
- package/connectors/enterpret/package.json +1 -1
- package/connectors/envoy/package.json +1 -1
- package/connectors/epo/package.json +1 -1
- package/connectors/erpnext/package.json +1 -1
- package/connectors/esendex/package.json +1 -1
- package/connectors/evervault/package.json +1 -1
- package/connectors/evolphinzoom/package.json +1 -1
- package/connectors/exa/package.json +1 -1
- package/connectors/f5bigip/package.json +1 -1
- package/connectors/fal/package.json +1 -1
- package/connectors/faraday/package.json +1 -1
- package/connectors/faros/package.json +1 -1
- package/connectors/fastbots/package.json +1 -1
- package/connectors/fathom/package.json +1 -1
- package/connectors/figma/package.json +1 -1
- package/connectors/filemaker/package.json +1 -1
- package/connectors/filescan/package.json +1 -1
- package/connectors/firecrawl/README.md +10 -0
- package/connectors/firecrawl/package.json +1 -1
- package/connectors/firecrawl/src/cli/extraction.test.ts +46 -0
- package/connectors/firecrawl/src/cli/extraction.ts +36 -0
- package/connectors/firecrawl/src/cli/index.ts +5 -0
- package/connectors/fireworks/package.json +1 -1
- package/connectors/firmao/package.json +1 -1
- package/connectors/fitbit/package.json +1 -1
- package/connectors/flagship/package.json +1 -1
- package/connectors/float/package.json +1 -1
- package/connectors/flotiq/package.json +1 -1
- package/connectors/flow/package.json +1 -1
- package/connectors/fluentsupport/package.json +1 -1
- package/connectors/focuster/package.json +1 -1
- package/connectors/formcarry/package.json +1 -1
- package/connectors/formdesk/package.json +1 -1
- package/connectors/formsite/package.json +1 -1
- package/connectors/formsonfire/package.json +1 -1
- package/connectors/formstackdocuments/package.json +1 -1
- package/connectors/fortinetfortigate/package.json +1 -1
- package/connectors/foursquare/package.json +1 -1
- package/connectors/freedictionary/package.json +1 -1
- package/connectors/freshdesk/package.json +1 -1
- package/connectors/freshping/package.json +1 -1
- package/connectors/freshservice/package.json +1 -1
- package/connectors/freshworkscrm/package.json +1 -1
- package/connectors/fullcontact/package.json +1 -1
- package/connectors/fusioo/package.json +1 -1
- package/connectors/gali/package.json +1 -1
- package/connectors/gatekeeper/package.json +1 -1
- package/connectors/genderapi/package.json +1 -1
- package/connectors/getresponse/package.json +1 -1
- package/connectors/getscreenshot/package.json +1 -1
- package/connectors/ghost/package.json +1 -1
- package/connectors/giphy/package.json +1 -1
- package/connectors/gitea/package.json +1 -1
- package/connectors/github/package.json +1 -1
- package/connectors/gitlab/package.json +1 -1
- package/connectors/gleap/package.json +1 -1
- package/connectors/gmail/package.json +1 -1
- package/connectors/gocanvas/package.json +1 -1
- package/connectors/godaddy/package.json +1 -1
- package/connectors/gong/package.json +1 -1
- package/connectors/google/package.json +1 -1
- package/connectors/googleads/package.json +1 -1
- package/connectors/googleanalytics/package.json +1 -1
- package/connectors/googlebigquery/package.json +1 -1
- package/connectors/googlebooks/package.json +1 -1
- package/connectors/googlebusinessprofile/package.json +1 -1
- package/connectors/googlecalendar/package.json +1 -1
- package/connectors/googlechat/package.json +1 -1
- package/connectors/googlecloud/package.json +1 -1
- package/connectors/googlecontacts/package.json +1 -1
- package/connectors/googledocs/package.json +1 -1
- package/connectors/googledrive/package.json +1 -1
- package/connectors/googleforms/package.json +1 -1
- package/connectors/googlegemini/package.json +1 -1
- package/connectors/googlemaps/package.json +1 -1
- package/connectors/googleperspective/package.json +1 -1
- package/connectors/googlephotos/package.json +1 -1
- package/connectors/googlesheets/package.json +1 -1
- package/connectors/googleslides/package.json +1 -1
- package/connectors/googletables/package.json +1 -1
- package/connectors/googletasks/package.json +1 -1
- package/connectors/googletranslate/package.json +1 -1
- package/connectors/googlevertexai/package.json +1 -1
- package/connectors/gotify/package.json +1 -1
- package/connectors/gotowebinar/package.json +1 -1
- package/connectors/gptea/package.json +1 -1
- package/connectors/grafana/package.json +1 -1
- package/connectors/grain/package.json +1 -1
- package/connectors/gravityforms/package.json +1 -1
- package/connectors/grist/package.json +1 -1
- package/connectors/groq/package.json +1 -1
- package/connectors/growbots/package.json +1 -1
- package/connectors/gumroad/package.json +1 -1
- package/connectors/gupshup/package.json +1 -1
- package/connectors/guru/package.json +1 -1
- package/connectors/hackernews/package.json +1 -1
- package/connectors/halopsa/package.json +1 -1
- package/connectors/handwrytten/package.json +1 -1
- package/connectors/hansei/package.json +1 -1
- package/connectors/harrypotterapi/package.json +1 -1
- package/connectors/harvest/package.json +1 -1
- package/connectors/headlesstesting/package.json +1 -1
- package/connectors/hedra/package.json +1 -1
- package/connectors/helcim/package.json +1 -1
- package/connectors/hellosign/package.json +1 -1
- package/connectors/helpscout/package.json +1 -1
- package/connectors/heygen/package.json +1 -1
- package/connectors/heysummit/package.json +1 -1
- package/connectors/highlevel/package.json +1 -1
- package/connectors/homeassistant/package.json +1 -1
- package/connectors/hubplanner/package.json +1 -1
- package/connectors/hubspot/package.json +1 -1
- package/connectors/huggingface/package.json +1 -1
- package/connectors/humanticai/package.json +1 -1
- package/connectors/hunter/package.json +1 -1
- package/connectors/hybridanalysis/package.json +1 -1
- package/connectors/iauditorbysafetyculture/package.json +1 -1
- package/connectors/icons8/package.json +1 -1
- package/connectors/idealpostcodes/package.json +1 -1
- package/connectors/idealspot/package.json +1 -1
- package/connectors/ideogram/package.json +1 -1
- package/connectors/ideta/package.json +1 -1
- package/connectors/imessage/package.json +1 -1
- package/connectors/imgbb/package.json +1 -1
- package/connectors/imgur/package.json +1 -1
- package/connectors/impervawaf/package.json +1 -1
- package/connectors/impira/package.json +1 -1
- package/connectors/industryselect/package.json +1 -1
- package/connectors/influxdbcloud/package.json +1 -1
- package/connectors/infolobby/package.json +1 -1
- package/connectors/instabot/package.json +1 -1
- package/connectors/instabug/package.json +1 -1
- package/connectors/intakeq/package.json +1 -1
- package/connectors/intercom/package.json +1 -1
- package/connectors/invoiced/package.json +1 -1
- package/connectors/invoiceninja/package.json +1 -1
- package/connectors/ip2location/package.json +1 -1
- package/connectors/ipinfo/package.json +1 -1
- package/connectors/ipregistry/package.json +1 -1
- package/connectors/irisdfir/package.json +1 -1
- package/connectors/isn/package.json +1 -1
- package/connectors/iterable/package.json +1 -1
- package/connectors/jama/package.json +1 -1
- package/connectors/jasper/package.json +1 -1
- package/connectors/jenkins/package.json +1 -1
- package/connectors/jinaai/package.json +1 -1
- package/connectors/jira/package.json +1 -1
- package/connectors/kadoa/package.json +1 -1
- package/connectors/kafka/package.json +1 -1
- package/connectors/kaggle/package.json +1 -1
- package/connectors/kanbantool/package.json +1 -1
- package/connectors/karbon/package.json +1 -1
- package/connectors/keap/package.json +1 -1
- package/connectors/keygen/package.json +1 -1
- package/connectors/keyzy/package.json +1 -1
- package/connectors/kibana/package.json +1 -1
- package/connectors/kitemaker/package.json +1 -1
- package/connectors/klaviyo/package.json +1 -1
- package/connectors/klazify/package.json +1 -1
- package/connectors/kling/package.json +1 -1
- package/connectors/knack/package.json +1 -1
- package/connectors/knowbe4/package.json +1 -1
- package/connectors/kobotoolbox/package.json +1 -1
- package/connectors/kraftful/package.json +1 -1
- package/connectors/lagrowthmachine/package.json +1 -1
- package/connectors/lambdatest/package.json +1 -1
- package/connectors/landbot/package.json +1 -1
- package/connectors/laposta/package.json +1 -1
- package/connectors/launch27/package.json +1 -1
- package/connectors/launchdarkly/package.json +1 -1
- package/connectors/ldap/package.json +1 -1
- package/connectors/leadboxer/package.json +1 -1
- package/connectors/leadpops/package.json +1 -1
- package/connectors/lemlist/package.json +1 -1
- package/connectors/lemonsqueezy/package.json +1 -1
- package/connectors/leonardo/package.json +1 -1
- package/connectors/lepton/package.json +1 -1
- package/connectors/letsenhance/package.json +1 -1
- package/connectors/libraria/package.json +1 -1
- package/connectors/lighthouse/package.json +1 -1
- package/connectors/limego/package.json +1 -1
- package/connectors/line/package.json +1 -1
- package/connectors/linear/package.json +1 -1
- package/connectors/lingvanex/package.json +1 -1
- package/connectors/linkedin/package.json +1 -1
- package/connectors/linkish/package.json +1 -1
- package/connectors/linode/package.json +1 -1
- package/connectors/liveagent/package.json +1 -1
- package/connectors/localazy/package.json +1 -1
- package/connectors/loginradius/package.json +1 -1
- package/connectors/lokalise/package.json +1 -1
- package/connectors/lonescale/package.json +1 -1
- package/connectors/lucidchart/package.json +1 -1
- package/connectors/luma/package.json +1 -1
- package/connectors/magento2/package.json +1 -1
- package/connectors/mailcheck/package.json +1 -1
- package/connectors/mailchimp/package.json +1 -1
- package/connectors/mailerlite/package.json +1 -1
- package/connectors/mailersend/package.json +1 -1
- package/connectors/mailgun/package.json +1 -1
- package/connectors/mailify/package.json +1 -1
- package/connectors/mailjet/package.json +1 -1
- package/connectors/mailmodo/package.json +1 -1
- package/connectors/malcore/package.json +1 -1
- package/connectors/mandrill/package.json +1 -1
- package/connectors/marcomrobot/package.json +1 -1
- package/connectors/marketingmasterio/package.json +1 -1
- package/connectors/marketplacer/package.json +1 -1
- package/connectors/marketstack/package.json +1 -1
- package/connectors/maropost/package.json +1 -1
- package/connectors/mastodon/package.json +1 -1
- package/connectors/matrix/package.json +1 -1
- package/connectors/mattermost/package.json +1 -1
- package/connectors/mautic/package.json +1 -1
- package/connectors/mav/package.json +1 -1
- package/connectors/maverick/package.json +1 -1
- package/connectors/medium/package.json +1 -1
- package/connectors/mem/package.json +1 -1
- package/connectors/mercury/package.json +1 -1
- package/connectors/messagebird/package.json +1 -1
- package/connectors/meta/package.json +1 -1
- package/connectors/metabase/package.json +1 -1
- package/connectors/mews/package.json +1 -1
- package/connectors/microsoftazuremonitor/package.json +1 -1
- package/connectors/microsoftdynamics365businesscentralapi/package.json +1 -1
- package/connectors/microsoftdynamicscrm/package.json +1 -1
- package/connectors/microsoftentraid/package.json +1 -1
- package/connectors/microsoftentraidazureactivedirectory/package.json +1 -1
- package/connectors/microsoftexcel/package.json +1 -1
- package/connectors/microsoftgraphsecurity/package.json +1 -1
- package/connectors/microsoftonedrive/package.json +1 -1
- package/connectors/microsoftoutlook/package.json +1 -1
- package/connectors/microsoftsharepoint/package.json +1 -1
- package/connectors/microsoftsql/package.json +1 -1
- package/connectors/microsoftteams/package.json +1 -1
- package/connectors/microsoftteamsadmin/package.json +1 -1
- package/connectors/microsofttodo/package.json +1 -1
- package/connectors/midjourney/package.json +1 -1
- package/connectors/miestro/package.json +1 -1
- package/connectors/mindee/package.json +1 -1
- package/connectors/minimax/package.json +1 -1
- package/connectors/miro/package.json +1 -1
- package/connectors/misp/package.json +1 -1
- package/connectors/missive/package.json +1 -1
- package/connectors/mist/package.json +1 -1
- package/connectors/mistral/package.json +1 -1
- package/connectors/mixpanel/package.json +1 -1
- package/connectors/mocean/package.json +1 -1
- package/connectors/modal/package.json +1 -1
- package/connectors/monday/package.json +1 -1
- package/connectors/mongodb/package.json +1 -1
- package/connectors/monicacrm/package.json +1 -1
- package/connectors/moonclerk/package.json +1 -1
- package/connectors/moonmail/package.json +1 -1
- package/connectors/morph/package.json +1 -1
- package/connectors/mqtt/package.json +1 -1
- package/connectors/msg91/package.json +1 -1
- package/connectors/mubert/package.json +1 -1
- package/connectors/murf/package.json +1 -1
- package/connectors/mux/package.json +1 -1
- package/connectors/mxtoolbox/package.json +1 -1
- package/connectors/myaskai/package.json +1 -1
- package/connectors/myphoner/package.json +1 -1
- package/connectors/mysql/package.json +1 -1
- package/connectors/namecheap/package.json +1 -1
- package/connectors/nanonetsocr/package.json +1 -1
- package/connectors/nasa/package.json +1 -1
- package/connectors/ncscale/package.json +1 -1
- package/connectors/netlify/package.json +1 -1
- package/connectors/nextcloud/package.json +1 -1
- package/connectors/nightfallai/package.json +1 -1
- package/connectors/ninox/package.json +1 -1
- package/connectors/nmkr/package.json +1 -1
- package/connectors/nocodb/package.json +1 -1
- package/connectors/notion/package.json +1 -1
- package/connectors/npm/package.json +1 -1
- package/connectors/nuclia/package.json +1 -1
- package/connectors/nusiiproposals/package.json +1 -1
- package/connectors/nyckel/package.json +1 -1
- package/connectors/nyota/package.json +1 -1
- package/connectors/occasion/package.json +1 -1
- package/connectors/ocrspace/package.json +1 -1
- package/connectors/octoai/package.json +1 -1
- package/connectors/odoo/package.json +1 -1
- package/connectors/offalerts/package.json +1 -1
- package/connectors/okta/package.json +1 -1
- package/connectors/ollama/package.json +1 -1
- package/connectors/omeda/package.json +1 -1
- package/connectors/omniconvert/package.json +1 -1
- package/connectors/omnimind/package.json +1 -1
- package/connectors/on2air/package.json +1 -1
- package/connectors/oneai/package.json +1 -1
- package/connectors/onesimpleapi/package.json +1 -1
- package/connectors/onfleet/package.json +1 -1
- package/connectors/openai/AGENTS.md +0 -1
- package/connectors/openai/README.md +3 -3
- package/connectors/openai/package.json +3 -2
- package/connectors/opencti/package.json +1 -1
- package/connectors/openthesaurus/package.json +1 -1
- package/connectors/openweathermap/package.json +1 -1
- package/connectors/opnformerlyomise/package.json +1 -1
- package/connectors/oracledatabase/package.json +1 -1
- package/connectors/orbit/package.json +1 -1
- package/connectors/orderdesk/package.json +1 -1
- package/connectors/ortto/package.json +1 -1
- package/connectors/oura/package.json +1 -1
- package/connectors/paddle/package.json +1 -1
- package/connectors/pagerduty/package.json +1 -1
- package/connectors/pandadoc/package.json +1 -1
- package/connectors/paperform/package.json +1 -1
- package/connectors/papyrs/package.json +1 -1
- package/connectors/parsehub/package.json +1 -1
- package/connectors/parseprompt/package.json +1 -1
- package/connectors/passcreator/package.json +1 -1
- package/connectors/passslot/package.json +1 -1
- package/connectors/patentsview/package.json +1 -1
- package/connectors/patreon/package.json +1 -1
- package/connectors/paymo/package.json +1 -1
- package/connectors/paypal/package.json +1 -1
- package/connectors/peekalink/package.json +1 -1
- package/connectors/perplexity/package.json +1 -1
- package/connectors/persio/package.json +1 -1
- package/connectors/personalai/package.json +1 -1
- package/connectors/phantombuster/package.json +1 -1
- package/connectors/philipshue/package.json +1 -1
- package/connectors/phrase/package.json +1 -1
- package/connectors/pika/package.json +1 -1
- package/connectors/pinata/package.json +1 -1
- package/connectors/pinboard/package.json +1 -1
- package/connectors/pinterest/package.json +1 -1
- package/connectors/pipedrive/package.json +1 -1
- package/connectors/pipefy/package.json +1 -1
- package/connectors/pirateweather/package.json +1 -1
- package/connectors/pitchly/package.json +1 -1
- package/connectors/pivotaltracker/package.json +1 -1
- package/connectors/plaid/package.json +1 -1
- package/connectors/planviewleankit/package.json +1 -1
- package/connectors/planyoonlinebooking/package.json +1 -1
- package/connectors/platformly/package.json +1 -1
- package/connectors/playht/package.json +1 -1
- package/connectors/plecto/package.json +1 -1
- package/connectors/plivo/package.json +1 -1
- package/connectors/postgres/package.json +1 -1
- package/connectors/posthog/package.json +1 -1
- package/connectors/practitest/package.json +1 -1
- package/connectors/predisai/package.json +1 -1
- package/connectors/prodia/package.json +1 -1
- package/connectors/producthunt/package.json +1 -1
- package/connectors/profitwell/package.json +1 -1
- package/connectors/projectbubbleproprofsproject/package.json +1 -1
- package/connectors/prompthub/package.json +1 -1
- package/connectors/prospeai/package.json +1 -1
- package/connectors/pulsetic/package.json +1 -1
- package/connectors/pushbullet/package.json +1 -1
- package/connectors/pushcut/package.json +1 -1
- package/connectors/pusher/package.json +1 -1
- package/connectors/pushover/package.json +1 -1
- package/connectors/qradar/package.json +1 -1
- package/connectors/qualaroo/package.json +1 -1
- package/connectors/qualys/package.json +1 -1
- package/connectors/quentn/package.json +1 -1
- package/connectors/questdb/package.json +1 -1
- package/connectors/quickbase/package.json +1 -1
- package/connectors/quickbooksonline/package.json +1 -1
- package/connectors/quickchart/package.json +1 -1
- package/connectors/quintadb/package.json +1 -1
- package/connectors/quo/package.json +1 -1
- package/connectors/rabbitmq/package.json +1 -1
- package/connectors/radar/package.json +1 -1
- package/connectors/raindrop/package.json +1 -1
- package/connectors/rapid7insightvm/package.json +1 -1
- package/connectors/raventools/package.json +1 -1
- package/connectors/rawgvideogamesdatabase/package.json +1 -1
- package/connectors/rdstationcrm/package.json +1 -1
- package/connectors/readai/package.json +1 -1
- package/connectors/realphonevalidation/package.json +1 -1
- package/connectors/recharge/package.json +1 -1
- package/connectors/recordedfuture/package.json +1 -1
- package/connectors/redash/package.json +1 -1
- package/connectors/reddit/package.json +1 -1
- package/connectors/redis/package.json +1 -1
- package/connectors/reducto/package.json +1 -1
- package/connectors/relevanceai/package.json +1 -1
- package/connectors/relinkurlshortener/package.json +1 -1
- package/connectors/relysia/package.json +1 -1
- package/connectors/replicate/package.json +1 -1
- package/connectors/reply/package.json +1 -1
- package/connectors/replyio/package.json +1 -1
- package/connectors/resemble/package.json +1 -1
- package/connectors/resend/package.json +1 -1
- package/connectors/retable/package.json +1 -1
- package/connectors/reversecontact/package.json +1 -1
- package/connectors/revolut/package.json +1 -1
- package/connectors/rewardful/package.json +1 -1
- package/connectors/ritekit/package.json +1 -1
- package/connectors/roboflow/package.json +1 -1
- package/connectors/robolytix/package.json +1 -1
- package/connectors/roboresponseai/package.json +1 -1
- package/connectors/rocketchat/package.json +1 -1
- package/connectors/rollbar/package.json +1 -1
- package/connectors/rootly/package.json +1 -1
- package/connectors/route4me/package.json +1 -1
- package/connectors/rundeck/package.json +1 -1
- package/connectors/runpod/package.json +1 -1
- package/connectors/runway/package.json +1 -1
- package/connectors/s3/package.json +1 -1
- package/connectors/salesforce/package.json +1 -1
- package/connectors/salesmaa/package.json +1 -1
- package/connectors/salesmate/package.json +1 -1
- package/connectors/salesmsg/package.json +1 -1
- package/connectors/salesrocks/package.json +1 -1
- package/connectors/salessimplify/package.json +1 -1
- package/connectors/samsungsmartthings/package.json +1 -1
- package/connectors/scrapeitcloud/package.json +1 -1
- package/connectors/scrapeninja/package.json +1 -1
- package/connectors/screenshotone/package.json +1 -1
- package/connectors/seamlessai/package.json +1 -1
- package/connectors/searchandsave/package.json +1 -1
- package/connectors/searxng/package.json +1 -1
- package/connectors/seatable/package.json +1 -1
- package/connectors/securityscorecard/package.json +1 -1
- package/connectors/sedo/package.json +1 -1
- package/connectors/segment/package.json +1 -1
- package/connectors/sekoia/package.json +1 -1
- package/connectors/sellix/package.json +1 -1
- package/connectors/semblyai/package.json +1 -1
- package/connectors/sendgrid/package.json +1 -1
- package/connectors/sendy/package.json +1 -1
- package/connectors/sentry/package.json +1 -1
- package/connectors/servicenow/package.json +1 -1
- package/connectors/shadcn/package.json +1 -1
- package/connectors/sharlyai/package.json +1 -1
- package/connectors/shiphero/package.json +1 -1
- package/connectors/shipstation/package.json +1 -1
- package/connectors/shopify/package.json +1 -1
- package/connectors/shortio/package.json +1 -1
- package/connectors/shuffler/package.json +1 -1
- package/connectors/sierrainteractive/package.json +1 -1
- package/connectors/sifter/package.json +1 -1
- package/connectors/signaturit/package.json +1 -1
- package/connectors/signl4/package.json +1 -1
- package/connectors/simpleem/package.json +1 -1
- package/connectors/simplehash/package.json +1 -1
- package/connectors/simplekpi/package.json +1 -1
- package/connectors/simplelocalize/package.json +1 -1
- package/connectors/simplero/package.json +1 -1
- package/connectors/simpletexting/package.json +1 -1
- package/connectors/sitecreatorio/package.json +1 -1
- package/connectors/sitespeakai/package.json +1 -1
- package/connectors/slack/package.json +1 -1
- package/connectors/smaily/package.json +1 -1
- package/connectors/smartreach/package.json +1 -1
- package/connectors/smartrecruiters/package.json +1 -1
- package/connectors/smartsheet/package.json +1 -1
- package/connectors/smartsuite/package.json +1 -1
- package/connectors/smile-io/package.json +1 -1
- package/connectors/smol-machines/package.json +1 -1
- package/connectors/sms77/package.json +1 -1
- package/connectors/smsit/package.json +1 -1
- package/connectors/smsmagic/package.json +1 -1
- package/connectors/smtp2go/package.json +1 -1
- package/connectors/snap/package.json +1 -1
- package/connectors/snapdocs/package.json +1 -1
- package/connectors/snatchbot/package.json +1 -1
- package/connectors/snipcart/package.json +1 -1
- package/connectors/snov-io/package.json +1 -1
- package/connectors/snowflake/package.json +1 -1
- package/connectors/solcast/package.json +1 -1
- package/connectors/solvedata/package.json +1 -1
- package/connectors/sonarqube/package.json +1 -1
- package/connectors/sparkpost/package.json +1 -1
- package/connectors/speakeasy-api/package.json +1 -1
- package/connectors/specific/package.json +1 -1
- package/connectors/specter/package.json +1 -1
- package/connectors/speechify/package.json +1 -1
- package/connectors/spike/package.json +1 -1
- package/connectors/split-in-batches/package.json +1 -1
- package/connectors/split-io/package.json +1 -1
- package/connectors/splunk/package.json +1 -1
- package/connectors/splunk-cloud/package.json +1 -1
- package/connectors/spondyr/package.json +1 -1
- package/connectors/sponge/package.json +1 -1
- package/connectors/spontit/package.json +1 -1
- package/connectors/sportsdata/package.json +1 -1
- package/connectors/spotify/package.json +1 -1
- package/connectors/spotify-ads/package.json +1 -1
- package/connectors/spotpay/package.json +1 -1
- package/connectors/spreadsheet-file/package.json +1 -1
- package/connectors/sprig/package.json +1 -1
- package/connectors/sprinklr/package.json +1 -1
- package/connectors/sprout-social/package.json +1 -1
- package/connectors/spydra/package.json +1 -1
- package/connectors/square/package.json +1 -1
- package/connectors/squarespace/package.json +1 -1
- package/connectors/squid/package.json +1 -1
- package/connectors/sse-trigger/package.json +1 -1
- package/connectors/ssh/package.json +1 -1
- package/connectors/sslmatecertspotterapi/package.json +1 -1
- package/connectors/stability-api-platform/package.json +1 -1
- package/connectors/stabilityai/package.json +1 -1
- package/connectors/stablebrowse/package.json +1 -1
- package/connectors/stackadapt/package.json +1 -1
- package/connectors/stackby/package.json +1 -1
- package/connectors/stackexchange/package.json +1 -1
- package/connectors/stage/package.json +1 -1
- package/connectors/stagehand/package.json +1 -1
- package/connectors/stainlessapi/package.json +1 -1
- package/connectors/stammerai/package.json +1 -1
- package/connectors/stampedio/package.json +1 -1
- package/connectors/standard-signal/package.json +1 -1
- package/connectors/standout/package.json +1 -1
- package/connectors/starton/package.json +1 -1
- package/connectors/statsig/package.json +1 -1
- package/connectors/statuscake/package.json +1 -1
- package/connectors/statuspage/package.json +1 -1
- package/connectors/steel-dev/package.json +1 -1
- package/connectors/sticky-note/package.json +1 -1
- package/connectors/stilta/package.json +1 -1
- package/connectors/stitch-data/package.json +1 -1
- package/connectors/stop-and-error/package.json +1 -1
- package/connectors/stoplight/package.json +1 -1
- package/connectors/stoplight-api-platform/package.json +1 -1
- package/connectors/storyblok/package.json +1 -1
- package/connectors/strand-ai/package.json +1 -1
- package/connectors/strapi/package.json +1 -1
- package/connectors/strava/package.json +1 -1
- package/connectors/streak/package.json +1 -1
- package/connectors/streamable/package.json +1 -1
- package/connectors/stripe/package.json +1 -1
- package/connectors/stripe-billing-advanced/package.json +1 -1
- package/connectors/stripe-connect-platform/package.json +1 -1
- package/connectors/stripe-financial-connections/package.json +1 -1
- package/connectors/stripe-issuing/package.json +1 -1
- package/connectors/stripe-reporting-advanced/package.json +1 -1
- package/connectors/stripe-sigma/package.json +1 -1
- package/connectors/stripe-tax-advanced/package.json +1 -1
- package/connectors/stripe-terminal/package.json +1 -1
- package/connectors/stripe-webhooks-advanced/package.json +1 -1
- package/connectors/stripeapps/package.json +1 -1
- package/connectors/stripeatlas/package.json +1 -1
- package/connectors/stripecapital/package.json +1 -1
- package/connectors/stripeclimate/package.json +1 -1
- package/connectors/stripeidentity/package.json +1 -1
- package/connectors/stripetreasury/package.json +1 -1
- package/connectors/studiobyai21labs/package.json +1 -1
- package/connectors/stytch/package.json +1 -1
- package/connectors/substack/package.json +1 -1
- package/connectors/sucuri/package.json +1 -1
- package/connectors/sucuri-api-platform/package.json +1 -1
- package/connectors/sugarcrm/package.json +1 -1
- package/connectors/suitedash/package.json +1 -1
- package/connectors/sumo-logic/package.json +1 -1
- package/connectors/suno/package.json +1 -1
- package/connectors/supabase/package.json +1 -1
- package/connectors/supabase-api-platform/package.json +1 -1
- package/connectors/supadata/package.json +1 -1
- package/connectors/supernormal/package.json +1 -1
- package/connectors/superpowered/package.json +1 -1
- package/connectors/superset/package.json +1 -1
- package/connectors/supportbee/package.json +1 -1
- package/connectors/supportivekoala/package.json +1 -1
- package/connectors/surtrdefensesystems/package.json +1 -1
- package/connectors/surveysparrow/package.json +1 -1
- package/connectors/survicate/package.json +1 -1
- package/connectors/swagup/package.json +1 -1
- package/connectors/switchboard/package.json +1 -1
- package/connectors/syncly/package.json +1 -1
- package/connectors/syncromsp/package.json +1 -1
- package/connectors/synphony/package.json +1 -1
- package/connectors/synthesia/package.json +1 -1
- package/connectors/syntheticsciences/package.json +1 -1
- package/connectors/syntropy/package.json +1 -1
- package/connectors/sysdig/package.json +1 -1
- package/connectors/tableau/package.json +1 -1
- package/connectors/taboola/package.json +1 -1
- package/connectors/taiga/package.json +1 -1
- package/connectors/takecareos/package.json +1 -1
- package/connectors/talend-api-platform/package.json +1 -1
- package/connectors/talentlms/package.json +1 -1
- package/connectors/talkdesk/package.json +1 -1
- package/connectors/talknotes/package.json +1 -1
- package/connectors/tapfiliate/package.json +1 -1
- package/connectors/tave/package.json +1 -1
- package/connectors/tdameritrade/package.json +1 -1
- package/connectors/teachable/package.json +1 -1
- package/connectors/teamdeck/package.json +1 -1
- package/connectors/teamgate/package.json +1 -1
- package/connectors/teamtailor/package.json +1 -1
- package/connectors/teamup/package.json +1 -1
- package/connectors/teamwork/package.json +1 -1
- package/connectors/teknoir/package.json +1 -1
- package/connectors/telegram/package.json +1 -1
- package/connectors/teleport/package.json +1 -1
- package/connectors/telnyx/package.json +1 -1
- package/connectors/telnyx/src/utils/config.ts +1 -1
- package/connectors/tenable/package.json +1 -1
- package/connectors/tenor/package.json +1 -1
- package/connectors/tensorboard/package.json +1 -1
- package/connectors/tepali/package.json +1 -1
- package/connectors/terminal-use/package.json +1 -1
- package/connectors/terminus/package.json +1 -1
- package/connectors/terraform-cloud/package.json +1 -1
- package/connectors/testerarmy/package.json +1 -1
- package/connectors/testim/package.json +1 -1
- package/connectors/testmo/package.json +1 -1
- package/connectors/testmonitor/package.json +1 -1
- package/connectors/testrail/package.json +1 -1
- package/connectors/testrigor/package.json +1 -1
- package/connectors/tettra/package.json +1 -1
- package/connectors/tettra-api-platform/package.json +1 -1
- package/connectors/textcortex/package.json +1 -1
- package/connectors/textcortexai/package.json +1 -1
- package/connectors/textgain/package.json +1 -1
- package/connectors/textit/package.json +1 -1
- package/connectors/textkit/package.json +1 -1
- package/connectors/textmagic/package.json +1 -1
- package/connectors/textrazor/package.json +1 -1
- package/connectors/textsidekick/package.json +1 -1
- package/connectors/thankster/package.json +1 -1
- package/connectors/the-company-company/package.json +1 -1
- package/connectors/the-hive-project/package.json +1 -1
- package/connectors/the-token-company/package.json +1 -1
- package/connectors/the-trade-desk/package.json +1 -1
- package/connectors/thecustomerfactor/package.json +1 -1
- package/connectors/thehive/package.json +1 -1
- package/connectors/thehive5/package.json +1 -1
- package/connectors/theleap/package.json +1 -1
- package/connectors/thoughtfulgpt/package.json +1 -1
- package/connectors/thoughtspot/package.json +1 -1
- package/connectors/thousandeyes/package.json +1 -1
- package/connectors/thrivecart/package.json +1 -1
- package/connectors/ticket-tailor/package.json +1 -1
- package/connectors/ticketbud/package.json +1 -1
- package/connectors/ticketmaster/package.json +1 -1
- package/connectors/ticketsource/package.json +1 -1
- package/connectors/ticktick/package.json +1 -1
- package/connectors/tidbcloud/package.json +1 -1
- package/connectors/tidio/package.json +1 -1
- package/connectors/tierion/package.json +1 -1
- package/connectors/tiktok/package.json +1 -1
- package/connectors/tiktok-events-api/package.json +1 -1
- package/connectors/tiktokads/package.json +1 -1
- package/connectors/tilda/package.json +1 -1
- package/connectors/time-saved/package.json +1 -1
- package/connectors/timelinesai/package.json +1 -1
- package/connectors/timescaledb/package.json +1 -1
- package/connectors/timetonic/package.json +1 -1
- package/connectors/tines/package.json +1 -1
- package/connectors/tinker/package.json +1 -1
- package/connectors/tinybird/package.json +1 -1
- package/connectors/tinypng/package.json +1 -1
- package/connectors/tinyurl/package.json +1 -1
- package/connectors/tipalti/package.json +1 -1
- package/connectors/tisane/package.json +1 -1
- package/connectors/tisanelabs/package.json +1 -1
- package/connectors/tito/package.json +1 -1
- package/connectors/toast-pos/package.json +1 -1
- package/connectors/todoist/package.json +1 -1
- package/connectors/together/package.json +1 -1
- package/connectors/together-api-platform/package.json +1 -1
- package/connectors/toggl/package.json +1 -1
- package/connectors/toggl-track/package.json +1 -1
- package/connectors/tokenmetrics/package.json +1 -1
- package/connectors/toket/package.json +1 -1
- package/connectors/tomtom/package.json +1 -1
- package/connectors/topaz-labs/package.json +1 -1
- package/connectors/totalis/package.json +1 -1
- package/connectors/totango/package.json +1 -1
- package/connectors/totp/package.json +1 -1
- package/connectors/trackjs/package.json +1 -1
- package/connectors/trackvia/package.json +1 -1
- package/connectors/transform/package.json +1 -1
- package/connectors/transifex/package.json +1 -1
- package/connectors/transload/package.json +1 -1
- package/connectors/traverse/package.json +1 -1
- package/connectors/travisci/package.json +1 -1
- package/connectors/travo/package.json +1 -1
- package/connectors/travo-ai/package.json +1 -1
- package/connectors/travo-real-estate/package.json +1 -1
- package/connectors/tray-api-platform/package.json +1 -1
- package/connectors/trellistech/package.json +1 -1
- package/connectors/trellixepo/package.json +1 -1
- package/connectors/trello/package.json +1 -1
- package/connectors/trengo/package.json +1 -1
- package/connectors/trevorio/package.json +1 -1
- package/connectors/tricentis/package.json +1 -1
- package/connectors/trigger-dev/package.json +1 -1
- package/connectors/trigger-dev-api-platform/package.json +1 -1
- package/connectors/triggercmd/package.json +1 -1
- package/connectors/triple-whale/package.json +1 -1
- package/connectors/truelayer/package.json +1 -1
- package/connectors/trustpilot/package.json +1 -1
- package/connectors/trustpilot-business/package.json +1 -1
- package/connectors/trybloom/package.json +1 -1
- package/connectors/trycardinal-ai/package.json +1 -1
- package/connectors/tryprism/package.json +1 -1
- package/connectors/tumblr/package.json +1 -1
- package/connectors/turbohire/package.json +1 -1
- package/connectors/turbot-pipes/package.json +1 -1
- package/connectors/turso/package.json +1 -1
- package/connectors/turso-api-platform/package.json +1 -1
- package/connectors/tuskr/package.json +1 -1
- package/connectors/tuulio/package.json +1 -1
- package/connectors/twake/package.json +1 -1
- package/connectors/twelve-data/package.json +1 -1
- package/connectors/twilio/package.json +1 -1
- package/connectors/twilio/src/utils/config.ts +1 -1
- package/connectors/twilio-api-platform/package.json +1 -1
- package/connectors/twist/package.json +1 -1
- package/connectors/twitch/package.json +1 -1
- package/connectors/tyk/package.json +1 -1
- package/connectors/tyk-api-platform/package.json +1 -1
- package/connectors/typeform/package.json +1 -1
- package/connectors/typesense/package.json +1 -1
- package/connectors/typless/package.json +1 -1
- package/connectors/udio/package.json +1 -1
- package/connectors/ultimate-ai/package.json +1 -1
- package/connectors/umami/package.json +1 -1
- package/connectors/unbounce/package.json +1 -1
- package/connectors/unifold/package.json +1 -1
- package/connectors/unione/package.json +1 -1
- package/connectors/uniprot/package.json +1 -1
- package/connectors/unisender/package.json +1 -1
- package/connectors/unisson/package.json +1 -1
- package/connectors/uniswap-api/package.json +1 -1
- package/connectors/unit/package.json +1 -1
- package/connectors/unleash/package.json +1 -1
- package/connectors/unleashedsoftware/package.json +1 -1
- package/connectors/unpaywall/package.json +1 -1
- package/connectors/upcloud/package.json +1 -1
- package/connectors/updown-io/package.json +1 -1
- package/connectors/upkeep/package.json +1 -1
- package/connectors/uplead/package.json +1 -1
- package/connectors/uploadcare/package.json +1 -1
- package/connectors/uproc/package.json +1 -1
- package/connectors/ups/package.json +1 -1
- package/connectors/upstash/package.json +1 -1
- package/connectors/upstash-api-platform/package.json +1 -1
- package/connectors/uptimerobot/package.json +1 -1
- package/connectors/uptimetoolbox/package.json +1 -1
- package/connectors/urlscanio/package.json +1 -1
- package/connectors/usebidflow/package.json +1 -1
- package/connectors/usecrow/package.json +1 -1
- package/connectors/usereframe/package.json +1 -1
- package/connectors/userflow/package.json +1 -1
- package/connectors/userlens/package.json +1 -1
- package/connectors/userlist/package.json +1 -1
- package/connectors/userpilot/package.json +1 -1
- package/connectors/uservoice/package.json +1 -1
- package/connectors/usps/package.json +1 -1
- package/connectors/uspto/package.json +1 -1
- package/connectors/v0/package.json +1 -1
- package/connectors/valence/package.json +1 -1
- package/connectors/valgo/package.json +1 -1
- package/connectors/vanta/package.json +1 -1
- package/connectors/vapi/package.json +1 -1
- package/connectors/vault/package.json +1 -1
- package/connectors/vector-legal/package.json +1 -1
- package/connectors/vector-legal-api/package.json +1 -1
- package/connectors/vectorshift/package.json +1 -1
- package/connectors/vela/package.json +1 -1
- package/connectors/velum-data-quality/package.json +1 -1
- package/connectors/velum-labs/package.json +1 -1
- package/connectors/venafi/package.json +1 -1
- package/connectors/veo/package.json +1 -1
- package/connectors/veracode/package.json +1 -1
- package/connectors/vercel/package.json +1 -1
- package/connectors/vercel-ai-gateway/package.json +1 -1
- package/connectors/vercel-api-platform/package.json +1 -1
- package/connectors/vercel-blob/package.json +1 -1
- package/connectors/vercel-blob-platform/package.json +1 -1
- package/connectors/vercel-edge-config/package.json +1 -1
- package/connectors/vercel-edge-config-platform/package.json +1 -1
- package/connectors/verdex/package.json +1 -1
- package/connectors/verifalia/package.json +1 -1
- package/connectors/veriphone/package.json +1 -1
- package/connectors/vero/package.json +1 -1
- package/connectors/vertex-ai/package.json +1 -1
- package/connectors/vidyard/package.json +1 -1
- package/connectors/vimeo/package.json +1 -1
- package/connectors/virustotal/package.json +1 -1
- package/connectors/visibl-semiconductors/package.json +1 -1
- package/connectors/vitally/package.json +1 -1
- package/connectors/vivenu/package.json +1 -1
- package/connectors/vivifyscrum/package.json +1 -1
- package/connectors/voiceflow/package.json +1 -1
- package/connectors/voicit/package.json +1 -1
- package/connectors/voltair/package.json +1 -1
- package/connectors/vonage/package.json +1 -1
- package/connectors/voquill/package.json +1 -1
- package/connectors/vowel/package.json +1 -1
- package/connectors/voygr/package.json +1 -1
- package/connectors/vultr/package.json +1 -1
- package/connectors/vwo/package.json +1 -1
- package/connectors/waboxapp/package.json +1 -1
- package/connectors/wait/package.json +1 -1
- package/connectors/wakatime/package.json +1 -1
- package/connectors/walmart-marketplace/package.json +1 -1
- package/connectors/wandb/package.json +1 -1
- package/connectors/wappalyzer/package.json +1 -1
- package/connectors/watchsignals/package.json +1 -1
- package/connectors/wati/package.json +1 -1
- package/connectors/wato/package.json +1 -1
- package/connectors/wave-accounting/package.json +1 -1
- package/connectors/wavelineextract/package.json +1 -1
- package/connectors/wayco/package.json +1 -1
- package/connectors/weaviate/package.json +1 -1
- package/connectors/weaviate-api-platform/package.json +1 -1
- package/connectors/webengage/package.json +1 -1
- package/connectors/webex/package.json +1 -1
- package/connectors/webexbycisco/package.json +1 -1
- package/connectors/webflow/package.json +1 -1
- package/connectors/webhook/package.json +1 -1
- package/connectors/webhooks/package.json +1 -1
- package/connectors/webinarjam/package.json +1 -1
- package/connectors/webpagetest/package.json +1 -1
- package/connectors/webscraperio/package.json +1 -1
- package/connectors/weezevent/package.json +1 -1
- package/connectors/weights-biases/package.json +1 -1
- package/connectors/wekan/package.json +1 -1
- package/connectors/whal3s/package.json +1 -1
- package/connectors/whatconverts/package.json +1 -1
- package/connectors/whatsapp/package.json +1 -1
- package/connectors/whatsapp-cloud-api/package.json +1 -1
- package/connectors/wideframe/package.json +1 -1
- package/connectors/wikipedia/package.json +1 -1
- package/connectors/wildcard/package.json +1 -1
- package/connectors/windmill/package.json +1 -1
- package/connectors/windmill-api-platform/package.json +1 -1
- package/connectors/wipo/package.json +1 -1
- package/connectors/wise/package.json +1 -1
- package/connectors/wistia/package.json +1 -1
- package/connectors/withai/package.json +1 -1
- package/connectors/wix/package.json +1 -1
- package/connectors/wiz/package.json +1 -1
- package/connectors/wizychat/package.json +1 -1
- package/connectors/wolframoralpha/package.json +1 -1
- package/connectors/wonderchat/package.json +1 -1
- package/connectors/wondercraft/package.json +1 -1
- package/connectors/woocommerce/package.json +1 -1
- package/connectors/woodpecker/package.json +1 -1
- package/connectors/woodpeckerco/package.json +1 -1
- package/connectors/wordfence/package.json +1 -1
- package/connectors/wordfence-api-platform/package.json +1 -1
- package/connectors/wordpress/package.json +1 -1
- package/connectors/workable/package.json +1 -1
- package/connectors/workast/package.json +1 -1
- package/connectors/workato/package.json +1 -1
- package/connectors/workato-api-platform/package.json +1 -1
- package/connectors/workboard/package.json +1 -1
- package/connectors/workflow-trigger/package.json +1 -1
- package/connectors/workos/package.json +1 -1
- package/connectors/woxo/package.json +1 -1
- package/connectors/wrike/package.json +1 -1
- package/connectors/write-binary-file/package.json +1 -1
- package/connectors/writesonic/package.json +1 -1
- package/connectors/wubookratechecker/package.json +1 -1
- package/connectors/wufoo/package.json +1 -1
- package/connectors/x/package.json +1 -1
- package/connectors/xads/package.json +1 -1
- package/connectors/xai/package.json +1 -1
- package/connectors/xai-api-platform/package.json +1 -1
- package/connectors/xai-grok/package.json +1 -1
- package/connectors/xata/package.json +1 -1
- package/connectors/xero/package.json +1 -1
- package/connectors/xml/package.json +1 -1
- package/connectors/xray/package.json +1 -1
- package/connectors/xtractly/package.json +1 -1
- package/connectors/ybug/package.json +1 -1
- package/connectors/ycode/package.json +1 -1
- package/connectors/yesware/package.json +1 -1
- package/connectors/ynab/package.json +1 -1
- package/connectors/yodiz/package.json +1 -1
- package/connectors/yotpo/package.json +1 -1
- package/connectors/you-com/package.json +1 -1
- package/connectors/youart/package.json +1 -1
- package/connectors/yourls/package.json +1 -1
- package/connectors/yousearch/package.json +1 -1
- package/connectors/yousign/package.json +1 -1
- package/connectors/youtube/package.json +2 -1
- package/connectors/youtube/src/cli/index.test.ts +65 -0
- package/connectors/youtube/src/cli/index.ts +6 -3
- package/connectors/zabbix/package.json +1 -1
- package/connectors/zammad/package.json +1 -1
- package/connectors/zapier-api-platform/package.json +1 -1
- package/connectors/zatanna/package.json +1 -1
- package/connectors/zendesk/package.json +1 -1
- package/connectors/zendesk/server/index.js +1 -1
- package/connectors/zendesk/src/server/index.ts +1 -1
- package/connectors/zenodo/package.json +1 -1
- package/connectors/zenrows/package.json +1 -1
- package/connectors/zenserp/package.json +1 -1
- package/connectors/zerobounce/package.json +1 -1
- package/connectors/zerosettle/package.json +1 -1
- package/connectors/zerotier/package.json +1 -1
- package/connectors/zhipu-ai/package.json +1 -1
- package/connectors/zibra-labs/package.json +1 -1
- package/connectors/zipkin/package.json +1 -1
- package/connectors/zoho/package.json +1 -1
- package/connectors/zoho-analytics/package.json +1 -1
- package/connectors/zoho-bigin/package.json +1 -1
- package/connectors/zoho-campaigns/package.json +1 -1
- package/connectors/zoho-cliq/package.json +1 -1
- package/connectors/zoho-creator/package.json +1 -1
- package/connectors/zoho-inventory/package.json +1 -1
- package/connectors/zoho-meeting/package.json +1 -1
- package/connectors/zoho-people/package.json +1 -1
- package/connectors/zoho-sign/package.json +1 -1
- package/connectors/zoho-subscriptions/package.json +1 -1
- package/connectors/zoho-survey/package.json +1 -1
- package/connectors/zohobookings/package.json +1 -1
- package/connectors/zohobooks/package.json +1 -1
- package/connectors/zohocrm/package.json +1 -1
- package/connectors/zohodesk/package.json +1 -1
- package/connectors/zohoforms/package.json +1 -1
- package/connectors/zohoprojects/package.json +1 -1
- package/connectors/zohorecruit/package.json +1 -1
- package/connectors/zohovault/package.json +1 -1
- package/connectors/zohoworkdrive/package.json +1 -1
- package/connectors/zolvo/package.json +1 -1
- package/connectors/zonkafeedback/package.json +1 -1
- package/connectors/zoom/package.json +1 -1
- package/connectors/zoom-api/package.json +1 -1
- package/connectors/zoominfo/package.json +1 -1
- package/connectors/zotero/package.json +1 -1
- package/connectors/zscalerzia/package.json +1 -1
- package/connectors/zulip/package.json +1 -1
- package/connectors/zymbly/package.json +1 -1
- package/dist/db/database.d.ts +5 -2
- package/dist/index.js +242 -142
- package/dist/lib/paths.d.ts +37 -0
- package/dist/lib/strip.d.ts +1 -0
- package/dist/sdk/bundle-boundary.test.d.ts +1 -0
- package/dist/sdk/fixtures/platform-connectors.d.ts +20 -0
- package/dist/sdk/index.d.ts +696 -0
- package/dist/sdk/index.js +508 -0
- package/dist/sdk/index.test.d.ts +1 -0
- package/dist/sdk/platform-contract.test.d.ts +1 -0
- package/dist/server/auth.d.ts +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/serve-auth.d.ts +54 -0
- package/dist/server/serve-auth.test.d.ts +1 -0
- package/dist/server/serve.d.ts +18 -6
- package/dist/server/server-auth-gate.test.d.ts +1 -0
- package/package.json +13 -10
- package/dashboard/dist/assets/index-8uoGZF7B.js +0 -280
- package/dashboard/dist/assets/index-D7ZVhmHr.css +0 -1
- package/dashboard/dist/index.html +0 -13
- package/dashboard/dist/logo.jpg +0 -0
- package/dist/server/dashboard.d.ts +0 -5
- /package/dist/{server/dashboard.test.d.ts → lib/paths.test.d.ts} +0 -0
package/bin/serve.js
CHANGED
|
@@ -105,6 +105,107 @@ class SqliteAdapter {
|
|
|
105
105
|
}
|
|
106
106
|
var init_sqlite_adapter = () => {};
|
|
107
107
|
|
|
108
|
+
// src/lib/paths.ts
|
|
109
|
+
import { existsSync } from "fs";
|
|
110
|
+
import { homedir } from "os";
|
|
111
|
+
import { join, resolve } from "path";
|
|
112
|
+
import { homedir as pathsResolverHomedir } from "os";
|
|
113
|
+
import { join as pathsResolverJoin } from "path";
|
|
114
|
+
function pathsResolverAssertApp(app) {
|
|
115
|
+
if (typeof app !== "string" || app.length === 0) {
|
|
116
|
+
throw new TypeError("paths: app must be a non-empty string");
|
|
117
|
+
}
|
|
118
|
+
if (!PATHS_RESOLVER_APP_SLUG_RE.test(app)) {
|
|
119
|
+
throw new TypeError(`paths: invalid app slug "${app}" \u2014 expected lowercase kebab-case ([a-z0-9]+(-[a-z0-9]+)*)`);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function pathsResolverAssertKind(kind) {
|
|
123
|
+
if (!Object.keys(PATHS_RESOLVER_KIND_ENV).includes(kind)) {
|
|
124
|
+
throw new TypeError(`paths: invalid path kind "${kind}" \u2014 expected one of ${Object.keys(PATHS_RESOLVER_KIND_ENV).join(", ")}`);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function pathsResolverBaseDir(kind, options) {
|
|
128
|
+
pathsResolverAssertKind(kind);
|
|
129
|
+
const env = options.env ?? process.env;
|
|
130
|
+
const override = env[PATHS_RESOLVER_KIND_ENV[kind]];
|
|
131
|
+
if (typeof override === "string" && override.length > 0)
|
|
132
|
+
return override;
|
|
133
|
+
const home = options.home ?? pathsResolverHomedir();
|
|
134
|
+
const platform = options.platform ?? process.platform;
|
|
135
|
+
if (platform === "darwin") {
|
|
136
|
+
switch (kind) {
|
|
137
|
+
case "config":
|
|
138
|
+
case "data":
|
|
139
|
+
return pathsResolverJoin(home, "Library", "Application Support", "Hasna");
|
|
140
|
+
case "cache":
|
|
141
|
+
return pathsResolverJoin(home, "Library", "Caches", "Hasna");
|
|
142
|
+
case "state":
|
|
143
|
+
return pathsResolverJoin(home, "Library", "Logs", "Hasna");
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
switch (kind) {
|
|
147
|
+
case "config":
|
|
148
|
+
return pathsResolverJoin(home, ".config", "hasna");
|
|
149
|
+
case "data":
|
|
150
|
+
return pathsResolverJoin(home, ".local", "share", "hasna");
|
|
151
|
+
case "state":
|
|
152
|
+
return pathsResolverJoin(home, ".local", "state", "hasna");
|
|
153
|
+
case "cache":
|
|
154
|
+
return pathsResolverJoin(home, ".cache", "hasna");
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
function pathsResolverResolve(kind, options) {
|
|
158
|
+
pathsResolverAssertApp(options.app);
|
|
159
|
+
const appSegment = options.internal === true ? pathsResolverJoin("internal", options.app) : options.app;
|
|
160
|
+
return pathsResolverJoin(pathsResolverBaseDir(kind, options), appSegment);
|
|
161
|
+
}
|
|
162
|
+
function dataDir(options) {
|
|
163
|
+
return pathsResolverResolve("data", options);
|
|
164
|
+
}
|
|
165
|
+
function envOr(name, fallback) {
|
|
166
|
+
const value = process.env[name]?.trim();
|
|
167
|
+
return value ? value : fallback;
|
|
168
|
+
}
|
|
169
|
+
function effectiveHome() {
|
|
170
|
+
return process.env["HOME"] || process.env["USERPROFILE"] || homedir();
|
|
171
|
+
}
|
|
172
|
+
function legacyHomeDir() {
|
|
173
|
+
return join(effectiveHome(), ".hasna", "connectors");
|
|
174
|
+
}
|
|
175
|
+
function resolverHome() {
|
|
176
|
+
return dataDir({
|
|
177
|
+
app: "connectors",
|
|
178
|
+
home: process.env["HOME"] || process.env["USERPROFILE"] || undefined
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
function adoptResolverHome(resolved, env = process.env) {
|
|
182
|
+
const dataOverride = env.HASNA_DATA_HOME;
|
|
183
|
+
if (typeof dataOverride === "string" && dataOverride.trim().length > 0)
|
|
184
|
+
return true;
|
|
185
|
+
return existsSync(join(resolved, "connectors.db"));
|
|
186
|
+
}
|
|
187
|
+
function exactConnectorsHome() {
|
|
188
|
+
const home = envOr("HASNA_CONNECTORS_DIR", "");
|
|
189
|
+
return home ? home : undefined;
|
|
190
|
+
}
|
|
191
|
+
function connectorsHome() {
|
|
192
|
+
const exact = exactConnectorsHome();
|
|
193
|
+
if (exact)
|
|
194
|
+
return resolve(exact);
|
|
195
|
+
const resolved = resolverHome();
|
|
196
|
+
return adoptResolverHome(resolved) ? resolve(resolved) : resolve(legacyHomeDir());
|
|
197
|
+
}
|
|
198
|
+
var PATHS_RESOLVER_KIND_ENV, PATHS_RESOLVER_APP_SLUG_RE;
|
|
199
|
+
var init_paths = __esm(() => {
|
|
200
|
+
PATHS_RESOLVER_KIND_ENV = {
|
|
201
|
+
config: "HASNA_CONFIG_HOME",
|
|
202
|
+
data: "HASNA_DATA_HOME",
|
|
203
|
+
state: "HASNA_STATE_HOME",
|
|
204
|
+
cache: "HASNA_CACHE_HOME"
|
|
205
|
+
};
|
|
206
|
+
PATHS_RESOLVER_APP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
207
|
+
});
|
|
208
|
+
|
|
108
209
|
// src/db/database.ts
|
|
109
210
|
var exports_database = {};
|
|
110
211
|
__export(exports_database, {
|
|
@@ -115,33 +216,32 @@ __export(exports_database, {
|
|
|
115
216
|
closeDatabase: () => closeDatabase,
|
|
116
217
|
SqliteAdapter: () => SqliteAdapter
|
|
117
218
|
});
|
|
118
|
-
import { dirname, join } from "path";
|
|
119
|
-
import {
|
|
120
|
-
import { mkdirSync, existsSync, readdirSync, copyFileSync, statSync } from "fs";
|
|
219
|
+
import { dirname, join as join2 } from "path";
|
|
220
|
+
import { mkdirSync, existsSync as existsSync2, readdirSync, copyFileSync, statSync } from "fs";
|
|
121
221
|
function mergeDirectoryContents(sourceDir, targetDir) {
|
|
122
|
-
if (!
|
|
222
|
+
if (!existsSync2(sourceDir)) {
|
|
123
223
|
return;
|
|
124
224
|
}
|
|
125
225
|
mkdirSync(targetDir, { recursive: true });
|
|
126
226
|
for (const entry of readdirSync(sourceDir)) {
|
|
127
|
-
const sourcePath =
|
|
128
|
-
const targetPath =
|
|
227
|
+
const sourcePath = join2(sourceDir, entry);
|
|
228
|
+
const targetPath = join2(targetDir, entry);
|
|
129
229
|
try {
|
|
130
230
|
const sourceStat = statSync(sourcePath);
|
|
131
231
|
if (sourceStat.isDirectory()) {
|
|
132
232
|
mergeDirectoryContents(sourcePath, targetPath);
|
|
133
233
|
continue;
|
|
134
234
|
}
|
|
135
|
-
if (!
|
|
235
|
+
if (!existsSync2(targetPath)) {
|
|
136
236
|
copyFileSync(sourcePath, targetPath);
|
|
137
237
|
}
|
|
138
238
|
} catch {}
|
|
139
239
|
}
|
|
140
240
|
}
|
|
141
241
|
function getConnectorsHome() {
|
|
142
|
-
const
|
|
143
|
-
const
|
|
144
|
-
const legacyDirs = [
|
|
242
|
+
const newDir = connectorsHome();
|
|
243
|
+
const home = effectiveHome();
|
|
244
|
+
const legacyDirs = [join2(home, ".connectors"), join2(home, ".connect")];
|
|
145
245
|
mkdirSync(newDir, { recursive: true });
|
|
146
246
|
for (const legacyDir of legacyDirs) {
|
|
147
247
|
try {
|
|
@@ -289,8 +389,9 @@ var DB_DIR, DB_PATH, _db = null, _dbPath = null;
|
|
|
289
389
|
var init_database = __esm(() => {
|
|
290
390
|
init_sqlite_adapter();
|
|
291
391
|
init_sqlite_adapter();
|
|
392
|
+
init_paths();
|
|
292
393
|
DB_DIR = getConnectorsHome();
|
|
293
|
-
DB_PATH =
|
|
394
|
+
DB_PATH = join2(DB_DIR, "connectors.db");
|
|
294
395
|
});
|
|
295
396
|
|
|
296
397
|
// src/lib/llm.ts
|
|
@@ -304,14 +405,14 @@ __export(exports_llm, {
|
|
|
304
405
|
PROVIDER_DEFAULTS: () => PROVIDER_DEFAULTS,
|
|
305
406
|
LLMClient: () => LLMClient
|
|
306
407
|
});
|
|
307
|
-
import { existsSync as
|
|
308
|
-
import { join as
|
|
408
|
+
import { existsSync as existsSync3, readFileSync, writeFileSync, mkdirSync as mkdirSync2 } from "fs";
|
|
409
|
+
import { join as join3 } from "path";
|
|
309
410
|
function getLlmConfigPath() {
|
|
310
|
-
return
|
|
411
|
+
return join3(getConnectorsHome(), "llm.json");
|
|
311
412
|
}
|
|
312
413
|
function getLlmConfig() {
|
|
313
414
|
const path = getLlmConfigPath();
|
|
314
|
-
if (!
|
|
415
|
+
if (!existsSync3(path))
|
|
315
416
|
return null;
|
|
316
417
|
try {
|
|
317
418
|
return JSON.parse(readFileSync(path, "utf-8"));
|
|
@@ -451,7 +552,8 @@ var STRIP_PROMPT = `You are a data extraction assistant. Your job is to take raw
|
|
|
451
552
|
|
|
452
553
|
Rules:
|
|
453
554
|
- Return valid JSON only (no markdown, no explanation)
|
|
454
|
-
-
|
|
555
|
+
- Preserve pagination and continuation metadata exactly (count, total, limit, cursor, nextCursor, next_cursor, hasMore, has_more, complete)
|
|
556
|
+
- Remove rate limit headers, empty fields, and null values that are not continuation markers
|
|
455
557
|
- Keep all meaningful data fields
|
|
456
558
|
- If the input is already minimal, return it unchanged
|
|
457
559
|
- If input is not JSON, extract key facts as a JSON object
|
|
@@ -596,7 +698,7 @@ function cronMatches(cron, d) {
|
|
|
596
698
|
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);
|
|
597
699
|
}
|
|
598
700
|
async function runConnectorCommand(connector, command, args) {
|
|
599
|
-
return new Promise((
|
|
701
|
+
return new Promise((resolve2) => {
|
|
600
702
|
const cmdArgs = [connector, command, ...args, "--format", "json"];
|
|
601
703
|
const proc = spawn("connectors", ["run", ...cmdArgs], { shell: false });
|
|
602
704
|
let output = "";
|
|
@@ -606,11 +708,11 @@ async function runConnectorCommand(connector, command, args) {
|
|
|
606
708
|
proc.stderr.on("data", (d) => {
|
|
607
709
|
output += d.toString();
|
|
608
710
|
});
|
|
609
|
-
proc.on("close", (code) =>
|
|
610
|
-
proc.on("error", () =>
|
|
711
|
+
proc.on("close", (code) => resolve2({ exitCode: code ?? 1, output }));
|
|
712
|
+
proc.on("error", () => resolve2({ exitCode: 1, output: `Failed to spawn connectors run` }));
|
|
611
713
|
setTimeout(() => {
|
|
612
714
|
proc.kill();
|
|
613
|
-
|
|
715
|
+
resolve2({ exitCode: 124, output: output + `
|
|
614
716
|
[timeout]` });
|
|
615
717
|
}, 60000);
|
|
616
718
|
});
|
|
@@ -4764,28 +4866,28 @@ var init_zod = __esm(() => {
|
|
|
4764
4866
|
|
|
4765
4867
|
// src/core/connectors/github.ts
|
|
4766
4868
|
import { Buffer as Buffer2 } from "buffer";
|
|
4767
|
-
import { existsSync as
|
|
4768
|
-
import { dirname as dirname2, join as
|
|
4869
|
+
import { existsSync as existsSync4 } from "fs";
|
|
4870
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
4769
4871
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
4770
4872
|
function resolveGithubConnectorDir() {
|
|
4771
4873
|
const candidates = [
|
|
4772
|
-
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
-
|
|
4874
|
+
join4(__dirname2, "..", "..", "..", "connectors", "github"),
|
|
4875
|
+
join4(__dirname2, "..", "..", "connectors", "github"),
|
|
4876
|
+
join4(__dirname2, "..", "connectors", "github"),
|
|
4877
|
+
join4(process.cwd(), "connectors", "github")
|
|
4776
4878
|
];
|
|
4777
4879
|
for (const candidate of candidates) {
|
|
4778
|
-
if (
|
|
4880
|
+
if (existsSync4(candidate)) {
|
|
4779
4881
|
return candidate;
|
|
4780
4882
|
}
|
|
4781
4883
|
}
|
|
4782
4884
|
return candidates[0];
|
|
4783
4885
|
}
|
|
4784
4886
|
async function loadGitHubApiModule() {
|
|
4785
|
-
return await import(pathToFileURL(
|
|
4887
|
+
return await import(pathToFileURL(join4(CONNECTOR_DIR, "src", "api", "index.ts")).href);
|
|
4786
4888
|
}
|
|
4787
4889
|
async function loadGitHubConfigModule() {
|
|
4788
|
-
return await import(pathToFileURL(
|
|
4890
|
+
return await import(pathToFileURL(join4(CONNECTOR_DIR, "src", "utils", "config.ts")).href);
|
|
4789
4891
|
}
|
|
4790
4892
|
function extractGlobalArgs(args) {
|
|
4791
4893
|
const remaining = [];
|
|
@@ -5629,9 +5731,8 @@ Commands:
|
|
|
5629
5731
|
});
|
|
5630
5732
|
|
|
5631
5733
|
// src/core/connectors/gmail.ts
|
|
5632
|
-
import { existsSync as
|
|
5633
|
-
import {
|
|
5634
|
-
import { basename, join as join4 } from "path";
|
|
5734
|
+
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
5735
|
+
import { basename, join as join5 } from "path";
|
|
5635
5736
|
async function modifyMessage(profile, messageId, addLabelIds, removeLabelIds) {
|
|
5636
5737
|
return requestJson(profile, `/users/me/messages/${encodeURIComponent(messageId)}/modify`, {}, {
|
|
5637
5738
|
method: "POST",
|
|
@@ -5668,7 +5769,7 @@ async function replyToMessage(profile, messageId, input) {
|
|
|
5668
5769
|
}
|
|
5669
5770
|
async function downloadAttachments(profile, input) {
|
|
5670
5771
|
const messageId = getMessageId(input);
|
|
5671
|
-
const outputDir = input.dir ?? input.outputDir ??
|
|
5772
|
+
const outputDir = input.dir ?? input.outputDir ?? join5(configDirs()[0], "attachments", messageId);
|
|
5672
5773
|
mkdirSync3(outputDir, { recursive: true });
|
|
5673
5774
|
const attachments = input.attachmentId && input.filename ? [{
|
|
5674
5775
|
attachmentId: input.attachmentId,
|
|
@@ -5680,7 +5781,7 @@ async function downloadAttachments(profile, input) {
|
|
|
5680
5781
|
for (const attachment of attachments) {
|
|
5681
5782
|
const data = await requestJson(profile, `/users/me/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(attachment.attachmentId)}`, {});
|
|
5682
5783
|
const filename = safeFilename(attachment.filename);
|
|
5683
|
-
const path =
|
|
5784
|
+
const path = join5(outputDir, filename);
|
|
5684
5785
|
const buffer = Buffer.from(data.data, "base64url");
|
|
5685
5786
|
writeFileSync2(path, buffer);
|
|
5686
5787
|
downloaded.push({
|
|
@@ -5750,7 +5851,7 @@ function gmailBackoffDelayMs(attempt, retryAfter = null) {
|
|
|
5750
5851
|
return Math.min(2 ** attempt * baseMs + jitterMs, 64000);
|
|
5751
5852
|
}
|
|
5752
5853
|
function sleep(ms) {
|
|
5753
|
-
return new Promise((
|
|
5854
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
5754
5855
|
}
|
|
5755
5856
|
async function getValidAccessToken(profile) {
|
|
5756
5857
|
if (process.env.GMAIL_ACCESS_TOKEN)
|
|
@@ -5797,8 +5898,8 @@ async function refreshAccessToken(profile, currentTokens) {
|
|
|
5797
5898
|
function listProfiles() {
|
|
5798
5899
|
const profiles = new Set;
|
|
5799
5900
|
for (const baseDir of configDirs()) {
|
|
5800
|
-
const profilesDir =
|
|
5801
|
-
if (!
|
|
5901
|
+
const profilesDir = join5(baseDir, "profiles");
|
|
5902
|
+
if (!existsSync5(profilesDir))
|
|
5802
5903
|
continue;
|
|
5803
5904
|
for (const entry of readdirSync2(profilesDir, { withFileTypes: true })) {
|
|
5804
5905
|
if (entry.isDirectory())
|
|
@@ -5816,8 +5917,8 @@ function loadCredentials(profile) {
|
|
|
5816
5917
|
return { clientId: envClientId, clientSecret: envClientSecret };
|
|
5817
5918
|
for (const baseDir of configDirs()) {
|
|
5818
5919
|
const credentials = {
|
|
5819
|
-
...readJson(
|
|
5820
|
-
...readJson(
|
|
5920
|
+
...readJson(join5(baseDir, "credentials.json")),
|
|
5921
|
+
...readJson(join5(baseDir, "profiles", profile, "config.json"))
|
|
5821
5922
|
};
|
|
5822
5923
|
if (credentials.clientId || credentials.clientSecret)
|
|
5823
5924
|
return credentials;
|
|
@@ -5826,30 +5927,30 @@ function loadCredentials(profile) {
|
|
|
5826
5927
|
}
|
|
5827
5928
|
function loadTokens(profile) {
|
|
5828
5929
|
for (const baseDir of configDirs()) {
|
|
5829
|
-
const fromProfile = readJson(
|
|
5930
|
+
const fromProfile = readJson(join5(baseDir, "profiles", profile, "tokens.json"));
|
|
5830
5931
|
if (fromProfile)
|
|
5831
5932
|
return fromProfile;
|
|
5832
|
-
const flat = readJson(
|
|
5933
|
+
const flat = readJson(join5(baseDir, "profiles", `${profile}.json`));
|
|
5833
5934
|
if (flat)
|
|
5834
5935
|
return flat.tokens ?? (flat.accessToken || flat.refreshToken ? flat : null);
|
|
5835
5936
|
}
|
|
5836
5937
|
return null;
|
|
5837
5938
|
}
|
|
5838
5939
|
function saveTokens(profile, tokens) {
|
|
5839
|
-
const baseDir = configDirs().find((dir) =>
|
|
5840
|
-
const profileDir =
|
|
5940
|
+
const baseDir = configDirs().find((dir) => existsSync5(dir)) ?? configDirs()[0];
|
|
5941
|
+
const profileDir = join5(baseDir, "profiles", profile);
|
|
5841
5942
|
mkdirSync3(profileDir, { recursive: true });
|
|
5842
|
-
writeFileSync2(
|
|
5943
|
+
writeFileSync2(join5(profileDir, "tokens.json"), JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
5843
5944
|
}
|
|
5844
5945
|
function configDirs() {
|
|
5845
5946
|
const explicit = process.env.HASNA_GMAIL_CONNECTOR_DIR ?? process.env.GMAIL_CONNECTOR_DIR;
|
|
5846
5947
|
if (explicit)
|
|
5847
5948
|
return [explicit];
|
|
5848
|
-
const baseDir =
|
|
5849
|
-
return [
|
|
5949
|
+
const baseDir = connectorsHome();
|
|
5950
|
+
return [join5(baseDir, "gmail"), join5(baseDir, "connect-gmail")];
|
|
5850
5951
|
}
|
|
5851
5952
|
function readJson(path) {
|
|
5852
|
-
if (!
|
|
5953
|
+
if (!existsSync5(path))
|
|
5853
5954
|
return null;
|
|
5854
5955
|
try {
|
|
5855
5956
|
return JSON.parse(readFileSync2(path, "utf8"));
|
|
@@ -5930,6 +6031,7 @@ function safeFilename(filename) {
|
|
|
5930
6031
|
}
|
|
5931
6032
|
var GMAIL_API_BASE = "https://gmail.googleapis.com/gmail/v1", TOKEN_URL = "https://oauth2.googleapis.com/token", REFRESH_BUFFER_MS, MAX_GMAIL_RETRIES = 5, listMessagesSchema, messageIdSchema, readMessageSchema, attachmentListSchema, attachmentDownloadSchema, historyListSchema, replySchema, gmailConnector;
|
|
5932
6033
|
var init_gmail = __esm(() => {
|
|
6034
|
+
init_paths();
|
|
5933
6035
|
init_zod();
|
|
5934
6036
|
init_connector();
|
|
5935
6037
|
REFRESH_BUFFER_MS = 5 * 60 * 1000;
|
|
@@ -6099,9 +6201,8 @@ var init_gmail = __esm(() => {
|
|
|
6099
6201
|
});
|
|
6100
6202
|
|
|
6101
6203
|
// src/core/connectors/googledrive.ts
|
|
6102
|
-
import { existsSync as
|
|
6103
|
-
import {
|
|
6104
|
-
import { basename as basename2, join as join5 } from "path";
|
|
6204
|
+
import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync3, readdirSync as readdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
6205
|
+
import { basename as basename2, join as join6 } from "path";
|
|
6105
6206
|
async function requestJson2(profile, path, params) {
|
|
6106
6207
|
const response = await request(profile, path, params);
|
|
6107
6208
|
const text = await response.text();
|
|
@@ -6169,8 +6270,8 @@ async function refreshAccessToken2(profile, currentTokens) {
|
|
|
6169
6270
|
function listProfiles2() {
|
|
6170
6271
|
const profiles = new Set;
|
|
6171
6272
|
for (const baseDir of configDirs2()) {
|
|
6172
|
-
const profilesDir =
|
|
6173
|
-
if (!
|
|
6273
|
+
const profilesDir = join6(baseDir, "profiles");
|
|
6274
|
+
if (!existsSync6(profilesDir))
|
|
6174
6275
|
continue;
|
|
6175
6276
|
for (const entry of readdirSync3(profilesDir, { withFileTypes: true })) {
|
|
6176
6277
|
if (entry.isDirectory())
|
|
@@ -6217,8 +6318,8 @@ function loadCredentials2(profile) {
|
|
|
6217
6318
|
return { clientId: envClientId, clientSecret: envClientSecret };
|
|
6218
6319
|
for (const baseDir of configDirs2()) {
|
|
6219
6320
|
const credentials = {
|
|
6220
|
-
...readJson2(
|
|
6221
|
-
...readJson2(
|
|
6321
|
+
...readJson2(join6(baseDir, "credentials.json")),
|
|
6322
|
+
...readJson2(join6(baseDir, "profiles", profile, "config.json"))
|
|
6222
6323
|
};
|
|
6223
6324
|
if (credentials.clientId || credentials.clientSecret)
|
|
6224
6325
|
return credentials;
|
|
@@ -6227,30 +6328,30 @@ function loadCredentials2(profile) {
|
|
|
6227
6328
|
}
|
|
6228
6329
|
function loadTokens2(profile) {
|
|
6229
6330
|
for (const baseDir of configDirs2()) {
|
|
6230
|
-
const fromProfile = readJson2(
|
|
6331
|
+
const fromProfile = readJson2(join6(baseDir, "profiles", profile, "tokens.json"));
|
|
6231
6332
|
if (fromProfile)
|
|
6232
6333
|
return fromProfile;
|
|
6233
|
-
const flat = readJson2(
|
|
6334
|
+
const flat = readJson2(join6(baseDir, "profiles", `${profile}.json`));
|
|
6234
6335
|
if (flat)
|
|
6235
6336
|
return flat.tokens ?? (flat.accessToken || flat.refreshToken ? flat : null);
|
|
6236
6337
|
}
|
|
6237
6338
|
return null;
|
|
6238
6339
|
}
|
|
6239
6340
|
function saveTokens2(profile, tokens) {
|
|
6240
|
-
const baseDir = configDirs2().find((dir) =>
|
|
6241
|
-
const profileDir =
|
|
6341
|
+
const baseDir = configDirs2().find((dir) => existsSync6(dir)) ?? configDirs2()[0];
|
|
6342
|
+
const profileDir = join6(baseDir, "profiles", profile);
|
|
6242
6343
|
mkdirSync4(profileDir, { recursive: true });
|
|
6243
|
-
writeFileSync3(
|
|
6344
|
+
writeFileSync3(join6(profileDir, "tokens.json"), JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
6244
6345
|
}
|
|
6245
6346
|
function configDirs2() {
|
|
6246
6347
|
const explicit = process.env.HASNA_GOOGLE_DRIVE_CONNECTOR_DIR ?? process.env.GOOGLE_DRIVE_CONNECTOR_DIR;
|
|
6247
6348
|
if (explicit)
|
|
6248
6349
|
return [explicit];
|
|
6249
|
-
const baseDir =
|
|
6250
|
-
return [
|
|
6350
|
+
const baseDir = connectorsHome();
|
|
6351
|
+
return [join6(baseDir, "googledrive"), join6(baseDir, "connect-googledrive")];
|
|
6251
6352
|
}
|
|
6252
6353
|
function readJson2(path) {
|
|
6253
|
-
if (!
|
|
6354
|
+
if (!existsSync6(path))
|
|
6254
6355
|
return null;
|
|
6255
6356
|
try {
|
|
6256
6357
|
return JSON.parse(readFileSync3(path, "utf8"));
|
|
@@ -6284,6 +6385,7 @@ function extractGoogleError(body) {
|
|
|
6284
6385
|
}
|
|
6285
6386
|
var DRIVE_API_BASE = "https://www.googleapis.com/drive/v3", TOKEN_URL2 = "https://oauth2.googleapis.com/token", REFRESH_BUFFER_MS2, DEFAULT_FILE_FIELDS, DEFAULT_EXPORT_FORMATS, EXPORT_EXTENSIONS, listFilesSchema, listDrivesSchema, fileIdSchema, downloadSchema, profilesStatusSchema, googleDriveConnector;
|
|
6286
6387
|
var init_googledrive = __esm(() => {
|
|
6388
|
+
init_paths();
|
|
6287
6389
|
init_zod();
|
|
6288
6390
|
init_connector();
|
|
6289
6391
|
REFRESH_BUFFER_MS2 = 5 * 60 * 1000;
|
|
@@ -6433,7 +6535,7 @@ var package_default;
|
|
|
6433
6535
|
var init_package = __esm(() => {
|
|
6434
6536
|
package_default = {
|
|
6435
6537
|
name: "@hasna/connectors",
|
|
6436
|
-
version: "1.4.
|
|
6538
|
+
version: "1.4.6",
|
|
6437
6539
|
description: "Open source connector library - Install API connectors with a single command",
|
|
6438
6540
|
type: "module",
|
|
6439
6541
|
bin: {
|
|
@@ -6444,7 +6546,6 @@ var init_package = __esm(() => {
|
|
|
6444
6546
|
files: [
|
|
6445
6547
|
"bin/",
|
|
6446
6548
|
"dist/",
|
|
6447
|
-
"dashboard/dist/",
|
|
6448
6549
|
"connectors/",
|
|
6449
6550
|
"README.md",
|
|
6450
6551
|
"!connectors/**/.test-home/**",
|
|
@@ -6464,20 +6565,23 @@ var init_package = __esm(() => {
|
|
|
6464
6565
|
"./social": {
|
|
6465
6566
|
import: "./dist/social/index.js",
|
|
6466
6567
|
types: "./dist/.types/src/social/index.d.ts"
|
|
6568
|
+
},
|
|
6569
|
+
"./sdk": {
|
|
6570
|
+
types: "./dist/sdk/index.d.ts",
|
|
6571
|
+
import: "./dist/sdk/index.js",
|
|
6572
|
+
default: "./dist/sdk/index.js"
|
|
6467
6573
|
}
|
|
6468
6574
|
},
|
|
6469
6575
|
main: "./dist/index.js",
|
|
6470
6576
|
types: "./dist/index.d.ts",
|
|
6471
6577
|
scripts: {
|
|
6472
|
-
build: "
|
|
6473
|
-
|
|
6474
|
-
postinstall: 'mkdir -p $HOME/.hasna/connectors 2>/dev/null || true; [ "$SKIP_DASHBOARD" = "1" ] || [ ! -f dashboard/package.json ] || [ -d dashboard/node_modules ] || (cd dashboard && bun install)',
|
|
6578
|
+
build: "bun build ./src/cli/index.tsx --outdir ./bin --target bun --external ink --external react --external chalk --external conf --external @hasna/events && 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 && bun build ./src/social/index.ts --outfile ./dist/social/index.js --target bun && bun build ./src/sdk/index.ts --outfile ./dist/sdk/index.js --target bun && tsc --emitDeclarationOnly --outDir ./dist && tsc -p tsconfig.social.json",
|
|
6579
|
+
postinstall: "mkdir -p $HOME/.hasna/connectors 2>/dev/null || true",
|
|
6475
6580
|
dev: "bun run ./src/cli/index.tsx",
|
|
6476
6581
|
"check:package-secrets": "bun run scripts/check-package-secrets.ts",
|
|
6477
6582
|
typecheck: "tsc --noEmit && tsc -p tsconfig.social.json --noEmit",
|
|
6478
6583
|
test: "bun run build && bun test",
|
|
6479
6584
|
"secrets:scan:npmrc": "bun run scripts/scan-npmrc-auth.mjs",
|
|
6480
|
-
"sdk:build": "cd sdk && bun run build",
|
|
6481
6585
|
prepublishOnly: "bun run secrets:scan:npmrc && bun run build && bun run check:package-secrets && bun test",
|
|
6482
6586
|
prepack: "bun run build && bun run check:package-secrets"
|
|
6483
6587
|
},
|
|
@@ -6497,7 +6601,7 @@ var init_package = __esm(() => {
|
|
|
6497
6601
|
author: "Hasna",
|
|
6498
6602
|
license: "Apache-2.0",
|
|
6499
6603
|
devDependencies: {
|
|
6500
|
-
"@types/bun": "
|
|
6604
|
+
"@types/bun": "1.3.14",
|
|
6501
6605
|
"@types/react": "^18.2.0",
|
|
6502
6606
|
"ink-testing-library": "^4.0.0",
|
|
6503
6607
|
typescript: "^5",
|
|
@@ -6527,18 +6631,19 @@ var init_package = __esm(() => {
|
|
|
6527
6631
|
},
|
|
6528
6632
|
repository: {
|
|
6529
6633
|
type: "git",
|
|
6530
|
-
url: "
|
|
6634
|
+
url: "https://github.com/hasna/apps.git",
|
|
6635
|
+
directory: "apps/connectors"
|
|
6531
6636
|
},
|
|
6532
|
-
homepage: "https://github.com/hasna/connectors#readme",
|
|
6637
|
+
homepage: "https://github.com/hasna/apps/tree/main/apps/connectors#readme",
|
|
6533
6638
|
bugs: {
|
|
6534
|
-
url: "https://github.com/hasna/
|
|
6639
|
+
url: "https://github.com/hasna/apps/issues"
|
|
6535
6640
|
}
|
|
6536
6641
|
};
|
|
6537
6642
|
});
|
|
6538
6643
|
|
|
6539
6644
|
// src/lib/connector-resolver.ts
|
|
6540
|
-
import { existsSync as
|
|
6541
|
-
import { join as
|
|
6645
|
+
import { existsSync as existsSync7, readdirSync as readdirSync4, statSync as statSync2 } from "fs";
|
|
6646
|
+
import { join as join7 } from "path";
|
|
6542
6647
|
function stripLegacyPrefix(name) {
|
|
6543
6648
|
return name.startsWith(LEGACY_CONNECTOR_PREFIX) ? name.slice(LEGACY_CONNECTOR_PREFIX.length) : name;
|
|
6544
6649
|
}
|
|
@@ -6581,8 +6686,8 @@ function connectorPackageDirNames(name) {
|
|
|
6581
6686
|
function resolveConnectorPackagePath(connectorsDir, name) {
|
|
6582
6687
|
const resolution = resolveConnectorName(name);
|
|
6583
6688
|
const dirNames = connectorPackageDirNames(name);
|
|
6584
|
-
const checkedPaths = dirNames.map((dirName) =>
|
|
6585
|
-
const existingPath = checkedPaths.find((path) =>
|
|
6689
|
+
const checkedPaths = dirNames.map((dirName) => join7(connectorsDir, dirName));
|
|
6690
|
+
const existingPath = checkedPaths.find((path) => existsSync7(path)) ?? null;
|
|
6586
6691
|
const existingDirName = existingPath ? dirNames[checkedPaths.indexOf(existingPath)] : null;
|
|
6587
6692
|
return {
|
|
6588
6693
|
...resolution,
|
|
@@ -6598,16 +6703,16 @@ function getConnectorPackagePath(connectorsDir, name) {
|
|
|
6598
6703
|
const resolved = resolveConnectorPackagePath(connectorsDir, name);
|
|
6599
6704
|
return resolved.existingPath ?? resolved.preferredPath;
|
|
6600
6705
|
}
|
|
6601
|
-
function resolveConnectorConfigPaths(name,
|
|
6706
|
+
function resolveConnectorConfigPaths(name, connectorsHome2 = getConnectorsHome()) {
|
|
6602
6707
|
const resolution = resolveConnectorName(name);
|
|
6603
6708
|
const preferredDirName = resolution.canonicalName || resolution.legacyName;
|
|
6604
|
-
const preferredPath =
|
|
6605
|
-
const legacyPath =
|
|
6709
|
+
const preferredPath = join7(connectorsHome2, preferredDirName);
|
|
6710
|
+
const legacyPath = join7(connectorsHome2, resolution.legacyName);
|
|
6606
6711
|
const paths = preferredPath === legacyPath ? [preferredPath] : [preferredPath, legacyPath];
|
|
6607
|
-
const existingPaths = paths.filter((path) =>
|
|
6712
|
+
const existingPaths = paths.filter((path) => existsSync7(path));
|
|
6608
6713
|
return {
|
|
6609
6714
|
...resolution,
|
|
6610
|
-
connectorsHome,
|
|
6715
|
+
connectorsHome: connectorsHome2,
|
|
6611
6716
|
preferredDirName,
|
|
6612
6717
|
preferredPath,
|
|
6613
6718
|
legacyPath,
|
|
@@ -6615,18 +6720,18 @@ function resolveConnectorConfigPaths(name, connectorsHome = getConnectorsHome())
|
|
|
6615
6720
|
readPaths: paths
|
|
6616
6721
|
};
|
|
6617
6722
|
}
|
|
6618
|
-
function getConnectorConfigDir(name,
|
|
6619
|
-
return resolveConnectorConfigPaths(name,
|
|
6723
|
+
function getConnectorConfigDir(name, connectorsHome2 = getConnectorsHome()) {
|
|
6724
|
+
return resolveConnectorConfigPaths(name, connectorsHome2).preferredPath;
|
|
6620
6725
|
}
|
|
6621
|
-
function getConnectorConfigReadDirs(name,
|
|
6622
|
-
return resolveConnectorConfigPaths(name,
|
|
6726
|
+
function getConnectorConfigReadDirs(name, connectorsHome2 = getConnectorsHome()) {
|
|
6727
|
+
return resolveConnectorConfigPaths(name, connectorsHome2).readPaths;
|
|
6623
6728
|
}
|
|
6624
|
-
function listConfiguredConnectorNames(
|
|
6625
|
-
if (!
|
|
6729
|
+
function listConfiguredConnectorNames(connectorsHome2 = getConnectorsHome()) {
|
|
6730
|
+
if (!existsSync7(connectorsHome2))
|
|
6626
6731
|
return [];
|
|
6627
6732
|
const names = new Set;
|
|
6628
|
-
for (const entry of readdirSync4(
|
|
6629
|
-
const fullPath =
|
|
6733
|
+
for (const entry of readdirSync4(connectorsHome2)) {
|
|
6734
|
+
const fullPath = join7(connectorsHome2, entry);
|
|
6630
6735
|
try {
|
|
6631
6736
|
if (!statSync2(fullPath).isDirectory())
|
|
6632
6737
|
continue;
|
|
@@ -6649,7 +6754,7 @@ var init_connector_resolver = __esm(() => {
|
|
|
6649
6754
|
|
|
6650
6755
|
// src/core/connectors/imessage.ts
|
|
6651
6756
|
import {
|
|
6652
|
-
existsSync as
|
|
6757
|
+
existsSync as existsSync8,
|
|
6653
6758
|
mkdirSync as mkdirSync5,
|
|
6654
6759
|
readFileSync as readFileSync4,
|
|
6655
6760
|
readdirSync as readdirSync5,
|
|
@@ -6657,7 +6762,7 @@ import {
|
|
|
6657
6762
|
statSync as statSync3,
|
|
6658
6763
|
writeFileSync as writeFileSync4
|
|
6659
6764
|
} from "fs";
|
|
6660
|
-
import { join as
|
|
6765
|
+
import { join as join8 } from "path";
|
|
6661
6766
|
function buildRootHelp(specs) {
|
|
6662
6767
|
const lines = [
|
|
6663
6768
|
"Usage: connect-imessage [options] [command]",
|
|
@@ -6708,12 +6813,12 @@ function getConfigReadDirs() {
|
|
|
6708
6813
|
return getConnectorConfigReadDirs(CONNECTOR_NAME);
|
|
6709
6814
|
}
|
|
6710
6815
|
function getProfilesDir() {
|
|
6711
|
-
return
|
|
6816
|
+
return join8(getConfigDir(), "profiles");
|
|
6712
6817
|
}
|
|
6713
6818
|
function getCurrentProfile() {
|
|
6714
6819
|
for (const configDir of getConfigReadDirs()) {
|
|
6715
|
-
const currentProfileFile =
|
|
6716
|
-
if (!
|
|
6820
|
+
const currentProfileFile = join8(configDir, "current_profile");
|
|
6821
|
+
if (!existsSync8(currentProfileFile))
|
|
6717
6822
|
continue;
|
|
6718
6823
|
try {
|
|
6719
6824
|
return readFileSync4(currentProfileFile, "utf-8").trim() || "default";
|
|
@@ -6726,16 +6831,16 @@ function getCurrentProfile() {
|
|
|
6726
6831
|
function setCurrentProfile(profile) {
|
|
6727
6832
|
const configDir = getConfigDir();
|
|
6728
6833
|
mkdirSync5(configDir, { recursive: true });
|
|
6729
|
-
writeFileSync4(
|
|
6834
|
+
writeFileSync4(join8(configDir, "current_profile"), profile);
|
|
6730
6835
|
}
|
|
6731
6836
|
function getFlatProfilePath(profile) {
|
|
6732
|
-
return
|
|
6837
|
+
return join8(getProfilesDir(), `${profile}.json`);
|
|
6733
6838
|
}
|
|
6734
6839
|
function getFlatProfileReadPaths(profile) {
|
|
6735
|
-
return getConfigReadDirs().map((dir) =>
|
|
6840
|
+
return getConfigReadDirs().map((dir) => join8(dir, "profiles", `${profile}.json`));
|
|
6736
6841
|
}
|
|
6737
6842
|
function getDirectoryProfileReadPaths(profile) {
|
|
6738
|
-
return getConfigReadDirs().map((dir) =>
|
|
6843
|
+
return getConfigReadDirs().map((dir) => join8(dir, "profiles", profile, "config.json"));
|
|
6739
6844
|
}
|
|
6740
6845
|
function loadJsonFile(path) {
|
|
6741
6846
|
try {
|
|
@@ -6755,8 +6860,8 @@ function sanitizeProfileConfig(config) {
|
|
|
6755
6860
|
};
|
|
6756
6861
|
}
|
|
6757
6862
|
function loadProfile(profile = getCurrentProfile()) {
|
|
6758
|
-
const flatConfig = getFlatProfileReadPaths(profile).reverse().reduce((config, path) => ({ ...config, ...
|
|
6759
|
-
const directoryConfig = getDirectoryProfileReadPaths(profile).reverse().reduce((config, path) => ({ ...config, ...
|
|
6863
|
+
const flatConfig = getFlatProfileReadPaths(profile).reverse().reduce((config, path) => ({ ...config, ...existsSync8(path) ? loadJsonFile(path) : {} }), {});
|
|
6864
|
+
const directoryConfig = getDirectoryProfileReadPaths(profile).reverse().reduce((config, path) => ({ ...config, ...existsSync8(path) ? loadJsonFile(path) : {} }), {});
|
|
6760
6865
|
return sanitizeProfileConfig({
|
|
6761
6866
|
...flatConfig,
|
|
6762
6867
|
...directoryConfig
|
|
@@ -6772,17 +6877,17 @@ function profileExists(profile) {
|
|
|
6772
6877
|
if (profile === "default") {
|
|
6773
6878
|
return true;
|
|
6774
6879
|
}
|
|
6775
|
-
return getFlatProfileReadPaths(profile).some((path) =>
|
|
6880
|
+
return getFlatProfileReadPaths(profile).some((path) => existsSync8(path)) || getConfigReadDirs().some((dir) => existsSync8(join8(dir, "profiles", profile)));
|
|
6776
6881
|
}
|
|
6777
6882
|
function listProfiles3() {
|
|
6778
6883
|
const seen = new Set(["default"]);
|
|
6779
6884
|
for (const configDir of getConfigReadDirs()) {
|
|
6780
|
-
const profilesDir =
|
|
6781
|
-
if (!
|
|
6885
|
+
const profilesDir = join8(configDir, "profiles");
|
|
6886
|
+
if (!existsSync8(profilesDir))
|
|
6782
6887
|
continue;
|
|
6783
6888
|
try {
|
|
6784
6889
|
for (const entry of readdirSync5(profilesDir)) {
|
|
6785
|
-
const fullPath =
|
|
6890
|
+
const fullPath = join8(profilesDir, entry);
|
|
6786
6891
|
const stat = statSync3(fullPath);
|
|
6787
6892
|
if (stat.isDirectory()) {
|
|
6788
6893
|
seen.add(entry);
|
|
@@ -6804,11 +6909,11 @@ function createProfile(profile, config = {}) {
|
|
|
6804
6909
|
}
|
|
6805
6910
|
function clearProfile(profile = getCurrentProfile()) {
|
|
6806
6911
|
const flatPath = getFlatProfilePath(profile);
|
|
6807
|
-
const directoryPath =
|
|
6808
|
-
if (
|
|
6912
|
+
const directoryPath = join8(getProfilesDir(), profile);
|
|
6913
|
+
if (existsSync8(flatPath)) {
|
|
6809
6914
|
rmSync(flatPath);
|
|
6810
6915
|
}
|
|
6811
|
-
if (
|
|
6916
|
+
if (existsSync8(directoryPath)) {
|
|
6812
6917
|
rmSync(directoryPath, { recursive: true, force: true });
|
|
6813
6918
|
}
|
|
6814
6919
|
}
|
|
@@ -7441,7 +7546,7 @@ API Key authentication is optional and depends on the bridge deployment. A bridg
|
|
|
7441
7546
|
|
|
7442
7547
|
## Data Storage
|
|
7443
7548
|
|
|
7444
|
-
Connector state is stored under \`~/.hasna/connectors/imessage/\`. Profiles are read from both \`profiles/<name>.json\` and \`profiles/<name>/config.json\` so the connector stays compatible with the shared
|
|
7549
|
+
Connector state is stored under \`~/.hasna/connectors/imessage/\`. Profiles are read from both \`profiles/<name>.json\` and \`profiles/<name>/config.json\` so the connector stays compatible with the shared auth helpers while remaining fully internal to the one-product repo.
|
|
7445
7550
|
`, commandInputSchema, conversationListInputSchema, conversationGetInputSchema, messageListInputSchema, messageSendInputSchema, messageReplyInputSchema, imessageConnector;
|
|
7446
7551
|
var init_imessage = __esm(() => {
|
|
7447
7552
|
init_package();
|
|
@@ -7734,18 +7839,18 @@ var init_imessage = __esm(() => {
|
|
|
7734
7839
|
});
|
|
7735
7840
|
|
|
7736
7841
|
// src/core/connectors/stripe.ts
|
|
7737
|
-
import { existsSync as
|
|
7738
|
-
import { dirname as dirname3, join as
|
|
7842
|
+
import { existsSync as existsSync9 } from "fs";
|
|
7843
|
+
import { dirname as dirname3, join as join9 } from "path";
|
|
7739
7844
|
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "url";
|
|
7740
7845
|
function resolveStripeConnectorDir() {
|
|
7741
7846
|
const candidates = [
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7847
|
+
join9(__dirname3, "..", "..", "..", "connectors", "stripe"),
|
|
7848
|
+
join9(__dirname3, "..", "..", "connectors", "stripe"),
|
|
7849
|
+
join9(__dirname3, "..", "connectors", "stripe"),
|
|
7850
|
+
join9(process.cwd(), "connectors", "stripe")
|
|
7746
7851
|
];
|
|
7747
7852
|
for (const candidate of candidates) {
|
|
7748
|
-
if (
|
|
7853
|
+
if (existsSync9(candidate)) {
|
|
7749
7854
|
return candidate;
|
|
7750
7855
|
}
|
|
7751
7856
|
}
|
|
@@ -7793,10 +7898,10 @@ function buildCommandHelp2(spec) {
|
|
|
7793
7898
|
`);
|
|
7794
7899
|
}
|
|
7795
7900
|
async function loadStripeApiModule() {
|
|
7796
|
-
return await import(pathToFileURL2(
|
|
7901
|
+
return await import(pathToFileURL2(join9(CONNECTOR_DIR2, "src", "api", "index.ts")).href);
|
|
7797
7902
|
}
|
|
7798
7903
|
async function loadStripeConfigModule() {
|
|
7799
|
-
return await import(pathToFileURL2(
|
|
7904
|
+
return await import(pathToFileURL2(join9(CONNECTOR_DIR2, "src", "utils", "config.ts")).href);
|
|
7800
7905
|
}
|
|
7801
7906
|
function extractGlobalArgs3(args) {
|
|
7802
7907
|
const remaining = [];
|
|
@@ -8642,30 +8747,30 @@ __export(exports_installer, {
|
|
|
8642
8747
|
getConnectorDocs: () => getConnectorDocs,
|
|
8643
8748
|
connectorExists: () => connectorExists
|
|
8644
8749
|
});
|
|
8645
|
-
import { existsSync as
|
|
8646
|
-
import { join as
|
|
8750
|
+
import { existsSync as existsSync11, mkdirSync as mkdirSync6, readFileSync as readFileSync6, writeFileSync as writeFileSync5, readdirSync as readdirSync6, statSync as statSync4, rmSync as rmSync2 } from "fs";
|
|
8751
|
+
import { join as join11, dirname as dirname5 } from "path";
|
|
8647
8752
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
8648
8753
|
function resolveConnectorsDir() {
|
|
8649
|
-
const fromBin =
|
|
8650
|
-
if (
|
|
8754
|
+
const fromBin = join11(__dirname4, "..", "connectors");
|
|
8755
|
+
if (existsSync11(fromBin))
|
|
8651
8756
|
return fromBin;
|
|
8652
|
-
const fromSrc =
|
|
8653
|
-
if (
|
|
8757
|
+
const fromSrc = join11(__dirname4, "..", "..", "connectors");
|
|
8758
|
+
if (existsSync11(fromSrc))
|
|
8654
8759
|
return fromSrc;
|
|
8655
8760
|
return fromBin;
|
|
8656
8761
|
}
|
|
8657
8762
|
function getProjectConnectorsDir(targetDir) {
|
|
8658
|
-
return
|
|
8763
|
+
return join11(targetDir, PROJECT_CONNECTORS_DIRNAME);
|
|
8659
8764
|
}
|
|
8660
8765
|
function getEnablementManifestPath(targetDir) {
|
|
8661
|
-
return
|
|
8766
|
+
return join11(getProjectConnectorsDir(targetDir), ENABLEMENT_MANIFEST_FILENAME);
|
|
8662
8767
|
}
|
|
8663
8768
|
function getLegacyInstallPath(targetDir, name) {
|
|
8664
|
-
return
|
|
8769
|
+
return join11(getProjectConnectorsDir(targetDir), legacyConnectorName(name));
|
|
8665
8770
|
}
|
|
8666
8771
|
function loadEnablementManifest(targetDir) {
|
|
8667
8772
|
const manifestPath = getEnablementManifestPath(targetDir);
|
|
8668
|
-
if (!
|
|
8773
|
+
if (!existsSync11(manifestPath)) {
|
|
8669
8774
|
return null;
|
|
8670
8775
|
}
|
|
8671
8776
|
try {
|
|
@@ -8685,11 +8790,11 @@ function loadEnablementManifest(targetDir) {
|
|
|
8685
8790
|
}
|
|
8686
8791
|
function getLegacyInstalledConnectors(targetDir) {
|
|
8687
8792
|
const connectorsDir = getProjectConnectorsDir(targetDir);
|
|
8688
|
-
if (!
|
|
8793
|
+
if (!existsSync11(connectorsDir)) {
|
|
8689
8794
|
return [];
|
|
8690
8795
|
}
|
|
8691
8796
|
return readdirSync6(connectorsDir).filter((entry) => {
|
|
8692
|
-
const fullPath =
|
|
8797
|
+
const fullPath = join11(connectorsDir, entry);
|
|
8693
8798
|
return entry.startsWith("connect-") && statSync4(fullPath).isDirectory();
|
|
8694
8799
|
}).map((entry) => entry.replace("connect-", "")).sort();
|
|
8695
8800
|
}
|
|
@@ -8698,7 +8803,7 @@ function getEnabledConnectors(targetDir) {
|
|
|
8698
8803
|
return [...new Set([...manifestConnectors, ...getLegacyInstalledConnectors(targetDir)])].sort();
|
|
8699
8804
|
}
|
|
8700
8805
|
function updateConnectorsIndex(connectorsDir, connectors18) {
|
|
8701
|
-
const indexPath =
|
|
8806
|
+
const indexPath = join11(connectorsDir, ENABLEMENT_INDEX_FILENAME);
|
|
8702
8807
|
const connectorList = connectors18.map((connector) => ` "${connector}",`).join(`
|
|
8703
8808
|
`);
|
|
8704
8809
|
const content = `/**
|
|
@@ -8734,7 +8839,7 @@ function getConnectorPath(name) {
|
|
|
8734
8839
|
}
|
|
8735
8840
|
function connectorExists(name) {
|
|
8736
8841
|
const normalizedName = normalizeConnectorName(name);
|
|
8737
|
-
return hasInternalConnectorDefinition(normalizedName) ||
|
|
8842
|
+
return hasInternalConnectorDefinition(normalizedName) || existsSync11(getConnectorPath(normalizedName));
|
|
8738
8843
|
}
|
|
8739
8844
|
function installConnector(name, options = {}) {
|
|
8740
8845
|
const { targetDir = process.cwd(), overwrite = false } = options;
|
|
@@ -8767,7 +8872,7 @@ function installConnector(name, options = {}) {
|
|
|
8767
8872
|
try {
|
|
8768
8873
|
const nextEnabled = [...new Set([...installed, normalizedName])].sort();
|
|
8769
8874
|
writeEnablementManifest(targetDir, nextEnabled);
|
|
8770
|
-
if (overwrite &&
|
|
8875
|
+
if (overwrite && existsSync11(legacyInstallPath)) {
|
|
8771
8876
|
rmSync2(legacyInstallPath, { recursive: true });
|
|
8772
8877
|
}
|
|
8773
8878
|
return {
|
|
@@ -8802,8 +8907,8 @@ function parseConnectorDocs(raw) {
|
|
|
8802
8907
|
function getConnectorDocs(name) {
|
|
8803
8908
|
const normalizedName = normalizeConnectorName(name);
|
|
8804
8909
|
const connectorPath = getConnectorPath(normalizedName);
|
|
8805
|
-
const claudeMdPath =
|
|
8806
|
-
if (
|
|
8910
|
+
const claudeMdPath = join11(connectorPath, "CLAUDE.md");
|
|
8911
|
+
if (existsSync11(claudeMdPath)) {
|
|
8807
8912
|
return parseConnectorDocs(readFileSync6(claudeMdPath, "utf-8"));
|
|
8808
8913
|
}
|
|
8809
8914
|
const internalDocs = getInternalConnectorDefinition(normalizedName)?.docsMarkdown;
|
|
@@ -8848,7 +8953,7 @@ function removeConnector(name, targetDir = process.cwd()) {
|
|
|
8848
8953
|
const nextEnabled = installed.filter((connector) => connector !== normalizedName);
|
|
8849
8954
|
writeEnablementManifest(targetDir, nextEnabled);
|
|
8850
8955
|
const legacyInstallPath = getLegacyInstallPath(targetDir, normalizedName);
|
|
8851
|
-
if (
|
|
8956
|
+
if (existsSync11(legacyInstallPath)) {
|
|
8852
8957
|
rmSync2(legacyInstallPath, { recursive: true });
|
|
8853
8958
|
}
|
|
8854
8959
|
return true;
|
|
@@ -8862,7 +8967,7 @@ var init_installer = __esm(() => {
|
|
|
8862
8967
|
});
|
|
8863
8968
|
|
|
8864
8969
|
// src/lib/lock.ts
|
|
8865
|
-
import { openSync, closeSync, unlinkSync, existsSync as
|
|
8970
|
+
import { openSync, closeSync, unlinkSync, existsSync as existsSync12, statSync as statSync5 } from "fs";
|
|
8866
8971
|
import { mkdirSync as mkdirSync7 } from "fs";
|
|
8867
8972
|
function lockPath(connector) {
|
|
8868
8973
|
const dir = getConnectorConfigDir(connector);
|
|
@@ -8878,7 +8983,7 @@ function isStale(path) {
|
|
|
8878
8983
|
}
|
|
8879
8984
|
}
|
|
8880
8985
|
function tryAcquire(path) {
|
|
8881
|
-
if (
|
|
8986
|
+
if (existsSync12(path) && isStale(path)) {
|
|
8882
8987
|
try {
|
|
8883
8988
|
unlinkSync(path);
|
|
8884
8989
|
} catch {}
|
|
@@ -8910,7 +9015,7 @@ async function withWriteLock(connector, fn) {
|
|
|
8910
9015
|
release(path);
|
|
8911
9016
|
}
|
|
8912
9017
|
}
|
|
8913
|
-
await new Promise((
|
|
9018
|
+
await new Promise((resolve2) => setTimeout(resolve2, LOCK_RETRY_MS));
|
|
8914
9019
|
}
|
|
8915
9020
|
throw new LockTimeoutError(connector);
|
|
8916
9021
|
}
|
|
@@ -8928,9 +9033,9 @@ var init_lock = __esm(() => {
|
|
|
8928
9033
|
});
|
|
8929
9034
|
|
|
8930
9035
|
// src/server/auth.ts
|
|
8931
|
-
import { chmodSync, existsSync as
|
|
9036
|
+
import { chmodSync, existsSync as existsSync13, readFileSync as readFileSync7, writeFileSync as writeFileSync6, mkdirSync as mkdirSync8, readdirSync as readdirSync7, rmSync as rmSync3, statSync as statSync6 } from "fs";
|
|
8932
9037
|
import { randomBytes } from "crypto";
|
|
8933
|
-
import { join as
|
|
9038
|
+
import { join as join12 } from "path";
|
|
8934
9039
|
function getAuthType(name) {
|
|
8935
9040
|
name = normalizeConnectorName(name);
|
|
8936
9041
|
const docs = getConnectorDocs(name);
|
|
@@ -8971,8 +9076,8 @@ function writePrivateText(path, data) {
|
|
|
8971
9076
|
function getCurrentProfile2(name) {
|
|
8972
9077
|
name = normalizeConnectorName(name);
|
|
8973
9078
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
8974
|
-
const currentProfileFile =
|
|
8975
|
-
if (
|
|
9079
|
+
const currentProfileFile = join12(configDir, "current_profile");
|
|
9080
|
+
if (existsSync13(currentProfileFile)) {
|
|
8976
9081
|
try {
|
|
8977
9082
|
return readFileSync7(currentProfileFile, "utf-8").trim() || "default";
|
|
8978
9083
|
} catch {
|
|
@@ -8985,14 +9090,14 @@ function getCurrentProfile2(name) {
|
|
|
8985
9090
|
function loadProfileConfigFromDir(configDir, profile) {
|
|
8986
9091
|
let flatConfig = {};
|
|
8987
9092
|
let dirConfig = {};
|
|
8988
|
-
const profileFile =
|
|
8989
|
-
if (
|
|
9093
|
+
const profileFile = join12(configDir, "profiles", `${profile}.json`);
|
|
9094
|
+
if (existsSync13(profileFile)) {
|
|
8990
9095
|
try {
|
|
8991
9096
|
flatConfig = JSON.parse(readFileSync7(profileFile, "utf-8"));
|
|
8992
9097
|
} catch {}
|
|
8993
9098
|
}
|
|
8994
|
-
const profileDirConfig =
|
|
8995
|
-
if (
|
|
9099
|
+
const profileDirConfig = join12(configDir, "profiles", profile, "config.json");
|
|
9100
|
+
if (existsSync13(profileDirConfig)) {
|
|
8996
9101
|
try {
|
|
8997
9102
|
dirConfig = JSON.parse(readFileSync7(profileDirConfig, "utf-8"));
|
|
8998
9103
|
} catch {}
|
|
@@ -9012,8 +9117,8 @@ function loadTokens3(name) {
|
|
|
9012
9117
|
name = normalizeConnectorName(name);
|
|
9013
9118
|
const profile = getCurrentProfile2(name);
|
|
9014
9119
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9015
|
-
const tokensFile =
|
|
9016
|
-
if (
|
|
9120
|
+
const tokensFile = join12(configDir, "profiles", profile, "tokens.json");
|
|
9121
|
+
if (existsSync13(tokensFile)) {
|
|
9017
9122
|
try {
|
|
9018
9123
|
return JSON.parse(readFileSync7(tokensFile, "utf-8"));
|
|
9019
9124
|
} catch {
|
|
@@ -9146,10 +9251,10 @@ function _saveApiKey(name, key, field) {
|
|
|
9146
9251
|
const profile = getCurrentProfile2(name);
|
|
9147
9252
|
const keyField = field || guessKeyField(name);
|
|
9148
9253
|
if (keyField === "clientId" || keyField === "clientSecret") {
|
|
9149
|
-
const credentialsFile =
|
|
9254
|
+
const credentialsFile = join12(configDir, "credentials.json");
|
|
9150
9255
|
ensurePrivateDir(configDir);
|
|
9151
9256
|
let creds = {};
|
|
9152
|
-
if (
|
|
9257
|
+
if (existsSync13(credentialsFile)) {
|
|
9153
9258
|
try {
|
|
9154
9259
|
creds = JSON.parse(readFileSync7(credentialsFile, "utf-8"));
|
|
9155
9260
|
} catch {}
|
|
@@ -9158,10 +9263,10 @@ function _saveApiKey(name, key, field) {
|
|
|
9158
9263
|
writePrivateJson(credentialsFile, creds);
|
|
9159
9264
|
return;
|
|
9160
9265
|
}
|
|
9161
|
-
const profilesDir =
|
|
9162
|
-
const profileFile =
|
|
9163
|
-
const profileDir =
|
|
9164
|
-
if (
|
|
9266
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9267
|
+
const profileFile = join12(profilesDir, `${profile}.json`);
|
|
9268
|
+
const profileDir = join12(profilesDir, profile);
|
|
9269
|
+
if (existsSync13(profileFile)) {
|
|
9165
9270
|
let config = {};
|
|
9166
9271
|
try {
|
|
9167
9272
|
config = JSON.parse(readFileSync7(profileFile, "utf-8"));
|
|
@@ -9172,10 +9277,10 @@ function _saveApiKey(name, key, field) {
|
|
|
9172
9277
|
writePrivateJson(profileFile, config);
|
|
9173
9278
|
return;
|
|
9174
9279
|
}
|
|
9175
|
-
if (
|
|
9176
|
-
const configFile =
|
|
9280
|
+
if (existsSync13(profileDir)) {
|
|
9281
|
+
const configFile = join12(profileDir, "config.json");
|
|
9177
9282
|
let config = {};
|
|
9178
|
-
if (
|
|
9283
|
+
if (existsSync13(configFile)) {
|
|
9179
9284
|
try {
|
|
9180
9285
|
config = JSON.parse(readFileSync7(configFile, "utf-8"));
|
|
9181
9286
|
} catch {}
|
|
@@ -9190,7 +9295,7 @@ function _saveApiKey(name, key, field) {
|
|
|
9190
9295
|
ensurePrivateDir(configDir);
|
|
9191
9296
|
ensurePrivateDir(profilesDir);
|
|
9192
9297
|
ensurePrivateDir(profileDir);
|
|
9193
|
-
writePrivateJson(
|
|
9298
|
+
writePrivateJson(join12(profileDir, "config.json"), { [keyField]: key });
|
|
9194
9299
|
}
|
|
9195
9300
|
function guessKeyField(name) {
|
|
9196
9301
|
name = normalizeConnectorName(name);
|
|
@@ -9212,8 +9317,8 @@ function guessKeyField(name) {
|
|
|
9212
9317
|
function getOAuthConfig(name) {
|
|
9213
9318
|
name = normalizeConnectorName(name);
|
|
9214
9319
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9215
|
-
const credentialsFile =
|
|
9216
|
-
if (
|
|
9320
|
+
const credentialsFile = join12(configDir, "credentials.json");
|
|
9321
|
+
if (existsSync13(credentialsFile)) {
|
|
9217
9322
|
try {
|
|
9218
9323
|
const creds = JSON.parse(readFileSync7(credentialsFile, "utf-8"));
|
|
9219
9324
|
return { clientId: creds.clientId, clientSecret: creds.clientSecret };
|
|
@@ -9299,12 +9404,12 @@ function saveOAuthTokens(name, tokens) {
|
|
|
9299
9404
|
name = normalizeConnectorName(name);
|
|
9300
9405
|
const configDir = getConnectorConfigDir2(name);
|
|
9301
9406
|
const profile = getCurrentProfile2(name);
|
|
9302
|
-
const profilesDir =
|
|
9303
|
-
const profileDir =
|
|
9407
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9408
|
+
const profileDir = join12(profilesDir, profile);
|
|
9304
9409
|
ensurePrivateDir(configDir);
|
|
9305
9410
|
ensurePrivateDir(profilesDir);
|
|
9306
9411
|
ensurePrivateDir(profileDir);
|
|
9307
|
-
const tokensFile =
|
|
9412
|
+
const tokensFile = join12(profileDir, "tokens.json");
|
|
9308
9413
|
writePrivateJson(tokensFile, tokens);
|
|
9309
9414
|
}
|
|
9310
9415
|
async function refreshOAuthToken(name) {
|
|
@@ -9351,13 +9456,13 @@ function listProfiles4(name) {
|
|
|
9351
9456
|
name = normalizeConnectorName(name);
|
|
9352
9457
|
const seen = new Set;
|
|
9353
9458
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9354
|
-
const profilesDir =
|
|
9355
|
-
if (!
|
|
9459
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9460
|
+
if (!existsSync13(profilesDir))
|
|
9356
9461
|
continue;
|
|
9357
9462
|
try {
|
|
9358
9463
|
const entries = readdirSync7(profilesDir);
|
|
9359
9464
|
for (const entry of entries) {
|
|
9360
|
-
const fullPath =
|
|
9465
|
+
const fullPath = join12(profilesDir, entry);
|
|
9361
9466
|
const stat = statSync6(fullPath);
|
|
9362
9467
|
if (stat.isDirectory()) {
|
|
9363
9468
|
seen.add(entry);
|
|
@@ -9374,24 +9479,24 @@ function switchProfile(name, profile) {
|
|
|
9374
9479
|
name = normalizeConnectorName(name);
|
|
9375
9480
|
const configDir = getConnectorConfigDir2(name);
|
|
9376
9481
|
ensurePrivateDir(configDir);
|
|
9377
|
-
writePrivateText(
|
|
9482
|
+
writePrivateText(join12(configDir, "current_profile"), profile);
|
|
9378
9483
|
}
|
|
9379
9484
|
function deleteProfile2(name, profile) {
|
|
9380
9485
|
name = normalizeConnectorName(name);
|
|
9381
9486
|
if (profile === "default")
|
|
9382
9487
|
return false;
|
|
9383
9488
|
const configDir = getConnectorConfigDir2(name);
|
|
9384
|
-
const profilesDir =
|
|
9385
|
-
const profileFile =
|
|
9386
|
-
if (
|
|
9489
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9490
|
+
const profileFile = join12(profilesDir, `${profile}.json`);
|
|
9491
|
+
if (existsSync13(profileFile)) {
|
|
9387
9492
|
rmSync3(profileFile);
|
|
9388
9493
|
if (getCurrentProfile2(name) === profile) {
|
|
9389
9494
|
switchProfile(name, "default");
|
|
9390
9495
|
}
|
|
9391
9496
|
return true;
|
|
9392
9497
|
}
|
|
9393
|
-
const profileDir =
|
|
9394
|
-
if (
|
|
9498
|
+
const profileDir = join12(profilesDir, profile);
|
|
9499
|
+
if (existsSync13(profileDir)) {
|
|
9395
9500
|
rmSync3(profileDir, { recursive: true });
|
|
9396
9501
|
if (getCurrentProfile2(name) === profile) {
|
|
9397
9502
|
switchProfile(name, "default");
|
|
@@ -9465,16 +9570,16 @@ __export(exports_runner, {
|
|
|
9465
9570
|
buildEnvWithCredentials: () => buildEnvWithCredentials,
|
|
9466
9571
|
buildConnectorOperationArgs: () => buildConnectorOperationArgs
|
|
9467
9572
|
});
|
|
9468
|
-
import { existsSync as
|
|
9469
|
-
import { join as
|
|
9573
|
+
import { existsSync as existsSync14, readdirSync as readdirSync8 } from "fs";
|
|
9574
|
+
import { join as join13, dirname as dirname6 } from "path";
|
|
9470
9575
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
9471
9576
|
import { spawn as spawn2 } from "child_process";
|
|
9472
9577
|
function resolveConnectorsDir2() {
|
|
9473
|
-
const fromBin =
|
|
9474
|
-
if (
|
|
9578
|
+
const fromBin = join13(__dirname5, "..", "connectors");
|
|
9579
|
+
if (existsSync14(fromBin))
|
|
9475
9580
|
return fromBin;
|
|
9476
|
-
const fromSrc =
|
|
9477
|
-
if (
|
|
9581
|
+
const fromSrc = join13(__dirname5, "..", "..", "connectors");
|
|
9582
|
+
if (existsSync14(fromSrc))
|
|
9478
9583
|
return fromSrc;
|
|
9479
9584
|
return fromBin;
|
|
9480
9585
|
}
|
|
@@ -9542,8 +9647,8 @@ function buildEnvWithCredentials(connectorName, baseEnv) {
|
|
|
9542
9647
|
function getConnectorCliPath(name) {
|
|
9543
9648
|
const safeName = normalizeConnectorName(name).replace(/[^a-z0-9-]/g, "");
|
|
9544
9649
|
const connectorDir = getConnectorPackagePath(CONNECTORS_DIR2, safeName);
|
|
9545
|
-
const cliPath =
|
|
9546
|
-
if (
|
|
9650
|
+
const cliPath = join13(connectorDir, "src", "cli", "index.ts");
|
|
9651
|
+
if (existsSync14(cliPath))
|
|
9547
9652
|
return cliPath;
|
|
9548
9653
|
return null;
|
|
9549
9654
|
}
|
|
@@ -9737,7 +9842,7 @@ function runLegacyConnectorCommand(name, args, timeoutMs = 30000) {
|
|
|
9737
9842
|
success: false
|
|
9738
9843
|
});
|
|
9739
9844
|
}
|
|
9740
|
-
return new Promise((
|
|
9845
|
+
return new Promise((resolve2) => {
|
|
9741
9846
|
const proc = spawn2("bun", ["run", cliPath, ...args], {
|
|
9742
9847
|
timeout: timeoutMs,
|
|
9743
9848
|
env: buildEnvWithCredentials(connectorName, process.env),
|
|
@@ -9752,7 +9857,7 @@ function runLegacyConnectorCommand(name, args, timeoutMs = 30000) {
|
|
|
9752
9857
|
stderr += data.toString();
|
|
9753
9858
|
});
|
|
9754
9859
|
proc.on("close", (code) => {
|
|
9755
|
-
|
|
9860
|
+
resolve2({
|
|
9756
9861
|
stdout: stdout.trim(),
|
|
9757
9862
|
stderr: stderr.trim(),
|
|
9758
9863
|
exitCode: code ?? 1,
|
|
@@ -9760,7 +9865,7 @@ function runLegacyConnectorCommand(name, args, timeoutMs = 30000) {
|
|
|
9760
9865
|
});
|
|
9761
9866
|
});
|
|
9762
9867
|
proc.on("error", (err) => {
|
|
9763
|
-
|
|
9868
|
+
resolve2({
|
|
9764
9869
|
stdout: "",
|
|
9765
9870
|
stderr: err.message,
|
|
9766
9871
|
exitCode: 1,
|
|
@@ -12845,7 +12950,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
12845
12950
|
const schOrFunc = root.refs[ref];
|
|
12846
12951
|
if (schOrFunc)
|
|
12847
12952
|
return schOrFunc;
|
|
12848
|
-
let _sch =
|
|
12953
|
+
let _sch = resolve2.call(this, root, ref);
|
|
12849
12954
|
if (_sch === undefined) {
|
|
12850
12955
|
const schema = (_a = root.localRefs) === null || _a === undefined ? undefined : _a[ref];
|
|
12851
12956
|
const { schemaId } = this.opts;
|
|
@@ -12872,7 +12977,7 @@ var require_compile = __commonJS((exports) => {
|
|
|
12872
12977
|
function sameSchemaEnv(s1, s2) {
|
|
12873
12978
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
12874
12979
|
}
|
|
12875
|
-
function
|
|
12980
|
+
function resolve2(root, ref) {
|
|
12876
12981
|
let sch;
|
|
12877
12982
|
while (typeof (sch = this.refs[ref]) == "string")
|
|
12878
12983
|
ref = sch;
|
|
@@ -12961,13 +13066,32 @@ var require_data = __commonJS((exports, module) => {
|
|
|
12961
13066
|
};
|
|
12962
13067
|
});
|
|
12963
13068
|
|
|
12964
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13069
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/utils.js
|
|
12965
13070
|
var require_utils = __commonJS((exports, module) => {
|
|
12966
13071
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
12967
13072
|
var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
|
|
13073
|
+
var isPort = RegExp.prototype.test.bind(/^\d*$/u);
|
|
12968
13074
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
12969
13075
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
12970
|
-
var isPathCharacter = RegExp.prototype.test.bind(/^[
|
|
13076
|
+
var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
|
|
13077
|
+
var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
|
|
13078
|
+
var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
|
|
13079
|
+
var BYTE_HEX = new Array(256);
|
|
13080
|
+
{
|
|
13081
|
+
const HEX_DIGITS = "0123456789ABCDEF";
|
|
13082
|
+
for (let i = 0;i < 256; i++) {
|
|
13083
|
+
BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
|
|
13084
|
+
}
|
|
13085
|
+
}
|
|
13086
|
+
function percentEncodeNonAscii(cp) {
|
|
13087
|
+
if (cp < 2048) {
|
|
13088
|
+
return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
|
|
13089
|
+
}
|
|
13090
|
+
if (cp < 65536) {
|
|
13091
|
+
return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
13092
|
+
}
|
|
13093
|
+
return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
|
|
13094
|
+
}
|
|
12971
13095
|
function stringArrayToHexStripped(input) {
|
|
12972
13096
|
let acc = "";
|
|
12973
13097
|
let code = 0;
|
|
@@ -12992,91 +13116,122 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
12992
13116
|
}
|
|
12993
13117
|
return acc;
|
|
12994
13118
|
}
|
|
13119
|
+
var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
|
|
13120
|
+
var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
|
|
13121
|
+
var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
|
|
12995
13122
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
12996
|
-
function
|
|
12997
|
-
|
|
12998
|
-
|
|
12999
|
-
|
|
13000
|
-
|
|
13001
|
-
|
|
13002
|
-
|
|
13003
|
-
|
|
13004
|
-
|
|
13005
|
-
} else {
|
|
13006
|
-
output.error = true;
|
|
13007
|
-
return false;
|
|
13123
|
+
function isZoneIdentifier(zone) {
|
|
13124
|
+
if (zone.length === 0)
|
|
13125
|
+
return false;
|
|
13126
|
+
for (let i = 0;i < zone.length; i++) {
|
|
13127
|
+
if (isZoneCharacter(zone[i]))
|
|
13128
|
+
continue;
|
|
13129
|
+
if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
|
|
13130
|
+
i += 2;
|
|
13131
|
+
continue;
|
|
13008
13132
|
}
|
|
13009
|
-
|
|
13133
|
+
return false;
|
|
13010
13134
|
}
|
|
13011
13135
|
return true;
|
|
13012
13136
|
}
|
|
13013
|
-
function
|
|
13014
|
-
let
|
|
13015
|
-
|
|
13016
|
-
|
|
13017
|
-
|
|
13018
|
-
let
|
|
13019
|
-
|
|
13020
|
-
|
|
13021
|
-
|
|
13022
|
-
|
|
13023
|
-
|
|
13024
|
-
|
|
13025
|
-
|
|
13026
|
-
if (cursor === ":") {
|
|
13027
|
-
if (endipv6Encountered === true) {
|
|
13028
|
-
endIpv6 = true;
|
|
13029
|
-
}
|
|
13030
|
-
if (!consume(buffer, address, output)) {
|
|
13031
|
-
break;
|
|
13032
|
-
}
|
|
13033
|
-
if (++tokenCount > 7) {
|
|
13034
|
-
output.error = true;
|
|
13035
|
-
break;
|
|
13036
|
-
}
|
|
13037
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
13038
|
-
endipv6Encountered = true;
|
|
13039
|
-
}
|
|
13040
|
-
address.push(":");
|
|
13041
|
-
continue;
|
|
13042
|
-
} else if (cursor === "%") {
|
|
13043
|
-
if (!consume(buffer, address, output)) {
|
|
13044
|
-
break;
|
|
13137
|
+
function compressIPv6ZeroRun(hextets) {
|
|
13138
|
+
let bestStart = -1;
|
|
13139
|
+
let bestLength = 0;
|
|
13140
|
+
let runStart = -1;
|
|
13141
|
+
let runLength = 0;
|
|
13142
|
+
for (let i = 0;i < hextets.length; i++) {
|
|
13143
|
+
if (hextets[i] === "0") {
|
|
13144
|
+
if (runStart === -1)
|
|
13145
|
+
runStart = i;
|
|
13146
|
+
runLength++;
|
|
13147
|
+
if (runLength > bestLength) {
|
|
13148
|
+
bestLength = runLength;
|
|
13149
|
+
bestStart = runStart;
|
|
13045
13150
|
}
|
|
13046
|
-
consume = consumeIsZone;
|
|
13047
13151
|
} else {
|
|
13048
|
-
|
|
13049
|
-
|
|
13152
|
+
runStart = -1;
|
|
13153
|
+
runLength = 0;
|
|
13050
13154
|
}
|
|
13051
13155
|
}
|
|
13052
|
-
if (
|
|
13053
|
-
|
|
13054
|
-
|
|
13055
|
-
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13156
|
+
if (bestLength < 2)
|
|
13157
|
+
return hextets.join(":");
|
|
13158
|
+
const head = hextets.slice(0, bestStart).join(":");
|
|
13159
|
+
const tail = hextets.slice(bestStart + bestLength).join(":");
|
|
13160
|
+
return head + "::" + tail;
|
|
13161
|
+
}
|
|
13162
|
+
function normalizeIPv6Address(input) {
|
|
13163
|
+
const compression = input.indexOf("::");
|
|
13164
|
+
if (compression !== -1 && input.indexOf("::", compression + 1) !== -1)
|
|
13165
|
+
return;
|
|
13166
|
+
const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
|
|
13167
|
+
const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
|
|
13168
|
+
if (compression !== -1) {
|
|
13169
|
+
if (left.length === 1 && left[0] === "")
|
|
13170
|
+
left.length = 0;
|
|
13171
|
+
if (right.length === 1 && right[0] === "")
|
|
13172
|
+
right.length = 0;
|
|
13173
|
+
}
|
|
13174
|
+
const parts = left.concat(right);
|
|
13175
|
+
let hextetCount = 0;
|
|
13176
|
+
for (let i = 0;i < parts.length; i++) {
|
|
13177
|
+
const part = parts[i];
|
|
13178
|
+
if (part === "")
|
|
13179
|
+
return;
|
|
13180
|
+
if (part.indexOf(".") !== -1) {
|
|
13181
|
+
if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part))
|
|
13182
|
+
return;
|
|
13183
|
+
hextetCount += 2;
|
|
13184
|
+
continue;
|
|
13059
13185
|
}
|
|
13186
|
+
if (!isHextet(part))
|
|
13187
|
+
return;
|
|
13188
|
+
parts[i] = parseInt(part, 16).toString(16);
|
|
13189
|
+
hextetCount++;
|
|
13060
13190
|
}
|
|
13061
|
-
|
|
13062
|
-
|
|
13191
|
+
if (compression === -1) {
|
|
13192
|
+
if (hextetCount !== 8)
|
|
13193
|
+
return;
|
|
13194
|
+
return compressIPv6ZeroRun(parts);
|
|
13195
|
+
}
|
|
13196
|
+
if (hextetCount >= 8)
|
|
13197
|
+
return;
|
|
13198
|
+
const expanded = parts.slice(0, left.length);
|
|
13199
|
+
for (let i = hextetCount;i < 8; i++)
|
|
13200
|
+
expanded.push("0");
|
|
13201
|
+
for (let i = left.length;i < parts.length; i++)
|
|
13202
|
+
expanded.push(parts[i]);
|
|
13203
|
+
return compressIPv6ZeroRun(expanded);
|
|
13063
13204
|
}
|
|
13064
13205
|
function normalizeIPv6(host) {
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
}
|
|
13076
|
-
|
|
13077
|
-
|
|
13078
|
-
|
|
13079
|
-
|
|
13206
|
+
const bracketed = host[0] === "[" && host[host.length - 1] === "]";
|
|
13207
|
+
const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
|
|
13208
|
+
if (hasBracket && !bracketed)
|
|
13209
|
+
return { host, isIPV6: false, error: true };
|
|
13210
|
+
let input = bracketed ? host.slice(1, -1) : host;
|
|
13211
|
+
if (bracketed && isIPvFuture(input)) {
|
|
13212
|
+
input = input.toLowerCase();
|
|
13213
|
+
return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
|
|
13214
|
+
}
|
|
13215
|
+
if (findToken(input, ":") < 2) {
|
|
13216
|
+
return { host, isIPV6: false, error: bracketed };
|
|
13217
|
+
}
|
|
13218
|
+
let zoneIdentifier = "";
|
|
13219
|
+
const zoneSeparator = input.indexOf("%");
|
|
13220
|
+
if (zoneSeparator !== -1) {
|
|
13221
|
+
const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
|
|
13222
|
+
zoneIdentifier = input.slice(zoneSeparator + separatorLength);
|
|
13223
|
+
if (!isZoneIdentifier(zoneIdentifier))
|
|
13224
|
+
return { host, isIPV6: false, error: true };
|
|
13225
|
+
input = input.slice(0, zoneSeparator);
|
|
13226
|
+
}
|
|
13227
|
+
const address = normalizeIPv6Address(input);
|
|
13228
|
+
if (address === undefined)
|
|
13229
|
+
return { host, isIPV6: false, error: true };
|
|
13230
|
+
return {
|
|
13231
|
+
host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
|
|
13232
|
+
escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
|
|
13233
|
+
isIPV6: true
|
|
13234
|
+
};
|
|
13080
13235
|
}
|
|
13081
13236
|
function findToken(str, token) {
|
|
13082
13237
|
let ind = 0;
|
|
@@ -13196,7 +13351,8 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13196
13351
|
function normalizePathEncoding(input) {
|
|
13197
13352
|
let output = "";
|
|
13198
13353
|
for (let i = 0;i < input.length; i++) {
|
|
13199
|
-
|
|
13354
|
+
const ch = input[i];
|
|
13355
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
13200
13356
|
const hex = input.slice(i + 1, i + 3);
|
|
13201
13357
|
if (isHexPair(hex)) {
|
|
13202
13358
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -13210,10 +13366,152 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13210
13366
|
continue;
|
|
13211
13367
|
}
|
|
13212
13368
|
}
|
|
13213
|
-
if (isPathCharacter(
|
|
13214
|
-
output +=
|
|
13369
|
+
if (isPathCharacter(ch)) {
|
|
13370
|
+
output += ch;
|
|
13371
|
+
} else {
|
|
13372
|
+
const code = input.charCodeAt(i);
|
|
13373
|
+
if (code < 128) {
|
|
13374
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
13375
|
+
} else if (code < 55296 || code > 57343) {
|
|
13376
|
+
output += percentEncodeNonAscii(code);
|
|
13377
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
13378
|
+
const low = input.charCodeAt(i + 1);
|
|
13379
|
+
if (low >= 56320 && low <= 57343) {
|
|
13380
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
13381
|
+
i++;
|
|
13382
|
+
} else {
|
|
13383
|
+
output += percentEncodeNonAscii(65533);
|
|
13384
|
+
}
|
|
13385
|
+
} else {
|
|
13386
|
+
output += percentEncodeNonAscii(65533);
|
|
13387
|
+
}
|
|
13388
|
+
}
|
|
13389
|
+
}
|
|
13390
|
+
return output;
|
|
13391
|
+
}
|
|
13392
|
+
function serializePathEncoding(input, pathNoScheme = false) {
|
|
13393
|
+
let output = "";
|
|
13394
|
+
let firstSegment = pathNoScheme && input[0] !== "/";
|
|
13395
|
+
for (let i = 0;i < input.length; i++) {
|
|
13396
|
+
const ch = input[i];
|
|
13397
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
13398
|
+
const hex = input.slice(i + 1, i + 3);
|
|
13399
|
+
if (isHexPair(hex)) {
|
|
13400
|
+
output += "%" + hex.toUpperCase();
|
|
13401
|
+
i += 2;
|
|
13402
|
+
continue;
|
|
13403
|
+
}
|
|
13404
|
+
}
|
|
13405
|
+
if (ch === "/") {
|
|
13406
|
+
firstSegment = false;
|
|
13407
|
+
}
|
|
13408
|
+
if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
|
|
13409
|
+
output += ch;
|
|
13215
13410
|
} else {
|
|
13216
|
-
|
|
13411
|
+
const code = input.charCodeAt(i);
|
|
13412
|
+
if (code < 128) {
|
|
13413
|
+
output += BYTE_HEX[code];
|
|
13414
|
+
} else if (code < 55296 || code > 57343) {
|
|
13415
|
+
output += percentEncodeNonAscii(code);
|
|
13416
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
13417
|
+
const low = input.charCodeAt(i + 1);
|
|
13418
|
+
if (low >= 56320 && low <= 57343) {
|
|
13419
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
13420
|
+
i++;
|
|
13421
|
+
} else {
|
|
13422
|
+
output += percentEncodeNonAscii(65533);
|
|
13423
|
+
}
|
|
13424
|
+
} else {
|
|
13425
|
+
output += percentEncodeNonAscii(65533);
|
|
13426
|
+
}
|
|
13427
|
+
}
|
|
13428
|
+
}
|
|
13429
|
+
return output;
|
|
13430
|
+
}
|
|
13431
|
+
function encodeComponent(input, isAllowed) {
|
|
13432
|
+
let output = "";
|
|
13433
|
+
for (let i = 0;i < input.length; i++) {
|
|
13434
|
+
const ch = input[i];
|
|
13435
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
13436
|
+
const hex = input.slice(i + 1, i + 3);
|
|
13437
|
+
if (isHexPair(hex)) {
|
|
13438
|
+
output += "%" + hex.toUpperCase();
|
|
13439
|
+
i += 2;
|
|
13440
|
+
continue;
|
|
13441
|
+
}
|
|
13442
|
+
}
|
|
13443
|
+
if (isAllowed(ch)) {
|
|
13444
|
+
output += ch;
|
|
13445
|
+
} else {
|
|
13446
|
+
const code = input.charCodeAt(i);
|
|
13447
|
+
if (code < 128) {
|
|
13448
|
+
output += BYTE_HEX[code];
|
|
13449
|
+
} else if (code < 55296 || code > 57343) {
|
|
13450
|
+
output += percentEncodeNonAscii(code);
|
|
13451
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
13452
|
+
const low = input.charCodeAt(i + 1);
|
|
13453
|
+
if (low >= 56320 && low <= 57343) {
|
|
13454
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
13455
|
+
i++;
|
|
13456
|
+
} else {
|
|
13457
|
+
output += percentEncodeNonAscii(65533);
|
|
13458
|
+
}
|
|
13459
|
+
} else {
|
|
13460
|
+
output += percentEncodeNonAscii(65533);
|
|
13461
|
+
}
|
|
13462
|
+
}
|
|
13463
|
+
}
|
|
13464
|
+
return output;
|
|
13465
|
+
}
|
|
13466
|
+
function encodeUserinfo(input) {
|
|
13467
|
+
return encodeComponent(input, isUserinfoCharacter);
|
|
13468
|
+
}
|
|
13469
|
+
function encodeQuery(input) {
|
|
13470
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
13471
|
+
}
|
|
13472
|
+
function encodeFragment(input) {
|
|
13473
|
+
return encodeComponent(input, isQueryFragmentCharacter);
|
|
13474
|
+
}
|
|
13475
|
+
function isEscapeSafe(cp) {
|
|
13476
|
+
return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
|
|
13477
|
+
}
|
|
13478
|
+
function normalizeQueryFragmentEncoding(input) {
|
|
13479
|
+
let output = "";
|
|
13480
|
+
for (let i = 0;i < input.length; i++) {
|
|
13481
|
+
const ch = input[i];
|
|
13482
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
13483
|
+
const hex = input.slice(i + 1, i + 3);
|
|
13484
|
+
if (isHexPair(hex)) {
|
|
13485
|
+
const normalizedHex = hex.toUpperCase();
|
|
13486
|
+
const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
|
|
13487
|
+
if (isUnreserved(decoded)) {
|
|
13488
|
+
output += decoded;
|
|
13489
|
+
} else {
|
|
13490
|
+
output += "%" + normalizedHex;
|
|
13491
|
+
}
|
|
13492
|
+
i += 2;
|
|
13493
|
+
continue;
|
|
13494
|
+
}
|
|
13495
|
+
}
|
|
13496
|
+
if (isQueryFragmentCharacter(ch)) {
|
|
13497
|
+
output += ch;
|
|
13498
|
+
} else {
|
|
13499
|
+
const code = input.charCodeAt(i);
|
|
13500
|
+
if (code < 128) {
|
|
13501
|
+
output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
|
|
13502
|
+
} else if (code < 55296 || code > 57343) {
|
|
13503
|
+
output += percentEncodeNonAscii(code);
|
|
13504
|
+
} else if (code <= 56319 && i + 1 < input.length) {
|
|
13505
|
+
const low = input.charCodeAt(i + 1);
|
|
13506
|
+
if (low >= 56320 && low <= 57343) {
|
|
13507
|
+
output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
|
|
13508
|
+
i++;
|
|
13509
|
+
} else {
|
|
13510
|
+
output += percentEncodeNonAscii(65533);
|
|
13511
|
+
}
|
|
13512
|
+
} else {
|
|
13513
|
+
output += percentEncodeNonAscii(65533);
|
|
13514
|
+
}
|
|
13217
13515
|
}
|
|
13218
13516
|
}
|
|
13219
13517
|
return output;
|
|
@@ -13236,14 +13534,18 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13236
13534
|
function recomposeAuthority(component) {
|
|
13237
13535
|
const uriTokens = [];
|
|
13238
13536
|
if (component.userinfo !== undefined) {
|
|
13239
|
-
uriTokens.push(component.userinfo);
|
|
13537
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
13240
13538
|
uriTokens.push("@");
|
|
13241
13539
|
}
|
|
13242
13540
|
if (component.host !== undefined) {
|
|
13243
|
-
let host =
|
|
13541
|
+
let host = component.host;
|
|
13244
13542
|
if (!isIPv4(host)) {
|
|
13245
|
-
|
|
13246
|
-
if (ipV6res.isIPV6
|
|
13543
|
+
let ipV6res = normalizeIPv6(host);
|
|
13544
|
+
if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
|
|
13545
|
+
host = normalizePercentEncoding(host, true);
|
|
13546
|
+
ipV6res = normalizeIPv6(host);
|
|
13547
|
+
}
|
|
13548
|
+
if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
|
|
13247
13549
|
host = `[${ipV6res.escapedHost}]`;
|
|
13248
13550
|
} else {
|
|
13249
13551
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -13252,8 +13554,12 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13252
13554
|
uriTokens.push(host);
|
|
13253
13555
|
}
|
|
13254
13556
|
if (typeof component.port === "number" || typeof component.port === "string") {
|
|
13557
|
+
const port = String(component.port);
|
|
13558
|
+
if (!isPort(port)) {
|
|
13559
|
+
throw new TypeError("URI port is malformed.");
|
|
13560
|
+
}
|
|
13255
13561
|
uriTokens.push(":");
|
|
13256
|
-
uriTokens.push(
|
|
13562
|
+
uriTokens.push(port);
|
|
13257
13563
|
}
|
|
13258
13564
|
return uriTokens.length ? uriTokens.join("") : undefined;
|
|
13259
13565
|
}
|
|
@@ -13263,6 +13569,11 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13263
13569
|
reescapeHostDelimiters,
|
|
13264
13570
|
normalizePercentEncoding,
|
|
13265
13571
|
normalizePathEncoding,
|
|
13572
|
+
serializePathEncoding,
|
|
13573
|
+
normalizeQueryFragmentEncoding,
|
|
13574
|
+
encodeUserinfo,
|
|
13575
|
+
encodeQuery,
|
|
13576
|
+
encodeFragment,
|
|
13266
13577
|
escapePreservingEscapes,
|
|
13267
13578
|
removeDotSegments,
|
|
13268
13579
|
isIPv4,
|
|
@@ -13272,10 +13583,10 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13272
13583
|
};
|
|
13273
13584
|
});
|
|
13274
13585
|
|
|
13275
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13586
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/schemes.js
|
|
13276
13587
|
var require_schemes = __commonJS((exports, module) => {
|
|
13277
13588
|
var { isUUID } = require_utils();
|
|
13278
|
-
var URN_REG =
|
|
13589
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
13279
13590
|
var supportedSchemeNames = [
|
|
13280
13591
|
"http",
|
|
13281
13592
|
"https",
|
|
@@ -13330,9 +13641,10 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13330
13641
|
wsComponent.secure = undefined;
|
|
13331
13642
|
}
|
|
13332
13643
|
if (wsComponent.resourceName) {
|
|
13333
|
-
const
|
|
13644
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
13645
|
+
const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
13334
13646
|
wsComponent.path = path && path !== "/" ? path : undefined;
|
|
13335
|
-
wsComponent.query =
|
|
13647
|
+
wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
|
|
13336
13648
|
wsComponent.resourceName = undefined;
|
|
13337
13649
|
}
|
|
13338
13650
|
wsComponent.fragment = undefined;
|
|
@@ -13344,7 +13656,7 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13344
13656
|
return urnComponent;
|
|
13345
13657
|
}
|
|
13346
13658
|
const matches = urnComponent.path.match(URN_REG);
|
|
13347
|
-
if (matches) {
|
|
13659
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
13348
13660
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
13349
13661
|
urnComponent.nid = matches[1].toLowerCase();
|
|
13350
13662
|
urnComponent.nss = matches[2];
|
|
@@ -13446,10 +13758,19 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13446
13758
|
};
|
|
13447
13759
|
});
|
|
13448
13760
|
|
|
13449
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13761
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/index.js
|
|
13450
13762
|
var require_fast_uri = __commonJS((exports, module) => {
|
|
13451
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
13763
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
13452
13764
|
var { SCHEMES, getSchemeHandler } = require_schemes();
|
|
13765
|
+
var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
|
|
13766
|
+
var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
|
|
13767
|
+
function decodeValidScheme(scheme) {
|
|
13768
|
+
const decodedScheme = unescape(String(scheme));
|
|
13769
|
+
if (!VALID_SCHEME.test(decodedScheme)) {
|
|
13770
|
+
throw new TypeError(MALFORMED_SCHEME_ERROR);
|
|
13771
|
+
}
|
|
13772
|
+
return decodedScheme;
|
|
13773
|
+
}
|
|
13453
13774
|
function normalize(uri, options) {
|
|
13454
13775
|
if (typeof uri === "string") {
|
|
13455
13776
|
uri = normalizeString(uri, options);
|
|
@@ -13458,14 +13779,36 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13458
13779
|
}
|
|
13459
13780
|
return uri;
|
|
13460
13781
|
}
|
|
13461
|
-
function
|
|
13782
|
+
function resolve2(baseURI, relativeURI, options) {
|
|
13462
13783
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
13463
|
-
const {
|
|
13464
|
-
|
|
13465
|
-
|
|
13784
|
+
const {
|
|
13785
|
+
parsed: baseParsed,
|
|
13786
|
+
malformedAuthorityOrPort: baseMalformed,
|
|
13787
|
+
malformedPercentEncoding: baseMalformedPercentEncoding,
|
|
13788
|
+
malformedSchemeSpecific: baseMalformedSchemeSpecific,
|
|
13789
|
+
malformedHost: baseMalformedHost,
|
|
13790
|
+
malformedScheme: baseMalformedScheme
|
|
13791
|
+
} = parseWithStatus(baseURI, schemelessOptions);
|
|
13792
|
+
const {
|
|
13793
|
+
parsed: relativeParsed,
|
|
13794
|
+
malformedAuthorityOrPort: relativeMalformed,
|
|
13795
|
+
malformedPercentEncoding: relativeMalformedPercentEncoding,
|
|
13796
|
+
malformedSchemeSpecific: relativeMalformedSchemeSpecific,
|
|
13797
|
+
malformedHost: relativeMalformedHost,
|
|
13798
|
+
malformedScheme: relativeMalformedScheme
|
|
13799
|
+
} = parseWithStatus(relativeURI, schemelessOptions);
|
|
13800
|
+
if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
|
|
13466
13801
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
13467
13802
|
}
|
|
13468
13803
|
const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
|
|
13804
|
+
const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
|
|
13805
|
+
const resolvedHost = resolved.host;
|
|
13806
|
+
const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
|
|
13807
|
+
canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
|
|
13808
|
+
const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
|
|
13809
|
+
if (resolved.error && !encodedASCIIHost) {
|
|
13810
|
+
throw new Error(resolved.error);
|
|
13811
|
+
}
|
|
13469
13812
|
schemelessOptions.skipEscape = true;
|
|
13470
13813
|
return serialize(resolved, schemelessOptions);
|
|
13471
13814
|
}
|
|
@@ -13525,7 +13868,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13525
13868
|
function equal(uriA, uriB, options) {
|
|
13526
13869
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
13527
13870
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
13528
|
-
return normalizedA !== undefined && normalizedB !== undefined && normalizedA
|
|
13871
|
+
return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB;
|
|
13529
13872
|
}
|
|
13530
13873
|
function serialize(cmpts, opts) {
|
|
13531
13874
|
const component = {
|
|
@@ -13546,20 +13889,23 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13546
13889
|
};
|
|
13547
13890
|
const options = Object.assign({}, opts);
|
|
13548
13891
|
const uriTokens = [];
|
|
13892
|
+
if (component.scheme) {
|
|
13893
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
13894
|
+
}
|
|
13549
13895
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
13550
13896
|
if (schemeHandler && schemeHandler.serialize)
|
|
13551
13897
|
schemeHandler.serialize(component, options);
|
|
13898
|
+
const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
|
|
13899
|
+
const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority;
|
|
13552
13900
|
if (component.path !== undefined) {
|
|
13553
13901
|
if (!options.skipEscape) {
|
|
13554
|
-
component.path =
|
|
13555
|
-
if (component.scheme !== undefined) {
|
|
13556
|
-
component.path = component.path.split("%3A").join(":");
|
|
13557
|
-
}
|
|
13902
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
13558
13903
|
} else {
|
|
13559
13904
|
component.path = normalizePercentEncoding(component.path);
|
|
13560
13905
|
}
|
|
13561
13906
|
}
|
|
13562
13907
|
if (options.reference !== "suffix" && component.scheme) {
|
|
13908
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
13563
13909
|
uriTokens.push(component.scheme, ":");
|
|
13564
13910
|
}
|
|
13565
13911
|
const authority = recomposeAuthority(component);
|
|
@@ -13577,16 +13923,19 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13577
13923
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
13578
13924
|
s = removeDotSegments(s);
|
|
13579
13925
|
}
|
|
13926
|
+
if (pathNoScheme) {
|
|
13927
|
+
s = serializePathEncoding(s, true);
|
|
13928
|
+
}
|
|
13580
13929
|
if (authority === undefined && s[0] === "/" && s[1] === "/") {
|
|
13581
13930
|
s = "/%2F" + s.slice(2);
|
|
13582
13931
|
}
|
|
13583
13932
|
uriTokens.push(s);
|
|
13584
13933
|
}
|
|
13585
13934
|
if (component.query !== undefined) {
|
|
13586
|
-
uriTokens.push("?", component.query);
|
|
13935
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
13587
13936
|
}
|
|
13588
13937
|
if (component.fragment !== undefined) {
|
|
13589
|
-
uriTokens.push("#", component.fragment);
|
|
13938
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
13590
13939
|
}
|
|
13591
13940
|
return uriTokens.join("");
|
|
13592
13941
|
}
|
|
@@ -13602,6 +13951,36 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13602
13951
|
}
|
|
13603
13952
|
return;
|
|
13604
13953
|
}
|
|
13954
|
+
function hasMalformedPercentEncoding(component) {
|
|
13955
|
+
if (component === undefined)
|
|
13956
|
+
return false;
|
|
13957
|
+
let percent = component.indexOf("%");
|
|
13958
|
+
while (percent !== -1) {
|
|
13959
|
+
if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
|
|
13960
|
+
return true;
|
|
13961
|
+
}
|
|
13962
|
+
percent = component.indexOf("%", percent + 3);
|
|
13963
|
+
}
|
|
13964
|
+
return false;
|
|
13965
|
+
}
|
|
13966
|
+
function isIPLiteral(host) {
|
|
13967
|
+
return host[0] === "[" && host[host.length - 1] === "]";
|
|
13968
|
+
}
|
|
13969
|
+
function hasMalformedComponentPercentEncoding(matches) {
|
|
13970
|
+
const host = matches[4];
|
|
13971
|
+
return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
|
|
13972
|
+
}
|
|
13973
|
+
function canonicalizeHost(parsed, options, schemeHandler, isIP) {
|
|
13974
|
+
if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
|
|
13975
|
+
try {
|
|
13976
|
+
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
13977
|
+
} catch (e) {
|
|
13978
|
+
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
13979
|
+
return true;
|
|
13980
|
+
}
|
|
13981
|
+
}
|
|
13982
|
+
return false;
|
|
13983
|
+
}
|
|
13605
13984
|
function parseWithStatus(uri, opts) {
|
|
13606
13985
|
const options = Object.assign({}, opts);
|
|
13607
13986
|
const parsed = {
|
|
@@ -13614,6 +13993,11 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13614
13993
|
fragment: undefined
|
|
13615
13994
|
};
|
|
13616
13995
|
let malformedAuthorityOrPort = false;
|
|
13996
|
+
let malformedPercentEncoding = false;
|
|
13997
|
+
let malformedSchemeSpecific = false;
|
|
13998
|
+
let malformedHost = false;
|
|
13999
|
+
let malformedIPLiteral = false;
|
|
14000
|
+
let malformedScheme = false;
|
|
13617
14001
|
let isIP = false;
|
|
13618
14002
|
if (options.reference === "suffix") {
|
|
13619
14003
|
if (options.scheme) {
|
|
@@ -13650,6 +14034,19 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13650
14034
|
parsed.path = matches[6] || "";
|
|
13651
14035
|
parsed.query = matches[7];
|
|
13652
14036
|
parsed.fragment = matches[8];
|
|
14037
|
+
if (parsed.scheme !== undefined) {
|
|
14038
|
+
const decodedScheme = unescape(parsed.scheme);
|
|
14039
|
+
if (VALID_SCHEME.test(decodedScheme)) {
|
|
14040
|
+
parsed.scheme = decodedScheme.toLowerCase();
|
|
14041
|
+
} else {
|
|
14042
|
+
parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
|
|
14043
|
+
malformedScheme = true;
|
|
14044
|
+
}
|
|
14045
|
+
}
|
|
14046
|
+
malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
|
|
14047
|
+
if (malformedPercentEncoding) {
|
|
14048
|
+
parsed.error = parsed.error || "URI contains malformed percent-encoding.";
|
|
14049
|
+
}
|
|
13653
14050
|
if (isNaN(parsed.port)) {
|
|
13654
14051
|
parsed.port = matches[5];
|
|
13655
14052
|
}
|
|
@@ -13661,9 +14058,16 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13661
14058
|
if (parsed.host) {
|
|
13662
14059
|
const ipv4result = isIPv4(parsed.host);
|
|
13663
14060
|
if (ipv4result === false) {
|
|
14061
|
+
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
14062
|
+
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
13664
14063
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
13665
|
-
|
|
13666
|
-
|
|
14064
|
+
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
14065
|
+
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
14066
|
+
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
14067
|
+
if (malformedIPLiteral) {
|
|
14068
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
14069
|
+
malformedAuthorityOrPort = true;
|
|
14070
|
+
}
|
|
13667
14071
|
} else {
|
|
13668
14072
|
isIP = true;
|
|
13669
14073
|
}
|
|
@@ -13681,42 +14085,36 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13681
14085
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
13682
14086
|
}
|
|
13683
14087
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
13684
|
-
if (!
|
|
13685
|
-
|
|
13686
|
-
try {
|
|
13687
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
13688
|
-
} catch (e) {
|
|
13689
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
13690
|
-
}
|
|
13691
|
-
}
|
|
14088
|
+
if (!malformedIPLiteral) {
|
|
14089
|
+
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
13692
14090
|
}
|
|
13693
14091
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
13694
14092
|
if (uri.indexOf("%") !== -1) {
|
|
13695
|
-
if (parsed.
|
|
13696
|
-
parsed.
|
|
13697
|
-
|
|
13698
|
-
if (parsed.host !== undefined) {
|
|
13699
|
-
parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
|
|
14093
|
+
if (parsed.host !== undefined && !malformedIPLiteral) {
|
|
14094
|
+
const host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
|
|
14095
|
+
parsed.host = reescapeHostDelimiters(host, isIP);
|
|
13700
14096
|
}
|
|
13701
14097
|
}
|
|
13702
14098
|
if (parsed.path) {
|
|
13703
14099
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
13704
14100
|
}
|
|
14101
|
+
if (parsed.query) {
|
|
14102
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
14103
|
+
}
|
|
13705
14104
|
if (parsed.fragment) {
|
|
13706
|
-
|
|
13707
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
13708
|
-
} catch {
|
|
13709
|
-
parsed.error = parsed.error || "URI malformed";
|
|
13710
|
-
}
|
|
14105
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
13711
14106
|
}
|
|
13712
14107
|
}
|
|
13713
14108
|
if (schemeHandler && schemeHandler.parse) {
|
|
13714
14109
|
schemeHandler.parse(parsed, options);
|
|
14110
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {
|
|
14111
|
+
malformedSchemeSpecific = true;
|
|
14112
|
+
}
|
|
13715
14113
|
}
|
|
13716
14114
|
} else {
|
|
13717
14115
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
13718
14116
|
}
|
|
13719
|
-
return { parsed, malformedAuthorityOrPort };
|
|
14117
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
13720
14118
|
}
|
|
13721
14119
|
function parse6(uri, opts) {
|
|
13722
14120
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -13725,25 +14123,33 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13725
14123
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
13726
14124
|
}
|
|
13727
14125
|
function normalizeStringWithStatus(uri, opts) {
|
|
13728
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
14126
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
13729
14127
|
return {
|
|
13730
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
13731
|
-
malformedAuthorityOrPort
|
|
14128
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
|
|
14129
|
+
malformedAuthorityOrPort,
|
|
14130
|
+
malformedPercentEncoding,
|
|
14131
|
+
malformedSchemeSpecific,
|
|
14132
|
+
malformedHost,
|
|
14133
|
+
malformedScheme
|
|
13732
14134
|
};
|
|
13733
14135
|
}
|
|
13734
14136
|
function normalizeComparableURI(uri, opts) {
|
|
13735
|
-
if (typeof uri
|
|
13736
|
-
|
|
13737
|
-
return malformedAuthorityOrPort ? undefined : normalized;
|
|
14137
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
14138
|
+
return;
|
|
13738
14139
|
}
|
|
13739
|
-
|
|
13740
|
-
|
|
14140
|
+
let value;
|
|
14141
|
+
try {
|
|
14142
|
+
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
14143
|
+
} catch {
|
|
14144
|
+
return;
|
|
13741
14145
|
}
|
|
14146
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
14147
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
|
|
13742
14148
|
}
|
|
13743
14149
|
var fastUri = {
|
|
13744
14150
|
SCHEMES,
|
|
13745
14151
|
normalize,
|
|
13746
|
-
resolve,
|
|
14152
|
+
resolve: resolve2,
|
|
13747
14153
|
resolveComponent,
|
|
13748
14154
|
equal,
|
|
13749
14155
|
serialize,
|
|
@@ -16613,709 +17019,8 @@ var init_usage = __esm(() => {
|
|
|
16613
17019
|
init_database();
|
|
16614
17020
|
});
|
|
16615
17021
|
|
|
16616
|
-
// ../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
16617
|
-
import fs from "fs";
|
|
16618
|
-
function hasDockerEnv() {
|
|
16619
|
-
try {
|
|
16620
|
-
fs.statSync("/.dockerenv");
|
|
16621
|
-
return true;
|
|
16622
|
-
} catch {
|
|
16623
|
-
return false;
|
|
16624
|
-
}
|
|
16625
|
-
}
|
|
16626
|
-
function hasDockerCGroup() {
|
|
16627
|
-
try {
|
|
16628
|
-
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
16629
|
-
} catch {
|
|
16630
|
-
return false;
|
|
16631
|
-
}
|
|
16632
|
-
}
|
|
16633
|
-
function isDocker() {
|
|
16634
|
-
if (isDockerCached === undefined) {
|
|
16635
|
-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
16636
|
-
}
|
|
16637
|
-
return isDockerCached;
|
|
16638
|
-
}
|
|
16639
|
-
var isDockerCached;
|
|
16640
|
-
var init_is_docker = () => {};
|
|
16641
|
-
|
|
16642
|
-
// ../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
16643
|
-
import fs2 from "fs";
|
|
16644
|
-
function isInsideContainer() {
|
|
16645
|
-
if (cachedResult === undefined) {
|
|
16646
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
16647
|
-
}
|
|
16648
|
-
return cachedResult;
|
|
16649
|
-
}
|
|
16650
|
-
var cachedResult, hasContainerEnv = () => {
|
|
16651
|
-
try {
|
|
16652
|
-
fs2.statSync("/run/.containerenv");
|
|
16653
|
-
return true;
|
|
16654
|
-
} catch {
|
|
16655
|
-
return false;
|
|
16656
|
-
}
|
|
16657
|
-
};
|
|
16658
|
-
var init_is_inside_container = __esm(() => {
|
|
16659
|
-
init_is_docker();
|
|
16660
|
-
});
|
|
16661
|
-
|
|
16662
|
-
// ../../node_modules/.bun/is-wsl@3.1.1/node_modules/is-wsl/index.js
|
|
16663
|
-
import process2 from "process";
|
|
16664
|
-
import os from "os";
|
|
16665
|
-
import fs3 from "fs";
|
|
16666
|
-
var isWsl = () => {
|
|
16667
|
-
if (process2.platform !== "linux") {
|
|
16668
|
-
return false;
|
|
16669
|
-
}
|
|
16670
|
-
if (os.release().toLowerCase().includes("microsoft")) {
|
|
16671
|
-
if (isInsideContainer()) {
|
|
16672
|
-
return false;
|
|
16673
|
-
}
|
|
16674
|
-
return true;
|
|
16675
|
-
}
|
|
16676
|
-
try {
|
|
16677
|
-
if (fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
|
|
16678
|
-
return !isInsideContainer();
|
|
16679
|
-
}
|
|
16680
|
-
} catch {}
|
|
16681
|
-
if (fs3.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs3.existsSync("/run/WSL")) {
|
|
16682
|
-
return !isInsideContainer();
|
|
16683
|
-
}
|
|
16684
|
-
return false;
|
|
16685
|
-
}, is_wsl_default;
|
|
16686
|
-
var init_is_wsl = __esm(() => {
|
|
16687
|
-
init_is_inside_container();
|
|
16688
|
-
is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
16689
|
-
});
|
|
16690
|
-
|
|
16691
|
-
// ../../node_modules/.bun/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
16692
|
-
import process3 from "process";
|
|
16693
|
-
import { Buffer as Buffer3 } from "buffer";
|
|
16694
|
-
import { promisify } from "util";
|
|
16695
|
-
import childProcess from "child_process";
|
|
16696
|
-
var execFile, powerShellPath = () => `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (command, options = {}) => {
|
|
16697
|
-
const {
|
|
16698
|
-
powerShellPath: psPath,
|
|
16699
|
-
...execFileOptions
|
|
16700
|
-
} = options;
|
|
16701
|
-
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
16702
|
-
return execFile(psPath ?? powerShellPath(), [
|
|
16703
|
-
...executePowerShell.argumentsPrefix,
|
|
16704
|
-
encodedCommand
|
|
16705
|
-
], {
|
|
16706
|
-
encoding: "utf8",
|
|
16707
|
-
...execFileOptions
|
|
16708
|
-
});
|
|
16709
|
-
};
|
|
16710
|
-
var init_powershell_utils = __esm(() => {
|
|
16711
|
-
execFile = promisify(childProcess.execFile);
|
|
16712
|
-
executePowerShell.argumentsPrefix = [
|
|
16713
|
-
"-NoProfile",
|
|
16714
|
-
"-NonInteractive",
|
|
16715
|
-
"-ExecutionPolicy",
|
|
16716
|
-
"Bypass",
|
|
16717
|
-
"-EncodedCommand"
|
|
16718
|
-
];
|
|
16719
|
-
executePowerShell.encodeCommand = (command) => Buffer3.from(command, "utf16le").toString("base64");
|
|
16720
|
-
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
16721
|
-
});
|
|
16722
|
-
|
|
16723
|
-
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/utilities.js
|
|
16724
|
-
function parseMountPointFromConfig(content) {
|
|
16725
|
-
for (const line of content.split(`
|
|
16726
|
-
`)) {
|
|
16727
|
-
if (/^\s*#/.test(line)) {
|
|
16728
|
-
continue;
|
|
16729
|
-
}
|
|
16730
|
-
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
16731
|
-
if (!match) {
|
|
16732
|
-
continue;
|
|
16733
|
-
}
|
|
16734
|
-
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
16735
|
-
}
|
|
16736
|
-
}
|
|
16737
|
-
|
|
16738
|
-
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/index.js
|
|
16739
|
-
import path from "path";
|
|
16740
|
-
import { promisify as promisify2 } from "util";
|
|
16741
|
-
import childProcess2 from "child_process";
|
|
16742
|
-
import fs4, { constants as fsConstants } from "fs/promises";
|
|
16743
|
-
var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
16744
|
-
const mountPoint = await wslDrivesMountPoint();
|
|
16745
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
16746
|
-
}, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell = async () => {
|
|
16747
|
-
canAccessPowerShellPromise ??= (async () => {
|
|
16748
|
-
try {
|
|
16749
|
-
const psPath = await powerShellPath2();
|
|
16750
|
-
await fs4.access(psPath, fsConstants.X_OK);
|
|
16751
|
-
return true;
|
|
16752
|
-
} catch {
|
|
16753
|
-
return false;
|
|
16754
|
-
}
|
|
16755
|
-
})();
|
|
16756
|
-
return canAccessPowerShellPromise;
|
|
16757
|
-
}, wslDefaultBrowser = async () => {
|
|
16758
|
-
const psPath = await powerShellPath2();
|
|
16759
|
-
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
16760
|
-
const { stdout } = await executePowerShell(command, {
|
|
16761
|
-
powerShellPath: psPath,
|
|
16762
|
-
cwd: path.dirname(psPath)
|
|
16763
|
-
});
|
|
16764
|
-
return stdout.trim();
|
|
16765
|
-
}, isUrl = (path2) => /^[a-z]+:\/\//i.test(path2), convertWslPathToWindows = async (paths) => {
|
|
16766
|
-
const isBatch = Array.isArray(paths);
|
|
16767
|
-
const pathArray = isBatch ? paths : [paths];
|
|
16768
|
-
const indicesToConvert = [];
|
|
16769
|
-
const pathsToConvert = [];
|
|
16770
|
-
for (const [index, path2] of pathArray.entries()) {
|
|
16771
|
-
if (!isUrl(path2)) {
|
|
16772
|
-
indicesToConvert.push(index);
|
|
16773
|
-
pathsToConvert.push(path2);
|
|
16774
|
-
}
|
|
16775
|
-
}
|
|
16776
|
-
const results = [...pathArray];
|
|
16777
|
-
if (pathsToConvert.length > 0) {
|
|
16778
|
-
try {
|
|
16779
|
-
const { stdout } = await execFile2("wslpath", ["-aw", ...pathsToConvert], { encoding: "utf8" });
|
|
16780
|
-
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
16781
|
-
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
16782
|
-
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
16783
|
-
}
|
|
16784
|
-
} catch {}
|
|
16785
|
-
}
|
|
16786
|
-
return isBatch ? results : results[0];
|
|
16787
|
-
};
|
|
16788
|
-
var init_wsl_utils = __esm(() => {
|
|
16789
|
-
init_is_wsl();
|
|
16790
|
-
init_powershell_utils();
|
|
16791
|
-
init_is_wsl();
|
|
16792
|
-
execFile2 = promisify2(childProcess2.execFile);
|
|
16793
|
-
wslDrivesMountPoint = (() => {
|
|
16794
|
-
const defaultMountPoint = "/mnt/";
|
|
16795
|
-
let mountPoint;
|
|
16796
|
-
return async function() {
|
|
16797
|
-
if (mountPoint) {
|
|
16798
|
-
return mountPoint;
|
|
16799
|
-
}
|
|
16800
|
-
const configFilePath = "/etc/wsl.conf";
|
|
16801
|
-
let isConfigFileExists = false;
|
|
16802
|
-
try {
|
|
16803
|
-
await fs4.access(configFilePath, fsConstants.F_OK);
|
|
16804
|
-
isConfigFileExists = true;
|
|
16805
|
-
} catch {}
|
|
16806
|
-
if (!isConfigFileExists) {
|
|
16807
|
-
return defaultMountPoint;
|
|
16808
|
-
}
|
|
16809
|
-
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
|
|
16810
|
-
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
16811
|
-
if (parsedMountPoint === undefined) {
|
|
16812
|
-
return defaultMountPoint;
|
|
16813
|
-
}
|
|
16814
|
-
mountPoint = parsedMountPoint;
|
|
16815
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
16816
|
-
return mountPoint;
|
|
16817
|
-
};
|
|
16818
|
-
})();
|
|
16819
|
-
powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
16820
|
-
});
|
|
16821
|
-
|
|
16822
|
-
// ../../node_modules/.bun/powershell-utils@0.2.0/node_modules/powershell-utils/index.js
|
|
16823
|
-
import process4 from "process";
|
|
16824
|
-
import { Buffer as Buffer4 } from "buffer";
|
|
16825
|
-
import { promisify as promisify3 } from "util";
|
|
16826
|
-
import childProcess3 from "child_process";
|
|
16827
|
-
var execFile3, powerShellPath3 = () => `${process4.env.SYSTEMROOT || process4.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, argumentsPrefix, encodeCommand = (command) => Buffer4.from(command, "utf16le").toString("base64"), escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`, createArguments = (command) => [...argumentsPrefix, encodeCommand(command)], executePowerShell2 = async (command, options = {}) => {
|
|
16828
|
-
const {
|
|
16829
|
-
powerShellPath: psPath,
|
|
16830
|
-
...execFileOptions
|
|
16831
|
-
} = options;
|
|
16832
|
-
return execFile3(psPath ?? powerShellPath3(), createArguments(command), {
|
|
16833
|
-
encoding: "utf8",
|
|
16834
|
-
...execFileOptions
|
|
16835
|
-
});
|
|
16836
|
-
};
|
|
16837
|
-
var init_powershell_utils2 = __esm(() => {
|
|
16838
|
-
execFile3 = promisify3(childProcess3.execFile);
|
|
16839
|
-
argumentsPrefix = [
|
|
16840
|
-
"-NoProfile",
|
|
16841
|
-
"-NonInteractive",
|
|
16842
|
-
"-ExecutionPolicy",
|
|
16843
|
-
"Bypass",
|
|
16844
|
-
"-EncodedCommand"
|
|
16845
|
-
];
|
|
16846
|
-
executePowerShell2.argumentsPrefix = argumentsPrefix;
|
|
16847
|
-
executePowerShell2.encodeCommand = encodeCommand;
|
|
16848
|
-
executePowerShell2.escapeArgument = escapeArgument;
|
|
16849
|
-
executePowerShell2.createArguments = createArguments;
|
|
16850
|
-
});
|
|
16851
|
-
|
|
16852
|
-
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
16853
|
-
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
16854
|
-
const define = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
16855
|
-
Object.defineProperty(object4, propertyName, {
|
|
16856
|
-
configurable: true,
|
|
16857
|
-
enumerable: true,
|
|
16858
|
-
get() {
|
|
16859
|
-
const result = valueGetter();
|
|
16860
|
-
define(result);
|
|
16861
|
-
return result;
|
|
16862
|
-
},
|
|
16863
|
-
set(value) {
|
|
16864
|
-
define(value);
|
|
16865
|
-
}
|
|
16866
|
-
});
|
|
16867
|
-
return object4;
|
|
16868
|
-
}
|
|
16869
|
-
|
|
16870
|
-
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
16871
|
-
import { promisify as promisify4 } from "util";
|
|
16872
|
-
import process5 from "process";
|
|
16873
|
-
import { execFile as execFile4 } from "child_process";
|
|
16874
|
-
async function defaultBrowserId() {
|
|
16875
|
-
if (process5.platform !== "darwin") {
|
|
16876
|
-
throw new Error("macOS only");
|
|
16877
|
-
}
|
|
16878
|
-
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
16879
|
-
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
16880
|
-
const browserId = match?.groups.id ?? "com.apple.Safari";
|
|
16881
|
-
if (browserId === "com.apple.safari") {
|
|
16882
|
-
return "com.apple.Safari";
|
|
16883
|
-
}
|
|
16884
|
-
return browserId;
|
|
16885
|
-
}
|
|
16886
|
-
var execFileAsync;
|
|
16887
|
-
var init_default_browser_id = __esm(() => {
|
|
16888
|
-
execFileAsync = promisify4(execFile4);
|
|
16889
|
-
});
|
|
16890
|
-
|
|
16891
|
-
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
16892
|
-
import process6 from "process";
|
|
16893
|
-
import { promisify as promisify5 } from "util";
|
|
16894
|
-
import { execFile as execFile5, execFileSync } from "child_process";
|
|
16895
|
-
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
16896
|
-
if (process6.platform !== "darwin") {
|
|
16897
|
-
throw new Error("macOS only");
|
|
16898
|
-
}
|
|
16899
|
-
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
16900
|
-
const execOptions = {};
|
|
16901
|
-
if (signal) {
|
|
16902
|
-
execOptions.signal = signal;
|
|
16903
|
-
}
|
|
16904
|
-
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
16905
|
-
return stdout.trim();
|
|
16906
|
-
}
|
|
16907
|
-
var execFileAsync2;
|
|
16908
|
-
var init_run_applescript = __esm(() => {
|
|
16909
|
-
execFileAsync2 = promisify5(execFile5);
|
|
16910
|
-
});
|
|
16911
|
-
|
|
16912
|
-
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
16913
|
-
async function bundleName(bundleId) {
|
|
16914
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
16915
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
16916
|
-
}
|
|
16917
|
-
var init_bundle_name = __esm(() => {
|
|
16918
|
-
init_run_applescript();
|
|
16919
|
-
});
|
|
16920
|
-
|
|
16921
|
-
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/windows.js
|
|
16922
|
-
import process7 from "process";
|
|
16923
|
-
import { promisify as promisify6 } from "util";
|
|
16924
|
-
import { execFile as execFile6 } from "child_process";
|
|
16925
|
-
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
16926
|
-
const regPath = `${process7.env.SYSTEMROOT ?? process7.env.windir ?? "C:\\Windows"}\\System32\\reg.exe`;
|
|
16927
|
-
const { stdout } = await _execFileAsync(regPath, [
|
|
16928
|
-
"QUERY",
|
|
16929
|
-
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
16930
|
-
"/v",
|
|
16931
|
-
"ProgId"
|
|
16932
|
-
]);
|
|
16933
|
-
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
16934
|
-
if (!match) {
|
|
16935
|
-
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
16936
|
-
}
|
|
16937
|
-
const { id } = match.groups;
|
|
16938
|
-
const dotIndex = id.lastIndexOf(".");
|
|
16939
|
-
const hyphenIndex = id.lastIndexOf("-");
|
|
16940
|
-
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
16941
|
-
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
16942
|
-
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
16943
|
-
}
|
|
16944
|
-
var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
16945
|
-
var init_windows = __esm(() => {
|
|
16946
|
-
execFileAsync3 = promisify6(execFile6);
|
|
16947
|
-
windowsBrowserProgIds = {
|
|
16948
|
-
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
16949
|
-
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
16950
|
-
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
16951
|
-
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
16952
|
-
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
16953
|
-
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
16954
|
-
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
16955
|
-
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
16956
|
-
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
16957
|
-
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
16958
|
-
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
16959
|
-
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
16960
|
-
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
16961
|
-
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
16962
|
-
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
16963
|
-
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
16964
|
-
};
|
|
16965
|
-
_windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
16966
|
-
UnknownBrowserError = class UnknownBrowserError extends Error {
|
|
16967
|
-
};
|
|
16968
|
-
});
|
|
16969
|
-
|
|
16970
|
-
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/index.js
|
|
16971
|
-
import { promisify as promisify7 } from "util";
|
|
16972
|
-
import process8 from "process";
|
|
16973
|
-
import { execFile as execFile7 } from "child_process";
|
|
16974
|
-
async function defaultBrowser2() {
|
|
16975
|
-
if (process8.platform === "darwin") {
|
|
16976
|
-
const id = await defaultBrowserId();
|
|
16977
|
-
const name = await bundleName(id);
|
|
16978
|
-
return { name, id };
|
|
16979
|
-
}
|
|
16980
|
-
if (process8.platform === "linux") {
|
|
16981
|
-
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
16982
|
-
const id = stdout.trim();
|
|
16983
|
-
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
16984
|
-
return { name, id };
|
|
16985
|
-
}
|
|
16986
|
-
if (process8.platform === "win32") {
|
|
16987
|
-
return defaultBrowser();
|
|
16988
|
-
}
|
|
16989
|
-
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
16990
|
-
}
|
|
16991
|
-
var execFileAsync4, titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
16992
|
-
var init_default_browser = __esm(() => {
|
|
16993
|
-
init_default_browser_id();
|
|
16994
|
-
init_bundle_name();
|
|
16995
|
-
init_windows();
|
|
16996
|
-
init_windows();
|
|
16997
|
-
execFileAsync4 = promisify7(execFile7);
|
|
16998
|
-
});
|
|
16999
|
-
|
|
17000
|
-
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
17001
|
-
import process9 from "process";
|
|
17002
|
-
var isInSsh, is_in_ssh_default;
|
|
17003
|
-
var init_is_in_ssh = __esm(() => {
|
|
17004
|
-
isInSsh = Boolean(process9.env.SSH_CONNECTION || process9.env.SSH_CLIENT || process9.env.SSH_TTY);
|
|
17005
|
-
is_in_ssh_default = isInSsh;
|
|
17006
|
-
});
|
|
17007
|
-
|
|
17008
|
-
// ../../node_modules/.bun/open@11.0.1/node_modules/open/index.js
|
|
17009
|
-
import process10 from "process";
|
|
17010
|
-
import path2 from "path";
|
|
17011
|
-
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
17012
|
-
import childProcess4 from "child_process";
|
|
17013
|
-
import fs5, { constants as fsConstants2 } from "fs/promises";
|
|
17014
|
-
function detectArchBinary(binary) {
|
|
17015
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
17016
|
-
return binary;
|
|
17017
|
-
}
|
|
17018
|
-
const { [arch]: archBinary } = binary;
|
|
17019
|
-
if (!archBinary) {
|
|
17020
|
-
throw new Error(`${arch} is not supported`);
|
|
17021
|
-
}
|
|
17022
|
-
return archBinary;
|
|
17023
|
-
}
|
|
17024
|
-
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
17025
|
-
if (wsl && is_wsl_default) {
|
|
17026
|
-
return detectArchBinary(wsl);
|
|
17027
|
-
}
|
|
17028
|
-
if (!platformBinary) {
|
|
17029
|
-
throw new Error(`${platform} is not supported`);
|
|
17030
|
-
}
|
|
17031
|
-
return detectArchBinary(platformBinary);
|
|
17032
|
-
}
|
|
17033
|
-
var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEachApp = async (apps, opener) => {
|
|
17034
|
-
if (apps.length === 0) {
|
|
17035
|
-
return;
|
|
17036
|
-
}
|
|
17037
|
-
const errors4 = [];
|
|
17038
|
-
for (const app of apps) {
|
|
17039
|
-
try {
|
|
17040
|
-
return await opener(app);
|
|
17041
|
-
} catch (error2) {
|
|
17042
|
-
errors4.push(error2);
|
|
17043
|
-
}
|
|
17044
|
-
}
|
|
17045
|
-
throw new AggregateError(errors4, "Failed to open in all supported apps");
|
|
17046
|
-
}, baseOpen = async (options) => {
|
|
17047
|
-
options = {
|
|
17048
|
-
wait: false,
|
|
17049
|
-
background: false,
|
|
17050
|
-
newInstance: false,
|
|
17051
|
-
allowNonzeroExitCode: false,
|
|
17052
|
-
...options
|
|
17053
|
-
};
|
|
17054
|
-
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
17055
|
-
delete options[fallbackAttemptSymbol];
|
|
17056
|
-
if (Array.isArray(options.app)) {
|
|
17057
|
-
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
17058
|
-
...options,
|
|
17059
|
-
app: singleApp,
|
|
17060
|
-
[fallbackAttemptSymbol]: true
|
|
17061
|
-
}));
|
|
17062
|
-
}
|
|
17063
|
-
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
17064
|
-
appArguments = [...appArguments];
|
|
17065
|
-
if (Array.isArray(app)) {
|
|
17066
|
-
return tryEachApp(app, (appName) => baseOpen({
|
|
17067
|
-
...options,
|
|
17068
|
-
app: {
|
|
17069
|
-
name: appName,
|
|
17070
|
-
arguments: appArguments
|
|
17071
|
-
},
|
|
17072
|
-
[fallbackAttemptSymbol]: true
|
|
17073
|
-
}));
|
|
17074
|
-
}
|
|
17075
|
-
if (app === "browser" || app === "browserPrivate") {
|
|
17076
|
-
const ids = {
|
|
17077
|
-
"com.google.chrome": "chrome",
|
|
17078
|
-
"google-chrome.desktop": "chrome",
|
|
17079
|
-
"com.brave.browser": "brave",
|
|
17080
|
-
"org.mozilla.firefox": "firefox",
|
|
17081
|
-
"firefox.desktop": "firefox",
|
|
17082
|
-
"com.microsoft.msedge": "edge",
|
|
17083
|
-
"com.microsoft.edge": "edge",
|
|
17084
|
-
"com.microsoft.edgemac": "edge",
|
|
17085
|
-
"microsoft-edge.desktop": "edge",
|
|
17086
|
-
"com.apple.safari": "safari"
|
|
17087
|
-
};
|
|
17088
|
-
const flags = {
|
|
17089
|
-
chrome: "--incognito",
|
|
17090
|
-
brave: "--incognito",
|
|
17091
|
-
firefox: "--private-window",
|
|
17092
|
-
edge: "--inPrivate"
|
|
17093
|
-
};
|
|
17094
|
-
let browser;
|
|
17095
|
-
if (is_wsl_default) {
|
|
17096
|
-
const progId = await wslDefaultBrowser();
|
|
17097
|
-
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
17098
|
-
browser = browserInfo ?? {};
|
|
17099
|
-
} else {
|
|
17100
|
-
browser = await defaultBrowser2();
|
|
17101
|
-
}
|
|
17102
|
-
if (browser.id in ids) {
|
|
17103
|
-
const browserName = ids[browser.id.toLowerCase()];
|
|
17104
|
-
if (app === "browserPrivate") {
|
|
17105
|
-
if (browserName === "safari") {
|
|
17106
|
-
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
17107
|
-
}
|
|
17108
|
-
appArguments.push(flags[browserName]);
|
|
17109
|
-
}
|
|
17110
|
-
return baseOpen({
|
|
17111
|
-
...options,
|
|
17112
|
-
app: {
|
|
17113
|
-
name: apps[browserName],
|
|
17114
|
-
arguments: appArguments
|
|
17115
|
-
}
|
|
17116
|
-
});
|
|
17117
|
-
}
|
|
17118
|
-
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
17119
|
-
}
|
|
17120
|
-
let command;
|
|
17121
|
-
const cliArguments = [];
|
|
17122
|
-
const childProcessOptions = {};
|
|
17123
|
-
let shouldUseWindowsInWsl = false;
|
|
17124
|
-
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
17125
|
-
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
17126
|
-
}
|
|
17127
|
-
if (platform === "darwin") {
|
|
17128
|
-
command = "open";
|
|
17129
|
-
if (options.wait) {
|
|
17130
|
-
cliArguments.push("--wait-apps");
|
|
17131
|
-
}
|
|
17132
|
-
if (options.background) {
|
|
17133
|
-
cliArguments.push("--background");
|
|
17134
|
-
}
|
|
17135
|
-
if (options.newInstance) {
|
|
17136
|
-
cliArguments.push("--new");
|
|
17137
|
-
}
|
|
17138
|
-
if (app) {
|
|
17139
|
-
cliArguments.push("-a", app);
|
|
17140
|
-
}
|
|
17141
|
-
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
17142
|
-
command = await powerShellPath2();
|
|
17143
|
-
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
17144
|
-
if (!is_wsl_default) {
|
|
17145
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
17146
|
-
}
|
|
17147
|
-
if (is_wsl_default && options.target) {
|
|
17148
|
-
options.target = await convertWslPathToWindows(options.target);
|
|
17149
|
-
}
|
|
17150
|
-
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
17151
|
-
if (options.wait) {
|
|
17152
|
-
encodedArguments.push("-Wait");
|
|
17153
|
-
}
|
|
17154
|
-
if (app) {
|
|
17155
|
-
encodedArguments.push(executePowerShell2.escapeArgument(app));
|
|
17156
|
-
if (options.target) {
|
|
17157
|
-
appArguments.push(options.target);
|
|
17158
|
-
}
|
|
17159
|
-
} else if (options.target) {
|
|
17160
|
-
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
17161
|
-
}
|
|
17162
|
-
if (appArguments.length > 0) {
|
|
17163
|
-
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
17164
|
-
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
17165
|
-
}
|
|
17166
|
-
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
17167
|
-
if (!options.wait) {
|
|
17168
|
-
childProcessOptions.stdio = "ignore";
|
|
17169
|
-
}
|
|
17170
|
-
if (is_wsl_default) {
|
|
17171
|
-
childProcessOptions.cwd = path2.dirname(command);
|
|
17172
|
-
}
|
|
17173
|
-
} else {
|
|
17174
|
-
if (app) {
|
|
17175
|
-
command = app;
|
|
17176
|
-
} else {
|
|
17177
|
-
const isBundled = !__dirname6 || __dirname6 === "/";
|
|
17178
|
-
let exeLocalXdgOpen = false;
|
|
17179
|
-
try {
|
|
17180
|
-
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
17181
|
-
exeLocalXdgOpen = true;
|
|
17182
|
-
} catch {}
|
|
17183
|
-
const useSystemXdgOpen = process10.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
17184
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
17185
|
-
}
|
|
17186
|
-
if (appArguments.length > 0) {
|
|
17187
|
-
cliArguments.push(...appArguments);
|
|
17188
|
-
}
|
|
17189
|
-
if (!options.wait) {
|
|
17190
|
-
childProcessOptions.stdio = "ignore";
|
|
17191
|
-
childProcessOptions.detached = true;
|
|
17192
|
-
}
|
|
17193
|
-
}
|
|
17194
|
-
if (platform === "darwin" && appArguments.length > 0) {
|
|
17195
|
-
cliArguments.push("--args", ...appArguments);
|
|
17196
|
-
}
|
|
17197
|
-
if (options.target) {
|
|
17198
|
-
cliArguments.push(options.target);
|
|
17199
|
-
}
|
|
17200
|
-
const subprocess = childProcess4.spawn(command, cliArguments, childProcessOptions);
|
|
17201
|
-
if (options.wait) {
|
|
17202
|
-
return new Promise((resolve, reject) => {
|
|
17203
|
-
subprocess.once("error", reject);
|
|
17204
|
-
subprocess.once("close", (exitCode) => {
|
|
17205
|
-
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
17206
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
17207
|
-
return;
|
|
17208
|
-
}
|
|
17209
|
-
resolve(subprocess);
|
|
17210
|
-
});
|
|
17211
|
-
});
|
|
17212
|
-
}
|
|
17213
|
-
if (isFallbackAttempt) {
|
|
17214
|
-
return new Promise((resolve, reject) => {
|
|
17215
|
-
subprocess.once("error", reject);
|
|
17216
|
-
subprocess.once("spawn", () => {
|
|
17217
|
-
subprocess.once("close", (exitCode) => {
|
|
17218
|
-
subprocess.off("error", reject);
|
|
17219
|
-
if (exitCode !== 0) {
|
|
17220
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
17221
|
-
return;
|
|
17222
|
-
}
|
|
17223
|
-
subprocess.unref();
|
|
17224
|
-
resolve(subprocess);
|
|
17225
|
-
});
|
|
17226
|
-
});
|
|
17227
|
-
});
|
|
17228
|
-
}
|
|
17229
|
-
subprocess.unref();
|
|
17230
|
-
return new Promise((resolve, reject) => {
|
|
17231
|
-
subprocess.once("error", reject);
|
|
17232
|
-
subprocess.once("spawn", () => {
|
|
17233
|
-
subprocess.off("error", reject);
|
|
17234
|
-
resolve(subprocess);
|
|
17235
|
-
});
|
|
17236
|
-
});
|
|
17237
|
-
}, open = (target, options) => {
|
|
17238
|
-
if (typeof target !== "string") {
|
|
17239
|
-
throw new TypeError("Expected a `target`");
|
|
17240
|
-
}
|
|
17241
|
-
return baseOpen({
|
|
17242
|
-
...options,
|
|
17243
|
-
target
|
|
17244
|
-
});
|
|
17245
|
-
}, apps, open_default;
|
|
17246
|
-
var init_open = __esm(() => {
|
|
17247
|
-
init_wsl_utils();
|
|
17248
|
-
init_powershell_utils2();
|
|
17249
|
-
init_default_browser();
|
|
17250
|
-
init_is_inside_container();
|
|
17251
|
-
init_is_in_ssh();
|
|
17252
|
-
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
17253
|
-
__dirname6 = import.meta.url ? path2.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
17254
|
-
localXdgOpenPath = path2.join(__dirname6, "xdg-open");
|
|
17255
|
-
({ platform, arch } = process10);
|
|
17256
|
-
apps = {
|
|
17257
|
-
browser: "browser",
|
|
17258
|
-
browserPrivate: "browserPrivate"
|
|
17259
|
-
};
|
|
17260
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
17261
|
-
darwin: "google chrome",
|
|
17262
|
-
win32: "chrome",
|
|
17263
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
17264
|
-
}, {
|
|
17265
|
-
wsl: {
|
|
17266
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
17267
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
17268
|
-
}
|
|
17269
|
-
}));
|
|
17270
|
-
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
17271
|
-
darwin: "brave browser",
|
|
17272
|
-
win32: "brave",
|
|
17273
|
-
linux: ["brave-browser", "brave"]
|
|
17274
|
-
}, {
|
|
17275
|
-
wsl: {
|
|
17276
|
-
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
17277
|
-
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
17278
|
-
}
|
|
17279
|
-
}));
|
|
17280
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
17281
|
-
darwin: "firefox",
|
|
17282
|
-
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
17283
|
-
linux: "firefox"
|
|
17284
|
-
}, {
|
|
17285
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
17286
|
-
}));
|
|
17287
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
17288
|
-
darwin: "microsoft edge",
|
|
17289
|
-
win32: "msedge",
|
|
17290
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
17291
|
-
}, {
|
|
17292
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
17293
|
-
}));
|
|
17294
|
-
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
17295
|
-
darwin: "Safari"
|
|
17296
|
-
}));
|
|
17297
|
-
open_default = open;
|
|
17298
|
-
});
|
|
17299
|
-
|
|
17300
|
-
// src/lib/open-browser.ts
|
|
17301
|
-
var exports_open_browser = {};
|
|
17302
|
-
__export(exports_open_browser, {
|
|
17303
|
-
openBrowser: () => openBrowser
|
|
17304
|
-
});
|
|
17305
|
-
async function openBrowser(url) {
|
|
17306
|
-
try {
|
|
17307
|
-
await open_default(url);
|
|
17308
|
-
return { ok: true };
|
|
17309
|
-
} catch (error2) {
|
|
17310
|
-
return { ok: false, error: error2 };
|
|
17311
|
-
}
|
|
17312
|
-
}
|
|
17313
|
-
var init_open_browser = __esm(() => {
|
|
17314
|
-
init_open();
|
|
17315
|
-
});
|
|
17316
|
-
|
|
17317
17022
|
// src/server/serve.ts
|
|
17318
|
-
import { existsSync as
|
|
17023
|
+
import { existsSync as existsSync17, readdirSync as readdirSync9, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync10 } from "fs";
|
|
17319
17024
|
|
|
17320
17025
|
// src/db/agents.ts
|
|
17321
17026
|
init_database();
|
|
@@ -17507,7 +17212,7 @@ init_strip();
|
|
|
17507
17212
|
import { spawn as nodeSpawn } from "child_process";
|
|
17508
17213
|
var spawnImpl = nodeSpawn;
|
|
17509
17214
|
async function runStep(step, previousOutput) {
|
|
17510
|
-
return new Promise((
|
|
17215
|
+
return new Promise((resolve2) => {
|
|
17511
17216
|
const args = [...step.args ?? []];
|
|
17512
17217
|
if (previousOutput && previousOutput.trim()) {
|
|
17513
17218
|
args.push("--input", previousOutput.trim().slice(0, 4096));
|
|
@@ -17521,11 +17226,11 @@ async function runStep(step, previousOutput) {
|
|
|
17521
17226
|
proc.stderr.on("data", (d) => {
|
|
17522
17227
|
output += d.toString();
|
|
17523
17228
|
});
|
|
17524
|
-
proc.on("close", (code) =>
|
|
17525
|
-
proc.on("error", () =>
|
|
17229
|
+
proc.on("close", (code) => resolve2({ exitCode: code ?? 1, output }));
|
|
17230
|
+
proc.on("error", () => resolve2({ exitCode: 1, output: "Failed to spawn connectors" }));
|
|
17526
17231
|
setTimeout(() => {
|
|
17527
17232
|
proc.kill();
|
|
17528
|
-
|
|
17233
|
+
resolve2({ exitCode: 124, output: output + `
|
|
17529
17234
|
[timeout]` });
|
|
17530
17235
|
}, 60000);
|
|
17531
17236
|
});
|
|
@@ -17556,13 +17261,12 @@ async function runWorkflow(workflow) {
|
|
|
17556
17261
|
|
|
17557
17262
|
// src/server/serve.ts
|
|
17558
17263
|
init_database();
|
|
17559
|
-
import { join as
|
|
17560
|
-
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
17264
|
+
import { join as join16, basename as basename3 } from "path";
|
|
17561
17265
|
|
|
17562
17266
|
// src/lib/registry.ts
|
|
17563
17267
|
init_builtins();
|
|
17564
|
-
import { existsSync as
|
|
17565
|
-
import { join as
|
|
17268
|
+
import { existsSync as existsSync10, readFileSync as readFileSync5 } from "fs";
|
|
17269
|
+
import { join as join10, dirname as dirname4 } from "path";
|
|
17566
17270
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
17567
17271
|
|
|
17568
17272
|
// src/lib/fuzzy.ts
|
|
@@ -25995,16 +25699,16 @@ function loadConnectorVersions() {
|
|
|
25995
25699
|
versionsLoaded = true;
|
|
25996
25700
|
const thisDir = dirname4(fileURLToPath3(import.meta.url));
|
|
25997
25701
|
const candidates = [
|
|
25998
|
-
|
|
25999
|
-
|
|
25702
|
+
join10(thisDir, "..", "connectors"),
|
|
25703
|
+
join10(thisDir, "..", "..", "connectors")
|
|
26000
25704
|
];
|
|
26001
|
-
const connectorsDir = candidates.find((d) =>
|
|
25705
|
+
const connectorsDir = candidates.find((d) => existsSync10(d));
|
|
26002
25706
|
if (!connectorsDir)
|
|
26003
25707
|
return;
|
|
26004
25708
|
for (const connector of CONNECTORS) {
|
|
26005
25709
|
try {
|
|
26006
|
-
const pkgPath =
|
|
26007
|
-
if (
|
|
25710
|
+
const pkgPath = join10(getConnectorPackagePath(connectorsDir, connector.name), "package.json");
|
|
25711
|
+
if (existsSync10(pkgPath)) {
|
|
26008
25712
|
const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
|
|
26009
25713
|
connector.version = pkg.version || "0.0.0";
|
|
26010
25714
|
continue;
|
|
@@ -26099,7 +25803,7 @@ async function getConnectorCapabilityManifest(options = {}) {
|
|
|
26099
25803
|
// src/server/serve.ts
|
|
26100
25804
|
init_auth();
|
|
26101
25805
|
|
|
26102
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
|
|
25806
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/mediaType.js
|
|
26103
25807
|
var import_content_type = __toESM(require_content_type(), 1);
|
|
26104
25808
|
function mediaTypeEssence(header) {
|
|
26105
25809
|
if (!header) {
|
|
@@ -26122,7 +25826,7 @@ function isJsonContentType(header) {
|
|
|
26122
25826
|
return mediaTypeEssence(header) === "application/json";
|
|
26123
25827
|
}
|
|
26124
25828
|
|
|
26125
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js
|
|
25829
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/sseKeepAlive.js
|
|
26126
25830
|
var DEFAULT_SSE_KEEP_ALIVE_MS = 15000;
|
|
26127
25831
|
var MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
26128
25832
|
function armSseKeepAlive(intervalMs, onTick) {
|
|
@@ -30589,7 +30293,7 @@ function preprocess(fn, schema) {
|
|
|
30589
30293
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
30590
30294
|
config(en_default2());
|
|
30591
30295
|
|
|
30592
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
30296
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
30593
30297
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
30594
30298
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
30595
30299
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -31436,7 +31140,7 @@ class UrlElicitationRequiredError extends McpError {
|
|
|
31436
31140
|
}
|
|
31437
31141
|
}
|
|
31438
31142
|
|
|
31439
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
|
|
31143
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/webStandardStreamableHttp.js
|
|
31440
31144
|
class WebStandardStreamableHTTPServerTransport {
|
|
31441
31145
|
constructor(options = {}) {
|
|
31442
31146
|
this._started = false;
|
|
@@ -31835,9 +31539,9 @@ data:
|
|
|
31835
31539
|
const initRequest = messages.find((m) => isInitializeRequest(m));
|
|
31836
31540
|
const clientProtocolVersion = initRequest ? initRequest.params.protocolVersion : req.headers.get("mcp-protocol-version") ?? DEFAULT_NEGOTIATED_PROTOCOL_VERSION;
|
|
31837
31541
|
if (this._enableJsonResponse) {
|
|
31838
|
-
return new Promise((
|
|
31542
|
+
return new Promise((resolve2) => {
|
|
31839
31543
|
this._streamMapping.set(streamId, {
|
|
31840
|
-
resolveJson:
|
|
31544
|
+
resolveJson: resolve2,
|
|
31841
31545
|
cleanup: () => {
|
|
31842
31546
|
this._streamMapping.delete(streamId);
|
|
31843
31547
|
}
|
|
@@ -32134,7 +31838,7 @@ function object2(shape, params) {
|
|
|
32134
31838
|
};
|
|
32135
31839
|
return new ZodMiniObject(def);
|
|
32136
31840
|
}
|
|
32137
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
31841
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js
|
|
32138
31842
|
function isZ4Schema(s) {
|
|
32139
31843
|
const schema = s;
|
|
32140
31844
|
return !!schema._zod;
|
|
@@ -32295,7 +31999,7 @@ function getLiteralValue(schema) {
|
|
|
32295
31999
|
return;
|
|
32296
32000
|
}
|
|
32297
32001
|
|
|
32298
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
32002
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
|
|
32299
32003
|
function isTerminal(status) {
|
|
32300
32004
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
32301
32005
|
}
|
|
@@ -33536,7 +33240,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
33536
33240
|
}
|
|
33537
33241
|
return combined;
|
|
33538
33242
|
};
|
|
33539
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
33243
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js
|
|
33540
33244
|
function mapMiniTarget(t) {
|
|
33541
33245
|
if (!t)
|
|
33542
33246
|
return "draft-7";
|
|
@@ -33578,7 +33282,7 @@ function parseWithCompat(schema, data) {
|
|
|
33578
33282
|
return result.data;
|
|
33579
33283
|
}
|
|
33580
33284
|
|
|
33581
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
33285
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js
|
|
33582
33286
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
33583
33287
|
|
|
33584
33288
|
class Protocol {
|
|
@@ -34040,7 +33744,7 @@ class Protocol {
|
|
|
34040
33744
|
return;
|
|
34041
33745
|
}
|
|
34042
33746
|
const pollInterval = task2.pollInterval ?? this._options?.defaultTaskPollInterval ?? 1000;
|
|
34043
|
-
await new Promise((
|
|
33747
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
34044
33748
|
options?.signal?.throwIfAborted();
|
|
34045
33749
|
}
|
|
34046
33750
|
} catch (error2) {
|
|
@@ -34052,7 +33756,7 @@ class Protocol {
|
|
|
34052
33756
|
}
|
|
34053
33757
|
request(request2, resultSchema, options) {
|
|
34054
33758
|
const { relatedRequestId, resumptionToken, onresumptiontoken, task, relatedTask } = options ?? {};
|
|
34055
|
-
return new Promise((
|
|
33759
|
+
return new Promise((resolve2, reject) => {
|
|
34056
33760
|
const earlyReject = (error2) => {
|
|
34057
33761
|
reject(error2);
|
|
34058
33762
|
};
|
|
@@ -34130,7 +33834,7 @@ class Protocol {
|
|
|
34130
33834
|
if (!parseResult.success) {
|
|
34131
33835
|
reject(parseResult.error);
|
|
34132
33836
|
} else {
|
|
34133
|
-
|
|
33837
|
+
resolve2(parseResult.data);
|
|
34134
33838
|
}
|
|
34135
33839
|
} catch (error2) {
|
|
34136
33840
|
reject(error2);
|
|
@@ -34321,12 +34025,12 @@ class Protocol {
|
|
|
34321
34025
|
interval = task.pollInterval;
|
|
34322
34026
|
}
|
|
34323
34027
|
} catch {}
|
|
34324
|
-
return new Promise((
|
|
34028
|
+
return new Promise((resolve2, reject) => {
|
|
34325
34029
|
if (signal.aborted) {
|
|
34326
34030
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
34327
34031
|
return;
|
|
34328
34032
|
}
|
|
34329
|
-
const timeoutId = setTimeout(
|
|
34033
|
+
const timeoutId = setTimeout(resolve2, interval);
|
|
34330
34034
|
signal.addEventListener("abort", () => {
|
|
34331
34035
|
clearTimeout(timeoutId);
|
|
34332
34036
|
reject(new McpError(ErrorCode.InvalidRequest, "Request cancelled"));
|
|
@@ -34419,7 +34123,7 @@ function mergeCapabilities(base, additional) {
|
|
|
34419
34123
|
return result;
|
|
34420
34124
|
}
|
|
34421
34125
|
|
|
34422
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
34126
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js
|
|
34423
34127
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
34424
34128
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
34425
34129
|
function createDefaultAjvInstance() {
|
|
@@ -34459,7 +34163,7 @@ class AjvJsonSchemaValidator {
|
|
|
34459
34163
|
}
|
|
34460
34164
|
}
|
|
34461
34165
|
|
|
34462
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
34166
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js
|
|
34463
34167
|
class ExperimentalServerTasks {
|
|
34464
34168
|
constructor(_server) {
|
|
34465
34169
|
this._server = _server;
|
|
@@ -34537,7 +34241,7 @@ class ExperimentalServerTasks {
|
|
|
34537
34241
|
}
|
|
34538
34242
|
}
|
|
34539
34243
|
|
|
34540
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
34244
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js
|
|
34541
34245
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
34542
34246
|
if (!requests) {
|
|
34543
34247
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -34572,7 +34276,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
34572
34276
|
}
|
|
34573
34277
|
}
|
|
34574
34278
|
|
|
34575
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
34279
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js
|
|
34576
34280
|
class Server extends Protocol {
|
|
34577
34281
|
constructor(_serverInfo, options) {
|
|
34578
34282
|
super(options);
|
|
@@ -34896,7 +34600,7 @@ class Server extends Protocol {
|
|
|
34896
34600
|
}
|
|
34897
34601
|
}
|
|
34898
34602
|
|
|
34899
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
34603
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
34900
34604
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
34901
34605
|
function isCompletable(schema) {
|
|
34902
34606
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -34910,7 +34614,7 @@ var McpZodTypeKind;
|
|
|
34910
34614
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
34911
34615
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
34912
34616
|
|
|
34913
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
34617
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
34914
34618
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
34915
34619
|
function validateToolName(name) {
|
|
34916
34620
|
const warnings = [];
|
|
@@ -34968,7 +34672,7 @@ function validateAndWarnToolName(name) {
|
|
|
34968
34672
|
return result.isValid;
|
|
34969
34673
|
}
|
|
34970
34674
|
|
|
34971
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
34675
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
34972
34676
|
class ExperimentalMcpServerTasks {
|
|
34973
34677
|
constructor(_mcpServer) {
|
|
34974
34678
|
this._mcpServer = _mcpServer;
|
|
@@ -34983,7 +34687,7 @@ class ExperimentalMcpServerTasks {
|
|
|
34983
34687
|
}
|
|
34984
34688
|
}
|
|
34985
34689
|
|
|
34986
|
-
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
34690
|
+
// ../../node_modules/.bun/@modelcontextprotocol+sdk@1.30.0+2b91fc17bf64bdfd/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
34987
34691
|
init_zod();
|
|
34988
34692
|
|
|
34989
34693
|
class McpServer {
|
|
@@ -35173,7 +34877,7 @@ class McpServer {
|
|
|
35173
34877
|
let task = createTaskResult.task;
|
|
35174
34878
|
const pollInterval = task.pollInterval ?? 5000;
|
|
35175
34879
|
while (task.status !== "completed" && task.status !== "failed" && task.status !== "cancelled") {
|
|
35176
|
-
await new Promise((
|
|
34880
|
+
await new Promise((resolve2) => setTimeout(resolve2, pollInterval));
|
|
35177
34881
|
const updatedTask = await extra.taskStore.getTask(taskId);
|
|
35178
34882
|
if (!updatedTask) {
|
|
35179
34883
|
throw new McpError(ErrorCode.InternalError, `Task ${taskId} not found during polling`);
|
|
@@ -35717,6 +35421,7 @@ init_package();
|
|
|
35717
35421
|
|
|
35718
35422
|
// src/mcp/tools/discovery.ts
|
|
35719
35423
|
init_zod();
|
|
35424
|
+
init_package();
|
|
35720
35425
|
|
|
35721
35426
|
// src/lib/compact-output.ts
|
|
35722
35427
|
var DEFAULT_MCP_LIMIT = 20;
|
|
@@ -35801,7 +35506,7 @@ function registerDiscoveryTools(server, stripped) {
|
|
|
35801
35506
|
description: "Search connectors by name or keyword.",
|
|
35802
35507
|
inputSchema: {
|
|
35803
35508
|
query: exports_external.string(),
|
|
35804
|
-
limit: exports_external.number().optional(),
|
|
35509
|
+
limit: exports_external.number().int().min(1).max(100).optional(),
|
|
35805
35510
|
verbose: exports_external.boolean().optional()
|
|
35806
35511
|
}
|
|
35807
35512
|
}, async ({ query, limit, verbose }) => {
|
|
@@ -35872,13 +35577,19 @@ function registerDiscoveryTools(server, stripped) {
|
|
|
35872
35577
|
description: c.description,
|
|
35873
35578
|
tags: c.tags
|
|
35874
35579
|
})) : page.items.map((c) => compactConnector(c, 120));
|
|
35875
|
-
|
|
35580
|
+
const compactMode = compact === true || !verbose && compact !== false;
|
|
35581
|
+
return { content: [{ type: "text", text: JSON.stringify({
|
|
35876
35582
|
connectors: data,
|
|
35877
35583
|
total: connectors18.length,
|
|
35878
35584
|
count: data.length,
|
|
35585
|
+
limit: page.limit,
|
|
35586
|
+
cursor: String(page.offset),
|
|
35879
35587
|
nextCursor: page.nextOffset === null ? null : String(page.nextOffset),
|
|
35588
|
+
hasMore: page.nextOffset !== null,
|
|
35589
|
+
compact: compactMode,
|
|
35590
|
+
catalogVersion: package_default.version,
|
|
35880
35591
|
hint: page.nextOffset === null ? "Use verbose=true or compact=false for full connector metadata." : `Call again with cursor="${page.nextOffset}", or use verbose=true / compact=false for full connector metadata.`
|
|
35881
|
-
}
|
|
35592
|
+
}) }] };
|
|
35882
35593
|
});
|
|
35883
35594
|
server.registerTool("connector_docs", {
|
|
35884
35595
|
title: "Connector Documentation",
|
|
@@ -36124,8 +35835,8 @@ init_zod();
|
|
|
36124
35835
|
init_auth();
|
|
36125
35836
|
init_database();
|
|
36126
35837
|
init_connector_resolver();
|
|
36127
|
-
import { existsSync as
|
|
36128
|
-
import { join as
|
|
35838
|
+
import { existsSync as existsSync15, readFileSync as readFileSync8 } from "fs";
|
|
35839
|
+
import { join as join14 } from "path";
|
|
36129
35840
|
import { spawn as spawn3 } from "child_process";
|
|
36130
35841
|
function registerAuthTools(server, stripped) {
|
|
36131
35842
|
server.registerTool("connector_auth_status", {
|
|
@@ -36260,11 +35971,11 @@ function registerAuthTools(server, stripped) {
|
|
|
36260
35971
|
const serverPort = port || 9876;
|
|
36261
35972
|
const oauthUrl = `http://localhost:${serverPort}/oauth/${name}/start`;
|
|
36262
35973
|
if (noBrowser) {
|
|
36263
|
-
const
|
|
36264
|
-
const tokenPaths = getConnectorConfigReadDirs(name,
|
|
35974
|
+
const connectorsHome2 = getConnectorsHome();
|
|
35975
|
+
const tokenPaths = getConnectorConfigReadDirs(name, connectorsHome2).map((dir) => join14(dir, "profiles", "default", "tokens.json"));
|
|
36265
35976
|
let serverRunning = false;
|
|
36266
35977
|
try {
|
|
36267
|
-
await fetch(`http://localhost:${serverPort}/
|
|
35978
|
+
await fetch(`http://localhost:${serverPort}/health`);
|
|
36268
35979
|
serverRunning = true;
|
|
36269
35980
|
} catch {}
|
|
36270
35981
|
if (!serverRunning) {
|
|
@@ -36274,13 +35985,13 @@ function registerAuthTools(server, stripped) {
|
|
|
36274
35985
|
stdio: "ignore"
|
|
36275
35986
|
});
|
|
36276
35987
|
serverProc.unref();
|
|
36277
|
-
await new Promise((
|
|
35988
|
+
await new Promise((resolve2) => setTimeout(resolve2, 2000));
|
|
36278
35989
|
}
|
|
36279
35990
|
let attempts = 0;
|
|
36280
35991
|
const maxAttempts = 120;
|
|
36281
35992
|
while (attempts < maxAttempts) {
|
|
36282
|
-
await new Promise((
|
|
36283
|
-
if (tokenPaths.some((tokensPath) =>
|
|
35993
|
+
await new Promise((resolve2) => setTimeout(resolve2, 500));
|
|
35994
|
+
if (tokenPaths.some((tokensPath) => existsSync15(tokensPath))) {
|
|
36284
35995
|
break;
|
|
36285
35996
|
}
|
|
36286
35997
|
attempts++;
|
|
@@ -36299,7 +36010,7 @@ function registerAuthTools(server, stripped) {
|
|
|
36299
36010
|
};
|
|
36300
36011
|
}
|
|
36301
36012
|
try {
|
|
36302
|
-
const tokensPath = tokenPaths.find((path) =>
|
|
36013
|
+
const tokensPath = tokenPaths.find((path) => existsSync15(path)) ?? tokenPaths[0];
|
|
36303
36014
|
const tokenData = JSON.parse(readFileSync8(tokensPath, "utf-8"));
|
|
36304
36015
|
return {
|
|
36305
36016
|
content: [{
|
|
@@ -37023,6 +36734,114 @@ async function handleMcpHttpRequest(req) {
|
|
|
37023
36734
|
return null;
|
|
37024
36735
|
}
|
|
37025
36736
|
|
|
36737
|
+
// src/server/serve-auth.ts
|
|
36738
|
+
init_paths();
|
|
36739
|
+
import { chmodSync as chmodSync2, existsSync as existsSync16, mkdirSync as mkdirSync9, readFileSync as readFileSync9, writeFileSync as writeFileSync7 } from "fs";
|
|
36740
|
+
import { randomBytes as randomBytes2, timingSafeEqual } from "crypto";
|
|
36741
|
+
import { dirname as dirname7, join as join15 } from "path";
|
|
36742
|
+
var SERVE_TOKEN_ENV = "HASNA_CONNECTORS_SERVE_TOKEN";
|
|
36743
|
+
var SERVE_TOKEN_FILE = "serve-token";
|
|
36744
|
+
var SERVE_UNAUTHORIZED_CODE = "CONNECTORS_SERVE_UNAUTHORIZED";
|
|
36745
|
+
var SERVE_DEFAULT_HOSTNAME = "127.0.0.1";
|
|
36746
|
+
var PRIVATE_FILE_MODE2 = 384;
|
|
36747
|
+
function serveTokenPath(home = connectorsHome()) {
|
|
36748
|
+
return join15(home, SERVE_TOKEN_FILE);
|
|
36749
|
+
}
|
|
36750
|
+
function readTokenFile(path) {
|
|
36751
|
+
if (!existsSync16(path))
|
|
36752
|
+
return null;
|
|
36753
|
+
try {
|
|
36754
|
+
const value = readFileSync9(path, "utf-8").trim();
|
|
36755
|
+
return value.length > 0 ? value : null;
|
|
36756
|
+
} catch {
|
|
36757
|
+
return null;
|
|
36758
|
+
}
|
|
36759
|
+
}
|
|
36760
|
+
function writeTokenFile(path, token) {
|
|
36761
|
+
mkdirSync9(dirname7(path), { recursive: true });
|
|
36762
|
+
writeFileSync7(path, `${token}
|
|
36763
|
+
`, { mode: PRIVATE_FILE_MODE2 });
|
|
36764
|
+
try {
|
|
36765
|
+
chmodSync2(path, PRIVATE_FILE_MODE2);
|
|
36766
|
+
} catch {}
|
|
36767
|
+
}
|
|
36768
|
+
function readServeToken(env = process.env, home) {
|
|
36769
|
+
const fromEnv = env[SERVE_TOKEN_ENV]?.trim();
|
|
36770
|
+
if (fromEnv)
|
|
36771
|
+
return { token: fromEnv, source: "env", path: null };
|
|
36772
|
+
const path = serveTokenPath(home);
|
|
36773
|
+
const fromFile = readTokenFile(path);
|
|
36774
|
+
if (fromFile)
|
|
36775
|
+
return { token: fromFile, source: "file", path };
|
|
36776
|
+
return null;
|
|
36777
|
+
}
|
|
36778
|
+
function resolveServeToken(options = {}) {
|
|
36779
|
+
const explicit = options.token?.trim();
|
|
36780
|
+
if (explicit)
|
|
36781
|
+
return { token: explicit, source: "explicit", path: null };
|
|
36782
|
+
const existing = readServeToken(options.env ?? process.env, options.home);
|
|
36783
|
+
if (existing)
|
|
36784
|
+
return existing;
|
|
36785
|
+
const path = serveTokenPath(options.home);
|
|
36786
|
+
const token = randomBytes2(32).toString("hex");
|
|
36787
|
+
writeTokenFile(path, token);
|
|
36788
|
+
return { token, source: "generated", path };
|
|
36789
|
+
}
|
|
36790
|
+
function presentedToken(req) {
|
|
36791
|
+
const authorization = req.headers.get("authorization");
|
|
36792
|
+
if (authorization) {
|
|
36793
|
+
const match = /^Bearer\s+(.+)$/i.exec(authorization.trim());
|
|
36794
|
+
if (match)
|
|
36795
|
+
return match[1].trim();
|
|
36796
|
+
}
|
|
36797
|
+
const header = req.headers.get("x-connectors-token");
|
|
36798
|
+
if (header && header.trim().length > 0)
|
|
36799
|
+
return header.trim();
|
|
36800
|
+
return null;
|
|
36801
|
+
}
|
|
36802
|
+
function tokenMatches(presented, expected) {
|
|
36803
|
+
if (!presented)
|
|
36804
|
+
return false;
|
|
36805
|
+
const a = Buffer.from(presented, "utf-8");
|
|
36806
|
+
const b = Buffer.from(expected, "utf-8");
|
|
36807
|
+
if (a.length !== b.length)
|
|
36808
|
+
return false;
|
|
36809
|
+
return timingSafeEqual(a, b);
|
|
36810
|
+
}
|
|
36811
|
+
function requiresServeAuth(pathname, method) {
|
|
36812
|
+
if (method === "OPTIONS")
|
|
36813
|
+
return false;
|
|
36814
|
+
if (pathname === "/health")
|
|
36815
|
+
return false;
|
|
36816
|
+
if (/^\/oauth\/[^/]+\/(start|callback)$/.test(pathname))
|
|
36817
|
+
return false;
|
|
36818
|
+
return true;
|
|
36819
|
+
}
|
|
36820
|
+
function isServeAuthorized(req, token) {
|
|
36821
|
+
const url = new URL(req.url);
|
|
36822
|
+
if (!requiresServeAuth(url.pathname, req.method))
|
|
36823
|
+
return true;
|
|
36824
|
+
return tokenMatches(presentedToken(req), token);
|
|
36825
|
+
}
|
|
36826
|
+
function unauthorizedPayload() {
|
|
36827
|
+
return {
|
|
36828
|
+
error: `${SERVE_UNAUTHORIZED_CODE}: this connectors-serve route requires ` + "`Authorization: Bearer <token>` (or `X-Connectors-Token`).",
|
|
36829
|
+
hint: `The token is ${SERVE_TOKEN_ENV} when set, otherwise the owner-only file ` + `<connectors home>/${SERVE_TOKEN_FILE} (default ~/.hasna/connectors/${SERVE_TOKEN_FILE}) ` + "the server generates on first start. Same-user CLI, MCP and `@hasna/connectors/sdk` clients read it automatically."
|
|
36830
|
+
};
|
|
36831
|
+
}
|
|
36832
|
+
function describeServeTokenSource(resolved) {
|
|
36833
|
+
switch (resolved.source) {
|
|
36834
|
+
case "env":
|
|
36835
|
+
return `bearer token from ${SERVE_TOKEN_ENV}`;
|
|
36836
|
+
case "explicit":
|
|
36837
|
+
return "bearer token supplied by the caller";
|
|
36838
|
+
case "file":
|
|
36839
|
+
return `bearer token from ${resolved.path}`;
|
|
36840
|
+
case "generated":
|
|
36841
|
+
return `bearer token generated and written owner-only to ${resolved.path}`;
|
|
36842
|
+
}
|
|
36843
|
+
}
|
|
36844
|
+
|
|
37026
36845
|
// src/server/serve.ts
|
|
37027
36846
|
var activityLog = [];
|
|
37028
36847
|
var MAX_ACTIVITY_LOG = 100;
|
|
@@ -37032,37 +36851,6 @@ function logActivity(action, connector, detail) {
|
|
|
37032
36851
|
activityLog.length = MAX_ACTIVITY_LOG;
|
|
37033
36852
|
}
|
|
37034
36853
|
}
|
|
37035
|
-
function resolveDashboardDir() {
|
|
37036
|
-
const candidates = [];
|
|
37037
|
-
try {
|
|
37038
|
-
const scriptDir = dirname7(fileURLToPath7(import.meta.url));
|
|
37039
|
-
candidates.push(join14(scriptDir, "..", "dashboard", "dist"));
|
|
37040
|
-
candidates.push(join14(scriptDir, "..", "..", "dashboard", "dist"));
|
|
37041
|
-
} catch {}
|
|
37042
|
-
if (process.argv[1]) {
|
|
37043
|
-
const mainDir = dirname7(process.argv[1]);
|
|
37044
|
-
candidates.push(join14(mainDir, "..", "dashboard", "dist"));
|
|
37045
|
-
candidates.push(join14(mainDir, "..", "..", "dashboard", "dist"));
|
|
37046
|
-
}
|
|
37047
|
-
candidates.push(join14(process.cwd(), "dashboard", "dist"));
|
|
37048
|
-
for (const candidate of candidates) {
|
|
37049
|
-
if (existsSync15(candidate))
|
|
37050
|
-
return candidate;
|
|
37051
|
-
}
|
|
37052
|
-
return join14(process.cwd(), "dashboard", "dist");
|
|
37053
|
-
}
|
|
37054
|
-
var MIME_TYPES = {
|
|
37055
|
-
".html": "text/html; charset=utf-8",
|
|
37056
|
-
".js": "application/javascript",
|
|
37057
|
-
".css": "text/css",
|
|
37058
|
-
".json": "application/json",
|
|
37059
|
-
".png": "image/png",
|
|
37060
|
-
".jpg": "image/jpeg",
|
|
37061
|
-
".svg": "image/svg+xml",
|
|
37062
|
-
".ico": "image/x-icon",
|
|
37063
|
-
".woff": "font/woff",
|
|
37064
|
-
".woff2": "font/woff2"
|
|
37065
|
-
};
|
|
37066
36854
|
var SECURITY_HEADERS = {
|
|
37067
36855
|
"X-Content-Type-Options": "nosniff",
|
|
37068
36856
|
"X-Frame-Options": "DENY"
|
|
@@ -37147,15 +36935,6 @@ function oauthPage(type, title, message, hint, extra) {
|
|
|
37147
36935
|
</div>
|
|
37148
36936
|
</body></html>`;
|
|
37149
36937
|
}
|
|
37150
|
-
function serveStaticFile(filePath) {
|
|
37151
|
-
if (!existsSync15(filePath))
|
|
37152
|
-
return null;
|
|
37153
|
-
const ext = extname(filePath);
|
|
37154
|
-
const contentType2 = MIME_TYPES[ext] || "application/octet-stream";
|
|
37155
|
-
return new Response(Bun.file(filePath), {
|
|
37156
|
-
headers: { "Content-Type": contentType2 }
|
|
37157
|
-
});
|
|
37158
|
-
}
|
|
37159
36938
|
async function findAvailablePort(preferred, strict = false) {
|
|
37160
36939
|
if (strict) {
|
|
37161
36940
|
try {
|
|
@@ -37181,37 +36960,37 @@ async function findAvailablePort(preferred, strict = false) {
|
|
|
37181
36960
|
throw new Error(`No available port found in range ${preferred}-${preferred + 99}`);
|
|
37182
36961
|
}
|
|
37183
36962
|
async function startServer(requestedPort, options) {
|
|
37184
|
-
const shouldOpen = options?.open ?? true;
|
|
37185
36963
|
const strict = options?.strict ?? false;
|
|
36964
|
+
const hostname2 = options?.hostname ?? SERVE_DEFAULT_HOSTNAME;
|
|
37186
36965
|
loadConnectorVersions();
|
|
37187
|
-
const
|
|
37188
|
-
const dashboardExists = existsSync15(dashboardDir);
|
|
37189
|
-
if (!dashboardExists) {
|
|
37190
|
-
console.error(`
|
|
37191
|
-
Dashboard not found at: ${dashboardDir}`);
|
|
37192
|
-
console.error(`Run this to build it:
|
|
37193
|
-
`);
|
|
37194
|
-
console.error(` cd dashboard && bun install && bun run build
|
|
37195
|
-
`);
|
|
37196
|
-
console.error(`Or from the project root:
|
|
37197
|
-
`);
|
|
37198
|
-
console.error(` bun run build:dashboard
|
|
37199
|
-
`);
|
|
37200
|
-
}
|
|
36966
|
+
const serveToken = resolveServeToken({ token: options?.token });
|
|
37201
36967
|
const port = await findAvailablePort(requestedPort, strict);
|
|
37202
36968
|
if (port !== requestedPort) {
|
|
37203
36969
|
console.log(`Port ${requestedPort} is in use, using port ${port} instead`);
|
|
37204
36970
|
}
|
|
37205
36971
|
const server = Bun.serve({
|
|
36972
|
+
hostname: hostname2,
|
|
37206
36973
|
port,
|
|
37207
36974
|
async fetch(req) {
|
|
37208
36975
|
const url2 = new URL(req.url);
|
|
37209
|
-
const
|
|
36976
|
+
const path = url2.pathname;
|
|
37210
36977
|
const method = req.method;
|
|
36978
|
+
if (!isServeAuthorized(req, serveToken.token)) {
|
|
36979
|
+
const body = unauthorizedPayload();
|
|
36980
|
+
return new Response(JSON.stringify(body), {
|
|
36981
|
+
status: 401,
|
|
36982
|
+
headers: {
|
|
36983
|
+
"Content-Type": "application/json",
|
|
36984
|
+
"WWW-Authenticate": 'Bearer realm="connectors-serve"',
|
|
36985
|
+
"Access-Control-Allow-Origin": `http://localhost:${port}`,
|
|
36986
|
+
...SECURITY_HEADERS
|
|
36987
|
+
}
|
|
36988
|
+
});
|
|
36989
|
+
}
|
|
37211
36990
|
const mcpResponse = await handleMcpHttpRequest(req);
|
|
37212
36991
|
if (mcpResponse)
|
|
37213
36992
|
return mcpResponse;
|
|
37214
|
-
if (
|
|
36993
|
+
if (path === "/api/connectors" && method === "GET") {
|
|
37215
36994
|
const compact = url2.searchParams.get("compact") === "true";
|
|
37216
36995
|
const fieldsParam = url2.searchParams.get("fields");
|
|
37217
36996
|
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
@@ -37231,7 +37010,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37231
37010
|
}
|
|
37232
37011
|
return jsonStripped(data, 200, port);
|
|
37233
37012
|
}
|
|
37234
|
-
if (
|
|
37013
|
+
if (path === "/api/connectors/manifest" && method === "GET") {
|
|
37235
37014
|
const connectorNames = url2.searchParams.get("connectors")?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
37236
37015
|
const includeOperations = url2.searchParams.get("includeOperations") === "true";
|
|
37237
37016
|
const manifest = await getConnectorCapabilityManifest({
|
|
@@ -37240,7 +37019,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37240
37019
|
});
|
|
37241
37020
|
return json(manifest, 200, port);
|
|
37242
37021
|
}
|
|
37243
|
-
const singleMatch =
|
|
37022
|
+
const singleMatch = path.match(/^\/api\/connectors\/([^/]+)$/);
|
|
37244
37023
|
if (singleMatch && method === "GET") {
|
|
37245
37024
|
const name = singleMatch[1];
|
|
37246
37025
|
if (!isValidConnectorName(name))
|
|
@@ -37260,7 +37039,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37260
37039
|
overview: docs?.overview || null
|
|
37261
37040
|
}, 200, port);
|
|
37262
37041
|
}
|
|
37263
|
-
const operationsMatch =
|
|
37042
|
+
const operationsMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations$/);
|
|
37264
37043
|
if (operationsMatch && method === "GET") {
|
|
37265
37044
|
const name = operationsMatch[1];
|
|
37266
37045
|
if (!isValidConnectorName(name))
|
|
@@ -37281,7 +37060,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37281
37060
|
helpText: ops.helpText
|
|
37282
37061
|
}, 200, port);
|
|
37283
37062
|
}
|
|
37284
|
-
const operationHelpMatch =
|
|
37063
|
+
const operationHelpMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations\/([^/]+)$/);
|
|
37285
37064
|
if (operationHelpMatch && method === "GET") {
|
|
37286
37065
|
const name = operationHelpMatch[1];
|
|
37287
37066
|
const command = decodeURIComponent(operationHelpMatch[2]);
|
|
@@ -37296,7 +37075,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37296
37075
|
const help = await getConnectorCommandHelp(name, command);
|
|
37297
37076
|
return json({ connector: name, displayName: meta.displayName, command, help }, 200, port);
|
|
37298
37077
|
}
|
|
37299
|
-
const operationRunMatch =
|
|
37078
|
+
const operationRunMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations\/run$/);
|
|
37300
37079
|
if (operationRunMatch && method === "POST") {
|
|
37301
37080
|
const name = operationRunMatch[1];
|
|
37302
37081
|
if (!isValidConnectorName(name))
|
|
@@ -37360,7 +37139,7 @@ ${result.stderr}`;
|
|
|
37360
37139
|
}, 500, port);
|
|
37361
37140
|
}
|
|
37362
37141
|
}
|
|
37363
|
-
const keyMatch =
|
|
37142
|
+
const keyMatch = path.match(/^\/api\/connectors\/([^/]+)\/key$/);
|
|
37364
37143
|
if (keyMatch && method === "POST") {
|
|
37365
37144
|
const name = keyMatch[1];
|
|
37366
37145
|
if (!isValidConnectorName(name))
|
|
@@ -37379,7 +37158,7 @@ ${result.stderr}`;
|
|
|
37379
37158
|
return json({ error: e instanceof Error ? e.message : "Failed to save key" }, 500, port);
|
|
37380
37159
|
}
|
|
37381
37160
|
}
|
|
37382
|
-
const refreshMatch =
|
|
37161
|
+
const refreshMatch = path.match(/^\/api\/connectors\/([^/]+)\/refresh$/);
|
|
37383
37162
|
if (refreshMatch && method === "POST") {
|
|
37384
37163
|
const name = refreshMatch[1];
|
|
37385
37164
|
if (!isValidConnectorName(name))
|
|
@@ -37392,7 +37171,7 @@ ${result.stderr}`;
|
|
|
37392
37171
|
return json({ success: false, error: e instanceof Error ? e.message : "Failed to refresh" }, 500, port);
|
|
37393
37172
|
}
|
|
37394
37173
|
}
|
|
37395
|
-
const installMatch =
|
|
37174
|
+
const installMatch = path.match(/^\/api\/connectors\/([^/]+)\/install$/);
|
|
37396
37175
|
if (installMatch && method === "POST") {
|
|
37397
37176
|
const name = installMatch[1];
|
|
37398
37177
|
if (!isValidConnectorName(name))
|
|
@@ -37411,7 +37190,7 @@ ${result.stderr}`;
|
|
|
37411
37190
|
return json({ error: e instanceof Error ? e.message : "Failed to install connector" }, 500, port);
|
|
37412
37191
|
}
|
|
37413
37192
|
}
|
|
37414
|
-
const uninstallMatch =
|
|
37193
|
+
const uninstallMatch = path.match(/^\/api\/connectors\/([^/]+)\/uninstall$/);
|
|
37415
37194
|
if (uninstallMatch && method === "POST") {
|
|
37416
37195
|
const name = uninstallMatch[1];
|
|
37417
37196
|
if (!isValidConnectorName(name))
|
|
@@ -37427,7 +37206,7 @@ ${result.stderr}`;
|
|
|
37427
37206
|
return json({ error: e instanceof Error ? e.message : "Failed to uninstall connector" }, 500, port);
|
|
37428
37207
|
}
|
|
37429
37208
|
}
|
|
37430
|
-
if (
|
|
37209
|
+
if (path === "/api/update" && method === "POST") {
|
|
37431
37210
|
try {
|
|
37432
37211
|
const installed = getInstalledConnectors();
|
|
37433
37212
|
if (installed.length === 0) {
|
|
@@ -37443,10 +37222,10 @@ ${result.stderr}`;
|
|
|
37443
37222
|
return json({ error: e instanceof Error ? e.message : "Failed to update" }, 500, port);
|
|
37444
37223
|
}
|
|
37445
37224
|
}
|
|
37446
|
-
if (
|
|
37225
|
+
if (path === "/api/activity" && method === "GET") {
|
|
37447
37226
|
return json(activityLog, 200, port);
|
|
37448
37227
|
}
|
|
37449
|
-
if (
|
|
37228
|
+
if (path === "/api/hot" && method === "GET") {
|
|
37450
37229
|
const { getTopConnectors: getTopConnectors2 } = await Promise.resolve().then(() => (init_usage(), exports_usage));
|
|
37451
37230
|
const { getPromotedConnectors: getPromotedConnectors2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
37452
37231
|
const limit = parseInt(url2.searchParams.get("limit") || "10", 10);
|
|
@@ -37456,7 +37235,7 @@ ${result.stderr}`;
|
|
|
37456
37235
|
const promoted = new Set(getPromotedConnectors2(db));
|
|
37457
37236
|
return json(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) })), 200, port);
|
|
37458
37237
|
}
|
|
37459
|
-
const promoteMatch =
|
|
37238
|
+
const promoteMatch = path.match(/^\/api\/connectors\/([^/]+)\/promote$/);
|
|
37460
37239
|
if (promoteMatch && method === "POST") {
|
|
37461
37240
|
const name = promoteMatch[1];
|
|
37462
37241
|
if (!getConnector(name))
|
|
@@ -37470,13 +37249,13 @@ ${result.stderr}`;
|
|
|
37470
37249
|
const removed = demoteConnector2(promoteMatch[1], getDatabase3());
|
|
37471
37250
|
return json({ success: removed, connector: promoteMatch[1] }, 200, port);
|
|
37472
37251
|
}
|
|
37473
|
-
if (
|
|
37252
|
+
if (path === "/api/llm" && method === "GET") {
|
|
37474
37253
|
const config2 = getLlmConfig();
|
|
37475
37254
|
if (!config2)
|
|
37476
37255
|
return json({ configured: false }, 200, port);
|
|
37477
37256
|
return json({ configured: true, provider: config2.provider, model: config2.model, key: maskKey(config2.api_key), strip: config2.strip }, 200, port);
|
|
37478
37257
|
}
|
|
37479
|
-
if (
|
|
37258
|
+
if (path === "/api/llm" && method === "POST") {
|
|
37480
37259
|
const body = await req.json().catch(() => ({}));
|
|
37481
37260
|
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
37482
37261
|
const provider = body.provider;
|
|
@@ -37490,7 +37269,7 @@ ${result.stderr}`;
|
|
|
37490
37269
|
saveLlmConfig({ provider, model, api_key, strip });
|
|
37491
37270
|
return json({ success: true, provider, model, strip }, 200, port);
|
|
37492
37271
|
}
|
|
37493
|
-
if (
|
|
37272
|
+
if (path === "/api/llm/test" && method === "POST") {
|
|
37494
37273
|
const config2 = getLlmConfig();
|
|
37495
37274
|
if (!config2)
|
|
37496
37275
|
return json({ error: "No LLM configured" }, 400, port);
|
|
@@ -37502,17 +37281,17 @@ ${result.stderr}`;
|
|
|
37502
37281
|
return json({ success: false, error: e instanceof Error ? e.message : String(e) }, 500, port);
|
|
37503
37282
|
}
|
|
37504
37283
|
}
|
|
37505
|
-
if (
|
|
37284
|
+
if (path === "/api/jobs" && method === "GET") {
|
|
37506
37285
|
return json(listJobs(getDatabase3()), 200, port);
|
|
37507
37286
|
}
|
|
37508
|
-
if (
|
|
37287
|
+
if (path === "/api/jobs" && method === "POST") {
|
|
37509
37288
|
const body = await req.json().catch(() => ({}));
|
|
37510
37289
|
if (!body.name || !body.connector || !body.command || !body.cron)
|
|
37511
37290
|
return json({ error: "name, connector, command, cron required" }, 400, port);
|
|
37512
37291
|
const job = createJob({ name: body.name, connector: body.connector, command: body.command, args: body.args ?? [], cron: body.cron, strip: !!body.strip }, getDatabase3());
|
|
37513
37292
|
return json(job, 201, port);
|
|
37514
37293
|
}
|
|
37515
|
-
const jobMatch =
|
|
37294
|
+
const jobMatch = path.match(/^\/api\/jobs\/([^/]+)$/);
|
|
37516
37295
|
if (jobMatch) {
|
|
37517
37296
|
const db = getDatabase3();
|
|
37518
37297
|
const job = getJobByName(jobMatch[1]) ?? getDatabase3().query("SELECT * FROM connector_jobs WHERE id = ?").get(jobMatch[1]);
|
|
@@ -37534,7 +37313,7 @@ ${result.stderr}`;
|
|
|
37534
37313
|
return json(updated, 200, port);
|
|
37535
37314
|
}
|
|
37536
37315
|
}
|
|
37537
|
-
const jobRunMatch =
|
|
37316
|
+
const jobRunMatch = path.match(/^\/api\/jobs\/([^/]+)\/run$/);
|
|
37538
37317
|
if (jobRunMatch && method === "POST") {
|
|
37539
37318
|
const db = getDatabase3();
|
|
37540
37319
|
const job = getJobByName(jobRunMatch[1], db);
|
|
@@ -37543,17 +37322,17 @@ ${result.stderr}`;
|
|
|
37543
37322
|
const result = await triggerJob(job, db);
|
|
37544
37323
|
return json(result, 200, port);
|
|
37545
37324
|
}
|
|
37546
|
-
if (
|
|
37325
|
+
if (path === "/api/workflows" && method === "GET") {
|
|
37547
37326
|
return json(listWorkflows(getDatabase3()), 200, port);
|
|
37548
37327
|
}
|
|
37549
|
-
if (
|
|
37328
|
+
if (path === "/api/workflows" && method === "POST") {
|
|
37550
37329
|
const body = await req.json().catch(() => ({}));
|
|
37551
37330
|
if (!body.name || !body.steps)
|
|
37552
37331
|
return json({ error: "name and steps required" }, 400, port);
|
|
37553
37332
|
const wf = createWorkflow({ name: body.name, steps: body.steps }, getDatabase3());
|
|
37554
37333
|
return json(wf, 201, port);
|
|
37555
37334
|
}
|
|
37556
|
-
const wfMatch =
|
|
37335
|
+
const wfMatch = path.match(/^\/api\/workflows\/([^/]+)$/);
|
|
37557
37336
|
if (wfMatch) {
|
|
37558
37337
|
const db = getDatabase3();
|
|
37559
37338
|
const wf = getWorkflowByName(wfMatch[1], db);
|
|
@@ -37566,7 +37345,7 @@ ${result.stderr}`;
|
|
|
37566
37345
|
return json({ success: true }, 200, port);
|
|
37567
37346
|
}
|
|
37568
37347
|
}
|
|
37569
|
-
const wfRunMatch =
|
|
37348
|
+
const wfRunMatch = path.match(/^\/api\/workflows\/([^/]+)\/run$/);
|
|
37570
37349
|
if (wfRunMatch && method === "POST") {
|
|
37571
37350
|
const wf = getWorkflowByName(wfRunMatch[1], getDatabase3());
|
|
37572
37351
|
if (!wf)
|
|
@@ -37574,10 +37353,10 @@ ${result.stderr}`;
|
|
|
37574
37353
|
const result = await runWorkflow(wf);
|
|
37575
37354
|
return json(result, 200, port);
|
|
37576
37355
|
}
|
|
37577
|
-
if (
|
|
37356
|
+
if (path === "/api/agents" && method === "GET") {
|
|
37578
37357
|
return json(listAgents(), 200, port);
|
|
37579
37358
|
}
|
|
37580
|
-
if (
|
|
37359
|
+
if (path === "/api/agents/register" && method === "POST") {
|
|
37581
37360
|
const body = await req.json().catch(() => ({}));
|
|
37582
37361
|
const name = typeof body.name === "string" ? body.name : null;
|
|
37583
37362
|
if (!name)
|
|
@@ -37591,15 +37370,15 @@ ${result.stderr}`;
|
|
|
37591
37370
|
return json(result, 409, port);
|
|
37592
37371
|
return json(result, 200, port);
|
|
37593
37372
|
}
|
|
37594
|
-
if (
|
|
37595
|
-
const agentName =
|
|
37373
|
+
if (path.startsWith("/api/agents/") && method === "DELETE") {
|
|
37374
|
+
const agentName = path.slice("/api/agents/".length);
|
|
37596
37375
|
const agent = getAgentByName(agentName);
|
|
37597
37376
|
if (!agent)
|
|
37598
37377
|
return json({ error: "Agent not found" }, 404, port);
|
|
37599
37378
|
deleteAgent(agent.id);
|
|
37600
37379
|
return json({ success: true }, 200, port);
|
|
37601
37380
|
}
|
|
37602
|
-
const rateMatch =
|
|
37381
|
+
const rateMatch = path.match(/^\/api\/rate\/([^/]+)\/([^/]+)$/);
|
|
37603
37382
|
if (rateMatch && method === "GET") {
|
|
37604
37383
|
const [, agentId, connector] = rateMatch;
|
|
37605
37384
|
const limit = parseInt(url2.searchParams.get("limit") || "60", 10);
|
|
@@ -37607,7 +37386,7 @@ ${result.stderr}`;
|
|
|
37607
37386
|
const result = consume ? checkRateBudget(agentId, connector, limit) : getRateBudget(agentId, connector, limit);
|
|
37608
37387
|
return json(result, 200, port);
|
|
37609
37388
|
}
|
|
37610
|
-
const profilesMatch =
|
|
37389
|
+
const profilesMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles$/);
|
|
37611
37390
|
if (profilesMatch && method === "GET") {
|
|
37612
37391
|
const name = profilesMatch[1];
|
|
37613
37392
|
if (!isValidConnectorName(name))
|
|
@@ -37616,10 +37395,10 @@ ${result.stderr}`;
|
|
|
37616
37395
|
const profiles = listProfiles4(name);
|
|
37617
37396
|
let current = "default";
|
|
37618
37397
|
for (const configDir of getConnectorConfigReadDirs(name)) {
|
|
37619
|
-
const currentProfileFile =
|
|
37620
|
-
if (
|
|
37398
|
+
const currentProfileFile = join16(configDir, "current_profile");
|
|
37399
|
+
if (existsSync17(currentProfileFile)) {
|
|
37621
37400
|
try {
|
|
37622
|
-
current =
|
|
37401
|
+
current = readFileSync10(currentProfileFile, "utf-8").trim() || "default";
|
|
37623
37402
|
} catch {}
|
|
37624
37403
|
break;
|
|
37625
37404
|
}
|
|
@@ -37629,7 +37408,7 @@ ${result.stderr}`;
|
|
|
37629
37408
|
return json({ error: e instanceof Error ? e.message : "Failed to list profiles" }, 500, port);
|
|
37630
37409
|
}
|
|
37631
37410
|
}
|
|
37632
|
-
const profileSwitchMatch =
|
|
37411
|
+
const profileSwitchMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles\/switch$/);
|
|
37633
37412
|
if (profileSwitchMatch && method === "POST") {
|
|
37634
37413
|
const name = profileSwitchMatch[1];
|
|
37635
37414
|
if (!isValidConnectorName(name))
|
|
@@ -37648,7 +37427,7 @@ ${result.stderr}`;
|
|
|
37648
37427
|
return json({ error: e instanceof Error ? e.message : "Failed to switch profile" }, 500, port);
|
|
37649
37428
|
}
|
|
37650
37429
|
}
|
|
37651
|
-
const profileDeleteMatch =
|
|
37430
|
+
const profileDeleteMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles\/([^/]+)$/);
|
|
37652
37431
|
if (profileDeleteMatch && method === "DELETE") {
|
|
37653
37432
|
const name = profileDeleteMatch[1];
|
|
37654
37433
|
const profile = profileDeleteMatch[2];
|
|
@@ -37666,31 +37445,31 @@ ${result.stderr}`;
|
|
|
37666
37445
|
return json({ error: e instanceof Error ? e.message : "Failed to delete profile" }, 500, port);
|
|
37667
37446
|
}
|
|
37668
37447
|
}
|
|
37669
|
-
if (
|
|
37448
|
+
if (path === "/api/export" && method === "GET") {
|
|
37670
37449
|
try {
|
|
37671
37450
|
const connectDir = getConnectorsHome();
|
|
37672
37451
|
const result = {};
|
|
37673
|
-
if (
|
|
37452
|
+
if (existsSync17(connectDir)) {
|
|
37674
37453
|
for (const connectorName of listConfiguredConnectorNames(connectDir)) {
|
|
37675
37454
|
const profiles = {};
|
|
37676
37455
|
for (const configDir of [...getConnectorConfigReadDirs(connectorName, connectDir)].reverse()) {
|
|
37677
|
-
const profilesDir =
|
|
37678
|
-
if (!
|
|
37456
|
+
const profilesDir = join16(configDir, "profiles");
|
|
37457
|
+
if (!existsSync17(profilesDir))
|
|
37679
37458
|
continue;
|
|
37680
37459
|
const profileEntries = readdirSync9(profilesDir, { withFileTypes: true });
|
|
37681
37460
|
for (const pEntry of profileEntries) {
|
|
37682
37461
|
if (pEntry.isFile() && pEntry.name.endsWith(".json")) {
|
|
37683
37462
|
const profileName = basename3(pEntry.name, ".json");
|
|
37684
37463
|
try {
|
|
37685
|
-
const config2 = JSON.parse(
|
|
37464
|
+
const config2 = JSON.parse(readFileSync10(join16(profilesDir, pEntry.name), "utf-8"));
|
|
37686
37465
|
profiles[profileName] = config2;
|
|
37687
37466
|
} catch {}
|
|
37688
37467
|
}
|
|
37689
37468
|
if (pEntry.isDirectory()) {
|
|
37690
|
-
const configPath =
|
|
37691
|
-
if (
|
|
37469
|
+
const configPath = join16(profilesDir, pEntry.name, "config.json");
|
|
37470
|
+
if (existsSync17(configPath)) {
|
|
37692
37471
|
try {
|
|
37693
|
-
const config2 = JSON.parse(
|
|
37472
|
+
const config2 = JSON.parse(readFileSync10(configPath, "utf-8"));
|
|
37694
37473
|
profiles[pEntry.name] = config2;
|
|
37695
37474
|
} catch {}
|
|
37696
37475
|
}
|
|
@@ -37716,7 +37495,7 @@ ${result.stderr}`;
|
|
|
37716
37495
|
return json({ error: e instanceof Error ? e.message : "Failed to export credentials" }, 500, port);
|
|
37717
37496
|
}
|
|
37718
37497
|
}
|
|
37719
|
-
if (
|
|
37498
|
+
if (path === "/api/import" && method === "POST") {
|
|
37720
37499
|
try {
|
|
37721
37500
|
const contentLength = parseInt(req.headers.get("content-length") || "0", 10);
|
|
37722
37501
|
if (contentLength > MAX_BODY_SIZE)
|
|
@@ -37733,13 +37512,13 @@ ${result.stderr}`;
|
|
|
37733
37512
|
if (!data.profiles || typeof data.profiles !== "object")
|
|
37734
37513
|
continue;
|
|
37735
37514
|
const connectorDir = getConnectorConfigDir(connectorName, connectDir);
|
|
37736
|
-
const profilesDir =
|
|
37515
|
+
const profilesDir = join16(connectorDir, "profiles");
|
|
37737
37516
|
for (const [profileName, config2] of Object.entries(data.profiles)) {
|
|
37738
37517
|
if (!config2 || typeof config2 !== "object")
|
|
37739
37518
|
continue;
|
|
37740
|
-
|
|
37741
|
-
const profileFile =
|
|
37742
|
-
|
|
37519
|
+
mkdirSync10(profilesDir, { recursive: true });
|
|
37520
|
+
const profileFile = join16(profilesDir, `${profileName}.json`);
|
|
37521
|
+
writeFileSync8(profileFile, JSON.stringify(config2, null, 2));
|
|
37743
37522
|
imported++;
|
|
37744
37523
|
}
|
|
37745
37524
|
}
|
|
@@ -37749,7 +37528,7 @@ ${result.stderr}`;
|
|
|
37749
37528
|
return json({ error: e instanceof Error ? e.message : "Failed to import credentials" }, 500, port);
|
|
37750
37529
|
}
|
|
37751
37530
|
}
|
|
37752
|
-
const oauthStartMatch =
|
|
37531
|
+
const oauthStartMatch = path.match(/^\/oauth\/([^/]+)\/start$/);
|
|
37753
37532
|
if (oauthStartMatch && method === "GET") {
|
|
37754
37533
|
const name = oauthStartMatch[1];
|
|
37755
37534
|
const redirectUri = `http://localhost:${port}/oauth/${name}/callback`;
|
|
@@ -37759,7 +37538,7 @@ ${result.stderr}`;
|
|
|
37759
37538
|
}
|
|
37760
37539
|
return Response.redirect(authUrl, 302);
|
|
37761
37540
|
}
|
|
37762
|
-
const oauthCallbackMatch =
|
|
37541
|
+
const oauthCallbackMatch = path.match(/^\/oauth\/([^/]+)\/callback$/);
|
|
37763
37542
|
if (oauthCallbackMatch && method === "GET") {
|
|
37764
37543
|
const name = oauthCallbackMatch[1];
|
|
37765
37544
|
const code = url2.searchParams.get("code");
|
|
@@ -37769,7 +37548,7 @@ ${result.stderr}`;
|
|
|
37769
37548
|
return htmlResponse(oauthPage("error", "Authentication Failed", error2, "You can close this window."));
|
|
37770
37549
|
}
|
|
37771
37550
|
if (!validateOAuthState(state, name)) {
|
|
37772
|
-
return htmlResponse(oauthPage("error", "Invalid State", "CSRF validation failed. The OAuth state parameter is missing or invalid.", "Please try again
|
|
37551
|
+
return htmlResponse(oauthPage("error", "Invalid State", "CSRF validation failed. The OAuth state parameter is missing or invalid.", "Please try again."));
|
|
37773
37552
|
}
|
|
37774
37553
|
if (!code) {
|
|
37775
37554
|
return htmlResponse(oauthPage("error", "Missing Authorization Code", "No code received from the OAuth provider.", "You can close this window and try again."));
|
|
@@ -37788,25 +37567,10 @@ ${result.stderr}`;
|
|
|
37788
37567
|
headers: {
|
|
37789
37568
|
"Access-Control-Allow-Origin": `http://localhost:${port}`,
|
|
37790
37569
|
"Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS",
|
|
37791
|
-
"Access-Control-Allow-Headers": "Content-Type"
|
|
37570
|
+
"Access-Control-Allow-Headers": "Content-Type, Authorization, X-Connectors-Token"
|
|
37792
37571
|
}
|
|
37793
37572
|
});
|
|
37794
37573
|
}
|
|
37795
|
-
if (dashboardExists && (method === "GET" || method === "HEAD")) {
|
|
37796
|
-
if (path3 !== "/") {
|
|
37797
|
-
const filePath = join14(dashboardDir, path3);
|
|
37798
|
-
const rel = relative(dashboardDir, resolve(filePath));
|
|
37799
|
-
if (!rel.startsWith("..") && !rel.includes(`..${sep}`) && rel !== "") {
|
|
37800
|
-
const res2 = serveStaticFile(filePath);
|
|
37801
|
-
if (res2)
|
|
37802
|
-
return res2;
|
|
37803
|
-
}
|
|
37804
|
-
}
|
|
37805
|
-
const indexPath = join14(dashboardDir, "index.html");
|
|
37806
|
-
const res = serveStaticFile(indexPath);
|
|
37807
|
-
if (res)
|
|
37808
|
-
return res;
|
|
37809
|
-
}
|
|
37810
37574
|
return json({ error: "Not found" }, 404, port);
|
|
37811
37575
|
}
|
|
37812
37576
|
});
|
|
@@ -37819,17 +37583,9 @@ ${result.stderr}`;
|
|
|
37819
37583
|
const { startScheduler: startScheduler2 } = await Promise.resolve().then(() => (init_scheduler(), exports_scheduler));
|
|
37820
37584
|
const { getDatabase: getDatabase3 } = await Promise.resolve().then(() => (init_database(), exports_database));
|
|
37821
37585
|
startScheduler2(getDatabase3());
|
|
37822
|
-
const url = `http
|
|
37823
|
-
console.log(`Connectors
|
|
37824
|
-
|
|
37825
|
-
try {
|
|
37826
|
-
const { openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_open_browser(), exports_open_browser));
|
|
37827
|
-
const opened = await openBrowser2(url);
|
|
37828
|
-
if (!opened.ok) {
|
|
37829
|
-
console.log(`If the browser did not open, visit ${url} manually.`);
|
|
37830
|
-
}
|
|
37831
|
-
} catch {}
|
|
37832
|
-
}
|
|
37586
|
+
const url = `http://${hostname2}:${port}`;
|
|
37587
|
+
console.log(`Connectors API + OAuth server running at ${url}`);
|
|
37588
|
+
console.log(` /api/* and /mcp require ${describeServeTokenSource(serveToken)}; /health and /oauth/* are public`);
|
|
37833
37589
|
return port;
|
|
37834
37590
|
}
|
|
37835
37591
|
|
|
@@ -37842,12 +37598,11 @@ function hasFlag(flag) {
|
|
|
37842
37598
|
function printHelp() {
|
|
37843
37599
|
console.log(`Usage: connectors-serve [options]
|
|
37844
37600
|
|
|
37845
|
-
Start the Connectors
|
|
37601
|
+
Start the Connectors API + OAuth server
|
|
37846
37602
|
|
|
37847
37603
|
Options:
|
|
37848
37604
|
--port <port> Port to bind (default: ${DEFAULT_PORT})
|
|
37849
37605
|
--port=<port> Port to bind (default: ${DEFAULT_PORT})
|
|
37850
|
-
--no-open Do not open the dashboard in a browser
|
|
37851
37606
|
-V, --version Output the version number
|
|
37852
37607
|
-h, --help Display help for command`);
|
|
37853
37608
|
}
|
|
@@ -37870,5 +37625,4 @@ if (hasFlag("--version") || hasFlag("-V")) {
|
|
|
37870
37625
|
console.log(package_default.version);
|
|
37871
37626
|
process.exit(0);
|
|
37872
37627
|
}
|
|
37873
|
-
|
|
37874
|
-
startServer(parsePort(), { open: shouldOpen });
|
|
37628
|
+
startServer(parsePort());
|