@hasna/connectors 1.4.5 → 1.4.7
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 +1891 -1526
- package/bin/mcp.js +610 -307
- package/bin/serve.js +800 -1156
- 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 +1 -1
- 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 +1 -1
- 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/api/client.ts +3 -1
- package/connectors/firecrawl/src/api/scrape-contract.test.ts +64 -0
- package/connectors/firecrawl/src/api/scrape.ts +4 -3
- package/connectors/firecrawl/src/cli/extraction.test.ts +46 -0
- package/connectors/firecrawl/src/cli/extraction.ts +38 -0
- package/connectors/firecrawl/src/cli/index.ts +5 -0
- package/connectors/firecrawl/src/types/index.ts +3 -2
- 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/index.js +127 -132
- package/dist/lib/paths.d.ts +9 -0
- package/dist/lib/strip.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 -11
- 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 → sdk/bundle-boundary.test.d.ts} +0 -0
package/bin/serve.js
CHANGED
|
@@ -105,87 +105,72 @@ class SqliteAdapter {
|
|
|
105
105
|
}
|
|
106
106
|
var init_sqlite_adapter = () => {};
|
|
107
107
|
|
|
108
|
-
//
|
|
108
|
+
// src/lib/paths.ts
|
|
109
|
+
import { existsSync } from "fs";
|
|
109
110
|
import { homedir } from "os";
|
|
110
|
-
import { join } from "path";
|
|
111
|
-
|
|
111
|
+
import { join, resolve } from "path";
|
|
112
|
+
import { homedir as pathsResolverHomedir } from "os";
|
|
113
|
+
import { join as pathsResolverJoin } from "path";
|
|
114
|
+
function pathsResolverAssertApp(app) {
|
|
112
115
|
if (typeof app !== "string" || app.length === 0) {
|
|
113
116
|
throw new TypeError("paths: app must be a non-empty string");
|
|
114
117
|
}
|
|
115
|
-
if (!
|
|
118
|
+
if (!PATHS_RESOLVER_APP_SLUG_RE.test(app)) {
|
|
116
119
|
throw new TypeError(`paths: invalid app slug "${app}" \u2014 expected lowercase kebab-case ([a-z0-9]+(-[a-z0-9]+)*)`);
|
|
117
120
|
}
|
|
118
121
|
}
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
const value = envOf(options)[KIND_ENV[kind]];
|
|
124
|
-
return typeof value === "string" && value.length > 0 ? value : undefined;
|
|
125
|
-
}
|
|
126
|
-
function isMacOS(platform) {
|
|
127
|
-
return platform === "darwin";
|
|
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
|
+
}
|
|
128
126
|
}
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
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
132
|
return override;
|
|
133
|
-
const home = options.home ??
|
|
133
|
+
const home = options.home ?? pathsResolverHomedir();
|
|
134
134
|
const platform = options.platform ?? process.platform;
|
|
135
|
-
if (
|
|
135
|
+
if (platform === "darwin") {
|
|
136
136
|
switch (kind) {
|
|
137
137
|
case "config":
|
|
138
138
|
case "data":
|
|
139
|
-
return
|
|
139
|
+
return pathsResolverJoin(home, "Library", "Application Support", "Hasna");
|
|
140
140
|
case "cache":
|
|
141
|
-
return
|
|
141
|
+
return pathsResolverJoin(home, "Library", "Caches", "Hasna");
|
|
142
142
|
case "state":
|
|
143
|
-
return
|
|
143
|
+
return pathsResolverJoin(home, "Library", "Logs", "Hasna");
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
switch (kind) {
|
|
147
147
|
case "config":
|
|
148
|
-
return
|
|
148
|
+
return pathsResolverJoin(home, ".config", "hasna");
|
|
149
149
|
case "data":
|
|
150
|
-
return
|
|
150
|
+
return pathsResolverJoin(home, ".local", "share", "hasna");
|
|
151
151
|
case "state":
|
|
152
|
-
return
|
|
152
|
+
return pathsResolverJoin(home, ".local", "state", "hasna");
|
|
153
153
|
case "cache":
|
|
154
|
-
return
|
|
154
|
+
return pathsResolverJoin(home, ".cache", "hasna");
|
|
155
155
|
}
|
|
156
156
|
}
|
|
157
|
-
function
|
|
158
|
-
|
|
159
|
-
const appSegment = options.internal === true ?
|
|
160
|
-
return
|
|
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
161
|
}
|
|
162
162
|
function dataDir(options) {
|
|
163
|
-
return
|
|
163
|
+
return pathsResolverResolve("data", options);
|
|
164
164
|
}
|
|
165
|
-
var KIND_ENV, APP_SLUG_RE;
|
|
166
|
-
var init_dist = __esm(() => {
|
|
167
|
-
KIND_ENV = {
|
|
168
|
-
config: "HASNA_CONFIG_HOME",
|
|
169
|
-
data: "HASNA_DATA_HOME",
|
|
170
|
-
state: "HASNA_STATE_HOME",
|
|
171
|
-
cache: "HASNA_CACHE_HOME"
|
|
172
|
-
};
|
|
173
|
-
APP_SLUG_RE = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
174
|
-
});
|
|
175
|
-
|
|
176
|
-
// src/lib/paths.ts
|
|
177
|
-
import { existsSync } from "fs";
|
|
178
|
-
import { homedir as homedir2 } from "os";
|
|
179
|
-
import { join as join2, resolve } from "path";
|
|
180
165
|
function envOr(name, fallback) {
|
|
181
166
|
const value = process.env[name]?.trim();
|
|
182
167
|
return value ? value : fallback;
|
|
183
168
|
}
|
|
184
169
|
function effectiveHome() {
|
|
185
|
-
return process.env["HOME"] || process.env["USERPROFILE"] ||
|
|
170
|
+
return process.env["HOME"] || process.env["USERPROFILE"] || homedir();
|
|
186
171
|
}
|
|
187
172
|
function legacyHomeDir() {
|
|
188
|
-
return
|
|
173
|
+
return join(effectiveHome(), ".hasna", "connectors");
|
|
189
174
|
}
|
|
190
175
|
function resolverHome() {
|
|
191
176
|
return dataDir({
|
|
@@ -197,7 +182,7 @@ function adoptResolverHome(resolved, env = process.env) {
|
|
|
197
182
|
const dataOverride = env.HASNA_DATA_HOME;
|
|
198
183
|
if (typeof dataOverride === "string" && dataOverride.trim().length > 0)
|
|
199
184
|
return true;
|
|
200
|
-
return existsSync(
|
|
185
|
+
return existsSync(join(resolved, "connectors.db"));
|
|
201
186
|
}
|
|
202
187
|
function exactConnectorsHome() {
|
|
203
188
|
const home = envOr("HASNA_CONNECTORS_DIR", "");
|
|
@@ -210,8 +195,15 @@ function connectorsHome() {
|
|
|
210
195
|
const resolved = resolverHome();
|
|
211
196
|
return adoptResolverHome(resolved) ? resolve(resolved) : resolve(legacyHomeDir());
|
|
212
197
|
}
|
|
198
|
+
var PATHS_RESOLVER_KIND_ENV, PATHS_RESOLVER_APP_SLUG_RE;
|
|
213
199
|
var init_paths = __esm(() => {
|
|
214
|
-
|
|
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]+)*$/;
|
|
215
207
|
});
|
|
216
208
|
|
|
217
209
|
// src/db/database.ts
|
|
@@ -224,7 +216,7 @@ __export(exports_database, {
|
|
|
224
216
|
closeDatabase: () => closeDatabase,
|
|
225
217
|
SqliteAdapter: () => SqliteAdapter
|
|
226
218
|
});
|
|
227
|
-
import { dirname, join as
|
|
219
|
+
import { dirname, join as join2 } from "path";
|
|
228
220
|
import { mkdirSync, existsSync as existsSync2, readdirSync, copyFileSync, statSync } from "fs";
|
|
229
221
|
function mergeDirectoryContents(sourceDir, targetDir) {
|
|
230
222
|
if (!existsSync2(sourceDir)) {
|
|
@@ -232,8 +224,8 @@ function mergeDirectoryContents(sourceDir, targetDir) {
|
|
|
232
224
|
}
|
|
233
225
|
mkdirSync(targetDir, { recursive: true });
|
|
234
226
|
for (const entry of readdirSync(sourceDir)) {
|
|
235
|
-
const sourcePath =
|
|
236
|
-
const targetPath =
|
|
227
|
+
const sourcePath = join2(sourceDir, entry);
|
|
228
|
+
const targetPath = join2(targetDir, entry);
|
|
237
229
|
try {
|
|
238
230
|
const sourceStat = statSync(sourcePath);
|
|
239
231
|
if (sourceStat.isDirectory()) {
|
|
@@ -249,7 +241,7 @@ function mergeDirectoryContents(sourceDir, targetDir) {
|
|
|
249
241
|
function getConnectorsHome() {
|
|
250
242
|
const newDir = connectorsHome();
|
|
251
243
|
const home = effectiveHome();
|
|
252
|
-
const legacyDirs = [
|
|
244
|
+
const legacyDirs = [join2(home, ".connectors"), join2(home, ".connect")];
|
|
253
245
|
mkdirSync(newDir, { recursive: true });
|
|
254
246
|
for (const legacyDir of legacyDirs) {
|
|
255
247
|
try {
|
|
@@ -399,7 +391,7 @@ var init_database = __esm(() => {
|
|
|
399
391
|
init_sqlite_adapter();
|
|
400
392
|
init_paths();
|
|
401
393
|
DB_DIR = getConnectorsHome();
|
|
402
|
-
DB_PATH =
|
|
394
|
+
DB_PATH = join2(DB_DIR, "connectors.db");
|
|
403
395
|
});
|
|
404
396
|
|
|
405
397
|
// src/lib/llm.ts
|
|
@@ -414,9 +406,9 @@ __export(exports_llm, {
|
|
|
414
406
|
LLMClient: () => LLMClient
|
|
415
407
|
});
|
|
416
408
|
import { existsSync as existsSync3, readFileSync, writeFileSync, mkdirSync as mkdirSync2 } from "fs";
|
|
417
|
-
import { join as
|
|
409
|
+
import { join as join3 } from "path";
|
|
418
410
|
function getLlmConfigPath() {
|
|
419
|
-
return
|
|
411
|
+
return join3(getConnectorsHome(), "llm.json");
|
|
420
412
|
}
|
|
421
413
|
function getLlmConfig() {
|
|
422
414
|
const path = getLlmConfigPath();
|
|
@@ -560,7 +552,8 @@ var STRIP_PROMPT = `You are a data extraction assistant. Your job is to take raw
|
|
|
560
552
|
|
|
561
553
|
Rules:
|
|
562
554
|
- Return valid JSON only (no markdown, no explanation)
|
|
563
|
-
-
|
|
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
|
|
564
557
|
- Keep all meaningful data fields
|
|
565
558
|
- If the input is already minimal, return it unchanged
|
|
566
559
|
- If input is not JSON, extract key facts as a JSON object
|
|
@@ -4874,14 +4867,14 @@ var init_zod = __esm(() => {
|
|
|
4874
4867
|
// src/core/connectors/github.ts
|
|
4875
4868
|
import { Buffer as Buffer2 } from "buffer";
|
|
4876
4869
|
import { existsSync as existsSync4 } from "fs";
|
|
4877
|
-
import { dirname as dirname2, join as
|
|
4870
|
+
import { dirname as dirname2, join as join4 } from "path";
|
|
4878
4871
|
import { fileURLToPath, pathToFileURL } from "url";
|
|
4879
4872
|
function resolveGithubConnectorDir() {
|
|
4880
4873
|
const candidates = [
|
|
4881
|
-
|
|
4882
|
-
|
|
4883
|
-
|
|
4884
|
-
|
|
4874
|
+
join4(__dirname2, "..", "..", "..", "connectors", "github"),
|
|
4875
|
+
join4(__dirname2, "..", "..", "connectors", "github"),
|
|
4876
|
+
join4(__dirname2, "..", "connectors", "github"),
|
|
4877
|
+
join4(process.cwd(), "connectors", "github")
|
|
4885
4878
|
];
|
|
4886
4879
|
for (const candidate of candidates) {
|
|
4887
4880
|
if (existsSync4(candidate)) {
|
|
@@ -4891,10 +4884,10 @@ function resolveGithubConnectorDir() {
|
|
|
4891
4884
|
return candidates[0];
|
|
4892
4885
|
}
|
|
4893
4886
|
async function loadGitHubApiModule() {
|
|
4894
|
-
return await import(pathToFileURL(
|
|
4887
|
+
return await import(pathToFileURL(join4(CONNECTOR_DIR, "src", "api", "index.ts")).href);
|
|
4895
4888
|
}
|
|
4896
4889
|
async function loadGitHubConfigModule() {
|
|
4897
|
-
return await import(pathToFileURL(
|
|
4890
|
+
return await import(pathToFileURL(join4(CONNECTOR_DIR, "src", "utils", "config.ts")).href);
|
|
4898
4891
|
}
|
|
4899
4892
|
function extractGlobalArgs(args) {
|
|
4900
4893
|
const remaining = [];
|
|
@@ -5739,7 +5732,7 @@ Commands:
|
|
|
5739
5732
|
|
|
5740
5733
|
// src/core/connectors/gmail.ts
|
|
5741
5734
|
import { existsSync as existsSync5, mkdirSync as mkdirSync3, readFileSync as readFileSync2, readdirSync as readdirSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
5742
|
-
import { basename, join as
|
|
5735
|
+
import { basename, join as join5 } from "path";
|
|
5743
5736
|
async function modifyMessage(profile, messageId, addLabelIds, removeLabelIds) {
|
|
5744
5737
|
return requestJson(profile, `/users/me/messages/${encodeURIComponent(messageId)}/modify`, {}, {
|
|
5745
5738
|
method: "POST",
|
|
@@ -5776,7 +5769,7 @@ async function replyToMessage(profile, messageId, input) {
|
|
|
5776
5769
|
}
|
|
5777
5770
|
async function downloadAttachments(profile, input) {
|
|
5778
5771
|
const messageId = getMessageId(input);
|
|
5779
|
-
const outputDir = input.dir ?? input.outputDir ??
|
|
5772
|
+
const outputDir = input.dir ?? input.outputDir ?? join5(configDirs()[0], "attachments", messageId);
|
|
5780
5773
|
mkdirSync3(outputDir, { recursive: true });
|
|
5781
5774
|
const attachments = input.attachmentId && input.filename ? [{
|
|
5782
5775
|
attachmentId: input.attachmentId,
|
|
@@ -5788,7 +5781,7 @@ async function downloadAttachments(profile, input) {
|
|
|
5788
5781
|
for (const attachment of attachments) {
|
|
5789
5782
|
const data = await requestJson(profile, `/users/me/messages/${encodeURIComponent(messageId)}/attachments/${encodeURIComponent(attachment.attachmentId)}`, {});
|
|
5790
5783
|
const filename = safeFilename(attachment.filename);
|
|
5791
|
-
const path =
|
|
5784
|
+
const path = join5(outputDir, filename);
|
|
5792
5785
|
const buffer = Buffer.from(data.data, "base64url");
|
|
5793
5786
|
writeFileSync2(path, buffer);
|
|
5794
5787
|
downloaded.push({
|
|
@@ -5904,8 +5897,8 @@ async function refreshAccessToken(profile, currentTokens) {
|
|
|
5904
5897
|
}
|
|
5905
5898
|
function listProfiles() {
|
|
5906
5899
|
const profiles = new Set;
|
|
5907
|
-
for (const
|
|
5908
|
-
const profilesDir =
|
|
5900
|
+
for (const baseDir of configDirs()) {
|
|
5901
|
+
const profilesDir = join5(baseDir, "profiles");
|
|
5909
5902
|
if (!existsSync5(profilesDir))
|
|
5910
5903
|
continue;
|
|
5911
5904
|
for (const entry of readdirSync2(profilesDir, { withFileTypes: true })) {
|
|
@@ -5922,10 +5915,10 @@ function loadCredentials(profile) {
|
|
|
5922
5915
|
const envClientSecret = process.env.GMAIL_CLIENT_SECRET ?? process.env.GOOGLE_CLIENT_SECRET;
|
|
5923
5916
|
if (envClientId && envClientSecret)
|
|
5924
5917
|
return { clientId: envClientId, clientSecret: envClientSecret };
|
|
5925
|
-
for (const
|
|
5918
|
+
for (const baseDir of configDirs()) {
|
|
5926
5919
|
const credentials = {
|
|
5927
|
-
...readJson(
|
|
5928
|
-
...readJson(
|
|
5920
|
+
...readJson(join5(baseDir, "credentials.json")),
|
|
5921
|
+
...readJson(join5(baseDir, "profiles", profile, "config.json"))
|
|
5929
5922
|
};
|
|
5930
5923
|
if (credentials.clientId || credentials.clientSecret)
|
|
5931
5924
|
return credentials;
|
|
@@ -5933,28 +5926,28 @@ function loadCredentials(profile) {
|
|
|
5933
5926
|
return {};
|
|
5934
5927
|
}
|
|
5935
5928
|
function loadTokens(profile) {
|
|
5936
|
-
for (const
|
|
5937
|
-
const fromProfile = readJson(
|
|
5929
|
+
for (const baseDir of configDirs()) {
|
|
5930
|
+
const fromProfile = readJson(join5(baseDir, "profiles", profile, "tokens.json"));
|
|
5938
5931
|
if (fromProfile)
|
|
5939
5932
|
return fromProfile;
|
|
5940
|
-
const flat = readJson(
|
|
5933
|
+
const flat = readJson(join5(baseDir, "profiles", `${profile}.json`));
|
|
5941
5934
|
if (flat)
|
|
5942
5935
|
return flat.tokens ?? (flat.accessToken || flat.refreshToken ? flat : null);
|
|
5943
5936
|
}
|
|
5944
5937
|
return null;
|
|
5945
5938
|
}
|
|
5946
5939
|
function saveTokens(profile, tokens) {
|
|
5947
|
-
const
|
|
5948
|
-
const profileDir =
|
|
5940
|
+
const baseDir = configDirs().find((dir) => existsSync5(dir)) ?? configDirs()[0];
|
|
5941
|
+
const profileDir = join5(baseDir, "profiles", profile);
|
|
5949
5942
|
mkdirSync3(profileDir, { recursive: true });
|
|
5950
|
-
writeFileSync2(
|
|
5943
|
+
writeFileSync2(join5(profileDir, "tokens.json"), JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
5951
5944
|
}
|
|
5952
5945
|
function configDirs() {
|
|
5953
5946
|
const explicit = process.env.HASNA_GMAIL_CONNECTOR_DIR ?? process.env.GMAIL_CONNECTOR_DIR;
|
|
5954
5947
|
if (explicit)
|
|
5955
5948
|
return [explicit];
|
|
5956
|
-
const
|
|
5957
|
-
return [
|
|
5949
|
+
const baseDir = connectorsHome();
|
|
5950
|
+
return [join5(baseDir, "gmail"), join5(baseDir, "connect-gmail")];
|
|
5958
5951
|
}
|
|
5959
5952
|
function readJson(path) {
|
|
5960
5953
|
if (!existsSync5(path))
|
|
@@ -6209,7 +6202,7 @@ var init_gmail = __esm(() => {
|
|
|
6209
6202
|
|
|
6210
6203
|
// src/core/connectors/googledrive.ts
|
|
6211
6204
|
import { existsSync as existsSync6, mkdirSync as mkdirSync4, readFileSync as readFileSync3, readdirSync as readdirSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
6212
|
-
import { basename as basename2, join as
|
|
6205
|
+
import { basename as basename2, join as join6 } from "path";
|
|
6213
6206
|
async function requestJson2(profile, path, params) {
|
|
6214
6207
|
const response = await request(profile, path, params);
|
|
6215
6208
|
const text = await response.text();
|
|
@@ -6276,8 +6269,8 @@ async function refreshAccessToken2(profile, currentTokens) {
|
|
|
6276
6269
|
}
|
|
6277
6270
|
function listProfiles2() {
|
|
6278
6271
|
const profiles = new Set;
|
|
6279
|
-
for (const
|
|
6280
|
-
const profilesDir =
|
|
6272
|
+
for (const baseDir of configDirs2()) {
|
|
6273
|
+
const profilesDir = join6(baseDir, "profiles");
|
|
6281
6274
|
if (!existsSync6(profilesDir))
|
|
6282
6275
|
continue;
|
|
6283
6276
|
for (const entry of readdirSync3(profilesDir, { withFileTypes: true })) {
|
|
@@ -6323,10 +6316,10 @@ function loadCredentials2(profile) {
|
|
|
6323
6316
|
const envClientSecret = process.env.GOOGLE_CLIENT_SECRET;
|
|
6324
6317
|
if (envClientId && envClientSecret)
|
|
6325
6318
|
return { clientId: envClientId, clientSecret: envClientSecret };
|
|
6326
|
-
for (const
|
|
6319
|
+
for (const baseDir of configDirs2()) {
|
|
6327
6320
|
const credentials = {
|
|
6328
|
-
...readJson2(
|
|
6329
|
-
...readJson2(
|
|
6321
|
+
...readJson2(join6(baseDir, "credentials.json")),
|
|
6322
|
+
...readJson2(join6(baseDir, "profiles", profile, "config.json"))
|
|
6330
6323
|
};
|
|
6331
6324
|
if (credentials.clientId || credentials.clientSecret)
|
|
6332
6325
|
return credentials;
|
|
@@ -6334,28 +6327,28 @@ function loadCredentials2(profile) {
|
|
|
6334
6327
|
return {};
|
|
6335
6328
|
}
|
|
6336
6329
|
function loadTokens2(profile) {
|
|
6337
|
-
for (const
|
|
6338
|
-
const fromProfile = readJson2(
|
|
6330
|
+
for (const baseDir of configDirs2()) {
|
|
6331
|
+
const fromProfile = readJson2(join6(baseDir, "profiles", profile, "tokens.json"));
|
|
6339
6332
|
if (fromProfile)
|
|
6340
6333
|
return fromProfile;
|
|
6341
|
-
const flat = readJson2(
|
|
6334
|
+
const flat = readJson2(join6(baseDir, "profiles", `${profile}.json`));
|
|
6342
6335
|
if (flat)
|
|
6343
6336
|
return flat.tokens ?? (flat.accessToken || flat.refreshToken ? flat : null);
|
|
6344
6337
|
}
|
|
6345
6338
|
return null;
|
|
6346
6339
|
}
|
|
6347
6340
|
function saveTokens2(profile, tokens) {
|
|
6348
|
-
const
|
|
6349
|
-
const profileDir =
|
|
6341
|
+
const baseDir = configDirs2().find((dir) => existsSync6(dir)) ?? configDirs2()[0];
|
|
6342
|
+
const profileDir = join6(baseDir, "profiles", profile);
|
|
6350
6343
|
mkdirSync4(profileDir, { recursive: true });
|
|
6351
|
-
writeFileSync3(
|
|
6344
|
+
writeFileSync3(join6(profileDir, "tokens.json"), JSON.stringify(tokens, null, 2), { mode: 384 });
|
|
6352
6345
|
}
|
|
6353
6346
|
function configDirs2() {
|
|
6354
6347
|
const explicit = process.env.HASNA_GOOGLE_DRIVE_CONNECTOR_DIR ?? process.env.GOOGLE_DRIVE_CONNECTOR_DIR;
|
|
6355
6348
|
if (explicit)
|
|
6356
6349
|
return [explicit];
|
|
6357
|
-
const
|
|
6358
|
-
return [
|
|
6350
|
+
const baseDir = connectorsHome();
|
|
6351
|
+
return [join6(baseDir, "googledrive"), join6(baseDir, "connect-googledrive")];
|
|
6359
6352
|
}
|
|
6360
6353
|
function readJson2(path) {
|
|
6361
6354
|
if (!existsSync6(path))
|
|
@@ -6542,7 +6535,7 @@ var package_default;
|
|
|
6542
6535
|
var init_package = __esm(() => {
|
|
6543
6536
|
package_default = {
|
|
6544
6537
|
name: "@hasna/connectors",
|
|
6545
|
-
version: "1.4.
|
|
6538
|
+
version: "1.4.7",
|
|
6546
6539
|
description: "Open source connector library - Install API connectors with a single command",
|
|
6547
6540
|
type: "module",
|
|
6548
6541
|
bin: {
|
|
@@ -6553,7 +6546,6 @@ var init_package = __esm(() => {
|
|
|
6553
6546
|
files: [
|
|
6554
6547
|
"bin/",
|
|
6555
6548
|
"dist/",
|
|
6556
|
-
"dashboard/dist/",
|
|
6557
6549
|
"connectors/",
|
|
6558
6550
|
"README.md",
|
|
6559
6551
|
"!connectors/**/.test-home/**",
|
|
@@ -6573,20 +6565,23 @@ var init_package = __esm(() => {
|
|
|
6573
6565
|
"./social": {
|
|
6574
6566
|
import: "./dist/social/index.js",
|
|
6575
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"
|
|
6576
6573
|
}
|
|
6577
6574
|
},
|
|
6578
6575
|
main: "./dist/index.js",
|
|
6579
6576
|
types: "./dist/index.d.ts",
|
|
6580
6577
|
scripts: {
|
|
6581
|
-
build: "
|
|
6582
|
-
|
|
6583
|
-
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",
|
|
6584
6580
|
dev: "bun run ./src/cli/index.tsx",
|
|
6585
6581
|
"check:package-secrets": "bun run scripts/check-package-secrets.ts",
|
|
6586
6582
|
typecheck: "tsc --noEmit && tsc -p tsconfig.social.json --noEmit",
|
|
6587
6583
|
test: "bun run build && bun test",
|
|
6588
6584
|
"secrets:scan:npmrc": "bun run scripts/scan-npmrc-auth.mjs",
|
|
6589
|
-
"sdk:build": "cd sdk && bun run build",
|
|
6590
6585
|
prepublishOnly: "bun run secrets:scan:npmrc && bun run build && bun run check:package-secrets && bun test",
|
|
6591
6586
|
prepack: "bun run build && bun run check:package-secrets"
|
|
6592
6587
|
},
|
|
@@ -6606,7 +6601,7 @@ var init_package = __esm(() => {
|
|
|
6606
6601
|
author: "Hasna",
|
|
6607
6602
|
license: "Apache-2.0",
|
|
6608
6603
|
devDependencies: {
|
|
6609
|
-
"@types/bun": "
|
|
6604
|
+
"@types/bun": "1.3.14",
|
|
6610
6605
|
"@types/react": "^18.2.0",
|
|
6611
6606
|
"ink-testing-library": "^4.0.0",
|
|
6612
6607
|
typescript: "^5",
|
|
@@ -6614,7 +6609,6 @@ var init_package = __esm(() => {
|
|
|
6614
6609
|
},
|
|
6615
6610
|
dependencies: {
|
|
6616
6611
|
"@hasna/events": "0.1.8",
|
|
6617
|
-
"@hasna/paths": "0.1.0",
|
|
6618
6612
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
6619
6613
|
chalk: "^5.3.0",
|
|
6620
6614
|
commander: "^12.1.0",
|
|
@@ -6637,18 +6631,19 @@ var init_package = __esm(() => {
|
|
|
6637
6631
|
},
|
|
6638
6632
|
repository: {
|
|
6639
6633
|
type: "git",
|
|
6640
|
-
url: "
|
|
6634
|
+
url: "https://github.com/hasna/apps.git",
|
|
6635
|
+
directory: "apps/connectors"
|
|
6641
6636
|
},
|
|
6642
|
-
homepage: "https://github.com/hasna/connectors#readme",
|
|
6637
|
+
homepage: "https://github.com/hasna/apps/tree/main/apps/connectors#readme",
|
|
6643
6638
|
bugs: {
|
|
6644
|
-
url: "https://github.com/hasna/
|
|
6639
|
+
url: "https://github.com/hasna/apps/issues"
|
|
6645
6640
|
}
|
|
6646
6641
|
};
|
|
6647
6642
|
});
|
|
6648
6643
|
|
|
6649
6644
|
// src/lib/connector-resolver.ts
|
|
6650
6645
|
import { existsSync as existsSync7, readdirSync as readdirSync4, statSync as statSync2 } from "fs";
|
|
6651
|
-
import { join as
|
|
6646
|
+
import { join as join7 } from "path";
|
|
6652
6647
|
function stripLegacyPrefix(name) {
|
|
6653
6648
|
return name.startsWith(LEGACY_CONNECTOR_PREFIX) ? name.slice(LEGACY_CONNECTOR_PREFIX.length) : name;
|
|
6654
6649
|
}
|
|
@@ -6691,7 +6686,7 @@ function connectorPackageDirNames(name) {
|
|
|
6691
6686
|
function resolveConnectorPackagePath(connectorsDir, name) {
|
|
6692
6687
|
const resolution = resolveConnectorName(name);
|
|
6693
6688
|
const dirNames = connectorPackageDirNames(name);
|
|
6694
|
-
const checkedPaths = dirNames.map((dirName) =>
|
|
6689
|
+
const checkedPaths = dirNames.map((dirName) => join7(connectorsDir, dirName));
|
|
6695
6690
|
const existingPath = checkedPaths.find((path) => existsSync7(path)) ?? null;
|
|
6696
6691
|
const existingDirName = existingPath ? dirNames[checkedPaths.indexOf(existingPath)] : null;
|
|
6697
6692
|
return {
|
|
@@ -6711,8 +6706,8 @@ function getConnectorPackagePath(connectorsDir, name) {
|
|
|
6711
6706
|
function resolveConnectorConfigPaths(name, connectorsHome2 = getConnectorsHome()) {
|
|
6712
6707
|
const resolution = resolveConnectorName(name);
|
|
6713
6708
|
const preferredDirName = resolution.canonicalName || resolution.legacyName;
|
|
6714
|
-
const preferredPath =
|
|
6715
|
-
const legacyPath =
|
|
6709
|
+
const preferredPath = join7(connectorsHome2, preferredDirName);
|
|
6710
|
+
const legacyPath = join7(connectorsHome2, resolution.legacyName);
|
|
6716
6711
|
const paths = preferredPath === legacyPath ? [preferredPath] : [preferredPath, legacyPath];
|
|
6717
6712
|
const existingPaths = paths.filter((path) => existsSync7(path));
|
|
6718
6713
|
return {
|
|
@@ -6736,7 +6731,7 @@ function listConfiguredConnectorNames(connectorsHome2 = getConnectorsHome()) {
|
|
|
6736
6731
|
return [];
|
|
6737
6732
|
const names = new Set;
|
|
6738
6733
|
for (const entry of readdirSync4(connectorsHome2)) {
|
|
6739
|
-
const fullPath =
|
|
6734
|
+
const fullPath = join7(connectorsHome2, entry);
|
|
6740
6735
|
try {
|
|
6741
6736
|
if (!statSync2(fullPath).isDirectory())
|
|
6742
6737
|
continue;
|
|
@@ -6767,7 +6762,7 @@ import {
|
|
|
6767
6762
|
statSync as statSync3,
|
|
6768
6763
|
writeFileSync as writeFileSync4
|
|
6769
6764
|
} from "fs";
|
|
6770
|
-
import { join as
|
|
6765
|
+
import { join as join8 } from "path";
|
|
6771
6766
|
function buildRootHelp(specs) {
|
|
6772
6767
|
const lines = [
|
|
6773
6768
|
"Usage: connect-imessage [options] [command]",
|
|
@@ -6818,11 +6813,11 @@ function getConfigReadDirs() {
|
|
|
6818
6813
|
return getConnectorConfigReadDirs(CONNECTOR_NAME);
|
|
6819
6814
|
}
|
|
6820
6815
|
function getProfilesDir() {
|
|
6821
|
-
return
|
|
6816
|
+
return join8(getConfigDir(), "profiles");
|
|
6822
6817
|
}
|
|
6823
6818
|
function getCurrentProfile() {
|
|
6824
6819
|
for (const configDir of getConfigReadDirs()) {
|
|
6825
|
-
const currentProfileFile =
|
|
6820
|
+
const currentProfileFile = join8(configDir, "current_profile");
|
|
6826
6821
|
if (!existsSync8(currentProfileFile))
|
|
6827
6822
|
continue;
|
|
6828
6823
|
try {
|
|
@@ -6836,16 +6831,16 @@ function getCurrentProfile() {
|
|
|
6836
6831
|
function setCurrentProfile(profile) {
|
|
6837
6832
|
const configDir = getConfigDir();
|
|
6838
6833
|
mkdirSync5(configDir, { recursive: true });
|
|
6839
|
-
writeFileSync4(
|
|
6834
|
+
writeFileSync4(join8(configDir, "current_profile"), profile);
|
|
6840
6835
|
}
|
|
6841
6836
|
function getFlatProfilePath(profile) {
|
|
6842
|
-
return
|
|
6837
|
+
return join8(getProfilesDir(), `${profile}.json`);
|
|
6843
6838
|
}
|
|
6844
6839
|
function getFlatProfileReadPaths(profile) {
|
|
6845
|
-
return getConfigReadDirs().map((dir) =>
|
|
6840
|
+
return getConfigReadDirs().map((dir) => join8(dir, "profiles", `${profile}.json`));
|
|
6846
6841
|
}
|
|
6847
6842
|
function getDirectoryProfileReadPaths(profile) {
|
|
6848
|
-
return getConfigReadDirs().map((dir) =>
|
|
6843
|
+
return getConfigReadDirs().map((dir) => join8(dir, "profiles", profile, "config.json"));
|
|
6849
6844
|
}
|
|
6850
6845
|
function loadJsonFile(path) {
|
|
6851
6846
|
try {
|
|
@@ -6882,17 +6877,17 @@ function profileExists(profile) {
|
|
|
6882
6877
|
if (profile === "default") {
|
|
6883
6878
|
return true;
|
|
6884
6879
|
}
|
|
6885
|
-
return getFlatProfileReadPaths(profile).some((path) => existsSync8(path)) || getConfigReadDirs().some((dir) => existsSync8(
|
|
6880
|
+
return getFlatProfileReadPaths(profile).some((path) => existsSync8(path)) || getConfigReadDirs().some((dir) => existsSync8(join8(dir, "profiles", profile)));
|
|
6886
6881
|
}
|
|
6887
6882
|
function listProfiles3() {
|
|
6888
6883
|
const seen = new Set(["default"]);
|
|
6889
6884
|
for (const configDir of getConfigReadDirs()) {
|
|
6890
|
-
const profilesDir =
|
|
6885
|
+
const profilesDir = join8(configDir, "profiles");
|
|
6891
6886
|
if (!existsSync8(profilesDir))
|
|
6892
6887
|
continue;
|
|
6893
6888
|
try {
|
|
6894
6889
|
for (const entry of readdirSync5(profilesDir)) {
|
|
6895
|
-
const fullPath =
|
|
6890
|
+
const fullPath = join8(profilesDir, entry);
|
|
6896
6891
|
const stat = statSync3(fullPath);
|
|
6897
6892
|
if (stat.isDirectory()) {
|
|
6898
6893
|
seen.add(entry);
|
|
@@ -6914,7 +6909,7 @@ function createProfile(profile, config = {}) {
|
|
|
6914
6909
|
}
|
|
6915
6910
|
function clearProfile(profile = getCurrentProfile()) {
|
|
6916
6911
|
const flatPath = getFlatProfilePath(profile);
|
|
6917
|
-
const directoryPath =
|
|
6912
|
+
const directoryPath = join8(getProfilesDir(), profile);
|
|
6918
6913
|
if (existsSync8(flatPath)) {
|
|
6919
6914
|
rmSync(flatPath);
|
|
6920
6915
|
}
|
|
@@ -7551,7 +7546,7 @@ API Key authentication is optional and depends on the bridge deployment. A bridg
|
|
|
7551
7546
|
|
|
7552
7547
|
## Data Storage
|
|
7553
7548
|
|
|
7554
|
-
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.
|
|
7555
7550
|
`, commandInputSchema, conversationListInputSchema, conversationGetInputSchema, messageListInputSchema, messageSendInputSchema, messageReplyInputSchema, imessageConnector;
|
|
7556
7551
|
var init_imessage = __esm(() => {
|
|
7557
7552
|
init_package();
|
|
@@ -7845,14 +7840,14 @@ var init_imessage = __esm(() => {
|
|
|
7845
7840
|
|
|
7846
7841
|
// src/core/connectors/stripe.ts
|
|
7847
7842
|
import { existsSync as existsSync9 } from "fs";
|
|
7848
|
-
import { dirname as dirname3, join as
|
|
7843
|
+
import { dirname as dirname3, join as join9 } from "path";
|
|
7849
7844
|
import { fileURLToPath as fileURLToPath2, pathToFileURL as pathToFileURL2 } from "url";
|
|
7850
7845
|
function resolveStripeConnectorDir() {
|
|
7851
7846
|
const candidates = [
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7847
|
+
join9(__dirname3, "..", "..", "..", "connectors", "stripe"),
|
|
7848
|
+
join9(__dirname3, "..", "..", "connectors", "stripe"),
|
|
7849
|
+
join9(__dirname3, "..", "connectors", "stripe"),
|
|
7850
|
+
join9(process.cwd(), "connectors", "stripe")
|
|
7856
7851
|
];
|
|
7857
7852
|
for (const candidate of candidates) {
|
|
7858
7853
|
if (existsSync9(candidate)) {
|
|
@@ -7903,10 +7898,10 @@ function buildCommandHelp2(spec) {
|
|
|
7903
7898
|
`);
|
|
7904
7899
|
}
|
|
7905
7900
|
async function loadStripeApiModule() {
|
|
7906
|
-
return await import(pathToFileURL2(
|
|
7901
|
+
return await import(pathToFileURL2(join9(CONNECTOR_DIR2, "src", "api", "index.ts")).href);
|
|
7907
7902
|
}
|
|
7908
7903
|
async function loadStripeConfigModule() {
|
|
7909
|
-
return await import(pathToFileURL2(
|
|
7904
|
+
return await import(pathToFileURL2(join9(CONNECTOR_DIR2, "src", "utils", "config.ts")).href);
|
|
7910
7905
|
}
|
|
7911
7906
|
function extractGlobalArgs3(args) {
|
|
7912
7907
|
const remaining = [];
|
|
@@ -8753,25 +8748,25 @@ __export(exports_installer, {
|
|
|
8753
8748
|
connectorExists: () => connectorExists
|
|
8754
8749
|
});
|
|
8755
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";
|
|
8756
|
-
import { join as
|
|
8751
|
+
import { join as join11, dirname as dirname5 } from "path";
|
|
8757
8752
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
8758
8753
|
function resolveConnectorsDir() {
|
|
8759
|
-
const fromBin =
|
|
8754
|
+
const fromBin = join11(__dirname4, "..", "connectors");
|
|
8760
8755
|
if (existsSync11(fromBin))
|
|
8761
8756
|
return fromBin;
|
|
8762
|
-
const fromSrc =
|
|
8757
|
+
const fromSrc = join11(__dirname4, "..", "..", "connectors");
|
|
8763
8758
|
if (existsSync11(fromSrc))
|
|
8764
8759
|
return fromSrc;
|
|
8765
8760
|
return fromBin;
|
|
8766
8761
|
}
|
|
8767
8762
|
function getProjectConnectorsDir(targetDir) {
|
|
8768
|
-
return
|
|
8763
|
+
return join11(targetDir, PROJECT_CONNECTORS_DIRNAME);
|
|
8769
8764
|
}
|
|
8770
8765
|
function getEnablementManifestPath(targetDir) {
|
|
8771
|
-
return
|
|
8766
|
+
return join11(getProjectConnectorsDir(targetDir), ENABLEMENT_MANIFEST_FILENAME);
|
|
8772
8767
|
}
|
|
8773
8768
|
function getLegacyInstallPath(targetDir, name) {
|
|
8774
|
-
return
|
|
8769
|
+
return join11(getProjectConnectorsDir(targetDir), legacyConnectorName(name));
|
|
8775
8770
|
}
|
|
8776
8771
|
function loadEnablementManifest(targetDir) {
|
|
8777
8772
|
const manifestPath = getEnablementManifestPath(targetDir);
|
|
@@ -8799,7 +8794,7 @@ function getLegacyInstalledConnectors(targetDir) {
|
|
|
8799
8794
|
return [];
|
|
8800
8795
|
}
|
|
8801
8796
|
return readdirSync6(connectorsDir).filter((entry) => {
|
|
8802
|
-
const fullPath =
|
|
8797
|
+
const fullPath = join11(connectorsDir, entry);
|
|
8803
8798
|
return entry.startsWith("connect-") && statSync4(fullPath).isDirectory();
|
|
8804
8799
|
}).map((entry) => entry.replace("connect-", "")).sort();
|
|
8805
8800
|
}
|
|
@@ -8808,7 +8803,7 @@ function getEnabledConnectors(targetDir) {
|
|
|
8808
8803
|
return [...new Set([...manifestConnectors, ...getLegacyInstalledConnectors(targetDir)])].sort();
|
|
8809
8804
|
}
|
|
8810
8805
|
function updateConnectorsIndex(connectorsDir, connectors18) {
|
|
8811
|
-
const indexPath =
|
|
8806
|
+
const indexPath = join11(connectorsDir, ENABLEMENT_INDEX_FILENAME);
|
|
8812
8807
|
const connectorList = connectors18.map((connector) => ` "${connector}",`).join(`
|
|
8813
8808
|
`);
|
|
8814
8809
|
const content = `/**
|
|
@@ -8912,7 +8907,7 @@ function parseConnectorDocs(raw) {
|
|
|
8912
8907
|
function getConnectorDocs(name) {
|
|
8913
8908
|
const normalizedName = normalizeConnectorName(name);
|
|
8914
8909
|
const connectorPath = getConnectorPath(normalizedName);
|
|
8915
|
-
const claudeMdPath =
|
|
8910
|
+
const claudeMdPath = join11(connectorPath, "CLAUDE.md");
|
|
8916
8911
|
if (existsSync11(claudeMdPath)) {
|
|
8917
8912
|
return parseConnectorDocs(readFileSync6(claudeMdPath, "utf-8"));
|
|
8918
8913
|
}
|
|
@@ -9040,7 +9035,7 @@ var init_lock = __esm(() => {
|
|
|
9040
9035
|
// src/server/auth.ts
|
|
9041
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";
|
|
9042
9037
|
import { randomBytes } from "crypto";
|
|
9043
|
-
import { join as
|
|
9038
|
+
import { join as join12 } from "path";
|
|
9044
9039
|
function getAuthType(name) {
|
|
9045
9040
|
name = normalizeConnectorName(name);
|
|
9046
9041
|
const docs = getConnectorDocs(name);
|
|
@@ -9081,7 +9076,7 @@ function writePrivateText(path, data) {
|
|
|
9081
9076
|
function getCurrentProfile2(name) {
|
|
9082
9077
|
name = normalizeConnectorName(name);
|
|
9083
9078
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9084
|
-
const currentProfileFile =
|
|
9079
|
+
const currentProfileFile = join12(configDir, "current_profile");
|
|
9085
9080
|
if (existsSync13(currentProfileFile)) {
|
|
9086
9081
|
try {
|
|
9087
9082
|
return readFileSync7(currentProfileFile, "utf-8").trim() || "default";
|
|
@@ -9095,13 +9090,13 @@ function getCurrentProfile2(name) {
|
|
|
9095
9090
|
function loadProfileConfigFromDir(configDir, profile) {
|
|
9096
9091
|
let flatConfig = {};
|
|
9097
9092
|
let dirConfig = {};
|
|
9098
|
-
const profileFile =
|
|
9093
|
+
const profileFile = join12(configDir, "profiles", `${profile}.json`);
|
|
9099
9094
|
if (existsSync13(profileFile)) {
|
|
9100
9095
|
try {
|
|
9101
9096
|
flatConfig = JSON.parse(readFileSync7(profileFile, "utf-8"));
|
|
9102
9097
|
} catch {}
|
|
9103
9098
|
}
|
|
9104
|
-
const profileDirConfig =
|
|
9099
|
+
const profileDirConfig = join12(configDir, "profiles", profile, "config.json");
|
|
9105
9100
|
if (existsSync13(profileDirConfig)) {
|
|
9106
9101
|
try {
|
|
9107
9102
|
dirConfig = JSON.parse(readFileSync7(profileDirConfig, "utf-8"));
|
|
@@ -9122,7 +9117,7 @@ function loadTokens3(name) {
|
|
|
9122
9117
|
name = normalizeConnectorName(name);
|
|
9123
9118
|
const profile = getCurrentProfile2(name);
|
|
9124
9119
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9125
|
-
const tokensFile =
|
|
9120
|
+
const tokensFile = join12(configDir, "profiles", profile, "tokens.json");
|
|
9126
9121
|
if (existsSync13(tokensFile)) {
|
|
9127
9122
|
try {
|
|
9128
9123
|
return JSON.parse(readFileSync7(tokensFile, "utf-8"));
|
|
@@ -9256,7 +9251,7 @@ function _saveApiKey(name, key, field) {
|
|
|
9256
9251
|
const profile = getCurrentProfile2(name);
|
|
9257
9252
|
const keyField = field || guessKeyField(name);
|
|
9258
9253
|
if (keyField === "clientId" || keyField === "clientSecret") {
|
|
9259
|
-
const credentialsFile =
|
|
9254
|
+
const credentialsFile = join12(configDir, "credentials.json");
|
|
9260
9255
|
ensurePrivateDir(configDir);
|
|
9261
9256
|
let creds = {};
|
|
9262
9257
|
if (existsSync13(credentialsFile)) {
|
|
@@ -9268,9 +9263,9 @@ function _saveApiKey(name, key, field) {
|
|
|
9268
9263
|
writePrivateJson(credentialsFile, creds);
|
|
9269
9264
|
return;
|
|
9270
9265
|
}
|
|
9271
|
-
const profilesDir =
|
|
9272
|
-
const profileFile =
|
|
9273
|
-
const profileDir =
|
|
9266
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9267
|
+
const profileFile = join12(profilesDir, `${profile}.json`);
|
|
9268
|
+
const profileDir = join12(profilesDir, profile);
|
|
9274
9269
|
if (existsSync13(profileFile)) {
|
|
9275
9270
|
let config = {};
|
|
9276
9271
|
try {
|
|
@@ -9283,7 +9278,7 @@ function _saveApiKey(name, key, field) {
|
|
|
9283
9278
|
return;
|
|
9284
9279
|
}
|
|
9285
9280
|
if (existsSync13(profileDir)) {
|
|
9286
|
-
const configFile =
|
|
9281
|
+
const configFile = join12(profileDir, "config.json");
|
|
9287
9282
|
let config = {};
|
|
9288
9283
|
if (existsSync13(configFile)) {
|
|
9289
9284
|
try {
|
|
@@ -9300,7 +9295,7 @@ function _saveApiKey(name, key, field) {
|
|
|
9300
9295
|
ensurePrivateDir(configDir);
|
|
9301
9296
|
ensurePrivateDir(profilesDir);
|
|
9302
9297
|
ensurePrivateDir(profileDir);
|
|
9303
|
-
writePrivateJson(
|
|
9298
|
+
writePrivateJson(join12(profileDir, "config.json"), { [keyField]: key });
|
|
9304
9299
|
}
|
|
9305
9300
|
function guessKeyField(name) {
|
|
9306
9301
|
name = normalizeConnectorName(name);
|
|
@@ -9322,7 +9317,7 @@ function guessKeyField(name) {
|
|
|
9322
9317
|
function getOAuthConfig(name) {
|
|
9323
9318
|
name = normalizeConnectorName(name);
|
|
9324
9319
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9325
|
-
const credentialsFile =
|
|
9320
|
+
const credentialsFile = join12(configDir, "credentials.json");
|
|
9326
9321
|
if (existsSync13(credentialsFile)) {
|
|
9327
9322
|
try {
|
|
9328
9323
|
const creds = JSON.parse(readFileSync7(credentialsFile, "utf-8"));
|
|
@@ -9409,12 +9404,12 @@ function saveOAuthTokens(name, tokens) {
|
|
|
9409
9404
|
name = normalizeConnectorName(name);
|
|
9410
9405
|
const configDir = getConnectorConfigDir2(name);
|
|
9411
9406
|
const profile = getCurrentProfile2(name);
|
|
9412
|
-
const profilesDir =
|
|
9413
|
-
const profileDir =
|
|
9407
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9408
|
+
const profileDir = join12(profilesDir, profile);
|
|
9414
9409
|
ensurePrivateDir(configDir);
|
|
9415
9410
|
ensurePrivateDir(profilesDir);
|
|
9416
9411
|
ensurePrivateDir(profileDir);
|
|
9417
|
-
const tokensFile =
|
|
9412
|
+
const tokensFile = join12(profileDir, "tokens.json");
|
|
9418
9413
|
writePrivateJson(tokensFile, tokens);
|
|
9419
9414
|
}
|
|
9420
9415
|
async function refreshOAuthToken(name) {
|
|
@@ -9461,13 +9456,13 @@ function listProfiles4(name) {
|
|
|
9461
9456
|
name = normalizeConnectorName(name);
|
|
9462
9457
|
const seen = new Set;
|
|
9463
9458
|
for (const configDir of getConnectorConfigReadDirs2(name)) {
|
|
9464
|
-
const profilesDir =
|
|
9459
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9465
9460
|
if (!existsSync13(profilesDir))
|
|
9466
9461
|
continue;
|
|
9467
9462
|
try {
|
|
9468
9463
|
const entries = readdirSync7(profilesDir);
|
|
9469
9464
|
for (const entry of entries) {
|
|
9470
|
-
const fullPath =
|
|
9465
|
+
const fullPath = join12(profilesDir, entry);
|
|
9471
9466
|
const stat = statSync6(fullPath);
|
|
9472
9467
|
if (stat.isDirectory()) {
|
|
9473
9468
|
seen.add(entry);
|
|
@@ -9484,15 +9479,15 @@ function switchProfile(name, profile) {
|
|
|
9484
9479
|
name = normalizeConnectorName(name);
|
|
9485
9480
|
const configDir = getConnectorConfigDir2(name);
|
|
9486
9481
|
ensurePrivateDir(configDir);
|
|
9487
|
-
writePrivateText(
|
|
9482
|
+
writePrivateText(join12(configDir, "current_profile"), profile);
|
|
9488
9483
|
}
|
|
9489
9484
|
function deleteProfile2(name, profile) {
|
|
9490
9485
|
name = normalizeConnectorName(name);
|
|
9491
9486
|
if (profile === "default")
|
|
9492
9487
|
return false;
|
|
9493
9488
|
const configDir = getConnectorConfigDir2(name);
|
|
9494
|
-
const profilesDir =
|
|
9495
|
-
const profileFile =
|
|
9489
|
+
const profilesDir = join12(configDir, "profiles");
|
|
9490
|
+
const profileFile = join12(profilesDir, `${profile}.json`);
|
|
9496
9491
|
if (existsSync13(profileFile)) {
|
|
9497
9492
|
rmSync3(profileFile);
|
|
9498
9493
|
if (getCurrentProfile2(name) === profile) {
|
|
@@ -9500,7 +9495,7 @@ function deleteProfile2(name, profile) {
|
|
|
9500
9495
|
}
|
|
9501
9496
|
return true;
|
|
9502
9497
|
}
|
|
9503
|
-
const profileDir =
|
|
9498
|
+
const profileDir = join12(profilesDir, profile);
|
|
9504
9499
|
if (existsSync13(profileDir)) {
|
|
9505
9500
|
rmSync3(profileDir, { recursive: true });
|
|
9506
9501
|
if (getCurrentProfile2(name) === profile) {
|
|
@@ -9576,14 +9571,14 @@ __export(exports_runner, {
|
|
|
9576
9571
|
buildConnectorOperationArgs: () => buildConnectorOperationArgs
|
|
9577
9572
|
});
|
|
9578
9573
|
import { existsSync as existsSync14, readdirSync as readdirSync8 } from "fs";
|
|
9579
|
-
import { join as
|
|
9574
|
+
import { join as join13, dirname as dirname6 } from "path";
|
|
9580
9575
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
9581
9576
|
import { spawn as spawn2 } from "child_process";
|
|
9582
9577
|
function resolveConnectorsDir2() {
|
|
9583
|
-
const fromBin =
|
|
9578
|
+
const fromBin = join13(__dirname5, "..", "connectors");
|
|
9584
9579
|
if (existsSync14(fromBin))
|
|
9585
9580
|
return fromBin;
|
|
9586
|
-
const fromSrc =
|
|
9581
|
+
const fromSrc = join13(__dirname5, "..", "..", "connectors");
|
|
9587
9582
|
if (existsSync14(fromSrc))
|
|
9588
9583
|
return fromSrc;
|
|
9589
9584
|
return fromBin;
|
|
@@ -9652,7 +9647,7 @@ function buildEnvWithCredentials(connectorName, baseEnv) {
|
|
|
9652
9647
|
function getConnectorCliPath(name) {
|
|
9653
9648
|
const safeName = normalizeConnectorName(name).replace(/[^a-z0-9-]/g, "");
|
|
9654
9649
|
const connectorDir = getConnectorPackagePath(CONNECTORS_DIR2, safeName);
|
|
9655
|
-
const cliPath =
|
|
9650
|
+
const cliPath = join13(connectorDir, "src", "cli", "index.ts");
|
|
9656
9651
|
if (existsSync14(cliPath))
|
|
9657
9652
|
return cliPath;
|
|
9658
9653
|
return null;
|
|
@@ -13071,13 +13066,32 @@ var require_data = __commonJS((exports, module) => {
|
|
|
13071
13066
|
};
|
|
13072
13067
|
});
|
|
13073
13068
|
|
|
13074
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13069
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/utils.js
|
|
13075
13070
|
var require_utils = __commonJS((exports, module) => {
|
|
13076
13071
|
var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
|
|
13077
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);
|
|
13078
13074
|
var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
|
|
13079
13075
|
var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
|
|
13080
|
-
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
|
+
}
|
|
13081
13095
|
function stringArrayToHexStripped(input) {
|
|
13082
13096
|
let acc = "";
|
|
13083
13097
|
let code = 0;
|
|
@@ -13102,91 +13116,122 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13102
13116
|
}
|
|
13103
13117
|
return acc;
|
|
13104
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\-._~]$/);
|
|
13105
13122
|
var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
|
|
13106
|
-
function
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
} else {
|
|
13116
|
-
output.error = true;
|
|
13117
|
-
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;
|
|
13118
13132
|
}
|
|
13119
|
-
|
|
13133
|
+
return false;
|
|
13120
13134
|
}
|
|
13121
13135
|
return true;
|
|
13122
13136
|
}
|
|
13123
|
-
function
|
|
13124
|
-
let
|
|
13125
|
-
|
|
13126
|
-
|
|
13127
|
-
|
|
13128
|
-
let
|
|
13129
|
-
|
|
13130
|
-
|
|
13131
|
-
|
|
13132
|
-
|
|
13133
|
-
|
|
13134
|
-
|
|
13135
|
-
|
|
13136
|
-
if (cursor === ":") {
|
|
13137
|
-
if (endipv6Encountered === true) {
|
|
13138
|
-
endIpv6 = true;
|
|
13139
|
-
}
|
|
13140
|
-
if (!consume(buffer, address, output)) {
|
|
13141
|
-
break;
|
|
13142
|
-
}
|
|
13143
|
-
if (++tokenCount > 7) {
|
|
13144
|
-
output.error = true;
|
|
13145
|
-
break;
|
|
13146
|
-
}
|
|
13147
|
-
if (i > 0 && input[i - 1] === ":") {
|
|
13148
|
-
endipv6Encountered = true;
|
|
13149
|
-
}
|
|
13150
|
-
address.push(":");
|
|
13151
|
-
continue;
|
|
13152
|
-
} else if (cursor === "%") {
|
|
13153
|
-
if (!consume(buffer, address, output)) {
|
|
13154
|
-
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;
|
|
13155
13150
|
}
|
|
13156
|
-
consume = consumeIsZone;
|
|
13157
13151
|
} else {
|
|
13158
|
-
|
|
13159
|
-
|
|
13152
|
+
runStart = -1;
|
|
13153
|
+
runLength = 0;
|
|
13160
13154
|
}
|
|
13161
13155
|
}
|
|
13162
|
-
if (
|
|
13163
|
-
|
|
13164
|
-
|
|
13165
|
-
|
|
13166
|
-
|
|
13167
|
-
|
|
13168
|
-
|
|
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;
|
|
13169
13185
|
}
|
|
13186
|
+
if (!isHextet(part))
|
|
13187
|
+
return;
|
|
13188
|
+
parts[i] = parseInt(part, 16).toString(16);
|
|
13189
|
+
hextetCount++;
|
|
13170
13190
|
}
|
|
13171
|
-
|
|
13172
|
-
|
|
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);
|
|
13173
13204
|
}
|
|
13174
13205
|
function normalizeIPv6(host) {
|
|
13175
|
-
|
|
13176
|
-
|
|
13177
|
-
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
|
|
13182
|
-
|
|
13183
|
-
|
|
13184
|
-
|
|
13185
|
-
}
|
|
13186
|
-
|
|
13187
|
-
|
|
13188
|
-
|
|
13189
|
-
|
|
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
|
+
};
|
|
13190
13235
|
}
|
|
13191
13236
|
function findToken(str, token) {
|
|
13192
13237
|
let ind = 0;
|
|
@@ -13306,7 +13351,8 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13306
13351
|
function normalizePathEncoding(input) {
|
|
13307
13352
|
let output = "";
|
|
13308
13353
|
for (let i = 0;i < input.length; i++) {
|
|
13309
|
-
|
|
13354
|
+
const ch = input[i];
|
|
13355
|
+
if (ch === "%" && i + 2 < input.length) {
|
|
13310
13356
|
const hex = input.slice(i + 1, i + 3);
|
|
13311
13357
|
if (isHexPair(hex)) {
|
|
13312
13358
|
const normalizedHex = hex.toUpperCase();
|
|
@@ -13320,10 +13366,152 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13320
13366
|
continue;
|
|
13321
13367
|
}
|
|
13322
13368
|
}
|
|
13323
|
-
if (isPathCharacter(
|
|
13324
|
-
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;
|
|
13410
|
+
} else {
|
|
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;
|
|
13325
13498
|
} else {
|
|
13326
|
-
|
|
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
|
+
}
|
|
13327
13515
|
}
|
|
13328
13516
|
}
|
|
13329
13517
|
return output;
|
|
@@ -13346,14 +13534,18 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13346
13534
|
function recomposeAuthority(component) {
|
|
13347
13535
|
const uriTokens = [];
|
|
13348
13536
|
if (component.userinfo !== undefined) {
|
|
13349
|
-
uriTokens.push(component.userinfo);
|
|
13537
|
+
uriTokens.push(encodeUserinfo(component.userinfo));
|
|
13350
13538
|
uriTokens.push("@");
|
|
13351
13539
|
}
|
|
13352
13540
|
if (component.host !== undefined) {
|
|
13353
|
-
let host =
|
|
13541
|
+
let host = component.host;
|
|
13354
13542
|
if (!isIPv4(host)) {
|
|
13355
|
-
|
|
13356
|
-
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) {
|
|
13357
13549
|
host = `[${ipV6res.escapedHost}]`;
|
|
13358
13550
|
} else {
|
|
13359
13551
|
host = reescapeHostDelimiters(host, false);
|
|
@@ -13362,8 +13554,12 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13362
13554
|
uriTokens.push(host);
|
|
13363
13555
|
}
|
|
13364
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
|
+
}
|
|
13365
13561
|
uriTokens.push(":");
|
|
13366
|
-
uriTokens.push(
|
|
13562
|
+
uriTokens.push(port);
|
|
13367
13563
|
}
|
|
13368
13564
|
return uriTokens.length ? uriTokens.join("") : undefined;
|
|
13369
13565
|
}
|
|
@@ -13373,6 +13569,11 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13373
13569
|
reescapeHostDelimiters,
|
|
13374
13570
|
normalizePercentEncoding,
|
|
13375
13571
|
normalizePathEncoding,
|
|
13572
|
+
serializePathEncoding,
|
|
13573
|
+
normalizeQueryFragmentEncoding,
|
|
13574
|
+
encodeUserinfo,
|
|
13575
|
+
encodeQuery,
|
|
13576
|
+
encodeFragment,
|
|
13376
13577
|
escapePreservingEscapes,
|
|
13377
13578
|
removeDotSegments,
|
|
13378
13579
|
isIPv4,
|
|
@@ -13382,10 +13583,10 @@ var require_utils = __commonJS((exports, module) => {
|
|
|
13382
13583
|
};
|
|
13383
13584
|
});
|
|
13384
13585
|
|
|
13385
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13586
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/lib/schemes.js
|
|
13386
13587
|
var require_schemes = __commonJS((exports, module) => {
|
|
13387
13588
|
var { isUUID } = require_utils();
|
|
13388
|
-
var URN_REG =
|
|
13589
|
+
var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
|
|
13389
13590
|
var supportedSchemeNames = [
|
|
13390
13591
|
"http",
|
|
13391
13592
|
"https",
|
|
@@ -13440,9 +13641,10 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13440
13641
|
wsComponent.secure = undefined;
|
|
13441
13642
|
}
|
|
13442
13643
|
if (wsComponent.resourceName) {
|
|
13443
|
-
const
|
|
13644
|
+
const queryIndex = wsComponent.resourceName.indexOf("?");
|
|
13645
|
+
const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
|
|
13444
13646
|
wsComponent.path = path && path !== "/" ? path : undefined;
|
|
13445
|
-
wsComponent.query =
|
|
13647
|
+
wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
|
|
13446
13648
|
wsComponent.resourceName = undefined;
|
|
13447
13649
|
}
|
|
13448
13650
|
wsComponent.fragment = undefined;
|
|
@@ -13454,7 +13656,7 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13454
13656
|
return urnComponent;
|
|
13455
13657
|
}
|
|
13456
13658
|
const matches = urnComponent.path.match(URN_REG);
|
|
13457
|
-
if (matches) {
|
|
13659
|
+
if (matches && matches[0] === urnComponent.path) {
|
|
13458
13660
|
const scheme = options.scheme || urnComponent.scheme || "urn";
|
|
13459
13661
|
urnComponent.nid = matches[1].toLowerCase();
|
|
13460
13662
|
urnComponent.nss = matches[2];
|
|
@@ -13556,10 +13758,19 @@ var require_schemes = __commonJS((exports, module) => {
|
|
|
13556
13758
|
};
|
|
13557
13759
|
});
|
|
13558
13760
|
|
|
13559
|
-
// ../../node_modules/.bun/fast-uri@3.1.
|
|
13761
|
+
// ../../node_modules/.bun/fast-uri@3.1.7/node_modules/fast-uri/index.js
|
|
13560
13762
|
var require_fast_uri = __commonJS((exports, module) => {
|
|
13561
|
-
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding,
|
|
13763
|
+
var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
|
|
13562
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
|
+
}
|
|
13563
13774
|
function normalize(uri, options) {
|
|
13564
13775
|
if (typeof uri === "string") {
|
|
13565
13776
|
uri = normalizeString(uri, options);
|
|
@@ -13570,12 +13781,34 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13570
13781
|
}
|
|
13571
13782
|
function resolve2(baseURI, relativeURI, options) {
|
|
13572
13783
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
13573
|
-
const {
|
|
13574
|
-
|
|
13575
|
-
|
|
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) {
|
|
13576
13801
|
throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
|
|
13577
13802
|
}
|
|
13578
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
|
+
}
|
|
13579
13812
|
schemelessOptions.skipEscape = true;
|
|
13580
13813
|
return serialize(resolved, schemelessOptions);
|
|
13581
13814
|
}
|
|
@@ -13635,7 +13868,7 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13635
13868
|
function equal(uriA, uriB, options) {
|
|
13636
13869
|
const normalizedA = normalizeComparableURI(uriA, options);
|
|
13637
13870
|
const normalizedB = normalizeComparableURI(uriB, options);
|
|
13638
|
-
return normalizedA !== undefined && normalizedB !== undefined && normalizedA
|
|
13871
|
+
return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB;
|
|
13639
13872
|
}
|
|
13640
13873
|
function serialize(cmpts, opts) {
|
|
13641
13874
|
const component = {
|
|
@@ -13656,20 +13889,23 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13656
13889
|
};
|
|
13657
13890
|
const options = Object.assign({}, opts);
|
|
13658
13891
|
const uriTokens = [];
|
|
13892
|
+
if (component.scheme) {
|
|
13893
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
13894
|
+
}
|
|
13659
13895
|
const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
|
|
13660
13896
|
if (schemeHandler && schemeHandler.serialize)
|
|
13661
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;
|
|
13662
13900
|
if (component.path !== undefined) {
|
|
13663
13901
|
if (!options.skipEscape) {
|
|
13664
|
-
component.path =
|
|
13665
|
-
if (component.scheme !== undefined) {
|
|
13666
|
-
component.path = component.path.split("%3A").join(":");
|
|
13667
|
-
}
|
|
13902
|
+
component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
13668
13903
|
} else {
|
|
13669
13904
|
component.path = normalizePercentEncoding(component.path);
|
|
13670
13905
|
}
|
|
13671
13906
|
}
|
|
13672
13907
|
if (options.reference !== "suffix" && component.scheme) {
|
|
13908
|
+
component.scheme = decodeValidScheme(component.scheme);
|
|
13673
13909
|
uriTokens.push(component.scheme, ":");
|
|
13674
13910
|
}
|
|
13675
13911
|
const authority = recomposeAuthority(component);
|
|
@@ -13687,16 +13923,19 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13687
13923
|
if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
|
|
13688
13924
|
s = removeDotSegments(s);
|
|
13689
13925
|
}
|
|
13926
|
+
if (pathNoScheme) {
|
|
13927
|
+
s = serializePathEncoding(s, true);
|
|
13928
|
+
}
|
|
13690
13929
|
if (authority === undefined && s[0] === "/" && s[1] === "/") {
|
|
13691
13930
|
s = "/%2F" + s.slice(2);
|
|
13692
13931
|
}
|
|
13693
13932
|
uriTokens.push(s);
|
|
13694
13933
|
}
|
|
13695
13934
|
if (component.query !== undefined) {
|
|
13696
|
-
uriTokens.push("?", component.query);
|
|
13935
|
+
uriTokens.push("?", encodeQuery(component.query));
|
|
13697
13936
|
}
|
|
13698
13937
|
if (component.fragment !== undefined) {
|
|
13699
|
-
uriTokens.push("#", component.fragment);
|
|
13938
|
+
uriTokens.push("#", encodeFragment(component.fragment));
|
|
13700
13939
|
}
|
|
13701
13940
|
return uriTokens.join("");
|
|
13702
13941
|
}
|
|
@@ -13712,6 +13951,36 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13712
13951
|
}
|
|
13713
13952
|
return;
|
|
13714
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
|
+
}
|
|
13715
13984
|
function parseWithStatus(uri, opts) {
|
|
13716
13985
|
const options = Object.assign({}, opts);
|
|
13717
13986
|
const parsed = {
|
|
@@ -13724,6 +13993,11 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13724
13993
|
fragment: undefined
|
|
13725
13994
|
};
|
|
13726
13995
|
let malformedAuthorityOrPort = false;
|
|
13996
|
+
let malformedPercentEncoding = false;
|
|
13997
|
+
let malformedSchemeSpecific = false;
|
|
13998
|
+
let malformedHost = false;
|
|
13999
|
+
let malformedIPLiteral = false;
|
|
14000
|
+
let malformedScheme = false;
|
|
13727
14001
|
let isIP = false;
|
|
13728
14002
|
if (options.reference === "suffix") {
|
|
13729
14003
|
if (options.scheme) {
|
|
@@ -13760,6 +14034,19 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13760
14034
|
parsed.path = matches[6] || "";
|
|
13761
14035
|
parsed.query = matches[7];
|
|
13762
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
|
+
}
|
|
13763
14050
|
if (isNaN(parsed.port)) {
|
|
13764
14051
|
parsed.port = matches[5];
|
|
13765
14052
|
}
|
|
@@ -13771,9 +14058,16 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13771
14058
|
if (parsed.host) {
|
|
13772
14059
|
const ipv4result = isIPv4(parsed.host);
|
|
13773
14060
|
if (ipv4result === false) {
|
|
14061
|
+
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
14062
|
+
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
13774
14063
|
const ipv6result = normalizeIPv6(parsed.host);
|
|
13775
|
-
|
|
13776
|
-
|
|
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
|
+
}
|
|
13777
14071
|
} else {
|
|
13778
14072
|
isIP = true;
|
|
13779
14073
|
}
|
|
@@ -13791,42 +14085,36 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13791
14085
|
parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
|
|
13792
14086
|
}
|
|
13793
14087
|
const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
|
|
13794
|
-
if (!
|
|
13795
|
-
|
|
13796
|
-
try {
|
|
13797
|
-
parsed.host = new URL("http://" + parsed.host).hostname;
|
|
13798
|
-
} catch (e) {
|
|
13799
|
-
parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
|
|
13800
|
-
}
|
|
13801
|
-
}
|
|
14088
|
+
if (!malformedIPLiteral) {
|
|
14089
|
+
malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
|
|
13802
14090
|
}
|
|
13803
14091
|
if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
|
|
13804
14092
|
if (uri.indexOf("%") !== -1) {
|
|
13805
|
-
if (parsed.
|
|
13806
|
-
parsed.
|
|
13807
|
-
|
|
13808
|
-
if (parsed.host !== undefined) {
|
|
13809
|
-
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);
|
|
13810
14096
|
}
|
|
13811
14097
|
}
|
|
13812
14098
|
if (parsed.path) {
|
|
13813
14099
|
parsed.path = normalizePathEncoding(parsed.path);
|
|
13814
14100
|
}
|
|
14101
|
+
if (parsed.query) {
|
|
14102
|
+
parsed.query = normalizeQueryFragmentEncoding(parsed.query);
|
|
14103
|
+
}
|
|
13815
14104
|
if (parsed.fragment) {
|
|
13816
|
-
|
|
13817
|
-
parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
|
|
13818
|
-
} catch {
|
|
13819
|
-
parsed.error = parsed.error || "URI malformed";
|
|
13820
|
-
}
|
|
14105
|
+
parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
|
|
13821
14106
|
}
|
|
13822
14107
|
}
|
|
13823
14108
|
if (schemeHandler && schemeHandler.parse) {
|
|
13824
14109
|
schemeHandler.parse(parsed, options);
|
|
14110
|
+
if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {
|
|
14111
|
+
malformedSchemeSpecific = true;
|
|
14112
|
+
}
|
|
13825
14113
|
}
|
|
13826
14114
|
} else {
|
|
13827
14115
|
parsed.error = parsed.error || "URI can not be parsed.";
|
|
13828
14116
|
}
|
|
13829
|
-
return { parsed, malformedAuthorityOrPort };
|
|
14117
|
+
return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
|
|
13830
14118
|
}
|
|
13831
14119
|
function parse6(uri, opts) {
|
|
13832
14120
|
return parseWithStatus(uri, opts).parsed;
|
|
@@ -13835,20 +14123,28 @@ var require_fast_uri = __commonJS((exports, module) => {
|
|
|
13835
14123
|
return normalizeStringWithStatus(uri, opts).normalized;
|
|
13836
14124
|
}
|
|
13837
14125
|
function normalizeStringWithStatus(uri, opts) {
|
|
13838
|
-
const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
|
|
14126
|
+
const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
|
|
13839
14127
|
return {
|
|
13840
|
-
normalized: malformedAuthorityOrPort ? uri : serialize(parsed, opts),
|
|
13841
|
-
malformedAuthorityOrPort
|
|
14128
|
+
normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
|
|
14129
|
+
malformedAuthorityOrPort,
|
|
14130
|
+
malformedPercentEncoding,
|
|
14131
|
+
malformedSchemeSpecific,
|
|
14132
|
+
malformedHost,
|
|
14133
|
+
malformedScheme
|
|
13842
14134
|
};
|
|
13843
14135
|
}
|
|
13844
14136
|
function normalizeComparableURI(uri, opts) {
|
|
13845
|
-
if (typeof uri
|
|
13846
|
-
|
|
13847
|
-
return malformedAuthorityOrPort ? undefined : normalized;
|
|
14137
|
+
if (typeof uri !== "string" && typeof uri !== "object") {
|
|
14138
|
+
return;
|
|
13848
14139
|
}
|
|
13849
|
-
|
|
13850
|
-
|
|
14140
|
+
let value;
|
|
14141
|
+
try {
|
|
14142
|
+
value = typeof uri === "string" ? uri : serialize(uri, opts);
|
|
14143
|
+
} catch {
|
|
14144
|
+
return;
|
|
13851
14145
|
}
|
|
14146
|
+
const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
|
|
14147
|
+
return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
|
|
13852
14148
|
}
|
|
13853
14149
|
var fastUri = {
|
|
13854
14150
|
SCHEMES,
|
|
@@ -16723,709 +17019,8 @@ var init_usage = __esm(() => {
|
|
|
16723
17019
|
init_database();
|
|
16724
17020
|
});
|
|
16725
17021
|
|
|
16726
|
-
// ../../node_modules/.bun/is-docker@3.0.0/node_modules/is-docker/index.js
|
|
16727
|
-
import fs from "fs";
|
|
16728
|
-
function hasDockerEnv() {
|
|
16729
|
-
try {
|
|
16730
|
-
fs.statSync("/.dockerenv");
|
|
16731
|
-
return true;
|
|
16732
|
-
} catch {
|
|
16733
|
-
return false;
|
|
16734
|
-
}
|
|
16735
|
-
}
|
|
16736
|
-
function hasDockerCGroup() {
|
|
16737
|
-
try {
|
|
16738
|
-
return fs.readFileSync("/proc/self/cgroup", "utf8").includes("docker");
|
|
16739
|
-
} catch {
|
|
16740
|
-
return false;
|
|
16741
|
-
}
|
|
16742
|
-
}
|
|
16743
|
-
function isDocker() {
|
|
16744
|
-
if (isDockerCached === undefined) {
|
|
16745
|
-
isDockerCached = hasDockerEnv() || hasDockerCGroup();
|
|
16746
|
-
}
|
|
16747
|
-
return isDockerCached;
|
|
16748
|
-
}
|
|
16749
|
-
var isDockerCached;
|
|
16750
|
-
var init_is_docker = () => {};
|
|
16751
|
-
|
|
16752
|
-
// ../../node_modules/.bun/is-inside-container@1.0.0/node_modules/is-inside-container/index.js
|
|
16753
|
-
import fs2 from "fs";
|
|
16754
|
-
function isInsideContainer() {
|
|
16755
|
-
if (cachedResult === undefined) {
|
|
16756
|
-
cachedResult = hasContainerEnv() || isDocker();
|
|
16757
|
-
}
|
|
16758
|
-
return cachedResult;
|
|
16759
|
-
}
|
|
16760
|
-
var cachedResult, hasContainerEnv = () => {
|
|
16761
|
-
try {
|
|
16762
|
-
fs2.statSync("/run/.containerenv");
|
|
16763
|
-
return true;
|
|
16764
|
-
} catch {
|
|
16765
|
-
return false;
|
|
16766
|
-
}
|
|
16767
|
-
};
|
|
16768
|
-
var init_is_inside_container = __esm(() => {
|
|
16769
|
-
init_is_docker();
|
|
16770
|
-
});
|
|
16771
|
-
|
|
16772
|
-
// ../../node_modules/.bun/is-wsl@3.1.1/node_modules/is-wsl/index.js
|
|
16773
|
-
import process2 from "process";
|
|
16774
|
-
import os from "os";
|
|
16775
|
-
import fs3 from "fs";
|
|
16776
|
-
var isWsl = () => {
|
|
16777
|
-
if (process2.platform !== "linux") {
|
|
16778
|
-
return false;
|
|
16779
|
-
}
|
|
16780
|
-
if (os.release().toLowerCase().includes("microsoft")) {
|
|
16781
|
-
if (isInsideContainer()) {
|
|
16782
|
-
return false;
|
|
16783
|
-
}
|
|
16784
|
-
return true;
|
|
16785
|
-
}
|
|
16786
|
-
try {
|
|
16787
|
-
if (fs3.readFileSync("/proc/version", "utf8").toLowerCase().includes("microsoft")) {
|
|
16788
|
-
return !isInsideContainer();
|
|
16789
|
-
}
|
|
16790
|
-
} catch {}
|
|
16791
|
-
if (fs3.existsSync("/proc/sys/fs/binfmt_misc/WSLInterop") || fs3.existsSync("/run/WSL")) {
|
|
16792
|
-
return !isInsideContainer();
|
|
16793
|
-
}
|
|
16794
|
-
return false;
|
|
16795
|
-
}, is_wsl_default;
|
|
16796
|
-
var init_is_wsl = __esm(() => {
|
|
16797
|
-
init_is_inside_container();
|
|
16798
|
-
is_wsl_default = process2.env.__IS_WSL_TEST__ ? isWsl : isWsl();
|
|
16799
|
-
});
|
|
16800
|
-
|
|
16801
|
-
// ../../node_modules/.bun/powershell-utils@0.1.0/node_modules/powershell-utils/index.js
|
|
16802
|
-
import process3 from "process";
|
|
16803
|
-
import { Buffer as Buffer3 } from "buffer";
|
|
16804
|
-
import { promisify } from "util";
|
|
16805
|
-
import childProcess from "child_process";
|
|
16806
|
-
var execFile, powerShellPath = () => `${process3.env.SYSTEMROOT || process3.env.windir || String.raw`C:\Windows`}\\System32\\WindowsPowerShell\\v1.0\\powershell.exe`, executePowerShell = async (command, options = {}) => {
|
|
16807
|
-
const {
|
|
16808
|
-
powerShellPath: psPath,
|
|
16809
|
-
...execFileOptions
|
|
16810
|
-
} = options;
|
|
16811
|
-
const encodedCommand = executePowerShell.encodeCommand(command);
|
|
16812
|
-
return execFile(psPath ?? powerShellPath(), [
|
|
16813
|
-
...executePowerShell.argumentsPrefix,
|
|
16814
|
-
encodedCommand
|
|
16815
|
-
], {
|
|
16816
|
-
encoding: "utf8",
|
|
16817
|
-
...execFileOptions
|
|
16818
|
-
});
|
|
16819
|
-
};
|
|
16820
|
-
var init_powershell_utils = __esm(() => {
|
|
16821
|
-
execFile = promisify(childProcess.execFile);
|
|
16822
|
-
executePowerShell.argumentsPrefix = [
|
|
16823
|
-
"-NoProfile",
|
|
16824
|
-
"-NonInteractive",
|
|
16825
|
-
"-ExecutionPolicy",
|
|
16826
|
-
"Bypass",
|
|
16827
|
-
"-EncodedCommand"
|
|
16828
|
-
];
|
|
16829
|
-
executePowerShell.encodeCommand = (command) => Buffer3.from(command, "utf16le").toString("base64");
|
|
16830
|
-
executePowerShell.escapeArgument = (value) => `'${String(value).replaceAll("'", "''")}'`;
|
|
16831
|
-
});
|
|
16832
|
-
|
|
16833
|
-
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/utilities.js
|
|
16834
|
-
function parseMountPointFromConfig(content) {
|
|
16835
|
-
for (const line of content.split(`
|
|
16836
|
-
`)) {
|
|
16837
|
-
if (/^\s*#/.test(line)) {
|
|
16838
|
-
continue;
|
|
16839
|
-
}
|
|
16840
|
-
const match = /^\s*root\s*=\s*(?<mountPoint>"[^"]*"|'[^']*'|[^#]*)/.exec(line);
|
|
16841
|
-
if (!match) {
|
|
16842
|
-
continue;
|
|
16843
|
-
}
|
|
16844
|
-
return match.groups.mountPoint.trim().replaceAll(/^["']|["']$/g, "");
|
|
16845
|
-
}
|
|
16846
|
-
}
|
|
16847
|
-
|
|
16848
|
-
// ../../node_modules/.bun/wsl-utils@1.0.0/node_modules/wsl-utils/index.js
|
|
16849
|
-
import path from "path";
|
|
16850
|
-
import { promisify as promisify2 } from "util";
|
|
16851
|
-
import childProcess2 from "child_process";
|
|
16852
|
-
import fs4, { constants as fsConstants } from "fs/promises";
|
|
16853
|
-
var execFile2, wslDrivesMountPoint, powerShellPathFromWsl = async () => {
|
|
16854
|
-
const mountPoint = await wslDrivesMountPoint();
|
|
16855
|
-
return `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe`;
|
|
16856
|
-
}, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell = async () => {
|
|
16857
|
-
canAccessPowerShellPromise ??= (async () => {
|
|
16858
|
-
try {
|
|
16859
|
-
const psPath = await powerShellPath2();
|
|
16860
|
-
await fs4.access(psPath, fsConstants.X_OK);
|
|
16861
|
-
return true;
|
|
16862
|
-
} catch {
|
|
16863
|
-
return false;
|
|
16864
|
-
}
|
|
16865
|
-
})();
|
|
16866
|
-
return canAccessPowerShellPromise;
|
|
16867
|
-
}, wslDefaultBrowser = async () => {
|
|
16868
|
-
const psPath = await powerShellPath2();
|
|
16869
|
-
const command = String.raw`(Get-ItemProperty -Path "HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice").ProgId`;
|
|
16870
|
-
const { stdout } = await executePowerShell(command, {
|
|
16871
|
-
powerShellPath: psPath,
|
|
16872
|
-
cwd: path.dirname(psPath)
|
|
16873
|
-
});
|
|
16874
|
-
return stdout.trim();
|
|
16875
|
-
}, isUrl = (path2) => /^[a-z]+:\/\//i.test(path2), convertWslPathToWindows = async (paths) => {
|
|
16876
|
-
const isBatch = Array.isArray(paths);
|
|
16877
|
-
const pathArray = isBatch ? paths : [paths];
|
|
16878
|
-
const indicesToConvert = [];
|
|
16879
|
-
const pathsToConvert = [];
|
|
16880
|
-
for (const [index, path2] of pathArray.entries()) {
|
|
16881
|
-
if (!isUrl(path2)) {
|
|
16882
|
-
indicesToConvert.push(index);
|
|
16883
|
-
pathsToConvert.push(path2);
|
|
16884
|
-
}
|
|
16885
|
-
}
|
|
16886
|
-
const results = [...pathArray];
|
|
16887
|
-
if (pathsToConvert.length > 0) {
|
|
16888
|
-
try {
|
|
16889
|
-
const { stdout } = await execFile2("wslpath", ["-aw", ...pathsToConvert], { encoding: "utf8" });
|
|
16890
|
-
const convertedPaths = stdout.split(/\r?\n/).filter(Boolean);
|
|
16891
|
-
for (const [index, originalIndex] of indicesToConvert.entries()) {
|
|
16892
|
-
results[originalIndex] = convertedPaths[index] ?? pathArray[originalIndex];
|
|
16893
|
-
}
|
|
16894
|
-
} catch {}
|
|
16895
|
-
}
|
|
16896
|
-
return isBatch ? results : results[0];
|
|
16897
|
-
};
|
|
16898
|
-
var init_wsl_utils = __esm(() => {
|
|
16899
|
-
init_is_wsl();
|
|
16900
|
-
init_powershell_utils();
|
|
16901
|
-
init_is_wsl();
|
|
16902
|
-
execFile2 = promisify2(childProcess2.execFile);
|
|
16903
|
-
wslDrivesMountPoint = (() => {
|
|
16904
|
-
const defaultMountPoint = "/mnt/";
|
|
16905
|
-
let mountPoint;
|
|
16906
|
-
return async function() {
|
|
16907
|
-
if (mountPoint) {
|
|
16908
|
-
return mountPoint;
|
|
16909
|
-
}
|
|
16910
|
-
const configFilePath = "/etc/wsl.conf";
|
|
16911
|
-
let isConfigFileExists = false;
|
|
16912
|
-
try {
|
|
16913
|
-
await fs4.access(configFilePath, fsConstants.F_OK);
|
|
16914
|
-
isConfigFileExists = true;
|
|
16915
|
-
} catch {}
|
|
16916
|
-
if (!isConfigFileExists) {
|
|
16917
|
-
return defaultMountPoint;
|
|
16918
|
-
}
|
|
16919
|
-
const configContent = await fs4.readFile(configFilePath, { encoding: "utf8" });
|
|
16920
|
-
const parsedMountPoint = parseMountPointFromConfig(configContent);
|
|
16921
|
-
if (parsedMountPoint === undefined) {
|
|
16922
|
-
return defaultMountPoint;
|
|
16923
|
-
}
|
|
16924
|
-
mountPoint = parsedMountPoint;
|
|
16925
|
-
mountPoint = mountPoint.endsWith("/") ? mountPoint : `${mountPoint}/`;
|
|
16926
|
-
return mountPoint;
|
|
16927
|
-
};
|
|
16928
|
-
})();
|
|
16929
|
-
powerShellPath2 = is_wsl_default ? powerShellPathFromWsl : powerShellPath;
|
|
16930
|
-
});
|
|
16931
|
-
|
|
16932
|
-
// ../../node_modules/.bun/powershell-utils@0.2.0/node_modules/powershell-utils/index.js
|
|
16933
|
-
import process4 from "process";
|
|
16934
|
-
import { Buffer as Buffer4 } from "buffer";
|
|
16935
|
-
import { promisify as promisify3 } from "util";
|
|
16936
|
-
import childProcess3 from "child_process";
|
|
16937
|
-
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 = {}) => {
|
|
16938
|
-
const {
|
|
16939
|
-
powerShellPath: psPath,
|
|
16940
|
-
...execFileOptions
|
|
16941
|
-
} = options;
|
|
16942
|
-
return execFile3(psPath ?? powerShellPath3(), createArguments(command), {
|
|
16943
|
-
encoding: "utf8",
|
|
16944
|
-
...execFileOptions
|
|
16945
|
-
});
|
|
16946
|
-
};
|
|
16947
|
-
var init_powershell_utils2 = __esm(() => {
|
|
16948
|
-
execFile3 = promisify3(childProcess3.execFile);
|
|
16949
|
-
argumentsPrefix = [
|
|
16950
|
-
"-NoProfile",
|
|
16951
|
-
"-NonInteractive",
|
|
16952
|
-
"-ExecutionPolicy",
|
|
16953
|
-
"Bypass",
|
|
16954
|
-
"-EncodedCommand"
|
|
16955
|
-
];
|
|
16956
|
-
executePowerShell2.argumentsPrefix = argumentsPrefix;
|
|
16957
|
-
executePowerShell2.encodeCommand = encodeCommand;
|
|
16958
|
-
executePowerShell2.escapeArgument = escapeArgument;
|
|
16959
|
-
executePowerShell2.createArguments = createArguments;
|
|
16960
|
-
});
|
|
16961
|
-
|
|
16962
|
-
// ../../node_modules/.bun/define-lazy-prop@3.0.0/node_modules/define-lazy-prop/index.js
|
|
16963
|
-
function defineLazyProperty(object4, propertyName, valueGetter) {
|
|
16964
|
-
const define = (value) => Object.defineProperty(object4, propertyName, { value, enumerable: true, writable: true });
|
|
16965
|
-
Object.defineProperty(object4, propertyName, {
|
|
16966
|
-
configurable: true,
|
|
16967
|
-
enumerable: true,
|
|
16968
|
-
get() {
|
|
16969
|
-
const result = valueGetter();
|
|
16970
|
-
define(result);
|
|
16971
|
-
return result;
|
|
16972
|
-
},
|
|
16973
|
-
set(value) {
|
|
16974
|
-
define(value);
|
|
16975
|
-
}
|
|
16976
|
-
});
|
|
16977
|
-
return object4;
|
|
16978
|
-
}
|
|
16979
|
-
|
|
16980
|
-
// ../../node_modules/.bun/default-browser-id@5.0.1/node_modules/default-browser-id/index.js
|
|
16981
|
-
import { promisify as promisify4 } from "util";
|
|
16982
|
-
import process5 from "process";
|
|
16983
|
-
import { execFile as execFile4 } from "child_process";
|
|
16984
|
-
async function defaultBrowserId() {
|
|
16985
|
-
if (process5.platform !== "darwin") {
|
|
16986
|
-
throw new Error("macOS only");
|
|
16987
|
-
}
|
|
16988
|
-
const { stdout } = await execFileAsync("defaults", ["read", "com.apple.LaunchServices/com.apple.launchservices.secure", "LSHandlers"]);
|
|
16989
|
-
const match = /LSHandlerRoleAll = "(?!-)(?<id>[^"]+?)";\s+?LSHandlerURLScheme = (?:http|https);/.exec(stdout);
|
|
16990
|
-
const browserId = match?.groups.id ?? "com.apple.Safari";
|
|
16991
|
-
if (browserId === "com.apple.safari") {
|
|
16992
|
-
return "com.apple.Safari";
|
|
16993
|
-
}
|
|
16994
|
-
return browserId;
|
|
16995
|
-
}
|
|
16996
|
-
var execFileAsync;
|
|
16997
|
-
var init_default_browser_id = __esm(() => {
|
|
16998
|
-
execFileAsync = promisify4(execFile4);
|
|
16999
|
-
});
|
|
17000
|
-
|
|
17001
|
-
// ../../node_modules/.bun/run-applescript@7.1.0/node_modules/run-applescript/index.js
|
|
17002
|
-
import process6 from "process";
|
|
17003
|
-
import { promisify as promisify5 } from "util";
|
|
17004
|
-
import { execFile as execFile5, execFileSync } from "child_process";
|
|
17005
|
-
async function runAppleScript(script, { humanReadableOutput = true, signal } = {}) {
|
|
17006
|
-
if (process6.platform !== "darwin") {
|
|
17007
|
-
throw new Error("macOS only");
|
|
17008
|
-
}
|
|
17009
|
-
const outputArguments = humanReadableOutput ? [] : ["-ss"];
|
|
17010
|
-
const execOptions = {};
|
|
17011
|
-
if (signal) {
|
|
17012
|
-
execOptions.signal = signal;
|
|
17013
|
-
}
|
|
17014
|
-
const { stdout } = await execFileAsync2("osascript", ["-e", script, outputArguments], execOptions);
|
|
17015
|
-
return stdout.trim();
|
|
17016
|
-
}
|
|
17017
|
-
var execFileAsync2;
|
|
17018
|
-
var init_run_applescript = __esm(() => {
|
|
17019
|
-
execFileAsync2 = promisify5(execFile5);
|
|
17020
|
-
});
|
|
17021
|
-
|
|
17022
|
-
// ../../node_modules/.bun/bundle-name@4.1.0/node_modules/bundle-name/index.js
|
|
17023
|
-
async function bundleName(bundleId) {
|
|
17024
|
-
return runAppleScript(`tell application "Finder" to set app_path to application file id "${bundleId}" as string
|
|
17025
|
-
tell application "System Events" to get value of property list item "CFBundleName" of property list file (app_path & ":Contents:Info.plist")`);
|
|
17026
|
-
}
|
|
17027
|
-
var init_bundle_name = __esm(() => {
|
|
17028
|
-
init_run_applescript();
|
|
17029
|
-
});
|
|
17030
|
-
|
|
17031
|
-
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/windows.js
|
|
17032
|
-
import process7 from "process";
|
|
17033
|
-
import { promisify as promisify6 } from "util";
|
|
17034
|
-
import { execFile as execFile6 } from "child_process";
|
|
17035
|
-
async function defaultBrowser(_execFileAsync = execFileAsync3) {
|
|
17036
|
-
const regPath = `${process7.env.SYSTEMROOT ?? process7.env.windir ?? "C:\\Windows"}\\System32\\reg.exe`;
|
|
17037
|
-
const { stdout } = await _execFileAsync(regPath, [
|
|
17038
|
-
"QUERY",
|
|
17039
|
-
" HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\http\\UserChoice",
|
|
17040
|
-
"/v",
|
|
17041
|
-
"ProgId"
|
|
17042
|
-
]);
|
|
17043
|
-
const match = /ProgId\s*REG_SZ\s*(?<id>\S+)/.exec(stdout);
|
|
17044
|
-
if (!match) {
|
|
17045
|
-
throw new UnknownBrowserError(`Cannot find Windows browser in stdout: ${JSON.stringify(stdout)}`);
|
|
17046
|
-
}
|
|
17047
|
-
const { id } = match.groups;
|
|
17048
|
-
const dotIndex = id.lastIndexOf(".");
|
|
17049
|
-
const hyphenIndex = id.lastIndexOf("-");
|
|
17050
|
-
const baseIdByDot = dotIndex === -1 ? undefined : id.slice(0, dotIndex);
|
|
17051
|
-
const baseIdByHyphen = hyphenIndex === -1 ? undefined : id.slice(0, hyphenIndex);
|
|
17052
|
-
return windowsBrowserProgIds[id] ?? windowsBrowserProgIds[baseIdByDot] ?? windowsBrowserProgIds[baseIdByHyphen] ?? { name: id, id };
|
|
17053
|
-
}
|
|
17054
|
-
var execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError;
|
|
17055
|
-
var init_windows = __esm(() => {
|
|
17056
|
-
execFileAsync3 = promisify6(execFile6);
|
|
17057
|
-
windowsBrowserProgIds = {
|
|
17058
|
-
MSEdgeHTM: { name: "Edge", id: "com.microsoft.edge" },
|
|
17059
|
-
MSEdgeBHTML: { name: "Edge Beta", id: "com.microsoft.edge.beta" },
|
|
17060
|
-
MSEdgeDHTML: { name: "Edge Dev", id: "com.microsoft.edge.dev" },
|
|
17061
|
-
AppXq0fevzme2pys62n3e0fbqa7peapykr8v: { name: "Edge", id: "com.microsoft.edge.old" },
|
|
17062
|
-
ChromeHTML: { name: "Chrome", id: "com.google.chrome" },
|
|
17063
|
-
ChromeBHTML: { name: "Chrome Beta", id: "com.google.chrome.beta" },
|
|
17064
|
-
ChromeDHTML: { name: "Chrome Dev", id: "com.google.chrome.dev" },
|
|
17065
|
-
ChromiumHTM: { name: "Chromium", id: "org.chromium.Chromium" },
|
|
17066
|
-
BraveHTML: { name: "Brave", id: "com.brave.Browser" },
|
|
17067
|
-
BraveBHTML: { name: "Brave Beta", id: "com.brave.Browser.beta" },
|
|
17068
|
-
BraveDHTML: { name: "Brave Dev", id: "com.brave.Browser.dev" },
|
|
17069
|
-
BraveSSHTM: { name: "Brave Nightly", id: "com.brave.Browser.nightly" },
|
|
17070
|
-
FirefoxURL: { name: "Firefox", id: "org.mozilla.firefox" },
|
|
17071
|
-
OperaStable: { name: "Opera", id: "com.operasoftware.Opera" },
|
|
17072
|
-
VivaldiHTM: { name: "Vivaldi", id: "com.vivaldi.Vivaldi" },
|
|
17073
|
-
"IE.HTTP": { name: "Internet Explorer", id: "com.microsoft.ie" }
|
|
17074
|
-
};
|
|
17075
|
-
_windowsBrowserProgIdMap = new Map(Object.entries(windowsBrowserProgIds));
|
|
17076
|
-
UnknownBrowserError = class UnknownBrowserError extends Error {
|
|
17077
|
-
};
|
|
17078
|
-
});
|
|
17079
|
-
|
|
17080
|
-
// ../../node_modules/.bun/default-browser@5.5.1/node_modules/default-browser/index.js
|
|
17081
|
-
import { promisify as promisify7 } from "util";
|
|
17082
|
-
import process8 from "process";
|
|
17083
|
-
import { execFile as execFile7 } from "child_process";
|
|
17084
|
-
async function defaultBrowser2() {
|
|
17085
|
-
if (process8.platform === "darwin") {
|
|
17086
|
-
const id = await defaultBrowserId();
|
|
17087
|
-
const name = await bundleName(id);
|
|
17088
|
-
return { name, id };
|
|
17089
|
-
}
|
|
17090
|
-
if (process8.platform === "linux") {
|
|
17091
|
-
const { stdout } = await execFileAsync4("xdg-mime", ["query", "default", "x-scheme-handler/http"]);
|
|
17092
|
-
const id = stdout.trim();
|
|
17093
|
-
const name = titleize(id.replace(/.desktop$/, "").replace("-", " "));
|
|
17094
|
-
return { name, id };
|
|
17095
|
-
}
|
|
17096
|
-
if (process8.platform === "win32") {
|
|
17097
|
-
return defaultBrowser();
|
|
17098
|
-
}
|
|
17099
|
-
throw new Error("Only macOS, Linux, and Windows are supported");
|
|
17100
|
-
}
|
|
17101
|
-
var execFileAsync4, titleize = (string4) => string4.toLowerCase().replaceAll(/(?:^|\s|-)\S/g, (x) => x.toUpperCase());
|
|
17102
|
-
var init_default_browser = __esm(() => {
|
|
17103
|
-
init_default_browser_id();
|
|
17104
|
-
init_bundle_name();
|
|
17105
|
-
init_windows();
|
|
17106
|
-
init_windows();
|
|
17107
|
-
execFileAsync4 = promisify7(execFile7);
|
|
17108
|
-
});
|
|
17109
|
-
|
|
17110
|
-
// ../../node_modules/.bun/is-in-ssh@1.0.0/node_modules/is-in-ssh/index.js
|
|
17111
|
-
import process9 from "process";
|
|
17112
|
-
var isInSsh, is_in_ssh_default;
|
|
17113
|
-
var init_is_in_ssh = __esm(() => {
|
|
17114
|
-
isInSsh = Boolean(process9.env.SSH_CONNECTION || process9.env.SSH_CLIENT || process9.env.SSH_TTY);
|
|
17115
|
-
is_in_ssh_default = isInSsh;
|
|
17116
|
-
});
|
|
17117
|
-
|
|
17118
|
-
// ../../node_modules/.bun/open@11.0.1/node_modules/open/index.js
|
|
17119
|
-
import process10 from "process";
|
|
17120
|
-
import path2 from "path";
|
|
17121
|
-
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
17122
|
-
import childProcess4 from "child_process";
|
|
17123
|
-
import fs5, { constants as fsConstants2 } from "fs/promises";
|
|
17124
|
-
function detectArchBinary(binary) {
|
|
17125
|
-
if (typeof binary === "string" || Array.isArray(binary)) {
|
|
17126
|
-
return binary;
|
|
17127
|
-
}
|
|
17128
|
-
const { [arch]: archBinary } = binary;
|
|
17129
|
-
if (!archBinary) {
|
|
17130
|
-
throw new Error(`${arch} is not supported`);
|
|
17131
|
-
}
|
|
17132
|
-
return archBinary;
|
|
17133
|
-
}
|
|
17134
|
-
function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
|
|
17135
|
-
if (wsl && is_wsl_default) {
|
|
17136
|
-
return detectArchBinary(wsl);
|
|
17137
|
-
}
|
|
17138
|
-
if (!platformBinary) {
|
|
17139
|
-
throw new Error(`${platform} is not supported`);
|
|
17140
|
-
}
|
|
17141
|
-
return detectArchBinary(platformBinary);
|
|
17142
|
-
}
|
|
17143
|
-
var fallbackAttemptSymbol, __dirname6, localXdgOpenPath, platform, arch, tryEachApp = async (apps, opener) => {
|
|
17144
|
-
if (apps.length === 0) {
|
|
17145
|
-
return;
|
|
17146
|
-
}
|
|
17147
|
-
const errors4 = [];
|
|
17148
|
-
for (const app of apps) {
|
|
17149
|
-
try {
|
|
17150
|
-
return await opener(app);
|
|
17151
|
-
} catch (error2) {
|
|
17152
|
-
errors4.push(error2);
|
|
17153
|
-
}
|
|
17154
|
-
}
|
|
17155
|
-
throw new AggregateError(errors4, "Failed to open in all supported apps");
|
|
17156
|
-
}, baseOpen = async (options) => {
|
|
17157
|
-
options = {
|
|
17158
|
-
wait: false,
|
|
17159
|
-
background: false,
|
|
17160
|
-
newInstance: false,
|
|
17161
|
-
allowNonzeroExitCode: false,
|
|
17162
|
-
...options
|
|
17163
|
-
};
|
|
17164
|
-
const isFallbackAttempt = options[fallbackAttemptSymbol] === true;
|
|
17165
|
-
delete options[fallbackAttemptSymbol];
|
|
17166
|
-
if (Array.isArray(options.app)) {
|
|
17167
|
-
return tryEachApp(options.app, (singleApp) => baseOpen({
|
|
17168
|
-
...options,
|
|
17169
|
-
app: singleApp,
|
|
17170
|
-
[fallbackAttemptSymbol]: true
|
|
17171
|
-
}));
|
|
17172
|
-
}
|
|
17173
|
-
let { name: app, arguments: appArguments = [] } = options.app ?? {};
|
|
17174
|
-
appArguments = [...appArguments];
|
|
17175
|
-
if (Array.isArray(app)) {
|
|
17176
|
-
return tryEachApp(app, (appName) => baseOpen({
|
|
17177
|
-
...options,
|
|
17178
|
-
app: {
|
|
17179
|
-
name: appName,
|
|
17180
|
-
arguments: appArguments
|
|
17181
|
-
},
|
|
17182
|
-
[fallbackAttemptSymbol]: true
|
|
17183
|
-
}));
|
|
17184
|
-
}
|
|
17185
|
-
if (app === "browser" || app === "browserPrivate") {
|
|
17186
|
-
const ids = {
|
|
17187
|
-
"com.google.chrome": "chrome",
|
|
17188
|
-
"google-chrome.desktop": "chrome",
|
|
17189
|
-
"com.brave.browser": "brave",
|
|
17190
|
-
"org.mozilla.firefox": "firefox",
|
|
17191
|
-
"firefox.desktop": "firefox",
|
|
17192
|
-
"com.microsoft.msedge": "edge",
|
|
17193
|
-
"com.microsoft.edge": "edge",
|
|
17194
|
-
"com.microsoft.edgemac": "edge",
|
|
17195
|
-
"microsoft-edge.desktop": "edge",
|
|
17196
|
-
"com.apple.safari": "safari"
|
|
17197
|
-
};
|
|
17198
|
-
const flags = {
|
|
17199
|
-
chrome: "--incognito",
|
|
17200
|
-
brave: "--incognito",
|
|
17201
|
-
firefox: "--private-window",
|
|
17202
|
-
edge: "--inPrivate"
|
|
17203
|
-
};
|
|
17204
|
-
let browser;
|
|
17205
|
-
if (is_wsl_default) {
|
|
17206
|
-
const progId = await wslDefaultBrowser();
|
|
17207
|
-
const browserInfo = _windowsBrowserProgIdMap.get(progId);
|
|
17208
|
-
browser = browserInfo ?? {};
|
|
17209
|
-
} else {
|
|
17210
|
-
browser = await defaultBrowser2();
|
|
17211
|
-
}
|
|
17212
|
-
if (browser.id in ids) {
|
|
17213
|
-
const browserName = ids[browser.id.toLowerCase()];
|
|
17214
|
-
if (app === "browserPrivate") {
|
|
17215
|
-
if (browserName === "safari") {
|
|
17216
|
-
throw new Error("Safari doesn't support opening in private mode via command line");
|
|
17217
|
-
}
|
|
17218
|
-
appArguments.push(flags[browserName]);
|
|
17219
|
-
}
|
|
17220
|
-
return baseOpen({
|
|
17221
|
-
...options,
|
|
17222
|
-
app: {
|
|
17223
|
-
name: apps[browserName],
|
|
17224
|
-
arguments: appArguments
|
|
17225
|
-
}
|
|
17226
|
-
});
|
|
17227
|
-
}
|
|
17228
|
-
throw new Error(`${browser.name} is not supported as a default browser`);
|
|
17229
|
-
}
|
|
17230
|
-
let command;
|
|
17231
|
-
const cliArguments = [];
|
|
17232
|
-
const childProcessOptions = {};
|
|
17233
|
-
let shouldUseWindowsInWsl = false;
|
|
17234
|
-
if (is_wsl_default && !isInsideContainer() && !is_in_ssh_default && !app) {
|
|
17235
|
-
shouldUseWindowsInWsl = await canAccessPowerShell();
|
|
17236
|
-
}
|
|
17237
|
-
if (platform === "darwin") {
|
|
17238
|
-
command = "open";
|
|
17239
|
-
if (options.wait) {
|
|
17240
|
-
cliArguments.push("--wait-apps");
|
|
17241
|
-
}
|
|
17242
|
-
if (options.background) {
|
|
17243
|
-
cliArguments.push("--background");
|
|
17244
|
-
}
|
|
17245
|
-
if (options.newInstance) {
|
|
17246
|
-
cliArguments.push("--new");
|
|
17247
|
-
}
|
|
17248
|
-
if (app) {
|
|
17249
|
-
cliArguments.push("-a", app);
|
|
17250
|
-
}
|
|
17251
|
-
} else if (platform === "win32" || shouldUseWindowsInWsl) {
|
|
17252
|
-
command = await powerShellPath2();
|
|
17253
|
-
cliArguments.push(...executePowerShell2.argumentsPrefix);
|
|
17254
|
-
if (!is_wsl_default) {
|
|
17255
|
-
childProcessOptions.windowsVerbatimArguments = true;
|
|
17256
|
-
}
|
|
17257
|
-
if (is_wsl_default && options.target) {
|
|
17258
|
-
options.target = await convertWslPathToWindows(options.target);
|
|
17259
|
-
}
|
|
17260
|
-
const encodedArguments = ["$ProgressPreference = 'SilentlyContinue';", "Start"];
|
|
17261
|
-
if (options.wait) {
|
|
17262
|
-
encodedArguments.push("-Wait");
|
|
17263
|
-
}
|
|
17264
|
-
if (app) {
|
|
17265
|
-
encodedArguments.push(executePowerShell2.escapeArgument(app));
|
|
17266
|
-
if (options.target) {
|
|
17267
|
-
appArguments.push(options.target);
|
|
17268
|
-
}
|
|
17269
|
-
} else if (options.target) {
|
|
17270
|
-
encodedArguments.push(executePowerShell2.escapeArgument(options.target));
|
|
17271
|
-
}
|
|
17272
|
-
if (appArguments.length > 0) {
|
|
17273
|
-
appArguments = appArguments.map((argument) => executePowerShell2.escapeArgument(argument));
|
|
17274
|
-
encodedArguments.push("-ArgumentList", appArguments.join(","));
|
|
17275
|
-
}
|
|
17276
|
-
options.target = executePowerShell2.encodeCommand(encodedArguments.join(" "));
|
|
17277
|
-
if (!options.wait) {
|
|
17278
|
-
childProcessOptions.stdio = "ignore";
|
|
17279
|
-
}
|
|
17280
|
-
if (is_wsl_default) {
|
|
17281
|
-
childProcessOptions.cwd = path2.dirname(command);
|
|
17282
|
-
}
|
|
17283
|
-
} else {
|
|
17284
|
-
if (app) {
|
|
17285
|
-
command = app;
|
|
17286
|
-
} else {
|
|
17287
|
-
const isBundled = !__dirname6 || __dirname6 === "/";
|
|
17288
|
-
let exeLocalXdgOpen = false;
|
|
17289
|
-
try {
|
|
17290
|
-
await fs5.access(localXdgOpenPath, fsConstants2.X_OK);
|
|
17291
|
-
exeLocalXdgOpen = true;
|
|
17292
|
-
} catch {}
|
|
17293
|
-
const useSystemXdgOpen = process10.versions.electron ?? (platform === "android" || isBundled || !exeLocalXdgOpen);
|
|
17294
|
-
command = useSystemXdgOpen ? "xdg-open" : localXdgOpenPath;
|
|
17295
|
-
}
|
|
17296
|
-
if (appArguments.length > 0) {
|
|
17297
|
-
cliArguments.push(...appArguments);
|
|
17298
|
-
}
|
|
17299
|
-
if (!options.wait) {
|
|
17300
|
-
childProcessOptions.stdio = "ignore";
|
|
17301
|
-
childProcessOptions.detached = true;
|
|
17302
|
-
}
|
|
17303
|
-
}
|
|
17304
|
-
if (platform === "darwin" && appArguments.length > 0) {
|
|
17305
|
-
cliArguments.push("--args", ...appArguments);
|
|
17306
|
-
}
|
|
17307
|
-
if (options.target) {
|
|
17308
|
-
cliArguments.push(options.target);
|
|
17309
|
-
}
|
|
17310
|
-
const subprocess = childProcess4.spawn(command, cliArguments, childProcessOptions);
|
|
17311
|
-
if (options.wait) {
|
|
17312
|
-
return new Promise((resolve2, reject) => {
|
|
17313
|
-
subprocess.once("error", reject);
|
|
17314
|
-
subprocess.once("close", (exitCode) => {
|
|
17315
|
-
if (!options.allowNonzeroExitCode && exitCode !== 0) {
|
|
17316
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
17317
|
-
return;
|
|
17318
|
-
}
|
|
17319
|
-
resolve2(subprocess);
|
|
17320
|
-
});
|
|
17321
|
-
});
|
|
17322
|
-
}
|
|
17323
|
-
if (isFallbackAttempt) {
|
|
17324
|
-
return new Promise((resolve2, reject) => {
|
|
17325
|
-
subprocess.once("error", reject);
|
|
17326
|
-
subprocess.once("spawn", () => {
|
|
17327
|
-
subprocess.once("close", (exitCode) => {
|
|
17328
|
-
subprocess.off("error", reject);
|
|
17329
|
-
if (exitCode !== 0) {
|
|
17330
|
-
reject(new Error(`Exited with code ${exitCode}`));
|
|
17331
|
-
return;
|
|
17332
|
-
}
|
|
17333
|
-
subprocess.unref();
|
|
17334
|
-
resolve2(subprocess);
|
|
17335
|
-
});
|
|
17336
|
-
});
|
|
17337
|
-
});
|
|
17338
|
-
}
|
|
17339
|
-
subprocess.unref();
|
|
17340
|
-
return new Promise((resolve2, reject) => {
|
|
17341
|
-
subprocess.once("error", reject);
|
|
17342
|
-
subprocess.once("spawn", () => {
|
|
17343
|
-
subprocess.off("error", reject);
|
|
17344
|
-
resolve2(subprocess);
|
|
17345
|
-
});
|
|
17346
|
-
});
|
|
17347
|
-
}, open = (target, options) => {
|
|
17348
|
-
if (typeof target !== "string") {
|
|
17349
|
-
throw new TypeError("Expected a `target`");
|
|
17350
|
-
}
|
|
17351
|
-
return baseOpen({
|
|
17352
|
-
...options,
|
|
17353
|
-
target
|
|
17354
|
-
});
|
|
17355
|
-
}, apps, open_default;
|
|
17356
|
-
var init_open = __esm(() => {
|
|
17357
|
-
init_wsl_utils();
|
|
17358
|
-
init_powershell_utils2();
|
|
17359
|
-
init_default_browser();
|
|
17360
|
-
init_is_inside_container();
|
|
17361
|
-
init_is_in_ssh();
|
|
17362
|
-
fallbackAttemptSymbol = Symbol("fallbackAttempt");
|
|
17363
|
-
__dirname6 = import.meta.url ? path2.dirname(fileURLToPath6(import.meta.url)) : "";
|
|
17364
|
-
localXdgOpenPath = path2.join(__dirname6, "xdg-open");
|
|
17365
|
-
({ platform, arch } = process10);
|
|
17366
|
-
apps = {
|
|
17367
|
-
browser: "browser",
|
|
17368
|
-
browserPrivate: "browserPrivate"
|
|
17369
|
-
};
|
|
17370
|
-
defineLazyProperty(apps, "chrome", () => detectPlatformBinary({
|
|
17371
|
-
darwin: "google chrome",
|
|
17372
|
-
win32: "chrome",
|
|
17373
|
-
linux: ["google-chrome", "google-chrome-stable", "chromium", "chromium-browser"]
|
|
17374
|
-
}, {
|
|
17375
|
-
wsl: {
|
|
17376
|
-
ia32: "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
17377
|
-
x64: ["/mnt/c/Program Files/Google/Chrome/Application/chrome.exe", "/mnt/c/Program Files (x86)/Google/Chrome/Application/chrome.exe"]
|
|
17378
|
-
}
|
|
17379
|
-
}));
|
|
17380
|
-
defineLazyProperty(apps, "brave", () => detectPlatformBinary({
|
|
17381
|
-
darwin: "brave browser",
|
|
17382
|
-
win32: "brave",
|
|
17383
|
-
linux: ["brave-browser", "brave"]
|
|
17384
|
-
}, {
|
|
17385
|
-
wsl: {
|
|
17386
|
-
ia32: "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
|
|
17387
|
-
x64: ["/mnt/c/Program Files/BraveSoftware/Brave-Browser/Application/brave.exe", "/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe"]
|
|
17388
|
-
}
|
|
17389
|
-
}));
|
|
17390
|
-
defineLazyProperty(apps, "firefox", () => detectPlatformBinary({
|
|
17391
|
-
darwin: "firefox",
|
|
17392
|
-
win32: String.raw`C:\Program Files\Mozilla Firefox\firefox.exe`,
|
|
17393
|
-
linux: "firefox"
|
|
17394
|
-
}, {
|
|
17395
|
-
wsl: "/mnt/c/Program Files/Mozilla Firefox/firefox.exe"
|
|
17396
|
-
}));
|
|
17397
|
-
defineLazyProperty(apps, "edge", () => detectPlatformBinary({
|
|
17398
|
-
darwin: "microsoft edge",
|
|
17399
|
-
win32: "msedge",
|
|
17400
|
-
linux: ["microsoft-edge", "microsoft-edge-dev"]
|
|
17401
|
-
}, {
|
|
17402
|
-
wsl: "/mnt/c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe"
|
|
17403
|
-
}));
|
|
17404
|
-
defineLazyProperty(apps, "safari", () => detectPlatformBinary({
|
|
17405
|
-
darwin: "Safari"
|
|
17406
|
-
}));
|
|
17407
|
-
open_default = open;
|
|
17408
|
-
});
|
|
17409
|
-
|
|
17410
|
-
// src/lib/open-browser.ts
|
|
17411
|
-
var exports_open_browser = {};
|
|
17412
|
-
__export(exports_open_browser, {
|
|
17413
|
-
openBrowser: () => openBrowser
|
|
17414
|
-
});
|
|
17415
|
-
async function openBrowser(url) {
|
|
17416
|
-
try {
|
|
17417
|
-
await open_default(url);
|
|
17418
|
-
return { ok: true };
|
|
17419
|
-
} catch (error2) {
|
|
17420
|
-
return { ok: false, error: error2 };
|
|
17421
|
-
}
|
|
17422
|
-
}
|
|
17423
|
-
var init_open_browser = __esm(() => {
|
|
17424
|
-
init_open();
|
|
17425
|
-
});
|
|
17426
|
-
|
|
17427
17022
|
// src/server/serve.ts
|
|
17428
|
-
import { existsSync as
|
|
17023
|
+
import { existsSync as existsSync17, readdirSync as readdirSync9, readFileSync as readFileSync10, writeFileSync as writeFileSync8, mkdirSync as mkdirSync10 } from "fs";
|
|
17429
17024
|
|
|
17430
17025
|
// src/db/agents.ts
|
|
17431
17026
|
init_database();
|
|
@@ -17666,13 +17261,12 @@ async function runWorkflow(workflow) {
|
|
|
17666
17261
|
|
|
17667
17262
|
// src/server/serve.ts
|
|
17668
17263
|
init_database();
|
|
17669
|
-
import { join as join16,
|
|
17670
|
-
import { fileURLToPath as fileURLToPath7 } from "url";
|
|
17264
|
+
import { join as join16, basename as basename3 } from "path";
|
|
17671
17265
|
|
|
17672
17266
|
// src/lib/registry.ts
|
|
17673
17267
|
init_builtins();
|
|
17674
17268
|
import { existsSync as existsSync10, readFileSync as readFileSync5 } from "fs";
|
|
17675
|
-
import { join as
|
|
17269
|
+
import { join as join10, dirname as dirname4 } from "path";
|
|
17676
17270
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
17677
17271
|
|
|
17678
17272
|
// src/lib/fuzzy.ts
|
|
@@ -26105,15 +25699,15 @@ function loadConnectorVersions() {
|
|
|
26105
25699
|
versionsLoaded = true;
|
|
26106
25700
|
const thisDir = dirname4(fileURLToPath3(import.meta.url));
|
|
26107
25701
|
const candidates = [
|
|
26108
|
-
|
|
26109
|
-
|
|
25702
|
+
join10(thisDir, "..", "connectors"),
|
|
25703
|
+
join10(thisDir, "..", "..", "connectors")
|
|
26110
25704
|
];
|
|
26111
25705
|
const connectorsDir = candidates.find((d) => existsSync10(d));
|
|
26112
25706
|
if (!connectorsDir)
|
|
26113
25707
|
return;
|
|
26114
25708
|
for (const connector of CONNECTORS) {
|
|
26115
25709
|
try {
|
|
26116
|
-
const pkgPath =
|
|
25710
|
+
const pkgPath = join10(getConnectorPackagePath(connectorsDir, connector.name), "package.json");
|
|
26117
25711
|
if (existsSync10(pkgPath)) {
|
|
26118
25712
|
const pkg = JSON.parse(readFileSync5(pkgPath, "utf-8"));
|
|
26119
25713
|
connector.version = pkg.version || "0.0.0";
|
|
@@ -26209,7 +25803,7 @@ async function getConnectorCapabilityManifest(options = {}) {
|
|
|
26209
25803
|
// src/server/serve.ts
|
|
26210
25804
|
init_auth();
|
|
26211
25805
|
|
|
26212
|
-
// ../../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
|
|
26213
25807
|
var import_content_type = __toESM(require_content_type(), 1);
|
|
26214
25808
|
function mediaTypeEssence(header) {
|
|
26215
25809
|
if (!header) {
|
|
@@ -26232,7 +25826,7 @@ function isJsonContentType(header) {
|
|
|
26232
25826
|
return mediaTypeEssence(header) === "application/json";
|
|
26233
25827
|
}
|
|
26234
25828
|
|
|
26235
|
-
// ../../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
|
|
26236
25830
|
var DEFAULT_SSE_KEEP_ALIVE_MS = 15000;
|
|
26237
25831
|
var MAX_TIMER_DELAY_MS = 2 ** 31 - 1;
|
|
26238
25832
|
function armSseKeepAlive(intervalMs, onTick) {
|
|
@@ -30699,7 +30293,7 @@ function preprocess(fn, schema) {
|
|
|
30699
30293
|
// ../../node_modules/.bun/zod@3.25.76/node_modules/zod/v4/classic/external.js
|
|
30700
30294
|
config(en_default2());
|
|
30701
30295
|
|
|
30702
|
-
// ../../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
|
|
30703
30297
|
var LATEST_PROTOCOL_VERSION = "2025-11-25";
|
|
30704
30298
|
var DEFAULT_NEGOTIATED_PROTOCOL_VERSION = "2025-03-26";
|
|
30705
30299
|
var SUPPORTED_PROTOCOL_VERSIONS = [LATEST_PROTOCOL_VERSION, "2025-06-18", "2025-03-26", "2024-11-05", "2024-10-07"];
|
|
@@ -31546,7 +31140,7 @@ class UrlElicitationRequiredError extends McpError {
|
|
|
31546
31140
|
}
|
|
31547
31141
|
}
|
|
31548
31142
|
|
|
31549
|
-
// ../../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
|
|
31550
31144
|
class WebStandardStreamableHTTPServerTransport {
|
|
31551
31145
|
constructor(options = {}) {
|
|
31552
31146
|
this._started = false;
|
|
@@ -32244,7 +31838,7 @@ function object2(shape, params) {
|
|
|
32244
31838
|
};
|
|
32245
31839
|
return new ZodMiniObject(def);
|
|
32246
31840
|
}
|
|
32247
|
-
// ../../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
|
|
32248
31842
|
function isZ4Schema(s) {
|
|
32249
31843
|
const schema = s;
|
|
32250
31844
|
return !!schema._zod;
|
|
@@ -32405,7 +31999,7 @@ function getLiteralValue(schema) {
|
|
|
32405
31999
|
return;
|
|
32406
32000
|
}
|
|
32407
32001
|
|
|
32408
|
-
// ../../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
|
|
32409
32003
|
function isTerminal(status) {
|
|
32410
32004
|
return status === "completed" || status === "failed" || status === "cancelled";
|
|
32411
32005
|
}
|
|
@@ -33646,7 +33240,7 @@ var zodToJsonSchema = (schema, options) => {
|
|
|
33646
33240
|
}
|
|
33647
33241
|
return combined;
|
|
33648
33242
|
};
|
|
33649
|
-
// ../../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
|
|
33650
33244
|
function mapMiniTarget(t) {
|
|
33651
33245
|
if (!t)
|
|
33652
33246
|
return "draft-7";
|
|
@@ -33688,7 +33282,7 @@ function parseWithCompat(schema, data) {
|
|
|
33688
33282
|
return result.data;
|
|
33689
33283
|
}
|
|
33690
33284
|
|
|
33691
|
-
// ../../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
|
|
33692
33286
|
var DEFAULT_REQUEST_TIMEOUT_MSEC = 60000;
|
|
33693
33287
|
|
|
33694
33288
|
class Protocol {
|
|
@@ -34529,7 +34123,7 @@ function mergeCapabilities(base, additional) {
|
|
|
34529
34123
|
return result;
|
|
34530
34124
|
}
|
|
34531
34125
|
|
|
34532
|
-
// ../../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
|
|
34533
34127
|
var import_ajv = __toESM(require_ajv(), 1);
|
|
34534
34128
|
var import_ajv_formats = __toESM(require_dist(), 1);
|
|
34535
34129
|
function createDefaultAjvInstance() {
|
|
@@ -34569,7 +34163,7 @@ class AjvJsonSchemaValidator {
|
|
|
34569
34163
|
}
|
|
34570
34164
|
}
|
|
34571
34165
|
|
|
34572
|
-
// ../../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
|
|
34573
34167
|
class ExperimentalServerTasks {
|
|
34574
34168
|
constructor(_server) {
|
|
34575
34169
|
this._server = _server;
|
|
@@ -34647,7 +34241,7 @@ class ExperimentalServerTasks {
|
|
|
34647
34241
|
}
|
|
34648
34242
|
}
|
|
34649
34243
|
|
|
34650
|
-
// ../../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
|
|
34651
34245
|
function assertToolsCallTaskCapability(requests, method, entityName) {
|
|
34652
34246
|
if (!requests) {
|
|
34653
34247
|
throw new Error(`${entityName} does not support task creation (required for ${method})`);
|
|
@@ -34682,7 +34276,7 @@ function assertClientRequestTaskCapability(requests, method, entityName) {
|
|
|
34682
34276
|
}
|
|
34683
34277
|
}
|
|
34684
34278
|
|
|
34685
|
-
// ../../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
|
|
34686
34280
|
class Server extends Protocol {
|
|
34687
34281
|
constructor(_serverInfo, options) {
|
|
34688
34282
|
super(options);
|
|
@@ -35006,7 +34600,7 @@ class Server extends Protocol {
|
|
|
35006
34600
|
}
|
|
35007
34601
|
}
|
|
35008
34602
|
|
|
35009
|
-
// ../../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
|
|
35010
34604
|
var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
35011
34605
|
function isCompletable(schema) {
|
|
35012
34606
|
return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
|
|
@@ -35020,7 +34614,7 @@ var McpZodTypeKind;
|
|
|
35020
34614
|
McpZodTypeKind2["Completable"] = "McpCompletable";
|
|
35021
34615
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
35022
34616
|
|
|
35023
|
-
// ../../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
|
|
35024
34618
|
var TOOL_NAME_REGEX = /^[A-Za-z0-9._-]{1,128}$/;
|
|
35025
34619
|
function validateToolName(name) {
|
|
35026
34620
|
const warnings = [];
|
|
@@ -35078,7 +34672,7 @@ function validateAndWarnToolName(name) {
|
|
|
35078
34672
|
return result.isValid;
|
|
35079
34673
|
}
|
|
35080
34674
|
|
|
35081
|
-
// ../../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
|
|
35082
34676
|
class ExperimentalMcpServerTasks {
|
|
35083
34677
|
constructor(_mcpServer) {
|
|
35084
34678
|
this._mcpServer = _mcpServer;
|
|
@@ -35093,7 +34687,7 @@ class ExperimentalMcpServerTasks {
|
|
|
35093
34687
|
}
|
|
35094
34688
|
}
|
|
35095
34689
|
|
|
35096
|
-
// ../../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
|
|
35097
34691
|
init_zod();
|
|
35098
34692
|
|
|
35099
34693
|
class McpServer {
|
|
@@ -35827,6 +35421,7 @@ init_package();
|
|
|
35827
35421
|
|
|
35828
35422
|
// src/mcp/tools/discovery.ts
|
|
35829
35423
|
init_zod();
|
|
35424
|
+
init_package();
|
|
35830
35425
|
|
|
35831
35426
|
// src/lib/compact-output.ts
|
|
35832
35427
|
var DEFAULT_MCP_LIMIT = 20;
|
|
@@ -35911,7 +35506,7 @@ function registerDiscoveryTools(server, stripped) {
|
|
|
35911
35506
|
description: "Search connectors by name or keyword.",
|
|
35912
35507
|
inputSchema: {
|
|
35913
35508
|
query: exports_external.string(),
|
|
35914
|
-
limit: exports_external.number().optional(),
|
|
35509
|
+
limit: exports_external.number().int().min(1).max(100).optional(),
|
|
35915
35510
|
verbose: exports_external.boolean().optional()
|
|
35916
35511
|
}
|
|
35917
35512
|
}, async ({ query, limit, verbose }) => {
|
|
@@ -35982,13 +35577,19 @@ function registerDiscoveryTools(server, stripped) {
|
|
|
35982
35577
|
description: c.description,
|
|
35983
35578
|
tags: c.tags
|
|
35984
35579
|
})) : page.items.map((c) => compactConnector(c, 120));
|
|
35985
|
-
|
|
35580
|
+
const compactMode = compact === true || !verbose && compact !== false;
|
|
35581
|
+
return { content: [{ type: "text", text: JSON.stringify({
|
|
35986
35582
|
connectors: data,
|
|
35987
35583
|
total: connectors18.length,
|
|
35988
35584
|
count: data.length,
|
|
35585
|
+
limit: page.limit,
|
|
35586
|
+
cursor: String(page.offset),
|
|
35989
35587
|
nextCursor: page.nextOffset === null ? null : String(page.nextOffset),
|
|
35588
|
+
hasMore: page.nextOffset !== null,
|
|
35589
|
+
compact: compactMode,
|
|
35590
|
+
catalogVersion: package_default.version,
|
|
35990
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.`
|
|
35991
|
-
}
|
|
35592
|
+
}) }] };
|
|
35992
35593
|
});
|
|
35993
35594
|
server.registerTool("connector_docs", {
|
|
35994
35595
|
title: "Connector Documentation",
|
|
@@ -36235,7 +35836,7 @@ init_auth();
|
|
|
36235
35836
|
init_database();
|
|
36236
35837
|
init_connector_resolver();
|
|
36237
35838
|
import { existsSync as existsSync15, readFileSync as readFileSync8 } from "fs";
|
|
36238
|
-
import { join as
|
|
35839
|
+
import { join as join14 } from "path";
|
|
36239
35840
|
import { spawn as spawn3 } from "child_process";
|
|
36240
35841
|
function registerAuthTools(server, stripped) {
|
|
36241
35842
|
server.registerTool("connector_auth_status", {
|
|
@@ -36371,10 +35972,10 @@ function registerAuthTools(server, stripped) {
|
|
|
36371
35972
|
const oauthUrl = `http://localhost:${serverPort}/oauth/${name}/start`;
|
|
36372
35973
|
if (noBrowser) {
|
|
36373
35974
|
const connectorsHome2 = getConnectorsHome();
|
|
36374
|
-
const tokenPaths = getConnectorConfigReadDirs(name, connectorsHome2).map((dir) =>
|
|
35975
|
+
const tokenPaths = getConnectorConfigReadDirs(name, connectorsHome2).map((dir) => join14(dir, "profiles", "default", "tokens.json"));
|
|
36375
35976
|
let serverRunning = false;
|
|
36376
35977
|
try {
|
|
36377
|
-
await fetch(`http://localhost:${serverPort}/
|
|
35978
|
+
await fetch(`http://localhost:${serverPort}/health`);
|
|
36378
35979
|
serverRunning = true;
|
|
36379
35980
|
} catch {}
|
|
36380
35981
|
if (!serverRunning) {
|
|
@@ -37133,6 +36734,114 @@ async function handleMcpHttpRequest(req) {
|
|
|
37133
36734
|
return null;
|
|
37134
36735
|
}
|
|
37135
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
|
+
|
|
37136
36845
|
// src/server/serve.ts
|
|
37137
36846
|
var activityLog = [];
|
|
37138
36847
|
var MAX_ACTIVITY_LOG = 100;
|
|
@@ -37142,37 +36851,6 @@ function logActivity(action, connector, detail) {
|
|
|
37142
36851
|
activityLog.length = MAX_ACTIVITY_LOG;
|
|
37143
36852
|
}
|
|
37144
36853
|
}
|
|
37145
|
-
function resolveDashboardDir() {
|
|
37146
|
-
const candidates = [];
|
|
37147
|
-
try {
|
|
37148
|
-
const scriptDir = dirname7(fileURLToPath7(import.meta.url));
|
|
37149
|
-
candidates.push(join16(scriptDir, "..", "dashboard", "dist"));
|
|
37150
|
-
candidates.push(join16(scriptDir, "..", "..", "dashboard", "dist"));
|
|
37151
|
-
} catch {}
|
|
37152
|
-
if (process.argv[1]) {
|
|
37153
|
-
const mainDir = dirname7(process.argv[1]);
|
|
37154
|
-
candidates.push(join16(mainDir, "..", "dashboard", "dist"));
|
|
37155
|
-
candidates.push(join16(mainDir, "..", "..", "dashboard", "dist"));
|
|
37156
|
-
}
|
|
37157
|
-
candidates.push(join16(process.cwd(), "dashboard", "dist"));
|
|
37158
|
-
for (const candidate of candidates) {
|
|
37159
|
-
if (existsSync16(candidate))
|
|
37160
|
-
return candidate;
|
|
37161
|
-
}
|
|
37162
|
-
return join16(process.cwd(), "dashboard", "dist");
|
|
37163
|
-
}
|
|
37164
|
-
var MIME_TYPES = {
|
|
37165
|
-
".html": "text/html; charset=utf-8",
|
|
37166
|
-
".js": "application/javascript",
|
|
37167
|
-
".css": "text/css",
|
|
37168
|
-
".json": "application/json",
|
|
37169
|
-
".png": "image/png",
|
|
37170
|
-
".jpg": "image/jpeg",
|
|
37171
|
-
".svg": "image/svg+xml",
|
|
37172
|
-
".ico": "image/x-icon",
|
|
37173
|
-
".woff": "font/woff",
|
|
37174
|
-
".woff2": "font/woff2"
|
|
37175
|
-
};
|
|
37176
36854
|
var SECURITY_HEADERS = {
|
|
37177
36855
|
"X-Content-Type-Options": "nosniff",
|
|
37178
36856
|
"X-Frame-Options": "DENY"
|
|
@@ -37257,15 +36935,6 @@ function oauthPage(type, title, message, hint, extra) {
|
|
|
37257
36935
|
</div>
|
|
37258
36936
|
</body></html>`;
|
|
37259
36937
|
}
|
|
37260
|
-
function serveStaticFile(filePath) {
|
|
37261
|
-
if (!existsSync16(filePath))
|
|
37262
|
-
return null;
|
|
37263
|
-
const ext = extname(filePath);
|
|
37264
|
-
const contentType2 = MIME_TYPES[ext] || "application/octet-stream";
|
|
37265
|
-
return new Response(Bun.file(filePath), {
|
|
37266
|
-
headers: { "Content-Type": contentType2 }
|
|
37267
|
-
});
|
|
37268
|
-
}
|
|
37269
36938
|
async function findAvailablePort(preferred, strict = false) {
|
|
37270
36939
|
if (strict) {
|
|
37271
36940
|
try {
|
|
@@ -37291,37 +36960,37 @@ async function findAvailablePort(preferred, strict = false) {
|
|
|
37291
36960
|
throw new Error(`No available port found in range ${preferred}-${preferred + 99}`);
|
|
37292
36961
|
}
|
|
37293
36962
|
async function startServer(requestedPort, options) {
|
|
37294
|
-
const shouldOpen = options?.open ?? true;
|
|
37295
36963
|
const strict = options?.strict ?? false;
|
|
36964
|
+
const hostname2 = options?.hostname ?? SERVE_DEFAULT_HOSTNAME;
|
|
37296
36965
|
loadConnectorVersions();
|
|
37297
|
-
const
|
|
37298
|
-
const dashboardExists = existsSync16(dashboardDir);
|
|
37299
|
-
if (!dashboardExists) {
|
|
37300
|
-
console.error(`
|
|
37301
|
-
Dashboard not found at: ${dashboardDir}`);
|
|
37302
|
-
console.error(`Run this to build it:
|
|
37303
|
-
`);
|
|
37304
|
-
console.error(` cd dashboard && bun install && bun run build
|
|
37305
|
-
`);
|
|
37306
|
-
console.error(`Or from the project root:
|
|
37307
|
-
`);
|
|
37308
|
-
console.error(` bun run build:dashboard
|
|
37309
|
-
`);
|
|
37310
|
-
}
|
|
36966
|
+
const serveToken = resolveServeToken({ token: options?.token });
|
|
37311
36967
|
const port = await findAvailablePort(requestedPort, strict);
|
|
37312
36968
|
if (port !== requestedPort) {
|
|
37313
36969
|
console.log(`Port ${requestedPort} is in use, using port ${port} instead`);
|
|
37314
36970
|
}
|
|
37315
36971
|
const server = Bun.serve({
|
|
36972
|
+
hostname: hostname2,
|
|
37316
36973
|
port,
|
|
37317
36974
|
async fetch(req) {
|
|
37318
36975
|
const url2 = new URL(req.url);
|
|
37319
|
-
const
|
|
36976
|
+
const path = url2.pathname;
|
|
37320
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
|
+
}
|
|
37321
36990
|
const mcpResponse = await handleMcpHttpRequest(req);
|
|
37322
36991
|
if (mcpResponse)
|
|
37323
36992
|
return mcpResponse;
|
|
37324
|
-
if (
|
|
36993
|
+
if (path === "/api/connectors" && method === "GET") {
|
|
37325
36994
|
const compact = url2.searchParams.get("compact") === "true";
|
|
37326
36995
|
const fieldsParam = url2.searchParams.get("fields");
|
|
37327
36996
|
const fields = fieldsParam ? new Set(fieldsParam.split(",").map((f) => f.trim())) : null;
|
|
@@ -37341,7 +37010,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37341
37010
|
}
|
|
37342
37011
|
return jsonStripped(data, 200, port);
|
|
37343
37012
|
}
|
|
37344
|
-
if (
|
|
37013
|
+
if (path === "/api/connectors/manifest" && method === "GET") {
|
|
37345
37014
|
const connectorNames = url2.searchParams.get("connectors")?.split(",").map((name) => name.trim()).filter(Boolean);
|
|
37346
37015
|
const includeOperations = url2.searchParams.get("includeOperations") === "true";
|
|
37347
37016
|
const manifest = await getConnectorCapabilityManifest({
|
|
@@ -37350,7 +37019,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37350
37019
|
});
|
|
37351
37020
|
return json(manifest, 200, port);
|
|
37352
37021
|
}
|
|
37353
|
-
const singleMatch =
|
|
37022
|
+
const singleMatch = path.match(/^\/api\/connectors\/([^/]+)$/);
|
|
37354
37023
|
if (singleMatch && method === "GET") {
|
|
37355
37024
|
const name = singleMatch[1];
|
|
37356
37025
|
if (!isValidConnectorName(name))
|
|
@@ -37370,7 +37039,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37370
37039
|
overview: docs?.overview || null
|
|
37371
37040
|
}, 200, port);
|
|
37372
37041
|
}
|
|
37373
|
-
const operationsMatch =
|
|
37042
|
+
const operationsMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations$/);
|
|
37374
37043
|
if (operationsMatch && method === "GET") {
|
|
37375
37044
|
const name = operationsMatch[1];
|
|
37376
37045
|
if (!isValidConnectorName(name))
|
|
@@ -37391,7 +37060,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37391
37060
|
helpText: ops.helpText
|
|
37392
37061
|
}, 200, port);
|
|
37393
37062
|
}
|
|
37394
|
-
const operationHelpMatch =
|
|
37063
|
+
const operationHelpMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations\/([^/]+)$/);
|
|
37395
37064
|
if (operationHelpMatch && method === "GET") {
|
|
37396
37065
|
const name = operationHelpMatch[1];
|
|
37397
37066
|
const command = decodeURIComponent(operationHelpMatch[2]);
|
|
@@ -37406,7 +37075,7 @@ Dashboard not found at: ${dashboardDir}`);
|
|
|
37406
37075
|
const help = await getConnectorCommandHelp(name, command);
|
|
37407
37076
|
return json({ connector: name, displayName: meta.displayName, command, help }, 200, port);
|
|
37408
37077
|
}
|
|
37409
|
-
const operationRunMatch =
|
|
37078
|
+
const operationRunMatch = path.match(/^\/api\/connectors\/([^/]+)\/operations\/run$/);
|
|
37410
37079
|
if (operationRunMatch && method === "POST") {
|
|
37411
37080
|
const name = operationRunMatch[1];
|
|
37412
37081
|
if (!isValidConnectorName(name))
|
|
@@ -37470,7 +37139,7 @@ ${result.stderr}`;
|
|
|
37470
37139
|
}, 500, port);
|
|
37471
37140
|
}
|
|
37472
37141
|
}
|
|
37473
|
-
const keyMatch =
|
|
37142
|
+
const keyMatch = path.match(/^\/api\/connectors\/([^/]+)\/key$/);
|
|
37474
37143
|
if (keyMatch && method === "POST") {
|
|
37475
37144
|
const name = keyMatch[1];
|
|
37476
37145
|
if (!isValidConnectorName(name))
|
|
@@ -37489,7 +37158,7 @@ ${result.stderr}`;
|
|
|
37489
37158
|
return json({ error: e instanceof Error ? e.message : "Failed to save key" }, 500, port);
|
|
37490
37159
|
}
|
|
37491
37160
|
}
|
|
37492
|
-
const refreshMatch =
|
|
37161
|
+
const refreshMatch = path.match(/^\/api\/connectors\/([^/]+)\/refresh$/);
|
|
37493
37162
|
if (refreshMatch && method === "POST") {
|
|
37494
37163
|
const name = refreshMatch[1];
|
|
37495
37164
|
if (!isValidConnectorName(name))
|
|
@@ -37502,7 +37171,7 @@ ${result.stderr}`;
|
|
|
37502
37171
|
return json({ success: false, error: e instanceof Error ? e.message : "Failed to refresh" }, 500, port);
|
|
37503
37172
|
}
|
|
37504
37173
|
}
|
|
37505
|
-
const installMatch =
|
|
37174
|
+
const installMatch = path.match(/^\/api\/connectors\/([^/]+)\/install$/);
|
|
37506
37175
|
if (installMatch && method === "POST") {
|
|
37507
37176
|
const name = installMatch[1];
|
|
37508
37177
|
if (!isValidConnectorName(name))
|
|
@@ -37521,7 +37190,7 @@ ${result.stderr}`;
|
|
|
37521
37190
|
return json({ error: e instanceof Error ? e.message : "Failed to install connector" }, 500, port);
|
|
37522
37191
|
}
|
|
37523
37192
|
}
|
|
37524
|
-
const uninstallMatch =
|
|
37193
|
+
const uninstallMatch = path.match(/^\/api\/connectors\/([^/]+)\/uninstall$/);
|
|
37525
37194
|
if (uninstallMatch && method === "POST") {
|
|
37526
37195
|
const name = uninstallMatch[1];
|
|
37527
37196
|
if (!isValidConnectorName(name))
|
|
@@ -37537,7 +37206,7 @@ ${result.stderr}`;
|
|
|
37537
37206
|
return json({ error: e instanceof Error ? e.message : "Failed to uninstall connector" }, 500, port);
|
|
37538
37207
|
}
|
|
37539
37208
|
}
|
|
37540
|
-
if (
|
|
37209
|
+
if (path === "/api/update" && method === "POST") {
|
|
37541
37210
|
try {
|
|
37542
37211
|
const installed = getInstalledConnectors();
|
|
37543
37212
|
if (installed.length === 0) {
|
|
@@ -37553,10 +37222,10 @@ ${result.stderr}`;
|
|
|
37553
37222
|
return json({ error: e instanceof Error ? e.message : "Failed to update" }, 500, port);
|
|
37554
37223
|
}
|
|
37555
37224
|
}
|
|
37556
|
-
if (
|
|
37225
|
+
if (path === "/api/activity" && method === "GET") {
|
|
37557
37226
|
return json(activityLog, 200, port);
|
|
37558
37227
|
}
|
|
37559
|
-
if (
|
|
37228
|
+
if (path === "/api/hot" && method === "GET") {
|
|
37560
37229
|
const { getTopConnectors: getTopConnectors2 } = await Promise.resolve().then(() => (init_usage(), exports_usage));
|
|
37561
37230
|
const { getPromotedConnectors: getPromotedConnectors2 } = await Promise.resolve().then(() => (init_promotions(), exports_promotions));
|
|
37562
37231
|
const limit = parseInt(url2.searchParams.get("limit") || "10", 10);
|
|
@@ -37566,7 +37235,7 @@ ${result.stderr}`;
|
|
|
37566
37235
|
const promoted = new Set(getPromotedConnectors2(db));
|
|
37567
37236
|
return json(top.map((t) => ({ ...t, promoted: promoted.has(t.connector) })), 200, port);
|
|
37568
37237
|
}
|
|
37569
|
-
const promoteMatch =
|
|
37238
|
+
const promoteMatch = path.match(/^\/api\/connectors\/([^/]+)\/promote$/);
|
|
37570
37239
|
if (promoteMatch && method === "POST") {
|
|
37571
37240
|
const name = promoteMatch[1];
|
|
37572
37241
|
if (!getConnector(name))
|
|
@@ -37580,13 +37249,13 @@ ${result.stderr}`;
|
|
|
37580
37249
|
const removed = demoteConnector2(promoteMatch[1], getDatabase3());
|
|
37581
37250
|
return json({ success: removed, connector: promoteMatch[1] }, 200, port);
|
|
37582
37251
|
}
|
|
37583
|
-
if (
|
|
37252
|
+
if (path === "/api/llm" && method === "GET") {
|
|
37584
37253
|
const config2 = getLlmConfig();
|
|
37585
37254
|
if (!config2)
|
|
37586
37255
|
return json({ configured: false }, 200, port);
|
|
37587
37256
|
return json({ configured: true, provider: config2.provider, model: config2.model, key: maskKey(config2.api_key), strip: config2.strip }, 200, port);
|
|
37588
37257
|
}
|
|
37589
|
-
if (
|
|
37258
|
+
if (path === "/api/llm" && method === "POST") {
|
|
37590
37259
|
const body = await req.json().catch(() => ({}));
|
|
37591
37260
|
const validProviders = ["cerebras", "groq", "openai", "anthropic"];
|
|
37592
37261
|
const provider = body.provider;
|
|
@@ -37600,7 +37269,7 @@ ${result.stderr}`;
|
|
|
37600
37269
|
saveLlmConfig({ provider, model, api_key, strip });
|
|
37601
37270
|
return json({ success: true, provider, model, strip }, 200, port);
|
|
37602
37271
|
}
|
|
37603
|
-
if (
|
|
37272
|
+
if (path === "/api/llm/test" && method === "POST") {
|
|
37604
37273
|
const config2 = getLlmConfig();
|
|
37605
37274
|
if (!config2)
|
|
37606
37275
|
return json({ error: "No LLM configured" }, 400, port);
|
|
@@ -37612,17 +37281,17 @@ ${result.stderr}`;
|
|
|
37612
37281
|
return json({ success: false, error: e instanceof Error ? e.message : String(e) }, 500, port);
|
|
37613
37282
|
}
|
|
37614
37283
|
}
|
|
37615
|
-
if (
|
|
37284
|
+
if (path === "/api/jobs" && method === "GET") {
|
|
37616
37285
|
return json(listJobs(getDatabase3()), 200, port);
|
|
37617
37286
|
}
|
|
37618
|
-
if (
|
|
37287
|
+
if (path === "/api/jobs" && method === "POST") {
|
|
37619
37288
|
const body = await req.json().catch(() => ({}));
|
|
37620
37289
|
if (!body.name || !body.connector || !body.command || !body.cron)
|
|
37621
37290
|
return json({ error: "name, connector, command, cron required" }, 400, port);
|
|
37622
37291
|
const job = createJob({ name: body.name, connector: body.connector, command: body.command, args: body.args ?? [], cron: body.cron, strip: !!body.strip }, getDatabase3());
|
|
37623
37292
|
return json(job, 201, port);
|
|
37624
37293
|
}
|
|
37625
|
-
const jobMatch =
|
|
37294
|
+
const jobMatch = path.match(/^\/api\/jobs\/([^/]+)$/);
|
|
37626
37295
|
if (jobMatch) {
|
|
37627
37296
|
const db = getDatabase3();
|
|
37628
37297
|
const job = getJobByName(jobMatch[1]) ?? getDatabase3().query("SELECT * FROM connector_jobs WHERE id = ?").get(jobMatch[1]);
|
|
@@ -37644,7 +37313,7 @@ ${result.stderr}`;
|
|
|
37644
37313
|
return json(updated, 200, port);
|
|
37645
37314
|
}
|
|
37646
37315
|
}
|
|
37647
|
-
const jobRunMatch =
|
|
37316
|
+
const jobRunMatch = path.match(/^\/api\/jobs\/([^/]+)\/run$/);
|
|
37648
37317
|
if (jobRunMatch && method === "POST") {
|
|
37649
37318
|
const db = getDatabase3();
|
|
37650
37319
|
const job = getJobByName(jobRunMatch[1], db);
|
|
@@ -37653,17 +37322,17 @@ ${result.stderr}`;
|
|
|
37653
37322
|
const result = await triggerJob(job, db);
|
|
37654
37323
|
return json(result, 200, port);
|
|
37655
37324
|
}
|
|
37656
|
-
if (
|
|
37325
|
+
if (path === "/api/workflows" && method === "GET") {
|
|
37657
37326
|
return json(listWorkflows(getDatabase3()), 200, port);
|
|
37658
37327
|
}
|
|
37659
|
-
if (
|
|
37328
|
+
if (path === "/api/workflows" && method === "POST") {
|
|
37660
37329
|
const body = await req.json().catch(() => ({}));
|
|
37661
37330
|
if (!body.name || !body.steps)
|
|
37662
37331
|
return json({ error: "name and steps required" }, 400, port);
|
|
37663
37332
|
const wf = createWorkflow({ name: body.name, steps: body.steps }, getDatabase3());
|
|
37664
37333
|
return json(wf, 201, port);
|
|
37665
37334
|
}
|
|
37666
|
-
const wfMatch =
|
|
37335
|
+
const wfMatch = path.match(/^\/api\/workflows\/([^/]+)$/);
|
|
37667
37336
|
if (wfMatch) {
|
|
37668
37337
|
const db = getDatabase3();
|
|
37669
37338
|
const wf = getWorkflowByName(wfMatch[1], db);
|
|
@@ -37676,7 +37345,7 @@ ${result.stderr}`;
|
|
|
37676
37345
|
return json({ success: true }, 200, port);
|
|
37677
37346
|
}
|
|
37678
37347
|
}
|
|
37679
|
-
const wfRunMatch =
|
|
37348
|
+
const wfRunMatch = path.match(/^\/api\/workflows\/([^/]+)\/run$/);
|
|
37680
37349
|
if (wfRunMatch && method === "POST") {
|
|
37681
37350
|
const wf = getWorkflowByName(wfRunMatch[1], getDatabase3());
|
|
37682
37351
|
if (!wf)
|
|
@@ -37684,10 +37353,10 @@ ${result.stderr}`;
|
|
|
37684
37353
|
const result = await runWorkflow(wf);
|
|
37685
37354
|
return json(result, 200, port);
|
|
37686
37355
|
}
|
|
37687
|
-
if (
|
|
37356
|
+
if (path === "/api/agents" && method === "GET") {
|
|
37688
37357
|
return json(listAgents(), 200, port);
|
|
37689
37358
|
}
|
|
37690
|
-
if (
|
|
37359
|
+
if (path === "/api/agents/register" && method === "POST") {
|
|
37691
37360
|
const body = await req.json().catch(() => ({}));
|
|
37692
37361
|
const name = typeof body.name === "string" ? body.name : null;
|
|
37693
37362
|
if (!name)
|
|
@@ -37701,15 +37370,15 @@ ${result.stderr}`;
|
|
|
37701
37370
|
return json(result, 409, port);
|
|
37702
37371
|
return json(result, 200, port);
|
|
37703
37372
|
}
|
|
37704
|
-
if (
|
|
37705
|
-
const agentName =
|
|
37373
|
+
if (path.startsWith("/api/agents/") && method === "DELETE") {
|
|
37374
|
+
const agentName = path.slice("/api/agents/".length);
|
|
37706
37375
|
const agent = getAgentByName(agentName);
|
|
37707
37376
|
if (!agent)
|
|
37708
37377
|
return json({ error: "Agent not found" }, 404, port);
|
|
37709
37378
|
deleteAgent(agent.id);
|
|
37710
37379
|
return json({ success: true }, 200, port);
|
|
37711
37380
|
}
|
|
37712
|
-
const rateMatch =
|
|
37381
|
+
const rateMatch = path.match(/^\/api\/rate\/([^/]+)\/([^/]+)$/);
|
|
37713
37382
|
if (rateMatch && method === "GET") {
|
|
37714
37383
|
const [, agentId, connector] = rateMatch;
|
|
37715
37384
|
const limit = parseInt(url2.searchParams.get("limit") || "60", 10);
|
|
@@ -37717,7 +37386,7 @@ ${result.stderr}`;
|
|
|
37717
37386
|
const result = consume ? checkRateBudget(agentId, connector, limit) : getRateBudget(agentId, connector, limit);
|
|
37718
37387
|
return json(result, 200, port);
|
|
37719
37388
|
}
|
|
37720
|
-
const profilesMatch =
|
|
37389
|
+
const profilesMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles$/);
|
|
37721
37390
|
if (profilesMatch && method === "GET") {
|
|
37722
37391
|
const name = profilesMatch[1];
|
|
37723
37392
|
if (!isValidConnectorName(name))
|
|
@@ -37727,9 +37396,9 @@ ${result.stderr}`;
|
|
|
37727
37396
|
let current = "default";
|
|
37728
37397
|
for (const configDir of getConnectorConfigReadDirs(name)) {
|
|
37729
37398
|
const currentProfileFile = join16(configDir, "current_profile");
|
|
37730
|
-
if (
|
|
37399
|
+
if (existsSync17(currentProfileFile)) {
|
|
37731
37400
|
try {
|
|
37732
|
-
current =
|
|
37401
|
+
current = readFileSync10(currentProfileFile, "utf-8").trim() || "default";
|
|
37733
37402
|
} catch {}
|
|
37734
37403
|
break;
|
|
37735
37404
|
}
|
|
@@ -37739,7 +37408,7 @@ ${result.stderr}`;
|
|
|
37739
37408
|
return json({ error: e instanceof Error ? e.message : "Failed to list profiles" }, 500, port);
|
|
37740
37409
|
}
|
|
37741
37410
|
}
|
|
37742
|
-
const profileSwitchMatch =
|
|
37411
|
+
const profileSwitchMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles\/switch$/);
|
|
37743
37412
|
if (profileSwitchMatch && method === "POST") {
|
|
37744
37413
|
const name = profileSwitchMatch[1];
|
|
37745
37414
|
if (!isValidConnectorName(name))
|
|
@@ -37758,7 +37427,7 @@ ${result.stderr}`;
|
|
|
37758
37427
|
return json({ error: e instanceof Error ? e.message : "Failed to switch profile" }, 500, port);
|
|
37759
37428
|
}
|
|
37760
37429
|
}
|
|
37761
|
-
const profileDeleteMatch =
|
|
37430
|
+
const profileDeleteMatch = path.match(/^\/api\/connectors\/([^/]+)\/profiles\/([^/]+)$/);
|
|
37762
37431
|
if (profileDeleteMatch && method === "DELETE") {
|
|
37763
37432
|
const name = profileDeleteMatch[1];
|
|
37764
37433
|
const profile = profileDeleteMatch[2];
|
|
@@ -37776,31 +37445,31 @@ ${result.stderr}`;
|
|
|
37776
37445
|
return json({ error: e instanceof Error ? e.message : "Failed to delete profile" }, 500, port);
|
|
37777
37446
|
}
|
|
37778
37447
|
}
|
|
37779
|
-
if (
|
|
37448
|
+
if (path === "/api/export" && method === "GET") {
|
|
37780
37449
|
try {
|
|
37781
37450
|
const connectDir = getConnectorsHome();
|
|
37782
37451
|
const result = {};
|
|
37783
|
-
if (
|
|
37452
|
+
if (existsSync17(connectDir)) {
|
|
37784
37453
|
for (const connectorName of listConfiguredConnectorNames(connectDir)) {
|
|
37785
37454
|
const profiles = {};
|
|
37786
37455
|
for (const configDir of [...getConnectorConfigReadDirs(connectorName, connectDir)].reverse()) {
|
|
37787
37456
|
const profilesDir = join16(configDir, "profiles");
|
|
37788
|
-
if (!
|
|
37457
|
+
if (!existsSync17(profilesDir))
|
|
37789
37458
|
continue;
|
|
37790
37459
|
const profileEntries = readdirSync9(profilesDir, { withFileTypes: true });
|
|
37791
37460
|
for (const pEntry of profileEntries) {
|
|
37792
37461
|
if (pEntry.isFile() && pEntry.name.endsWith(".json")) {
|
|
37793
37462
|
const profileName = basename3(pEntry.name, ".json");
|
|
37794
37463
|
try {
|
|
37795
|
-
const config2 = JSON.parse(
|
|
37464
|
+
const config2 = JSON.parse(readFileSync10(join16(profilesDir, pEntry.name), "utf-8"));
|
|
37796
37465
|
profiles[profileName] = config2;
|
|
37797
37466
|
} catch {}
|
|
37798
37467
|
}
|
|
37799
37468
|
if (pEntry.isDirectory()) {
|
|
37800
37469
|
const configPath = join16(profilesDir, pEntry.name, "config.json");
|
|
37801
|
-
if (
|
|
37470
|
+
if (existsSync17(configPath)) {
|
|
37802
37471
|
try {
|
|
37803
|
-
const config2 = JSON.parse(
|
|
37472
|
+
const config2 = JSON.parse(readFileSync10(configPath, "utf-8"));
|
|
37804
37473
|
profiles[pEntry.name] = config2;
|
|
37805
37474
|
} catch {}
|
|
37806
37475
|
}
|
|
@@ -37826,7 +37495,7 @@ ${result.stderr}`;
|
|
|
37826
37495
|
return json({ error: e instanceof Error ? e.message : "Failed to export credentials" }, 500, port);
|
|
37827
37496
|
}
|
|
37828
37497
|
}
|
|
37829
|
-
if (
|
|
37498
|
+
if (path === "/api/import" && method === "POST") {
|
|
37830
37499
|
try {
|
|
37831
37500
|
const contentLength = parseInt(req.headers.get("content-length") || "0", 10);
|
|
37832
37501
|
if (contentLength > MAX_BODY_SIZE)
|
|
@@ -37847,9 +37516,9 @@ ${result.stderr}`;
|
|
|
37847
37516
|
for (const [profileName, config2] of Object.entries(data.profiles)) {
|
|
37848
37517
|
if (!config2 || typeof config2 !== "object")
|
|
37849
37518
|
continue;
|
|
37850
|
-
|
|
37519
|
+
mkdirSync10(profilesDir, { recursive: true });
|
|
37851
37520
|
const profileFile = join16(profilesDir, `${profileName}.json`);
|
|
37852
|
-
|
|
37521
|
+
writeFileSync8(profileFile, JSON.stringify(config2, null, 2));
|
|
37853
37522
|
imported++;
|
|
37854
37523
|
}
|
|
37855
37524
|
}
|
|
@@ -37859,7 +37528,7 @@ ${result.stderr}`;
|
|
|
37859
37528
|
return json({ error: e instanceof Error ? e.message : "Failed to import credentials" }, 500, port);
|
|
37860
37529
|
}
|
|
37861
37530
|
}
|
|
37862
|
-
const oauthStartMatch =
|
|
37531
|
+
const oauthStartMatch = path.match(/^\/oauth\/([^/]+)\/start$/);
|
|
37863
37532
|
if (oauthStartMatch && method === "GET") {
|
|
37864
37533
|
const name = oauthStartMatch[1];
|
|
37865
37534
|
const redirectUri = `http://localhost:${port}/oauth/${name}/callback`;
|
|
@@ -37869,7 +37538,7 @@ ${result.stderr}`;
|
|
|
37869
37538
|
}
|
|
37870
37539
|
return Response.redirect(authUrl, 302);
|
|
37871
37540
|
}
|
|
37872
|
-
const oauthCallbackMatch =
|
|
37541
|
+
const oauthCallbackMatch = path.match(/^\/oauth\/([^/]+)\/callback$/);
|
|
37873
37542
|
if (oauthCallbackMatch && method === "GET") {
|
|
37874
37543
|
const name = oauthCallbackMatch[1];
|
|
37875
37544
|
const code = url2.searchParams.get("code");
|
|
@@ -37879,7 +37548,7 @@ ${result.stderr}`;
|
|
|
37879
37548
|
return htmlResponse(oauthPage("error", "Authentication Failed", error2, "You can close this window."));
|
|
37880
37549
|
}
|
|
37881
37550
|
if (!validateOAuthState(state, name)) {
|
|
37882
|
-
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."));
|
|
37883
37552
|
}
|
|
37884
37553
|
if (!code) {
|
|
37885
37554
|
return htmlResponse(oauthPage("error", "Missing Authorization Code", "No code received from the OAuth provider.", "You can close this window and try again."));
|
|
@@ -37898,25 +37567,10 @@ ${result.stderr}`;
|
|
|
37898
37567
|
headers: {
|
|
37899
37568
|
"Access-Control-Allow-Origin": `http://localhost:${port}`,
|
|
37900
37569
|
"Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS",
|
|
37901
|
-
"Access-Control-Allow-Headers": "Content-Type"
|
|
37570
|
+
"Access-Control-Allow-Headers": "Content-Type, Authorization, X-Connectors-Token"
|
|
37902
37571
|
}
|
|
37903
37572
|
});
|
|
37904
37573
|
}
|
|
37905
|
-
if (dashboardExists && (method === "GET" || method === "HEAD")) {
|
|
37906
|
-
if (path3 !== "/") {
|
|
37907
|
-
const filePath = join16(dashboardDir, path3);
|
|
37908
|
-
const rel = relative(dashboardDir, resolve2(filePath));
|
|
37909
|
-
if (!rel.startsWith("..") && !rel.includes(`..${sep}`) && rel !== "") {
|
|
37910
|
-
const res2 = serveStaticFile(filePath);
|
|
37911
|
-
if (res2)
|
|
37912
|
-
return res2;
|
|
37913
|
-
}
|
|
37914
|
-
}
|
|
37915
|
-
const indexPath = join16(dashboardDir, "index.html");
|
|
37916
|
-
const res = serveStaticFile(indexPath);
|
|
37917
|
-
if (res)
|
|
37918
|
-
return res;
|
|
37919
|
-
}
|
|
37920
37574
|
return json({ error: "Not found" }, 404, port);
|
|
37921
37575
|
}
|
|
37922
37576
|
});
|
|
@@ -37929,17 +37583,9 @@ ${result.stderr}`;
|
|
|
37929
37583
|
const { startScheduler: startScheduler2 } = await Promise.resolve().then(() => (init_scheduler(), exports_scheduler));
|
|
37930
37584
|
const { getDatabase: getDatabase3 } = await Promise.resolve().then(() => (init_database(), exports_database));
|
|
37931
37585
|
startScheduler2(getDatabase3());
|
|
37932
|
-
const url = `http
|
|
37933
|
-
console.log(`Connectors
|
|
37934
|
-
|
|
37935
|
-
try {
|
|
37936
|
-
const { openBrowser: openBrowser2 } = await Promise.resolve().then(() => (init_open_browser(), exports_open_browser));
|
|
37937
|
-
const opened = await openBrowser2(url);
|
|
37938
|
-
if (!opened.ok) {
|
|
37939
|
-
console.log(`If the browser did not open, visit ${url} manually.`);
|
|
37940
|
-
}
|
|
37941
|
-
} catch {}
|
|
37942
|
-
}
|
|
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`);
|
|
37943
37589
|
return port;
|
|
37944
37590
|
}
|
|
37945
37591
|
|
|
@@ -37952,12 +37598,11 @@ function hasFlag(flag) {
|
|
|
37952
37598
|
function printHelp() {
|
|
37953
37599
|
console.log(`Usage: connectors-serve [options]
|
|
37954
37600
|
|
|
37955
|
-
Start the Connectors
|
|
37601
|
+
Start the Connectors API + OAuth server
|
|
37956
37602
|
|
|
37957
37603
|
Options:
|
|
37958
37604
|
--port <port> Port to bind (default: ${DEFAULT_PORT})
|
|
37959
37605
|
--port=<port> Port to bind (default: ${DEFAULT_PORT})
|
|
37960
|
-
--no-open Do not open the dashboard in a browser
|
|
37961
37606
|
-V, --version Output the version number
|
|
37962
37607
|
-h, --help Display help for command`);
|
|
37963
37608
|
}
|
|
@@ -37980,5 +37625,4 @@ if (hasFlag("--version") || hasFlag("-V")) {
|
|
|
37980
37625
|
console.log(package_default.version);
|
|
37981
37626
|
process.exit(0);
|
|
37982
37627
|
}
|
|
37983
|
-
|
|
37984
|
-
startServer(parsePort(), { open: shouldOpen });
|
|
37628
|
+
startServer(parsePort());
|