@floless/app 0.149.0 → 0.149.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/floless-server.cjs +639 -161
- package/dist/web/chat.css +18 -3
- package/dist/web/chat.js +193 -8
- package/dist/web/commands-shell.js +24 -3
- package/dist/web/index.html +4 -0
- package/package.json +1 -1
package/dist/web/chat.css
CHANGED
|
@@ -212,7 +212,8 @@
|
|
|
212
212
|
.ai-chat-provider-switch:disabled,
|
|
213
213
|
.ai-chat-provider-switch[aria-disabled="true"] { cursor: default; color: var(--text-dim); border-color: var(--border); background: var(--surface); }
|
|
214
214
|
.ai-chat-provider-switch[hidden] { display: none; }
|
|
215
|
-
.ai-chat-integration-setting
|
|
215
|
+
.ai-chat-integration-setting,
|
|
216
|
+
.ai-chat-own-connectors {
|
|
216
217
|
grid-column: 1 / -1;
|
|
217
218
|
display: flex;
|
|
218
219
|
align-items: center;
|
|
@@ -221,8 +222,10 @@
|
|
|
221
222
|
border-top: 1px solid var(--border);
|
|
222
223
|
padding-inline: 7px;
|
|
223
224
|
}
|
|
224
|
-
.ai-chat-integration-setting > span,
|
|
225
|
-
.ai-chat-integration-setting > strong { margin: 0; }
|
|
225
|
+
.ai-chat-integration-setting > span, .ai-chat-own-connectors > span,
|
|
226
|
+
.ai-chat-integration-setting > strong, .ai-chat-own-connectors > strong { margin: 0; }
|
|
227
|
+
/* #1907: the switch reads its state in the value slot, with the accent only while on. */
|
|
228
|
+
.ai-chat-own-connectors[aria-checked="true"] > strong { color: var(--accent); }
|
|
226
229
|
.ai-chat-desktop-status {
|
|
227
230
|
grid-column: 1 / -1;
|
|
228
231
|
min-width: 0;
|
|
@@ -1061,6 +1064,18 @@
|
|
|
1061
1064
|
font: 10.5px/1.45 var(--ui);
|
|
1062
1065
|
}
|
|
1063
1066
|
.ai-chat-units[hidden] { display: none; }
|
|
1067
|
+
/* #1907: the person's own connectors allowed for this conversation, each with its own Revoke. */
|
|
1068
|
+
.ai-chat-connectors { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 6px; color: var(--text-muted); font: 10.5px/1.45 var(--ui); }
|
|
1069
|
+
.ai-chat-connectors[hidden] { display: none; }
|
|
1070
|
+
.ai-chat-connector-pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 2px 1px 8px; border: 1px solid var(--accent); border-radius: 999px; background: var(--accent-soft); color: var(--text); font-size: 10px; }
|
|
1071
|
+
.ai-chat-connector-revoke { appearance: none; min-height: 24px; padding: 1px 8px; border: 0; border-radius: 999px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-decoration: underline; }
|
|
1072
|
+
.ai-chat-connector-revoke:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
|
|
1073
|
+
.ai-chat-connector-revoke:disabled { opacity: .55; cursor: default; }
|
|
1074
|
+
/* #1907: "Your Claude connectors are on · Turn off" — quiet, with the units line's Change button. */
|
|
1075
|
+
.ai-chat-connectors-status { color: var(--text); }
|
|
1076
|
+
.ai-chat-connectors .ai-chat-units-change:disabled { opacity: .55; cursor: default; }
|
|
1077
|
+
.ai-chat-event.connector { border-color: color-mix(in srgb, var(--accent) 24%, var(--border)); }
|
|
1078
|
+
.ai-chat-approval-warning { color: var(--text); font-weight: 600; }
|
|
1064
1079
|
.ai-chat-units-question { color: var(--text); }
|
|
1065
1080
|
.ai-chat-units-options { display: inline-flex; flex-wrap: wrap; gap: 4px; }
|
|
1066
1081
|
.ai-chat-units-option, .ai-chat-units-change {
|
package/dist/web/chat.js
CHANGED
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
historyToggle: el('chat-history-toggle'), newChat: el('chat-new'), refresh: el('chat-refresh'), history: el('chat-history'),
|
|
20
20
|
title: el('chat-title'), rename: el('chat-rename'), scope: el('chat-scope'), settingsToggle: el('chat-settings-toggle'),
|
|
21
21
|
settings: el('chat-settings'), provider: el('chat-provider'), switchAccount: el('chat-switch-account'), model: el('chat-model'),
|
|
22
|
-
effort: el('chat-effort'), permission: el('chat-permission'), integrations: el('chat-integrations'),
|
|
22
|
+
effort: el('chat-effort'), permission: el('chat-permission'), integrations: el('chat-integrations'), ownConnectors: el('chat-own-connectors'),
|
|
23
23
|
desktopValue: el('chat-desktop-value'), desktopReason: el('chat-desktop-reason'), picker: el('chat-picker'),
|
|
24
24
|
feed: el('chat-feed'), offscreenActivity: el('chat-offscreen-activity'), recovery: el('chat-recovery'),
|
|
25
25
|
approvalTray: el('chat-approval-tray'), recoveryCopy: el('chat-recovery-copy'),
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
unread: el('chat-unread'), tab: el('narrative-tab'),
|
|
31
31
|
context: el('left-chat-context'),
|
|
32
32
|
teklaChip: el('chat-tekla-context'),
|
|
33
|
+
connectors: el('chat-connectors'),
|
|
33
34
|
workspaceUnits: el('chat-units'),
|
|
34
35
|
};
|
|
35
36
|
|
|
@@ -194,6 +195,8 @@
|
|
|
194
195
|
// request() writes the timeout's sentence itself. Without this it fell through to the generic "could
|
|
195
196
|
// not complete this chat action", which hid the one fact the user could act on (#1604).
|
|
196
197
|
if (code === 'local-timeout' && raw) return raw;
|
|
198
|
+
// #1907: the server marks a not-sent reason it already wrote for the person; it is shown as is.
|
|
199
|
+
if (code === 'chat-send-refused-plain' && raw) return raw;
|
|
197
200
|
const codeMessages = {
|
|
198
201
|
'chat-origin-refused': 'This chat can only be used from the FloLess app. Reload the page and try again.',
|
|
199
202
|
'chat-owner-stale': 'This conversation no longer matches the current project or workflow folder. Reopen the project or workflow, then try again.',
|
|
@@ -257,8 +260,9 @@
|
|
|
257
260
|
'chat-knowledge-unscoped': 'Knowledge is available only inside a project conversation. Open a project and try again.',
|
|
258
261
|
'chat-knowledge-page-missing': 'That Knowledge page is no longer available in this project. Refresh the conversation.',
|
|
259
262
|
'approval-explicit-only': 'This read needs its own approval. Choose Approve once or Deny.',
|
|
260
|
-
'approval-not-chat-allowable': '
|
|
263
|
+
'approval-not-chat-allowable': 'This can only be approved once. Choose Approve once or Deny.',
|
|
261
264
|
'tekla-allowance-changed': 'The Tekla read permission for this chat changed. Choose again.',
|
|
265
|
+
'connector-allowance-changed': 'The connectors allowed for this chat changed. Choose again.',
|
|
262
266
|
};
|
|
263
267
|
if (code === 'chat-followup-refused' && error?.reason === 'chat-session-required') {
|
|
264
268
|
return 'Your FloLess session expired before this message was sent. Copy the draft, reload, then paste and send it again.';
|
|
@@ -1905,6 +1909,30 @@
|
|
|
1905
1909
|
return item;
|
|
1906
1910
|
}
|
|
1907
1911
|
|
|
1912
|
+
// #1907: the plain name of one of the person's connectors — the same rule the server words its cards with.
|
|
1913
|
+
function connectorLabel(connector) {
|
|
1914
|
+
// A Claude.ai connector is named "claude.ai <Name>"; the prefix names the channel, not the connector.
|
|
1915
|
+
const raw = String(connector?.app || connector?.server || 'A connector').replace(/^claude[._ ]ai[_ ]/i, '');
|
|
1916
|
+
return raw.replace(/[_-]+/g, ' ').replace(/\b\w/g, (letter) => letter.toUpperCase()).slice(0, 80);
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
function connectorKey(connector) {
|
|
1920
|
+
return `${connector.provider}:${connector.server}:${connector.app || ''}`;
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
function renderConnectorReceipt(event) {
|
|
1924
|
+
const item = document.createElement('div');
|
|
1925
|
+
item.className = 'ai-chat-event connector';
|
|
1926
|
+
item.dataset.eventSequence = String(event.sequence);
|
|
1927
|
+
item.dataset.eventId = event.eventId;
|
|
1928
|
+
const label = document.createElement('strong');
|
|
1929
|
+
label.textContent = 'Allowed for this chat';
|
|
1930
|
+
const connector = event.payload.connector;
|
|
1931
|
+
const tool = typeof connector.tool === 'string' ? connector.tool : 'a tool';
|
|
1932
|
+
item.append(label, document.createTextNode(` · ${connectorLabel(connector)} ran ${tool}`));
|
|
1933
|
+
return item;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1908
1936
|
function renderEvent(event) {
|
|
1909
1937
|
if (event.type === 'user-message' && event.payload?.source === 'request' && event.payload?.filterAi) return renderFilterQuestion(event);
|
|
1910
1938
|
if (event.type === 'user-message' && event.payload?.source === 'request') return renderRequestCard(event);
|
|
@@ -1913,6 +1941,8 @@
|
|
|
1913
1941
|
if (event.type === 'filter-proposal') return renderServerProposal(event);
|
|
1914
1942
|
if (event.type === 'filter-proposal-update') return null;
|
|
1915
1943
|
if (event.type === 'assistant-message') return renderMessage(event, 'assistant', payloadText(event), Boolean(event.payload?.delta));
|
|
1944
|
+
// #1907: a connector call that ran under "Allow for this chat" leaves a visible receipt; every other decision is audit only.
|
|
1945
|
+
if (event.type === 'approval-decided' && event.payload?.automatic === true && event.payload?.connector) return renderConnectorReceipt(event);
|
|
1916
1946
|
if (event.type === 'approval-requested' || event.type === 'approval-decided' || event.type === 'state' || event.type === 'followup-status') return null;
|
|
1917
1947
|
if (event.type === 'tekla-read') return renderTeklaReadEvent(event);
|
|
1918
1948
|
if (event.type === 'height-question') return renderHeightQuestion(event);
|
|
@@ -1949,7 +1979,10 @@
|
|
|
1949
1979
|
return item;
|
|
1950
1980
|
}
|
|
1951
1981
|
label.textContent = event.type === 'error' && payload.outcome === 'not-sent' ? 'Not sent' : labels[event.type] || event.type;
|
|
1952
|
-
|
|
1982
|
+
// #1907: a not-sent reason the server wrote for the person (`plain`) is shown as is.
|
|
1983
|
+
let detail = event.type === 'error'
|
|
1984
|
+
? (payload.plain === true && typeof payload.message === 'string' && payload.message ? payload.message : errorMessage(payloadText(event)))
|
|
1985
|
+
: payloadText(event);
|
|
1953
1986
|
if (!detail && event.type === 'tool') {
|
|
1954
1987
|
const toolLabels = { provider: 'AI provider', integration: 'Connected service', attachment: 'Attachment', knowledge: 'Knowledge', filesystem: 'Project files' };
|
|
1955
1988
|
const statusLabels = { started: 'started', completed: 'completed', failed: 'failed', denied: 'not allowed' };
|
|
@@ -3865,7 +3898,10 @@
|
|
|
3865
3898
|
// Keep the same buttons during polling so keyboard focus and pointer clicks survive. A Tekla card
|
|
3866
3899
|
// also carries the permission view it offers "Allow for this chat" on, so a change repaints it.
|
|
3867
3900
|
const teklaBinding = teklaAllowableApproval(approval) ? currentTeklaBinding(state.chat) : null;
|
|
3868
|
-
|
|
3901
|
+
// #1907: a call to one of the person's connectors FloLess could identify may be allowed for the whole chat.
|
|
3902
|
+
const connector = approval.connector?.verified ? approval.connector : null;
|
|
3903
|
+
const allowanceRevision = teklaBinding ? String(teklaAllowanceRevision(teklaBinding))
|
|
3904
|
+
: connector ? String(state.chat?.connectorAllowance?.revision ?? 0) : '';
|
|
3869
3905
|
if (existing?.dataset.approvalId === approval.approvalId && (existing.dataset.allowanceRevision || '') === allowanceRevision) return;
|
|
3870
3906
|
// A permission change repaints the same approval: keep keyboard focus on the same control.
|
|
3871
3907
|
const refocus = existing?.dataset.approvalId === approval.approvalId && existing.contains(document.activeElement)
|
|
@@ -3873,7 +3909,7 @@
|
|
|
3873
3909
|
existing?.remove();
|
|
3874
3910
|
const card = document.createElement('section'); card.className = 'ai-chat-approval';
|
|
3875
3911
|
card.dataset.approvalId = approval.approvalId;
|
|
3876
|
-
if (teklaBinding) card.dataset.allowanceRevision = allowanceRevision;
|
|
3912
|
+
if (teklaBinding || connector) card.dataset.allowanceRevision = allowanceRevision;
|
|
3877
3913
|
const heading = document.createElement('strong'); heading.textContent = 'Approval needed';
|
|
3878
3914
|
const copy = document.createElement('p'); copy.textContent = approval.summary;
|
|
3879
3915
|
const actions = document.createElement('div'); actions.className = 'ai-chat-approval-actions';
|
|
@@ -3893,6 +3929,27 @@
|
|
|
3893
3929
|
allowRequest.setAttribute('aria-describedby', scope.id);
|
|
3894
3930
|
allowRequest.addEventListener('click', () => decideApproval('allow-request'));
|
|
3895
3931
|
actions.append(deny, allow, allowRequest); card.append(heading, copy, actions, scope);
|
|
3932
|
+
} else if (connector) {
|
|
3933
|
+
card.dataset.explicitOnly = 'true';
|
|
3934
|
+
// The warning is the part that decides it: on its own line, not at the end of the question.
|
|
3935
|
+
const split = approval.summary.indexOf(' FloLess cannot check');
|
|
3936
|
+
const warning = document.createElement('p');
|
|
3937
|
+
warning.className = 'ai-chat-approval-warning';
|
|
3938
|
+
if (split > 0) {
|
|
3939
|
+
copy.textContent = approval.summary.slice(0, split);
|
|
3940
|
+
warning.textContent = approval.summary.slice(split + 1);
|
|
3941
|
+
}
|
|
3942
|
+
const who = connectorLabel(connector);
|
|
3943
|
+
const allowChat = button(`Allow ${who} for this chat`, `shell.chat-connector-allow-chat#${connectorKey(connector)}`, 'allow');
|
|
3944
|
+
allowChat.dataset.commandInstanceLabel = who;
|
|
3945
|
+
const help = document.createElement('span');
|
|
3946
|
+
help.className = 'sr-only';
|
|
3947
|
+
help.id = `chat-approval-connector-scope-help-${approval.approvalId}`;
|
|
3948
|
+
help.textContent = `Let ${who} run whenever Chat asks in this conversation, without asking you each time. Each run is shown in the chat. Revoke it above the message box.`;
|
|
3949
|
+
allowChat.dataset.tip = help.textContent;
|
|
3950
|
+
allowChat.setAttribute('aria-describedby', help.id);
|
|
3951
|
+
allowChat.addEventListener('click', () => decideApproval('allow-chat', Number(allowanceRevision)));
|
|
3952
|
+
actions.append(deny, allow, allowChat); card.append(heading, copy, ...(warning.textContent ? [warning] : []), actions, help);
|
|
3896
3953
|
} else if (teklaBinding) {
|
|
3897
3954
|
// A Tekla read may instead be allowed for the whole chat, covering every read the chat is bound for.
|
|
3898
3955
|
card.dataset.explicitOnly = 'true';
|
|
@@ -4428,7 +4485,7 @@
|
|
|
4428
4485
|
const bindings = chat?.integrationBindings || [];
|
|
4429
4486
|
ui.integrations.querySelector('strong').textContent = bindings.length
|
|
4430
4487
|
? `${bindings.length} FloLess account${bindings.length === 1 ? '' : 's'}`
|
|
4431
|
-
:
|
|
4488
|
+
: 'Not using one';
|
|
4432
4489
|
const frozen = !chat || Boolean(chat.activeTurn) || !state.capability?.available;
|
|
4433
4490
|
ui.model.disabled = frozen; ui.effort.disabled = frozen; ui.permission.disabled = frozen;
|
|
4434
4491
|
ui.integrations.disabled = frozen || Boolean(chat?.nativeSessionId);
|
|
@@ -4441,9 +4498,39 @@
|
|
|
4441
4498
|
ui.integrations.dataset.tip = integrationBlocked || 'Choose which connected account this chat can use';
|
|
4442
4499
|
if (integrationBlocked) ui.integrations.dataset.blockedReason = integrationBlocked;
|
|
4443
4500
|
else delete ui.integrations.dataset.blockedReason;
|
|
4501
|
+
paintOwnConnectorsSetting(chat, frozen);
|
|
4444
4502
|
paintDesktopStatus();
|
|
4445
4503
|
}
|
|
4446
4504
|
|
|
4505
|
+
/** #1907: the per-conversation switch for the AI's own connectors (off for every new conversation). */
|
|
4506
|
+
function paintOwnConnectorsSetting(chat, frozen) {
|
|
4507
|
+
const control = ui.ownConnectors;
|
|
4508
|
+
if (!control) return;
|
|
4509
|
+
const provider = providerLabels[chat?.provider] || 'Claude or Codex';
|
|
4510
|
+
const usesAccount = Boolean(chat?.integrationBindings?.length);
|
|
4511
|
+
const on = chat?.settings?.useOwnConnectors === true && !usesAccount;
|
|
4512
|
+
control.querySelector('span').textContent = `Use my ${provider} connectors in this chat`;
|
|
4513
|
+
control.querySelector('strong').textContent = on ? 'On' : 'Off';
|
|
4514
|
+
control.setAttribute('aria-checked', String(on));
|
|
4515
|
+
const blocked = !chat ? 'Open a conversation first.'
|
|
4516
|
+
: usesAccount ? 'This chat uses a FloLess connected account, so your own connectors stay off.'
|
|
4517
|
+
: chat.activeTurn ? 'Wait for the current AI reply to finish before changing this.'
|
|
4518
|
+
: !state.capability?.available ? capabilityMessage(chat.provider, state.capability?.reason)
|
|
4519
|
+
: frozen ? 'This setting cannot change right now.' : '';
|
|
4520
|
+
control.disabled = Boolean(blocked);
|
|
4521
|
+
control.dataset.tip = blocked || `Lets the AI use the connectors you added to ${provider}, such as Google Drive. Each call still asks you first. Off in every new chat.`;
|
|
4522
|
+
if (blocked) control.dataset.blockedReason = blocked; else delete control.dataset.blockedReason;
|
|
4523
|
+
}
|
|
4524
|
+
|
|
4525
|
+
async function setOwnConnectors(on, options = {}) {
|
|
4526
|
+
if (!state.chat) return;
|
|
4527
|
+
const provider = providerLabels[state.chat.provider] || 'Claude or Codex';
|
|
4528
|
+
await saveSettings({ useOwnConnectors: on }, { announce: false });
|
|
4529
|
+
if (state.chat?.settings?.useOwnConnectors === true !== on) return;
|
|
4530
|
+
announce(on ? `Your ${provider} connectors are on for this chat. Each call asks you first.` : `Your ${provider} connectors are off for this chat.`);
|
|
4531
|
+
if (options.focusInput) ui.input?.focus();
|
|
4532
|
+
}
|
|
4533
|
+
|
|
4447
4534
|
function paintDesktopStatus() {
|
|
4448
4535
|
const desktop = state.desktop;
|
|
4449
4536
|
if (!state.chat) {
|
|
@@ -4485,6 +4572,7 @@
|
|
|
4485
4572
|
function paintConversation() {
|
|
4486
4573
|
paintComposerDisclosure();
|
|
4487
4574
|
paintTeklaChip();
|
|
4575
|
+
paintConnectorAllowance();
|
|
4488
4576
|
const chat = state.chat;
|
|
4489
4577
|
if (!chat) { providerChooser(); paintHistory(); return; }
|
|
4490
4578
|
ui.historyToggle.disabled = false;
|
|
@@ -5307,7 +5395,9 @@
|
|
|
5307
5395
|
const lead = document.createElement('strong');
|
|
5308
5396
|
const detail = document.createTextNode(state.chat?.integrationBindings?.length
|
|
5309
5397
|
? ' When you select a FloLess account, this chat uses it for that service instead of the account connected in Claude or Codex.'
|
|
5310
|
-
:
|
|
5398
|
+
: state.chat?.settings?.useOwnConnectors === true
|
|
5399
|
+
? ` Until you select a FloLess account here, ${providerLabels[state.chat.provider] || 'the AI'} uses your own connectors, and each call asks you first.`
|
|
5400
|
+
: ` Your own ${providerLabels[state.chat?.provider] || 'Claude or Codex'} connectors are off in this chat, so select a FloLess account to use a service.`);
|
|
5311
5401
|
lead.textContent = state.chat?.integrationBindings?.length ? 'This chat will use the FloLess account you selected.' : 'Choose a connected account for this chat.';
|
|
5312
5402
|
note.append(lead, detail); ui.picker.append(note);
|
|
5313
5403
|
const rows = data?.rows || [];
|
|
@@ -5361,7 +5451,7 @@
|
|
|
5361
5451
|
state.chat = chat;
|
|
5362
5452
|
const index = state.chats.findIndex((item) => item.chatId === chatId); if (index >= 0) state.chats[index] = state.chat;
|
|
5363
5453
|
await loadIntegrations(); paintSettings(); paintIntegrationPicker();
|
|
5364
|
-
announce(row.selected ? `${row.label}
|
|
5454
|
+
announce(row.selected ? `${row.label} is no longer selected for this chat.` : `${integrationAccountLabel(row)} selected in FloLess.`);
|
|
5365
5455
|
} catch (error) { if (sameChat(snapshot)) { report(error, 'Could not change the connected account'); paintIntegrationPicker(); } }
|
|
5366
5456
|
}
|
|
5367
5457
|
|
|
@@ -6913,6 +7003,94 @@
|
|
|
6913
7003
|
}
|
|
6914
7004
|
|
|
6915
7005
|
// Ends this chat's standing Tekla read allowance. Nothing to confirm: it only removes permission.
|
|
7006
|
+
// #1907: the connectors allowed for this conversation, each with its own Revoke. Repainted only when the list changes,
|
|
7007
|
+
// so a click is never swapped out from under the pointer.
|
|
7008
|
+
function paintConnectorAllowance() {
|
|
7009
|
+
const host = ui.connectors;
|
|
7010
|
+
if (!host) return;
|
|
7011
|
+
const chat = state.chat;
|
|
7012
|
+
// #1907: the line exists only while this chat's own connectors are on; with them off, nothing can call.
|
|
7013
|
+
const on = Boolean(chat && !chat.archivedAt && chat.settings?.useOwnConnectors === true && !chat.integrationBindings?.length);
|
|
7014
|
+
const allowed = on && Array.isArray(chat.connectorAllowance?.allowed) ? chat.connectorAllowance.allowed : [];
|
|
7015
|
+
const busy = Boolean(chat?.activeTurn) || state.ownConnectorsSaving === true;
|
|
7016
|
+
const painted = `${chat?.chatId || ''}|${on}|${busy}|${chat?.provider || ''}|${allowed.map(connectorKey).join(',')}|${state.connectorRevoking || ''}`;
|
|
7017
|
+
if (host.dataset.painted === painted) return;
|
|
7018
|
+
host.dataset.painted = painted;
|
|
7019
|
+
host.replaceChildren();
|
|
7020
|
+
host.hidden = !on;
|
|
7021
|
+
if (!on) return;
|
|
7022
|
+
const provider = providerLabels[chat.provider] || 'Claude or Codex';
|
|
7023
|
+
const status = document.createElement('span');
|
|
7024
|
+
status.className = 'ai-chat-connectors-status';
|
|
7025
|
+
status.textContent = `Your ${provider} connectors are on`;
|
|
7026
|
+
const off = button('Turn off', 'shell.chat-own-connectors-off', 'ai-chat-units-change');
|
|
7027
|
+
off.setAttribute('aria-label', `Turn off your ${provider} connectors for this chat`);
|
|
7028
|
+
off.disabled = busy;
|
|
7029
|
+
const offBlocked = busy ? 'Wait for the current AI reply to finish before changing this.' : '';
|
|
7030
|
+
off.dataset.tip = offBlocked || 'The AI stops using your own connectors in this chat. You can turn them on again in chat settings.';
|
|
7031
|
+
if (offBlocked) off.dataset.blockedReason = offBlocked;
|
|
7032
|
+
off.addEventListener('click', () => { void turnOffOwnConnectors(); });
|
|
7033
|
+
host.append(status, off);
|
|
7034
|
+
if (!allowed.length) return;
|
|
7035
|
+
const title = document.createElement('span');
|
|
7036
|
+
title.className = 'ai-chat-connectors-title';
|
|
7037
|
+
title.textContent = 'Allowed for this chat:';
|
|
7038
|
+
host.append(title);
|
|
7039
|
+
for (const entry of allowed) {
|
|
7040
|
+
const pill = document.createElement('span');
|
|
7041
|
+
pill.className = 'ai-chat-connector-pill';
|
|
7042
|
+
const name = document.createElement('span');
|
|
7043
|
+
name.textContent = connectorLabel(entry);
|
|
7044
|
+
const key = connectorKey(entry);
|
|
7045
|
+
const revoke = button('Revoke', `shell.chat-connector-allowance-revoke#${key}`, 'ai-chat-connector-revoke');
|
|
7046
|
+
revoke.dataset.commandInstanceLabel = connectorLabel(entry);
|
|
7047
|
+
revoke.setAttribute('aria-label', `Revoke ${connectorLabel(entry)} for this chat`);
|
|
7048
|
+
revoke.dataset.tip = `${connectorLabel(entry)} will ask you again before it runs in this chat.`;
|
|
7049
|
+
revoke.disabled = state.connectorRevoking === key;
|
|
7050
|
+
revoke.addEventListener('click', () => { void revokeConnectorAllowance(entry); });
|
|
7051
|
+
pill.append(name, revoke);
|
|
7052
|
+
host.append(pill);
|
|
7053
|
+
}
|
|
7054
|
+
}
|
|
7055
|
+
|
|
7056
|
+
async function turnOffOwnConnectors() {
|
|
7057
|
+
state.ownConnectorsSaving = true;
|
|
7058
|
+
paintConnectorAllowance();
|
|
7059
|
+
try { await setOwnConnectors(false, { focusInput: true }); }
|
|
7060
|
+
finally { state.ownConnectorsSaving = false; paintConnectorAllowance(); }
|
|
7061
|
+
}
|
|
7062
|
+
|
|
7063
|
+
async function revokeConnectorAllowance(entry) {
|
|
7064
|
+
const snapshot = captureChat();
|
|
7065
|
+
if (!snapshot) return;
|
|
7066
|
+
const key = connectorKey(entry);
|
|
7067
|
+
state.connectorRevoking = key;
|
|
7068
|
+
paintConnectorAllowance();
|
|
7069
|
+
try {
|
|
7070
|
+
const result = await request(`/api/chat/conversations/${encodeURIComponent(snapshot.chatId)}/connector-allowance/revoke`, {
|
|
7071
|
+
method: 'POST', body: JSON.stringify({ owner: snapshot.scope.owner, connector: { provider: entry.provider, server: entry.server, app: entry.app ?? null } }),
|
|
7072
|
+
});
|
|
7073
|
+
if (!sameChat(snapshot)) return;
|
|
7074
|
+
// Only the server's own record, without that connector, may say it ended.
|
|
7075
|
+
const updated = result?.chat;
|
|
7076
|
+
if (!updated || updated.chatId !== snapshot.chatId || (updated.connectorAllowance?.allowed || []).some((row) => connectorKey(row) === key)) {
|
|
7077
|
+
report(new Error('FloLess could not confirm that this connector will ask again. Choose Revoke again.'), 'Could not revoke');
|
|
7078
|
+
return;
|
|
7079
|
+
}
|
|
7080
|
+
state.chat = { ...state.chat, connectorAllowance: updated.connectorAllowance };
|
|
7081
|
+
announce(`${connectorLabel(entry)} will ask you again in this chat.`);
|
|
7082
|
+
state.connectorRevoking = null;
|
|
7083
|
+
paintConnectorAllowance();
|
|
7084
|
+
// The pressed Revoke is gone with its pill: keep keyboard focus on the next one, or on the message box.
|
|
7085
|
+
(ui.connectors?.querySelector('.ai-chat-connector-revoke') || ui.input)?.focus();
|
|
7086
|
+
} catch (error) {
|
|
7087
|
+
if (sameChat(snapshot)) report(error, 'Could not revoke');
|
|
7088
|
+
} finally {
|
|
7089
|
+
if (state.connectorRevoking === key) state.connectorRevoking = null;
|
|
7090
|
+
paintConnectorAllowance();
|
|
7091
|
+
}
|
|
7092
|
+
}
|
|
7093
|
+
|
|
6916
7094
|
async function revokeTeklaAllowance() {
|
|
6917
7095
|
const chat = state.chat;
|
|
6918
7096
|
const snapshot = captureChat();
|
|
@@ -7066,6 +7244,8 @@
|
|
|
7066
7244
|
updateOffscreenActivity();
|
|
7067
7245
|
// The left chat's library chip ("added to this chat") must not linger over the chooser.
|
|
7068
7246
|
paintTeklaChip();
|
|
7247
|
+
// Nor the left chat's "connectors are on" line and its allowances (#1907).
|
|
7248
|
+
paintConnectorAllowance();
|
|
7069
7249
|
}
|
|
7070
7250
|
|
|
7071
7251
|
// Graft receipt → unsent Chat draft. Opening performs no binding, sends nothing and never
|
|
@@ -7166,6 +7346,11 @@
|
|
|
7166
7346
|
ui.switchAccount.addEventListener('click', () => { void switchAccount(); });
|
|
7167
7347
|
ui.effort.addEventListener('click', () => openPicker('effort', ui.effort, effortChoices()));
|
|
7168
7348
|
ui.permission.addEventListener('click', () => openPicker('permission', ui.permission, permissionChoices()));
|
|
7349
|
+
ui.ownConnectors?.addEventListener('click', () => {
|
|
7350
|
+
if (ui.ownConnectors.disabled || !state.chat) return;
|
|
7351
|
+
closePicker();
|
|
7352
|
+
void setOwnConnectors(state.chat.settings?.useOwnConnectors !== true);
|
|
7353
|
+
});
|
|
7169
7354
|
ui.integrations.addEventListener('click', openIntegrations);
|
|
7170
7355
|
ui.send.addEventListener('click', sendTurn);
|
|
7171
7356
|
// The Drawing Filter page reports every change that can alter what the chat shows about it.
|
|
@@ -1669,12 +1669,21 @@
|
|
|
1669
1669
|
group: 'In AI Chat settings', persistence: 'working', interaction: 'dialog', risk: ['destructive'], guidance: 'on-demand',
|
|
1670
1670
|
});
|
|
1671
1671
|
def('shell.chat-integrations', {
|
|
1672
|
-
label: 'Connected accounts', actsOn: 'Shows which FloLess
|
|
1672
|
+
label: 'Connected accounts', actsOn: 'Shows which FloLess accounts this conversation will use',
|
|
1673
1673
|
group: 'In AI Chat settings', persistence: 'none', interaction: 'dialog', risk: [], guidance: 'on-demand',
|
|
1674
|
-
why: '
|
|
1674
|
+
why: 'A FloLess account selected here is how this chat reaches that service; your own Claude or Codex connectors stay off while one is selected.',
|
|
1675
|
+
});
|
|
1676
|
+
def('shell.chat-own-connectors', {
|
|
1677
|
+
label: 'Use my connectors in this chat', actsOn: 'Turns the connectors you added to Claude or Codex on or off for this conversation only',
|
|
1678
|
+
group: 'In AI Chat settings', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1679
|
+
why: 'Your own connectors are off in every new chat. Turned on, each call they make still asks you first.',
|
|
1680
|
+
});
|
|
1681
|
+
def('shell.chat-own-connectors-off', {
|
|
1682
|
+
label: 'Turn off my connectors', actsOn: 'Turns off the connectors you added to Claude or Codex for this conversation',
|
|
1683
|
+
group: 'In AI Chat', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1675
1684
|
});
|
|
1676
1685
|
def('shell.chat-integration-choice', {
|
|
1677
|
-
label: 'Use connected account', actsOn: 'Uses {instance} for this chat, or
|
|
1686
|
+
label: 'Use connected account', actsOn: 'Uses {instance} for this chat, or stops using it',
|
|
1678
1687
|
group: 'In AI Chat settings', persistence: 'working', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1679
1688
|
});
|
|
1680
1689
|
def('shell.chat-choice', {
|
|
@@ -1960,6 +1969,18 @@
|
|
|
1960
1969
|
group: 'In AI Chat', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1961
1970
|
why: 'Saves approving each Tekla read one by one. FloLess still checks Tekla live before every read and shows every result; nothing in the model changes.',
|
|
1962
1971
|
});
|
|
1972
|
+
// #1907: every call to the person's own connector asks first; it may be allowed per connector for the chat.
|
|
1973
|
+
def('shell.chat-connector-allow-chat', {
|
|
1974
|
+
label: 'Allow this connector for this chat', actsOn: 'Allows {instance} to run now and whenever Chat asks in this conversation, without asking again until you revoke it',
|
|
1975
|
+
anyInstance: 'the connector on the card',
|
|
1976
|
+
group: 'In AI Chat', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1977
|
+
why: 'Saves approving each call to one of your own connectors one by one. Every run is still shown in the chat, and it covers only that connector.',
|
|
1978
|
+
});
|
|
1979
|
+
def('shell.chat-connector-allowance-revoke', {
|
|
1980
|
+
label: 'Revoke a connector for this chat', actsOn: 'Makes {instance} ask you again before it runs in this conversation; a call already running may finish',
|
|
1981
|
+
anyInstance: 'that connector',
|
|
1982
|
+
group: 'In AI Chat', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand',
|
|
1983
|
+
});
|
|
1963
1984
|
def('shell.chat-tekla-allowance-revoke', {
|
|
1964
1985
|
label: 'Revoke Tekla reads for this chat', actsOn: 'Makes Chat ask you again before each Tekla read in this conversation; a read already running may finish',
|
|
1965
1986
|
group: 'In AI Chat', persistence: 'external', interaction: 'instant', risk: [], guidance: 'on-demand',
|
package/dist/web/index.html
CHANGED
|
@@ -186,6 +186,8 @@
|
|
|
186
186
|
<button data-command-id="shell.chat-effort" type="button" class="ai-chat-setting" id="chat-effort" aria-haspopup="listbox" aria-expanded="false" data-tip="Choose how much reasoning the AI uses for future messages."><span>Effort</span><strong>Medium</strong></button>
|
|
187
187
|
<button data-command-id="shell.chat-permission" type="button" class="ai-chat-setting" id="chat-permission" aria-haspopup="listbox" aria-expanded="false" data-tip="Access controls what the AI may change: Read only, Working folder write, or Full access."><span>Access</span><strong>Read only</strong></button>
|
|
188
188
|
<button data-command-id="shell.chat-integrations" type="button" class="ai-chat-setting ai-chat-integration-setting" id="chat-integrations" aria-haspopup="listbox" aria-expanded="false"><span>Connected accounts</span><strong>Choose a connected account</strong></button>
|
|
189
|
+
<!-- #1907 (owner ruling 2026-10-03): the AI's own connectors are off in every new conversation; this turns them on for this one. -->
|
|
190
|
+
<button data-command-id="shell.chat-own-connectors" type="button" class="ai-chat-setting ai-chat-own-connectors" id="chat-own-connectors" role="switch" aria-checked="false"><span>Use my connectors in this chat</span><strong aria-hidden="true">Off</strong></button>
|
|
189
191
|
<div class="ai-chat-desktop-status" id="chat-desktop-status">
|
|
190
192
|
<div><span>Continue in desktop app</span><strong id="chat-desktop-value">—</strong></div>
|
|
191
193
|
<small id="chat-desktop-reason" aria-live="polite">Open a conversation to check whether the desktop app can continue it.</small>
|
|
@@ -210,6 +212,8 @@
|
|
|
210
212
|
<!-- #1890: a workspace conversation's units question, and then its "Units: … · Change" line. -->
|
|
211
213
|
<div class="ai-chat-units" id="chat-units" hidden></div>
|
|
212
214
|
<div class="ai-chat-tekla-context" id="chat-tekla-context" hidden></div>
|
|
215
|
+
<!-- #1907: shown only while this chat uses the person's own connectors: "on · Turn off", then each allowed one with Revoke (web/chat.js). -->
|
|
216
|
+
<div class="ai-chat-connectors" id="chat-connectors" role="group" aria-label="Your connectors in this chat" hidden></div>
|
|
213
217
|
<textarea data-command-id="shell.chat-input" id="chat-input" rows="1" maxlength="131072" placeholder="Message AI…" aria-label="Message AI"></textarea>
|
|
214
218
|
<!-- The data-handling disclosure gets its OWN node in the composer, not a line in
|
|
215
219
|
#chat-compose-hint: that hint is one mutable string chosen by a priority chain,
|