@mcp-b/react-components 0.64.0 → 0.64.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.
@@ -5,17 +5,33 @@ import { WorkspacePersonSource } from "../agents-sdk/WorkspacePerson.js";
5
5
  import { WorkspaceProjectSource } from "../agents-sdk/WorkspaceProject.js";
6
6
  import * as React from "react";
7
7
  import { SkillDescriptor } from "agents/skills";
8
+ //#region src/components/extension/first-run/flow.d.ts
9
+ /**
10
+ * Every screen of the first run, in order. `FirstRunStep` is derived from this
11
+ * list, so a host that persists the step can validate it at its boundary.
12
+ */
13
+ export declare const firstRunSteps: readonly ["welcome", "sign-in", "model-connection", "chrome-profile", "history", "preparation", "writing", "schedules", "try", "pin", "ask", "ready"];
14
+ /** Every history choice, for a host that persists it. */
15
+ export declare const firstRunHistoryChoices: readonly ["unset", "history", "skip"];
16
+ //#endregion
8
17
  //#region src/components/extension/FirstRunSetup.d.ts
9
18
  /**
10
- * A screen of the first run. Work is the history choice, then preparation,
11
- * writing style, schedule approvals, and a trial run, each its own screen.
19
+ * A screen of the first run, one of `firstRunSteps`. Work is the history
20
+ * choice, then preparation, writing style, schedule approvals, and a trial
21
+ * run, each its own screen.
12
22
  */
13
- export type FirstRunStep = "welcome" | "sign-in" | "model-connection" | "chrome-profile" | "history" | "preparation" | "writing" | "schedules" | "try" | "pin" | "ask" | "ready";
23
+ export type FirstRunStep = (typeof firstRunSteps)[number];
14
24
  /** Where a sign-in stands: not started, waiting on the provider's page, failed, or done. */
15
25
  export type FirstRunSignInStatus = "idle" | "waiting" | "failed" | "done";
16
- /** Whether this Chrome profile’s history may be used to prepare setup suggestions. */
17
- export type FirstRunHistoryChoice = "unset" | "history" | "skip";
18
- /** Where work the agent does during setup stands. */
26
+ /**
27
+ * Whether this Chrome profile’s history may be used to prepare setup
28
+ * suggestions, one of `firstRunHistoryChoices`.
29
+ */
30
+ export type FirstRunHistoryChoice = (typeof firstRunHistoryChoices)[number];
31
+ /**
32
+ * Where work the agent does during setup stands: `idle` before the host has
33
+ * started it, `working` while it runs, then `done` or `failed`.
34
+ */
19
35
  export type FirstRunWorkStatus = "idle" | "working" | "done" | "failed";
20
36
  /** One app or source currently being examined during preparation. */
21
37
  export interface FirstRunWorkActivity {
@@ -42,12 +58,21 @@ export interface FirstRunWork<Source> {
42
58
  export type FirstRunWritingStyle = "direct" | "friendly" | "detailed" | "formal";
43
59
  /** Sign using the current Chrome profile identity or the product’s separate assistant identity. */
44
60
  export type FirstRunSigning = "assistant" | "profile";
45
- /** An OpenAI-compatible model running locally or at another provider. */
46
- export interface FirstRunModelSettings {
47
- kind: "local" | "api";
61
+ /**
62
+ * An OpenAI-compatible model running on this computer, or at another provider
63
+ * reached with the provider's API key. A local model never takes a key.
64
+ */
65
+ export type FirstRunModelSettings = {
66
+ kind: "local";
48
67
  endpoint: string;
49
68
  model: string;
50
- }
69
+ } | {
70
+ kind: "api";
71
+ endpoint: string;
72
+ model: string;
73
+ /** The provider's API key, trimmed. Empty when the provider takes none. */
74
+ apiKey: string;
75
+ };
51
76
  /** The host owns discovery, connection checks, and persisted model settings. */
52
77
  export interface FirstRunModelConnection {
53
78
  value: FirstRunModelSettings;
@@ -83,15 +108,28 @@ export interface FirstRunSetupProps extends Omit<React.HTMLAttributes<HTMLElemen
83
108
  /** Connecting the model that runs the rest of setup, or choosing another provider. */
84
109
  signIn: {
85
110
  status: FirstRunSignInStatus;
111
+ /** Starts the provider's sign-in. Never called while `status` is `done`. */
86
112
  onSignIn: () => void;
113
+ /**
114
+ * The person chose the signed-in account while `status` is `done`: make it
115
+ * the model in use again, in place of any other connected model.
116
+ */
117
+ onUse: () => void;
87
118
  };
88
119
  /** Another provider or local AI, configured within the Connect your AI section. */
89
120
  modelConnection: FirstRunModelConnection;
90
121
  /** History consent is independent of Chrome sign-in. Hosts must not read history before opting in. */
91
122
  history: {
92
123
  choice: FirstRunHistoryChoice;
93
- /** Record consent before starting history-derived preparation. */
94
- onSetUpFromHistory: () => void;
124
+ /**
125
+ * Ask for any access the host needs, record consent, and start
126
+ * history-derived preparation. Resolve `true` once consent is recorded
127
+ * and `choice` reads `"history"`; resolve `false` when it did not happen
128
+ * (access refused, window closed). The choice waits while this is
129
+ * pending, moves to preparation on `true`, and shows the failure on
130
+ * `false` or a rejection. Never called again while pending.
131
+ */
132
+ onSetUpFromHistory: () => Promise<boolean>;
95
133
  /** Skip preparation and stop any ongoing discovery; keep results already prepared. */
96
134
  onSkipForNow: () => void;
97
135
  };