@zortexhq/indra-v2.5 0.2.8 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +5 -0
  2. package/bin/codex-postinstall.mjs +1 -1
  3. package/dist/auto-sync.js +1 -1
  4. package/dist/cli-run.js +1 -1
  5. package/dist/codex-install.js +1 -1
  6. package/dist/codex-setup.js +1 -1
  7. package/dist/connector-worker.js +1 -1
  8. package/dist/content-find.js +2 -8
  9. package/dist/find-snapshots.js +1 -0
  10. package/dist/gateway.js +1 -1
  11. package/dist/imessage-sync.js +1 -0
  12. package/dist/mail-search-body.js +1 -0
  13. package/dist/match-excerpt.js +1 -0
  14. package/dist/native-connect.js +1 -0
  15. package/dist/native-level1-setup.js +1 -1
  16. package/dist/public-tool.js +1 -1
  17. package/dist/read-route.js +1 -0
  18. package/dist/recovery-support.js +1 -1
  19. package/dist/resident-host.js +2 -2
  20. package/dist/resident-jobs.js +1 -1
  21. package/dist/source-data.js +1 -1
  22. package/dist/supervised-sync.js +1 -1
  23. package/dist/sync-sources.js +1 -0
  24. package/node_modules/@zortexhq/plugin-connector-computer-files/dist/catalog.js +1 -0
  25. package/node_modules/@zortexhq/plugin-connector-computer-files/dist/index.js +1 -0
  26. package/node_modules/@zortexhq/plugin-connector-computer-files/dist/policy.js +1 -0
  27. package/node_modules/@zortexhq/plugin-connector-computer-files/dist/result.js +1 -0
  28. package/node_modules/@zortexhq/plugin-connector-computer-files/package.json +18 -0
  29. package/node_modules/@zortexhq/plugin-connector-core/dist/api/index.js +1 -1
  30. package/node_modules/@zortexhq/plugin-connector-core/dist/hub.js +1 -1
  31. package/node_modules/@zortexhq/plugin-connector-core/dist/native-file-roots.js +1 -0
  32. package/node_modules/@zortexhq/plugin-connector-google-tasks/dist/provider.js +1 -1
  33. package/node_modules/@zortexhq/plugin-connector-imessage/dist/attributed-body.js +1 -0
  34. package/node_modules/@zortexhq/plugin-connector-imessage/dist/chatdb-source.js +1 -0
  35. package/node_modules/@zortexhq/plugin-connector-imessage/dist/connector.js +1 -0
  36. package/node_modules/@zortexhq/plugin-connector-imessage/dist/index.js +1 -0
  37. package/node_modules/@zortexhq/plugin-connector-imessage/dist/manifest.js +1 -0
  38. package/node_modules/@zortexhq/plugin-connector-imessage/dist/sqlite-snapshot.js +1 -0
  39. package/node_modules/@zortexhq/plugin-connector-imessage/package.json +16 -0
  40. package/node_modules/@zortexhq/plugin-connector-level1/dist/api/index.js +1 -0
  41. package/node_modules/@zortexhq/plugin-connector-level1/dist/computer-files-pages.js +1 -1
  42. package/node_modules/@zortexhq/plugin-connector-level1/dist/computer-files.js +1 -0
  43. package/node_modules/@zortexhq/plugin-connector-level1/dist/cua-runtime.js +1 -0
  44. package/node_modules/@zortexhq/plugin-connector-level1/dist/index.js +1 -1
  45. package/node_modules/@zortexhq/plugin-connector-level1/dist/prepared-local.js +1 -1
  46. package/node_modules/@zortexhq/plugin-connector-level1/dist/sources.js +1 -1
  47. package/node_modules/@zortexhq/plugin-connector-level1/package.json +5 -1
  48. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/file-catalog.js +1 -0
  49. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/file-renderer.js +1 -0
  50. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/galaxy-text.js +1 -1
  51. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/index.js +1 -1
  52. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/original-adapter.js +1 -1
  53. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/routes.js +1 -1
  54. package/node_modules/@zortexhq/plugin-galaxy-ui/dist/snapshot.js +1 -1
  55. package/node_modules/@zortexhq/plugin-galaxy-ui/package.json +1 -0
  56. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-i18n-twin.js +1 -1
  57. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-i18n.js +1 -1
  58. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-model.js +1 -1
  59. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-text.js +1 -1
  60. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/galaxy-renderer.js +1 -1
  61. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/live-model.js +1 -1
  62. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/portrait-model.js +1 -1
  63. package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/shell.js +1 -1
  64. package/node_modules/@zortexhq/plugin-google-auth/default-client.json +1 -0
  65. package/node_modules/@zortexhq/plugin-google-auth/dist/desktop-client.js +1 -1
  66. package/node_modules/@zortexhq/plugin-google-auth/dist/index.js +1 -1
  67. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/api/index.js +1 -1
  68. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/api/search-text.js +1 -0
  69. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/current-records.js +1 -1
  70. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/index.js +1 -1
  71. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/schema.js +13 -4
  72. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/search-records.js +1 -0
  73. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/snapshot-tables.js +1 -1
  74. package/node_modules/@zortexhq/plugin-vault-sqlite/dist/sql-worker.js +1 -1
  75. package/package.json +11 -7
  76. package/release-provenance.json +35 -21
  77. package/update-manifest.json +304 -118
