@xrkseek/harness-cli 0.0.2 → 0.0.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/README.md +5 -0
- package/dist/commands/restart.d.ts +3 -0
- package/dist/commands/restart.d.ts.map +1 -0
- package/dist/commands/restart.js +32 -0
- package/dist/commands/restart.js.map +1 -0
- package/dist/commands/serve.d.ts.map +1 -1
- package/dist/commands/serve.js +19 -11
- package/dist/commands/serve.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/log.d.ts +19 -0
- package/dist/log.d.ts.map +1 -0
- package/dist/log.js +52 -0
- package/dist/log.js.map +1 -0
- package/dist/parse-args.d.ts +5 -1
- package/dist/parse-args.d.ts.map +1 -1
- package/dist/parse-args.js +33 -1
- package/dist/parse-args.js.map +1 -1
- package/dist/port.d.ts +9 -0
- package/dist/port.d.ts.map +1 -0
- package/dist/port.js +86 -0
- package/dist/port.js.map +1 -0
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts +2 -0
- package/node_modules/@xrkseek/core-agent/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent/dist/index.js +3 -0
- package/node_modules/@xrkseek/core-agent/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts +5 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js +3 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts +5 -0
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js +22 -2
- package/node_modules/@xrkseek/core-agent-loop/dist/settle-batch.js.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.d.ts.map +1 -1
- package/node_modules/@xrkseek/core-session/dist/compaction.js.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts +4 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-shell/dist/index.js +18 -2
- package/node_modules/@xrkseek/exec-shell/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts +5 -2
- package/node_modules/@xrkseek/exec-web/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/index.js +5 -2
- package/node_modules/@xrkseek/exec-web/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/search-duckduckgo.d.ts +14 -0
- package/node_modules/@xrkseek/exec-web/dist/search-duckduckgo.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-duckduckgo.js +139 -0
- package/node_modules/@xrkseek/exec-web/dist/search-duckduckgo.js.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-mcp-client.d.ts +21 -0
- package/node_modules/@xrkseek/exec-web/dist/search-mcp-client.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-mcp-client.js +175 -0
- package/node_modules/@xrkseek/exec-web/dist/search-mcp-client.js.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-parallel-free.d.ts +12 -0
- package/node_modules/@xrkseek/exec-web/dist/search-parallel-free.d.ts.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-parallel-free.js +105 -0
- package/node_modules/@xrkseek/exec-web/dist/search-parallel-free.js.map +1 -0
- package/node_modules/@xrkseek/exec-web/dist/search-providers.d.ts +9 -1
- package/node_modules/@xrkseek/exec-web/dist/search-providers.d.ts.map +1 -1
- package/node_modules/@xrkseek/exec-web/dist/search-providers.js +100 -12
- package/node_modules/@xrkseek/exec-web/dist/search-providers.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/client.d.ts.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/client.js.map +1 -1
- package/node_modules/@xrkseek/mcp/dist/project-content.js +1 -1
- package/node_modules/@xrkseek/mcp/dist/project-content.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts +7 -0
- package/node_modules/@xrkseek/preset-harness/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js +11 -1
- package/node_modules/@xrkseek/preset-harness/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-harness/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-minimal/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.d.ts.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js +3 -1
- package/node_modules/@xrkseek/preset-server/dist/preset.js.map +1 -1
- package/node_modules/@xrkseek/preset-server/dist/tsconfig.tsbuildinfo +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/dispatch.js +4 -2
- package/node_modules/@xrkseek/server-face/dist/dispatch.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.js +3 -2
- package/node_modules/@xrkseek/server-face/dist/handlers/session-added.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js +5 -3
- package/node_modules/@xrkseek/server-face/dist/handlers/session.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.d.ts +1 -0
- package/node_modules/@xrkseek/server-face/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/index.js +1 -0
- package/node_modules/@xrkseek/server-face/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/session-cwd.d.ts +3 -0
- package/node_modules/@xrkseek/server-face/dist/session-cwd.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/session-cwd.js +19 -0
- package/node_modules/@xrkseek/server-face/dist/session-cwd.js.map +1 -0
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js +0 -9
- package/node_modules/@xrkseek/server-face/dist/settings-schemas.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js +26 -9
- package/node_modules/@xrkseek/server-face/dist/workspace-face.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts +6 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js +39 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-registry.js.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts +4 -0
- package/node_modules/@xrkseek/server-face/dist/workspace-store.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js +43 -1
- package/node_modules/@xrkseek/server-face/dist/workspace-store.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts +9 -1
- package/node_modules/@xrkseek/server-host/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/index.js +92 -16
- package/node_modules/@xrkseek/server-host/dist/index.js.map +1 -1
- package/node_modules/@xrkseek/server-host/dist/log.d.ts +14 -0
- package/node_modules/@xrkseek/server-host/dist/log.d.ts.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/log.js +6 -0
- package/node_modules/@xrkseek/server-host/dist/log.js.map +1 -0
- package/node_modules/@xrkseek/server-host/dist/standing-tools.js +2 -2
- package/node_modules/@xrkseek/server-host/dist/standing-tools.js.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.d.ts +9 -0
- package/node_modules/@xrkseek/server-http/dist/index.d.ts.map +1 -1
- package/node_modules/@xrkseek/server-http/dist/index.js +9 -0
- package/node_modules/@xrkseek/server-http/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/product-web/boot.json +1 -1
- package/product-web/plugins/@xrkseek/client-locale/client.js +1 -1
- package/product-web/plugins/@xrkseek/client-ui-agent-preset/client.js +36 -36
- package/product-web/plugins/@xrkseek/client-ui-commands/client.js +7 -7
- package/product-web/plugins/@xrkseek/client-ui-conversation/client.js +158 -158
- package/product-web/plugins/@xrkseek/client-ui-deliverables/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-directory-picker-browse/client.js +28 -28
- package/product-web/plugins/@xrkseek/client-ui-goal/client.js +6 -6
- package/product-web/plugins/@xrkseek/client-ui-input-trigger/client.js +5 -5
- package/product-web/plugins/@xrkseek/client-ui-jobs/client.js +9 -9
- package/product-web/plugins/@xrkseek/client-ui-layout/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-message-feedback/client.js +2 -2
- package/product-web/plugins/@xrkseek/client-ui-model-selection/client.js +17 -17
- package/product-web/plugins/@xrkseek/client-ui-permission-presets/client.js +4 -4
- package/product-web/plugins/@xrkseek/client-ui-plan/client.js +2 -2
- package/product-web/plugins/@xrkseek/client-ui-settings-general/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-settings-models/client.js +52 -52
- package/product-web/plugins/@xrkseek/client-ui-settings-plugin-inventory/client.js +10 -10
- package/product-web/plugins/@xrkseek/client-ui-settings-plugins/client.js +107 -528
- package/product-web/plugins/@xrkseek/client-ui-sidebar/client.js +14 -14
- package/product-web/plugins/@xrkseek/client-ui-skill/client.js +12 -12
- package/product-web/plugins/@xrkseek/client-ui-subagent/client.js +16 -16
- package/product-web/plugins/@xrkseek/client-ui-theme/client.js +3 -3
- package/product-web/plugins/@xrkseek/client-ui-tool/client.js +39 -39
- package/product-web/plugins/@xrkseek/client-ui-trajectory/client.js +132 -132
- package/product-web/plugins/@xrkseek/client-ui-user-questions/client.js +28 -28
- package/product-web/plugins/@xrkseek/client-ui-workflow-run/client.js +15 -15
- package/product-web/plugins/@xrkseek/client-ui-workspace/client.js +52 -52
|
@@ -20,17 +20,17 @@ window.__ModuleLoader__.load({
|
|
|
20
20
|
document.head.appendChild(tag);
|
|
21
21
|
}
|
|
22
22
|
var fields_module_css_default = {
|
|
23
|
-
"
|
|
24
|
-
"badgeMuted": "MiE2dW_badgeMuted",
|
|
25
|
-
"field": "MiE2dW_field",
|
|
23
|
+
"label": "MiE2dW_label",
|
|
26
24
|
"input": "MiE2dW_input",
|
|
27
|
-
"select": "MiE2dW_select",
|
|
28
|
-
"inputInvalid": "MiE2dW_inputInvalid",
|
|
29
|
-
"badges": "MiE2dW_badges",
|
|
30
25
|
"invalid": "MiE2dW_invalid",
|
|
31
|
-
"
|
|
26
|
+
"badge": "MiE2dW_badge",
|
|
32
27
|
"reset": "MiE2dW_reset",
|
|
28
|
+
"field": "MiE2dW_field",
|
|
33
29
|
"head": "MiE2dW_head",
|
|
30
|
+
"badges": "MiE2dW_badges",
|
|
31
|
+
"badgeMuted": "MiE2dW_badgeMuted",
|
|
32
|
+
"select": "MiE2dW_select",
|
|
33
|
+
"inputInvalid": "MiE2dW_inputInvalid",
|
|
34
34
|
"hint": "MiE2dW_hint"
|
|
35
35
|
};
|
|
36
36
|
//#endregion
|
|
@@ -43,68 +43,6 @@ window.__ModuleLoader__.load({
|
|
|
43
43
|
* card's save is the single point where a draft becomes a document mutation.
|
|
44
44
|
*/
|
|
45
45
|
/**
|
|
46
|
-
* Label + control + hint without override chrome (list editors, MCP rows).
|
|
47
|
-
*/
|
|
48
|
-
function PlainField(props) {
|
|
49
|
-
const invalid = props.invalid === true;
|
|
50
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
51
|
-
className: fields_module_css_default.field,
|
|
52
|
-
children: [
|
|
53
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
54
|
-
className: fields_module_css_default.label,
|
|
55
|
-
htmlFor: props.id,
|
|
56
|
-
children: props.label
|
|
57
|
-
}),
|
|
58
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
59
|
-
id: props.id,
|
|
60
|
-
className: invalid ? fields_module_css_default.inputInvalid : fields_module_css_default.input,
|
|
61
|
-
type: "text",
|
|
62
|
-
value: props.value,
|
|
63
|
-
placeholder: props.placeholder ?? "",
|
|
64
|
-
disabled: props.disabled,
|
|
65
|
-
"aria-invalid": invalid || void 0,
|
|
66
|
-
onChange: (event) => {
|
|
67
|
-
props.onChange(event.target.value);
|
|
68
|
-
}
|
|
69
|
-
}),
|
|
70
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
71
|
-
className: fields_module_css_default.hint,
|
|
72
|
-
children: props.hint
|
|
73
|
-
})
|
|
74
|
-
]
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/** Same chrome as PlainField, for a short option list (MCP transport). */
|
|
78
|
-
function SelectField(props) {
|
|
79
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
80
|
-
className: fields_module_css_default.field,
|
|
81
|
-
children: [
|
|
82
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
83
|
-
className: fields_module_css_default.label,
|
|
84
|
-
htmlFor: props.id,
|
|
85
|
-
children: props.label
|
|
86
|
-
}),
|
|
87
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("select", {
|
|
88
|
-
id: props.id,
|
|
89
|
-
className: fields_module_css_default.select,
|
|
90
|
-
value: props.value,
|
|
91
|
-
disabled: props.disabled,
|
|
92
|
-
onChange: (event) => {
|
|
93
|
-
props.onChange(event.target.value);
|
|
94
|
-
},
|
|
95
|
-
children: props.options.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
96
|
-
value: option.value,
|
|
97
|
-
children: option.label
|
|
98
|
-
}, option.value))
|
|
99
|
-
}),
|
|
100
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
101
|
-
className: fields_module_css_default.hint,
|
|
102
|
-
children: props.hint
|
|
103
|
-
})
|
|
104
|
-
]
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
46
|
* A staged value field. `numeric` only hints the keypad: which drafts a field
|
|
109
47
|
* accepts is decided by its spec, so the control never silently rewrites what
|
|
110
48
|
* the user typed.
|
|
@@ -155,49 +93,6 @@ window.__ModuleLoader__.load({
|
|
|
155
93
|
]
|
|
156
94
|
});
|
|
157
95
|
}
|
|
158
|
-
/**
|
|
159
|
-
* A write-only credential control. The value never rides a response, so the
|
|
160
|
-
* control reports only whether one is configured and starts blank; a blank
|
|
161
|
-
* draft writes nothing, which keeps the stored key rather than clearing it.
|
|
162
|
-
* @param props - the field's copy, its staged text, and the configured state.
|
|
163
|
-
* @returns the labelled control.
|
|
164
|
-
*/
|
|
165
|
-
function SecretField(props) {
|
|
166
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
167
|
-
className: fields_module_css_default.field,
|
|
168
|
-
children: [
|
|
169
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
170
|
-
className: fields_module_css_default.head,
|
|
171
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
172
|
-
className: fields_module_css_default.label,
|
|
173
|
-
htmlFor: props.id,
|
|
174
|
-
children: props.label
|
|
175
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
176
|
-
className: fields_module_css_default.badges,
|
|
177
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
178
|
-
className: props.configured ? fields_module_css_default.badge : fields_module_css_default.badgeMuted,
|
|
179
|
-
children: props.stateLabel
|
|
180
|
-
})
|
|
181
|
-
})]
|
|
182
|
-
}),
|
|
183
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
184
|
-
id: props.id,
|
|
185
|
-
className: fields_module_css_default.input,
|
|
186
|
-
type: "password",
|
|
187
|
-
autoComplete: "off",
|
|
188
|
-
value: props.text,
|
|
189
|
-
disabled: props.disabled,
|
|
190
|
-
onChange: (event) => {
|
|
191
|
-
props.onEdit(event.target.value);
|
|
192
|
-
}
|
|
193
|
-
}),
|
|
194
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
195
|
-
className: fields_module_css_default.hint,
|
|
196
|
-
children: props.hint
|
|
197
|
-
})
|
|
198
|
-
]
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
96
|
//#endregion
|
|
202
97
|
//#region ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
203
98
|
function r(e) {
|
|
@@ -226,20 +121,20 @@ window.__ModuleLoader__.load({
|
|
|
226
121
|
}
|
|
227
122
|
var PluginCard_module_css_default = {
|
|
228
123
|
"headText": "YRvGva_headText",
|
|
124
|
+
"failed": "YRvGva_failed",
|
|
125
|
+
"chevronOpen": "YRvGva_chevronOpen",
|
|
229
126
|
"header": "YRvGva_header",
|
|
230
|
-
"readOnly": "YRvGva_readOnly",
|
|
231
127
|
"save": "YRvGva_save",
|
|
232
|
-
"
|
|
233
|
-
"
|
|
128
|
+
"body": "YRvGva_body",
|
|
129
|
+
"readOnly": "YRvGva_readOnly",
|
|
130
|
+
"name": "YRvGva_name",
|
|
234
131
|
"card": "YRvGva_card",
|
|
235
|
-
"
|
|
132
|
+
"description": "YRvGva_description",
|
|
133
|
+
"chevron": "YRvGva_chevron",
|
|
236
134
|
"discard": "YRvGva_discard",
|
|
237
135
|
"pending": "YRvGva_pending",
|
|
238
|
-
"
|
|
239
|
-
"
|
|
240
|
-
"chevron": "YRvGva_chevron",
|
|
241
|
-
"failed": "YRvGva_failed",
|
|
242
|
-
"chevronOpen": "YRvGva_chevronOpen"
|
|
136
|
+
"cardOpen": "YRvGva_cardOpen",
|
|
137
|
+
"footer": "YRvGva_footer"
|
|
243
138
|
};
|
|
244
139
|
//#endregion
|
|
245
140
|
//#region src/client/PluginCard.tsx
|
|
@@ -434,14 +329,14 @@ window.__ModuleLoader__.load({
|
|
|
434
329
|
document.head.appendChild(tag);
|
|
435
330
|
}
|
|
436
331
|
var PluginsSettingsSection_module_css_default = {
|
|
437
|
-
"
|
|
332
|
+
"tabs": "ha2I9q_tabs",
|
|
333
|
+
"tab": "ha2I9q_tab",
|
|
334
|
+
"cards": "ha2I9q_cards",
|
|
438
335
|
"empty": "ha2I9q_empty",
|
|
336
|
+
"section": "ha2I9q_section",
|
|
439
337
|
"heading": "ha2I9q_heading",
|
|
440
338
|
"panel": "ha2I9q_panel",
|
|
441
|
-
"
|
|
442
|
-
"section": "ha2I9q_section",
|
|
443
|
-
"cards": "ha2I9q_cards",
|
|
444
|
-
"tabs": "ha2I9q_tabs"
|
|
339
|
+
"intro": "ha2I9q_intro"
|
|
445
340
|
};
|
|
446
341
|
//#endregion
|
|
447
342
|
//#region src/client/ConfigurablePluginsTab.tsx
|
|
@@ -482,35 +377,30 @@ window.__ModuleLoader__.load({
|
|
|
482
377
|
document.head.appendChild(tag);
|
|
483
378
|
}
|
|
484
379
|
var McpCard_module_css_default = {
|
|
485
|
-
"
|
|
486
|
-
"badgeMuted": "FVl50a_badgeMuted",
|
|
487
|
-
"add": "FVl50a_add",
|
|
380
|
+
"remove": "FVl50a_remove",
|
|
488
381
|
"badgeError": "FVl50a_badgeError",
|
|
489
|
-
"
|
|
382
|
+
"entry": "FVl50a_entry",
|
|
490
383
|
"entryTitle": "FVl50a_entryTitle",
|
|
491
|
-
"
|
|
492
|
-
"
|
|
493
|
-
"block": "FVl50a_block",
|
|
384
|
+
"paste": "FVl50a_paste",
|
|
385
|
+
"badgeMuted": "FVl50a_badgeMuted",
|
|
494
386
|
"note": "FVl50a_note",
|
|
495
|
-
"
|
|
496
|
-
"remove": "FVl50a_remove",
|
|
497
|
-
"connectedName": "FVl50a_connectedName",
|
|
387
|
+
"block": "FVl50a_block",
|
|
498
388
|
"empty": "FVl50a_empty",
|
|
499
|
-
"heading": "FVl50a_heading",
|
|
500
389
|
"entryHead": "FVl50a_entryHead",
|
|
390
|
+
"badge": "FVl50a_badge",
|
|
391
|
+
"add": "FVl50a_add",
|
|
392
|
+
"invalid": "FVl50a_invalid",
|
|
501
393
|
"connectedList": "FVl50a_connectedList",
|
|
502
|
-
"entry": "FVl50a_entry",
|
|
503
394
|
"list": "FVl50a_list",
|
|
395
|
+
"connectedRow": "FVl50a_connectedRow",
|
|
396
|
+
"connectedName": "FVl50a_connectedName",
|
|
397
|
+
"heading": "FVl50a_heading",
|
|
398
|
+
"entryBody": "FVl50a_entryBody",
|
|
504
399
|
"pasteLabel": "FVl50a_pasteLabel"
|
|
505
400
|
};
|
|
506
401
|
//#endregion
|
|
507
402
|
//#region src/client/McpCard.tsx
|
|
508
|
-
/** MCP desired-server card:
|
|
509
|
-
*
|
|
510
|
-
* Same vertical field stack as Agent / Bash (label + control + hint). All of
|
|
511
|
-
* name / transport / command / args / cwd stay visible so they read alike —
|
|
512
|
-
* no launch-line merge, no buried “advanced” cwd.
|
|
513
|
-
*/
|
|
403
|
+
/** MCP desired-server card: JSON-block paste only (Cursor / Trae style). */
|
|
514
404
|
/**
|
|
515
405
|
* Render the MCP card.
|
|
516
406
|
* @param props - locale copy, the card snapshot, and its form actions.
|
|
@@ -521,10 +411,16 @@ window.__ModuleLoader__.load({
|
|
|
521
411
|
const state = props.useMcpCard((snapshot) => snapshot);
|
|
522
412
|
const disabled = !state.writable;
|
|
523
413
|
const pasteRef = (0, react.useRef)(null);
|
|
524
|
-
const
|
|
414
|
+
const [pasteHint, setPasteHint] = (0, react.useState)();
|
|
415
|
+
const addFromPaste = () => {
|
|
525
416
|
const pasted = pasteRef.current?.value ?? "";
|
|
526
|
-
props.addRow(pasted);
|
|
527
|
-
if (
|
|
417
|
+
const result = props.addRow(pasted);
|
|
418
|
+
if (result === "ok") {
|
|
419
|
+
if (pasteRef.current) pasteRef.current.value = "";
|
|
420
|
+
setPasteHint(void 0);
|
|
421
|
+
return;
|
|
422
|
+
}
|
|
423
|
+
setPasteHint(result === "empty" ? t("mcpPasteEmpty") : t("mcpPasteInvalid"));
|
|
528
424
|
};
|
|
529
425
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PluginCard, {
|
|
530
426
|
t,
|
|
@@ -587,19 +483,16 @@ window.__ModuleLoader__.load({
|
|
|
587
483
|
state.rows.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
588
484
|
className: McpCard_module_css_default.empty,
|
|
589
485
|
children: t("mcpServersEmpty")
|
|
590
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
486
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
|
|
591
487
|
className: McpCard_module_css_default.list,
|
|
592
|
-
children: state.rows.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
488
|
+
children: state.rows.map((row, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ServerSummary, {
|
|
593
489
|
t,
|
|
594
|
-
index,
|
|
595
490
|
row,
|
|
596
491
|
disabled,
|
|
597
|
-
showErrors: state.showErrors,
|
|
598
|
-
onEdit: props.editRow,
|
|
599
492
|
onRemove: () => {
|
|
600
493
|
props.removeRow(index);
|
|
601
494
|
}
|
|
602
|
-
}, `mcp-row-${String(index)}`))
|
|
495
|
+
}, `mcp-row-${row.serverName}-${String(index)}`))
|
|
603
496
|
}),
|
|
604
497
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
605
498
|
className: McpCard_module_css_default.pasteLabel,
|
|
@@ -612,124 +505,52 @@ window.__ModuleLoader__.load({
|
|
|
612
505
|
className: McpCard_module_css_default.paste,
|
|
613
506
|
disabled,
|
|
614
507
|
placeholder: t("mcpPasteHint"),
|
|
615
|
-
rows:
|
|
616
|
-
spellCheck: false
|
|
508
|
+
rows: 8,
|
|
509
|
+
spellCheck: false,
|
|
510
|
+
onChange: () => {
|
|
511
|
+
if (pasteHint) setPasteHint(void 0);
|
|
512
|
+
}
|
|
617
513
|
}),
|
|
618
514
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
619
515
|
type: "button",
|
|
620
516
|
className: McpCard_module_css_default.add,
|
|
621
517
|
disabled,
|
|
622
|
-
onClick:
|
|
518
|
+
onClick: addFromPaste,
|
|
623
519
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_xrkseek_client_ui_primitives.IconPlusOutline16, { size: 14 }), t("mcpAddServer")]
|
|
624
520
|
}),
|
|
625
|
-
|
|
521
|
+
pasteHint ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
626
522
|
className: McpCard_module_css_default.invalid,
|
|
627
523
|
role: "status",
|
|
628
|
-
children:
|
|
524
|
+
children: pasteHint
|
|
629
525
|
}) : null
|
|
630
526
|
]
|
|
631
527
|
})
|
|
632
528
|
]
|
|
633
529
|
});
|
|
634
530
|
}
|
|
635
|
-
function
|
|
636
|
-
const
|
|
637
|
-
|
|
638
|
-
const nameInvalid = showErrors && row.serverName.trim() === "";
|
|
639
|
-
const endpointInvalid = showErrors && (row.transport === "http" ? row.url.trim() === "" : row.command.trim() === "");
|
|
640
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("article", {
|
|
531
|
+
function ServerSummary({ t, row, disabled, onRemove }) {
|
|
532
|
+
const summary = row.transport === "http" ? row.url : [row.command, row.args].filter((part) => part.trim()).join(" ");
|
|
533
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
|
|
641
534
|
className: McpCard_module_css_default.entry,
|
|
642
|
-
"aria-label":
|
|
643
|
-
children:
|
|
535
|
+
"aria-label": row.serverName,
|
|
536
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
644
537
|
className: McpCard_module_css_default.entryHead,
|
|
645
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
538
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
|
|
646
539
|
className: McpCard_module_css_default.entryTitle,
|
|
647
|
-
children:
|
|
648
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
540
|
+
children: row.serverName
|
|
541
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
542
|
+
className: McpCard_module_css_default.empty,
|
|
543
|
+
children: summary || t("mcpServerRow").replace("{index}", "")
|
|
544
|
+
})] }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
649
545
|
type: "button",
|
|
650
546
|
className: McpCard_module_css_default.remove,
|
|
651
|
-
"aria-label": `${t("mcpRemoveServer")} ${
|
|
547
|
+
"aria-label": `${t("mcpRemoveServer")} ${row.serverName}`,
|
|
652
548
|
title: t("mcpRemoveServer"),
|
|
653
549
|
disabled,
|
|
654
550
|
onClick: onRemove,
|
|
655
551
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_xrkseek_client_ui_primitives.IconTrashOutline16, { size: 14 })
|
|
656
552
|
})]
|
|
657
|
-
})
|
|
658
|
-
className: McpCard_module_css_default.entryBody,
|
|
659
|
-
children: [
|
|
660
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainField, {
|
|
661
|
-
id: `plugin-config-mcp-name-${String(index)}`,
|
|
662
|
-
label: t("mcpServerName"),
|
|
663
|
-
hint: t("mcpServerNameHint"),
|
|
664
|
-
value: row.serverName,
|
|
665
|
-
invalid: nameInvalid,
|
|
666
|
-
disabled,
|
|
667
|
-
onChange: (value) => {
|
|
668
|
-
onEdit(index, { serverName: value });
|
|
669
|
-
}
|
|
670
|
-
}),
|
|
671
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SelectField, {
|
|
672
|
-
id: `plugin-config-mcp-transport-${String(index)}`,
|
|
673
|
-
label: t("mcpTransport"),
|
|
674
|
-
hint: t("mcpTransportHint"),
|
|
675
|
-
value: row.transport,
|
|
676
|
-
disabled,
|
|
677
|
-
options: [{
|
|
678
|
-
value: "stdio",
|
|
679
|
-
label: t("mcpTransportStdio")
|
|
680
|
-
}, {
|
|
681
|
-
value: "http",
|
|
682
|
-
label: t("mcpTransportHttp")
|
|
683
|
-
}],
|
|
684
|
-
onChange: (value) => {
|
|
685
|
-
onEdit(index, { transport: value });
|
|
686
|
-
}
|
|
687
|
-
}),
|
|
688
|
-
row.transport === "http" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainField, {
|
|
689
|
-
id: `plugin-config-mcp-url-${String(index)}`,
|
|
690
|
-
label: t("mcpUrl"),
|
|
691
|
-
hint: t("mcpUrlHint"),
|
|
692
|
-
value: row.url,
|
|
693
|
-
invalid: endpointInvalid,
|
|
694
|
-
disabled,
|
|
695
|
-
onChange: (value) => {
|
|
696
|
-
onEdit(index, { url: value });
|
|
697
|
-
}
|
|
698
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
699
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainField, {
|
|
700
|
-
id: `plugin-config-mcp-command-${String(index)}`,
|
|
701
|
-
label: t("mcpCommand"),
|
|
702
|
-
hint: t("mcpCommandHint"),
|
|
703
|
-
value: row.command,
|
|
704
|
-
invalid: endpointInvalid,
|
|
705
|
-
disabled,
|
|
706
|
-
onChange: (value) => {
|
|
707
|
-
onEdit(index, { command: value });
|
|
708
|
-
}
|
|
709
|
-
}),
|
|
710
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainField, {
|
|
711
|
-
id: `plugin-config-mcp-args-${String(index)}`,
|
|
712
|
-
label: t("mcpArgs"),
|
|
713
|
-
hint: t("mcpArgsHint"),
|
|
714
|
-
value: row.args,
|
|
715
|
-
disabled,
|
|
716
|
-
onChange: (value) => {
|
|
717
|
-
onEdit(index, { args: value });
|
|
718
|
-
}
|
|
719
|
-
}),
|
|
720
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(PlainField, {
|
|
721
|
-
id: `plugin-config-mcp-cwd-${String(index)}`,
|
|
722
|
-
label: t("mcpCwd"),
|
|
723
|
-
hint: t("mcpCwdHint"),
|
|
724
|
-
value: row.cwd,
|
|
725
|
-
disabled,
|
|
726
|
-
onChange: (value) => {
|
|
727
|
-
onEdit(index, { cwd: value });
|
|
728
|
-
}
|
|
729
|
-
})
|
|
730
|
-
] })
|
|
731
|
-
]
|
|
732
|
-
})]
|
|
553
|
+
})
|
|
733
554
|
});
|
|
734
555
|
}
|
|
735
556
|
//#endregion
|
|
@@ -826,73 +647,6 @@ window.__ModuleLoader__.load({
|
|
|
826
647
|
});
|
|
827
648
|
}
|
|
828
649
|
//#endregion
|
|
829
|
-
//#region src/client/WebSearchCard.tsx
|
|
830
|
-
/**
|
|
831
|
-
* Render the web-search card.
|
|
832
|
-
* @param props - locale copy, the card snapshot, and its form actions.
|
|
833
|
-
* @returns the card.
|
|
834
|
-
*/
|
|
835
|
-
function WebSearchCard(props) {
|
|
836
|
-
const { t } = props;
|
|
837
|
-
const state = props.useWebSearchCard((snapshot) => snapshot);
|
|
838
|
-
const disabled = !state.writable;
|
|
839
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(PluginCard, {
|
|
840
|
-
t,
|
|
841
|
-
titleKey: "webSearchTitle",
|
|
842
|
-
descriptionKey: "webSearchDescription",
|
|
843
|
-
state,
|
|
844
|
-
onSave: props.save,
|
|
845
|
-
onDiscard: props.discard,
|
|
846
|
-
children: [
|
|
847
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(SecretField, {
|
|
848
|
-
id: "plugin-config-web-search-key",
|
|
849
|
-
label: t("webSearchApiKey"),
|
|
850
|
-
hint: t("webSearchApiKeyHint"),
|
|
851
|
-
disabled: !state.apiKeyWritable,
|
|
852
|
-
text: state.apiKey.text,
|
|
853
|
-
configured: state.apiKeyConfigured,
|
|
854
|
-
stateLabel: state.apiKeyConfigured ? t("webSearchApiKeySet") : t("webSearchApiKeyUnset"),
|
|
855
|
-
onEdit: (text) => {
|
|
856
|
-
props.edit("apiKey", text);
|
|
857
|
-
}
|
|
858
|
-
}),
|
|
859
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
860
|
-
id: "plugin-config-web-search-endpoint",
|
|
861
|
-
label: t("webSearchBaseUrl"),
|
|
862
|
-
hint: t("webSearchBaseUrlHint"),
|
|
863
|
-
overriddenLabel: t("overridden"),
|
|
864
|
-
resetLabel: t("reset"),
|
|
865
|
-
invalidLabel: t("invalidNumber"),
|
|
866
|
-
disabled,
|
|
867
|
-
...state.baseURL,
|
|
868
|
-
onEdit: (text) => {
|
|
869
|
-
props.edit("baseURL", text);
|
|
870
|
-
},
|
|
871
|
-
onReset: () => {
|
|
872
|
-
props.resetField("baseURL");
|
|
873
|
-
}
|
|
874
|
-
}),
|
|
875
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueField, {
|
|
876
|
-
id: "plugin-config-web-search-max-uses",
|
|
877
|
-
label: t("webSearchMaxUses"),
|
|
878
|
-
hint: t("webSearchMaxUsesHint"),
|
|
879
|
-
overriddenLabel: t("overridden"),
|
|
880
|
-
resetLabel: t("reset"),
|
|
881
|
-
invalidLabel: t("invalidNumber"),
|
|
882
|
-
numeric: true,
|
|
883
|
-
disabled,
|
|
884
|
-
...state.maxUses,
|
|
885
|
-
onEdit: (text) => {
|
|
886
|
-
props.edit("maxUses", text);
|
|
887
|
-
},
|
|
888
|
-
onReset: () => {
|
|
889
|
-
props.resetField("maxUses");
|
|
890
|
-
}
|
|
891
|
-
})
|
|
892
|
-
]
|
|
893
|
-
});
|
|
894
|
-
}
|
|
895
|
-
//#endregion
|
|
896
650
|
//#region src/client/card-form.ts
|
|
897
651
|
/**
|
|
898
652
|
* A whole-number field. An empty draft clears the field; any other draft that
|
|
@@ -916,25 +670,6 @@ window.__ModuleLoader__.load({
|
|
|
916
670
|
};
|
|
917
671
|
}
|
|
918
672
|
/**
|
|
919
|
-
* A free-text field. An empty draft clears the field, so emptying the control
|
|
920
|
-
* and saving is the same gesture as resetting it.
|
|
921
|
-
* @param field - field name inside the namespace section.
|
|
922
|
-
* @returns the field's conversion spec.
|
|
923
|
-
*/
|
|
924
|
-
function textField(field) {
|
|
925
|
-
return {
|
|
926
|
-
field,
|
|
927
|
-
format: (value) => typeof value === "string" ? value : "",
|
|
928
|
-
parse: (text) => {
|
|
929
|
-
const trimmed = text.trim();
|
|
930
|
-
return trimmed === "" ? { kind: "clear" } : {
|
|
931
|
-
kind: "set",
|
|
932
|
-
value: trimmed
|
|
933
|
-
};
|
|
934
|
-
}
|
|
935
|
-
};
|
|
936
|
-
}
|
|
937
|
-
/**
|
|
938
673
|
* Stages one card's edits over one settings namespace and writes them on save.
|
|
939
674
|
*
|
|
940
675
|
* The form publishes through a snapshot store because slot components read
|
|
@@ -1184,11 +919,11 @@ window.__ModuleLoader__.load({
|
|
|
1184
919
|
//#endregion
|
|
1185
920
|
//#region src/client/bash-card-controller.ts
|
|
1186
921
|
/**
|
|
1187
|
-
* Namespace of the
|
|
1188
|
-
*
|
|
1189
|
-
*
|
|
922
|
+
* Namespace of the bash/terminal capability. Must match Face
|
|
923
|
+
* `FACE_PRODUCT_SETTINGS_NAMESPACES` (`bash`) or the Plugins tab never
|
|
924
|
+
* dispatches this card (Host serves `bash`, not `shell`).
|
|
1190
925
|
*/
|
|
1191
|
-
const SHELL_NS = "
|
|
926
|
+
const SHELL_NS = "bash";
|
|
1192
927
|
/** Bridges the `bash` scope onto the shell card's staged form. */
|
|
1193
928
|
var BashCardController = class {
|
|
1194
929
|
form;
|
|
@@ -1284,9 +1019,7 @@ window.__ModuleLoader__.load({
|
|
|
1284
1019
|
editRow: (index, patch) => {
|
|
1285
1020
|
this.editRow(index, patch);
|
|
1286
1021
|
},
|
|
1287
|
-
addRow: (paste) =>
|
|
1288
|
-
this.addRow(paste);
|
|
1289
|
-
},
|
|
1022
|
+
addRow: (paste) => this.addRow(paste),
|
|
1290
1023
|
removeRow: (index) => {
|
|
1291
1024
|
this.removeRow(index);
|
|
1292
1025
|
},
|
|
@@ -1322,10 +1055,14 @@ window.__ModuleLoader__.load({
|
|
|
1322
1055
|
this.publish();
|
|
1323
1056
|
}
|
|
1324
1057
|
addRow(paste) {
|
|
1325
|
-
const
|
|
1326
|
-
|
|
1058
|
+
const raw = typeof paste === "string" ? paste.trim() : "";
|
|
1059
|
+
if (!raw) return "empty";
|
|
1060
|
+
const imported = rowsFromMcpPaste(raw);
|
|
1061
|
+
if (imported.length === 0) return "invalid";
|
|
1062
|
+
this.rows = mergeRowsByName(this.rows, imported);
|
|
1327
1063
|
this.failed = false;
|
|
1328
1064
|
this.publish();
|
|
1065
|
+
return "ok";
|
|
1329
1066
|
}
|
|
1330
1067
|
removeRow(index) {
|
|
1331
1068
|
if (index < 0 || index >= this.rows.length) return;
|
|
@@ -1416,15 +1153,14 @@ window.__ModuleLoader__.load({
|
|
|
1416
1153
|
...cwd ? { cwd } : {}
|
|
1417
1154
|
};
|
|
1418
1155
|
}
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
};
|
|
1156
|
+
/** Upsert imported rows by `serverName` (later paste wins). */
|
|
1157
|
+
function mergeRowsByName(existing, imported) {
|
|
1158
|
+
const byName = new Map(existing.map((row) => [row.serverName, row]));
|
|
1159
|
+
for (const row of imported) byName.set(row.serverName, row);
|
|
1160
|
+
const order = [];
|
|
1161
|
+
for (const row of existing) if (!order.includes(row.serverName)) order.push(row.serverName);
|
|
1162
|
+
for (const row of imported) if (!order.includes(row.serverName)) order.push(row.serverName);
|
|
1163
|
+
return order.map((name) => byName.get(name)).filter(Boolean);
|
|
1428
1164
|
}
|
|
1429
1165
|
function namedRowToUi(name, row) {
|
|
1430
1166
|
const serverName = name.trim();
|
|
@@ -1442,7 +1178,7 @@ window.__ModuleLoader__.load({
|
|
|
1442
1178
|
};
|
|
1443
1179
|
}
|
|
1444
1180
|
/**
|
|
1445
|
-
* Cursor / Claude Desktop paste: `{ "mcpServers": { "
|
|
1181
|
+
* Cursor / Trae / Claude Desktop paste: `{ "mcpServers": { "name": { "command", "args" } } }`.
|
|
1446
1182
|
* Also accepts a bare name map or a Face array of `{ serverName, command }`.
|
|
1447
1183
|
*/
|
|
1448
1184
|
function rowsFromMcpPaste(raw) {
|
|
@@ -1552,137 +1288,6 @@ window.__ModuleLoader__.load({
|
|
|
1552
1288
|
}
|
|
1553
1289
|
};
|
|
1554
1290
|
//#endregion
|
|
1555
|
-
//#region src/client/web-search-card-controller.ts
|
|
1556
|
-
/**
|
|
1557
|
-
* Namespace of the DeepSeek search provider. Spelled here rather than
|
|
1558
|
-
* imported: a client package must not depend on a Host package.
|
|
1559
|
-
*/
|
|
1560
|
-
const WEB_SEARCH_NS = "web-search-deepseek";
|
|
1561
|
-
/** Credential reference the provider resolves when the section names none. */
|
|
1562
|
-
const DEFAULT_API_KEY_REF = "DEEPSEEK_API_KEY";
|
|
1563
|
-
/** Form field the credential control stages under. */
|
|
1564
|
-
const API_KEY_FIELD = "apiKey";
|
|
1565
|
-
/** Bridges the `web-search-deepseek` scope and the credentials domain onto the card. */
|
|
1566
|
-
var WebSearchCardController = class {
|
|
1567
|
-
scope;
|
|
1568
|
-
api;
|
|
1569
|
-
form;
|
|
1570
|
-
store;
|
|
1571
|
-
credential = {
|
|
1572
|
-
ref: "",
|
|
1573
|
-
configured: false,
|
|
1574
|
-
writable: true
|
|
1575
|
-
};
|
|
1576
|
-
/**
|
|
1577
|
-
* @param scope - the bound settings scope for the `web-search-deepseek` namespace.
|
|
1578
|
-
* @param api - wire face used for the credential the section references.
|
|
1579
|
-
*/
|
|
1580
|
-
constructor(scope, api) {
|
|
1581
|
-
this.scope = scope;
|
|
1582
|
-
this.api = api;
|
|
1583
|
-
this.form = new CardForm(scope, [textField("baseURL"), numberField("maxUses")], [{
|
|
1584
|
-
field: API_KEY_FIELD,
|
|
1585
|
-
write: (text) => this.writeKey(text)
|
|
1586
|
-
}]);
|
|
1587
|
-
this.store = this.form.bind(() => this.projection());
|
|
1588
|
-
scope.subscribe(() => {
|
|
1589
|
-
this.readCredential();
|
|
1590
|
-
});
|
|
1591
|
-
this.readCredential();
|
|
1592
|
-
}
|
|
1593
|
-
projection() {
|
|
1594
|
-
return {
|
|
1595
|
-
...this.form.shell(),
|
|
1596
|
-
baseURL: this.form.field("baseURL"),
|
|
1597
|
-
maxUses: this.form.field("maxUses"),
|
|
1598
|
-
apiKey: this.form.field(API_KEY_FIELD),
|
|
1599
|
-
apiKeyConfigured: this.credential.configured,
|
|
1600
|
-
apiKeyWritable: this.credential.writable
|
|
1601
|
-
};
|
|
1602
|
-
}
|
|
1603
|
-
/**
|
|
1604
|
-
* Ask the credentials domain about the reference the section currently names.
|
|
1605
|
-
*
|
|
1606
|
-
* The answer is stored with the reference it describes: `apiKeyEnv` can
|
|
1607
|
-
* change between the request and its response, and two reads can settle out
|
|
1608
|
-
* of order, so a response is published only while it still answers for the
|
|
1609
|
-
* reference in force.
|
|
1610
|
-
*/
|
|
1611
|
-
async readCredential() {
|
|
1612
|
-
const ref = refOf(this.scope.getSnapshot());
|
|
1613
|
-
if (ref !== this.credential.ref) {
|
|
1614
|
-
this.credential = {
|
|
1615
|
-
ref,
|
|
1616
|
-
configured: false,
|
|
1617
|
-
writable: true
|
|
1618
|
-
};
|
|
1619
|
-
this.store.set(this.projection());
|
|
1620
|
-
}
|
|
1621
|
-
let response;
|
|
1622
|
-
try {
|
|
1623
|
-
response = await this.api.credentials.describe({ refs: [ref] });
|
|
1624
|
-
} catch (_credentialReadFailure) {
|
|
1625
|
-
return;
|
|
1626
|
-
}
|
|
1627
|
-
if (!response.result.ok || ref !== refOf(this.scope.getSnapshot())) return;
|
|
1628
|
-
const view = response.result.value.credentials[ref];
|
|
1629
|
-
const next = {
|
|
1630
|
-
ref,
|
|
1631
|
-
configured: view?.configured ?? false,
|
|
1632
|
-
writable: view?.writable ?? true
|
|
1633
|
-
};
|
|
1634
|
-
if (next.configured === this.credential.configured && next.writable === this.credential.writable) return;
|
|
1635
|
-
this.credential = next;
|
|
1636
|
-
this.store.set(this.projection());
|
|
1637
|
-
}
|
|
1638
|
-
/**
|
|
1639
|
-
* Re-read after the Host reports a change to the reference this card watches.
|
|
1640
|
-
*
|
|
1641
|
-
* A key can be written from somewhere else — the Models page addresses the
|
|
1642
|
-
* same reference — and the settings section does not change when it is, so
|
|
1643
|
-
* without this the badge keeps reporting a state the Host already replaced.
|
|
1644
|
-
* @param ref - the reference the Host reports as changed.
|
|
1645
|
-
*/
|
|
1646
|
-
refreshCredential(ref) {
|
|
1647
|
-
if (ref !== this.credential.ref) return;
|
|
1648
|
-
this.readCredential();
|
|
1649
|
-
}
|
|
1650
|
-
/**
|
|
1651
|
-
* Build the face the card's slot registration injects.
|
|
1652
|
-
* @returns the card's snapshot and its form actions.
|
|
1653
|
-
*/
|
|
1654
|
-
inject() {
|
|
1655
|
-
return {
|
|
1656
|
-
hooks: { webSearchCard: this.store },
|
|
1657
|
-
...this.form.actions()
|
|
1658
|
-
};
|
|
1659
|
-
}
|
|
1660
|
-
/**
|
|
1661
|
-
* Write the staged key, then re-read whether the Host now holds one.
|
|
1662
|
-
* @param value - the staged credential literal.
|
|
1663
|
-
* @returns whether the Host reports a configured credential afterwards.
|
|
1664
|
-
*/
|
|
1665
|
-
async writeKey(value) {
|
|
1666
|
-
try {
|
|
1667
|
-
await this.api.credentials.set({
|
|
1668
|
-
ref: refOf(this.scope.getSnapshot()),
|
|
1669
|
-
value
|
|
1670
|
-
});
|
|
1671
|
-
} catch (_credentialWriteFailure) {}
|
|
1672
|
-
await this.readCredential();
|
|
1673
|
-
return this.credential.configured;
|
|
1674
|
-
}
|
|
1675
|
-
};
|
|
1676
|
-
/**
|
|
1677
|
-
* The credential reference the section names, or the provider's default.
|
|
1678
|
-
* @param snapshot - the current scope snapshot.
|
|
1679
|
-
* @returns the reference to address.
|
|
1680
|
-
*/
|
|
1681
|
-
function refOf(snapshot) {
|
|
1682
|
-
const declared = snapshot.value?.apiKeyEnv;
|
|
1683
|
-
return declared !== void 0 && declared.length > 0 ? declared : DEFAULT_API_KEY_REF;
|
|
1684
|
-
}
|
|
1685
|
-
//#endregion
|
|
1686
1291
|
//#region src/client/locales.ts
|
|
1687
1292
|
/** English copy. */
|
|
1688
1293
|
const en = {
|
|
@@ -1713,25 +1318,17 @@ window.__ModuleLoader__.load({
|
|
|
1713
1318
|
agentLoopDescription: "How the agent dispatches tool calls.",
|
|
1714
1319
|
agentLoopMaxParallel: "Parallel tool calls",
|
|
1715
1320
|
agentLoopMaxParallelHint: "Upper bound on parallel-safe calls running at once within one step.",
|
|
1716
|
-
webSearchTitle: "Web search",
|
|
1717
|
-
webSearchDescription: "The XRK search provider.",
|
|
1718
|
-
webSearchApiKey: "API key",
|
|
1719
|
-
webSearchApiKeyHint: "Stored outside the settings file. Leave blank to keep the current key.",
|
|
1720
|
-
webSearchApiKeySet: "A key is configured.",
|
|
1721
|
-
webSearchApiKeyUnset: "No key is configured; search is unavailable until one is.",
|
|
1722
|
-
webSearchBaseUrl: "Endpoint",
|
|
1723
|
-
webSearchBaseUrlHint: "Leave blank to use the provider default.",
|
|
1724
|
-
webSearchMaxUses: "Max searches per request",
|
|
1725
|
-
webSearchMaxUsesHint: "How many times one request may search before it must answer.",
|
|
1726
1321
|
mcpTitle: "MCP servers",
|
|
1727
|
-
mcpDescription: "
|
|
1322
|
+
mcpDescription: "Paste Cursor / Trae style JSON blocks one at a time. Each paste merges servers by name; save remounts when Host uses the settings file.",
|
|
1728
1323
|
mcpConnectedHeading: "Connected now",
|
|
1729
1324
|
mcpServersHeading: "Servers",
|
|
1730
|
-
mcpServersEmpty: "No servers yet.
|
|
1731
|
-
mcpAddServer: "Add
|
|
1325
|
+
mcpServersEmpty: "No servers yet. Paste a JSON block below and add.",
|
|
1326
|
+
mcpAddServer: "Add from JSON",
|
|
1732
1327
|
mcpRemoveServer: "Remove",
|
|
1733
|
-
mcpPaste: "Paste JSON",
|
|
1734
|
-
mcpPasteHint: "{ \"mcpServers\": { \"
|
|
1328
|
+
mcpPaste: "Paste JSON block",
|
|
1329
|
+
mcpPasteHint: "{ \"mcpServers\": { \"demo\": { \"command\": \"npx\", \"args\": [\"-y\", \"demo-mcp\"] } } }",
|
|
1330
|
+
mcpPasteEmpty: "Paste a JSON block first.",
|
|
1331
|
+
mcpPasteInvalid: "Could not find mcpServers entries in that JSON.",
|
|
1735
1332
|
mcpServerRow: "Server {index}",
|
|
1736
1333
|
mcpServerName: "Name",
|
|
1737
1334
|
mcpServerNameHint: "Short id in tool names (mcp__name__…).",
|
|
@@ -1782,25 +1379,17 @@ window.__ModuleLoader__.load({
|
|
|
1782
1379
|
agentLoopDescription: "Agent 如何派发工具调用。",
|
|
1783
1380
|
agentLoopMaxParallel: "并行工具调用数",
|
|
1784
1381
|
agentLoopMaxParallelHint: "同一步内最多同时运行多少个可并行的调用。",
|
|
1785
|
-
webSearchTitle: "网页搜索",
|
|
1786
|
-
webSearchDescription: "XRK 搜索提供方。",
|
|
1787
|
-
webSearchApiKey: "API Key",
|
|
1788
|
-
webSearchApiKeyHint: "不写入设置文件。留空表示保持当前密钥。",
|
|
1789
|
-
webSearchApiKeySet: "已配置密钥。",
|
|
1790
|
-
webSearchApiKeyUnset: "未配置密钥;配置之前搜索不可用。",
|
|
1791
|
-
webSearchBaseUrl: "接口地址",
|
|
1792
|
-
webSearchBaseUrlHint: "留空则使用提供方默认地址。",
|
|
1793
|
-
webSearchMaxUses: "单次请求最多搜索次数",
|
|
1794
|
-
webSearchMaxUsesHint: "一次请求在必须作答前最多可以搜索多少次。",
|
|
1795
1382
|
mcpTitle: "MCP 服务器",
|
|
1796
|
-
mcpDescription: "
|
|
1383
|
+
mcpDescription: "像 Trae / Cursor 一样每次粘贴一段 mcpServers JSON;按名称合并进列表,保存后热挂载。",
|
|
1797
1384
|
mcpConnectedHeading: "当前已连接",
|
|
1798
1385
|
mcpServersHeading: "服务器",
|
|
1799
|
-
mcpServersEmpty: "
|
|
1800
|
-
mcpAddServer: "
|
|
1386
|
+
mcpServersEmpty: "还没有服务器。在下方粘贴 JSON 块后点添加。",
|
|
1387
|
+
mcpAddServer: "从 JSON 添加",
|
|
1801
1388
|
mcpRemoveServer: "移除",
|
|
1802
|
-
mcpPaste: "粘贴 JSON",
|
|
1803
|
-
mcpPasteHint: "{ \"mcpServers\": { \"
|
|
1389
|
+
mcpPaste: "粘贴 JSON 块",
|
|
1390
|
+
mcpPasteHint: "{ \"mcpServers\": { \"demo\": { \"command\": \"npx\", \"args\": [\"-y\", \"demo-mcp\"] } } }",
|
|
1391
|
+
mcpPasteEmpty: "请先粘贴一段 JSON。",
|
|
1392
|
+
mcpPasteInvalid: "这段 JSON 里没有可用的 mcpServers 条目。",
|
|
1804
1393
|
mcpServerRow: "服务器 {index}",
|
|
1805
1394
|
mcpServerName: "名称",
|
|
1806
1395
|
mcpServerNameHint: "工具名里的短 id(mcp__name__…)。",
|
|
@@ -1847,11 +1436,7 @@ window.__ModuleLoader__.load({
|
|
|
1847
1436
|
}), "ui-settings-plugins: section dictionaries");
|
|
1848
1437
|
const bash = new BashCardController(ctx.settingsScope.bind({ namespace: SHELL_NS }));
|
|
1849
1438
|
const agentLoop = new AgentLoopCardController(ctx.settingsScope.bind({ namespace: AGENT_LOOP_NS }));
|
|
1850
|
-
const webSearch = new WebSearchCardController(ctx.settingsScope.bind({ namespace: WEB_SEARCH_NS }), api);
|
|
1851
1439
|
const mcp = new McpCardController(ctx.settingsScope.bind({ namespace: "mcp" }));
|
|
1852
|
-
ctx.effect(() => ctx.remote.$on("credentials/updated", (ref) => {
|
|
1853
|
-
webSearch.refreshCredential(ref);
|
|
1854
|
-
}), "ui-settings-plugins: credential invalidations");
|
|
1855
1440
|
const configurable = new ConfigurablePluginsTabController(api, () => ctx.slots.entries("settings.plugin.item"));
|
|
1856
1441
|
ctx.effect(() => () => {
|
|
1857
1442
|
configurable.dispose();
|
|
@@ -1919,6 +1504,12 @@ window.__ModuleLoader__.load({
|
|
|
1919
1504
|
} }
|
|
1920
1505
|
}, ConfigurablePluginsTab));
|
|
1921
1506
|
ctx.slots.inject("settings.plugin.item", function* () {
|
|
1507
|
+
yield ctx.slots.register({
|
|
1508
|
+
name: "settings.plugin.item",
|
|
1509
|
+
key: "mcp",
|
|
1510
|
+
locale: NS,
|
|
1511
|
+
inject: () => mcp.inject()
|
|
1512
|
+
}, McpCard);
|
|
1922
1513
|
yield ctx.slots.register({
|
|
1923
1514
|
name: "settings.plugin.item",
|
|
1924
1515
|
key: SHELL_NS,
|
|
@@ -1931,18 +1522,6 @@ window.__ModuleLoader__.load({
|
|
|
1931
1522
|
locale: NS,
|
|
1932
1523
|
inject: () => agentLoop.inject()
|
|
1933
1524
|
}, AgentLoopCard);
|
|
1934
|
-
yield ctx.slots.register({
|
|
1935
|
-
name: "settings.plugin.item",
|
|
1936
|
-
key: WEB_SEARCH_NS,
|
|
1937
|
-
locale: NS,
|
|
1938
|
-
inject: () => webSearch.inject()
|
|
1939
|
-
}, WebSearchCard);
|
|
1940
|
-
yield ctx.slots.register({
|
|
1941
|
-
name: "settings.plugin.item",
|
|
1942
|
-
key: "mcp",
|
|
1943
|
-
locale: NS,
|
|
1944
|
-
inject: () => mcp.inject()
|
|
1945
|
-
}, McpCard);
|
|
1946
1525
|
});
|
|
1947
1526
|
}
|
|
1948
1527
|
//#endregion
|