@datalayer/agent-runtimes 1.3.46 → 1.3.47
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.
|
@@ -8,6 +8,7 @@ import { computed, signal } from '@datalayer/reactor';
|
|
|
8
8
|
const NO_STANCE = signal(undefined);
|
|
9
9
|
import { useContributions, useSignalValue, useGate, useReactorPlatform, ReactorLazy, ReactorSlot, useSlotComponents, } from '@datalayer/reactor/react';
|
|
10
10
|
import { ChatBase } from '../../../chat/base/ChatBase';
|
|
11
|
+
import { useChatAvailability } from '../../../chat/base/ChatAvailability';
|
|
11
12
|
import { offeredModels as offeredModelsFor, readServerCatalogue, readServerDecisions, } from '../../../chat/base/modelChoice';
|
|
12
13
|
import { SUGGESTION_CHIP_WIDTH } from '../../../chat/display/EmptyState';
|
|
13
14
|
import { AnonymousKeyExpired } from '@datalayer/core/lib/components/anonymous/AnonymousKeyExpired';
|
|
@@ -997,12 +998,21 @@ export default function ChatView({ workspace }) {
|
|
|
997
998
|
* for something that was never theirs.
|
|
998
999
|
*/
|
|
999
1000
|
const expiredKeyIsTemporary = !signedInUser;
|
|
1000
|
-
|
|
1001
|
+
/*
|
|
1002
|
+
* What its host said of whether there is anything to talk to
|
|
1003
|
+
* (`ChatAvailabilityProvider`): an application whose model is not offered
|
|
1004
|
+
* or not served (LOOP R-27) is switched off with the reason, by the
|
|
1005
|
+
* Studio's Preview and the hosted page, rather than left unanswered.
|
|
1006
|
+
*/
|
|
1007
|
+
const ambient = useChatAvailability();
|
|
1008
|
+
const chatDisabled = gateBlocked || keyExpired || Boolean(inPageRefusal) || ambient.disabled;
|
|
1001
1009
|
const disabledReason = keyExpired
|
|
1002
1010
|
? expiredKeyIsTemporary
|
|
1003
1011
|
? 'This demo runs on a shared key, and its time is up. Sign in to keep going.'
|
|
1004
1012
|
: 'Your key has expired. Sign in to keep going.'
|
|
1005
|
-
: (inPageRefusal ??
|
|
1013
|
+
: (inPageRefusal ??
|
|
1014
|
+
gateReason ??
|
|
1015
|
+
(ambient.disabled ? ambient.disableReason : undefined));
|
|
1006
1016
|
/*
|
|
1007
1017
|
* The prompt's text, held here rather than inside `InputPrompt`.
|
|
1008
1018
|
*
|