@belonguniverseai/react-sdk 0.6.6 → 0.6.7
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/api/client.d.ts +683 -2
- package/dist/api/connectors.d.ts +360 -0
- package/dist/api/query-keys.d.ts +8 -0
- package/dist/component/{abnfDiagram-N423BO3Z-C6FcPK3d.js → abnfDiagram-N423BO3Z-CZS71qjo.js} +4 -4
- package/dist/component/{arc-BFUQjzCS.js → arc-CztymUZ_.js} +2 -2
- package/dist/component/{architectureDiagram-T3A2C74G-BDBrDBki.js → architectureDiagram-T3A2C74G-Dg9ZE0Qp.js} +3 -3
- package/dist/component/{blockDiagram-VBNYF7ZC-UZV4Vc3P.js → blockDiagram-VBNYF7ZC-DngLqsTJ.js} +4 -4
- package/dist/component/{c4Diagram-5PPSVZJV-CCPtctjO.js → c4Diagram-5PPSVZJV-Dv9PRH6O.js} +3 -3
- package/dist/component/{channel-CIUveBDa.js → channel-Cy1msWjd.js} +2 -2
- package/dist/component/{chunk-2GRJ4B5K-CRCj56HD.js → chunk-2GRJ4B5K-BP6YBz9_.js} +2 -2
- package/dist/component/{chunk-2Q5K7J3B-CL0yogzL.js → chunk-2Q5K7J3B-BfWYZyaV.js} +2 -2
- package/dist/component/{chunk-5RXB4S5H-Blwl04-V.js → chunk-5RXB4S5H-Wn88BCO0.js} +5 -5
- package/dist/component/{chunk-5VM5RSS4-C497fKeV.js → chunk-5VM5RSS4-CXdsy-yn.js} +2 -2
- package/dist/component/{chunk-6Q2QTUOP-C_2Jk1ii.js → chunk-6Q2QTUOP-DSge-zbv.js} +2 -2
- package/dist/component/{chunk-GF5L2VYU-Cs_Nhfpw.js → chunk-GF5L2VYU-7kov7TtI.js} +6 -6
- package/dist/component/{chunk-JWPE2WC7-Dcs41Q_n.js → chunk-JWPE2WC7-BKBsGsHG.js} +2 -2
- package/dist/component/{chunk-KBJHAD2P-BWm1frM-.js → chunk-KBJHAD2P-CZBTReK1.js} +2 -2
- package/dist/component/{chunk-RYQCIY6F-XA_jesTk.js → chunk-RYQCIY6F-DanZm73E.js} +2 -2
- package/dist/component/{chunk-XXDRQBXY-BDtOkxP3.js → chunk-XXDRQBXY-K9dZrAbB.js} +2 -2
- package/dist/component/{classDiagram-JCYQIIEL-CvZflq4I.js → classDiagram-JCYQIIEL-DgVNXgGq.js} +3 -3
- package/dist/component/{classDiagram-v2-OCEON4UE-CvZflq4I.js → classDiagram-v2-OCEON4UE-DgVNXgGq.js} +3 -3
- package/dist/component/{cose-bilkent-JH36ORCC-C1arfbyI.js → cose-bilkent-JH36ORCC-CNh7W_Rr.js} +2 -2
- package/dist/component/{cynefinDiagram-MW4NZA55-CS5V8R4P.js → cynefinDiagram-MW4NZA55-BBxdfZii.js} +3 -3
- package/dist/component/{dagre-VZM6K2ZE-BZ6hBjLx.js → dagre-VZM6K2ZE-D6mkmclz.js} +3 -3
- package/dist/component/{diagram-7IWD3JNH-sP7Tm4Ov.js → diagram-7IWD3JNH-EoPRghAe.js} +4 -4
- package/dist/component/{diagram-B4RE2ZJO-BNGAdSWl.js → diagram-B4RE2ZJO-Ck-EIN4V.js} +3 -3
- package/dist/component/{diagram-LBJQPF4R-FUyO9neA.js → diagram-LBJQPF4R-CFJ1IxnO.js} +3 -3
- package/dist/component/{diagram-Q27KOJAE-j_dqjRdo.js → diagram-Q27KOJAE-xtJbi8_k.js} +4 -4
- package/dist/component/{diagram-UB23O5K3-C9DPA3Ub.js → diagram-UB23O5K3-CL4MaOzz.js} +3 -3
- package/dist/component/{ebnfDiagram-BXEA7PRR-D33P9__e.js → ebnfDiagram-BXEA7PRR-BkyoJuZH.js} +4 -4
- package/dist/component/{erDiagram-JOGREHBK-DOB0CdMC.js → erDiagram-JOGREHBK-BIXrNwQY.js} +5 -5
- package/dist/component/{flowDiagram-UKHOOZJN-Byd1bpG0.js → flowDiagram-UKHOOZJN-D0Mrp2sk.js} +7 -7
- package/dist/component/{ganttDiagram-PKOTCBZU-DYe8BZEh.js → ganttDiagram-PKOTCBZU-Bk57vzJC.js} +3 -3
- package/dist/component/{gitGraphDiagram-DS77QQ5N-XZ8Mo4GA.js → gitGraphDiagram-DS77QQ5N-CCpx-kXh.js} +4 -4
- package/dist/component/{highlighted-body-OFNGDK62-CL31TQjN.js → highlighted-body-OFNGDK62-B6vAKr9s.js} +2 -2
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-6WML65LV-CKFHlOyG.js → infoDiagram-6WML65LV-KlVle315.js} +2 -2
- package/dist/component/{ishikawaDiagram-WSZJBQD7-DcYs6_Ks.js → ishikawaDiagram-WSZJBQD7-Bi7sbuio.js} +2 -2
- package/dist/component/{journeyDiagram-NVQOT4AX-BdL6QUhp.js → journeyDiagram-NVQOT4AX-Bve0TBmQ.js} +5 -5
- package/dist/component/{kanban-definition-27J2QSJJ-BXSCmJV1.js → kanban-definition-27J2QSJJ-BznMypxI.js} +3 -3
- package/dist/component/{linear-CKjHF2HZ.js → linear-Db0zTzeX.js} +2 -2
- package/dist/component/{mermaid-GHXKKRXX-DkoZohjm.js → mermaid-GHXKKRXX-DRvjpCT4.js} +34217 -31398
- package/dist/component/{mindmap-definition-FAOFIHXS-DW4hhNZQ.js → mindmap-definition-FAOFIHXS-DC-W6F5t.js} +4 -4
- package/dist/component/{pegDiagram-VL7TDLO6-Bi-Kyrnt.js → pegDiagram-VL7TDLO6-DN4TVY9N.js} +4 -4
- package/dist/component/{pieDiagram-7S7Q4E2Y-BMhIZVGK.js → pieDiagram-7S7Q4E2Y-TgcBFjjO.js} +4 -4
- package/dist/component/{quadrantDiagram-CIZ2JOQS-bceN8tX9.js → quadrantDiagram-CIZ2JOQS-CkM5IhjU.js} +3 -3
- package/dist/component/{railroadDiagram-AXF67PYL-D-nJshKI.js → railroadDiagram-AXF67PYL-DxiLraF5.js} +4 -4
- package/dist/component/{requirementDiagram-LRYGKXZP-CYZUa3OC.js → requirementDiagram-LRYGKXZP-nQo-Mina.js} +4 -4
- package/dist/component/{sankeyDiagram-W5VNT64P-BGB3WZee.js → sankeyDiagram-W5VNT64P-4KllqWbF.js} +2 -2
- package/dist/component/{sequenceDiagram-SI44F4Z6-C1vZr0MI.js → sequenceDiagram-SI44F4Z6-Ddb1e9Vc.js} +4 -4
- package/dist/component/{sizeCapture-X5ZJPWSS-RlcsaXgG.js → sizeCapture-X5ZJPWSS-cOyVP5iN.js} +2 -2
- package/dist/component/{stateDiagram-OKZ733FA-fvMUXvo7.js → stateDiagram-OKZ733FA-77JC1AgC.js} +3 -3
- package/dist/component/{stateDiagram-v2-UEYNNEHI-C5wIei7D.js → stateDiagram-v2-UEYNNEHI-CASTwYVj.js} +3 -3
- package/dist/component/{swimlanes-SLNWSIFB-C3hQy7qq.js → swimlanes-SLNWSIFB-DlzxVctq.js} +4 -4
- package/dist/component/{swimlanesDiagram-ULZ7WXOC-ByZ1cbCX.js → swimlanesDiagram-ULZ7WXOC-BQv0GPEC.js} +3 -3
- package/dist/component/{timeline-definition-Z64GVDOM-D0_tzWD4.js → timeline-definition-Z64GVDOM-snpoPkCw.js} +3 -3
- package/dist/component/{vennDiagram-T6HMQDX7-C9YEUDaF.js → vennDiagram-T6HMQDX7-CQ3oA8fU.js} +2 -2
- package/dist/component/{wardleyDiagram-T6FBY63Y-CXHDuHLt.js → wardleyDiagram-T6FBY63Y-BPE-lH8K.js} +3 -3
- package/dist/component/{xychartDiagram-ELKLHX3M-n_ilatMg.js → xychartDiagram-ELKLHX3M-DOiVr_f-.js} +3 -3
- package/dist/components/connectors/ConfirmDeleteConnectorDialog.d.ts +16 -0
- package/dist/components/connectors/ConnectorAuthFields.d.ts +8 -0
- package/dist/components/connectors/ConnectorAvatar.d.ts +14 -0
- package/dist/components/connectors/ConnectorDetailsDialog.d.ts +8 -0
- package/dist/components/connectors/ConnectorNoticeLine.d.ts +5 -0
- package/dist/components/connectors/ConnectorsListSurface.d.ts +31 -0
- package/dist/components/connectors/NewConnectorDialog.d.ts +47 -0
- package/dist/components/connectors/connector-copy.d.ts +17 -0
- package/dist/components/connectors/connector-form.d.ts +247 -0
- package/dist/components/connectors/portal-theme.d.ts +8 -0
- package/dist/components/connectors/product-name.d.ts +17 -0
- package/dist/components/connectors/use-connector-oauth.d.ts +28 -0
- package/dist/components/embed/EmbedRail.d.ts +14 -2
- package/dist/components/embed/rail-flags.d.ts +14 -0
- package/dist/embed/dock-state.d.ts +1 -1
- package/dist/i18n/messages/en.d.ts +154 -0
- package/dist/i18n/messages/surfaces/connectors.d.ts +512 -0
- package/dist/i18n/messages/surfaces/header.d.ts +3 -0
- package/dist/routes/connectors.d.ts +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,247 @@
|
|
|
1
|
+
import { ConnectorAuthInput, ConnectorCredentialInput, ConnectorTransport } from '../../api/connectors.ts';
|
|
2
|
+
/** The two transports, in menu order — the default first. */
|
|
3
|
+
export declare const CONNECTOR_TRANSPORTS: readonly ConnectorTransport[];
|
|
4
|
+
/** What a connector is reached with unless the user says otherwise. Nearly
|
|
5
|
+
* every server published today speaks it; SSE is the older one. */
|
|
6
|
+
export declare const DEFAULT_CONNECTOR_TRANSPORT: ConnectorTransport;
|
|
7
|
+
export declare const isConnectorTransport: (value: string) => value is ConnectorTransport;
|
|
8
|
+
export declare const MAX_CONNECTOR_NAME_CHARS = 100;
|
|
9
|
+
export declare const MAX_CONNECTOR_DESCRIPTION_CHARS = 500;
|
|
10
|
+
export declare const MAX_CONNECTOR_EMOJI_CHARS = 16;
|
|
11
|
+
export declare const MAX_CONNECTOR_SERVER_URL_CHARS = 2048;
|
|
12
|
+
export declare const MAX_CONNECTOR_HEADER_ROWS = 16;
|
|
13
|
+
export declare const MAX_CONNECTOR_OAUTH_CLIENT_ID_CHARS = 256;
|
|
14
|
+
export declare const MAX_CONNECTOR_OAUTH_CLIENT_SECRET_CHARS = 2048;
|
|
15
|
+
export declare const MAX_CONNECTOR_OAUTH_SCOPE_CHARS = 1024;
|
|
16
|
+
export declare const MAX_CONNECTOR_OAUTH_PARAM_ROWS = 10;
|
|
17
|
+
export declare const MAX_CONNECTOR_OAUTH_PARAM_VALUE_CHARS = 512;
|
|
18
|
+
export declare const MAX_CONNECTOR_TOKEN_ENDPOINT_CHARS = 2048;
|
|
19
|
+
/**
|
|
20
|
+
* One row of the custom-headers editor. Rows are ORDERED and may be blank —
|
|
21
|
+
* the editor always keeps a row to type into.
|
|
22
|
+
*
|
|
23
|
+
* `id` is the row's REACT identity, not data: rows are added, removed from the
|
|
24
|
+
* middle and retyped, and keying them by array index makes React reuse the
|
|
25
|
+
* wrong input's DOM node (the value you typed follows the row above the one
|
|
26
|
+
* you deleted). It never reaches the wire — `validateConnectorAuth` builds the
|
|
27
|
+
* header map from `name`/`value` alone.
|
|
28
|
+
*/
|
|
29
|
+
export type ConnectorHeaderRow = {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly value: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* One row of the extra-sign-in-settings editor. Same three fields as a header
|
|
36
|
+
* row and same reason for each of them (see above) — a separate type because
|
|
37
|
+
* the two editors bound their names and values differently, and a shared alias
|
|
38
|
+
* would invite validating one with the other's rules.
|
|
39
|
+
*/
|
|
40
|
+
export type ConnectorParamRow = {
|
|
41
|
+
readonly id: string;
|
|
42
|
+
readonly name: string;
|
|
43
|
+
readonly value: string;
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* The credential half of the form, as the dialog holds it in state.
|
|
47
|
+
*
|
|
48
|
+
* `oauth` is the odd one out and stays that way on purpose: every field is
|
|
49
|
+
* OPTIONAL and all-empty is the ordinary case, because there is no credential
|
|
50
|
+
* to type — signing in happens at the provider. They exist for the minority of
|
|
51
|
+
* apps that hand you an id and a secret to paste, or that insist on being asked
|
|
52
|
+
* for particular permissions, and they live behind a disclosure so the common
|
|
53
|
+
* path stays one choice in a menu.
|
|
54
|
+
*
|
|
55
|
+
* `oauth_client_credentials` is the opposite: its id and secret are REQUIRED,
|
|
56
|
+
* because they are the whole credential. It behaves like `bearer` — typed once,
|
|
57
|
+
* used immediately, replaced through Edit.
|
|
58
|
+
*/
|
|
59
|
+
export type ConnectorAuthDraft = {
|
|
60
|
+
readonly mode: "none";
|
|
61
|
+
} | {
|
|
62
|
+
readonly mode: "bearer";
|
|
63
|
+
readonly token: string;
|
|
64
|
+
} | {
|
|
65
|
+
readonly mode: "headers";
|
|
66
|
+
readonly rows: readonly ConnectorHeaderRow[];
|
|
67
|
+
} | {
|
|
68
|
+
readonly mode: "oauth";
|
|
69
|
+
readonly clientId: string;
|
|
70
|
+
readonly clientSecret: string;
|
|
71
|
+
readonly scope: string;
|
|
72
|
+
readonly params: readonly ConnectorParamRow[];
|
|
73
|
+
} | {
|
|
74
|
+
readonly mode: "oauth_client_credentials";
|
|
75
|
+
readonly clientId: string;
|
|
76
|
+
readonly clientSecret: string;
|
|
77
|
+
readonly tokenEndpoint: string;
|
|
78
|
+
readonly scope: string;
|
|
79
|
+
};
|
|
80
|
+
export type ConnectorAuthDraftMode = ConnectorAuthDraft["mode"];
|
|
81
|
+
export type ConnectorFormDraft = {
|
|
82
|
+
readonly name: string;
|
|
83
|
+
readonly description: string;
|
|
84
|
+
readonly emoji: string;
|
|
85
|
+
readonly serverUrl: string;
|
|
86
|
+
/** Never validated, only carried: both members are legal, and the edit form
|
|
87
|
+
* passes the STORED one straight back through (it cannot be changed). */
|
|
88
|
+
readonly transport: ConnectorTransport;
|
|
89
|
+
readonly auth: ConnectorAuthDraft;
|
|
90
|
+
};
|
|
91
|
+
/**
|
|
92
|
+
* What is wrong with the draft. A discriminated union rather than a message
|
|
93
|
+
* string so the copy lives in the i18n catalog and this module stays
|
|
94
|
+
* translatable — and so a new rule mechanically fails every `match` on it.
|
|
95
|
+
*/
|
|
96
|
+
export type ConnectorFormProblem = {
|
|
97
|
+
readonly kind: "name_empty";
|
|
98
|
+
} | {
|
|
99
|
+
readonly kind: "name_too_long";
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: "description_too_long";
|
|
102
|
+
} | {
|
|
103
|
+
readonly kind: "emoji_too_long";
|
|
104
|
+
} | {
|
|
105
|
+
readonly kind: "url_empty";
|
|
106
|
+
} | {
|
|
107
|
+
readonly kind: "url_too_long";
|
|
108
|
+
}
|
|
109
|
+
/** Not a URL at all, or a scheme we could never dispatch (`file:`, `javascript:`). */
|
|
110
|
+
| {
|
|
111
|
+
readonly kind: "url_invalid";
|
|
112
|
+
} | {
|
|
113
|
+
readonly kind: "token_empty";
|
|
114
|
+
}
|
|
115
|
+
/** A row with a value typed but no header name. */
|
|
116
|
+
| {
|
|
117
|
+
readonly kind: "header_name_empty";
|
|
118
|
+
} | {
|
|
119
|
+
readonly kind: "header_name_invalid";
|
|
120
|
+
readonly name: string;
|
|
121
|
+
} | {
|
|
122
|
+
readonly kind: "header_name_duplicate";
|
|
123
|
+
readonly name: string;
|
|
124
|
+
} | {
|
|
125
|
+
readonly kind: "header_value_newline";
|
|
126
|
+
readonly name: string;
|
|
127
|
+
} | {
|
|
128
|
+
readonly kind: "header_rows_exceeded";
|
|
129
|
+
readonly maxCount: number;
|
|
130
|
+
}
|
|
131
|
+
/** A secret typed with no id. Both blank is fine; a secret alone is a paste
|
|
132
|
+
* that went wrong, and the server refuses it too. */
|
|
133
|
+
| {
|
|
134
|
+
readonly kind: "oauth_client_id_missing";
|
|
135
|
+
} | {
|
|
136
|
+
readonly kind: "oauth_client_id_too_long";
|
|
137
|
+
} | {
|
|
138
|
+
readonly kind: "oauth_client_secret_too_long";
|
|
139
|
+
}
|
|
140
|
+
/** Not a permissions line the app could be asked for — a stray quote, a tab,
|
|
141
|
+
* or two spaces where one word was meant. */
|
|
142
|
+
| {
|
|
143
|
+
readonly kind: "oauth_scope_invalid";
|
|
144
|
+
} | {
|
|
145
|
+
readonly kind: "oauth_scope_too_long";
|
|
146
|
+
}
|
|
147
|
+
/** A setting with a value typed but no name. */
|
|
148
|
+
| {
|
|
149
|
+
readonly kind: "oauth_param_name_empty";
|
|
150
|
+
} | {
|
|
151
|
+
readonly kind: "oauth_param_name_invalid";
|
|
152
|
+
readonly name: string;
|
|
153
|
+
}
|
|
154
|
+
/** A name the sign-in address already uses for something of its own. */
|
|
155
|
+
| {
|
|
156
|
+
readonly kind: "oauth_param_name_reserved";
|
|
157
|
+
readonly name: string;
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: "oauth_param_name_duplicate";
|
|
160
|
+
readonly name: string;
|
|
161
|
+
} | {
|
|
162
|
+
readonly kind: "oauth_param_value_newline";
|
|
163
|
+
readonly name: string;
|
|
164
|
+
} | {
|
|
165
|
+
readonly kind: "oauth_param_value_too_long";
|
|
166
|
+
readonly name: string;
|
|
167
|
+
} | {
|
|
168
|
+
readonly kind: "oauth_params_exceeded";
|
|
169
|
+
readonly maxCount: number;
|
|
170
|
+
}
|
|
171
|
+
/** The service credential's two required halves. Unlike the sign-in mode's,
|
|
172
|
+
* these ARE the credential, so neither may be left blank. */
|
|
173
|
+
| {
|
|
174
|
+
readonly kind: "cc_client_id_missing";
|
|
175
|
+
} | {
|
|
176
|
+
readonly kind: "cc_client_id_too_long";
|
|
177
|
+
} | {
|
|
178
|
+
readonly kind: "cc_client_secret_missing";
|
|
179
|
+
} | {
|
|
180
|
+
readonly kind: "cc_client_secret_too_long";
|
|
181
|
+
} | {
|
|
182
|
+
readonly kind: "cc_token_endpoint_invalid";
|
|
183
|
+
} | {
|
|
184
|
+
readonly kind: "cc_token_endpoint_too_long";
|
|
185
|
+
}
|
|
186
|
+
/** Re-signing in is the Connect action, not a field on the edit form. */
|
|
187
|
+
| {
|
|
188
|
+
readonly kind: "oauth_not_replaceable";
|
|
189
|
+
};
|
|
190
|
+
/** The normalized payload a valid draft submits — trimmed, with blank header
|
|
191
|
+
* rows dropped and the emoji omitted (not empty-stringed) when unset. */
|
|
192
|
+
export type ConnectorFormValues = {
|
|
193
|
+
readonly name: string;
|
|
194
|
+
readonly description: string;
|
|
195
|
+
readonly emoji?: string;
|
|
196
|
+
readonly serverUrl: string;
|
|
197
|
+
readonly transport: ConnectorTransport;
|
|
198
|
+
readonly auth: ConnectorAuthInput;
|
|
199
|
+
};
|
|
200
|
+
export type ConnectorFormValidation = {
|
|
201
|
+
readonly kind: "ok";
|
|
202
|
+
readonly values: ConnectorFormValues;
|
|
203
|
+
} | {
|
|
204
|
+
readonly kind: "invalid";
|
|
205
|
+
readonly problem: ConnectorFormProblem;
|
|
206
|
+
};
|
|
207
|
+
/** The auth half's own verdict, for the CREATE form (OAuth included). */
|
|
208
|
+
export type ConnectorAuthValidation = {
|
|
209
|
+
readonly kind: "ok";
|
|
210
|
+
readonly value: ConnectorAuthInput;
|
|
211
|
+
} | {
|
|
212
|
+
readonly kind: "invalid";
|
|
213
|
+
readonly problem: ConnectorFormProblem;
|
|
214
|
+
};
|
|
215
|
+
/** The narrower verdict the EDIT dialog needs — a credential it can replace. */
|
|
216
|
+
export type ConnectorCredentialValidation = {
|
|
217
|
+
readonly kind: "ok";
|
|
218
|
+
readonly value: ConnectorCredentialInput;
|
|
219
|
+
} | {
|
|
220
|
+
readonly kind: "invalid";
|
|
221
|
+
readonly problem: ConnectorFormProblem;
|
|
222
|
+
};
|
|
223
|
+
/**
|
|
224
|
+
* The server's ORIGIN, for showing a user which host they pointed at without
|
|
225
|
+
* echoing a path or query back (either can carry a token). Falls back to the
|
|
226
|
+
* raw string when it does not parse — a value we cannot read is still a value
|
|
227
|
+
* the user typed and may need to recognise.
|
|
228
|
+
*/
|
|
229
|
+
export declare const connectorServerOrigin: (serverUrl: string) => string;
|
|
230
|
+
/** Validate the auth half alone. Accepts every mode the CREATE form offers. */
|
|
231
|
+
export declare const validateConnectorAuth: (auth: ConnectorAuthDraft) => ConnectorAuthValidation;
|
|
232
|
+
/**
|
|
233
|
+
* Validate a credential the EDIT dialog can actually replace.
|
|
234
|
+
*
|
|
235
|
+
* `oauth` is refused rather than accepted-and-ignored: re-signing in is the
|
|
236
|
+
* Connect action, and a save button that silently did nothing would be worse
|
|
237
|
+
* than a sentence saying where the control is. The edit dialog does not offer
|
|
238
|
+
* the mode, so this is the belt to that braces — and it keeps the patch's type
|
|
239
|
+
* honest instead of widening it to a shape the server refuses.
|
|
240
|
+
*
|
|
241
|
+
* A SERVICE credential passes, and has to: an app that stopped honouring an id
|
|
242
|
+
* and secret has no window to send anyone to, so typing the new pair here is
|
|
243
|
+
* the whole recovery.
|
|
244
|
+
*/
|
|
245
|
+
export declare const validateConnectorCredential: (auth: ConnectorAuthDraft) => ConnectorCredentialValidation;
|
|
246
|
+
/** Validate the whole add-a-connector form. */
|
|
247
|
+
export declare const validateConnectorForm: (draft: ConnectorFormDraft) => ConnectorFormValidation;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
export type PortalTheme = {
|
|
3
|
+
/** Spread onto the portaled content element. */
|
|
4
|
+
readonly style: CSSProperties;
|
|
5
|
+
/** `"dark"` when the dock is dark, so Tailwind's `.dark` variants apply. */
|
|
6
|
+
readonly className: string | undefined;
|
|
7
|
+
};
|
|
8
|
+
export declare const usePortalTheme: () => PortalTheme;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The product name the connector copy says out loud — "Simetrik" on the tenant
|
|
3
|
+
* preset, "Belong" by default, or whatever a host pushed with
|
|
4
|
+
* `belong.setTheme({ brand })`.
|
|
5
|
+
*
|
|
6
|
+
* The same value `app.openAssistant` and `embed.agentWorking` interpolate, read
|
|
7
|
+
* from the same live store; the connector surfaces need it because they are
|
|
8
|
+
* PROPLESS (see `ConnectorsListSurface`'s module doc) and cannot be handed the
|
|
9
|
+
* theme the way `EmbedLogin` is. Lives in a plain `.ts` module for the reason
|
|
10
|
+
* `portal-theme.ts` does — the component files stay clean React Fast Refresh
|
|
11
|
+
* boundaries.
|
|
12
|
+
*
|
|
13
|
+
* Why the name is in the copy at all: "connect an app so the agent can act on
|
|
14
|
+
* your data" is a sentence a user cannot weigh, because "the agent" is not
|
|
15
|
+
* anything they signed up for. The brand is (§42 — name the product).
|
|
16
|
+
*/
|
|
17
|
+
export declare const useProductName: () => string;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ConnectorNotice } from './connector-copy.ts';
|
|
2
|
+
export type ConnectorOAuthPhase = {
|
|
3
|
+
readonly kind: "idle";
|
|
4
|
+
}
|
|
5
|
+
/** The server is discovering the provider; nothing is on screen yet. */
|
|
6
|
+
| {
|
|
7
|
+
readonly kind: "starting";
|
|
8
|
+
} | {
|
|
9
|
+
readonly kind: "waiting";
|
|
10
|
+
readonly connectorId: string;
|
|
11
|
+
/** Rendered as a link when the popup did not open. */
|
|
12
|
+
readonly authorizationUrl: string;
|
|
13
|
+
readonly popupBlocked: boolean;
|
|
14
|
+
} | {
|
|
15
|
+
readonly kind: "done";
|
|
16
|
+
readonly connectorId: string;
|
|
17
|
+
} | {
|
|
18
|
+
readonly kind: "failed";
|
|
19
|
+
readonly notice: ConnectorNotice;
|
|
20
|
+
};
|
|
21
|
+
export type ConnectorOAuthConnect = {
|
|
22
|
+
readonly phase: ConnectorOAuthPhase;
|
|
23
|
+
/** Start (or restart) the flow for one connector. */
|
|
24
|
+
readonly connect: (connectorId: string) => Promise<void>;
|
|
25
|
+
/** Back to `idle` — what a dialog calls when it reopens. */
|
|
26
|
+
readonly reset: () => void;
|
|
27
|
+
};
|
|
28
|
+
export declare const useConnectorOAuthConnect: () => ConnectorOAuthConnect;
|
|
@@ -7,7 +7,7 @@ import { BelongTheme, BelongThemePalette, PresetName } from '../../types/public.
|
|
|
7
7
|
* two must carry the SAME members: this one is what the chrome renders, that
|
|
8
8
|
* one is what the router and localStorage persist, and a view present in only
|
|
9
9
|
* one of them is a view you can reach but not come back to after a reload. */
|
|
10
|
-
export type EmbedView = "chat" | "files" | "scheduled" | "prompts";
|
|
10
|
+
export type EmbedView = "chat" | "files" | "scheduled" | "prompts" | "connectors";
|
|
11
11
|
/**
|
|
12
12
|
* 52px rail. Top: user avatar (account + theme controls). Middle: Chat /
|
|
13
13
|
* Files nav (active = Ocean primary fill, brand-driven). Bottom
|
|
@@ -15,7 +15,7 @@ export type EmbedView = "chat" | "files" | "scheduled" | "prompts";
|
|
|
15
15
|
* expand-to-modal — then the collapse toggle. Active fill + brand colours come
|
|
16
16
|
* from `palette` so a host brand push re-themes everything.
|
|
17
17
|
*/
|
|
18
|
-
export declare function EmbedRail({ view, collapsed, user, theme, palette, sessions, activeId, planProgress, speakEnabled, ttsSupported, voiceSupported, voiceStatus, pendingVoiceDraft, voiceActionFlash, accent, cssVars, presets, activePreset, onSelectView, onToggleCollapse, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onSelectAgentLine, onCloseAgentLine, onDeleteSession, onRenameSession, onSessionsOpen, onViewStats, onToggleSpeak, onExpand, }: {
|
|
18
|
+
export declare function EmbedRail({ view, collapsed, user, theme, palette, sessions, activeId, planProgress, speakEnabled, ttsSupported, voiceSupported, voiceStatus, pendingVoiceDraft, voiceActionFlash, accent, cssVars, presets, activePreset, onSelectView, onToggleCollapse, onToggleMode, onToggleSide, onAccentChange, onAccentReset, onCssVarsChange, onApplyPreset, onLogout, onNewSession, onSelectSession, onSelectAgentLine, onCloseAgentLine, onDeleteSession, onRenameSession, onSessionsOpen, onViewStats, onToggleSpeak, onExpand, connectorsUnavailable, }: {
|
|
19
19
|
view: EmbedView;
|
|
20
20
|
collapsed: boolean;
|
|
21
21
|
user: string | null;
|
|
@@ -86,4 +86,16 @@ export declare function EmbedRail({ view, collapsed, user, theme, palette, sessi
|
|
|
86
86
|
onViewStats?: (sessionId: string) => void;
|
|
87
87
|
onToggleSpeak: () => void;
|
|
88
88
|
onExpand: () => void;
|
|
89
|
+
/**
|
|
90
|
+
* This deployment answered "the connectors feature is off here" — the rail
|
|
91
|
+
* then hides the Connectors entry entirely, because a surface that can only
|
|
92
|
+
* ever say "unavailable" is worse than no entry at all.
|
|
93
|
+
*
|
|
94
|
+
* Optional and defaulting to FALSE so the entry shows OPTIMISTICALLY: the
|
|
95
|
+
* dock's list query is still in flight on first paint, and a rail item that
|
|
96
|
+
* pops in a second late reads as a glitch. Only a resolved `featureAbsent`
|
|
97
|
+
* (404, or a 503 whose body is `connectors_disabled`) flips this — an
|
|
98
|
+
* ordinary outage keeps the entry, and the surface shows its retry state.
|
|
99
|
+
*/
|
|
100
|
+
connectorsUnavailable?: boolean;
|
|
89
101
|
}): import("react").JSX.Element;
|
|
@@ -40,3 +40,17 @@ export declare const MULTI_AGENT_RAIL_ENABLED = true;
|
|
|
40
40
|
* back with no other change.
|
|
41
41
|
*/
|
|
42
42
|
export declare const VOICE_CALL_BUTTON_ENABLED = false;
|
|
43
|
+
/**
|
|
44
|
+
* The Connectors tab in the MOBILE bottom nav bar (the desktop rail entry is
|
|
45
|
+
* always on — it is only gated by whether the deployment has the feature).
|
|
46
|
+
*
|
|
47
|
+
* `false` on purpose: the bar is AT CAPACITY. `MobileNavBar`'s own comment
|
|
48
|
+
* measures it — BEL-259's fourth tab already took the row to 7 cells (8 with
|
|
49
|
+
* the dial button), which at 375px in Spanish overflows into a horizontal
|
|
50
|
+
* scroller, and a fifth view tab pushes the sessions switcher and the close
|
|
51
|
+
* chevron further behind a swipe the user has no reason to attempt. Connectors
|
|
52
|
+
* is a set-up-once surface; a phone is where you USE what you connected, not
|
|
53
|
+
* where you register an app. Flip to `true` once the bar is re-thought (an
|
|
54
|
+
* overflow "More" cell), and the tab appears with no other change.
|
|
55
|
+
*/
|
|
56
|
+
export declare const CONNECTORS_MOBILE_TAB_ENABLED = false;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* in the stream-state store; this module owns only view + size. Best-effort:
|
|
6
6
|
* disabled/quota'd storage just means no cross-reload restore.
|
|
7
7
|
*/
|
|
8
|
-
export type DockView = "chat" | "files" | "scheduled" | "prompts";
|
|
8
|
+
export type DockView = "chat" | "files" | "scheduled" | "prompts" | "connectors";
|
|
9
9
|
export type DockSize = "collapsed" | "expanded" | "modal";
|
|
10
10
|
export type DockState = {
|
|
11
11
|
readonly view: DockView;
|
|
@@ -294,6 +294,7 @@ export declare const en: {
|
|
|
294
294
|
readonly navFiles: "Files";
|
|
295
295
|
readonly navScheduled: "Scheduled";
|
|
296
296
|
readonly navPrompts: "Prompts";
|
|
297
|
+
readonly navConnectors: "Connectors";
|
|
297
298
|
readonly chatPlanRunning: "Chat — plan running, {{completed}} of {{total}} steps done";
|
|
298
299
|
readonly devMode: "Dev mode";
|
|
299
300
|
readonly devModeTitle: "Dev mode (belong:dev)";
|
|
@@ -397,6 +398,159 @@ export declare const en: {
|
|
|
397
398
|
readonly micMuted: "Mic muted";
|
|
398
399
|
readonly agentWorking: "{{name}} is working…";
|
|
399
400
|
};
|
|
401
|
+
readonly connectors: {
|
|
402
|
+
readonly viewTitle: "Connectors";
|
|
403
|
+
readonly subtitle: "Connect services so {{product}} can access and act on your data";
|
|
404
|
+
readonly searchPlaceholder: "Search your connectors";
|
|
405
|
+
readonly loading: "Loading your connectors…";
|
|
406
|
+
readonly loadError: "Couldn't load your connectors.";
|
|
407
|
+
readonly unavailable: "Connecting your own apps isn't turned on here.";
|
|
408
|
+
readonly noResults: "No connectors match “{{q}}”.";
|
|
409
|
+
readonly empty: "No connected apps yet.";
|
|
410
|
+
readonly emptyHint: "Connect your tools so the agent can use them in your tasks.";
|
|
411
|
+
readonly add: "Add connector";
|
|
412
|
+
readonly actionsMenu: "Connector actions";
|
|
413
|
+
readonly edit: "Edit";
|
|
414
|
+
readonly refresh: "Refresh";
|
|
415
|
+
readonly refreshing: "Refreshing…";
|
|
416
|
+
readonly turnOn: "Turn on";
|
|
417
|
+
readonly turnOff: "Turn off";
|
|
418
|
+
readonly delete: "Delete";
|
|
419
|
+
readonly close: "Close";
|
|
420
|
+
readonly cancel: "Cancel";
|
|
421
|
+
readonly toolsCount_one: "{{count}} tool";
|
|
422
|
+
readonly toolsCount_other: "{{count}} tools";
|
|
423
|
+
readonly statusConnected: "Connected";
|
|
424
|
+
readonly needsAttention: "Needs attention";
|
|
425
|
+
readonly statusError: "Couldn't connect";
|
|
426
|
+
readonly statusOff: "Off";
|
|
427
|
+
readonly enabledLabel: "Available to the agent";
|
|
428
|
+
readonly addTitle: "Add custom connector";
|
|
429
|
+
readonly addDescription: "Connect {{product}} to external apps.";
|
|
430
|
+
readonly editTitle: "Edit connector";
|
|
431
|
+
readonly nameLabel: "Name";
|
|
432
|
+
readonly namePlaceholder: "My App";
|
|
433
|
+
readonly descriptionLabel: "Description (optional)";
|
|
434
|
+
readonly descriptionPlaceholder: "A brief description of your connector";
|
|
435
|
+
readonly emojiLabel: "Icon (optional)";
|
|
436
|
+
readonly emojiPlaceholder: "🔗";
|
|
437
|
+
readonly urlLabel: "MCP server URL";
|
|
438
|
+
readonly urlPlaceholder: "https://example.com/mcp";
|
|
439
|
+
readonly urlHint: "From the app's own setup page. This can't be changed later.";
|
|
440
|
+
readonly urlFixed: "The address can't be changed. Add a new connector to point somewhere else.";
|
|
441
|
+
readonly advanced: "Advanced";
|
|
442
|
+
readonly authLabel: "Authentication";
|
|
443
|
+
readonly authNone: "No authentication";
|
|
444
|
+
readonly authOAuth: "Sign in through the app";
|
|
445
|
+
readonly authBearer: "Access token";
|
|
446
|
+
readonly authHeaders: "Custom headers";
|
|
447
|
+
readonly authClientCredentials: "Service credentials";
|
|
448
|
+
readonly oauthHint: "You'll sign in on the app's own page. Nothing to type here.";
|
|
449
|
+
readonly oauthAppCredentials: "I was given app credentials";
|
|
450
|
+
readonly oauthAppCredentialsHint: "Only if the app asked you to register it and gave you an ID. Most apps don't.";
|
|
451
|
+
readonly oauthClientId: "Client ID";
|
|
452
|
+
readonly oauthClientSecret: "Client Secret";
|
|
453
|
+
readonly oauthScope: "Permissions (optional)";
|
|
454
|
+
readonly oauthScopePlaceholder: "read write";
|
|
455
|
+
readonly oauthScopeHint: "Only if the app told you exactly what to ask for. Separate them with spaces.";
|
|
456
|
+
readonly oauthParams: "Extra settings (optional)";
|
|
457
|
+
readonly oauthParamsHint: "Only if the app's setup page told you to add them.";
|
|
458
|
+
readonly oauthParamNamePlaceholder: "Setting";
|
|
459
|
+
readonly oauthParamValuePlaceholder: "Value";
|
|
460
|
+
readonly addOAuthParam: "Add setting";
|
|
461
|
+
readonly removeOAuthParam: "Remove setting";
|
|
462
|
+
readonly ccHint: "Use the ID and secret the app issued. You won't be asked to sign in.";
|
|
463
|
+
readonly ccTokenEndpoint: "Token URL (optional)";
|
|
464
|
+
readonly ccTokenEndpointPlaceholder: "https://example.com/token";
|
|
465
|
+
readonly ccTokenEndpointHint: "Only if the app gave you one. Otherwise we find it from the address above.";
|
|
466
|
+
readonly ccNeedsCredentials: "This app stopped accepting the saved credentials. Edit this connector and enter them again.";
|
|
467
|
+
readonly transportLabel: "Transport";
|
|
468
|
+
readonly transportStreamableHttp: "Streamable HTTP";
|
|
469
|
+
readonly transportSse: "SSE";
|
|
470
|
+
readonly connect: "Connect";
|
|
471
|
+
readonly connectStarting: "Opening the app…";
|
|
472
|
+
readonly connectWaiting: "Waiting for you to finish signing in…";
|
|
473
|
+
readonly connectPopupBlocked: "Your browser blocked the sign-in window.";
|
|
474
|
+
readonly connectOpenManually: "Open the sign-in page";
|
|
475
|
+
readonly tokenLabel: "Access token";
|
|
476
|
+
readonly tokenPlaceholder: "Paste the token from the app";
|
|
477
|
+
readonly headerNamePlaceholder: "Header";
|
|
478
|
+
readonly headerValuePlaceholder: "Value";
|
|
479
|
+
readonly addHeader: "Add header";
|
|
480
|
+
readonly removeHeader: "Remove header";
|
|
481
|
+
readonly replaceCredentials: "Replace credentials";
|
|
482
|
+
readonly replaceCredentialsHint: "Saved credentials are never shown again. Enter them to replace them.";
|
|
483
|
+
readonly risk: "I understand custom connectors can introduce risks.";
|
|
484
|
+
readonly riskDetail: "{{product}} can't verify this app or guarantee answer quality, so only use connectors from sources you trust.";
|
|
485
|
+
readonly submitAdd: "Add";
|
|
486
|
+
readonly submitAdding: "Adding…";
|
|
487
|
+
readonly submitSave: "Save changes";
|
|
488
|
+
readonly submitSaving: "Saving…";
|
|
489
|
+
readonly toolsTitle: "Tools";
|
|
490
|
+
readonly toolsEmpty: "This app didn't offer any tools.";
|
|
491
|
+
readonly toolToggle: "Use {{tool}}";
|
|
492
|
+
readonly refusedTitle_one: "One tool was skipped";
|
|
493
|
+
readonly refusedTitle_other: "{{count}} tools were skipped";
|
|
494
|
+
readonly errorNameEmpty: "Give this connector a name.";
|
|
495
|
+
readonly errorNameTooLong: "That name is too long.";
|
|
496
|
+
readonly errorDescriptionTooLong: "That description is too long.";
|
|
497
|
+
readonly errorEmojiTooLong: "Use a single emoji.";
|
|
498
|
+
readonly errorUrlEmpty: "Add the MCP server URL.";
|
|
499
|
+
readonly errorUrlInvalid: "That doesn't look like a web address — it should start with https://.";
|
|
500
|
+
readonly errorUrlTooLong: "That address is too long.";
|
|
501
|
+
readonly errorTokenEmpty: "Paste the access token.";
|
|
502
|
+
readonly errorHeaderNameEmpty: "Name every header you filled in.";
|
|
503
|
+
readonly errorHeaderNameInvalid: "“{{name}}” isn't a valid header name — use letters, numbers and dashes.";
|
|
504
|
+
readonly errorHeaderNameDuplicate: "“{{name}}” is listed twice.";
|
|
505
|
+
readonly errorHeaderValueNewline: "The value for “{{name}}” can't contain line breaks.";
|
|
506
|
+
readonly errorHeaderRowsExceeded: "You can add up to {{maxCount}} headers.";
|
|
507
|
+
readonly errorOAuthClientIdMissing: "Add the Client ID that goes with that secret.";
|
|
508
|
+
readonly errorOAuthClientIdTooLong: "That Client ID is too long.";
|
|
509
|
+
readonly errorOAuthClientSecretTooLong: "That Client Secret is too long.";
|
|
510
|
+
readonly errorOAuthScopeInvalid: "Use single spaces between permissions, and no quotes.";
|
|
511
|
+
readonly errorOAuthScopeTooLong: "That list of permissions is too long.";
|
|
512
|
+
readonly errorOAuthParamNameEmpty: "Name every setting you filled in.";
|
|
513
|
+
readonly errorOAuthParamNameInvalid: "“{{name}}” isn't a valid setting name — use lowercase letters, numbers and underscores.";
|
|
514
|
+
readonly errorOAuthParamNameReserved: "“{{name}}” is used by the sign-in itself — pick another name.";
|
|
515
|
+
readonly errorOAuthParamNameDuplicate: "“{{name}}” is listed twice.";
|
|
516
|
+
readonly errorOAuthParamValueNewline: "The value for “{{name}}” can't contain line breaks.";
|
|
517
|
+
readonly errorOAuthParamValueTooLong: "The value for “{{name}}” is too long.";
|
|
518
|
+
readonly errorOAuthParamsExceeded: "You can add up to {{maxCount}} settings.";
|
|
519
|
+
readonly errorCcClientIdMissing: "Add the Client ID the app gave you.";
|
|
520
|
+
readonly errorCcClientSecretMissing: "Add the Client Secret the app gave you.";
|
|
521
|
+
readonly errorCcTokenEndpointInvalid: "That doesn't look like a web address — it should start with https://.";
|
|
522
|
+
readonly errorCcTokenEndpointTooLong: "That address is too long.";
|
|
523
|
+
readonly errorOAuthNotReplaceable: "To sign in again, use Connect on the connector itself.";
|
|
524
|
+
readonly errorNameTaken: "You already have a connector whose tools are named “{{alias}}”. Pick another name.";
|
|
525
|
+
readonly errorInvalidName: "That name can't be used — include some letters or numbers.";
|
|
526
|
+
readonly errorLimitReached: "You've reached the limit of {{maxCount}} connectors. Remove one to add another.";
|
|
527
|
+
readonly errorUrlBlocked: "That address can't be used.";
|
|
528
|
+
readonly errorToolBudget: "That app offers more tools than there's room for.";
|
|
529
|
+
readonly errorDiscoveryUnreachable: "We couldn't reach that address.";
|
|
530
|
+
readonly errorDiscoveryTimeout: "The server took too long to answer.";
|
|
531
|
+
readonly errorDiscoveryProtocol: "That address doesn't speak the connector protocol.";
|
|
532
|
+
readonly errorDiscoveryUnauthorized: "The app refused the credentials this connector uses. Update them and try again.";
|
|
533
|
+
readonly errorDiscoveryDrifted: "That app's tools changed while we were reading them — try again.";
|
|
534
|
+
readonly errorNeedsAuth: "This connector has to be reconnected before it can refresh.";
|
|
535
|
+
readonly errorCredentialsUnreadable: "We can't read the saved credentials any more — enter them again.";
|
|
536
|
+
readonly errorForbidden: "You don't have permission to change connectors here.";
|
|
537
|
+
readonly errorUnavailable: "Connectors aren't available right now.";
|
|
538
|
+
readonly errorSaveFailed: "Couldn't save — try again.";
|
|
539
|
+
readonly errorRefreshFailed: "Couldn't refresh — try again.";
|
|
540
|
+
readonly errorGone: "That connector is no longer there.";
|
|
541
|
+
readonly errorWrongAuthMode: "This connector doesn't sign in — it already has its credentials.";
|
|
542
|
+
readonly errorOAuthDiscovery: "That app doesn't offer a sign-in we can use.";
|
|
543
|
+
readonly errorOAuthNoApp: "That app needs credentials before it can sign you in. Add them and try again.";
|
|
544
|
+
readonly errorOAuthUnavailable: "Signing in through an app isn't set up here.";
|
|
545
|
+
readonly errorOAuthAbandoned: "The sign-in window closed before it finished.";
|
|
546
|
+
readonly errorOAuthTimedOut: "The sign-in took too long. Try again.";
|
|
547
|
+
readonly errorOAuthFailed: "Couldn't start the sign-in — try again.";
|
|
548
|
+
readonly errorOAuthUnsupported: "This app doesn't offer a sign-in service here. Paste the Token URL from the app's setup page.";
|
|
549
|
+
readonly errorOAuthTokenFailed: "The app refused those credentials.";
|
|
550
|
+
readonly deleteConfirmTitle: "Delete {{name}}?";
|
|
551
|
+
readonly deleteConfirmBody: "The agent will lose access to its tools. This can't be undone.";
|
|
552
|
+
readonly deleteConfirm: "Delete connector";
|
|
553
|
+
};
|
|
400
554
|
readonly app: {
|
|
401
555
|
readonly uploadNoWorkspace: "Open the terminal once so your workspace exists, then upload.";
|
|
402
556
|
readonly uploadTooLarge: "{{name}} is too large (max 25 MB).";
|