@dsmm/dsmm 0.3.11 → 0.3.12
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 +1 -1
- package/docs/agent-presets.md +4 -4
- package/docs/compatibility.md +10 -4
- package/docs/deferred-native-approval-risk.md +1 -1
- package/docs/design.md +15 -5
- package/docs/lsp.md +1 -1
- package/docs/model-routing.md +6 -6
- package/docs/native-permissions.md +1 -1
- package/docs/profiles.md +36 -5
- package/docs/roadmap.md +3 -3
- package/docs/runtime-recovery.md +5 -5
- package/docs/safety-guards.md +1 -1
- package/docs/settings-status.md +3 -3
- package/lib/child-capture.d.ts +9 -0
- package/lib/child-capture.js +24 -1
- package/lib/client/ProfilesSection.js +65 -13
- package/lib/client/RoleToolView-data.d.ts +4 -4
- package/lib/client/RoleToolView-data.js +3 -1
- package/lib/client/RoleToolView-locales.d.ts +7 -4
- package/lib/client/RoleToolView-locales.js +10 -6
- package/lib/client/RoleToolView.js +20 -5
- package/lib/client/SessionProfiles.d.ts +5 -1
- package/lib/client/SessionProfiles.js +13 -9
- package/lib/client/StructuredEditor.d.ts +32 -0
- package/lib/client/StructuredEditor.js +75 -23
- package/lib/client/controller.d.ts +10 -0
- package/lib/client/controller.js +44 -14
- package/lib/client/locales.d.ts +36 -0
- package/lib/client/locales.js +47 -17
- package/lib/client/session-labels.js +4 -1
- package/lib/client/structured.d.ts +4 -0
- package/lib/client/structured.js +16 -1
- package/lib/client/styles.d.ts +1 -1
- package/lib/client/styles.js +19 -1
- package/lib/client.js +762 -303
- package/lib/host-llm.js +3 -3
- package/lib/index.js +1 -1
- package/lib/model-routing.d.ts +3 -2
- package/lib/model-routing.js +28 -7
- package/lib/native-admission.d.ts +2 -0
- package/lib/native-admission.js +106 -34
- package/lib/profile-runtime.d.ts +11 -0
- package/lib/profile-runtime.js +48 -13
- package/lib/profile-store.d.ts +4 -1
- package/lib/profile-store.js +37 -14
- package/lib/role-control-rpc.js +18 -5
- package/lib/role-llm-runtime.js +10 -1
- package/lib/role-policy.d.ts +4 -3
- package/lib/role-policy.js +6 -6
- package/lib/role-providers.js +1 -0
- package/lib/runtime-recovery.d.ts +2 -2
- package/lib/runtime-recovery.js +7 -4
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect, useId, useState } from "react";
|
|
2
|
+
import { useEffect, useId, useRef, useState } from "react";
|
|
3
3
|
import { Button, Input } from "@deepseek-ai/dsh-client-ui-primitives";
|
|
4
4
|
import { DSMM_LOCALES } from "../profile-locale.js";
|
|
5
5
|
import { DSMM_RATE_LIMIT_BOUNDS, normalizeRateLimitPolicy } from "../routing-policy.js";
|
|
@@ -8,23 +8,43 @@ import { RETRY_FIELD_LABEL_KEYS } from "./locales.js";
|
|
|
8
8
|
import { RoleAvailability, roleAvailability } from "./RoleAvailability.js";
|
|
9
9
|
import { EditableChoice } from "./EditableChoice.js";
|
|
10
10
|
function RetryNumber({ id, name, field, value, inherited, path, disabled, actions, t }) {
|
|
11
|
-
const [draft, setDraft] = useState(value === undefined ? "" : String(value));
|
|
12
|
-
const [invalid, setInvalid] = useState(false);
|
|
13
|
-
const [min, max] = DSMM_RATE_LIMIT_BOUNDS[field];
|
|
14
11
|
const key = path.join(".");
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
const stored = actions.getNumberDraft?.(key);
|
|
13
|
+
const sourceChanged = stored !== undefined && value !== stored.sourceValue;
|
|
14
|
+
const [draft, setDraft] = useState(stored && !sourceChanged ? stored.draft : (value === undefined ? "" : String(value)));
|
|
15
|
+
const [invalid, setInvalid] = useState(stored && !sourceChanged ? stored.invalid : false);
|
|
16
|
+
const [min, max] = DSMM_RATE_LIMIT_BOUNDS[field];
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const currentStored = actions.getNumberDraft?.(key);
|
|
19
|
+
if (currentStored && value !== currentStored.sourceValue) {
|
|
20
|
+
setDraft(value === undefined ? "" : String(value));
|
|
21
|
+
setInvalid(false);
|
|
22
|
+
}
|
|
23
|
+
else if (!currentStored) {
|
|
24
|
+
setDraft(value === undefined ? "" : String(value));
|
|
25
|
+
setInvalid(false);
|
|
26
|
+
}
|
|
27
|
+
}, [value, key, actions]);
|
|
28
|
+
const displayDraft = sourceChanged ? (value === undefined ? "" : String(value)) : draft;
|
|
29
|
+
const isInvalid = sourceChanged ? false : invalid;
|
|
30
|
+
return _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: id, children: t("retryField", { name, field: t(RETRY_FIELD_LABEL_KEYS[field]) }) }), _jsx(Input, { id: id, "data-dsmm-policy-field": field, className: "dsmm-input", type: "number", inputMode: "numeric", min: min, max: max, step: 1, disabled: disabled, value: displayDraft, placeholder: inherited === undefined ? t("unknownDefault") : t("inheritNumber", { value: inherited }), "aria-invalid": isInvalid || undefined, "aria-describedby": `${id}-hint${isInvalid ? ` ${id}-invalid` : ""}`, onChange: (event) => {
|
|
18
31
|
const input = event.currentTarget;
|
|
19
|
-
|
|
20
|
-
const valid = input.validity.valid && (
|
|
32
|
+
const valStr = input.value;
|
|
33
|
+
const valid = input.validity.valid && (valStr === "" || Number.isSafeInteger(input.valueAsNumber));
|
|
34
|
+
setDraft(valStr);
|
|
21
35
|
setInvalid(!valid);
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
actions.
|
|
25
|
-
|
|
36
|
+
if (!valid) {
|
|
37
|
+
actions.setNumberDraft?.(key, { draft: valStr, invalid: true, sourceValue: value });
|
|
38
|
+
actions.setFieldInvalid(key, true);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
actions.setNumberDraft?.(key, null);
|
|
42
|
+
actions.setFieldInvalid(key, false);
|
|
43
|
+
actions.editPath(path, valStr === "" ? undefined : input.valueAsNumber);
|
|
44
|
+
}
|
|
45
|
+
} }), _jsx("p", { className: "dsmm-hint", id: `${id}-hint`, children: t("retryBounds", { min, max, value: inherited ?? t("unknownDefault") }) }), isInvalid && _jsx("p", { id: `${id}-invalid`, children: t("invalidNumber") })] });
|
|
26
46
|
}
|
|
27
|
-
function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t }) {
|
|
47
|
+
export function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t, naturalLabels }) {
|
|
28
48
|
const prefix = useId();
|
|
29
49
|
const providers = catalog?.groups ?? [];
|
|
30
50
|
const group = providers.find((candidate) => candidate.id === value.provider);
|
|
@@ -35,24 +55,49 @@ function RouteFields({ value, path, name, catalog, disabled, edit, editRoute, t
|
|
|
35
55
|
// route's adapter-owned effort; do not save or touch the native model default.
|
|
36
56
|
editRoute(path, provider, modelId);
|
|
37
57
|
};
|
|
38
|
-
|
|
58
|
+
const providerLabel = naturalLabels ? t("naturalProvider") : t("routeProvider", { name: name ?? "" });
|
|
59
|
+
const modelLabel = naturalLabels ? t("naturalModel") : t("routeModel", { name: name ?? "" });
|
|
60
|
+
const effortLabel = naturalLabels ? t("naturalEffort") : t("routeEffort", { name: name ?? "" });
|
|
61
|
+
return _jsxs("div", { className: "dsmm-route-fields", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-provider`, children: providerLabel }), _jsx(EditableChoice, { id: `${prefix}-provider`, label: providerLabel, value: value.provider, options: providers, disabled: disabled, onChange: provider => updateModel(provider, value.model), onSelect: provider => updateModel(provider, "") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-model`, children: modelLabel }), _jsx(EditableChoice, { id: `${prefix}-model`, label: modelLabel, value: value.model, options: group?.models ?? [], disabled: disabled, onChange: modelId => updateModel(value.provider, modelId) })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-effort`, children: effortLabel }), _jsx(EditableChoice, { id: `${prefix}-effort`, label: effortLabel, value: value.reasoningEffort ?? "", options: efforts, disabled: disabled, placeholder: t("effortDefault"), onChange: effort => edit([...path, "reasoningEffort"], effort || undefined) })] })] });
|
|
39
62
|
}
|
|
40
63
|
function PolicyFields({ value, inherited, path, name, disabled, actions, t }) {
|
|
41
64
|
const prefix = useId();
|
|
42
|
-
return _jsxs("div", { className: "dsmm-policy-fields", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name }) }), _jsxs("select", { id: `${prefix}-strategy`, disabled: disabled, value: value.strategy ?? "", onChange: (event) => actions.editPath([...path, "strategy"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritStrategy", { value: inherited?.strategy ?? t("unknownDefault") }) }), _jsx("option", { value: "startup-lock", children: t("startupLock") }), _jsx("option", { value: "rate-limit-fallback", children: t("rateFallback") })] })] }), _jsx("p", { className: "dsmm-hint", children: t("strategyHint") }), _jsx("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => _jsx(RetryNumber, { id: `${prefix}-${field}`, t: t, name: name, field: field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled: disabled, actions: actions }, field)) })] });
|
|
65
|
+
return _jsxs("div", { className: "dsmm-policy-fields", children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-strategy`, children: t("strategy", { name }) }), _jsxs("select", { id: `${prefix}-strategy`, disabled: disabled, value: value.strategy ?? "", onChange: (event) => actions.editPath([...path, "strategy"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritStrategy", { value: inherited?.strategy ?? t("unknownDefault") }) }), _jsx("option", { value: "startup-lock", children: t("startupLock") }), _jsx("option", { value: "rate-limit-fallback", children: t("rateFallback") })] })] }), _jsx("p", { className: "dsmm-hint", children: t("strategyHint") }), _jsx("div", { className: "dsmm-route-fields", children: Object.keys(DSMM_RATE_LIMIT_BOUNDS).map((field) => (_jsx(RetryNumber, { id: `${prefix}-${field}`, t: t, name: name, field: field, value: value.rateLimit?.[field], inherited: inherited?.rateLimit[field], path: [...path, "rateLimit", field], disabled: disabled, actions: actions }, field))) })] });
|
|
43
66
|
}
|
|
44
67
|
function LevelFields({ level, value, path, catalog, disabled, actions, t }) {
|
|
45
68
|
const prefix = useId();
|
|
46
69
|
const mode = value === undefined ? "inherit" : value.provider === undefined ? "effort" : "route";
|
|
47
70
|
return _jsxs("fieldset", { "data-dsmm-level": level, children: [_jsx("legend", { children: t("levelName", { level }) }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-mode`, children: t("levelMode", { level }) }), _jsxs("select", { id: `${prefix}-mode`, value: mode, disabled: disabled, onChange: event => actions.editPath(path, event.currentTarget.value === "inherit" ? undefined : event.currentTarget.value === "effort" ? { reasoningEffort: "" } : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("levelUnconfigured") }), _jsx("option", { value: "effort", children: t("levelEffortOnly") }), _jsx("option", { value: "route", children: t("levelFullRoute") })] })] }), mode === "effort" && _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-effort`, children: t("routeEffort", { name: level }) }), _jsx(EditableChoice, { id: `${prefix}-effort`, label: t("routeEffort", { name: level }), value: value?.reasoningEffort ?? "", options: [], disabled: disabled, onChange: effort => actions.editPath([...path, "reasoningEffort"], effort) })] }), value?.provider !== undefined && _jsx(RouteFields, { value: value, path: path, name: t("levelName", { level }), catalog: catalog, disabled: disabled, edit: actions.editPath, editRoute: actions.editRoute, t: t })] });
|
|
48
71
|
}
|
|
49
|
-
|
|
50
|
-
|
|
72
|
+
export function BasicSettings({ state, actions, disabled, inputRef, idInvalid, orchestratorRef, onJumpToJsonc, t }) {
|
|
73
|
+
const prefix = useId();
|
|
74
|
+
const editor = state.editor;
|
|
75
|
+
if (editor === null)
|
|
76
|
+
return null;
|
|
77
|
+
const document = structuredDocument(editor.content);
|
|
78
|
+
if (document === null) {
|
|
79
|
+
return _jsxs("div", { className: "dsmm-structured-invalid", "data-dsmm-structured-invalid": true, children: [_jsx("p", { children: t("rawInvalid") }), _jsx("p", { className: "dsmm-hint", children: t("rawInvalidFormDisabled") }), onJumpToJsonc && _jsx(Button, { type: "button", variant: "outline", onClick: onJumpToJsonc, children: t("viewConfiguration") })] });
|
|
80
|
+
}
|
|
81
|
+
const orchPolicy = document.roleRouting["dsmm-orchestrator"] ?? {};
|
|
82
|
+
const orchPath = ["settings", "roleRouting", "dsmm-orchestrator"];
|
|
83
|
+
return _jsxs("div", { className: "dsmm-basic-settings", "data-dsmm-basic-settings": true, children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-label`, children: t("profileLabel") }), _jsx(Input, { id: `${prefix}-label`, className: "dsmm-input", value: document.label ?? "", disabled: disabled, onChange: (event) => actions.editPath(["label"], event.currentTarget.value) }), _jsx(Button, { type: "button", variant: "outline", disabled: disabled || document.label === undefined, onClick: () => actions.editPath(["label"], undefined), children: t("omitLabel") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-id`, children: t("profileId") }), _jsx(Input, { ref: inputRef, id: `${prefix}-id`, className: "dsmm-input", value: editor.id, disabled: disabled || editor.revision !== null, "aria-invalid": idInvalid || undefined, "aria-describedby": `${prefix}-id-hint${idInvalid ? ` ${prefix}-issue` : ""}`, onChange: (event) => actions.editId(event.currentTarget.value) }), _jsx("p", { id: `${prefix}-id-hint`, className: "dsmm-hint", children: t("idHint") })] }), _jsxs("div", { ref: orchestratorRef, className: "dsmm-field", id: `${prefix}-orchestrator-primary`, children: [_jsx("label", { htmlFor: `${prefix}-orch-mode`, children: t("orchestratorModel") }), _jsx("p", { className: "dsmm-hint", children: t("orchestratorModelDesc") }), _jsxs("select", { id: `${prefix}-orch-mode`, disabled: disabled, value: orchPolicy.primary === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...orchPath, "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] }), orchPolicy.primary !== undefined && _jsx(RouteFields, { t: t, value: orchPolicy.primary, path: [...orchPath, "primary"], naturalLabels: true, catalog: state.catalog, disabled: disabled, edit: actions.editPath, editRoute: actions.editRoute }), _jsx("p", { className: "dsmm-hint", children: t("effortChangeHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-locale`, children: t("businessLocale") }), _jsxs("select", { id: `${prefix}-locale`, value: String(document.settings.locale ?? ""), disabled: disabled, "aria-describedby": `${prefix}-locale-hint`, onChange: event => actions.editPath(["settings", "locale"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inheritLocale") }), typeof document.settings.locale === "string" && !DSMM_LOCALES.includes(document.settings.locale) && _jsx("option", { value: document.settings.locale, children: t("unsupportedLocale") }), DSMM_LOCALES.map(locale => _jsx("option", { value: locale, children: locale }, locale))] }), _jsx("p", { id: `${prefix}-locale-hint`, className: "dsmm-hint", children: t("localeHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-active`, children: t("defaultActive") }), _jsxs("select", { id: `${prefix}-active`, disabled: disabled, value: document.settings.defaultActive === undefined ? "" : String(document.settings.defaultActive), onChange: (event) => actions.editPath(["settings", "defaultActive"], event.currentTarget.value === "" ? undefined : event.currentTarget.value === "true"), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "true", children: t("enabled") }), _jsx("option", { value: "false", children: t("disabled") })] }), _jsx("p", { className: "dsmm-hint", children: t("activeHint") })] })] });
|
|
84
|
+
}
|
|
85
|
+
export function AdvancedSettings({ state, actions, disabled, onJumpToOrchestrator, t }) {
|
|
51
86
|
const prefix = useId();
|
|
52
87
|
const [selectedRole, setSelectedRole] = useState("dsmm-orchestrator");
|
|
53
|
-
const
|
|
88
|
+
const editor = state.editor;
|
|
89
|
+
if (editor === null)
|
|
90
|
+
return null;
|
|
91
|
+
const rawDoc = structuredDocument(editor.content);
|
|
92
|
+
const lastValidDocRef = useRef(null);
|
|
93
|
+
if (rawDoc !== null) {
|
|
94
|
+
lastValidDocRef.current = rawDoc;
|
|
95
|
+
}
|
|
96
|
+
const document = rawDoc ?? lastValidDocRef.current;
|
|
97
|
+
const isInvalidProjection = rawDoc === null;
|
|
54
98
|
if (document === null)
|
|
55
99
|
return _jsx("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") });
|
|
100
|
+
const effectiveDisabled = disabled || isInvalidProjection;
|
|
56
101
|
const roles = state.snapshot?.roles ?? [];
|
|
57
102
|
const role = roles.find((candidate) => candidate.id === selectedRole) ?? roles[0];
|
|
58
103
|
const policy = role === undefined ? undefined : document.roleRouting[role.id] ?? {};
|
|
@@ -69,14 +114,21 @@ export function StructuredEditor({ state, actions, disabled, t }) {
|
|
|
69
114
|
const availability = roleAvailability(role?.availability);
|
|
70
115
|
const namedRoles = document.settings.roles;
|
|
71
116
|
const topology = document.settings.subagents?.toolTopology;
|
|
72
|
-
|
|
117
|
+
const gitGuard = document.guards?.gitWriteGuard;
|
|
118
|
+
const gitScope = document.guards?.gitWriteScope;
|
|
119
|
+
const isGuardOff = gitGuard === "off";
|
|
120
|
+
return _jsxs("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [isInvalidProjection && _jsx("p", { className: "dsmm-hint", "data-dsmm-structured-invalid": true, children: t("rawInvalid") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-role`, children: t("roleSelect") }), _jsxs("select", { id: `${prefix}-role`, disabled: effectiveDisabled || roles.length === 0, value: role?.id ?? "", onChange: (event) => setSelectedRole(event.currentTarget.value), children: [roles.length === 0 && _jsx("option", { value: "", children: t("rolesUnavailable") }), roles.map((candidate) => _jsxs("option", { value: candidate.id, children: [candidate.label, candidate.enabled ? "" : ` — ${t("roleDisabled")}`] }, candidate.id))] })] }), role !== undefined && policy !== undefined && _jsxs("fieldset", { "data-dsmm-role": role.id, children: [_jsx("legend", { children: role.label }), _jsx(RoleAvailability, { value: role.availability, t: t }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-role-enabled`, children: t("namedRole", { name: role.label }) }), _jsxs("select", { id: `${prefix}-role-enabled`, value: namedRoles?.[role.id] === undefined ? "" : String(namedRoles[role.id]), disabled: effectiveDisabled, "aria-describedby": `${prefix}-role-hint`, onChange: event => actions.editPath(["settings", "roles", role.id], event.currentTarget.value === "" ? undefined : event.currentTarget.value === "true"), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "true", disabled: availability === undefined || !availability.startupAvailable || !availability.deploymentEnabled || availability.reason === "module-off", children: t("enabled") }), _jsx("option", { value: "false", disabled: availability === undefined || availability.required, children: t("disabled") })] }), _jsx("p", { id: `${prefix}-role-hint`, className: "dsmm-hint", children: t("namedRoleHint") })] }), _jsx(PolicyFields, { t: t, value: policy, inherited: inherited, path: rolePath, name: role.label, disabled: effectiveDisabled, actions: actions }), role.id === "dsmm-orchestrator" ? _jsxs("div", { className: "dsmm-field", children: [_jsx("p", { className: "dsmm-hint", children: t("orchestratorInBasicNotice") }), onJumpToOrchestrator && _jsx(Button, { type: "button", variant: "outline", onClick: onJumpToOrchestrator, children: t("orchestratorJumpToBasic") }), _jsx("p", { className: "dsmm-hint", children: t("orchestratorLevels") })] }) : _jsxs(_Fragment, { children: [_jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-primary-mode`, children: t("primaryMode", { name: role.label }) }), _jsxs("select", { id: `${prefix}-primary-mode`, disabled: effectiveDisabled, value: policy.primary === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...rolePath, "primary"], event.currentTarget.value === "inherit" ? undefined : { provider: "", model: "" }), children: [_jsx("option", { value: "inherit", children: t("inheritRoute") }), _jsx("option", { value: "explicit", children: t("configuredRoute") })] })] }), policy.primary !== undefined && _jsx(RouteFields, { t: t, value: policy.primary, path: [...rolePath, "primary"], name: t("primaryName", { name: role.label }), catalog: state.catalog, disabled: effectiveDisabled, edit: actions.editPath, editRoute: actions.editRoute }), _jsx("p", { className: "dsmm-hint", children: t("effortChangeHint") }), _jsx("p", { className: "dsmm-hint", children: t("normalLevel") }), _jsx("p", { className: "dsmm-hint", children: t("levelsHint") }), ["low", "high", "max"].map(level => _jsx(LevelFields, { level: level, value: policy.levels?.[level], path: [...rolePath, "levels", level], catalog: state.catalog, disabled: effectiveDisabled, actions: actions, t: t }, level))] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-fallback-mode`, children: t("fallbackMode", { name: role.label }) }), _jsxs("select", { id: `${prefix}-fallback-mode`, disabled: effectiveDisabled, value: policy.fallbackRoutes === undefined ? "inherit" : "explicit", onChange: (event) => actions.editPath([...rolePath, "fallbackRoutes"], event.currentTarget.value === "inherit" ? undefined : []), children: [_jsx("option", { value: "inherit", children: t("inheritChain") }), _jsx("option", { value: "explicit", children: t("configuredChain") })] })] }), policy.fallbackRoutes?.length === 0 && _jsx("p", { className: "dsmm-hint", children: t("emptyChain") }), policy.fallbackRoutes?.map((candidate, index) => {
|
|
73
121
|
const name = t("fallbackName", { name: role.label, index: index + 1 });
|
|
74
|
-
return _jsxs("fieldset", { children: [_jsx("legend", { children: name }), _jsx(RouteFields, { t: t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name, catalog: state.catalog, disabled:
|
|
75
|
-
}), _jsx(Button, { type: "button", variant: "outline", disabled:
|
|
122
|
+
return _jsxs("fieldset", { children: [_jsx("legend", { children: name }), _jsx(RouteFields, { t: t, value: candidate, path: [...rolePath, "fallbackRoutes", index], name: name, catalog: state.catalog, disabled: effectiveDisabled, edit: actions.editPath, editRoute: actions.editRoute }), _jsxs("div", { className: "dsmm-actions", children: [_jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === 0, onClick: () => actions.moveFallback(role.id, index, index - 1), children: t("moveUp", { name }) }), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || index === policy.fallbackRoutes.length - 1, onClick: () => actions.moveFallback(role.id, index, index + 1), children: t("moveDown", { name }) }), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled, onClick: () => actions.editPath([...rolePath, "fallbackRoutes", index], undefined), children: t("removeFallback", { name }) })] })] }, index);
|
|
123
|
+
}), _jsx(Button, { type: "button", variant: "outline", disabled: effectiveDisabled || (policy.fallbackRoutes?.length ?? 0) >= 32, onClick: () => {
|
|
76
124
|
if (policy.fallbackRoutes === undefined)
|
|
77
125
|
actions.editPath([...rolePath, "fallbackRoutes"], [{ provider: "", model: "" }]);
|
|
78
126
|
else
|
|
79
127
|
actions.editPath([...rolePath, "fallbackRoutes", policy.fallbackRoutes.length], { provider: "", model: "" });
|
|
80
|
-
}, children: t("addFallback", { name: role.label }) })] }, role.id)] });
|
|
128
|
+
}, children: t("addFallback", { name: role.label }) })] }, role.id), _jsxs("fieldset", { children: [_jsx("legend", { children: t("profileDefaults") }), _jsx(PolicyFields, { t: t, value: document.runtimePolicy, inherited: baseline, path: ["settings", "runtimePolicy"], name: t("profileDefaults"), disabled: effectiveDisabled, actions: actions })] }), _jsxs("fieldset", { className: "dsmm-git-guard", children: [_jsx("legend", { children: t("gitWriteGuard") }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-guard`, children: t("gitWriteGuard") }), _jsxs("select", { id: `${prefix}-git-guard`, disabled: effectiveDisabled, value: gitGuard ?? "", "aria-describedby": `${prefix}-git-guard-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteGuard"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "ask", children: t("gitWriteAsk") }), _jsx("option", { value: "deny", children: t("gitWriteDeny") }), _jsx("option", { value: "off", children: t("gitWriteOff") })] }), _jsx("p", { id: `${prefix}-git-guard-hint`, className: "dsmm-hint", children: t("gitWriteGuardHint") })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-git-scope`, children: t("gitWriteScope") }), _jsxs("select", { id: `${prefix}-git-scope`, disabled: effectiveDisabled, value: gitScope ?? "", "aria-describedby": `${prefix}-git-scope-hint`, onChange: event => actions.editPath(["settings", "guards", "gitWriteScope"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "all-writes", disabled: isGuardOff, children: t("gitWriteAllWrites") }), _jsx("option", { value: "high-risk", disabled: isGuardOff, children: t("gitWriteHighRisk") })] }), isGuardOff && _jsx("p", { id: `${prefix}-git-scope-hint`, className: "dsmm-hint", children: t("gitWriteScopeDisabledHint") })] })] }), _jsxs("div", { className: "dsmm-field", children: [_jsx("label", { htmlFor: `${prefix}-topology`, children: t("toolTopology") }), _jsxs("select", { id: `${prefix}-topology`, value: topology ?? "", disabled: effectiveDisabled, "aria-describedby": `${prefix}-topology-hint`, onChange: event => actions.editPath(["settings", "subagents", "toolTopology"], event.currentTarget.value || undefined), children: [_jsx("option", { value: "", children: t("inherit") }), _jsx("option", { value: "per-role", children: t("topologyPerRole") }), _jsx("option", { value: "parameterized", children: t("topologyParameterized") })] }), _jsx("p", { id: `${prefix}-topology-hint`, className: "dsmm-hint", children: t("topologyHint") })] })] });
|
|
129
|
+
}
|
|
130
|
+
/** The same raw draft drives every control; there is no form-to-document rewrite. */
|
|
131
|
+
export function StructuredEditor({ state, actions, disabled, t }) {
|
|
132
|
+
return _jsxs("div", { className: "dsmm-structured", "data-dsmm-structured": true, children: [_jsx(BasicSettings, { state: state, actions: actions, disabled: disabled, t: t }), _jsx(AdvancedSettings, { state: state, actions: actions, disabled: disabled, t: t })] });
|
|
81
133
|
}
|
|
82
134
|
//# sourceMappingURL=StructuredEditor.js.map
|
|
@@ -66,6 +66,7 @@ export interface ProfilesActions {
|
|
|
66
66
|
save(): Promise<void>;
|
|
67
67
|
apply(): Promise<void>;
|
|
68
68
|
reset(): Promise<void>;
|
|
69
|
+
discard(): void;
|
|
69
70
|
discardAndOpen(): Promise<void>;
|
|
70
71
|
cancelDiscard(): void;
|
|
71
72
|
editPath(path: JsonPath, value: unknown): void;
|
|
@@ -79,6 +80,13 @@ export interface ProfilesActions {
|
|
|
79
80
|
setDeepwork(active: boolean): Promise<void>;
|
|
80
81
|
useSessionProfileModel(): Promise<void>;
|
|
81
82
|
setFieldInvalid(field: string, invalid: boolean): void;
|
|
83
|
+
setNumberDraft(key: string, entry: NumberDraftState | null): void;
|
|
84
|
+
getNumberDraft(key: string): NumberDraftState | undefined;
|
|
85
|
+
}
|
|
86
|
+
export interface NumberDraftState {
|
|
87
|
+
draft: string;
|
|
88
|
+
invalid: boolean;
|
|
89
|
+
sourceValue: number | undefined;
|
|
82
90
|
}
|
|
83
91
|
export interface ModelCatalogRemote {
|
|
84
92
|
modelCatalog(): Promise<RemoteResult<ModelCatalog>>;
|
|
@@ -131,6 +139,7 @@ export declare class ProfilesController {
|
|
|
131
139
|
subscribe: (listener: () => void) => (() => void);
|
|
132
140
|
};
|
|
133
141
|
readonly actions: ProfilesActions;
|
|
142
|
+
private numberDrafts;
|
|
134
143
|
constructor(remote: DsmmProfilesRemote);
|
|
135
144
|
dispose(): void;
|
|
136
145
|
bindConnection(source: ConnectionGenerationState | null): void;
|
|
@@ -157,6 +166,7 @@ export declare class ProfilesController {
|
|
|
157
166
|
refresh(): Promise<void>;
|
|
158
167
|
open(id: string): Promise<void>;
|
|
159
168
|
reload(): Promise<void>;
|
|
169
|
+
discard(): void;
|
|
160
170
|
private loadEditor;
|
|
161
171
|
discardAndOpen(): Promise<void>;
|
|
162
172
|
private editId;
|
package/lib/client/controller.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isProfileId } from "../profile-remote.js";
|
|
|
2
2
|
import { safeIssue } from "./diagnostics.js";
|
|
3
3
|
import { isConfigRevision } from "../config-revision.js";
|
|
4
4
|
import { writableSelectionVersion } from "./configuration-display.js";
|
|
5
|
-
import { editStructuredPath, moveFallback } from "./structured.js";
|
|
5
|
+
import { editStructuredPath, moveFallback, structuredDocument } from "./structured.js";
|
|
6
6
|
function modelSelectionWatermark(window) {
|
|
7
7
|
let watermark = -1;
|
|
8
8
|
for (const entry of window.entries)
|
|
@@ -73,6 +73,7 @@ export class ProfilesController {
|
|
|
73
73
|
refresh: () => this.refresh(), open: (id) => this.open(id), create: () => this.open(NEW_EDITOR), reload: () => this.reload(),
|
|
74
74
|
editId: (id) => this.editId(id), editContent: (content) => this.editContent(content),
|
|
75
75
|
save: () => this.save(), apply: () => this.apply(), reset: () => this.reset(),
|
|
76
|
+
discard: () => this.discard(),
|
|
76
77
|
discardAndOpen: () => this.discardAndOpen(), cancelDiscard: () => this.publish({ pendingEditor: null }),
|
|
77
78
|
editPath: (path, value) => this.editPath(path, value), moveFallback: (role, from, to) => this.editFallbackOrder(role, from, to),
|
|
78
79
|
editRoute: (path, provider, model) => this.editRoute(path, provider, model),
|
|
@@ -90,11 +91,23 @@ export class ProfilesController {
|
|
|
90
91
|
if (invalidFields.join("\n") !== this.current.invalidFields.join("\n"))
|
|
91
92
|
this.publish({ invalidFields, ...(invalid ? { dirty: true } : {}) });
|
|
92
93
|
},
|
|
94
|
+
setNumberDraft: (key, entry) => {
|
|
95
|
+
if (this.disposed)
|
|
96
|
+
return;
|
|
97
|
+
if (entry === null) {
|
|
98
|
+
this.numberDrafts.delete(key);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
this.numberDrafts.set(key, entry);
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
getNumberDraft: (key) => this.numberDrafts.get(key),
|
|
93
105
|
};
|
|
106
|
+
numberDrafts = new Map();
|
|
94
107
|
constructor(remote) {
|
|
95
108
|
this.remote = remote;
|
|
96
109
|
}
|
|
97
|
-
dispose() { this.releaseComposerBlock(); this.stopConnection?.(); this.disposed = true; this.generation += 1; this.sessionGeneration += 1; this.catalogGeneration += 1; this.modelSelectorGeneration += 1; this.modelSelectionGeneration += 1; this.stopModelSelection?.(); this.stopModelEvents?.(); this.stopModelInteraction?.(); this.stopModelSelection = null; this.stopModelEvents = null; this.stopModelInteraction = null; this.modelSelectionSource = null; this.modelEvents = null; this.modelInteraction = null; this.catalogRemote = null; this.modelSelector = null; this.listeners.clear(); }
|
|
110
|
+
dispose() { this.releaseComposerBlock(); this.numberDrafts.clear(); this.stopConnection?.(); this.disposed = true; this.generation += 1; this.sessionGeneration += 1; this.catalogGeneration += 1; this.modelSelectorGeneration += 1; this.modelSelectionGeneration += 1; this.stopModelSelection?.(); this.stopModelEvents?.(); this.stopModelInteraction?.(); this.stopModelSelection = null; this.stopModelEvents = null; this.stopModelInteraction = null; this.modelSelectionSource = null; this.modelEvents = null; this.modelInteraction = null; this.catalogRemote = null; this.modelSelector = null; this.listeners.clear(); }
|
|
98
111
|
bindConnection(source) {
|
|
99
112
|
if (this.disposed)
|
|
100
113
|
return;
|
|
@@ -438,6 +451,7 @@ export class ProfilesController {
|
|
|
438
451
|
listener();
|
|
439
452
|
}
|
|
440
453
|
accept(document) {
|
|
454
|
+
this.numberDrafts.clear();
|
|
441
455
|
this.accepted = { ...document };
|
|
442
456
|
this.publish({ editor: { ...document }, dirty: false, pendingEditor: null, invalidFields: [], editorEpoch: this.current.editorEpoch + 1 });
|
|
443
457
|
}
|
|
@@ -490,7 +504,7 @@ export class ProfilesController {
|
|
|
490
504
|
return;
|
|
491
505
|
if (id !== NEW_EDITOR && this.current.editor?.id === id)
|
|
492
506
|
return;
|
|
493
|
-
if (this.current.dirty) {
|
|
507
|
+
if (this.current.dirty || this.current.invalidFields.length > 0) {
|
|
494
508
|
this.publish({ pendingEditor: id });
|
|
495
509
|
return;
|
|
496
510
|
}
|
|
@@ -500,14 +514,23 @@ export class ProfilesController {
|
|
|
500
514
|
const editor = this.current.editor;
|
|
501
515
|
if (editor === null || editor.revision === null || this.current.busy !== null || this.current.pendingEditor !== null)
|
|
502
516
|
return;
|
|
503
|
-
if (this.current.dirty) {
|
|
517
|
+
if (this.current.dirty || this.current.invalidFields.length > 0) {
|
|
504
518
|
this.publish({ pendingEditor: editor.id });
|
|
505
519
|
return;
|
|
506
520
|
}
|
|
507
521
|
await this.loadEditor(editor.id);
|
|
508
522
|
}
|
|
523
|
+
discard() {
|
|
524
|
+
const editor = this.current.editor;
|
|
525
|
+
if (this.disposed || editor === null || this.current.busy !== null || this.current.pendingEditor !== null)
|
|
526
|
+
return;
|
|
527
|
+
if (!this.current.dirty && this.current.invalidFields.length === 0)
|
|
528
|
+
return;
|
|
529
|
+
this.publish({ pendingEditor: editor.revision === null ? NEW_EDITOR : editor.id });
|
|
530
|
+
}
|
|
509
531
|
async loadEditor(id) {
|
|
510
532
|
if (id === NEW_EDITOR) {
|
|
533
|
+
this.numberDrafts.clear();
|
|
511
534
|
this.accepted = null;
|
|
512
535
|
this.publish({ editor: { id: "new-profile", content: NEW_PROFILE_CONTENT, revision: null }, dirty: true, issue: null, notice: null, pendingEditor: null, invalidFields: [], editorEpoch: this.current.editorEpoch + 1 });
|
|
513
536
|
return;
|
|
@@ -523,14 +546,7 @@ export class ProfilesController {
|
|
|
523
546
|
if (wanted === null || this.current.busy !== null)
|
|
524
547
|
return;
|
|
525
548
|
this.publish({ pendingEditor: null });
|
|
526
|
-
// Only explicit confirmation clears a draft; a failed read restores it.
|
|
527
|
-
const previous = this.current.editor;
|
|
528
|
-
const accepted = this.accepted;
|
|
529
549
|
await this.loadEditor(wanted);
|
|
530
|
-
if (this.current.issue !== null && previous !== null) {
|
|
531
|
-
this.accepted = accepted;
|
|
532
|
-
this.publish({ editor: previous, dirty: true });
|
|
533
|
-
}
|
|
534
550
|
}
|
|
535
551
|
editId(id) {
|
|
536
552
|
const editor = this.current.editor;
|
|
@@ -547,7 +563,21 @@ export class ProfilesController {
|
|
|
547
563
|
const editor = this.current.editor;
|
|
548
564
|
if (editor === null || editor.refreshRequired || this.current.busy !== null || this.current.pendingEditor !== null)
|
|
549
565
|
return;
|
|
550
|
-
|
|
566
|
+
const document = structuredDocument(content);
|
|
567
|
+
let invalidFields = this.current.invalidFields;
|
|
568
|
+
if (document !== null) {
|
|
569
|
+
for (const [key, draft] of this.numberDrafts) {
|
|
570
|
+
let value = document;
|
|
571
|
+
for (const segment of key.split(".")) {
|
|
572
|
+
value = value !== null && typeof value === "object" && Object.hasOwn(value, segment) ? value[segment] : undefined;
|
|
573
|
+
}
|
|
574
|
+
if (value !== draft.sourceValue) {
|
|
575
|
+
this.numberDrafts.delete(key);
|
|
576
|
+
invalidFields = invalidFields.filter(field => field !== key);
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
this.publish({ editor: { ...editor, content }, invalidFields, dirty: this.accepted === null || this.accepted.content !== content || this.accepted.id !== editor.id, issue: null, notice: null });
|
|
551
581
|
}
|
|
552
582
|
editPath(path, value) {
|
|
553
583
|
const editor = this.current.editor;
|
|
@@ -604,8 +634,8 @@ export class ProfilesController {
|
|
|
604
634
|
});
|
|
605
635
|
}
|
|
606
636
|
async apply() {
|
|
607
|
-
const { editor, snapshot, dirty } = this.current;
|
|
608
|
-
if (editor?.refreshRequired || !isConfigRevision(editor?.revision) || !canReconcileSelection(snapshot) || dirty)
|
|
637
|
+
const { editor, snapshot, dirty, invalidFields } = this.current;
|
|
638
|
+
if (editor?.refreshRequired || !isConfigRevision(editor?.revision) || !canReconcileSelection(snapshot) || dirty || invalidFields.length > 0)
|
|
609
639
|
return;
|
|
610
640
|
await this.perform("apply", async (live) => {
|
|
611
641
|
const accepted = await this.unwrap(this.remote.select({ id: editor.id, expectedRevision: editor.revision, expectedSelectionRevision: snapshot.selectionRevision }));
|
package/lib/client/locales.d.ts
CHANGED
|
@@ -77,6 +77,39 @@ export declare const en: {
|
|
|
77
77
|
headerUseCurrentModel: string;
|
|
78
78
|
title: string;
|
|
79
79
|
description: string;
|
|
80
|
+
effectiveSummary: string;
|
|
81
|
+
futureDefaultSummary: string;
|
|
82
|
+
currentSessionSummary: string;
|
|
83
|
+
locateSessionScope: string;
|
|
84
|
+
moreActions: string;
|
|
85
|
+
futureResetHint: string;
|
|
86
|
+
basicSettings: string;
|
|
87
|
+
profileIdHint: string;
|
|
88
|
+
orchestratorModel: string;
|
|
89
|
+
orchestratorModelDesc: string;
|
|
90
|
+
orchestratorUnavailable: string;
|
|
91
|
+
orchestratorInBasicNotice: string;
|
|
92
|
+
orchestratorJumpToBasic: string;
|
|
93
|
+
useSessionProfileModelDesc: string;
|
|
94
|
+
rawInvalidFormDisabled: string;
|
|
95
|
+
viewConfiguration: string;
|
|
96
|
+
advancedSettings: string;
|
|
97
|
+
gitWriteGuard: string;
|
|
98
|
+
gitWriteScope: string;
|
|
99
|
+
gitWriteScopeDisabledHint: string;
|
|
100
|
+
gitWriteGuardHint: string;
|
|
101
|
+
gitWriteAsk: string;
|
|
102
|
+
gitWriteDeny: string;
|
|
103
|
+
gitWriteOff: string;
|
|
104
|
+
gitWriteAllWrites: string;
|
|
105
|
+
gitWriteHighRisk: string;
|
|
106
|
+
topologyPerRole: string;
|
|
107
|
+
topologyParameterized: string;
|
|
108
|
+
roleModels: string;
|
|
109
|
+
callingLevels: string;
|
|
110
|
+
fallbackRoutes: string;
|
|
111
|
+
retryPolicy: string;
|
|
112
|
+
roleRoutingNotice: string;
|
|
80
113
|
newSessions: string;
|
|
81
114
|
editorSelect: string;
|
|
82
115
|
choose: string;
|
|
@@ -237,6 +270,9 @@ export declare const en: {
|
|
|
237
270
|
unset: string;
|
|
238
271
|
effortDefault: string;
|
|
239
272
|
effortChangeHint: string;
|
|
273
|
+
naturalProvider: string;
|
|
274
|
+
naturalModel: string;
|
|
275
|
+
naturalEffort: string;
|
|
240
276
|
advanced: string;
|
|
241
277
|
rawInvalid: string;
|
|
242
278
|
invalidNumber: string;
|
package/lib/client/locales.js
CHANGED
|
@@ -9,7 +9,7 @@ export const en = {
|
|
|
9
9
|
browseZone: "Saved profiles", editZone: "Edit profile", savedRevision: "Version: {revision}", savedInventory: "Warnings and errors", futurePin: "Default version: {revision}", noEditor: "Choose a profile or create one to edit.",
|
|
10
10
|
warningMarker: "Warning · {code} · {field}", blockingMarker: "Error · {code} · {field}", blankLabelWarning: "The label is blank, so the ID is shown instead. The profile can still be saved and selected.", diagnosticLocation: "Line {line}, column {column}.",
|
|
11
11
|
savedWarnings: "Warnings in the saved version", draftWarnings: "Warnings in this draft", futureWarnings: "Warnings for new sessions", admissionWarnings: "Warnings for this session", warningProfile: "has warnings",
|
|
12
|
-
omitLabel: "Use the ID as the name", businessLocale: "Output language", inheritLocale: "
|
|
12
|
+
omitLabel: "Use the ID as the name", businessLocale: "Output language", inheritLocale: "Inherit plugin configuration", unsupportedLocale: "Choose a supported language", localeHint: "Inherits plugin configuration and Host/user guidance when unset. An explicit request in the conversation still decides the reply language.",
|
|
13
13
|
toolTopology: "Subagent tools", topologyHint: "per-role: one tool per role, plus one category tool. parameterized: pick the role or category in the tool arguments.",
|
|
14
14
|
levelName: "Level: {level}", levelMode: "{level} override", levelUnconfigured: "Use the deployment level", levelEffortOnly: "Reasoning effort only", levelFullRoute: "Provider, model and effort", normalLevel: "normal · default route", orchestratorLevels: "The orchestrator has no invocation levels.", levelsHint: "Only configured levels can be used. Reasoning effort only keeps the configured model; a full route replaces model and effort.",
|
|
15
15
|
namedRole: "Enable {name}", namedRoleHint: "Required roles stay enabled. Roles disabled by the deployment cannot be enabled here.", availabilityUnknown: "Role availability is unknown. Refresh before changing it.", roleRequired: "Required · {reason}", roleOptional: "Optional", roleCeiling: "Startup: {startup}; deployment: {deployment}; current: {admitted}.", roleProvenance: "Source: {source}; capture: {capture}.", roleUnavailableReason: "Reason: {reason}.",
|
|
@@ -19,13 +19,27 @@ export const en = {
|
|
|
19
19
|
sessionNewRequired: "Start a new session to change its profile. You can still save profiles and set the default for new sessions.",
|
|
20
20
|
sessionModuleOff: "Deepwork is unavailable in this session.",
|
|
21
21
|
headerModeEnable: "Enable Deepwork", headerModeDisable: "Disable Deepwork", headerModePreset: "Deepwork · DW preset", headerModeUnavailable: "Deepwork unavailable", headerModeOn: "Deepwork enabled.", headerModeOff: "Deepwork disabled.", headerUseCurrentModel: "Use profile model",
|
|
22
|
-
title: "
|
|
22
|
+
title: "Profiles", description: "Save Deepwork configurations; saving and activation are separate operations.",
|
|
23
|
+
effectiveSummary: "Effective summary", futureDefaultSummary: "Future default:", currentSessionSummary: "This session:",
|
|
24
|
+
locateSessionScope: "Select session profile", moreActions: "More actions", futureResetHint: "Restore new sessions to inherit the deployment baseline.",
|
|
25
|
+
basicSettings: "Basic settings", profileIdHint: "Editable when creating; read-only after saving.",
|
|
26
|
+
orchestratorModel: "Orchestrator model", orchestratorModelDesc: "Configure the primary model for the orchestrator role; saving does not switch the current session model.",
|
|
27
|
+
orchestratorUnavailable: "The current role inventory does not include the orchestrator. Refresh to check; its stored configuration is kept.",
|
|
28
|
+
orchestratorInBasicNotice: "The orchestrator model is configured above in Basic settings.", orchestratorJumpToBasic: "Edit in Basic settings",
|
|
29
|
+
useSessionProfileModelDesc: "Uses the primary model of the profile currently admitted in this session; has the same effect as native model selection and may update the native default model.",
|
|
30
|
+
rawInvalidFormDisabled: "The configuration has syntax errors; structured editing is unavailable.", viewConfiguration: "View JSONC source",
|
|
31
|
+
advancedSettings: "Advanced settings", gitWriteGuard: "Git write protection", gitWriteScope: "Inspection scope",
|
|
32
|
+
gitWriteScopeDisabledHint: "Protection is off; inspection scope is inactive",
|
|
33
|
+
gitWriteGuardHint: "Inspection scope adjusts automatic Git protection only; explicit ask/deny still applies. Turning off does not authorize operations.",
|
|
34
|
+
gitWriteAsk: "Ask", gitWriteDeny: "Deny", gitWriteOff: "Off", gitWriteAllWrites: "All Git write operations", gitWriteHighRisk: "High-risk Git operations only",
|
|
35
|
+
topologyPerRole: "One tool per role", topologyParameterized: "Select role in tool arguments",
|
|
36
|
+
roleModels: "Role models and availability", callingLevels: "Calling levels", fallbackRoutes: "Fallback routes", retryPolicy: "Retry policy", roleRoutingNotice: "Role routing configuration",
|
|
23
37
|
newSessions: "Choose the configuration new sessions use. Existing sessions stay unchanged.",
|
|
24
38
|
editorSelect: "Profile", choose: "Choose a profile", newDraft: "New unsaved profile", new: "New profile",
|
|
25
39
|
profileId: "Profile ID", idHint: "1–64 lowercase letters, digits, hyphens or underscores. It cannot be changed after saving.",
|
|
26
40
|
configuration: "Configuration (JSONC)", configurationHint: "Use version: 1, the ID above, and settings. An optional label sets the name.",
|
|
27
41
|
structuralHint: "Permissions, accounts and plugins are managed in app settings.",
|
|
28
|
-
save: "Save", saving: "Saving…", apply: "Set as default for new sessions", applying: "Setting default…", reset: "
|
|
42
|
+
save: "Save", saving: "Saving…", apply: "Set as default for new sessions", applying: "Setting default…", reset: "New sessions: use plugin defaults", resetting: "Restoring default…",
|
|
29
43
|
refresh: "Refresh", refreshing: "Refreshing…", reload: "Reload saved version", loading: "Loading…", reading: "Reading…",
|
|
30
44
|
empty: "No saved profiles yet. Create one to start.",
|
|
31
45
|
baseline: "Default configuration", appliedProfile: "{id}",
|
|
@@ -34,7 +48,7 @@ export const en = {
|
|
|
34
48
|
dirty: "Unsaved changes. Save or discard them before choosing this profile.", savedNotApplied: "Saved; not the default for new sessions.", savedApplied: "Saved; this is the default for new sessions.",
|
|
35
49
|
versionObserved: "Available", versionAbsent: "Not saved", versionUnknown: "Unknown", savedRelationshipUnknown: "Saved; refresh to check whether it is the default.", savedRefreshRequired: "Saved. Reload before editing or choosing again.",
|
|
36
50
|
saved: "Saved {id}.", applied: "New sessions will use {id}. Existing sessions stay unchanged.", resetDone: "New sessions will use the default configuration. Existing sessions stay unchanged.",
|
|
37
|
-
discardPrompt: "Discard the unsaved draft?", discard: "Discard", cancel: "Cancel",
|
|
51
|
+
discardPrompt: "Discard the unsaved draft?", discard: "Discard changes", cancel: "Cancel",
|
|
38
52
|
conflict: "The saved file or selection changed elsewhere. Your draft was kept. Refresh, then reload the profile or review your draft before retrying.",
|
|
39
53
|
validation: "This profile is not valid. Fix the field below; your draft is unchanged.",
|
|
40
54
|
io: "Could not save. Your draft was kept. Check access to the profile storage and retry.",
|
|
@@ -58,7 +72,7 @@ export const en = {
|
|
|
58
72
|
sessionGlobalCaptured: "Current configuration (profile unknown)",
|
|
59
73
|
sessionAdmittedProfile: "{id}", sessionFutureDefault: "Default for new sessions: {profile}.",
|
|
60
74
|
sessionConflict: "The session configuration changed elsewhere. Your draft was kept. Refresh before retrying.",
|
|
61
|
-
sessionApply: "Use this profile", sessionApplying: "Applying…", sessionReset: "
|
|
75
|
+
sessionApply: "Use this profile", sessionApplying: "Applying…", sessionReset: "This session: use plugin defaults", sessionResetting: "Restoring default…", sessionRefresh: "Refresh session state",
|
|
62
76
|
sessionApplied: "Applied to this session only. The default for new sessions and existing children stay unchanged.", sessionResetDone: "This session uses the default configuration. The default for new sessions stays unchanged.",
|
|
63
77
|
sessionAppliedWithModel: "Applied this profile and selected its model. The global profile default was not changed.",
|
|
64
78
|
sessionDirty: "Save or discard the draft before choosing a configuration for this session.",
|
|
@@ -74,6 +88,7 @@ export const en = {
|
|
|
74
88
|
primaryMode: "{name} primary route", inheritRoute: "Inherit the deployment route", configuredRoute: "Configure the primary route", primaryName: "{name} primary",
|
|
75
89
|
fallbackMode: "{name} fallback chain", inheritChain: "Inherit the deployment chain", configuredChain: "Explicit ordered chain", emptyChain: "Empty chain: no fallback routes.", fallbackName: "{name} fallback {index}", addFallback: "Add fallback for {name}", removeFallback: "Remove {name}", moveUp: "Move up {name}", moveDown: "Move down {name}",
|
|
76
90
|
routeProvider: "{name} provider", routeModel: "{name} model", routeEffort: "{name} effort", manualProvider: "{name} provider (typed)", manualModel: "{name} model (typed)", manualEffort: "{name} effort (typed)", manual: "Type an identifier", manualValue: "Not listed: {value}", unset: "not set", effortDefault: "Default (no explicit effort)", effortChangeHint: "Changing the provider or model clears this route's reasoning effort.",
|
|
91
|
+
naturalProvider: "Provider", naturalModel: "Model", naturalEffort: "Reasoning Effort",
|
|
77
92
|
advanced: "Advanced JSONC", rawInvalid: "Fix the invalid draft in Advanced JSONC to use these controls. Your draft was kept.", invalidNumber: "Enter a whole number within the limits.",
|
|
78
93
|
};
|
|
79
94
|
export const zh = {
|
|
@@ -86,7 +101,7 @@ export const zh = {
|
|
|
86
101
|
browseZone: "已保存配置", editZone: "编辑配置", savedRevision: "版本:{revision}", savedInventory: "警告与错误", futurePin: "默认版本:{revision}", noEditor: "选择或新建配置后进行编辑。",
|
|
87
102
|
warningMarker: "警告 · {code} · {field}", blockingMarker: "错误 · {code} · {field}", blankLabelWarning: "名称为空,将显示 ID。该配置仍可保存和选择。", diagnosticLocation: "第 {line} 行,第 {column} 列。",
|
|
88
103
|
savedWarnings: "已保存版本的警告", draftWarnings: "此草稿的警告", futureWarnings: "新会话的警告", admissionWarnings: "本次会话的警告", warningProfile: "有警告",
|
|
89
|
-
omitLabel: "使用 ID 作为名称", businessLocale: "输出语言", inheritLocale: "
|
|
104
|
+
omitLabel: "使用 ID 作为名称", businessLocale: "输出语言", inheritLocale: "继承插件配置", unsupportedLocale: "请选择支持的语言", localeHint: "未设置时继承插件配置与 Host/用户指导;对话中的明确要求仍然决定回复语言。",
|
|
90
105
|
toolTopology: "子代理工具", topologyHint: "per-role:每个角色一个工具,另有一个类别工具。parameterized:在工具参数中选择角色或类别。",
|
|
91
106
|
levelName: "等级:{level}", levelMode: "{level} 覆盖", levelUnconfigured: "使用部署等级", levelEffortOnly: "仅推理强度", levelFullRoute: "提供商、模型与强度", normalLevel: "normal · 默认路由", orchestratorLevels: "orchestrator 没有调用等级。", levelsHint: "只有已配置的等级可用。仅强度会保留配置中的模型;完整路由会同时替换模型和强度。",
|
|
92
107
|
namedRole: "启用 {name}", namedRoleHint: "必需角色保持启用;部署已禁用的角色无法在此启用。", availabilityUnknown: "角色可用性未知,请刷新后再改。", roleRequired: "必需 · {reason}", roleOptional: "可选", roleCeiling: "启动:{startup};部署:{deployment};当前:{admitted}。", roleProvenance: "来源:{source};捕获:{capture}。", roleUnavailableReason: "原因:{reason}。",
|
|
@@ -95,14 +110,28 @@ export const zh = {
|
|
|
95
110
|
headerCompactProfiles: "配置 · 保留模型", headerCompactRefresh: "刷新", headerNoSession: "选择会话后可更改。",
|
|
96
111
|
sessionNewRequired: "请新建会话后更改其配置。仍可保存配置或设置新会话的默认配置。",
|
|
97
112
|
sessionModuleOff: "此会话无法使用 Deepwork。",
|
|
98
|
-
headerModeEnable: "启用 Deepwork", headerModeDisable: "关闭 Deepwork", headerModePreset: "Deepwork · DW 预设", headerModeUnavailable: "Deepwork 不可用", headerModeOn: "Deepwork 已启用。", headerModeOff: "Deepwork 已关闭。", headerUseCurrentModel: "
|
|
99
|
-
title: "
|
|
113
|
+
headerModeEnable: "启用 Deepwork", headerModeDisable: "关闭 Deepwork", headerModePreset: "Deepwork · DW 预设", headerModeUnavailable: "Deepwork 不可用", headerModeOn: "Deepwork 已启用。", headerModeOff: "Deepwork 已关闭。", headerUseCurrentModel: "切换会话模型",
|
|
114
|
+
title: "预设方案", description: "用于保存 Deepwork 配置;保存与生效是不同操作。",
|
|
115
|
+
effectiveSummary: "生效摘要", futureDefaultSummary: "新会话默认:", currentSessionSummary: "本次会话:",
|
|
116
|
+
locateSessionScope: "选择会话方案", moreActions: "更多生效操作", futureResetHint: "新会话将恢复为继承插件部署基线。",
|
|
117
|
+
basicSettings: "基础设置", profileIdHint: "新建时可编辑;保存后只读。",
|
|
118
|
+
orchestratorModel: "主协调模型", orchestratorModelDesc: "配置方案中的主协调角色;保存不会切换当前会话模型。",
|
|
119
|
+
orchestratorInBasicNotice: "主协调模型在上方「基础设置」中配置。", orchestratorJumpToBasic: "在基础设置中编辑",
|
|
120
|
+
useSessionProfileModelDesc: "使用本次会话已采用方案的角色主力模型;与原生模型选择具有相同效果,可能更新原生默认模型。",
|
|
121
|
+
orchestratorUnavailable: "当前角色库存未包含主协调角色,请刷新确认;已存配置会保留。",
|
|
122
|
+
rawInvalidFormDisabled: "配置内容有错误,暂时无法使用表单编辑", viewConfiguration: "查看配置内容",
|
|
123
|
+
advancedSettings: "高级设置", gitWriteGuard: "Git 写入保护", gitWriteScope: "检查范围",
|
|
124
|
+
gitWriteScopeDisabledHint: "保护已关闭,检查范围暂不生效",
|
|
125
|
+
gitWriteGuardHint: "检查范围只调整自动 Git 保护,显式 ask/deny 仍生效;关闭不代表授权。",
|
|
126
|
+
gitWriteAsk: "询问", gitWriteDeny: "禁止", gitWriteOff: "关闭", gitWriteAllWrites: "所有 Git 写操作", gitWriteHighRisk: "仅高危 Git 操作",
|
|
127
|
+
topologyPerRole: "每个角色独立入口", topologyParameterized: "统一入口中选择角色",
|
|
128
|
+
roleModels: "角色模型与可用性", callingLevels: "调用档位", fallbackRoutes: "备用模型", retryPolicy: "重试策略", roleRoutingNotice: "角色路由配置",
|
|
100
129
|
newSessions: "选择新会话使用的配置,已有会话不变。",
|
|
101
|
-
editorSelect: "
|
|
102
|
-
profileId: "
|
|
130
|
+
editorSelect: "方案", choose: "选择配置", newDraft: "未保存的新配置", new: "新建",
|
|
131
|
+
profileId: "方案 ID", idHint: "1–64 个小写字母、数字、连字符或下划线,保存后不可修改。",
|
|
103
132
|
configuration: "配置内容(JSONC)", configurationHint: "使用 version: 1、与上方一致的 ID 和 settings;label 可选,用于显示名称。",
|
|
104
133
|
structuralHint: "权限、账户和插件在应用设置中管理。",
|
|
105
|
-
save: "保存", saving: "正在保存…", apply: "
|
|
134
|
+
save: "保存", saving: "正在保存…", apply: "设为新会话默认", applying: "正在设置…", reset: "新会话使用插件默认", resetting: "正在恢复…",
|
|
106
135
|
refresh: "刷新", refreshing: "正在刷新…", reload: "重新加载已保存版本", loading: "加载中…", reading: "读取中…",
|
|
107
136
|
empty: "尚无已保存的配置,请先新建。",
|
|
108
137
|
baseline: "默认配置", appliedProfile: "{id}",
|
|
@@ -111,7 +140,7 @@ export const zh = {
|
|
|
111
140
|
dirty: "有未保存的更改,请先保存或丢弃再选择此配置。", savedNotApplied: "已保存,但不是新会话默认配置。", savedApplied: "已保存,是新会话默认配置。",
|
|
112
141
|
versionObserved: "可用", versionAbsent: "未保存", versionUnknown: "未知", savedRelationshipUnknown: "已保存,请刷新确认是否为默认配置。", savedRefreshRequired: "已保存,请重新加载后再编辑或选择。",
|
|
113
142
|
saved: "已保存 {id}。", applied: "新会话将使用 {id},已有会话不变。", resetDone: "新会话将使用默认配置,已有会话不变。",
|
|
114
|
-
discardPrompt: "是否丢弃未保存的草稿?", discard: "
|
|
143
|
+
discardPrompt: "是否丢弃未保存的草稿?", discard: "放弃更改", cancel: "取消",
|
|
115
144
|
conflict: "已保存文件或选择在别处改变,草稿已保留。请刷新后重新加载或检查草稿再重试。",
|
|
116
145
|
validation: "此配置无效,请修正下方字段;草稿未改变。",
|
|
117
146
|
io: "无法保存,草稿已保留。请检查配置存储权限后重试。",
|
|
@@ -135,22 +164,23 @@ export const zh = {
|
|
|
135
164
|
sessionGlobalCaptured: "当前配置(来源未知)",
|
|
136
165
|
sessionAdmittedProfile: "{id}", sessionFutureDefault: "新会话默认配置:{profile}。",
|
|
137
166
|
sessionConflict: "会话配置已在别处改变,草稿已保留。请刷新后重试。",
|
|
138
|
-
sessionApply: "
|
|
167
|
+
sessionApply: "应用到本次会话", sessionApplying: "正在应用…", sessionReset: "本次会话使用插件默认", sessionResetting: "正在恢复…", sessionRefresh: "刷新会话状态",
|
|
139
168
|
sessionApplied: "已仅应用到本次会话,新会话默认配置和已有子会话不变。", sessionResetDone: "本次会话已使用默认配置,新会话默认配置不变。",
|
|
140
169
|
sessionAppliedWithModel: "已应用此配置并选择了它的模型,全局配置默认值未改变。",
|
|
141
170
|
sessionDirty: "选择本次会话配置前,请保存或丢弃草稿。",
|
|
142
171
|
roleState: "路由 {route};策略 {strategy};重试 {retries};限流失败 {failures};切换 {switches};累计延迟 {delay} 毫秒。",
|
|
143
172
|
catalogTitle: "模型目录", catalogHint: "未列出的模型可以手动输入。",
|
|
144
173
|
catalogUnavailable: "模型目录不可用,提供商、模型和强度仍可填写。", catalogRefresh: "刷新模型目录", catalogRefreshing: "正在刷新…", catalogFailure: "提供商目录不可用:{name}({id})。",
|
|
145
|
-
profileLabel: "
|
|
174
|
+
profileLabel: "方案名称", defaultActive: "默认 Deepwork 模式", activeHint: "会话中选择的模式优先。", enabled: "启用", disabled: "禁用", inherit: "继承插件配置",
|
|
146
175
|
profileDefaults: "默认值", roleSelect: "角色", rolesUnavailable: "角色列表不可用,请刷新或使用高级编辑器。", roleEnabled: "应用设置中已启用", roleDisabled: "应用设置中已禁用",
|
|
147
|
-
strategy: "{name} 策略", inheritStrategy: "
|
|
176
|
+
strategy: "{name} 策略", inheritStrategy: "继承插件配置({value})", startupLock: "保留起始路由", rateFallback: "多次限流后切换",
|
|
148
177
|
strategyHint: "仅在限流且没有输出时切换模型;认证或配额错误会停止尝试。留空表示继承,零是明确值。",
|
|
149
178
|
retryField: "{name} {field}", inheritNumber: "继承 {value}", retryBounds: "整数 {min}–{max};继承值 {value}。", unknownDefault: "不可用",
|
|
150
179
|
retryCount: "重试次数", initialDelay: "初始延迟(毫秒)", maxDelay: "最大单次延迟(毫秒)", totalWait: "累计等待上限(毫秒)", switchThreshold: "切换前的限流次数", maxSwitches: "最大切换次数",
|
|
151
|
-
primaryMode: "{name} 主路由", inheritRoute: "
|
|
152
|
-
fallbackMode: "{name} 备用链", inheritChain: "
|
|
180
|
+
primaryMode: "{name} 主路由", inheritRoute: "继承插件配置", configuredRoute: "配置主路由", primaryName: "{name} 主路由",
|
|
181
|
+
fallbackMode: "{name} 备用链", inheritChain: "继承插件配置", configuredChain: "明确的有序备用链", emptyChain: "空备用链:没有备用路由。", fallbackName: "{name} 备用 {index}", addFallback: "为 {name} 添加备用", removeFallback: "移除 {name}", moveUp: "上移 {name}", moveDown: "下移 {name}",
|
|
153
182
|
routeProvider: "{name} 提供商", routeModel: "{name} 模型", routeEffort: "{name} 强度", manualProvider: "{name} 提供商(手动)", manualModel: "{name} 模型(手动)", manualEffort: "{name} 强度(手动)", manual: "输入标识", manualValue: "未列出:{value}", unset: "未设置", effortDefault: "默认(不指定强度)", effortChangeHint: "更改提供商或模型会清除该路由的推理强度。",
|
|
183
|
+
naturalProvider: "提供商", naturalModel: "模型", naturalEffort: "推理强度",
|
|
154
184
|
advanced: "高级 JSONC", rawInvalid: "请先在高级 JSONC 中修正草稿,再使用这些控件。草稿已保留。", invalidNumber: "请输入范围内的整数。",
|
|
155
185
|
};
|
|
156
186
|
export const RETRY_FIELD_LABEL_KEYS = {
|
|
@@ -8,7 +8,10 @@ export function sessionProfileLabels(session, t) {
|
|
|
8
8
|
const future = session.globalDefault;
|
|
9
9
|
return {
|
|
10
10
|
admitted: t("sessionState", { profile, scope: session.scope }),
|
|
11
|
-
futureDefault: t("sessionFutureDefault", {
|
|
11
|
+
futureDefault: t("sessionFutureDefault", {
|
|
12
|
+
profile: !future || future.selectedId === null ? t("sessionBaseline")
|
|
13
|
+
: t("sessionAdmittedProfile", { id: future.selectedId, revision: t(configurationVersionState(future.sourceRevision)) }),
|
|
14
|
+
}),
|
|
12
15
|
};
|
|
13
16
|
}
|
|
14
17
|
//# sourceMappingURL=session-labels.js.map
|