@jini-ai/mcp 0.7.3-next.1 → 0.7.3-next.3
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/CHANGELOG.md +8 -0
- package/README.md +15 -0
- package/dist/agent-install/owned-json-install.d.ts +1 -1
- package/dist/client/client.js +1 -1
- package/dist/client/css-url-refs.d.ts +3 -1
- package/dist/client/css-url-refs.js +1 -1
- package/dist/external/access-review.d.ts +46 -0
- package/dist/external/access-review.js +175 -0
- package/dist/external/agent-tools.d.ts +72 -0
- package/dist/external/agent-tools.js +218 -0
- package/dist/external/built-in-connections.d.ts +17 -0
- package/dist/external/built-in-connections.js +15 -0
- package/dist/external/external-mcp-host-copy.d.ts +14 -0
- package/dist/external/external-mcp-host-copy.js +8 -0
- package/dist/external/operations-tools.d.ts +69 -0
- package/dist/external/operations-tools.js +96 -0
- package/dist/external/save-form.d.ts +105 -0
- package/dist/external/save-form.js +260 -0
- package/dist/external/save-input.d.ts +41 -0
- package/dist/external/save-input.js +149 -0
- package/dist/external/tool-registrations.d.ts +130 -0
- package/dist/external/tool-registrations.js +299 -0
- package/dist/federation/bootstrap.d.ts +18 -0
- package/dist/federation/bootstrap.js +2 -2
- package/dist/federation/external-mcp-admissions.d.ts +19 -0
- package/dist/federation/external-mcp-admissions.js +30 -0
- package/dist/federation/external-mcp-probe.d.ts +86 -0
- package/dist/federation/external-mcp-probe.js +75 -0
- package/dist/federation/hosted/external-mcp-repo.d.ts +108 -0
- package/dist/federation/hosted/external-mcp-repo.js +210 -0
- package/dist/federation/hosted/external-mcp-repo.writes.d.ts +75 -0
- package/dist/federation/hosted/external-mcp-repo.writes.js +131 -0
- package/dist/federation/hosted/store-credentials.d.ts +6 -1
- package/dist/federation/hosted/store-credentials.js +2 -2
- package/dist/federation/hosted/store-input.d.ts +11 -3
- package/dist/federation/hosted/store-input.js +5 -5
- package/dist/federation/hosted/store-oauth-fields.d.ts +10 -2
- package/dist/federation/hosted/store-oauth-fields.js +7 -7
- package/dist/federation/hosted/store-view.d.ts +6 -1
- package/dist/federation/hosted/store-view.js +2 -2
- package/dist/federation/hosted/store.js +7 -7
- package/dist/federation/hosted/store.memory.d.ts +2 -0
- package/dist/federation/hosted/store.memory.js +6 -2
- package/dist/federation/index.d.ts +2 -0
- package/dist/federation/index.js +2 -0
- package/dist/federation/registrations.js +73 -56
- package/dist/federation/roster-change.d.ts +63 -0
- package/dist/federation/roster-change.js +68 -0
- package/dist/federation/runtime.d.ts +140 -0
- package/dist/federation/runtime.js +118 -0
- package/dist/react/external-mcp/ExternalMcpAdmissionsBanner.d.ts +42 -0
- package/dist/react/external-mcp/ExternalMcpAdmissionsBanner.js +80 -0
- package/dist/react/external-mcp/ExternalMcpPanelSections.d.ts +50 -0
- package/dist/react/external-mcp/ExternalMcpPanelSections.js +35 -0
- package/dist/react/external-mcp/ExternalMcpSettingsPanel.d.ts +446 -0
- package/dist/react/external-mcp/ExternalMcpSettingsPanel.hooks.d.ts +135 -0
- package/dist/react/external-mcp/ExternalMcpSettingsPanel.hooks.js +122 -0
- package/dist/react/external-mcp/ExternalMcpSettingsPanel.js +63 -0
- package/dist/react/external-mcp/ExternalMcpSourceRow.d.ts +40 -0
- package/dist/react/external-mcp/ExternalMcpSourceRow.js +100 -0
- package/dist/react/external-mcp/hooks/external-mcp-form.rules.d.ts +58 -0
- package/dist/react/external-mcp/hooks/external-mcp-form.rules.js +209 -0
- package/dist/react/external-mcp/hooks/external-mcp-source-actions.d.ts +115 -0
- package/dist/react/external-mcp/hooks/external-mcp-source-actions.js +152 -0
- package/dist/react/external-mcp/hooks/use-external-mcp-admissions.hooks.d.ts +166 -0
- package/dist/react/external-mcp/hooks/use-external-mcp-admissions.hooks.js +209 -0
- package/dist/react/external-mcp/hooks/use-external-mcp.hooks.d.ts +132 -0
- package/dist/react/external-mcp/hooks/use-external-mcp.hooks.js +37 -0
- package/dist/server/tool-arguments.d.ts +5 -1
- package/dist/server/tool-arguments.js +13 -9
- package/dist/server/tool-protocol.js +7 -5
- package/dist/server/tools/tool-catalog-tools.js +6 -3
- package/dist/tools/ask-choice/custom-answer.d.ts +77 -0
- package/dist/tools/ask-choice/custom-answer.js +113 -0
- package/dist/tools/ask-choice/index.d.ts +2 -0
- package/dist/tools/ask-choice/index.js +1 -0
- package/package.json +122 -7
|
@@ -0,0 +1,446 @@
|
|
|
1
|
+
import { type ComponentType, type ComponentProps, type RefObject } from "react";
|
|
2
|
+
import type { AdminToolRefusalReason } from "@jini-ai/core/contracts/hosted-mcp";
|
|
3
|
+
import type { Translate } from "@jini-ai/core/text";
|
|
4
|
+
import { type useSavedAllowedToolNamesById } from "./ExternalMcpSettingsPanel.hooks.js";
|
|
5
|
+
import { ExternalMcpAdmissionsBanner } from "./ExternalMcpAdmissionsBanner.js";
|
|
6
|
+
export interface ExternalMcpSettingsPanelProps {
|
|
7
|
+
dependencies: {
|
|
8
|
+
port: {
|
|
9
|
+
fetchSources: () => Promise<SourceConfigItem[]>;
|
|
10
|
+
addSource: (input: {
|
|
11
|
+
fields: Record<string, string>;
|
|
12
|
+
trust?: string;
|
|
13
|
+
}) => Promise<{
|
|
14
|
+
ok: boolean;
|
|
15
|
+
source?: SourceConfigItem;
|
|
16
|
+
message?: string;
|
|
17
|
+
}>;
|
|
18
|
+
removeSource: (id: string) => Promise<boolean>;
|
|
19
|
+
updateSource?: (id: string, patch: {
|
|
20
|
+
label?: string;
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
fields?: Record<string, string>;
|
|
23
|
+
}) => Promise<SourceConfigItem | null>;
|
|
24
|
+
testSource?: (id: string | undefined, draft?: Record<string, string>) => Promise<{
|
|
25
|
+
ok: boolean;
|
|
26
|
+
message?: string;
|
|
27
|
+
latencyMs?: number;
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
saveStatusLabel?: string | undefined;
|
|
32
|
+
showTitle?: boolean;
|
|
33
|
+
hooks: {
|
|
34
|
+
useTHook: () => Translate;
|
|
35
|
+
useExternalMcpDriftCopyHook: () => Translate;
|
|
36
|
+
useWiredSourceConfigListHook: (required: {
|
|
37
|
+
dependencies: ExternalMcpSettingsPanelProps["dependencies"];
|
|
38
|
+
}) => {
|
|
39
|
+
sources: SourceConfigItem[];
|
|
40
|
+
loading: boolean;
|
|
41
|
+
error: string | null;
|
|
42
|
+
capabilities: {
|
|
43
|
+
canRefresh: boolean;
|
|
44
|
+
canSetTrust: boolean;
|
|
45
|
+
canTest: boolean;
|
|
46
|
+
canUpdate: boolean;
|
|
47
|
+
};
|
|
48
|
+
testResults: Record<string, {
|
|
49
|
+
ok: boolean;
|
|
50
|
+
message?: string;
|
|
51
|
+
latencyMs?: number;
|
|
52
|
+
}>;
|
|
53
|
+
isPending: (id: string, kind: "add" | "remove" | "refresh" | "trust" | "test" | "update") => boolean;
|
|
54
|
+
reload: () => Promise<void>;
|
|
55
|
+
addSourceToList: (source: SourceConfigItem) => void;
|
|
56
|
+
remove: (id: string) => Promise<void>;
|
|
57
|
+
refresh: (id: string) => Promise<void>;
|
|
58
|
+
setTrust: (id: string, trust: string) => Promise<void>;
|
|
59
|
+
test: (id: string | undefined, draft?: Record<string, string>) => Promise<void>;
|
|
60
|
+
update: (id: string, patch: {
|
|
61
|
+
label?: string;
|
|
62
|
+
enabled?: boolean;
|
|
63
|
+
fields?: Record<string, string>;
|
|
64
|
+
}) => Promise<void>;
|
|
65
|
+
};
|
|
66
|
+
useExternalMcpAddFormHook: (required: {
|
|
67
|
+
dependencies: ExternalMcpSettingsPanelProps["dependencies"];
|
|
68
|
+
list: ReturnType<ExternalMcpSettingsPanelProps["hooks"]["useWiredSourceConfigListHook"]>;
|
|
69
|
+
}) => {
|
|
70
|
+
formOpen: boolean;
|
|
71
|
+
toggleForm: () => void;
|
|
72
|
+
cancelForm: () => void;
|
|
73
|
+
fieldSpecs: SourceFieldSpec[];
|
|
74
|
+
addForm: {
|
|
75
|
+
values: Record<string, string>;
|
|
76
|
+
validation: {
|
|
77
|
+
ok: boolean;
|
|
78
|
+
issues: {
|
|
79
|
+
field: string;
|
|
80
|
+
message: string;
|
|
81
|
+
}[];
|
|
82
|
+
};
|
|
83
|
+
submitAttempted: boolean;
|
|
84
|
+
submitting: boolean;
|
|
85
|
+
submitError: string | null;
|
|
86
|
+
setField: (key: string, value: string) => void;
|
|
87
|
+
submit: () => Promise<void>;
|
|
88
|
+
reset: () => void;
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
useSavedAllowedToolNamesByIdHook: typeof useSavedAllowedToolNamesById;
|
|
92
|
+
useExternalMcpAdmissionsHook: (saved: ReturnType<typeof useSavedAllowedToolNamesById<SourceConfigItem, "stdio" | "streamable_http">>) => ComponentProps<typeof ExternalMcpAdmissionsBanner<AdmissionDriftConnection>>["controller"];
|
|
93
|
+
useKitT: () => Translate;
|
|
94
|
+
useFocusTrap: (required: {
|
|
95
|
+
containerRef: RefObject<HTMLElement | null>;
|
|
96
|
+
}, optional?: {
|
|
97
|
+
active?: boolean;
|
|
98
|
+
}) => void;
|
|
99
|
+
useExternalMcpToolsModalEscape: (required: {
|
|
100
|
+
onClose: () => void;
|
|
101
|
+
useFocusTrapHook: ExternalMcpSettingsPanelProps["hooks"]["useFocusTrap"];
|
|
102
|
+
}, optional?: Record<string, never>) => {
|
|
103
|
+
dialogRef: RefObject<HTMLDivElement | null>;
|
|
104
|
+
closeRef: RefObject<HTMLButtonElement | null>;
|
|
105
|
+
};
|
|
106
|
+
useExternalMcpRemoveConfirm: <TCopy>(required: {
|
|
107
|
+
name: string;
|
|
108
|
+
isOAuth: boolean;
|
|
109
|
+
onCancel: () => void;
|
|
110
|
+
t?: Translate;
|
|
111
|
+
buildCopy: (required: {
|
|
112
|
+
name: string;
|
|
113
|
+
isOAuth: boolean;
|
|
114
|
+
}, optional: {
|
|
115
|
+
t?: Translate;
|
|
116
|
+
}) => TCopy;
|
|
117
|
+
useFocusTrapHook: ExternalMcpSettingsPanelProps["hooks"]["useFocusTrap"];
|
|
118
|
+
}) => {
|
|
119
|
+
copy: TCopy;
|
|
120
|
+
dialogRef: RefObject<HTMLDivElement | null>;
|
|
121
|
+
};
|
|
122
|
+
useHostExternalMcpSharedChoice: (required: {
|
|
123
|
+
serverId: string;
|
|
124
|
+
onChanged: () => void;
|
|
125
|
+
}) => {
|
|
126
|
+
view: {
|
|
127
|
+
available: boolean;
|
|
128
|
+
connections: {
|
|
129
|
+
credentialId: string;
|
|
130
|
+
label: string;
|
|
131
|
+
}[];
|
|
132
|
+
current: {
|
|
133
|
+
credentialId: string;
|
|
134
|
+
status: string;
|
|
135
|
+
granted: boolean;
|
|
136
|
+
} | null;
|
|
137
|
+
} | undefined;
|
|
138
|
+
error: string;
|
|
139
|
+
pending: boolean;
|
|
140
|
+
load: () => Promise<void>;
|
|
141
|
+
chooseSaved: (required: {
|
|
142
|
+
credentialId: string;
|
|
143
|
+
}, optional?: Record<string, never>) => Promise<void>;
|
|
144
|
+
stopHere: () => Promise<void>;
|
|
145
|
+
chooseLocal: () => Promise<void>;
|
|
146
|
+
};
|
|
147
|
+
useConnect: (required: {
|
|
148
|
+
serverId: string;
|
|
149
|
+
grant: string;
|
|
150
|
+
onConnected: () => void;
|
|
151
|
+
}, optional: {
|
|
152
|
+
fallbackError: string;
|
|
153
|
+
}) => {
|
|
154
|
+
state: {
|
|
155
|
+
phase: "idle";
|
|
156
|
+
error?: string;
|
|
157
|
+
} | {
|
|
158
|
+
phase: "starting";
|
|
159
|
+
} | {
|
|
160
|
+
phase: "waiting";
|
|
161
|
+
} | {
|
|
162
|
+
phase: "device";
|
|
163
|
+
userCode: string;
|
|
164
|
+
verificationUri: string;
|
|
165
|
+
};
|
|
166
|
+
connect: (optional?: {
|
|
167
|
+
destination?: "shared";
|
|
168
|
+
}) => Promise<void>;
|
|
169
|
+
cancel: () => void;
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
kit: {
|
|
173
|
+
Icon: ComponentType<{
|
|
174
|
+
name: "plus";
|
|
175
|
+
size: number;
|
|
176
|
+
}>;
|
|
177
|
+
InfoTip: ComponentType<{
|
|
178
|
+
label: string;
|
|
179
|
+
triggerLabel: string;
|
|
180
|
+
agentHandle: string;
|
|
181
|
+
}>;
|
|
182
|
+
SourceConfigAddForm: ComponentType<{
|
|
183
|
+
fieldSpecs: SourceFieldSpec[];
|
|
184
|
+
values: Record<string, string>;
|
|
185
|
+
validation: {
|
|
186
|
+
ok: boolean;
|
|
187
|
+
issues: {
|
|
188
|
+
field: string;
|
|
189
|
+
message: string;
|
|
190
|
+
}[];
|
|
191
|
+
};
|
|
192
|
+
submitAttempted: boolean;
|
|
193
|
+
submitting: boolean;
|
|
194
|
+
submitError?: string;
|
|
195
|
+
onFieldChange: (key: string, value: string) => void;
|
|
196
|
+
onSubmit: () => void;
|
|
197
|
+
canTest: boolean;
|
|
198
|
+
testing: boolean;
|
|
199
|
+
testResult?: {
|
|
200
|
+
ok: boolean;
|
|
201
|
+
message?: string;
|
|
202
|
+
latencyMs?: number;
|
|
203
|
+
};
|
|
204
|
+
onTest: () => void;
|
|
205
|
+
addLabel: string;
|
|
206
|
+
agentHandle: string;
|
|
207
|
+
onCancel: () => void;
|
|
208
|
+
}>;
|
|
209
|
+
SourceConfigItemCard: ComponentType<{
|
|
210
|
+
source: SourceConfigItem;
|
|
211
|
+
agentHandle: string;
|
|
212
|
+
fieldSpecs: SourceFieldSpec[];
|
|
213
|
+
capabilities: ReturnType<ExternalMcpSettingsPanelProps["hooks"]["useWiredSourceConfigListHook"]>["capabilities"];
|
|
214
|
+
removing: boolean;
|
|
215
|
+
refreshing: boolean;
|
|
216
|
+
settingTrust: boolean;
|
|
217
|
+
testing: boolean;
|
|
218
|
+
updating: boolean;
|
|
219
|
+
onRefresh: () => void;
|
|
220
|
+
onRemove: () => void;
|
|
221
|
+
onTest: () => void;
|
|
222
|
+
onUpdate: (patch: {
|
|
223
|
+
label?: string;
|
|
224
|
+
enabled?: boolean;
|
|
225
|
+
fields?: Record<string, string>;
|
|
226
|
+
}) => void;
|
|
227
|
+
testResult?: {
|
|
228
|
+
ok: boolean;
|
|
229
|
+
message?: string;
|
|
230
|
+
latencyMs?: number;
|
|
231
|
+
};
|
|
232
|
+
}>;
|
|
233
|
+
ExternalMcpSharedChoice: ComponentType<{
|
|
234
|
+
serverId: string;
|
|
235
|
+
busy: boolean;
|
|
236
|
+
signIn: () => void;
|
|
237
|
+
onChanged: () => void;
|
|
238
|
+
t: Translate;
|
|
239
|
+
useExternalMcpSharedChoiceHook: ExternalMcpSettingsPanelProps["hooks"]["useHostExternalMcpSharedChoice"];
|
|
240
|
+
}>;
|
|
241
|
+
ExternalMcpToolsModal: ComponentType<{
|
|
242
|
+
name: string;
|
|
243
|
+
cardHandle: string;
|
|
244
|
+
onClose: () => void;
|
|
245
|
+
serverId: string;
|
|
246
|
+
connectionEnabled: boolean;
|
|
247
|
+
allowedToolNames: string | undefined;
|
|
248
|
+
writeAllowedToolNames: string | undefined;
|
|
249
|
+
saving: boolean;
|
|
250
|
+
onSave: (fields: {
|
|
251
|
+
allowedToolNames: string;
|
|
252
|
+
writeAllowedToolNames: string;
|
|
253
|
+
}) => void;
|
|
254
|
+
useExternalMcpToolsModalEscapeHook: ExternalMcpSettingsPanelProps["hooks"]["useExternalMcpToolsModalEscape"];
|
|
255
|
+
useTHook: () => Translate;
|
|
256
|
+
useExternalMcpDriftCopyHook: () => Translate;
|
|
257
|
+
pickerCollaborators: ExternalMcpSettingsPanelProps["deps"]["pickerCollaborators"];
|
|
258
|
+
}>;
|
|
259
|
+
ExternalMcpRemoveConfirmDialog: ComponentType<{
|
|
260
|
+
name: string;
|
|
261
|
+
isOAuth: boolean;
|
|
262
|
+
cardHandle: string;
|
|
263
|
+
onConfirm: () => void;
|
|
264
|
+
onCancel: () => void;
|
|
265
|
+
t: Translate;
|
|
266
|
+
ConfirmDialog: ExternalMcpSettingsPanelProps["kit"]["ConfirmActionDialog"];
|
|
267
|
+
buildCopy: ExternalMcpSettingsPanelProps["deps"]["buildExternalMcpRemoveConfirmCopy"];
|
|
268
|
+
useExternalMcpRemoveConfirmHook: ExternalMcpSettingsPanelProps["hooks"]["useExternalMcpRemoveConfirm"];
|
|
269
|
+
useFocusTrapHook: ExternalMcpSettingsPanelProps["hooks"]["useFocusTrap"];
|
|
270
|
+
}>;
|
|
271
|
+
ConfirmActionDialog: ComponentType<{
|
|
272
|
+
dialogRef: RefObject<HTMLDivElement | null>;
|
|
273
|
+
titleId: string;
|
|
274
|
+
title: string;
|
|
275
|
+
body: string;
|
|
276
|
+
onCancel: () => void;
|
|
277
|
+
onConfirm: () => void;
|
|
278
|
+
cancelText: string;
|
|
279
|
+
confirmText: string;
|
|
280
|
+
cancelHandle: string;
|
|
281
|
+
cancelAgentLabel: string;
|
|
282
|
+
confirmHandle: string;
|
|
283
|
+
confirmAgentLabel: string;
|
|
284
|
+
}>;
|
|
285
|
+
};
|
|
286
|
+
deps: {
|
|
287
|
+
buildExternalMcpCardHandles: (required: {
|
|
288
|
+
sourceIds: string[];
|
|
289
|
+
}) => string[];
|
|
290
|
+
buildExternalMcpFieldSpecs: (fields: Record<string, string>, optional: {
|
|
291
|
+
t: Translate;
|
|
292
|
+
}) => SourceFieldSpec[];
|
|
293
|
+
sourceDisplayLabel: (required: {
|
|
294
|
+
source: SourceConfigItem;
|
|
295
|
+
fieldSpecs: SourceFieldSpec[];
|
|
296
|
+
}) => string;
|
|
297
|
+
isBuiltInExternalMcpSource: (required: {
|
|
298
|
+
source: SourceConfigItem;
|
|
299
|
+
}) => boolean;
|
|
300
|
+
externalMcpNeedsSignIn: (required: {
|
|
301
|
+
source: SourceConfigItem;
|
|
302
|
+
}) => boolean;
|
|
303
|
+
resolveExternalMcpEffectiveTransport: (fields: Record<string, string>) => "stdio" | "streamable_http";
|
|
304
|
+
resolveExternalMcpEffectiveAuthMode: (fields: Record<string, string>) => "none" | "static_env" | "oauth";
|
|
305
|
+
parseSavedToolNames: (required: {
|
|
306
|
+
value: string | undefined;
|
|
307
|
+
}) => string[];
|
|
308
|
+
grantWriteFieldValue: (required: {
|
|
309
|
+
currentWriteAllowedToolNames: string | undefined;
|
|
310
|
+
remoteName: string;
|
|
311
|
+
}) => string;
|
|
312
|
+
buildExternalMcpRemoveConfirmCopy: (required: {
|
|
313
|
+
name: string;
|
|
314
|
+
isOAuth: boolean;
|
|
315
|
+
}, optional: {
|
|
316
|
+
t?: Translate;
|
|
317
|
+
}) => {
|
|
318
|
+
title: string;
|
|
319
|
+
body: string;
|
|
320
|
+
};
|
|
321
|
+
describeDriftHeadline: (required: {
|
|
322
|
+
connections: readonly AdmissionDriftConnection[];
|
|
323
|
+
copy: ExternalMcpSettingsPanelProps["deps"]["driftCopy"];
|
|
324
|
+
}) => string;
|
|
325
|
+
driftCopy: {
|
|
326
|
+
readonly refusal: Readonly<Record<Exclude<AdminToolRefusalReason, "not-in-operator-allowlist">, {
|
|
327
|
+
kind: AdmissionDriftKind;
|
|
328
|
+
key: string;
|
|
329
|
+
}>>;
|
|
330
|
+
readonly refusedFallback: string;
|
|
331
|
+
readonly notOffered: string;
|
|
332
|
+
readonly inertWriteGrant: string;
|
|
333
|
+
readonly stillLive: string;
|
|
334
|
+
readonly notRunning: string;
|
|
335
|
+
readonly disabledButRunning: string;
|
|
336
|
+
readonly removedButStillRunning: string;
|
|
337
|
+
readonly decryptFailed: string;
|
|
338
|
+
readonly failedToStart: string;
|
|
339
|
+
readonly launcherMissing: string;
|
|
340
|
+
readonly restartHeadline: string;
|
|
341
|
+
readonly noRestartHeadline: string;
|
|
342
|
+
readonly needsSignIn: string;
|
|
343
|
+
};
|
|
344
|
+
pickerCollaborators: {
|
|
345
|
+
useExternalMcpDriftCopyHook: () => Translate;
|
|
346
|
+
useTHook: () => Translate;
|
|
347
|
+
productVars: Readonly<{
|
|
348
|
+
productName: string;
|
|
349
|
+
}>;
|
|
350
|
+
useWiredExternalMcpToolPickerHook: (required: {
|
|
351
|
+
serverId: string;
|
|
352
|
+
active: boolean;
|
|
353
|
+
allowedToolNames: string | undefined;
|
|
354
|
+
writeAllowedToolNames: string | undefined;
|
|
355
|
+
t: Translate;
|
|
356
|
+
}) => {
|
|
357
|
+
readonly loading: boolean;
|
|
358
|
+
readonly refreshing: boolean;
|
|
359
|
+
readonly unreachable: string | null;
|
|
360
|
+
readonly rows: readonly ToolPickerRow[];
|
|
361
|
+
readonly advertisedCount: number;
|
|
362
|
+
readonly enabledCount: number;
|
|
363
|
+
readonly dirty: boolean;
|
|
364
|
+
setEnabled: (remoteName: string, enabled: boolean) => void;
|
|
365
|
+
setMayWrite: (remoteName: string, mayWrite: boolean) => void;
|
|
366
|
+
reset: () => void;
|
|
367
|
+
refresh: () => void;
|
|
368
|
+
fieldValues: () => {
|
|
369
|
+
allowedToolNames: string;
|
|
370
|
+
writeAllowedToolNames: string;
|
|
371
|
+
};
|
|
372
|
+
};
|
|
373
|
+
useToolRowHandlesHook: (required: {
|
|
374
|
+
base: string;
|
|
375
|
+
rows: readonly ToolPickerRow[];
|
|
376
|
+
}, optional?: Record<string, never>) => string[];
|
|
377
|
+
useToolPickerFilterHook: (rows: readonly ToolPickerRow[], deps: {
|
|
378
|
+
handles: readonly string[];
|
|
379
|
+
base: string;
|
|
380
|
+
setEnabled: (remoteName: string, enabled: boolean) => void;
|
|
381
|
+
}) => {
|
|
382
|
+
query: string;
|
|
383
|
+
setQuery: (query: string) => void;
|
|
384
|
+
visible: {
|
|
385
|
+
row: ToolPickerRow;
|
|
386
|
+
handle: string;
|
|
387
|
+
}[];
|
|
388
|
+
canSelectAll: boolean;
|
|
389
|
+
canSelectNone: boolean;
|
|
390
|
+
selectVisible: (enabled: boolean) => void;
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
EXTERNAL_MCP_PRODUCT_VARS: {
|
|
394
|
+
productName: string;
|
|
395
|
+
};
|
|
396
|
+
EXTERNAL_MCP_ADD_FORM_HANDLE: string;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
type AdmissionDriftKind = "needs-write-grant" | "destructive" | "not-offered" | "inert-write-grant" | "server-side-defect" | "still-live-after-removal" | "not-running" | "disabled-but-running" | "removed-but-still-running" | "decrypt-failed" | "failed-to-start" | "missing-launcher" | "needs-sign-in";
|
|
400
|
+
type AdmissionDriftConnection = {
|
|
401
|
+
readonly connectionId: string;
|
|
402
|
+
readonly notLoaded: readonly string[];
|
|
403
|
+
readonly liveToolCount: number;
|
|
404
|
+
readonly savedToolCount: number;
|
|
405
|
+
readonly entries: readonly {
|
|
406
|
+
readonly connectionId: string;
|
|
407
|
+
readonly remoteName: string | null;
|
|
408
|
+
readonly kind: AdmissionDriftKind;
|
|
409
|
+
readonly messageKey: string;
|
|
410
|
+
readonly messageVars: Readonly<Record<string, string>>;
|
|
411
|
+
}[];
|
|
412
|
+
};
|
|
413
|
+
type ToolPickerRow = {
|
|
414
|
+
readonly remoteName: string;
|
|
415
|
+
readonly description: string;
|
|
416
|
+
readonly enabled: boolean;
|
|
417
|
+
readonly mayWrite: boolean;
|
|
418
|
+
readonly writeDeclared: boolean;
|
|
419
|
+
readonly destructiveDeclared: boolean;
|
|
420
|
+
readonly hintsAbsent: boolean;
|
|
421
|
+
readonly kind: "advertised" | "absent";
|
|
422
|
+
};
|
|
423
|
+
type SourceConfigItem = {
|
|
424
|
+
id: string;
|
|
425
|
+
label?: string;
|
|
426
|
+
trust?: string;
|
|
427
|
+
enabled?: boolean;
|
|
428
|
+
fields: Record<string, string>;
|
|
429
|
+
status?: "idle" | "testing" | "connected" | "error";
|
|
430
|
+
statusMessage?: string;
|
|
431
|
+
};
|
|
432
|
+
type SourceFieldSpec = {
|
|
433
|
+
key: string;
|
|
434
|
+
label: string;
|
|
435
|
+
kind: "text" | "url" | "password" | "select" | "textarea" | "secret-textarea";
|
|
436
|
+
placeholder?: string;
|
|
437
|
+
required?: boolean;
|
|
438
|
+
options?: {
|
|
439
|
+
value: string;
|
|
440
|
+
label: string;
|
|
441
|
+
}[];
|
|
442
|
+
};
|
|
443
|
+
export declare function ExternalMcpSettingsPanel({ dependencies, saveStatusLabel, showTitle, hooks, kit, deps }: ExternalMcpSettingsPanelProps, _optional?: {}): import("react").JSX.Element;
|
|
444
|
+
export declare function bindExternalMcpSettingsPanel({ hooks, kit, deps }: Pick<ExternalMcpSettingsPanelProps, "hooks" | "kit" | "deps">, _optional?: {}): (props: Omit<ExternalMcpSettingsPanelProps, "hooks" | "kit" | "deps">, _optional?: {}) => import("react").JSX.Element;
|
|
445
|
+
export {};
|
|
446
|
+
//# sourceMappingURL=ExternalMcpSettingsPanel.d.ts.map
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Translate } from "@jini-ai/core/text";
|
|
2
|
+
type SourceConfigItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
fields: Record<string, string>;
|
|
6
|
+
};
|
|
7
|
+
type SavedConnectionIntent<Transport extends string> = {
|
|
8
|
+
allowedToolNames: string;
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
transport: Transport;
|
|
11
|
+
command: string;
|
|
12
|
+
needsSignIn: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @file `ExternalMcpSettingsPanel.tsx`'s own derived-value logic, split out per the
|
|
16
|
+
* `<Name>.tsx`/`<Name>.hooks.tsx` pattern `TabBar.tsx`/`TabBar.hooks.tsx` establishes (admin
|
|
17
|
+
* TSX-logic-sweep, 2026-09-05) — this repo's rule that a `.tsx` file carries no functions or derived
|
|
18
|
+
* logic of its own.
|
|
19
|
+
*/
|
|
20
|
+
/** `ExternalMcpSettingsPanel`'s own per-card agent handles. Not `useMemo`'d: an O(n) pass (see
|
|
21
|
+
* `buildAgentListHandles`'s own `@complexity` doc, which `buildExternalMcpCardHandles` wraps) over
|
|
22
|
+
* one workspace's own configured external MCP servers — small and cheap enough next to the render
|
|
23
|
+
* it feeds that memoizing it was not judged worth the added indirection. That is a decision about
|
|
24
|
+
* memoization, separate from why this now lives outside the component body at all (the
|
|
25
|
+
* `.tsx` bodies carry no derived logic). */
|
|
26
|
+
export declare function resolveExternalMcpCardHandles({ sources, buildHandles }: {
|
|
27
|
+
sources: readonly SourceConfigItem[];
|
|
28
|
+
buildHandles: (required: {
|
|
29
|
+
sourceIds: string[];
|
|
30
|
+
}) => string[];
|
|
31
|
+
}, _optional?: Record<string, never>): string[];
|
|
32
|
+
/** Each card's saved intent, keyed by server id — the "saved" half of the saved-vs-live comparison
|
|
33
|
+
* the admissions banner states. Memoized because it is the dependency of a `useMemo` inside
|
|
34
|
+
* `useExternalMcpAdmissions`: rebuilding the object every render would make that memo useless.
|
|
35
|
+
*
|
|
36
|
+
* `enabled` joined `allowedToolNames` here for ADM-001 (2026-09-07): the banner now reports a saved
|
|
37
|
+
* connection the daemon is not running, and without the toggle it would report every server the
|
|
38
|
+
* operator deliberately switched off as a fault. `SourceConfigItem.enabled` is optional in
|
|
39
|
+
* `@jini-ai/ui`'s type; `toItem` in `use-external-mcp.hooks.ts` always sets it from the stored
|
|
40
|
+
* record, so `?? true` only ever covers a source that came from somewhere else — and "on" is the
|
|
41
|
+
* right reading of a missing flag, since a card with no toggle state is not one the operator
|
|
42
|
+
* turned off. Saved transport/command identify missing stdio launchers; the existing transport
|
|
43
|
+
* rule also supplies the legacy stdio default for cards without an explicit transport. */
|
|
44
|
+
export declare function useSavedAllowedToolNamesById<Source extends SourceConfigItem, Transport extends string>({ sources, resolveTransport, needsSignIn }: {
|
|
45
|
+
sources: readonly Source[];
|
|
46
|
+
resolveTransport: (fields: Record<string, string>) => Transport;
|
|
47
|
+
needsSignIn: (required: {
|
|
48
|
+
source: Source;
|
|
49
|
+
}) => boolean;
|
|
50
|
+
}, _optional?: Record<string, never>): Record<string, SavedConnectionIntent<Transport>>;
|
|
51
|
+
export declare function useExternalMcpDriftCopy({ useLocaleHook, translate }: {
|
|
52
|
+
useLocaleHook: () => string;
|
|
53
|
+
translate: (required: {
|
|
54
|
+
locale: string;
|
|
55
|
+
key: string;
|
|
56
|
+
}) => string;
|
|
57
|
+
}, _optional?: Record<string, never>): Translate;
|
|
58
|
+
/**
|
|
59
|
+
* The banner's one-click fix, as the panel's `updateSource` patch.
|
|
60
|
+
*
|
|
61
|
+
* Written through the SAME port the card's own edit form uses, so `mergeSourceUpdate` fills in
|
|
62
|
+
* every field this patch does not mention and `toWriteBody`'s omit-when-blank rules keep `env` and
|
|
63
|
+
* `oauthClientSecret` from being wiped — the asymmetry `use-external-mcp.hooks.ts`'s header calls
|
|
64
|
+
* the safe direction. Reaching for `api.saveExternalMcpServer` directly here would bypass both.
|
|
65
|
+
*
|
|
66
|
+
* @returns The patch, or `null` when the id names no configured card (nothing to write).
|
|
67
|
+
*/
|
|
68
|
+
export declare function buildAllowWritePatch({ sources, connectionId, remoteName, grantWriteFieldValue }: {
|
|
69
|
+
sources: readonly SourceConfigItem[];
|
|
70
|
+
connectionId: string;
|
|
71
|
+
remoteName: string;
|
|
72
|
+
grantWriteFieldValue: (required: {
|
|
73
|
+
currentWriteAllowedToolNames: string | undefined;
|
|
74
|
+
remoteName: string;
|
|
75
|
+
}) => string;
|
|
76
|
+
}, _options?: {}): {
|
|
77
|
+
fields: Record<string, string>;
|
|
78
|
+
} | null;
|
|
79
|
+
/** Everything `ExternalMcpSettingsPanel` renders its "Add server" button and form from. */
|
|
80
|
+
export interface ExternalMcpAddFormController<FieldSpec, AddForm> {
|
|
81
|
+
/** Whether the add form is showing (the "Add server" button's `aria-expanded`). */
|
|
82
|
+
formOpen: boolean;
|
|
83
|
+
/** "Add server": opens a closed form, closes an open one (without discarding the draft). */
|
|
84
|
+
toggleForm: () => void;
|
|
85
|
+
/** Cancel: discards the draft, not just hides it — reopening must not resurrect a half-typed
|
|
86
|
+
* server (or a typed secret) the operator chose to abandon — then closes the form. */
|
|
87
|
+
cancelForm: () => void;
|
|
88
|
+
/** The field specs for the draft's last-known transport/auth mode — one render behind a change,
|
|
89
|
+
* per `ExternalMcpSettingsPanel.tsx`'s "two-pass reactive field-spec sync" header. */
|
|
90
|
+
fieldSpecs: FieldSpec[];
|
|
91
|
+
/** `@jini-ai/ui`'s add-form controller (values, validation, submit, reset), seeded from
|
|
92
|
+
* {@link fieldSpecs}. */
|
|
93
|
+
addForm: AddForm;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Owns `ExternalMcpSettingsPanel`'s "Add server" form: its open state, the draft, and the lagged
|
|
97
|
+
* transport/auth-mode sync that keeps the form's field specs following the operator's own choices
|
|
98
|
+
* (see `ExternalMcpSettingsPanel.tsx`'s "two-pass reactive field-spec sync" header for why the sync
|
|
99
|
+
* is one render behind, by design).
|
|
100
|
+
*
|
|
101
|
+
* `fieldSpecs` is deliberately rebuilt every render (not `useMemo`'d), exactly as it was when this
|
|
102
|
+
* lived in the component body — this move changes where the logic lives, not how often it runs.
|
|
103
|
+
*
|
|
104
|
+
* @param input.dependencies - The same source-config port the panel's list uses.
|
|
105
|
+
* @param input.list - Receives a newly added server (`addSourceToList`), so the roster shows it
|
|
106
|
+
* without a reload.
|
|
107
|
+
* @returns See {@link ExternalMcpAddFormController}.
|
|
108
|
+
* @complexity O(1) per render beyond `buildExternalMcpFieldSpecs`'s fixed-size spec list.
|
|
109
|
+
*/
|
|
110
|
+
export declare function useExternalMcpAddForm<Source, Dependencies, FieldSpec, AddForm extends {
|
|
111
|
+
values: Record<string, string>;
|
|
112
|
+
setField: (name: string, value: string) => void;
|
|
113
|
+
reset: () => void;
|
|
114
|
+
}>({ dependencies, list, useDriftCopyHook, useSourceConfigAddFormHook, buildFieldSpecs, resolveTransport, resolveAuthMode }: {
|
|
115
|
+
dependencies: Dependencies;
|
|
116
|
+
list: {
|
|
117
|
+
addSourceToList: (source: Source) => void;
|
|
118
|
+
};
|
|
119
|
+
useDriftCopyHook: () => Translate;
|
|
120
|
+
useSourceConfigAddFormHook: (required: {
|
|
121
|
+
dependencies: Dependencies;
|
|
122
|
+
fieldSpecs: FieldSpec[];
|
|
123
|
+
onAdded: (source: Source) => void;
|
|
124
|
+
}) => AddForm;
|
|
125
|
+
buildFieldSpecs: (required: {
|
|
126
|
+
transport: string;
|
|
127
|
+
authMode: string;
|
|
128
|
+
}, optional: {
|
|
129
|
+
t: Translate;
|
|
130
|
+
}) => FieldSpec[];
|
|
131
|
+
resolveTransport: (fields: Record<string, string>) => string;
|
|
132
|
+
resolveAuthMode: (fields: Record<string, string>) => string;
|
|
133
|
+
}, _optional?: Record<string, never>): ExternalMcpAddFormController<FieldSpec, AddForm>;
|
|
134
|
+
export {};
|
|
135
|
+
//# sourceMappingURL=ExternalMcpSettingsPanel.hooks.d.ts.map
|