@zortexhq/indra-v2.5 0.2.2 → 0.2.3
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/dist/box-level1-setup.js +1 -1
- package/dist/calcom-level1-setup.js +1 -1
- package/dist/cli-run.js +1 -1
- package/dist/connector-worker.js +1 -1
- package/dist/discord-level1-setup.js +1 -1
- package/dist/dropbox-level1-setup.js +1 -1
- package/dist/figma-level1-setup.js +1 -1
- package/dist/freshdesk-level1-setup.js +1 -1
- package/dist/freshrss-level1-setup.js +1 -1
- package/dist/front-level1-setup.js +1 -1
- package/dist/gateway.js +1 -1
- package/dist/google-chat-level1-setup.js +1 -1
- package/dist/google-contacts-level1-setup.js +1 -1
- package/dist/hubspot-level1-setup.js +1 -1
- package/dist/joplin-selection.js +1 -1
- package/dist/local-cloud.js +1 -1
- package/dist/mattermost-level1-setup.js +1 -1
- package/dist/mcp.js +2 -2
- package/dist/measurement-context.js +1 -1
- package/dist/miniflux-level1-setup.js +1 -1
- package/dist/nextcloud-level1-setup.js +1 -1
- package/dist/operation-telemetry.js +1 -0
- package/dist/prepared-level1-setup.js +1 -0
- package/dist/profile.js +1 -1
- package/dist/proton-mail-level1-setup.js +1 -1
- package/dist/recovery-launch.js +10 -0
- package/dist/recovery-support.js +1 -1
- package/dist/recovery-surface.js +1 -0
- package/dist/recovery.js +1 -1
- package/dist/resident-host.js +2 -2
- package/dist/resident-jobs.js +1 -1
- package/dist/resident-platform.js +1 -1
- package/dist/resident-telemetry.js +1 -0
- package/dist/resource-telemetry.js +1 -0
- package/dist/salesforce-level1-setup.js +1 -1
- package/dist/smartsheet-level1-setup.js +1 -1
- package/dist/startup.js +2 -2
- package/dist/thunderbird-level1-setup.js +1 -1
- package/dist/wakatime-level1-setup.js +1 -1
- package/dist/wallabag-level1-setup.js +1 -1
- package/dist/web.js +2 -2
- package/dist/zendesk-level1-setup.js +1 -1
- package/dist/zoom-level1-setup.js +1 -1
- package/dist/zulip-level1-setup.js +1 -1
- package/node_modules/@zortexhq/plugin-connector-core/dist/hub.js +1 -1
- package/node_modules/@zortexhq/plugin-connector-core/dist/operational-hub.js +1 -0
- package/node_modules/@zortexhq/plugin-connector-level1/dist/chatgpt.js +1 -1
- package/node_modules/@zortexhq/plugin-connector-level1/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-connector-level1/dist/mcp-feedback.js +1 -0
- package/node_modules/@zortexhq/plugin-connector-level1/dist/operational-client.js +1 -0
- package/node_modules/@zortexhq/plugin-connector-level1/dist/shallow.js +1 -1
- package/node_modules/@zortexhq/plugin-connector-level1/package.json +2 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-galaxy-ui/dist/routes.js +1 -1
- package/node_modules/@zortexhq/plugin-galaxy-ui/dist/server.js +1 -1
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-catalog.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-i18n.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-model.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app-text.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/app.html +42 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/connection-client.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/connection-forms.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/demo.js +1 -0
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/shell.css +47 -6
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/integration/shell.js +1 -1
- package/node_modules/@zortexhq/plugin-galaxy-ui/src/original/fonts/LICENSE.txt +92 -0
- package/node_modules/@zortexhq/plugin-jev-autopilot/dist/feedback.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-autopilot/dist/google-oauth-bridge.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-autopilot/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/browser-actions.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/driver.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/operational-browser.js +1 -0
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/session-routes.js +1 -1
- package/node_modules/@zortexhq/plugin-jev-browser-driver/dist/shared-session.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/collection-status.js +1 -0
- package/node_modules/@zortexhq/plugin-posthog/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/indra.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/local-cloud.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/northstar.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/observations.js +1 -1
- package/node_modules/@zortexhq/plugin-posthog/dist/operational.js +1 -0
- package/node_modules/@zortexhq/plugin-posthog/dist/resources.js +1 -0
- package/node_modules/@zortexhq/plugin-posthog/dist/source-ids.js +1 -1
- package/node_modules/@zortexhq/plugin-process-local/dist/api/resources.js +1 -0
- package/node_modules/@zortexhq/plugin-process-local/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-process-local/dist/resource-sampler.js +1 -0
- package/node_modules/@zortexhq/plugin-process-local/dist/runner.js +1 -1
- package/node_modules/@zortexhq/plugin-process-local/package.json +3 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/collection.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/index.js +1 -1
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/measurement.js +1 -1
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/observations.js +1 -1
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/operational.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/resources.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/source-ids.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/telemetry.js +1 -1
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/tool-call.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/tool-methods.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/api/upstream-tools.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-telemetry/dist/resources.js +1 -0
- package/node_modules/@zortexhq/plugin-telemetry/package.json +3 -0
- package/node_modules/@zortexhq/plugin-vault-sqlite/dist/api/index.js +1 -1
- package/node_modules/@zortexhq/plugin-vault-sqlite/dist/api/storage-metadata.js +1 -0
- package/node_modules/@zortexhq/plugin-vault-sqlite/dist/index.js +1 -1
- package/node_modules/@zortexhq/plugin-vault-sqlite/dist/storage-metadata.js +1 -0
- package/package.json +6 -6
- package/release-provenance.json +26 -26
- package/update-manifest.json +377 -179
- package/dist/recovery-page.js +0 -215
package/dist/recovery-page.js
DELETED
|
@@ -1,215 +0,0 @@
|
|
|
1
|
-
import{localizerScript}from"@zortexhq/plugin-galaxy-ui";import{RECOVERY_TEXT}from"./recovery-text.js";import{savedReconnectSources}from"./saved-reconnect.js";export function recoveryPage(nonce){return`<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>Zortex Connection Help</title>
|
|
2
|
-
<style nonce="${nonce}">
|
|
3
|
-
:root{color-scheme:light;--ink:#0d0d0d;--muted:#626262;--line:#e5e5e5;--soft:#f5f5f5}*{box-sizing:border-box}
|
|
4
|
-
body{margin:0;background:#fff;color:var(--ink);font:16px/1.65 Inter,Arial,"Microsoft JhengHei",Helvetica,sans-serif}button{font:inherit;cursor:pointer}button,a{touch-action:manipulation}:focus-visible{outline:2px solid var(--ink);outline-offset:4px}
|
|
5
|
-
header{height:80px;max-width:1280px;margin:auto;padding:0 32px;display:flex;align-items:center;justify-content:space-between;gap:16px}.brand{font-size:22px;font-weight:600;letter-spacing:-.8px}:lang(zh-Hans) body{font-family:Inter,Arial,"Microsoft YaHei","PingFang SC",sans-serif}:lang(zh-Hant) body{font-family:Inter,Arial,"Microsoft JhengHei","PingFang TC",sans-serif}.zx-language{margin-left:auto;font:inherit;font-size:13px;color:var(--ink);background:#fff;border:1px solid var(--line);border-radius:100px;padding:5px 12px;min-height:32px;cursor:pointer}.local{font-size:13px;color:var(--muted);background:var(--soft);padding:5px 14px;border-radius:100px}
|
|
6
|
-
main{max-width:860px;margin:0 auto;padding:52px 32px 40px}h1{font-size:32px;line-height:1.35;letter-spacing:-.64px;font-weight:500;margin:0 0 16px}p{margin:0}.intro{color:var(--muted);line-height:1.8;max-width:650px;margin-bottom:32px}
|
|
7
|
-
.statusbar{display:flex;align-items:baseline;justify-content:space-between;gap:16px;border-bottom:1px solid var(--line);padding-bottom:16px;margin-bottom:24px}.statusbar h2{font-size:16px;font-weight:500;margin:0}.count{font-size:14px;color:var(--muted)}
|
|
8
|
-
#notice{font-size:14px;color:var(--muted);margin-bottom:20px}#notice:empty{display:none}#notice[data-error="true"]{color:var(--ink);padding:16px;background:var(--soft);border-radius:16px}
|
|
9
|
-
article{border:1px solid var(--line);border-radius:20px;padding:24px;margin-bottom:16px}.rowhead{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:12px}h3{font-size:18px;line-height:1.4;font-weight:500;margin:0}.badge{font-size:12px;background:var(--soft);padding:5px 12px;border-radius:100px;flex-shrink:0}.message{font-size:15px}.next{font-size:14px;color:var(--muted);margin-top:6px;line-height:1.8}.actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:20px}
|
|
10
|
-
.button{display:inline-flex;align-items:center;justify-content:center;text-decoration:none;min-height:44px;border:1px solid var(--ink);border-radius:100px;padding:9px 20px;background:var(--ink);color:#fff;font-size:14px;font-weight:500;line-height:1.5}.button:hover:not(:disabled){background:#303030}.secondary{background:#fff;color:var(--ink);border-color:var(--line)}.secondary:hover:not(:disabled){background:var(--soft)}button:disabled{cursor:default;color:#767676;background:#f1f1f1;border-color:#f1f1f1}
|
|
11
|
-
details{margin:24px 0}summary{cursor:pointer;font-size:14px;color:var(--muted);padding:12px 0;min-height:44px}details article{margin-top:12px;border-radius:16px;padding:18px 24px}
|
|
12
|
-
footer{margin-top:32px;border-top:1px solid var(--line);padding-top:24px}footer small{display:block;margin-top:20px;font-size:12px;line-height:1.8;color:var(--muted)}.help{font-size:13px;color:var(--muted)}.footer-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
|
|
13
|
-
@media(max-width:600px){header{height:64px;padding:0 20px}.local{display:none}main{padding:28px 20px 32px}h1{font-size:28px}article{padding:20px}.rowhead{align-items:flex-start;gap:10px}.badge{max-width:52%;text-align:center;flex-shrink:1}.statusbar{flex-wrap:wrap;gap:4px}details article{padding:18px}.actions .button{flex-grow:1}}
|
|
14
|
-
.authorization-qr{display:block;max-width:100%;height:auto;margin-top:16px}
|
|
15
|
-
.joplin-pairing{width:100%;min-width:0}.joplin-pairing form{display:grid;gap:10px;margin:16px 0}.joplin-pairing input{width:100%;min-width:0;padding:8px;font:inherit}.joplin-pairing code{display:block;overflow-wrap:anywhere;user-select:all;margin:12px 0}
|
|
16
|
-
</style></head><body><header><span class="brand">Zortex</span><span class="local">Local connection help</span></header>
|
|
17
|
-
<main><h1 id="heading">Connect your apps</h1><p id="intro" class="intro">Follow the steps below. Zortex will check which actions or data are available.</p>
|
|
18
|
-
<div class="statusbar"><h2 id="section-title">Needs your attention</h2><span id="count" class="count">Checking connections</span></div>
|
|
19
|
-
<p id="notice" role="status" aria-live="polite" aria-atomic="true"></p><section id="sources" aria-labelledby="section-title"></section>
|
|
20
|
-
<footer><div class="footer-actions"><button class="button secondary" id="later">Continue later</button><span class="help">Your completed connections are saved.</span></div>
|
|
21
|
-
<details class="help"><summary>Cancelled or closed the wrong page?</summary><p>Select the source and click Reconnect to try again. If this page has expired or disconnected, ask Codex to reopen connection help.</p></details>
|
|
22
|
-
<small>Enter passwords and verification codes only on the service provider\u2019s page. This help page works only on this computer. Do not share its link.</small></footer></main><script nonce="${nonce}">${localizerScript({...RECOVERY_TEXT,Connected:["\u5DF2\u8FDE\u63A5","\u5DF2\u9023\u63A5"],"{0} / {1} sources connected":["{0} / {1} \u4E2A\u6765\u6E90\u5DF2\u8FDE\u63A5","{0} / {1} \u500B\u4F86\u6E90\u5DF2\u9023\u63A5"]},{picker:"header .local"})}<\/script><script nonce="${nonce}">
|
|
23
|
-
const capability=location.hash.slice(1);let ended=false,inflight=false,lastRender="",pollTimer;
|
|
24
|
-
// A corrected link can reuse this document with a different fragment. Discard
|
|
25
|
-
// the old capability and stopped polling state together before using the new one.
|
|
26
|
-
addEventListener('hashchange',()=>{if(location.hash.slice(1)!==capability)location.reload();});
|
|
27
|
-
const names={'google-chrome':'Chrome','microsoft-edge':'Edge',gmail:'Gmail','google-drive':'Google Drive','google-calendar':'Google Calendar',youtube:'YouTube',notion:'Notion',slack:'Slack',outlook:'Outlook',x:'X',instagram:'Instagram',linkedin:'LinkedIn','whatsapp-web':'WhatsApp',steam:'Steam',reddit:'Reddit',spotify:'Spotify','google-tasks':'Google Tasks','netease-mail':'NetEase Mail',notebooklm:'NotebookLM',stripe:'Stripe',openrouter:'OpenRouter',calendly:'Calendly',shopify:'Shopify',activitywatch:'ActivityWatch',cua:'CUA Driver'};
|
|
28
|
-
async function api(body){if(!/^[A-Za-z0-9_-]{43}$/.test(capability)){stopPage();throw Error('This connection help link is incomplete or damaged. Open a new help page using the instructions on this page. Do not copy or share this link.');}const response=await fetch('/api',{method:'POST',headers:{'Content-Type':'application/json','X-Zortex-Recovery':capability},body:JSON.stringify(body),cache:'no-store'}).catch(()=>{throw Error('The local connection help service cannot be reached. Status will retry automatically while this session remains available.');});if(!response.ok){if([403,410].includes(response.status)){stopPage();throw Error('This connection help link has expired or belongs to a different session. Open a new help page using the instructions on this page.');}let failure={};try{failure=await response.json();}catch{}if(response.status===409&&typeof failure.activeSource==='string'){const name=names[failure.activeSource]||failure.activeSource;throw Error('\u8BF7\u5148\u5B8C\u6210 '+name+' \u7684\u9A8C\u8BC1\u6216\u53D6\u6D88 '+name+' \u7684\u9A8C\u8BC1\u3002');}throw Error(response.status===409?'Another connection is in progress. Please try again shortly.':'The local connection help service returned an error. Status will retry automatically.');}return response.json();}
|
|
29
|
-
// Connection state is independent of read results, including empty and failed reads.
|
|
30
|
-
function connectionLabel(row){if(row.support?.state==='unsupported'||row.connection==='unavailable'||row.state==='unavailable')return 'Unavailable';if(row.state==='waiting-user')return 'Waiting for authorization';if(row.state==='connecting')return 'Connecting';return row.connection==='connected'?'Connected':'Not connected';}
|
|
31
|
-
const labels={pending:'Pending',connecting:'Connecting','waiting-user':'Waiting for authorization',reading:'Checking connection',complete:'Ready to use',empty:'Connected, no data yet',failed:'Try again',unavailable:'Unavailable'};
|
|
32
|
-
const activeStates=['connecting','waiting-user','reading'];
|
|
33
|
-
const element=(tag,text,cls)=>{const node=document.createElement(tag);if(text)node.textContent=text;if(cls)node.className=cls;return node;};
|
|
34
|
-
function notice(text,error=false){const node=document.getElementById('notice');node.textContent=text;node.dataset.error=String(error);}
|
|
35
|
-
function stopPage(){ended=true;if(pollTimer){clearTimeout(pollTimer);pollTimer=undefined;}document.getElementById('count').textContent='Unable to update status';document.getElementById('section-title').textContent='Next step';document.getElementById('heading').textContent='Reopen connection help';document.getElementById('intro').textContent='Your completed connections are saved. In the terminal used for this installation, run zortex help, or ask Codex to run the zortex help command from this installation. If you installed with a custom data directory, run indra --root "<same data directory>" help, replacing <same data directory> with that directory.';for(const button of document.querySelectorAll('button'))button.disabled=true;for(const link of document.querySelectorAll('[data-action="open"]'))link.remove();}
|
|
36
|
-
let submitting=false,pendingFocus,activeVerification,pressedAction=false,deferredReport,releaseTimer,joplinPairing,lastReport;
|
|
37
|
-
async function pairJoplin(selection,button){
|
|
38
|
-
if(submitting||ended)return;
|
|
39
|
-
if(selection.phase!=='start'&&(!joplinPairing||joplinPairing.expiresAt<=Date.now())){joplinPairing=undefined;if(lastReport)render(lastReport);notice('Pairing expired. Start again in both apps.',true);return;}
|
|
40
|
-
if(selection.phase==='inspect'&&!/^[a-f0-9]{88}$/.test(selection.pluginPublicKey||'')){notice('Paste the 88-character public key displayed by the Zortex Joplin plugin.',true);return;}
|
|
41
|
-
if(selection.phase==='confirm'&&(!Number.isInteger(selection.port)||selection.port<1024||selection.port>65535||selection.fingerprint!==joplinPairing.fingerprint)){notice('Match the pairing fingerprint and use the port displayed by Joplin (1024\u201365535).',true);return;}
|
|
42
|
-
submitting=true;button.disabled=true;
|
|
43
|
-
try{
|
|
44
|
-
const result=await api({action:'configure-joplin',source:'joplin',selection}),pair=result.pairing;
|
|
45
|
-
if(!pair||!['pairing','confirm-required','configured','cancelled','recovery-required','configuration-required','permission-required','unavailable'].includes(pair.state))throw new Error('Invalid pairing response. Start again.');
|
|
46
|
-
if(['pairing','confirm-required'].includes(pair.state)){
|
|
47
|
-
if(!/^[a-f0-9]{32}$/.test(pair.pairingId||'')||!Number.isSafeInteger(pair.expiresAt)||pair.expiresAt<=Date.now()||(pair.state==='pairing'?!/^[a-f0-9]{88}$/.test(pair.zortexPublicKey||''):!/^[a-f0-9]{64}$/.test(pair.fingerprint||'')))throw new Error('Invalid or expired pairing response. Start again.');
|
|
48
|
-
joplinPairing={state:pair.state,pairingId:pair.pairingId,expiresAt:pair.expiresAt,...(pair.state==='pairing'?{zortexPublicKey:pair.zortexPublicKey}:{fingerprint:pair.fingerprint})};
|
|
49
|
-
}else joplinPairing=undefined;
|
|
50
|
-
if(lastReport)render(lastReport);
|
|
51
|
-
notice(pair.state==='configured'?'Pairing saved. Follow the Joplin next step, then check again to verify real note access.':pair.state==='cancelled'?'Pairing cancelled.':pair.state==='recovery-required'?'An interrupted pairing was disabled. Revoke the old pairing in Joplin, then start again.':pair.state==='pairing'?'Exchange public keys with the Zortex Joplin plugin.':pair.state==='confirm-required'?'Complete the matching fingerprint exchange through the available computer tools.':'Pairing could not be completed. Keep Joplin open and start again.',!['pairing','confirm-required','configured','cancelled'].includes(pair.state));
|
|
52
|
-
}catch(error){joplinPairing=undefined;if(lastReport)render(lastReport);notice(error.message,true);}
|
|
53
|
-
finally{submitting=false;if(!ended){button.disabled=false;poll();}}
|
|
54
|
-
}
|
|
55
|
-
function finishPressedAction(){pressedAction=false;releaseTimer=undefined;if(deferredReport){const next=deferredReport;deferredReport=undefined;render(next);}}
|
|
56
|
-
function releasePressedAction(){if(!pressedAction)return;if(releaseTimer)clearTimeout(releaseTimer);releaseTimer=setTimeout(finishPressedAction,0);}
|
|
57
|
-
async function saveZulip(url,email,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-zulip',source:'zulip',selection:{instanceUrl:url.value,username:email.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
58
|
-
async function saveFreshRSS(url,username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-freshrss',source:'freshrss',selection:{instanceUrl:url.value,username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
59
|
-
async function saveMiniflux(url,username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-miniflux',source:'miniflux',selection:{instanceUrl:url.value,username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
60
|
-
async function saveMattermost(url,username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-mattermost',source:'mattermost',selection:{instanceUrl:url.value,username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
61
|
-
async function saveWallabag(url,username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-wallabag',source:'wallabag',selection:{instanceUrl:url.value,username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
62
|
-
async function saveCalcom(username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-calcom',source:'calcom',selection:{username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
63
|
-
async function saveWakatime(username,button){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-wakatime',source:'wakatime',selection:{username:username.value}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
64
|
-
async function saveNextcloud(input,button){if(submitting)return;const instanceUrl=input.value;if(!instanceUrl){notice('Enter your Nextcloud HTTPS instance URL.',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-nextcloud',source:'nextcloud',instanceUrl}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
65
|
-
async function saveDropbox(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your public app key and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-dropbox',source:'dropbox',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
66
|
-
async function saveBox(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Box client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-box',source:'box',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
67
|
-
async function saveFront(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Front client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-front',source:'front',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
68
|
-
async function saveHubSpot(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your HubSpot client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-hubspot',source:'hubspot',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
69
|
-
async function saveGoogleContacts(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Google Contacts client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-google-contacts',source:'google-contacts',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
70
|
-
async function saveGoogleChat(client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Google Chat client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-google-chat',source:'google-chat',selection:{clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
71
|
-
async function saveSalesforce(environment,client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Salesforce client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-salesforce',source:'salesforce',selection:{environment:environment.value,clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
72
|
-
async function saveZendesk(tenant,client,port,button){if(submitting)return;const clientId=client.value,loopbackPort=Number(port.value);if(!clientId||clientId.length>512||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)||!Number.isInteger(loopbackPort)||loopbackPort<1024||loopbackPort>65535){notice('Enter your Zendesk client ID and registered localhost port (1024\u201365535).',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-zendesk',source:'zendesk',selection:{subdomain:tenant.value,clientId,loopbackPort}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
73
|
-
async function saveZoom(client,button){if(submitting)return;const clientId=client.value;if(!clientId||clientId.length>2048||/\\s|[\\u0000-\\u001f\\u007f-\\u009f]/u.test(clientId)){notice('Enter a valid public Zoom client ID.',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-zoom',source:'zoom',selection:{clientId}}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
74
|
-
async function saveFigma(button,mode){if(submitting)return;submitting=true;button.disabled=true;try{render(await api({action:'configure-figma',source:'figma',selection:mode}));}catch(error){notice(error.message||'Could not save Figma setup.',true);}finally{submitting=false;button.disabled=false;}}
|
|
75
|
-
async function saveSmartsheet(input,button){if(submitting)return;const region=input.value;if(!['us','eu','au'].includes(region)){notice('Select a supported Smartsheet region.',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-smartsheet',source:'smartsheet',region}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
76
|
-
async function saveFreshdesk(input,button){if(submitting)return;const subdomain=input.value.trim();if(!/^(?:[a-z0-9]|[a-z0-9][a-z0-9-]{0,61}[a-z0-9])$/.test(subdomain)){notice('Enter only your Freshdesk tenant name in lowercase, without the domain.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-freshdesk',source:'freshdesk',subdomain}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
77
|
-
async function saveCopyQ(executable,session,button){if(submitting)return;const path=executable.value.trim(),name=session.value.trim();if(!path||! /^[\\p{L}\\p{N}_-]{0,16}$/u.test(name)){notice('Enter a CopyQ program path and a valid session name.',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-copyq',source:'copyq',executable:path,session:name}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
78
|
-
async function act(action,source,button){if(action!=='cancel'&&activeVerification&&activeVerification.source!==source){notice('\u8BF7\u5148\u5B8C\u6210 '+activeVerification.name+' \u7684\u9A8C\u8BC1\u6216\u53D6\u6D88 '+activeVerification.name+' \u7684\u9A8C\u8BC1\u3002',true);return;}if(submitting){notice('\u6B63\u5728\u5904\u7406\u8FDE\u63A5\u8BF7\u6C42\uFF0C\u8BF7\u7A0D\u5019\u3002',true);return;}const previous=button.textContent;submitting=true;if(document.activeElement===button)pendingFocus={key:button.dataset.focus,source};button.disabled=true;if(['connect','authorize','reconnect-saved'].includes(action)){button.textContent='Starting connection\u2026';notice('Starting '+(names[source]||source)+' connection.');}try{ended=false;render(await api({action,source}));}catch(error){if(!ended){button.disabled=false;button.textContent=previous;}notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
79
|
-
let obsidianSuggestions=null;
|
|
80
|
-
async function findObsidianFolders(button){
|
|
81
|
-
if(submitting)return;submitting=true;button.disabled=true;
|
|
82
|
-
try{const result=await api({action:'discover-native-vault',source:'obsidian'});obsidianSuggestions=result;const currentContainer=document.getElementById('obsidian-folder-suggestions'),currentInput=document.getElementById('folder-obsidian');if(currentContainer&¤tInput)showObsidianFolders(currentContainer,currentInput);}
|
|
83
|
-
catch(error){notice(error.message,true);}
|
|
84
|
-
finally{submitting=false;if(!ended)button.disabled=false;}
|
|
85
|
-
}
|
|
86
|
-
function showObsidianFolders(container,input){
|
|
87
|
-
container.replaceChildren();if(!obsidianSuggestions)return;
|
|
88
|
-
if(obsidianSuggestions.state==='unsupported'){container.append(element('p','Automatic Obsidian folder detection is not supported on this platform. Enter a folder path manually.'));return;}
|
|
89
|
-
if(obsidianSuggestions.state!=='found'&&obsidianSuggestions.state!=='empty'){container.append(element('p','Unable to detect Obsidian folders. Enter a folder path manually.'));return;}
|
|
90
|
-
const paths=Array.isArray(obsidianSuggestions.candidates)?obsidianSuggestions.candidates:[];
|
|
91
|
-
if(!paths.length){container.append(element('p',obsidianSuggestions.state==='empty'?'No Obsidian folders found. Enter a folder path manually.':'Unable to detect Obsidian folders. Enter a folder path manually.'));return;}
|
|
92
|
-
const select=element('select');select.setAttribute('aria-label','Choose an Obsidian folder');
|
|
93
|
-
const placeholder=element('option','Choose a detected folder');placeholder.value='';select.append(placeholder);
|
|
94
|
-
for(const path of paths){const option=element('option',path);option.value=path;select.append(option);}
|
|
95
|
-
select.onchange=()=>{if(select.value)input.value=select.value;};container.append(select,element('p','Select a folder, then choose Save folder to grant access.'));
|
|
96
|
-
}
|
|
97
|
-
async function saveFolder(source,input,button){if(submitting)return;const path=input.value.trim();if(!path){notice('Enter an absolute folder path.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-native-files',source,roots:[path]}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
98
|
-
async function saveWeChat(input,button){if(submitting)return;const port=Number(input.value);if(!Number.isInteger(port)||port<1024||port>65535){notice('Enter the WeChat local port between 1024 and 65535.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-wechat',source:'wechat',port}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
99
|
-
async function saveThunderbird(input,button){if(submitting)return;const port=Number(input.value);if(!Number.isInteger(port)||port<1024||port>65535){notice('Enter the Thunderbird local port between 1024 and 65535.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-thunderbird',source:'thunderbird',port}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
100
|
-
async function saveDiscord(clientId,subject,ipcPath,channels,button){if(submitting)return;const selection={clientId:clientId.value.trim(),expectedSubject:subject.value.trim(),ipcPath:ipcPath.value.trim(),channelIds:channels.value.split(',').map(x=>x.trim())};if(!selection.clientId||!selection.expectedSubject||!selection.ipcPath||!selection.channelIds.length||selection.channelIds.length>50||selection.channelIds.some(x=>!x)){notice('Enter the Discord app, account, IPC path and selected channel IDs.',true);return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-discord',source:'discord',selection}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
101
|
-
async function saveProtonMail(input,button){if(submitting)return;const port=Number(input.value);if(!Number.isInteger(port)||port<1024||port>65535){notice('Enter the ProtonMail local port between 1024 and 65535.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-proton-mail',source:'proton-mail',port}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
102
|
-
async function saveOwnTracks(input,button){if(submitting)return;const port=Number(input.value);if(!Number.isInteger(port)||port<1024||port>65535){notice('Enter the OwnTracks local port between 1024 and 65535.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-owntracks',source:'owntracks',port}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
103
|
-
async function saveZotero(input,type,button){if(submitting)return;const libraryId=input.value.trim();if(!(/^[1-9][0-9]{0,19}$/.test(libraryId)||type.value==='user'&&libraryId==='0')){notice('Enter 0 for a personal library or a positive group ID.',true);input.focus();return;}submitting=true;button.disabled=true;try{render(await api({action:'configure-zotero',source:'zotero',libraryId,libraryType:type.value}));}catch(error){if(!ended)button.disabled=false;notice(error.message,true);}finally{submitting=false;if(!ended)poll();}}
|
|
104
|
-
// Drafts live only across this render; never persist credentials or file inputs.
|
|
105
|
-
function draftFields(root){return [...root.querySelectorAll('[data-draft]')].filter(node=>node.tagName!=='INPUT'||['text','email','url','tel','search','number','checkbox','radio'].includes(node.type));}
|
|
106
|
-
function render(report){
|
|
107
|
-
if(pressedAction){deferredReport=report;return;}
|
|
108
|
-
lastReport=report;if(joplinPairing?.expiresAt<=Date.now()||report.state==='closed')joplinPairing=undefined;
|
|
109
|
-
const signature=JSON.stringify({report,joplinPairing});if(signature===lastRender)return;const initial=!lastRender;lastRender=signature;
|
|
110
|
-
const others=Array.isArray(report.others)?report.others:[],closed=report.state==='closed',all=report.sources.concat(others),activeRow=all.find(row=>row.source===report.activeSource),active=!!activeRow;
|
|
111
|
-
activeVerification=activeRow?{source:activeRow.source,name:names[activeRow.source]||activeRow.label||activeRow.source}:undefined;
|
|
112
|
-
const isReady=row=>connectionLabel(row)==='Connected'&&!row.errorCode&&row.read!=='failed'&&['complete','empty'].includes(row.state),complete=all.filter(isReady),connected=all.filter(row=>connectionLabel(row)==='Connected'),unchecked=connected.length-complete.length,isUnavailable=row=>connectionLabel(row)==='Unavailable'&&row.support?.reasonCode!=='configuration_required',unavailable=all.filter(isUnavailable),pending=all.filter(row=>!isReady(row)&&!isUnavailable(row)),ready=report.success&&!pending.length;
|
|
113
|
-
document.getElementById('heading').textContent=closed?'Connection help has ended':ready?'Your apps are ready':pending.length?'Connect your apps':'Review your connections';
|
|
114
|
-
document.getElementById('intro').textContent=closed?'Your completed connections are saved. Reopen connection help to continue.':ready?'All sources are connected and available. Return to Codex to use their actions or read data.':'Follow the steps below. Zortex will check which actions or data are available. You can already use sources that are ready in Codex.';
|
|
115
|
-
document.getElementById('section-title').textContent=closed?'Connection summary':pending.length?'Connections in progress':'Connection status';
|
|
116
|
-
document.getElementById('count').textContent=complete.length+' / '+all.length+' ready \xB7 '+unchecked+' awaiting checks';
|
|
117
|
-
const later=document.getElementById('later');later.textContent=ready?'Done':closed?'Help ended':'Continue later';later.disabled=closed;
|
|
118
|
-
notice(closed?'You can close this page.':ready?'Connections checked.':active?'Connecting '+activeVerification.name+'. Other completed connections remain available.':pending.length?'Continue incomplete sources with the available browser or computer tools.':'You can use the sources that are ready.');
|
|
119
|
-
const main=document.getElementById('sources'),focused=document.activeElement,focusKey=pendingFocus?.key??focused?.dataset?.focus,focusSource=pendingFocus?.source??focused?.closest('article')?.dataset.source;pendingFocus=undefined;
|
|
120
|
-
const focusDraft=!focusKey&&focused?.dataset?.draft,selection=typeof focused?.selectionStart==='number'?{start:focused.selectionStart,end:focused.selectionEnd,direction:focused.selectionDirection}:undefined;
|
|
121
|
-
const drafts=new Map(draftFields(main).map(node=>[node.dataset.draft,{value:node.value,checked:node.checked,selected:node.multiple?[...node.selectedOptions].map(option=>option.value):undefined}]));
|
|
122
|
-
const expanded=new Set([...main.querySelectorAll('details[open]')].map(node=>node.dataset.group));main.replaceChildren();
|
|
123
|
-
function card(row){
|
|
124
|
-
const status=connectionLabel(row),connected=status==='Connected';
|
|
125
|
-
const item=element('article'),head=element('div',null,'rowhead'),title=element('h3',names[row.source]||row.label||row.source),badge=element('span',status==='Unavailable'?'Unavailable':['complete','empty'].includes(row.state)&&!isReady(row)?connected?'Try again':'Not connected':others.includes(row)&&row.state==='pending'&&!connected?'Not connected':labels[row.state]||'Checking','badge');
|
|
126
|
-
item.dataset.source=row.source;title.id='source-'+row.source;title.dataset.focus=row.source+'-title';title.tabIndex=-1;item.setAttribute('aria-labelledby',title.id);head.append(title,badge);item.append(head,element('p',row.message,'message'),element('p',closed&&!['complete','empty'].includes(row.state)?'Reopen connection help to continue.':row.nextStep,'next'));
|
|
127
|
-
if(row.publicRead){const result={reading:'in progress',succeeded:'succeeded',failed:'failed'}[row.publicRead.state];if(result)item.append(element('p',row.source==='appstore'?'Public App Store data read: '+result+'. Apple account connection was not checked.':'Public data read: '+result+'.','next'));}
|
|
128
|
-
const actions=element('div',null,'actions');
|
|
129
|
-
if(row.signInUrl&&!closed){const link=element('a','Sign in or register \u2197','button secondary');link.href=row.signInUrl;link.target='_blank';link.rel='noopener noreferrer';link.dataset.focus=row.source+'-signin';actions.append(link);item.append(element('p','Finish signing in or registering on the provider\u2019s page, then return here and connect. Your password and verification codes stay on that page.','next'));}
|
|
130
|
-
function button(text,action,secondary=false){const node=element('button',text,'button'+(secondary?' secondary':''));node.type='button';node.dataset.focus=row.source+'-'+action;node.disabled=action!=='cancel'&&row.source===report.activeSource;node.onpointerdown=()=>{pressedAction=true;if(releaseTimer)clearTimeout(releaseTimer);releaseTimer=setTimeout(finishPressedAction,2000);};node.onpointerup=releasePressedAction;node.onpointercancel=releasePressedAction;node.onclick=()=>void act(action,row.source,node);actions.append(node);}
|
|
131
|
-
const other=others.includes(row);
|
|
132
|
-
if(!row.catalogOnly&&status!=='Unavailable'&&!isReady(row)&&!closed&&(row.source!=='joplin'||row.support?.reasonCode==='existing_authorization_read_only')){
|
|
133
|
-
const label=row.state==='connecting'?'Connecting\u2026':other&&row.state==='pending'&&!connected?'Connect':row.state==='reading'?'Checking connection\u2026':row.state==='waiting-user'?'Continue current authorization':row.connection==='connected'?'Check again':row.state==='failed'?'Reconnect':'Continue connecting';
|
|
134
|
-
button(label,row.connection==='connected'&&row.state==='pending'?'read':'connect',row.state==='waiting-user');
|
|
135
|
-
}
|
|
136
|
-
if(!row.catalogOnly&&isReady(row)&&!closed)button('Check again','read',true);
|
|
137
|
-
if(row.source==='gmail'&&row.connection!=='unavailable'&&!row.catalogOnly&&!closed&&['pending','complete','failed','empty'].includes(row.state)){
|
|
138
|
-
actions.append(element('p','Gmail write Actions use provider access for sending, changing and deleting mail. Continue the provider connection with the available tools.'));
|
|
139
|
-
button('Connect Gmail write Actions','authorize-gmail-write',true);
|
|
140
|
-
}
|
|
141
|
-
if(row.source==='readwise'&&!row.catalogOnly&&row.registration!=='deferred'&&!closed&&['pending','complete','failed','empty'].includes(row.state)){
|
|
142
|
-
actions.append(element('p','Readwise MCP requires read and write scopes. Continue its provider connection with the available tools.'));
|
|
143
|
-
button('Connect Readwise MCP','authorize-readwise-mcp',true);
|
|
144
|
-
}
|
|
145
|
-
if(!row.catalogOnly&&row.registration!=='deferred'&&row.connection==='connected'&&['complete','failed','empty','pending'].includes(row.state)&&!closed&&${JSON.stringify(savedReconnectSources)}.includes(row.source))button('Reconnect with saved access','reconnect-saved',true);
|
|
146
|
-
if(!closed&&(row.source===report.activeSource||row.state==='waiting-user'&&(row.authorizationUrl||row.authorizationImage||row.browserContinuation)))button('Cancel connection','cancel',true);
|
|
147
|
-
if(row.state==='waiting-user'&&row.browserContinuation&&!closed){const route=row.browserContinuation;item.append(element('p','Agent continuation: use actions source=browser-use, then action browser.observe with params '+JSON.stringify({sessionId:route.sessionId})+'. Continue using the returned controls. Available local input names: '+(route.inputNames||[]).join(', ')+'.','next'));}
|
|
148
|
-
if(row.support?.state!=='unsupported'&&row.support?.reasonCode!=='existing_authorization_read_only'&&row.registration!=='deferred'&&!['google-chrome','microsoft-edge','joplin'].includes(row.source)&&(row.connection==='connected'||(['todoist','linear'].includes(row.source)&&row.errorCode==='authorization_client_registration_required'))&&['complete','failed','empty','pending'].includes(row.state)&&!closed){button('Authorize again','authorize',true);if(['gmail','google-drive','google-calendar','youtube','google-tasks'].includes(row.source))item.append(element('p','Authorize again uses the Google account you verify for future reads. Previously saved history is preserved.','next'));}
|
|
149
|
-
if(row.state==='waiting-user'&&row.authorizationImage&&!closed){const qr=row.authorizationImage;if(qr.mimeType==='image/png'&&typeof qr.data==='string'&&qr.data.length<=65536&&/^[A-Za-z0-9+/]+={0,2}$/.test(qr.data)){const img=element('img');img.src='data:image/png;base64,'+qr.data;img.alt='Scan this QR code with the provider\u2019s app';img.width=240;img.height=240;img.className='authorization-qr';img.dataset.action='open';item.append(img);}}
|
|
150
|
-
if(row.state==='waiting-user'&&row.authorizationUrl&&row.deviceUserCode&&!closed)item.append(element('p','Enter this code on the authorization page: '+row.deviceUserCode,'next'));
|
|
151
|
-
if(row.state==='waiting-user'&&row.authorizationUrl&&!closed){const qr=row.source==='whatsapp-web';const link=element('a',qr?'Open QR code page \u2197':'Open authorization page \u2197','button');link.href=row.authorizationUrl;link.target='_blank';link.rel='noopener noreferrer';link.dataset.action='open';link.dataset.focus=row.source+'-open';link.setAttribute('aria-label','Open '+(names[row.source]||row.source)+(qr?' QR code page (new tab)':' authorization page (new tab)'));actions.append(link);}
|
|
152
|
-
if(row.zulipSetupAvailable&&!closed){const form=element('form'),url=element('input'),email=element('input'),label=element('label','Zulip HTTPS instance URL'),account=element('label','Zulip account email'),save=element('button','Save Zulip setup','button secondary');url.type='url';url.required=true;url.maxLength=512;url.placeholder='https://zulip.example.com';url.id='zulip-instance';label.htmlFor=url.id;email.type='email';email.required=true;email.maxLength=320;email.id='zulip-email';account.htmlFor=email.id;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted Zulip instance. This saves the URL and email only. After saving, follow the next step shown, then enter your API key in the protected local authorization form. The connection remains unverified. Starting the connector can download its pinned upstream software and contact the selected instance.'),label,url,account,email,save);form.onsubmit=event=>{event.preventDefault();void saveZulip(url,email,save);};actions.append(form);}
|
|
153
|
-
if(row.freshrssSetupAvailable&&!closed){const form=element('form'),url=element('input'),username=element('input'),label=element('label','FreshRSS HTTPS instance URL'),account=element('label','FreshRSS account username'),save=element('button','Save FreshRSS setup','button secondary');url.type='url';url.required=true;url.maxLength=512;url.placeholder='https://freshrss.example.com';url.id='freshrss-instance';label.htmlFor=url.id;username.type='text';username.required=true;username.maxLength=64;username.id='freshrss-username';account.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted FreshRSS instance. This saves the URL and username only. After saving, follow the next step shown, then enter your dedicated API password (not your web password) in the protected local authorization form. The connection remains unverified. Starting the connector can download its pinned upstream software and contact the selected instance.'),label,url,account,username,save);form.onsubmit=event=>{event.preventDefault();void saveFreshRSS(url,username,save);};actions.append(form);}
|
|
154
|
-
if(row.minifluxSetupAvailable&&!closed){const form=element('form'),url=element('input'),username=element('input'),label=element('label','Miniflux HTTPS instance URL'),account=element('label','Miniflux account username'),save=element('button','Save Miniflux setup','button secondary');url.type='url';url.required=true;url.maxLength=512;url.placeholder='https://miniflux.example.com';url.id='miniflux-instance';label.htmlFor=url.id;username.type='text';username.required=true;username.maxLength=320;username.id='miniflux-username';account.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted Miniflux instance. This saves the URL and username only. After saving, follow the next step shown, then enter your API key in the protected local authorization form. The connection remains unverified. Connecting will contact the selected instance.'),label,url,account,username,save);form.onsubmit=event=>{event.preventDefault();void saveMiniflux(url,username,save);};actions.append(form);}
|
|
155
|
-
if(row.mattermostSetupAvailable&&!closed){const form=element('form'),url=element('input'),username=element('input'),label=element('label','Mattermost HTTPS instance URL'),account=element('label','Mattermost account username'),save=element('button','Save Mattermost setup','button secondary');url.type='url';url.required=true;url.maxLength=512;url.placeholder='https://mattermost.example.com';url.id='mattermost-instance';label.htmlFor=url.id;username.type='text';username.required=true;username.maxLength=320;username.id='mattermost-username';account.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted Mattermost instance. An administrator must enable personal access tokens. The token has full account permissions even though Zortex uses read-only operations. Only the URL and username are saved here. After saving, follow the next step shown and enter the token in the protected local authorization form. Connecting contacts the selected instance; the connection is not yet verified.'),label,url,account,username,save);form.onsubmit=event=>{event.preventDefault();void saveMattermost(url,username,save);};actions.append(form);}
|
|
156
|
-
if(row.wallabagSetupAvailable&&!closed){const form=element('form'),url=element('input'),username=element('input'),label=element('label','Wallabag HTTPS instance URL'),account=element('label','Wallabag account username'),save=element('button','Save Wallabag setup','button secondary');url.type='url';url.required=true;url.maxLength=512;url.placeholder='https://wallabag.example.com';url.id='wallabag-instance';label.htmlFor=url.id;username.type='text';username.required=true;username.maxLength=320;username.id='wallabag-username';account.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted Wallabag instance. This saves the URL and username only. After saving, follow the next step shown, then enter your access token in the protected local authorization form. Tokens can expire and may require reauthorization. The connection remains unverified. Connecting will contact the selected instance.'),label,url,account,username,save);form.onsubmit=event=>{event.preventDefault();void saveWallabag(url,username,save);};actions.append(form);}
|
|
157
|
-
if(row.calcomSetupAvailable&&!closed){const form=element('form'),username=element('input'),label=element('label','Cal.com username'),save=element('button','Save Cal.com setup','button secondary');username.type='text';username.required=true;username.maxLength=320;username.id='calcom-username';label.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','This saves your username only. After saving, follow the next step shown, then enter your API key in the protected local authorization form. Cal.com API keys can expire or be revoked and may require reauthorization. Connecting contacts api.cal.com; the connection remains unverified until then.'),label,username,save);form.onsubmit=event=>{event.preventDefault();void saveCalcom(username,save);};actions.append(form);}
|
|
158
|
-
if(row.wakatimeSetupAvailable&&!closed){const form=element('form'),username=element('input'),label=element('label','WakaTime username or account ID'),save=element('button','Save WakaTime setup','button secondary');username.type='text';username.required=true;username.maxLength=320;username.id='wakatime-username';label.htmlFor=username.id;save.type='submit';save.disabled=active;form.append(element('p','If you have no username, use the account ID after @ in your WakaTime profile URL. After saving, follow the next step shown, then enter your OAuth access token in the protected local authorization form. Obtain a personal OAuth access token at https://wakatime.com/oauth (sign-in required) with email and read_summaries scopes; API keys cannot be used for reads. Tokens can expire or be revoked and may require reauthorization. Connecting contacts api.wakatime.com; the connection remains unverified until then.'),label,username,save);form.onsubmit=event=>{event.preventDefault();void saveWakatime(username,save);};actions.append(form);}
|
|
159
|
-
if(row.nextcloudSetupAvailable&&!closed){const form=element('form'),label=element('label','Nextcloud HTTPS instance URL'),input=element('input'),destination=element('p'),save=element('button','Save Nextcloud instance','button secondary');label.htmlFor='nextcloud-instance';input.id=label.htmlFor;input.type='url';input.maxLength=512;input.required=true;input.placeholder='https://cloud.example.com/nextcloud';input.oninput=()=>{const v=input.value;let valid=false;try{const u=new URL(v);valid=v.startsWith('https://')&&!v.includes('@')&&!v.includes('?')&&!v.includes('#')&&!v.includes(String.fromCharCode(92))&&[...v].every(c=>c.charCodeAt(0)>32&&c.charCodeAt(0)!==127)&&!/%(?:2f|5c|2e|25|0[0-9a-f]|1[0-9a-f]|7f)/i.test(v)&&u.protocol==='https:'&&!v.slice(8).split('/').some(part=>part==='.'||part==='..');if(valid)destination.textContent='Authorization destination: '+(u.href.endsWith('/')?u.href.slice(0,-1):u.href)+'/index.php/apps/app_api/proxy/context_agent/mcp/';}catch{}if(!valid)destination.textContent='';};save.type='submit';save.disabled=active;form.append(element('p','Check the destination carefully. Restart Zortex after saving; enter your app password only in the protected local authorization form. Saving does not connect or verify the instance. Existing sessions can keep using the previous destination until restart; a changed destination requires authorization again.'),label,input,destination,save);form.onsubmit=event=>{event.preventDefault();void saveNextcloud(input,save);};actions.append(form);}
|
|
160
|
-
if(row.dropboxSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','Dropbox public app key'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Dropbox setup','button secondary');clientLabel.htmlFor='dropbox-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='dropbox-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Create and approve your own public Dropbox app first and register the exact callback http://localhost:PORT/callback using the port below. Enter only the app key, never a client secret. After saving, Zortex activates the setup and continues authorization and connection checks.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveDropbox(client,port,save);};actions.append(form);}
|
|
161
|
-
if(row.boxSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','Box client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Box setup','button secondary');clientLabel.htmlFor='box-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='box-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Use your own approved Box OAuth app and register http://localhost:PORT/callback. Enter only its client ID and port here; provide the client secret only in the protected local OAuth form during connection. Box scope root_readwrite grants write access even when the connector is in read-only mode. Saving does not authorize or connect.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveBox(client,port,save);};actions.append(form);}
|
|
162
|
-
if(row.frontSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','Front client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Front setup','button secondary');clientLabel.htmlFor='front-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='front-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Use your own Front MCP connector client, register the exact callback http://localhost:PORT/callback using the port below, and select only Read resource permissions. Enter only its client ID and port here; provide the client secret only in the protected local OAuth form during connection. Front determines account permissions during authorization; they may allow writes even when the connector is in read-only mode. Saving does not authorize or connect.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveFront(client,port,save);};actions.append(form);}
|
|
163
|
-
if(row.hubspotSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','HubSpot client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save HubSpot setup','button secondary');clientLabel.htmlFor='hubspot-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='hubspot-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Use your own HubSpot MCP connector client and register http://localhost:PORT/callback. Enter only its client ID and port here; provide the client secret only in the protected local OAuth form during connection. HubSpot determines account permissions during authorization; they may allow writes even when the connector is in read-only mode. Saving does not authorize or connect.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveHubSpot(client,port,save);};actions.append(form);}
|
|
164
|
-
if(row.googleContactsSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','Google Contacts client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Google Contacts setup','button secondary');clientLabel.htmlFor='google-contacts-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='google-contacts-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Configure the People API and Web OAuth app with registered callback http://localhost:PORT/callback. Scope: https://www.googleapis.com/auth/contacts.readonly. The provider verifies project eligibility. Continue setup and connection with the available tools; keep the client secret in the protected local OAuth form.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveGoogleContacts(client,port,save);};actions.append(form);}
|
|
165
|
-
if(row.googleChatSetupAvailable&&!closed){const form=element('form'),clientLabel=element('label','Google Chat client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Google Chat setup','button secondary');clientLabel.htmlFor='google-chat-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='google-chat-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Configure the Google Chat API and Web OAuth app with registered callback http://localhost:PORT/callback. Default scopes: https://www.googleapis.com/auth/chat.messages.readonly and https://www.googleapis.com/auth/chat.spaces.readonly. Full Actions can also request chat.memberships.readonly, chat.messages.create and chat.users.readstate. The provider verifies project eligibility. Continue setup and connection with the available tools; keep the client secret in the protected local OAuth form.'),clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveGoogleChat(client,port,save);};actions.append(form);}
|
|
166
|
-
if(row.salesforceSetupAvailable&&!closed){const form=element('form'),envLabel=element('label','Salesforce environment'),env=element('select'),clientLabel=element('label','Salesforce client ID'),client=element('input'),portLabel=element('label','Registered localhost callback port'),port=element('input'),save=element('button','Save Salesforce setup','button secondary');envLabel.htmlFor='salesforce-environment';env.id=envLabel.htmlFor;for(const value of ['production','sandbox']){const option=element('option',value);option.value=value;env.append(option);}clientLabel.htmlFor='salesforce-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';portLabel.htmlFor='salesforce-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;form.append(element('p','Use your own approved Salesforce External Client App with secret requirements disabled and register http://localhost:PORT/callback. mcp_api and refresh_token permissions are not a guarantee of read-only access. After saving, Zortex continues authorization and checks access.'),envLabel,env,clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveSalesforce(env,client,port,save);};actions.append(form);}
|
|
167
|
-
if(row.zendeskSetupAvailable&&!closed){const form=element('form'),tenantLabel=element('label','Zendesk subdomain'),tenant=element('input'),clientLabel=element('label','Zendesk public OAuth client ID'),client=element('input'),portLabel=element('label','Registered callback port'),port=element('input'),save=element('button','Save Zendesk setup','button secondary');tenantLabel.htmlFor='zendesk-tenant';tenant.id=tenantLabel.htmlFor;tenant.required=true;tenant.placeholder='your-company';tenant.maxLength=63;clientLabel.htmlFor='zendesk-client';client.id=clientLabel.htmlFor;client.required=true;client.maxLength=512;client.autocomplete='off';portLabel.htmlFor='zendesk-port';port.id=portLabel.htmlFor;port.type='number';port.min='1024';port.max='65535';port.required=true;save.type='submit';save.disabled=active;const guide=element('a','Zendesk OAuth client registration guide');guide.href='https://developer.zendesk.com/documentation/authentication/oauth-pkce/';guide.target='_blank';guide.rel='noopener noreferrer';form.append(element('p','A Zendesk administrator must first register a public OAuth client for your tenant and the exact callback http://127.0.0.1:PORT/callback. Enter its public client ID; no client secret or token is requested here. After saving, continue the provider page for tickets:read, users:read and organizations:read. Saving setup does not authorize or verify a connection.'),guide,tenantLabel,tenant,clientLabel,client,portLabel,port,save);form.onsubmit=event=>{event.preventDefault();void saveZendesk(tenant,client,port,save);};actions.append(form);}
|
|
168
|
-
if(row.zoomSetupAvailable&&!closed){const form=element('form'),label=element('label','Zoom public client ID'),client=element('input'),save=element('button','Save Zoom setup','button secondary');label.htmlFor='zoom-client';client.id=label.htmlFor;client.required=true;client.maxLength=2048;client.autocomplete='off';save.type='submit';save.disabled=active;form.append(element('p','Use your own eligible Zoom public OAuth app and register http://127.0.0.1/callback. Enter only the public client ID, never a client secret. After saving, Zortex continues authorization and checks access.'),label,client,save);form.onsubmit=event=>{event.preventDefault();void saveZoom(client,save);};actions.append(form);}
|
|
169
|
-
if(row.figmaSetupAvailable&&!closed){const save=element('button','Use Figma personal access token','button secondary');save.type='button';save.disabled=active;save.onclick=()=>void saveFigma(save,'fields');const oauth=element('button','Use Figma hosted OAuth','button secondary');oauth.type='button';oauth.disabled=active;oauth.onclick=()=>void saveFigma(oauth,'oauth');actions.append(element('p','Choose a Figma connection mode. The token must allow current_user:read and the file access you need. Hosted OAuth requires Figma product-client approval.'),save,oauth);}
|
|
170
|
-
if(row.smartsheetSetupAvailable&&!closed){const form=element('form'),label=element('label','Smartsheet region'),select=element('select'),save=element('button','Save Smartsheet region','button secondary');label.htmlFor='smartsheet-region';select.id=label.htmlFor;for(const [value,name] of [['us','United States'],['eu','Europe'],['au','Australia']]){const option=element('option',name);option.value=value;select.append(option);}save.type='submit';save.disabled=active;form.append(element('p','Choose your account region. After saving, use the available tools to enter your API key only in the local authorization form. Connection is not yet verified.'),label,select,save);form.onsubmit=event=>{event.preventDefault();void saveSmartsheet(select,save);};actions.append(form);}
|
|
171
|
-
if(row.freshdeskSetupAvailable&&!closed){const form=element('form'),label=element('label','Freshdesk tenant name'),input=element('input'),save=element('button','Save Freshdesk tenant','button secondary');label.htmlFor='freshdesk-tenant';input.id=label.htmlFor;input.required=true;input.maxLength=63;input.autocomplete='off';input.placeholder='tenant (without .freshdesk.com)';save.type='submit';save.disabled=active;form.append(element('p','Enter only the tenant name, not an API key. After saving, use the available tools to enter your key only in the local authorization form. Connection is not yet verified.'),label,input,save);form.onsubmit=event=>{event.preventDefault();void saveFreshdesk(input,save);};actions.append(form);}
|
|
172
|
-
if(row.copyqSetupAvailable&&!closed){const form=element('form'),label=element('label','Trusted CopyQ program absolute path'),input=element('input'),sessionLabel=element('label','CopyQ session name (optional)'),session=element('input'),save=element('button','Save CopyQ settings','button secondary');label.htmlFor='copyq-executable';input.id=label.htmlFor;input.required=true;input.maxLength=512;input.autocomplete='off';sessionLabel.htmlFor='copyq-session';session.id=sessionLabel.htmlFor;session.maxLength=32;session.autocomplete='off';save.type='submit';save.disabled=active;form.append(element('p','Choose a trusted installed CopyQ program. uvx must be available; the first connection may download a fixed-hash MCP wheel. Saving settings does not run CopyQ or read the clipboard. Zortex activates the source after saving and checks the connection.'),label,input,sessionLabel,session,save);form.onsubmit=event=>{event.preventDefault();void saveCopyQ(input,session,save);};actions.append(form);}
|
|
173
|
-
if(row.wechatSetupAvailable&&!closed){const form=element('form'),label=element('label','WeChat local MCP port'),input=element('input'),save=element('button','Save WeChat port','button secondary');label.htmlFor='wechat-port';input.id=label.htmlFor;input.type='number';input.min='1024';input.max='65535';input.required=true;save.type='submit';save.disabled=active;form.append(element('p','Requires a compatible third-party chatlog MCP service already running locally. Its upstream was removed and read-only behavior has not been verified.'),label,input,save);form.onsubmit=event=>{event.preventDefault();void saveWeChat(input,save);};actions.append(form);}
|
|
174
|
-
if(row.thunderbirdSetupAvailable&&!closed){const form=element('form'),label=element('label','Thunderbird local MCP port'),input=element('input'),save=element('button','Save Thunderbird port','button secondary');label.htmlFor='thunderbird-port';input.id=label.htmlFor;input.type='number';input.min='1024';input.max='65535';input.required=true;save.type='submit';save.disabled=active;form.append(element('p','Use a trusted Thunderbird MCP extension and confirm its local service and port. After saving, use the available tools to enter the token only in the protected local authorization form. Changing the port requires authorization again. Saving does not connect or verify the service.'),label,input,save);form.onsubmit=event=>{event.preventDefault();void saveThunderbird(input,save);};actions.append(form);}
|
|
175
|
-
if(row.discordSetupAvailable&&!closed){const form=element('form'),description=element('p','Requires an existing approved Discord application, Discord desktop, and an approved RPC access token including messages.read. Zortex cannot obtain a token for you. Select the exact app, user, local Discord IPC path and channels. After saving, use the available tools to enter your existing token only in the protected local authorization form. Changing this selection requires authorization again. Saving does not connect or verify the service.'),client=element('input'),subject=element('input'),ipc=element('input'),channels=element('input'),save=element('button','Save Discord selection','button secondary');for(const [input,label] of [[client,'Discord application ID'],[subject,'Discord user ID'],[ipc,'Discord local IPC path'],[channels,'Selected channel IDs (comma separated)']]){const l=element('label',label);input.type='text';input.required=true;input.maxLength=input===ipc?512:input===channels?1100:20;l.append(input);form.append(l);}save.type='submit';save.disabled=active;form.prepend(description);form.append(save);form.onsubmit=event=>{event.preventDefault();void saveDiscord(client,subject,ipc,channels,save);};actions.append(form);}
|
|
176
|
-
if(row.protonMailSetupAvailable&&!closed){const form=element('form'),label=element('label','Proton Bridge IMAP port'),input=element('input'),save=element('button','Save Proton Bridge port','button secondary');label.htmlFor='proton-mail-port';input.id=label.htmlFor;input.type='number';input.min='1024';input.max='65535';input.required=true;save.type='submit';save.disabled=active;form.append(element('p','Requires a signed-in Proton Mail Bridge, its dedicated Bridge credentials, Python 3.13 or newer and uvx. Connecting may download a third-party package. Confirm the Bridge IMAP port. After saving, use the available tools to enter Bridge credentials only in the protected local authorization form. Changing the port requires authorization again. Saving does not connect or verify the service.'),label,input,save);form.onsubmit=event=>{event.preventDefault();void saveProtonMail(input,save);};actions.append(form);}
|
|
177
|
-
if(row.owntracksSetupAvailable&&!closed){const form=element('form'),label=element('label','OwnTracks local MCP port'),input=element('input'),save=element('button','Save OwnTracks port','button secondary');label.htmlFor='owntracks-port';input.id=label.htmlFor;input.type='number';input.min='1024';input.max='65535';input.required=true;save.type='submit';save.disabled=active;form.append(label,input,save);form.onsubmit=event=>{event.preventDefault();void saveOwnTracks(input,save);};actions.append(form);}
|
|
178
|
-
if(row.zoteroSetupAvailable&&!closed){const form=element('form'),label=element('label','Zotero library ID'),input=element('input'),type=element('select'),save=element('button','Save Zotero library','button secondary');label.htmlFor='zotero-library-id';input.id=label.htmlFor;input.required=true;input.maxLength=20;input.inputMode='numeric';input.autocomplete='off';type.setAttribute('aria-label','Zotero library type');for(const [value,text] of [['user','Personal library'],['group','Group library']]){const option=element('option',text);option.value=value;type.append(option);}save.type='submit';save.disabled=active;form.append(element('p','If you previously connected Zotero, select your library and save it again to update the local connection. For a personal library, use ID 0; group libraries require their group ID. Start Zotero and enable its local API, then save. Zortex activates the configuration and checks the connection.'),label,input,type,save);form.onsubmit=event=>{event.preventDefault();void saveZotero(input,type,save);};actions.append(form);}
|
|
179
|
-
if(row.setupAvailable&&!closed){const form=element('form'),label=element('label','Folder path on this computer'),input=element('input'),save=element('button','Save folder','button secondary');label.htmlFor='folder-'+row.source;input.id=label.htmlFor;input.type='text';input.required=true;input.maxLength=512;input.autocomplete='off';input.placeholder='Absolute folder path';save.type='submit';save.disabled=active;form.append(label,input);if(row.source==='obsidian'){const discover=element('button','Find Obsidian folders','button secondary'),suggestions=element('div');suggestions.id='obsidian-folder-suggestions';discover.type='button';discover.disabled=active;discover.onclick=()=>void findObsidianFolders(discover);form.append(discover,suggestions);showObsidianFolders(suggestions,input);}form.append(save);form.onsubmit=event=>{event.preventDefault();void saveFolder(row.source,input,save);};actions.append(form);}
|
|
180
|
-
if(row.joplinSetupAvailable&&!closed){
|
|
181
|
-
const section=element('section',null,'joplin-pairing'),pair=joplinPairing;
|
|
182
|
-
section.append(element('h4','Pair with Joplin'),element('p','Install the Zortex Read-only Bridge .jpl plugin in Joplin: Tools \u2192 Options \u2192 Plugins \u2192 Install from file, then restart Joplin. Open Tools \u2192 Pair with Zortex. Exchange only the public keys below; never paste a Joplin API token or password.'));
|
|
183
|
-
if(!pair){const start=element('button','Start Joplin pairing','button secondary');start.type='button';start.disabled=active;start.dataset.focus='joplin-pair-start';start.onclick=()=>void pairJoplin({phase:'start'},start);section.append(start);}
|
|
184
|
-
else{
|
|
185
|
-
section.append(element('p','Pairing expires at '+new Date(pair.expiresAt).toLocaleTimeString()+'. Keep this Help page and Joplin open.'));
|
|
186
|
-
if(pair.state==='pairing'){
|
|
187
|
-
const form=element('form'),keyLabel=element('label','Zortex public key \u2014 paste into Joplin'),key=element('input'),pluginLabel=element('label','Joplin public key \u2014 copy from the plugin'),pluginKey=element('input'),inspect=element('button','Compare fingerprints','button');
|
|
188
|
-
key.id='joplin-zortex-public-'+pair.pairingId;keyLabel.htmlFor=key.id;key.type='text';key.value=pair.zortexPublicKey;key.readOnly=true;
|
|
189
|
-
pluginKey.id='joplin-plugin-public-'+pair.pairingId;pluginLabel.htmlFor=pluginKey.id;pluginKey.type='text';pluginKey.required=true;pluginKey.maxLength=88;pluginKey.pattern='[a-f0-9]{88}';pluginKey.autocomplete='off';pluginKey.spellcheck=false;
|
|
190
|
-
inspect.type='submit';inspect.disabled=active;form.append(keyLabel,key,pluginLabel,pluginKey,inspect);form.onsubmit=event=>{event.preventDefault();void pairJoplin({phase:'inspect',pairingId:pair.pairingId,pluginPublicKey:pluginKey.value.trim()},inspect);};section.append(form);
|
|
191
|
-
}else{
|
|
192
|
-
const form=element('form'),fingerprint=element('code',pair.fingerprint),portLabel=element('label','Port displayed by Joplin'),port=element('input'),confirm=element('button','Complete Joplin pairing','button');
|
|
193
|
-
section.append(element('p','Use the available computer tools to match this fingerprint in Joplin and complete its pairing step. A mismatch cannot connect. Use the port returned by Joplin.'),fingerprint);
|
|
194
|
-
port.id='joplin-pair-port-'+pair.pairingId;portLabel.htmlFor=port.id;port.type='number';port.min='1024';port.max='65535';port.required=true;confirm.type='submit';confirm.disabled=active;
|
|
195
|
-
form.append(portLabel,port,confirm);form.onsubmit=event=>{event.preventDefault();void pairJoplin({phase:'confirm',pairingId:pair.pairingId,port:Number(port.value),fingerprint:pair.fingerprint},confirm);};section.append(form);
|
|
196
|
-
}
|
|
197
|
-
const cancel=element('button','Cancel Joplin pairing','button secondary');cancel.type='button';cancel.disabled=active;cancel.onclick=()=>void pairJoplin({phase:'cancel',pairingId:pair.pairingId},cancel);section.append(cancel);
|
|
198
|
-
}
|
|
199
|
-
actions.append(section);
|
|
200
|
-
}
|
|
201
|
-
if(actions.childElementCount)item.append(actions);
|
|
202
|
-
[...item.querySelectorAll('input,select,textarea')].forEach((node,index)=>{node.dataset.draft=row.source+':'+(node.id||String(index));});return item;
|
|
203
|
-
}
|
|
204
|
-
for(const row of pending)main.append(card(row));
|
|
205
|
-
function group(rows,key,label){if(!rows.length)return;const details=element('details');details.dataset.group=key;details.open=expanded.has(key)||!pending.length||(initial&&key==='catalog');const summary=element('summary',label+' ('+rows.length+')');summary.dataset.focus='group-'+key;details.append(summary);for(const row of rows)details.append(card(row));main.append(details);}
|
|
206
|
-
group(complete,'complete','Ready to use');group(unavailable,'unavailable','Unavailable');
|
|
207
|
-
let draftTarget;
|
|
208
|
-
if(!closed)for(const node of draftFields(main)){const draft=drafts.get(node.dataset.draft);if(!draft)continue;if(draft.selected){for(const option of node.options)option.selected=draft.selected.includes(option.value);}else node.value=draft.value;if(typeof draft.checked==='boolean')node.checked=draft.checked;if(node.dataset.draft===focusDraft&&!node.disabled)draftTarget=node;}
|
|
209
|
-
if(draftTarget){const details=draftTarget.closest('details');if(details)details.open=true;draftTarget.focus({preventScroll:true});if(selection&&typeof draftTarget.setSelectionRange==='function')draftTarget.setSelectionRange(selection.start,selection.end,selection.direction);}
|
|
210
|
-
else if(focusKey){const target=[...main.querySelectorAll('[data-focus]')].find(node=>node.dataset.focus===focusKey&&!node.disabled);if(target)target.focus({preventScroll:true});else if(focusSource){const title=document.getElementById('source-'+focusSource);if(title){const details=title.closest('details');if(details)details.open=true;title.tabIndex=-1;title.focus({preventScroll:true});}}}
|
|
211
|
-
if(closed)ended=true;
|
|
212
|
-
}
|
|
213
|
-
document.getElementById('later').onclick=async()=>{try{render(await api({action:'close'}));ended=true;}catch(error){notice(error.message,true);}};
|
|
214
|
-
async function poll(){if(ended||inflight)return;if(pollTimer){clearTimeout(pollTimer);pollTimer=undefined;}inflight=true;try{render(await api({action:'status'}));}catch(error){notice(error.message,true);}finally{inflight=false;if(!ended)pollTimer=setTimeout(()=>{pollTimer=undefined;poll();},1000);}}poll();
|
|
215
|
-
<\/script></body></html>`}
|