@floless/app 0.169.0 → 0.170.0
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 +71580 -59849
- package/dist/schemas/drawing-check.profile.v1.schema.json +12 -2
- package/dist/schemas/steel.model.v2.schema.json +2 -1
- package/dist/skills/floless-app-knowledge/SKILL.md +43 -13
- package/dist/skills/floless-app-new-workflow/SKILL.md +8 -1
- package/dist/skills/floless-app-routines/SKILL.md +2 -2
- package/dist/skills/floless-app-routines/references/routines-api.md +20 -8
- package/dist/skills/floless-app-steel-model/SKILL.md +8 -5
- package/dist/skills/floless-app-steel-takeoff/SKILL.md +31 -1
- package/dist/skills/floless-app-workflows/SKILL.md +22 -3
- package/dist/skills/floless-app-workflows/references/agent-steps.md +40 -6
- package/dist/skills/floless-app-workflows/references/exec-contract.md +27 -0
- package/dist/skills/floless-app-workflows/references/script-runner.md +105 -0
- package/dist/web/agent-steps.js +89 -18
- package/dist/web/agents.js +32 -22
- package/dist/web/app.css +223 -1
- package/dist/web/app.js +24 -3
- package/dist/web/aware.js +877 -189
- package/dist/web/chat.js +184 -95
- package/dist/web/checkpoint-standard.js +5 -3
- package/dist/web/commands-drawing-check.js +1 -0
- package/dist/web/commands-shell.js +440 -11
- package/dist/web/commands-steel.js +60 -1
- package/dist/web/drawing-check-editor.js +352 -88
- package/dist/web/failure-copy.js +32 -2
- package/dist/web/filter-ai-proposal.js +11 -8
- package/dist/web/flo-3d.js +1 -1
- package/dist/web/guide.js +33 -26
- package/dist/web/index.html +69 -1
- package/dist/web/instructor.js +99 -15
- package/dist/web/left-pane.js +4 -1
- package/dist/web/local-discovery.js +8 -7
- package/dist/web/missed-routines.js +239 -0
- package/dist/web/model-measure.js +6 -0
- package/dist/web/model-spatial-panel.js +19 -4
- package/dist/web/model-spatial-tools.js +3 -3
- package/dist/web/model-viewport-revit-adapter.js +3 -3
- package/dist/web/origin-rule.js +155 -0
- package/dist/web/project-access.js +1 -1
- package/dist/web/project-modules.js +2 -2
- package/dist/web/project-rfis.js +6 -1
- package/dist/web/project-workflows.js +2 -2
- package/dist/web/revit-editor.js +22 -8
- package/dist/web/run-history.js +12 -1
- package/dist/web/steel-3d-core.js +39 -9
- package/dist/web/steel-3d-flo.js +26 -4
- package/dist/web/steel-3d-view.js +8 -3
- package/dist/web/steel-ai-marks.js +3 -1
- package/dist/web/steel-editor.html +455 -122
- package/dist/web/steel-environments.js +297 -0
- package/dist/web/steel-filter.html +3 -2
- package/dist/web/steel-model-v2-client-validation.js +8 -1
- package/dist/web/steel-model-v2-commands.js +23 -9
- package/dist/web/steel-model-v2-projection.js +1 -1
- package/dist/web/step-rename.js +3 -2
- package/dist/web/terminal-requests.js +1 -1
- package/dist/web/tool-updates.js +7 -6
- package/dist/web/workspaces.js +1714 -119
- package/package.json +4 -1
package/dist/web/chat.js
CHANGED
|
@@ -194,7 +194,7 @@
|
|
|
194
194
|
// The server is almost always running but busy when this happens (#1604), so the sentence
|
|
195
195
|
// leads with "try again" and keeps "is it still running?" as the fallback.
|
|
196
196
|
const timeout = new Error('FloLess took too long to respond, most likely because it is busy. Try again in a moment — if it keeps happening, make sure FloLess is still running.');
|
|
197
|
-
timeout.code = 'local-timeout';
|
|
197
|
+
timeout.code = 'local-timeout'; timeout.forPerson = true;
|
|
198
198
|
// Which call timed out, and after how long: the sentence above is for the user, this is for
|
|
199
199
|
// whoever reads the console when it happens (#1604).
|
|
200
200
|
timeout.cause = { path, timeoutMs, name: error.name };
|
|
@@ -209,7 +209,7 @@
|
|
|
209
209
|
const unreadable = (cause) => {
|
|
210
210
|
console.warn('[chat] a request was answered with JSON this window could not read', path, response.status, cause);
|
|
211
211
|
return Object.assign(new Error(failureCopy({ status: response.status, body: { ok: false, code: 'response-unreadable' } }, { retrySafe: readOnly }).text),
|
|
212
|
-
{ code: 'response-unreadable', status: response.status });
|
|
212
|
+
{ code: 'response-unreadable', status: response.status, body: { ok: false, code: 'response-unreadable' } });
|
|
213
213
|
};
|
|
214
214
|
const body = contentType.includes('application/json')
|
|
215
215
|
? await response.json().catch((cause) => { if (response.ok) throw unreadable(cause); return null; })
|
|
@@ -224,8 +224,9 @@
|
|
|
224
224
|
error.code = body?.code || null;
|
|
225
225
|
error.reason = body?.reason || null;
|
|
226
226
|
error.recovery = Array.isArray(body?.recovery) ? body.recovery : null;
|
|
227
|
-
// The subscription gate's answer (state + reason) decides which sign-in sentence errorMessage shows.
|
|
228
|
-
|
|
227
|
+
// The subscription gate's answer (state + reason) decides which sign-in sentence errorMessage shows. #3097 3b: the
|
|
228
|
+
// reply rides on every refusal, so errorText works the sentence out again from it rather than from this message.
|
|
229
|
+
error.body = json || {};
|
|
229
230
|
// #2061: who holds a busy project, so the person can be asked: wait, stop it, or open it.
|
|
230
231
|
error.holder = body?.holder && typeof body.holder === 'object' ? body.holder : null;
|
|
231
232
|
// #2470 R6.7b: a project intake from Add a module whose link the General project can't take is a choice, not a refusal.
|
|
@@ -373,6 +374,9 @@
|
|
|
373
374
|
'tekla-allowance-changed': 'The Tekla read permission for this chat changed. Choose again.',
|
|
374
375
|
'connector-allowance-changed': 'The connectors allowed for this chat changed. Choose again.',
|
|
375
376
|
};
|
|
377
|
+
// #3255: the conversation is from an earlier opening of this Workspace; reopening does not help, a new one does.
|
|
378
|
+
// Written out, not the shared constant: several test harnesses lift this function alone.
|
|
379
|
+
if (code === 'chat-owner-stale' && error?.body?.earlierOpening) return 'This conversation is from before this Workspace was reopened, so you can read it but not continue it. To carry on, choose New conversation at the top of the chat. The new conversation won’t remember this one.';
|
|
376
380
|
if (code === 'chat-followup-refused' && error?.reason === 'chat-session-required') {
|
|
377
381
|
return 'Your FloLess session expired before this message was sent. Copy the draft, reload, then paste and send it again.';
|
|
378
382
|
}
|
|
@@ -605,7 +609,9 @@
|
|
|
605
609
|
}
|
|
606
610
|
return;
|
|
607
611
|
}
|
|
608
|
-
const message =
|
|
612
|
+
const message = state.chat?.earlierOpening
|
|
613
|
+
? 'This conversation is from before this Workspace was reopened, so you can read it but not continue it. To carry on, choose New conversation at the top of the chat. The new conversation won’t remember this one.'
|
|
614
|
+
: requestExecutionBlocked()
|
|
609
615
|
? 'Another AI Chat is changing this project or workflow. Wait for it to finish or stop it before sending here.'
|
|
610
616
|
: state.followupUnknownId || hasUnknownFollowup()
|
|
611
617
|
? 'FloLess could not confirm this message. Check its status and use the action beside it before sending again.'
|
|
@@ -1496,7 +1502,10 @@
|
|
|
1496
1502
|
meta.textContent = archived
|
|
1497
1503
|
? `${providerLabels[chat.provider]} · Archived ${eventTime({ createdAt: chat.archivedAt || chat.updatedAt })}`
|
|
1498
1504
|
: `${providerLabels[chat.provider]} · Created ${eventTime(chat)}`;
|
|
1499
|
-
|
|
1505
|
+
// #3255: from an earlier opening of this Workspace: it opens to be read. In place of its time, so the title keeps
|
|
1506
|
+
// its room (the day heading above still dates it, and the row's spoken label keeps the time).
|
|
1507
|
+
if (chat?.earlierOpening) meta.textContent = `${providerLabels[chat.provider]} · Read only`;
|
|
1508
|
+
row.setAttribute('aria-label', `${chat.title}, ${unread ? 'unread conversation, ' : ''}${chat?.earlierOpening ? 'read only, ' : ''}${providerLabels[chat.provider]}, ${chat.archivedAt ? 'archived' : 'created'} ${eventTime({ createdAt: chat.archivedAt || chat.createdAt })}`);
|
|
1500
1509
|
const rename = document.createElement('button');
|
|
1501
1510
|
rename.type = 'button'; rename.className = 'ai-chat-history-rename'; rename.textContent = '✎';
|
|
1502
1511
|
rename.dataset.commandId = `shell.chat-history-rename#${chat.chatId}`;
|
|
@@ -1529,7 +1538,7 @@
|
|
|
1529
1538
|
event.preventDefault(); event.stopPropagation(); deleteConversation(chat, remove);
|
|
1530
1539
|
});
|
|
1531
1540
|
actions.append(rename, archive, remove);
|
|
1532
|
-
actions.hidden = turnIsVisiblyActive(chat);
|
|
1541
|
+
actions.hidden = turnIsVisiblyActive(chat) || Boolean(chat?.earlierOpening);
|
|
1533
1542
|
row.append(title, meta, actions);
|
|
1534
1543
|
if (turnIsVisiblyActive(chat)) {
|
|
1535
1544
|
const spinner = document.createElement('span'); spinner.className = 'ai-chat-history-working';
|
|
@@ -1728,7 +1737,8 @@
|
|
|
1728
1737
|
/** A waiting move with a warning, for the conversation on screen: the sentence and the person's choices. */
|
|
1729
1738
|
function moveNoticeForChat(chat) {
|
|
1730
1739
|
const rehome = chat?.rehome;
|
|
1731
|
-
|
|
1740
|
+
// #3255: a conversation from an earlier opening of the Workspace is read only, so its move is not offered either.
|
|
1741
|
+
if (!rehome || chat?.earlierOpening || state.scope?.owner?.kind !== 'workspace' || rehome.state !== 'pending' || !rehome.warning) return null;
|
|
1732
1742
|
const keep = { label: 'Keep it here', command: 'shell.chat-move-keep', run: () => keepConversationHere(chat.chatId) };
|
|
1733
1743
|
const retry = { label: 'Try again', command: 'shell.chat-move-retry', run: () => retryConversationMove(chat.chatId) };
|
|
1734
1744
|
return rehome.targetGone
|
|
@@ -1869,7 +1879,7 @@
|
|
|
1869
1879
|
}
|
|
1870
1880
|
|
|
1871
1881
|
function beginRename() {
|
|
1872
|
-
if (!state.chat || turnIsVisiblyActive() || state.renaming) return;
|
|
1882
|
+
if (!state.chat || turnIsVisiblyActive() || state.renaming || state.chat?.earlierOpening) return;
|
|
1873
1883
|
state.renaming = { original: state.chat.title };
|
|
1874
1884
|
ui.title.contentEditable = 'true';
|
|
1875
1885
|
ui.title.setAttribute('role', 'textbox');
|
|
@@ -1890,7 +1900,7 @@
|
|
|
1890
1900
|
ui.title.removeAttribute('role');
|
|
1891
1901
|
ui.title.removeAttribute('aria-label');
|
|
1892
1902
|
ui.title.classList.remove('editing');
|
|
1893
|
-
ui.rename.hidden = !state.chat || Boolean(state.chat.activeTurn);
|
|
1903
|
+
ui.rename.hidden = !state.chat || Boolean(state.chat.activeTurn) || Boolean(state.chat?.earlierOpening);
|
|
1894
1904
|
if (!save || !title || title === original || !snapshot) {
|
|
1895
1905
|
ui.title.textContent = original;
|
|
1896
1906
|
return;
|
|
@@ -4711,7 +4721,8 @@
|
|
|
4711
4721
|
*/
|
|
4712
4722
|
function probeSources(turnId, index) {
|
|
4713
4723
|
const chatId = state.chat?.chatId;
|
|
4714
|
-
|
|
4724
|
+
// #3255: a conversation from an earlier opening of the Workspace is read as history; its sources are not re-checked.
|
|
4725
|
+
if (!chatId || !turnId || state.chat?.earlierOpening || answerRunning(turnId)) return;
|
|
4715
4726
|
const key = `${chatId}\u0000${turnId}`;
|
|
4716
4727
|
if (probedTurns.has(key) || ![...index.byAnchor.values()].some((row) => (row.entry.status === 'resolved' && !row.entry.bare) || row.choice)) return;
|
|
4717
4728
|
probedTurns.add(key);
|
|
@@ -4932,7 +4943,7 @@
|
|
|
4932
4943
|
help.textContent = deliveryReceipt.reason;
|
|
4933
4944
|
item.append(help);
|
|
4934
4945
|
}
|
|
4935
|
-
if (delivery === 'unknown' && event.clientSubmissionId) {
|
|
4946
|
+
if (delivery === 'unknown' && event.clientSubmissionId && !state.chat?.earlierOpening) {
|
|
4936
4947
|
const help = document.createElement('span'); help.className = 'ai-chat-message-delivery ai-chat-message-delivery-detail';
|
|
4937
4948
|
help.textContent = 'AI may have received this. Check the conversation before continuing.';
|
|
4938
4949
|
const resolve = button(event.optimistic ? 'Review draft and continue' : 'Continue without resending',
|
|
@@ -4949,7 +4960,7 @@
|
|
|
4949
4960
|
item.append(help, resolve);
|
|
4950
4961
|
}
|
|
4951
4962
|
if (delivery === 'not-sent' && deliveryReceipt?.retryable !== false
|
|
4952
|
-
&& event.clientSubmissionId && !state.chat?.archivedAt
|
|
4963
|
+
&& event.clientSubmissionId && !state.chat?.archivedAt && !state.chat?.earlierOpening
|
|
4953
4964
|
&& state.chat?.state !== 'recovery'
|
|
4954
4965
|
&& !state.followupUnknownId && !hasUnknownFollowup()
|
|
4955
4966
|
&& (!state.chat?.activeTurn || state.chat.activeTurn.turnId === event.turnId)
|
|
@@ -5081,7 +5092,9 @@
|
|
|
5081
5092
|
item.classList.toggle('ai-chat-request-aside', set === 'dismissed' || set === 'expired');
|
|
5082
5093
|
// A request I dismissed from here can be taken back from here.
|
|
5083
5094
|
let undo = item.querySelector('.ai-chat-request-undo');
|
|
5084
|
-
|
|
5095
|
+
// #3255: a card in a conversation from an earlier opening of the Workspace is read only: no Dismiss or Undo here.
|
|
5096
|
+
const history = Boolean(state.chat?.earlierOpening);
|
|
5097
|
+
if ((set === 'dismissed' || set === 'expired') && !history) {
|
|
5085
5098
|
if (!undo) {
|
|
5086
5099
|
undo = button('Undo', `shell.chat-request-undo#${requestId || 'linked request'}`, 'ai-chat-request-undo');
|
|
5087
5100
|
undo.dataset.tip = 'Put this request back in Requests, exactly as it was';
|
|
@@ -5092,7 +5105,7 @@
|
|
|
5092
5105
|
// Nothing is left to set aside once the request is finished, dismissed or gone; its card still folds (its chevron).
|
|
5093
5106
|
const finished = Boolean(live && (live.found === false || set));
|
|
5094
5107
|
const dismiss = item.querySelector('.ai-chat-request-dismiss');
|
|
5095
|
-
if (dismiss) dismiss.hidden = finished;
|
|
5108
|
+
if (dismiss) dismiss.hidden = finished || history;
|
|
5096
5109
|
// #2678: what a hidden card's line says still waits: the person (the server's "needs you", except a request only waiting
|
|
5097
5110
|
// for the AI to start it), or the AI. The line says the card's own live word either way.
|
|
5098
5111
|
if (finished) item.dataset.waits = 'done';
|
|
@@ -5108,7 +5121,7 @@
|
|
|
5108
5121
|
if (!note) { note = document.createElement('p'); note.className = 'ai-chat-request-note'; note.setAttribute('role', 'status'); item.append(note); }
|
|
5109
5122
|
note.textContent = entry.note;
|
|
5110
5123
|
} else note?.remove();
|
|
5111
|
-
if (entry.hold) paintRequestAsk(item, entry);
|
|
5124
|
+
if (entry.hold && !history) paintRequestAsk(item, entry);
|
|
5112
5125
|
else item.querySelector('.ai-chat-request-ask')?.remove();
|
|
5113
5126
|
}
|
|
5114
5127
|
|
|
@@ -5147,6 +5160,7 @@
|
|
|
5147
5160
|
}
|
|
5148
5161
|
|
|
5149
5162
|
async function dismissRequestFromCard(item) {
|
|
5163
|
+
if (state.chat?.earlierOpening) return;
|
|
5150
5164
|
const requestId = item.dataset.requestId;
|
|
5151
5165
|
if (!requestId) return;
|
|
5152
5166
|
const entry = requestCardEntry(requestId);
|
|
@@ -5248,7 +5262,7 @@
|
|
|
5248
5262
|
const go = button('Stop it and dismiss', `shell.chat-request-stop-dismiss#${item.dataset.requestId || 'linked request'}`, 'danger');
|
|
5249
5263
|
go.disabled = Boolean(entry.busy);
|
|
5250
5264
|
go.addEventListener('click', async () => {
|
|
5251
|
-
if (entry.busy) return;
|
|
5265
|
+
if (entry.busy || state.chat?.earlierOpening) return;
|
|
5252
5266
|
entry.busy = 'stop'; entry.askError = ''; repaintRequestCard(requestId);
|
|
5253
5267
|
openFeedCard(item.dataset.cardEventId); // #2678: as Dismiss: the Undo it offers stays in front of them
|
|
5254
5268
|
let stopped = true; // a stale stop means the work had already ended or changed: never claimed as "stopped"
|
|
@@ -5289,6 +5303,7 @@
|
|
|
5289
5303
|
}
|
|
5290
5304
|
|
|
5291
5305
|
async function restoreRequestFromCard(item) {
|
|
5306
|
+
if (state.chat?.earlierOpening) return;
|
|
5292
5307
|
const requestId = item.dataset.requestId;
|
|
5293
5308
|
const entry = requestCardEntry(requestId);
|
|
5294
5309
|
if (entry.busy) return;
|
|
@@ -5877,13 +5892,33 @@
|
|
|
5877
5892
|
const current = actionProposalState(proposalId);
|
|
5878
5893
|
// #2266: an unfinished card asks FloLess once whether it has moved on (see syncActionProposal).
|
|
5879
5894
|
if (!entry.synced && !ACTION_FINAL.has(current.state)) { entry.synced = true; void syncActionProposal(proposalId); }
|
|
5880
|
-
const signature = JSON.stringify([event.eventId, current.state, current.result?.message || null, current.supersededBy, current.next || null, entry.busy, entry
|
|
5895
|
+
const signature = JSON.stringify([event.eventId, current.state, current.result?.message || null, current.supersededBy, current.next || null, entry.busy, actionStatusLine(entry, current)]);
|
|
5881
5896
|
if (entry.node && entry.signature === signature) return entry.node;
|
|
5882
5897
|
entry.node = paintActionProposal(event, payload, proposalId, entry, current);
|
|
5883
5898
|
entry.signature = signature;
|
|
5884
5899
|
return entry.node;
|
|
5885
5900
|
}
|
|
5886
5901
|
|
|
5902
|
+
/**
|
|
5903
|
+
* #3238: what a waiting card's line says. The click was answered "confirm that card first"; once that card runs, and once
|
|
5904
|
+
* it has made what this card needs, the line says so with FloLess's own words for each, rather than keep a sentence that
|
|
5905
|
+
* is no longer true. A card that card was replaced by is followed, and waiting on the new one says to confirm it (never
|
|
5906
|
+
* the expired one). One that finished without naming what it made keeps the answer: FloLess ends this card then. A card
|
|
5907
|
+
* this window does not show keeps the answer as it came. Once this card itself has moved on (confirmed from another
|
|
5908
|
+
* window, say), "confirm it again" no longer applies, and the line is the card's own.
|
|
5909
|
+
*/
|
|
5910
|
+
function actionStatusLine(entry, current) {
|
|
5911
|
+
const awaits = entry.waitingOn;
|
|
5912
|
+
if (!awaits) return entry.error;
|
|
5913
|
+
if (current.state !== 'proposed') return '';
|
|
5914
|
+
let id = awaits.id;
|
|
5915
|
+
let awaited = actionProposalState(id);
|
|
5916
|
+
for (let hops = 0; awaited.supersededBy && hops < ACTION_CARDS_KEPT; hops++) { id = awaited.supersededBy; awaited = actionProposalState(id); }
|
|
5917
|
+
if (awaited.state === 'done') return awaited.result?.made?.id ? awaits.done : entry.error;
|
|
5918
|
+
if (awaited.state === 'executing') return awaits.running;
|
|
5919
|
+
return awaited.state === 'proposed' && id !== awaits.id ? awaits.waiting : entry.error;
|
|
5920
|
+
}
|
|
5921
|
+
|
|
5887
5922
|
function repaintActionCards(focusProposal) {
|
|
5888
5923
|
for (const old of ui.feed?.querySelectorAll('.ai-chat-action-card[data-proposal-id]') || []) {
|
|
5889
5924
|
const event = state.events.find((known) => known.eventId === old.dataset.eventId);
|
|
@@ -6148,9 +6183,9 @@
|
|
|
6148
6183
|
|
|
6149
6184
|
async function actOnProposal(event, proposalId, verb) {
|
|
6150
6185
|
const entry = actionCards.get(proposalId);
|
|
6151
|
-
if (!entry || entry.busy) return;
|
|
6186
|
+
if (!entry || entry.busy || state.chat?.earlierOpening) return;
|
|
6152
6187
|
const title = String(event.payload?.title || 'the action');
|
|
6153
|
-
entry.busy = verb; entry.error = '';
|
|
6188
|
+
entry.busy = verb; entry.error = ''; entry.waitingOn = null;
|
|
6154
6189
|
repaintActionCards();
|
|
6155
6190
|
let focus = proposalId;
|
|
6156
6191
|
try {
|
|
@@ -6175,10 +6210,15 @@
|
|
|
6175
6210
|
} else if (body.fresh) {
|
|
6176
6211
|
// The target changed or the offer ended: the old card says so, and a fresh card shows the current state.
|
|
6177
6212
|
entry.local = { state: body.proposal?.state || 'superseded', result: null, supersededBy: body.fresh.id };
|
|
6178
|
-
announce(body
|
|
6213
|
+
announce(personText(body) || 'It changed after it was suggested. A new card shows the current state.');
|
|
6179
6214
|
} else {
|
|
6180
|
-
|
|
6215
|
+
// #3238: "waiting" changed nothing about this card, so it is not kept as the card's state: a later update (another
|
|
6216
|
+
// window confirming it) is then not outranked by this answer's "proposed".
|
|
6217
|
+
if (body.proposal?.state && body.code !== 'waiting') entry.local = { state: body.proposal.state, result: body.proposal.result || null, supersededBy: body.proposal.supersededBy || null };
|
|
6181
6218
|
entry.error = body.error || 'FloLess could not do that just now. Try again in a moment.';
|
|
6219
|
+
// #3238: "confirm that card first". The line then follows that card (actionStatusLine), so it never goes stale.
|
|
6220
|
+
const awaits = body.code === 'waiting' ? body.awaits : null;
|
|
6221
|
+
if (awaits && ['id', 'waiting', 'running', 'done'].every((key) => typeof awaits[key] === 'string')) entry.waitingOn = awaits;
|
|
6182
6222
|
}
|
|
6183
6223
|
} catch {
|
|
6184
6224
|
entry.error = 'FloLess could not be reached. Check that it is still running, then try again.';
|
|
@@ -6208,9 +6248,11 @@
|
|
|
6208
6248
|
card.setAttribute('aria-labelledby', titleId);
|
|
6209
6249
|
|
|
6210
6250
|
// Finished, set aside or replaced: one quiet line that says honestly what happened.
|
|
6251
|
+
// #3238: a card that waited for another card, which ended without making what it needed, says why.
|
|
6252
|
+
const ended = current.result?.code === 'card-ended' && typeof current.result.message === 'string' ? current.result.message.trim() : '';
|
|
6211
6253
|
const collapsed = {
|
|
6212
6254
|
declined: `Not now: ${title}`,
|
|
6213
|
-
expired: `Offer ended: ${title}. Ask again if you still want it.`,
|
|
6255
|
+
expired: ended ? `Offer ended: ${title}. ${ended}` : `Offer ended: ${title}. Ask again if you still want it.`,
|
|
6214
6256
|
superseded: `Replaced by a newer suggestion: ${title}`,
|
|
6215
6257
|
cancelled: `Stopped: ${title}. Work already sent to the host may remain.`,
|
|
6216
6258
|
}[current.state];
|
|
@@ -6282,7 +6324,7 @@
|
|
|
6282
6324
|
|
|
6283
6325
|
if (handedOver) {
|
|
6284
6326
|
card.classList.add('is-handed-over');
|
|
6285
|
-
status.textContent = entry
|
|
6327
|
+
status.textContent = actionStatusLine(entry, current) || String(current.result?.message || 'It is ready for you. Press it to finish.');
|
|
6286
6328
|
card.append(status);
|
|
6287
6329
|
return card;
|
|
6288
6330
|
}
|
|
@@ -6293,7 +6335,7 @@
|
|
|
6293
6335
|
// and the card's edge turns amber so the person notices their choice was not what ran.
|
|
6294
6336
|
const resultNote = typeof current.result?.note === 'string' && current.result.note ? current.result.note : '';
|
|
6295
6337
|
if (resultNote) card.classList.add('is-fallback');
|
|
6296
|
-
status.textContent = entry
|
|
6338
|
+
status.textContent = actionStatusLine(entry, current) || resultNote || (current.next ? 'Done. Its result is ready to view.' : String(payload.doneNote || 'Done.'));
|
|
6297
6339
|
if (current.next) {
|
|
6298
6340
|
// What the finished action made (a run's report): opening it only shows it, it runs nothing again.
|
|
6299
6341
|
const actions = document.createElement('div');
|
|
@@ -6341,11 +6383,17 @@
|
|
|
6341
6383
|
why.textContent = `Why: ${String(payload.why)}`;
|
|
6342
6384
|
card.append(why);
|
|
6343
6385
|
}
|
|
6386
|
+
// #3255: a request in a conversation from an earlier opening of the Workspace is history: it shows what was asked.
|
|
6387
|
+
if (state.chat?.earlierOpening) {
|
|
6388
|
+
status.textContent = 'Read only: this conversation is from before the Workspace was reopened.';
|
|
6389
|
+
card.append(status);
|
|
6390
|
+
return card;
|
|
6391
|
+
}
|
|
6344
6392
|
const actions = document.createElement('div');
|
|
6345
6393
|
actions.className = 'ai-chat-filter-actions';
|
|
6346
6394
|
if (current.state === 'executing') {
|
|
6347
6395
|
// A window step whose report did not land stays running here; what the window said (what to press) still shows.
|
|
6348
|
-
status.textContent = entry
|
|
6396
|
+
status.textContent = actionStatusLine(entry, current) || (actionId === 'workflows.run' || actionId === 'routines.run' ? 'Running…' : 'Working…');
|
|
6349
6397
|
if (actionId === 'workflows.run') {
|
|
6350
6398
|
const stop = actionButton('Stop', 'shell.chat-action-stop', proposalId, summaryText);
|
|
6351
6399
|
stop.dataset.tip = 'Asks the run to stop. Work already sent to the host may remain.';
|
|
@@ -6377,7 +6425,7 @@
|
|
|
6377
6425
|
const note = document.createElement('p');
|
|
6378
6426
|
note.className = 'ai-chat-filter-note';
|
|
6379
6427
|
// #2811: the one question this dialog asks only the person, said on the card that takes them there.
|
|
6380
|
-
note.textContent = screen.view === 'new-project' ? 'In the dialog, only you decide whether the AI may choose the Drawing Filter. Nothing is made until you press Create.'
|
|
6428
|
+
note.textContent = screen.view === 'new-project' ? 'In the dialog, only you decide whether the AI may choose the Drawing Filter, and who picks the model origin. Nothing is made until you press Create.'
|
|
6381
6429
|
: 'Only you can do this. Nothing runs from here.';
|
|
6382
6430
|
status.textContent = entry.error;
|
|
6383
6431
|
card.append(actions, note, status);
|
|
@@ -6398,7 +6446,7 @@
|
|
|
6398
6446
|
meta.className = 'ai-chat-filter-note ai-chat-action-meta';
|
|
6399
6447
|
meta.textContent = payload.revision === 'bound' ? 'Checked against how it is now; if it changes first, you will be asked again.'
|
|
6400
6448
|
: 'Acts on things as they are when you confirm.';
|
|
6401
|
-
status.textContent = entry
|
|
6449
|
+
status.textContent = actionStatusLine(entry, current);
|
|
6402
6450
|
card.append(actions, meta, status);
|
|
6403
6451
|
return card;
|
|
6404
6452
|
}
|
|
@@ -6609,7 +6657,7 @@
|
|
|
6609
6657
|
Object.assign(document.createElement('span'), { className: 'ai-chat-readiness-assumption-meta', textContent: `About: ${a.readingText}` }),
|
|
6610
6658
|
Object.assign(document.createElement('span'), { className: 'ai-chat-readiness-assumption-meta',
|
|
6611
6659
|
textContent: `You confirmed this on ${readinessDate(a.confirmedAt)}.${a.proposedBy === 'ai' ? ' The AI wrote the words.' : ''}` }));
|
|
6612
|
-
if (card.projectId) {
|
|
6660
|
+
if (card.projectId && !state.chat?.earlierOpening) {
|
|
6613
6661
|
const withdraw = button('Withdraw', 'shell.chat-readiness-withdraw-assumption', 'ai-chat-source-action');
|
|
6614
6662
|
withdraw.setAttribute('aria-label', `Withdraw assumption: ${a.statement}`);
|
|
6615
6663
|
withdraw.dataset.commandInstanceLabel = `${row.jointId}: ${a.statement}`;
|
|
@@ -7440,7 +7488,8 @@
|
|
|
7440
7488
|
card.append(line, retry);
|
|
7441
7489
|
return card;
|
|
7442
7490
|
}
|
|
7443
|
-
|
|
7491
|
+
// #3255: a suggestion made in an earlier opening of the Workspace can no longer be used, so it is not offered.
|
|
7492
|
+
if (!server || state.chat?.earlierOpening) { card.hidden = true; return card; }
|
|
7444
7493
|
|
|
7445
7494
|
const status = assistantNode('p', 'ai-chat-filter-note ai-chat-action-status assistant-card-status');
|
|
7446
7495
|
status.setAttribute('role', 'status');
|
|
@@ -7684,7 +7733,7 @@
|
|
|
7684
7733
|
}
|
|
7685
7734
|
|
|
7686
7735
|
async function useAssistantCard(entry, text) {
|
|
7687
|
-
if (entry.busy) return;
|
|
7736
|
+
if (entry.busy || state.chat?.earlierOpening) return;
|
|
7688
7737
|
const chatId = entry.event.chatId;
|
|
7689
7738
|
// #2678: the person's own click holds the card open (a read's result is shown on it), counted from the click so a
|
|
7690
7739
|
// collapse while it is answered still wins.
|
|
@@ -7798,7 +7847,7 @@
|
|
|
7798
7847
|
}
|
|
7799
7848
|
|
|
7800
7849
|
async function dismissAssistantCard(entry, title, how) {
|
|
7801
|
-
if (entry.busy) return;
|
|
7850
|
+
if (entry.busy || state.chat?.earlierOpening) return;
|
|
7802
7851
|
entry.busy = how; entry.error = '';
|
|
7803
7852
|
repaintAssistantCard(entry);
|
|
7804
7853
|
try {
|
|
@@ -7817,7 +7866,7 @@
|
|
|
7817
7866
|
}
|
|
7818
7867
|
|
|
7819
7868
|
async function bringBackAssistantCard(entry, title) {
|
|
7820
|
-
if (entry.busy) return;
|
|
7869
|
+
if (entry.busy || state.chat?.earlierOpening) return;
|
|
7821
7870
|
entry.busy = 'undo'; entry.error = '';
|
|
7822
7871
|
repaintAssistantCard(entry);
|
|
7823
7872
|
try {
|
|
@@ -8215,7 +8264,8 @@
|
|
|
8215
8264
|
// #2046: a next move the Guide suggested; web/guide.js paints it and owns its button.
|
|
8216
8265
|
// #2399 PR C2: a next step the assistant suggested in a project, workflow or workspace chat; this file paints it.
|
|
8217
8266
|
if (event.type === 'next-move' && event.payload?.assistant === true) return renderAssistantCard(event);
|
|
8218
|
-
|
|
8267
|
+
// #3255: a next move from an earlier opening of the Workspace can no longer be taken, so it is not offered.
|
|
8268
|
+
if (event.type === 'next-move') return state.chat?.earlierOpening ? null : window.flolessGuide?.renderNextMove?.(event) || null;
|
|
8219
8269
|
// #2185: what came of a card's button repaints that card; it is never a line of its own.
|
|
8220
8270
|
if (event.type === 'next-move-update') { window.flolessGuide?.applyMoveUpdate?.(event); return null; }
|
|
8221
8271
|
if (event.type === 'approval-decided' && event.payload?.automatic === true && event.payload?.connectionCheck) return renderConnectionCheckAllowed(event);
|
|
@@ -9795,8 +9845,9 @@
|
|
|
9795
9845
|
} else if (row.kind === 'origin') {
|
|
9796
9846
|
q.otherInputLabel = 'Grid crossing (optional)'; q.otherPlaceholder = 'A/1'; q.otherUncapped = true;
|
|
9797
9847
|
q.question = 'Which grid crossing is the model’s origin (0, 0)?'; q.layout = 'grid'; q.confirmSelection = true;
|
|
9798
|
-
|
|
9799
|
-
row.
|
|
9848
|
+
// #2909 V4: a crossing past a grid line's end may still be chosen; the card says so before it can be confirmed.
|
|
9849
|
+
row.choices.forEach((choice, index) => { q.options.push({ shown: originText(choice), description: 'A straight grid crossing in the model', confirmLabel: `Confirm ${originText(choice)} as the model origin`, tag: row.proposed === index ? 'THE READ SUGGESTS' : '', ...(choice.offSegment?.why ? { statement: choice.offSegment.why } : {}) }); choices.push({ key, action: 'confirm', choice: `c${index}`, shown: originText(choice) }); });
|
|
9850
|
+
row.offGrid.forEach((point, index) => { const target = row.choices[point.same]; q.options.push({ shown: point.as, description: 'Not a straight grid line; check the read’s mapping', confirmLabel: `Confirm ${originText(target)} as the model origin`, statement: `${point.as} is not a straight grid line in the model. The read says it is the same point as ${originText(target)} (${point.why}). This is the read’s claim; FloLess has not checked it.${target?.offSegment?.why ? ` ${target.offSegment.why}` : ''}` }); choices.push({ key, action: 'confirm', choice: `o${index}`, shown: originText(target) }); });
|
|
9800
9851
|
q.recommended = Number.isInteger(row.proposed) ? row.proposed : null;
|
|
9801
9852
|
if (row.fromEvidence) q.context.push(row.inherited?.length ? 'The read’s reading of your picture. Check it before you confirm.' : 'The read’s reading of your note. Check it before you confirm.');
|
|
9802
9853
|
} else {
|
|
@@ -9811,6 +9862,12 @@
|
|
|
9811
9862
|
description: row.kind === 'scale' ? proposal.evidence : levelEvidence(proposal), tag: proposal.source === 'read-of-picture' && !row.inherited?.length ? 'THE READ’S READING OF YOUR NOTE' : (row.kind === 'scale' ? scaleTag : levelTag)[proposal.source] || 'PROPOSED' }); choices.push({ key, action: 'confirm', choice: proposal.id, shown: row.kind === 'scale' ? proposal.mmPerPx : proposal.value }); });
|
|
9812
9863
|
}
|
|
9813
9864
|
if (kind === 'setup' && (row.kind === 'origin' || row.kind === 'scale')) q.context.push('This setup question has no saved drawing location. Inspect the drawing set in Drawing Filter, or ask the read to point out the context.');
|
|
9865
|
+
// #2909 (owner ruling 2026-11-08): in a Quick read whose person chose to pick the origin, they can hand it back.
|
|
9866
|
+
// A real answer with a recorded outcome, so it comes before the "None of these" escape hatch (UX review).
|
|
9867
|
+
if (kind === 'setup' && row.kind === 'origin' && entry.view?.originHandBack === true) {
|
|
9868
|
+
q.options.push({ shown: 'Let the AI choose', description: SETUP_HANDBACK_WORDS, confirmLabel: 'Let the AI choose the model origin', tag: '' });
|
|
9869
|
+
choices.push({ key, action: 'to-ai' });
|
|
9870
|
+
}
|
|
9814
9871
|
if (kind === 'setup' && row.kind !== 'scale') { q.options.push({ shown: row.kind === 'origin' ? 'None of these' : 'No single level', description: 'Tell the read what to use instead', requiresNote: { placeholder: 'Say why, and what to use instead', max: MAX_HEIGHT_CLARIFICATION } }); choices.push({ key, action: 'none' }); }
|
|
9815
9872
|
if (kind === 'setup') { const banner = setupConflictBanner(row); if (banner) q.context.push(banner.textContent); }
|
|
9816
9873
|
const controlKey = kind === 'height' ? `${row.memberId} ${row.endWord}` : key;
|
|
@@ -9893,7 +9950,8 @@
|
|
|
9893
9950
|
const showing = tray.querySelector('.ai-chat-drawing-step');
|
|
9894
9951
|
const heldFocus = showing?.contains(document.activeElement) ? document.activeElement : null;
|
|
9895
9952
|
// A hidden approval or AI question still holds the slot (Codex review round 3): its line is not an .ai-chat-approval.
|
|
9896
|
-
|
|
9953
|
+
// #3255: nothing in a conversation from an earlier opening of the Workspace waits for an answer.
|
|
9954
|
+
if (state.chat?.earlierOpening || state.chat?.pendingApproval || tray.querySelector('.ai-chat-approval:not(.ai-chat-approval-scope):not(.ai-chat-drawing-step), .ai-chat-approval-hidden')) { showing?.remove(); return false; }
|
|
9897
9955
|
const entries = [...setupCards.values()].map((entry) => ({ kind: 'setup', entry })).concat([...heightCards.values()].map((entry) => ({ kind: 'height', entry })))
|
|
9898
9956
|
.filter(({ entry }) => drawingEntryCurrent(entry) && entry.view?.open && !entry.reloadPending && !entry.loading)
|
|
9899
9957
|
.sort((a, b) => (drawingEntryHeld(b.entry) ? b.entry.reopenedAt || 0 : 0) - (drawingEntryHeld(a.entry) ? a.entry.reopenedAt || 0 : 0) || a.entry.sequence - b.entry.sequence);
|
|
@@ -9993,6 +10051,7 @@
|
|
|
9993
10051
|
else if (step.key === 'batch-value') name = 'bulk-confirm';
|
|
9994
10052
|
else if (step.row?.kind === 'origin' && step.actions[extra]?.action === 'confirm') { name = 'origin-choice'; suffix += ` ${step.actions[extra].choice}`; instance = step.question.options[extra].shown; }
|
|
9995
10053
|
else if (step.actions?.[extra]?.action === 'none') name = 'none';
|
|
10054
|
+
else if (step.actions?.[extra]?.action === 'to-ai') name = 'handback';
|
|
9996
10055
|
else { name = 'confirm'; if (step.actions?.[extra]?.choice) suffix += ` ${step.actions[extra].choice}`; }
|
|
9997
10056
|
} else if (what === 'group') { name = 'select-group'; const groups = [...new Set(step.rows.map((row) => row.group).filter(Boolean))]; suffix = groups[extra]; instance = suffix; }
|
|
9998
10057
|
else if (what === 'other-input') name = step.key === 'batch-value' ? 'bulk-input' : 'input';
|
|
@@ -10003,6 +10062,7 @@
|
|
|
10003
10062
|
if (step.key === 'batch-select') name = 'bulk-next';
|
|
10004
10063
|
else if (step.key === 'batch-value') name = !draft.rows[0].choices.length && !draft.rows[0].other.trim() && hasAnswerSource(step.scope) ? 'bulk-evidence' : 'bulk-use';
|
|
10005
10064
|
else if (step.actions?.[draft.rows[0].choices[0]]?.action === 'none') name = 'none-save';
|
|
10065
|
+
else if (step.actions?.[draft.rows[0].choices[0]]?.action === 'to-ai') name = 'handback-confirm';
|
|
10006
10066
|
else if (!draft.rows[0].choices.length && !draft.rows[0].other.trim() && hasAnswerSource(step.scope)) name = 'evidence';
|
|
10007
10067
|
else name = step.row?.kind === 'origin' && !draft.rows[0].otherOpen ? 'origin-confirm' : 'use';
|
|
10008
10068
|
}
|
|
@@ -10161,7 +10221,9 @@
|
|
|
10161
10221
|
|| rememberCard(entry, paintSetupCard(entry, event.eventId, String(event.sequence)), event.eventId, String(event.sequence));
|
|
10162
10222
|
}
|
|
10163
10223
|
|
|
10164
|
-
|
|
10224
|
+
// #2909: handing the origin to the AI is the person's whole answer to that row; the AI's decision is the read's to make.
|
|
10225
|
+
const setupSettled = (row) => row.status === 'settled' || row.status === 'handed-to-ai';
|
|
10226
|
+
const SETUP_HANDBACK_WORDS = 'The AI uses the bottom-left grid intersection when every plan view is upright and the grid is straight; otherwise it picks one and records why. Its choice is labelled as the AI\u2019s.';
|
|
10165
10227
|
const setupLive = (row) => row.status !== 'superseded';
|
|
10166
10228
|
const scaleTag = { floless: 'FLOLESS FIT', 'floless-candidate': 'FLOLESS CANDIDATE', 'floless-scale-bar': 'THE SHEET’S SCALE BAR', read: 'THE READ’S MEASUREMENT', 'read-of-picture': 'THE READ’S READING OF YOUR PICTURE' };
|
|
10167
10229
|
const levelTag = { 'drawing-text': 'ON THE DRAWING', 'drawing-picture': 'READ OFF THE PICTURE · NOT CHECKED', 'read-of-picture': 'THE READ’S READING OF YOUR PICTURE' };
|
|
@@ -10172,6 +10234,7 @@
|
|
|
10172
10234
|
const a = row.answer;
|
|
10173
10235
|
if (!a) return '';
|
|
10174
10236
|
if (row.kind === 'origin') {
|
|
10237
|
+
if (a.how === 'handed-to-ai') return 'You let the AI choose the model origin';
|
|
10175
10238
|
if (a.how === 'none') return `None of these: ${a.note}`;
|
|
10176
10239
|
return `${originText(a.origin)}${a.origin.pickedAs ? ` (you picked ${a.origin.pickedAs})` : ''}${a.how === 'typed' ? ', typed' : ''}`;
|
|
10177
10240
|
}
|
|
@@ -10225,7 +10288,7 @@
|
|
|
10225
10288
|
const changing = entry.changing.has(row.key);
|
|
10226
10289
|
if (row.answer && !changing && row.status !== 'picture') {
|
|
10227
10290
|
const done = document.createElement('div'); done.className = 'ai-chat-height-answered';
|
|
10228
|
-
const glyph = document.createElement('span'); glyph.className = 'ai-chat-height-glyph'; glyph.textContent = row
|
|
10291
|
+
const glyph = document.createElement('span'); glyph.className = 'ai-chat-height-glyph'; glyph.textContent = setupSettled(row) ? '✓' : '…'; glyph.setAttribute('aria-hidden', 'true');
|
|
10229
10292
|
const text = document.createElement('span');
|
|
10230
10293
|
text.textContent = row.status === 'needs-new-choices' ? `${setupAnswerText(row)}. Waiting for the read to offer other points.` : setupAnswerText(row);
|
|
10231
10294
|
done.append(glyph, text);
|
|
@@ -10665,7 +10728,7 @@
|
|
|
10665
10728
|
const ownerKey = scopeKey(state.scope);
|
|
10666
10729
|
if (!ownerKey) return false;
|
|
10667
10730
|
Promise.resolve(openConversation(link.chatId, { messageEventId: link.messageEventId, ownerKey }))
|
|
10668
|
-
.catch((error) => { window.showToast?.(error
|
|
10731
|
+
.catch((error) => { window.showToast?.(errorText(error, { action: 'open that conversation', retrySafe: true }), 'info'); });
|
|
10669
10732
|
return true;
|
|
10670
10733
|
}
|
|
10671
10734
|
|
|
@@ -11332,7 +11395,8 @@
|
|
|
11332
11395
|
shell.dataset.approvalPending = String(Boolean(approval) && !deciding);
|
|
11333
11396
|
// #2223 Revision 6: a question Codex asked without waiting, while no approval holds the slot — a blocking question or an
|
|
11334
11397
|
// action the AI is waiting on always goes first, and this one shows once it has settled. The chat is waiting on the person.
|
|
11335
|
-
|
|
11398
|
+
// #3255: a question from an earlier opening of the Workspace is history; nobody can answer it there.
|
|
11399
|
+
const asking = approval || state.chat?.earlierOpening ? null : openAsyncQuestion(state.events, state.chat);
|
|
11336
11400
|
if (asking) shell.dataset.approvalPending = 'true';
|
|
11337
11401
|
document.dispatchEvent(new CustomEvent('floless:chat-indicator'));
|
|
11338
11402
|
const waiting = asking || (approval && !deciding ? approval : null);
|
|
@@ -12175,7 +12239,8 @@
|
|
|
12175
12239
|
const turn = state.chat?.activeTurn;
|
|
12176
12240
|
// #2162: a session grant belongs to the conversation, so it shows whatever the turn is doing, and instead of the
|
|
12177
12241
|
// request strip, which it contains.
|
|
12178
|
-
|
|
12242
|
+
// #3255: what an earlier opening allowed is not live: it is not shown as a permission with Revoke.
|
|
12243
|
+
const session = state.chat?.earlierOpening ? null : state.chat?.sessionApproval;
|
|
12179
12244
|
if (session) { paintSessionApprovalScope(existing, session); return; }
|
|
12180
12245
|
if (!turn?.accessApprovalGranted || !['running', 'awaiting-approval'].includes(state.chat?.state)) {
|
|
12181
12246
|
existing?.remove(); return;
|
|
@@ -13246,7 +13311,8 @@
|
|
|
13246
13311
|
current = { mode: body.mode, recovered: body.recovered === true }; publish();
|
|
13247
13312
|
announce(`Suggest next steps: ${SUGGEST_LABELS[body.mode] || body.mode}.`);
|
|
13248
13313
|
} catch (error) {
|
|
13249
|
-
|
|
13314
|
+
// Choosing a setting again sets the same value, so a retry is safe.
|
|
13315
|
+
announce(errorText(error, { action: 'save that setting', retrySafe: true }));
|
|
13250
13316
|
}
|
|
13251
13317
|
},
|
|
13252
13318
|
choices() {
|
|
@@ -13279,7 +13345,7 @@
|
|
|
13279
13345
|
if (ui.scopeControls) paintScopeControl();
|
|
13280
13346
|
paintSuggestSetting();
|
|
13281
13347
|
const chat = state.chat;
|
|
13282
|
-
ui.settingsToggle.disabled = !chat;
|
|
13348
|
+
ui.settingsToggle.disabled = !chat || Boolean(chat?.earlierOpening);
|
|
13283
13349
|
const answer = capabilityAnswer(state.capability);
|
|
13284
13350
|
const pendingSignIn = Boolean(chat && state.signInPending.has(chat.provider));
|
|
13285
13351
|
const accountLabel = chat ? providerAccountLabel(chat.provider, answer) : '—';
|
|
@@ -13428,12 +13494,13 @@
|
|
|
13428
13494
|
const chat = state.chat;
|
|
13429
13495
|
if (!chat) { providerChooser(); paintHistory(); return; }
|
|
13430
13496
|
ui.historyToggle.disabled = false;
|
|
13431
|
-
|
|
13497
|
+
// #3255: an earlier opening's conversation is read only: nothing in its header changes it.
|
|
13498
|
+
ui.refresh.disabled = Boolean(chat?.earlierOpening);
|
|
13432
13499
|
ui.title.textContent = chat.title;
|
|
13433
13500
|
ui.scope.textContent = `${state.scope.label} · ${providerLabels[chat.provider]}`;
|
|
13434
|
-
ui.rename.hidden = Boolean(chat.activeTurn) || Boolean(chat.archivedAt);
|
|
13435
|
-
ui.input.disabled = Boolean(chat.archivedAt) || chat.state === 'recovery' || requestExecutionBlocked();
|
|
13436
|
-
const draft = draftForChat(chat);
|
|
13501
|
+
ui.rename.hidden = Boolean(chat.activeTurn) || Boolean(chat.archivedAt) || Boolean(chat?.earlierOpening);
|
|
13502
|
+
ui.input.disabled = Boolean(chat.archivedAt) || chat.state === 'recovery' || requestExecutionBlocked() || Boolean(chat?.earlierOpening);
|
|
13503
|
+
const draft = chat?.earlierOpening ? '' : draftForChat(chat);
|
|
13437
13504
|
if (ui.input.value !== draft && document.activeElement !== ui.input) ui.input.value = draft;
|
|
13438
13505
|
const active = turnIsVisiblyActive(chat);
|
|
13439
13506
|
ui.stop.hidden = !active || Boolean(chat.activeTurn?.local);
|
|
@@ -13497,7 +13564,8 @@
|
|
|
13497
13564
|
|
|
13498
13565
|
function connectEvents() {
|
|
13499
13566
|
closeSource();
|
|
13500
|
-
|
|
13567
|
+
// #3255: an earlier opening's conversation has nothing live to stream.
|
|
13568
|
+
if (!state.chat || !state.scope || state.chat?.earlierOpening) return;
|
|
13501
13569
|
const chatId = state.chat.chatId;
|
|
13502
13570
|
const scope = state.scope;
|
|
13503
13571
|
const generation = state.scopeGeneration;
|
|
@@ -13847,7 +13915,9 @@
|
|
|
13847
13915
|
if (exactQuestion) window.showToast?.(gone, 'info');
|
|
13848
13916
|
return;
|
|
13849
13917
|
}
|
|
13850
|
-
|
|
13918
|
+
// #3255: a conversation from an earlier opening asks the AI app nothing: it is only read.
|
|
13919
|
+
const [capability, desktop] = chat?.earlierOpening ? [null, null]
|
|
13920
|
+
: await Promise.all([readCapability(chat), readDesktopCapability(chat)]);
|
|
13851
13921
|
if (generation !== state.scopeGeneration || selection !== state.selectionGeneration) return;
|
|
13852
13922
|
// Reopened while this conversation was opening: the person has moved on to the history, so
|
|
13853
13923
|
// it stays open — with any rename in it — and focus stays where they put it (#1646).
|
|
@@ -13861,8 +13931,8 @@
|
|
|
13861
13931
|
reconcileUnknownFollowupOnSelection(chat);
|
|
13862
13932
|
state.capability = capability;
|
|
13863
13933
|
state.desktop = desktop;
|
|
13864
|
-
state.attachments = composerDrafts(chat);
|
|
13865
|
-
ui.input.value = draftForChat(chat);
|
|
13934
|
+
state.attachments = chat?.earlierOpening ? [] : composerDrafts(chat);
|
|
13935
|
+
ui.input.value = chat?.earlierOpening ? '' : draftForChat(chat);
|
|
13866
13936
|
// A cached draft may be newer than the server draft after a fast switch.
|
|
13867
13937
|
// Save it now, even if the user does not type again after reopening.
|
|
13868
13938
|
if (state.backgroundDrafts.has(chatId) && draftFitsStorage(state.scope.owner, ui.input.value)) saveDraftSoon();
|
|
@@ -13873,11 +13943,11 @@
|
|
|
13873
13943
|
}, 2600);
|
|
13874
13944
|
}
|
|
13875
13945
|
paintConversation(); connectEvents();
|
|
13876
|
-
if (options.applyProviderDefaults || !chat.nativeSessionId) await applyProviderDefaults(chatId);
|
|
13946
|
+
if (!chat?.earlierOpening && (options.applyProviderDefaults || !chat.nativeSessionId)) await applyProviderDefaults(chatId);
|
|
13877
13947
|
// Let the server prepare the provider for the next message while the user types, after the
|
|
13878
13948
|
// default model and effort are saved so the prepared runtime matches the first message. Best-effort:
|
|
13879
13949
|
// the server decides whether a runtime can be prepared; nothing here waits on it.
|
|
13880
|
-
if (providerReady()) void request(`/api/chat/conversations/${encodeURIComponent(chatId)}/warm`, {
|
|
13950
|
+
if (providerReady() && !chat?.earlierOpening) void request(`/api/chat/conversations/${encodeURIComponent(chatId)}/warm`, {
|
|
13881
13951
|
method: 'POST', body: JSON.stringify({ owner: state.scope.owner }),
|
|
13882
13952
|
}).catch(() => { /* a missed warm-up only means a slower first message */ });
|
|
13883
13953
|
if (answerTarget) {
|
|
@@ -13919,7 +13989,8 @@
|
|
|
13919
13989
|
|| chat.draft?.trim() === uncertain.text.trim()) {
|
|
13920
13990
|
state.localDraft = { chatId, text: '' };
|
|
13921
13991
|
chat.draft = '';
|
|
13922
|
-
|
|
13992
|
+
// #3255: opening an earlier opening's conversation writes nothing into it.
|
|
13993
|
+
if (!chat?.earlierOpening) void writeChatDraft(chatId, state.scope.owner, '').catch(error => report(error, 'Draft was not saved'));
|
|
13923
13994
|
}
|
|
13924
13995
|
} else {
|
|
13925
13996
|
state.followupUnknownId = uncertain.submissionId;
|
|
@@ -14044,7 +14115,9 @@
|
|
|
14044
14115
|
const host = ui.workspaceUnits;
|
|
14045
14116
|
if (!host) return;
|
|
14046
14117
|
const chat = state.chat;
|
|
14047
|
-
|
|
14118
|
+
// #3255: the receipts of a conversation from an earlier opening still read in its own units; only the menu is hidden.
|
|
14119
|
+
if (state.scope?.owner?.kind === 'workspace' && chat?.earlierOpening) state.displayUnits = workspaceUnitsOf(chat);
|
|
14120
|
+
if (state.scope?.owner?.kind !== 'workspace' || !chat || chat.archivedAt || chat.earlierOpening) { dropUnitsMenu(); host.hidden = true; host.replaceChildren(); delete host.dataset.painted; return; }
|
|
14048
14121
|
// The receipts' units follow the conversation's own (chosen, else suggested) — set here, where the chat is known.
|
|
14049
14122
|
state.displayUnits = workspaceUnitsOf(chat);
|
|
14050
14123
|
const units = chat.workspaceUnits || {};
|
|
@@ -14134,6 +14207,7 @@
|
|
|
14134
14207
|
}
|
|
14135
14208
|
|
|
14136
14209
|
async function chooseWorkspaceUnits(value) {
|
|
14210
|
+
if (state.chat?.earlierOpening) return;
|
|
14137
14211
|
const snapshot = captureChat();
|
|
14138
14212
|
if (!snapshot) return;
|
|
14139
14213
|
try {
|
|
@@ -14414,6 +14488,8 @@
|
|
|
14414
14488
|
}
|
|
14415
14489
|
|
|
14416
14490
|
async function saveSettings(patch, options = {}) {
|
|
14491
|
+
// #3255: nothing in an earlier opening's conversation is changed.
|
|
14492
|
+
if (state.chat?.earlierOpening) return;
|
|
14417
14493
|
let snapshot = captureChat();
|
|
14418
14494
|
if (!snapshot) return;
|
|
14419
14495
|
// #2059: giving an Instructor answer tools asks first; the server refuses it without this confirmation.
|
|
@@ -14705,7 +14781,8 @@
|
|
|
14705
14781
|
// A provider FloLess is still setting up cannot take a message; the runtime card explains why.
|
|
14706
14782
|
const settingUp = Boolean(state.capability?.runtime && state.capability.runtime.state !== 'installed');
|
|
14707
14783
|
const uploading = Boolean(state.chat?.chatId && state.uploadingChatIds.has(state.chat.chatId));
|
|
14708
|
-
|
|
14784
|
+
const history = Boolean(state.chat?.earlierOpening);
|
|
14785
|
+
ui.input.disabled = state.followupSubmitting || !state.chat || Boolean(state.chat?.archivedAt) || recovery || blocked || history;
|
|
14709
14786
|
// #1890 PR 3b: while the conversation moves, typing goes on (the draft is kept) and Send waits. Inline, not a helper:
|
|
14710
14787
|
// several harnesses run this function on its own.
|
|
14711
14788
|
const movingTo = state.chat?.rehome && ['freezing', 'copying', 'publishing'].includes(state.chat.rehome.state)
|
|
@@ -14721,10 +14798,10 @@
|
|
|
14721
14798
|
ui.send.disabled = state.loading || state.followupSubmitting || Boolean(state.followupUnknownId) || hasUnknownFollowup() || uploading || !state.chat || blocked || frozen
|
|
14722
14799
|
|| (!ui.input.value.trim() && state.attachments.length === 0
|
|
14723
14800
|
&& !(state.mentions?.[state.chat?.chatId]?.length)) || settingUp;
|
|
14724
|
-
if (moving) ui.send.disabled = true;
|
|
14801
|
+
if (moving || history) ui.send.disabled = true;
|
|
14725
14802
|
// The paperclip is the same on every surface, the Drawing Filter included (#1681, #1859): a message
|
|
14726
14803
|
// there carries the filter's context AND whatever the person attached, under the general rules only.
|
|
14727
|
-
ui.attach.disabled = state.loading || state.followupSubmitting || Boolean(state.followupUnknownId) || hasUnknownFollowup() || uploading || !state.chat || blocked || frozen;
|
|
14804
|
+
ui.attach.disabled = state.loading || state.followupSubmitting || Boolean(state.followupUnknownId) || hasUnknownFollowup() || uploading || !state.chat || blocked || frozen || history;
|
|
14728
14805
|
// Repainted here too: this runs on a surface switch, which changes what may be attached without
|
|
14729
14806
|
// changing the attachments themselves.
|
|
14730
14807
|
paintAttachControl();
|
|
@@ -14733,7 +14810,9 @@
|
|
|
14733
14810
|
const sendingReason = state.followupSubmitting
|
|
14734
14811
|
? 'FloLess is saving this message. Wait for its delivery status before sending another.' : null;
|
|
14735
14812
|
for (const control of [ui.send, ui.attach]) {
|
|
14736
|
-
|
|
14813
|
+
// #3255: Instructor says why Send and the paperclip are off in an earlier opening's conversation.
|
|
14814
|
+
const historyReason = history ? 'Read only: this conversation is from before the Workspace was reopened.' : null;
|
|
14815
|
+
if (unknownReason || sendingReason || historyReason) control.dataset.blockedReason = unknownReason || sendingReason || historyReason;
|
|
14737
14816
|
else delete control.dataset.blockedReason;
|
|
14738
14817
|
}
|
|
14739
14818
|
ui.stop.hidden = !active || Boolean(state.chat?.activeTurn?.local);
|
|
@@ -14741,7 +14820,7 @@
|
|
|
14741
14820
|
ui.send.hidden = false;
|
|
14742
14821
|
// Session recovery must remain available even while provider capability discovery is loading
|
|
14743
14822
|
// or has failed; it is the escape hatch for that exact state.
|
|
14744
|
-
ui.refresh.disabled = !state.chat;
|
|
14823
|
+
ui.refresh.disabled = !state.chat || history;
|
|
14745
14824
|
clearReport();
|
|
14746
14825
|
paintFloLessContext();
|
|
14747
14826
|
}
|
|
@@ -14763,7 +14842,7 @@
|
|
|
14763
14842
|
|
|
14764
14843
|
function saveDraftSoon() {
|
|
14765
14844
|
clearTimeout(state.draftTimer);
|
|
14766
|
-
if (!state.chat) return;
|
|
14845
|
+
if (!state.chat || state.chat?.earlierOpening) return;
|
|
14767
14846
|
const chatId = state.chat.chatId;
|
|
14768
14847
|
const draft = ui.input.value;
|
|
14769
14848
|
state.localDraft = { chatId, text: draft };
|
|
@@ -15071,8 +15150,9 @@
|
|
|
15071
15150
|
// Repaints run on every filter change; keep keyboard focus on the same control when it survives.
|
|
15072
15151
|
const focused = actions.contains(document.activeElement) ? document.activeElement.dataset.commandId : null;
|
|
15073
15152
|
actions.replaceChildren();
|
|
15074
|
-
if (!info.known) {
|
|
15075
|
-
// Nothing here can act on a suggestion this page never recorded
|
|
15153
|
+
if (!info.known || state.chat?.earlierOpening) {
|
|
15154
|
+
// Nothing here can act on a suggestion this page never recorded, or on one from an earlier opening of the
|
|
15155
|
+
// Workspace (#3255); the note says why.
|
|
15076
15156
|
} else if (disposition === 'pending' && hasChanges) {
|
|
15077
15157
|
const unavailable = info.applicable ? null : info.reason || FILTER_NOT_OPEN;
|
|
15078
15158
|
const keep = filterActionButton('Keep current', 'keep', requestId, 'ai-chat-filter-keep', info.known && info.open ? null : unavailable);
|
|
@@ -15094,20 +15174,22 @@
|
|
|
15094
15174
|
const requestId = String(event.payload.requestId || '');
|
|
15095
15175
|
// Re-resolve the page at click time: the frame may have reloaded since this card was painted.
|
|
15096
15176
|
const surface = filterSurface();
|
|
15097
|
-
|
|
15098
|
-
|
|
15177
|
+
// `outcome.message` is the Drawing Filter bridge's own sentence for the person (its apply / undo / keep answer), not
|
|
15178
|
+
// a thrown error's text.
|
|
15179
|
+
let outcome;
|
|
15180
|
+
if (surface.state !== 'ready') outcome = { ok: false, message: FILTER_NOT_OPEN };
|
|
15099
15181
|
else {
|
|
15100
15182
|
try {
|
|
15101
|
-
|
|
15183
|
+
outcome = action === 'apply' ? surface.bridge.apply(requestId, event.payload.filterAi.proposal)
|
|
15102
15184
|
: action === 'undo' ? surface.bridge.undo(requestId) : surface.bridge.keep(requestId);
|
|
15103
15185
|
} catch (error) {
|
|
15104
15186
|
console.error('[chat] the Drawing Filter could not finish a suggestion action:', error);
|
|
15105
|
-
|
|
15187
|
+
outcome = { ok: false, message: 'FloLess could not finish this in the Drawing Filter. Check its ticks before you save, and reload the Drawing Filter if they look wrong.' };
|
|
15106
15188
|
}
|
|
15107
15189
|
}
|
|
15108
|
-
if (
|
|
15109
|
-
else state.filterCardMessages.set(requestId,
|
|
15110
|
-
announce(
|
|
15190
|
+
if (outcome?.ok) state.filterCardMessages.delete(requestId);
|
|
15191
|
+
else state.filterCardMessages.set(requestId, outcome?.message || FILTER_NOT_OPEN);
|
|
15192
|
+
announce(outcome?.message || FILTER_NOT_OPEN);
|
|
15111
15193
|
refreshFilterCards();
|
|
15112
15194
|
const card = ui.feed.querySelector(`.ai-chat-filter-card[data-request-id="${CSS.escape(requestId)}"]`);
|
|
15113
15195
|
(card?.querySelector('.ai-chat-filter-actions button') || card?.querySelector('.ai-chat-filter-note'))?.focus({ preventScroll: true });
|
|
@@ -15307,6 +15389,7 @@
|
|
|
15307
15389
|
* on-screen selection, and the outcome is settled. A claim that is never settled is never reopened.
|
|
15308
15390
|
*/
|
|
15309
15391
|
async function runServerProposalAction(action, event) {
|
|
15392
|
+
if (state.chat?.earlierOpening) return;
|
|
15310
15393
|
const payload = event.payload.serverProposal;
|
|
15311
15394
|
const requestId = String(event.payload.requestId || '');
|
|
15312
15395
|
const snapshot = captureChat();
|
|
@@ -15418,6 +15501,7 @@
|
|
|
15418
15501
|
function givenMessageBlocked() {
|
|
15419
15502
|
const chat = state.chat;
|
|
15420
15503
|
if (!chat || chat.archivedAt) return 'This conversation can’t take a message right now. Open it again, then send your answer.';
|
|
15504
|
+
if (chat.earlierOpening) return 'This conversation is from before this Workspace was reopened, so you can read it but not continue it. To carry on, choose New conversation at the top of the chat. The new conversation won’t remember this one.';
|
|
15421
15505
|
if (state.loading || state.followupSubmitting || chat.activeTurn?.local) return 'FloLess is still sending your last message. Wait a moment, then send your answer again.';
|
|
15422
15506
|
if (state.followupUnknownId || hasUnknownFollowup()) return 'FloLess could not confirm your last message reached the AI. Check it in the conversation, then send your answer.';
|
|
15423
15507
|
if (chat.state === 'recovery') return 'This conversation is reconnecting to the AI. Send your answer once it is ready.';
|
|
@@ -15729,8 +15813,9 @@
|
|
|
15729
15813
|
async function checkProjectWait() {
|
|
15730
15814
|
const busy = state.projectBusy;
|
|
15731
15815
|
if (!busy || busy.mode !== 'waiting' || busy.checking) return;
|
|
15732
|
-
// The wait belongs to the conversation it was asked in; leaving it ends the wait (the draft stays there).
|
|
15733
|
-
|
|
15816
|
+
// The wait belongs to the conversation it was asked in; leaving it ends the wait (the draft stays there). #3255: so
|
|
15817
|
+
// does that conversation becoming an earlier opening's: nothing is sent into it.
|
|
15818
|
+
if (state.chat?.chatId !== busy.message.chatId || state.chat?.earlierOpening) { endProjectBusy(); return; }
|
|
15734
15819
|
if (Date.now() - busy.since >= PROJECT_WAIT_CAP_MS) {
|
|
15735
15820
|
clearInterval(busy.timer); busy.timer = null; busy.mode = 'cap';
|
|
15736
15821
|
paintProjectBusy({ focus: true });
|
|
@@ -15821,7 +15906,7 @@
|
|
|
15821
15906
|
/** #2106: a project's Knowledge step. A missing Workspaces bridge is said, never a silent no-op. */
|
|
15822
15907
|
async function openKnowledgeStepOf(projectId) {
|
|
15823
15908
|
const open = window.flolessWorkspaces?.openKnowledgeStep;
|
|
15824
|
-
if (typeof open !== 'function') throw new Error('FloLess couldn’t open that project’s Knowledge step. Open it from Workspaces.');
|
|
15909
|
+
if (typeof open !== 'function') throw Object.assign(new Error('FloLess couldn’t open that project’s Knowledge step. Open it from Workspaces.'), { forPerson: true });
|
|
15825
15910
|
await open(projectId);
|
|
15826
15911
|
}
|
|
15827
15912
|
|
|
@@ -15831,7 +15916,7 @@
|
|
|
15831
15916
|
if (holder.kind === 'knowledge') {
|
|
15832
15917
|
// The wait keeps going: opening the Knowledge step only shows the organizing this message waits for.
|
|
15833
15918
|
try { await openKnowledgeStepOf(holder.projectId); }
|
|
15834
|
-
catch (error) { announce(error
|
|
15919
|
+
catch (error) { announce(errorText(error, { action: 'open that project’s Knowledge step', retrySafe: true })); }
|
|
15835
15920
|
return;
|
|
15836
15921
|
}
|
|
15837
15922
|
if (holder.kind === 'chat' && holder.chatId && holder.owner) {
|
|
@@ -16100,7 +16185,7 @@
|
|
|
16100
16185
|
}
|
|
16101
16186
|
|
|
16102
16187
|
async function resolveUnknownFollowup(clientSubmissionId) {
|
|
16103
|
-
if (!state.chat || !clientSubmissionId) return;
|
|
16188
|
+
if (!state.chat || !clientSubmissionId || state.chat.earlierOpening) return;
|
|
16104
16189
|
if (state.resolvingFollowupIds.has(clientSubmissionId)) return;
|
|
16105
16190
|
const optimistic = state.events.find((event) => event.optimistic && event.clientSubmissionId === clientSubmissionId);
|
|
16106
16191
|
if (optimistic) {
|
|
@@ -16148,7 +16233,7 @@
|
|
|
16148
16233
|
}
|
|
16149
16234
|
|
|
16150
16235
|
async function retryNotSentFollowup(clientSubmissionId) {
|
|
16151
|
-
if (!state.chat || !clientSubmissionId || state.retryingFollowupIds.has(clientSubmissionId)) return;
|
|
16236
|
+
if (!state.chat || !clientSubmissionId || state.chat.earlierOpening || state.retryingFollowupIds.has(clientSubmissionId)) return;
|
|
16152
16237
|
const snapshot = captureChat();
|
|
16153
16238
|
if (!snapshot) return;
|
|
16154
16239
|
const commandId = `shell.chat-followup-retry#${clientSubmissionId}`;
|
|
@@ -16620,7 +16705,7 @@
|
|
|
16620
16705
|
}
|
|
16621
16706
|
|
|
16622
16707
|
async function attachFiles(files) {
|
|
16623
|
-
if (!state.chat || state.chat.activeTurn?.local || state.chat.state === 'recovery' || state.followupSubmitting || state.followupUnknownId || hasUnknownFollowup()) return;
|
|
16708
|
+
if (!state.chat || state.chat.earlierOpening || state.chat.activeTurn?.local || state.chat.state === 'recovery' || state.followupSubmitting || state.followupUnknownId || hasUnknownFollowup()) return;
|
|
16624
16709
|
const snapshot = captureChat();
|
|
16625
16710
|
if (!snapshot) return;
|
|
16626
16711
|
if (state.uploadingChatIds.has(snapshot.chatId)) return;
|
|
@@ -16729,7 +16814,7 @@
|
|
|
16729
16814
|
paintTeklaChip();
|
|
16730
16815
|
// SSE delivers messages immediately, while this poll is what confirms that the provider has
|
|
16731
16816
|
// finished. Keep the Rename chat control in step with that durable active-turn state.
|
|
16732
|
-
ui.rename.hidden = !state.chat || Boolean(state.chat.activeTurn) || Boolean(state.chat.archivedAt);
|
|
16817
|
+
ui.rename.hidden = !state.chat || Boolean(state.chat.activeTurn) || Boolean(state.chat.archivedAt) || Boolean(state.chat?.earlierOpening);
|
|
16733
16818
|
// Polling can clear activeTurn after the feed was painted by SSE. Repaint the feed
|
|
16734
16819
|
// so a completed turn removes any stale live activity indicator. With no conversation
|
|
16735
16820
|
// selected the feed is the Claude/Codex chooser, which a repaint would erase.
|
|
@@ -16743,7 +16828,7 @@
|
|
|
16743
16828
|
// after a sign-out made elsewhere can still carry the reader's stale answer. Not for a
|
|
16744
16829
|
// conversation with messages and the strip closed: past the 10 s server cache this read
|
|
16745
16830
|
// asks both CLIs for their status, and nothing there would show the answer.
|
|
16746
|
-
if (state.chat && (!ui.settings.hidden || !state.events.length)) {
|
|
16831
|
+
if (state.chat && !state.chat.earlierOpening && (!ui.settings.hidden || !state.events.length)) {
|
|
16747
16832
|
const chatId = state.chat.chatId;
|
|
16748
16833
|
try {
|
|
16749
16834
|
const info = await request('/api/terminal-runtimes');
|
|
@@ -16899,8 +16984,9 @@
|
|
|
16899
16984
|
* conversation in the same project, the earlier one left in history. Nothing of the old transcript is carried over.
|
|
16900
16985
|
*/
|
|
16901
16986
|
async function startNewChat(projectId) {
|
|
16902
|
-
// `
|
|
16903
|
-
|
|
16987
|
+
// `forPerson` (failure-copy.js errorText): the sentence is written for the person, so the caller shows it as it is
|
|
16988
|
+
// (not as an unknown failure).
|
|
16989
|
+
const refuse = (text) => Object.assign(new Error(text), { forPerson: true });
|
|
16904
16990
|
await refreshScope();
|
|
16905
16991
|
const owner = state.scope?.owner;
|
|
16906
16992
|
if (!owner || (projectId && (owner.kind !== 'project' || owner.projectId !== projectId))) {
|
|
@@ -16966,7 +17052,8 @@
|
|
|
16966
17052
|
const draft = teklaDraftForChat(chat);
|
|
16967
17053
|
const bound = currentTeklaBinding(chat);
|
|
16968
17054
|
const library = draft?.library || bound;
|
|
16969
|
-
|
|
17055
|
+
// #3255: an earlier opening's Tekla model and its read allowance are not live, so they offer no Remove or Revoke.
|
|
17056
|
+
if (!chat || !library || chat.earlierOpening) {
|
|
16970
17057
|
if (!node.hidden || node.childElementCount) { node.replaceChildren(); node.hidden = true; delete node.dataset.key; }
|
|
16971
17058
|
return;
|
|
16972
17059
|
}
|
|
@@ -17084,7 +17171,7 @@
|
|
|
17084
17171
|
if (!host) return;
|
|
17085
17172
|
const chat = state.chat;
|
|
17086
17173
|
// #1907: the line exists only while this chat's own connectors are on; with them off, nothing can call.
|
|
17087
|
-
const on = Boolean(chat && !chat.archivedAt && chat.settings?.useOwnConnectors === true && !chat.integrationBindings?.length);
|
|
17174
|
+
const on = Boolean(chat && !chat.archivedAt && !chat.earlierOpening && chat.settings?.useOwnConnectors === true && !chat.integrationBindings?.length);
|
|
17088
17175
|
const allowed = on && Array.isArray(chat.connectorAllowance?.allowed) ? chat.connectorAllowance.allowed : [];
|
|
17089
17176
|
const busy = Boolean(chat?.activeTurn) || state.ownConnectorsSaving === true;
|
|
17090
17177
|
const painted = `${chat?.chatId || ''}|${on}|${busy}|${chat?.provider || ''}|${allowed.map(connectorKey).join(',')}|${state.connectorRevoking || ''}`;
|
|
@@ -17192,8 +17279,9 @@
|
|
|
17192
17279
|
scopeLabel.textContent = scopeText;
|
|
17193
17280
|
ui.scopeToggle.setAttribute('aria-label', `Scope: ${scopeText}`);
|
|
17194
17281
|
ui.scopeToggle.dataset.tip = `Scope: ${scopeText}. See the conversation’s home folder and add or remove other projects and workflows.`;
|
|
17195
|
-
ui.scopeToggle.disabled = state.loading;
|
|
17196
|
-
if (
|
|
17282
|
+
ui.scopeToggle.disabled = Boolean(state.loading || chat?.earlierOpening);
|
|
17283
|
+
if (chat?.earlierOpening) ui.scopeToggle.dataset.blockedReason = 'Read only: this conversation is from before the Workspace was reopened.';
|
|
17284
|
+
else if (ui.scopeToggle.disabled) ui.scopeToggle.dataset.blockedReason = 'The conversation is still loading.';
|
|
17197
17285
|
else delete ui.scopeToggle.dataset.blockedReason;
|
|
17198
17286
|
if (ui.accessChip) {
|
|
17199
17287
|
const instructor = isInstructorAnswer(chat);
|
|
@@ -17202,8 +17290,9 @@
|
|
|
17202
17290
|
// #2651: Access can change at any time, a reply included: it shows the level the next message uses.
|
|
17203
17291
|
const changed = accessChangedDuringReply(chat);
|
|
17204
17292
|
ui.accessChip.setAttribute('aria-label', changed ? `Access: ${label} from your next message. Change access` : `Access: ${label}. Change access`);
|
|
17205
|
-
ui.accessChip.disabled =
|
|
17206
|
-
|
|
17293
|
+
ui.accessChip.disabled = Boolean(chat?.earlierOpening);
|
|
17294
|
+
if (chat?.earlierOpening) ui.accessChip.dataset.blockedReason = 'Read only: this conversation is from before the Workspace was reopened.';
|
|
17295
|
+
else delete ui.accessChip.dataset.blockedReason;
|
|
17207
17296
|
// One line, like the menu; what the level means in full is in this conversation's Scope view.
|
|
17208
17297
|
ui.accessChip.dataset.tip = instructor
|
|
17209
17298
|
? 'This chat answers an Instructor question, so the AI can’t read files, run commands, search the web or use your connectors. Choose an Access to turn it into an ordinary chat. FloLess asks first.'
|
|
@@ -17420,7 +17509,7 @@
|
|
|
17420
17509
|
const host = ui.grants;
|
|
17421
17510
|
if (!host) return;
|
|
17422
17511
|
const chat = state.chat;
|
|
17423
|
-
const live = chat && !chat.archivedAt;
|
|
17512
|
+
const live = chat && !chat.archivedAt && !chat.earlierOpening;
|
|
17424
17513
|
const turn = live && ['running', 'awaiting-approval'].includes(chat.state) ? chat.activeTurn : null;
|
|
17425
17514
|
const request = turn && Array.isArray(turn.requestGrants) ? turn.requestGrants.filter((grant) => grant && grant.key) : [];
|
|
17426
17515
|
const conversation = live && Array.isArray(chat.approvalGrants?.grants) ? chat.approvalGrants.grants : [];
|
|
@@ -17488,9 +17577,9 @@
|
|
|
17488
17577
|
const host = ui.changeAllowance;
|
|
17489
17578
|
if (!host) return;
|
|
17490
17579
|
const chat = state.chat;
|
|
17491
|
-
const allowed = chat && !chat.archivedAt && Array.isArray(chat.changeAllowance?.allowed)
|
|
17580
|
+
const allowed = chat && !chat.archivedAt && !chat.earlierOpening && Array.isArray(chat.changeAllowance?.allowed)
|
|
17492
17581
|
? chat.changeAllowance.allowed : [];
|
|
17493
|
-
const global = chat && !chat.archivedAt && chat.changeAllowance?.allowedForChat;
|
|
17582
|
+
const global = chat && !chat.archivedAt && !chat.earlierOpening && chat.changeAllowance?.allowedForChat;
|
|
17494
17583
|
const readOnly = chat?.settings?.permissionProfile === 'read-only';
|
|
17495
17584
|
const painted = `${chat?.chatId || ''}|${allowed.map((entry) => entry.key).join(',')}|${Boolean(global)}|${readOnly}|${state.changeRevoking || ''}`;
|
|
17496
17585
|
if (host.dataset.painted === painted) return;
|
|
@@ -17572,7 +17661,7 @@
|
|
|
17572
17661
|
const host = ui.checkAllowance;
|
|
17573
17662
|
if (!host) return;
|
|
17574
17663
|
const chat = state.chat;
|
|
17575
|
-
const grants = chat && !chat.archivedAt && Array.isArray(chat.integrationReadAllowance?.grants) ? chat.integrationReadAllowance.grants : [];
|
|
17664
|
+
const grants = chat && !chat.archivedAt && !chat.earlierOpening && Array.isArray(chat.integrationReadAllowance?.grants) ? chat.integrationReadAllowance.grants : [];
|
|
17576
17665
|
const painted = `${chat?.chatId || ''}|${grants.map((grant) => `${checkGrantKey(grant)}:${grant.identity || ''}`).join(',')}|${state.checkRevoking || ''}`;
|
|
17577
17666
|
if (host.dataset.painted === painted) return;
|
|
17578
17667
|
host.dataset.painted = painted;
|
|
@@ -17847,16 +17936,16 @@
|
|
|
17847
17936
|
// Graft receipt → unsent Chat draft. Opening performs no binding, sends nothing and never
|
|
17848
17937
|
// touches Tekla: the binding is stored only when the user presses Send.
|
|
17849
17938
|
async function openVerifiedTeklaDraft(receipt) {
|
|
17850
|
-
// `
|
|
17939
|
+
// `forPerson` (failure-copy.js errorText) marks errors written for the user, so the Graft dialog can show them as-is.
|
|
17851
17940
|
if (!receipt || typeof receipt.sourcePath !== 'string' || !receipt.sourcePath
|
|
17852
17941
|
|| typeof receipt.hostVersion !== 'string' || !receipt.hostVersion) {
|
|
17853
|
-
throw Object.assign(new Error('FloLess could not read the result of the model check. Check the model read again, then continue in AI Chat.'), {
|
|
17942
|
+
throw Object.assign(new Error('FloLess could not read the result of the model check. Check the model read again, then continue in AI Chat.'), { forPerson: true });
|
|
17854
17943
|
}
|
|
17855
17944
|
// The chip lists exactly these reads, and Send binds exactly these: nothing defaults to more.
|
|
17856
17945
|
const library = { sourcePath: receipt.sourcePath, hostVersion: receipt.hostVersion, operations: teklaChatReads() };
|
|
17857
17946
|
const draft = teklaDraftText(receipt);
|
|
17858
17947
|
await refreshScope();
|
|
17859
|
-
if (!state.scope?.owner) throw Object.assign(new Error('Open a project or workflow before continuing in AI Chat.'), {
|
|
17948
|
+
if (!state.scope?.owner) throw Object.assign(new Error('Open a project or workflow before continuing in AI Chat.'), { forPerson: true });
|
|
17860
17949
|
window.flolessBridge?.revealAiChat?.();
|
|
17861
17950
|
ui.tab.click();
|
|
17862
17951
|
const chat = state.chat;
|