openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
5 lines • 1.45 kB
JavaScript
import"./session-key-BPgKfU2m.mjs";import{t as DEFAULT_ACCOUNT_ID}from"./account-id-3yqrEsRn.mjs";import"./setup-contract-OX3vOUb4.mjs";import{t as formatDocsLink}from"./links-C_FK9uVv.mjs";import"./setup-CylWArcc.mjs";
//!src/plugin-sdk/optional-channel-setup.ts
function buildOptionalChannelSetupMessage(e){const t=e.npmSpec??`the ${e.label} plugin`;const n=[`${e.label} setup requires ${t} to be installed.`];if(e.docsPath)n.push(`Docs: ${formatDocsLink(e.docsPath,e.docsPath.replace(/^\/+/u,``))}`);return n.join(` `)}function createOptionalChannelSetupAdapter(e){const t=buildOptionalChannelSetupMessage(e);return{resolveAccountId:({accountId:e})=>e??`default`,applyAccountConfig:()=>{throw new Error(t)},validateInput:()=>t}}function createOptionalChannelSetupWizard(e){const t=buildOptionalChannelSetupMessage(e);return{channel:e.channel,status:{configuredLabel:`${e.label} plugin installed`,unconfiguredLabel:`install ${e.label} plugin`,configuredHint:t,unconfiguredHint:t,unconfiguredScore:0,resolveConfigured:()=>false,resolveStatusLines:()=>[t],resolveSelectionHint:()=>t},credentials:[],finalize:async()=>{throw new Error(t)}}}
//!src/plugin-sdk/channel-setup.ts
function createOptionalChannelSetupSurface(e){return{setupAdapter:createOptionalChannelSetupAdapter(e),setupWizard:createOptionalChannelSetupWizard(e)}}export{createOptionalChannelSetupAdapter as n,createOptionalChannelSetupWizard as r,createOptionalChannelSetupSurface as t};