@@ -1 +1 @@
1
- import{mkdir,readdir,realpath}from"node:fs/promises";import{isAbsolute,join}from"node:path";import{isDeepStrictEqual}from"node:util";import{createShallowProvider}from"./shallow.js";import{publicDataSourceIds}from"./public-data/catalog.js";import{withLoopbackTls}from"./loopback-tls.js";import{firstBatch,sentry}from"./sources.js";import{additionalSources}from"./additional-sources.js";import{preparedWork,preparedWorkSourceIds,createPreparedWorkSource}from"./prepared-work.js";import{preparedLocalSourceIds,createPreparedLocalSource,fastmail}from"./prepared-local.js";import{preparedServiceSourceIds,createPreparedServiceSource,createImmichFieldsSource,createLarkFieldsSource,readwise,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark}from"./prepared-services.js";import{preparedGraphSourceIds,createPreparedGraphSource,graphSessionSourceIds,createGraphSessionSource}from"./prepared-graph.js";import{preparedWorkStdioSourceIds,createGhostFieldsSource,createZendeskFieldsSource,createZendeskOAuthSource,validateZendeskOAuthOptions}from"./prepared-work-stdio.js";import{preparedExistingSourceIds,createPreparedExistingSource}from"./prepared-existing.js";import{preparedDingTalkSourceIds,createPreparedDingTalkSource}from"./prepared-dingtalk.js";import{preparedDiscordSourceIds,createPreparedDiscordSource}from"./prepared-discord.js";import{preparedTelegramSourceIds,createPreparedTelegramSource}from"./prepared-telegram.js";import{createPreparedWordPressSource}from"./prepared-wordpress.js";import{prepareConfiguration,validateLevel1Selection}from"./provisioning.js";import{replaceSettings,updateSettings,withSettingsReadLock,withSettingsStartupLock,recoverInterruptedJoplinSettings}from"./settings-transaction.js";import{fullActionCatalog}from"./action-policy.js";import{deferredSource}from"./deferred-box.js";export function level1Catalog(specs=firstBatch){return specs.map(spec=>{if(spec.server.transport==="http"){const url=new URL(spec.server.url),local=["127.0.0.1","[::1]"].includes(url.hostname);return{source:spec.source,execution:{kind:local?"local-http-mcp":"hosted-mcp",url:url.href},licenseMode:local?"open-source":"hosted"}}if(spec.server.command==="npx"&&spec.origin.package&&spec.server.args.includes(spec.origin.package)&&/@\d+\.\d+\.\d+$/.test(spec.origin.package))return{source:spec.source,execution:{kind:"npm-stdio",package:spec.origin.package,command:"npx",args:[...spec.server.args]},licenseMode:"open-source"};if(spec.server.command==="uvx"&&spec.origin.package&&spec.server.args.includes(spec.origin.package)&&/==\d+\.\d+\.\d+$/.test(spec.origin.package))return{source:spec.source,execution:{kind:"python-stdio",package:spec.origin.package,command:"uvx",args:[...spec.server.args]},licenseMode:"open-source"};if(spec.origin.artifact&&/@\d+\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/.test(spec.origin.artifact))return{source:spec.source,execution:{kind:"local-executable",artifact:spec.origin.artifact,command:spec.server.command,args:[...spec.server.args]},licenseMode:"open-source"};throw Error(`${spec.source} has no exact executable artifact contract.`)})}export{createShallowProvider,toolRow,setLoginPoll,proxyEnv}from"./shallow.js";export{firstBatch,onPath,stripe,calendly,openrouter,cloudflare,posthog,notionL1,github,gitlab,jira,confluence,linear,asana,clickup,todoist,ticktick,microsoftTodo,appleNotes,appleReminders,appleMusic,sentry,shopify,reddit,spotify,tiktok,notebooklm,cua}from"./sources.js";export{additionalSources,appstore,rednote}from"./additional-sources.js";export{publicDataSourceIds}from"./public-data/catalog.js";export{preparedWork}from"./prepared-work.js";export{preparedWorkSourceIds,createPreparedWorkSource}from"./prepared-work.js";export{createGhostFieldsSource,createZendeskFieldsSource,createZendeskOAuthSource}from"./prepared-work-stdio.js";export{preparedLocalSourceIds,createPreparedLocalSource,preparedLocalRootsAudience,preparedLocalNativeSelection,fastmail}from"./prepared-local.js";export{prepareMacAptOptions,createPreparedMacAptSource}from"./prepared-macapt.js";export{preparedServiceSourceIds,createPreparedServiceSource,createImmichFieldsSource,createLarkFieldsSource,readwise,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark}from"./prepared-services.js";export{preparedGraphSourceIds,createPreparedGraphSource}from"./prepared-graph.js";export{preparedExistingSourceIds,createPreparedExistingSource}from"./prepared-existing.js";export{preparedDingTalkSourceIds,createPreparedDingTalkSource}from"./prepared-dingtalk.js";export{preparedDiscordSourceIds,createPreparedDiscordSource,preparedDiscordAudience}from"./prepared-discord.js";export{preparedTelegramSourceIds,createPreparedTelegramSource,preparedTelegramAudience}from"./prepared-telegram.js";export{createPreparedWordPressSource}from"./prepared-wordpress.js";export{reviewedToolSchemaHash}from"./custodied.js";export const name="zortex-connector-level1",inject=["zortexConnectorHub","zortexConnectorEnrollment","zortexVaultStore","zortexConnectorHttp"];const runtimeSources=new Set([...preparedGraphSourceIds,...preparedWorkStdioSourceIds]);function deploymentOptions(source,options,deployment){return deployment.runtimeDirectory&&runtimeSources.has(source)&&options.runtimeDirectory===void 0?{...options,runtimeDirectory:join(deployment.runtimeDirectory,source)}:options}async function prepareRuntimeDirectories(deployment,sources){if(deployment.runtimeDirectory===void 0)return{};if(typeof deployment.runtimeDirectory!=="string"||!isAbsolute(deployment.runtimeDirectory))throw Error("Level 1 runtime directory must be an absolute product-owned path.");await mkdir(deployment.runtimeDirectory,{recursive:true,mode:448});const runtimeDirectory=await realpath(deployment.runtimeDirectory);for(const source of sources)if(runtimeSources.has(source))await mkdir(join(runtimeDirectory,source),{recursive:true,mode:448});for(const source of sources)if(graphSessionSourceIds.includes(source))await mkdir(join(runtimeDirectory,"server-sessions",source),{recursive:true,mode:448});return{runtimeDirectory}}const preparedFactories=new Map([...preparedWorkSourceIds.map(source=>[source,source==="wordpress"?createConfiguredWordPressSource:source==="ghost"||source==="zendesk"?createConfiguredWorkStdioSource:createPreparedWorkSource]),...preparedLocalSourceIds.map(source=>[source,createPreparedLocalSource]),...preparedServiceSourceIds.map(source=>[source,createPreparedServiceSource]),...preparedGraphSourceIds.map(source=>[source,createConfiguredGraphSource]),...preparedExistingSourceIds.map(source=>[source,createPreparedExistingSource]),...preparedDingTalkSourceIds.map(source=>[source,createPreparedDingTalkSource]),...preparedDiscordSourceIds.map(source=>[source,createPreparedDiscordSource]),...preparedTelegramSourceIds.map(source=>[source,createPreparedTelegramSource])]);function createConfiguredWordPressSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;return mode&&"value"in mode&&mode.value==="self-hosted"?createPreparedWordPressSource(source,options):createPreparedWorkSource(source,options,policy)}function createConfiguredGraphSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;return mode&&"value"in mode&&mode.value==="server-session"?createGraphSessionSource(source,options,policy):createPreparedGraphSource(source,options,policy)}function createConfiguredWorkStdioSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;if(source==="zendesk"&&mode&&"value"in mode&&mode.value==="oauth")return createZendeskOAuthSource(options,policy);return mode&&"value"in mode&&mode.value==="fields"?(source==="ghost"?createGhostFieldsSource:createZendeskFieldsSource)(options,policy):createPreparedWorkSource(source,options,policy)}export function configuredLevel1Sources(config,deployment={}){return configuredLevel1SourcesInternal(config,deployment,false)}function configuredLevel1SourcesInternal(config,deployment,settingsValidation){const declared=[...firstBatch,sentry,readwise,fastmail,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark,...preparedWork,...additionalSources].filter((spec,index,all)=>all.findIndex(item=>item.source===spec.source)===index),selection=config.sources;if(selection!==void 0&&(!Array.isArray(selection)||new Set(selection).size!==selection.length||selection.some(source=>typeof source!=="string"||!declared.some(spec=>spec.source===source)&&!preparedFactories.has(source))))throw Error("Invalid level 1 source selection: every source must be declared and unique.");const requested=config.requestedSources??selection;if(config.requestedSources!==void 0&&(!selection||!Array.isArray(requested)||new Set(requested).size!==requested.length||requested.some(source=>typeof source!=="string"||!declared.some(spec=>spec.source===source)&&!preparedFactories.has(source))||selection.some(source=>!requested.includes(source))))throw Error("Invalid requested level 1 source selection.");if(config.fullActions!==void 0&&(!Array.isArray(config.fullActions)||new Set(config.fullActions).size!==config.fullActions.length||config.fullActions.some(source=>!requested?.includes(source))))throw Error("Invalid level 1 action selection: select each source explicitly.");if(config.oauthSources!==void 0&&(!Array.isArray(config.oauthSources)||new Set(config.oauthSources).size!==config.oauthSources.length||config.oauthSources.some(source=>!requested?.includes(source))))throw Error("Invalid level 1 OAuth resource selection.");const options=config.prepared;if(options!==void 0){if(!options||typeof options!=="object"||Array.isArray(options)||![Object.prototype,null].includes(Object.getPrototypeOf(options)))throw Error("Invalid prepared level 1 source settings.");for(const key of Reflect.ownKeys(options)){if(typeof key!=="string"||!requested?.includes(key)||!preparedFactories.has(key))throw Error("Prepared settings require explicit selection of the matching source.");const descriptor=Object.getOwnPropertyDescriptor(options,key);if(!descriptor.enumerable||!("value"in descriptor))throw Error("Invalid prepared level 1 source settings.")}}for(const[source,value]of Object.entries(options??{}))if(!selection?.includes(source))configuredLevel1SourcesInternal({sources:[source],prepared:{[source]:value},fullActions:config.fullActions?.includes(source)?[source]:[],oauthSources:config.oauthSources?.includes(source)?[source]:[]},deployment,settingsValidation);if(selection===void 0)return configuredLevel1SourcesInternal({...config,sources:firstBatch.map(spec=>spec.source)},deployment,settingsValidation);const ordered=[...declared.filter(spec=>selection.includes(spec.source)).map(spec=>spec.source),...selection.filter(source=>!declared.some(spec=>spec.source===source))];return ordered.filter(source=>{if(settingsValidation&&source==="zendesk"&&options&&Object.hasOwn(options,source)){const value=options[source];const mode=Object.getOwnPropertyDescriptor(value,"mode");if(mode&&"value"in mode&&mode.value==="oauth"&&!Object.hasOwn(value,"runtimeDirectory")){validateZendeskOAuthOptions(value);if(Object.hasOwn(value,"packageDirectory"))throw Error("Zendesk package directory requires a validated runtime.");return false}}return true}).map(source=>{const policy={fullActions:true};if(options&&Object.hasOwn(options,source))return preparedFactories.get(source)(source,deploymentOptions(source,options[source],deployment),policy);if(graphSessionSourceIds.includes(source)&&deployment.runtimeDirectory)return createGraphSessionSource(source,{runtimeDirectory:join(deployment.runtimeDirectory,"server-sessions",source)},policy);if(source==="ghost"&&deployment.runtimeDirectory)return createGhostFieldsSource({mode:"fields",runtimeDirectory:join(deployment.runtimeDirectory,source)},policy);if(source==="zendesk"&&deployment.runtimeDirectory)return createZendeskFieldsSource({mode:"fields",runtimeDirectory:join(deployment.runtimeDirectory,source)},policy);const fixed=declared.find(spec=>spec.source===source);if(fixed)return source==="immich"?createImmichFieldsSource(policy):source==="lark"?createLarkFieldsSource(policy):fixed;if(!options||!Object.hasOwn(options,source))throw Error(`Prepared source '${source}' needs explicit nonsecret provisioning references.`);return preparedFactories.get(source)(source,options[source],policy)}).map(spec=>{if(spec.auth.kind==="mcp-oauth"&&spec.auth.reviewed){const writer=spec.source==="cloudflare"?"workers-kv-storage.write":spec.source==="raindrop"||spec.source==="readwise"?"write":void 0;if(writer)spec={...spec,auth:{...spec.auth,reviewed:{...spec.auth.reviewed,scopes:[...new Set([...spec.auth.reviewed.scopes,writer])]}}}}if(spec.source==="microsoft-todo"&&spec.auth.kind==="oauth-device"){const review=spec.auth.reviewed;spec={...spec,auth:{...spec.auth,reviewed:{...review,scopes:review.scopes.map(scope=>scope==="Tasks.Read"?"Tasks.ReadWrite":scope)}}}}if(config.oauthSources?.includes(spec.source)){const bearer=spec.server.transport==="http"?new URL(spec.server.url).protocol==="https:"&&(!spec.server.authorization||spec.server.authorization.kind==="bearer"):typeof spec.server.tokenEnv==="string"&&/^[A-Z][A-Z0-9_]{0,127}$/u.test(spec.server.tokenEnv);if(spec.auth.kind!=="custodied"||!["mcp-token","rest-token"].includes(spec.auth.credentialKind)||!bearer||new URL(spec.auth.issuer).protocol!=="https:"||spec.auth.requiredScopes.length>32)throw Error("Existing OAuth resources require an explicit bearer route or stdio token environment.");const hosted=spec.server.transport==="http"?spec.server.url:void 0,issuer=spec.auth.issuer,audience=spec.auth.audience;const box=spec.source==="box"&&issuer==="https://api.box.com"&&["https://mcp.box.com","https://mcp.box.com/"].includes(hosted??"")&&["https://mcp.box.com","https://mcp.box.com/"].includes(audience);const googleResource=spec.source==="google-contacts"?"https://people.googleapis.com/mcp/v1":spec.source==="google-chat"?"https://chatmcp.googleapis.com/mcp/v1":void 0;const google=googleResource!==void 0&&issuer==="https://accounts.google.com"&&hosted===googleResource&&audience===googleResource;const allowedOrigins=box?["https://api.box.com","https://account.box.com"]:google?["https://accounts.google.com","https://oauth2.googleapis.com"]:[new URL(issuer).origin];spec={...spec,auth:{...spec.auth,credentialKind:"oauth",oauth:{allowedOrigins}}}}const nativeRead=spec.auth.kind==="custodied"&&spec.auth.credentialKind==="local-no-secret"||["front","hubspot"].includes(spec.source)&&spec.auth.kind==="mcp-oauth"&&spec.auth.reviewed?.registration?.kind==="pre-registered";return fullActionCatalog(withLoopbackTls(spec,deployment.runtimeDirectory),{fullActions:true},nativeRead)})}export function level1SourceIds(){return[...new Set([...firstBatch,sentry,readwise,fastmail,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark,...preparedWork,...additionalSources].map(spec=>spec.source).concat([...preparedFactories.keys()]))]}export function automaticLevel1SourceIds(){return level1SourceIds()}export async function prepareLevel1Configuration(vault,config={},deployment={}){const ids=level1SourceIds();validateLevel1Selection(config,ids);const sources=config.requestedSources??config.sources??automaticLevel1SourceIds();const runtime=await prepareRuntimeDirectories(deployment,sources);const plan=await prepareConfiguration(vault,{...config,sources},ids,value=>configuredLevel1Sources(value,runtime),[...preparedFactories.keys()]);if(runtime.runtimeDirectory){for(const source of plan.configuration.sources)if(graphSessionSourceIds.includes(source)&&!Object.hasOwn(plan.configuration.prepared,source))plan.configuration.prepared[source]={mode:"server-session",runtimeDirectory:join(runtime.runtimeDirectory,"server-sessions",source)}}if(runtime.runtimeDirectory){for(const source of["ghost","zendesk"])if(plan.configuration.sources.includes(source)&&!Object.hasOwn(plan.configuration.prepared,source))plan.configuration.prepared[source]={mode:"fields",runtimeDirectory:join(runtime.runtimeDirectory,source)}}for(const[source,options]of Object.entries(plan.configuration.prepared))plan.configuration.prepared[source]=deploymentOptions(source,options,runtime);return plan}function withoutDisabledJoplin(config){if(config.prepared?.joplin?.mode==="paired-plugin")return config;const without=items=>items?.filter(source=>source!=="joplin");const omit=values=>values&&Object.fromEntries(Object.entries(values).filter(([source])=>source!=="joplin"));return{...config,...config.sources?{sources:without(config.sources)}:{},...config.requestedSources?{requestedSources:without(config.requestedSources)}:{},...config.fullActions?{fullActions:without(config.fullActions)}:{},...config.oauthSources?{oauthSources:without(config.oauthSources)}:{},...config.prepared?{prepared:omit(config.prepared)}:{},...config.bindings?{bindings:omit(config.bindings)}:{}}}export function validateLevel1Configuration(value){validateLevel1Selection(value,level1SourceIds());configuredLevel1SourcesInternal(withoutDisabledJoplin(value),{},true)}export function readLevel1Configuration(file,options={}){return withSettingsReadLock(file,options.partial?value=>validateLevel1Selection(value,level1SourceIds()):validateLevel1Configuration,async current=>current)}export function writeLevel1Configuration(file,config){return replaceSettings(file,config,validateLevel1Configuration)}export function updateLevel1Configuration(file,update,options={}){return updateSettings(file,validateLevel1Configuration,update,options)}export function recoverInterruptedJoplinConfiguration(file,options={}){return recoverInterruptedJoplinSettings(file,validateLevel1Configuration,options)}function nativeFolderRegistration(spec,selection){const source=spec.source,auth=spec.auth,prepared=selection.prepared?.[source];if(auth.kind!=="custodied"||auth.credentialKind!=="local-no-secret"||!Array.isArray(prepared?.roots)||auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")return void 0;return{prepared,auth,binding:selection.bindings?.[source],fullActions:true,oauth:selection.oauthSources?.includes(source)??false}}export async function apply(ctx,config={}){if(!config||typeof config!=="object"||Array.isArray(config)||Object.keys(config).some(k=>!["transport","sources","requestedSources","prepared","fullActions","oauthSources","bindings","wire","provisioningFile","autoProvision","runtimeDirectory"].includes(k))||config.sources!==void 0&&(!Array.isArray(config.sources)||config.sources.some(s=>typeof s!=="string"))||config.autoProvision!==void 0&&typeof config.autoProvision!=="boolean")throw new Error("Invalid level 1 connector settings.");const start=async(saved,pendingFirst)=>{if(pendingFirst&&config.sources?.includes("joplin")&&config.prepared?.joplin?.mode==="paired-plugin")throw Error("Level 1 setup requires interrupted-commit recovery.");const deployment=config.runtimeDirectory===void 0?{}:{runtimeDirectory:config.runtimeDirectory};const disabledJoplin=(config.sources??saved?.requestedSources??saved?.sources??[]).includes("joplin");const safeSaved=saved?withoutDisabledJoplin(saved):void 0;const automatic=config.sources===void 0&&(safeSaved?.requestedSources!==void 0||config.autoProvision&&safeSaved===void 0)?await prepareLevel1Configuration(ctx.zortexVaultStore,safeSaved??{},deployment):void 0;const selection=withoutDisabledJoplin(config.sources!==void 0?config:automatic?.configuration??safeSaved??config);const runtime=await prepareRuntimeDirectories(deployment,selection.sources??[]);const specs=configuredLevel1Sources(selection,runtime);const catalog=level1Catalog(specs);const publicConnections=runtime.runtimeDirectory&&join(runtime.runtimeDirectory,"enabled-public-sources");function makeProvider(spec){const rememberPublicConnection=publicConnections&&publicDataSourceIds.includes(spec.source)?async()=>{await mkdir(join(publicConnections,spec.source),{recursive:true,mode:448})}:void 0;return createShallowProvider(spec,{metrics:()=>ctx.get("zortexTelemetry"),vault:ctx.zortexVaultStore,enrollment:ctx.zortexConnectorEnrollment,transport:config.transport??ctx.zortexConnectorHttp,...config.wire?{wire:config.wire}:{},...rememberPublicConnection?{rememberPublicConnection}:{}})}const providers=specs.map(makeProvider);const loadedFolders=new Map(specs.map(spec=>[spec.source,nativeFolderRegistration(spec,selection)]));const withdraws=providers.map(p=>ctx.zortexConnectorHub.register(p));const deferred=new Map;if(disabledJoplin&&!ctx.zortexConnectorHub.hasSource?.("joplin")){const placeholder=deferredSource("joplin");withdraws.push(ctx.zortexConnectorHub.register(placeholder));deferred.set("joplin",placeholder)}if(automatic&&ctx.zortexConnectorHub.hasSource){const candidates=new Set(automatic.pending.map(item=>item.source));for(const source of candidates)if(preparedFactories.has(source)&&!ctx.zortexConnectorHub.hasSource(source)){const placeholder=deferredSource(source);withdraws.push(ctx.zortexConnectorHub.register(placeholder));deferred.set(source,placeholder)}}const sources=providers.map(p=>p.info.source),pending=automatic?.pending??[];let disposed=false,activationQueue=Promise.resolve();const activate=source=>{const work=activationQueue.then(async()=>{if(disposed)return{status:"restart-required",reason:"plugin-disposed"};if(config.sources!==void 0)return{status:"restart-required",reason:"inline-selection"};if(!config.provisioningFile)return{status:"restart-required",reason:"no-settings-file"};const loadedFolder=loadedFolders.get(source);if(!loadedFolder&&providers.some(p=>p.info.source===source))return{status:"restart-required",reason:"provider-already-active"};if(!preparedFactories.has(source))return{status:"unavailable",reason:"unsupported-source"};if(!ctx.zortexConnectorHub.hasSource)return{status:"restart-required",reason:"registry-inspection-unavailable"};try{return await withSettingsReadLock(config.provisioningFile,validateLevel1Configuration,async saved2=>{if(disposed)return{status:"restart-required",reason:"plugin-disposed"};if(!saved2?.sources?.includes(source))return{status:"unavailable",reason:"source-not-configured"};const placeholder=deferred.get(source);if(placeholder&&!ctx.zortexConnectorHub.replaceDeferred)return{status:"restart-required",reason:"deferred-upgrade-unavailable"};if(!placeholder&&!loadedFolder&&ctx.zortexConnectorHub.hasSource(source))return{status:"restart-required",reason:"provider-already-active"};const single={sources:[source],requestedSources:[source],...saved2.prepared?.[source]?{prepared:{[source]:saved2.prepared[source]}}:{},...saved2.fullActions?{fullActions:saved2.fullActions.includes(source)?[source]:[]}:{},...saved2.oauthSources?{oauthSources:saved2.oauthSources.includes(source)?[source]:[]}:{},...saved2.bindings?.[source]?{bindings:{[source]:saved2.bindings[source]}}:{}};const plan=await prepareLevel1Configuration(ctx.zortexVaultStore,single,deployment);if(disposed)return{status:"restart-required",reason:"plugin-disposed"};const denied=plan.pending.find(item=>item.source===source);if(denied){for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);pending.push(denied);return{status:"unavailable",reason:denied.reason}}if(!plan.configuration.sources.includes(source))return{status:"unavailable",reason:"source-not-configured"};const runtime2=await prepareRuntimeDirectories(deployment,[source]);if(disposed)return{status:"restart-required",reason:"plugin-disposed"};const spec=configuredLevel1Sources(plan.configuration,runtime2).find(item=>item.source===source);if(!spec)return{status:"unavailable",reason:"source-not-configured"};if(loadedFolder){if(!ctx.zortexConnectorHub.hasSource(source)||!isDeepStrictEqual(loadedFolder,nativeFolderRegistration(spec,plan.configuration)))return{status:"restart-required",reason:"provider-already-active"};for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);return{status:"activated"}}const entry=level1Catalog([spec])[0];if(!placeholder&&ctx.zortexConnectorHub.hasSource(source))return{status:"restart-required",reason:"provider-already-active"};const provider=makeProvider(spec);try{const withdraw=placeholder?ctx.zortexConnectorHub.replaceDeferred(placeholder,provider):ctx.zortexConnectorHub.register(provider);if(!withdraw){await provider.close();return{status:"restart-required",reason:"deferred-provider-changed"}}if(placeholder)deferred.delete(source);loadedFolders.set(source,nativeFolderRegistration(spec,plan.configuration));withdraws.push(withdraw);providers.push(provider);sources.push(source);catalog.push(entry);for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);return{status:"activated"}}catch{await provider.close();return{status:"restart-required",reason:"registration-failed"}}})}catch{return{status:"restart-required",reason:"settings-unavailable"}}});activationQueue=work.then(()=>{},()=>{});return work};if(publicConnections){const entries=await readdir(publicConnections,{withFileTypes:true}).catch(error=>{if(["ENOENT","EACCES","EPERM","ENOTDIR"].includes(error.code??""))return[];throw error});const enabled=new Set(entries.filter(entry=>entry.isDirectory()).map(entry=>entry.name));const restore=providers.filter(p=>enabled.has(p.info.source)&&publicDataSourceIds.includes(p.info.source));for(let offset=0;offset<restore.length;offset+=4){await Promise.all(restore.slice(offset,offset+4).map(p=>p.check?.({signal:AbortSignal.timeout(15e3)})))}}ctx.reflect.provide("zortexLevel1Connectors",{sources,catalog,pending,provider:source=>providers.find(p=>p.info.source===source),activate});const owner=ctx;owner.effect(()=>async()=>{disposed=true;await activationQueue;for(const w of withdraws)w();await Promise.allSettled(providers.map(p=>p.close()))},"connector-level1:sources")};if(config.provisioningFile)await withSettingsStartupLock(config.provisioningFile,validateLevel1Configuration,start);else await start(void 0,false)}export{createJoplinPairing,readPairedJoplinBridge}from"./joplin-pairing.js";
1
+ import{mkdir,readdir,realpath}from"node:fs/promises";import{dirname,isAbsolute,join}from"node:path";import{isDeepStrictEqual}from"node:util";import{createShallowProvider}from"./shallow.js";import{publicDataSourceIds}from"./public-data/catalog.js";import{withLoopbackTls}from"./loopback-tls.js";import{firstBatch,sentry}from"./sources.js";import{additionalSources}from"./additional-sources.js";import{preparedWork,preparedWorkSourceIds,createPreparedWorkSource}from"./prepared-work.js";import{preparedLocalSourceIds,createPreparedLocalSource,fastmail}from"./prepared-local.js";import{preparedServiceSourceIds,createPreparedServiceSource,createImmichFieldsSource,createLarkFieldsSource,readwise,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark}from"./prepared-services.js";import{preparedGraphSourceIds,createPreparedGraphSource,graphSessionSourceIds,createGraphSessionSource}from"./prepared-graph.js";import{preparedWorkStdioSourceIds,createGhostFieldsSource,createZendeskFieldsSource,createZendeskOAuthSource,validateZendeskOAuthOptions}from"./prepared-work-stdio.js";import{preparedExistingSourceIds,createPreparedExistingSource}from"./prepared-existing.js";import{preparedDingTalkSourceIds,createPreparedDingTalkSource}from"./prepared-dingtalk.js";import{preparedDiscordSourceIds,createPreparedDiscordSource}from"./prepared-discord.js";import{preparedTelegramSourceIds,createPreparedTelegramSource}from"./prepared-telegram.js";import{createPreparedWordPressSource}from"./prepared-wordpress.js";import{prepareConfiguration,validateLevel1Selection}from"./provisioning.js";import{replaceSettings,updateSettings,withSettingsReadLock,withSettingsStartupLock,recoverInterruptedJoplinSettings}from"./settings-transaction.js";import{fullActionCatalog}from"./action-policy.js";import{deferredSource}from"./deferred-box.js";import{attachComputerFiles}from"./computer-files.js";export function level1Catalog(specs=firstBatch){return specs.map(spec=>{if(spec.server.transport==="http"){const url=new URL(spec.server.url),local=["127.0.0.1","[::1]"].includes(url.hostname);return{source:spec.source,execution:{kind:local?"local-http-mcp":"hosted-mcp",url:url.href},licenseMode:local?"open-source":"hosted"}}if(spec.server.command==="npx"&&spec.origin.package&&spec.server.args.includes(spec.origin.package)&&/@\d+\.\d+\.\d+$/.test(spec.origin.package))return{source:spec.source,execution:{kind:"npm-stdio",package:spec.origin.package,command:"npx",args:[...spec.server.args]},licenseMode:"open-source"};if(spec.server.command==="uvx"&&spec.origin.package&&spec.server.args.includes(spec.origin.package)&&/==\d+\.\d+\.\d+$/.test(spec.origin.package))return{source:spec.source,execution:{kind:"python-stdio",package:spec.origin.package,command:"uvx",args:[...spec.server.args]},licenseMode:"open-source"};if(spec.origin.artifact&&/@\d+\.\d+\.\d+(?:-[0-9A-Za-z]+(?:[.-][0-9A-Za-z]+)*)?$/.test(spec.origin.artifact))return{source:spec.source,execution:{kind:"local-executable",artifact:spec.origin.artifact,command:spec.server.command,args:[...spec.server.args]},licenseMode:"open-source"};throw Error(`${spec.source} has no exact executable artifact contract.`)})}export{createShallowProvider,toolRow,setLoginPoll,proxyEnv}from"./shallow.js";export{firstBatch,onPath,stripe,calendly,openrouter,cloudflare,posthog,notionL1,github,gitlab,jira,confluence,linear,asana,clickup,todoist,ticktick,microsoftTodo,appleNotes,appleReminders,appleMusic,sentry,shopify,reddit,spotify,tiktok,notebooklm,cua}from"./sources.js";export{additionalSources,appstore,rednote}from"./additional-sources.js";export{publicDataSourceIds}from"./public-data/catalog.js";export{preparedWork}from"./prepared-work.js";export{preparedWorkSourceIds,createPreparedWorkSource}from"./prepared-work.js";export{createGhostFieldsSource,createZendeskFieldsSource,createZendeskOAuthSource}from"./prepared-work-stdio.js";export{preparedLocalSourceIds,createPreparedLocalSource,preparedLocalRootsAudience,preparedLocalNativeSelection,fastmail}from"./prepared-local.js";export{prepareMacAptOptions,createPreparedMacAptSource}from"./prepared-macapt.js";export{preparedServiceSourceIds,createPreparedServiceSource,createImmichFieldsSource,createLarkFieldsSource,readwise,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark}from"./prepared-services.js";export{preparedGraphSourceIds,createPreparedGraphSource}from"./prepared-graph.js";export{preparedExistingSourceIds,createPreparedExistingSource}from"./prepared-existing.js";export{preparedDingTalkSourceIds,createPreparedDingTalkSource}from"./prepared-dingtalk.js";export{preparedDiscordSourceIds,createPreparedDiscordSource,preparedDiscordAudience}from"./prepared-discord.js";export{preparedTelegramSourceIds,createPreparedTelegramSource,preparedTelegramAudience}from"./prepared-telegram.js";export{createPreparedWordPressSource}from"./prepared-wordpress.js";export{reviewedToolSchemaHash}from"./custodied.js";export const name="zortex-connector-level1",inject=["zortexConnectorHub","zortexConnectorEnrollment","zortexVaultStore","zortexConnectorHttp"];const runtimeSources=new Set([...preparedGraphSourceIds,...preparedWorkStdioSourceIds]);function deploymentOptions(source,options,deployment){return deployment.runtimeDirectory&&runtimeSources.has(source)&&options.runtimeDirectory===void 0?{...options,runtimeDirectory:join(deployment.runtimeDirectory,source)}:options}async function prepareRuntimeDirectories(deployment,sources){if(deployment.runtimeDirectory===void 0)return{};if(typeof deployment.runtimeDirectory!=="string"||!isAbsolute(deployment.runtimeDirectory))throw Error("Level 1 runtime directory must be an absolute product-owned path.");await mkdir(deployment.runtimeDirectory,{recursive:true,mode:448});const runtimeDirectory=await realpath(deployment.runtimeDirectory);for(const source of sources)if(runtimeSources.has(source))await mkdir(join(runtimeDirectory,source),{recursive:true,mode:448});for(const source of sources)if(graphSessionSourceIds.includes(source))await mkdir(join(runtimeDirectory,"server-sessions",source),{recursive:true,mode:448});return{runtimeDirectory}}const preparedFactories=new Map([...preparedWorkSourceIds.map(source=>[source,source==="wordpress"?createConfiguredWordPressSource:source==="ghost"||source==="zendesk"?createConfiguredWorkStdioSource:createPreparedWorkSource]),...preparedLocalSourceIds.map(source=>[source,createPreparedLocalSource]),...preparedServiceSourceIds.map(source=>[source,createPreparedServiceSource]),...preparedGraphSourceIds.map(source=>[source,createConfiguredGraphSource]),...preparedExistingSourceIds.map(source=>[source,createPreparedExistingSource]),...preparedDingTalkSourceIds.map(source=>[source,createPreparedDingTalkSource]),...preparedDiscordSourceIds.map(source=>[source,createPreparedDiscordSource]),...preparedTelegramSourceIds.map(source=>[source,createPreparedTelegramSource])]);function createConfiguredWordPressSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;return mode&&"value"in mode&&mode.value==="self-hosted"?createPreparedWordPressSource(source,options):createPreparedWorkSource(source,options,policy)}function createConfiguredGraphSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;return mode&&"value"in mode&&mode.value==="server-session"?createGraphSessionSource(source,options,policy):createPreparedGraphSource(source,options,policy)}function createConfiguredWorkStdioSource(source,options,policy={}){const mode=options&&typeof options==="object"?Object.getOwnPropertyDescriptor(options,"mode"):void 0;if(source==="zendesk"&&mode&&"value"in mode&&mode.value==="oauth")return createZendeskOAuthSource(options,policy);return mode&&"value"in mode&&mode.value==="fields"?(source==="ghost"?createGhostFieldsSource:createZendeskFieldsSource)(options,policy):createPreparedWorkSource(source,options,policy)}export function configuredLevel1Sources(config,deployment={}){return configuredLevel1SourcesInternal(config,deployment,false)}function configuredLevel1SourcesInternal(config,deployment,settingsValidation){const declared=[...firstBatch,sentry,readwise,fastmail,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark,...preparedWork,...additionalSources].filter((spec,index,all)=>all.findIndex(item=>item.source===spec.source)===index),selection=config.sources;if(selection!==void 0&&(!Array.isArray(selection)||new Set(selection).size!==selection.length||selection.some(source=>typeof source!=="string"||!declared.some(spec=>spec.source===source)&&!preparedFactories.has(source))))throw Error("Invalid level 1 source selection: every source must be declared and unique.");const requested=config.requestedSources??selection;if(config.requestedSources!==void 0&&(!selection||!Array.isArray(requested)||new Set(requested).size!==requested.length||requested.some(source=>typeof source!=="string"||!declared.some(spec=>spec.source===source)&&!preparedFactories.has(source))||selection.some(source=>!requested.includes(source))))throw Error("Invalid requested level 1 source selection.");if(config.fullActions!==void 0&&(!Array.isArray(config.fullActions)||new Set(config.fullActions).size!==config.fullActions.length||config.fullActions.some(source=>!requested?.includes(source))))throw Error("Invalid level 1 action selection: select each source explicitly.");if(config.oauthSources!==void 0&&(!Array.isArray(config.oauthSources)||new Set(config.oauthSources).size!==config.oauthSources.length||config.oauthSources.some(source=>!requested?.includes(source))))throw Error("Invalid level 1 OAuth resource selection.");const options=config.prepared;if(options!==void 0){if(!options||typeof options!=="object"||Array.isArray(options)||![Object.prototype,null].includes(Object.getPrototypeOf(options)))throw Error("Invalid prepared level 1 source settings.");for(const key of Reflect.ownKeys(options)){if(typeof key!=="string"||!requested?.includes(key)||!preparedFactories.has(key))throw Error("Prepared settings require explicit selection of the matching source.");const descriptor=Object.getOwnPropertyDescriptor(options,key);if(!descriptor.enumerable||!("value"in descriptor))throw Error("Invalid prepared level 1 source settings.")}}for(const[source,value]of Object.entries(options??{}))if(!selection?.includes(source))configuredLevel1SourcesInternal({sources:[source],prepared:{[source]:value},fullActions:config.fullActions?.includes(source)?[source]:[],oauthSources:config.oauthSources?.includes(source)?[source]:[]},deployment,settingsValidation);if(selection===void 0)return configuredLevel1SourcesInternal({...config,sources:firstBatch.map(spec=>spec.source)},deployment,settingsValidation);const ordered=[...declared.filter(spec=>selection.includes(spec.source)).map(spec=>spec.source),...selection.filter(source=>!declared.some(spec=>spec.source===source))];return ordered.filter(source=>{if(settingsValidation&&source==="zendesk"&&options&&Object.hasOwn(options,source)){const value=options[source];const mode=Object.getOwnPropertyDescriptor(value,"mode");if(mode&&"value"in mode&&mode.value==="oauth"&&!Object.hasOwn(value,"runtimeDirectory")){validateZendeskOAuthOptions(value);if(Object.hasOwn(value,"packageDirectory"))throw Error("Zendesk package directory requires a validated runtime.");return false}}return true}).map(source=>{const policy={fullActions:true};if(options&&Object.hasOwn(options,source))return preparedFactories.get(source)(source,deploymentOptions(source,options[source],deployment),policy);if(graphSessionSourceIds.includes(source)&&deployment.runtimeDirectory)return createGraphSessionSource(source,{runtimeDirectory:join(deployment.runtimeDirectory,"server-sessions",source)},policy);if(source==="ghost"&&deployment.runtimeDirectory)return createGhostFieldsSource({mode:"fields",runtimeDirectory:join(deployment.runtimeDirectory,source)},policy);if(source==="zendesk"&&deployment.runtimeDirectory)return createZendeskFieldsSource({mode:"fields",runtimeDirectory:join(deployment.runtimeDirectory,source)},policy);const fixed=declared.find(spec=>spec.source===source);if(fixed)return source==="immich"?createImmichFieldsSource(policy):source==="lark"?createLarkFieldsSource(policy):fixed;if(!options||!Object.hasOwn(options,source))throw Error(`Prepared source '${source}' needs explicit nonsecret provisioning references.`);return preparedFactories.get(source)(source,options[source],policy)}).map(spec=>{if(spec.auth.kind==="mcp-oauth"&&spec.auth.reviewed){const writer=spec.source==="cloudflare"?"workers-kv-storage.write":spec.source==="raindrop"||spec.source==="readwise"?"write":void 0;if(writer)spec={...spec,auth:{...spec.auth,reviewed:{...spec.auth.reviewed,scopes:[...new Set([...spec.auth.reviewed.scopes,writer])]}}}}if(spec.source==="microsoft-todo"&&spec.auth.kind==="oauth-device"){const review=spec.auth.reviewed;spec={...spec,auth:{...spec.auth,reviewed:{...review,scopes:review.scopes.map(scope=>scope==="Tasks.Read"?"Tasks.ReadWrite":scope)}}}}if(config.oauthSources?.includes(spec.source)){const bearer=spec.server.transport==="http"?new URL(spec.server.url).protocol==="https:"&&(!spec.server.authorization||spec.server.authorization.kind==="bearer"):typeof spec.server.tokenEnv==="string"&&/^[A-Z][A-Z0-9_]{0,127}$/u.test(spec.server.tokenEnv);if(spec.auth.kind!=="custodied"||!["mcp-token","rest-token"].includes(spec.auth.credentialKind)||!bearer||new URL(spec.auth.issuer).protocol!=="https:"||spec.auth.requiredScopes.length>32)throw Error("Existing OAuth resources require an explicit bearer route or stdio token environment.");const hosted=spec.server.transport==="http"?spec.server.url:void 0,issuer=spec.auth.issuer,audience=spec.auth.audience;const box=spec.source==="box"&&issuer==="https://api.box.com"&&["https://mcp.box.com","https://mcp.box.com/"].includes(hosted??"")&&["https://mcp.box.com","https://mcp.box.com/"].includes(audience);const googleResource=spec.source==="google-contacts"?"https://people.googleapis.com/mcp/v1":spec.source==="google-chat"?"https://chatmcp.googleapis.com/mcp/v1":void 0;const google=googleResource!==void 0&&issuer==="https://accounts.google.com"&&hosted===googleResource&&audience===googleResource;const allowedOrigins=box?["https://api.box.com","https://account.box.com"]:google?["https://accounts.google.com","https://oauth2.googleapis.com"]:[new URL(issuer).origin];spec={...spec,auth:{...spec.auth,credentialKind:"oauth",oauth:{allowedOrigins}}}}const nativeRead=spec.auth.kind==="custodied"&&spec.auth.credentialKind==="local-no-secret"||["front","hubspot"].includes(spec.source)&&spec.auth.kind==="mcp-oauth"&&spec.auth.reviewed?.registration?.kind==="pre-registered";return fullActionCatalog(withLoopbackTls(spec,deployment.runtimeDirectory),{fullActions:true},nativeRead)})}export function level1SourceIds(){return[...new Set([...firstBatch,sentry,readwise,fastmail,raindrop,calcom,harvest,toggl,immich,karakeep,matrix,lark,...preparedWork,...additionalSources].map(spec=>spec.source).concat([...preparedFactories.keys()]))]}export function automaticLevel1SourceIds(){return level1SourceIds()}export async function prepareLevel1Configuration(vault,config={},deployment={}){const ids=level1SourceIds();validateLevel1Selection(config,ids);const sources=config.requestedSources??config.sources??automaticLevel1SourceIds();const runtime=await prepareRuntimeDirectories(deployment,sources);const plan=await prepareConfiguration(vault,{...config,sources},ids,value=>configuredLevel1Sources(value,runtime),[...preparedFactories.keys()]);if(runtime.runtimeDirectory){for(const source of plan.configuration.sources)if(graphSessionSourceIds.includes(source)&&!Object.hasOwn(plan.configuration.prepared,source))plan.configuration.prepared[source]={mode:"server-session",runtimeDirectory:join(runtime.runtimeDirectory,"server-sessions",source)}}if(runtime.runtimeDirectory){for(const source of["ghost","zendesk"])if(plan.configuration.sources.includes(source)&&!Object.hasOwn(plan.configuration.prepared,source))plan.configuration.prepared[source]={mode:"fields",runtimeDirectory:join(runtime.runtimeDirectory,source)}}for(const[source,options]of Object.entries(plan.configuration.prepared))plan.configuration.prepared[source]=deploymentOptions(source,options,runtime);return plan}function withoutDisabledJoplin(config){if(config.prepared?.joplin?.mode==="paired-plugin")return config;const without=items=>items?.filter(source=>source!=="joplin");const omit=values=>values&&Object.fromEntries(Object.entries(values).filter(([source])=>source!=="joplin"));return{...config,...config.sources?{sources:without(config.sources)}:{},...config.requestedSources?{requestedSources:without(config.requestedSources)}:{},...config.fullActions?{fullActions:without(config.fullActions)}:{},...config.oauthSources?{oauthSources:without(config.oauthSources)}:{},...config.prepared?{prepared:omit(config.prepared)}:{},...config.bindings?{bindings:omit(config.bindings)}:{}}}export function validateLevel1Configuration(value){validateLevel1Selection(value,level1SourceIds());configuredLevel1SourcesInternal(withoutDisabledJoplin(value),{},true)}export function readLevel1Configuration(file,options={}){return withSettingsReadLock(file,options.partial?value=>validateLevel1Selection(value,level1SourceIds()):validateLevel1Configuration,async current=>current)}export function writeLevel1Configuration(file,config){return replaceSettings(file,config,validateLevel1Configuration)}export function updateLevel1Configuration(file,update,options={}){return updateSettings(file,validateLevel1Configuration,update,options)}export function recoverInterruptedJoplinConfiguration(file,options={}){return recoverInterruptedJoplinSettings(file,validateLevel1Configuration,options)}function nativeFolderRegistration(spec,selection){const source=spec.source,auth=spec.auth,prepared=selection.prepared?.[source];if(auth.kind!=="custodied"||auth.credentialKind!=="local-no-secret"||!Array.isArray(prepared?.roots)||auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")return void 0;return{prepared,auth,binding:selection.bindings?.[source],fullActions:true,oauth:selection.oauthSources?.includes(source)??false}}export async function apply(ctx,config={}){if(!config||typeof config!=="object"||Array.isArray(config)||Object.keys(config).some(k=>!["transport","sources","requestedSources","prepared","fullActions","oauthSources","bindings","wire","provisioningFile","autoProvision","runtimeDirectory"].includes(k))||config.sources!==void 0&&(!Array.isArray(config.sources)||config.sources.some(s=>typeof s!=="string"))||config.autoProvision!==void 0&&typeof config.autoProvision!=="boolean")throw new Error("Invalid level 1 connector settings.");const start=async(saved,pendingFirst)=>{if(pendingFirst&&config.sources?.includes("joplin")&&config.prepared?.joplin?.mode==="paired-plugin")throw Error("Level 1 setup requires interrupted-commit recovery.");const deployment=config.runtimeDirectory===void 0?{}:{runtimeDirectory:config.runtimeDirectory};const disabledJoplin=(config.sources??saved?.requestedSources??saved?.sources??[]).includes("joplin");const safeSaved=saved?withoutDisabledJoplin(saved):void 0;const automatic=config.sources===void 0&&(safeSaved?.requestedSources!==void 0||config.autoProvision&&safeSaved===void 0)?await prepareLevel1Configuration(ctx.zortexVaultStore,safeSaved??{},deployment):void 0;const selection=withoutDisabledJoplin(config.sources!==void 0?config:automatic?.configuration??safeSaved??config);const runtime=await prepareRuntimeDirectories(deployment,selection.sources??[]);const specs=configuredLevel1Sources(selection,runtime);const catalog=level1Catalog(specs);const publicConnections=runtime.runtimeDirectory&&join(runtime.runtimeDirectory,"enabled-public-sources");async function makeProvider(spec,providerSelection=selection){const rememberPublicConnection=publicConnections&&publicDataSourceIds.includes(spec.source)?async()=>{await mkdir(join(publicConnections,spec.source),{recursive:true,mode:448})}:void 0;const provider=createShallowProvider(spec,{metrics:()=>ctx.get("zortexTelemetry"),vault:ctx.zortexVaultStore,enrollment:ctx.zortexConnectorEnrollment,transport:config.transport??ctx.zortexConnectorHttp,...config.wire?{wire:config.wire}:{},...rememberPublicConnection?{rememberPublicConnection}:{}});const sqlite=ctx.get("zortexSqliteVault");if(spec.source==="computer-files"&&spec.auth.kind==="custodied"&&sqlite&&nativeFolderRegistration(spec,providerSelection)){const excludeRoots=[...config.provisioningFile?[dirname(config.provisioningFile)]:[],...runtime.runtimeDirectory?[runtime.runtimeDirectory]:[]];return attachComputerFiles(provider,{vault:ctx.zortexVaultStore,sqlite,auth:spec.auth,selection:providerSelection,...config.sources===void 0&&config.provisioningFile?{settingsFile:config.provisioningFile}:{},excludeRoots})}return{provider,files:void 0}}const preparedProviders=await Promise.all(specs.map(spec=>makeProvider(spec)));const providers=preparedProviders.map(row=>row.provider);const loadedFolders=new Map(specs.map(spec=>[spec.source,nativeFolderRegistration(spec,selection)]));const withdraws=providers.map(p=>ctx.zortexConnectorHub.register(p));const computerFiles=preparedProviders.find(row=>row.files)?.files;if(computerFiles)ctx.reflect.provide("zortexComputerFiles",computerFiles);const deferred=new Map;if(disabledJoplin&&!ctx.zortexConnectorHub.hasSource?.("joplin")){const placeholder=deferredSource("joplin");withdraws.push(ctx.zortexConnectorHub.register(placeholder));deferred.set("joplin",placeholder)}if(automatic&&ctx.zortexConnectorHub.hasSource){const candidates=new Set(automatic.pending.map(item=>item.source));for(const source of candidates)if(preparedFactories.has(source)&&!ctx.zortexConnectorHub.hasSource(source)){const placeholder=deferredSource(source);withdraws.push(ctx.zortexConnectorHub.register(placeholder));deferred.set(source,placeholder)}}const sources=providers.map(p=>p.info.source),pending=automatic?.pending??[];let disposed=false,activationQueue=Promise.resolve();const activate=source=>{const work=activationQueue.then(async()=>{if(disposed)return{status:"restart-required",reason:"plugin-disposed"};if(config.sources!==void 0)return{status:"restart-required",reason:"inline-selection"};if(!config.provisioningFile)return{status:"restart-required",reason:"no-settings-file"};const loadedFolder=loadedFolders.get(source);if(!loadedFolder&&providers.some(p=>p.info.source===source))return{status:"restart-required",reason:"provider-already-active"};if(!preparedFactories.has(source))return{status:"unavailable",reason:"unsupported-source"};if(!ctx.zortexConnectorHub.hasSource)return{status:"restart-required",reason:"registry-inspection-unavailable"};try{return await withSettingsReadLock(config.provisioningFile,validateLevel1Configuration,async saved2=>{if(disposed)return{status:"restart-required",reason:"plugin-disposed"};if(!saved2?.sources?.includes(source))return{status:"unavailable",reason:"source-not-configured"};const placeholder=deferred.get(source);if(placeholder&&!ctx.zortexConnectorHub.replaceDeferred)return{status:"restart-required",reason:"deferred-upgrade-unavailable"};if(!placeholder&&!loadedFolder&&ctx.zortexConnectorHub.hasSource(source))return{status:"restart-required",reason:"provider-already-active"};const single={sources:[source],requestedSources:[source],...saved2.prepared?.[source]?{prepared:{[source]:saved2.prepared[source]}}:{},...saved2.fullActions?{fullActions:saved2.fullActions.includes(source)?[source]:[]}:{},...saved2.oauthSources?{oauthSources:saved2.oauthSources.includes(source)?[source]:[]}:{},...saved2.bindings?.[source]?{bindings:{[source]:saved2.bindings[source]}}:{}};const plan=await prepareLevel1Configuration(ctx.zortexVaultStore,single,deployment);if(disposed)return{status:"restart-required",reason:"plugin-disposed"};const denied=plan.pending.find(item=>item.source===source);if(denied){for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);pending.push(denied);return{status:"unavailable",reason:denied.reason}}if(!plan.configuration.sources.includes(source))return{status:"unavailable",reason:"source-not-configured"};const runtime2=await prepareRuntimeDirectories(deployment,[source]);if(disposed)return{status:"restart-required",reason:"plugin-disposed"};const spec=configuredLevel1Sources(plan.configuration,runtime2).find(item=>item.source===source);if(!spec)return{status:"unavailable",reason:"source-not-configured"};if(loadedFolder){if(!ctx.zortexConnectorHub.hasSource(source)||!isDeepStrictEqual(loadedFolder,nativeFolderRegistration(spec,plan.configuration)))return{status:"restart-required",reason:"provider-already-active"};for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);return{status:"activated"}}const entry=level1Catalog([spec])[0];if(!placeholder&&ctx.zortexConnectorHub.hasSource(source))return{status:"restart-required",reason:"provider-already-active"};const{provider,files}=await makeProvider(spec,plan.configuration);try{const withdraw=placeholder?ctx.zortexConnectorHub.replaceDeferred(placeholder,provider):ctx.zortexConnectorHub.register(provider);if(!withdraw){await provider.close();return{status:"restart-required",reason:"deferred-provider-changed"}}if(placeholder)deferred.delete(source);loadedFolders.set(source,nativeFolderRegistration(spec,plan.configuration));withdraws.push(withdraw);providers.push(provider);sources.push(source);catalog.push(entry);if(files)ctx.reflect.provide("zortexComputerFiles",files);for(let i=pending.length-1;i>=0;i--)if(pending[i].source===source)pending.splice(i,1);return{status:"activated"}}catch{await provider.close();return{status:"restart-required",reason:"registration-failed"}}})}catch{return{status:"restart-required",reason:"settings-unavailable"}}});activationQueue=work.then(()=>{},()=>{});return work};if(publicConnections){const entries=await readdir(publicConnections,{withFileTypes:true}).catch(error=>{if(["ENOENT","EACCES","EPERM","ENOTDIR"].includes(error.code??""))return[];throw error});const enabled=new Set(entries.filter(entry=>entry.isDirectory()).map(entry=>entry.name));const restore=providers.filter(p=>enabled.has(p.info.source)&&publicDataSourceIds.includes(p.info.source));for(let offset=0;offset<restore.length;offset+=4){await Promise.all(restore.slice(offset,offset+4).map(p=>p.check?.({signal:AbortSignal.timeout(15e3)})))}}ctx.reflect.provide("zortexLevel1Connectors",{sources,catalog,pending,provider:source=>providers.find(p=>p.info.source===source),activate});const owner=ctx;owner.effect(()=>async()=>{disposed=true;await activationQueue;for(const w of withdraws)w();await Promise.allSettled(providers.map(p=>p.close()))},"connector-level1:sources")};if(config.provisioningFile)await withSettingsStartupLock(config.provisioningFile,validateLevel1Configuration,start);else await start(void 0,false)}export{createJoplinPairing,readPairedJoplinBridge}from"./joplin-pairing.js";
@@ -1 +1 @@
1
- import{preparedAdobeNative}from"./prepared-adobe-native.js";import{preparedGameMetadata}from"./prepared-game-metadata.js";import{preparedDeveloperHistory}from"./prepared-developer-history.js";import{preparedOfficeLocal}from"./prepared-office-local.js";import{preparedAedt}from"./prepared-aedt.js";import{preparedPremierePro}from"./prepared-premiere-pro.js";import{preparedPacketTracer}from"./prepared-packet-tracer.js";import{preparedModrinth}from"./prepared-modrinth.js";import{preparedHearthstone}from"./prepared-hearthstone.js";import{preparedVisio}from"./prepared-visio.js";import{preparedMatlab}from"./prepared-matlab.js";import{preparedIllustrator}from"./prepared-illustrator.js";import{preparedMinecraft}from"./prepared-minecraft.js";import{preparedPowerPoint}from"./prepared-powerpoint.js";import{preparedCcs}from"./prepared-ccs.js";import{preparedPscad}from"./prepared-pscad.js";import{preparedPhotoshop}from"./prepared-photoshop.js";import{preparedAutocad}from"./prepared-autocad.js";import{preparedWindowsMetadata,windowsMetadataSource,windowsMetadataGrant}from"./prepared-windows-metadata.js";import{preparedDockerDesktop}from"./prepared-docker-desktop.js";import{preparedOllama}from"./prepared-ollama.js";import{preparedQtDesigner}from"./prepared-qt-designer.js";import{preparedTdms}from"./prepared-tdms.js";import{preparedJupyter}from"./prepared-jupyter.js";import{createHash}from"node:crypto";import{pageSchema,readFilePage}from"./computer-files-pages.js";import{realpathSync,statSync,readFileSync}from"node:fs";import{isAbsolute}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";import{reviewedToolSchemaHash}from"./custodied.js";import{createVisualStudioSource}from"./prepared-visual-studio.js";import{createModelSimSource}from"./prepared-modelsim.js";import{createQuartusSource}from"./prepared-quartus.js";import{createSimulinkSource}from"./prepared-simulink.js";import{createJianyingSource}from"./prepared-jianying.js";import{createPreparedMacAptSource}from"./prepared-macapt.js";import{zoteroApiReads,zoteroRecentRecords}from"./zotero-read.js";import{preparedStm32CubeMx}from"./prepared-stm32cubemx.js";import{preparedMultisim}from"./prepared-multisim.js";import{preparedSolidWorks}from"./prepared-solidworks.js";import{preparedLattics}from"./prepared-lattics.js";import{preparedJetBrains}from"./prepared-jetbrains.js";import{preparedEclipse}from"./prepared-eclipse.js";import{preparedPlecs}from"./prepared-plecs.js";import{joplinSchemas}from"./joplin-server.js";const fastmailUrl="https://api.fastmail.com/mcp",fastmailIssuer="https://api.fastmail.com";export const fastmail={source:"fastmail",label:"Fastmail",group:"Connector / Prepared Local",readOnly:true,server:{transport:"http",url:fastmailUrl},auth:{kind:"mcp-oauth",loopbackPort:0},origin:{official:true,repo:"https://www.fastmail.help/hc/en-us/articles/15869557281295-Connecting-AI-tools-via-Fastmail-s-MCP-server",check:"Official hosted MCP and public discovery reviewed 2026-10-26: exact /mcp resource, api.fastmail.com issuer, DCR, S256, public-client none and offline_access. Shared enrollment and refresh own OAuth; the user chooses read, write and send access at Fastmail. Existing API-token stdio grants retain their original route. Attachments are not supported by the hosted service; real account Actions remain separately qualified."}};export const preparedLocalSourceIds=["solidworks","lattics","jetbrains","eclipse","multisim","stm32cubemx","plecs","obsidian","joplin","logseq","apple-notes","nextcloud","imessage","wechat","thunderbird","fastmail","proton-mail","local-audio","zotero","macos-contacts","computer-files","visual-studio","modelsim","quartus","simulink","jianying","epic-games-launcher","ryujinx","modrinth","powerpoint","ti-ccs","pscad","adobe-photoshop","autocad","microsoft-word","microsoft-excel","local-git","vscode-local-history","libreoffice","adobe-acrobat","adobe-camera-raw","adobe-media-encoder","ansys-electronics-desktop","adobe-premiere-pro","packet-tracer","qt-designer","hearthstone-deck-tracker","visio","matlab","adobe-illustrator","minecraft-java","ni-tdms","jupyter","windows-event-viewer","windows-task-scheduler","wsl","docker-desktop","ollama","owntracks","copyq","mac-apt"];const preparedLocalReadSchemas={read_note:{additionalProperties:false,type:"object",properties:{id:{type:"string",description:"The note id (32-character hex)."},offset:{type:"integer",description:"Byte offset into the body to start at. Defaults to 0.",minimum:0},max_chars:{type:"integer",description:"Maximum characters of body to return. Omit or set to 0 for the full body.",minimum:0}},required:["id"]},notes_get:{type:"object",properties:{id:{type:"string",description:"Note ID"}},required:["id"]},contacts_get:{type:"object",properties:{id:{type:"string",description:"Contact ID"}},required:["id"]},messages_read:{type:"object",properties:{chatId:{type:"string",description:"Chat ID"},limit:{type:"integer",description:"Maximum number of messages to return"},cursor:{type:"string",description:"Pagination cursor"}},required:["chatId"]},listAccounts:{type:"object",properties:{},required:[]},getMessageHeaders:{type:"object",properties:{messageId:{type:"string",description:"The id from getMessage or searchMessages; surrounding angle brackets are optional"},folderPath:{type:"string",description:"The folder URI path (from searchMessages results)"}},required:["messageId","folderPath"]},getMessage:{type:"object",properties:{messageId:{type:"string",description:"The message ID (from searchMessages results)"},folderPath:{type:"string",description:"The folder URI path (from searchMessages results)"},saveAttachments:{type:"boolean",description:"If true, save attachments to <OS temp dir>/thunderbird-mcp/<messageId>/ and include filePath in response (default: false)"},includeInlineImages:{type:"boolean",description:"If true, append supported inline email images as MCP image content blocks after the text result (default: false; max 1 MiB base64 per image and 4 MiB total). Images referenced by the rendered body are attempted first in document order, followed by remaining inline images in MIME order. Ignored when rawSource is true."},bodyFormat:{type:"string",enum:["markdown","text","html"],description:"Body output format: 'markdown' (default; HTML conversion allows only http/https/mailto links and replaces images with alt text; plain-text bodies only escape image openers, preserving other Markdown/HTML), 'text' (plain text), 'html' (unchanged, untrusted HTML). HTML input over 2 MiB is truncated before markdown/text conversion, with a notice."},rawSource:{type:"boolean",description:"If true, return untrusted raw RFC 2822 message source (all headers + MIME parts). Useful for extracting calendar invites, S/MIME data, or debugging. Other fields (body, attachments) are omitted when this is set. IMAP messages without a complete offline copy are fetched from the server."}},required:["messageId","folderPath"]},get_email:{type:"object",properties:{emailId:{type:"string",description:"The email ID to retrieve"}},required:["emailId"],additionalProperties:false,$schema:"http://json-schema.org/draft-07/schema#"},list_mailboxes:{type:"object",properties:{},$schema:"http://json-schema.org/draft-07/schema#"},getPage:{type:"object",properties:{pageName:{type:"string",description:"The page's name or uuid"}},required:["pageName"],$schema:"http://json-schema.org/draft-07/schema#"},find_details_of_current_user:{properties:{},type:"object"},get_file_content:{properties:{file_path:{type:"string"}},required:["file_path"],type:"object"}};const common=["resourceId","issuer","audience","requiredScopes"];const invalid=field=>{throw Error(`Invalid prepared local connector configuration: ${field}.`)};function record(value){return!!value&&typeof value==="object"&&!Array.isArray(value)&&[Object.prototype,null].includes(Object.getPrototypeOf(value))}function exact(options,keys){if(!record(options))invalid("unknown option");for(const key of Reflect.ownKeys(options)){if(typeof key!=="string"||!keys.includes(key))invalid("unknown option");const descriptor=Object.getOwnPropertyDescriptor(options,key);if(!("value"in descriptor))invalid("accessor option");if(!descriptor.enumerable)invalid("hidden option")}}function text(value,field,max=2048){if(typeof value!=="string"||!value||value!==value.trim()||value.length>max||/[\u0000-\u001f\u007f]/u.test(value))invalid(field);return value}function port(value,defaultValue){if(value===void 0&&defaultValue!==void 0)return defaultValue;if(!Number.isInteger(value)||Number(value)<1024||Number(value)>65535)invalid("port");return value}function path(value,field,directory){const requested=text(value,field,4096);if(!isAbsolute(requested))invalid(field);let resolved;try{resolved=realpathSync(requested);const stat=statSync(resolved);if(directory?!stat.isDirectory():!stat.isFile())invalid(field)}catch{invalid(field)}return resolved}function rootPaths(value){if(!Array.isArray(value)||value.length<1||value.length>16)invalid("roots");const roots=value.map(item=>path(item,"root",true));if(new Set(roots).size!==roots.length)invalid("duplicate root");return roots.sort()}export function preparedLocalRootsAudience(source,roots){if(!["visual-studio","modelsim","quartus","simulink","jianying","epic-games-launcher","ryujinx","modrinth","powerpoint","ti-ccs","pscad","adobe-photoshop","autocad","microsoft-word","microsoft-excel","local-git","vscode-local-history","libreoffice","adobe-acrobat","adobe-camera-raw","adobe-media-encoder","ansys-electronics-desktop","adobe-premiere-pro","packet-tracer","qt-designer","hearthstone-deck-tracker","visio","matlab","adobe-illustrator","minecraft-java","ni-tdms","jupyter","solidworks","lattics","jetbrains","eclipse","multisim","stm32cubemx","plecs","obsidian","logseq","local-audio","computer-files"].includes(source))invalid("file source");if((source==="plecs"||source==="stm32cubemx"||source==="multisim"||source==="solidworks"||source==="lattics"||source==="jetbrains"||source==="eclipse")&&roots.length!==1)invalid("Select one project folder");const canonical=rootPaths([...roots]).map(root=>pathToFileURL(root).href);return`indra-local-roots:${source}:${createHash("sha256").update(JSON.stringify(canonical)).digest("hex")}`}function authority(options,credentialKind,audience){const resourceId=text(options.resourceId,"resourceId",512),issuer=text(options.issuer,"issuer",512),selectedAudience=text(options.audience,"audience",2048);if(audience!==void 0&&selectedAudience!==audience)invalid("audience does not match selected resource");if(!Array.isArray(options.requiredScopes)||options.requiredScopes.length>32||options.requiredScopes.some(scope=>typeof scope!=="string"||!scope||scope.length>1024||/\s/u.test(scope))||new Set(options.requiredScopes).size!==options.requiredScopes.length)invalid("requiredScopes");return{kind:"custodied",resourceId,issuer,audience:selectedAudience,requiredScopes:[...options.requiredScopes],credentialKind}}function review(names){return Object.fromEntries(names.map(name=>[name,{inputSchemaSha256:reviewedToolSchemaHash(preparedLocalReadSchemas[name])}]))}const validateThunderbirdParams=(tool,params)=>{if(tool!=="getMessage")return ok(void 0);const invalidRead=()=>businessError("invalid_argument","Thunderbird full reads require a selected messageId and folderPath, rawSource=true, and disabled attachment saving and inline images.","plugin");if(!record(params))return invalidRead();for(const key of Reflect.ownKeys(params)){if(typeof key!=="string"||!["messageId","folderPath","rawSource","saveAttachments","includeInlineImages"].includes(key))return invalidRead();const descriptor=Object.getOwnPropertyDescriptor(params,key);if(!("value"in descriptor)||!descriptor.enumerable)return invalidRead()}const validReference=(value,max)=>typeof value==="string"&&value.length>0&&value.length<=max&&value===value.trim()&&!/[\u0000-\u001f\u007f]/u.test(value);if(!validReference(params.messageId,1024)||!validReference(params.folderPath,4096)||params.rawSource!==true||params.saveAttachments!==void 0&&params.saveAttachments!==false||params.includeInlineImages!==void 0&&params.includeInlineImages!==false)return invalidRead();return ok(void 0)};const validateThunderbirdResult=(tool,result,params)=>{if(tool!=="getMessage")return ok(void 0);const malformed=()=>businessError("data_loss","Thunderbird did not return the complete selected message MIME source.","plugin");if(result.structured!==void 0||params?.rawSource!==true)return malformed();let value;try{value=JSON.parse(result.text)}catch{return malformed()}if(!record(value))return malformed();if("error"in value)return businessError("unavailable","Thunderbird could not complete the protected message read.","plugin");if(value.encryptedContentWithheld===true)return businessError("permission_denied","Thunderbird withheld the selected message under its content access policy.","plugin");if(Object.keys(value).some(key=>!["id","subject","rawSource"].includes(key))||typeof value.id!=="string"||value.id!==params.messageId||typeof value.subject!=="string"||typeof value.rawSource!=="string"||!/(?:\r\n\r\n|\n\n|\r\r)/u.test(value.rawSource))return malformed();return ok(void 0)};const validateThunderbirdOutcome=(_tool,result)=>{let value=result.structured;try{if(value===void 0)value=JSON.parse(result.text)}catch{return ok(void 0)}if(record(value)&&"error"in value)return businessError("unavailable","Thunderbird could not complete the requested operation.","plugin");if(record(value)&&value.encryptedContentWithheld===true)return businessError("permission_denied","Thunderbird withheld the selected message under its content access policy.","plugin");return ok(void 0)};function numericId(value,field){const result=text(value,field,32);if(!/^[1-9][0-9]{0,19}$/.test(result))invalid(field);return result}function base(source,label){return{source,label,group:"Connector / Local and native"}}const nextcloudReady={tool:"find_details_of_current_user",done(structured,text2){let value=structured;try{if(value===void 0)value=JSON.parse(text2)}catch{return false}return record(value)&&typeof value.id==="string"&&value.id.length>0&&!("error"in value)}};const thunderbirdReady={tool:"listAccounts",done(structured,text2){if(structured!==void 0)return false;let value;try{value=JSON.parse(text2)}catch{return false}return Array.isArray(value)&&value.every(account=>record(account)&&typeof account.id==="string"&&!!account.id&&typeof account.name==="string"&&typeof account.type==="string"&&Array.isArray(account.identities)&&account.identities.every(identity=>record(identity)&&typeof identity.id==="string"&&!!identity.id&&typeof identity.email==="string"&&typeof identity.name==="string"&&typeof identity.isDefault==="boolean"))}};const protonReady={tool:"get_status",args:{folder:"INBOX"},done(structured){if(!record(structured)||"error"in structured||!Array.isArray(structured.result)||structured.result.length!==1)return false;const status=structured.result[0];return record(status)&&Object.keys(status).length===3&&status.name==="INBOX"&&Number.isSafeInteger(status.total)&&Number(status.total)>=0&&Number.isSafeInteger(status.unread)&&Number(status.unread)>=0}};const filesystemPackage="@modelcontextprotocol/server-filesystem@2.0.1";const filesystemCommit="ef9808f71090d0db3eda99e2af2ba78f1086f4fb";const appleCommit="951c11af2b621fc34debd2d57432b9ea856c7198";export const preparedProtonReadPolicy='[policy]\nmode = "read"\n\n[index]\nenabled = false\n\n[notifications]\nenabled = false\n';export function preparedLocalNativeSelection(source,input){if(windowsMetadataSource(source)){exact(input,[]);return windowsMetadataGrant(source)}if(source==="docker-desktop"){exact(input,[]);return{options:{},audience:"npipe:////./pipe/dockerDesktopLinuxEngine",scope:"images.read"}}if(source==="ollama"){exact(input,["port"]);const selectedPort=port(input.port,11434);return{options:{port:selectedPort},audience:"http://127.0.0.1:"+selectedPort,scope:"models.read"}}if(source==="owntracks"||source==="wechat"){exact(input,["port"]);const selectedPort=port(input.port,source==="owntracks"?8765:5030);return{options:{port:selectedPort},audience:`http://127.0.0.1:${selectedPort}/mcp`,scope:source==="owntracks"?"location.read":"messages.read"}}if(source==="copyq"){exact(input,["executable","session"]);const executable=path(input.executable,"executable",false),session=input.session===""?"":text(input.session,"session",16);if(!/^[\p{L}\p{N}_-]{0,16}$/u.test(session))invalid("session");return{options:{executable,session},audience:`copyq:${pathToFileURL(executable).href}?session=${encodeURIComponent(session)}`,scope:"clipboard.read"}}if(source==="zotero"){exact(input,["libraryId","libraryType","serverId"]);const libraryType=input.libraryType??"user";if(libraryType!=="user"&&libraryType!=="group")invalid("libraryType");const libraryId=libraryType==="user"&&input.libraryId==="0"?"0":numericId(input.libraryId,"libraryId");const serverId=text(input.serverId,"serverId",128);if(!/^[A-Za-z0-9_-]{1,128}$/.test(serverId))invalid("serverId");return{options:{libraryId,libraryType,serverId},audience:`http://127.0.0.1:23119/api/${libraryType==="user"?"users":"groups"}/${libraryId}?serverId=${serverId}`,scope:"library.read"}}if(["apple-notes","imessage","macos-contacts"].includes(source)){exact(input,["executable"]);const executable=path(input.executable,"executable",false);return{options:{executable},audience:`indra-apple-runtime:${source}:${pathToFileURL(executable).href}`,scope:source==="imessage"?"messages.read":source==="macos-contacts"?"contacts.read":"notes.read"}}return invalid("native source")}export function createPreparedLocalSource(source,options,policy={}){if(!preparedLocalSourceIds.includes(source)||!record(options))invalid("source or options");if(source==="stm32cubemx"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("STM32CubeMX project permission");return preparedStm32CubeMx(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="multisim"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Multisim project permission");return preparedMultisim(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="solidworks"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("SolidWorks project permission");return preparedSolidWorks(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="lattics"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Lattics library permission");return preparedLattics(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="jetbrains"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("JetBrains project permission");return preparedJetBrains(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="eclipse"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Eclipse project permission");return preparedEclipse(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="plecs"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("PLECS project permission");return preparedPlecs(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}const fieldsMode=["nextcloud","thunderbird","proton-mail"].includes(source)&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="fields";if(source==="joplin"&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="paired-plugin"){exact(options,["mode","port","fingerprint"]);const selectedPort=port(options.port);if(typeof options.fingerprint!=="string"||!/^[a-f0-9]{64}$/.test(options.fingerprint))invalid("Joplin pairing fingerprint");const account=`joplin-plugin:${options.fingerprint}:127.0.0.1:${selectedPort}`;return{...base(source,"Joplin"),server:{transport:"stdio",command:process.execPath,args:[fileURLToPath(new URL("./joplin-server.js",import.meta.url))],env:fields=>{if(typeof fields.bridgeKey!=="string"||!/^[a-f0-9]{64}$/.test(fields.bridgeKey))invalid("Joplin paired bridge key");return{JOPLIN_PORT:String(selectedPort),JOPLIN_BRIDGE_KEY:fields.bridgeKey}}},auth:{kind:"fields",fields:[{key:"bridgeKey",label:"Joplin paired bridge key",secret:true}],account:()=>account,accountBinding:"endpoint",login:{ready:{tool:"check_auth",done(structured){return record(structured)&&structured.authenticated===true}}}},readOnly:true,allowedTools:Object.keys(joplinSchemas),reviewedReadTools:Object.fromEntries(Object.entries(joplinSchemas).map(([name,schema])=>[name,{inputSchemaSha256:reviewedToolSchemaHash(schema)}])),origin:{official:false,repo:"laurent22/joplin",artifact:"@zortexhq/plugin-connector-level1@0.1.0",check:"Official Joplin plugin data API through a mutually confirmed encrypted loopback bridge. Read-only Actions, bounded replies, no Web Clipper token or credential URL. Pairing must be renewed after Joplin restart."}}}if(source==="simulink"||source==="quartus"||source==="modelsim"||source==="visual-studio"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Select one project folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("This source requires the native read grant");if(source==="visual-studio")return createVisualStudioSource(roots[0],auth);if(source==="modelsim")return createModelSimSource(roots[0],auth);return source==="quartus"?createQuartusSource(roots[0],auth):createSimulinkSource(roots[0],auth)}if(source==="jianying"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Jianying needs one draft folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Jianying needs the native read grant");return createJianyingSource(roots[0],auth)}if(source==="epic-games-launcher"||source==="ryujinx"||source==="modrinth"||source==="powerpoint"||source==="ti-ccs"||source==="pscad"||source==="adobe-photoshop"||source==="autocad"||source==="microsoft-word"||source==="microsoft-excel"||source==="local-git"||source==="vscode-local-history"||source==="libreoffice"||source==="adobe-acrobat"||source==="adobe-camera-raw"||source==="adobe-media-encoder"||source==="ansys-electronics-desktop"||source==="adobe-premiere-pro"||source==="packet-tracer"||source==="qt-designer"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Choose exactly one source folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Source needs the native read grant");if(source==="powerpoint")return preparedPowerPoint(roots[0],auth);if(source==="ti-ccs")return preparedCcs(roots[0],auth);if(source==="pscad")return preparedPscad(roots[0],auth);if(source==="adobe-photoshop")return preparedPhotoshop(roots[0],auth);if(source==="microsoft-word"||source==="microsoft-excel")return preparedOfficeLocal(source,roots[0],auth);if(source==="local-git"||source==="vscode-local-history")return preparedDeveloperHistory(source,roots[0],auth);if(source==="libreoffice")return preparedDeveloperHistory(source,roots[0],auth);if(source==="adobe-acrobat"||source==="adobe-camera-raw"||source==="adobe-media-encoder")return preparedAdobeNative(source,roots[0],auth);if(source==="ansys-electronics-desktop")return preparedAedt(roots[0],auth);if(source==="adobe-premiere-pro")return preparedPremierePro(roots[0],auth);if(source==="packet-tracer")return preparedPacketTracer(roots[0],auth);if(source==="epic-games-launcher"||source==="ryujinx")return preparedGameMetadata(source,roots[0],auth);if(source==="modrinth")return preparedModrinth(roots[0],auth);return source==="autocad"?preparedAutocad(roots[0],auth):preparedQtDesigner(roots[0],auth)}if(source==="minecraft-java"||source==="adobe-illustrator"||source==="hearthstone-deck-tracker"||source==="visio"||source==="matlab"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Select exactly one source folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("The source requires the native read grant");if(source==="hearthstone-deck-tracker")return preparedHearthstone(roots[0],auth);if(source==="visio")return preparedVisio(roots[0],auth);if(source==="matlab")return preparedMatlab(roots[0],auth);return source==="adobe-illustrator"?preparedIllustrator(roots[0],auth):preparedMinecraft(roots[0],auth)}if(source==="ni-tdms"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("TDMS needs exactly one measurement folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("TDMS needs the native read grant");return preparedTdms(roots[0],auth)}if(source==="jupyter"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Jupyter needs exactly one notebook folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Jupyter needs the native read grant");return preparedJupyter(roots[0],auth)}if(windowsMetadataSource(source)){exact(options,common);const grant=windowsMetadataGrant(source),auth=authority(options,"local-no-secret",grant.audience);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!==grant.scope)invalid("Windows source requires its local metadata grant");return preparedWindowsMetadata(source,auth)}if(source==="joplin"&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="fields")throw Error("Legacy Joplin Web Clipper authorization is disabled. Use Help encrypted plugin pairing.");if(source==="mac-apt")return createPreparedMacAptSource(source,options);if(source==="docker-desktop"){exact(options,common);const selection=preparedLocalNativeSelection(source,{});const auth=authority(options,"local-no-secret",selection.audience);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!==selection.scope)invalid("Docker Desktop requires the image metadata grant");return preparedDockerDesktop(auth)}if(source==="ollama"){exact(options,[...common,"port"]);const endpoint=preparedLocalNativeSelection(source,{port:options.port}).audience;const auth=authority(options,"local-no-secret",endpoint);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="models.read")invalid("Ollama requires the model metadata grant");return preparedOllama(endpoint,auth)}if(source==="owntracks"){exact(options,[...common,"port"]);const url=preparedLocalNativeSelection(source,{port:options.port}).audience;return{...base(source,"OwnTracks"),server:{transport:"http",url},auth:authority(options,"local-no-secret",url),readOnly:true,allowedTools:["owntracks_status","list_devices","get_last_location","get_location_history","get_distance","reverse_geocode"],origin:{official:false,repo:"de-niji/OwnTracksHermes",artifact:"owntracks-mcp@0.2.0",check:"MIT; source 9f005a790c388d3cd4aeb1306b3a202be917a1ff, archive SHA256 367406a8561c57657872661cc7a8d814ace162a0a21cd9214799394eb1fca63f. Existing local server must already own its selected Recorder configuration. Native Recorder queries only; Hermes reminders/history and cron are outside this route."}}}if(source==="copyq"){exact(options,[...common,"executable","session"]);authority(options,"local-no-secret");const selection=preparedLocalNativeSelection(source,{executable:options.executable,session:options.session}),{executable,session}=selection.options;const wheel="https://github.com/AutoraLabs/copyq-mcp/releases/download/v0.1.0/copyq_mcp-0.1.0-py3-none-any.whl#sha256=46e3f12eead7e9d7bd2589f6a563dba17c67a6ac6f5c4804522243a07def5746";return{...base(source,"CopyQ clipboard history"),server:{transport:"stdio",command:"uvx",args:["--from",wheel,"copyq-mcp"],env:()=>({COPYQ_MCP_EXECUTABLE:executable,COPYQ_MCP_SESSION:session})},auth:authority(options,"local-no-secret",selection.audience),readOnly:true,allowedTools:["clipboard_read","clipboard_search","clipboard_tabs"],origin:{official:false,repo:"AutoraLabs/copyq-mcp",artifact:"copyq-mcp@0.1.0",check:"MIT, active with CI/tests; exact release wheel digest verified 2026-10-26. Selected native CopyQ session only; all three text-history Actions preserved. No setup command, clipboard rewrite, dictation hook, or second clipboard store."}}}const mode=source==="logseq"?Object.getOwnPropertyDescriptor(options,"mode")?.value??"native-mcp":void 0;if(["obsidian","local-audio","computer-files"].includes(source)||source==="logseq"&&mode==="files"){exact(options,[...common,"roots",...source==="logseq"?["mode"]:[]]);authority(options,"local-no-secret");const roots=rootPaths(options.roots),audience=preparedLocalRootsAudience(source,roots);const label={obsidian:"Obsidian",logseq:"Logseq (file graph)","local-audio":"Local audio (file)","computer-files":"Local files"}[source];return{...base(source,label),server:{transport:"stdio",command:"npx",args:["-y",filesystemPackage,...roots]},auth:authority(options,"local-no-secret",audience),readOnly:true,preserveContent:true,...source==="computer-files"?{adaptSchema:pageSchema,adaptInvoke:(name,params,_grant,{signal})=>name==="read_text_file"?readFilePage(roots,params,signal):Promise.resolve(void 0)}:{},allowedTools:source==="local-audio"?["read_media_file","get_file_info"]:source==="computer-files"?["list_allowed_directories","search_files","list_directory","read_text_file","read_media_file","get_file_info"]:["read_text_file","read_media_file","get_file_info","list_directory"],origin:{official:true,repo:"modelcontextprotocol/servers",package:filesystemPackage,check:`Filesystem source reviewed at ${filesystemCommit}; exact granted roots, readonly tools, no recursive ingestion. Node >=24; license transition Apache-2.0/MIT, see pinned LICENSE.`}}}if(source==="joplin"||source==="logseq"||source==="wechat"||source==="thunderbird"){exact(options,fieldsMode?["mode","port"]:[...common,"port",...source==="logseq"?["mode"]:[]]);if(source==="logseq"&&mode!=="native-mcp")invalid("Logseq mode");const selectedPort=port(options.port,source==="logseq"?12315:source==="wechat"?5030:void 0);const url=source==="wechat"?preparedLocalNativeSelection(source,{port:selectedPort}).audience:`http://127.0.0.1:${selectedPort}${source==="thunderbird"?"/":"/mcp"}`;if(source==="joplin")throw Error("Joplin connection is temporarily disabled: upstream logs credential-bearing request URLs. Existing settings have been preserved.");if(source==="logseq")return{...base(source,"Logseq (database graph)"),server:{transport:"http",url},auth:authority(options,"mcp-token",url),readOnly:true,allowedTools:["getPage"],reviewedReadTools:review(["getPage"]),origin:{official:true,repo:"logseq/logseq",artifact:"native Logseq MCP 0.1.0",check:"getPage API/server reviewed at f8fb34b79bd5d183d22eb8f05d50173227ee2d81; native DB graph only; separately selected file graphs use filesystem route."}};if(source==="thunderbird")return{...base(source,"Thunderbird"),server:{transport:"http",url},auth:fieldsMode?{kind:"fields",fields:[{key:"apiKey",label:"Thunderbird MCP token",secret:true}],tokenField:"apiKey",account:()=>url,login:{ready:thunderbirdReady}}:authority(options,"mcp-token",url),readOnly:true,allowedTools:["listAccounts","getMessageHeaders","getMessage"],reviewedReadTools:review(["listAccounts","getMessageHeaders","getMessage"]),...policy.fullActions?{validateResult:validateThunderbirdOutcome}:{validateParams:validateThunderbirdParams,validateResult:validateThunderbirdResult},origin:{official:false,repo:"TKasperczyk/thunderbird-mcp",artifact:"thunderbird-mcp@0.10.0",check:"Extension/native MCP at 8910dbf4300a7ea7ebf1edd0bdd0d22996531b88; XPI SHA256 638b7512d4f8b30d71b1547e10372ac537f046cc05d196a867e3871684c19f8c. Exact approved profile port/token; no profile discovery or installation. getMessage admits rawSource=true only, with attachment saving and inline images disabled; complete MIME bytes remain transient. Exact stored Message-ID and folder URI; shared 1 MiB reply and 120 second bounds. Native account/content access checks remain authoritative."}};return{...base(source,"WeChat (local chatlog)"),server:{transport:"http",url},auth:authority(options,"local-no-secret",url),allowedTools:["query_contact","query_chat_room","query_recent_chat","query_chat_log"],origin:{official:false,repo:"sjzar/chatlog",artifact:"chatlog@0.0.26",check:"Retained Indra vendor pin 74e568085b8ae5aa3ec72dcd37aac6da969fa121, archive SHA256 e8affa2def64a68bc65f8eaeccd643080d18eeab29750ce9205f574adfa69cbb; /mcp Streamable HTTP. Public upstream removed. Explicit false readonly hints preserved; readonly acceptance remains blocked."}}}if(["apple-notes","imessage","macos-contacts"].includes(source)){exact(options,[...common,"executable"]);authority(options,"local-no-secret");const selection=preparedLocalNativeSelection(source,{executable:options.executable}),executable=selection.options.executable,tool={"apple-notes":"notes_get",imessage:"messages_read","macos-contacts":"contacts_get"}[source];const audience=typeof options.audience==="string"&&options.audience.startsWith("indra-apple-runtime:")?selection.audience:void 0;return{...base(source,{"apple-notes":"Apple Notes",imessage:"iMessage","macos-contacts":"macOS Contacts"}[source]),server:{transport:"stdio",command:executable,args:[],env:()=>({APPLE_BRIDGE_SKIP_PERMISSIONS:"1"})},auth:authority(options,"local-no-secret",audience),readOnly:true,allowedTools:[tool],reviewedReadTools:review([tool]),origin:{official:false,repo:"boutquin/apple-bridge",artifact:"apple-bridge@3.2.0",check:`Native readonly tools reviewed at ${appleCommit}; release macOS arm64 archive SHA256 83c64569fa8238e694ed4e30b6c32e81c7f9285b4130aaaf4e303a430dda5875. Startup permission requests disabled; existing OS permission still required. No Windows adapter.`},unavailable:()=>process.platform==="darwin"?void 0:"This reviewed Apple native adapter requires macOS; Windows qualification remains open."}}if(source==="nextcloud"){exact(options,fieldsMode?["mode","instanceUrl"]:[...common,"instanceUrl"]);const input=text(options.instanceUrl,"instanceUrl");let instance;try{instance=new URL(input);if(instance.protocol!=="https:"||instance.username||instance.password||instance.search||instance.hash)invalid("instanceUrl")}catch{invalid("instanceUrl")}const url=`${instance.href.replace(/\/$/,"")}/index.php/apps/app_api/proxy/context_agent/mcp/`;return{...base(source,"Nextcloud"),server:{transport:"http",url},auth:fieldsMode?{kind:"fields",fields:[{key:"apiKey",label:"Nextcloud app password",secret:true}],tokenField:"apiKey",account:()=>url,login:{ready:nextcloudReady}}:authority(options,"rest-token",url),readOnly:true,allowedTools:["find_details_of_current_user","get_file_content"],reviewedReadTools:review(["find_details_of_current_user","get_file_content"]),origin:{official:true,repo:"nextcloud/context_agent",artifact:"Context Agent native MCP",check:"Hosted bearer app-password contract, current-user metadata and private-file text read reviewed at 321e0943dfee7eef1a8ade118dc2aea3da0ba356. Instance AppAPI/Context Agent versions and stateless transport compatibility require installed qualification."}}}if(source==="fastmail"){exact(options,common);if(options.audience===fastmailUrl){if(options.issuer!==fastmailIssuer)invalid("hosted Fastmail issuer");return{...fastmail,auth:authority(options,"mcp-token",fastmailUrl)}}return{...base(source,"Fastmail"),server:{transport:"stdio",command:"npx",args:["-y","@jordonh19/fastmail-mcp-server@1.3.0","--transport","stdio"],tokenEnv:"FASTMAIL_API_TOKEN"},auth:authority(options,"rest-token","https://api.fastmail.com"),readOnly:true,allowedTools:["get_email","list_mailboxes"],reviewedReadTools:review(["get_email","list_mailboxes"]),origin:{official:false,repo:"Jordonh18/fastmail-mcp-server",package:"@jordonh19/fastmail-mcp-server@1.3.0",check:"MIT; source pin 68bb946fecd82b892190f0641a6b09bd4229d84c. Published package tools/list exercised with SDK1.27.1/Zod3.25.76 and zero network calls. Grant acquisition/OAuth refresh is separate; never infer account from a token label."}}}if(source==="proton-mail"){exact(options,fieldsMode?["mode","imapPort","policyFile"]:[...common,"username","imapPort","policyFile"]);if(!fieldsMode)authority(options,"rest-token");const username=fieldsMode?void 0:text(options.username,"Bridge username",320),imapPort=port(options.imapPort,fieldsMode?void 0:1143);const policyFile=path(fieldsMode&&options.policyFile===void 0?fileURLToPath(new URL("../server/proton/read.toml",import.meta.url)):options.policyFile,"policyFile",false);const policyValid=()=>{try{return readFileSync(policyFile,"utf8")===preparedProtonReadPolicy}catch{return false}};if(!policyValid())invalid("Proton readonly policy");const selectedFields=fields=>{exact(fields,["username","password"]);return{username:text(fields.username,"Bridge username",320),password:text(fields.password,"Bridge mailbox password",4096)}};const audience=selectedUsername=>`imap://127.0.0.1:${imapPort}/${encodeURIComponent(selectedUsername)}`;const environment=selectedUsername=>{if(!policyValid())invalid("Proton readonly policy");return{PROTONMAIL_BRIDGE_USERNAME:selectedUsername,PROTONMAIL_BRIDGE_HOST:"127.0.0.1",PROTONMAIL_BRIDGE_IMAP_PORT:String(imapPort),PROTONMAIL_BRIDGE_IMAP_SECURITY:"starttls",PROTONMAIL_BRIDGE_TIMEOUT:"30",PROTONMAIL_MCP_MODE:"read",PROTONMAIL_MCP_POLICY:policyFile,PROTONMAIL_MCP_AUDIT_LOG:""}};return{...base(source,"Proton Mail Bridge"),server:{transport:"stdio",command:"uvx",args:["--from","protonmail-mcp==0.4.0","protonmail-mcp"],...fieldsMode?{env:fields=>{const selected=selectedFields(fields);return{...environment(selected.username),PROTONMAIL_BRIDGE_PASSWORD:selected.password}}}:{tokenEnv:"PROTONMAIL_BRIDGE_PASSWORD",env:()=>environment(username)}},auth:fieldsMode?{kind:"fields",fields:[{key:"username",label:"Proton Bridge username"},{key:"password",label:"Proton Bridge mailbox password",secret:true}],accountBinding:"endpoint",account:fields=>audience(selectedFields(fields).username),login:{ready:protonReady}}:authority(options,"rest-token",audience(username)),readOnly:true,allowedTools:["list_folders","list_emails","read_email"],origin:{official:false,repo:"mhbxyz/protonmail-mcp",package:"protonmail-mcp==0.4.0",check:"Source pin f15d769d562de55c288a574f2a1e0946fefc9e31; fixed loopback Proton Bridge STARTTLS, immutable read preset, index/notifications/audit off. Fields mode verifies get_status for INBOX before saving the existing credential envelope and binds it to the selected port and username. Password is the Bridge mailbox credential. Python >=3.13 and an installed, signed-in Bridge remain required. Full Actions preserves upstream local-export write effects; this policy does not enable SMTP or mailbox mutations."},unavailable:()=>policyValid()?void 0:"The selected Proton readonly policy changed; requalify the connection."}}if(source==="zotero"){exact(options,[...common,"libraryId","libraryType","serverId"]);const selection=preparedLocalNativeSelection(source,{libraryId:options.libraryId,libraryType:options.libraryType,serverId:options.serverId}),{libraryId,libraryType,serverId}=selection.options,audience=selection.audience;return{...base(source,"Zotero (local library)"),server:{transport:"stdio",command:"uvx",args:["--with","fastmcp==3.4.11","--with","pydantic==2.13.4","--from","zotero-mcp-server==0.15.1","python",fileURLToPath(new URL("../server/zotero/read.py",import.meta.url))],env:()=>({ZOTERO_LOCAL:"true",ZOTERO_LIBRARY_ID:libraryId,ZOTERO_LIBRARY_TYPE:libraryType,ZOTERO_SERVER_ID:serverId,ZOTERO_LOCAL_WRITE:"false",ZOTERO_MCP_TOOLSETS:"none",ZOTERO_BACKEND:"api",ZOTERO_SEARCH_BACKEND:"api",ZOTERO_NO_CLAUDE:"1",ZOTERO_MCP_SCHEMA_REFRESH:"0",PYTHON_DOTENV_DISABLED:"1"})},auth:authority(options,"local-no-secret",audience),readOnly:true,...zoteroApiReads,liveRead:{tool:"zotero_get_recent",args:{limit:1},records:zoteroRecentRecords},origin:{official:false,repo:"54yyyu/zotero-mcp",package:"zotero-mcp-server==0.15.1",check:"Source pin f1f6cdc1ea26e04c59525f5b3ee7dd2b9d839bc3; selected library and local server identity bound, API backend forced, write/index/library-switch tools excluded. Public FastMCP3.4.11 import_server reuses unchanged tools without the upstream CLI environment discovery, reranker or startup indexing lifespan. Dotenv discovery is disabled; HOME is unchanged. Python server MIT; bundled plugin AGPL-3.0-or-later. Actual native library and OS acceptance remain separate."}}}return invalid("source")}
1
+ import{preparedAdobeNative}from"./prepared-adobe-native.js";import{preparedGameMetadata}from"./prepared-game-metadata.js";import{preparedDeveloperHistory}from"./prepared-developer-history.js";import{preparedOfficeLocal}from"./prepared-office-local.js";import{preparedAedt}from"./prepared-aedt.js";import{preparedPremierePro}from"./prepared-premiere-pro.js";import{preparedPacketTracer}from"./prepared-packet-tracer.js";import{preparedModrinth}from"./prepared-modrinth.js";import{preparedHearthstone}from"./prepared-hearthstone.js";import{preparedVisio}from"./prepared-visio.js";import{preparedMatlab}from"./prepared-matlab.js";import{preparedIllustrator}from"./prepared-illustrator.js";import{preparedMinecraft}from"./prepared-minecraft.js";import{preparedPowerPoint}from"./prepared-powerpoint.js";import{preparedCcs}from"./prepared-ccs.js";import{preparedPscad}from"./prepared-pscad.js";import{preparedPhotoshop}from"./prepared-photoshop.js";import{preparedAutocad}from"./prepared-autocad.js";import{preparedWindowsMetadata,windowsMetadataSource,windowsMetadataGrant}from"./prepared-windows-metadata.js";import{preparedDockerDesktop}from"./prepared-docker-desktop.js";import{preparedOllama}from"./prepared-ollama.js";import{preparedQtDesigner}from"./prepared-qt-designer.js";import{preparedTdms}from"./prepared-tdms.js";import{preparedJupyter}from"./prepared-jupyter.js";import{createHash}from"node:crypto";import{pageSchema,createComputerFilesAdapter}from"./computer-files-pages.js";import{realpathSync,statSync,readFileSync}from"node:fs";import{isAbsolute}from"node:path";import{fileURLToPath,pathToFileURL}from"node:url";import{businessError,ok}from"@zortexhq/plugin-connector-framework/api";import{reviewedToolSchemaHash}from"./custodied.js";import{createVisualStudioSource}from"./prepared-visual-studio.js";import{createModelSimSource}from"./prepared-modelsim.js";import{createQuartusSource}from"./prepared-quartus.js";import{createSimulinkSource}from"./prepared-simulink.js";import{createJianyingSource}from"./prepared-jianying.js";import{createPreparedMacAptSource}from"./prepared-macapt.js";import{zoteroApiReads,zoteroRecentRecords}from"./zotero-read.js";import{preparedStm32CubeMx}from"./prepared-stm32cubemx.js";import{preparedMultisim}from"./prepared-multisim.js";import{preparedSolidWorks}from"./prepared-solidworks.js";import{preparedLattics}from"./prepared-lattics.js";import{preparedJetBrains}from"./prepared-jetbrains.js";import{preparedEclipse}from"./prepared-eclipse.js";import{preparedPlecs}from"./prepared-plecs.js";import{joplinSchemas}from"./joplin-server.js";const fastmailUrl="https://api.fastmail.com/mcp",fastmailIssuer="https://api.fastmail.com";export const fastmail={source:"fastmail",label:"Fastmail",group:"Connector / Prepared Local",readOnly:true,server:{transport:"http",url:fastmailUrl},auth:{kind:"mcp-oauth",loopbackPort:0},origin:{official:true,repo:"https://www.fastmail.help/hc/en-us/articles/15869557281295-Connecting-AI-tools-via-Fastmail-s-MCP-server",check:"Official hosted MCP and public discovery reviewed 2026-10-26: exact /mcp resource, api.fastmail.com issuer, DCR, S256, public-client none and offline_access. Shared enrollment and refresh own OAuth; the user chooses read, write and send access at Fastmail. Existing API-token stdio grants retain their original route. Attachments are not supported by the hosted service; real account Actions remain separately qualified."}};export const preparedLocalSourceIds=["solidworks","lattics","jetbrains","eclipse","multisim","stm32cubemx","plecs","obsidian","joplin","logseq","apple-notes","nextcloud","imessage","wechat","thunderbird","fastmail","proton-mail","local-audio","zotero","macos-contacts","computer-files","visual-studio","modelsim","quartus","simulink","jianying","epic-games-launcher","ryujinx","modrinth","powerpoint","ti-ccs","pscad","adobe-photoshop","autocad","microsoft-word","microsoft-excel","local-git","vscode-local-history","libreoffice","adobe-acrobat","adobe-camera-raw","adobe-media-encoder","ansys-electronics-desktop","adobe-premiere-pro","packet-tracer","qt-designer","hearthstone-deck-tracker","visio","matlab","adobe-illustrator","minecraft-java","ni-tdms","jupyter","windows-event-viewer","windows-task-scheduler","wsl","docker-desktop","ollama","owntracks","copyq","mac-apt"];const preparedLocalReadSchemas={read_note:{additionalProperties:false,type:"object",properties:{id:{type:"string",description:"The note id (32-character hex)."},offset:{type:"integer",description:"Byte offset into the body to start at. Defaults to 0.",minimum:0},max_chars:{type:"integer",description:"Maximum characters of body to return. Omit or set to 0 for the full body.",minimum:0}},required:["id"]},notes_get:{type:"object",properties:{id:{type:"string",description:"Note ID"}},required:["id"]},contacts_get:{type:"object",properties:{id:{type:"string",description:"Contact ID"}},required:["id"]},messages_read:{type:"object",properties:{chatId:{type:"string",description:"Chat ID"},limit:{type:"integer",description:"Maximum number of messages to return"},cursor:{type:"string",description:"Pagination cursor"}},required:["chatId"]},listAccounts:{type:"object",properties:{},required:[]},getMessageHeaders:{type:"object",properties:{messageId:{type:"string",description:"The id from getMessage or searchMessages; surrounding angle brackets are optional"},folderPath:{type:"string",description:"The folder URI path (from searchMessages results)"}},required:["messageId","folderPath"]},getMessage:{type:"object",properties:{messageId:{type:"string",description:"The message ID (from searchMessages results)"},folderPath:{type:"string",description:"The folder URI path (from searchMessages results)"},saveAttachments:{type:"boolean",description:"If true, save attachments to <OS temp dir>/thunderbird-mcp/<messageId>/ and include filePath in response (default: false)"},includeInlineImages:{type:"boolean",description:"If true, append supported inline email images as MCP image content blocks after the text result (default: false; max 1 MiB base64 per image and 4 MiB total). Images referenced by the rendered body are attempted first in document order, followed by remaining inline images in MIME order. Ignored when rawSource is true."},bodyFormat:{type:"string",enum:["markdown","text","html"],description:"Body output format: 'markdown' (default; HTML conversion allows only http/https/mailto links and replaces images with alt text; plain-text bodies only escape image openers, preserving other Markdown/HTML), 'text' (plain text), 'html' (unchanged, untrusted HTML). HTML input over 2 MiB is truncated before markdown/text conversion, with a notice."},rawSource:{type:"boolean",description:"If true, return untrusted raw RFC 2822 message source (all headers + MIME parts). Useful for extracting calendar invites, S/MIME data, or debugging. Other fields (body, attachments) are omitted when this is set. IMAP messages without a complete offline copy are fetched from the server."}},required:["messageId","folderPath"]},get_email:{type:"object",properties:{emailId:{type:"string",description:"The email ID to retrieve"}},required:["emailId"],additionalProperties:false,$schema:"http://json-schema.org/draft-07/schema#"},list_mailboxes:{type:"object",properties:{},$schema:"http://json-schema.org/draft-07/schema#"},getPage:{type:"object",properties:{pageName:{type:"string",description:"The page's name or uuid"}},required:["pageName"],$schema:"http://json-schema.org/draft-07/schema#"},find_details_of_current_user:{properties:{},type:"object"},get_file_content:{properties:{file_path:{type:"string"}},required:["file_path"],type:"object"}};const common=["resourceId","issuer","audience","requiredScopes"];const invalid=field=>{throw Error(`Invalid prepared local connector configuration: ${field}.`)};function record(value){return!!value&&typeof value==="object"&&!Array.isArray(value)&&[Object.prototype,null].includes(Object.getPrototypeOf(value))}function exact(options,keys){if(!record(options))invalid("unknown option");for(const key of Reflect.ownKeys(options)){if(typeof key!=="string"||!keys.includes(key))invalid("unknown option");const descriptor=Object.getOwnPropertyDescriptor(options,key);if(!("value"in descriptor))invalid("accessor option");if(!descriptor.enumerable)invalid("hidden option")}}function text(value,field,max=2048){if(typeof value!=="string"||!value||value!==value.trim()||value.length>max||/[\u0000-\u001f\u007f]/u.test(value))invalid(field);return value}function port(value,defaultValue){if(value===void 0&&defaultValue!==void 0)return defaultValue;if(!Number.isInteger(value)||Number(value)<1024||Number(value)>65535)invalid("port");return value}function path(value,field,directory){const requested=text(value,field,4096);if(!isAbsolute(requested))invalid(field);let resolved;try{resolved=realpathSync(requested);const stat=statSync(resolved);if(directory?!stat.isDirectory():!stat.isFile())invalid(field)}catch{invalid(field)}return resolved}function rootPaths(value){if(!Array.isArray(value)||value.length<1||value.length>16)invalid("roots");const roots=value.map(item=>path(item,"root",true));if(new Set(roots).size!==roots.length)invalid("duplicate root");return roots.sort()}export function preparedLocalRootsAudience(source,roots){if(!["visual-studio","modelsim","quartus","simulink","jianying","epic-games-launcher","ryujinx","modrinth","powerpoint","ti-ccs","pscad","adobe-photoshop","autocad","microsoft-word","microsoft-excel","local-git","vscode-local-history","libreoffice","adobe-acrobat","adobe-camera-raw","adobe-media-encoder","ansys-electronics-desktop","adobe-premiere-pro","packet-tracer","qt-designer","hearthstone-deck-tracker","visio","matlab","adobe-illustrator","minecraft-java","ni-tdms","jupyter","solidworks","lattics","jetbrains","eclipse","multisim","stm32cubemx","plecs","obsidian","logseq","local-audio","computer-files"].includes(source))invalid("file source");if((source==="plecs"||source==="stm32cubemx"||source==="multisim"||source==="solidworks"||source==="lattics"||source==="jetbrains"||source==="eclipse")&&roots.length!==1)invalid("Select one project folder");const canonical=rootPaths([...roots]).map(root=>pathToFileURL(root).href);return`indra-local-roots:${source}:${createHash("sha256").update(JSON.stringify(canonical)).digest("hex")}`}function authority(options,credentialKind,audience){const resourceId=text(options.resourceId,"resourceId",512),issuer=text(options.issuer,"issuer",512),selectedAudience=text(options.audience,"audience",2048);if(audience!==void 0&&selectedAudience!==audience)invalid("audience does not match selected resource");if(!Array.isArray(options.requiredScopes)||options.requiredScopes.length>32||options.requiredScopes.some(scope=>typeof scope!=="string"||!scope||scope.length>1024||/\s/u.test(scope))||new Set(options.requiredScopes).size!==options.requiredScopes.length)invalid("requiredScopes");return{kind:"custodied",resourceId,issuer,audience:selectedAudience,requiredScopes:[...options.requiredScopes],credentialKind}}function review(names){return Object.fromEntries(names.map(name=>[name,{inputSchemaSha256:reviewedToolSchemaHash(preparedLocalReadSchemas[name])}]))}const validateThunderbirdParams=(tool,params)=>{if(tool!=="getMessage")return ok(void 0);const invalidRead=()=>businessError("invalid_argument","Thunderbird full reads require a selected messageId and folderPath, rawSource=true, and disabled attachment saving and inline images.","plugin");if(!record(params))return invalidRead();for(const key of Reflect.ownKeys(params)){if(typeof key!=="string"||!["messageId","folderPath","rawSource","saveAttachments","includeInlineImages"].includes(key))return invalidRead();const descriptor=Object.getOwnPropertyDescriptor(params,key);if(!("value"in descriptor)||!descriptor.enumerable)return invalidRead()}const validReference=(value,max)=>typeof value==="string"&&value.length>0&&value.length<=max&&value===value.trim()&&!/[\u0000-\u001f\u007f]/u.test(value);if(!validReference(params.messageId,1024)||!validReference(params.folderPath,4096)||params.rawSource!==true||params.saveAttachments!==void 0&&params.saveAttachments!==false||params.includeInlineImages!==void 0&&params.includeInlineImages!==false)return invalidRead();return ok(void 0)};const validateThunderbirdResult=(tool,result,params)=>{if(tool!=="getMessage")return ok(void 0);const malformed=()=>businessError("data_loss","Thunderbird did not return the complete selected message MIME source.","plugin");if(result.structured!==void 0||params?.rawSource!==true)return malformed();let value;try{value=JSON.parse(result.text)}catch{return malformed()}if(!record(value))return malformed();if("error"in value)return businessError("unavailable","Thunderbird could not complete the protected message read.","plugin");if(value.encryptedContentWithheld===true)return businessError("permission_denied","Thunderbird withheld the selected message under its content access policy.","plugin");if(Object.keys(value).some(key=>!["id","subject","rawSource"].includes(key))||typeof value.id!=="string"||value.id!==params.messageId||typeof value.subject!=="string"||typeof value.rawSource!=="string"||!/(?:\r\n\r\n|\n\n|\r\r)/u.test(value.rawSource))return malformed();return ok(void 0)};const validateThunderbirdOutcome=(_tool,result)=>{let value=result.structured;try{if(value===void 0)value=JSON.parse(result.text)}catch{return ok(void 0)}if(record(value)&&"error"in value)return businessError("unavailable","Thunderbird could not complete the requested operation.","plugin");if(record(value)&&value.encryptedContentWithheld===true)return businessError("permission_denied","Thunderbird withheld the selected message under its content access policy.","plugin");return ok(void 0)};function numericId(value,field){const result=text(value,field,32);if(!/^[1-9][0-9]{0,19}$/.test(result))invalid(field);return result}function base(source,label){return{source,label,group:"Connector / Local and native"}}const nextcloudReady={tool:"find_details_of_current_user",done(structured,text2){let value=structured;try{if(value===void 0)value=JSON.parse(text2)}catch{return false}return record(value)&&typeof value.id==="string"&&value.id.length>0&&!("error"in value)}};const thunderbirdReady={tool:"listAccounts",done(structured,text2){if(structured!==void 0)return false;let value;try{value=JSON.parse(text2)}catch{return false}return Array.isArray(value)&&value.every(account=>record(account)&&typeof account.id==="string"&&!!account.id&&typeof account.name==="string"&&typeof account.type==="string"&&Array.isArray(account.identities)&&account.identities.every(identity=>record(identity)&&typeof identity.id==="string"&&!!identity.id&&typeof identity.email==="string"&&typeof identity.name==="string"&&typeof identity.isDefault==="boolean"))}};const protonReady={tool:"get_status",args:{folder:"INBOX"},done(structured){if(!record(structured)||"error"in structured||!Array.isArray(structured.result)||structured.result.length!==1)return false;const status=structured.result[0];return record(status)&&Object.keys(status).length===3&&status.name==="INBOX"&&Number.isSafeInteger(status.total)&&Number(status.total)>=0&&Number.isSafeInteger(status.unread)&&Number(status.unread)>=0}};const filesystemPackage="@modelcontextprotocol/server-filesystem@2.0.1";const filesystemCommit="ef9808f71090d0db3eda99e2af2ba78f1086f4fb";const appleCommit="951c11af2b621fc34debd2d57432b9ea856c7198";export const preparedProtonReadPolicy='[policy]\nmode = "read"\n\n[index]\nenabled = false\n\n[notifications]\nenabled = false\n';export function preparedLocalNativeSelection(source,input){if(windowsMetadataSource(source)){exact(input,[]);return windowsMetadataGrant(source)}if(source==="docker-desktop"){exact(input,[]);return{options:{},audience:"npipe:////./pipe/dockerDesktopLinuxEngine",scope:"images.read"}}if(source==="ollama"){exact(input,["port"]);const selectedPort=port(input.port,11434);return{options:{port:selectedPort},audience:"http://127.0.0.1:"+selectedPort,scope:"models.read"}}if(source==="owntracks"||source==="wechat"){exact(input,["port"]);const selectedPort=port(input.port,source==="owntracks"?8765:5030);return{options:{port:selectedPort},audience:`http://127.0.0.1:${selectedPort}/mcp`,scope:source==="owntracks"?"location.read":"messages.read"}}if(source==="copyq"){exact(input,["executable","session"]);const executable=path(input.executable,"executable",false),session=input.session===""?"":text(input.session,"session",16);if(!/^[\p{L}\p{N}_-]{0,16}$/u.test(session))invalid("session");return{options:{executable,session},audience:`copyq:${pathToFileURL(executable).href}?session=${encodeURIComponent(session)}`,scope:"clipboard.read"}}if(source==="zotero"){exact(input,["libraryId","libraryType","serverId"]);const libraryType=input.libraryType??"user";if(libraryType!=="user"&&libraryType!=="group")invalid("libraryType");const libraryId=libraryType==="user"&&input.libraryId==="0"?"0":numericId(input.libraryId,"libraryId");const serverId=text(input.serverId,"serverId",128);if(!/^[A-Za-z0-9_-]{1,128}$/.test(serverId))invalid("serverId");return{options:{libraryId,libraryType,serverId},audience:`http://127.0.0.1:23119/api/${libraryType==="user"?"users":"groups"}/${libraryId}?serverId=${serverId}`,scope:"library.read"}}if(["apple-notes","imessage","macos-contacts"].includes(source)){exact(input,["executable"]);const executable=path(input.executable,"executable",false);return{options:{executable},audience:`indra-apple-runtime:${source}:${pathToFileURL(executable).href}`,scope:source==="imessage"?"messages.read":source==="macos-contacts"?"contacts.read":"notes.read"}}return invalid("native source")}export function createPreparedLocalSource(source,options,policy={}){if(!preparedLocalSourceIds.includes(source)||!record(options))invalid("source or options");if(source==="stm32cubemx"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("STM32CubeMX project permission");return preparedStm32CubeMx(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="multisim"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Multisim project permission");return preparedMultisim(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="solidworks"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("SolidWorks project permission");return preparedSolidWorks(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="lattics"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Lattics library permission");return preparedLattics(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="jetbrains"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("JetBrains project permission");return preparedJetBrains(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="eclipse"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("Eclipse project permission");return preparedEclipse(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}if(source==="plecs"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1||!Array.isArray(options.requiredScopes)||options.requiredScopes.length!==1||options.requiredScopes[0]!=="files.read")invalid("PLECS project permission");return preparedPlecs(roots[0],authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots)))}const fieldsMode=["nextcloud","thunderbird","proton-mail"].includes(source)&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="fields";if(source==="joplin"&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="paired-plugin"){exact(options,["mode","port","fingerprint"]);const selectedPort=port(options.port);if(typeof options.fingerprint!=="string"||!/^[a-f0-9]{64}$/.test(options.fingerprint))invalid("Joplin pairing fingerprint");const account=`joplin-plugin:${options.fingerprint}:127.0.0.1:${selectedPort}`;return{...base(source,"Joplin"),server:{transport:"stdio",command:process.execPath,args:[fileURLToPath(new URL("./joplin-server.js",import.meta.url))],env:fields=>{if(typeof fields.bridgeKey!=="string"||!/^[a-f0-9]{64}$/.test(fields.bridgeKey))invalid("Joplin paired bridge key");return{JOPLIN_PORT:String(selectedPort),JOPLIN_BRIDGE_KEY:fields.bridgeKey}}},auth:{kind:"fields",fields:[{key:"bridgeKey",label:"Joplin paired bridge key",secret:true}],account:()=>account,accountBinding:"endpoint",login:{ready:{tool:"check_auth",done(structured){return record(structured)&&structured.authenticated===true}}}},readOnly:true,allowedTools:Object.keys(joplinSchemas),reviewedReadTools:Object.fromEntries(Object.entries(joplinSchemas).map(([name,schema])=>[name,{inputSchemaSha256:reviewedToolSchemaHash(schema)}])),origin:{official:false,repo:"laurent22/joplin",artifact:"@zortexhq/plugin-connector-level1@0.1.0",check:"Official Joplin plugin data API through a mutually confirmed encrypted loopback bridge. Read-only Actions, bounded replies, no Web Clipper token or credential URL. Pairing must be renewed after Joplin restart."}}}if(source==="simulink"||source==="quartus"||source==="modelsim"||source==="visual-studio"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Select one project folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("This source requires the native read grant");if(source==="visual-studio")return createVisualStudioSource(roots[0],auth);if(source==="modelsim")return createModelSimSource(roots[0],auth);return source==="quartus"?createQuartusSource(roots[0],auth):createSimulinkSource(roots[0],auth)}if(source==="jianying"){exact(options,[...common,"roots"]);authority(options,"local-no-secret");const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Jianying needs one draft folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Jianying needs the native read grant");return createJianyingSource(roots[0],auth)}if(source==="epic-games-launcher"||source==="ryujinx"||source==="modrinth"||source==="powerpoint"||source==="ti-ccs"||source==="pscad"||source==="adobe-photoshop"||source==="autocad"||source==="microsoft-word"||source==="microsoft-excel"||source==="local-git"||source==="vscode-local-history"||source==="libreoffice"||source==="adobe-acrobat"||source==="adobe-camera-raw"||source==="adobe-media-encoder"||source==="ansys-electronics-desktop"||source==="adobe-premiere-pro"||source==="packet-tracer"||source==="qt-designer"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Choose exactly one source folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Source needs the native read grant");if(source==="powerpoint")return preparedPowerPoint(roots[0],auth);if(source==="ti-ccs")return preparedCcs(roots[0],auth);if(source==="pscad")return preparedPscad(roots[0],auth);if(source==="adobe-photoshop")return preparedPhotoshop(roots[0],auth);if(source==="microsoft-word"||source==="microsoft-excel")return preparedOfficeLocal(source,roots[0],auth);if(source==="local-git"||source==="vscode-local-history")return preparedDeveloperHistory(source,roots[0],auth);if(source==="libreoffice")return preparedDeveloperHistory(source,roots[0],auth);if(source==="adobe-acrobat"||source==="adobe-camera-raw"||source==="adobe-media-encoder")return preparedAdobeNative(source,roots[0],auth);if(source==="ansys-electronics-desktop")return preparedAedt(roots[0],auth);if(source==="adobe-premiere-pro")return preparedPremierePro(roots[0],auth);if(source==="packet-tracer")return preparedPacketTracer(roots[0],auth);if(source==="epic-games-launcher"||source==="ryujinx")return preparedGameMetadata(source,roots[0],auth);if(source==="modrinth")return preparedModrinth(roots[0],auth);return source==="autocad"?preparedAutocad(roots[0],auth):preparedQtDesigner(roots[0],auth)}if(source==="minecraft-java"||source==="adobe-illustrator"||source==="hearthstone-deck-tracker"||source==="visio"||source==="matlab"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Select exactly one source folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("The source requires the native read grant");if(source==="hearthstone-deck-tracker")return preparedHearthstone(roots[0],auth);if(source==="visio")return preparedVisio(roots[0],auth);if(source==="matlab")return preparedMatlab(roots[0],auth);return source==="adobe-illustrator"?preparedIllustrator(roots[0],auth):preparedMinecraft(roots[0],auth)}if(source==="ni-tdms"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("TDMS needs exactly one measurement folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("TDMS needs the native read grant");return preparedTdms(roots[0],auth)}if(source==="jupyter"){exact(options,[...common,"roots"]);const roots=rootPaths(options.roots);if(roots.length!==1)invalid("Jupyter needs exactly one notebook folder");const auth=authority(options,"local-no-secret",preparedLocalRootsAudience(source,roots));if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="files.read")invalid("Jupyter needs the native read grant");return preparedJupyter(roots[0],auth)}if(windowsMetadataSource(source)){exact(options,common);const grant=windowsMetadataGrant(source),auth=authority(options,"local-no-secret",grant.audience);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!==grant.scope)invalid("Windows source requires its local metadata grant");return preparedWindowsMetadata(source,auth)}if(source==="joplin"&&Object.getOwnPropertyDescriptor(options,"mode")?.value==="fields")throw Error("Legacy Joplin Web Clipper authorization is disabled. Use Help encrypted plugin pairing.");if(source==="mac-apt")return createPreparedMacAptSource(source,options);if(source==="docker-desktop"){exact(options,common);const selection=preparedLocalNativeSelection(source,{});const auth=authority(options,"local-no-secret",selection.audience);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!==selection.scope)invalid("Docker Desktop requires the image metadata grant");return preparedDockerDesktop(auth)}if(source==="ollama"){exact(options,[...common,"port"]);const endpoint=preparedLocalNativeSelection(source,{port:options.port}).audience;const auth=authority(options,"local-no-secret",endpoint);if(auth.requiredScopes.length!==1||auth.requiredScopes[0]!=="models.read")invalid("Ollama requires the model metadata grant");return preparedOllama(endpoint,auth)}if(source==="owntracks"){exact(options,[...common,"port"]);const url=preparedLocalNativeSelection(source,{port:options.port}).audience;return{...base(source,"OwnTracks"),server:{transport:"http",url},auth:authority(options,"local-no-secret",url),readOnly:true,allowedTools:["owntracks_status","list_devices","get_last_location","get_location_history","get_distance","reverse_geocode"],origin:{official:false,repo:"de-niji/OwnTracksHermes",artifact:"owntracks-mcp@0.2.0",check:"MIT; source 9f005a790c388d3cd4aeb1306b3a202be917a1ff, archive SHA256 367406a8561c57657872661cc7a8d814ace162a0a21cd9214799394eb1fca63f. Existing local server must already own its selected Recorder configuration. Native Recorder queries only; Hermes reminders/history and cron are outside this route."}}}if(source==="copyq"){exact(options,[...common,"executable","session"]);authority(options,"local-no-secret");const selection=preparedLocalNativeSelection(source,{executable:options.executable,session:options.session}),{executable,session}=selection.options;const wheel="https://github.com/AutoraLabs/copyq-mcp/releases/download/v0.1.0/copyq_mcp-0.1.0-py3-none-any.whl#sha256=46e3f12eead7e9d7bd2589f6a563dba17c67a6ac6f5c4804522243a07def5746";return{...base(source,"CopyQ clipboard history"),server:{transport:"stdio",command:"uvx",args:["--from",wheel,"copyq-mcp"],env:()=>({COPYQ_MCP_EXECUTABLE:executable,COPYQ_MCP_SESSION:session})},auth:authority(options,"local-no-secret",selection.audience),readOnly:true,allowedTools:["clipboard_read","clipboard_search","clipboard_tabs"],origin:{official:false,repo:"AutoraLabs/copyq-mcp",artifact:"copyq-mcp@0.1.0",check:"MIT, active with CI/tests; exact release wheel digest verified 2026-10-26. Selected native CopyQ session only; all three text-history Actions preserved. No setup command, clipboard rewrite, dictation hook, or second clipboard store."}}}const mode=source==="logseq"?Object.getOwnPropertyDescriptor(options,"mode")?.value??"native-mcp":void 0;if(["obsidian","local-audio","computer-files"].includes(source)||source==="logseq"&&mode==="files"){exact(options,[...common,"roots",...source==="logseq"?["mode"]:[]]);authority(options,"local-no-secret");const roots=rootPaths(options.roots),audience=preparedLocalRootsAudience(source,roots);const fileAdapter=source==="computer-files"?createComputerFilesAdapter(roots):void 0;const label={obsidian:"Obsidian",logseq:"Logseq (file graph)","local-audio":"Local audio (file)","computer-files":"Local files"}[source];return{...base(source,label),server:{transport:"stdio",command:"npx",args:["-y",filesystemPackage,...roots]},auth:authority(options,"local-no-secret",audience),readOnly:true,preserveContent:true,...fileAdapter?{adaptSchema:pageSchema,adaptInvoke:(name,params,_grant,{signal})=>fileAdapter(name,params,signal)}:{},allowedTools:source==="local-audio"?["read_media_file","get_file_info"]:source==="computer-files"?["list_allowed_directories","search_files","list_directory","read_text_file","read_media_file","get_file_info"]:["read_text_file","read_media_file","get_file_info","list_directory"],origin:{official:true,repo:"modelcontextprotocol/servers",package:filesystemPackage,check:`Filesystem source reviewed at ${filesystemCommit}; exact granted roots, readonly tools, no recursive ingestion. Node >=24; license transition Apache-2.0/MIT, see pinned LICENSE.`}}}if(source==="joplin"||source==="logseq"||source==="wechat"||source==="thunderbird"){exact(options,fieldsMode?["mode","port"]:[...common,"port",...source==="logseq"?["mode"]:[]]);if(source==="logseq"&&mode!=="native-mcp")invalid("Logseq mode");const selectedPort=port(options.port,source==="logseq"?12315:source==="wechat"?5030:void 0);const url=source==="wechat"?preparedLocalNativeSelection(source,{port:selectedPort}).audience:`http://127.0.0.1:${selectedPort}${source==="thunderbird"?"/":"/mcp"}`;if(source==="joplin")throw Error("Joplin connection is temporarily disabled: upstream logs credential-bearing request URLs. Existing settings have been preserved.");if(source==="logseq")return{...base(source,"Logseq (database graph)"),server:{transport:"http",url},auth:authority(options,"mcp-token",url),readOnly:true,allowedTools:["getPage"],reviewedReadTools:review(["getPage"]),origin:{official:true,repo:"logseq/logseq",artifact:"native Logseq MCP 0.1.0",check:"getPage API/server reviewed at f8fb34b79bd5d183d22eb8f05d50173227ee2d81; native DB graph only; separately selected file graphs use filesystem route."}};if(source==="thunderbird")return{...base(source,"Thunderbird"),server:{transport:"http",url},auth:fieldsMode?{kind:"fields",fields:[{key:"apiKey",label:"Thunderbird MCP token",secret:true}],tokenField:"apiKey",account:()=>url,login:{ready:thunderbirdReady}}:authority(options,"mcp-token",url),readOnly:true,allowedTools:["listAccounts","getMessageHeaders","getMessage"],reviewedReadTools:review(["listAccounts","getMessageHeaders","getMessage"]),...policy.fullActions?{validateResult:validateThunderbirdOutcome}:{validateParams:validateThunderbirdParams,validateResult:validateThunderbirdResult},origin:{official:false,repo:"TKasperczyk/thunderbird-mcp",artifact:"thunderbird-mcp@0.10.0",check:"Extension/native MCP at 8910dbf4300a7ea7ebf1edd0bdd0d22996531b88; XPI SHA256 638b7512d4f8b30d71b1547e10372ac537f046cc05d196a867e3871684c19f8c. Exact approved profile port/token; no profile discovery or installation. getMessage admits rawSource=true only, with attachment saving and inline images disabled; complete MIME bytes remain transient. Exact stored Message-ID and folder URI; shared 1 MiB reply and 120 second bounds. Native account/content access checks remain authoritative."}};return{...base(source,"WeChat (local chatlog)"),server:{transport:"http",url},auth:authority(options,"local-no-secret",url),allowedTools:["query_contact","query_chat_room","query_recent_chat","query_chat_log"],origin:{official:false,repo:"sjzar/chatlog",artifact:"chatlog@0.0.26",check:"Retained Indra vendor pin 74e568085b8ae5aa3ec72dcd37aac6da969fa121, archive SHA256 e8affa2def64a68bc65f8eaeccd643080d18eeab29750ce9205f574adfa69cbb; /mcp Streamable HTTP. Public upstream removed. Explicit false readonly hints preserved; readonly acceptance remains blocked."}}}if(["apple-notes","imessage","macos-contacts"].includes(source)){exact(options,[...common,"executable"]);authority(options,"local-no-secret");const selection=preparedLocalNativeSelection(source,{executable:options.executable}),executable=selection.options.executable,tool={"apple-notes":"notes_get",imessage:"messages_read","macos-contacts":"contacts_get"}[source];const audience=typeof options.audience==="string"&&options.audience.startsWith("indra-apple-runtime:")?selection.audience:void 0;return{...base(source,{"apple-notes":"Apple Notes",imessage:"iMessage","macos-contacts":"macOS Contacts"}[source]),server:{transport:"stdio",command:executable,args:[],env:()=>({APPLE_BRIDGE_SKIP_PERMISSIONS:"1"})},auth:authority(options,"local-no-secret",audience),readOnly:true,allowedTools:[tool],reviewedReadTools:review([tool]),origin:{official:false,repo:"boutquin/apple-bridge",artifact:"apple-bridge@3.2.0",check:`Native readonly tools reviewed at ${appleCommit}; release macOS arm64 archive SHA256 83c64569fa8238e694ed4e30b6c32e81c7f9285b4130aaaf4e303a430dda5875. Startup permission requests disabled; existing OS permission still required. No Windows adapter.`},unavailable:()=>process.platform==="darwin"?void 0:"This reviewed Apple native adapter requires macOS; Windows qualification remains open."}}if(source==="nextcloud"){exact(options,fieldsMode?["mode","instanceUrl"]:[...common,"instanceUrl"]);const input=text(options.instanceUrl,"instanceUrl");let instance;try{instance=new URL(input);if(instance.protocol!=="https:"||instance.username||instance.password||instance.search||instance.hash)invalid("instanceUrl")}catch{invalid("instanceUrl")}const url=`${instance.href.replace(/\/$/,"")}/index.php/apps/app_api/proxy/context_agent/mcp/`;return{...base(source,"Nextcloud"),server:{transport:"http",url},auth:fieldsMode?{kind:"fields",fields:[{key:"apiKey",label:"Nextcloud app password",secret:true}],tokenField:"apiKey",account:()=>url,login:{ready:nextcloudReady}}:authority(options,"rest-token",url),readOnly:true,allowedTools:["find_details_of_current_user","get_file_content"],reviewedReadTools:review(["find_details_of_current_user","get_file_content"]),origin:{official:true,repo:"nextcloud/context_agent",artifact:"Context Agent native MCP",check:"Hosted bearer app-password contract, current-user metadata and private-file text read reviewed at 321e0943dfee7eef1a8ade118dc2aea3da0ba356. Instance AppAPI/Context Agent versions and stateless transport compatibility require installed qualification."}}}if(source==="fastmail"){exact(options,common);if(options.audience===fastmailUrl){if(options.issuer!==fastmailIssuer)invalid("hosted Fastmail issuer");return{...fastmail,auth:authority(options,"mcp-token",fastmailUrl)}}return{...base(source,"Fastmail"),server:{transport:"stdio",command:"npx",args:["-y","@jordonh19/fastmail-mcp-server@1.3.0","--transport","stdio"],tokenEnv:"FASTMAIL_API_TOKEN"},auth:authority(options,"rest-token","https://api.fastmail.com"),readOnly:true,allowedTools:["get_email","list_mailboxes"],reviewedReadTools:review(["get_email","list_mailboxes"]),origin:{official:false,repo:"Jordonh18/fastmail-mcp-server",package:"@jordonh19/fastmail-mcp-server@1.3.0",check:"MIT; source pin 68bb946fecd82b892190f0641a6b09bd4229d84c. Published package tools/list exercised with SDK1.27.1/Zod3.25.76 and zero network calls. Grant acquisition/OAuth refresh is separate; never infer account from a token label."}}}if(source==="proton-mail"){exact(options,fieldsMode?["mode","imapPort","policyFile"]:[...common,"username","imapPort","policyFile"]);if(!fieldsMode)authority(options,"rest-token");const username=fieldsMode?void 0:text(options.username,"Bridge username",320),imapPort=port(options.imapPort,fieldsMode?void 0:1143);const policyFile=path(fieldsMode&&options.policyFile===void 0?fileURLToPath(new URL("../server/proton/read.toml",import.meta.url)):options.policyFile,"policyFile",false);const policyValid=()=>{try{return readFileSync(policyFile,"utf8")===preparedProtonReadPolicy}catch{return false}};if(!policyValid())invalid("Proton readonly policy");const selectedFields=fields=>{exact(fields,["username","password"]);return{username:text(fields.username,"Bridge username",320),password:text(fields.password,"Bridge mailbox password",4096)}};const audience=selectedUsername=>`imap://127.0.0.1:${imapPort}/${encodeURIComponent(selectedUsername)}`;const environment=selectedUsername=>{if(!policyValid())invalid("Proton readonly policy");return{PROTONMAIL_BRIDGE_USERNAME:selectedUsername,PROTONMAIL_BRIDGE_HOST:"127.0.0.1",PROTONMAIL_BRIDGE_IMAP_PORT:String(imapPort),PROTONMAIL_BRIDGE_IMAP_SECURITY:"starttls",PROTONMAIL_BRIDGE_TIMEOUT:"30",PROTONMAIL_MCP_MODE:"read",PROTONMAIL_MCP_POLICY:policyFile,PROTONMAIL_MCP_AUDIT_LOG:""}};return{...base(source,"Proton Mail Bridge"),server:{transport:"stdio",command:"uvx",args:["--from","protonmail-mcp==0.4.0","protonmail-mcp"],...fieldsMode?{env:fields=>{const selected=selectedFields(fields);return{...environment(selected.username),PROTONMAIL_BRIDGE_PASSWORD:selected.password}}}:{tokenEnv:"PROTONMAIL_BRIDGE_PASSWORD",env:()=>environment(username)}},auth:fieldsMode?{kind:"fields",fields:[{key:"username",label:"Proton Bridge username"},{key:"password",label:"Proton Bridge mailbox password",secret:true}],accountBinding:"endpoint",account:fields=>audience(selectedFields(fields).username),login:{ready:protonReady}}:authority(options,"rest-token",audience(username)),readOnly:true,allowedTools:["list_folders","list_emails","read_email"],origin:{official:false,repo:"mhbxyz/protonmail-mcp",package:"protonmail-mcp==0.4.0",check:"Source pin f15d769d562de55c288a574f2a1e0946fefc9e31; fixed loopback Proton Bridge STARTTLS, immutable read preset, index/notifications/audit off. Fields mode verifies get_status for INBOX before saving the existing credential envelope and binds it to the selected port and username. Password is the Bridge mailbox credential. Python >=3.13 and an installed, signed-in Bridge remain required. Full Actions preserves upstream local-export write effects; this policy does not enable SMTP or mailbox mutations."},unavailable:()=>policyValid()?void 0:"The selected Proton readonly policy changed; requalify the connection."}}if(source==="zotero"){exact(options,[...common,"libraryId","libraryType","serverId"]);const selection=preparedLocalNativeSelection(source,{libraryId:options.libraryId,libraryType:options.libraryType,serverId:options.serverId}),{libraryId,libraryType,serverId}=selection.options,audience=selection.audience;return{...base(source,"Zotero (local library)"),server:{transport:"stdio",command:"uvx",args:["--with","fastmcp==3.4.11","--with","pydantic==2.13.4","--from","zotero-mcp-server==0.15.1","python",fileURLToPath(new URL("../server/zotero/read.py",import.meta.url))],env:()=>({ZOTERO_LOCAL:"true",ZOTERO_LIBRARY_ID:libraryId,ZOTERO_LIBRARY_TYPE:libraryType,ZOTERO_SERVER_ID:serverId,ZOTERO_LOCAL_WRITE:"false",ZOTERO_MCP_TOOLSETS:"none",ZOTERO_BACKEND:"api",ZOTERO_SEARCH_BACKEND:"api",ZOTERO_NO_CLAUDE:"1",ZOTERO_MCP_SCHEMA_REFRESH:"0",PYTHON_DOTENV_DISABLED:"1"})},auth:authority(options,"local-no-secret",audience),readOnly:true,...zoteroApiReads,liveRead:{tool:"zotero_get_recent",args:{limit:1},records:zoteroRecentRecords},origin:{official:false,repo:"54yyyu/zotero-mcp",package:"zotero-mcp-server==0.15.1",check:"Source pin f1f6cdc1ea26e04c59525f5b3ee7dd2b9d839bc3; selected library and local server identity bound, API backend forced, write/index/library-switch tools excluded. Public FastMCP3.4.11 import_server reuses unchanged tools without the upstream CLI environment discovery, reranker or startup indexing lifespan. Dotenv discovery is disabled; HOME is unchanged. Python server MIT; bundled plugin AGPL-3.0-or-later. Actual native library and OS acceptance remain separate."}}}return invalid("source")}
@@ -1 +1 @@
1
- import{accessSync,constants,existsSync}from"node:fs";import{homedir}from"node:os";import{delimiter,join}from"node:path";import{fileURLToPath}from"node:url";import{notebookRecords}from"./notebooklm-read.js";import{facebookCompat,facebookSchema,facebookWriteToken}from"./facebook-compat.js";export function onPath(command,env=process.env){const exts=process.platform==="win32"?(env.PATHEXT??".EXE;.CMD").split(";"):[""];return(env.PATH??"").split(delimiter).filter(Boolean).some(dir=>exts.some(ext=>existsSync(join(dir,command+ext.toLowerCase()))||existsSync(join(dir,command+ext))))}const npx=pkg=>({transport:"stdio",command:"npx",args:["-y",pkg]});const needsNpx=()=>onPath("npx")?void 0:"Node.js npx is not on PATH; install Node.js 20+ to start this connector.";export const stripe={source:"stripe",label:"Stripe",group:"Connector / \u6536\u6B3E",server:{transport:"http",url:"https://mcp.stripe.com"},auth:{kind:"mcp-oauth",loopbackPort:8751,reviewed:{issuer:"https://access.stripe.com/mcp",scopes:["mcp"],allowedOrigins:["https://access.stripe.com"]}},origin:{official:true,repo:"stripe/ai",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4)"}};const calendlyClientId=process.env.ZORTEX_CALENDLY_CLIENT_ID?.trim();export const calendly={source:"calendly",label:"Calendly",group:"Connector / \u65E5\u7A0B",server:{transport:"http",url:"https://mcp.calendly.com"},auth:{kind:"mcp-oauth",loopbackPort:8752,reviewed:{issuer:"https://calendly.com/",scopes:["mcp:scheduling:read","mcp:scheduling:write"],allowedOrigins:["https://calendly.com","https://zortex-calendly-auth.pages.dev","https://zortex-auth-9sl.pages.dev"],redirectUriPolicy:"https-only",registration:calendlyClientId?{kind:"redirect-broker",clientId:calendlyClientId,brokerBase:"https://zortex-auth-9sl.pages.dev",brokerPath:"calendly"}:{kind:"dcr",httpsBroker:"calendly"},identity:{tool:"users-get_current_user",subjectPath:["resource","uri"],labelPath:["resource","email"]}}},origin:{official:true,repo:"developer.calendly.com/calendly-mcp-server",check:"official hosted server; no public repository"}};export const openrouter={source:"openrouter",label:"OpenRouter",group:"Connector / \u6A21\u578B",server:{transport:"http",url:"https://mcp.openrouter.ai/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.openrouter.ai",scopes:[],allowedOrigins:["https://mcp.openrouter.ai","https://openrouter.ai"],identity:{kind:"openrouter-current-key"}}},origin:{official:true,repo:"openrouter.ai/docs/guides/overview/mcp-server",check:"official hosted server; SDK OpenRouterTeam/typescript-sdk \u503C\u5F97\u4E00\u8BD5 (score 5)"}};export const cloudflare={source:"cloudflare",label:"Cloudflare",readOnly:true,group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.cloudflare.com/mcp"},exposedTools:["whoami","docs","search","execute"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.cloudflare.com",scopes:["user:read","account:read","offline_access"],allowedOrigins:["https://mcp.cloudflare.com","https://dash.cloudflare.com"],registration:{kind:"dcr"},identity:{tool:"whoami",subjectPath:["id"],labelPath:["email"]}}},origin:{official:true,repo:"cloudflare/mcp",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4; tests, CI, Apache-2.0, active upstream) at 550e1be82b2227818e6b98fc32a313a59403ae3f; use the vendor-hosted unified server instead of embedding the deprecated specialist servers."}};export const posthog={source:"posthog",label:"PostHog",group:"Connector / \u5206\u6790",server:{transport:"http",url:"https://mcp.posthog.com/mcp"},exposedTools:["user-get","organizations-get","projects-get","dashboards-get-all","insights-list","execute-sql","annotation-create","annotation-retrieve","annotations-list","annotation-delete"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://oauth.posthog.com",scopes:["user:read","organization:read","dashboard:read","insight:read","query:read","annotation:read","annotation:write"],allowedOrigins:["https://oauth.posthog.com","https://us.posthog.com","https://eu.posthog.com"],registration:{kind:"dcr"},identity:{tool:"user-get",subjectPath:["uuid"],labelPath:["email"]}}},origin:{official:true,repo:"PostHog/posthog",check:"official active monorepo with tests and CI reviewed at 531a053f2408a3416536cf942a8378e172308f7e; gh oss-check was unavailable because this host token is invalid, so public upstream source and live OAuth metadata were inspected directly. Use the vendor-hosted MCP."}};export const notionL1={source:"notion-l1",label:"Notion (Actions)",group:"Connector / Documents",server:{transport:"http",url:"https://mcp.notion.com/mcp"},exposedTools:["notion-get-self","notion-get-tool-access","notion-search","notion-fetch","notion-create-pages","notion-update-page","notion-create-comment","notion-get-comments"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.notion.com",scopes:["default"],allowedOrigins:["https://mcp.notion.com"],registration:{kind:"dcr"},identity:{kind:"notion-bot-owner"}}},origin:{official:true,repo:"makenotion/notion-cookbook",check:"official hosted MCP and client-integration documentation reviewed 2026-10-26; gh oss-check was unavailable because this host token is invalid, so the public official repository, current provider documentation and live OAuth metadata were inspected directly. The existing Notion L2 provider remains installed separately."}};export const github={source:"github",label:"GitHub",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://api.githubcopilot.com/mcp/"},auth:{kind:"oauth-device",clientId:"Ov23liDjCBTGEwUJvt8f",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",reviewed:{issuer:"https://github.com",allowedOrigins:["https://github.com"],scopes:["repo","read:org","read:user","user:email","read:packages","write:packages","read:project","project","gist","notifications"],identity:{tool:"get_me",subjectPath:["id"],labelPath:["login"]}}},origin:{official:true,repo:"github/github-mcp-server",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8); official remote endpoint and get_me contract reviewed at current upstream"}};export const gitlab={source:"gitlab",label:"GitLab",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://gitlab.com/api/v4/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://gitlab.com",scopes:["mcp"],allowedOrigins:["https://gitlab.com"],registration:{kind:"dcr",allowUnadvertisedPublicClient:true},identity:{kind:"gitlab-token-info"}}},origin:{official:true,repo:"gitlab-org/gitlab",check:"official hosted MCP; gitlabhq/gitlabhq mirror oss-check \u4E0D\u786E\u5B9A (score 3) and has no usable license signal, so it is not embedded"}};export const jira={source:"jira",label:"Jira",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.atlassian.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://auth.atlassian.com/VCeDsk8ZHncYF1g234fKtc4lNipbBhu3",scopes:["read:me","read:account","offline_access","email","read:jira:agent-interface","write:jira:agent-interface","search:jira:agent-interface","delete:jira:agent-interface","manage:jira:agent-interface"],allowedOrigins:["https://auth.atlassian.com","https://api.atlassian.com"],registration:{kind:"dcr",discardReturnedSecretForPublicClient:true},identity:{kind:"atlassian-current-user-sites"}}},origin:{official:true,repo:"atlassian/atlassian-mcp-server",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4, Apache-2.0, active upstream); use the vendor-hosted v2 server instead of embedding it"}};export const confluence={source:"confluence",label:"Confluence",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.atlassian.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://auth.atlassian.com/VCeDsk8ZHncYF1g234fKtc4lNipbBhu3",scopes:["read:me","read:account","offline_access","email","read:confluence:agent-interface","write:confluence:agent-interface","search:confluence:agent-interface"],allowedOrigins:["https://auth.atlassian.com","https://api.atlassian.com"],registration:{kind:"dcr",discardReturnedSecretForPublicClient:true},identity:{kind:"atlassian-current-user-sites"}}},origin:{official:true,repo:"atlassian/atlassian-mcp-server",check:"reuses source 027 oss-check: \u503C\u5F97\u4E00\u8BD5 (score 4, Apache-2.0, active upstream); use the vendor-hosted v2 server instead of embedding it"}};export const linear={source:"linear",label:"Linear",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.linear.app/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.linear.app",scopes:["read","write","openid","email"],allowedOrigins:["https://mcp.linear.app","https://linear.app"],registration:{kind:"dcr"},identity:{kind:"linear-openid-teams"}}},origin:{official:true,repo:"linear/linear",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8, MIT, active upstream with tests, CI and releases); use Linear's vendor-hosted MCP rather than embedding the application repository"}};export const asana={source:"asana",label:"Asana",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.asana.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:8752,reviewed:{issuer:"https://app.asana.com",scopes:[],allowedOrigins:["https://app.asana.com"],registration:{kind:"broker",clientId:"1219875673629405",brokerBase:"https://zortex-auth-9sl.pages.dev",brokerPath:"asana"},identity:{kind:"asana-user-workspaces"}}},origin:{official:true,repo:"Asana/node-asana",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 6, MIT, active upstream); use Asana's vendor-hosted v2 MCP server rather than embedding the REST SDK"}};export const clickup={source:"clickup",label:"ClickUp",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.clickup.com/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.clickup.com",scopes:["read","write"],allowedOrigins:["https://mcp.clickup.com","https://app.clickup.com"],registration:{kind:"dcr"},identity:{kind:"clickup-current-user-workspaces"}}},origin:{official:true,repo:"clickup/clickup-plugin",check:"oss-check score 2; ten-minute source trial confirmed the official MIT plugin is a thin manifest for the same hosted MCP URL, so Zortex reuses the vendor endpoint rather than embedding untested code"}};export const ticktick={source:"ticktick",label:"TickTick",group:"Connector / Tasks",server:{transport:"http",url:"https://mcp.ticktick.com"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://ticktick.com",scopes:["tasks:read","tasks:write"],allowedOrigins:["https://ticktick.com","https://api.ticktick.com"],registration:{kind:"dcr"},identity:{kind:"ticktick-inbox-self"}}},origin:{official:true,repo:"help.ticktick.com/articles/7438129581631995904",check:"Official hosted MCP documented by help.ticktick.com/articles/7438129581631995904. Real DCR/S256 qualification and 57-tool catalog; readonly Inbox membership returned exactly one self=true username matching consent. Username changes require reauthorization; no immutable numeric user ID is advertised."}};export const todoist={source:"todoist",label:"Todoist",group:"Connector / Tasks",server:{transport:"http",url:"https://ai.todoist.net/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://todoist.com",scopes:["data:read_write"],allowedOrigins:["https://todoist.com","https://app.todoist.com"],registration:{kind:"dcr"},identity:{tool:"user-info",subjectPath:["userId"],labelPath:["email"]}}},origin:{official:true,repo:"Doist/todoist-ai",check:"MIT official hosted MCP; oss-check score 4 with active CI/releases and colocated tests. Live qualification at 4438a5159a3666977550e1488b557bcf1a09b83f verified public DCR, real PKCE grant, 47 tools and readonly user-info; no embedded API key or SDK."}};export const microsoftTodo={source:"microsoft-todo",label:"Microsoft To Do",readOnly:true,group:"Connector / Tasks",server:{transport:"stdio",command:process.execPath,args:[fileURLToPath(new URL("./microsoft-todo-server.js",import.meta.url))],env:(_fields,token)=>({MICROSOFT_TODO_ACCESS_TOKEN:token??""})},auth:{kind:"oauth-device",clientId:"2a0c47ae-6035-459e-a544-f8c2008a9d78",deviceCodeUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",reviewed:{issuer:"https://login.microsoftonline.com/common/v2.0",scopes:["openid","profile","email","Tasks.Read","User.Read","offline_access"],allowedOrigins:["https://login.microsoftonline.com"],identity:{tool:"get_profile",subjectPath:["id"]}}},origin:{official:true,repo:"microsoftgraph/microsoft-graph-docs-contrib",artifact:"zortex-microsoft-todo@0.1.0",check:"Official Graph API behind a bounded in-package adapter. pnp/cli-microsoft365-mcp-server at 9b6863daef5bb093c70540479092a8c160a657be was rejected after its ten-minute trial because it delegates auth to a separately installed global CLI and exposes arbitrary command execution instead of a bounded To Do surface."}};export const appleNotes={source:"apple-notes",label:"Apple Notes",group:"Connector / Notes",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-notes-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.id==="string"},identity:{tool:"get_identity",subjectPath:["id"],labelPath:["name"]}}},origin:{official:true,repo:"Apple/macOS-Notes-scripting-dictionary",artifact:"zortex-apple-notes@0.1.0",check:"macOS system Notes scripting dictionary; the existing in-repo native adapter has exercised the same JXA boundary on a 2,237-note real store. Local Actions are bounded and do not start the L2 sync connector."},unavailable:()=>process.platform!=="darwin"?"Apple Notes is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Notes bridge."};export const appleReminders={source:"apple-reminders",label:"Apple Reminders",group:"Connector / Tasks",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-reminders-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.id==="string"},identity:{tool:"get_identity",subjectPath:["id"],labelPath:["name"]}}},origin:{official:true,repo:"Apple/macOS-Reminders-scripting-dictionary",artifact:"zortex-apple-reminders@0.1.0",check:"Native macOS Reminders.sdef provides bounded accounts, lists and reminder CRUD. burghr/reminders-mcp and Don-Works/reminders-mcp were considered; the former has one commit and an extra Python service, while the latter is AGPL and requires an separately shipped Swift binary. The in-package bridge keeps the installed artifact self-contained and uses the already-qualified background launchd Apple Events path."},unavailable:()=>process.platform!=="darwin"?"Apple Reminders is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Reminders bridge."};export const appleMusic={source:"apple-music",label:"Apple Music",group:"Connector / \u97F3\u4E50",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-music-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.libraryId==="string"},identity:{tool:"get_identity",subjectPath:["libraryId"],labelPath:["libraryName"]}}},origin:{official:true,repo:"Apple/macOS-Music-scripting-dictionary",artifact:"zortex-apple-music@0.1.0",check:"The installed Music.sdef provides stable library and media identifiers, playlist/track reads, native search, playback state and user-playlist CRUD. tomahawk-player/tomahawk was rejected by the repository OSS gate because it has no current tests or release and its last commit was more than six years ago. The self-contained adapter uses the same bounded background launchd Apple Events path as the qualified native connectors."},unavailable:()=>process.platform!=="darwin"?"Apple Music is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Music bridge."};export const sentry={source:"sentry",label:"Sentry",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.sentry.dev/mcp"},exposedTools:["find_organizations","find_projects","update_issue","search_errors","search_logs","search_traces","search_metrics","search_profiles","search_replays","find_dropped_events","analyze_issue_with_seer","search_issues","get_sentry_resource","search_sentry_tools","execute_sentry_tool"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.sentry.dev",scopes:["org:read","project:write","team:write","event:write","alerts:write"],allowedOrigins:["https://mcp.sentry.dev","https://sentry.io"],registration:{kind:"dcr"},identity:{kind:"sentry-catalog-whoami"}}},origin:{official:true,repo:"getsentry/toolkit",check:"official remote MCP source and tests reviewed at 3869ac95a3227cc29783939c436252f0cd796aea; oss-check CLI unavailable because GitHub credentials were rejected, so the public repository was inspected directly"}};export const shopify={source:"shopify",label:"Shopify",group:"Connector / \u5E97\u94FA",server:{...npx("mcp-shopify-admin@1.1.0"),env:f=>({SHOPIFY_STORE_DOMAIN:f.store??"",SHOPIFY_CLIENT_ID:f.clientId??"",SHOPIFY_CLIENT_SECRET:f.clientSecret??""})},auth:{kind:"fields",account:f=>String(f.store??"").trim().toLowerCase(),fields:[{key:"store",label:"Store domain (my-store.myshopify.com)"},{key:"clientId",label:"Dev Dashboard app client ID"},{key:"clientSecret",label:"Dev Dashboard app client secret",secret:true}]},origin:{official:false,repo:"A1-x-Tech/mcp-shopify-admin",package:"mcp-shopify-admin@1.1.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 5, tests + CI, 0 stars); GeLi2001/shopify-mcp stale 192 days"},unavailable:needsNpx};export const reddit={source:"reddit",label:"Reddit",group:"Connector / \u793E\u533A",server:{...npx("reddit-mcp-server@1.6.3"),env:f=>({REDDIT_AUTH_MODE:"auto",REDDIT_SAFE_MODE:"standard",...Object.fromEntries(Object.entries({REDDIT_CLIENT_ID:f.clientId,REDDIT_CLIENT_SECRET:f.clientSecret,REDDIT_USERNAME:f.username,REDDIT_PASSWORD:f.password}).filter(([,v])=>v))})},publicTools:["browse_subreddit","get_top_posts"],auth:{kind:"fields",account:f=>"u/"+String(f.username??"").trim(),fields:[{key:"clientId",label:"Reddit app client ID"},{key:"clientSecret",label:"Reddit app client secret",secret:true},{key:"username",label:"Reddit username (for posting)"},{key:"password",label:"Reddit password (for posting)",secret:true}]},origin:{official:false,repo:"jordanburke/reddit-mcp-server",package:"reddit-mcp-server@1.6.3",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 6)"},unavailable:needsNpx};export const spotify={source:"spotify",label:"Spotify",group:"Connector / \u97F3\u4E50",server:{...npx("@xavifabregat/spotify-mcp@0.1.2"),env:f=>({SPOTIFY_CLIENT_ID:f.clientId??""})},auth:{kind:"fields",account:f=>"spotify app "+String(f.clientId??"").slice(0,6),login:{tool:"authenticate"},fields:[{key:"clientId",label:"Spotify app client ID (redirect URI http://127.0.0.1:8888/callback)"}]},origin:{official:false,repo:"XavierFabregat/spotify-mcp",package:"@xavifabregat/spotify-mcp@0.1.2",check:"oss-check \u4E0D\u786E\u5B9A (tests + CI, 1 star); marcelmarais/spotify-mcp-server has no license, varunneal/spotify-mcp stale"},unavailable:needsNpx};export const tiktok={source:"tiktok",label:"TikTok",group:"Connector / \u793E\u533A",exposedTools:["list_accounts","get_profile","list_videos","get_videos","top_videos","search_my_videos","stats_summary"],server:{...npx("@thenavidm/tiktok-mcp-cli@2.0.1"),env:f=>({TIKTOK_CLIENT_KEY:f.clientKey??"",TIKTOK_CLIENT_SECRET:f.clientSecret??"",TIKTOK_REFRESH_TOKEN:f.refreshToken??""})},auth:{kind:"fields",account:f=>"@"+String(f.username??"").trim().replace(/^@/,""),fields:[{key:"username",label:"Authorized TikTok username"},{key:"clientKey",label:"TikTok developer app client key",secret:true},{key:"clientSecret",label:"TikTok developer app client secret",secret:true},{key:"refreshToken",label:"TikTok Login Kit refresh token",secret:true}]},origin:{official:false,repo:"thenavidm/tiktok-mcp-cli",package:"@thenavidm/tiktok-mcp-cli@2.0.1",check:"oss-check real-use signals reviewed; exact npm artifact and source pin 2f32934850642d59868f7e6f9c788f9e6672ec8e passed 51/51 upstream tests, build, and live read-only OAuth/API qualification. Full Actions retains the published 14-tool catalog; actual posting still needs its provider scopes/app approval and upstream confirmation. Direct runtime dependencies retain known zod resource-exhaustion and fast-uri advisories; Zortex bounds Action input to 64 KiB, output to 1 MiB and calls to 120 seconds."},unavailable:needsNpx};export const facebook={enrollmentUnavailable:()=>"Facebook account authorization is not yet configured by Zortex. A platform-owned Meta application, authorization service and verified Page selection are required. Do not enter developer credentials. Existing saved credentials are not proof of verified Facebook access.",source:"facebook",label:"Facebook",group:"Connector / \u793E\u533A",exposedTools:["facebook_whoami","facebook_list_pages","facebook_get_page","facebook_list_posts","facebook_get_post","facebook_create_post","facebook_update_post","facebook_list_scheduled_posts","facebook_delete_post"],adaptInvoke:facebookCompat,adaptSchema:facebookSchema,server:{...npx("@ivanbaev/facebook-mcp@0.7.0"),env:f=>({FB_ACCESS_TOKEN:f.accessToken??"",FB_APP_ID:f.appId??"",FB_APP_SECRET:f.appSecret??"",FB_PAGE_ID:f.pageId??"",FB_CONFIRM_TOKEN:facebookWriteToken,FB_TOOL_PACKAGES:"core,reader,posts",FB_PACKAGES_DENY:"insights,moderation,messages,ads",FB_WRITE_MODE:"apply",FB_MAX_RESULT_CHARS:"25000"})},auth:{kind:"fields",account:f=>"facebook-page:"+String(f.pageId??"").trim(),fields:[{key:"pageId",label:"Authorized Facebook Page ID"},{key:"appId",label:"Meta developer app ID"},{key:"appSecret",label:"Meta developer app secret",secret:true},{key:"accessToken",label:"Long-lived Facebook user access token",secret:true}]},origin:{official:false,repo:"IvanBBaev/facebook-mcp",package:"@ivanbaev/facebook-mcp@0.7.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 5; tests, CI, release, MIT, active upstream) at 2d8f4687470fbdc205346f1ab5927ee9c43a000b. Exact source passed build, lint and 2,626 fixture tests. Its direct zod dependency retains GHSA-mrhx-c7xc-m3w5; Indra bounds Action input to 64 KiB, output to 1 MiB and calls to 120 seconds while this server further caps results at 25,000 characters."},unavailable:needsNpx};export const notebooklm={source:"notebooklm",label:"NotebookLM",group:"Connector / \u7B14\u8BB0",server:{...npx("@roomi-fields/notebooklm-mcp@3.2.0"),env:()=>{const chrome=process.platform==="win32"&&[process.env.PROGRAMFILES,process.env["PROGRAMFILES(X86)"],process.env.LOCALAPPDATA].some(root=>root&&existsSync(join(root,"Google","Chrome","Application","chrome.exe")));return process.env.BROWSER_CHANNEL?{BROWSER_CHANNEL:process.env.BROWSER_CHANNEL}:chrome?{BROWSER_CHANNEL:"chrome"}:{}}},auth:{kind:"server-login",login:{tool:"auth_setup",args:{show_browser:true},ready:{tool:"server_health",done:s=>s?.data?.authenticated===true},handoff:{openingInstructions:"Complete Google sign-in in the NotebookLM browser window.",instructions:()=>"Complete Google sign-in in the NotebookLM browser window."}}},liveRead:{tool:"notebook_list",args:{show_browser:false},records:notebookRecords},origin:{official:false,repo:"roomi-fields/notebooklm-mcp",package:"@roomi-fields/notebooklm-mcp@3.2.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8); PleasePrompto/notebooklm-mcp archived"},unavailable:needsNpx};const installedCua="/Applications/CuaDriver.app/Contents/MacOS/cua-driver";function canExecute(path){try{accessSync(path,constants.X_OK);return true}catch{return false}}const cuaCommand=process.platform==="darwin"&&canExecute(installedCua)?installedCua:"cua-driver";const cuaSocket=process.platform==="darwin"?join(homedir(),"Library","Caches","cua-driver","cua-driver.sock"):void 0;export const cua={source:"cua",label:"CUA Driver",group:"Connector / \u7535\u8111\u64CD\u4F5C",server:{transport:"stdio",command:cuaCommand,args:cuaSocket?["mcp","--socket",cuaSocket]:["mcp"]},auth:{kind:"none"},origin:{official:true,repo:"trycua/cua",artifact:"cua-driver@0.28.2",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8)"},unavailable:()=>{if(cuaCommand==="cua-driver"&&!onPath(cuaCommand))return"cua-driver is not installed; install it from trycua/cua (libs/cua-driver/scripts/install.sh).";if(cuaSocket&&!existsSync(cuaSocket))return"The CUA Driver background service socket is unavailable."}};export const firstBatch=[cua,reddit,notebooklm,calendly,spotify,appleMusic,tiktok,facebook,shopify,stripe,openrouter,github,gitlab,jira,confluence,linear,asana,clickup,todoist,ticktick,microsoftTodo,appleNotes,appleReminders,cloudflare,posthog,notionL1];
1
+ import{existsSync}from"node:fs";import{delimiter,join}from"node:path";import{fileURLToPath}from"node:url";import{notebookRecords}from"./notebooklm-read.js";import{facebookCompat,facebookSchema,facebookWriteToken}from"./facebook-compat.js";import{cuaCommand,cuaSocket,cuaVersion}from"./cua-runtime.js";export function onPath(command,env=process.env){const exts=process.platform==="win32"?(env.PATHEXT??".EXE;.CMD").split(";"):[""];return(env.PATH??"").split(delimiter).filter(Boolean).some(dir=>exts.some(ext=>existsSync(join(dir,command+ext.toLowerCase()))||existsSync(join(dir,command+ext))))}const npx=pkg=>({transport:"stdio",command:"npx",args:["-y",pkg]});const needsNpx=()=>onPath("npx")?void 0:"Node.js npx is not on PATH; install Node.js 20+ to start this connector.";export const stripe={source:"stripe",label:"Stripe",group:"Connector / \u6536\u6B3E",server:{transport:"http",url:"https://mcp.stripe.com"},auth:{kind:"mcp-oauth",loopbackPort:8751,reviewed:{issuer:"https://access.stripe.com/mcp",scopes:["mcp"],allowedOrigins:["https://access.stripe.com"]}},origin:{official:true,repo:"stripe/ai",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4)"}};const calendlyClientId=process.env.ZORTEX_CALENDLY_CLIENT_ID?.trim();export const calendly={source:"calendly",label:"Calendly",group:"Connector / \u65E5\u7A0B",server:{transport:"http",url:"https://mcp.calendly.com"},auth:{kind:"mcp-oauth",loopbackPort:8752,reviewed:{issuer:"https://calendly.com/",scopes:["mcp:scheduling:read","mcp:scheduling:write"],allowedOrigins:["https://calendly.com","https://zortex-calendly-auth.pages.dev","https://zortex-auth-9sl.pages.dev"],redirectUriPolicy:"https-only",registration:calendlyClientId?{kind:"redirect-broker",clientId:calendlyClientId,brokerBase:"https://zortex-auth-9sl.pages.dev",brokerPath:"calendly"}:{kind:"dcr",httpsBroker:"calendly"},identity:{tool:"users-get_current_user",subjectPath:["resource","uri"],labelPath:["resource","email"]}}},origin:{official:true,repo:"developer.calendly.com/calendly-mcp-server",check:"official hosted server; no public repository"}};export const openrouter={source:"openrouter",label:"OpenRouter",group:"Connector / \u6A21\u578B",server:{transport:"http",url:"https://mcp.openrouter.ai/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.openrouter.ai",scopes:[],allowedOrigins:["https://mcp.openrouter.ai","https://openrouter.ai"],identity:{kind:"openrouter-current-key"}}},origin:{official:true,repo:"openrouter.ai/docs/guides/overview/mcp-server",check:"official hosted server; SDK OpenRouterTeam/typescript-sdk \u503C\u5F97\u4E00\u8BD5 (score 5)"}};export const cloudflare={source:"cloudflare",label:"Cloudflare",readOnly:true,group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.cloudflare.com/mcp"},exposedTools:["whoami","docs","search","execute"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.cloudflare.com",scopes:["user:read","account:read","offline_access"],allowedOrigins:["https://mcp.cloudflare.com","https://dash.cloudflare.com"],registration:{kind:"dcr"},identity:{tool:"whoami",subjectPath:["id"],labelPath:["email"]}}},origin:{official:true,repo:"cloudflare/mcp",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4; tests, CI, Apache-2.0, active upstream) at 550e1be82b2227818e6b98fc32a313a59403ae3f; use the vendor-hosted unified server instead of embedding the deprecated specialist servers."}};export const posthog={source:"posthog",label:"PostHog",group:"Connector / \u5206\u6790",server:{transport:"http",url:"https://mcp.posthog.com/mcp"},exposedTools:["user-get","organizations-get","projects-get","dashboards-get-all","insights-list","execute-sql","annotation-create","annotation-retrieve","annotations-list","annotation-delete"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://oauth.posthog.com",scopes:["user:read","organization:read","dashboard:read","insight:read","query:read","annotation:read","annotation:write"],allowedOrigins:["https://oauth.posthog.com","https://us.posthog.com","https://eu.posthog.com"],registration:{kind:"dcr"},identity:{tool:"user-get",subjectPath:["uuid"],labelPath:["email"]}}},origin:{official:true,repo:"PostHog/posthog",check:"official active monorepo with tests and CI reviewed at 531a053f2408a3416536cf942a8378e172308f7e; gh oss-check was unavailable because this host token is invalid, so public upstream source and live OAuth metadata were inspected directly. Use the vendor-hosted MCP."}};export const notionL1={source:"notion-l1",label:"Notion (Actions)",group:"Connector / Documents",server:{transport:"http",url:"https://mcp.notion.com/mcp"},exposedTools:["notion-get-self","notion-get-tool-access","notion-search","notion-fetch","notion-create-pages","notion-update-page","notion-create-comment","notion-get-comments"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.notion.com",scopes:["default"],allowedOrigins:["https://mcp.notion.com"],registration:{kind:"dcr"},identity:{kind:"notion-bot-owner"}}},origin:{official:true,repo:"makenotion/notion-cookbook",check:"official hosted MCP and client-integration documentation reviewed 2026-10-26; gh oss-check was unavailable because this host token is invalid, so the public official repository, current provider documentation and live OAuth metadata were inspected directly. The existing Notion L2 provider remains installed separately."}};export const github={source:"github",label:"GitHub",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://api.githubcopilot.com/mcp/"},auth:{kind:"oauth-device",clientId:"Ov23liDjCBTGEwUJvt8f",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",reviewed:{issuer:"https://github.com",allowedOrigins:["https://github.com"],scopes:["repo","read:org","read:user","user:email","read:packages","write:packages","read:project","project","gist","notifications"],identity:{tool:"get_me",subjectPath:["id"],labelPath:["login"]}}},origin:{official:true,repo:"github/github-mcp-server",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8); official remote endpoint and get_me contract reviewed at current upstream"}};export const gitlab={source:"gitlab",label:"GitLab",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://gitlab.com/api/v4/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://gitlab.com",scopes:["mcp"],allowedOrigins:["https://gitlab.com"],registration:{kind:"dcr",allowUnadvertisedPublicClient:true},identity:{kind:"gitlab-token-info"}}},origin:{official:true,repo:"gitlab-org/gitlab",check:"official hosted MCP; gitlabhq/gitlabhq mirror oss-check \u4E0D\u786E\u5B9A (score 3) and has no usable license signal, so it is not embedded"}};export const jira={source:"jira",label:"Jira",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.atlassian.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://auth.atlassian.com/VCeDsk8ZHncYF1g234fKtc4lNipbBhu3",scopes:["read:me","read:account","offline_access","email","read:jira:agent-interface","write:jira:agent-interface","search:jira:agent-interface","delete:jira:agent-interface","manage:jira:agent-interface"],allowedOrigins:["https://auth.atlassian.com","https://api.atlassian.com"],registration:{kind:"dcr",discardReturnedSecretForPublicClient:true},identity:{kind:"atlassian-current-user-sites"}}},origin:{official:true,repo:"atlassian/atlassian-mcp-server",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 4, Apache-2.0, active upstream); use the vendor-hosted v2 server instead of embedding it"}};export const confluence={source:"confluence",label:"Confluence",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.atlassian.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://auth.atlassian.com/VCeDsk8ZHncYF1g234fKtc4lNipbBhu3",scopes:["read:me","read:account","offline_access","email","read:confluence:agent-interface","write:confluence:agent-interface","search:confluence:agent-interface"],allowedOrigins:["https://auth.atlassian.com","https://api.atlassian.com"],registration:{kind:"dcr",discardReturnedSecretForPublicClient:true},identity:{kind:"atlassian-current-user-sites"}}},origin:{official:true,repo:"atlassian/atlassian-mcp-server",check:"reuses source 027 oss-check: \u503C\u5F97\u4E00\u8BD5 (score 4, Apache-2.0, active upstream); use the vendor-hosted v2 server instead of embedding it"}};export const linear={source:"linear",label:"Linear",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.linear.app/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.linear.app",scopes:["read","write","openid","email"],allowedOrigins:["https://mcp.linear.app","https://linear.app"],registration:{kind:"dcr"},identity:{kind:"linear-openid-teams"}}},origin:{official:true,repo:"linear/linear",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8, MIT, active upstream with tests, CI and releases); use Linear's vendor-hosted MCP rather than embedding the application repository"}};export const asana={source:"asana",label:"Asana",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.asana.com/v2/mcp"},auth:{kind:"mcp-oauth",loopbackPort:8752,reviewed:{issuer:"https://app.asana.com",scopes:[],allowedOrigins:["https://app.asana.com"],registration:{kind:"broker",clientId:"1219875673629405",brokerBase:"https://zortex-auth-9sl.pages.dev",brokerPath:"asana"},identity:{kind:"asana-user-workspaces"}}},origin:{official:true,repo:"Asana/node-asana",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 6, MIT, active upstream); use Asana's vendor-hosted v2 MCP server rather than embedding the REST SDK"}};export const clickup={source:"clickup",label:"ClickUp",group:"Connector / \u534F\u4F5C",server:{transport:"http",url:"https://mcp.clickup.com/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.clickup.com",scopes:["read","write"],allowedOrigins:["https://mcp.clickup.com","https://app.clickup.com"],registration:{kind:"dcr"},identity:{kind:"clickup-current-user-workspaces"}}},origin:{official:true,repo:"clickup/clickup-plugin",check:"oss-check score 2; ten-minute source trial confirmed the official MIT plugin is a thin manifest for the same hosted MCP URL, so Zortex reuses the vendor endpoint rather than embedding untested code"}};export const ticktick={source:"ticktick",label:"TickTick",group:"Connector / Tasks",server:{transport:"http",url:"https://mcp.ticktick.com"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://ticktick.com",scopes:["tasks:read","tasks:write"],allowedOrigins:["https://ticktick.com","https://api.ticktick.com"],registration:{kind:"dcr"},identity:{kind:"ticktick-inbox-self"}}},origin:{official:true,repo:"help.ticktick.com/articles/7438129581631995904",check:"Official hosted MCP documented by help.ticktick.com/articles/7438129581631995904. Real DCR/S256 qualification and 57-tool catalog; readonly Inbox membership returned exactly one self=true username matching consent. Username changes require reauthorization; no immutable numeric user ID is advertised."}};export const todoist={source:"todoist",label:"Todoist",group:"Connector / Tasks",server:{transport:"http",url:"https://ai.todoist.net/mcp"},auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://todoist.com",scopes:["data:read_write"],allowedOrigins:["https://todoist.com","https://app.todoist.com"],registration:{kind:"dcr"},identity:{tool:"user-info",subjectPath:["userId"],labelPath:["email"]}}},origin:{official:true,repo:"Doist/todoist-ai",check:"MIT official hosted MCP; oss-check score 4 with active CI/releases and colocated tests. Live qualification at 4438a5159a3666977550e1488b557bcf1a09b83f verified public DCR, real PKCE grant, 47 tools and readonly user-info; no embedded API key or SDK."}};export const microsoftTodo={source:"microsoft-todo",label:"Microsoft To Do",readOnly:true,group:"Connector / Tasks",server:{transport:"stdio",command:process.execPath,args:[fileURLToPath(new URL("./microsoft-todo-server.js",import.meta.url))],env:(_fields,token)=>({MICROSOFT_TODO_ACCESS_TOKEN:token??""})},auth:{kind:"oauth-device",clientId:"2a0c47ae-6035-459e-a544-f8c2008a9d78",deviceCodeUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/devicecode",tokenUrl:"https://login.microsoftonline.com/common/oauth2/v2.0/token",reviewed:{issuer:"https://login.microsoftonline.com/common/v2.0",scopes:["openid","profile","email","Tasks.Read","User.Read","offline_access"],allowedOrigins:["https://login.microsoftonline.com"],identity:{tool:"get_profile",subjectPath:["id"]}}},origin:{official:true,repo:"microsoftgraph/microsoft-graph-docs-contrib",artifact:"zortex-microsoft-todo@0.1.0",check:"Official Graph API behind a bounded in-package adapter. pnp/cli-microsoft365-mcp-server at 9b6863daef5bb093c70540479092a8c160a657be was rejected after its ten-minute trial because it delegates auth to a separately installed global CLI and exposes arbitrary command execution instead of a bounded To Do surface."}};export const appleNotes={source:"apple-notes",label:"Apple Notes",group:"Connector / Notes",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-notes-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.id==="string"},identity:{tool:"get_identity",subjectPath:["id"],labelPath:["name"]}}},origin:{official:true,repo:"Apple/macOS-Notes-scripting-dictionary",artifact:"zortex-apple-notes@0.1.0",check:"macOS system Notes scripting dictionary; the existing in-repo native adapter has exercised the same JXA boundary on a 2,237-note real store. Local Actions are bounded and do not start the L2 sync connector."},unavailable:()=>process.platform!=="darwin"?"Apple Notes is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Notes bridge."};export const appleReminders={source:"apple-reminders",label:"Apple Reminders",group:"Connector / Tasks",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-reminders-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.id==="string"},identity:{tool:"get_identity",subjectPath:["id"],labelPath:["name"]}}},origin:{official:true,repo:"Apple/macOS-Reminders-scripting-dictionary",artifact:"zortex-apple-reminders@0.1.0",check:"Native macOS Reminders.sdef provides bounded accounts, lists and reminder CRUD. burghr/reminders-mcp and Don-Works/reminders-mcp were considered; the former has one commit and an extra Python service, while the latter is AGPL and requires an separately shipped Swift binary. The in-package bridge keeps the installed artifact self-contained and uses the already-qualified background launchd Apple Events path."},unavailable:()=>process.platform!=="darwin"?"Apple Reminders is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Reminders bridge."};export const appleMusic={source:"apple-music",label:"Apple Music",group:"Connector / \u97F3\u4E50",server:{transport:"stdio",command:"bun",args:[fileURLToPath(new URL("./apple-music-server.js",import.meta.url))]},auth:{kind:"server-login",login:{tool:"get_identity",ready:{tool:"get_identity",done:structured=>typeof structured?.libraryId==="string"},identity:{tool:"get_identity",subjectPath:["libraryId"],labelPath:["libraryName"]}}},origin:{official:true,repo:"Apple/macOS-Music-scripting-dictionary",artifact:"zortex-apple-music@0.1.0",check:"The installed Music.sdef provides stable library and media identifiers, playlist/track reads, native search, playback state and user-playlist CRUD. tomahawk-player/tomahawk was rejected by the repository OSS gate because it has no current tests or release and its last commit was more than six years ago. The self-contained adapter uses the same bounded background launchd Apple Events path as the qualified native connectors."},unavailable:()=>process.platform!=="darwin"?"Apple Music is available only on macOS.":onPath("bun")?void 0:"Bun is required to use the authorized local Music bridge."};export const sentry={source:"sentry",label:"Sentry",group:"Connector / \u5F00\u53D1",server:{transport:"http",url:"https://mcp.sentry.dev/mcp"},exposedTools:["find_organizations","find_projects","update_issue","search_errors","search_logs","search_traces","search_metrics","search_profiles","search_replays","find_dropped_events","analyze_issue_with_seer","search_issues","get_sentry_resource","search_sentry_tools","execute_sentry_tool"],auth:{kind:"mcp-oauth",loopbackPort:0,reviewed:{issuer:"https://mcp.sentry.dev",scopes:["org:read","project:write","team:write","event:write","alerts:write"],allowedOrigins:["https://mcp.sentry.dev","https://sentry.io"],registration:{kind:"dcr"},identity:{kind:"sentry-catalog-whoami"}}},origin:{official:true,repo:"getsentry/toolkit",check:"official remote MCP source and tests reviewed at 3869ac95a3227cc29783939c436252f0cd796aea; oss-check CLI unavailable because GitHub credentials were rejected, so the public repository was inspected directly"}};export const shopify={source:"shopify",label:"Shopify",group:"Connector / \u5E97\u94FA",server:{...npx("mcp-shopify-admin@1.1.0"),env:f=>({SHOPIFY_STORE_DOMAIN:f.store??"",SHOPIFY_CLIENT_ID:f.clientId??"",SHOPIFY_CLIENT_SECRET:f.clientSecret??""})},auth:{kind:"fields",account:f=>String(f.store??"").trim().toLowerCase(),fields:[{key:"store",label:"Store domain (my-store.myshopify.com)"},{key:"clientId",label:"Dev Dashboard app client ID"},{key:"clientSecret",label:"Dev Dashboard app client secret",secret:true}]},origin:{official:false,repo:"A1-x-Tech/mcp-shopify-admin",package:"mcp-shopify-admin@1.1.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 5, tests + CI, 0 stars); GeLi2001/shopify-mcp stale 192 days"},unavailable:needsNpx};export const reddit={source:"reddit",label:"Reddit",group:"Connector / \u793E\u533A",server:{...npx("reddit-mcp-server@1.6.3"),env:f=>({REDDIT_AUTH_MODE:"auto",REDDIT_SAFE_MODE:"standard",...Object.fromEntries(Object.entries({REDDIT_CLIENT_ID:f.clientId,REDDIT_CLIENT_SECRET:f.clientSecret,REDDIT_USERNAME:f.username,REDDIT_PASSWORD:f.password}).filter(([,v])=>v))})},publicTools:["browse_subreddit","get_top_posts"],auth:{kind:"fields",account:f=>"u/"+String(f.username??"").trim(),fields:[{key:"clientId",label:"Reddit app client ID"},{key:"clientSecret",label:"Reddit app client secret",secret:true},{key:"username",label:"Reddit username (for posting)"},{key:"password",label:"Reddit password (for posting)",secret:true}]},origin:{official:false,repo:"jordanburke/reddit-mcp-server",package:"reddit-mcp-server@1.6.3",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 6)"},unavailable:needsNpx};export const spotify={source:"spotify",label:"Spotify",group:"Connector / \u97F3\u4E50",server:{...npx("@xavifabregat/spotify-mcp@0.1.2"),env:f=>({SPOTIFY_CLIENT_ID:f.clientId??""})},auth:{kind:"fields",account:f=>"spotify app "+String(f.clientId??"").slice(0,6),login:{tool:"authenticate"},fields:[{key:"clientId",label:"Spotify app client ID (redirect URI http://127.0.0.1:8888/callback)"}]},origin:{official:false,repo:"XavierFabregat/spotify-mcp",package:"@xavifabregat/spotify-mcp@0.1.2",check:"oss-check \u4E0D\u786E\u5B9A (tests + CI, 1 star); marcelmarais/spotify-mcp-server has no license, varunneal/spotify-mcp stale"},unavailable:needsNpx};export const tiktok={source:"tiktok",label:"TikTok",group:"Connector / \u793E\u533A",exposedTools:["list_accounts","get_profile","list_videos","get_videos","top_videos","search_my_videos","stats_summary"],server:{...npx("@thenavidm/tiktok-mcp-cli@2.0.1"),env:f=>({TIKTOK_CLIENT_KEY:f.clientKey??"",TIKTOK_CLIENT_SECRET:f.clientSecret??"",TIKTOK_REFRESH_TOKEN:f.refreshToken??""})},auth:{kind:"fields",account:f=>"@"+String(f.username??"").trim().replace(/^@/,""),fields:[{key:"username",label:"Authorized TikTok username"},{key:"clientKey",label:"TikTok developer app client key",secret:true},{key:"clientSecret",label:"TikTok developer app client secret",secret:true},{key:"refreshToken",label:"TikTok Login Kit refresh token",secret:true}]},origin:{official:false,repo:"thenavidm/tiktok-mcp-cli",package:"@thenavidm/tiktok-mcp-cli@2.0.1",check:"oss-check real-use signals reviewed; exact npm artifact and source pin 2f32934850642d59868f7e6f9c788f9e6672ec8e passed 51/51 upstream tests, build, and live read-only OAuth/API qualification. Full Actions retains the published 14-tool catalog; actual posting still needs its provider scopes/app approval and upstream confirmation. Direct runtime dependencies retain known zod resource-exhaustion and fast-uri advisories; Zortex bounds Action input to 64 KiB, output to 1 MiB and calls to 120 seconds."},unavailable:needsNpx};export const facebook={enrollmentUnavailable:()=>"Facebook account authorization is not yet configured by Zortex. A platform-owned Meta application, authorization service and verified Page selection are required. Do not enter developer credentials. Existing saved credentials are not proof of verified Facebook access.",source:"facebook",label:"Facebook",group:"Connector / \u793E\u533A",exposedTools:["facebook_whoami","facebook_list_pages","facebook_get_page","facebook_list_posts","facebook_get_post","facebook_create_post","facebook_update_post","facebook_list_scheduled_posts","facebook_delete_post"],adaptInvoke:facebookCompat,adaptSchema:facebookSchema,server:{...npx("@ivanbaev/facebook-mcp@0.7.0"),env:f=>({FB_ACCESS_TOKEN:f.accessToken??"",FB_APP_ID:f.appId??"",FB_APP_SECRET:f.appSecret??"",FB_PAGE_ID:f.pageId??"",FB_CONFIRM_TOKEN:facebookWriteToken,FB_TOOL_PACKAGES:"core,reader,posts",FB_PACKAGES_DENY:"insights,moderation,messages,ads",FB_WRITE_MODE:"apply",FB_MAX_RESULT_CHARS:"25000"})},auth:{kind:"fields",account:f=>"facebook-page:"+String(f.pageId??"").trim(),fields:[{key:"pageId",label:"Authorized Facebook Page ID"},{key:"appId",label:"Meta developer app ID"},{key:"appSecret",label:"Meta developer app secret",secret:true},{key:"accessToken",label:"Long-lived Facebook user access token",secret:true}]},origin:{official:false,repo:"IvanBBaev/facebook-mcp",package:"@ivanbaev/facebook-mcp@0.7.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 5; tests, CI, release, MIT, active upstream) at 2d8f4687470fbdc205346f1ab5927ee9c43a000b. Exact source passed build, lint and 2,626 fixture tests. Its direct zod dependency retains GHSA-mrhx-c7xc-m3w5; Indra bounds Action input to 64 KiB, output to 1 MiB and calls to 120 seconds while this server further caps results at 25,000 characters."},unavailable:needsNpx};export const notebooklm={source:"notebooklm",label:"NotebookLM",group:"Connector / \u7B14\u8BB0",server:{...npx("@roomi-fields/notebooklm-mcp@3.2.0"),env:()=>{const chrome=process.platform==="win32"&&[process.env.PROGRAMFILES,process.env["PROGRAMFILES(X86)"],process.env.LOCALAPPDATA].some(root=>root&&existsSync(join(root,"Google","Chrome","Application","chrome.exe")));return process.env.BROWSER_CHANNEL?{BROWSER_CHANNEL:process.env.BROWSER_CHANNEL}:chrome?{BROWSER_CHANNEL:"chrome"}:{}}},auth:{kind:"server-login",login:{tool:"auth_setup",args:{show_browser:true},ready:{tool:"server_health",done:s=>s?.data?.authenticated===true},handoff:{openingInstructions:"Complete Google sign-in in the NotebookLM browser window.",instructions:()=>"Complete Google sign-in in the NotebookLM browser window."}}},liveRead:{tool:"notebook_list",args:{show_browser:false},records:notebookRecords},origin:{official:false,repo:"roomi-fields/notebooklm-mcp",package:"@roomi-fields/notebooklm-mcp@3.2.0",check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8); PleasePrompto/notebooklm-mcp archived"},unavailable:needsNpx};export const cua={source:"cua",label:"CUA Driver",group:"Connector / \u7535\u8111\u64CD\u4F5C",get server(){return{transport:"stdio",command:cuaCommand(),args:cuaSocket?["mcp","--socket",cuaSocket]:["mcp"]}},auth:{kind:"none"},origin:{official:true,repo:"trycua/cua",artifact:"cua-driver@"+cuaVersion,check:"oss-check \u503C\u5F97\u4E00\u8BD5 (score 8)"},unavailable:()=>{if(cuaCommand()==="cua-driver"&&!onPath("cua-driver"))return cuaSocket?"CUA Driver is unavailable. Run indra setup computer-use to install it.":"cua-driver is not installed; install it from the trycua/cua releases.";if(cuaSocket&&!existsSync(cuaSocket))return"The CUA Driver background service is unavailable. Run indra setup computer-use to start it."}};export const firstBatch=[cua,reddit,notebooklm,calendly,spotify,appleMusic,tiktok,facebook,shopify,stripe,openrouter,github,gitlab,jira,confluence,linear,asana,clickup,todoist,ticktick,microsoftTodo,appleNotes,appleReminders,cloudflare,posthog,notionL1];
@@ -5,6 +5,9 @@
5
5
  "exports": {
6
6
  ".": {
7
7
  "import": "./dist/index.js"
8
+ },
9
+ "./api": {
10
+ "import": "./dist/api/index.js"
8
11
  }
9
12
  },
10
13
  "dependencies": {
@@ -14,7 +17,8 @@
14
17
  "@zortexhq/plugin-telemetry": "0.1.0",
15
18
  "@zortexhq/plugin-vault-sqlite": "0.1.0",
16
19
  "@softeria/ms-365-mcp-server": "0.171.0",
17
- "@abd-enterprises/zendesk-mcp": "0.5.0"
20
+ "@abd-enterprises/zendesk-mcp": "0.5.0",
21
+ "@zortexhq/plugin-connector-computer-files": "0.1.0"
18
22
  },
19
23
  "zortex": {
20
24
  "role": "plugin"
@@ -0,0 +1 @@
1
+ export const FILE_REFERENCE_LIMIT=1e3;const opaque=value=>typeof value==="string"&&/^[a-f0-9]{64}$/.test(value);const instant=value=>typeof value==="string"&&/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.\d{1,3})?Z$/.test(value)&&Number.isFinite(Date.parse(value));const unavailable=errorCode=>({source:"computer-files",state:"unavailable",catalogItems:null,partial:true,sampled:false,limit:FILE_REFERENCE_LIMIT,records:[],errorCode});export async function readFileCatalog(reader,signal){if(signal?.aborted)return unavailable("cancelled");if(!reader)return unavailable("unavailable");try{const result=await reader.graph({limit:FILE_REFERENCE_LIMIT});if(signal?.aborted)return unavailable("cancelled");if(!("ok"in result))return unavailable("unavailable");const value=result.ok;if(value?.source!=="computer-files"||!["ready","scanning","partial","paused","unavailable"].includes(value.state)||!Number.isSafeInteger(value.catalogItems)||value.catalogItems<0||typeof value.partial!=="boolean"||!Array.isArray(value.records))return unavailable("invalid_argument");if(value.state==="paused"||value.state==="unavailable")return{source:"computer-files",state:value.state,catalogItems:null,partial:value.partial,sampled:false,limit:FILE_REFERENCE_LIMIT,records:[]};const records=[],seen=new Set;let partial=value.partial||value.state==="partial"||value.state==="scanning";for(const row of value.records.slice(0,FILE_REFERENCE_LIMIT)){if(!row||!opaque(row.id)||!opaque(row.rootId)||!opaque(row.parentId)||!instant(row.modifiedAt)||!instant(row.observedAt)||seen.has(row.id)){partial=true;continue}seen.add(row.id);records.push({id:row.id,modifiedAt:row.modifiedAt,observedAt:row.observedAt,rootId:row.rootId,parentId:row.parentId})}if(records.length>value.catalogItems)return unavailable("invalid_argument");const sampled=value.records.length>FILE_REFERENCE_LIMIT||value.catalogItems>records.length;return{source:"computer-files",state:value.state,catalogItems:value.catalogItems,partial,sampled,limit:FILE_REFERENCE_LIMIT,records}}catch{return unavailable("unavailable")}}
@@ -0,0 +1 @@
1
+ export function nodeRendererWithFileReferences(source){const change=(from,to,count=1)=>{if(source.split(from).length-1!==count)throw Error("Pinned Galaxy node renderer changed.");source=source.replaceAll(from,to)};change("const N = nodes.length;","const N = nodes.length, currentFile = n => n.reference?.source === 'computer-files';\n const fileReferenceCount = things.reduce((n, t) => n + Number(currentFile(t)), 0);");change("nodes.forEach((n, k) => { const t = Date.parse(n.person ? n.first : n.made);","nodes.forEach((n, k) => { if (currentFile(n)) { born[k] = Infinity; return; } const t = Date.parse(n.person ? n.first : n.made);");change("drawn = { things: things.length, people: people.length, undated: 0 }","drawn = { things: things.length - fileReferenceCount, people: people.length, undated: 0 }");change("if (!dated[k]) {","if (!dated[k] && !currentFile(nodes[k])) {");change("Array.from({ length: N }, (_, k) => k).sort((a, b) => born[a] - born[b]","Array.from({ length: N }, (_, k) => k).filter(k => !currentFile(nodes[k])).sort((a, b) => born[a] - born[b]");change("counts: { things: things.length, made: made.length, kept: kept.length, people: people.length },","counts: { things: things.length - fileReferenceCount, made: made.length, kept: kept.length - fileReferenceCount, people: people.length },\n fileReferences: fileReferenceCount,");change("if (starOf[k] < 0) continue;\n const i = Math.min(bins - 1,","if (starOf[k] < 0 || currentFile(nodes[k])) continue;\n const i = Math.min(bins - 1,");change("for (let k = 0; k < N; k++) {\n const name = nodes[k].app ?","for (let k = 0; k < N; k++) {\n if (currentFile(nodes[k])) continue;\n const name = nodes[k].app ?");change("stream.i >= N","stream.i >= stream.order.length",2);change("stream.i + n < N","stream.i + n < stream.order.length");change("stream.i < N","stream.i < stream.order.length",2);return source}export function controllerWithFileReferences(source){const caption="`${count(nodes.counts.things + nodes.counts.people)} things and people, from your vault`";if(!source.includes(caption))throw Error("Pinned Galaxy caption changed.");return source.replace(caption,"nodesData?.fileReferences ? `${count(nodes.counts.things + nodes.counts.people)} activity nodes and ${count(nodesData.fileReferences.drawn)} current file references` : "+caption).replace(" $('modes-foot').textContent"," if (nodesData?.fileReferences) $('world-note').textContent = 'Current files appear as references. File links show shared folder membership. Files are excluded from activity history, and their positions are layout only.';\n $('modes-foot').textContent")}