@ycodium-ai/plugin-im 0.2.3608 → 0.2.3635
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/ui.js +3 -8
- package/dist/index.js +35 -63
- package/locales/en.json +13 -24
- package/locales/zh-CN.json +13 -24
- package/package.json +3 -3
package/assets/ui.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var Gn=window.__ycodiumPluginHost.react;var{Activity:st,Children:dt,Component:ct,Fragment:Me,Profiler:mt,PureComponent:ut,StrictMode:gt,Suspense:yt,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ft,__COMPILER_RUNTIME:pt,act:bt,cache:vt,cacheSignal:St,captureOwnerStack:wt,cloneElement:ht,createContext:te,createElement:Re,createRef:It,forwardRef:xt,isValidElement:Ct,lazy:kt,memo:Nt,startTransition:Rt,unstable_useCacheRefresh:Tt,use:ie,useActionState:_t,useCallback:Pt,useContext:Et,useDebugValue:At,useDeferredValue:Bt,useEffect:Ve,useEffectEvent:Ot,useId:Ke,useImperativeHandle:Lt,useInsertionEffect:Mt,useLayoutEffect:Vt,useMemo:B,useOptimistic:Kt,useReducer:Ft,useRef:L,useState:I,useSyncExternalStore:Dt,useTransition:$t,version:Ut}=Gn;var M=(e,n)=>{let t=e[n];return typeof t=="string"?t.trim():""};var R="/developers/v1",zt={uploadImage:`${R}/app/upload/image`,createFromTemplate:`${R}/manifest/upsert_by_template`,createBare:`${R}/app/create`,listApps:`${R}/app/list`,robotSwitch:e=>`${R}/robot/switch/${e}`,eventSwitch:e=>`${R}/event/switch/${e}`,eventRead:e=>`${R}/event/${e}`,eventUpdate:e=>`${R}/event/update/${e}`,callbackSwitch:e=>`${R}/callback/switch/${e}`,callbackRead:e=>`${R}/callback/${e}`,callbackUpdate:e=>`${R}/callback/update/${e}`,scopeCatalog:e=>`${R}/scope/all/${e}`,scopeUpdate:e=>`${R}/scope/update/${e}`,safeSetting:e=>`${R}/safe_setting/update/${e}`,visibleOnline:e=>`${R}/visible/online/${e}`,versionList:e=>`${R}/app_version/list/${e}`,versionCreate:e=>`${R}/app_version/create/${e}`,publishCommit:(e,n)=>`${R}/publish/commit/${e}/${n}`,secret:e=>`${R}/secret/${e}`};var Qt=10*6e4;var Fe=9e4;var De="settings.view",$e="settings.connections",Ue="settings.saveBot",Ge="settings.removeBot",He="settings.saveGeneral",ze="settings.saveTarget",Qe="settings.removeTarget",We="larkSetup.session",je="wecomSetup.session",$={labelKey:"setup.action.label",descriptionKey:"setup.action.description",badgeKey:"setup.action.badge",warningKey:"setup.action.warning"},qe={checkConnection:"im.settings.checkConnection",reconnect:"im.settings.reconnect",resetInbox:"im.settings.resetInbox",copyDiagnostics:"im.settings.copyDiagnostics",larkRepair:"im.settings.larkRepair",larkCallbackProbe:"im.settings.larkCallbackProbe"},Ye=e=>e==="telegram"?["rowAction.resetInbox.telegramOffline"]:[],Je=[{id:"checkConnection",labelKey:"rowAction.checkConnection.label",descriptionKey:"rowAction.checkConnection.description"},{id:"reconnect",labelKey:"rowAction.reconnect.label",descriptionKey:"rowAction.reconnect.description"},{id:"resetInbox",labelKey:"rowAction.resetInbox.label",descriptionKey:"rowAction.resetInbox.description"},{id:"copyDiagnostics",labelKey:"rowAction.copyDiagnostics.label",descriptionKey:"rowAction.copyDiagnostics.description"},{id:"larkRepair",labelKey:"rowAction.larkRepair.label",descriptionKey:"rowAction.larkRepair.description",platform:"lark"},{id:"larkCallbackProbe",labelKey:"rowAction.larkCallbackProbe.label",descriptionKey:"rowAction.larkCallbackProbe.description",descriptionParams:{seconds:Fe/1e3},platform:"lark"}],Hn="lark",oe=[{value:"zh-CN",labelKey:"settings.language.zhCN"},{value:"en",labelKey:"settings.language.en"}],zn="botId",U=e=>M(e,"platform")||Hn,Ze=(e,n)=>{let t=e.showWhen;if(t===void 0)return!0;let o=t.key==="platform"?U(n):M(n,t.key);return t.equals.includes(o)},Xe=(e,n,t)=>e.map(o=>o.key===zn?{...o,kind:"select",options:n.map(r=>({value:r.rowId,label:`${M(r.values,"displayName")||t(r.platform)} (${r.rowId})`}))}:o),en=(e,n)=>{switch(n.kind){case"qr":{let{expired:t,...o}=e,r=n.expiresAt===void 0?{payload:n.payload}:{payload:n.payload,expiresAt:n.expiresAt};return{...o,qr:r}}case"status":{let t=n.params===void 0?{statusKey:n.statusKey}:{statusKey:n.statusKey,params:n.params};if(n.expired!==!0)return{...e,status:t};let{qr:o,...r}=e;return{...r,status:t,expired:!0}}case"steps":return{...e,steps:n.steps};case"done":case"failed":{let{status:t,...o}=e;return{...o,result:n}}}},Te=e=>e==="inboxUnreadable"?"settingsSection.connection.reason.inbox-unreadable":e==="notAvailable"?"settingsSection.connection.reason.not-available":`rowAction.checkConnection.hint.${e}`,J=e=>e.reason==="not-available"||e.hint==="notAvailable",ae=e=>e?.state==="failed"&&(e.reason==="inbox-unreadable"||e.hint==="inboxUnreadable"),nn=e=>e.hint==="wecomBotCredentials"||e.hint==="unauthorized"||e.hint==="larkCredentials"||e.hint==="wecomLongConnOff"||e.hint==="wecomTakenOver",K=e=>e.state==="duplicate"||J(e)||e.hint==="connecting"||e.hint==="wecomCallbackNotSeen"?"warning":"error";var tn=e=>{if(!e||typeof e!="object"||Array.isArray(e)||!("code"in e)||typeof e.code!="string"||!e.code.trim()||!("reason"in e)||typeof e.reason!="string"||!e.reason.trim()||!("message"in e)||typeof e.message!="string"||!e.message.trim()||!("referenceId"in e)||typeof e.referenceId!="string"||!e.referenceId.trim()||!("at"in e)||typeof e.at!="number"||!Number.isFinite(e.at))return null;let n="messageKey"in e?e.messageKey:void 0;if(n!==void 0&&(typeof n!="string"||!n.trim()))return null;let t="messageParams"in e?e.messageParams:void 0,o;if(t!==void 0){if(!t||typeof t!="object"||Array.isArray(t)||!("detail"in t)||typeof t.detail!="string")return null;o={detail:t.detail.slice(0,500)}}return{code:e.code.slice(0,64),reason:e.reason.slice(0,64),message:e.message.slice(0,500),...n!==void 0?{messageKey:n.slice(0,128)}:{},...o===void 0?{}:{messageParams:o},referenceId:e.referenceId.slice(0,40),at:e.at}},on=e=>!e||typeof e!="object"||Array.isArray(e)?tn(e):tn(Object.fromEntries(Object.entries(e).map(([n,t])=>[n,typeof t=="string"?t.trim():t])));var an=(e,n)=>{let t=e.filter(o=>o.configured);return{configured:t.length,connected:t.filter(o=>n?.[o.rowId]?.state==="connected").length}},rn=e=>{if(e.error!==null||e.isUnavailable||typeof e.data!="object"||e.data===null||Array.isArray(e.data))return null;let n=e.data;return Object.values(n).some(t=>"lastMessageError"in t||"statusSince"in t)?Object.fromEntries(Object.entries(n).map(([t,o])=>{let{lastMessageError:r,statusSince:a,...l}=o,d=on(r);return[t,{...l,...typeof a=="number"&&Number.isSafeInteger(a)&&a>=0&&a<=864e13?{statusSince:a}:{},...d===null?{}:{lastMessageError:d}}]})):n},_e=e=>e===null||!e.configured?{key:"settingsSection.status.incomplete",tone:"attention"}:{key:"settingsSection.status.ready",tone:"success"},re=(e,n)=>{if(e===null||!e.configured)return _e(e);let t=n?.[e.rowId];switch(t?.state){case"connecting":return{key:"settingsSection.status.connecting",tone:"working"};case"connected":return{key:"settingsSection.status.connected",tone:"success"};case"failed":case"duplicate":return{key:"settingsSection.status.notConnected",tone:K(t)};default:return{key:"settingsSection.status.ready",tone:"neutral"}}},ln=(e,n,t,o)=>{if(e===null||!e.configured)return null;let r=n?.[e.rowId];return r?.state==="failed"?ae(r)?{text:o(Te("inboxUnreadable")),variant:K(r)}:{text:[o(r.reason===void 0?"settingsSection.connection.failed":`settingsSection.connection.reason.${r.reason}`),r.hint===void 0?null:o(Te(r.hint)),J(r)||nn(r)?null:o("settingsSection.connection.reconnect"),r.error===void 0?null:o("settingsSection.connection.details",{error:r.error})].filter(l=>l!==null).join(" "),variant:K(r)}:r?.state==="duplicate"?{text:o("settingsSection.connection.duplicate",{name:t??r.duplicateOf??""}),variant:K(r)}:null};var{jsx:i,jsxs:s,Fragment:k}=window.__ycodiumPluginHost.jsxRuntime;function le(e){let n=e.bridge.useFormatTimestamp();if(e.since===void 0)return null;let t=new Date(e.since).toISOString();return i("time",{className:"im-small im-muted",dateTime:t,children:e.t("settingsSection.connection.since",{time:n(t)})})}var sn=te(null);function dn(e){return i(sn,{value:e.bridge,children:e.children})}var Qn=new Set(["Collapsible","CollapsiblePanel","CollapsibleTrigger"]);function N(e){let n=t=>{let a=ie(sn)?.ui?.[e];return a===void 0?Qn.has(e)?Re("div",{className:t.className},t.children):null:Re(a,t)};return n.displayName=e,n}var p=N("Button"),G=N("Input"),H=N("Label"),cn=N("Switch"),se=N("Select"),de=N("SelectTrigger"),Z=N("SelectValue"),ce=N("SelectPopup"),X=N("SelectItem"),z=N("StatusPill"),mn=N("EmptyInline"),Q=N("Alert"),un=N("AlertAction"),W=N("AlertDescription"),gn=N("Collapsible"),yn=N("CollapsibleTrigger"),fn=N("CollapsiblePanel"),F=N("Spinner"),pn=N("QRCodeSvg"),bn=N("ProxyChoiceSelect");var vn=(e,n)=>{if(e.kind==="done")return{headline:e.messageKey===void 0?n("settingsSection.action.done"):n(e.messageKey),tone:e.tone??"done",link:e.link===void 0?void 0:{url:e.link.url,label:n(e.link.labelKey)},note:void 0,headlineTone:e.tone??"done",details:(e.warnings??[]).map(d=>n(d.key,d.params))};let t=e.params?.ref,o=t===void 0?e.detail:n("rowAction.diagnostic.ref",{ref:t,detail:e.detail??""}).trimEnd(),r=e.params?.hint?.toString(),a=e.noteKey===void 0?void 0:n(e.noteKey),l=K({hint:r})==="warning"?"caution":"issue";return{headline:n(e.reasonKey,e.params),link:void 0,note:a,tone:l,headlineTone:a===void 0?l:"neutral",details:[...o===void 0?[]:[o],...(e.warnings??[]).map(d=>n(d.key,d.params))]}};var Sn=(e,n,t,o)=>{let r=o?.state==="failed"&&J(o),a=ae(o);return{actions:Je.filter(l=>(l.platform===void 0||l.platform===e)&&(l.id!=="resetInbox"||a)).map(l=>({...l,descriptionKeys:[l.descriptionKey,...l.id==="resetInbox"?Ye(e):[]],disabled:n||t||l.id==="reconnect"&&r})),noteKey:n?"settingsSection.action.saveFirst":r?"rowAction.reconnect.notAvailable":null}},me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),wn=e=>me(e)&&Array.isArray(e.bots)&&Array.isArray(e.targets)&&me(e.delivery),hn=e=>me(e)&&wn(e.view)&&Array.isArray(e.columns)&&Array.isArray(e.targetColumns)&&Array.isArray(e.proxies)?e:null,ee=async(e,n,t,o)=>{try{let r=await e.commands.invoke(n,t,o);return me(r)&&r.ok===!0&&wn(r.view)?r.view:null}catch{return null}},In=(e,n)=>n.isPending?e.phase==="asked"?{...e,phase:"refetching"}:e:n.view!==null&&!n.failed?e.phase==="refetching"||JSON.stringify(n.view)===JSON.stringify(e.view)?null:e:e.phase==="asked"?e:{...e,phase:"asked"},O=e=>e==null||e.length===0?{}:{environmentId:e},j=(e,n)=>n===null?e:`${e}:${n}`,Pe=e=>JSON.stringify([e.replyLanguage,e.delivery]);function q(e,n,t){if(n!==void 0&&n.length>0)return e(n);if(t!==void 0&&t.length>0)return t}function xn(e,n){return n.length===0?null:n.map(t=>e(t==="required"?"settingsSection.issue.required":"settingsSection.issue.format")).join(" ")}function D(e,n,t){return`im-${(e??"here").replace(/[^A-Za-z0-9_-]/g,"")}-${n}-${t}`}function ne(e,n,t){let o=[n?`${e}-issue`:null,t?`${e}-hint`:null].filter(r=>r!==null);return o.length===0?void 0:o.join(" ")}function V(e){return s("div",{className:e.span===!0?"im-field im-span":"im-field",children:[i(H,{htmlFor:e.id,children:e.label}),e.children,e.issue?i("p",{id:`${e.id}-issue`,className:"im-small im-issue",role:"alert",children:e.issue}):null,e.description===void 0?null:i("p",{id:`${e.id}-hint`,className:"im-hint im-small im-muted",children:e.description})]})}function ue(e){let n=e.stored&&e.value===""&&!e.clearing?e.savedPlaceholder:e.placeholder;return s("div",{className:"im-secret",children:[i(G,{id:e.id,type:"password",value:e.value,placeholder:n,disabled:e.disabled,autoComplete:"new-password","aria-invalid":e.invalid?!0:void 0,"aria-describedby":e.describedBy,onChange:t=>e.onChange(t.target.value)}),e.stored?i(p,{variant:"ghost",size:"sm","aria-pressed":e.clearing,disabled:e.disabled,onClick:e.onToggleClear,children:e.clearing?e.undoLabel:e.clearLabel}):null]})}function ge(e){let n=e.saving||e.busy===!0;return!e.dirty&&!e.saving&&!e.failed?null:s("div",{className:"im-span",children:[e.dirty||e.saving?s("div",{className:"im-actions",children:[s(p,{variant:e.solid?"default":"outline",disabled:n||!e.dirty,onClick:e.onSave,children:[e.saving?i(F,{}):null,e.saveLabel]}),e.dirty&&!n?i(p,{variant:"ghost",size:"sm",onClick:e.onRevert,children:e.revertLabel}):null]}):null,e.failed?i("p",{className:"im-small im-issue",role:"alert",children:e.failedLabel}):null]})}async function ye(e,n,t){try{await e.writeClipboard(n),e.notify(t("settingsSection.copied"),"success")}catch{e.notify(t("settingsSection.copyFailed"),"warning")}}var Wn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function fe(e){let n=B(()=>O(e.environmentId),[e.environmentId]),t=e.bridge.commands.useSubscription(e.command,e.payload,n),o=B(()=>Wn(t.data)?e.items==="snapshots"?t.data:en({},t.data):{},[t.data,e.items]),r=o.result,a=L(null),l=e.onSettled;Ve(()=>{r===void 0||a.current===t.data||(a.current=t.data,l?.(r))},[r,t.data,l]);let d=e.t,c=r===void 0&&t.error===null&&!t.isUnavailable;return s("div",{className:"im-flow im-span",children:[t.isUnavailable||t.error!==null?i(Q,{variant:"error",layout:"inline",children:i(W,{children:d("settingsSection.action.failedToRun")})}):null,o.qr===void 0?null:i("div",{className:"im-qr",children:i(pn,{value:o.qr.payload,size:176,marginSize:2,title:d("settingsSection.action.qrTitle")})}),o.status===void 0?null:s("p",{className:"im-flow-status im-medium",children:[c?i(F,{size:"sm"}):null,i("span",{children:d(o.status.statusKey,o.status.params)})]}),c&&o.status===void 0&&o.qr===void 0?s("p",{className:"im-flow-status im-medium",children:[i(F,{size:"sm"}),i("span",{children:d("settingsSection.action.running")})]}):null,o.steps===void 0?null:i("ul",{className:"im-steps im-small",children:o.steps.map(b=>s("li",{"data-state":b.state,children:[i("span",{children:d(b.labelKey)}),i("span",{className:"im-muted",children:d(`settingsSection.step.${b.state}`)})]},b.id))}),r===void 0?null:i(jn,{result:r,bridge:e.bridge,t:d}),s("div",{className:"im-actions",children:[r?.kind==="failed"||o.expired===!0||t.error!==null?i(p,{variant:"ghost",size:"sm",onClick:t.refresh,children:d("settingsSection.retry")}):null,i(p,{variant:"ghost",size:"sm",onClick:e.onClose,children:d(r===void 0?"settingsSection.cancel":"settingsSection.action.close")})]})]})}var Cn=e=>e==="issue"?"im-issue":e==="caution"?"im-caution":"";function jn(e){let{headline:n,headlineTone:t,tone:o,note:r,link:a,details:l}=vn(e.result,e.t),d=e.t;return s("div",{className:"im-result",children:[s("div",{className:"im-result-verdict",role:"status",children:[i("p",{className:`im-medium im-result-headline ${Cn(t)}`.trimEnd(),children:n}),r===void 0?null:i("p",{className:`im-small im-result-note ${Cn(o)}`.trimEnd(),children:r})]}),a===void 0?null:i("div",{className:"im-actions",children:i(p,{className:"im-link",variant:"link",size:"sm",onClick:()=>e.bridge.openExternal(a.url),children:a.label})}),l.length===0?null:s(k,{children:[i("pre",{className:"im-detail im-small",children:l.join(`
|
|
1
|
+
var Hn=window.__ycodiumPluginHost.react;var{Activity:st,Children:dt,Component:ct,Fragment:Me,Profiler:mt,PureComponent:ut,StrictMode:gt,Suspense:yt,__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE:ft,__COMPILER_RUNTIME:pt,act:bt,cache:vt,cacheSignal:St,captureOwnerStack:wt,cloneElement:ht,createContext:te,createElement:Re,createRef:It,forwardRef:xt,isValidElement:Ct,lazy:kt,memo:Nt,startTransition:Rt,unstable_useCacheRefresh:Tt,use:ie,useActionState:_t,useCallback:Pt,useContext:Et,useDebugValue:At,useDeferredValue:Bt,useEffect:Ve,useEffectEvent:Ot,useId:Ke,useImperativeHandle:Lt,useInsertionEffect:Mt,useLayoutEffect:Vt,useMemo:B,useOptimistic:Kt,useReducer:Ft,useRef:L,useState:x,useSyncExternalStore:Dt,useTransition:Ut,version:$t}=Hn;var M=(e,n)=>{let t=e[n];return typeof t=="string"?t.trim():""};var N="/developers/v1",zt={uploadImage:`${N}/app/upload/image`,createFromTemplate:`${N}/manifest/upsert_by_template`,createBare:`${N}/app/create`,listApps:`${N}/app/list`,robotSwitch:e=>`${N}/robot/switch/${e}`,eventSwitch:e=>`${N}/event/switch/${e}`,eventRead:e=>`${N}/event/${e}`,eventUpdate:e=>`${N}/event/update/${e}`,callbackSwitch:e=>`${N}/callback/switch/${e}`,callbackRead:e=>`${N}/callback/${e}`,callbackUpdate:e=>`${N}/callback/update/${e}`,scopeCatalog:e=>`${N}/scope/all/${e}`,scopeUpdate:e=>`${N}/scope/update/${e}`,safeSetting:e=>`${N}/safe_setting/update/${e}`,visibleOnline:e=>`${N}/visible/online/${e}`,versionList:e=>`${N}/app_version/list/${e}`,versionCreate:e=>`${N}/app_version/create/${e}`,publishCommit:(e,n)=>`${N}/publish/commit/${e}/${n}`,secret:e=>`${N}/secret/${e}`};var Qt=10*6e4;var Fe=9e4;var De="settings.view",Ue="settings.connections",$e="settings.saveBot",He="settings.removeBot",Ge="settings.saveGeneral",ze="settings.saveTarget",Qe="settings.removeTarget",We="larkSetup.session",je="wecomSetup.session",Y={labelKey:"setup.action.label",descriptionKey:"setup.action.description",badgeKey:"setup.action.badge",warningKey:"setup.action.warning"},qe={checkConnection:"im.settings.checkConnection",reconnect:"im.settings.reconnect",resetInbox:"im.settings.resetInbox",copyDiagnostics:"im.settings.copyDiagnostics",larkRepair:"im.settings.larkRepair",larkCallbackProbe:"im.settings.larkCallbackProbe"},Ye=e=>e==="telegram"?["rowAction.resetInbox.telegramOffline"]:[],Je=[{id:"checkConnection",labelKey:"rowAction.checkConnection.label",descriptionKey:"rowAction.checkConnection.description"},{id:"reconnect",labelKey:"rowAction.reconnect.label"},{id:"resetInbox",labelKey:"rowAction.resetInbox.label",descriptionKey:"rowAction.resetInbox.description"},{id:"copyDiagnostics",labelKey:"rowAction.copyDiagnostics.label"},{id:"larkRepair",labelKey:"rowAction.larkRepair.label",platform:"lark"},{id:"larkCallbackProbe",labelKey:"rowAction.larkCallbackProbe.label",descriptionKey:"rowAction.larkCallbackProbe.description",descriptionParams:{seconds:Fe/1e3},platform:"lark"}],Gn="lark",oe=[{value:"zh-CN",labelKey:"settings.language.zhCN"},{value:"en",labelKey:"settings.language.en"}],zn="botId",U=e=>M(e,"platform")||Gn,Ze=(e,n)=>{let t=e.showWhen;if(t===void 0)return!0;let o=t.key==="platform"?U(n):M(n,t.key);return t.equals.includes(o)},Xe=(e,n,t)=>e.map(o=>o.key===zn?{...o,kind:"select",options:n.map(r=>({value:r.rowId,label:`${M(r.values,"displayName")||t(r.platform)} (${r.rowId})`}))}:o),en=(e,n)=>{switch(n.kind){case"qr":{let{expired:t,...o}=e,r=n.expiresAt===void 0?{payload:n.payload}:{payload:n.payload,expiresAt:n.expiresAt};return{...o,qr:r}}case"status":{let t=n.params===void 0?{statusKey:n.statusKey}:{statusKey:n.statusKey,params:n.params};if(n.expired!==!0)return{...e,status:t};let{qr:o,...r}=e;return{...r,status:t,expired:!0}}case"steps":return{...e,steps:n.steps};case"done":case"failed":{let{status:t,...o}=e;return{...o,result:n}}}},Te=e=>e==="inboxUnreadable"?"settingsSection.connection.reason.inbox-unreadable":e==="notAvailable"?"settingsSection.connection.reason.not-available":`rowAction.checkConnection.hint.${e}`,J=e=>e.reason==="not-available"||e.hint==="notAvailable",ae=e=>e?.state==="failed"&&(e.reason==="inbox-unreadable"||e.hint==="inboxUnreadable"),nn=e=>e.hint==="wecomBotCredentials"||e.hint==="unauthorized"||e.hint==="larkCredentials"||e.hint==="wecomLongConnOff"||e.hint==="wecomTakenOver",K=e=>e.state==="duplicate"||J(e)||e.hint==="connecting"||e.hint==="wecomCallbackNotSeen"?"warning":"error";var tn=e=>{if(!e||typeof e!="object"||Array.isArray(e)||!("code"in e)||typeof e.code!="string"||!e.code.trim()||!("reason"in e)||typeof e.reason!="string"||!e.reason.trim()||!("message"in e)||typeof e.message!="string"||!e.message.trim()||!("referenceId"in e)||typeof e.referenceId!="string"||!e.referenceId.trim()||!("at"in e)||typeof e.at!="number"||!Number.isFinite(e.at))return null;let n="messageKey"in e?e.messageKey:void 0;if(n!==void 0&&(typeof n!="string"||!n.trim()))return null;let t="messageParams"in e?e.messageParams:void 0,o;if(t!==void 0){if(!t||typeof t!="object"||Array.isArray(t)||!("detail"in t)||typeof t.detail!="string")return null;o={detail:t.detail.slice(0,500)}}return{code:e.code.slice(0,64),reason:e.reason.slice(0,64),message:e.message.slice(0,500),...n!==void 0?{messageKey:n.slice(0,128)}:{},...o===void 0?{}:{messageParams:o},referenceId:e.referenceId.slice(0,40),at:e.at}},on=e=>!e||typeof e!="object"||Array.isArray(e)?tn(e):tn(Object.fromEntries(Object.entries(e).map(([n,t])=>[n,typeof t=="string"?t.trim():t])));var an=(e,n)=>{let t=e.filter(o=>o.configured);return{configured:t.length,connected:t.filter(o=>n?.[o.rowId]?.state==="connected").length}},rn=e=>{if(e.error!==null||e.isUnavailable||typeof e.data!="object"||e.data===null||Array.isArray(e.data))return null;let n=e.data;return Object.values(n).some(t=>"lastMessageError"in t||"statusSince"in t)?Object.fromEntries(Object.entries(n).map(([t,o])=>{let{lastMessageError:r,statusSince:a,...l}=o,d=on(r);return[t,{...l,...typeof a=="number"&&Number.isSafeInteger(a)&&a>=0&&a<=864e13?{statusSince:a}:{},...d===null?{}:{lastMessageError:d}}]})):n},_e=e=>e===null||!e.configured?{key:"settingsSection.status.incomplete",tone:"attention"}:{key:"settingsSection.status.ready",tone:"success"},re=(e,n)=>{if(e===null||!e.configured)return _e(e);let t=n?.[e.rowId];switch(t?.state){case"connecting":return{key:"settingsSection.status.connecting",tone:"working"};case"connected":return{key:"settingsSection.status.connected",tone:"success"};case"failed":case"duplicate":return{key:"settingsSection.status.notConnected",tone:K(t)};default:return{key:"settingsSection.status.ready",tone:"neutral"}}},ln=(e,n,t,o)=>{if(e===null||!e.configured)return null;let r=n?.[e.rowId];return r?.state==="failed"?ae(r)?{text:o(Te("inboxUnreadable")),variant:K(r)}:{text:[o(r.reason===void 0?"settingsSection.connection.failed":`settingsSection.connection.reason.${r.reason}`),r.hint===void 0?null:o(Te(r.hint)),J(r)||nn(r)?null:o("settingsSection.connection.reconnect"),r.error===void 0?null:o("settingsSection.connection.details",{error:r.error})].filter(l=>l!==null).join(" "),variant:K(r)}:r?.state==="duplicate"?{text:o("settingsSection.connection.duplicate",{name:t??r.duplicateOf??""}),variant:K(r)}:null};var{jsx:i,jsxs:s,Fragment:C}=window.__ycodiumPluginHost.jsxRuntime;function le(e){let n=e.bridge.useFormatTimestamp();if(e.since===void 0)return null;let t=new Date(e.since).toISOString();return i("time",{className:"im-small im-muted",dateTime:t,children:e.t("settingsSection.connection.since",{time:n(t)})})}var sn=te(null);function dn(e){return i(sn,{value:e.bridge,children:e.children})}var Qn=new Set(["Collapsible","CollapsiblePanel","CollapsibleTrigger"]);function k(e){let n=t=>{let a=ie(sn)?.ui?.[e];return a===void 0?Qn.has(e)?Re("div",{className:t.className},t.children):null:Re(a,t)};return n.displayName=e,n}var p=k("Button"),$=k("Input"),H=k("Label"),cn=k("Switch"),se=k("Select"),de=k("SelectTrigger"),Z=k("SelectValue"),ce=k("SelectPopup"),X=k("SelectItem"),G=k("StatusPill"),mn=k("EmptyInline"),z=k("Alert"),un=k("AlertAction"),Q=k("AlertDescription"),gn=k("Collapsible"),yn=k("CollapsibleTrigger"),fn=k("CollapsiblePanel"),F=k("Spinner"),pn=k("QRCodeSvg"),bn=k("ProxyChoiceSelect");var vn=(e,n)=>{if(e.kind==="done")return{headline:e.messageKey===void 0?n("settingsSection.action.done"):n(e.messageKey),tone:e.tone??"done",link:e.link===void 0?void 0:{url:e.link.url,label:n(e.link.labelKey)},note:void 0,headlineTone:e.tone??"done",details:(e.warnings??[]).map(d=>n(d.key,d.params))};let t=e.params?.ref,o=t===void 0?e.detail:n("rowAction.diagnostic.ref",{ref:t,detail:e.detail??""}).trimEnd(),r=e.params?.hint?.toString(),a=e.noteKey===void 0?void 0:n(e.noteKey),l=K({hint:r})==="warning"?"caution":"issue";return{headline:n(e.reasonKey,e.params),link:void 0,note:a,tone:l,headlineTone:a===void 0?l:"neutral",details:[...o===void 0?[]:[o],...(e.warnings??[]).map(d=>n(d.key,d.params))]}};var Sn=(e,n,t,o)=>{let r=o?.state==="failed"&&J(o),a=ae(o);return{actions:Je.filter(l=>(l.platform===void 0||l.platform===e)&&(l.id!=="resetInbox"||a)).map(l=>({...l,descriptionKeys:[...l.descriptionKey===void 0?[]:[l.descriptionKey],...l.id==="resetInbox"?Ye(e):[]],disabled:n||t||l.id==="reconnect"&&r})),noteKey:n?"settingsSection.action.saveFirst":r?"rowAction.reconnect.notAvailable":null}},me=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),wn=e=>me(e)&&Array.isArray(e.bots)&&Array.isArray(e.targets)&&me(e.delivery),hn=e=>me(e)&&wn(e.view)&&Array.isArray(e.columns)&&Array.isArray(e.targetColumns)&&Array.isArray(e.proxies)?e:null,ee=async(e,n,t,o)=>{try{let r=await e.commands.invoke(n,t,o);return me(r)&&r.ok===!0&&wn(r.view)?r.view:null}catch{return null}},In=(e,n)=>n.isPending?e.phase==="asked"?{...e,phase:"refetching"}:e:n.view!==null&&!n.failed?e.phase==="refetching"||JSON.stringify(n.view)===JSON.stringify(e.view)?null:e:e.phase==="asked"?e:{...e,phase:"asked"},O=e=>e==null||e.length===0?{}:{environmentId:e},W=(e,n)=>n===null?e:`${e}:${n}`,Pe=e=>JSON.stringify([e.replyLanguage,e.delivery]);function j(e,n,t){if(n!==void 0&&n.length>0)return e(n);if(t!==void 0&&t.length>0)return t}function xn(e,n){return n.length===0?null:n.map(t=>e(t==="required"?"settingsSection.issue.required":"settingsSection.issue.format")).join(" ")}function D(e,n,t){return`im-${(e??"here").replace(/[^A-Za-z0-9_-]/g,"")}-${n}-${t}`}function ne(e,n,t){let o=[n?`${e}-issue`:null,t?`${e}-hint`:null].filter(r=>r!==null);return o.length===0?void 0:o.join(" ")}function V(e){return s("div",{className:e.span===!0?"im-field im-span":"im-field",children:[i(H,{htmlFor:e.id,children:e.label}),e.children,e.issue?i("p",{id:`${e.id}-issue`,className:"im-small im-issue",role:"alert",children:e.issue}):null,e.description===void 0?null:i("p",{id:`${e.id}-hint`,className:"im-hint im-small im-muted",children:e.description})]})}function ue(e){let n=e.stored&&e.value===""&&!e.clearing?e.savedPlaceholder:e.placeholder;return s("div",{className:"im-secret",children:[i($,{id:e.id,type:"password",value:e.value,placeholder:n,disabled:e.disabled,autoComplete:"new-password","aria-invalid":e.invalid?!0:void 0,"aria-describedby":e.describedBy,onChange:t=>e.onChange(t.target.value)}),e.stored?i(p,{variant:"ghost",size:"sm","aria-pressed":e.clearing,disabled:e.disabled,onClick:e.onToggleClear,children:e.clearing?e.undoLabel:e.clearLabel}):null]})}function ge(e){let n=e.saving||e.busy===!0;return!e.dirty&&!e.saving&&!e.failed?null:s("div",{className:"im-span",children:[e.dirty||e.saving?s("div",{className:"im-actions",children:[s(p,{variant:e.solid?"default":"outline",disabled:n||!e.dirty,onClick:e.onSave,children:[e.saving?i(F,{}):null,e.saveLabel]}),e.dirty&&!n?i(p,{variant:"ghost",size:"sm",onClick:e.onRevert,children:e.revertLabel}):null]}):null,e.failed?i("p",{className:"im-small im-issue",role:"alert",children:e.failedLabel}):null]})}async function ye(e,n,t){try{await e.writeClipboard(n),e.notify(t("settingsSection.copied"),"success")}catch{e.notify(t("settingsSection.copyFailed"),"warning")}}var Wn=e=>typeof e=="object"&&e!==null&&!Array.isArray(e);function fe(e){let n=B(()=>O(e.environmentId),[e.environmentId]),t=e.bridge.commands.useSubscription(e.command,e.payload,n),o=B(()=>Wn(t.data)?e.items==="snapshots"?t.data:en({},t.data):{},[t.data,e.items]),r=o.result,a=L(null),l=e.onSettled;Ve(()=>{r===void 0||a.current===t.data||(a.current=t.data,l?.(r))},[r,t.data,l]);let d=e.t,c=r===void 0&&t.error===null&&!t.isUnavailable;return s("div",{className:"im-flow im-span",children:[t.isUnavailable||t.error!==null?i(z,{variant:"error",layout:"inline",children:i(Q,{children:d("settingsSection.action.failedToRun")})}):null,o.qr===void 0?null:i("div",{className:"im-qr",children:i(pn,{value:o.qr.payload,size:176,marginSize:2,title:d("settingsSection.action.qrTitle")})}),o.status===void 0?null:s("p",{className:"im-flow-status im-medium",children:[c?i(F,{size:"sm"}):null,i("span",{children:d(o.status.statusKey,o.status.params)})]}),c&&o.status===void 0&&o.qr===void 0?s("p",{className:"im-flow-status im-medium",children:[i(F,{size:"sm"}),i("span",{children:d("settingsSection.action.running")})]}):null,o.steps===void 0?null:i("ul",{className:"im-steps im-small",children:o.steps.map(b=>s("li",{"data-state":b.state,children:[i("span",{children:d(b.labelKey)}),i("span",{className:"im-muted",children:d(`settingsSection.step.${b.state}`)})]},b.id))}),r===void 0?null:i(jn,{result:r,bridge:e.bridge,t:d}),s("div",{className:"im-actions",children:[r?.kind==="failed"||o.expired===!0||t.error!==null?i(p,{variant:"ghost",size:"sm",onClick:t.refresh,children:d("settingsSection.retry")}):null,i(p,{variant:"ghost",size:"sm",onClick:e.onClose,children:d(r===void 0?"settingsSection.cancel":"settingsSection.action.close")})]})]})}var Cn=e=>e==="issue"?"im-issue":e==="caution"?"im-caution":"";function jn(e){let{headline:n,headlineTone:t,tone:o,note:r,link:a,details:l}=vn(e.result,e.t),d=e.t;return s("div",{className:"im-result",children:[s("div",{className:"im-result-verdict",role:"status",children:[i("p",{className:`im-medium im-result-headline ${Cn(t)}`.trimEnd(),children:n}),r===void 0?null:i("p",{className:`im-small im-result-note ${Cn(o)}`.trimEnd(),children:r})]}),a===void 0?null:i("div",{className:"im-actions",children:i(p,{className:"im-link",variant:"link",size:"sm",onClick:()=>e.bridge.openExternal(a.url),children:a.label})}),l.length===0?null:s(C,{children:[i("pre",{className:"im-detail im-small",children:l.join(`
|
|
2
2
|
|
|
3
3
|
`)}),i("div",{className:"im-actions",children:i(p,{variant:"ghost",size:"sm",onClick:()=>{ye(e.bridge,l.join(`
|
|
4
4
|
|
|
5
|
-
`),d)},children:d("settingsSection.copy")})})]})]})}function Y(e){let n=(()=>{switch(e.platform){case"lark":return s(k,{children:[i("path",{fill:"#00D6B9",d:"M7.2 4.5h7.6c1.2 0 2.1.55 2.7 1.58 1.05 1.8 1.55 3.45 1.58 4.95-2.04-.62-4.2-.15-6.22 1.45C11.3 9.7 9.42 7.04 7.2 4.5Z"}),i("path",{fill:"#1456B8",d:"M10.8 13.55c3.3-2.93 5.72-4.24 9.47-2.52-1.2 1.45-2.27 4.18-3.86 5.43-1.67 1.31-3.9.5-5.61-.64v-2.27Z"}),i("path",{fill:"#3370FF",d:"M4.4 8.35c3.47 3.61 7.25 6.1 10.33 5.7 1.06-.14 2.2-.72 3.4-1.72-1.04 2.65-2.6 4.8-5.06 6-2.46 1.2-5.56.52-7.42-.72A2.76 2.76 0 0 1 4.4 15.3V8.35Z"})]});case"wecom":case"wecom-app":return s(k,{children:[i("path",{fill:"none",stroke:"#3370FF",strokeWidth:"2.35",strokeLinecap:"round",strokeLinejoin:"round",d:"M17.7 14.5c1.05-1.12 1.65-2.52 1.65-4.03 0-3.82-3.58-6.92-8-6.92s-8 3.1-8 6.92 3.58 6.92 8 6.92c1.17 0 2.28-.22 3.28-.62"}),i("path",{fill:"#07C160",d:"M16.1 15.15c.7-.7 1.83-.7 2.53 0s.7 1.83 0 2.53-1.83.7-2.53 0-.7-1.83 0-2.53Z"}),i("path",{fill:"#FFB800",d:"M19.25 13.45a1.36 1.36 0 1 1 1.92 1.92 1.36 1.36 0 0 1-1.92-1.92Z"}),i("path",{fill:"#FF7A00",d:"M19.55 18.05a1.16 1.16 0 1 1 1.64 1.64 1.16 1.16 0 0 1-1.64-1.64Z"}),i("path",{fill:"#3370FF",d:"M15.25 18.75a.92.92 0 1 1 1.3 1.3.92.92 0 0 1-1.3-1.3Z"})]});case"telegram":return i("path",{fill:"#229ED9",d:"M23.95 4.57c-.36-1.45-1.43-1.76-2.82-1.24L1.5 10.9c-1.34.52-1.32 1.27-.24 1.6l5.03 1.57 11.66-7.36c.55-.34 1.05-.16.64.21l-9.44 8.52-.37 5.12c.54 0 .78-.24 1.08-.53l2.59-2.51 5.38 3.97c.99.55 1.7.27 1.95-.92L23.95 4.57Z"});case"wechat":return i("path",{fill:"#07C160",d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"});default:return null}})();return n===null?null:i("span",{className:`im-platform im-platform-${e.platform}`,"aria-hidden":"true",children:i("svg",{width:20,height:20,viewBox:"0 0 24 24",focusable:"false",children:n})})}function qn(e){return e.length>12?`${e.slice(0,8)}\u2022\u2022\u2022\u2022${e.slice(-4)}`:"cli_\u2022\u2022\u2022\u2022"}function kn(e){return e.length<=10?`${e.slice(0,3)}\u2022\u2022\u2022`:`${e.slice(0,6)}\u2022\u2022\u2022\u2022${e.slice(-4)}`}var Yn={lark:{column:"larkAppId",mask:qn},wecom:{column:"wecomBotId",mask:kn},"wecom-app":{column:"wecomAppCorpId",mask:kn}};function pe(e,n){let t=Yn[e];if(t===void 0)return null;let o=M(n,t.column);return o===""?null:t.mask(o)}function Ee(e){let n=e.className===void 0?"im-collapse":`im-collapse ${e.className}`;return e.staticHead===!0?s("div",{className:n,children:[s("div",{className:"im-head",children:[s("div",{className:"im-toggle im-static",children:[e.icon,i("span",{className:"im-title im-medium",children:e.title}),e.meta]}),e.actions]}),e.notice,i("div",{className:"im-panel",children:e.children})]}):s(gn,{className:n,...e.defaultOpen===void 0?{}:{defaultOpen:e.defaultOpen},...e.open===void 0?{}:{open:e.open},...e.onOpenChange===void 0?{}:{onOpenChange:e.onOpenChange},children:[s("div",{className:"im-head",children:[s(yn,{className:"im-toggle",children:[i("span",{className:"im-chevron","aria-hidden":"true"}),e.icon,i("span",{className:"im-title im-medium",children:e.title}),e.meta]}),e.actions]}),e.notice,i(fn,{children:i("div",{className:"im-panel",children:e.children})})]})}function be(e){return i("section",{className:e.className===void 0?"im-block":`im-block ${e.className}`,children:i(Ee,{...e})})}var Jn=new Set(["accessMode","allowedSenders","runtimeMode"]),Zn=new Set(["groupMention","queueMode","approvalTimeoutMinutes","larkPanelMode","larkTopicOnMention","wecomNumberedHints"]);function Nn(e){return Jn.has(e.key)?"access":Zn.has(e.key)?"chat":e.group==="essential"||e.key==="defaultModel"||e.key==="defaultPreset"?"basic":"advanced"}var ve=(e,n)=>e!=="wechat"||n;var Ae="\0empty";function Rn(e){let n=e.columns.filter(f=>Ze(f,e.values)&&(e.section===void 0||Nn(f)===e.section)),t=e.section!==void 0?n:e.groupBotSettings?n.filter(f=>f.group==="essential"):n,o=e.section!==void 0?[]:e.groupBotSettings?n.filter(f=>f.group!=="essential"):[],r=e.issues.filter(f=>o.some(w=>w.key===f.column)),a=JSON.stringify(r),[l,d]=I(()=>({open:r.length>0,issues:a})),c=l.open||l.issues!==a&&r.length>0;l.issues!==a&&d({open:c,issues:a});let b=f=>i(Xn,{column:f,scope:e.scope,environmentId:e.environmentId,proxies:e.proxies,values:e.values,savedValues:e.savedValues,secrets:e.secrets,clearSecrets:e.clearSecrets,storedSecrets:e.storedSecrets,issues:e.issues,disabled:e.disabled,t:e.t,onValue:e.onValue,onSecret:e.onSecret,onToggleClear:e.onToggleClear},f.key);return s(k,{children:[t.map(b),(e.section===void 0||e.section==="basic"?e.publicFields:[]).map(f=>i(nt,{field:f,scope:e.scope,environmentId:e.environmentId,bridge:e.bridge,t:e.t},f.key)),o.length===0?null:i(Ee,{className:"im-span",title:r.length>0?e.t("settingsSection.moreSettingsIssues",{count:r.length}):e.t("settingsSection.moreSettings"),open:c,onOpenChange:f=>d({open:f,issues:a}),children:i("div",{className:"im-form",children:o.map(b)})})]})}function Xn(e){let n=e.column,t=D(e.environmentId,e.scope,n.key),o=q(e.t,n.labelKey,n.label)??n.key,r=q(e.t,n.descriptionKey,n.description),a=q(e.t,n.placeholderKey,n.placeholder),l=xn(e.t,e.issues.filter(c=>c.column===n.key).map(c=>c.code)),d=ne(t,l!==null,r!==void 0);return n.kind==="password"?i(V,{id:t,label:o,description:r,issue:l,children:i(ue,{id:t,value:e.secrets[n.key]??"",stored:e.storedSecrets[n.key]===!0,clearing:e.clearSecrets.includes(n.key),disabled:e.disabled,invalid:l!==null,describedBy:d,placeholder:a,savedPlaceholder:e.t("settingsSection.secret.saved"),clearLabel:e.t("settingsSection.secret.clear"),undoLabel:e.t("settingsSection.secret.clearUndo"),onChange:c=>{c!==(e.secrets[n.key]??"")&&e.onSecret(n.key,c)},onToggleClear:()=>e.onToggleClear(n.key)})}):n.kind==="select"?i(et,{column:n,id:t,label:o,description:r,issue:l,described:d,values:e.values,savedValues:e.savedValues,disabled:e.disabled,t:e.t,onValue:e.onValue}):n.kind==="proxy"?i("div",{className:"im-field",children:i(bn,{id:t,label:o,hint:e.values.platform==="lark"?e.t("column.proxy.larkHint"):r,value:e.values[n.key]??"",proxies:e.proxies,disabled:e.disabled,onChange:c=>{c!==(e.values[n.key]??"")&&e.onValue(n.key,c)},children:l===null?null:i("p",{id:`${t}-issue`,className:"im-small im-issue",role:"alert",children:l})})}):i(V,{id:t,label:o,description:r,issue:l,children:i(G,{id:t,type:n.kind==="number"?"number":"text",min:n.min,max:n.max,step:n.kind==="number"?1:void 0,value:e.values[n.key]??n.defaultValue??"",placeholder:a,disabled:e.disabled,"aria-invalid":l!==null?!0:void 0,"aria-describedby":d,onChange:c=>{let b=c.target.value;b!==(e.values[n.key]??"")&&e.onValue(n.key,b)}})})}function et(e){let n=e.values[e.column.key]??"",t=e.savedValues[e.column.key]??"",o=(e.column.options??[]).filter(c=>e.column.key!=="platform"||ve(c.value,e.savedValues.platform===c.value)),r=o.some(c=>c.value===""),a=o.find(c=>c.value===n),l=c=>e.column.unavailableLabelKey===void 0?c:e.t(e.column.unavailableLabelKey,{value:c}),d=n===""&&a===void 0?void 0:a===void 0?l(n):q(e.t,a.labelKey,a.label)??a.value;return i(V,{id:e.id,label:e.label,description:e.description,issue:e.issue,children:s(se,{className:"im-wide",value:n===""?r?Ae:null:n,disabled:e.disabled,onValueChange:c=>{let b=r&&c===Ae?"":c??"";b!==n&&e.onValue(e.column.key,b)},children:[i(de,{id:e.id,"aria-invalid":e.issue!==null?!0:void 0,"aria-describedby":e.described,children:d===void 0?i(Z,{placeholder:e.t("settingsSection.select.default")}):i(Z,{children:d})}),s(ce,{children:[e.column.listsUnknownValue===!0&&t!==""&&!o.some(c=>c.value===t)?i(X,{value:t,disabled:e.column.unavailableLabelKey!==void 0,children:l(t)}):null,o.map(c=>i(X,{value:c.value===""?Ae:c.value,children:q(e.t,c.labelKey,c.label)??c.value},c.value))]})]})})}function nt(e){let n=D(e.environmentId,`${e.scope}-pub`,e.field.key);return s("div",{className:"im-field im-span",children:[i(H,{children:e.t(`settingsSection.publicField.${e.field.key}`)}),e.field.value===""?null:s("div",{className:"im-inline im-public-row",children:[i("span",{id:n,className:"im-public-value im-small",children:tt(e.field.value)}),e.field.copyable?i(p,{variant:"ghost",size:"sm",onClick:()=>{ye(e.bridge,e.field.value,e.t)},children:e.t("settingsSection.copy")}):null]}),e.field.hint===void 0?null:i("p",{className:"im-small im-muted",children:e.t(`settingsSection.publicFieldHint.${e.field.hint}`)})]})}function tt(e){let n=0;return e.split(/(?<=\/)(?!\/)/).map(t=>{let o=n;return n+=t.length,s(Me,{children:[o===0?null:i("wbr",{}),t]},o)})}var Tn=["basic","access","chat","advanced","danger"];function _n(e){let n=Ke(),t=e.showDanger?Tn:Tn.slice(0,-1),o=a=>{e.onChange(a),document.getElementById(`${n}-${a}`)?.focus()},r=(a,l)=>{let d=a.key==="Home"?0:a.key==="End"?t.length-1:a.key==="ArrowLeft"?(l-1+t.length)%t.length:a.key==="ArrowRight"?(l+1)%t.length:null;d!==null&&(a.preventDefault(),o(t[d]))};return i("div",{className:"im-detail-tabs",role:"tablist","aria-label":e.t("settingsSection.detailTabs"),children:t.map((a,l)=>i(p,{id:`${n}-${a}`,type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":e.value===a,tabIndex:e.value===a?0:-1,className:"im-detail-tab",onClick:()=>e.onChange(a),onKeyDown:d=>r(d,l),children:e.t(`settingsSection.tab.${a}`)},a))})}function Pn(e){let n={};for(let[a,l]of Object.entries(e.values))(e.baseline[a]??"")!==l&&(n[a]=l);let t={};for(let[a,l]of Object.entries(e.secrets))l!==""&&(t[a]=l);let o=[];for(let a of e.clearSecrets)Object.hasOwn(t,a)||o.includes(a)||o.push(a);return e.rowId===void 0||Object.keys(n).length>0||Object.keys(t).length>0||o.length>0?{changed:!0,edit:{...e.rowId===void 0?{}:{rowId:e.rowId},values:n,...Object.keys(t).length>0?{secrets:t}:{},...o.length>0?{clearSecrets:o}:{}}}:{changed:!1}}function it(e){let n=e.trim();if(!/^\d+$/.test(n))return null;let t=Number(n);return!Number.isInteger(t)||t<1||t>65535?null:t}function En(e){let n={};e.replyLanguage!==e.baseline.replyLanguage&&(n.replyLanguage=e.replyLanguage),e.enabled!==e.baseline.enabled&&(n.deliveryHttpEnabled=e.enabled);let t=!1;if(e.enabled){let o=it(e.port);o===null?t=!0:o!==e.baseline.port&&(n.deliveryHttpPort=o),e.token!==""?n.deliveryHttpToken=e.token:e.clearToken&&e.baseline.hasToken&&(n.clearDeliveryHttpToken=!0)}return t?{changed:!0,invalidPort:!0}:Object.keys(n).length===0?{changed:!1}:{changed:!0,invalidPort:!1,payload:n}}var An=te({activeId:null,activate:()=>{}});function Bn(e){return i(An,{value:{activeId:e.activeId,activate:e.activate},children:e.children})}function Se(e){let n=ie(An);return{chosen:n.activeId===e,activate:()=>n.activate(e)}}function we(e,n){let t=L(!1);return{cancelProps:{autoFocus:!0,"aria-describedby":e,onClick:()=>{t.current=!0,n()}},confirmProps:{"aria-describedby":e},triggerRef:o=>{o===null||!t.current||(t.current=!1,o.focus())}}}function he(e,n,t={}){return{signature:n,values:{...t,...e?.values},secrets:{},clearSecrets:[],saving:!1,failed:!1,confirming:!1,removing:!1,removeFailed:!1}}function Be(e){let{kind:n,row:t}=e,o=t===null?`${n.newSlot}:${JSON.stringify(e.initialValues??{})}`:JSON.stringify(t),r=Se(j(n.newSlot,t?.rowId??null)),a=L(0),[l,d]=I(()=>he(t,o,e.initialValues)),[c,b]=I("basic"),f=t!==null&&n.removeHintKey!==void 0?`im-remove-consequence-${n.newSlot}-${t.rowId}`:void 0,w=we(f,()=>d(m=>({...m,confirming:!1})));l.signature!==o&&(a.current+=1,d(he(t,o,e.initialValues)));let h=Pn({...t===null?{}:{rowId:t.rowId},baseline:t?.values??{},values:l.values,secrets:l.secrets,clearSecrets:l.clearSecrets}),v=h.changed,x=t===null||!t.configured,u=e.status??_e(t),C=e.notice??null,y=l.saving||l.removing;function T(m){r.activate(),d(g=>({...m(g),failed:!1}))}function P(){if(!h.changed||y)return;r.activate();let m=h.edit,g=++a.current;d(S=>({...S,saving:!0,failed:!1})),ee(e.bridge,n.saveCommand,m,O(e.environmentId)).then(S=>{if(a.current!==g)return;if(S===null){d(Ne=>({...Ne,saving:!1,failed:!0}));return}let A=t===null?void 0:n.rows(S).find(Ne=>Ne.rowId===t.rowId);A!==void 0&&d(he(A,JSON.stringify(A))),e.onSaved(S)})}function E(){if(t===null){e.onDiscard();return}let m=t.rowId,g=++a.current;d(S=>({...S,removing:!0,removeFailed:!1})),ee(e.bridge,n.removeCommand,{rowId:m},O(e.environmentId)).then(S=>{if(a.current===g){if(S===null){d(A=>({...A,removing:!1,removeFailed:!0,confirming:!0}));return}e.onSaved(S)}})}let _=l.confirming?s("div",{className:"im-actions",children:[i(p,{type:"button",variant:"ghost",size:"sm",disabled:y,...w.cancelProps,children:e.t("settingsSection.cancel")}),i(p,{type:"button",variant:"destructive",size:"sm",disabled:y,...w.confirmProps,onClick:E,children:e.t(n.removeConfirmKey)})]}):i(p,{type:"button",variant:e.detail===!0?"destructive":"ghost",size:"sm",disabled:y,ref:w.triggerRef,onClick:()=>d(m=>({...m,confirming:!0,removeFailed:!1})),children:e.t("settingsSection.remove")});return s(be,{title:e.title(l.values),icon:e.icon?.(l.values),defaultOpen:x,staticHead:e.detail===!0,...e.detail===!0?{className:"im-detail"}:{},meta:s(k,{children:[e.meta?.(l.values),s("span",{className:"im-status",children:[e.statusMeta,i(z,{tone:u.tone,children:e.t(u.key)})]})]}),actions:e.detail===!0?null:_,notice:s(k,{children:[e.summary,e.detail===!0?null:s(k,{children:[l.confirming&&t!==null&&n.removeHintKey!==void 0?i("p",{id:f,children:e.t(n.removeHintKey)}):null,l.removeFailed?i("p",{className:"im-small im-issue",role:"alert",children:e.t(n.removeFailedKey)}):null]})]}),children:[C===null?null:i(Q,{variant:C.variant,children:i(W,{children:C.text})}),e.detail===!0?i(_n,{value:c,showDanger:t!==null,onChange:m=>{m!=="danger"&&l.confirming&&d(g=>({...g,confirming:!1})),b(m),e.onSectionChange?.(m)},t:e.t}):null,e.detail===!0&&c==="danger"?s("div",{className:"im-danger-zone",children:[i("p",{className:"im-small im-muted",children:e.t("settingsSection.dangerDescription")}),l.confirming&&t!==null&&n.removeHintKey!==void 0?i("p",{id:f,children:e.t(n.removeHintKey)}):null,l.removeFailed?i("p",{className:"im-small im-issue",role:"alert",children:e.t(n.removeFailedKey)}):null,_,e.extra?.({dirty:v,frozen:y,section:c})]}):null,s("div",{className:"im-form",children:[e.detail===!0&&c==="danger"?null:i(Rn,{scope:`${n.newSlot}-${t?.rowId??"new"}`,environmentId:e.environmentId,columns:e.columns,groupBotSettings:n.groupBotSettings===!0,...e.detail===!0?{section:c}:{},proxies:e.proxies,values:l.values,savedValues:t?.values??{},secrets:l.secrets,clearSecrets:l.clearSecrets,storedSecrets:t?.secrets??{},issues:t?.issues??[],publicFields:t?.publicFields??[],disabled:y,bridge:e.bridge,t:e.t,onValue:(m,g)=>T(S=>({...S,values:{...S.values,[m]:g}})),onSecret:(m,g)=>T(S=>({...S,secrets:{...S.secrets,[m]:g}})),onToggleClear:m=>T(g=>({...g,clearSecrets:g.clearSecrets.includes(m)?g.clearSecrets.filter(S=>S!==m):[...g.clearSecrets,m]}))}),e.detail===!0&&c!=="advanced"?null:e.extra?.({dirty:v,frozen:y,...e.detail===!0?{section:c}:{}}),i(ge,{dirty:v,saving:l.saving,busy:l.removing,solid:r.chosen&&v,failed:l.failed,saveLabel:e.t("settingsSection.save"),revertLabel:e.t("settingsSection.revert"),failedLabel:e.t("settingsSection.saveFailed"),onSave:P,onRevert:()=>{a.current+=1,d(he(t,o,e.initialValues))}})]})]})}function On(e){let n=e.bridge.useFormatTimestamp(),{error:t,t:o}=e;if(t===void 0)return null;let r=new Date(t.at),a=Number.isFinite(r.getTime())?r.toISOString():null;return s("div",{className:"im-small",role:"status",children:[s("p",{children:[i("strong",{className:"im-issue",children:o("settingsSection.lastMessageError.title")}),o("settingsSection.lastMessageError.separator"),i("span",{children:t.messageKey===void 0?t.message:o(t.messageKey,{...t.messageParams,defaultValue:t.message})})]}),s("p",{className:"im-muted",children:[o("settingsSection.lastMessageError.code",{code:t.code}),", ",o("settingsSection.lastMessageError.reference",{referenceId:t.referenceId}),a===null?null:s(k,{children:[", ",i("time",{dateTime:a,children:n(a)})]})]})]})}var xe={groupBotSettings:!0,newSlot:"im-new-row",saveCommand:Ue,removeCommand:Ge,rows:e=>e.bots,removeConfirmKey:"settingsSection.removeConfirm",removeHintKey:"settingsSection.removeHint",removeFailedKey:"settingsSection.removeFailed"},Ce={newSlot:"im-new-target",saveCommand:ze,removeCommand:Qe,rows:e=>e.targets,removeConfirmKey:"settingsSection.target.removeConfirm",removeFailedKey:"settingsSection.target.removeFailed"},Ie=(e,n,t)=>{let o=(e.displayName??"").trim();return o.length>0?o:t(`platform.${n}`)};function Ln(e){let{bot:n,t}=e,o=e.bots.find(w=>w.rowId===(n===null?void 0:e.connections?.[n.rowId]?.duplicateOf)),r=ln(n,e.connections,o===void 0?void 0:Ie(o.values,o.platform,t),t),[a,l]=I(null),[d,c]=I(!1),b=n===null?void 0:`im-reset-consequence-${n.rowId}`,f=we(b,()=>c(!1));return i(Be,{...e,kind:xe,row:n,onSectionChange:w=>{l(null),w!=="danger"&&c(!1)},status:re(n,e.connections),statusMeta:n?.configured&&e.connections?.[n.rowId]?.statusSince!==void 0?i(le,{since:e.connections[n.rowId]?.statusSince,bridge:e.bridge,t}):null,notice:r,summary:n===null?null:i(On,{error:e.connections?.[n.rowId]?.lastMessageError,bridge:e.bridge,t}),title:w=>Ie(w,U(w),t),icon:w=>{let h=M(w,"platform");return h===""?null:i(Y,{platform:h})},meta:w=>{let h=U(w),v=pe(h,w),x=t(`platform.${h}`);return i("span",{className:"im-small im-muted",...v===null?{}:{title:v},children:v===null?x:`${x}, ${v}`})},extra:({dirty:w,frozen:h,section:v})=>{if(n===null)return null;let x=Sn(n.platform,w,h,e.connections?.[n.rowId]),u=x.actions.find(y=>y.id==="resetInbox"),C=x.actions.filter(y=>v===void 0||v==="danger"==(y.id==="resetInbox"));return s(k,{children:[s("div",{className:"im-span",children:[d&&u!==void 0?s(k,{children:[i("p",{id:b,children:u.descriptionKeys.map(y=>t(y)).join(" ")}),s("div",{className:"im-actions",children:[i(p,{type:"button",variant:"ghost",size:"sm",disabled:h,...f.cancelProps,children:t("settingsSection.cancel")}),i(p,{type:"button",variant:"destructive",size:"sm",disabled:u.disabled,...f.confirmProps,onClick:()=>{c(!1),l({id:"resetInbox",payload:{rowId:n.rowId}})},children:t("rowAction.resetInbox.confirm")})]})]}):i("div",{className:"im-actions",children:C.map(y=>i(p,{type:"button",variant:"ghost",size:"sm",disabled:y.disabled,title:y.descriptionKeys.map(T=>t(T,y.descriptionParams)).join(" "),ref:y.id==="resetInbox"?f.triggerRef:void 0,onClick:()=>{y.id==="resetInbox"?c(!0):l({id:y.id,payload:{rowId:n.rowId}})},children:t(y.labelKey)},y.id))}),v==="danger"||x.noteKey===null?null:i("p",{className:"im-small im-muted",children:t(x.noteKey)})]}),a===null?null:i(fe,{bridge:e.bridge,command:qe[a.id],payload:a.payload,items:"latest",environmentId:e.environmentId,t,onClose:()=>l(null)},a.id)]})}})}function Oe(e){let{t:n}=e;return i(Be,{...e,kind:Ce,row:e.target,title:t=>{let o=(t.name??"").trim()||(t.targetId??"").trim();return o.length>0?o:n("settingsSection.target.untitled")}})}function Mn(e){let{bot:n,t}=e,o=re(n,e.connections),r=U(n.values),a=pe(r,n.values);return s(p,{type:"button",variant:"outline",className:"im-bot-summary",onClick:e.onOpen,children:[s("span",{className:"im-bot-summary-identity",children:[i(Y,{platform:r}),s("span",{className:"im-bot-summary-copy",children:[i("strong",{children:Ie(n.values,n.platform,t)}),i("span",{className:"im-small im-muted",...a===null?{}:{title:a},children:a===null?t(`platform.${r}`):`${t(`platform.${r}`)}, ${a}`})]})]}),s("span",{className:"im-status",children:[n.configured&&e.connections?.[n.rowId]?.statusSince!==void 0?i(le,{since:e.connections[n.rowId]?.statusSince,bridge:e.bridge,t}):null,i(z,{tone:o.tone,children:t(o.key)})]}),i("span",{className:"im-summary-chevron","aria-hidden":"true"})]})}var ot={};function Vn(e){let{view:n,snapshot:t,t:o}=e,r=B(()=>{let g=(t.columns.find(S=>S.key==="platform")?.options?.map(S=>S.value)??[]).filter(S=>ve(S,n.bots.some(A=>A.platform===S)));for(let S of n.bots)g.includes(S.platform)||g.push(S.platform);return g.length===0?["lark"]:g},[t.columns,n.bots]),[a,l]=I(null),[d,c]=I(null),[b,f]=I(!1),[w,h]=I(null),v=a!==null&&r.includes(a)?a:n.bots[0]?.platform??r[0]??"lark",x=n.bots.filter(m=>m.platform===v),u=d===null?void 0:x.find(m=>m.rowId===d),C=b||u!==void 0,y=o(`platform.${v}`),T=w==="lark"?{command:We,descriptionKey:$.descriptionKey}:w==="wecom"?{command:je,descriptionKey:"wecomSetup.action.description"}:null,P=()=>{c(null),f(!1)},E=v==="wechat"?null:s("div",{className:"im-actions",children:[i(p,{variant:"outline",disabled:w!==null,onClick:()=>{f(!0),c(null),e.activate(j(xe.newSlot,null))},children:o("settingsSection.addBot")}),v==="lark"?s(p,{variant:x.length===0?"default":"outline",disabled:w!==null,onClick:()=>h("lark"),children:[o($.labelKey),i("span",{className:x.length===0?"im-badge im-badge-on-primary im-small":"im-badge im-small",children:o($.badgeKey)})]}):null,v==="wecom"?s(p,{variant:"outline",disabled:w!==null,onClick:()=>h("wecom"),children:[o("wecomSetup.action.label"),i("span",{className:"im-badge im-small",children:o($.badgeKey)})]}):null]}),_=v==="lark"?i("p",{className:"im-small im-muted",children:o($.warningKey)}):null;return s("div",{className:"im-workspace",children:[i("div",{className:"im-rail",role:"tablist","aria-label":o("settingsSection.channelPicker"),children:r.map(m=>{let g=n.bots.filter(S=>S.platform===m).length;return s(p,{type:"button",variant:"ghost",role:"tab","aria-selected":m===v,className:"im-channel",onClick:()=>{l(m),P(),h(null)},children:[i(Y,{platform:m}),i("span",{className:"im-channel-label",children:o(`platform.${m}`)}),g===0?null:i("span",{className:"im-channel-count",children:g})]},m)})}),i("div",{className:"im-main",children:C?s(k,{children:[i(p,{type:"button",variant:"ghost",size:"sm",className:"im-back",onClick:P,children:o("settingsSection.backToBots")}),i(Ln,{bot:b?null:u??null,bots:n.bots,connections:e.connections,columns:t.columns,proxies:t.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,detail:!0,...b?{initialValues:{platform:v}}:{},onSaved:m=>{if(b){let g=m.bots.find(S=>!n.bots.some(A=>A.rowId===S.rowId));g!==void 0&&l(g.platform),f(!1)}e.onSaved(m)},onDiscard:P},b?xe.newSlot:u?.rowId)]}):s(k,{children:[s("div",{className:"im-main-head",children:[i("h3",{className:"im-heading im-medium",children:y}),x.length===0?null:i("span",{className:"im-small im-muted",children:o("settingsSection.botCount",{count:x.length})})]}),v==="wechat"?i("p",{className:"im-small im-muted",children:o("settingsSection.wechatUnavailable")}):null,x.length===0?s("div",{className:"im-empty",children:[i(mn,{title:o("settingsSection.platformEmpty",{platform:y}),description:o("settingsSection.platformEmptyGuide")}),E,_]}):s(k,{children:[i("div",{className:"im-bot-list",children:x.map(m=>i(Mn,{bot:m,connections:e.connections,bridge:e.bridge,t:o,onOpen:()=>{c(m.rowId),h(null)}},m.rowId))}),E,_]}),T===null?null:s("section",{className:"im-block",children:[i("p",{className:"im-small im-muted",children:o(T.descriptionKey)}),i(fe,{bridge:e.bridge,command:T.command,payload:ot,items:"snapshots",environmentId:e.environmentId,t:o,onSettled:m=>{m.kind==="done"&&e.reload()},onClose:()=>h(null)})]})]})})]})}var at="im-general";function ke(e,n){return{signature:n,replyLanguage:e.replyLanguage,enabled:e.delivery.enabled,port:String(e.delivery.port),token:"",clearToken:!1,saving:!1,failed:!1}}function Kn(e){let n=e.view,t=Pe(n),o=Se(at),r=L(0),[a,l]=I(()=>ke(n,t));a.signature!==t&&(r.current+=1,l(ke(n,t)));let d=En({baseline:{replyLanguage:n.replyLanguage,enabled:n.delivery.enabled,port:n.delivery.port,hasToken:n.delivery.hasToken},replyLanguage:a.replyLanguage,enabled:a.enabled,port:a.port,token:a.token,clearToken:a.clearToken}),c=d.changed,b=d.changed&&d.invalidPort,f=D(e.environmentId,"general","port"),w=D(e.environmentId,"general","token"),h=D(e.environmentId,"general","language");function v(u){o.activate(),l(C=>({...C,...u,failed:!1}))}function x(){if(!d.changed||a.saving)return;if(o.activate(),d.invalidPort){l(y=>({...y,failed:!0}));return}let u=d.payload,C=++r.current;l(y=>({...y,saving:!0,failed:!1})),ee(e.bridge,He,u,O(e.environmentId)).then(y=>{if(r.current===C){if(y===null){l(T=>({...T,saving:!1,failed:!0}));return}l(ke(y,Pe(y))),e.onSaved(y)}})}return i(be,{title:e.t("settingsSection.general"),defaultOpen:e.open===!0,staticHead:e.open===!0,...e.open===!0?{className:"im-detail"}:{},children:s("div",{className:"im-form",children:[i(V,{id:h,label:e.t("settings.language.label"),description:e.t("settings.language.description"),children:s(se,{className:"im-wide",value:a.replyLanguage,disabled:a.saving,onValueChange:u=>{let C=oe.find(y=>y.value===u);C===void 0||C.value===a.replyLanguage||v({replyLanguage:C.value})},children:[i(de,{id:h,"aria-describedby":`${h}-hint`,children:i(Z,{children:oe.filter(u=>u.value===a.replyLanguage).map(u=>e.t(u.labelKey))})}),i(ce,{children:oe.map(u=>i(X,{value:u.value,children:e.t(u.labelKey)},u.value))})]})}),s("div",{className:"im-field",children:[s(H,{className:"im-inline",children:[i("span",{className:"im-medium",children:e.t("settings.deliveryHttp.enabled.label")}),i(cn,{checked:a.enabled,disabled:a.saving,onCheckedChange:u=>{u!==a.enabled&&v({enabled:u})}})]}),i("p",{className:"im-small im-muted",children:e.t("settings.deliveryHttp.enabled.description")})]}),a.enabled?i(V,{id:f,label:e.t("settings.deliveryHttp.port.label"),description:e.t("settings.deliveryHttp.port.description"),issue:b?e.t("settingsSection.issue.format"):null,children:i(G,{id:f,type:"number",value:a.port,disabled:a.saving,"aria-invalid":b?!0:void 0,"aria-describedby":ne(f,b,!0),onChange:u=>{u.target.value!==a.port&&v({port:u.target.value})}})}):null,a.enabled?i(V,{id:w,label:e.t("settings.deliveryHttp.token.label"),description:e.t("settings.deliveryHttp.token.description"),children:i(ue,{id:w,value:a.token,stored:n.delivery.hasToken,clearing:a.clearToken,disabled:a.saving,invalid:!1,describedBy:ne(w,!1,!0),savedPlaceholder:e.t("settingsSection.secret.saved"),clearLabel:e.t("settingsSection.secret.clear"),undoLabel:e.t("settingsSection.secret.clearUndo"),onChange:u=>{u!==a.token&&v({token:u})},onToggleClear:()=>v({clearToken:!a.clearToken})})}):null,i(ge,{dirty:c,saving:a.saving,solid:o.chosen&&c,failed:a.failed,saveLabel:e.t("settingsSection.save"),revertLabel:e.t("settingsSection.revert"),failedLabel:e.t("settingsSection.saveFailed"),onSave:x,onRevert:()=>{r.current+=1,l(ke(n,t))}})]})})}function Fn(e){let[n,t]=I(!1),{t:o}=e;return s("div",{className:"im-main",children:[i("div",{className:"im-main-head",children:i("h3",{className:"im-heading im-medium",children:o("settings.deliveryTargets.label")})}),i("p",{className:"im-small im-muted",children:o("settingsSection.target.description")}),e.view.targets.map(r=>i(Oe,{target:r,columns:e.columns,proxies:e.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,onSaved:e.onSaved,onDiscard:()=>{}},r.rowId)),n?i(Oe,{target:null,columns:e.columns,proxies:e.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,onSaved:r=>{t(!1),e.onSaved(r)},onDiscard:()=>t(!1)},Ce.newSlot):null,i("div",{className:"im-actions",children:i(p,{variant:"outline",disabled:n,onClick:()=>{t(!0),e.activate(j(Ce.newSlot,null))},children:o("settingsSection.target.add")})})]})}var Dn=`
|
|
5
|
+
`),d)},children:d("settingsSection.copy")})})]})]})}function q(e){let n=(()=>{switch(e.platform){case"lark":return s(C,{children:[i("path",{fill:"#00D6B9",d:"M7.2 4.5h7.6c1.2 0 2.1.55 2.7 1.58 1.05 1.8 1.55 3.45 1.58 4.95-2.04-.62-4.2-.15-6.22 1.45C11.3 9.7 9.42 7.04 7.2 4.5Z"}),i("path",{fill:"#1456B8",d:"M10.8 13.55c3.3-2.93 5.72-4.24 9.47-2.52-1.2 1.45-2.27 4.18-3.86 5.43-1.67 1.31-3.9.5-5.61-.64v-2.27Z"}),i("path",{fill:"#3370FF",d:"M4.4 8.35c3.47 3.61 7.25 6.1 10.33 5.7 1.06-.14 2.2-.72 3.4-1.72-1.04 2.65-2.6 4.8-5.06 6-2.46 1.2-5.56.52-7.42-.72A2.76 2.76 0 0 1 4.4 15.3V8.35Z"})]});case"wecom":case"wecom-app":return s(C,{children:[i("path",{fill:"none",stroke:"#3370FF",strokeWidth:"2.35",strokeLinecap:"round",strokeLinejoin:"round",d:"M17.7 14.5c1.05-1.12 1.65-2.52 1.65-4.03 0-3.82-3.58-6.92-8-6.92s-8 3.1-8 6.92 3.58 6.92 8 6.92c1.17 0 2.28-.22 3.28-.62"}),i("path",{fill:"#07C160",d:"M16.1 15.15c.7-.7 1.83-.7 2.53 0s.7 1.83 0 2.53-1.83.7-2.53 0-.7-1.83 0-2.53Z"}),i("path",{fill:"#FFB800",d:"M19.25 13.45a1.36 1.36 0 1 1 1.92 1.92 1.36 1.36 0 0 1-1.92-1.92Z"}),i("path",{fill:"#FF7A00",d:"M19.55 18.05a1.16 1.16 0 1 1 1.64 1.64 1.16 1.16 0 0 1-1.64-1.64Z"}),i("path",{fill:"#3370FF",d:"M15.25 18.75a.92.92 0 1 1 1.3 1.3.92.92 0 0 1-1.3-1.3Z"})]});case"telegram":return i("path",{fill:"#229ED9",d:"M23.95 4.57c-.36-1.45-1.43-1.76-2.82-1.24L1.5 10.9c-1.34.52-1.32 1.27-.24 1.6l5.03 1.57 11.66-7.36c.55-.34 1.05-.16.64.21l-9.44 8.52-.37 5.12c.54 0 .78-.24 1.08-.53l2.59-2.51 5.38 3.97c.99.55 1.7.27 1.95-.92L23.95 4.57Z"});case"wechat":return i("path",{fill:"#07C160",d:"M8.691 2.188C3.891 2.188 0 5.476 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.29.295a.326.326 0 0 0 .167-.054l1.903-1.114a.864.864 0 0 1 .717-.098 10.16 10.16 0 0 0 2.837.403c.276 0 .543-.027.811-.05-.857-2.578.157-4.972 1.932-6.446 1.703-1.415 3.882-1.98 5.853-1.838-.576-3.583-4.196-6.348-8.596-6.348zM5.785 5.991c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178A1.17 1.17 0 0 1 4.623 7.17c0-.651.52-1.18 1.162-1.18zm5.813 0c.642 0 1.162.529 1.162 1.18a1.17 1.17 0 0 1-1.162 1.178 1.17 1.17 0 0 1-1.162-1.178c0-.651.52-1.18 1.162-1.18zm5.34 2.867c-1.797-.052-3.746.512-5.28 1.786-1.72 1.428-2.687 3.72-1.78 6.22.942 2.453 3.666 4.229 6.884 4.229.826 0 1.622-.12 2.361-.336a.722.722 0 0 1 .598.082l1.584.926a.272.272 0 0 0 .14.047c.134 0 .24-.111.24-.247 0-.06-.023-.12-.038-.177l-.327-1.233a.582.582 0 0 1-.023-.156.49.49 0 0 1 .201-.398C23.024 18.48 24 16.82 24 14.98c0-3.21-2.931-5.837-6.656-6.088V8.89c-.135-.01-.27-.027-.407-.03zm-2.53 3.274c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.97-.982zm4.844 0c.535 0 .969.44.969.982a.976.976 0 0 1-.969.983.976.976 0 0 1-.969-.983c0-.542.434-.982.969-.982z"});default:return null}})();return n===null?null:i("span",{className:`im-platform im-platform-${e.platform}`,"aria-hidden":"true",children:i("svg",{width:20,height:20,viewBox:"0 0 24 24",focusable:"false",children:n})})}function qn(e){return e.length>12?`${e.slice(0,8)}\u2022\u2022\u2022\u2022${e.slice(-4)}`:"cli_\u2022\u2022\u2022\u2022"}function kn(e){return e.length<=10?`${e.slice(0,3)}\u2022\u2022\u2022`:`${e.slice(0,6)}\u2022\u2022\u2022\u2022${e.slice(-4)}`}var Yn={lark:{column:"larkAppId",mask:qn},wecom:{column:"wecomBotId",mask:kn},"wecom-app":{column:"wecomAppCorpId",mask:kn}};function pe(e,n){let t=Yn[e];if(t===void 0)return null;let o=M(n,t.column);return o===""?null:t.mask(o)}function Ee(e){let n=e.className===void 0?"im-collapse":`im-collapse ${e.className}`;return e.staticHead===!0&&e.hideTitle===!0?s("div",{className:n,children:[e.notice,i("div",{className:"im-panel",children:e.children})]}):e.staticHead===!0?s("div",{className:n,children:[s("div",{className:"im-head",children:[s("div",{className:"im-toggle im-static",children:[e.icon,i("span",{className:"im-title im-medium",children:e.title}),e.meta]}),e.actions]}),e.notice,i("div",{className:"im-panel",children:e.children})]}):s(gn,{className:n,...e.defaultOpen===void 0?{}:{defaultOpen:e.defaultOpen},...e.open===void 0?{}:{open:e.open},...e.onOpenChange===void 0?{}:{onOpenChange:e.onOpenChange},children:[s("div",{className:"im-head",children:[s(yn,{className:"im-toggle",children:[i("span",{className:"im-chevron","aria-hidden":"true"}),e.icon,i("span",{className:"im-title im-medium",children:e.title}),e.meta]}),e.actions]}),e.notice,i(fn,{children:i("div",{className:"im-panel",children:e.children})})]})}function be(e){return i("section",{className:e.className===void 0?"im-block":`im-block ${e.className}`,...e.hideTitle===!0?{"aria-label":e.title}:{},children:i(Ee,{...e})})}var Jn=new Set(["accessMode","allowedSenders","runtimeMode"]),Zn=new Set(["groupMention","queueMode","approvalTimeoutMinutes","larkPanelMode","larkTopicOnMention","wecomNumberedHints"]);function Nn(e){return Jn.has(e.key)?"access":Zn.has(e.key)?"chat":e.group==="essential"||e.key==="defaultModel"||e.key==="defaultPreset"?"basic":"advanced"}var ve=(e,n)=>e!=="wechat"||n;var Ae="\0empty";function Rn(e){let n=e.columns.filter(f=>Ze(f,e.values)&&(e.section===void 0||Nn(f)===e.section)),t=e.section!==void 0?n:e.groupBotSettings?n.filter(f=>f.group==="essential"):n,o=e.section!==void 0?[]:e.groupBotSettings?n.filter(f=>f.group!=="essential"):[],r=e.issues.filter(f=>o.some(w=>w.key===f.column)),a=JSON.stringify(r),[l,d]=x(()=>({open:r.length>0,issues:a})),c=l.open||l.issues!==a&&r.length>0;l.issues!==a&&d({open:c,issues:a});let b=f=>i(Xn,{column:f,scope:e.scope,environmentId:e.environmentId,proxies:e.proxies,values:e.values,savedValues:e.savedValues,secrets:e.secrets,clearSecrets:e.clearSecrets,storedSecrets:e.storedSecrets,issues:e.issues,disabled:e.disabled,t:e.t,onValue:e.onValue,onSecret:e.onSecret,onToggleClear:e.onToggleClear},f.key);return s(C,{children:[t.map(b),(e.section===void 0||e.section==="basic"?e.publicFields:[]).map(f=>i(nt,{field:f,scope:e.scope,environmentId:e.environmentId,bridge:e.bridge,t:e.t},f.key)),o.length===0?null:i(Ee,{className:"im-span",title:r.length>0?e.t("settingsSection.moreSettingsIssues",{count:r.length}):e.t("settingsSection.moreSettings"),open:c,onOpenChange:f=>d({open:f,issues:a}),children:i("div",{className:"im-form",children:o.map(b)})})]})}function Xn(e){let n=e.column,t=D(e.environmentId,e.scope,n.key),o=j(e.t,n.labelKey,n.label)??n.key,r=j(e.t,n.descriptionKey,n.description),a=j(e.t,n.placeholderKey,n.placeholder),l=xn(e.t,e.issues.filter(c=>c.column===n.key).map(c=>c.code)),d=ne(t,l!==null,r!==void 0);return n.kind==="password"?i(V,{id:t,label:o,description:r,issue:l,children:i(ue,{id:t,value:e.secrets[n.key]??"",stored:e.storedSecrets[n.key]===!0,clearing:e.clearSecrets.includes(n.key),disabled:e.disabled,invalid:l!==null,describedBy:d,placeholder:a,savedPlaceholder:e.t("settingsSection.secret.saved"),clearLabel:e.t("settingsSection.secret.clear"),undoLabel:e.t("settingsSection.secret.clearUndo"),onChange:c=>{c!==(e.secrets[n.key]??"")&&e.onSecret(n.key,c)},onToggleClear:()=>e.onToggleClear(n.key)})}):n.kind==="select"?i(et,{column:n,id:t,label:o,description:r,issue:l,described:d,values:e.values,savedValues:e.savedValues,disabled:e.disabled,t:e.t,onValue:e.onValue}):n.kind==="proxy"?i("div",{className:"im-field",children:i(bn,{id:t,label:o,hint:e.values.platform==="lark"?e.t("column.proxy.larkHint"):r,value:e.values[n.key]??"",proxies:e.proxies,disabled:e.disabled,onChange:c=>{c!==(e.values[n.key]??"")&&e.onValue(n.key,c)},children:l===null?null:i("p",{id:`${t}-issue`,className:"im-small im-issue",role:"alert",children:l})})}):i(V,{id:t,label:o,description:r,issue:l,children:i($,{id:t,type:n.kind==="number"?"number":"text",min:n.min,max:n.max,step:n.kind==="number"?1:void 0,value:e.values[n.key]??n.defaultValue??"",placeholder:a,disabled:e.disabled,"aria-invalid":l!==null?!0:void 0,"aria-describedby":d,onChange:c=>{let b=c.target.value;b!==(e.values[n.key]??"")&&e.onValue(n.key,b)}})})}function et(e){let n=e.values[e.column.key]??"",t=e.savedValues[e.column.key]??"",o=(e.column.options??[]).filter(c=>e.column.key!=="platform"||ve(c.value,e.savedValues.platform===c.value)),r=o.some(c=>c.value===""),a=o.find(c=>c.value===n),l=c=>e.column.unavailableLabelKey===void 0?c:e.t(e.column.unavailableLabelKey,{value:c}),d=n===""&&a===void 0?void 0:a===void 0?l(n):j(e.t,a.labelKey,a.label)??a.value;return i(V,{id:e.id,label:e.label,description:e.description,issue:e.issue,children:s(se,{className:"im-wide",value:n===""?r?Ae:null:n,disabled:e.disabled,onValueChange:c=>{let b=r&&c===Ae?"":c??"";b!==n&&e.onValue(e.column.key,b)},children:[i(de,{id:e.id,"aria-invalid":e.issue!==null?!0:void 0,"aria-describedby":e.described,children:d===void 0?i(Z,{placeholder:e.t("settingsSection.select.default")}):i(Z,{children:d})}),s(ce,{children:[e.column.listsUnknownValue===!0&&t!==""&&!o.some(c=>c.value===t)?i(X,{value:t,disabled:e.column.unavailableLabelKey!==void 0,children:l(t)}):null,o.map(c=>i(X,{value:c.value===""?Ae:c.value,children:j(e.t,c.labelKey,c.label)??c.value},c.value))]})]})})}function nt(e){let n=D(e.environmentId,`${e.scope}-pub`,e.field.key);return s("div",{className:"im-field im-span",children:[i(H,{children:e.t(`settingsSection.publicField.${e.field.key}`)}),e.field.value===""?null:s("div",{className:"im-inline im-public-row",children:[i("span",{id:n,className:"im-public-value im-small",children:tt(e.field.value)}),e.field.copyable?i(p,{variant:"ghost",size:"sm",onClick:()=>{ye(e.bridge,e.field.value,e.t)},children:e.t("settingsSection.copy")}):null]}),e.field.hint===void 0?null:i("p",{className:"im-small im-muted",children:e.t(`settingsSection.publicFieldHint.${e.field.hint}`)})]})}function tt(e){let n=0;return e.split(/(?<=\/)(?!\/)/).map(t=>{let o=n;return n+=t.length,s(Me,{children:[o===0?null:i("wbr",{}),t]},o)})}var Tn=["basic","access","chat","advanced","danger"];function _n(e){let n=Ke(),t=e.showDanger?Tn:Tn.slice(0,-1),o=a=>{e.onChange(a),document.getElementById(`${n}-${a}`)?.focus()},r=(a,l)=>{let d=a.key==="Home"?0:a.key==="End"?t.length-1:a.key==="ArrowLeft"?(l-1+t.length)%t.length:a.key==="ArrowRight"?(l+1)%t.length:null;d!==null&&(a.preventDefault(),o(t[d]))};return i("div",{className:"im-detail-tabs",role:"tablist","aria-label":e.t("settingsSection.detailTabs"),children:t.map((a,l)=>i(p,{id:`${n}-${a}`,type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":e.value===a,tabIndex:e.value===a?0:-1,className:"im-detail-tab",onClick:()=>e.onChange(a),onKeyDown:d=>r(d,l),children:e.t(`settingsSection.tab.${a}`)},a))})}function Pn(e){let n={};for(let[a,l]of Object.entries(e.values))(e.baseline[a]??"")!==l&&(n[a]=l);let t={};for(let[a,l]of Object.entries(e.secrets))l!==""&&(t[a]=l);let o=[];for(let a of e.clearSecrets)Object.hasOwn(t,a)||o.includes(a)||o.push(a);return e.rowId===void 0||Object.keys(n).length>0||Object.keys(t).length>0||o.length>0?{changed:!0,edit:{...e.rowId===void 0?{}:{rowId:e.rowId},values:n,...Object.keys(t).length>0?{secrets:t}:{},...o.length>0?{clearSecrets:o}:{}}}:{changed:!1}}function it(e){let n=e.trim();if(!/^\d+$/.test(n))return null;let t=Number(n);return!Number.isInteger(t)||t<1||t>65535?null:t}function En(e){let n={};e.replyLanguage!==e.baseline.replyLanguage&&(n.replyLanguage=e.replyLanguage),e.enabled!==e.baseline.enabled&&(n.deliveryHttpEnabled=e.enabled);let t=!1;if(e.enabled){let o=it(e.port);o===null?t=!0:o!==e.baseline.port&&(n.deliveryHttpPort=o),e.token!==""?n.deliveryHttpToken=e.token:e.clearToken&&e.baseline.hasToken&&(n.clearDeliveryHttpToken=!0)}return t?{changed:!0,invalidPort:!0}:Object.keys(n).length===0?{changed:!1}:{changed:!0,invalidPort:!1,payload:n}}var An=te({activeId:null,activate:()=>{}});function Bn(e){return i(An,{value:{activeId:e.activeId,activate:e.activate},children:e.children})}function Se(e){let n=ie(An);return{chosen:n.activeId===e,activate:()=>n.activate(e)}}function we(e,n){let t=L(!1);return{cancelProps:{autoFocus:!0,"aria-describedby":e,onClick:()=>{t.current=!0,n()}},confirmProps:{"aria-describedby":e},triggerRef:o=>{o===null||!t.current||(t.current=!1,o.focus())}}}function he(e,n,t={}){return{signature:n,values:{...t,...e?.values},secrets:{},clearSecrets:[],saving:!1,failed:!1,confirming:!1,removing:!1,removeFailed:!1}}function Be(e){let{kind:n,row:t}=e,o=t===null?`${n.newSlot}:${JSON.stringify(e.initialValues??{})}`:JSON.stringify(t),r=Se(W(n.newSlot,t?.rowId??null)),a=L(0),[l,d]=x(()=>he(t,o,e.initialValues)),[c,b]=x("basic"),f=t!==null&&n.removeHintKey!==void 0?`im-remove-consequence-${n.newSlot}-${t.rowId}`:void 0,w=we(f,()=>d(m=>({...m,confirming:!1})));l.signature!==o&&(a.current+=1,d(he(t,o,e.initialValues)));let h=Pn({...t===null?{}:{rowId:t.rowId},baseline:t?.values??{},values:l.values,secrets:l.secrets,clearSecrets:l.clearSecrets}),v=h.changed,R=t===null||!t.configured,g=e.status??_e(t),I=e.notice??null,u=l.saving||l.removing;function T(m){r.activate(),d(y=>({...m(y),failed:!1}))}function P(){if(!h.changed||u)return;r.activate();let m=h.edit,y=++a.current;d(S=>({...S,saving:!0,failed:!1})),ee(e.bridge,n.saveCommand,m,O(e.environmentId)).then(S=>{if(a.current!==y)return;if(S===null){d(Ne=>({...Ne,saving:!1,failed:!0}));return}let A=t===null?void 0:n.rows(S).find(Ne=>Ne.rowId===t.rowId);A!==void 0&&d(he(A,JSON.stringify(A))),e.onSaved(S)})}function E(){if(t===null){e.onDiscard();return}let m=t.rowId,y=++a.current;d(S=>({...S,removing:!0,removeFailed:!1})),ee(e.bridge,n.removeCommand,{rowId:m},O(e.environmentId)).then(S=>{if(a.current===y){if(S===null){d(A=>({...A,removing:!1,removeFailed:!0,confirming:!0}));return}e.onSaved(S)}})}let _=l.confirming?s("div",{className:"im-actions",children:[i(p,{type:"button",variant:"ghost",size:"sm",disabled:u,...w.cancelProps,children:e.t("settingsSection.cancel")}),i(p,{type:"button",variant:"destructive",size:"sm",disabled:u,...w.confirmProps,onClick:E,children:e.t(n.removeConfirmKey)})]}):i(p,{type:"button",variant:e.detail===!0?"destructive":"ghost",size:"sm",disabled:u,ref:w.triggerRef,onClick:()=>d(m=>({...m,confirming:!0,removeFailed:!1})),children:e.t("settingsSection.remove")});return s(be,{title:e.title(l.values),icon:e.icon?.(l.values),defaultOpen:R,staticHead:e.detail===!0,...e.detail===!0?{className:"im-detail"}:{},meta:s(C,{children:[e.meta?.(l.values),s("span",{className:"im-status",children:[e.statusMeta,i(G,{tone:g.tone,children:e.t(g.key)})]})]}),actions:e.detail===!0?null:_,notice:s(C,{children:[e.summary,e.detail===!0?null:s(C,{children:[l.confirming&&t!==null&&n.removeHintKey!==void 0?i("p",{id:f,children:e.t(n.removeHintKey)}):null,l.removeFailed?i("p",{className:"im-small im-issue",role:"alert",children:e.t(n.removeFailedKey)}):null]})]}),children:[I===null?null:i(z,{variant:I.variant,children:i(Q,{children:I.text})}),e.detail===!0?i(_n,{value:c,showDanger:t!==null,onChange:m=>{m!=="danger"&&l.confirming&&d(y=>({...y,confirming:!1})),b(m),e.onSectionChange?.(m)},t:e.t}):null,e.detail===!0&&c==="danger"?s("div",{className:"im-danger-zone",children:[n.removeHintKey===void 0?null:l.confirming&&t!==null?i("p",{id:f,children:e.t(n.removeHintKey)}):i("p",{className:"im-small im-muted",children:e.t(n.removeHintKey)}),l.removeFailed?i("p",{className:"im-small im-issue",role:"alert",children:e.t(n.removeFailedKey)}):null,_,e.extra?.({dirty:v,frozen:u,section:c})]}):null,s("div",{className:"im-form",children:[e.detail===!0&&c==="danger"?null:i(Rn,{scope:`${n.newSlot}-${t?.rowId??"new"}`,environmentId:e.environmentId,columns:e.columns,groupBotSettings:n.groupBotSettings===!0,...e.detail===!0?{section:c}:{},proxies:e.proxies,values:l.values,savedValues:t?.values??{},secrets:l.secrets,clearSecrets:l.clearSecrets,storedSecrets:t?.secrets??{},issues:t?.issues??[],publicFields:t?.publicFields??[],disabled:u,bridge:e.bridge,t:e.t,onValue:(m,y)=>T(S=>({...S,values:{...S.values,[m]:y}})),onSecret:(m,y)=>T(S=>({...S,secrets:{...S.secrets,[m]:y}})),onToggleClear:m=>T(y=>({...y,clearSecrets:y.clearSecrets.includes(m)?y.clearSecrets.filter(S=>S!==m):[...y.clearSecrets,m]}))}),e.detail===!0&&c!=="advanced"?null:e.extra?.({dirty:v,frozen:u,...e.detail===!0?{section:c}:{}}),i(ge,{dirty:v,saving:l.saving,busy:l.removing,solid:r.chosen&&v,failed:l.failed,saveLabel:e.t("settingsSection.save"),revertLabel:e.t("settingsSection.revert"),failedLabel:e.t("settingsSection.saveFailed"),onSave:P,onRevert:()=>{a.current+=1,d(he(t,o,e.initialValues))}})]})]})}function On(e){let n=e.bridge.useFormatTimestamp(),{error:t,t:o}=e;if(t===void 0)return null;let r=new Date(t.at),a=Number.isFinite(r.getTime())?r.toISOString():null;return s("div",{className:"im-small",role:"status",children:[s("p",{children:[i("strong",{className:"im-issue",children:o("settingsSection.lastMessageError.title")}),o("settingsSection.lastMessageError.separator"),i("span",{children:t.messageKey===void 0?t.message:o(t.messageKey,{...t.messageParams,defaultValue:t.message})})]}),s("p",{className:"im-muted",children:[o("settingsSection.lastMessageError.code",{code:t.code}),", ",o("settingsSection.lastMessageError.reference",{referenceId:t.referenceId}),a===null?null:s(C,{children:[", ",i("time",{dateTime:a,children:n(a)})]})]})]})}var xe={groupBotSettings:!0,newSlot:"im-new-row",saveCommand:$e,removeCommand:He,rows:e=>e.bots,removeConfirmKey:"settingsSection.removeConfirm",removeHintKey:"settingsSection.removeHint",removeFailedKey:"settingsSection.removeFailed"},Ce={newSlot:"im-new-target",saveCommand:ze,removeCommand:Qe,rows:e=>e.targets,removeConfirmKey:"settingsSection.target.removeConfirm",removeFailedKey:"settingsSection.target.removeFailed"},Ie=(e,n,t)=>{let o=(e.displayName??"").trim();return o.length>0?o:t(`platform.${n}`)};function Ln(e){let{bot:n,t}=e,o=e.bots.find(w=>w.rowId===(n===null?void 0:e.connections?.[n.rowId]?.duplicateOf)),r=ln(n,e.connections,o===void 0?void 0:Ie(o.values,o.platform,t),t),[a,l]=x(null),[d,c]=x(!1),b=n===null?void 0:`im-reset-consequence-${n.rowId}`,f=we(b,()=>c(!1));return i(Be,{...e,kind:xe,row:n,onSectionChange:w=>{l(null),w!=="danger"&&c(!1)},status:re(n,e.connections),statusMeta:n?.configured&&e.connections?.[n.rowId]?.statusSince!==void 0?i(le,{since:e.connections[n.rowId]?.statusSince,bridge:e.bridge,t}):null,notice:r,summary:n===null?null:i(On,{error:e.connections?.[n.rowId]?.lastMessageError,bridge:e.bridge,t}),title:w=>Ie(w,U(w),t),icon:w=>{let h=M(w,"platform");return h===""?null:i(q,{platform:h})},meta:w=>{let h=U(w),v=pe(h,w);return v===null?null:i("span",{className:"im-small im-muted",children:v})},extra:({dirty:w,frozen:h,section:v})=>{if(n===null)return null;let R=Sn(n.platform,w,h,e.connections?.[n.rowId]),g=R.actions.find(u=>u.id==="resetInbox"),I=R.actions.filter(u=>v===void 0||v==="danger"==(u.id==="resetInbox"));return s(C,{children:[s("div",{className:"im-span",children:[d&&g!==void 0?s(C,{children:[i("p",{id:b,children:g.descriptionKeys.map(u=>t(u)).join(" ")}),s("div",{className:"im-actions",children:[i(p,{type:"button",variant:"ghost",size:"sm",disabled:h,...f.cancelProps,children:t("settingsSection.cancel")}),i(p,{type:"button",variant:"destructive",size:"sm",disabled:g.disabled,...f.confirmProps,onClick:()=>{c(!1),l({id:"resetInbox",payload:{rowId:n.rowId}})},children:t("rowAction.resetInbox.confirm")})]})]}):i("div",{className:"im-actions",children:I.map(u=>i(p,{type:"button",variant:"ghost",size:"sm",disabled:u.disabled,ref:u.id==="resetInbox"?f.triggerRef:void 0,onClick:()=>{u.id==="resetInbox"?c(!0):l({id:u.id,payload:{rowId:n.rowId}})},children:t(u.labelKey)},u.id))}),v==="danger"?null:I.filter(u=>u.id!=="resetInbox"&&u.descriptionKeys.length>0).map(u=>i("p",{className:"im-small im-muted",children:u.descriptionKeys.map(T=>t(T,u.descriptionParams)).join(" ")},u.id)),v==="danger"||R.noteKey===null?null:i("p",{className:"im-small im-muted",children:t(R.noteKey)})]}),a===null?null:i(fe,{bridge:e.bridge,command:qe[a.id],payload:a.payload,items:"latest",environmentId:e.environmentId,t,onClose:()=>l(null)},a.id)]})}})}function Oe(e){let{t:n}=e;return i(Be,{...e,kind:Ce,row:e.target,title:t=>{let o=(t.name??"").trim()||(t.targetId??"").trim();return o.length>0?o:n("settingsSection.target.untitled")}})}function Mn(e){let{bot:n,t}=e,o=re(n,e.connections),r=U(n.values),a=pe(r,n.values);return s(p,{type:"button",variant:"outline",className:"im-bot-summary",onClick:e.onOpen,children:[s("span",{className:"im-bot-summary-identity",children:[i(q,{platform:r}),s("span",{className:"im-bot-summary-copy",children:[i("strong",{children:Ie(n.values,n.platform,t)}),a===null?null:i("span",{className:"im-small im-muted",children:a})]})]}),s("span",{className:"im-status",children:[n.configured&&e.connections?.[n.rowId]?.statusSince!==void 0?i(le,{since:e.connections[n.rowId]?.statusSince,bridge:e.bridge,t}):null,i(G,{tone:o.tone,children:t(o.key)})]}),i("span",{className:"im-summary-chevron","aria-hidden":"true"})]})}var ot={};function Vn(e){let{view:n,snapshot:t,t:o}=e,r=B(()=>{let y=(t.columns.find(S=>S.key==="platform")?.options?.map(S=>S.value)??[]).filter(S=>ve(S,n.bots.some(A=>A.platform===S)));for(let S of n.bots)y.includes(S.platform)||y.push(S.platform);return y.length===0?["lark"]:y},[t.columns,n.bots]),[a,l]=x(null),[d,c]=x(null),[b,f]=x(!1),[w,h]=x(null),v=a!==null&&r.includes(a)?a:n.bots[0]?.platform??r[0]??"lark",R=n.bots.filter(m=>m.platform===v),g=d===null?void 0:R.find(m=>m.rowId===d),I=b||g!==void 0,u=o(`platform.${v}`),T=w==="lark"?{command:We,descriptionKey:Y.descriptionKey}:w==="wecom"?{command:je,descriptionKey:"wecomSetup.action.description"}:null,P=()=>{c(null),f(!1)},E=v==="wechat"?null:s("div",{className:"im-actions",children:[i(p,{variant:"outline",disabled:w!==null,onClick:()=>{f(!0),c(null),e.activate(W(xe.newSlot,null))},children:o("settingsSection.addBot")}),v==="lark"?i(p,{variant:R.length===0?"default":"outline",disabled:w!==null,onClick:()=>h("lark"),children:o(Y.labelKey)}):null,v==="wecom"?s(p,{variant:"outline",disabled:w!==null,onClick:()=>h("wecom"),children:[o("wecomSetup.action.label"),i("span",{className:"im-badge im-small",children:o(Y.badgeKey)})]}):null]}),_=v==="lark"?i("p",{className:"im-small im-muted",children:o(Y.warningKey)}):null;return s("div",{className:"im-workspace",children:[i("div",{className:"im-rail",role:"tablist","aria-label":o("settingsSection.channelPicker"),children:r.map(m=>{let y=n.bots.filter(S=>S.platform===m).length;return s(p,{type:"button",variant:"ghost",role:"tab","aria-selected":m===v,className:"im-channel",onClick:()=>{l(m),P(),h(null)},children:[i(q,{platform:m}),i("span",{className:"im-channel-label",children:o(`platform.${m}`)}),y===0?null:i("span",{className:"im-channel-count",children:y})]},m)})}),i("div",{className:"im-main",children:I?s(C,{children:[i(p,{type:"button",variant:"ghost",size:"sm",className:"im-back",onClick:P,children:o("settingsSection.backToBots")}),i(Ln,{bot:b?null:g??null,bots:n.bots,connections:e.connections,columns:t.columns,proxies:t.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,detail:!0,...b?{initialValues:{platform:v}}:{},onSaved:m=>{if(b){let y=m.bots.find(S=>!n.bots.some(A=>A.rowId===S.rowId));y!==void 0&&l(y.platform),f(!1)}e.onSaved(m)},onDiscard:P},b?xe.newSlot:g?.rowId)]}):s(C,{children:[i("div",{className:"im-main-head",children:i("h3",{className:"im-heading im-medium",children:u})}),v==="wechat"?i("p",{className:"im-small im-muted",children:o("settingsSection.wechatUnavailable")}):null,R.length===0?s("div",{className:"im-empty",children:[i(mn,{title:o("settingsSection.platformEmpty",{platform:u})}),E,_]}):s(C,{children:[i("div",{className:"im-bot-list",children:R.map(m=>i(Mn,{bot:m,connections:e.connections,bridge:e.bridge,t:o,onOpen:()=>{c(m.rowId),h(null)}},m.rowId))}),E,_]}),T===null?null:s("section",{className:"im-block",children:[i("p",{className:"im-small im-muted",children:o(T.descriptionKey)}),i(fe,{bridge:e.bridge,command:T.command,payload:ot,items:"snapshots",environmentId:e.environmentId,t:o,onSettled:m=>{m.kind==="done"&&e.reload()},onClose:()=>h(null)})]})]})})]})}var at="im-general";function ke(e,n){return{signature:n,replyLanguage:e.replyLanguage,enabled:e.delivery.enabled,port:String(e.delivery.port),token:"",clearToken:!1,saving:!1,failed:!1}}function Kn(e){let n=e.view,t=Pe(n),o=Se(at),r=L(0),[a,l]=x(()=>ke(n,t));a.signature!==t&&(r.current+=1,l(ke(n,t)));let d=En({baseline:{replyLanguage:n.replyLanguage,enabled:n.delivery.enabled,port:n.delivery.port,hasToken:n.delivery.hasToken},replyLanguage:a.replyLanguage,enabled:a.enabled,port:a.port,token:a.token,clearToken:a.clearToken}),c=d.changed,b=d.changed&&d.invalidPort,f=D(e.environmentId,"general","port"),w=D(e.environmentId,"general","token"),h=D(e.environmentId,"general","language");function v(g){o.activate(),l(I=>({...I,...g,failed:!1}))}function R(){if(!d.changed||a.saving)return;if(o.activate(),d.invalidPort){l(u=>({...u,failed:!0}));return}let g=d.payload,I=++r.current;l(u=>({...u,saving:!0,failed:!1})),ee(e.bridge,Ge,g,O(e.environmentId)).then(u=>{if(r.current===I){if(u===null){l(T=>({...T,saving:!1,failed:!0}));return}l(ke(u,Pe(u))),e.onSaved(u)}})}return i(be,{title:e.t("settingsSection.general"),defaultOpen:e.open===!0,staticHead:e.open===!0,hideTitle:e.open===!0,...e.open===!0?{className:"im-detail"}:{},children:s("div",{className:"im-form",children:[i(V,{id:h,label:e.t("settings.language.label"),description:e.t("settings.language.description"),children:s(se,{className:"im-wide",value:a.replyLanguage,disabled:a.saving,onValueChange:g=>{let I=oe.find(u=>u.value===g);I===void 0||I.value===a.replyLanguage||v({replyLanguage:I.value})},children:[i(de,{id:h,"aria-describedby":`${h}-hint`,children:i(Z,{children:oe.filter(g=>g.value===a.replyLanguage).map(g=>e.t(g.labelKey))})}),i(ce,{children:oe.map(g=>i(X,{value:g.value,children:e.t(g.labelKey)},g.value))})]})}),s("div",{className:"im-field",children:[s(H,{className:"im-inline",children:[i("span",{className:"im-medium",children:e.t("settings.deliveryHttp.enabled.label")}),i(cn,{checked:a.enabled,disabled:a.saving,onCheckedChange:g=>{g!==a.enabled&&v({enabled:g})}})]}),i("p",{className:"im-small im-muted",children:e.t("settings.deliveryHttp.enabled.description")})]}),a.enabled?i(V,{id:f,label:e.t("settings.deliveryHttp.port.label"),description:e.t("settings.deliveryHttp.port.description"),issue:b?e.t("settingsSection.issue.format"):null,children:i($,{id:f,type:"number",value:a.port,disabled:a.saving,"aria-invalid":b?!0:void 0,"aria-describedby":ne(f,b,!0),onChange:g=>{g.target.value!==a.port&&v({port:g.target.value})}})}):null,a.enabled?i(V,{id:w,label:e.t("settings.deliveryHttp.token.label"),description:e.t("settings.deliveryHttp.token.description"),children:i(ue,{id:w,value:a.token,stored:n.delivery.hasToken,clearing:a.clearToken,disabled:a.saving,invalid:!1,describedBy:ne(w,!1,!0),savedPlaceholder:e.t("settingsSection.secret.saved"),clearLabel:e.t("settingsSection.secret.clear"),undoLabel:e.t("settingsSection.secret.clearUndo"),onChange:g=>{g!==a.token&&v({token:g})},onToggleClear:()=>v({clearToken:!a.clearToken})})}):null,i(ge,{dirty:c,saving:a.saving,solid:o.chosen&&c,failed:a.failed,saveLabel:e.t("settingsSection.save"),revertLabel:e.t("settingsSection.revert"),failedLabel:e.t("settingsSection.saveFailed"),onSave:R,onRevert:()=>{r.current+=1,l(ke(n,t))}})]})})}function Fn(e){let[n,t]=x(!1),{t:o}=e;return s("div",{className:"im-main",role:"region","aria-label":o("settings.deliveryTargets.label"),children:[e.view.targets.map(r=>i(Oe,{target:r,columns:e.columns,proxies:e.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,onSaved:e.onSaved,onDiscard:()=>{}},r.rowId)),n?i(Oe,{target:null,columns:e.columns,proxies:e.proxies,environmentId:e.environmentId,bridge:e.bridge,t:o,onSaved:r=>{t(!1),e.onSaved(r)},onDiscard:()=>t(!1)},Ce.newSlot):null,i("div",{className:"im-actions",children:i(p,{variant:"outline",disabled:n,onClick:()=>{t(!0),e.activate(W(Ce.newSlot,null))},children:o("settingsSection.target.add")})})]})}var Dn=`
|
|
6
6
|
.im-settings {
|
|
7
7
|
box-sizing: border-box;
|
|
8
8
|
color: var(--foreground);
|
|
@@ -231,11 +231,6 @@ var Gn=window.__ycodiumPluginHost.react;var{Activity:st,Children:dt,Component:ct
|
|
|
231
231
|
border-radius: var(--control-radius);
|
|
232
232
|
color: var(--muted-foreground);
|
|
233
233
|
}
|
|
234
|
-
/* \u4E3B\u6309\u94AE\u4E0A\u7684\u5FBD\u6807\u8DDF\u6309\u94AE\u6587\u5B57\u540C\u8272\uFF0C\u7070\u5B57\u538B\u5728\u4E3B\u8272\u4E0A\u770B\u4E0D\u6E05\u3002 */
|
|
235
|
-
.im-settings .im-badge-on-primary {
|
|
236
|
-
border-color: currentColor;
|
|
237
|
-
color: inherit;
|
|
238
|
-
}
|
|
239
234
|
.im-settings .im-area-tabs,
|
|
240
235
|
.im-settings .im-detail-tabs {
|
|
241
236
|
display: flex;
|
|
@@ -428,4 +423,4 @@ var Gn=window.__ycodiumPluginHost.react;var{Activity:st,Children:dt,Component:ct
|
|
|
428
423
|
.im-settings .im-detail .im-form {
|
|
429
424
|
grid-template-columns: minmax(0, 1fr);
|
|
430
425
|
}
|
|
431
|
-
`;var
|
|
426
|
+
`;var Un={},rt=["bots","targets","general"];function $n(e){let n=e.bridge.i18n.usePluginTranslation(),t=B(()=>O(e.environmentId),[e.environmentId]),o=e.bridge.commands.useQuery(De,Un,t),r=e.bridge.commands.useSubscription(Ue,Un,t),a=rn(r),l=B(()=>hn(o.data),[o.data]),[d,c]=x(null),[b,f]=x(null),[w,h]=x(null),[v,R]=x("bots");if(l!==null&&l!==d&&c(l),b!==null){let y=In(b,{view:l?.view??null,isPending:o.isPending,failed:o.error!==null});y!==b&&f(y)}let g=b?.view??l?.view??d?.view??null,I=l??d,u=l===null&&o.data!==null&&!o.isPending,T=B(()=>Xe(I?.targetColumns??[],g?.bots??[],y=>n(`platform.${y}`)),[I,g,n]);function P(y){f({view:y,phase:"asked"}),o.refresh()}function E(){f(null),o.refresh()}let _;o.isUnavailable?_=i(Le,{variant:"warning",message:n("settingsSection.unavailable"),retryLabel:n("settingsSection.retry"),onRetry:E}):g===null&&o.isPending?_=i("div",{className:"im-pending",children:i(F,{size:"md"})}):g===null||I===null?_=i(Le,{variant:"error",message:n("settingsSection.loadFailed"),retryLabel:n("settingsSection.retry"),onRetry:E}):_=s(Bn,{activeId:w,activate:h,children:[o.error!==null||u?i(Le,{variant:"error",message:n("settingsSection.loadFailed"),retryLabel:n("settingsSection.retry"),onRetry:E}):null,i("div",{className:"im-area-tabs",role:"tablist","aria-label":n("settingsSection.globalTabs"),children:rt.map(y=>i(p,{type:"button",variant:"ghost",size:"sm",role:"tab","aria-selected":v===y,className:"im-area-tab",onClick:()=>R(y),children:n(y==="bots"?"settingsSection.bots":y==="targets"?"settings.deliveryTargets.label":"settingsSection.general")},y))}),v==="bots"?i(Vn,{view:g,snapshot:I,connections:a,environmentId:e.environmentId,bridge:e.bridge,t:n,activate:h,onSaved:P,reload:E}):v==="targets"?i(Fn,{view:g,columns:T,proxies:I.proxies,environmentId:e.environmentId,bridge:e.bridge,t:n,activate:h,onSaved:P}):i("div",{className:"im-main",children:i(Kn,{view:g,environmentId:e.environmentId,bridge:e.bridge,t:n,onSaved:P,open:!0})})]});let m=a===null?null:an(g?.bots??[],a);return i(dn,{bridge:e.bridge,children:s("div",{className:"im-settings",children:[i("style",{children:Dn}),s("div",{className:"im-head",children:[i("h2",{className:"im-heading im-medium im-title",children:n("settings.title")}),m!==null&&m.configured>0?i(G,{tone:"neutral","aria-label":n("settingsSection.onlineLabel",m),children:n("settingsSection.online",m)}):null]}),_]})})}function Le(e){return s(z,{variant:e.variant,layout:"inline",children:[i(Q,{children:e.message}),i(un,{children:i(p,{variant:"ghost",size:"sm",onClick:e.onRetry,children:e.retryLabel})})]})}function lt(e){return{slots:[{name:"settings.section",order:20,component(n){return i($n,{bridge:e,environmentId:n.environmentId??null},n.environmentId??"")}}]}}export{lt as default};
|
package/dist/index.js
CHANGED
|
@@ -132908,8 +132908,7 @@ var BOT_ACTIONS = [
|
|
|
132908
132908
|
},
|
|
132909
132909
|
{
|
|
132910
132910
|
id: "reconnect",
|
|
132911
|
-
labelKey: "rowAction.reconnect.label"
|
|
132912
|
-
descriptionKey: "rowAction.reconnect.description"
|
|
132911
|
+
labelKey: "rowAction.reconnect.label"
|
|
132913
132912
|
},
|
|
132914
132913
|
{
|
|
132915
132914
|
id: "resetInbox",
|
|
@@ -132918,13 +132917,11 @@ var BOT_ACTIONS = [
|
|
|
132918
132917
|
},
|
|
132919
132918
|
{
|
|
132920
132919
|
id: "copyDiagnostics",
|
|
132921
|
-
labelKey: "rowAction.copyDiagnostics.label"
|
|
132922
|
-
descriptionKey: "rowAction.copyDiagnostics.description"
|
|
132920
|
+
labelKey: "rowAction.copyDiagnostics.label"
|
|
132923
132921
|
},
|
|
132924
132922
|
{
|
|
132925
132923
|
id: "larkRepair",
|
|
132926
132924
|
labelKey: "rowAction.larkRepair.label",
|
|
132927
|
-
descriptionKey: "rowAction.larkRepair.description",
|
|
132928
132925
|
platform: "lark"
|
|
132929
132926
|
},
|
|
132930
132927
|
{
|
|
@@ -133288,8 +133285,7 @@ var buildBotColumns = (adapters, models = [], catalogComplete = true, presets =
|
|
|
133288
133285
|
key: "proxy",
|
|
133289
133286
|
group: "more",
|
|
133290
133287
|
kind: "proxy",
|
|
133291
|
-
labelKey: "column.proxy.label"
|
|
133292
|
-
descriptionKey: "column.proxy.description"
|
|
133288
|
+
labelKey: "column.proxy.label"
|
|
133293
133289
|
},
|
|
133294
133290
|
{
|
|
133295
133291
|
key: "defaultModel",
|
|
@@ -135001,7 +134997,7 @@ var makePermissionCommand = (core) => {
|
|
|
135001
134997
|
// package.json
|
|
135002
134998
|
var package_default = {
|
|
135003
134999
|
name: "@ycodium-ai/plugin-im",
|
|
135004
|
-
version: "0.2.
|
|
135000
|
+
version: "0.2.3635",
|
|
135005
135001
|
description: "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
|
|
135006
135002
|
keywords: [
|
|
135007
135003
|
"im",
|
|
@@ -146210,7 +146206,7 @@ var panelButton = (button) => ({
|
|
|
146210
146206
|
});
|
|
146211
146207
|
var buildPanelCard = (card) => {
|
|
146212
146208
|
const elements = [];
|
|
146213
|
-
if (card.text
|
|
146209
|
+
if (card.text) elements.push({ tag: "markdown", content: stripAngleBrackets(card.text) });
|
|
146214
146210
|
for (const group of card.groups) {
|
|
146215
146211
|
if (group.buttons.length === 0) continue;
|
|
146216
146212
|
if (group.heading !== null) {
|
|
@@ -147168,7 +147164,7 @@ var en_default = {
|
|
|
147168
147164
|
},
|
|
147169
147165
|
port: {
|
|
147170
147166
|
label: "Delivery HTTP port",
|
|
147171
|
-
description: "
|
|
147167
|
+
description: "Default 3847."
|
|
147172
147168
|
},
|
|
147173
147169
|
token: {
|
|
147174
147170
|
label: "Delivery HTTP token",
|
|
@@ -147240,8 +147236,7 @@ var en_default = {
|
|
|
147240
147236
|
},
|
|
147241
147237
|
proxy: {
|
|
147242
147238
|
label: "Proxy",
|
|
147243
|
-
larkHint: "The long connection that receives Lark messages does not use Ycodium's proxy settings."
|
|
147244
|
-
description: "Some platforms are only reachable through a proxy on this machine, and which one can differ per bot."
|
|
147239
|
+
larkHint: "The long connection that receives Lark messages does not use Ycodium's proxy settings."
|
|
147245
147240
|
},
|
|
147246
147241
|
defaultModel: {
|
|
147247
147242
|
label: "Default model",
|
|
@@ -147253,7 +147248,7 @@ var en_default = {
|
|
|
147253
147248
|
},
|
|
147254
147249
|
runtimeMode: {
|
|
147255
147250
|
label: "What a chat message may do",
|
|
147256
|
-
description: "
|
|
147251
|
+
description: "Whichever mode asks, the request lands in the chat."
|
|
147257
147252
|
},
|
|
147258
147253
|
groupMention: {
|
|
147259
147254
|
label: "In groups, answer",
|
|
@@ -147261,7 +147256,7 @@ var en_default = {
|
|
|
147261
147256
|
},
|
|
147262
147257
|
deliveryBotId: {
|
|
147263
147258
|
label: "Bot",
|
|
147264
|
-
description: "
|
|
147259
|
+
description: "Callers pass the id in brackets as botId.",
|
|
147265
147260
|
placeholder: "bot row id"
|
|
147266
147261
|
},
|
|
147267
147262
|
deliveryTargetId: {
|
|
@@ -147283,7 +147278,7 @@ var en_default = {
|
|
|
147283
147278
|
},
|
|
147284
147279
|
queueMode: {
|
|
147285
147280
|
label: "New messages while busy",
|
|
147286
|
-
description: "
|
|
147281
|
+
description: "With Queue, Steer is still available as a button."
|
|
147287
147282
|
},
|
|
147288
147283
|
approvalTimeoutMinutes: {
|
|
147289
147284
|
label: "Approval timeout (minutes)",
|
|
@@ -147295,7 +147290,7 @@ var en_default = {
|
|
|
147295
147290
|
},
|
|
147296
147291
|
larkTopicOnMention: {
|
|
147297
147292
|
label: "Open a topic when mentioned",
|
|
147298
|
-
description: "
|
|
147293
|
+
description: "Messages already inside a topic are answered in that topic either way."
|
|
147299
147294
|
},
|
|
147300
147295
|
wecomNumberedHints: {
|
|
147301
147296
|
label: "Numbered-reply hints",
|
|
@@ -147345,11 +147340,11 @@ var en_default = {
|
|
|
147345
147340
|
},
|
|
147346
147341
|
wechatBotToken: {
|
|
147347
147342
|
label: "WeChat bot token",
|
|
147348
|
-
description: "
|
|
147343
|
+
description: "Filling this in does not connect yet."
|
|
147349
147344
|
},
|
|
147350
147345
|
accessMode: {
|
|
147351
147346
|
label: "Access mode",
|
|
147352
|
-
description: '
|
|
147347
|
+
description: 'The two mixed modes share the same "Allowed people"; in either of them, when the chat type cannot be confirmed, only "Allowed people" can use the bot.'
|
|
147353
147348
|
}
|
|
147354
147349
|
},
|
|
147355
147350
|
reply: {
|
|
@@ -147733,7 +147728,6 @@ var en_default = {
|
|
|
147733
147728
|
},
|
|
147734
147729
|
panel: {
|
|
147735
147730
|
title: "Command panel",
|
|
147736
|
-
hint: "A button does the same as typing its command. You can still type.",
|
|
147737
147731
|
wecomTruncated: "Some commands do not fit on this card. Send /help for the full list, then type the command; in a group, mention the bot first.",
|
|
147738
147732
|
wecomExpired: "This panel has expired. Send /panel again; in a group, mention the bot first.",
|
|
147739
147733
|
category: {
|
|
@@ -147765,15 +147759,13 @@ var en_default = {
|
|
|
147765
147759
|
busy: "The last tap is still being handled. Give it a moment.",
|
|
147766
147760
|
loadFailed: "Could not read that just now. Try again in a moment.",
|
|
147767
147761
|
sessions: {
|
|
147768
|
-
title: "Pick a session"
|
|
147769
|
-
hint: "Tap one to switch to it."
|
|
147762
|
+
title: "Pick a session"
|
|
147770
147763
|
},
|
|
147771
147764
|
models: {
|
|
147772
147765
|
title: "Pick a model"
|
|
147773
147766
|
},
|
|
147774
147767
|
projects: {
|
|
147775
147768
|
title: "Pick a project",
|
|
147776
|
-
hint: "Tap a project and this chat works on it.",
|
|
147777
147769
|
pickedTitle: "Project picked",
|
|
147778
147770
|
picked: "{{title}}\nSend /repo to change it."
|
|
147779
147771
|
}
|
|
@@ -147781,7 +147773,7 @@ var en_default = {
|
|
|
147781
147773
|
wecomSetup: {
|
|
147782
147774
|
action: {
|
|
147783
147775
|
label: "Scan to create a WeCom smart bot",
|
|
147784
|
-
description: "
|
|
147776
|
+
description: "Ycodium saves its Bot ID and Secret in the bot list on this machine."
|
|
147785
147777
|
},
|
|
147786
147778
|
status: {
|
|
147787
147779
|
waiting: "Scan the QR code with WeCom, then confirm in WeCom to create the smart bot."
|
|
@@ -147908,7 +147900,7 @@ var en_default = {
|
|
|
147908
147900
|
rowAction: {
|
|
147909
147901
|
checkConnection: {
|
|
147910
147902
|
label: "Check connection",
|
|
147911
|
-
description: "
|
|
147903
|
+
description: "Sends a test message to the most recent private chat. Does not open a session or call a model.",
|
|
147912
147904
|
running: "Checking {{rowId}}\u2026",
|
|
147913
147905
|
done: "Connection OK",
|
|
147914
147906
|
doneTestFailed: "Credentials OK, but the test message was not sent",
|
|
@@ -147954,7 +147946,6 @@ var en_default = {
|
|
|
147954
147946
|
},
|
|
147955
147947
|
reconnect: {
|
|
147956
147948
|
label: "Reconnect",
|
|
147957
|
-
description: "Disconnect and reconnect this bot using its saved settings.",
|
|
147958
147949
|
notAvailable: "This platform can't be connected yet, so reconnecting won't help.",
|
|
147959
147950
|
running: "Starting to reconnect {{rowId}}\u2026",
|
|
147960
147951
|
done: "Reconnection started. Check the bot's connection status for the result.",
|
|
@@ -147977,7 +147968,6 @@ var en_default = {
|
|
|
147977
147968
|
},
|
|
147978
147969
|
copyDiagnostics: {
|
|
147979
147970
|
label: "Copy diagnostics",
|
|
147980
|
-
description: "Run a connection probe and produce copy-paste diagnostics (no secrets).",
|
|
147981
147971
|
running: "Building diagnostics for {{rowId}}\u2026",
|
|
147982
147972
|
done: "Diagnostic report ready \u2014 see details below",
|
|
147983
147973
|
notSaved: "Save this row first before copying diagnostics."
|
|
@@ -147987,7 +147977,7 @@ var en_default = {
|
|
|
147987
147977
|
},
|
|
147988
147978
|
larkCallbackProbe: {
|
|
147989
147979
|
label: "Verify card buttons",
|
|
147990
|
-
description: "
|
|
147980
|
+
description: "Sends a private test card to the first person in this bot's allowlist (usually you) and waits up to {{seconds}} seconds for your click.",
|
|
147991
147981
|
step: "Send a private test card and wait for the click",
|
|
147992
147982
|
waiting: "Test card sent privately to the first person in the allowlist ({{id}}, usually you). Click its button in Lark within {{seconds}} seconds.",
|
|
147993
147983
|
notConnected: "Skipped: this bot is not connected on this machine. Use \u201CReconnect\u201D on this row to connect it, then verify again.",
|
|
@@ -148013,7 +148003,6 @@ var en_default = {
|
|
|
148013
148003
|
},
|
|
148014
148004
|
larkRepair: {
|
|
148015
148005
|
label: "Repair scopes",
|
|
148016
|
-
description: "List missing required scopes and a link to request them on the Feishu open platform; an app administrator then publishes the app version manually.",
|
|
148017
148006
|
step: {
|
|
148018
148007
|
token: "Get a tenant token with the saved credentials",
|
|
148019
148008
|
scopes: "Check the app's granted tenant scopes"
|
|
@@ -148064,11 +148053,8 @@ var en_default = {
|
|
|
148064
148053
|
globalTabs: "Chat settings",
|
|
148065
148054
|
detailTabs: "Bot settings",
|
|
148066
148055
|
backToBots: "Back to bots",
|
|
148067
|
-
botCount: "{{count}} bots",
|
|
148068
148056
|
platformEmpty: "No {{platform}} bots yet",
|
|
148069
|
-
platformEmptyGuide: "Add a bot to start working from this platform.",
|
|
148070
148057
|
wechatUnavailable: "WeChat can't be connected yet. Saved bots remain visible so you can inspect or remove them; this page doesn't offer new WeChat bots.",
|
|
148071
|
-
dangerDescription: "Deleting this bot removes its saved credentials and chat bindings. The bot on the chat platform is not deleted.",
|
|
148072
148058
|
tab: {
|
|
148073
148059
|
basic: "Basic",
|
|
148074
148060
|
access: "Access",
|
|
@@ -148085,7 +148071,7 @@ var en_default = {
|
|
|
148085
148071
|
remove: "Delete",
|
|
148086
148072
|
removeConfirm: "Delete this bot",
|
|
148087
148073
|
cancel: "Cancel",
|
|
148088
|
-
removeHint: "Deleting this bot
|
|
148074
|
+
removeHint: "Deleting this bot removes its saved credentials and the bindings of every chat on it. The bot on the chat platform is not deleted.",
|
|
148089
148075
|
copy: "Copy",
|
|
148090
148076
|
copied: "Copied.",
|
|
148091
148077
|
copyFailed: "Couldn't copy that.",
|
|
@@ -148148,7 +148134,6 @@ var en_default = {
|
|
|
148148
148134
|
default: "Default"
|
|
148149
148135
|
},
|
|
148150
148136
|
target: {
|
|
148151
|
-
description: "Places a script or another tool can send a message to through a bot. The caller names the bot and the target id; the chat id on the platform stays here.",
|
|
148152
148137
|
add: "Add a target",
|
|
148153
148138
|
untitled: "New target",
|
|
148154
148139
|
removeConfirm: "Delete this target",
|
|
@@ -148238,7 +148223,7 @@ var zh_CN_default = {
|
|
|
148238
148223
|
},
|
|
148239
148224
|
port: {
|
|
148240
148225
|
label: "\u6295\u9012 HTTP \u7AEF\u53E3",
|
|
148241
|
-
description: "\
|
|
148226
|
+
description: "\u9ED8\u8BA4 3847\u3002"
|
|
148242
148227
|
},
|
|
148243
148228
|
token: {
|
|
148244
148229
|
label: "\u6295\u9012 HTTP Token",
|
|
@@ -148310,8 +148295,7 @@ var zh_CN_default = {
|
|
|
148310
148295
|
},
|
|
148311
148296
|
proxy: {
|
|
148312
148297
|
label: "\u4EE3\u7406",
|
|
148313
|
-
larkHint: "\u98DE\u4E66\u63A5\u6536\u6D88\u606F\u7684\u957F\u8FDE\u63A5\u4E0D\u4F7F\u7528 Ycodium \u7684\u4EE3\u7406\u8BBE\u7F6E\u3002"
|
|
148314
|
-
description: "\u6709\u4E9B\u5E73\u53F0\u53EA\u80FD\u7ECF\u672C\u673A\u4E0A\u7684\u67D0\u4E2A\u4EE3\u7406\u624D\u8FDE\u5F97\u4E0A\uFF0C\u800C\u4E14\u6BCF\u4E2A\u673A\u5668\u4EBA\u53EF\u4EE5\u4E0D\u4E00\u6837\u3002"
|
|
148298
|
+
larkHint: "\u98DE\u4E66\u63A5\u6536\u6D88\u606F\u7684\u957F\u8FDE\u63A5\u4E0D\u4F7F\u7528 Ycodium \u7684\u4EE3\u7406\u8BBE\u7F6E\u3002"
|
|
148315
148299
|
},
|
|
148316
148300
|
defaultModel: {
|
|
148317
148301
|
label: "\u9ED8\u8BA4\u6A21\u578B",
|
|
@@ -148323,7 +148307,7 @@ var zh_CN_default = {
|
|
|
148323
148307
|
},
|
|
148324
148308
|
runtimeMode: {
|
|
148325
148309
|
label: "\u804A\u5929\u6D88\u606F\u80FD\u505A\u4EC0\u4E48",
|
|
148326
|
-
description: "\
|
|
148310
|
+
description: "\u4E0D\u8BBA\u9009\u54EA\u4E00\u6863\uFF0C\u8981\u62CD\u677F\u7684\u4E8B\u90FD\u4F1A\u6446\u5230\u804A\u5929\u91CC\u3002"
|
|
148327
148311
|
},
|
|
148328
148312
|
groupMention: {
|
|
148329
148313
|
label: "\u7FA4\u91CC\u4EC0\u4E48\u65F6\u5019\u7406\u5B83",
|
|
@@ -148331,7 +148315,7 @@ var zh_CN_default = {
|
|
|
148331
148315
|
},
|
|
148332
148316
|
deliveryBotId: {
|
|
148333
148317
|
label: "\u673A\u5668\u4EBA",
|
|
148334
|
-
description: "\
|
|
148318
|
+
description: "\u8C03\u7528\u65B9\u628A\u62EC\u53F7\u91CC\u7684 id \u5F53\u4F5C botId \u4F20\u3002",
|
|
148335
148319
|
placeholder: "\u673A\u5668\u4EBA\u884C id"
|
|
148336
148320
|
},
|
|
148337
148321
|
deliveryTargetId: {
|
|
@@ -148353,7 +148337,7 @@ var zh_CN_default = {
|
|
|
148353
148337
|
},
|
|
148354
148338
|
queueMode: {
|
|
148355
148339
|
label: "\u5FD9\u65F6\u65B0\u6D88\u606F",
|
|
148356
|
-
description: "\
|
|
148340
|
+
description: "\u9009\u6392\u961F\u65F6\uFF0C\u4ECD\u53EF\u70B9\u6309\u94AE\u63D2\u8BDD\u3002"
|
|
148357
148341
|
},
|
|
148358
148342
|
approvalTimeoutMinutes: {
|
|
148359
148343
|
label: "\u5BA1\u6279\u8D85\u65F6\uFF08\u5206\u949F\uFF09",
|
|
@@ -148365,7 +148349,7 @@ var zh_CN_default = {
|
|
|
148365
148349
|
},
|
|
148366
148350
|
larkTopicOnMention: {
|
|
148367
148351
|
label: "\u88AB @ \u65F6\u5F00\u8BDD\u9898",
|
|
148368
|
-
description: "\
|
|
148352
|
+
description: "\u5DF2\u7ECF\u5728\u8BDD\u9898\u91CC\u7684\u6D88\u606F\uFF0C\u4E0D\u7BA1\u5F00\u4E0D\u5F00\uFF0C\u7B54\u590D\u90FD\u7559\u5728\u8BE5\u8BDD\u9898\u91CC\u3002"
|
|
148369
148353
|
},
|
|
148370
148354
|
wecomNumberedHints: {
|
|
148371
148355
|
label: "\u7F16\u53F7\u5E94\u7B54\u63D0\u793A",
|
|
@@ -148415,11 +148399,11 @@ var zh_CN_default = {
|
|
|
148415
148399
|
},
|
|
148416
148400
|
wechatBotToken: {
|
|
148417
148401
|
label: "\u5FAE\u4FE1\u673A\u5668\u4EBA\u4EE4\u724C",
|
|
148418
|
-
description: "\
|
|
148402
|
+
description: "\u586B\u4E86\u4E5F\u4E0D\u4F1A\u8FDE\u4E0A\u3002"
|
|
148419
148403
|
},
|
|
148420
148404
|
accessMode: {
|
|
148421
148405
|
label: "\u8BBF\u95EE\u6A21\u5F0F",
|
|
148422
|
-
description: "\
|
|
148406
|
+
description: "\u4E24\u79CD\u6DF7\u5408\u6A21\u5F0F\u5171\u7528\u540C\u4E00\u4EFD\u300C\u5141\u8BB8\u7684\u4EBA\u300D\uFF1B\u8FD9\u4E24\u79CD\u6A21\u5F0F\u4E0B\uFF0C\u65E0\u6CD5\u786E\u8BA4\u662F\u79C1\u804A\u8FD8\u662F\u7FA4\u65F6\uFF0C\u53EA\u6709\u300C\u5141\u8BB8\u7684\u4EBA\u300D\u80FD\u7528\u673A\u5668\u4EBA\u3002"
|
|
148423
148407
|
}
|
|
148424
148408
|
},
|
|
148425
148409
|
reply: {
|
|
@@ -148803,7 +148787,6 @@ var zh_CN_default = {
|
|
|
148803
148787
|
},
|
|
148804
148788
|
panel: {
|
|
148805
148789
|
title: "\u547D\u4EE4\u9762\u677F",
|
|
148806
|
-
hint: "\u70B9\u6309\u94AE\u7B49\u4E8E\u6253\u51FA\u5BF9\u5E94\u7684\u547D\u4EE4\uFF0C\u4E5F\u53EF\u4EE5\u76F4\u63A5\u6253\u5B57\u3002",
|
|
148807
148790
|
wecomTruncated: "\u8FD9\u5F20\u5361\u653E\u4E0D\u4E0B\u5168\u90E8\u547D\u4EE4\u3002\u53D1\u9001 /help \u67E5\u770B\u5168\u90E8\u547D\u4EE4\uFF0C\u518D\u76F4\u63A5\u8F93\u5165\u547D\u4EE4\uFF1B\u5728\u7FA4\u91CC\u8981\u5148 @ \u673A\u5668\u4EBA\u3002",
|
|
148808
148791
|
wecomExpired: "\u8FD9\u4E2A\u9762\u677F\u5DF2\u8FC7\u671F\uFF0C\u8BF7\u91CD\u65B0\u53D1\u9001 /panel\uFF1B\u5728\u7FA4\u91CC\u8981\u5148 @ \u673A\u5668\u4EBA\u3002",
|
|
148809
148792
|
category: {
|
|
@@ -148835,15 +148818,13 @@ var zh_CN_default = {
|
|
|
148835
148818
|
busy: "\u4E0A\u4E00\u6B65\u8FD8\u5728\u5904\u7406\uFF0C\u7A0D\u7B49\u4E00\u4E0B\u3002",
|
|
148836
148819
|
loadFailed: "\u521A\u624D\u6CA1\u8BFB\u51FA\u6765\uFF0C\u7A0D\u540E\u518D\u8BD5\u3002",
|
|
148837
148820
|
sessions: {
|
|
148838
|
-
title: "\u9009\u4E00\u6761\u4F1A\u8BDD"
|
|
148839
|
-
hint: "\u70B9\u4E00\u6761\u5207\u8FC7\u53BB\u3002"
|
|
148821
|
+
title: "\u9009\u4E00\u6761\u4F1A\u8BDD"
|
|
148840
148822
|
},
|
|
148841
148823
|
models: {
|
|
148842
148824
|
title: "\u9009\u6A21\u578B"
|
|
148843
148825
|
},
|
|
148844
148826
|
projects: {
|
|
148845
148827
|
title: "\u9009\u4E00\u4E2A\u9879\u76EE",
|
|
148846
|
-
hint: "\u70B9\u4E00\u4E2A\u9879\u76EE\uFF0C\u8FD9\u4E2A\u804A\u5929\u5C31\u505A\u5B83\u3002",
|
|
148847
148828
|
pickedTitle: "\u5DF2\u9009\u5B9A\u9879\u76EE",
|
|
148848
148829
|
picked: "{{title}}\n\u53D1 /repo \u53EF\u4EE5\u66F4\u6362\u3002"
|
|
148849
148830
|
}
|
|
@@ -148851,7 +148832,7 @@ var zh_CN_default = {
|
|
|
148851
148832
|
wecomSetup: {
|
|
148852
148833
|
action: {
|
|
148853
148834
|
label: "\u626B\u7801\u521B\u5EFA\u4F01\u4E1A\u5FAE\u4FE1\u667A\u80FD\u673A\u5668\u4EBA",
|
|
148854
|
-
description: "
|
|
148835
|
+
description: "Ycodium \u4F1A\u628A Bot ID \u548C Secret \u5B58\u8FDB\u8FD9\u53F0\u673A\u5668\u7684\u673A\u5668\u4EBA\u5217\u8868\u3002"
|
|
148855
148836
|
},
|
|
148856
148837
|
status: {
|
|
148857
148838
|
waiting: "\u7528\u4F01\u4E1A\u5FAE\u4FE1\u626B\u63CF\u4E8C\u7EF4\u7801\uFF0C\u518D\u5728\u4F01\u4E1A\u5FAE\u4FE1\u91CC\u786E\u8BA4\u521B\u5EFA\u667A\u80FD\u673A\u5668\u4EBA\u3002"
|
|
@@ -148978,7 +148959,7 @@ var zh_CN_default = {
|
|
|
148978
148959
|
rowAction: {
|
|
148979
148960
|
checkConnection: {
|
|
148980
148961
|
label: "\u68C0\u67E5\u8FDE\u63A5",
|
|
148981
|
-
description: "\
|
|
148962
|
+
description: "\u5411\u6700\u8FD1\u7684\u79C1\u804A\u53D1\u4E00\u6761\u6D4B\u8BD5\u6D88\u606F\uFF1B\u4E0D\u4F1A\u5F00\u4F1A\u8BDD\uFF0C\u4E5F\u4E0D\u4F1A\u8C03\u6A21\u578B\u3002",
|
|
148982
148963
|
running: "\u6B63\u5728\u68C0\u67E5 {{rowId}} \u2026",
|
|
148983
148964
|
done: "\u8FDE\u63A5\u6B63\u5E38",
|
|
148984
148965
|
doneTestFailed: "\u51ED\u636E\u6B63\u5E38\uFF0C\u4F46\u6D4B\u8BD5\u6D88\u606F\u6CA1\u53D1\u51FA\u53BB",
|
|
@@ -149024,7 +149005,6 @@ var zh_CN_default = {
|
|
|
149024
149005
|
},
|
|
149025
149006
|
reconnect: {
|
|
149026
149007
|
label: "\u91CD\u65B0\u8FDE\u63A5",
|
|
149027
|
-
description: "\u6309\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\u65AD\u5F00\u5E76\u91CD\u65B0\u8FDE\u63A5\u8FD9\u4E2A\u673A\u5668\u4EBA\u3002",
|
|
149028
149008
|
notAvailable: "\u8FD9\u4E2A\u5E73\u53F0\u8FD8\u4E0D\u80FD\u8FDE\u63A5\uFF0C\u91CD\u65B0\u8FDE\u63A5\u4E5F\u8FDE\u4E0D\u4E0A\u3002",
|
|
149029
149009
|
running: "\u6B63\u5728\u91CD\u65B0\u8FDE\u63A5 {{rowId}} \u2026",
|
|
149030
149010
|
done: "\u5DF2\u5F00\u59CB\u91CD\u65B0\u8FDE\u63A5\uFF0C\u7ED3\u679C\u8BF7\u770B\u673A\u5668\u4EBA\u7684\u8FDE\u63A5\u72B6\u6001\u3002",
|
|
@@ -149047,7 +149027,6 @@ var zh_CN_default = {
|
|
|
149047
149027
|
},
|
|
149048
149028
|
copyDiagnostics: {
|
|
149049
149029
|
label: "\u590D\u5236\u8BCA\u65AD",
|
|
149050
|
-
description: "\u8DD1\u4E00\u6B21\u8FDE\u63A5\u63A2\u6D4B\uFF0C\u751F\u6210\u53EF\u590D\u5236\u7684\u8BCA\u65AD\u6587\u672C\uFF08\u4E0D\u542B\u5BC6\u94A5\uFF09\u3002",
|
|
149051
149030
|
running: "\u6B63\u5728\u751F\u6210\u8BCA\u65AD {{rowId}} \u2026",
|
|
149052
149031
|
done: "\u8BCA\u65AD\u62A5\u544A\u5DF2\u751F\u6210\uFF0C\u89C1\u4E0B\u65B9\u8BE6\u60C5",
|
|
149053
149032
|
notSaved: "\u8BF7\u5148\u4FDD\u5B58\u8FD9\u4E00\u884C\u518D\u590D\u5236\u8BCA\u65AD\u3002"
|
|
@@ -149057,7 +149036,7 @@ var zh_CN_default = {
|
|
|
149057
149036
|
},
|
|
149058
149037
|
larkCallbackProbe: {
|
|
149059
149038
|
label: "\u9A8C\u8BC1\u5361\u7247\u6309\u94AE",
|
|
149060
|
-
description: "\u79C1\u53D1\u6D4B\u8BD5\u5361\u7ED9\u8FD9\u4E00\u884C\u5141\u8BB8\u540D\u5355\u91CC\u7684\u7B2C\u4E00\u4E2A\u4EBA\uFF08\u901A\u5E38\u5C31\u662F\u4F60\uFF09\uFF0C\u7B49\u4F60\u5728 {{seconds}} \u79D2\u5185\u70B9\u51FB\u5361\u4E0A\u7684\u6309\u94AE\u3002",
|
|
149039
|
+
description: "\u79C1\u53D1\u6D4B\u8BD5\u5361\u7ED9\u8FD9\u4E00\u884C\u5141\u8BB8\u540D\u5355\u91CC\u7684\u7B2C\u4E00\u4E2A\u4EBA\uFF08\u901A\u5E38\u5C31\u662F\u4F60\uFF09\uFF0C\u5E76\u7B49\u4F60\u5728 {{seconds}} \u79D2\u5185\u70B9\u51FB\u5361\u4E0A\u7684\u6309\u94AE\u3002",
|
|
149061
149040
|
step: "\u79C1\u53D1\u6D4B\u8BD5\u5361\u5E76\u7B49\u5F85\u70B9\u51FB",
|
|
149062
149041
|
waiting: "\u6D4B\u8BD5\u5361\u5DF2\u79C1\u53D1\u7ED9\u5141\u8BB8\u540D\u5355\u91CC\u7684\u7B2C\u4E00\u4E2A\u4EBA\uFF08{{id}}\uFF0C\u901A\u5E38\u5C31\u662F\u4F60\uFF09\u3002\u8BF7\u5728 {{seconds}} \u79D2\u5185\u5230\u98DE\u4E66\u91CC\u70B9\u5361\u4E0A\u7684\u6309\u94AE\u3002",
|
|
149063
149042
|
notConnected: "\u8DF3\u8FC7\uFF1A\u8FD9\u4E2A\u673A\u5668\u4EBA\u8FD8\u6CA1\u5728\u8FD9\u53F0\u673A\u5668\u4E0A\u8FDE\u4E0A\u3002\u8BF7\u5148\u7528\u8FD9\u4E00\u884C\u7684\u300C\u91CD\u65B0\u8FDE\u63A5\u300D\u8FDE\u4E0A\uFF0C\u518D\u9A8C\u8BC1\u3002",
|
|
@@ -149083,7 +149062,6 @@ var zh_CN_default = {
|
|
|
149083
149062
|
},
|
|
149084
149063
|
larkRepair: {
|
|
149085
149064
|
label: "\u8865\u5168\u6743\u9650",
|
|
149086
|
-
description: "\u5217\u51FA\u7F3A\u5C11\u7684\u5FC5\u9700\u6743\u9650\u548C\u98DE\u4E66\u5F00\u653E\u5E73\u53F0\u7533\u8BF7\u94FE\u63A5\uFF0C\u518D\u7531\u7BA1\u7406\u5458\u624B\u52A8\u53D1\u5E03\u5E94\u7528\u7248\u672C\u3002",
|
|
149087
149065
|
step: {
|
|
149088
149066
|
token: "\u7528\u5DF2\u4FDD\u5B58\u7684\u51ED\u636E\u6362\u53D6 tenant token",
|
|
149089
149067
|
scopes: "\u6838\u5BF9\u5E94\u7528\u5DF2\u5F00\u901A\u7684\u79DF\u6237\u6743\u9650"
|
|
@@ -149134,11 +149112,8 @@ var zh_CN_default = {
|
|
|
149134
149112
|
globalTabs: "\u804A\u5929\u8BBE\u7F6E",
|
|
149135
149113
|
detailTabs: "\u673A\u5668\u4EBA\u8BBE\u7F6E",
|
|
149136
149114
|
backToBots: "\u8FD4\u56DE\u673A\u5668\u4EBA\u5217\u8868",
|
|
149137
|
-
botCount: "{{count}} \u4E2A\u673A\u5668\u4EBA",
|
|
149138
149115
|
platformEmpty: "\u8FD8\u6CA1\u6709{{platform}}\u673A\u5668\u4EBA",
|
|
149139
|
-
platformEmptyGuide: "\u63A5\u5165\u4E00\u4E2A\u673A\u5668\u4EBA\uFF0C\u5C31\u80FD\u4ECE\u8FD9\u4E2A\u5E73\u53F0\u6D3E\u6D3B\u3002",
|
|
149140
149116
|
wechatUnavailable: "\u5FAE\u4FE1\u6682\u65F6\u4E0D\u80FD\u8FDE\u63A5\u3002\u5DF2\u4FDD\u5B58\u7684\u673A\u5668\u4EBA\u4ECD\u53EF\u67E5\u770B\u6216\u5220\u9664\uFF1B\u8FD9\u4E2A\u9875\u9762\u6682\u4E0D\u63D0\u4F9B\u65B0\u5EFA\u5FAE\u4FE1\u673A\u5668\u4EBA\u3002",
|
|
149141
|
-
dangerDescription: "\u5220\u9664\u8FD9\u4E2A\u673A\u5668\u4EBA\u4F1A\u79FB\u9664\u5DF2\u5B58\u7684\u51ED\u636E\u548C\u804A\u5929\u7ED1\u5B9A\uFF0C\u4E0D\u4F1A\u5220\u9664\u804A\u5929\u5E73\u53F0\u4E0A\u7684\u673A\u5668\u4EBA\u3002",
|
|
149142
149117
|
tab: {
|
|
149143
149118
|
basic: "\u57FA\u672C",
|
|
149144
149119
|
access: "\u8BBF\u95EE",
|
|
@@ -149155,7 +149130,7 @@ var zh_CN_default = {
|
|
|
149155
149130
|
remove: "\u5220\u9664",
|
|
149156
149131
|
removeConfirm: "\u5220\u9664\u8FD9\u4E2A\u673A\u5668\u4EBA",
|
|
149157
149132
|
cancel: "\u53D6\u6D88",
|
|
149158
|
-
removeHint: "\u5220\
|
|
149133
|
+
removeHint: "\u5220\u9664\u8FD9\u4E2A\u673A\u5668\u4EBA\u4F1A\u79FB\u9664\u5DF2\u5B58\u7684\u51ED\u636E\u548C\u5B83\u4E0B\u9762\u6240\u6709\u4F1A\u8BDD\u7684\u7ED1\u5B9A\uFF0C\u4E0D\u4F1A\u5220\u9664\u804A\u5929\u5E73\u53F0\u4E0A\u7684\u673A\u5668\u4EBA\u3002",
|
|
149159
149134
|
copy: "\u590D\u5236",
|
|
149160
149135
|
copied: "\u5DF2\u590D\u5236\u3002",
|
|
149161
149136
|
copyFailed: "\u6CA1\u590D\u5236\u4E0A\u3002",
|
|
@@ -149218,7 +149193,6 @@ var zh_CN_default = {
|
|
|
149218
149193
|
default: "\u9ED8\u8BA4"
|
|
149219
149194
|
},
|
|
149220
149195
|
target: {
|
|
149221
|
-
description: "\u811A\u672C\u6216\u522B\u7684\u5DE5\u5177\u53EF\u4EE5\u7ECF\u673A\u5668\u4EBA\u628A\u6D88\u606F\u53D1\u5230\u8FD9\u4E9B\u5730\u65B9\u3002\u8C03\u7528\u65B9\u53EA\u62A5\u673A\u5668\u4EBA\u548C\u76EE\u6807 id\uFF0C\u5E73\u53F0\u4E0A\u7684\u804A\u5929 id \u7559\u5728\u8FD9\u91CC\u3002",
|
|
149222
149196
|
add: "\u6DFB\u52A0\u76EE\u6807",
|
|
149223
149197
|
untitled: "\u65B0\u76EE\u6807",
|
|
149224
149198
|
removeConfirm: "\u5220\u9664\u8FD9\u4E2A\u76EE\u6807",
|
|
@@ -150478,15 +150452,13 @@ var makePanelController = (deps) => {
|
|
|
150478
150452
|
const projectsText = (rows) => {
|
|
150479
150453
|
if (rows.length === 0) return t("repo.noProjects");
|
|
150480
150454
|
const current = rows.find((row) => row.current);
|
|
150481
|
-
return current === void 0 ? t("repo.needProject") :
|
|
150482
|
-
${t("panel.projects.hint")}`;
|
|
150455
|
+
return current === void 0 ? t("repo.needProject") : t("repo.currentLine", { title: current.title });
|
|
150483
150456
|
};
|
|
150484
150457
|
const menuCard = (chatKey) => {
|
|
150485
150458
|
const commands = panelCommandsFor(deps.panelMode(chatKey));
|
|
150486
150459
|
return {
|
|
150487
150460
|
title: t("panel.title"),
|
|
150488
150461
|
tone: "menu",
|
|
150489
|
-
text: t("panel.hint"),
|
|
150490
150462
|
groups: PANEL_CATEGORIES.map(
|
|
150491
150463
|
(category) => ({
|
|
150492
150464
|
heading: t(`panel.category.${category}`),
|
|
@@ -150543,7 +150515,7 @@ ${t("panel.projects.hint")}`;
|
|
|
150543
150515
|
page: view.page,
|
|
150544
150516
|
depth,
|
|
150545
150517
|
pageSize: entry.listPageSize,
|
|
150546
|
-
text: view.rows.length === 0 ? t("sessions.empty") :
|
|
150518
|
+
text: view.rows.length === 0 ? t("sessions.empty") : "",
|
|
150547
150519
|
items: view.rows.map(
|
|
150548
150520
|
(row, index) => button(sessionLine(row, index + 1, now, t), "pick", `sessions:${row.threadId}`)
|
|
150549
150521
|
)
|
|
@@ -152514,7 +152486,7 @@ var renderPanel = (card, version) => {
|
|
|
152514
152486
|
}
|
|
152515
152487
|
if (card.nav.length > 0) rows.push(rowOf(card.nav));
|
|
152516
152488
|
return {
|
|
152517
|
-
text: [card.title, card.text].filter((part) => part !== "").join("\n\n"),
|
|
152489
|
+
text: [card.title, card.text ?? ""].filter((part) => part !== "").join("\n\n"),
|
|
152518
152490
|
rows,
|
|
152519
152491
|
actions
|
|
152520
152492
|
};
|
|
@@ -157209,7 +157181,7 @@ var makeWecomAppAdapter = (deps) => {
|
|
|
157209
157181
|
// src/index.ts
|
|
157210
157182
|
var definition = {
|
|
157211
157183
|
id: "im",
|
|
157212
|
-
apiVersion:
|
|
157184
|
+
apiVersion: 50,
|
|
157213
157185
|
// 第二个参数只给插件自己的测试夹具:换掉文件 IO 与派发重试的等待。宿主只传 ctx。
|
|
157214
157186
|
activate: async (ctx, testing = {}) => {
|
|
157215
157187
|
const { dispatchSleep } = testing;
|
package/locales/en.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"port": {
|
|
43
43
|
"label": "Delivery HTTP port",
|
|
44
|
-
"description": "
|
|
44
|
+
"description": "Default 3847."
|
|
45
45
|
},
|
|
46
46
|
"token": {
|
|
47
47
|
"label": "Delivery HTTP token",
|
|
@@ -113,8 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
"proxy": {
|
|
115
115
|
"label": "Proxy",
|
|
116
|
-
"larkHint": "The long connection that receives Lark messages does not use Ycodium's proxy settings."
|
|
117
|
-
"description": "Some platforms are only reachable through a proxy on this machine, and which one can differ per bot."
|
|
116
|
+
"larkHint": "The long connection that receives Lark messages does not use Ycodium's proxy settings."
|
|
118
117
|
},
|
|
119
118
|
"defaultModel": {
|
|
120
119
|
"label": "Default model",
|
|
@@ -126,7 +125,7 @@
|
|
|
126
125
|
},
|
|
127
126
|
"runtimeMode": {
|
|
128
127
|
"label": "What a chat message may do",
|
|
129
|
-
"description": "
|
|
128
|
+
"description": "Whichever mode asks, the request lands in the chat."
|
|
130
129
|
},
|
|
131
130
|
"groupMention": {
|
|
132
131
|
"label": "In groups, answer",
|
|
@@ -134,7 +133,7 @@
|
|
|
134
133
|
},
|
|
135
134
|
"deliveryBotId": {
|
|
136
135
|
"label": "Bot",
|
|
137
|
-
"description": "
|
|
136
|
+
"description": "Callers pass the id in brackets as botId.",
|
|
138
137
|
"placeholder": "bot row id"
|
|
139
138
|
},
|
|
140
139
|
"deliveryTargetId": {
|
|
@@ -156,7 +155,7 @@
|
|
|
156
155
|
},
|
|
157
156
|
"queueMode": {
|
|
158
157
|
"label": "New messages while busy",
|
|
159
|
-
"description": "
|
|
158
|
+
"description": "With Queue, Steer is still available as a button."
|
|
160
159
|
},
|
|
161
160
|
"approvalTimeoutMinutes": {
|
|
162
161
|
"label": "Approval timeout (minutes)",
|
|
@@ -168,7 +167,7 @@
|
|
|
168
167
|
},
|
|
169
168
|
"larkTopicOnMention": {
|
|
170
169
|
"label": "Open a topic when mentioned",
|
|
171
|
-
"description": "
|
|
170
|
+
"description": "Messages already inside a topic are answered in that topic either way."
|
|
172
171
|
},
|
|
173
172
|
"wecomNumberedHints": {
|
|
174
173
|
"label": "Numbered-reply hints",
|
|
@@ -218,11 +217,11 @@
|
|
|
218
217
|
},
|
|
219
218
|
"wechatBotToken": {
|
|
220
219
|
"label": "WeChat bot token",
|
|
221
|
-
"description": "
|
|
220
|
+
"description": "Filling this in does not connect yet."
|
|
222
221
|
},
|
|
223
222
|
"accessMode": {
|
|
224
223
|
"label": "Access mode",
|
|
225
|
-
"description": "
|
|
224
|
+
"description": "The two mixed modes share the same \"Allowed people\"; in either of them, when the chat type cannot be confirmed, only \"Allowed people\" can use the bot."
|
|
226
225
|
}
|
|
227
226
|
},
|
|
228
227
|
"reply": {
|
|
@@ -606,7 +605,6 @@
|
|
|
606
605
|
},
|
|
607
606
|
"panel": {
|
|
608
607
|
"title": "Command panel",
|
|
609
|
-
"hint": "A button does the same as typing its command. You can still type.",
|
|
610
608
|
"wecomTruncated": "Some commands do not fit on this card. Send /help for the full list, then type the command; in a group, mention the bot first.",
|
|
611
609
|
"wecomExpired": "This panel has expired. Send /panel again; in a group, mention the bot first.",
|
|
612
610
|
"category": {
|
|
@@ -638,15 +636,13 @@
|
|
|
638
636
|
"busy": "The last tap is still being handled. Give it a moment.",
|
|
639
637
|
"loadFailed": "Could not read that just now. Try again in a moment.",
|
|
640
638
|
"sessions": {
|
|
641
|
-
"title": "Pick a session"
|
|
642
|
-
"hint": "Tap one to switch to it."
|
|
639
|
+
"title": "Pick a session"
|
|
643
640
|
},
|
|
644
641
|
"models": {
|
|
645
642
|
"title": "Pick a model"
|
|
646
643
|
},
|
|
647
644
|
"projects": {
|
|
648
645
|
"title": "Pick a project",
|
|
649
|
-
"hint": "Tap a project and this chat works on it.",
|
|
650
646
|
"pickedTitle": "Project picked",
|
|
651
647
|
"picked": "{{title}}\nSend /repo to change it."
|
|
652
648
|
}
|
|
@@ -654,7 +650,7 @@
|
|
|
654
650
|
"wecomSetup": {
|
|
655
651
|
"action": {
|
|
656
652
|
"label": "Scan to create a WeCom smart bot",
|
|
657
|
-
"description": "
|
|
653
|
+
"description": "Ycodium saves its Bot ID and Secret in the bot list on this machine."
|
|
658
654
|
},
|
|
659
655
|
"status": {
|
|
660
656
|
"waiting": "Scan the QR code with WeCom, then confirm in WeCom to create the smart bot."
|
|
@@ -781,7 +777,7 @@
|
|
|
781
777
|
"rowAction": {
|
|
782
778
|
"checkConnection": {
|
|
783
779
|
"label": "Check connection",
|
|
784
|
-
"description": "
|
|
780
|
+
"description": "Sends a test message to the most recent private chat. Does not open a session or call a model.",
|
|
785
781
|
"running": "Checking {{rowId}}…",
|
|
786
782
|
"done": "Connection OK",
|
|
787
783
|
"doneTestFailed": "Credentials OK, but the test message was not sent",
|
|
@@ -827,7 +823,6 @@
|
|
|
827
823
|
},
|
|
828
824
|
"reconnect": {
|
|
829
825
|
"label": "Reconnect",
|
|
830
|
-
"description": "Disconnect and reconnect this bot using its saved settings.",
|
|
831
826
|
"notAvailable": "This platform can't be connected yet, so reconnecting won't help.",
|
|
832
827
|
"running": "Starting to reconnect {{rowId}}…",
|
|
833
828
|
"done": "Reconnection started. Check the bot's connection status for the result.",
|
|
@@ -850,7 +845,6 @@
|
|
|
850
845
|
},
|
|
851
846
|
"copyDiagnostics": {
|
|
852
847
|
"label": "Copy diagnostics",
|
|
853
|
-
"description": "Run a connection probe and produce copy-paste diagnostics (no secrets).",
|
|
854
848
|
"running": "Building diagnostics for {{rowId}}…",
|
|
855
849
|
"done": "Diagnostic report ready — see details below",
|
|
856
850
|
"notSaved": "Save this row first before copying diagnostics."
|
|
@@ -860,7 +854,7 @@
|
|
|
860
854
|
},
|
|
861
855
|
"larkCallbackProbe": {
|
|
862
856
|
"label": "Verify card buttons",
|
|
863
|
-
"description": "
|
|
857
|
+
"description": "Sends a private test card to the first person in this bot's allowlist (usually you) and waits up to {{seconds}} seconds for your click.",
|
|
864
858
|
"step": "Send a private test card and wait for the click",
|
|
865
859
|
"waiting": "Test card sent privately to the first person in the allowlist ({{id}}, usually you). Click its button in Lark within {{seconds}} seconds.",
|
|
866
860
|
"notConnected": "Skipped: this bot is not connected on this machine. Use “Reconnect” on this row to connect it, then verify again.",
|
|
@@ -886,7 +880,6 @@
|
|
|
886
880
|
},
|
|
887
881
|
"larkRepair": {
|
|
888
882
|
"label": "Repair scopes",
|
|
889
|
-
"description": "List missing required scopes and a link to request them on the Feishu open platform; an app administrator then publishes the app version manually.",
|
|
890
883
|
"step": {
|
|
891
884
|
"token": "Get a tenant token with the saved credentials",
|
|
892
885
|
"scopes": "Check the app's granted tenant scopes"
|
|
@@ -937,11 +930,8 @@
|
|
|
937
930
|
"globalTabs": "Chat settings",
|
|
938
931
|
"detailTabs": "Bot settings",
|
|
939
932
|
"backToBots": "Back to bots",
|
|
940
|
-
"botCount": "{{count}} bots",
|
|
941
933
|
"platformEmpty": "No {{platform}} bots yet",
|
|
942
|
-
"platformEmptyGuide": "Add a bot to start working from this platform.",
|
|
943
934
|
"wechatUnavailable": "WeChat can't be connected yet. Saved bots remain visible so you can inspect or remove them; this page doesn't offer new WeChat bots.",
|
|
944
|
-
"dangerDescription": "Deleting this bot removes its saved credentials and chat bindings. The bot on the chat platform is not deleted.",
|
|
945
935
|
"tab": {
|
|
946
936
|
"basic": "Basic",
|
|
947
937
|
"access": "Access",
|
|
@@ -958,7 +948,7 @@
|
|
|
958
948
|
"remove": "Delete",
|
|
959
949
|
"removeConfirm": "Delete this bot",
|
|
960
950
|
"cancel": "Cancel",
|
|
961
|
-
"removeHint": "Deleting this bot
|
|
951
|
+
"removeHint": "Deleting this bot removes its saved credentials and the bindings of every chat on it. The bot on the chat platform is not deleted.",
|
|
962
952
|
"copy": "Copy",
|
|
963
953
|
"copied": "Copied.",
|
|
964
954
|
"copyFailed": "Couldn't copy that.",
|
|
@@ -1021,7 +1011,6 @@
|
|
|
1021
1011
|
"default": "Default"
|
|
1022
1012
|
},
|
|
1023
1013
|
"target": {
|
|
1024
|
-
"description": "Places a script or another tool can send a message to through a bot. The caller names the bot and the target id; the chat id on the platform stays here.",
|
|
1025
1014
|
"add": "Add a target",
|
|
1026
1015
|
"untitled": "New target",
|
|
1027
1016
|
"removeConfirm": "Delete this target",
|
package/locales/zh-CN.json
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
"port": {
|
|
43
43
|
"label": "投递 HTTP 端口",
|
|
44
|
-
"description": "
|
|
44
|
+
"description": "默认 3847。"
|
|
45
45
|
},
|
|
46
46
|
"token": {
|
|
47
47
|
"label": "投递 HTTP Token",
|
|
@@ -113,8 +113,7 @@
|
|
|
113
113
|
},
|
|
114
114
|
"proxy": {
|
|
115
115
|
"label": "代理",
|
|
116
|
-
"larkHint": "飞书接收消息的长连接不使用 Ycodium 的代理设置。"
|
|
117
|
-
"description": "有些平台只能经本机上的某个代理才连得上,而且每个机器人可以不一样。"
|
|
116
|
+
"larkHint": "飞书接收消息的长连接不使用 Ycodium 的代理设置。"
|
|
118
117
|
},
|
|
119
118
|
"defaultModel": {
|
|
120
119
|
"label": "默认模型",
|
|
@@ -126,7 +125,7 @@
|
|
|
126
125
|
},
|
|
127
126
|
"runtimeMode": {
|
|
128
127
|
"label": "聊天消息能做什么",
|
|
129
|
-
"description": "
|
|
128
|
+
"description": "不论选哪一档,要拍板的事都会摆到聊天里。"
|
|
130
129
|
},
|
|
131
130
|
"groupMention": {
|
|
132
131
|
"label": "群里什么时候理它",
|
|
@@ -134,7 +133,7 @@
|
|
|
134
133
|
},
|
|
135
134
|
"deliveryBotId": {
|
|
136
135
|
"label": "机器人",
|
|
137
|
-
"description": "
|
|
136
|
+
"description": "调用方把括号里的 id 当作 botId 传。",
|
|
138
137
|
"placeholder": "机器人行 id"
|
|
139
138
|
},
|
|
140
139
|
"deliveryTargetId": {
|
|
@@ -156,7 +155,7 @@
|
|
|
156
155
|
},
|
|
157
156
|
"queueMode": {
|
|
158
157
|
"label": "忙时新消息",
|
|
159
|
-
"description": "
|
|
158
|
+
"description": "选排队时,仍可点按钮插话。"
|
|
160
159
|
},
|
|
161
160
|
"approvalTimeoutMinutes": {
|
|
162
161
|
"label": "审批超时(分钟)",
|
|
@@ -168,7 +167,7 @@
|
|
|
168
167
|
},
|
|
169
168
|
"larkTopicOnMention": {
|
|
170
169
|
"label": "被 @ 时开话题",
|
|
171
|
-
"description": "
|
|
170
|
+
"description": "已经在话题里的消息,不管开不开,答复都留在该话题里。"
|
|
172
171
|
},
|
|
173
172
|
"wecomNumberedHints": {
|
|
174
173
|
"label": "编号应答提示",
|
|
@@ -218,11 +217,11 @@
|
|
|
218
217
|
},
|
|
219
218
|
"wechatBotToken": {
|
|
220
219
|
"label": "微信机器人令牌",
|
|
221
|
-
"description": "
|
|
220
|
+
"description": "填了也不会连上。"
|
|
222
221
|
},
|
|
223
222
|
"accessMode": {
|
|
224
223
|
"label": "访问模式",
|
|
225
|
-
"description": "
|
|
224
|
+
"description": "两种混合模式共用同一份「允许的人」;这两种模式下,无法确认是私聊还是群时,只有「允许的人」能用机器人。"
|
|
226
225
|
}
|
|
227
226
|
},
|
|
228
227
|
"reply": {
|
|
@@ -606,7 +605,6 @@
|
|
|
606
605
|
},
|
|
607
606
|
"panel": {
|
|
608
607
|
"title": "命令面板",
|
|
609
|
-
"hint": "点按钮等于打出对应的命令,也可以直接打字。",
|
|
610
608
|
"wecomTruncated": "这张卡放不下全部命令。发送 /help 查看全部命令,再直接输入命令;在群里要先 @ 机器人。",
|
|
611
609
|
"wecomExpired": "这个面板已过期,请重新发送 /panel;在群里要先 @ 机器人。",
|
|
612
610
|
"category": {
|
|
@@ -638,15 +636,13 @@
|
|
|
638
636
|
"busy": "上一步还在处理,稍等一下。",
|
|
639
637
|
"loadFailed": "刚才没读出来,稍后再试。",
|
|
640
638
|
"sessions": {
|
|
641
|
-
"title": "选一条会话"
|
|
642
|
-
"hint": "点一条切过去。"
|
|
639
|
+
"title": "选一条会话"
|
|
643
640
|
},
|
|
644
641
|
"models": {
|
|
645
642
|
"title": "选模型"
|
|
646
643
|
},
|
|
647
644
|
"projects": {
|
|
648
645
|
"title": "选一个项目",
|
|
649
|
-
"hint": "点一个项目,这个聊天就做它。",
|
|
650
646
|
"pickedTitle": "已选定项目",
|
|
651
647
|
"picked": "{{title}}\n发 /repo 可以更换。"
|
|
652
648
|
}
|
|
@@ -654,7 +650,7 @@
|
|
|
654
650
|
"wecomSetup": {
|
|
655
651
|
"action": {
|
|
656
652
|
"label": "扫码创建企业微信智能机器人",
|
|
657
|
-
"description": "
|
|
653
|
+
"description": "Ycodium 会把 Bot ID 和 Secret 存进这台机器的机器人列表。"
|
|
658
654
|
},
|
|
659
655
|
"status": {
|
|
660
656
|
"waiting": "用企业微信扫描二维码,再在企业微信里确认创建智能机器人。"
|
|
@@ -781,7 +777,7 @@
|
|
|
781
777
|
"rowAction": {
|
|
782
778
|
"checkConnection": {
|
|
783
779
|
"label": "检查连接",
|
|
784
|
-
"description": "
|
|
780
|
+
"description": "向最近的私聊发一条测试消息;不会开会话,也不会调模型。",
|
|
785
781
|
"running": "正在检查 {{rowId}} …",
|
|
786
782
|
"done": "连接正常",
|
|
787
783
|
"doneTestFailed": "凭据正常,但测试消息没发出去",
|
|
@@ -827,7 +823,6 @@
|
|
|
827
823
|
},
|
|
828
824
|
"reconnect": {
|
|
829
825
|
"label": "重新连接",
|
|
830
|
-
"description": "按已保存的设置断开并重新连接这个机器人。",
|
|
831
826
|
"notAvailable": "这个平台还不能连接,重新连接也连不上。",
|
|
832
827
|
"running": "正在重新连接 {{rowId}} …",
|
|
833
828
|
"done": "已开始重新连接,结果请看机器人的连接状态。",
|
|
@@ -850,7 +845,6 @@
|
|
|
850
845
|
},
|
|
851
846
|
"copyDiagnostics": {
|
|
852
847
|
"label": "复制诊断",
|
|
853
|
-
"description": "跑一次连接探测,生成可复制的诊断文本(不含密钥)。",
|
|
854
848
|
"running": "正在生成诊断 {{rowId}} …",
|
|
855
849
|
"done": "诊断报告已生成,见下方详情",
|
|
856
850
|
"notSaved": "请先保存这一行再复制诊断。"
|
|
@@ -860,7 +854,7 @@
|
|
|
860
854
|
},
|
|
861
855
|
"larkCallbackProbe": {
|
|
862
856
|
"label": "验证卡片按钮",
|
|
863
|
-
"description": "
|
|
857
|
+
"description": "私发测试卡给这一行允许名单里的第一个人(通常就是你),并等你在 {{seconds}} 秒内点击卡上的按钮。",
|
|
864
858
|
"step": "私发测试卡并等待点击",
|
|
865
859
|
"waiting": "测试卡已私发给允许名单里的第一个人({{id}},通常就是你)。请在 {{seconds}} 秒内到飞书里点卡上的按钮。",
|
|
866
860
|
"notConnected": "跳过:这个机器人还没在这台机器上连上。请先用这一行的「重新连接」连上,再验证。",
|
|
@@ -886,7 +880,6 @@
|
|
|
886
880
|
},
|
|
887
881
|
"larkRepair": {
|
|
888
882
|
"label": "补全权限",
|
|
889
|
-
"description": "列出缺少的必需权限和飞书开放平台申请链接,再由管理员手动发布应用版本。",
|
|
890
883
|
"step": {
|
|
891
884
|
"token": "用已保存的凭据换取 tenant token",
|
|
892
885
|
"scopes": "核对应用已开通的租户权限"
|
|
@@ -937,11 +930,8 @@
|
|
|
937
930
|
"globalTabs": "聊天设置",
|
|
938
931
|
"detailTabs": "机器人设置",
|
|
939
932
|
"backToBots": "返回机器人列表",
|
|
940
|
-
"botCount": "{{count}} 个机器人",
|
|
941
933
|
"platformEmpty": "还没有{{platform}}机器人",
|
|
942
|
-
"platformEmptyGuide": "接入一个机器人,就能从这个平台派活。",
|
|
943
934
|
"wechatUnavailable": "微信暂时不能连接。已保存的机器人仍可查看或删除;这个页面暂不提供新建微信机器人。",
|
|
944
|
-
"dangerDescription": "删除这个机器人会移除已存的凭据和聊天绑定,不会删除聊天平台上的机器人。",
|
|
945
935
|
"tab": {
|
|
946
936
|
"basic": "基本",
|
|
947
937
|
"access": "访问",
|
|
@@ -958,7 +948,7 @@
|
|
|
958
948
|
"remove": "删除",
|
|
959
949
|
"removeConfirm": "删除这个机器人",
|
|
960
950
|
"cancel": "取消",
|
|
961
|
-
"removeHint": "
|
|
951
|
+
"removeHint": "删除这个机器人会移除已存的凭据和它下面所有会话的绑定,不会删除聊天平台上的机器人。",
|
|
962
952
|
"copy": "复制",
|
|
963
953
|
"copied": "已复制。",
|
|
964
954
|
"copyFailed": "没复制上。",
|
|
@@ -1021,7 +1011,6 @@
|
|
|
1021
1011
|
"default": "默认"
|
|
1022
1012
|
},
|
|
1023
1013
|
"target": {
|
|
1024
|
-
"description": "脚本或别的工具可以经机器人把消息发到这些地方。调用方只报机器人和目标 id,平台上的聊天 id 留在这里。",
|
|
1025
1014
|
"add": "添加目标",
|
|
1026
1015
|
"untitled": "新目标",
|
|
1027
1016
|
"removeConfirm": "删除这个目标",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ycodium-ai/plugin-im",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3635",
|
|
4
4
|
"description": "Talk to your agents from Telegram, WeCom, Lark, or WeChat (experimental).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"im",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"markdown-it": "^15.0.2",
|
|
33
33
|
"react": "19.2.6",
|
|
34
34
|
"vite-plus": "0.2.2",
|
|
35
|
-
"
|
|
36
|
-
"ycodium-
|
|
35
|
+
"ycodium-react-test-harness": "0.0.0",
|
|
36
|
+
"@ycodium-ai/plugin-api": "0.2.3635"
|
|
37
37
|
},
|
|
38
38
|
"ycodium": {
|
|
39
39
|
"plugin": "./dist/index.js",
|