@mcp-b/react-components 0.64.1 → 0.65.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/components/agents-sdk/WorkspaceProject.d.ts +2 -1
- package/dist/components/agents-sdk/WorkspaceProject.js +7 -4
- package/dist/components/extension/FirstRunSetup.d.ts +132 -37
- package/dist/components/extension/FirstRunSetup.js +1914 -1561
- package/dist/components/general-purpose/StatusScreen.d.ts +6 -1
- package/dist/components/general-purpose/StatusScreen.js +44 -36
- package/dist/styles/chatgpt-sign-in-screen.css +2 -0
- package/dist/styles/first-run-setup.css +107 -96
- package/dist/styles/select.css +2 -1
- package/dist/styles/switch.css +20 -5
- package/package.json +2 -2
|
@@ -2,7 +2,8 @@ import { t as WorkspaceConceptQueryOptions } from "../../WorkspaceConcept-D46cYe
|
|
|
2
2
|
import { n as WorkspaceConceptPanelProps, t as WorkspaceConceptFileProps } from "../../workspace-concept-panel-BDTBISNO.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
//#region src/components/agents-sdk/WorkspaceProject.d.ts
|
|
5
|
-
|
|
5
|
+
/** Who started a thread: the person, a schedule, a messenger, or first-run setup. */
|
|
6
|
+
export type WorkspaceProjectThreadOrigin = "user" | "schedule" | "messenger" | "setup";
|
|
6
7
|
/** A file in the project's folder. */
|
|
7
8
|
export interface WorkspaceProjectLink {
|
|
8
9
|
path: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { V as MessageSquareIcon, f as CalendarIcon, ft as UserIcon, k as FolderIcon } from "../../icons-nLTnB9kd.js";
|
|
1
|
+
import { V as MessageSquareIcon, f as CalendarIcon, ft as UserIcon, ht as WrenchIcon, k as FolderIcon } from "../../icons-nLTnB9kd.js";
|
|
2
2
|
import { DescriptionList } from "../foundations/DescriptionList.js";
|
|
3
3
|
import { n as OutboundLink, r as WorkspaceComposerLink } from "../../workspace-assets-DdtnBDU3.js";
|
|
4
4
|
import { n as useConceptEntry, t as WorkspaceConceptPanel } from "../../workspace-concept-panel-VkjvFCY_.js";
|
|
@@ -17,17 +17,20 @@ const projectsWorkbenchItem = {
|
|
|
17
17
|
const ORIGIN_LABEL = {
|
|
18
18
|
user: "From you",
|
|
19
19
|
schedule: "Schedule",
|
|
20
|
-
messenger: "Messenger"
|
|
20
|
+
messenger: "Messenger",
|
|
21
|
+
setup: "Setup"
|
|
21
22
|
};
|
|
22
23
|
const ORIGIN_ICON = {
|
|
23
24
|
user: /* @__PURE__ */ jsx(UserIcon, {}),
|
|
24
25
|
schedule: /* @__PURE__ */ jsx(CalendarIcon, {}),
|
|
25
|
-
messenger: /* @__PURE__ */ jsx(MessageSquareIcon, {})
|
|
26
|
+
messenger: /* @__PURE__ */ jsx(MessageSquareIcon, {}),
|
|
27
|
+
setup: /* @__PURE__ */ jsx(WrenchIcon, {})
|
|
26
28
|
};
|
|
27
29
|
const ORIGIN_ORDER = [
|
|
28
30
|
"user",
|
|
29
31
|
"schedule",
|
|
30
|
-
"messenger"
|
|
32
|
+
"messenger",
|
|
33
|
+
"setup"
|
|
31
34
|
];
|
|
32
35
|
/** One labeled run of links. Each child is an `<li>` with its own key. */
|
|
33
36
|
function LinkFact(t0) {
|
|
@@ -13,6 +13,12 @@ import { SkillDescriptor } from "agents/skills";
|
|
|
13
13
|
export declare const firstRunSteps: readonly ["welcome", "sign-in", "model-connection", "chrome-profile", "history", "preparation", "writing", "schedules", "try", "pin", "ask", "ready"];
|
|
14
14
|
/** Every history choice, for a host that persists it. */
|
|
15
15
|
export declare const firstRunHistoryChoices: readonly ["unset", "history", "skip"];
|
|
16
|
+
/**
|
|
17
|
+
* Parallel work in one status: working while any runs, then failed if any
|
|
18
|
+
* failed, done once all are, and idle otherwise. Setup combines its own
|
|
19
|
+
* preparation this way; a host combines the jobs behind one work with it.
|
|
20
|
+
*/
|
|
21
|
+
export declare function combineFirstRunWorkStatus(statuses: readonly FirstRunWorkStatus[]): FirstRunWorkStatus;
|
|
16
22
|
//#endregion
|
|
17
23
|
//#region src/components/extension/FirstRunSetup.d.ts
|
|
18
24
|
/**
|
|
@@ -30,7 +36,9 @@ export type FirstRunSignInStatus = "idle" | "waiting" | "failed" | "done";
|
|
|
30
36
|
export type FirstRunHistoryChoice = (typeof firstRunHistoryChoices)[number];
|
|
31
37
|
/**
|
|
32
38
|
* Where work the agent does during setup stands: `idle` before the host has
|
|
33
|
-
* started it, `working` while it runs, then `done` or `failed`.
|
|
39
|
+
* started it, `working` while it runs, then `done` or `failed`. A host that
|
|
40
|
+
* runs several jobs for one piece of work combines theirs with
|
|
41
|
+
* `combineFirstRunWorkStatus`.
|
|
34
42
|
*/
|
|
35
43
|
export type FirstRunWorkStatus = "idle" | "working" | "done" | "failed";
|
|
36
44
|
/** One app or source currently being examined during preparation. */
|
|
@@ -48,12 +56,28 @@ export interface FirstRunWorkActivity {
|
|
|
48
56
|
* panel's actions.
|
|
49
57
|
*/
|
|
50
58
|
export interface FirstRunWork<Source> {
|
|
59
|
+
/** Where the rows come from: the concept's query, or the list the host holds. */
|
|
51
60
|
source: Source;
|
|
61
|
+
/**
|
|
62
|
+
* Where the host's run stands. Preparation's Continue waits while any work
|
|
63
|
+
* is `working`, or while none has started; start every work together.
|
|
64
|
+
*/
|
|
52
65
|
status: FirstRunWorkStatus;
|
|
53
66
|
/** Live source activity from the host. Never inferred from saved result rows. */
|
|
54
67
|
activity?: readonly FirstRunWorkActivity[];
|
|
55
|
-
/**
|
|
56
|
-
|
|
68
|
+
/**
|
|
69
|
+
* One sentence on why the work failed, shown with its Try again while
|
|
70
|
+
* `status` is `"failed"`. Without it setup says the work didn't finish.
|
|
71
|
+
*/
|
|
72
|
+
failure?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Starts the work again after it failed. Resolve once it has started again;
|
|
75
|
+
* reject with a sentence for the person when it could not (access refused,
|
|
76
|
+
* for example). While it is pending the work reads as working; a rejection
|
|
77
|
+
* keeps it failed and shows its message on the preparation screen until the
|
|
78
|
+
* host reports the work as anything but `failed`.
|
|
79
|
+
*/
|
|
80
|
+
onRetry: () => Promise<void>;
|
|
57
81
|
}
|
|
58
82
|
export type FirstRunWritingStyle = "direct" | "friendly" | "detailed" | "formal";
|
|
59
83
|
/** Sign using the current Chrome profile identity or the product’s separate assistant identity. */
|
|
@@ -70,20 +94,42 @@ export type FirstRunModelSettings = {
|
|
|
70
94
|
kind: "api";
|
|
71
95
|
endpoint: string;
|
|
72
96
|
model: string;
|
|
73
|
-
/** The
|
|
97
|
+
/** The key the person typed, trimmed. Empty keeps a saved key, or sends none. */
|
|
74
98
|
apiKey: string;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the host holds a key for these settings, so an empty `apiKey`
|
|
101
|
+
* keeps it. The field then says a key is saved instead of asking for
|
|
102
|
+
* one. The host decides it; the component passes it through unchanged.
|
|
103
|
+
*/
|
|
104
|
+
keySaved: boolean;
|
|
75
105
|
};
|
|
76
|
-
/**
|
|
77
|
-
|
|
106
|
+
/**
|
|
107
|
+
* The model that runs setup and everything after it, besides ChatGPT.
|
|
108
|
+
* `"editable"` is a model the person chooses and the host checks and saves;
|
|
109
|
+
* `"managed"` is one the person's organization manages, shown read-only.
|
|
110
|
+
*/
|
|
111
|
+
export type FirstRunModelConnection = {
|
|
112
|
+
kind: "editable";
|
|
113
|
+
/** The settings on screen: the saved ones, or the person's edit. */
|
|
78
114
|
value: FirstRunModelSettings;
|
|
115
|
+
/** Whether `value` is the model in use, checked and saved. */
|
|
79
116
|
connected: boolean;
|
|
80
|
-
/**
|
|
117
|
+
/** Every edit. The host keeps it and invalidates the previous connection check. */
|
|
81
118
|
onChange: (value: FirstRunModelSettings) => void;
|
|
82
119
|
/** Read advertised models. The signal aborts when settings change or the screen closes. */
|
|
83
120
|
onFindModels: (value: FirstRunModelSettings, signal: AbortSignal) => Promise<readonly string[]>;
|
|
84
|
-
/**
|
|
121
|
+
/**
|
|
122
|
+
* Verify a response and persist before resolving; honor the signal
|
|
123
|
+
* before persisting. A rejection's message shows on the screen as
|
|
124
|
+
* written, so it names the next step: “The service answered with an
|
|
125
|
+
* error. Check the address and try again.”
|
|
126
|
+
*/
|
|
85
127
|
onConnect: (value: FirstRunModelSettings, signal: AbortSignal) => Promise<void>;
|
|
86
|
-
}
|
|
128
|
+
} | {
|
|
129
|
+
kind: "managed";
|
|
130
|
+
/** The model in use, as the host names it. */
|
|
131
|
+
model: string;
|
|
132
|
+
};
|
|
87
133
|
export interface FirstRunWritingAnswer {
|
|
88
134
|
style: FirstRunWritingStyle;
|
|
89
135
|
sign: FirstRunSigning;
|
|
@@ -99,39 +145,50 @@ export interface FirstRunSetupProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
99
145
|
brandName?: string;
|
|
100
146
|
/** Product mark. An `img` or `svg` is drawn at each place's own size. */
|
|
101
147
|
brandLogo?: React.ReactNode;
|
|
102
|
-
/**
|
|
148
|
+
/**
|
|
149
|
+
* The Chrome profile's email, when Chrome is signed in. Without it the
|
|
150
|
+
* profile reads as signed out, and the signature offers “Me (Chrome
|
|
151
|
+
* profile)”.
|
|
152
|
+
*/
|
|
103
153
|
email?: string;
|
|
104
|
-
/**
|
|
105
|
-
chromeSignedIn?: boolean;
|
|
106
|
-
/** The keyboard shortcut that opens the product, as Chrome shows it. */
|
|
154
|
+
/** The keyboard shortcut that opens the product, as Chrome shows it. Ready names it. */
|
|
107
155
|
shortcut?: string;
|
|
108
|
-
/**
|
|
156
|
+
/** Signing in with ChatGPT, the first way to connect the model that runs the rest of setup. */
|
|
109
157
|
signIn: {
|
|
158
|
+
/** Where the host's sign-in stands. Turning `done` on this screen moves on after a moment. */
|
|
110
159
|
status: FirstRunSignInStatus;
|
|
111
|
-
/** Starts the provider's sign-in. Never called while `status` is `done`. */
|
|
112
|
-
onSignIn: () => void;
|
|
113
160
|
/**
|
|
114
|
-
*
|
|
115
|
-
* the
|
|
161
|
+
* Starts the provider's sign-in. Never called while `status` is `done`:
|
|
162
|
+
* the signed-in card then reads “Continue with ChatGPT” and only moves on.
|
|
116
163
|
*/
|
|
117
|
-
|
|
164
|
+
onSignIn: () => void;
|
|
118
165
|
};
|
|
119
|
-
/** Another provider or local AI,
|
|
166
|
+
/** Another provider or local AI, or the organization's model, under Connect your AI. */
|
|
120
167
|
modelConnection: FirstRunModelConnection;
|
|
121
168
|
/** History consent is independent of Chrome sign-in. Hosts must not read history before opting in. */
|
|
122
169
|
history: {
|
|
170
|
+
/** The choice that stands. A made choice marks its tile as the current answer. */
|
|
123
171
|
choice: FirstRunHistoryChoice;
|
|
124
172
|
/**
|
|
125
173
|
* Ask for any access the host needs, record consent, and start
|
|
126
|
-
* history-derived preparation. Resolve `
|
|
127
|
-
* and `choice` reads `"history"
|
|
128
|
-
*
|
|
129
|
-
* pending,
|
|
130
|
-
* `
|
|
174
|
+
* history-derived preparation. Resolve `"history"` once consent is
|
|
175
|
+
* recorded and `choice` reads `"history"`: setup moves to preparation.
|
|
176
|
+
* Resolve `"skip"` when a skip stands instead (made on another page while
|
|
177
|
+
* this was pending, for example): setup moves on as Skip for now does,
|
|
178
|
+
* without calling `onSkipForNow`. Reject with a sentence for the person
|
|
179
|
+
* when consent did not happen (access refused, window closed); it shows on
|
|
180
|
+
* the choice, or “Couldn’t set up from history. Try again.” when the
|
|
181
|
+
* rejection has no message. The choice waits while this is pending and is
|
|
182
|
+
* never asked again until it settles.
|
|
131
183
|
*/
|
|
132
|
-
onSetUpFromHistory: () => Promise<
|
|
133
|
-
/**
|
|
134
|
-
|
|
184
|
+
onSetUpFromHistory: () => Promise<"history" | "skip">;
|
|
185
|
+
/**
|
|
186
|
+
* The person chose Skip for now. `next` is the screen setup moves to, so
|
|
187
|
+
* the host can save the choice and the step in one write; setup then calls
|
|
188
|
+
* `onStepChange(next)` itself. Stop any ongoing discovery and keep results
|
|
189
|
+
* already prepared.
|
|
190
|
+
*/
|
|
191
|
+
onSkipForNow: (next: FirstRunStep) => void;
|
|
135
192
|
};
|
|
136
193
|
/** The projects the agent sets up, one for each thing the person works on. */
|
|
137
194
|
projects: FirstRunWork<WorkspaceProjectSource>;
|
|
@@ -139,25 +196,43 @@ export interface FirstRunSetupProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
139
196
|
people: FirstRunWork<WorkspacePersonSource>;
|
|
140
197
|
/** Writing analysis and samples supplied after authorized profile and sent-email analysis. */
|
|
141
198
|
writing: {
|
|
199
|
+
/** Where the analysis stands. Writing style opens once it is `done` and preparation has settled. */
|
|
142
200
|
status: FirstRunWorkStatus;
|
|
201
|
+
/** One sample per style and signing identity; the preview shows the chosen pair. */
|
|
143
202
|
samples: readonly FirstRunWritingSample[];
|
|
144
203
|
/** The style inferred from the person's sent emails, supplied only after analysis. */
|
|
145
204
|
suggested?: FirstRunWritingStyle;
|
|
146
|
-
/**
|
|
205
|
+
/**
|
|
206
|
+
* The answer the host saved, from an earlier visit or another page. It
|
|
207
|
+
* seeds the form, which stays editable, and counts Writing style as
|
|
208
|
+
* reviewed.
|
|
209
|
+
*/
|
|
210
|
+
answer?: FirstRunWritingAnswer;
|
|
211
|
+
/** Saves the chosen style and signing identity as the person leaves with Continue. */
|
|
147
212
|
onSave: (answer: FirstRunWritingAnswer) => void;
|
|
148
|
-
/**
|
|
149
|
-
|
|
213
|
+
/** Why the analysis failed, as `FirstRunWork.failure` says it. */
|
|
214
|
+
failure?: string;
|
|
215
|
+
/** Analyzes the writing again after it failed, as `FirstRunWork.onRetry` does. */
|
|
216
|
+
onRetry: () => Promise<void>;
|
|
150
217
|
};
|
|
151
218
|
/**
|
|
152
|
-
* Automations made from the person's work.
|
|
153
|
-
*
|
|
154
|
-
* `source.onStop` follow that run.
|
|
219
|
+
* Automations made from the person's work. The first one that needs no
|
|
220
|
+
* input is offered to try, through `source.onRun`; `source.trace` and
|
|
221
|
+
* `source.onStop` follow that run. A rejected run shows its message.
|
|
155
222
|
*/
|
|
156
|
-
automations: FirstRunWork<WorkspaceAutomationSource
|
|
223
|
+
automations: FirstRunWork<WorkspaceAutomationSource & {
|
|
224
|
+
onRun: NonNullable<WorkspaceAutomationSource["onRun"]>;
|
|
225
|
+
}>;
|
|
157
226
|
/** Explicit schedule approvals within Work; enabled schedules are summarized at Ready. */
|
|
158
227
|
schedules: {
|
|
228
|
+
/** Every schedule the host holds. A switch reads on from the one for its automation. */
|
|
159
229
|
list: readonly ThinkSchedule[];
|
|
160
|
-
|
|
230
|
+
/**
|
|
231
|
+
* One switch changed. `schedule` is the one in `list` for this automation,
|
|
232
|
+
* or `undefined` when there is none yet. Resolve once saved; a rejection's
|
|
233
|
+
* message shows under the switch, which keeps its saved state.
|
|
234
|
+
*/
|
|
235
|
+
onChange: (automation: WorkspaceAutomation, enabled: boolean, schedule: ThinkSchedule | undefined) => Promise<void>;
|
|
161
236
|
};
|
|
162
237
|
/** The skills the agent wrote during setup, from the person and their recurring work. */
|
|
163
238
|
skills: FirstRunWork<{
|
|
@@ -168,6 +243,26 @@ export interface FirstRunSetupProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
168
243
|
/** Opens the main surface during preparation or from Ready. Keep host preparation running if setup closes. */
|
|
169
244
|
onOpen: () => void;
|
|
170
245
|
}
|
|
246
|
+
export interface FirstRunFrameProps extends React.HTMLAttributes<HTMLElement> {
|
|
247
|
+
/** Product name in the brand bar and the page's label. */
|
|
248
|
+
brandName?: string;
|
|
249
|
+
/** Product mark in the brand bar. An `img` or `svg` is drawn at the bar's size. */
|
|
250
|
+
brandLogo?: React.ReactNode;
|
|
251
|
+
/** The card's top row. Setup puts its step picker here; a host screen leaves it out. */
|
|
252
|
+
navigation?: React.ReactNode;
|
|
253
|
+
/** The id of the screen's title, which names the card's screen region. */
|
|
254
|
+
titleId?: string;
|
|
255
|
+
/** The card's body: a step, or a host screen such as a `StatusScreen`. */
|
|
256
|
+
children: React.ReactNode;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* The page setup draws around every step after the welcome: the wallpaper,
|
|
260
|
+
* the brand bar, one glass card, and the footer. `FirstRunSetup` renders its
|
|
261
|
+
* steps in it. It is exported for host screens outside the step flow, such
|
|
262
|
+
* as setup stopping because its saved progress did not read, so they share
|
|
263
|
+
* the frame instead of copying its classes.
|
|
264
|
+
*/
|
|
265
|
+
export declare function FirstRunFrame({ brandName, brandLogo, navigation, titleId, children, className, ...props }: FirstRunFrameProps): React.JSX.Element;
|
|
171
266
|
/**
|
|
172
267
|
* Full-screen first run of the agent, one screen at a time: connect a
|
|
173
268
|
* model, confirm the Chrome profile, choose whether to use history, and set up projects, people, writing, and
|
|
@@ -177,5 +272,5 @@ export interface FirstRunSetupProps extends Omit<React.HTMLAttributes<HTMLElemen
|
|
|
177
272
|
* host owns `step` and gets each answer as the person leaves its screen;
|
|
178
273
|
* moving between screens animates through React view transitions.
|
|
179
274
|
*/
|
|
180
|
-
export declare function FirstRunSetup({ step, onStepChange, brandName, brandLogo, email,
|
|
275
|
+
export declare function FirstRunSetup({ step, onStepChange, brandName, brandLogo, email, shortcut, signIn, modelConnection, history, projects: projectWork, people: peopleWork, writing: writingWork, automations: automationWork, schedules, skills: skillWork, pinned, onOpen, className, ...props }: FirstRunSetupProps): React.JSX.Element;
|
|
181
276
|
//#endregion
|