@belonguniverseai/react-sdk 0.6.6 → 0.6.8
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 +886 -2
- package/dist/api/connectors.d.ts +448 -0
- package/dist/api/query-keys.d.ts +9 -0
- package/dist/component/{abnfDiagram-N423BO3Z-C6FcPK3d.js → abnfDiagram-N423BO3Z-DAMVrmeh.js} +4 -4
- package/dist/component/{arc-BFUQjzCS.js → arc-Gc-Ug7JA.js} +2 -2
- package/dist/component/{architectureDiagram-T3A2C74G-BDBrDBki.js → architectureDiagram-T3A2C74G-DEETzZJN.js} +3 -3
- package/dist/component/{blockDiagram-VBNYF7ZC-UZV4Vc3P.js → blockDiagram-VBNYF7ZC-B63eqqq8.js} +4 -4
- package/dist/component/{c4Diagram-5PPSVZJV-CCPtctjO.js → c4Diagram-5PPSVZJV-B1BOYc8g.js} +3 -3
- package/dist/component/{channel-CIUveBDa.js → channel-PLzmp3cE.js} +2 -2
- package/dist/component/{chunk-2GRJ4B5K-CRCj56HD.js → chunk-2GRJ4B5K-B6eq3oGl.js} +2 -2
- package/dist/component/{chunk-2Q5K7J3B-CL0yogzL.js → chunk-2Q5K7J3B-B7muvlHI.js} +2 -2
- package/dist/component/{chunk-5RXB4S5H-Blwl04-V.js → chunk-5RXB4S5H-DwKu1vp-.js} +5 -5
- package/dist/component/{chunk-5VM5RSS4-C497fKeV.js → chunk-5VM5RSS4-DfsJf4Z4.js} +2 -2
- package/dist/component/{chunk-6Q2QTUOP-C_2Jk1ii.js → chunk-6Q2QTUOP-CeaiyGYA.js} +2 -2
- package/dist/component/{chunk-GF5L2VYU-Cs_Nhfpw.js → chunk-GF5L2VYU-CNmM7mNX.js} +6 -6
- package/dist/component/{chunk-JWPE2WC7-Dcs41Q_n.js → chunk-JWPE2WC7-BzOJ0gSs.js} +2 -2
- package/dist/component/{chunk-KBJHAD2P-BWm1frM-.js → chunk-KBJHAD2P-B_0sEXXZ.js} +2 -2
- package/dist/component/{chunk-RYQCIY6F-XA_jesTk.js → chunk-RYQCIY6F-CzrE1hmt.js} +2 -2
- package/dist/component/{chunk-XXDRQBXY-BDtOkxP3.js → chunk-XXDRQBXY-BUnNxHRd.js} +2 -2
- package/dist/component/{classDiagram-JCYQIIEL-CvZflq4I.js → classDiagram-JCYQIIEL-9VG4K9gL.js} +3 -3
- package/dist/component/{classDiagram-v2-OCEON4UE-CvZflq4I.js → classDiagram-v2-OCEON4UE-9VG4K9gL.js} +3 -3
- package/dist/component/{cose-bilkent-JH36ORCC-C1arfbyI.js → cose-bilkent-JH36ORCC-_cCdJsPR.js} +2 -2
- package/dist/component/{cynefinDiagram-MW4NZA55-CS5V8R4P.js → cynefinDiagram-MW4NZA55-DrosRrWG.js} +3 -3
- package/dist/component/{dagre-VZM6K2ZE-BZ6hBjLx.js → dagre-VZM6K2ZE-DVXWVoHI.js} +3 -3
- package/dist/component/{diagram-7IWD3JNH-sP7Tm4Ov.js → diagram-7IWD3JNH-BvdLH-gr.js} +4 -4
- package/dist/component/{diagram-B4RE2ZJO-BNGAdSWl.js → diagram-B4RE2ZJO-yq2kxzf4.js} +3 -3
- package/dist/component/{diagram-LBJQPF4R-FUyO9neA.js → diagram-LBJQPF4R-DjZj7wKC.js} +3 -3
- package/dist/component/{diagram-Q27KOJAE-j_dqjRdo.js → diagram-Q27KOJAE-DjV3mMFp.js} +4 -4
- package/dist/component/{diagram-UB23O5K3-C9DPA3Ub.js → diagram-UB23O5K3-DG73tqIa.js} +3 -3
- package/dist/component/{ebnfDiagram-BXEA7PRR-D33P9__e.js → ebnfDiagram-BXEA7PRR-TI3Mi84Z.js} +4 -4
- package/dist/component/{erDiagram-JOGREHBK-DOB0CdMC.js → erDiagram-JOGREHBK-p28VOtOG.js} +5 -5
- package/dist/component/{flowDiagram-UKHOOZJN-Byd1bpG0.js → flowDiagram-UKHOOZJN-DptddxZK.js} +7 -7
- package/dist/component/{ganttDiagram-PKOTCBZU-DYe8BZEh.js → ganttDiagram-PKOTCBZU-CPBYUclk.js} +3 -3
- package/dist/component/{gitGraphDiagram-DS77QQ5N-XZ8Mo4GA.js → gitGraphDiagram-DS77QQ5N-DDJEly11.js} +4 -4
- package/dist/component/{highlighted-body-OFNGDK62-CL31TQjN.js → highlighted-body-OFNGDK62-DmArOVtb.js} +2 -2
- package/dist/component/index.js +2 -2
- package/dist/component/{infoDiagram-6WML65LV-CKFHlOyG.js → infoDiagram-6WML65LV-fa5NoEep.js} +2 -2
- package/dist/component/{ishikawaDiagram-WSZJBQD7-DcYs6_Ks.js → ishikawaDiagram-WSZJBQD7-D19tW2EN.js} +2 -2
- package/dist/component/{journeyDiagram-NVQOT4AX-BdL6QUhp.js → journeyDiagram-NVQOT4AX-BMjN5JId.js} +5 -5
- package/dist/component/{kanban-definition-27J2QSJJ-BXSCmJV1.js → kanban-definition-27J2QSJJ-DpEZoYj2.js} +3 -3
- package/dist/component/{linear-CKjHF2HZ.js → linear-BlZm6_oy.js} +2 -2
- package/dist/component/{mermaid-GHXKKRXX-DkoZohjm.js → mermaid-GHXKKRXX-p-OyUfKz.js} +41095 -37516
- package/dist/component/{mindmap-definition-FAOFIHXS-DW4hhNZQ.js → mindmap-definition-FAOFIHXS-CZooOHo7.js} +4 -4
- package/dist/component/{pegDiagram-VL7TDLO6-Bi-Kyrnt.js → pegDiagram-VL7TDLO6-BgsgvnUj.js} +4 -4
- package/dist/component/{pieDiagram-7S7Q4E2Y-BMhIZVGK.js → pieDiagram-7S7Q4E2Y-BMc5yYJ4.js} +4 -4
- package/dist/component/{quadrantDiagram-CIZ2JOQS-bceN8tX9.js → quadrantDiagram-CIZ2JOQS-2w1cEVRE.js} +3 -3
- package/dist/component/{railroadDiagram-AXF67PYL-D-nJshKI.js → railroadDiagram-AXF67PYL-DoiX2thq.js} +4 -4
- package/dist/component/{requirementDiagram-LRYGKXZP-CYZUa3OC.js → requirementDiagram-LRYGKXZP-CTB2STpc.js} +4 -4
- package/dist/component/{sankeyDiagram-W5VNT64P-BGB3WZee.js → sankeyDiagram-W5VNT64P-9xxjcZWi.js} +2 -2
- package/dist/component/{sequenceDiagram-SI44F4Z6-C1vZr0MI.js → sequenceDiagram-SI44F4Z6-mkS0lJ2i.js} +4 -4
- package/dist/component/{sizeCapture-X5ZJPWSS-RlcsaXgG.js → sizeCapture-X5ZJPWSS-BoQhOM5q.js} +2 -2
- package/dist/component/{stateDiagram-OKZ733FA-fvMUXvo7.js → stateDiagram-OKZ733FA-BC9-EQhL.js} +3 -3
- package/dist/component/{stateDiagram-v2-UEYNNEHI-C5wIei7D.js → stateDiagram-v2-UEYNNEHI-DtIgdpQz.js} +3 -3
- package/dist/component/{swimlanes-SLNWSIFB-C3hQy7qq.js → swimlanes-SLNWSIFB-Dt29sUod.js} +4 -4
- package/dist/component/{swimlanesDiagram-ULZ7WXOC-ByZ1cbCX.js → swimlanesDiagram-ULZ7WXOC-XhpcM99S.js} +3 -3
- package/dist/component/{timeline-definition-Z64GVDOM-D0_tzWD4.js → timeline-definition-Z64GVDOM-BaSPNtp7.js} +3 -3
- package/dist/component/{vennDiagram-T6HMQDX7-C9YEUDaF.js → vennDiagram-T6HMQDX7-DEh8MevO.js} +2 -2
- package/dist/component/{wardleyDiagram-T6FBY63Y-CXHDuHLt.js → wardleyDiagram-T6FBY63Y-DAL7SU3o.js} +3 -3
- package/dist/component/{xychartDiagram-ELKLHX3M-n_ilatMg.js → xychartDiagram-ELKLHX3M-Cde-mFmr.js} +3 -3
- package/dist/components/connectors/ConfirmDeleteConnectorDialog.d.ts +16 -0
- package/dist/components/connectors/ConnectorAuthFields.d.ts +18 -0
- package/dist/components/connectors/ConnectorAvatar.d.ts +14 -0
- package/dist/components/connectors/ConnectorDetailsDialog.d.ts +8 -0
- package/dist/components/connectors/ConnectorMarketplaceDialog.d.ts +9 -0
- package/dist/components/connectors/ConnectorNoticeLine.d.ts +5 -0
- package/dist/components/connectors/ConnectorsListSurface.d.ts +37 -0
- package/dist/components/connectors/NewConnectorDialog.d.ts +10 -0
- package/dist/components/connectors/connector-copy.d.ts +37 -0
- package/dist/components/connectors/connector-form.d.ts +299 -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/components/embed/save-prompt-name.d.ts +20 -7
- package/dist/embed/dock-state.d.ts +1 -1
- package/dist/i18n/messages/en.d.ts +195 -0
- package/dist/i18n/messages/surfaces/connectors.d.ts +635 -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,299 @@
|
|
|
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
|
+
/** The probe found no dynamic registration endpoint. Only matters when the
|
|
91
|
+
* user overrides the token-first suggestion and chooses sign-in. */
|
|
92
|
+
readonly signInNeedsClientId: boolean;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* What is wrong with the draft. A discriminated union rather than a message
|
|
96
|
+
* string so the copy lives in the i18n catalog and this module stays
|
|
97
|
+
* translatable — and so a new rule mechanically fails every `match` on it.
|
|
98
|
+
*/
|
|
99
|
+
export type ConnectorFormProblem = {
|
|
100
|
+
readonly kind: "name_empty";
|
|
101
|
+
} | {
|
|
102
|
+
readonly kind: "name_too_long";
|
|
103
|
+
} | {
|
|
104
|
+
readonly kind: "description_too_long";
|
|
105
|
+
} | {
|
|
106
|
+
readonly kind: "emoji_too_long";
|
|
107
|
+
} | {
|
|
108
|
+
readonly kind: "url_empty";
|
|
109
|
+
} | {
|
|
110
|
+
readonly kind: "url_too_long";
|
|
111
|
+
}
|
|
112
|
+
/** Not a URL at all, or a scheme we could never dispatch (`file:`, `javascript:`). */
|
|
113
|
+
| {
|
|
114
|
+
readonly kind: "url_invalid";
|
|
115
|
+
} | {
|
|
116
|
+
readonly kind: "token_empty";
|
|
117
|
+
}
|
|
118
|
+
/** A row with a value typed but no header name. */
|
|
119
|
+
| {
|
|
120
|
+
readonly kind: "header_name_empty";
|
|
121
|
+
} | {
|
|
122
|
+
readonly kind: "header_name_invalid";
|
|
123
|
+
readonly name: string;
|
|
124
|
+
} | {
|
|
125
|
+
readonly kind: "header_name_duplicate";
|
|
126
|
+
readonly name: string;
|
|
127
|
+
} | {
|
|
128
|
+
readonly kind: "header_value_newline";
|
|
129
|
+
readonly name: string;
|
|
130
|
+
} | {
|
|
131
|
+
readonly kind: "header_rows_exceeded";
|
|
132
|
+
readonly maxCount: number;
|
|
133
|
+
}
|
|
134
|
+
/** A secret typed with no id. Both blank is fine; a secret alone is a paste
|
|
135
|
+
* that went wrong, and the server refuses it too. */
|
|
136
|
+
| {
|
|
137
|
+
readonly kind: "oauth_client_id_missing";
|
|
138
|
+
}
|
|
139
|
+
/** Sign-in cannot start because this provider will not dynamically register
|
|
140
|
+
* Belong and the draft carries no already-registered app id. */
|
|
141
|
+
| {
|
|
142
|
+
readonly kind: "oauth_client_id_required";
|
|
143
|
+
} | {
|
|
144
|
+
readonly kind: "oauth_client_id_too_long";
|
|
145
|
+
} | {
|
|
146
|
+
readonly kind: "oauth_client_secret_too_long";
|
|
147
|
+
}
|
|
148
|
+
/** Not a permissions line the app could be asked for — a stray quote, a tab,
|
|
149
|
+
* or two spaces where one word was meant. */
|
|
150
|
+
| {
|
|
151
|
+
readonly kind: "oauth_scope_invalid";
|
|
152
|
+
} | {
|
|
153
|
+
readonly kind: "oauth_scope_too_long";
|
|
154
|
+
}
|
|
155
|
+
/** A setting with a value typed but no name. */
|
|
156
|
+
| {
|
|
157
|
+
readonly kind: "oauth_param_name_empty";
|
|
158
|
+
} | {
|
|
159
|
+
readonly kind: "oauth_param_name_invalid";
|
|
160
|
+
readonly name: string;
|
|
161
|
+
}
|
|
162
|
+
/** A name the sign-in address already uses for something of its own. */
|
|
163
|
+
| {
|
|
164
|
+
readonly kind: "oauth_param_name_reserved";
|
|
165
|
+
readonly name: string;
|
|
166
|
+
} | {
|
|
167
|
+
readonly kind: "oauth_param_name_duplicate";
|
|
168
|
+
readonly name: string;
|
|
169
|
+
} | {
|
|
170
|
+
readonly kind: "oauth_param_value_newline";
|
|
171
|
+
readonly name: string;
|
|
172
|
+
} | {
|
|
173
|
+
readonly kind: "oauth_param_value_too_long";
|
|
174
|
+
readonly name: string;
|
|
175
|
+
} | {
|
|
176
|
+
readonly kind: "oauth_params_exceeded";
|
|
177
|
+
readonly maxCount: number;
|
|
178
|
+
}
|
|
179
|
+
/** The service credential's two required halves. Unlike the sign-in mode's,
|
|
180
|
+
* these ARE the credential, so neither may be left blank. */
|
|
181
|
+
| {
|
|
182
|
+
readonly kind: "cc_client_id_missing";
|
|
183
|
+
} | {
|
|
184
|
+
readonly kind: "cc_client_id_too_long";
|
|
185
|
+
} | {
|
|
186
|
+
readonly kind: "cc_client_secret_missing";
|
|
187
|
+
} | {
|
|
188
|
+
readonly kind: "cc_client_secret_too_long";
|
|
189
|
+
} | {
|
|
190
|
+
readonly kind: "cc_token_endpoint_invalid";
|
|
191
|
+
} | {
|
|
192
|
+
readonly kind: "cc_token_endpoint_too_long";
|
|
193
|
+
}
|
|
194
|
+
/** Re-signing in is the Connect action, not a field on the edit form. */
|
|
195
|
+
| {
|
|
196
|
+
readonly kind: "oauth_not_replaceable";
|
|
197
|
+
};
|
|
198
|
+
/** The normalized payload a valid draft submits — trimmed, with blank header
|
|
199
|
+
* rows dropped and the emoji omitted (not empty-stringed) when unset. */
|
|
200
|
+
export type ConnectorFormValues = {
|
|
201
|
+
readonly name: string;
|
|
202
|
+
readonly description: string;
|
|
203
|
+
readonly emoji?: string;
|
|
204
|
+
readonly serverUrl: string;
|
|
205
|
+
readonly transport: ConnectorTransport;
|
|
206
|
+
readonly auth: ConnectorAuthInput;
|
|
207
|
+
};
|
|
208
|
+
export type ConnectorFormValidation = {
|
|
209
|
+
readonly kind: "ok";
|
|
210
|
+
readonly values: ConnectorFormValues;
|
|
211
|
+
} | {
|
|
212
|
+
readonly kind: "invalid";
|
|
213
|
+
readonly problem: ConnectorFormProblem;
|
|
214
|
+
};
|
|
215
|
+
/** The auth half's own verdict, for the CREATE form (OAuth included). */
|
|
216
|
+
export type ConnectorAuthValidation = {
|
|
217
|
+
readonly kind: "ok";
|
|
218
|
+
readonly value: ConnectorAuthInput;
|
|
219
|
+
} | {
|
|
220
|
+
readonly kind: "invalid";
|
|
221
|
+
readonly problem: ConnectorFormProblem;
|
|
222
|
+
};
|
|
223
|
+
/** The narrower verdict the EDIT dialog needs — a credential it can replace. */
|
|
224
|
+
export type ConnectorCredentialValidation = {
|
|
225
|
+
readonly kind: "ok";
|
|
226
|
+
readonly value: ConnectorCredentialInput;
|
|
227
|
+
} | {
|
|
228
|
+
readonly kind: "invalid";
|
|
229
|
+
readonly problem: ConnectorFormProblem;
|
|
230
|
+
};
|
|
231
|
+
/**
|
|
232
|
+
* The server's ORIGIN, for showing a user which host they pointed at without
|
|
233
|
+
* echoing a path or query back (either can carry a token). Falls back to the
|
|
234
|
+
* raw string when it does not parse — a value we cannot read is still a value
|
|
235
|
+
* the user typed and may need to recognise.
|
|
236
|
+
*/
|
|
237
|
+
export declare const connectorServerOrigin: (serverUrl: string) => string;
|
|
238
|
+
/**
|
|
239
|
+
* Is this address worth ASKING about yet? True only for something that would
|
|
240
|
+
* survive the form's own url check, so a half-typed `https://a` never becomes
|
|
241
|
+
* a request — the probe fires on a paste, and a request per keystroke would be
|
|
242
|
+
* a request per keystroke to somebody else's server.
|
|
243
|
+
*/
|
|
244
|
+
export declare const isProbableConnectorUrl: (serverUrl: string) => boolean;
|
|
245
|
+
/**
|
|
246
|
+
* The credential form a probed address should OPEN on.
|
|
247
|
+
*
|
|
248
|
+
* Deliberately returns a BLANK draft of the suggested mode rather than one
|
|
249
|
+
* pre-filled from discovery. The two values discovery could hand over — a
|
|
250
|
+
* client id and a scope line — are exactly the two the server re-derives on
|
|
251
|
+
* its own at sign-in time (`connector-oauth.ts` prefers the row's pinned scope
|
|
252
|
+
* and falls back to the server's), so writing them into the form would pin
|
|
253
|
+
* today's answer to a row that outlives it, in a field the user did not type.
|
|
254
|
+
*
|
|
255
|
+
* A suggestion is a STARTING POINT: the caller applies it only while the user
|
|
256
|
+
* has not chosen a mode themselves, and the Advanced select stays the override.
|
|
257
|
+
*/
|
|
258
|
+
export declare const authDraftForSuggestion: (suggestion: {
|
|
259
|
+
readonly mode: "none";
|
|
260
|
+
} | {
|
|
261
|
+
readonly mode: "oauth";
|
|
262
|
+
readonly registration: "dynamic" | "client_id_required";
|
|
263
|
+
readonly authorizationServerOrigin: string;
|
|
264
|
+
} | {
|
|
265
|
+
readonly mode: "bearer";
|
|
266
|
+
}) => ConnectorAuthDraft;
|
|
267
|
+
/**
|
|
268
|
+
* Does the suggested credential need the user to TYPE something before Add can
|
|
269
|
+
* work? That is the question Advanced's fold answers wrongly by default: a
|
|
270
|
+
* pasted token and a provider-console client id both live behind it, and a
|
|
271
|
+
* folded field the form is waiting on reads as a form that refuses to submit
|
|
272
|
+
* for no reason.
|
|
273
|
+
*/
|
|
274
|
+
export declare const suggestionNeedsInput: (suggestion: {
|
|
275
|
+
readonly mode: "none";
|
|
276
|
+
} | {
|
|
277
|
+
readonly mode: "oauth";
|
|
278
|
+
readonly registration: "dynamic" | "client_id_required";
|
|
279
|
+
} | {
|
|
280
|
+
readonly mode: "bearer";
|
|
281
|
+
}) => boolean;
|
|
282
|
+
/** Validate the auth half alone. Accepts every mode the CREATE form offers. */
|
|
283
|
+
export declare const validateConnectorAuth: (auth: ConnectorAuthDraft) => ConnectorAuthValidation;
|
|
284
|
+
/**
|
|
285
|
+
* Validate a credential the EDIT dialog can actually replace.
|
|
286
|
+
*
|
|
287
|
+
* `oauth` is refused rather than accepted-and-ignored: re-signing in is the
|
|
288
|
+
* Connect action, and a save button that silently did nothing would be worse
|
|
289
|
+
* than a sentence saying where the control is. The edit dialog does not offer
|
|
290
|
+
* the mode, so this is the belt to that braces — and it keeps the patch's type
|
|
291
|
+
* honest instead of widening it to a shape the server refuses.
|
|
292
|
+
*
|
|
293
|
+
* A SERVICE credential passes, and has to: an app that stopped honouring an id
|
|
294
|
+
* and secret has no window to send anyone to, so typing the new pair here is
|
|
295
|
+
* the whole recovery.
|
|
296
|
+
*/
|
|
297
|
+
export declare const validateConnectorCredential: (auth: ConnectorAuthDraft) => ConnectorCredentialValidation;
|
|
298
|
+
/** Validate the whole add-a-connector form. */
|
|
299
|
+
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;
|
|
@@ -3,14 +3,19 @@
|
|
|
3
3
|
* `schedule-dialog-model.ts` uses: every rule lives here, the component holds
|
|
4
4
|
* none of the branching.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Three jobs. `slugifyPromptName` turns whatever the user types into the
|
|
7
7
|
* lowercase slug the server accepts (rejecting instead would punish anyone who
|
|
8
|
-
* types a normal title). `
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
8
|
+
* types a normal title). `slugifyPromptNameWhileTyping` is its per-keystroke
|
|
9
|
+
* sibling: identical except it KEEPS a trailing dash, because a controlled
|
|
10
|
+
* input that re-runs the canonical slugify on every keystroke deletes the `-`
|
|
11
|
+
* the user just typed ("recon-" → "recon") — which made a hyphenated name like
|
|
12
|
+
* `recon-overview` impossible to TYPE even though pasting it worked.
|
|
13
|
+
* `validatePromptName` answers the ticket's open save-time UX question: a name
|
|
14
|
+
* already owned by a builtin, a tenant skill, a workspace command, or another
|
|
15
|
+
* saved prompt is BLOCKED and the reason NAMES which one — because the client
|
|
16
|
+
* merge resolves precedence by dropping the shadowed prompt, so saving one
|
|
17
|
+
* would produce a prompt that never appears in `/`. That reads as data loss,
|
|
18
|
+
* and the user has no way to discover it.
|
|
14
19
|
*/
|
|
15
20
|
/** Server bound — `pre-prompt.schemas.ts`'s `MAX_PRE_PROMPT_NAME_CHARS`. */
|
|
16
21
|
export declare const MAX_PROMPT_NAME_CHARS = 64;
|
|
@@ -19,6 +24,14 @@ export declare const MAX_PROMPT_NAME_CHARS = 64;
|
|
|
19
24
|
* the server's ceiling (then re-trim, since the cut can land on a dash).
|
|
20
25
|
*/
|
|
21
26
|
export declare const slugifyPromptName: (raw: string) => string;
|
|
27
|
+
/**
|
|
28
|
+
* The per-keystroke transform for the controlled name inputs: same pipeline as
|
|
29
|
+
* `slugifyPromptName` but the trailing dash SURVIVES, so the `-` the user just
|
|
30
|
+
* typed is still there when the next letter lands. Dialogs validate and submit
|
|
31
|
+
* the canonical `slugifyPromptName` of the field, so the kept dash never
|
|
32
|
+
* reaches the server.
|
|
33
|
+
*/
|
|
34
|
+
export declare const slugifyPromptNameWhileTyping: (raw: string) => string;
|
|
22
35
|
/** Which kind of existing entry already owns a name the user typed. */
|
|
23
36
|
export type PromptNameOwner = "builtin" | "skill" | "command" | "prompt";
|
|
24
37
|
type PromptNameValidation = {
|
|
@@ -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;
|