synabun 2.0.5 → 2.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +40 -0
- package/README.md +2 -1
- package/THIRD-PARTY-LICENSES.md +13 -0
- package/docs/whatsapp.md +151 -16
- package/hooks/claude-code/shared.mjs +6 -3
- package/lib/child-path.js +303 -0
- package/lib/claude-hooks.js +2 -1
- package/lib/data-home-migration.js +2 -0
- package/lib/desktop-app.js +265 -0
- package/lib/external-tools.js +7 -3
- package/lib/log-redact.js +102 -0
- package/lib/packaged-runtime.js +138 -11
- package/mcp-server/dist/http.d.ts +3 -1
- package/mcp-server/dist/http.d.ts.map +1 -1
- package/mcp-server/dist/http.js +15 -4
- package/mcp-server/dist/http.js.map +1 -1
- package/mcp-server/dist/index.d.ts.map +1 -1
- package/mcp-server/dist/index.js +9 -6
- package/mcp-server/dist/index.js.map +1 -1
- package/mcp-server/dist/services/budget-judgments.d.ts +108 -0
- package/mcp-server/dist/services/budget-judgments.d.ts.map +1 -0
- package/mcp-server/dist/services/budget-judgments.js +153 -0
- package/mcp-server/dist/services/budget-judgments.js.map +1 -0
- package/mcp-server/dist/services/codex-config-heal.d.ts +5 -1
- package/mcp-server/dist/services/codex-config-heal.d.ts.map +1 -1
- package/mcp-server/dist/services/codex-config-heal.js +41 -4
- package/mcp-server/dist/services/codex-config-heal.js.map +1 -1
- package/mcp-server/dist/services/identity.d.ts +11 -0
- package/mcp-server/dist/services/identity.d.ts.map +1 -1
- package/mcp-server/dist/services/identity.js +24 -0
- package/mcp-server/dist/services/identity.js.map +1 -1
- package/mcp-server/dist/services/neural-interface.d.ts +13 -0
- package/mcp-server/dist/services/neural-interface.d.ts.map +1 -1
- package/mcp-server/dist/services/neural-interface.js +34 -2
- package/mcp-server/dist/services/neural-interface.js.map +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts +1 -1
- package/mcp-server/dist/services/typesafe-config.d.ts.map +1 -1
- package/mcp-server/dist/services/typesafe-config.js +4 -1
- package/mcp-server/dist/services/typesafe-config.js.map +1 -1
- package/mcp-server/dist/tools/agents.d.ts +10 -7
- package/mcp-server/dist/tools/agents.d.ts.map +1 -1
- package/mcp-server/dist/tools/agents.js +34 -13
- package/mcp-server/dist/tools/agents.js.map +1 -1
- package/mcp-server/dist/tools/whatsapp-send-file.d.ts +17 -0
- package/mcp-server/dist/tools/whatsapp-send-file.d.ts.map +1 -0
- package/mcp-server/dist/tools/whatsapp-send-file.js +44 -0
- package/mcp-server/dist/tools/whatsapp-send-file.js.map +1 -0
- package/mcp-server/dist/tui.js +2 -1
- package/mcp-server/dist/tui.js.map +1 -1
- package/mcp-server/dist/version.d.ts +5 -0
- package/mcp-server/dist/version.d.ts.map +1 -0
- package/mcp-server/dist/version.js +21 -0
- package/mcp-server/dist/version.js.map +1 -0
- package/mcp-server/package-lock.json +2 -2
- package/mcp-server/package.json +1 -1
- package/mcp-server/run.mjs +15 -9
- package/mcp-server/src/http.ts +18 -3
- package/mcp-server/src/index.ts +9 -6
- package/mcp-server/src/services/budget-judgments.ts +183 -0
- package/mcp-server/src/services/codex-config-heal.ts +35 -4
- package/mcp-server/src/services/identity.ts +27 -0
- package/mcp-server/src/services/neural-interface.ts +34 -2
- package/mcp-server/src/services/typesafe-config.ts +4 -1
- package/mcp-server/src/tools/agents.ts +33 -14
- package/mcp-server/src/tools/whatsapp-send-file.ts +51 -0
- package/mcp-server/src/tui.ts +2 -1
- package/mcp-server/src/version.ts +22 -0
- package/neural-interface/i18n/en.json +627 -57
- package/neural-interface/i18n/pt-BR.json +626 -56
- package/neural-interface/lib/account-usage.js +163 -0
- package/neural-interface/lib/assistant-api.js +255 -52
- package/neural-interface/lib/assistant-brains/claude.js +15 -2
- package/neural-interface/lib/assistant-brains/codex.js +3 -0
- package/neural-interface/lib/assistant-brains/opencode.js +17 -4
- package/neural-interface/lib/assistant-budget-planner.js +390 -0
- package/neural-interface/lib/assistant-budget-split.js +408 -0
- package/neural-interface/lib/assistant-budget.js +94 -95
- package/neural-interface/lib/assistant-config.js +62 -14
- package/neural-interface/lib/assistant-dispatch.js +432 -125
- package/neural-interface/lib/assistant-jev.js +26 -3
- package/neural-interface/lib/assistant-persona.js +68 -11
- package/neural-interface/lib/assistant-plan-permissions.js +8 -1
- package/neural-interface/lib/assistant-route-accounts.js +14 -0
- package/neural-interface/lib/assistant-route-gate.js +19 -3
- package/neural-interface/lib/assistant-router.js +373 -42
- package/neural-interface/lib/assistant-runtime.js +307 -47
- package/neural-interface/lib/assistant-user-writer.js +4 -2
- package/neural-interface/lib/augmented-path.js +317 -53
- package/neural-interface/lib/claude-accounts.js +342 -31
- package/neural-interface/lib/claude-agent-bridge.js +90 -3
- package/neural-interface/lib/claude-executable.js +6 -1
- package/neural-interface/lib/claude-model-catalog.js +3 -3
- package/neural-interface/lib/claude-panel-auth.js +221 -0
- package/neural-interface/lib/claude-profile-api-key.js +62 -0
- package/neural-interface/lib/cli-install-api.js +137 -0
- package/neural-interface/lib/cli-install.js +797 -0
- package/neural-interface/lib/cli-path.js +130 -0
- package/neural-interface/lib/cli-resolver.js +744 -0
- package/neural-interface/lib/cli-update-planner.js +143 -7
- package/neural-interface/lib/codex-account-auth.js +178 -0
- package/neural-interface/lib/codex-accounts.js +489 -0
- package/neural-interface/lib/codex-capabilities.js +2 -1
- package/neural-interface/lib/codex-compat-rpc.js +8 -2
- package/neural-interface/lib/codex-mcp-approvals.js +5 -1
- package/neural-interface/lib/codex-panel-auth.js +62 -0
- package/neural-interface/lib/codex-session-settings.js +1 -1
- package/neural-interface/lib/codex-settings-schema.js +120 -0
- package/neural-interface/lib/desktop/config.js +3 -0
- package/neural-interface/lib/git-bash/bzip2.js +339 -0
- package/neural-interface/lib/git-bash/claude-settings.js +73 -0
- package/neural-interface/lib/git-bash/extract-worker.js +34 -0
- package/neural-interface/lib/git-bash/install.js +529 -0
- package/neural-interface/lib/git-bash/licenses/COPYING +360 -0
- package/neural-interface/lib/git-bash/licenses/LGPL-2.1 +511 -0
- package/neural-interface/lib/git-bash/manager.js +268 -0
- package/neural-interface/lib/git-bash/pins.js +206 -0
- package/neural-interface/lib/git-bash/pins.json +34 -0
- package/neural-interface/lib/git-bash/resolver.js +194 -0
- package/neural-interface/lib/git-read.js +34 -2
- package/neural-interface/lib/install-details.js +145 -0
- package/neural-interface/lib/mcp-installer.js +14 -2
- package/neural-interface/lib/native-loop-providers.js +16 -3
- package/neural-interface/lib/native-loop-runtime.js +9 -4
- package/neural-interface/lib/os-path.js +319 -0
- package/neural-interface/lib/provider-panel-api-key-auth.js +92 -0
- package/neural-interface/lib/provider-panel-terminal-auth.js +95 -0
- package/neural-interface/lib/pty-host/core.js +2 -1
- package/neural-interface/lib/pty-host/manager.js +27 -2
- package/neural-interface/lib/remote-policy.js +20 -11
- package/neural-interface/lib/session-title-generator.js +4 -3
- package/neural-interface/lib/system-about.js +340 -0
- package/neural-interface/lib/system-activity.js +66 -0
- package/neural-interface/lib/terminal-env.js +11 -3
- package/neural-interface/lib/terminal-path.js +55 -0
- package/neural-interface/lib/virtual-socket.js +12 -1
- package/neural-interface/lib/whatsapp/baileys-adapter.js +165 -45
- package/neural-interface/lib/whatsapp/bridge.js +78 -34
- package/neural-interface/lib/whatsapp/commands.js +13 -14
- package/neural-interface/lib/whatsapp/config.js +134 -20
- package/neural-interface/lib/whatsapp/fake-baileys.js +99 -14
- package/neural-interface/lib/whatsapp/host-core.js +168 -35
- package/neural-interface/lib/whatsapp/inbound.js +5 -3
- package/neural-interface/lib/whatsapp/local-file.js +524 -0
- package/neural-interface/lib/whatsapp/manager.js +92 -32
- package/neural-interface/lib/whatsapp/paths.js +11 -1
- package/neural-interface/lib/whatsapp/protocol.js +65 -5
- package/neural-interface/lib/whatsapp/redact.js +63 -0
- package/neural-interface/lib/whatsapp/service.js +343 -91
- package/neural-interface/lib/whatsapp/transcription.js +463 -0
- package/neural-interface/package-lock.json +2 -2
- package/neural-interface/package.json +1 -1
- package/neural-interface/public/index.html +2 -0
- package/neural-interface/public/index2d.html +2 -0
- package/neural-interface/public/offline.html +16 -1
- package/neural-interface/public/onboarding.html +96 -2
- package/neural-interface/public/shared/account-i18n.js +7 -0
- package/neural-interface/public/shared/account-menu.js +539 -0
- package/neural-interface/public/shared/account-usage.js +19 -0
- package/neural-interface/public/shared/account-view.js +335 -0
- package/neural-interface/public/shared/agent-runtime-options.js +28 -8
- package/neural-interface/public/shared/assistant/asst-accounts.js +182 -184
- package/neural-interface/public/shared/assistant/asst-api.js +32 -2
- package/neural-interface/public/shared/assistant/asst-brain-picker.js +124 -25
- package/neural-interface/public/shared/assistant/asst-budget.js +259 -303
- package/neural-interface/public/shared/assistant/asst-mascot.js +126 -7
- package/neural-interface/public/shared/assistant/asst-menu.js +15 -3
- package/neural-interface/public/shared/assistant/asst-panel.js +48 -14
- package/neural-interface/public/shared/assistant/asst-render.js +38 -7
- package/neural-interface/public/shared/assistant/asst-route.js +72 -14
- package/neural-interface/public/shared/assistant/asst-routes-editor.js +45 -6
- package/neural-interface/public/shared/assistant/asst-slash.js +1 -1
- package/neural-interface/public/shared/assistant/asst-state.js +1 -1
- package/neural-interface/public/shared/assistant/asst-styles.js +99 -17
- package/neural-interface/public/shared/cdx/cdx-commands.js +4 -1
- package/neural-interface/public/shared/cdx/cdx-features.js +22 -14
- package/neural-interface/public/shared/cdx/cdx-icons.js +2 -0
- package/neural-interface/public/shared/cdx/cdx-panel.js +48 -107
- package/neural-interface/public/shared/cdx/cdx-settings.js +231 -0
- package/neural-interface/public/shared/cdx/cdx-styles.js +128 -107
- package/neural-interface/public/shared/cdx/cdx-tabs.js +261 -664
- package/neural-interface/public/shared/cdx/cdx-ws.js +2 -0
- package/neural-interface/public/shared/claude-account-view.js +3 -0
- package/neural-interface/public/shared/cli-install-view.js +392 -0
- package/neural-interface/public/shared/cli-status.js +282 -22
- package/neural-interface/public/shared/cp/cp-events.js +2 -1
- package/neural-interface/public/shared/cp/cp-styles.js +46 -0
- package/neural-interface/public/shared/desktop-bridge.js +39 -0
- package/neural-interface/public/shared/desktop-titlebar-page.js +59 -0
- package/neural-interface/public/shared/desktop-titlebar-view.js +122 -0
- package/neural-interface/public/shared/desktop-titlebar.js +153 -0
- package/neural-interface/public/shared/desktop-update-view.js +462 -0
- package/neural-interface/public/shared/editor/editor-panel.js +1 -1
- package/neural-interface/public/shared/explorer/fx-main.js +1 -1
- package/neural-interface/public/shared/git-bash-view.js +145 -0
- package/neural-interface/public/shared/html-shell.js +1 -0
- package/neural-interface/public/shared/i18n.js +19 -1
- package/neural-interface/public/shared/install-details-view.js +86 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-panel.js +32 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-send.js +17 -0
- package/neural-interface/public/shared/ocp-v2/ocp-v2-styles.js +118 -0
- package/neural-interface/public/shared/pwa-install-page.js +3 -1
- package/neural-interface/public/shared/settings/settings-about-pane.js +271 -0
- package/neural-interface/public/shared/settings/settings-about.js +254 -0
- package/neural-interface/public/shared/settings/settings-ia.js +15 -0
- package/neural-interface/public/shared/showcase-privacy.js +489 -0
- package/neural-interface/public/shared/storage.js +30 -3
- package/neural-interface/public/shared/styles.css +278 -31
- package/neural-interface/public/shared/synabun-mascot.js +48 -2
- package/neural-interface/public/shared/ui-claude-panel.js +212 -213
- package/neural-interface/public/shared/ui-cli-banner.js +355 -0
- package/neural-interface/public/shared/ui-git-bash.js +124 -0
- package/neural-interface/public/shared/ui-judgments.js +10 -1
- package/neural-interface/public/shared/ui-loading.js +30 -6
- package/neural-interface/public/shared/ui-menubar.js +13 -3
- package/neural-interface/public/shared/ui-navbar.js +3 -1
- package/neural-interface/public/shared/ui-provider-auth.js +104 -0
- package/neural-interface/public/shared/ui-provider-terminal-auth.js +223 -0
- package/neural-interface/public/shared/ui-sessions.js +9 -3
- package/neural-interface/public/shared/ui-settings.js +55 -3
- package/neural-interface/public/shared/ui-sidepanel-sessions.js +3 -1
- package/neural-interface/public/shared/ui-sync.js +6 -0
- package/neural-interface/public/shared/ui-terminal.js +17 -0
- package/neural-interface/public/shared/ui-tool-updates.js +5 -0
- package/neural-interface/public/shared/ui-update.js +594 -5
- package/neural-interface/public/shared/ui-whatsapp.js +21 -6
- package/neural-interface/public/shared/whatsapp/wa-view.js +51 -8
- package/neural-interface/public/shared/worker-end.js +2 -0
- package/neural-interface/public/sw.js +1 -1
- package/neural-interface/public/variant/2d/main.js +10 -1
- package/neural-interface/public/variant/3d/main.js +10 -1
- package/neural-interface/server.js +1219 -608
- package/package.json +4 -1
- package/setup.js +9 -8
|
@@ -20,8 +20,8 @@ import { escapeHtml } from './utils.js';
|
|
|
20
20
|
import * as kit from './settings/settings-kit.js';
|
|
21
21
|
import { emit, on } from './state.js';
|
|
22
22
|
import {
|
|
23
|
-
waView, confirmLine, formatCountdown,
|
|
24
|
-
brainChoiceInUse, brainChoiceLabel, brainChoiceNotes,
|
|
23
|
+
waView, confirmLine, formatCountdown, levelLabel, modeLabel, chooseNote, connectorSize, brainLimitText,
|
|
24
|
+
brainChoiceInUse, brainChoiceLabel, brainChoiceNotes, connectionWarningText, transcriptionLine,
|
|
25
25
|
localizedCopy, localize, setTranslator,
|
|
26
26
|
} from './whatsapp/wa-view.js';
|
|
27
27
|
import { normalizePhone, PHONE_ERRORS as PHONE_ERROR_SOURCE } from './whatsapp/wa-phone.js';
|
|
@@ -59,8 +59,9 @@ const attr = (s) => String(s ?? '').replace(/&/g, '&').replace(/"/g, '"
|
|
|
59
59
|
const esc = (s) => escapeHtml(String(s ?? ''));
|
|
60
60
|
const num = (n) => Number(n || 0).toLocaleString('en-US');
|
|
61
61
|
const btn = (id, label, cls = '', extra = '') => `<button class="wa-btn${cls ? ` ${cls}` : ''}" id="${id}" type="button" ${extra}>${esc(label)}</button>`;
|
|
62
|
-
// `named`: the row's <strong id="<id>-label"> and <small id="<id>-help"> name and describe the switch
|
|
63
|
-
|
|
62
|
+
// `named`: the row's <strong id="<id>-label"> and <small id="<id>-help"> name and describe the switch
|
|
63
|
+
// (`alsoDescribedBy`: the id of one more line that describes it, such as a status line).
|
|
64
|
+
const toggle = (id, named = false, alsoDescribedBy = '') => `<label class="recall-toggle"><input type="checkbox" id="${id}"${named ? ` aria-labelledby="${id}-label" aria-describedby="${id}-help${alsoDescribedBy ? ` ${alsoDescribedBy}` : ''}"` : ''}><span class="recall-toggle-track"></span></label>`;
|
|
64
65
|
const tile = (id, label) => `<div class="db-stat"><span class="db-stat-label">${esc(label)}</span><span class="db-stat-value" id="${id}">—</span></div>`;
|
|
65
66
|
const radios = (name, options, invId = '') => `<div class="wa-radios" role="radiogroup"${invId ? ` ${kit.inv(invId)}` : ''}>${options.map((o) => `
|
|
66
67
|
<label class="wa-radio"><input type="radio" name="${name}" value="${attr(o.value)}"><span><strong>${esc(o.label)}</strong>${o.hint ? `<small>${esc(o.hint)}</small>` : ''}</span></label>`).join('')}</div>`;
|
|
@@ -114,6 +115,7 @@ export function buildWhatsAppTab() {
|
|
|
114
115
|
<ol class="wa-steps" id="wa-steps" hidden>${steps}</ol>
|
|
115
116
|
|
|
116
117
|
${section({ id: 'wa-sec-setup', badgeId: 'wa-setup-badge', body: `
|
|
118
|
+
<div class="wa-callout wa-callout-warn" id="wa-conn-warning" role="status" hidden></div>
|
|
117
119
|
<div class="wa-pane" data-pane="loading"><div class="settings-hint">${kit.te('settings.redesign.whatsapp.askingSynabunForTheWhatsappStatus')}</div></div>
|
|
118
120
|
<div class="wa-pane" data-pane="unavailable" hidden><div class="settings-hint" id="wa-unavailable-text"></div></div>
|
|
119
121
|
|
|
@@ -233,6 +235,7 @@ export function buildWhatsAppTab() {
|
|
|
233
235
|
<div class="settings-field"><label>${kit.te('settings.redesign.whatsapp.longAnswers')}</label>${radios('wa-max', MAX_MESSAGE_OPTIONS, 'WA045')}<div class="settings-hint">${kit.te('settings.redesign.whatsapp.longerAnswersAreCutThereWith')}</div></div>
|
|
234
236
|
<div class="settings-field"><label>${kit.te('settings.redesign.whatsapp.freshConversation')}</label>${radios('wa-rotation', ROTATION_OPTIONS, 'WA046')}</div>
|
|
235
237
|
<div class="settings-field" id="wa-trigger-field"><label>${kit.te('settings.redesign.whatsapp.inMessageYourself')}</label>${radios('wa-trigger', TRIGGER_OPTIONS, 'WA047')}</div>
|
|
238
|
+
<div class="settings-field wa-toggle-row" id="wa-voice-field" hidden><span><strong id="wa-voice-label">${kit.te('settings.redesign.whatsapp.transcribeVoiceNotes')}</strong><small id="wa-voice-help">${kit.te('settings.redesign.whatsapp.voiceNotesAreTurnedIntoText')}</small><small id="wa-voice-status" role="status"></small></span>${toggle('wa-voice', true, 'wa-voice-status')}</div>
|
|
236
239
|
<div class="settings-field"><label>${kit.te('settings.redesign.whatsapp.commandsYouCanSend')}</label>
|
|
237
240
|
<ul class="wa-commands">${COMMANDS.map((c) => `<li><code>${esc(c.name)}</code> ${esc(c.text)}</li>`).join('')}</ul>
|
|
238
241
|
<div class="settings-hint">${kit.te('settings.redesign.whatsapp.answerAQuestionOrAnApproval')}</div>
|
|
@@ -381,6 +384,10 @@ export function wireWhatsAppTab(overlay, { toast = () => {} } = {}) {
|
|
|
381
384
|
const pane = state.showChoose && ['link_expired', 'logged_out'].includes(status?.state) ? 'choose' : view.pane;
|
|
382
385
|
for (const el of tabBody.querySelectorAll('.wa-pane')) show(el, el.dataset.pane === pane);
|
|
383
386
|
renderPaneActions(view);
|
|
387
|
+
// A 440 / 403 the link keeps retrying: why, while it lasts (status.warning).
|
|
388
|
+
const warning = connectionWarningText(status);
|
|
389
|
+
setText($('wa-conn-warning'), warning);
|
|
390
|
+
show($('wa-conn-warning'), !!warning);
|
|
384
391
|
renderSetupDetails(status, view, pane);
|
|
385
392
|
renderConnector(status);
|
|
386
393
|
renderConversation(status);
|
|
@@ -422,7 +429,7 @@ export function wireWhatsAppTab(overlay, { toast = () => {} } = {}) {
|
|
|
422
429
|
[kit.tx('settings.redesign.whatsapp.mode'), modeLabel(s.mode)],
|
|
423
430
|
[kit.tx('settings.redesign.whatsapp.account'), [s.account?.name && s.account.name !== '~' ? s.account.name : null, s.account?.masked].filter(Boolean).join(' · ') || '—'],
|
|
424
431
|
[kit.tx('settings.redesign.whatsapp.owner'), s.owner?.masked ? `${s.owner.masked}${s.owner.boundAt ? (" " + kit.tx('settings.redesign.whatsapp.ownerSince', { date: new Date(s.owner.boundAt).toLocaleDateString() })) : ''}` : '—'],
|
|
425
|
-
[kit.tx('settings.redesign.whatsapp.level'),
|
|
432
|
+
[kit.tx('settings.redesign.whatsapp.level'), levelLabel(s.level)],
|
|
426
433
|
];
|
|
427
434
|
const html = lines.map(([k, v]) => `<div><strong>${esc(k)}</strong> ${esc(v)}</div>`).join('');
|
|
428
435
|
if ($('wa-connected-facts').innerHTML !== html) $('wa-connected-facts').innerHTML = html;
|
|
@@ -457,6 +464,13 @@ export function wireWhatsAppTab(overlay, { toast = () => {} } = {}) {
|
|
|
457
464
|
setRadio('wa-rotation', cfg.rotation);
|
|
458
465
|
setRadio('wa-trigger', cfg.selfTrigger);
|
|
459
466
|
show($('wa-trigger-field'), s.mode !== 'dedicated');
|
|
467
|
+
// Voice notes (a server without them sends neither the field nor status.transcription: the row stays hidden).
|
|
468
|
+
const voiceKnown = typeof cfg.transcriptionEnabled === 'boolean' && !!s.transcription;
|
|
469
|
+
show($('wa-voice-field'), voiceKnown);
|
|
470
|
+
if (voiceKnown) {
|
|
471
|
+
setChecked($('wa-voice'), cfg.transcriptionEnabled);
|
|
472
|
+
setText($('wa-voice-status'), transcriptionLine(s));
|
|
473
|
+
}
|
|
460
474
|
const session = s.session;
|
|
461
475
|
setText($('wa-session-line'), session?.id ? kit.tx('settings.redesign.whatsapp.sessionCurrent', { title: session.title || kit.tx('settings.redesign.whatsapp.whatsappConversation') }) : kit.tx('settings.redesign.whatsapp.noConversationYetYourFirstMessage'));
|
|
462
476
|
$('wa-open-conversation').disabled = !session?.id;
|
|
@@ -562,7 +576,7 @@ export function wireWhatsAppTab(overlay, { toast = () => {} } = {}) {
|
|
|
562
576
|
const box = $('wa-allow-box');
|
|
563
577
|
const e = state.escalation;
|
|
564
578
|
if (!e || Date.now() > e.expiresAt) { show(box, false); return; }
|
|
565
|
-
const html = `<strong>${kit.te('settings.redesign.whatsapp.nowOnYourPhone')}</strong> ${kit.te('settings.redesign.whatsapp.send')} <code class="wa-allow-code">ALLOW ${esc(e.code)}</code> ${kit.te('settings.redesign.whatsapp.inTheWhatsappChatWithSynabun')} <span id="wa-allow-countdown">${esc(formatCountdown(e.expiresAt - Date.now()))}</span>${kit.te('settings.redesign.whatsapp.
|
|
579
|
+
const html = `<strong>${kit.te('settings.redesign.whatsapp.nowOnYourPhone')}</strong> ${kit.te('settings.redesign.whatsapp.send')} <code class="wa-allow-code">ALLOW ${esc(e.code)}</code> ${kit.te('settings.redesign.whatsapp.inTheWhatsappChatWithSynabun')} <span id="wa-allow-countdown">${esc(formatCountdown(e.expiresAt - Date.now()))}</span>${kit.te('settings.redesign.whatsapp.autonomousUntilTurnedOff')}`;
|
|
566
580
|
if (box.dataset.sig !== e.code) { box.innerHTML = html; box.dataset.sig = e.code; }
|
|
567
581
|
show(box, true);
|
|
568
582
|
}
|
|
@@ -847,6 +861,7 @@ export function wireWhatsAppTab(overlay, { toast = () => {} } = {}) {
|
|
|
847
861
|
radioSave('wa-rotation', 'rotation');
|
|
848
862
|
radioSave('wa-trigger', 'selfTrigger');
|
|
849
863
|
$('wa-forward').addEventListener('change', () => putConfig({ forwardBackground: $('wa-forward').checked }));
|
|
864
|
+
$('wa-voice').addEventListener('change', () => putConfig({ transcriptionEnabled: $('wa-voice').checked }));
|
|
850
865
|
$('wa-label').addEventListener('input', renderLabelPreview);
|
|
851
866
|
$('wa-label-save').addEventListener('click', () => putConfig({ replyLabel: $('wa-label').value.trim() || null }).then((r) => { if (r.ok !== false) toast(kit.tx('settings.redesign.whatsapp.replyLabelSaved')); }));
|
|
852
867
|
|
|
@@ -69,7 +69,7 @@ export const MODE_CARDS = Object.freeze([
|
|
|
69
69
|
export const LEVEL_CARDS = Object.freeze([
|
|
70
70
|
{ id: 'read-only', title: 'Read-only', body: 'SynaBun answers, researches and plans. It never changes files, runs commands or starts agents from WhatsApp; a plan can only be approved on this computer.' },
|
|
71
71
|
{ id: 'ask', title: 'Ask on my phone', badge: 'Default', body: 'Before anything that would change your files, run a command or start an agent, SynaBun asks on WhatsApp and acts only on your yes. Any other message approves nothing: the conversation just carries on.' },
|
|
72
|
-
{ id: 'autonomous', title: 'Autonomous', body: 'SynaBun acts without asking, like the Assistant on this computer. Turning it on takes a second click here and an ALLOW code sent from your phone within 5 minutes. It
|
|
72
|
+
{ id: 'autonomous', title: 'Autonomous', body: 'SynaBun acts without asking, like the Assistant on this computer. Turning it on takes a second click here and an ALLOW code sent from your phone within 5 minutes. It stays on until you turn it off. Autonomous can read any file your computer account can, including SynaBun\'s WhatsApp login. Use it only with a locked phone, ideally on a second number.' },
|
|
73
73
|
]);
|
|
74
74
|
|
|
75
75
|
/** Ask and Autonomous need a Claude brain: the Safety warning when the WhatsApp conversation runs on another one (status.brainLimit). */
|
|
@@ -155,9 +155,35 @@ export const ROTATION_OPTIONS = Object.freeze([
|
|
|
155
155
|
]);
|
|
156
156
|
export const TRIGGER_OPTIONS = Object.freeze([
|
|
157
157
|
{ value: 'all', label: 'Every message in "Message yourself"', hint: 'Everything you write in your own chat goes to SynaBun.' },
|
|
158
|
-
{ value: 'prefix', label: 'Only messages that start with sb', hint: 'Keep using "Message yourself" for notes; start a message with sb (or sb:) to talk to SynaBun. Commands like /stop, the ALLOW code and replies to SynaBun\'s own messages always reach it.' },
|
|
158
|
+
{ value: 'prefix', label: 'Only messages that start with sb', hint: 'Keep using "Message yourself" for notes; start a message with sb (or sb:) to talk to SynaBun, or say "sb" first in a voice note. Commands like /stop, the ALLOW code and replies to SynaBun\'s own messages always reach it.' },
|
|
159
159
|
]);
|
|
160
160
|
|
|
161
|
+
/** Voice notes (status.transcription): what each missing part is called. */
|
|
162
|
+
export const VOICE_PARTS = Object.freeze({
|
|
163
|
+
engine: 'whisper.cpp (whisper-cli)',
|
|
164
|
+
model: 'the speech model (ggml-small.bin)',
|
|
165
|
+
ffmpeg: 'FFmpeg',
|
|
166
|
+
});
|
|
167
|
+
/**
|
|
168
|
+
* The line under the voice-note switch: transcribed here, set up but off, or what is missing
|
|
169
|
+
* ('' for a server without voice notes).
|
|
170
|
+
*/
|
|
171
|
+
export function transcriptionLine(status) {
|
|
172
|
+
const t = status?.transcription;
|
|
173
|
+
if (!t || typeof t !== 'object') return '';
|
|
174
|
+
if (t.available === true) {
|
|
175
|
+
return t.enabled === false
|
|
176
|
+
? say('voice.readyOff', 'Voice notes can be transcribed on this computer; turned off.')
|
|
177
|
+
: say('voice.ready', 'Voice notes are transcribed on this computer.');
|
|
178
|
+
}
|
|
179
|
+
const invalid = Array.isArray(t.invalid) ? t.invalid : [];
|
|
180
|
+
const parts = (Array.isArray(t.missing) ? t.missing : []).filter((id) => Object.prototype.hasOwnProperty.call(VOICE_PARTS, id)).map((id) => {
|
|
181
|
+
const name = pick('voice.part', VOICE_PARTS, id);
|
|
182
|
+
return invalid.includes(id) ? say('voice.partInvalid', '{name}: the path set for it does not work', { name }) : name;
|
|
183
|
+
});
|
|
184
|
+
return say('voice.notSetUp', 'Voice notes: not set up — missing {missing}.', { missing: parts.length ? parts.join(', ') : say('voice.part.tools', 'the transcription tools') });
|
|
185
|
+
}
|
|
186
|
+
|
|
161
187
|
export const COMMANDS = Object.freeze([
|
|
162
188
|
{ name: '/status', text: 'what SynaBun is doing, its spend and level' },
|
|
163
189
|
{ name: '/stop', text: 'stop the current task, its agents and anything waiting for your answer' },
|
|
@@ -170,12 +196,13 @@ export const COMMANDS = Object.freeze([
|
|
|
170
196
|
]);
|
|
171
197
|
|
|
172
198
|
export const LIMITS = Object.freeze([
|
|
173
|
-
'Text and pictures (up to 4 per message, 5 MB each)
|
|
199
|
+
'Text and pictures (up to 4 per message, 5 MB each), and voice notes transcribed on this computer (up to 10 minutes and 20 MB each). Videos, documents and stickers are not read yet.',
|
|
174
200
|
'At most 20 messages a minute and 300 a day; 5 messages can wait in line while SynaBun works.',
|
|
175
201
|
'Messages older than 10 minutes when SynaBun comes back online are skipped (it tells you how many).',
|
|
176
202
|
'Answers are split into messages of 3,500 characters; the rest stays in SynaBun.',
|
|
177
203
|
'Computer use from WhatsApp is off until you turn it on above. Then: never at Read-only or while paused, after one yes per task at Ask on my phone, and without asking while Autonomous is active. Agents started from WhatsApp never get it.',
|
|
178
204
|
'Levels, models and settings change only here, never from the phone.',
|
|
205
|
+
'A voice note is an ordinary message: it never approves anything and never runs a command. Approvals take a typed yes.',
|
|
179
206
|
]);
|
|
180
207
|
|
|
181
208
|
export const PRIVACY_STAYS = Object.freeze([
|
|
@@ -213,6 +240,7 @@ export const HELP = Object.freeze({
|
|
|
213
240
|
'With "Only messages that start with sb", a note without sb never reaches SynaBun and is not logged; commands, the ALLOW code and replies to SynaBun\'s messages always get through.',
|
|
214
241
|
'The QR code expires after about a minute. Press "Show a new code" and scan faster, or link with your phone number instead.',
|
|
215
242
|
'Stuck on "Reconnecting"? Check this computer\'s internet connection, then press Reconnect now.',
|
|
243
|
+
'Voice notes not transcribed? This computer needs whisper.cpp, its speech model and FFmpeg, which you install yourself; the line under "Transcribe voice notes" says what is missing.',
|
|
216
244
|
],
|
|
217
245
|
browserTools: 'Not the same as the WhatsApp browser tools. The whatsapp MCP profile lets agents read WhatsApp Web in SynaBun\'s browser; this tab is you chatting with SynaBun from your phone. They do not share a session.',
|
|
218
246
|
uninstall: 'Uninstalling SynaBun does not unlink WhatsApp. Use Unlink or Remove here first, or log SynaBun out under WhatsApp → Settings → Linked devices.',
|
|
@@ -252,8 +280,11 @@ export const INSTALL_ERRORS = Object.freeze({
|
|
|
252
280
|
UNKNOWN: 'Something unexpected happened. The install log has the details.',
|
|
253
281
|
});
|
|
254
282
|
|
|
283
|
+
// RECONNECT_LIMIT and REPLACED only come from a server older than this page (the link now retries
|
|
284
|
+
// forever, and a 440 is retried with a warning: WARNING_TEXT); HOST_HELD is a connector process of
|
|
285
|
+
// another SynaBun version (crashes are always retried).
|
|
255
286
|
export const ERROR_TEXT = Object.freeze({
|
|
256
|
-
HOST_HELD: 'The WhatsApp connector
|
|
287
|
+
HOST_HELD: 'The WhatsApp connector does not match this SynaBun version (it was updated while SynaBun ran), so SynaBun stopped it. Restart SynaBun to load the matching one.',
|
|
257
288
|
HOST_UNAVAILABLE: 'The WhatsApp connector did not start.',
|
|
258
289
|
REPLACED: 'Another copy of this WhatsApp link connected from somewhere else and took over. Reconnect here to take it back.',
|
|
259
290
|
LOCKED: 'Another SynaBun is using the WhatsApp session files. Close it, then reconnect.',
|
|
@@ -272,7 +303,20 @@ export const LOGOUT_TEXT = Object.freeze({
|
|
|
272
303
|
removed: { title: 'Logged out from the phone', sub: 'SynaBun was removed under Linked devices, or WhatsApp ended the session. Link again to keep chatting.' },
|
|
273
304
|
inactive: { title: 'Logged out after a long time offline', sub: 'WhatsApp logs out linked devices that stay offline for a long time. Link again to keep chatting.' },
|
|
274
305
|
banned: { title: 'WhatsApp refused this account', sub: 'WhatsApp blocked the account from linking devices, possibly a temporary or permanent ban. Check the WhatsApp app on the phone.' },
|
|
306
|
+
invalid_session: { title: 'The saved WhatsApp session is invalid', sub: 'WhatsApp rejected this device session (badSession). Link again to pair it; automatic retries cannot repair the credentials.' },
|
|
307
|
+
});
|
|
308
|
+
|
|
309
|
+
/** Why a saved session keeps retrying (status.warning: 440 another copy, 403 a refused account). */
|
|
310
|
+
export const WARNING_TEXT = Object.freeze({
|
|
311
|
+
replaced: 'Another copy is using this WhatsApp session. SynaBun retries every 5 minutes; close the other copy or unlink and link again.',
|
|
312
|
+
forbidden: 'WhatsApp refused this account; it may be restricted or banned. SynaBun retries every 5 minutes; check WhatsApp on the phone.',
|
|
275
313
|
});
|
|
314
|
+
/** The warning Settings shows while the link retries a 440 / 403 ('' for none, or once the link is not up or retrying). */
|
|
315
|
+
export function connectionWarningText(status) {
|
|
316
|
+
if (!Object.prototype.hasOwnProperty.call(WARNING_TEXT, status?.warning)) return '';
|
|
317
|
+
if (!['connected', 'reconnecting', 'paused'].includes(status?.state)) return '';
|
|
318
|
+
return pick('warning', WARNING_TEXT, status.warning);
|
|
319
|
+
}
|
|
276
320
|
|
|
277
321
|
export const ACTIVITY_KINDS = Object.freeze({
|
|
278
322
|
inbound: 'Received', reply: 'Sent', ignored: 'Ignored', state: 'Status', security: 'Security', error: 'Problem', settings: 'Settings',
|
|
@@ -355,9 +399,8 @@ export function waView(status, { now = Date.now() } = {}) {
|
|
|
355
399
|
}
|
|
356
400
|
case 'connected': {
|
|
357
401
|
const who = accountLine(s);
|
|
358
|
-
const until = s.level === 'autonomous' && s.levelExpiresAt ? ` ${say('view.connected.until', 'until {time}', { time: clockTime(s.levelExpiresAt) })}` : '';
|
|
359
402
|
// A Codex / OpenCode brain holds the conversation at read-only whatever the level.
|
|
360
|
-
const applies = s.brainLimit?.provider ? say('view.connected.readOnlyBrain', 'Read-only ({brain} brain)', { brain: s.brainLimit.label || s.brainLimit.provider }) :
|
|
403
|
+
const applies = s.brainLimit?.provider ? say('view.connected.readOnlyBrain', 'Read-only ({brain} brain)', { brain: s.brainLimit.label || s.brainLimit.provider }) : level;
|
|
361
404
|
return view('ok', say('view.connected.title', 'Connected'), [mode, who, applies].filter(Boolean).join(' · '), { primary: button('open-conversation', say('button.openConversation', 'Open conversation')), secondary: button('test', say('button.test', 'Send a test message')), step: 'done', pane: 'connected', nav: 'connected' });
|
|
362
405
|
}
|
|
363
406
|
case 'reconnecting': {
|
|
@@ -404,8 +447,8 @@ export function localizedCopy() {
|
|
|
404
447
|
COMMANDS: localize('commands', COMMANDS), LIMITS: localize('limits', LIMITS),
|
|
405
448
|
PRIVACY_STAYS: localize('privacyStays', PRIVACY_STAYS), PRIVACY_NEVER: localize('privacyNever', PRIVACY_NEVER),
|
|
406
449
|
HELP: localize('help', HELP), STAGE_TEXT: localize('stage', STAGE_TEXT), INSTALL_ERRORS: localize('installError', INSTALL_ERRORS),
|
|
407
|
-
ERROR_TEXT: localize('error', ERROR_TEXT), LOGOUT_TEXT: localize('logout', LOGOUT_TEXT), ACTIVITY_KINDS: localize('activity', ACTIVITY_KINDS),
|
|
450
|
+
ERROR_TEXT: localize('error', ERROR_TEXT), LOGOUT_TEXT: localize('logout', LOGOUT_TEXT), WARNING_TEXT: localize('warning', WARNING_TEXT), ACTIVITY_KINDS: localize('activity', ACTIVITY_KINDS),
|
|
408
451
|
LEVEL_LABELS: localize('levelLabel', LEVEL_LABELS), PHONE_HINT: localize('phoneHint', PHONE_HINT), TEST_HINT: localize('testHint', TEST_HINT),
|
|
409
|
-
BRAIN_COPY: localize('brainCopy', BRAIN_COPY),
|
|
452
|
+
BRAIN_COPY: localize('brainCopy', BRAIN_COPY), VOICE_PARTS: localize('voice.part', VOICE_PARTS),
|
|
410
453
|
};
|
|
411
454
|
}
|
|
@@ -43,6 +43,7 @@ export const WORKER_END_COPY = Object.freeze({
|
|
|
43
43
|
reasonAssistantSaid: 'Stopped by the Assistant: {reason}',
|
|
44
44
|
reasonTimeCap: 'The run reached its time limit.',
|
|
45
45
|
reasonBudget: 'The run reached its budget limit.',
|
|
46
|
+
reasonBudgetShare: 'This provider used up its share of the session budget.',
|
|
46
47
|
reasonMaxTurns: 'The run reached its turn limit.',
|
|
47
48
|
reasonIdle: 'The worker waited for a follow-up that did not come, and closed.',
|
|
48
49
|
reasonRestart: 'The server restarted while the run was open.',
|
|
@@ -155,6 +156,7 @@ function stopReason(reason, t) {
|
|
|
155
156
|
case 'assistant': case 'complete': return t('reasonAssistant');
|
|
156
157
|
case 'time_cap': return t('reasonTimeCap');
|
|
157
158
|
case 'budget_cap': case 'session_budget_cap': case 'budget_unpriced': return t('reasonBudget');
|
|
159
|
+
case 'budget_share': return t('reasonBudgetShare');
|
|
158
160
|
case 'max_turns': return t('reasonMaxTurns');
|
|
159
161
|
case 'idle_timeout': return t('reasonIdle');
|
|
160
162
|
case 'server_restart': case 'server_shutdown': return t('reasonRestart');
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Bump when offline.html changes shape: the new worker drops the old cache and
|
|
2
2
|
// stores the page again (v13: a restart read from the supervisor's report).
|
|
3
|
-
const CACHE_NAME = 'synabun-offline-
|
|
3
|
+
const CACHE_NAME = 'synabun-offline-v14';
|
|
4
4
|
const OFFLINE_URL = '/offline.html';
|
|
5
5
|
|
|
6
6
|
self.addEventListener('install', (event) => {
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
// wires event listeners, and boots the application.
|
|
7
7
|
|
|
8
8
|
// ── Storage (self-hydrating — importing it populates the cache) ──
|
|
9
|
-
import { storage } from '../../shared/storage.js';
|
|
9
|
+
import { storage, isShowcaseMode } from '../../shared/storage.js';
|
|
10
10
|
import { posStore } from '../../shared/node-positions-store.js';
|
|
11
11
|
|
|
12
12
|
// ── Shared foundation ──
|
|
@@ -156,6 +156,15 @@ registerHelpSection({
|
|
|
156
156
|
// 4. LOAD TRANSLATIONS & INJECT SHARED HTML
|
|
157
157
|
// ═══════════════════════════════════════════
|
|
158
158
|
|
|
159
|
+
// Showcase mode (?showcase): the user's own content is blurred for product captures,
|
|
160
|
+
// before anything is drawn. Without it window.__synabunShowcase is missing and a capture stops.
|
|
161
|
+
if (isShowcaseMode()) {
|
|
162
|
+
try {
|
|
163
|
+
(await import('../../shared/showcase-privacy.js')).installShowcasePrivacy();
|
|
164
|
+
} catch (err) {
|
|
165
|
+
console.warn('[showcase] privacy blur unavailable:', err);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
159
168
|
await initI18n();
|
|
160
169
|
injectSharedHTML();
|
|
161
170
|
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
// explorer, cards, tooltips) hydrates right behind it.
|
|
8
8
|
|
|
9
9
|
// ── Storage (self-hydrating — importing it populates the cache) ──
|
|
10
|
-
import { storage } from '../../shared/storage.js';
|
|
10
|
+
import { storage, isShowcaseMode } from '../../shared/storage.js';
|
|
11
11
|
import { posStore } from '../../shared/node-positions-store.js';
|
|
12
12
|
|
|
13
13
|
// ── Shared foundation ──
|
|
@@ -73,6 +73,15 @@ registerVariant({ variant: '3d', capabilities: ['memory-map'] });
|
|
|
73
73
|
// 2. TRANSLATIONS, SHARED HTML, HELP
|
|
74
74
|
// ═══════════════════════════════════════════
|
|
75
75
|
|
|
76
|
+
// Showcase mode (?showcase): the user's own content is blurred for product captures,
|
|
77
|
+
// before anything is drawn. Without it window.__synabunShowcase is missing and a capture stops.
|
|
78
|
+
if (isShowcaseMode()) {
|
|
79
|
+
try {
|
|
80
|
+
(await import('../../shared/showcase-privacy.js')).installShowcasePrivacy();
|
|
81
|
+
} catch (err) {
|
|
82
|
+
console.warn('[showcase] privacy blur unavailable:', err);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
76
85
|
await initI18n();
|
|
77
86
|
injectSharedHTML();
|
|
78
87
|
|