@iblai/iblai-js 2.80.0 → 2.81.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/web-containers/source/chat/chat-utils.js +87 -1
- package/dist/web-containers/source/chat/chat-utils.js.map +1 -1
- package/dist/web-containers/source/chat/code-activity.js +8 -6
- package/dist/web-containers/source/chat/code-activity.js.map +1 -1
- package/dist/web-containers/source/chat/code-error-text.js +12 -5
- package/dist/web-containers/source/chat/code-error-text.js.map +1 -1
- package/dist/web-containers/source/chat/working-indicator.js +33 -2
- package/dist/web-containers/source/chat/working-indicator.js.map +1 -1
- package/dist/web-containers/source/chat-input-form/cowork-control.js +308 -44
- package/dist/web-containers/source/chat-input-form/cowork-control.js.map +1 -1
- package/dist/web-containers/source/chat-input-form/inside-buttons.js +2 -2
- package/dist/web-containers/source/chat-input-form/inside-buttons.js.map +1 -1
- package/dist/web-containers/source/chat-utils.js +87 -1
- package/dist/web-containers/source/chat-utils.js.map +1 -1
- package/dist/web-containers/source/code-activity.js +8 -6
- package/dist/web-containers/source/code-activity.js.map +1 -1
- package/dist/web-containers/source/code-error-text.js +12 -5
- package/dist/web-containers/source/code-error-text.js.map +1 -1
- package/dist/web-containers/source/components/chat/chat-utils.js +87 -1
- package/dist/web-containers/source/components/chat/chat-utils.js.map +1 -1
- package/dist/web-containers/source/components/chat/code-activity.js +8 -6
- package/dist/web-containers/source/components/chat/code-activity.js.map +1 -1
- package/dist/web-containers/source/components/chat/code-error-text.js +12 -5
- package/dist/web-containers/source/components/chat/code-error-text.js.map +1 -1
- package/dist/web-containers/source/components/chat/working-indicator.js +33 -2
- package/dist/web-containers/source/components/chat/working-indicator.js.map +1 -1
- package/dist/web-containers/source/components/chat-input-form/cowork-control.js +308 -44
- package/dist/web-containers/source/components/chat-input-form/cowork-control.js.map +1 -1
- package/dist/web-containers/source/components/chat-input-form/inside-buttons.js +2 -2
- package/dist/web-containers/source/components/chat-input-form/inside-buttons.js.map +1 -1
- package/dist/web-containers/source/cowork-control.js +308 -44
- package/dist/web-containers/source/cowork-control.js.map +1 -1
- package/dist/web-containers/source/en.json.js +35 -8
- package/dist/web-containers/source/en.json.js.map +1 -1
- package/dist/web-containers/source/es.json.js +34 -7
- package/dist/web-containers/source/es.json.js.map +1 -1
- package/dist/web-containers/source/fr.json.js +34 -7
- package/dist/web-containers/source/fr.json.js.map +1 -1
- package/dist/web-containers/source/hooks/use-cua-driver.js +104 -4
- package/dist/web-containers/source/hooks/use-cua-driver.js.map +1 -1
- package/dist/web-containers/source/hooks/use-model-download.js +9 -9
- package/dist/web-containers/source/hooks/use-model-download.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/en.json.js +35 -8
- package/dist/web-containers/source/i18n/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/es.json.js +34 -7
- package/dist/web-containers/source/i18n/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/fr.json.js +34 -7
- package/dist/web-containers/source/i18n/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/i18n/messages/zh.json.js +35 -8
- package/dist/web-containers/source/i18n/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/inside-buttons.js +2 -2
- package/dist/web-containers/source/inside-buttons.js.map +1 -1
- package/dist/web-containers/source/messages/en.json.js +35 -8
- package/dist/web-containers/source/messages/en.json.js.map +1 -1
- package/dist/web-containers/source/messages/es.json.js +34 -7
- package/dist/web-containers/source/messages/es.json.js.map +1 -1
- package/dist/web-containers/source/messages/fr.json.js +34 -7
- package/dist/web-containers/source/messages/fr.json.js.map +1 -1
- package/dist/web-containers/source/messages/zh.json.js +35 -8
- package/dist/web-containers/source/messages/zh.json.js.map +1 -1
- package/dist/web-containers/source/tauri.js +8 -0
- package/dist/web-containers/source/tauri.js.map +1 -1
- package/dist/web-containers/source/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/types/tauri.js +8 -0
- package/dist/web-containers/source/types/tauri.js.map +1 -1
- package/dist/web-containers/source/use-cua-driver.js +104 -4
- package/dist/web-containers/source/use-cua-driver.js.map +1 -1
- package/dist/web-containers/source/use-model-download.js +9 -9
- package/dist/web-containers/source/use-model-download.js.map +1 -1
- package/dist/web-containers/source/web-containers/tsconfig.build.tsbuildinfo +1 -1
- package/dist/web-containers/source/working-indicator.js +33 -2
- package/dist/web-containers/source/working-indicator.js.map +1 -1
- package/dist/web-containers/source/zh.json.js +35 -8
- package/dist/web-containers/source/zh.json.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"code-error-text.js","sources":["../../../../../../../src/components/chat/code-error-text.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"code-error-text.js","sources":["../../../../../../../src/components/chat/code-error-text.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;AAMG;AACH,MAAM,iBAAiB,GAA6C;AAClE,IAAA;QACE,2KAA2K;QAC3K,SAAS;AACV,KAAA;;AAED,IAAA;QACE,wFAAwF;QACxF,UAAU;AACX,KAAA;IACD,CAAC,4BAA4B,EAAE,SAAS,CAAC;AACzC,IAAA;QACE,qHAAqH;QACrH,eAAe;AAChB,KAAA;IACD,CAAC,yCAAyC,EAAE,WAAW,CAAC;CACzD;AAEK,SAAU,cAAc,CAAC,GAAW,EAAA;IACxC,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,6BAA6B,EAAE,EAAE,CAAC;IAC3D,MAAM,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrE,IAAA,OAAO,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,IAAI;AAC5B;;;;"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useEffect, useRef } from 'react';
|
|
3
3
|
import { useChatT } from './chat-host-context.js';
|
|
4
|
+
import { isTauriEmbeddedLLMHost } from '@iblai/web-utils';
|
|
4
5
|
import { Tooltip, TooltipTrigger, TooltipContent } from '../ui/tooltip.js';
|
|
5
6
|
import { CHAT_CSS_CLASS_NAMES } from './chat-constants.js';
|
|
6
7
|
import { cn } from '../../lib/utils.js';
|
|
8
|
+
import { isLocalLLMEnabled, getLocalLLMModel } from '../profile/local-llm/local-llm-tab.js';
|
|
7
9
|
|
|
8
10
|
/**
|
|
9
11
|
* How long a turn may run without producing answer tokens before we swap in
|
|
@@ -27,6 +29,26 @@ const STALLED_STREAM_DELAY_MS = 15000;
|
|
|
27
29
|
* settles at most once per interval.
|
|
28
30
|
*/
|
|
29
31
|
const PHASE_ANNOUNCE_THROTTLE_MS = 2000;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the turn in flight runs on this computer's own model: Local Models
|
|
34
|
+
* is on with a model picked, and Code, if it is on, runs on that model too
|
|
35
|
+
* (not on Codex, Claude Code or a cloud model). Such a turn can sit for
|
|
36
|
+
* minutes before its first step while the model reads its instructions, which
|
|
37
|
+
* "Thinking…" alone makes look like a hang.
|
|
38
|
+
*/
|
|
39
|
+
function turnRunsOnDevice() {
|
|
40
|
+
var _a;
|
|
41
|
+
if (typeof window === 'undefined')
|
|
42
|
+
return false;
|
|
43
|
+
if (!isLocalLLMEnabled() || !getLocalLLMModel())
|
|
44
|
+
return false;
|
|
45
|
+
// A phone's embedded model is not "this computer".
|
|
46
|
+
if (isTauriEmbeddedLLMHost())
|
|
47
|
+
return false;
|
|
48
|
+
if (localStorage.getItem('ibl_coding_mode_enabled') !== 'true')
|
|
49
|
+
return true;
|
|
50
|
+
return /^(ollama|foundry)\//.test((_a = localStorage.getItem('ibl_coding_mode_model')) !== null && _a !== void 0 ? _a : '');
|
|
51
|
+
}
|
|
30
52
|
/**
|
|
31
53
|
* `prefers-reduced-motion: reduce` as a boolean. Read through `matchMedia` (not
|
|
32
54
|
* only the Tailwind `motion-reduce:` variant) so the shimmer can be swapped for
|
|
@@ -74,7 +96,14 @@ function WorkingIndicator({ phase, restatedByVisibleRow = false, content, classN
|
|
|
74
96
|
// over as the progress indicator.
|
|
75
97
|
const isStreamOnScreen = isWriting && (content !== null && content !== void 0 ? content : '').trim().length > 0;
|
|
76
98
|
const [showReassurance, setShowReassurance] = useState(false);
|
|
77
|
-
|
|
99
|
+
// Read when the turn starts, not during render: it comes from localStorage.
|
|
100
|
+
const [onDevice, setOnDevice] = useState(false);
|
|
101
|
+
useEffect(() => {
|
|
102
|
+
setOnDevice(isActive && turnRunsOnDevice());
|
|
103
|
+
}, [isActive]);
|
|
104
|
+
const rawLabel = onDevice && phase.kind === 'thinking'
|
|
105
|
+
? t('chat.chatWorkingIndicator.onDeviceThinking')
|
|
106
|
+
: phaseLabel(phase, t);
|
|
78
107
|
// A new label is a sign of life (a Code turn moves step to step without
|
|
79
108
|
// ever writing), so it restarts the clock.
|
|
80
109
|
useEffect(() => {
|
|
@@ -103,7 +132,9 @@ function WorkingIndicator({ phase, restatedByVisibleRow = false, content, classN
|
|
|
103
132
|
className: cn('text-sm', CHAT_CSS_CLASS_NAMES.CHAT.WORKING_INDICATOR, className), children: jsxs(Tooltip, { children: [jsx(TooltipTrigger, { asChild: true, children: jsx("span", { className: cn('inline-block w-fit', prefersReducedMotion
|
|
104
133
|
? 'text-muted-foreground'
|
|
105
134
|
: 'ibl-text-shimmer motion-reduce:animate-none'), children: showReassurance || isStreamStalled
|
|
106
|
-
? t(
|
|
135
|
+
? t(onDevice
|
|
136
|
+
? 'chat.chatWorkingIndicator.onDeviceStillWorking'
|
|
137
|
+
: 'chat.chatWorkingIndicator.stillWorking')
|
|
107
138
|
: label }) }), jsx(TooltipContent, { className: "ibl-tooltip-content max-w-xs", children: t('chat.chatWorkingIndicator.tooltip') })] }) }));
|
|
108
139
|
}
|
|
109
140
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"working-indicator.js","sources":["../../../../../../../src/components/chat/working-indicator.tsx"],"sourcesContent":[null],"names":["_jsx","CSS_CLASS_NAMES","_jsxs"],"mappings":"
|
|
1
|
+
{"version":3,"file":"working-indicator.js","sources":["../../../../../../../src/components/chat/working-indicator.tsx"],"sourcesContent":[null],"names":["_jsx","CSS_CLASS_NAMES","_jsxs"],"mappings":";;;;;;;;;AAcA;;;;AAIG;AACI,MAAM,8BAA8B,GAAG;AAE9C;;;;;;;;AAQG;AACI,MAAM,uBAAuB,GAAG;AAEvC;;;;AAIG;AACI,MAAM,0BAA0B,GAAG;AAE1C;;;;;;AAMG;AACH,SAAS,gBAAgB,GAAA;;IACvB,IAAI,OAAO,MAAM,KAAK,WAAW;AAAE,QAAA,OAAO,KAAK;AAC/C,IAAA,IAAI,CAAC,iBAAiB,EAAE,IAAI,CAAC,gBAAgB,EAAE;AAAE,QAAA,OAAO,KAAK;;AAE7D,IAAA,IAAI,sBAAsB,EAAE;AAAE,QAAA,OAAO,KAAK;AAC1C,IAAA,IAAI,YAAY,CAAC,OAAO,CAAC,yBAAyB,CAAC,KAAK,MAAM;AAAE,QAAA,OAAO,IAAI;AAC3E,IAAA,OAAO,qBAAqB,CAAC,IAAI,CAAC,MAAA,YAAY,CAAC,OAAO,CAAC,uBAAuB,CAAC,MAAA,IAAA,IAAA,EAAA,KAAA,MAAA,GAAA,EAAA,GAAI,EAAE,CAAC;AACxF;AAsBA;;;;;AAKG;AACH,SAAS,uBAAuB,GAAA;IAC9B,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEvE,SAAS,CAAC,MAAK;QACb,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,UAAU;YAAE;QAEzD,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC;AACnE,QAAA,uBAAuB,CAAC,KAAK,CAAC,OAAO,CAAC;AAEtC,QAAA,MAAM,QAAQ,GAAG,C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;AACxC,QAAA,OAAO,MAAM,YAAY,CAAC,KAAK,CAAC;AAClC,IAAA,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;AAErB,IAAA,OAAO,SAAS;AAClB;;;;"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
2
|
-
import { useState, useEffect, useRef } from 'react';
|
|
2
|
+
import { useState, useEffect, useRef, useId } from 'react';
|
|
3
3
|
import { toast } from 'sonner';
|
|
4
4
|
import { hasRemoteAiConfig } from '@iblai/web-utils';
|
|
5
5
|
import { useChatHost, useChatT } from '../chat/chat-host-context.js';
|
|
6
6
|
import { Button } from '../chat/ui/button.js';
|
|
7
7
|
import { Switch } from '../chat/ui/switch.js';
|
|
8
|
-
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel
|
|
8
|
+
import { AlertDialog, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogCancel } from '../chat/ui/alert-dialog.js';
|
|
9
9
|
import { Popover, PopoverTrigger, PopoverContent } from '../ui/popover.js';
|
|
10
|
-
import { isTauriMobile, readPanelCowork, readCoworkApprovals, writeCoworkApprovals, writePanelCowork } from '../chat/chat-utils.js';
|
|
10
|
+
import { isTauriMobile, readPanelCowork, readCoworkApprovals, coworkSetupPending, writeCoworkSetupPending, coworkPermissionAsked, writeCoworkApprovals, markCoworkPermissionAsked, writeCoworkConsent, writePanelCowork, coworkConsentGiven } from '../chat/chat-utils.js';
|
|
11
11
|
import { useCuaDriver } from '../../hooks/use-cua-driver.js';
|
|
12
12
|
import { isCoworkEnabled, setCoworkEnabled } from '../profile/cowork/cowork-tab.js';
|
|
13
13
|
import { isLocalLLMEnabled, modelSupportsCowork, getLocalLLMModel } from '../profile/local-llm/local-llm-tab.js';
|
|
@@ -15,11 +15,18 @@ import { cn } from '../../lib/utils.js';
|
|
|
15
15
|
import { useComposerToolPill } from './composer-tool-row.js';
|
|
16
16
|
import Monitor from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/monitor.js';
|
|
17
17
|
import ChevronDown from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/chevron-down.js';
|
|
18
|
+
import Check from '../../node_modules/.pnpm/lucide-react@0.528.0_react@19.1.0/node_modules/lucide-react/dist/esm/icons/check.js';
|
|
18
19
|
|
|
20
|
+
// The canvas split layout mounts two composers at once. Only one of them may
|
|
21
|
+
// own a pending setup, or the user gets two dialogs, two toasts and two installs.
|
|
22
|
+
let setupOwner = null;
|
|
19
23
|
// 12GB floor, matching the SDK default (DEFAULT_COWORK_REQUIRED_SIZE_GB)
|
|
20
24
|
// and the Local Models tab's "supported" indicator. modelSupportsCowork
|
|
21
25
|
// gates size <= gb (strictly greater), so a model of exactly 12GB is also off.
|
|
22
26
|
const COWORK_MIN_MODEL_GB = 12;
|
|
27
|
+
// One grant at a time, in this order: only the current step has a button, so
|
|
28
|
+
// two macOS alerts can never be on screen together.
|
|
29
|
+
const COWORK_GRANT_ORDER = ['accessibility', 'screen_recording'];
|
|
23
30
|
/**
|
|
24
31
|
* Cowork (the desktop Cua Driver assistant, or the Chrome extension's tab
|
|
25
32
|
* driver) — state, consent and install reconciliation. Shared by the classic
|
|
@@ -38,6 +45,8 @@ function useCowork() {
|
|
|
38
45
|
return t('chat.chatInputFormInsideButtons.coworkUnsupportedGnomeHelper');
|
|
39
46
|
case 'unsupported_os':
|
|
40
47
|
return t('chat.chatInputFormInsideButtons.coworkUnsupportedOs');
|
|
48
|
+
case 'sandboxed':
|
|
49
|
+
return t('chat.chatInputFormInsideButtons.coworkUnsupportedSandboxed');
|
|
41
50
|
default:
|
|
42
51
|
return t('chat.chatInputFormInsideButtons.coworkUnsupportedSession');
|
|
43
52
|
}
|
|
@@ -66,9 +75,10 @@ function useCowork() {
|
|
|
66
75
|
// setCoworkEnabled.
|
|
67
76
|
const cuaDriver = useCuaDriver();
|
|
68
77
|
const [coworkOn, setCoworkOn] = useState(() => inExtensionPanel ? readPanelCowork() : isCoworkEnabled());
|
|
69
|
-
// Switching Cowork
|
|
70
|
-
//
|
|
71
|
-
|
|
78
|
+
// Switching Cowork on is one dialog in two stages: `consent` says what it is
|
|
79
|
+
// about to do before macOS is asked for anything (it reads the user's windows
|
|
80
|
+
// and sends them off-device); `steps` collects the macOS grants.
|
|
81
|
+
const [stage, setStage] = useState(null);
|
|
72
82
|
const [approvals, setApprovals] = useState('auto');
|
|
73
83
|
// After mount, never during render: the pref is read from localStorage, and a
|
|
74
84
|
// render-time read would mismatch the prerendered HTML during hydration.
|
|
@@ -77,6 +87,11 @@ function useCowork() {
|
|
|
77
87
|
setApprovals(mode);
|
|
78
88
|
writeCoworkApprovals(mode);
|
|
79
89
|
};
|
|
90
|
+
// Cowork runs on EITHER a large local model or the remote AI (DM
|
|
91
|
+
// OpenAI-compatible endpoint) — either backend being ready is enough, so a
|
|
92
|
+
// local model is not required.
|
|
93
|
+
const backendReady = () => (isLocalLLMEnabled() && modelSupportsCowork(getLocalLLMModel(), COWORK_MIN_MODEL_GB)) ||
|
|
94
|
+
hasRemoteAiConfig();
|
|
80
95
|
const toggle = () => {
|
|
81
96
|
if (coworkOn) {
|
|
82
97
|
setCoworkOn(false);
|
|
@@ -86,6 +101,8 @@ function useCowork() {
|
|
|
86
101
|
return;
|
|
87
102
|
}
|
|
88
103
|
setCoworkEnabled(false);
|
|
104
|
+
// So switching back on retries an install that failed this time.
|
|
105
|
+
ensuredDriverInstall.current = false;
|
|
89
106
|
cuaDriver.stop();
|
|
90
107
|
return;
|
|
91
108
|
}
|
|
@@ -102,44 +119,236 @@ function useCowork() {
|
|
|
102
119
|
writePanelCowork(true);
|
|
103
120
|
return;
|
|
104
121
|
}
|
|
105
|
-
// Guard before anything user-visible.
|
|
106
|
-
//
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
// dialog or an OS permission prompt.
|
|
110
|
-
const localReady = isLocalLLMEnabled() && modelSupportsCowork(getLocalLLMModel(), COWORK_MIN_MODEL_GB);
|
|
111
|
-
if (!localReady && !hasRemoteAiConfig()) {
|
|
122
|
+
// Guard before anything user-visible. Running this first means a turn that
|
|
123
|
+
// is about to be refused never raises a consent dialog or an OS permission
|
|
124
|
+
// prompt.
|
|
125
|
+
if (!backendReady()) {
|
|
112
126
|
toast.warning(isLocalLLMEnabled()
|
|
113
127
|
? t('chat.chatInputFormInsideButtons.coworkModelTooSmall')
|
|
114
128
|
: t('chat.chatInputFormInsideButtons.coworkNeedsLocalModel'));
|
|
115
129
|
return;
|
|
116
130
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* The user accepted the explanation: ask for the OS grants, and only switch
|
|
121
|
-
* Cowork on if it actually has them. Desktop only — the panel enables
|
|
122
|
-
* straight from its switch and never raises the dialog.
|
|
123
|
-
*/
|
|
124
|
-
const acceptConsent = async () => {
|
|
125
|
-
setConsentOpen(false);
|
|
126
|
-
const { accessibility, screenRecording } = await cuaDriver.requestDriverPermissions();
|
|
127
|
-
// `=== false` — checked and denied — never falsy. `null` means the host has
|
|
128
|
-
// no such concept (Linux, Windows), where Cowork works and these grants do
|
|
129
|
-
// not exist; treating that as denied would make it impossible to switch on
|
|
130
|
-
// precisely where upstream has proven the driver.
|
|
131
|
-
if (accessibility === false) {
|
|
132
|
-
toast.warning(t('chat.chatInputFormInsideButtons.coworkNeedsAccessibility'));
|
|
131
|
+
if (!coworkConsentGiven()) {
|
|
132
|
+
setStage('consent');
|
|
133
133
|
return;
|
|
134
134
|
}
|
|
135
|
-
|
|
136
|
-
|
|
135
|
+
void startSetup();
|
|
136
|
+
};
|
|
137
|
+
// When the desktop app is too old to open System Settings or relaunch itself,
|
|
138
|
+
// the dialog says where to go instead.
|
|
139
|
+
const [manualHint, setManualHint] = useState(null);
|
|
140
|
+
// Mirrors the stored "asked before" flags, so a row switches from Allow to
|
|
141
|
+
// Open Settings the moment it is clicked.
|
|
142
|
+
const [asked, setAsked] = useState({
|
|
143
|
+
accessibility: false,
|
|
144
|
+
screen_recording: false,
|
|
145
|
+
});
|
|
146
|
+
const [ownerId] = useState(() => Symbol('cowork-setup'));
|
|
147
|
+
const claimSetup = () => {
|
|
148
|
+
if (setupOwner && setupOwner !== ownerId)
|
|
149
|
+
return false;
|
|
150
|
+
setupOwner = ownerId;
|
|
151
|
+
return true;
|
|
152
|
+
};
|
|
153
|
+
const releaseSetup = () => {
|
|
154
|
+
if (setupOwner === ownerId)
|
|
155
|
+
setupOwner = null;
|
|
156
|
+
};
|
|
157
|
+
const openSteps = () => {
|
|
158
|
+
setAsked({
|
|
159
|
+
accessibility: coworkPermissionAsked('accessibility'),
|
|
160
|
+
screen_recording: coworkPermissionAsked('screen_recording'),
|
|
161
|
+
});
|
|
162
|
+
setStage('steps');
|
|
163
|
+
};
|
|
164
|
+
// A setup still waiting on a macOS grant. Read from storage after mount so it
|
|
165
|
+
// survives the relaunch a Screen Recording grant needs — and never during
|
|
166
|
+
// render, which would mismatch the prerendered HTML during hydration. Never
|
|
167
|
+
// prompts: the steps only re-read the grants until the user acts. Only where
|
|
168
|
+
// the host can answer, or the steps would poll for a read that never comes.
|
|
169
|
+
// Finishing from here switches Cowork on without another click, so it is held
|
|
170
|
+
// to the backend check `toggle` makes; a setup with nothing to run on is dropped.
|
|
171
|
+
useEffect(() => {
|
|
172
|
+
if (inExtensionPanel || !cuaDriver.isAvailable || !coworkSetupPending())
|
|
173
|
+
return;
|
|
174
|
+
if (!backendReady()) {
|
|
175
|
+
writeCoworkSetupPending(false);
|
|
137
176
|
return;
|
|
138
177
|
}
|
|
178
|
+
if (claimSetup())
|
|
179
|
+
openSteps();
|
|
180
|
+
}, [inExtensionPanel, cuaDriver.isAvailable]);
|
|
181
|
+
useEffect(() => releaseSetup, []);
|
|
182
|
+
const closeSetup = () => {
|
|
183
|
+
writeCoworkSetupPending(false);
|
|
184
|
+
setStage(null);
|
|
185
|
+
setManualHint(null);
|
|
186
|
+
releaseSetup();
|
|
187
|
+
};
|
|
188
|
+
// Not Now and Escape. The consent stage never wrote the pending flag, and
|
|
189
|
+
// clearing it from there could drop the other composer's setup.
|
|
190
|
+
const dismissSetup = () => {
|
|
191
|
+
if (stage === 'steps')
|
|
192
|
+
closeSetup();
|
|
193
|
+
else
|
|
194
|
+
setStage(null);
|
|
195
|
+
};
|
|
196
|
+
const grantLabel = (kind) => t(kind === 'accessibility'
|
|
197
|
+
? 'chat.chatInputFormInsideButtons.coworkGrantAccessibility'
|
|
198
|
+
: 'chat.chatInputFormInsideButtons.coworkGrantScreenRecording');
|
|
199
|
+
const relaunch = async () => {
|
|
200
|
+
// Refreshes the stamp, so the launch that follows picks the setup back up.
|
|
201
|
+
writeCoworkSetupPending(true);
|
|
202
|
+
if (await cuaDriver.relaunch())
|
|
203
|
+
return;
|
|
204
|
+
// Restart is offered only while Screen Recording waits on a relaunch.
|
|
205
|
+
setManualHint({
|
|
206
|
+
kind: 'screen_recording',
|
|
207
|
+
text: t('chat.chatInputFormInsideButtons.coworkRelaunchManually'),
|
|
208
|
+
});
|
|
209
|
+
};
|
|
210
|
+
const turnOn = () => {
|
|
211
|
+
var _a;
|
|
139
212
|
setCoworkOn(true);
|
|
140
213
|
setCoworkEnabled(true);
|
|
141
|
-
|
|
214
|
+
// Turn On may have started the download already, and the reconcile effect
|
|
215
|
+
// below would otherwise see the host's stale `installed: false` on the next
|
|
216
|
+
// render and start a second one. One that failed is tried again, or the
|
|
217
|
+
// setup would end on "Cowork is on." with no driver.
|
|
218
|
+
if (!ensuredDriverInstall.current || ((_a = cuaDriver.state) === null || _a === void 0 ? void 0 : _a.status) === 'error') {
|
|
219
|
+
ensuredDriverInstall.current = true;
|
|
220
|
+
cuaDriver.install();
|
|
221
|
+
}
|
|
222
|
+
};
|
|
223
|
+
const finish = () => {
|
|
224
|
+
closeSetup();
|
|
225
|
+
toast.success(t('chat.chatInputFormInsideButtons.coworkReady'));
|
|
226
|
+
turnOn();
|
|
227
|
+
};
|
|
228
|
+
// One host round-trip at a time: a double click must not raise two macOS
|
|
229
|
+
// alerts, or finish twice.
|
|
230
|
+
const busy = useRef(false);
|
|
231
|
+
const [requesting, setRequesting] = useState(null);
|
|
232
|
+
const startSetup = async () => {
|
|
233
|
+
if (busy.current)
|
|
234
|
+
return;
|
|
235
|
+
busy.current = true;
|
|
236
|
+
try {
|
|
237
|
+
const { accessibility, screenRecording } = await cuaDriver.refreshPermissions();
|
|
238
|
+
// `!== false` — only checked-and-denied is missing. `null` means the host
|
|
239
|
+
// has no such grant (Linux, Windows), where Cowork works without it.
|
|
240
|
+
if (accessibility !== false && screenRecording !== false) {
|
|
241
|
+
finish();
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
writeCoworkSetupPending(true);
|
|
245
|
+
if (claimSetup())
|
|
246
|
+
openSteps();
|
|
247
|
+
else
|
|
248
|
+
setStage(null);
|
|
249
|
+
}
|
|
250
|
+
finally {
|
|
251
|
+
busy.current = false;
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
const acceptConsent = () => {
|
|
255
|
+
var _a;
|
|
256
|
+
writeCoworkConsent();
|
|
257
|
+
// Fetch the driver while the user works through the macOS steps.
|
|
258
|
+
if (((_a = cuaDriver.status) === null || _a === void 0 ? void 0 : _a.installed) !== true && !ensuredDriverInstall.current) {
|
|
259
|
+
ensuredDriverInstall.current = true;
|
|
260
|
+
cuaDriver.install();
|
|
261
|
+
}
|
|
262
|
+
void startSetup();
|
|
142
263
|
};
|
|
264
|
+
const askForGrant = async (kind) => {
|
|
265
|
+
if (busy.current)
|
|
266
|
+
return;
|
|
267
|
+
busy.current = true;
|
|
268
|
+
const openSettings = coworkPermissionAsked(kind) || asked[kind];
|
|
269
|
+
markCoworkPermissionAsked(kind);
|
|
270
|
+
// Acting on a step keeps the setup fresh for the relaunch that may follow.
|
|
271
|
+
writeCoworkSetupPending(true);
|
|
272
|
+
setAsked((prev) => ({ ...prev, [kind]: true }));
|
|
273
|
+
setRequesting(kind);
|
|
274
|
+
try {
|
|
275
|
+
if ((await cuaDriver.requestPermission(kind, openSettings)) === 'unsupported') {
|
|
276
|
+
setManualHint({
|
|
277
|
+
kind,
|
|
278
|
+
text: t('chat.chatInputFormInsideButtons.coworkOpenSettingsManually', {
|
|
279
|
+
pane: grantLabel(kind),
|
|
280
|
+
}),
|
|
281
|
+
});
|
|
282
|
+
}
|
|
283
|
+
await cuaDriver.refreshPermissions();
|
|
284
|
+
}
|
|
285
|
+
finally {
|
|
286
|
+
busy.current = false;
|
|
287
|
+
setRequesting(null);
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
// Checking never prompts, so the steps re-read the grants every second and
|
|
291
|
+
// whenever the user comes back: the rows update by themselves while System
|
|
292
|
+
// Settings is in front, with no "check again" button to find.
|
|
293
|
+
const { isAvailable, refreshPermissions, bringToFront, accessibilityPermission, screenRecordingPermission, } = cuaDriver;
|
|
294
|
+
useEffect(() => {
|
|
295
|
+
if (stage !== 'steps' || inExtensionPanel || !isAvailable)
|
|
296
|
+
return;
|
|
297
|
+
const recheck = () => {
|
|
298
|
+
if (document.visibilityState === 'visible')
|
|
299
|
+
void refreshPermissions();
|
|
300
|
+
};
|
|
301
|
+
const poll = window.setInterval(() => void refreshPermissions(), 1000);
|
|
302
|
+
window.addEventListener('focus', recheck);
|
|
303
|
+
document.addEventListener('visibilitychange', recheck);
|
|
304
|
+
return () => {
|
|
305
|
+
window.clearInterval(poll);
|
|
306
|
+
window.removeEventListener('focus', recheck);
|
|
307
|
+
document.removeEventListener('visibilitychange', recheck);
|
|
308
|
+
};
|
|
309
|
+
}, [stage, inExtensionPanel, isAvailable, refreshPermissions]);
|
|
310
|
+
// Accessibility is switched on in System Settings, which stays in front of
|
|
311
|
+
// the app; bring the app back so the next step is in view.
|
|
312
|
+
const lastAccessibility = useRef(accessibilityPermission);
|
|
313
|
+
useEffect(() => {
|
|
314
|
+
const before = lastAccessibility.current;
|
|
315
|
+
lastAccessibility.current = accessibilityPermission;
|
|
316
|
+
if (stage === 'steps' && before === false && accessibilityPermission === true) {
|
|
317
|
+
void bringToFront();
|
|
318
|
+
}
|
|
319
|
+
}, [stage, accessibilityPermission, bringToFront]);
|
|
320
|
+
// Finish the moment nothing is missing any more — while System Settings is
|
|
321
|
+
// still open, or on the first mount after the relaunch. Waits for the host
|
|
322
|
+
// to answer first: `null` on both means it has not yet, not that the grants
|
|
323
|
+
// do not apply (the steps only ever open where they do).
|
|
324
|
+
useEffect(() => {
|
|
325
|
+
if (stage !== 'steps' || inExtensionPanel)
|
|
326
|
+
return;
|
|
327
|
+
if (accessibilityPermission === null && screenRecordingPermission === null)
|
|
328
|
+
return;
|
|
329
|
+
if (accessibilityPermission === false || screenRecordingPermission === false)
|
|
330
|
+
return;
|
|
331
|
+
finish();
|
|
332
|
+
}, [stage, inExtensionPanel, accessibilityPermission, screenRecordingPermission]);
|
|
333
|
+
const grantMissing = accessibilityPermission === false || screenRecordingPermission === false;
|
|
334
|
+
const currentStep = COWORK_GRANT_ORDER.findIndex((kind) => (kind === 'accessibility' ? accessibilityPermission : screenRecordingPermission) === false);
|
|
335
|
+
const grantFor = (kind) => kind === 'accessibility' ? accessibilityPermission : screenRecordingPermission;
|
|
336
|
+
const steps = COWORK_GRANT_ORDER.map((kind, index) => {
|
|
337
|
+
// A grant already held reads Allowed wherever it sits in the order.
|
|
338
|
+
const state = grantFor(kind) !== false ? 'granted' : index === currentStep ? 'current' : 'upcoming';
|
|
339
|
+
return {
|
|
340
|
+
kind,
|
|
341
|
+
state,
|
|
342
|
+
asked: asked[kind],
|
|
343
|
+
label: grantLabel(kind),
|
|
344
|
+
hint: t(kind === 'accessibility'
|
|
345
|
+
? 'chat.chatInputFormInsideButtons.coworkGrantAccessibilityHint'
|
|
346
|
+
: 'chat.chatInputFormInsideButtons.coworkGrantScreenRecordingHint'),
|
|
347
|
+
askedHint: t(kind === 'accessibility'
|
|
348
|
+
? 'chat.chatInputFormInsideButtons.coworkStepAskedAccessibility'
|
|
349
|
+
: 'chat.chatInputFormInsideButtons.coworkStepAskedScreenRecording'),
|
|
350
|
+
};
|
|
351
|
+
});
|
|
143
352
|
// Cowork used to be macOS-only because GhostOS was. The Cua Driver runs on
|
|
144
353
|
// Windows, macOS and Linux — but not on every Linux session, so an
|
|
145
354
|
// unsupported one renders the pill DISABLED with the reason rather than
|
|
@@ -188,9 +397,19 @@ function useCowork() {
|
|
|
188
397
|
label: t('chat.chatInputFormInsideButtons.cowork'),
|
|
189
398
|
coworkOn,
|
|
190
399
|
toggle,
|
|
191
|
-
|
|
192
|
-
|
|
400
|
+
// The steps stay hidden until the host has answered: a resumed setup must
|
|
401
|
+
// not flash two "Allowed" rows before the first check lands.
|
|
402
|
+
setupStage: stage === 'consent' || (stage === 'steps' && grantMissing) ? stage : null,
|
|
403
|
+
dismissSetup,
|
|
193
404
|
acceptConsent,
|
|
405
|
+
steps,
|
|
406
|
+
askForGrant,
|
|
407
|
+
requesting,
|
|
408
|
+
relaunchOffered: asked.screen_recording && screenRecordingPermission === false,
|
|
409
|
+
relaunch,
|
|
410
|
+
// Directions for a grant that has since been allowed would point at the
|
|
411
|
+
// wrong pane under the next step.
|
|
412
|
+
manualHint: manualHint && grantFor(manualHint.kind) === false ? manualHint.text : null,
|
|
194
413
|
approvals,
|
|
195
414
|
chooseApprovals,
|
|
196
415
|
isEnabled,
|
|
@@ -200,15 +419,60 @@ function useCowork() {
|
|
|
200
419
|
};
|
|
201
420
|
}
|
|
202
421
|
/**
|
|
203
|
-
* Switching Cowork on
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
422
|
+
* Switching Cowork on, in one dialog. The consent stage says what Cowork will
|
|
423
|
+
* do before macOS is asked for anything, and dismissing it leaves Cowork off.
|
|
424
|
+
* The steps stage takes the macOS grants one at a time, re-reads them by
|
|
425
|
+
* itself, and turns Cowork on once both read Allowed. Not Now is the dialog's
|
|
426
|
+
* Cancel, which the dialog focuses when it opens; every other button is a plain
|
|
427
|
+
* Button, because an AlertDialogAction would close the dialog mid-setup.
|
|
428
|
+
* Desktop only: the extension panel drives one tab, which Chrome already asked
|
|
429
|
+
* about at install time, and says so in the panel instead of interrupting.
|
|
208
430
|
*/
|
|
209
|
-
function
|
|
431
|
+
function CoworkSetupDialog({ cowork }) {
|
|
432
|
+
var _a;
|
|
210
433
|
const t = useChatT();
|
|
211
|
-
|
|
434
|
+
const labelId = useId();
|
|
435
|
+
// Keeps the last stage on screen while the dialog animates closed.
|
|
436
|
+
const [shownStage, setShownStage] = useState(cowork.setupStage);
|
|
437
|
+
if (cowork.setupStage && cowork.setupStage !== shownStage)
|
|
438
|
+
setShownStage(cowork.setupStage);
|
|
439
|
+
// The dialog focuses Not Now when it opens; moving from the consent to the
|
|
440
|
+
// steps replaces that button, so focus follows it into the new stage rather
|
|
441
|
+
// than dropping to the page behind the dialog.
|
|
442
|
+
const stepsCancel = useRef(null);
|
|
443
|
+
useEffect(() => {
|
|
444
|
+
var _a;
|
|
445
|
+
if (shownStage === 'steps')
|
|
446
|
+
(_a = stepsCancel.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
447
|
+
}, [shownStage]);
|
|
448
|
+
// A step that turns Allowed takes its button with it; focus moves on to the
|
|
449
|
+
// next step's button instead of dropping to the dialog itself.
|
|
450
|
+
const currentKind = (_a = cowork.steps.find((step) => step.state === 'current')) === null || _a === void 0 ? void 0 : _a.kind;
|
|
451
|
+
const currentStepButton = useRef(null);
|
|
452
|
+
const lastCurrentKind = useRef(currentKind);
|
|
453
|
+
useEffect(() => {
|
|
454
|
+
var _a;
|
|
455
|
+
const before = lastCurrentKind.current;
|
|
456
|
+
lastCurrentKind.current = currentKind;
|
|
457
|
+
if (!before || !currentKind || before === currentKind)
|
|
458
|
+
return;
|
|
459
|
+
if (document.activeElement instanceof HTMLButtonElement)
|
|
460
|
+
return;
|
|
461
|
+
(_a = currentStepButton.current) === null || _a === void 0 ? void 0 : _a.focus({ preventScroll: true });
|
|
462
|
+
}, [currentKind]);
|
|
463
|
+
return (jsx(AlertDialog, { open: cowork.setupStage !== null, onOpenChange: (open) => {
|
|
464
|
+
if (!open)
|
|
465
|
+
cowork.dismissSetup();
|
|
466
|
+
}, children: jsx(AlertDialogContent, { "data-testid": "cowork-setup-dialog", "data-stage": shownStage !== null && shownStage !== void 0 ? shownStage : undefined, children: shownStage === 'consent' ? (jsxs(Fragment, { children: [jsxs(AlertDialogHeader, { children: [jsx(AlertDialogTitle, { children: t('chat.chatInputFormInsideButtons.coworkConsentTitle') }), jsx(AlertDialogDescription, { children: t('chat.chatInputFormInsideButtons.coworkConsentBody') })] }), jsxs("div", { className: "text-sm text-gray-700", children: [jsx("p", { className: "font-medium text-gray-900", children: t('chat.chatInputFormInsideButtons.coworkConsentKeepInMind') }), jsxs("ul", { className: "mt-1 list-disc space-y-1 pl-5", children: [jsx("li", { children: t('chat.chatInputFormInsideButtons.coworkConsentTipUndo') }), jsx("li", { children: t('chat.chatInputFormInsideButtons.coworkConsentTipPrivate') })] })] }), jsxs(AlertDialogFooter, { children: [jsx(AlertDialogCancel, { type: "button", children: t('chat.chatInputFormInsideButtons.coworkConsentCancel') }), jsx(Button, { type: "button", onClick: () => cowork.acceptConsent(), children: t('chat.chatInputFormInsideButtons.coworkConsentConfirm') })] })] })) : (jsxs(Fragment, { children: [jsxs(AlertDialogHeader, { children: [jsx(AlertDialogTitle, { children: t('chat.chatInputFormInsideButtons.coworkSetupTitle') }), jsx(AlertDialogDescription, { children: t('chat.chatInputFormInsideButtons.coworkSetupBody') })] }), jsx("ul", { "aria-live": "polite", className: "divide-y divide-gray-200 rounded-lg border border-gray-200", children: cowork.steps.map((step, index) => (jsxs("li", { "data-testid": `cowork-grant-${step.kind}`, "data-state": step.state, "aria-current": step.state === 'current' ? 'step' : undefined, className: cn('px-3 py-2', step.state === 'upcoming' && 'opacity-60'), children: [jsxs("div", { className: "flex items-center gap-3", children: [jsx("span", { className: "sr-only", children: t('chat.chatInputFormInsideButtons.coworkStepOf', {
|
|
467
|
+
n: index + 1,
|
|
468
|
+
total: cowork.steps.length,
|
|
469
|
+
}) }), jsx("span", { "aria-hidden": "true", className: cn('flex h-5 w-5 shrink-0 items-center justify-center rounded-full text-xs', step.state === 'granted'
|
|
470
|
+
? 'bg-green-50 text-green-600'
|
|
471
|
+
: step.state === 'current'
|
|
472
|
+
? 'bg-[#38A1E5] text-white'
|
|
473
|
+
: 'bg-gray-100 text-gray-500'), children: step.state === 'granted' ? jsx(Check, { className: "h-3 w-3" }) : index + 1 }), jsxs("div", { className: "min-w-0 flex-1", children: [jsx("p", { id: `${labelId}-${step.kind}`, className: "text-sm font-medium text-gray-900", children: step.label }), jsx("p", { className: "text-xs text-gray-500", children: step.hint })] }), step.state === 'granted' && (jsx("span", { className: "shrink-0 text-xs text-green-600", children: t('chat.chatInputFormInsideButtons.coworkGrantAllowed') })), step.state === 'current' && (jsx(Button, { ref: currentStepButton, type: "button", variant: step.asked ? 'outline' : 'default', size: "sm", className: "shrink-0", disabled: cowork.requesting !== null, "aria-describedby": `${labelId}-${step.kind}`, onClick: () => void cowork.askForGrant(step.kind), children: step.asked
|
|
474
|
+
? t('chat.chatInputFormInsideButtons.coworkOpenSettings')
|
|
475
|
+
: t('chat.chatInputFormInsideButtons.coworkStepAllow') }))] }), step.state === 'current' && step.asked && (jsx("p", { "data-testid": "cowork-step-hint", className: "mt-2 pl-8 text-xs text-gray-700", children: step.askedHint }))] }, step.kind))) }), cowork.manualHint && (jsx("p", { role: "status", "data-testid": "cowork-setup-manual", className: "text-xs text-gray-700", children: cowork.manualHint })), cowork.relaunchOffered && (jsx("p", { role: "status", "data-testid": "cowork-relaunch-hint", className: "text-xs text-gray-500", children: t('chat.chatInputFormInsideButtons.coworkRelaunchHint') })), jsxs(AlertDialogFooter, { children: [jsx(AlertDialogCancel, { ref: stepsCancel, type: "button", children: t('chat.chatInputFormInsideButtons.coworkConsentCancel') }), cowork.relaunchOffered && (jsx(Button, { type: "button", variant: "outline", onClick: () => void cowork.relaunch(), children: t('chat.chatInputFormInsideButtons.coworkRelaunch') }))] })] })) }) }));
|
|
212
476
|
}
|
|
213
477
|
/**
|
|
214
478
|
* The extension panel's Cowork popover: on/off switch, the disclosure note and
|
|
@@ -224,7 +488,7 @@ function CoworkPanelContent({ cowork }) {
|
|
|
224
488
|
: t('chat.chatInputFormInsideButtons.coworkApprovalsAuto') }, mode))) })] }), cowork.approvals === 'auto' && (jsx("p", { "data-testid": "cowork-auto-mode-hint", className: "mt-1 text-[11px] text-gray-400", children: t('chat.chatInputFormInsideButtons.coworkApprovalsAutoHint') }))] }));
|
|
225
489
|
}
|
|
226
490
|
/**
|
|
227
|
-
* The redesigned composer's Cowork pill — same toggle,
|
|
491
|
+
* The redesigned composer's Cowork pill — same toggle, setup dialog and
|
|
228
492
|
* extension panel as the classic row, styled like the Canvas pill. Renders
|
|
229
493
|
* nothing where Cowork can't exist (feature off, no driver host, phones).
|
|
230
494
|
*/
|
|
@@ -245,8 +509,8 @@ function CoworkPill({ disabled = false }) {
|
|
|
245
509
|
return (jsxs(Fragment, { children: [jsxs(Button, { variant: "ghost", size: "sm", type: "button", "data-testid": "cowork-pill", disabled: disabled || !!cowork.disabledReason, title: cowork.disabledReason || (showName ? undefined : cowork.label), "aria-pressed": cowork.coworkOn, className: pillClass, onClick: (e) => {
|
|
246
510
|
e.preventDefault();
|
|
247
511
|
cowork.toggle();
|
|
248
|
-
}, children: [jsx(Monitor, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { className: showName ? undefined : 'sr-only', children: cowork.label })] }), jsx(
|
|
512
|
+
}, children: [jsx(Monitor, { className: "h-4 w-4", "aria-hidden": "true" }), jsx("span", { className: showName ? undefined : 'sr-only', children: cowork.label })] }), jsx(CoworkSetupDialog, { cowork: cowork })] }));
|
|
249
513
|
}
|
|
250
514
|
|
|
251
|
-
export {
|
|
515
|
+
export { CoworkPanelContent, CoworkPill, CoworkSetupDialog, useCowork };
|
|
252
516
|
//# sourceMappingURL=cowork-control.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cowork-control.js","sources":["../../../../../../../src/components/chat-input-form/cowork-control.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;AAyCA;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,EAAE;AAE9B;;;;AAIG;SACa,SAAS,GAAA;;AACvB,IAAA,MAAM,CAAC,GAAG,QAAQ,EAAE;AACpB,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE;;AAGhC,IAAA,MAAM,uBAAuB,GAAG,CAAC,MAAe,KAAI;QAClD,QAAQ,MAAM;AACZ,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,CAAC,CAAC,sDAAsD,CAAC;AAClE,YAAA,KAAK,sBAAsB;AACzB,gBAAA,OAAO,CAAC,CAAC,8DAA8D,CAAC;AAC1E,YAAA,KAAK,gBAAgB;AACnB,gBAAA,OAAO,CAAC,CAAC,qDAAqD,CAAC;AACjE,YAAA;AACE,gBAAA,OAAO,CAAC,CAAC,0DAA0D,CAAC;;AAE1E,IAAA,CAAC;;;;IAKD,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;IACrD,SAAS,CAAC,MAAK;QACb,IAAI,SAAS,GAAG,KAAK;QACrB,KAAK,aAAa,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,KAAI;YACnC,IAAI,CAAC,SAAS,IAAI,MAAM;gBAAE,cAAc,CAAC,IAAI,CAAC;AAChD,QAAA,CAAC,CAAC;AACF,QAAA,OAAO,MAAK;YACV,SAAS,GAAG,IAAI;AAClB,QAAA,CAAC;IACH,CAAC,EAAE,EAAE,CAAC;;;;AAKN,IAAA,MAAM,gBAAgB,GAAG,CAAC,EAAC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,EACD,aAAa,EACzB,QAAQ,EAAE,QAAQ,IAAI,CAAC,CAAC,MAAM,CAAC,cAAc,EAC7C,KAAK,EAAE,MAAM,CAAC,cAAc,KAAK,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,EAAA,cAAA,EACvD,MAAM,CAAC,QAAQ,EAC7B,SAAS,EAAE,SAAS,EACpB,OAAO,EAAE,CAAC,CAAC,KAAI;oBACb,CAAC,CAAC,cAAc,EAAE;oBAClB,MAAM,CAAC,MAAM,EAAE;AACjB,gBAAA,CAAC,aAEDD,GAAA,CAAC,OAAO,EAAA,EAAC,SAAS,EAAC,SAAS,EAAA,aAAA,EAAa,MAAM,EAAA,CAAG,EAClDA,GAAA,CAAA,MAAA,EAAA,EAAM,SAAS,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,EAAA,QAAA,EAAG,MAAM,CAAC,KAAK,GAAQ,CAAA,EAAA,CACjE,EACTA,GAAA,CAAC,mBAAmB,IAAC,MAAM,EAAE,MAAM,EAAA,CAAI,CAAA,EAAA,CACtC;AAEP;;;;"}
|
|
1
|
+
{"version":3,"file":"cowork-control.js","sources":["../../../../../../../src/components/chat-input-form/cowork-control.tsx"],"sourcesContent":[null],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;AA+CA;AACA;AACA,IAAI,UAAU,GAAkB,IAAI;AAEpC;AACA;AACA;AACA,MAAM,mBAAmB,GAAG,EAAE;AAE9B;AACA;AACA,MAAM,kBAAkB,GAAoC,CAAC,eAAe,EAAE,kBAAkB,CAAC;AAIjG;;;;AAIG;SACa,SAAS,GAAA;;AACvB,IAAA,MAAM,CAAC,GAAG,QAAQ,EAAE;AACpB,IAAA,MAAM,EAAE,MAAM,EAAE,GAAG,WAAW,EAAE;;AAGhC,IAAA,MAAM,uBAAuB,GAAG,CAAC,MAAe,KAAI;QAClD,QAAQ,MAAM;AACZ,YAAA,KAAK,cAAc;AACjB,gBAAA,OAAO,CAAC,C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