dsh-opencode-go 0.1.15 → 0.1.16
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.en.md +28 -4
- package/README.md +28 -4
- package/docs/development.md +64 -0
- package/docs/independent-package.md +2 -0
- package/docs/verification.md +74 -0
- package/lib/client.js +328 -253
- package/lib/index.js +167 -44
- package/lib/types/adapter.d.ts +2 -0
- package/lib/types/catalog.d.ts +12 -1
- package/lib/types/client/Section.d.ts +6 -5
- package/lib/types/client/locales.d.ts +11 -1
- package/lib/types/metadata-cache.d.ts +12 -0
- package/lib/types/model-metadata.d.ts +3 -1
- package/lib/types/models-contract.d.ts +15 -0
- package/package.json +26 -17
package/lib/client.js
CHANGED
|
@@ -47,6 +47,13 @@ var import_react = require("react");
|
|
|
47
47
|
var import_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
48
48
|
|
|
49
49
|
// src/models-contract.ts
|
|
50
|
+
var INPUT_MODALITIES = ["text", "image", "audio", "video", "pdf"];
|
|
51
|
+
function normalizeInputModalities(value) {
|
|
52
|
+
if (!Array.isArray(value)) return void 0;
|
|
53
|
+
const declared = new Set(value.filter((item) => typeof item === "string").map((item) => item.toLowerCase()));
|
|
54
|
+
const ordered = INPUT_MODALITIES.filter((modality) => declared.has(modality));
|
|
55
|
+
return ordered.length === 0 ? void 0 : ordered;
|
|
56
|
+
}
|
|
50
57
|
function isModelEnabled(model, modelVisibility) {
|
|
51
58
|
if (model.configurationMissing) return false;
|
|
52
59
|
const enabled = modelVisibility && Object.hasOwn(modelVisibility, model.id) ? modelVisibility[model.id] : void 0;
|
|
@@ -78,6 +85,8 @@ function parseGoModels(value) {
|
|
|
78
85
|
if (typeof row.deprecated === "boolean") model.deprecated = row.deprecated;
|
|
79
86
|
if (typeof row.configurationMissing === "boolean") model.configurationMissing = row.configurationMissing;
|
|
80
87
|
if (validReleaseDate(row.releaseDate)) model.releaseDate = row.releaseDate;
|
|
88
|
+
const modalities = normalizeInputModalities(row.inputModalities);
|
|
89
|
+
if (modalities !== void 0) model.inputModalities = modalities;
|
|
81
90
|
return model;
|
|
82
91
|
});
|
|
83
92
|
}
|
|
@@ -130,19 +139,26 @@ var modelsRemote = {
|
|
|
130
139
|
}]
|
|
131
140
|
};
|
|
132
141
|
|
|
133
|
-
// plugin-css
|
|
142
|
+
// plugin-css:src/client/Section.module.css
|
|
134
143
|
var id = "dsh-opencode-go/Section.module.css";
|
|
135
144
|
if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id) + "]")) {
|
|
136
145
|
const style = document.createElement("style");
|
|
137
146
|
style.dataset.plugin = "dsh-opencode-go";
|
|
138
147
|
style.dataset.pluginCss = id;
|
|
139
|
-
style.textContent =
|
|
148
|
+
style.textContent = ".N807zW_page{flex-direction:column;min-width:0;height:100%;min-height:0;display:flex;container-type:size}.N807zW_pageBody{scrollbar-gutter:stable;flex-direction:column;flex:1;min-height:0;padding-right:4px;display:flex;overflow-y:auto}.N807zW_pageBody,.N807zW_modelList,.N807zW_modelDetails{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l3) transparent}.N807zW_pageBody::-webkit-scrollbar,.N807zW_modelList::-webkit-scrollbar,.N807zW_modelDetails::-webkit-scrollbar{width:8px;height:8px}.N807zW_pageBody::-webkit-scrollbar-track,.N807zW_modelList::-webkit-scrollbar-track,.N807zW_modelDetails::-webkit-scrollbar-track{background:0 0}.N807zW_pageBody::-webkit-scrollbar-thumb,.N807zW_modelList::-webkit-scrollbar-thumb,.N807zW_modelDetails::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l3);background-clip:content-box;border:2px solid #0000;border-radius:999px}.N807zW_pageBody:hover::-webkit-scrollbar-thumb,.N807zW_modelList:hover::-webkit-scrollbar-thumb,.N807zW_modelDetails:hover::-webkit-scrollbar-thumb{background:var(--dsw-alias-label-tertiary);background-clip:content-box}.N807zW_field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.N807zW_field+.N807zW_field{border-top:.5px solid var(--dsw-alias-border-l2)}.N807zW_head{align-items:center;gap:8px;display:flex}.N807zW_label{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.N807zW_badges{align-items:center;gap:8px;display:inline-flex}.N807zW_trailing{flex:none;align-items:center;gap:8px;display:inline-flex}.N807zW_reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.N807zW_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.N807zW_reset:disabled{cursor:default}.N807zW_reset:focus-visible,.N807zW_cardTrigger:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}.N807zW_input{border:.5px solid var(--dsw-alias-border-l4);background:var(--dsw-alias-bg-layer-3);height:34px;font:inherit;color:var(--dsw-alias-label-primary);border-radius:8px;padding:0 12px;font-size:13px;line-height:1.5}.N807zW_input:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px;border-color:var(--dsw-alias-brand-primary)}.N807zW_input:disabled{color:var(--dsw-alias-label-tertiary);cursor:default}.N807zW_inputInvalid{border-color:var(--dsw-alias-label-error);}.N807zW_invalid{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}.N807zW_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}.N807zW_pageTop{flex-direction:column;gap:3px;padding:2px 0 12px;display:flex}.N807zW_title{color:var(--dsw-alias-label-primary);margin:0;font-size:15px;font-weight:600;line-height:1.4}.N807zW_intro{color:var(--dsw-alias-label-secondary);margin:0;font-size:13px;line-height:1.5}.N807zW_card,.N807zW_cardModels{border:.5px solid var(--dsw-alias-border-l2);background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 40%, transparent);border-radius:12px;padding:8px 0 10px}.N807zW_card{flex:none}.N807zW_card+.N807zW_card,.N807zW_card+.N807zW_cardModels,.N807zW_cardModels+.N807zW_card{margin-top:8px}.N807zW_cardModels{flex-direction:column;flex:auto;max-height:720px;display:flex}.N807zW_cardHead{align-items:center;gap:8px;min-height:24px;padding:0 14px;display:flex}.N807zW_cardTitle{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13.5px;font-weight:600;line-height:1.5}.N807zW_cardSub{color:var(--dsw-alias-label-tertiary);flex:none;font-size:11.5px;line-height:1.5}.N807zW_cardBody{flex-direction:column;gap:8px;padding:4px 14px 0;display:flex}.N807zW_cardBody>.N807zW_input{box-sizing:border-box;width:100%}.N807zW_cardModels>.N807zW_cardBody{flex:auto}.N807zW_cardDivider{border-top:.5px solid var(--dsw-alias-border-l2);margin:10px 14px}.N807zW_cardTrigger{width:100%;min-height:24px;font:inherit;text-align:left;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:8px;margin:0;padding:0 14px;display:flex}.N807zW_cardTrigger:hover .N807zW_cardTitle{color:var(--dsw-alias-brand-primary)}.N807zW_advancedGrid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:12px 18px;display:grid}.N807zW_advancedGrid .N807zW_field{padding:0}.N807zW_advancedGrid .N807zW_field+.N807zW_field{border-top:none}.N807zW_limitsEditor{flex-direction:column;flex:auto;gap:10px;padding-top:4px;display:flex}.N807zW_limitsSummary{color:var(--dsw-alias-label-tertiary);white-space:nowrap;padding-bottom:8px;font-size:12px;line-height:1.5}.N807zW_modelMeta{align-items:baseline;gap:10px;display:flex}.N807zW_modelMeta .N807zW_limitsModelId{flex:1;min-width:0}.N807zW_releaseDate{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;flex:none;font-size:11px;line-height:1.4}.N807zW_limitsModelId{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;line-height:1.4;display:block;overflow:hidden}.N807zW_visuallyHidden{clip:rect(0, 0, 0, 0);white-space:nowrap;border:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.N807zW_actions{border-top:.5px solid var(--dsw-alias-border-l2);flex-wrap:wrap;flex:none;align-items:center;gap:8px;padding:12px 0;display:flex}.N807zW_starLink{max-width:100%;color:var(--dsw-alias-label-secondary);border-radius:4px;align-items:center;gap:7px;margin-left:auto;padding:6px 0;font-size:12px;line-height:1.5;text-decoration:none;display:inline-flex}.N807zW_starLink svg{flex:none}.N807zW_starLink:hover{color:var(--dsw-alias-brand-primary)}.N807zW_starLink:hover span{text-underline-offset:3px;text-decoration:underline}.N807zW_starLink:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:3px}.N807zW_failedNote{color:var(--dsw-alias-label-error);margin:0;font-size:12px;line-height:1.5}.N807zW_slot{width:16px;height:16px;color:var(--dsw-alias-label-tertiary);flex:none;justify-content:center;align-items:center;display:inline-flex}.N807zW_slot svg{width:15px;height:15px}.N807zW_chevron,.N807zW_chevronOpen{width:14px;height:14px;color:var(--dsw-alias-label-tertiary);flex:none;transition:transform .15s}.N807zW_chevron{transform:rotate(-90deg)}.N807zW_filters{flex-wrap:wrap;gap:6px;display:flex}.N807zW_filter{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:6px;padding:6px 9px;font-size:12px}.N807zW_filter[aria-pressed=true]{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3)}.N807zW_filter span{color:var(--dsw-alias-label-tertiary);margin-left:4px}.N807zW_modelLayout{border:.5px solid var(--dsw-alias-border-l4);border-radius:10px;flex:auto;grid-template-columns:minmax(0,45fr) minmax(0,55fr);min-height:260px;max-height:560px;display:grid;overflow:hidden}.N807zW_modelList{border-right:.5px solid var(--dsw-alias-border-l2);min-height:0;padding:4px 6px;overflow-y:auto}.N807zW_modelRow{align-items:center;gap:8px;padding-right:6px;display:flex}.N807zW_modelRow+.N807zW_modelRow{border-top:.5px solid var(--dsw-alias-border-l2)}.N807zW_modelRowSelected{background:var(--dsw-alias-bg-layer-3);border-top-color:#0000;border-radius:6px}.N807zW_modelRow>[role=switch]{flex-shrink:0}.N807zW_modelChoice{text-align:left;min-width:0;color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border:0;border-radius:6px;flex:1;align-items:baseline;padding:9px 3px 9px 6px;display:flex}.N807zW_modelRow:hover:not(.N807zW_modelRowSelected){background:color-mix(in srgb, var(--dsw-alias-bg-layer-3) 92%, var(--dsw-alias-label-primary));border-top-color:#0000;border-radius:6px}.N807zW_modelName{overflow-wrap:anywhere;flex-wrap:wrap;flex:0 auto;align-items:center;gap:5px;min-width:0;font-size:13px;display:flex}.N807zW_overrideDot{background:var(--dsw-alias-brand-primary);border-radius:50%;flex:none;width:6px;height:6px}.N807zW_modelDetails{flex-direction:column;gap:10px;min-height:0;padding:14px;display:flex;overflow-y:auto}.N807zW_modelDetails h3{overflow-wrap:anywhere;margin:0;font-size:14px}.N807zW_modelHeading{flex-wrap:wrap;align-items:center;gap:6px;display:flex}.N807zW_stats{flex-direction:column;gap:10px;display:flex}.N807zW_stat{flex-direction:column;gap:4px;display:flex}.N807zW_statLabel{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.5}.N807zW_modelDetails .N807zW_input{box-sizing:border-box;width:100%;min-width:0;height:30px;padding:0 9px;font-size:12px}.N807zW_modalities{flex-wrap:wrap;gap:4px;display:flex}.N807zW_modality,.N807zW_modalityOff{border-radius:6px;padding:2px 7px;font-size:11px;line-height:1.5}.N807zW_modality{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-secondary)}.N807zW_modalityOff{border:.5px dashed var(--dsw-alias-border-l4);color:var(--dsw-alias-label-tertiary)}.N807zW_modelDetails .N807zW_reset{align-self:flex-start}.N807zW_paneFoot{color:var(--dsw-alias-label-tertiary);margin:auto 0 0;font-size:11px;line-height:1.5}.N807zW_newBadge{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:.5px solid var(--dsw-alias-border-l4);border-radius:4px;padding:2px 4px;font-size:9px}.N807zW_modelChoice:focus-visible,.N807zW_filter:focus-visible,.N807zW_cardTrigger:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}@container (width<=440px){.N807zW_advancedGrid{grid-template-columns:minmax(0,1fr)}.N807zW_cardModels{max-height:none}.N807zW_modelLayout{flex:none;grid-template-columns:minmax(0,1fr);max-height:none}.N807zW_modelList{border-right:0;border-bottom:.5px solid var(--dsw-alias-border-l2);max-height:240px}.N807zW_modelDetails{max-height:460px}}@media (prefers-reduced-motion:reduce){.N807zW_chevron,.N807zW_chevronOpen{transition:none}}";
|
|
140
149
|
document.head.appendChild(style);
|
|
141
150
|
}
|
|
142
|
-
var Section_default = { "actions": "
|
|
151
|
+
var Section_default = { "actions": "N807zW_actions", "advancedGrid": "N807zW_advancedGrid", "badges": "N807zW_badges", "card": "N807zW_card", "cardBody": "N807zW_cardBody", "cardDivider": "N807zW_cardDivider", "cardHead": "N807zW_cardHead", "cardModels": "N807zW_cardModels", "cardSub": "N807zW_cardSub", "cardTitle": "N807zW_cardTitle", "cardTrigger": "N807zW_cardTrigger", "chevron": "N807zW_chevron", "chevronOpen": "N807zW_chevronOpen", "failedNote": "N807zW_failedNote", "field": "N807zW_field", "filter": "N807zW_filter", "filters": "N807zW_filters", "head": "N807zW_head", "hint": "N807zW_hint", "input": "N807zW_input", "inputInvalid": "N807zW_inputInvalid N807zW_input", "intro": "N807zW_intro", "invalid": "N807zW_invalid", "label": "N807zW_label", "limitsEditor": "N807zW_limitsEditor", "limitsModelId": "N807zW_limitsModelId", "limitsSummary": "N807zW_limitsSummary", "modalities": "N807zW_modalities", "modality": "N807zW_modality", "modalityOff": "N807zW_modalityOff", "modelChoice": "N807zW_modelChoice", "modelDetails": "N807zW_modelDetails", "modelHeading": "N807zW_modelHeading", "modelLayout": "N807zW_modelLayout", "modelList": "N807zW_modelList", "modelMeta": "N807zW_modelMeta", "modelName": "N807zW_modelName", "modelRow": "N807zW_modelRow", "modelRowSelected": "N807zW_modelRowSelected", "newBadge": "N807zW_newBadge", "overrideDot": "N807zW_overrideDot", "page": "N807zW_page", "pageBody": "N807zW_pageBody", "pageTop": "N807zW_pageTop", "paneFoot": "N807zW_paneFoot", "releaseDate": "N807zW_releaseDate", "reset": "N807zW_reset", "slot": "N807zW_slot", "starLink": "N807zW_starLink", "stat": "N807zW_stat", "statLabel": "N807zW_statLabel", "stats": "N807zW_stats", "title": "N807zW_title", "trailing": "N807zW_trailing", "visuallyHidden": "N807zW_visuallyHidden" };
|
|
143
152
|
|
|
144
153
|
// src/client/ModelEditor.tsx
|
|
145
154
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
155
|
+
var MODALITY_COPY = {
|
|
156
|
+
text: "modalityText",
|
|
157
|
+
image: "modalityImage",
|
|
158
|
+
audio: "modalityAudio",
|
|
159
|
+
video: "modalityVideo",
|
|
160
|
+
pdf: "modalityPdf"
|
|
161
|
+
};
|
|
146
162
|
function hasCapacityOverride(limit) {
|
|
147
163
|
return limit?.contextWindow != null || limit?.maxTokens != null;
|
|
148
164
|
}
|
|
@@ -216,49 +232,62 @@ function ModelEditor({ models, draft, modelVisibility, t, locale, disabled, visi
|
|
|
216
232
|
key
|
|
217
233
|
)) }),
|
|
218
234
|
model ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.modelLayout, children: [
|
|
219
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: Section_default.modelList, "aria-label": t("modelsLabel"), children: entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
235
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { className: Section_default.modelList, "aria-label": t("modelsLabel"), children: entries.map((entry) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
236
|
+
"div",
|
|
237
|
+
{
|
|
238
|
+
className: entry.id === model.id ? `${Section_default.modelRow} ${Section_default.modelRowSelected}` : Section_default.modelRow,
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
241
|
+
"button",
|
|
242
|
+
{
|
|
243
|
+
type: "button",
|
|
244
|
+
className: Section_default.modelChoice,
|
|
245
|
+
"aria-pressed": entry.id === model.id,
|
|
246
|
+
onClick: () => {
|
|
247
|
+
setSelected(entry.id);
|
|
248
|
+
},
|
|
249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", { className: Section_default.modelName, children: [
|
|
250
|
+
entry.name ?? entry.id,
|
|
251
|
+
" ",
|
|
252
|
+
badges(entry)
|
|
253
|
+
] })
|
|
254
|
+
}
|
|
255
|
+
),
|
|
256
|
+
hasCapacityOverride(draft[entry.id]) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Section_default.overrideDot, title: t("overridden"), "aria-hidden": "true" }) : null,
|
|
257
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
258
|
+
import_dsh_client_ui_primitives.Switch,
|
|
259
|
+
{
|
|
260
|
+
label: t("modelVisibleLabel", { name: entry.name ?? entry.id }),
|
|
261
|
+
checked: isModelEnabled(entry, modelVisibility),
|
|
262
|
+
disabled: visibilityDisabled || entry.configurationMissing,
|
|
263
|
+
onChange: (enabled) => {
|
|
264
|
+
onModelEnabled(entry.id, enabled);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
)
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
entry.id
|
|
271
|
+
)) }),
|
|
252
272
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("section", { className: Section_default.modelDetails, "aria-label": t("modelDetails"), children: [
|
|
253
273
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.modelHeading, children: [
|
|
254
274
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("h3", { children: model.name ?? model.id }),
|
|
255
275
|
badges(model)
|
|
256
276
|
] }),
|
|
257
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
277
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.modelMeta, children: [
|
|
278
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("code", { className: Section_default.limitsModelId, translate: "no", children: model.id }),
|
|
279
|
+
model.releaseDate ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Section_default.releaseDate, title: t("releaseSource", { date: model.releaseDate }), children: model.releaseDate }) : null
|
|
280
|
+
] }),
|
|
258
281
|
model.configurationMissing ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: Section_default.hint, children: t(metadataUnavailable ? "configurationUnavailableHint" : "configurationMissingHint") }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
|
|
259
282
|
model.deprecated ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: Section_default.hint, children: t("deprecatedHint") }) : null,
|
|
260
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
261
|
-
|
|
283
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.stats, children: [
|
|
284
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Capacity, { model, field: "contextWindow", limit: draft[model.id], t, locale, disabled, onChange: write }),
|
|
285
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Capacity, { model, field: "maxTokens", limit: draft[model.id], t, locale, disabled, onChange: write }),
|
|
286
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.stat, children: [
|
|
287
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Section_default.statLabel, children: t("modalityLabel") }),
|
|
288
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Modalities, { model, t })
|
|
289
|
+
] })
|
|
290
|
+
] }),
|
|
262
291
|
hasCapacityOverride(draft[model.id]) ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
263
292
|
"button",
|
|
264
293
|
{
|
|
@@ -271,8 +300,12 @@ function ModelEditor({ models, draft, modelVisibility, t, locale, disabled, visi
|
|
|
271
300
|
children: t("limitsResetModel")
|
|
272
301
|
}
|
|
273
302
|
) : null,
|
|
274
|
-
|
|
275
|
-
|
|
303
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("p", { className: Section_default.paneFoot, children: [
|
|
304
|
+
t("limitsHint"),
|
|
305
|
+
" ",
|
|
306
|
+
t("modalitiesSource"),
|
|
307
|
+
model.inputModalities?.some((modality) => modality !== "text" && modality !== "image") === true ? ` ${t("modalitiesForwarding")}` : ""
|
|
308
|
+
] })
|
|
276
309
|
] })
|
|
277
310
|
] })
|
|
278
311
|
] }) : models.status === "ready" && all.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { className: Section_default.hint, children: t("limitsNoMatches", { query }) }) : null,
|
|
@@ -293,11 +326,23 @@ function ModelEditor({ models, draft, modelVisibility, t, locale, disabled, visi
|
|
|
293
326
|
] })
|
|
294
327
|
] });
|
|
295
328
|
}
|
|
329
|
+
function Modalities({ model, t }) {
|
|
330
|
+
const declared = model.inputModalities;
|
|
331
|
+
if (declared === void 0 || declared.length === 0) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Section_default.hint, children: t("modalityUnknown") });
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { className: Section_default.modalities, children: INPUT_MODALITIES.map((modality) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
333
|
+
"span",
|
|
334
|
+
{
|
|
335
|
+
className: declared.includes(modality) ? Section_default.modality : Section_default.modalityOff,
|
|
336
|
+
children: t(MODALITY_COPY[modality])
|
|
337
|
+
},
|
|
338
|
+
modality
|
|
339
|
+
)) });
|
|
340
|
+
}
|
|
296
341
|
function Capacity({ model, field, limit, disabled, t, locale, onChange }) {
|
|
297
342
|
const id3 = `opencode-go-${field}-${encodeURIComponent(model.id)}`;
|
|
298
343
|
const defaultValue = model[field];
|
|
299
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.
|
|
300
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: Section_default.
|
|
344
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { className: Section_default.stat, children: [
|
|
345
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("label", { className: Section_default.statLabel, htmlFor: id3, children: t(field === "contextWindow" ? "limitsContext" : "limitsOutput") }),
|
|
301
346
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
302
347
|
"input",
|
|
303
348
|
{
|
|
@@ -331,7 +376,7 @@ function Capacity({ model, field, limit, disabled, t, locale, onChange }) {
|
|
|
331
376
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
332
377
|
var ChevronDown = primitives.IconChevronDownOutlineRegular ?? primitives.IconChevronDownOutline14;
|
|
333
378
|
function ValueField(props) {
|
|
334
|
-
const hintId =
|
|
379
|
+
const hintId = props.id + "-hint";
|
|
335
380
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.field, children: [
|
|
336
381
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.head, children: [
|
|
337
382
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: Section_default.label, htmlFor: props.id, children: props.label }),
|
|
@@ -443,165 +488,12 @@ function Loaded(props) {
|
|
|
443
488
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.page, children: [
|
|
444
489
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.pageBody, children: [
|
|
445
490
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.pageTop, children: [
|
|
446
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("
|
|
447
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
448
|
-
"button",
|
|
449
|
-
{
|
|
450
|
-
type: "button",
|
|
451
|
-
className: Section_default.advancedTrigger,
|
|
452
|
-
"aria-expanded": advanced,
|
|
453
|
-
"aria-controls": "opencode-go-advanced",
|
|
454
|
-
onClick: () => {
|
|
455
|
-
setAdvanced(!advanced);
|
|
456
|
-
},
|
|
457
|
-
children: [
|
|
458
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChevronDown, { className: advanced ? Section_default.chevronOpen : Section_default.chevron }),
|
|
459
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.label, children: t("advancedLabel") }),
|
|
460
|
-
advancedOverridden ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: "neutral", children: t("overridden") }) : null
|
|
461
|
-
]
|
|
462
|
-
}
|
|
463
|
-
)
|
|
491
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: Section_default.title, children: t("titleLabel") }),
|
|
492
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.intro, children: t("intro") })
|
|
464
493
|
] }),
|
|
465
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
466
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
467
|
-
|
|
468
|
-
ValueField,
|
|
469
|
-
{
|
|
470
|
-
id: "opencode-go-api-key-env",
|
|
471
|
-
label: t("apiKeyEnvLabel"),
|
|
472
|
-
hint: t("apiKeyEnvHint"),
|
|
473
|
-
field: state.apiKeyEnv,
|
|
474
|
-
...fieldProps,
|
|
475
|
-
onEdit: (text) => {
|
|
476
|
-
props.edit("apiKeyEnv", text);
|
|
477
|
-
},
|
|
478
|
-
onReset: () => {
|
|
479
|
-
props.resetField("apiKeyEnv");
|
|
480
|
-
}
|
|
481
|
-
}
|
|
482
|
-
),
|
|
483
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
484
|
-
ValueField,
|
|
485
|
-
{
|
|
486
|
-
id: "opencode-go-base-url",
|
|
487
|
-
label: t("baseURLLabel"),
|
|
488
|
-
hint: t("baseURLHint"),
|
|
489
|
-
field: state.baseURL,
|
|
490
|
-
...fieldProps,
|
|
491
|
-
onEdit: (text) => {
|
|
492
|
-
props.edit("baseURL", text);
|
|
493
|
-
},
|
|
494
|
-
onReset: () => {
|
|
495
|
-
props.resetField("baseURL");
|
|
496
|
-
}
|
|
497
|
-
}
|
|
498
|
-
),
|
|
499
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
500
|
-
ValueField,
|
|
501
|
-
{
|
|
502
|
-
id: "opencode-go-refresh-minutes",
|
|
503
|
-
label: t("refreshMinutesLabel"),
|
|
504
|
-
hint: t("refreshMinutesHint"),
|
|
505
|
-
field: state.refreshMinutes,
|
|
506
|
-
numeric: true,
|
|
507
|
-
...fieldProps,
|
|
508
|
-
onEdit: (text) => {
|
|
509
|
-
props.edit("refreshMinutes", text);
|
|
510
|
-
},
|
|
511
|
-
onReset: () => {
|
|
512
|
-
props.resetField("refreshMinutes");
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
),
|
|
516
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
517
|
-
ValueField,
|
|
518
|
-
{
|
|
519
|
-
id: "opencode-go-stream-idle",
|
|
520
|
-
label: t("streamIdleTimeoutMsLabel"),
|
|
521
|
-
hint: t("streamIdleTimeoutMsHint"),
|
|
522
|
-
field: state.streamIdleTimeoutMs,
|
|
523
|
-
numeric: true,
|
|
524
|
-
...fieldProps,
|
|
525
|
-
onEdit: (text) => {
|
|
526
|
-
props.edit("streamIdleTimeoutMs", text);
|
|
527
|
-
},
|
|
528
|
-
onReset: () => {
|
|
529
|
-
props.resetField("streamIdleTimeoutMs");
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
),
|
|
533
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
534
|
-
ValueField,
|
|
535
|
-
{
|
|
536
|
-
id: "opencode-go-max-images",
|
|
537
|
-
label: t("maxImagesLabel"),
|
|
538
|
-
hint: t("maxImagesHint"),
|
|
539
|
-
field: state.maxImages,
|
|
540
|
-
numeric: true,
|
|
541
|
-
...fieldProps,
|
|
542
|
-
onEdit: (text) => {
|
|
543
|
-
props.edit("maxImages", text);
|
|
544
|
-
},
|
|
545
|
-
onReset: () => {
|
|
546
|
-
props.resetField("maxImages");
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
),
|
|
550
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
551
|
-
ValueField,
|
|
552
|
-
{
|
|
553
|
-
id: "opencode-go-max-request-image-bytes",
|
|
554
|
-
label: t("maxRequestImageBytesLabel"),
|
|
555
|
-
hint: t("maxRequestImageBytesHint"),
|
|
556
|
-
field: state.maxRequestImageBytes,
|
|
557
|
-
numeric: true,
|
|
558
|
-
...fieldProps,
|
|
559
|
-
onEdit: (text) => {
|
|
560
|
-
props.edit("maxRequestImageBytes", text);
|
|
561
|
-
},
|
|
562
|
-
onReset: () => {
|
|
563
|
-
props.resetField("maxRequestImageBytes");
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
),
|
|
567
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
568
|
-
ValueField,
|
|
569
|
-
{
|
|
570
|
-
id: "opencode-go-image-pixel-budget",
|
|
571
|
-
label: t("requestImagePixelBudgetLabel"),
|
|
572
|
-
hint: t("requestImagePixelBudgetHint"),
|
|
573
|
-
field: state.requestImagePixelBudget,
|
|
574
|
-
numeric: true,
|
|
575
|
-
...fieldProps,
|
|
576
|
-
onEdit: (text) => {
|
|
577
|
-
props.edit("requestImagePixelBudget", text);
|
|
578
|
-
},
|
|
579
|
-
onReset: () => {
|
|
580
|
-
props.resetField("requestImagePixelBudget");
|
|
581
|
-
}
|
|
582
|
-
}
|
|
583
|
-
),
|
|
584
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
585
|
-
ValueField,
|
|
586
|
-
{
|
|
587
|
-
id: "opencode-go-image-max-bytes",
|
|
588
|
-
label: t("requestImageMaxBytesLabel"),
|
|
589
|
-
hint: t("requestImageMaxBytesHint"),
|
|
590
|
-
field: state.requestImageMaxBytes,
|
|
591
|
-
numeric: true,
|
|
592
|
-
...fieldProps,
|
|
593
|
-
onEdit: (text) => {
|
|
594
|
-
props.edit("requestImageMaxBytes", text);
|
|
595
|
-
},
|
|
596
|
-
onReset: () => {
|
|
597
|
-
props.resetField("requestImageMaxBytes");
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
)
|
|
601
|
-
] }) : null }),
|
|
602
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.field, children: [
|
|
603
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.head, children: [
|
|
604
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.label, children: t("enabledLabel") }),
|
|
494
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: Section_default.card, children: [
|
|
495
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.cardHead, children: [
|
|
496
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: Section_default.cardTitle, children: t("enabledLabel") }),
|
|
605
497
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
606
498
|
import_dsh_client_ui_primitives2.Switch,
|
|
607
499
|
{
|
|
@@ -612,36 +504,40 @@ function Loaded(props) {
|
|
|
612
504
|
}
|
|
613
505
|
)
|
|
614
506
|
] }),
|
|
615
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.hint, children: state.enabled ? t("enabledHint") : t("enabledOff") })
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
507
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Section_default.cardBody, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.hint, children: state.enabled ? t("enabledHint") : t("enabledOff") }) }),
|
|
508
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: Section_default.cardDivider }),
|
|
509
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.cardHead, children: [
|
|
510
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.slot, "aria-hidden": "true", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", focusable: "false", children: [
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("circle", { cx: "5.4", cy: "8", r: "3.1" }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("path", { d: "M8.5 8h5.3M11.9 8v2.2M10.2 8v1.6" })
|
|
513
|
+
] }) }),
|
|
514
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: Section_default.label, htmlFor: "opencode-go-key", children: t("keyLabel") }),
|
|
515
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.trailing, children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: state.apiKeyConfigured ? "success" : "warning", children: state.apiKeyConfigured ? t("keyConfigured") : t("keyMissing") }) })
|
|
621
516
|
] }),
|
|
622
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
517
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.cardBody, children: [
|
|
518
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
519
|
+
"input",
|
|
520
|
+
{
|
|
521
|
+
id: "opencode-go-key",
|
|
522
|
+
name: "api-key",
|
|
523
|
+
className: Section_default.input,
|
|
524
|
+
type: "password",
|
|
525
|
+
autoComplete: "off",
|
|
526
|
+
"aria-describedby": "opencode-go-key-hint",
|
|
527
|
+
value: state.apiKey.text,
|
|
528
|
+
disabled: !state.apiKeyWritable,
|
|
529
|
+
onChange: (event) => {
|
|
530
|
+
props.edit("apiKey", event.target.value);
|
|
531
|
+
}
|
|
636
532
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
533
|
+
),
|
|
534
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { id: "opencode-go-key-hint", className: Section_default.hint, children: state.apiKeyWritable ? t("keyHint") : t("keyNotWritable") })
|
|
535
|
+
] })
|
|
640
536
|
] }),
|
|
641
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("
|
|
642
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.
|
|
643
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("
|
|
644
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Section_default.
|
|
537
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: Section_default.cardModels, children: [
|
|
538
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.cardHead, children: [
|
|
539
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h3", { className: Section_default.cardTitle, children: t("modelsLabel") }),
|
|
540
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: Section_default.trailing, children: [
|
|
645
541
|
state.models.status === "ready" ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: "neutral", children: t("modelsCount", { count: state.models.count }) }) : null,
|
|
646
542
|
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
647
543
|
"button",
|
|
@@ -655,26 +551,185 @@ function Loaded(props) {
|
|
|
655
551
|
)
|
|
656
552
|
] })
|
|
657
553
|
] }),
|
|
658
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.
|
|
554
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.cardBody, children: [
|
|
555
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ModelsBody, { models: state.models, t, locale: props.locale }),
|
|
556
|
+
state.pickerFailed ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.failedNote, role: "alert", children: t("pickerFailed") }) : null,
|
|
557
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
558
|
+
ModelEditor,
|
|
559
|
+
{
|
|
560
|
+
models: state.models,
|
|
561
|
+
draft: state.modelLimitDraft,
|
|
562
|
+
t,
|
|
563
|
+
locale: props.locale,
|
|
564
|
+
disabled: disabled || state.saving,
|
|
565
|
+
modelVisibility: state.modelVisibility,
|
|
566
|
+
visibilitySaving: state.pickerSaving,
|
|
567
|
+
onModelEnabled: props.setModelEnabled,
|
|
568
|
+
onEdit: (next) => {
|
|
569
|
+
props.edit("modelLimits", JSON.stringify(next));
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
)
|
|
573
|
+
] })
|
|
659
574
|
] }),
|
|
660
|
-
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
ModelEditor,
|
|
575
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("section", { className: Section_default.card, children: [
|
|
576
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(
|
|
577
|
+
"button",
|
|
664
578
|
{
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
579
|
+
type: "button",
|
|
580
|
+
className: Section_default.cardTrigger,
|
|
581
|
+
"aria-expanded": advanced,
|
|
582
|
+
"aria-controls": "opencode-go-advanced",
|
|
583
|
+
onClick: () => {
|
|
584
|
+
setAdvanced(!advanced);
|
|
585
|
+
},
|
|
586
|
+
children: [
|
|
587
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.cardTitle, children: t("advancedLabel") }),
|
|
588
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { className: Section_default.cardSub, children: t("advancedSummary") }),
|
|
589
|
+
advancedOverridden ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_dsh_client_ui_primitives2.Tag, { tone: "neutral", children: t("overridden") }) : null,
|
|
590
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ChevronDown, { className: advanced ? Section_default.chevronOpen : Section_default.chevron })
|
|
591
|
+
]
|
|
676
592
|
}
|
|
677
|
-
)
|
|
593
|
+
),
|
|
594
|
+
advanced ? /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { id: "opencode-go-advanced", className: Section_default.cardBody, children: [
|
|
595
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.hint, children: t("advancedHint") }),
|
|
596
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: Section_default.advancedGrid, children: [
|
|
597
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
598
|
+
ValueField,
|
|
599
|
+
{
|
|
600
|
+
id: "opencode-go-api-key-env",
|
|
601
|
+
label: t("apiKeyEnvLabel"),
|
|
602
|
+
hint: t("apiKeyEnvHint"),
|
|
603
|
+
field: state.apiKeyEnv,
|
|
604
|
+
...fieldProps,
|
|
605
|
+
onEdit: (text) => {
|
|
606
|
+
props.edit("apiKeyEnv", text);
|
|
607
|
+
},
|
|
608
|
+
onReset: () => {
|
|
609
|
+
props.resetField("apiKeyEnv");
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
),
|
|
613
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
614
|
+
ValueField,
|
|
615
|
+
{
|
|
616
|
+
id: "opencode-go-base-url",
|
|
617
|
+
label: t("baseURLLabel"),
|
|
618
|
+
hint: t("baseURLHint"),
|
|
619
|
+
field: state.baseURL,
|
|
620
|
+
...fieldProps,
|
|
621
|
+
onEdit: (text) => {
|
|
622
|
+
props.edit("baseURL", text);
|
|
623
|
+
},
|
|
624
|
+
onReset: () => {
|
|
625
|
+
props.resetField("baseURL");
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
),
|
|
629
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
630
|
+
ValueField,
|
|
631
|
+
{
|
|
632
|
+
id: "opencode-go-refresh-minutes",
|
|
633
|
+
label: t("refreshMinutesLabel"),
|
|
634
|
+
hint: t("refreshMinutesHint"),
|
|
635
|
+
field: state.refreshMinutes,
|
|
636
|
+
numeric: true,
|
|
637
|
+
...fieldProps,
|
|
638
|
+
onEdit: (text) => {
|
|
639
|
+
props.edit("refreshMinutes", text);
|
|
640
|
+
},
|
|
641
|
+
onReset: () => {
|
|
642
|
+
props.resetField("refreshMinutes");
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
),
|
|
646
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
647
|
+
ValueField,
|
|
648
|
+
{
|
|
649
|
+
id: "opencode-go-stream-idle",
|
|
650
|
+
label: t("streamIdleTimeoutMsLabel"),
|
|
651
|
+
hint: t("streamIdleTimeoutMsHint"),
|
|
652
|
+
field: state.streamIdleTimeoutMs,
|
|
653
|
+
numeric: true,
|
|
654
|
+
...fieldProps,
|
|
655
|
+
onEdit: (text) => {
|
|
656
|
+
props.edit("streamIdleTimeoutMs", text);
|
|
657
|
+
},
|
|
658
|
+
onReset: () => {
|
|
659
|
+
props.resetField("streamIdleTimeoutMs");
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
),
|
|
663
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
664
|
+
ValueField,
|
|
665
|
+
{
|
|
666
|
+
id: "opencode-go-max-images",
|
|
667
|
+
label: t("maxImagesLabel"),
|
|
668
|
+
hint: t("maxImagesHint"),
|
|
669
|
+
field: state.maxImages,
|
|
670
|
+
numeric: true,
|
|
671
|
+
...fieldProps,
|
|
672
|
+
onEdit: (text) => {
|
|
673
|
+
props.edit("maxImages", text);
|
|
674
|
+
},
|
|
675
|
+
onReset: () => {
|
|
676
|
+
props.resetField("maxImages");
|
|
677
|
+
}
|
|
678
|
+
}
|
|
679
|
+
),
|
|
680
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
681
|
+
ValueField,
|
|
682
|
+
{
|
|
683
|
+
id: "opencode-go-max-request-image-bytes",
|
|
684
|
+
label: t("maxRequestImageBytesLabel"),
|
|
685
|
+
hint: t("maxRequestImageBytesHint"),
|
|
686
|
+
field: state.maxRequestImageBytes,
|
|
687
|
+
numeric: true,
|
|
688
|
+
...fieldProps,
|
|
689
|
+
onEdit: (text) => {
|
|
690
|
+
props.edit("maxRequestImageBytes", text);
|
|
691
|
+
},
|
|
692
|
+
onReset: () => {
|
|
693
|
+
props.resetField("maxRequestImageBytes");
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
),
|
|
697
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
698
|
+
ValueField,
|
|
699
|
+
{
|
|
700
|
+
id: "opencode-go-image-pixel-budget",
|
|
701
|
+
label: t("requestImagePixelBudgetLabel"),
|
|
702
|
+
hint: t("requestImagePixelBudgetHint"),
|
|
703
|
+
field: state.requestImagePixelBudget,
|
|
704
|
+
numeric: true,
|
|
705
|
+
...fieldProps,
|
|
706
|
+
onEdit: (text) => {
|
|
707
|
+
props.edit("requestImagePixelBudget", text);
|
|
708
|
+
},
|
|
709
|
+
onReset: () => {
|
|
710
|
+
props.resetField("requestImagePixelBudget");
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
),
|
|
714
|
+
/* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
|
|
715
|
+
ValueField,
|
|
716
|
+
{
|
|
717
|
+
id: "opencode-go-image-max-bytes",
|
|
718
|
+
label: t("requestImageMaxBytesLabel"),
|
|
719
|
+
hint: t("requestImageMaxBytesHint"),
|
|
720
|
+
field: state.requestImageMaxBytes,
|
|
721
|
+
numeric: true,
|
|
722
|
+
...fieldProps,
|
|
723
|
+
onEdit: (text) => {
|
|
724
|
+
props.edit("requestImageMaxBytes", text);
|
|
725
|
+
},
|
|
726
|
+
onReset: () => {
|
|
727
|
+
props.resetField("requestImageMaxBytes");
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
)
|
|
731
|
+
] })
|
|
732
|
+
] }) : null
|
|
678
733
|
] }),
|
|
679
734
|
disabled ? /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: Section_default.hint, children: t("readOnly") }) : null
|
|
680
735
|
] }),
|
|
@@ -1267,6 +1322,7 @@ var en = {
|
|
|
1267
1322
|
usageRefreshing: "Refreshing\u2026",
|
|
1268
1323
|
nav: "OpenCode Go",
|
|
1269
1324
|
title: "OpenCode Go",
|
|
1325
|
+
titleLabel: "OpenCode Go",
|
|
1270
1326
|
intro: "Choose the OpenCode Go models shown in conversations and adjust their capacities.",
|
|
1271
1327
|
starProject: "Enjoying the plugin? Star it on GitHub",
|
|
1272
1328
|
starProjectTitle: "Open the GitHub project in a new tab",
|
|
@@ -1295,7 +1351,7 @@ var en = {
|
|
|
1295
1351
|
modelsEmpty: "The gateway currently serves no model this adapter can route.",
|
|
1296
1352
|
modelsCount: "{count} models",
|
|
1297
1353
|
limitsLabel: "Model capacities",
|
|
1298
|
-
limitsHint: "Capacities come from the
|
|
1354
|
+
limitsHint: "Capacities come from the online configuration; blank keeps the default and Save applies your overrides.",
|
|
1299
1355
|
limitsFilterLabel: "Find a model",
|
|
1300
1356
|
limitsFilterPlaceholder: "Search by model name or id\u2026",
|
|
1301
1357
|
limitsSummary: "{count} customized",
|
|
@@ -1304,6 +1360,15 @@ var en = {
|
|
|
1304
1360
|
limitsOutput: "Max output",
|
|
1305
1361
|
capacityDefault: "Default: {value} tokens",
|
|
1306
1362
|
capacityMissing: "API did not provide a value",
|
|
1363
|
+
modalityLabel: "Input modalities",
|
|
1364
|
+
modalityText: "Text",
|
|
1365
|
+
modalityImage: "Image",
|
|
1366
|
+
modalityAudio: "Audio",
|
|
1367
|
+
modalityVideo: "Video",
|
|
1368
|
+
modalityPdf: "PDF",
|
|
1369
|
+
modalityUnknown: "Not declared",
|
|
1370
|
+
modalitiesSource: "Input modalities come from the online models.dev configuration.",
|
|
1371
|
+
modalitiesForwarding: "This plugin converts and forwards image attachments only.",
|
|
1307
1372
|
visibilityHint: "Only enabled models appear in conversation pickers. Changes apply immediately. Deprecated models are off by default and can be enabled individually.",
|
|
1308
1373
|
modelVisibleLabel: "Show {name} in conversations",
|
|
1309
1374
|
configurationMissing: "Configuration missing",
|
|
@@ -1315,7 +1380,6 @@ var en = {
|
|
|
1315
1380
|
deprecatedHint: "Marked deprecated by models.dev, but still provided by this gateway.",
|
|
1316
1381
|
newHint: "Released within the last seven UTC calendar days, according to models.dev.",
|
|
1317
1382
|
newBadge: "NEW",
|
|
1318
|
-
releasedOn: "Released {date}",
|
|
1319
1383
|
releaseSource: "Release date: {date} \xB7 models.dev",
|
|
1320
1384
|
modelDetails: "Model configuration",
|
|
1321
1385
|
filterLabel: "Filter models",
|
|
@@ -1329,6 +1393,7 @@ var en = {
|
|
|
1329
1393
|
limitsEmpty: "Read the model list first; capacities are edited per model the gateway serves.",
|
|
1330
1394
|
limitsContextLabel: "Context window for {name}",
|
|
1331
1395
|
limitsOutputLabel: "Max output for {name}",
|
|
1396
|
+
advancedSummary: "Credential name \xB7 Gateway URL \xB7 Refresh \xB7 Idle timeout \xB7 Image limits",
|
|
1332
1397
|
advancedLabel: "Advanced settings",
|
|
1333
1398
|
advancedHint: "Credential name, gateway URL, and adapter tuning. The inherited values work as they are; change them only if you know you need to.",
|
|
1334
1399
|
apiKeyEnvLabel: "Credential reference",
|
|
@@ -1377,6 +1442,7 @@ var zh = {
|
|
|
1377
1442
|
usageRefreshing: "\u6B63\u5728\u5237\u65B0\u2026",
|
|
1378
1443
|
nav: "OpenCode Go",
|
|
1379
1444
|
title: "OpenCode Go",
|
|
1445
|
+
titleLabel: "OpenCode Go",
|
|
1380
1446
|
intro: "\u9009\u62E9\u4F1A\u8BDD\u4E2D\u663E\u793A\u7684 OpenCode Go \u6A21\u578B\uFF0C\u5E76\u8C03\u6574\u5176\u5BB9\u91CF\u3002",
|
|
1381
1447
|
starProject: "\u559C\u6B22\u8FD9\u4E2A\u63D2\u4EF6\uFF1F\u53BB GitHub \u70B9\u4E2A Star",
|
|
1382
1448
|
starProjectTitle: "\u5728\u65B0\u6807\u7B7E\u9875\u6253\u5F00 GitHub \u9879\u76EE",
|
|
@@ -1405,7 +1471,7 @@ var zh = {
|
|
|
1405
1471
|
modelsEmpty: "\u7F51\u5173\u5F53\u524D\u6CA1\u6709\u672C\u9002\u914D\u5668\u53EF\u8DEF\u7531\u7684\u6A21\u578B\u3002",
|
|
1406
1472
|
modelsCount: "{count} \u4E2A\u6A21\u578B",
|
|
1407
1473
|
limitsLabel: "\u6A21\u578B\u5BB9\u91CF",
|
|
1408
|
-
limitsHint: "\u5BB9\u91CF\u6765\u81EA\u6A21\u578B
|
|
1474
|
+
limitsHint: "\u5BB9\u91CF\u6765\u81EA\u5728\u7EBF\u6A21\u578B\u914D\u7F6E\uFF1B\u7559\u7A7A\u7528\u9ED8\u8BA4\u503C\uFF0C\u4FDD\u5B58\u540E\u751F\u6548\u3002",
|
|
1409
1475
|
limitsFilterLabel: "\u67E5\u627E\u6A21\u578B",
|
|
1410
1476
|
limitsFilterPlaceholder: "\u6309\u6A21\u578B\u540D\u79F0\u6216 ID \u641C\u7D22\u2026",
|
|
1411
1477
|
limitsSummary: "{count} \u4E2A\u5DF2\u81EA\u5B9A\u4E49",
|
|
@@ -1414,6 +1480,15 @@ var zh = {
|
|
|
1414
1480
|
limitsOutput: "\u6700\u5927\u8F93\u51FA",
|
|
1415
1481
|
capacityDefault: "\u9ED8\u8BA4\uFF1A{value} tokens",
|
|
1416
1482
|
capacityMissing: "API \u672A\u63D0\u4F9B",
|
|
1483
|
+
modalityLabel: "\u8F93\u5165\u6A21\u6001",
|
|
1484
|
+
modalityText: "\u6587\u672C",
|
|
1485
|
+
modalityImage: "\u56FE\u50CF",
|
|
1486
|
+
modalityAudio: "\u97F3\u9891",
|
|
1487
|
+
modalityVideo: "\u89C6\u9891",
|
|
1488
|
+
modalityPdf: "PDF",
|
|
1489
|
+
modalityUnknown: "\u672A\u58F0\u660E",
|
|
1490
|
+
modalitiesSource: "\u8F93\u5165\u6A21\u6001\u6765\u81EA models.dev \u7684\u5728\u7EBF\u914D\u7F6E\u3002",
|
|
1491
|
+
modalitiesForwarding: "\u672C\u63D2\u4EF6\u76EE\u524D\u4EC5\u8F6C\u6362\u5E76\u8F6C\u53D1\u56FE\u50CF\u9644\u4EF6\u3002",
|
|
1417
1492
|
visibilityHint: "\u5F00\u542F\u7684\u6A21\u578B\u624D\u4F1A\u663E\u793A\u5728\u4F1A\u8BDD\u9009\u62E9\u5668\u4E2D\uFF0C\u4FEE\u6539\u7ACB\u5373\u751F\u6548\u3002\u8FC7\u65F6\u6A21\u578B\u9ED8\u8BA4\u5173\u95ED\uFF0C\u53EF\u5355\u72EC\u5F00\u542F\u3002",
|
|
1418
1493
|
modelVisibleLabel: "\u5728\u4F1A\u8BDD\u4E2D\u663E\u793A {name}",
|
|
1419
1494
|
configurationMissing: "\u914D\u7F6E\u7F3A\u5931",
|
|
@@ -1425,7 +1500,6 @@ var zh = {
|
|
|
1425
1500
|
deprecatedHint: "models.dev \u6807\u8BB0\u4E3A\u5DF2\u5F03\u7528\uFF0C\u5F53\u524D\u7F51\u5173\u4ECD\u63D0\u4F9B\u6B64\u6A21\u578B\u3002",
|
|
1426
1501
|
newHint: "\u4F9D\u636E models.dev \u53D1\u5E03\u65E5\u671F\uFF0C\u8FD1\u4E03\u4E2A UTC \u65E5\u5386\u65E5\u5185\u53D1\u5E03\u3002",
|
|
1427
1502
|
newBadge: "\u65B0",
|
|
1428
|
-
releasedOn: "{date} \u53D1\u5E03",
|
|
1429
1503
|
releaseSource: "\u53D1\u5E03\u65E5\u671F\uFF1A{date} \xB7 models.dev",
|
|
1430
1504
|
modelDetails: "\u6A21\u578B\u914D\u7F6E",
|
|
1431
1505
|
filterLabel: "\u7B5B\u9009\u6A21\u578B",
|
|
@@ -1439,6 +1513,7 @@ var zh = {
|
|
|
1439
1513
|
limitsEmpty: "\u8BF7\u5148\u8BFB\u53D6\u6A21\u578B\u5217\u8868\uFF1B\u5BB9\u91CF\u6309\u7F51\u5173\u63D0\u4F9B\u7684\u6A21\u578B\u9010\u4E2A\u7F16\u8F91\u3002",
|
|
1440
1514
|
limitsContextLabel: "{name} \u7684\u4E0A\u4E0B\u6587\u7A97\u53E3",
|
|
1441
1515
|
limitsOutputLabel: "{name} \u7684\u6700\u5927\u8F93\u51FA",
|
|
1516
|
+
advancedSummary: "\u51ED\u8BC1\u5F15\u7528\u540D \xB7 \u7F51\u5173\u5730\u5740 \xB7 \u76EE\u5F55\u5237\u65B0 \xB7 \u6D41\u7A7A\u95F2\u8D85\u65F6 \xB7 \u56FE\u7247 4 \u9879",
|
|
1442
1517
|
advancedLabel: "\u9AD8\u7EA7\u8BBE\u7F6E",
|
|
1443
1518
|
advancedHint: "\u51ED\u8BC1\u540D\u79F0\u3001\u7F51\u5173\u5730\u5740\u4E0E\u9002\u914D\u5668\u8C03\u4F18\u53C2\u6570\u3002\u7EE7\u627F\u6765\u7684\u53D6\u503C\u5373\u53EF\u6B63\u5E38\u4F7F\u7528\uFF0C\u9664\u975E\u4F60\u660E\u786E\u77E5\u9053\u9700\u8981\u4FEE\u6539\uFF0C\u5426\u5219\u4E0D\u5FC5\u52A8\u8FD9\u91CC\u3002",
|
|
1444
1519
|
apiKeyEnvLabel: "\u51ED\u8BC1\u5F15\u7528\u540D",
|
|
@@ -1516,16 +1591,16 @@ var goRemote = {
|
|
|
1516
1591
|
// src/client/UsagePill.tsx
|
|
1517
1592
|
var import_react3 = require("react");
|
|
1518
1593
|
|
|
1519
|
-
// plugin-css
|
|
1594
|
+
// plugin-css:src/client/UsagePill.module.css
|
|
1520
1595
|
var id2 = "dsh-opencode-go/UsagePill.module.css";
|
|
1521
1596
|
if (!document.querySelector("style[data-plugin-css=" + JSON.stringify(id2) + "]")) {
|
|
1522
1597
|
const style = document.createElement("style");
|
|
1523
1598
|
style.dataset.plugin = "dsh-opencode-go";
|
|
1524
1599
|
style.dataset.pluginCss = id2;
|
|
1525
|
-
style.textContent = ".
|
|
1600
|
+
style.textContent = ".mAjYhq_root{min-width:0;display:inline-flex;position:relative}.mAjYhq_trigger{color:inherit;opacity:.75;font:inherit;cursor:pointer;white-space:nowrap;background:0 0;border:0;border-radius:6px;padding:4px 6px;font-size:12px}.mAjYhq_trigger:hover,.mAjYhq_trigger:focus-visible{opacity:1;background:color-mix(in srgb, currentColor 8%, transparent)}.mAjYhq_panel{z-index:100;box-sizing:border-box;border:1px solid color-mix(in srgb, currentColor 18%, transparent);width:280px;max-width:calc(100vw - 32px);max-height:70vh;color:var(--dsw-alias-label-primary,CanvasText);isolation:isolate;background-color:canvas;background-image:linear-gradient(var(--dsw-specific-menu,transparent), var(--dsw-specific-menu,transparent)), linear-gradient(var(--dsw-alias-bg-layer-2,Canvas), var(--dsw-alias-bg-layer-2,Canvas));border-radius:12px;padding:16px;font-size:12px;position:absolute;bottom:calc(100% + 12px);right:0;overflow-y:auto;box-shadow:0 8px 30px #0003}.mAjYhq_hint{opacity:.65;font-size:11px;line-height:1.6}.mAjYhq_warning{background:color-mix(in srgb, currentColor 6%, transparent);overflow-wrap:anywhere;border-radius:6px;margin:10px 0;padding:10px;line-height:1.5}.mAjYhq_warning p{margin:5px 0 0}.mAjYhq_retry{border:1px solid color-mix(in srgb, currentColor 25%, transparent);color:inherit;font:inherit;cursor:pointer;background:0 0;border-radius:6px;padding:5px 9px}.mAjYhq_retry:disabled{opacity:.6;cursor:default}.mAjYhq_retry:focus-visible{outline-offset:2px;outline:2px solid}.mAjYhq_window{margin-top:14px}.mAjYhq_row{justify-content:space-between;margin-bottom:5px;display:flex}.mAjYhq_window progress{appearance:none;background:color-mix(in srgb, currentColor 15%, transparent);border:0;border-radius:4px;width:100%;height:5px;margin-bottom:5px;display:block}.mAjYhq_window progress::-webkit-progress-bar{background:0 0;border-radius:4px}.mAjYhq_window progress::-webkit-progress-value{background:#39a878;border-radius:4px}.mAjYhq_window progress::-moz-progress-bar{background:#39a878;border-radius:4px}.mAjYhq_window progress.mAjYhq_high::-webkit-progress-value{background:#e0a100}.mAjYhq_window progress.mAjYhq_high::-moz-progress-bar{background:#e0a100}.mAjYhq_window progress.mAjYhq_limited::-webkit-progress-value{background:#e5484d}.mAjYhq_window progress.mAjYhq_limited::-moz-progress-bar{background:#e5484d}.mAjYhq_limitedText{color:#e5484d;margin-top:2px;font-weight:600}";
|
|
1526
1601
|
document.head.appendChild(style);
|
|
1527
1602
|
}
|
|
1528
|
-
var UsagePill_default = { "
|
|
1603
|
+
var UsagePill_default = { "high": "mAjYhq_high", "hint": "mAjYhq_hint", "limited": "mAjYhq_limited", "limitedText": "mAjYhq_limitedText", "panel": "mAjYhq_panel", "retry": "mAjYhq_retry", "root": "mAjYhq_root", "row": "mAjYhq_row", "trigger": "mAjYhq_trigger", "warning": "mAjYhq_warning", "window": "mAjYhq_window" };
|
|
1529
1604
|
|
|
1530
1605
|
// src/client/UsagePill.tsx
|
|
1531
1606
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|