@morlay/dsh-session-mode 0.0.7 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/client.cjs CHANGED
@@ -6,6 +6,9 @@ window.__ModuleLoader__.load({
6
6
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
7
7
  //#region \0rolldown/runtime.js
8
8
  var __defProp = Object.defineProperty;
9
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
10
+ var __getOwnPropNames = Object.getOwnPropertyNames;
11
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
12
  var __exportAll = (all, no_symbols) => {
10
13
  let target = {};
11
14
  for (var name in all) __defProp(target, name, {
@@ -15,6 +18,17 @@ window.__ModuleLoader__.load({
15
18
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
19
  return target;
17
20
  };
21
+ var __copyProps = (to, from, except, desc) => {
22
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
23
+ key = keys[i];
24
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
25
+ get: ((k) => from[k]).bind(null, key),
26
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
27
+ });
28
+ }
29
+ return to;
30
+ };
31
+ var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
18
32
  //#endregion
19
33
  let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
20
34
  let _deepseek_ai_cordis = require("@deepseek-ai/cordis");
@@ -810,7 +824,7 @@ window.__ModuleLoader__.load({
810
824
  const name = Reflect.get(extra, "source");
811
825
  return typeof name === "string" && name.length > 0 ? name : void 0;
812
826
  }
813
- function fieldKey(path) {
827
+ function fieldKey$1(path) {
814
828
  return JSON.stringify(path);
815
829
  }
816
830
  function projectRoot(serialized, rehydrate) {
@@ -938,7 +952,7 @@ window.__ModuleLoader__.load({
938
952
  return this.#ns;
939
953
  }
940
954
  refresh() {
941
- this.#store.set(this.#project());
955
+ this.#sync();
942
956
  }
943
957
  dispose() {
944
958
  for (const dispose of this.#disposers.splice(0)) dispose();
@@ -974,23 +988,23 @@ window.__ModuleLoader__.load({
974
988
  const root = this.#root;
975
989
  const preview = this.#model.preview();
976
990
  const walked = root === void 0 ? [] : walkFields(root, preview);
977
- for (const item of walked) fields.set(fieldKey(item.path), this.#model.field(item.path, preview));
991
+ for (const item of walked) fields.set(fieldKey$1(item.path), this.#model.field(item.path, preview));
978
992
  const secrets = /* @__PURE__ */ new Map();
979
- for (const secret of this.#view?.secrets ?? []) secrets.set(fieldKey(secret.path), secret.set);
993
+ for (const secret of this.#view?.secrets ?? []) secrets.set(fieldKey$1(secret.path), secret.set);
980
994
  const texts = /* @__PURE__ */ new Map();
981
995
  const options = /* @__PURE__ */ new Map();
982
996
  const addable = /* @__PURE__ */ new Map();
983
997
  for (const item of walked) {
984
998
  const text = this.#deps.hints?.textFor(item.path);
985
- if (text !== void 0) texts.set(fieldKey(item.path), text);
999
+ if (text !== void 0) texts.set(fieldKey$1(item.path), text);
986
1000
  const candidates = optionsFor(item.node, item.path, preview, this.#deps.hints);
987
- if (candidates !== void 0) options.set(fieldKey(item.path), candidates);
1001
+ if (candidates !== void 0) options.set(fieldKey$1(item.path), candidates);
988
1002
  const addableHere = addableAt(item.node, item.path, readPath(preview, item.path), this.#deps.hints);
989
- if (addableHere.length > 0) addable.set(fieldKey(item.path), addableHere);
1003
+ if (addableHere.length > 0) addable.set(fieldKey$1(item.path), addableHere);
990
1004
  }
991
1005
  const violation = this.#model.violation();
992
1006
  const invalidAt = /* @__PURE__ */ new Map();
993
- if (violation !== void 0 && violation.path.length > 0) invalidAt.set(fieldKey(violation.path), violation.message);
1007
+ if (violation !== void 0 && violation.path.length > 0) invalidAt.set(fieldKey$1(violation.path), violation.message);
994
1008
  return {
995
1009
  ...this.#model.shell(),
996
1010
  configured: root !== void 0,
@@ -1300,17 +1314,17 @@ window.__ModuleLoader__.load({
1300
1314
  }
1301
1315
  }
1302
1316
  function visibleFields(state, fold) {
1303
- const containers = new Set(state.walked.filter((item) => containerShape(item.node, valueAt(state, item.path)) !== void 0).map((item) => fieldKey(item.path)));
1317
+ const containers = new Set(state.walked.filter((item) => containerShape(item.node, valueAt(state, item.path)) !== void 0).map((item) => fieldKey$1(item.path)));
1304
1318
  return state.walked.filter((item) => {
1305
1319
  for (let depth = 1; depth < item.path.length; depth++) {
1306
1320
  const ancestor = item.path.slice(0, depth);
1307
- if (containers.has(fieldKey(ancestor)) && fold.collapsed(ancestor)) return false;
1321
+ if (containers.has(fieldKey$1(ancestor)) && fold.collapsed(ancestor)) return false;
1308
1322
  }
1309
1323
  return true;
1310
1324
  });
1311
1325
  }
1312
1326
  function valueAt(state, path) {
1313
- return state.fields.get(fieldKey(path))?.value;
1327
+ return state.fields.get(fieldKey$1(path))?.value;
1314
1328
  }
1315
1329
  function addOf(node, shape, options) {
1316
1330
  if (shape === "array") return { kind: "item" };
@@ -1367,7 +1381,7 @@ window.__ModuleLoader__.load({
1367
1381
  const shape = containerShape(node, value);
1368
1382
  if (shape !== void 0) {
1369
1383
  const collapsed = fold.collapsed(item.path);
1370
- const add = addOf(node, shape, state.addable.get(fieldKey(item.path)) ?? []);
1384
+ const add = addOf(node, shape, state.addable.get(fieldKey$1(item.path)) ?? []);
1371
1385
  lines.push({
1372
1386
  kind: "open",
1373
1387
  path: item.path,
@@ -1393,7 +1407,7 @@ window.__ModuleLoader__.load({
1393
1407
  path: item.path,
1394
1408
  node,
1395
1409
  depth,
1396
- field: state.fields.get(fieldKey(item.path)) ?? {
1410
+ field: state.fields.get(fieldKey$1(item.path)) ?? {
1397
1411
  value: void 0,
1398
1412
  text: void 0,
1399
1413
  invalid: void 0,
@@ -1435,7 +1449,7 @@ window.__ModuleLoader__.load({
1435
1449
  return lines;
1436
1450
  }
1437
1451
  function commentFor(state, item, resolveText, t) {
1438
- const key = fieldKey(item.path);
1452
+ const key = fieldKey$1(item.path);
1439
1453
  const failure = state.fields.get(key)?.invalid ?? state.invalidAt.get(key);
1440
1454
  if (failure !== void 0) return {
1441
1455
  text: failure,
@@ -1443,7 +1457,7 @@ window.__ModuleLoader__.load({
1443
1457
  };
1444
1458
  const node = unwrapLazy(item.node) ?? item.node;
1445
1459
  const parts = [];
1446
- const text = state.texts.get(fieldKey(item.path));
1460
+ const text = state.texts.get(fieldKey$1(item.path));
1447
1461
  const hint = [text?.label, text?.hint].filter((part) => part !== void 0 && part !== "").join(":") || fieldHint(node, resolveText);
1448
1462
  if (hint !== void 0 && hint !== "") parts.push(hint);
1449
1463
  if (node.meta.disabled) parts.push(t("readOnlyField"));
@@ -1458,1212 +1472,37 @@ window.__ModuleLoader__.load({
1458
1472
  return prefix.every((segment, index) => path[index] === segment);
1459
1473
  }
1460
1474
  //#endregion
1461
- //#region ../../client/ui-primitives/src/client/styling/toolkit.ts
1462
- function isUndefined(value) {
1463
- return value === void 0;
1464
- }
1465
- function isNull(value) {
1466
- return value === null;
1467
- }
1468
- function isString(value) {
1469
- return typeof value === "string";
1470
- }
1471
- function isFunction(value) {
1472
- return typeof value === "function";
1473
- }
1474
- function isPlainObject(value) {
1475
- return typeof value === "object" && value !== null && !Array.isArray(value);
1476
- }
1477
- function toMerged(target, source) {
1478
- if (!isPlainObject(target) || !isPlainObject(source)) return source;
1479
- const result = { ...target };
1480
- for (const [key, value] of Object.entries(source)) result[key] = key in result ? toMerged(result[key], value) : value;
1481
- return result;
1482
- }
1483
- function mapKeys(source, map) {
1484
- const result = {};
1485
- for (const [key, value] of Object.entries(source)) result[map(key, value)] = value;
1486
- return result;
1487
- }
1488
- //#endregion
1489
- //#region ../../client/ui-primitives/src/client/styling/token.ts
1490
- const cssVarSymbol = Symbol("cssVar");
1491
- const tokensSymbol = Symbol("tokens");
1492
- const tokenInstSymbol = Symbol("tokenInst");
1493
- const SELF = "$";
1494
- function tokenVars(token, tokens, path) {
1495
- const reserved = /* @__PURE__ */ new Set([
1496
- "constructor",
1497
- "toJSON",
1498
- "__proto__"
1499
- ]);
1500
- return new Proxy(() => {}, {
1501
- apply() {
1502
- return Token.fallbackVar(token.cssVar(path));
1503
- },
1504
- get(_target, property) {
1505
- if (property === Symbol.toPrimitive || property === Symbol.toStringTag || property === "toString") return () => `var(${token.cssVar(path)})`;
1506
- if (property === "valueOf") return () => Token.fallbackVar(token.cssVar(path));
1507
- if (property === tokenInstSymbol) return token;
1508
- if (property === tokensSymbol) return tokens;
1509
- if (property === cssVarSymbol) return token.cssVar(path);
1510
- if (!isString(property) || reserved.has(property)) return void 0;
1511
- const next = tokens[property];
1512
- if (isUndefined(next)) return void 0;
1513
- return tokenVars(token, next, [...path, property]);
1514
- }
1515
- });
1516
- }
1517
- var Token = class Token {
1518
- prefix;
1519
- static vars(tokens, options = {}) {
1520
- return tokenVars(new Token(options.prefix ?? ""), tokens, []);
1521
- }
1522
- static extendsVars(vars, extra) {
1523
- const tokens = vars[tokensSymbol] ?? {};
1524
- return Token.vars(toMerged(tokens, extra));
1525
- }
1526
- static assignVars(vars, overwrites) {
1527
- const tokens = overwrites ?? vars[tokensSymbol] ?? {};
1528
- const token = vars[tokenInstSymbol] ?? new Token("");
1529
- const result = {};
1530
- for (const [name, value] of flattenTokens(token, tokens, [])) result[name] = token.normalize(value);
1531
- return result;
1532
- }
1533
- static variants(variants) {
1534
- return mapKeys(variants, (key) => `&[data-variant="${key}"]`);
1535
- }
1536
- static val(strings, ...values) {
1537
- return function* () {
1538
- for (let index = 0; index < strings.length; index += 1) {
1539
- const literal = strings[index];
1540
- if (literal) yield literal;
1541
- if (index >= values.length) continue;
1542
- const value = values[index];
1543
- yield* isFunction(value) ? value() : [value];
1544
- }
1545
- };
1546
- }
1547
- static calc(strings, ...values) {
1548
- return combinator("calc(", ")", strings, values);
1549
- }
1550
- static min(strings, ...values) {
1551
- return combinator("min(", ")", strings, values);
1552
- }
1553
- static max(strings, ...values) {
1554
- return combinator("max(", ")", strings, values);
1555
- }
1556
- static url(strings, ...values) {
1557
- return combinator("url(", ")", strings, values);
1558
- }
1559
- static colorMix(strings, ...values) {
1560
- return combinator("color-mix(", ")", strings, values);
1561
- }
1562
- static colorScale(color, options = {}) {
1563
- const channel = (name, amount, max) => Token.calc`${name} + (${String(max)} - ${name}) * max(${amount}, 0) + ${name} * min(${amount}, 0)`;
1564
- const mix = (from, to, amount) => Token.colorMix`in srgb, ${from}, ${to} ${Token.calc`${amount} * 100%`}`;
1565
- let result = color;
1566
- if (!isUndefined(options.alpha) || !isUndefined(options.lightness) || !isUndefined(options.saturation)) result = Token.val`hsl(from ${result} h ${isUndefined(options.saturation) ? "s" : channel("s", options.saturation, 100)} ${isUndefined(options.lightness) ? "l" : channel("l", options.lightness, 100)} / ${isUndefined(options.alpha) ? "alpha" : channel("alpha", options.alpha, 1)})`;
1567
- if (!isUndefined(options.whiteness)) result = mix(result, "white", options.whiteness);
1568
- if (!isUndefined(options.blackness)) result = mix(result, "black", options.blackness);
1569
- return result;
1570
- }
1571
- static fallbackVar(value, ...fallbacks) {
1572
- return Object.assign(function* () {
1573
- yield "var(";
1574
- for (const [index, item] of [value, ...fallbacks].entries()) {
1575
- if (index > 0) yield ", ";
1576
- yield* asIterable(item);
1577
- }
1578
- yield ")";
1579
- }, { [cssVarSymbol]: value });
1580
- }
1581
- static collect(value) {
1582
- const iterable = isFunction(value) ? value() : value;
1583
- let result = "";
1584
- for (const item of iterable) result += `${item}`;
1585
- return result;
1586
- }
1587
- constructor(prefix = "") {
1588
- this.prefix = prefix;
1589
- }
1590
- prop = (key) => key.startsWith("--") ? key : kebabCase(key);
1591
- normalize = (input) => {
1592
- const value = isFunction(input) ? input() : input;
1593
- if (typeof value === "number") return `${value}`;
1594
- if (typeof value === "string") return value;
1595
- if (isUndefined(value) || isNull(value)) return "";
1596
- if (isFunction(value)) return Token.collect(value);
1597
- if (isPlainObject(value) && Symbol.iterator in value) return Token.collect(value);
1598
- return "";
1599
- };
1600
- cssVar = (paths) => `--${[this.prefix, ...paths].filter(Boolean).join("-")}`;
1601
- };
1602
- function combinator(open, close, strings, values) {
1603
- return function* () {
1604
- yield open;
1605
- yield* Token.val(strings, ...values)();
1606
- yield close;
1607
- };
1608
- }
1609
- function* asIterable(value) {
1610
- const resolved = isFunction(value) ? value() : value;
1611
- const variable = resolved?.[cssVarSymbol];
1612
- if (!isUndefined(variable)) {
1613
- yield variable;
1614
- return;
1615
- }
1616
- if (typeof resolved === "object" && resolved !== null && Symbol.iterator in resolved) {
1617
- yield* resolved;
1618
- return;
1619
- }
1620
- yield resolved;
1621
- }
1622
- function* flattenTokens(token, value, parents) {
1623
- for (const [property, child] of Object.entries(value)) {
1624
- if (property === SELF) continue;
1625
- if (isPlainObject(child)) {
1626
- yield* flattenTokens(token, child, [...parents, property]);
1627
- continue;
1628
- }
1629
- yield [token.cssVar([...parents, property]), child];
1630
- }
1631
- }
1632
- function kebabCase(value) {
1633
- return value.replace(/([A-Z])/g, "-$1").toLowerCase();
1475
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/schema-form/schema-form.module.css.mjs
1476
+ const css$16 = ".B1Faoa_editorRoot{width:100%;color:var(--dsw-alias-label-primary);flex-direction:column;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace;font-size:14px;line-height:22px;display:flex}.B1Faoa_lineRow{white-space:nowrap;align-items:flex-start;gap:6px;min-height:22px;padding-right:8px;display:flex}.B1Faoa_lineRow:hover{background:var(--dsw-alias-bg-layer-2)}.B1Faoa_lineRow[data-selected=true]{background:var(--dsw-alias-bg-layer-3)}.B1Faoa_lineRow[data-dirty=true]{box-shadow:inset 2px 0 0 var(--dsw-alias-brand-primary)}.B1Faoa_lineRow[data-overridden=true]{box-shadow:inset 2px 0 0 var(--dsw-elevation-stroke-color)}.B1Faoa_lineRow[data-dirty=true] [data-role=key],.B1Faoa_lineRow[data-overridden=true] [data-role=key]{color:var(--dsw-alias-brand-primary)}.B1Faoa_lineRow[data-invalid=true]{background:color-mix(in srgb, var(--dsw-alias-state-error-secondary) 12%, transparent);box-shadow:inset 2px 0 0 var(--dsw-alias-state-error-primary)}.B1Faoa_lineRow[data-invalid=true] [data-role=key]{color:var(--dsw-alias-state-error-primary)}.B1Faoa_lineRow:hover [data-role=actions]{opacity:1}.B1Faoa_lineBody{flex:1;align-items:center;gap:6px;min-width:0;min-height:22px;display:flex}.B1Faoa_lineNumber{text-align:right;width:32px;color:var(--dsw-alias-label-caption);user-select:none;cursor:pointer;flex:none;line-height:22px}.B1Faoa_lineFold{width:14px;height:22px;color:var(--dsw-alias-label-caption);cursor:pointer;background:0 0;border:0;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.B1Faoa_lineFold:hover{color:var(--dsw-alias-label-secondary)}.B1Faoa_lineFoldSpacer{flex:none;width:14px}.B1Faoa_lineKey{color:var(--dsw-alias-label-primary);flex:none}.B1Faoa_lineKey[data-index=true]{color:var(--dsw-alias-label-caption)}.B1Faoa_lineToken{color:var(--dsw-alias-label-caption);flex:none}.B1Faoa_lineValue{text-overflow:ellipsis;cursor:text;min-width:0;color:var(--dsw-alias-state-business-primary);display:block;overflow:hidden}.B1Faoa_lineValue[data-tone=number]{color:var(--dsw-alias-state-warn-primary)}.B1Faoa_lineValue[data-tone=boolean]{color:var(--dsw-alias-state-success-primary)}.B1Faoa_lineValue[data-tone=empty]{color:var(--dsw-alias-label-caption)}.B1Faoa_valueSlot{flex:0 auto;min-width:0;display:block;overflow:hidden}.B1Faoa_valueTrigger{min-width:0;font:inherit;text-align:left;cursor:pointer;color:var(--dsw-alias-label-caption);background:0 0;border:0;align-items:center;gap:2px;padding:0;display:inline-flex}.B1Faoa_valueTrigger:disabled{cursor:default}.B1Faoa_valueTrigger:focus-visible{outline:none}.B1Faoa_compactInput{flex:auto;min-width:0;display:inline-flex}.B1Faoa_compactInput>span{border-radius:4px;width:100%;height:22px;padding:0 6px}.B1Faoa_compactInput input{font-size:14px;line-height:22px}.B1Faoa_compactTextField{background:var(--dsw-alias-bg-layer-1);min-width:0;box-shadow:0 0 0 .5px var(--dsw-elevation-stroke-color);border:0;border-radius:4px;flex:auto;padding:0 6px;display:inline-flex}.B1Faoa_compactTextField:focus-within{--dsw-elevation-stroke-color:var(--dsw-alias-brand-primary)}.B1Faoa_compactTextField>textarea{resize:none;field-sizing:content;width:100%;min-height:20px;max-height:240px;color:var(--dsw-alias-label-primary);background:0 0;border:0;outline:none;flex:1;padding:0;font-family:inherit;font-size:14px;line-height:22px}.B1Faoa_lineComment{text-overflow:ellipsis;min-width:0;color:var(--dsw-alias-label-tertiary);flex:auto;font-family:inherit;font-size:12px;overflow:hidden}.B1Faoa_lineInvalid{text-overflow:ellipsis;min-width:0;color:var(--dsw-alias-state-error-primary);flex:0 auto;font-family:inherit;font-size:12px;overflow:hidden}.B1Faoa_lineActions{opacity:0;flex:none;align-items:center;gap:4px;display:inline-flex}.B1Faoa_lineActions>button{width:20px;height:20px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:0;border-radius:4px;justify-content:center;align-items:center;padding:0;display:inline-flex}.B1Faoa_lineActions>button:hover{background:var(--dsw-alias-bg-layer-3);color:var(--dsw-alias-label-primary)}.B1Faoa_lineActions>button:disabled{cursor:not-allowed;color:var(--dsw-alias-label-dimmed)}.B1Faoa_hoverActions[data-editing=true]{opacity:1;gap:6px}.B1Faoa_hoverActions[data-editing=true]>button{box-shadow:0 0 0 .5px var(--dsw-elevation-stroke-color);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary)}.B1Faoa_hoverActions[data-editing=true]>button:first-of-type{color:var(--dsw-alias-state-success-primary)}.B1Faoa_addWrap{flex:auto;align-items:center;gap:6px;min-width:0;margin-left:6px;display:inline-flex;position:relative}.B1Faoa_addWrap[data-invalid=true] input{border-color:var(--dsw-alias-state-error-primary)}.B1Faoa_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}";
1477
+ const tagId$16 = "@morlay/dsh-session-mode/schema-form.module.css";
1478
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/schema-form.module.css\"]") === null) {
1479
+ const tag = document.createElement("style");
1480
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
1481
+ tag.dataset.pluginCss = tagId$16;
1482
+ tag.textContent = css$16;
1483
+ document.head.appendChild(tag);
1634
1484
  }
1635
- //#endregion
1636
- //#region ../../client/ui-primitives/src/client/styling/styling.ts
1637
- var Styling = class Styling {
1638
- static create() {
1639
- return new Styling();
1640
- }
1641
- static toRule(sheet) {
1642
- return sheet.selector === void 0 ? sheet.contents.join("") : `${sheet.selector} {${sheet.contents.join("")} }`;
1643
- }
1644
- #token = new Token();
1645
- #sheets = /* @__PURE__ */ new Map();
1646
- #injected = /* @__PURE__ */ new Set();
1647
- props = (...styles) => {
1648
- const merged = mergeStyles(styles);
1649
- if (Object.keys(merged).length === 0) return {};
1650
- const sheet = this.#sheet(2, this.#rules(merged));
1651
- return sheet === void 0 ? {} : { [`data-css-${sheet.id}`]: "" };
1652
- };
1653
- keyframes = (frames = {}) => {
1654
- return this.#sheet(1, this.#rules(frames))?.id ?? "anim-none";
1655
- };
1656
- injectGlobals = (styles = {}) => {
1657
- for (const [name, style] of Object.entries(styles)) this.#sheet(0, this.#rules(style), name);
1658
- };
1659
- className = (...styles) => {
1660
- const merged = mergeStyles(styles);
1661
- if (Object.keys(merged).length === 0) return "";
1662
- const sheet = this.#sheet(3, this.#rules(merged));
1663
- return sheet === void 0 ? "" : `cls-${sheet.id}`;
1664
- };
1665
- sheets = () => [...this.#sheets.values()].map((sheet) => Styling.toRule(sheet));
1666
- #sheet(type, rules, selector) {
1667
- let hash = 0;
1668
- const contents = [];
1669
- for (const rule of rules) {
1670
- contents.push(rule);
1671
- hash = incrementalHash(rule, hash);
1672
- }
1673
- if (selector !== void 0) hash = incrementalHash(selector, hash);
1674
- if (hash === 0) return void 0;
1675
- let id = selector ?? "";
1676
- if (type === 2) id = `s${hash.toString(36)}`;
1677
- if (type === 3) id = `c${hash.toString(36)}`;
1678
- if (type === 0) id = `g${hash.toString(36)}`;
1679
- if (type === 1) id = `a${hash.toString(36)}`;
1680
- let resolvedSelector = selector;
1681
- if (resolvedSelector === void 0) {
1682
- if (type === 1) resolvedSelector = `@keyframes ${id}`;
1683
- if (type === 2) resolvedSelector = `[data-css-${id}]`;
1684
- if (type === 3) resolvedSelector = `.cls-${id}`;
1685
- }
1686
- const sheet = {
1687
- id,
1688
- contents,
1689
- selector: resolvedSelector
1690
- };
1691
- const existing = this.#sheets.get(id);
1692
- if (existing !== void 0 && existing.contents.join("") === contents.join("")) return existing;
1693
- this.#sheets.set(id, sheet);
1694
- this.#inject(sheet);
1695
- return sheet;
1696
- }
1697
- #inject(sheet) {
1698
- if (this.#injected.has(sheet.id)) return;
1699
- this.#injected.add(sheet.id);
1700
- if (typeof document === "undefined") return;
1701
- const element = document.createElement("style");
1702
- element.setAttribute("data-css", sheet.id);
1703
- element.textContent = Styling.toRule(sheet);
1704
- document.head.appendChild(element);
1705
- }
1706
- *#rules(styles) {
1707
- const nested = /* @__PURE__ */ new Map();
1708
- for (const [key, value] of Object.entries(styles)) {
1709
- if (isNull(value) || isUndefined(value)) continue;
1710
- if (isPlainObject(value)) {
1711
- nested.set(key, value);
1712
- continue;
1713
- }
1714
- yield ` ${this.#token.prop(key)}: ${this.#token.normalize(value)};`;
1715
- }
1716
- for (const [key, value] of nested.entries()) {
1717
- yield ` ${key} {`;
1718
- yield* this.#rules(value);
1719
- yield " }";
1720
- }
1721
- }
1485
+ var schema_form_module_css_default = {
1486
+ "addWrap": "B1Faoa_addWrap",
1487
+ "valueTrigger": "B1Faoa_valueTrigger",
1488
+ "hint": "B1Faoa_hint",
1489
+ "valueSlot": "B1Faoa_valueSlot",
1490
+ "compactInput": "B1Faoa_compactInput",
1491
+ "compactTextField": "B1Faoa_compactTextField",
1492
+ "editorRoot": "B1Faoa_editorRoot",
1493
+ "lineFold": "B1Faoa_lineFold",
1494
+ "lineToken": "B1Faoa_lineToken",
1495
+ "lineValue": "B1Faoa_lineValue",
1496
+ "lineNumber": "B1Faoa_lineNumber",
1497
+ "lineKey": "B1Faoa_lineKey",
1498
+ "lineInvalid": "B1Faoa_lineInvalid",
1499
+ "lineRow": "B1Faoa_lineRow",
1500
+ "lineFoldSpacer": "B1Faoa_lineFoldSpacer",
1501
+ "lineComment": "B1Faoa_lineComment",
1502
+ "lineBody": "B1Faoa_lineBody",
1503
+ "lineActions": "B1Faoa_lineActions",
1504
+ "hoverActions": "B1Faoa_hoverActions"
1722
1505
  };
1723
- function mergeStyles(styles) {
1724
- return styles.reduce((accumulated, style) => style ? toMerged(accumulated, style) : accumulated, {});
1725
- }
1726
- function incrementalHash(value, previous = 0) {
1727
- let hash = previous;
1728
- for (let index = 0; index < value.length; index += 1) {
1729
- hash = (hash << 5) - hash + value.charCodeAt(index);
1730
- hash &= 2147483647;
1731
- }
1732
- return hash;
1733
- }
1734
- const STYLING_SINGLETON = Symbol.for("@morlay/dsh-client-ui-primitives/styling");
1735
- const globalScope = globalThis;
1736
- const styling = globalScope[STYLING_SINGLETON] ??= Styling.create();
1737
- //#endregion
1738
- //#region ../../client/ui-primitives/src/client/styling/styled.tsx
1739
- const sxSymbol = Symbol("styled.sx");
1740
- function styled(Component, defaultProps = {}) {
1741
- return (...styles) => {
1742
- const sx = styles.reduce((merged, style) => toMerged(merged, style), {});
1743
- const Styled = (0, react.forwardRef)((props, ref) => {
1744
- const styleProps = (0, react.useMemo)(() => styling.props(sx), []);
1745
- return (0, react.createElement)(Component, {
1746
- ...defaultProps,
1747
- ...props,
1748
- ...styleProps,
1749
- ref
1750
- });
1751
- });
1752
- Styled.displayName = `styled(${typeof Component === "string" ? Component : Component.displayName ?? Component.name ?? "Component"})`;
1753
- return Object.assign(Styled, { [sxSymbol]: sx });
1754
- };
1755
- }
1756
- //#endregion
1757
- //#region ../../client/ui-primitives/src/client/theme.ts
1758
- const dsw = Token.vars({
1759
- alias: {
1760
- bg: {
1761
- base: "var(--dsw-static-neutral-bluish-00)",
1762
- document: {
1763
- preview: "var(--dsw-static-neutral-bluish-100)",
1764
- selection: "color-mix(in srgb, var(--dsw-static-blue-500) 40%, transparent)"
1765
- },
1766
- layer: {
1767
- "1": "var(--dsw-static-neutral-bluish-00)",
1768
- "2": "var(--dsw-static-neutral-bluish-00)",
1769
- "3": "var(--dsw-static-neutral-bluish-00)"
1770
- },
1771
- mask: {
1772
- "1": "rgba(0, 0, 0, 0.24)",
1773
- "2": "rgba(0, 0, 0, 0.12)",
1774
- "3": "rgba(0, 0, 0, 0.48)",
1775
- drop: "rgba(255, 255, 255, 0.7)",
1776
- photo: "rgba(0, 0, 0, 0.88)"
1777
- },
1778
- module: { platform: "var(--dsw-static-neutral-bluish-60)" },
1779
- multi: { select: "var(--dsw-static-neutral-bluish-60)" },
1780
- overlay: "var(--dsw-static-neutral-bluish-150)",
1781
- skeleton: "rgba(0, 0, 0, 0.04)"
1782
- },
1783
- border: {
1784
- inverted: "rgba(0, 0, 0, 0)",
1785
- inverted2: "rgba(0, 0, 0, 0)",
1786
- l1: "rgba(0, 0, 0, 0.04)",
1787
- l2: {
1788
- $: "rgba(0, 0, 0, 0.1)",
1789
- darkmode: { thin: "rgba(0, 0, 0, 0.1)" }
1790
- },
1791
- l3: "rgba(0, 0, 0, 0.12)",
1792
- l4: "rgba(0, 0, 0, 0.16)"
1793
- },
1794
- brand: {
1795
- primary: {
1796
- $: "var(--dsw-static-neutral-bluish-1000)",
1797
- invert: "var(--dsw-static-neutral-bluish-1000)",
1798
- new: { colorprimary: { new: { color: "rgb(65, 118, 230)" } } }
1799
- },
1800
- text: "var(--dsw-static-neutral-bluish-1000)"
1801
- },
1802
- button: {
1803
- contrast: { fill: "var(--dsw-static-neutral-bluish-700)" },
1804
- elevated: { fill: "var(--dsw-static-neutral-bluish-00)" },
1805
- floating: {
1806
- fill: "var(--dsw-static-neutral-bluish-00)",
1807
- hover: "var(--dsw-static-neutral-bluish-75)"
1808
- },
1809
- ghost: { active: {
1810
- border: "var(--dsw-static-neutral-bluish-500)",
1811
- fill: "var(--dsw-static-neutral-bluish-100)",
1812
- hover: "var(--dsw-static-neutral-bluish-150)"
1813
- } },
1814
- info: {
1815
- fill: "var(--dsw-static-deepseek-500)",
1816
- hover: "var(--dsw-static-deepseek-400)"
1817
- },
1818
- primary: {
1819
- dimmed: "var(--dsw-static-neutral-bluish-100)",
1820
- fill: "var(--dsw-alias-brand-primary)",
1821
- hover: "var(--dsw-static-neutral-bluish-750)"
1822
- },
1823
- tool: { bar: {
1824
- fill: {
1825
- $: "rgba(84, 85, 87, 0.5)",
1826
- invisible: "rgba(31, 31, 31, 0.36)"
1827
- },
1828
- hover: "rgba(84, 85, 87, 0.6)"
1829
- } }
1830
- },
1831
- code: { diff: {
1832
- added: "var(--dsw-static-green-500-a08)",
1833
- deleted: "var(--dsw-static-red-600-a08)"
1834
- } },
1835
- file: { diff: {
1836
- added: {
1837
- bg: "rgb(230, 244, 231)",
1838
- gutter: "rgb(237, 247, 237)",
1839
- marker: "rgb(1, 162, 65)"
1840
- },
1841
- deleted: {
1842
- bg: "rgb(252, 230, 226)",
1843
- gutter: "rgb(253, 236, 233)",
1844
- marker: "rgb(186, 39, 35)"
1845
- }
1846
- } },
1847
- interactive: { bg: {
1848
- active: "rgba(38, 49, 72, 0.1)",
1849
- hover: {
1850
- $: "rgba(38, 49, 72, 0.06)",
1851
- accent: "rgba(38, 49, 72, 0.14)",
1852
- danger: "rgba(236, 19, 19, 0.05)",
1853
- solid: "var(--dsw-static-neutral-bluish-75)"
1854
- }
1855
- } },
1856
- label: {
1857
- caption: "var(--dsw-static-neutral-bluish-400)",
1858
- deep: { diving: {
1859
- $: "color-mix(in srgb, var(--dsw-static-deepseek-500) 70%, var(--dsw-static-blue-950))",
1860
- shimmer: "color-mix(in srgb, var(--dsw-static-deepseek-500) 30%, var(--dsw-static-blue-950))"
1861
- } },
1862
- dimmed: "var(--dsw-static-neutral-bluish-200)",
1863
- document: { preview: "var(--dsw-static-neutral-bluish-700)" },
1864
- primary: {
1865
- $: "var(--dsw-static-neutral-bluish-1000)",
1866
- bluish: "var(--dsw-static-blue-900)",
1867
- dimmed: "var(--dsw-static-neutral-bluish-950)",
1868
- foreground: "var(--dsw-static-neutral-bluish-00)",
1869
- inverted: "var(--dsw-static-neutral-bluish-00)"
1870
- },
1871
- secondary: "var(--dsw-static-neutral-bluish-700)",
1872
- shimmer: "color-mix(in srgb, var(--dsw-static-neutral-1000) 30%, transparent)",
1873
- tertiary: "var(--dsw-static-neutral-bluish-600)"
1874
- },
1875
- link: "var(--dsw-static-deepseek-500)",
1876
- markdown: {
1877
- citation: "var(--dsw-static-neutral-bluish-100)",
1878
- code: {
1879
- block: {
1880
- $: "var(--dsw-static-neutral-bluish-50)",
1881
- banner: "var(--dsw-static-neutral-bluish-50)"
1882
- },
1883
- segment: {
1884
- selected: "var(--dsw-static-neutral-bluish-00)",
1885
- unselected: "var(--dsw-static-neutral-bluish-75)"
1886
- }
1887
- },
1888
- inline: { code: "var(--dsw-static-neutral-50)" },
1889
- placeholder: "var(--dsw-static-neutral-bluish-60)",
1890
- tag: "var(--dsw-static-neutral-bluish-75)"
1891
- },
1892
- menu: {
1893
- group: { header: { fill: "rgba(248, 249, 250, 0.94)" } },
1894
- icon: "var(--dsw-static-neutral-bluish-800)"
1895
- },
1896
- onboarding: {
1897
- accent: "rgb(57, 100, 254)",
1898
- card: { fill: "color-mix(in srgb, var(--dsw-static-neutral-bluish-00) 80%, transparent)" },
1899
- checkbox: { border: "color-mix(in srgb, var(--dsw-static-neutral-bluish-1000) 20%, transparent)" },
1900
- secondary: { fill: "var(--dsw-static-neutral-bluish-00)" }
1901
- },
1902
- scrollbar: {
1903
- bg: {
1904
- l1: "var(--dsw-static-neutral-200)",
1905
- l2: "var(--dsw-static-neutral-200)"
1906
- },
1907
- hover: {
1908
- l1: "var(--dsw-static-neutral-300)",
1909
- l2: "var(--dsw-static-neutral-300)"
1910
- }
1911
- },
1912
- settings: { card: {
1913
- fill: "var(--dsw-alias-bg-layer-2)",
1914
- stroke: "var(--dsw-alias-border-l4)"
1915
- } },
1916
- state: {
1917
- business: {
1918
- primary: "var(--dsw-static-deepseek-500)",
1919
- tertiary: "var(--dsw-static-deepseek-100)"
1920
- },
1921
- error: {
1922
- primary: "var(--dsw-static-red-600)",
1923
- secondary: "var(--dsw-static-red-400)"
1924
- },
1925
- idle: { primary: "var(--dsw-static-neutral-300)" },
1926
- success: {
1927
- primary: "var(--dsw-static-green-500)",
1928
- secondary: "var(--dsw-static-green-400)",
1929
- tertiary: "var(--dsw-static-green-100)"
1930
- },
1931
- warn: {
1932
- label: "var(--dsw-static-amber-600)",
1933
- primary: "var(--dsw-static-amber-500)",
1934
- secondary: "var(--dsw-static-amber-400)",
1935
- tertiary: "var(--dsw-static-amber-100)"
1936
- }
1937
- },
1938
- switch: { thumb: "var(--dsw-static-neutral-bluish-00)" },
1939
- toast: {
1940
- bg: "var(--dsw-static-neutral-bluish-800)",
1941
- label: "var(--dsw-static-neutral-bluish-00)"
1942
- },
1943
- tooltip: {
1944
- bg: "var(--dsw-static-neutral-bluish-850)",
1945
- key: { bg: "color-mix(in srgb, var(--dsw-alias-tooltip-bg), white 18%)" }
1946
- },
1947
- turn: { trigger: { bg: {
1948
- $: "var(--dsw-alias-markdown-code-block)",
1949
- hover: "var(--dsw-alias-interactive-bg-hover)"
1950
- } } }
1951
- },
1952
- corner: { shape: "superellipse(1.5)" },
1953
- elevation: {
1954
- panel: "var(--dsw-elevation-stroke), 0 3px 8px 0 rgba(0, 0, 0, 0.03), 0 0 16px 0 rgba(0, 0, 0, 0.02)",
1955
- prominent: "var(--dsw-elevation-stroke), 0 3px 8px 0 rgba(0, 0, 0, 0.04), 0 0 20px 0 rgba(0, 0, 0, 0.05)",
1956
- soft: "var(--dsw-elevation-stroke), 0 4px 16px 0 rgba(0, 0, 0, 0.03), 0 0 24px 0 rgba(0, 0, 0, 0.03)",
1957
- stroke: {
1958
- $: "0 0 0 0.5px var(--dsw-elevation-stroke-color)",
1959
- color: "var(--dsw-alias-border-l4)"
1960
- }
1961
- },
1962
- focus: { ring: {
1963
- color: "transparent",
1964
- width: "2px"
1965
- } },
1966
- font: {
1967
- base: {
1968
- "16": {
1969
- $: "16px/24px var(--dsw-font-family)",
1970
- font: {
1971
- family: "var(--dsw-font-family)",
1972
- size: "16px",
1973
- style: "normal",
1974
- weight: "400"
1975
- },
1976
- line: { height: "24px" }
1977
- },
1978
- strong: { "16": {
1979
- $: "500 16px/24px var(--dsw-font-family)",
1980
- font: {
1981
- family: "var(--dsw-font-family)",
1982
- size: "16px",
1983
- style: "normal",
1984
- weight: "500"
1985
- },
1986
- line: { height: "24px" }
1987
- } }
1988
- },
1989
- family: {
1990
- $: "-apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',\n 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif",
1991
- brand: "'Montserrat', var(--dsw-font-family)"
1992
- },
1993
- l: { "20": {
1994
- $: "500 20px/28px var(--dsw-font-family)",
1995
- font: {
1996
- family: "var(--dsw-font-family)",
1997
- size: "20px",
1998
- style: "normal",
1999
- weight: "500"
2000
- },
2001
- line: { height: "28px" }
2002
- } },
2003
- m: { "18": {
2004
- $: "500 16px/28px var(--dsw-font-family)",
2005
- font: {
2006
- family: "var(--dsw-font-family)",
2007
- size: "16px",
2008
- style: "normal",
2009
- weight: "500"
2010
- },
2011
- line: { height: "28px" }
2012
- } },
2013
- markdown: {
2014
- base: {
2015
- $: "var(--dsh-content-font-size, 14px) / calc(24px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2016
- font: {
2017
- family: "var(--dsw-font-family)",
2018
- size: "var(--dsh-content-font-size, 14px)",
2019
- style: "normal",
2020
- weight: "400"
2021
- },
2022
- italic: {
2023
- $: "italic var(--dsh-content-font-size, 14px) / calc(24px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2024
- font: {
2025
- family: "var(--dsw-font-family)",
2026
- size: "var(--dsh-content-font-size, 14px)",
2027
- style: "italic",
2028
- weight: "400"
2029
- },
2030
- line: { height: "calc(24px + var(--dsh-content-font-delta))" }
2031
- },
2032
- line: { height: "calc(24px + var(--dsh-content-font-delta))" },
2033
- strong: {
2034
- $: "600 var(--dsh-content-font-size, 14px) / calc(24px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2035
- font: {
2036
- family: "var(--dsw-font-family)",
2037
- size: "var(--dsh-content-font-size, 14px)",
2038
- style: "normal",
2039
- weight: "600"
2040
- },
2041
- italic: {
2042
- $: "italic 600 var(--dsh-content-font-size, 14px) / calc(24px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2043
- font: {
2044
- family: "var(--dsw-font-family)",
2045
- size: "var(--dsh-content-font-size, 14px)",
2046
- style: "italic",
2047
- weight: "600"
2048
- },
2049
- line: { height: "calc(24px + var(--dsh-content-font-delta))" }
2050
- },
2051
- line: { height: "calc(24px + var(--dsh-content-font-delta))" }
2052
- }
2053
- },
2054
- code: {
2055
- $: "12px/19px var(--ds-font-family-code)",
2056
- block: {
2057
- $: "11px/19px var(--ds-font-family-code)",
2058
- font: {
2059
- family: "var(--ds-font-family-code)",
2060
- size: "11px",
2061
- style: "normal",
2062
- weight: "400"
2063
- },
2064
- line: { height: "19px" },
2065
- small: {
2066
- $: "11px/16px var(--ds-font-family-code)",
2067
- font: {
2068
- family: "var(--ds-font-family-code)",
2069
- size: "11px",
2070
- style: "normal",
2071
- weight: "400"
2072
- },
2073
- line: { height: "16px" }
2074
- }
2075
- },
2076
- font: {
2077
- family: "var(--ds-font-family-code)",
2078
- size: "12px",
2079
- style: "normal",
2080
- weight: "400"
2081
- },
2082
- line: { height: "19px" }
2083
- },
2084
- h1: {
2085
- $: "700 calc(21px + var(--dsh-content-font-delta)) / calc(30px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2086
- font: {
2087
- family: "var(--dsw-font-family)",
2088
- size: "calc(21px + var(--dsh-content-font-delta))",
2089
- style: "normal",
2090
- weight: "700"
2091
- },
2092
- line: { height: "calc(30px + var(--dsh-content-font-delta))" }
2093
- },
2094
- h2: {
2095
- $: "700 calc(19px + var(--dsh-content-font-delta)) / calc(28px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2096
- font: {
2097
- family: "var(--dsw-font-family)",
2098
- size: "calc(19px + var(--dsh-content-font-delta))",
2099
- style: "normal",
2100
- weight: "700"
2101
- },
2102
- line: { height: "calc(28px + var(--dsh-content-font-delta))" }
2103
- },
2104
- h3: {
2105
- $: "700 calc(18px + var(--dsh-content-font-delta)) / calc(26px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2106
- font: {
2107
- family: "var(--dsw-font-family)",
2108
- size: "calc(18px + var(--dsh-content-font-delta))",
2109
- style: "normal",
2110
- weight: "700"
2111
- },
2112
- line: { height: "calc(26px + var(--dsh-content-font-delta))" }
2113
- },
2114
- h4: {
2115
- $: "600 var(--dsh-content-font-size, 14px) / calc(24px + var(--dsh-content-font-delta)) var(--dsw-font-family)",
2116
- font: {
2117
- family: "var(--dsw-font-family)",
2118
- size: "var(--dsh-content-font-size, 14px)",
2119
- style: "normal",
2120
- weight: "600"
2121
- },
2122
- line: { height: "calc(24px + var(--dsh-content-font-delta))" }
2123
- },
2124
- small: {
2125
- $: "12px/20px var(--dsw-font-family)",
2126
- font: {
2127
- family: "var(--dsw-font-family)",
2128
- size: "12px",
2129
- style: "normal",
2130
- weight: "400"
2131
- },
2132
- italic: {
2133
- $: "italic 12px/20px var(--dsw-font-family)",
2134
- font: {
2135
- family: "var(--dsw-font-family)",
2136
- size: "12px",
2137
- style: "italic",
2138
- weight: "400"
2139
- },
2140
- line: { height: "20px" }
2141
- },
2142
- line: { height: "20px" },
2143
- strong: {
2144
- $: "600 12px/20px var(--dsw-font-family)",
2145
- font: {
2146
- family: "var(--dsw-font-family)",
2147
- size: "12px",
2148
- style: "normal",
2149
- weight: "600"
2150
- },
2151
- italic: {
2152
- $: "italic 600 12px/20px var(--dsw-font-family)",
2153
- font: {
2154
- family: "var(--dsw-font-family)",
2155
- size: "12px",
2156
- style: "italic",
2157
- weight: "600"
2158
- },
2159
- line: { height: "20px" }
2160
- },
2161
- line: { height: "20px" }
2162
- }
2163
- },
2164
- table: {
2165
- $: "var(--dsh-content-font-size-secondary, 13px)/calc(22px + var(--dsh-content-font-delta-secondary, 0px)) var(--dsw-font-family)",
2166
- font: {
2167
- family: "var(--dsw-font-family)",
2168
- size: "var(--dsh-content-font-size-secondary, 13px)",
2169
- style: "normal",
2170
- weight: "400"
2171
- },
2172
- head: {
2173
- $: "500 var(--dsh-content-font-size-secondary, 13px)/calc(22px + var(--dsh-content-font-delta-secondary, 0px)) var(--dsw-font-family)",
2174
- font: {
2175
- family: "var(--dsw-font-family)",
2176
- size: "var(--dsh-content-font-size-secondary, 13px)",
2177
- style: "normal",
2178
- weight: "500"
2179
- },
2180
- line: { height: "calc(22px + var(--dsh-content-font-delta-secondary, 0px))" }
2181
- },
2182
- line: { height: "calc(22px + var(--dsh-content-font-delta-secondary, 0px))" }
2183
- }
2184
- },
2185
- s: {
2186
- "14": {
2187
- $: "14px/22px var(--dsw-font-family)",
2188
- font: {
2189
- family: "var(--dsw-font-family)",
2190
- size: "14px",
2191
- style: "normal",
2192
- weight: "400"
2193
- },
2194
- line: { height: "22px" }
2195
- },
2196
- strong: { "14": {
2197
- $: "500 14px/22px var(--dsw-font-family)",
2198
- font: {
2199
- family: "var(--dsw-font-family)",
2200
- size: "14px",
2201
- style: "normal",
2202
- weight: "500"
2203
- },
2204
- line: { height: "22px" }
2205
- } }
2206
- },
2207
- xl: { "24": {
2208
- $: "600 24px/32px var(--dsw-font-family)",
2209
- font: {
2210
- family: "var(--dsw-font-family)",
2211
- size: "24px",
2212
- style: "normal",
2213
- weight: "600"
2214
- },
2215
- line: { height: "32px" }
2216
- } },
2217
- xs: {
2218
- "13": {
2219
- $: "13px/20px var(--dsw-font-family)",
2220
- font: {
2221
- family: "var(--dsw-font-family)",
2222
- size: "13px",
2223
- style: "normal",
2224
- weight: "400"
2225
- },
2226
- line: { height: "20px" }
2227
- },
2228
- strong: { "13": {
2229
- $: "500 13px/20px var(--dsw-font-family)",
2230
- font: {
2231
- family: "var(--dsw-font-family)",
2232
- size: "13px",
2233
- style: "normal",
2234
- weight: "500"
2235
- },
2236
- line: { height: "20px" }
2237
- } }
2238
- },
2239
- xxs: {
2240
- "12": {
2241
- $: "12px/18px var(--dsw-font-family)",
2242
- font: {
2243
- family: "var(--dsw-font-family)",
2244
- size: "12px",
2245
- style: "normal",
2246
- weight: "400"
2247
- },
2248
- line: { height: "18px" }
2249
- },
2250
- strong: { "12": {
2251
- $: "500 12px/18px var(--dsw-font-family)",
2252
- font: {
2253
- family: "var(--dsw-font-family)",
2254
- size: "12px",
2255
- style: "normal",
2256
- weight: "500"
2257
- },
2258
- line: { height: "18px" }
2259
- } }
2260
- },
2261
- xxxs: {
2262
- "11": {
2263
- $: "11px/14px var(--dsw-font-family)",
2264
- font: {
2265
- family: "var(--dsw-font-family)",
2266
- size: "11px",
2267
- style: "normal",
2268
- weight: "400"
2269
- },
2270
- line: { height: "14px" }
2271
- },
2272
- strong: { "11": {
2273
- $: "500 11px/14px var(--dsw-font-family)",
2274
- font: {
2275
- family: "var(--dsw-font-family)",
2276
- size: "11px",
2277
- style: "normal",
2278
- weight: "500"
2279
- },
2280
- line: { height: "14px" }
2281
- } }
2282
- }
2283
- },
2284
- gradient: { onboarding: {
2285
- blue: { stops: "#3964fe 18.75%, #398efe 51.78%, #6dccff 86.252%, #3964fe" },
2286
- cyan: { stops: "#0293b4 21.154%, #2dc8eb 50.954%, #aff0ff 85.326%, #0293b4" },
2287
- violet: { stops: "#2a2fb6 33.102%, #8b76f6 50.954%, #c5c0ff 85.326%, #2a2fb6" }
2288
- } },
2289
- linear: {
2290
- gradient: { think: "linear-gradient(180deg, #fff 20.19%, rgba(255, 255, 255, 0) 100%)" },
2291
- think: { select: "linear-gradient(180deg, #f5f6f7 20.19%, rgba(245, 246, 247, 0) 100%)" }
2292
- },
2293
- mask: { blur: "none" },
2294
- menu: {
2295
- backdrop: { filter: "blur(40px) saturate(150%)" },
2296
- surface: { fill: "rgba(248, 249, 250, 0.58)" }
2297
- },
2298
- radius: {
2299
- lg: "16px",
2300
- md: "12px",
2301
- panel: "28px",
2302
- sm: "8px",
2303
- xl: "20px",
2304
- xs: "4px"
2305
- },
2306
- shadow: {
2307
- lv1: {
2308
- $: "0 2px 4px 0 rgba(0, 0, 0, 0.05)",
2309
- blur: "0 4px 12px 0 rgba(0, 0, 0, 0.02)"
2310
- },
2311
- lv2: "0 4px 12px 0 rgba(0, 0, 0, 0.02), 0 2px 8px 0 rgba(0, 0, 0, 0.04)",
2312
- lv3: "0 0 1px 0 rgba(0, 0, 0, 0.2), 0 0 4px 0 rgba(0, 0, 0, 0.02), 0 12px 32px 0 rgba(0, 0, 0, 0.08)"
2313
- },
2314
- specific: {
2315
- bubble: {
2316
- $: "var(--dsw-static-deepseek-50)",
2317
- highlight: "var(--dsw-static-deepseek-200)"
2318
- },
2319
- input: { major: "var(--dsw-static-neutral-bluish-00)" },
2320
- login: { input: "var(--dsw-static-neutral-bluish-50)" },
2321
- menu: "var(--dsw-menu-surface-fill)",
2322
- selector: "var(--dsw-static-neutral-bluish-60)",
2323
- sidebar: {
2324
- fill: "var(--dsw-static-neutral-bluish-50)",
2325
- nav: { item: {
2326
- active: {
2327
- $: "var(--dsw-static-neutral-bluish-100)",
2328
- accent: "var(--dsw-static-deepseek-100)"
2329
- },
2330
- hover: "var(--dsw-static-neutral-bluish-75)"
2331
- } }
2332
- },
2333
- tip: "var(--dsw-static-neutral-bluish-60)"
2334
- },
2335
- static: {
2336
- amber: {
2337
- "100": "rgb(254, 245, 231)",
2338
- "400": "rgb(247, 173, 49)",
2339
- "500": "rgb(245, 158, 11)",
2340
- "600": "rgb(221, 134, 41)",
2341
- "900": "rgb(39, 36, 31)"
2342
- },
2343
- blue: {
2344
- "50": "rgb(239, 246, 255)",
2345
- "75": "rgb(229, 240, 255)",
2346
- "100": "rgb(219, 234, 254)",
2347
- "300": "rgb(147, 197, 253)",
2348
- "400": "rgb(96, 165, 250)",
2349
- "450": "rgb(77, 147, 248)",
2350
- "500": "rgb(59, 130, 246)",
2351
- "600": "rgb(37, 99, 235)",
2352
- "800": "rgb(30, 64, 175)",
2353
- "900": "rgb(14, 48, 116)",
2354
- "950": "rgb(23, 37, 84)",
2355
- "50p": "rgb(234, 243, 255)"
2356
- },
2357
- deepseek: {
2358
- "50": "rgb(237, 243, 254)",
2359
- "100": "rgb(228, 237, 253)",
2360
- "200": "rgb(211, 226, 255)",
2361
- "300": "rgb(183, 200, 254)",
2362
- "400": "rgb(122, 170, 255)",
2363
- "450": "rgb(86, 134, 254)",
2364
- "500": "rgb(65, 118, 230)",
2365
- "600": "rgb(72, 104, 178)",
2366
- "700": { delete: "rgb(47, 76, 143)" },
2367
- "800": "rgb(52, 65, 91)",
2368
- "900": "rgb(40, 49, 66)"
2369
- },
2370
- green: {
2371
- "100": "rgb(230, 250, 237)",
2372
- "400": "rgb(78, 209, 126)",
2373
- "500": {
2374
- $: "rgb(34, 197, 94)",
2375
- a08: "rgb(34 197 94 / 8%)",
2376
- a12: "rgb(34 197 94 / 12%)"
2377
- },
2378
- "900": "rgb(35, 60, 44)"
2379
- },
2380
- neutral: {
2381
- "50": "rgb(250, 250, 250)",
2382
- "100": "rgb(245, 245, 245)",
2383
- "150": "rgb(237, 237, 237)",
2384
- "200": "rgb(229, 229, 229)",
2385
- "250": "rgb(220, 220, 220)",
2386
- "300": "rgb(212, 212, 212)",
2387
- "400": "rgb(162, 164, 166)",
2388
- "500": "rgb(127, 130, 135)",
2389
- "550": "rgb(101, 103, 107)",
2390
- "600": "rgb(84, 85, 87)",
2391
- "700": "rgb(60, 60, 61)",
2392
- "800": "rgb(41, 41, 41)",
2393
- "850": "rgb(33, 33, 35)",
2394
- "900": "rgb(15, 15, 15)",
2395
- "1000": "rgb(0, 0, 0)",
2396
- "00": "rgb(255, 255, 255)",
2397
- bluish: {
2398
- "50": "rgb(249, 250, 251)",
2399
- "60": "rgb(245, 246, 247)",
2400
- "75": "rgb(241, 243, 245)",
2401
- "100": "rgb(235, 238, 242)",
2402
- "150": "rgb(233, 236, 242)",
2403
- "200": "rgb(225, 229, 238)",
2404
- "300": "rgb(207, 211, 214)",
2405
- "400": "rgb(173, 178, 184)",
2406
- "500": "rgb(151, 157, 166)",
2407
- "600": "rgb(129, 133, 140)",
2408
- "700": "rgb(97, 102, 107)",
2409
- "750": "rgb(67, 69, 74)",
2410
- "800": "rgb(53, 54, 56)",
2411
- "850": "rgb(44, 44, 46)",
2412
- "875": "rgb(35, 35, 36)",
2413
- "900": "rgb(27, 27, 28)",
2414
- "950": "rgb(21, 21, 23)",
2415
- "1000": "rgb(15, 17, 21)",
2416
- "00": "rgb(255, 255, 255)"
2417
- }
2418
- },
2419
- red: {
2420
- "50": "rgb(254, 242, 242)",
2421
- "100": "rgb(254, 226, 226)",
2422
- "400": {
2423
- $: "rgb(242, 90, 90)",
2424
- a12: "rgb(242 90 90 / 12%)"
2425
- },
2426
- "500": "rgb(239, 68, 68)",
2427
- "600": {
2428
- $: "rgb(236, 19, 19)",
2429
- a08: "rgb(236 19 19 / 8%)"
2430
- },
2431
- "900": "rgb(87, 12, 12)"
2432
- }
2433
- }
2434
- }, { prefix: "dsw" });
2435
- //#endregion
2436
- //#region ../../client/ui-primitives/src/client/schema-form/styles.ts
2437
- const MONO = "ui-monospace, SFMono-Regular, \"SF Mono\", Menlo, Consolas, monospace";
2438
- const ROW = "22px";
2439
- const GAP = "6px";
2440
- const ACTION = "20px";
2441
- const ACTION_GAP = "4px";
2442
- const FOLD = "14px";
2443
- const NUMBER = "32px";
2444
- const PAD = "8px";
2445
- const HAIRLINE = dsw.elevation.stroke;
2446
- const LINE = dsw.elevation.stroke.color;
2447
- const EDGE = "2px";
2448
- const ERROR_WASH = `color-mix(in srgb, ${String(dsw.alias.state.error.secondary)} 12%, transparent)`;
2449
- const EditorRoot = styled("div")({
2450
- display: "flex",
2451
- flexDirection: "column",
2452
- width: "100%",
2453
- fontFamily: MONO,
2454
- fontSize: "14px",
2455
- lineHeight: ROW,
2456
- color: dsw.alias.label.primary
2457
- });
2458
- const LineRow = styled("div")({
2459
- display: "flex",
2460
- alignItems: "flex-start",
2461
- gap: GAP,
2462
- minHeight: ROW,
2463
- paddingRight: PAD,
2464
- whiteSpace: "nowrap",
2465
- "&:hover": { background: dsw.alias.bg.layer["2"] },
2466
- "&[data-selected='true']": { background: dsw.alias.bg.layer["3"] },
2467
- "&[data-dirty='true']": { boxShadow: `inset ${EDGE} 0 0 ${String(dsw.alias.brand.primary)}` },
2468
- "&[data-overridden='true']": { boxShadow: `inset ${EDGE} 0 0 ${String(LINE)}` },
2469
- "&[data-dirty='true'] [data-role='key']": { color: dsw.alias.brand.primary },
2470
- "&[data-overridden='true'] [data-role='key']": { color: dsw.alias.brand.primary },
2471
- "&[data-invalid='true']": {
2472
- background: ERROR_WASH,
2473
- boxShadow: `inset ${EDGE} 0 0 ${String(dsw.alias.state.error.primary)}`
2474
- },
2475
- "&[data-invalid='true'] [data-role='key']": { color: dsw.alias.state.error.primary },
2476
- "&:hover [data-role='actions']": { opacity: 1 }
2477
- });
2478
- const LineBody = styled("div")({
2479
- display: "flex",
2480
- alignItems: "center",
2481
- gap: GAP,
2482
- flex: 1,
2483
- minWidth: 0,
2484
- minHeight: ROW
2485
- });
2486
- const LineNumber = styled("span")({
2487
- flex: "none",
2488
- width: NUMBER,
2489
- lineHeight: ROW,
2490
- textAlign: "right",
2491
- color: dsw.alias.label.caption,
2492
- userSelect: "none",
2493
- cursor: "pointer"
2494
- });
2495
- const LineFold = styled("button")({
2496
- display: "inline-flex",
2497
- alignItems: "center",
2498
- justifyContent: "center",
2499
- flex: "none",
2500
- width: FOLD,
2501
- height: ROW,
2502
- padding: 0,
2503
- border: 0,
2504
- background: "none",
2505
- color: dsw.alias.label.caption,
2506
- cursor: "pointer",
2507
- "&:hover": { color: dsw.alias.label.secondary }
2508
- });
2509
- const LineFoldSpacer = styled("span")({
2510
- flex: "none",
2511
- width: FOLD
2512
- });
2513
- const LineKey = styled("span")({
2514
- flex: "none",
2515
- color: dsw.alias.label.primary,
2516
- "&[data-index='true']": { color: dsw.alias.label.caption }
2517
- });
2518
- const LineToken = styled("span")({
2519
- flex: "none",
2520
- color: dsw.alias.label.caption
2521
- });
2522
- const LineValue = styled("span")({
2523
- display: "block",
2524
- minWidth: 0,
2525
- overflow: "hidden",
2526
- textOverflow: "ellipsis",
2527
- cursor: "text",
2528
- color: dsw.alias.state.business.primary,
2529
- "&[data-tone='number']": { color: dsw.alias.state.warn.primary },
2530
- "&[data-tone='boolean']": { color: dsw.alias.state.success.primary },
2531
- "&[data-tone='empty']": { color: dsw.alias.label.caption }
2532
- });
2533
- const ValueSlot = styled("span")({
2534
- display: "block",
2535
- flex: "0 1 auto",
2536
- minWidth: 0,
2537
- overflow: "hidden"
2538
- });
2539
- const ValueTrigger = styled("button")({
2540
- display: "inline-flex",
2541
- alignItems: "center",
2542
- gap: "2px",
2543
- minWidth: 0,
2544
- padding: 0,
2545
- border: 0,
2546
- background: "none",
2547
- font: "inherit",
2548
- textAlign: "left",
2549
- cursor: "pointer",
2550
- color: dsw.alias.label.caption,
2551
- "&:disabled": { cursor: "default" },
2552
- "&:focus-visible": { outline: "none" }
2553
- });
2554
- const CompactInput = styled("span")({
2555
- display: "inline-flex",
2556
- flex: "1 1 auto",
2557
- minWidth: 0,
2558
- "& > span": {
2559
- width: "100%",
2560
- height: ROW,
2561
- padding: "0 6px",
2562
- borderRadius: "4px"
2563
- },
2564
- "& input": {
2565
- fontSize: "14px",
2566
- lineHeight: ROW
2567
- }
2568
- });
2569
- const CompactTextField = styled("span")({
2570
- display: "inline-flex",
2571
- flex: "1 1 auto",
2572
- minWidth: 0,
2573
- padding: "0 6px",
2574
- borderRadius: "4px",
2575
- background: dsw.alias.bg.layer["1"],
2576
- border: 0,
2577
- boxShadow: HAIRLINE,
2578
- "&:focus-within": { "--dsw-elevation-stroke-color": dsw.alias.brand.primary },
2579
- "& > textarea": {
2580
- flex: 1,
2581
- width: "100%",
2582
- minHeight: ACTION,
2583
- maxHeight: "240px",
2584
- padding: 0,
2585
- border: 0,
2586
- outline: "none",
2587
- background: "transparent",
2588
- resize: "none",
2589
- fieldSizing: "content",
2590
- fontFamily: "inherit",
2591
- fontSize: "14px",
2592
- lineHeight: ROW,
2593
- color: dsw.alias.label.primary
2594
- }
2595
- });
2596
- const LineComment = styled("span")({
2597
- flex: "1 1 auto",
2598
- minWidth: 0,
2599
- overflow: "hidden",
2600
- textOverflow: "ellipsis",
2601
- color: dsw.alias.label.tertiary,
2602
- fontFamily: "inherit",
2603
- fontSize: "12px"
2604
- });
2605
- const LineInvalid = styled("span")({
2606
- flex: "0 1 auto",
2607
- minWidth: 0,
2608
- overflow: "hidden",
2609
- textOverflow: "ellipsis",
2610
- color: dsw.alias.state.error.primary,
2611
- fontFamily: "inherit",
2612
- fontSize: "12px"
2613
- });
2614
- const HoverActions = styled(styled("span")({
2615
- display: "inline-flex",
2616
- alignItems: "center",
2617
- gap: ACTION_GAP,
2618
- flex: "none",
2619
- opacity: 0,
2620
- "& > button": {
2621
- display: "inline-flex",
2622
- alignItems: "center",
2623
- justifyContent: "center",
2624
- width: ACTION,
2625
- height: ACTION,
2626
- padding: 0,
2627
- border: 0,
2628
- borderRadius: "4px",
2629
- background: "none",
2630
- color: dsw.alias.label.secondary,
2631
- cursor: "pointer",
2632
- "&:hover": {
2633
- background: dsw.alias.bg.layer["3"],
2634
- color: dsw.alias.label.primary
2635
- },
2636
- "&:disabled": {
2637
- cursor: "not-allowed",
2638
- color: dsw.alias.label.dimmed
2639
- }
2640
- }
2641
- }))({ "&[data-editing='true']": {
2642
- opacity: 1,
2643
- gap: GAP,
2644
- "& > button": {
2645
- boxShadow: HAIRLINE,
2646
- background: dsw.alias.bg.layer["1"],
2647
- color: dsw.alias.label.primary,
2648
- "&:first-of-type": { color: dsw.alias.state.success.primary }
2649
- }
2650
- } });
2651
- const AddWrap = styled("span")({
2652
- position: "relative",
2653
- display: "inline-flex",
2654
- alignItems: "center",
2655
- gap: GAP,
2656
- flex: "1 1 auto",
2657
- minWidth: 0,
2658
- marginLeft: GAP,
2659
- "&[data-invalid='true'] input": { borderColor: dsw.alias.state.error.primary }
2660
- });
2661
- const Hint$1 = styled("p")({
2662
- margin: 0,
2663
- fontSize: "12px",
2664
- lineHeight: 1.5,
2665
- color: dsw.alias.label.tertiary
2666
- });
2667
1506
  //#endregion
2668
1507
  //#region ../../client/ui-primitives/src/client/schema-form/TruncatedTooltip.tsx
2669
1508
  function TruncatedTooltip({ label, children }) {
@@ -2721,7 +1560,8 @@ window.__ModuleLoader__.load({
2721
1560
  owner,
2722
1561
  options: owner.options
2723
1562
  });
2724
- if (owner.node.meta.secret) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineValue, {
1563
+ if (owner.node.meta.secret) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1564
+ className: schema_form_module_css_default.lineValue,
2725
1565
  "data-tone": "empty",
2726
1566
  title: owner.hint,
2727
1567
  children: owner.secretConfigured ? "••••••" : ""
@@ -2729,7 +1569,8 @@ window.__ModuleLoader__.load({
2729
1569
  const text = tokenText(owner.value);
2730
1570
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TruncatedTooltip, {
2731
1571
  label: text,
2732
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineValue, {
1572
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1573
+ className: schema_form_module_css_default.lineValue,
2733
1574
  "data-tone": owner.node.readOnly === null ? tokenTone(owner.value) : "empty",
2734
1575
  children: text
2735
1576
  })
@@ -2759,14 +1600,16 @@ window.__ModuleLoader__.load({
2759
1600
  onClose: () => {
2760
1601
  setOpen(false);
2761
1602
  },
2762
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ValueTrigger, {
1603
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1604
+ className: schema_form_module_css_default.valueTrigger,
2763
1605
  type: "button",
2764
1606
  disabled: owner.disabled,
2765
1607
  "aria-label": owner.label,
2766
1608
  onClick: () => {
2767
1609
  setOpen(true);
2768
1610
  },
2769
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineValue, {
1611
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1612
+ className: schema_form_module_css_default.lineValue,
2770
1613
  "data-tone": current === void 0 ? tokenTone(owner.value) : tokenTone(current.value),
2771
1614
  children: label
2772
1615
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { size: 14 })]
@@ -2895,6 +1738,11 @@ window.__ModuleLoader__.load({
2895
1738
  }
2896
1739
  }
2897
1740
  //#endregion
1741
+ //#region ../../client/ui-primitives/src/client/controls/classes.ts
1742
+ function classes(...names) {
1743
+ return names.filter((name) => typeof name === "string" && name !== "").join(" ");
1744
+ }
1745
+ //#endregion
2898
1746
  //#region ../../client/ui-primitives/src/client/schema-form/Editor.tsx
2899
1747
  function Editor(props) {
2900
1748
  const { ns, state, face, t, resolveText, renderField } = props;
@@ -2910,9 +1758,10 @@ window.__ModuleLoader__.load({
2910
1758
  t
2911
1759
  ]);
2912
1760
  const disabled = !state.writable || !state.available;
2913
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EditorRoot, {
1761
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1762
+ className: schema_form_module_css_default.editorRoot,
2914
1763
  "data-editor": "schema-form",
2915
- children: lines.map((line, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
1764
+ children: lines.map((line, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row$1, {
2916
1765
  line,
2917
1766
  n: index + 1,
2918
1767
  ns,
@@ -2933,35 +1782,35 @@ window.__ModuleLoader__.load({
2933
1782
  });
2934
1783
  },
2935
1784
  onAdded: (path) => {
2936
- setEditing(fieldKey(path));
1785
+ setEditing(fieldKey$1(path));
2937
1786
  },
2938
1787
  dismissed,
2939
1788
  onDismiss: (key) => {
2940
1789
  setDismissed((previous) => new Set(previous).add(key));
2941
1790
  },
2942
1791
  onSelect: (path) => {
2943
- setSelected(fieldKey(path));
1792
+ setSelected(fieldKey$1(path));
2944
1793
  },
2945
1794
  renderField
2946
- }, `${line.kind}:${fieldKey(line.path)}:${String(index)}`))
1795
+ }, `${line.kind}:${fieldKey$1(line.path)}:${String(index)}`))
2947
1796
  });
2948
1797
  }
2949
1798
  function useFold(state, toggled, setToggled) {
2950
1799
  const defaults = (0, react.useMemo)(() => {
2951
1800
  const collapsed = /* @__PURE__ */ new Set();
2952
1801
  for (const item of state.walked) {
2953
- const value = state.fields.get(fieldKey(item.path))?.value;
2954
- if (item.node.meta.collapse && containerShape(item.node, value) !== void 0) collapsed.add(fieldKey(item.path));
1802
+ const value = state.fields.get(fieldKey$1(item.path))?.value;
1803
+ if (item.node.meta.collapse && containerShape(item.node, value) !== void 0) collapsed.add(fieldKey$1(item.path));
2955
1804
  }
2956
1805
  return collapsed;
2957
1806
  }, [state.walked, state.fields]);
2958
1807
  return (0, react.useMemo)(() => ({
2959
1808
  collapsed: (path) => {
2960
- const key = fieldKey(path);
1809
+ const key = fieldKey$1(path);
2961
1810
  return toggled.has(key) !== defaults.has(key);
2962
1811
  },
2963
1812
  toggle: (path) => {
2964
- const key = fieldKey(path);
1813
+ const key = fieldKey$1(path);
2965
1814
  const next = new Set(toggled);
2966
1815
  if (next.has(key)) next.delete(key);
2967
1816
  else next.add(key);
@@ -2973,20 +1822,26 @@ window.__ModuleLoader__.load({
2973
1822
  toggled
2974
1823
  ]);
2975
1824
  }
2976
- function Row({ line, n, ns, state, face, fold, t, resolveText, disabled, editing, selected, dismissed, onEdit, onAdded, onDismiss, onSelect, renderField }) {
2977
- const key = fieldKey(line.path);
1825
+ function Row$1({ line, n, ns, state, face, fold, t, resolveText, disabled, editing, selected, dismissed, onEdit, onAdded, onDismiss, onSelect, renderField }) {
1826
+ const key = fieldKey$1(line.path);
2978
1827
  const indent = { paddingLeft: `${String(line.depth * 14)}px` };
2979
- const body = line.kind === "comment" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineFoldSpacer, { "data-role": "fold" }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TruncatedTooltip, {
1828
+ const body = line.kind === "comment" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1829
+ className: schema_form_module_css_default.lineFoldSpacer,
1830
+ "data-role": "fold"
1831
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TruncatedTooltip, {
2980
1832
  label: line.text,
2981
- children: line.invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineInvalid, {
1833
+ children: line.invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1834
+ className: schema_form_module_css_default.lineInvalid,
2982
1835
  "data-role": "comment",
2983
1836
  children: `// ${line.text}`
2984
- }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineComment, {
1837
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1838
+ className: schema_form_module_css_default.lineComment,
2985
1839
  "data-role": "comment",
2986
1840
  children: `// ${line.text}`
2987
1841
  })
2988
1842
  })] }) : line.kind === "open" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
2989
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineFold, {
1843
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1844
+ className: schema_form_module_css_default.lineFold,
2990
1845
  "data-role": "fold",
2991
1846
  type: "button",
2992
1847
  "aria-expanded": !line.collapsed,
@@ -3002,7 +1857,10 @@ window.__ModuleLoader__.load({
3002
1857
  t,
3003
1858
  disabled
3004
1859
  }),
3005
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineToken, { children: line.shape === "object" ? line.collapsed ? "{…}" : "{" : line.collapsed ? "[…]" : "[" }),
1860
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1861
+ className: schema_form_module_css_default.lineToken,
1862
+ children: line.shape === "object" ? line.collapsed ? "{…}" : "{" : line.collapsed ? "[…]" : "["
1863
+ }),
3006
1864
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(VariantSelect, {
3007
1865
  control: line.variants,
3008
1866
  path: line.path,
@@ -3011,8 +1869,14 @@ window.__ModuleLoader__.load({
3011
1869
  t
3012
1870
  })
3013
1871
  ] }) : line.kind === "close" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3014
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineFoldSpacer, { "data-role": "fold" }),
3015
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineToken, { children: line.shape === "object" ? "}" : "]" }),
1872
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1873
+ className: schema_form_module_css_default.lineFoldSpacer,
1874
+ "data-role": "fold"
1875
+ }),
1876
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1877
+ className: schema_form_module_css_default.lineToken,
1878
+ children: line.shape === "object" ? "}" : "]"
1879
+ }),
3016
1880
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AddLine, {
3017
1881
  line,
3018
1882
  state,
@@ -3035,20 +1899,23 @@ window.__ModuleLoader__.load({
3035
1899
  onDismiss,
3036
1900
  renderField
3037
1901
  });
3038
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(LineRow, {
1902
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1903
+ className: schema_form_module_css_default.lineRow,
3039
1904
  "data-line": line.kind,
3040
1905
  "data-field-path": line.path.join("."),
3041
1906
  "data-selected": selected === key ? "true" : void 0,
3042
1907
  "data-dirty": line.kind === "field" && line.field.staged ? "true" : void 0,
3043
1908
  "data-overridden": line.kind === "field" && line.field.overridden && !line.field.staged ? "true" : void 0,
3044
1909
  "data-invalid": line.kind === "field" && (line.field.invalid !== void 0 || state.invalidAt.has(key)) ? "true" : void 0,
3045
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineNumber, {
1910
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1911
+ className: schema_form_module_css_default.lineNumber,
3046
1912
  "data-role": "number",
3047
1913
  onClick: () => {
3048
1914
  onSelect(line.path);
3049
1915
  },
3050
1916
  children: n
3051
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineBody, {
1917
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1918
+ className: schema_form_module_css_default.lineBody,
3052
1919
  "data-role": "body",
3053
1920
  style: indent,
3054
1921
  children: body
@@ -3056,7 +1923,7 @@ window.__ModuleLoader__.load({
3056
1923
  });
3057
1924
  }
3058
1925
  function FieldLine({ line, ns, state, face, t, disabled, editing, dismissed, onEdit, onDismiss, renderField }) {
3059
- const key = fieldKey(line.path);
1926
+ const key = fieldKey$1(line.path);
3060
1927
  const member = line.member;
3061
1928
  const owner = {
3062
1929
  ns,
@@ -3093,49 +1960,63 @@ window.__ModuleLoader__.load({
3093
1960
  const text = line.field.text ?? valueText(line.field.value);
3094
1961
  const multiline = isMultiline(line.field.value) || /[\r\n]/.test(text);
3095
1962
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3096
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineFoldSpacer, { "data-role": "fold" }),
3097
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineKey, {
1963
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1964
+ className: schema_form_module_css_default.lineFoldSpacer,
1965
+ "data-role": "fold"
1966
+ }),
1967
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1968
+ className: schema_form_module_css_default.lineKey,
3098
1969
  "data-role": "key",
3099
1970
  "data-index": member?.index === void 0 ? void 0 : "true",
3100
1971
  title: member?.key ?? line.node.key,
3101
1972
  children: member?.key ?? line.node.key
3102
1973
  }),
3103
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineToken, { children: member?.index === void 0 ? ": " : " " }),
3104
- isEditing ? multiline ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactTextField, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
3105
- autoFocus: !missing,
3106
- rows: 1,
3107
- "aria-label": owner.label,
3108
- value: text,
3109
- onChange: (event) => {
3110
- owner.onEditText(event.target.value);
3111
- },
3112
- onKeyDown: (event) => {
3113
- if (event.key === "Escape") {
3114
- face.revert(line.path);
3115
- onEdit(void 0);
1974
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1975
+ className: schema_form_module_css_default.lineToken,
1976
+ children: member?.index === void 0 ? ": " : " "
1977
+ }),
1978
+ isEditing ? multiline ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1979
+ className: schema_form_module_css_default.compactTextField,
1980
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
1981
+ autoFocus: !missing,
1982
+ rows: 1,
1983
+ "aria-label": owner.label,
1984
+ value: text,
1985
+ onChange: (event) => {
1986
+ owner.onEditText(event.target.value);
1987
+ },
1988
+ onKeyDown: (event) => {
1989
+ if (event.key === "Escape") {
1990
+ face.revert(line.path);
1991
+ onEdit(void 0);
1992
+ }
3116
1993
  }
3117
- }
3118
- }) }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactInput, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
3119
- autoFocus: !missing,
3120
- type: "text",
3121
- "aria-label": owner.label,
3122
- placeholder: missing ? t("empty") : "",
3123
- value: text,
3124
- onBlur: () => {
3125
- if (!missing) onEdit(void 0);
3126
- },
3127
- onChange: (event) => {
3128
- owner.onEditText(event.target.value);
3129
- },
3130
- onKeyDown: (event) => {
3131
- if (event.key === "Enter" && !missing) onEdit(void 0);
3132
- if (event.key === "Escape") {
3133
- face.revert(line.path);
3134
- onEdit(void 0);
1994
+ })
1995
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1996
+ className: schema_form_module_css_default.compactInput,
1997
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
1998
+ autoFocus: !missing,
1999
+ type: "text",
2000
+ "aria-label": owner.label,
2001
+ placeholder: missing ? t("empty") : "",
2002
+ value: text,
2003
+ onBlur: () => {
2004
+ if (!missing) onEdit(void 0);
2005
+ },
2006
+ onChange: (event) => {
2007
+ owner.onEditText(event.target.value);
2008
+ },
2009
+ onKeyDown: (event) => {
2010
+ if (event.key === "Enter" && !missing) onEdit(void 0);
2011
+ if (event.key === "Escape") {
2012
+ face.revert(line.path);
2013
+ onEdit(void 0);
2014
+ }
3135
2015
  }
3136
- }
3137
- }) }) : null,
3138
- isEditing || line.variantsStandIn ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ValueSlot, {
2016
+ })
2017
+ }) : null,
2018
+ isEditing || line.variantsStandIn ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2019
+ className: schema_form_module_css_default.valueSlot,
3139
2020
  "data-role": "value",
3140
2021
  onClick: () => {
3141
2022
  if (editable) onEdit(key);
@@ -3149,7 +2030,8 @@ window.__ModuleLoader__.load({
3149
2030
  disabled,
3150
2031
  t
3151
2032
  }),
3152
- isEditing ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverActions, {
2033
+ isEditing ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
2034
+ className: classes(schema_form_module_css_default.lineActions, schema_form_module_css_default.hoverActions),
3153
2035
  "data-role": "actions",
3154
2036
  "data-editing": "true",
3155
2037
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -3172,7 +2054,8 @@ window.__ModuleLoader__.load({
3172
2054
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 14 })
3173
2055
  })]
3174
2056
  }) : null,
3175
- /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(HoverActions, {
2057
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
2058
+ className: classes(schema_form_module_css_default.lineActions, schema_form_module_css_default.hoverActions),
3176
2059
  "data-role": "actions",
3177
2060
  children: [
3178
2061
  line.field.staged && !disabled ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
@@ -3238,7 +2121,8 @@ window.__ModuleLoader__.load({
3238
2121
  onClose: () => {
3239
2122
  setOpen(false);
3240
2123
  },
3241
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(ValueTrigger, {
2124
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
2125
+ className: schema_form_module_css_default.valueTrigger,
3242
2126
  type: "button",
3243
2127
  "data-role": "variant",
3244
2128
  disabled,
@@ -3246,7 +2130,8 @@ window.__ModuleLoader__.load({
3246
2130
  onClick: () => {
3247
2131
  setOpen(true);
3248
2132
  },
3249
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineValue, {
2133
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2134
+ className: schema_form_module_css_default.lineValue,
3250
2135
  "data-tone": "empty",
3251
2136
  children: current?.label ?? ""
3252
2137
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { size: 14 })]
@@ -3259,14 +2144,19 @@ window.__ModuleLoader__.load({
3259
2144
  if (key === "") return null;
3260
2145
  const indexed = member !== void 0 && member.index !== void 0;
3261
2146
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
3262
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineKey, {
2147
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2148
+ className: schema_form_module_css_default.lineKey,
3263
2149
  "data-role": "key",
3264
2150
  "data-index": indexed ? "true" : void 0,
3265
2151
  title: key,
3266
2152
  children: key
3267
2153
  }),
3268
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineToken, { children: indexed ? " " : ": " }),
3269
- member === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(HoverActions, {
2154
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2155
+ className: schema_form_module_css_default.lineToken,
2156
+ children: indexed ? " " : ": "
2157
+ }),
2158
+ member === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2159
+ className: classes(schema_form_module_css_default.lineActions, schema_form_module_css_default.hoverActions),
3270
2160
  "data-role": "actions",
3271
2161
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RemoveLineButton, {
3272
2162
  member,
@@ -3314,7 +2204,7 @@ window.__ModuleLoader__.load({
3314
2204
  face.addKey(line.path, raw);
3315
2205
  onAdded([...line.path, raw]);
3316
2206
  } else if (spec.kind === "item") {
3317
- const current = state.fields.get(fieldKey(line.path))?.value;
2207
+ const current = state.fields.get(fieldKey$1(line.path))?.value;
3318
2208
  const index = Array.isArray(current) ? current.length : 0;
3319
2209
  face.appendItem(line.path);
3320
2210
  onAdded([...line.path, String(index)]);
@@ -3329,7 +2219,8 @@ window.__ModuleLoader__.load({
3329
2219
  setText("");
3330
2220
  setOpen(false);
3331
2221
  };
3332
- return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(AddWrap, {
2222
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
2223
+ className: schema_form_module_css_default.addWrap,
3333
2224
  "data-add": spec.kind,
3334
2225
  "data-invalid": invalid ? "true" : void 0,
3335
2226
  children: [
@@ -3349,35 +2240,44 @@ window.__ModuleLoader__.load({
3349
2240
  onClose: () => {
3350
2241
  setOpen(false);
3351
2242
  },
3352
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CompactInput, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
3353
- value: text,
3354
- placeholder: label,
3355
- "aria-label": label,
3356
- disabled,
3357
- onFocus: () => {
3358
- setOpen(true);
3359
- },
3360
- onChange: (event) => {
3361
- setText(event.target.value);
3362
- setInvalid(false);
3363
- setOpen(true);
3364
- },
3365
- onKeyDown: (event) => {
3366
- if (event.key === "Enter") {
3367
- event.preventDefault();
3368
- commit(matched.length === 1 && spec.kind === "prop" ? matched[0]?.key : void 0);
3369
- }
3370
- if (event.key === "Escape") {
3371
- setText("");
3372
- setOpen(false);
2243
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2244
+ className: schema_form_module_css_default.compactInput,
2245
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
2246
+ value: text,
2247
+ placeholder: label,
2248
+ "aria-label": label,
2249
+ disabled,
2250
+ onFocus: () => {
2251
+ setOpen(true);
2252
+ },
2253
+ onChange: (event) => {
2254
+ setText(event.target.value);
2255
+ setInvalid(false);
2256
+ setOpen(true);
2257
+ },
2258
+ onKeyDown: (event) => {
2259
+ if (event.key === "Enter") {
2260
+ event.preventDefault();
2261
+ commit(matched.length === 1 && spec.kind === "prop" ? matched[0]?.key : void 0);
2262
+ }
2263
+ if (event.key === "Escape") {
2264
+ setText("");
2265
+ setOpen(false);
2266
+ }
3373
2267
  }
3374
- }
3375
- }) })
2268
+ })
2269
+ })
3376
2270
  }),
3377
- invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineInvalid, { children: t("unknownProperty") }) : null,
2271
+ invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2272
+ className: schema_form_module_css_default.lineInvalid,
2273
+ children: t("unknownProperty")
2274
+ }) : null,
3378
2275
  !invalid && matched.length === 1 && matched[0]?.description !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TruncatedTooltip, {
3379
2276
  label: resolveText(matched[0].description),
3380
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(LineComment, { children: resolveText(matched[0].description) })
2277
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2278
+ className: schema_form_module_css_default.lineComment,
2279
+ children: resolveText(matched[0].description)
2280
+ })
3381
2281
  }) : null
3382
2282
  ]
3383
2283
  });
@@ -3395,7 +2295,8 @@ window.__ModuleLoader__.load({
3395
2295
  save: t("save"),
3396
2296
  saving: t("saving")
3397
2297
  };
3398
- if (!state.configured) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hint$1, {
2298
+ if (!state.configured) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2299
+ className: schema_form_module_css_default.hint,
3399
2300
  role: "status",
3400
2301
  children: t("noSchema")
3401
2302
  });
@@ -3418,7 +2319,8 @@ window.__ModuleLoader__.load({
3418
2319
  ...owner,
3419
2320
  onEditText: withParse(owner, t)
3420
2321
  } }) })
3421
- }), state.violation === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Hint$1, {
2322
+ }), state.violation === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2323
+ className: schema_form_module_css_default.hint,
3422
2324
  role: "alert",
3423
2325
  "data-violation": "true",
3424
2326
  children: t("notSaved", { message: state.violation.message })
@@ -3432,6 +2334,29 @@ window.__ModuleLoader__.load({
3432
2334
  }
3433
2335
  //#endregion
3434
2336
  //#region ../../client/ui-primitives/src/client/schema-form/index.ts
2337
+ var schema_form_exports = /* @__PURE__ */ __exportAll({
2338
+ InlineValue: () => InlineValue,
2339
+ NS: () => NS$1,
2340
+ SchemaFieldDefault: () => SchemaFieldDefault,
2341
+ SchemaFormController: () => SchemaFormController,
2342
+ SchemaFormHints: () => SchemaFormHints,
2343
+ apply: () => apply$2,
2344
+ canRender: () => canRender,
2345
+ containerShape: () => containerShape,
2346
+ editorLines: () => editorLines,
2347
+ failureOf: () => failureOf,
2348
+ inject: () => inject$2,
2349
+ optionsFor: () => optionsFor,
2350
+ parseFor: () => parseFor,
2351
+ projectNode: () => projectNode,
2352
+ projectRoot: () => projectRoot,
2353
+ rowRegistrations: () => rowRegistrations,
2354
+ tokenText: () => tokenText,
2355
+ tokenTone: () => tokenTone,
2356
+ valueText: () => valueText,
2357
+ visibleFields: () => visibleFields,
2358
+ walkFields: () => walkFields
2359
+ });
3435
2360
  const NS$1 = "settings.schema-form";
3436
2361
  const inject$2 = [
3437
2362
  "slots",
@@ -3543,205 +2468,835 @@ window.__ModuleLoader__.load({
3543
2468
  }, "ui-schema-form: row registrations");
3544
2469
  }
3545
2470
  //#endregion
3546
- //#region ../../client/ui-primitives/src/client/styling/focus.ts
3547
- const focusRing = `${String(dsw.focus.ring.width)} solid ${Token.collect(Token.fallbackVar(dsw.focus.ring.color, String(dsw.alias.state.business.primary)))}`;
3548
- //#endregion
3549
- //#region ../../client/ui-primitives/src/client/settings-form/fields.styles.ts
3550
- const helpButtonHoverBackground = "var(--dsw-alias-bg-layer-4)";
3551
- const styles$1 = {
3552
- field: {
3553
- display: "flex",
3554
- flexDirection: "column",
3555
- gap: "6px",
3556
- padding: "12px 0",
3557
- "& + &": { borderTop: `0.5px solid ${String(dsw.alias.border.l2)}` }
3558
- },
3559
- head: {
3560
- display: "flex",
3561
- alignItems: "center",
3562
- gap: "8px"
3563
- },
3564
- label: {
3565
- flex: 1,
3566
- minWidth: 0,
3567
- fontSize: "13px",
3568
- fontWeight: 500,
3569
- lineHeight: 1.5,
3570
- color: dsw.alias.label.primary
3571
- },
3572
- groupLabel: { flex: "0 1 auto" },
3573
- labelGroup: {
3574
- display: "flex",
3575
- alignItems: "center",
3576
- gap: "4px",
3577
- flex: 1,
3578
- minWidth: 0
3579
- },
3580
- helpButton: {
3581
- display: "inline-flex",
3582
- alignItems: "center",
3583
- justifyContent: "center",
3584
- flex: "none",
3585
- width: "24px",
3586
- height: "24px",
3587
- padding: 0,
3588
- border: 0,
3589
- borderRadius: "6px",
3590
- background: "none",
3591
- color: dsw.alias.label.tertiary,
3592
- cursor: "pointer",
3593
- "&:hover": {
3594
- background: helpButtonHoverBackground,
3595
- color: dsw.alias.label.secondary
3596
- },
3597
- "&[aria-expanded='true']": {
3598
- background: helpButtonHoverBackground,
3599
- color: dsw.alias.label.secondary
3600
- },
3601
- "&:focus-visible": {
3602
- outline: focusRing,
3603
- outlineOffset: "1px"
3604
- }
3605
- },
3606
- help: {
3607
- padding: "10px 0 0",
3608
- fontSize: "12px",
3609
- lineHeight: 1.6,
3610
- color: dsw.alias.label.secondary,
3611
- "& > p": { margin: 0 },
3612
- "& > p + p": { marginTop: "8px" }
3613
- },
3614
- badges: {
3615
- display: "inline-flex",
3616
- alignItems: "center",
3617
- gap: "8px"
3618
- },
3619
- badge: {
3620
- display: "inline-flex",
3621
- alignItems: "center",
3622
- borderRadius: "999px",
3623
- cornerShape: "round",
3624
- padding: "1px 8px",
3625
- fontSize: "11px",
3626
- lineHeight: "17px",
3627
- fontWeight: 500,
3628
- whiteSpace: "nowrap"
3629
- },
3630
- badgeNeutral: {
3631
- background: dsw.alias.bg.module.platform,
3632
- color: dsw.alias.label.secondary
3633
- },
3634
- badgeQuiet: { color: dsw.alias.label.tertiary },
3635
- reset: {
3636
- border: "none",
3637
- background: "none",
3638
- padding: 0,
3639
- font: "inherit",
3640
- fontSize: "12px",
3641
- lineHeight: 1.5,
3642
- color: dsw.alias.label.secondary,
3643
- cursor: "pointer",
3644
- "&:hover:not(:disabled)": { color: dsw.alias.label.primary },
3645
- "&:disabled": { cursor: "default" }
3646
- },
3647
- input: {
3648
- height: "34px",
3649
- padding: "0 12px",
3650
- border: `0.5px solid ${String(dsw.alias.border.l4)}`,
3651
- borderRadius: "8px",
3652
- background: dsw.alias.bg.layer["3"],
3653
- font: "inherit",
3654
- fontSize: "13px",
3655
- lineHeight: 1.5,
3656
- color: dsw.alias.label.primary,
3657
- "&:focus-visible": {
3658
- outline: "none",
3659
- borderColor: dsw.alias.state.business.primary
3660
- },
3661
- "&:disabled": {
3662
- color: dsw.alias.label.tertiary,
3663
- cursor: "default"
2471
+ //#region ../../client/ui-primitives/src/client/markdown-labels.ts
2472
+ function markdownLabels(t) {
2473
+ return {
2474
+ code: {
2475
+ copyLabel: t("copy"),
2476
+ copiedLabel: t("copied")
3664
2477
  },
3665
- "&[aria-invalid='true']": { borderColor: dsw.alias.state.error.primary }
3666
- },
3667
- invalid: {
3668
- margin: 0,
3669
- fontSize: "12px",
3670
- lineHeight: 1.5,
3671
- color: dsw.alias.state.error.primary
3672
- },
3673
- hint: {
3674
- margin: 0,
3675
- fontSize: "12px",
3676
- lineHeight: 1.5,
3677
- color: dsw.alias.label.tertiary
3678
- }
2478
+ footnotes: t("markdown.footnotes")
2479
+ };
2480
+ }
2481
+ //#endregion
2482
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/layout/layout.module.css.mjs
2483
+ const css$15 = ".e_G4ZW_stack{flex-direction:column;min-width:0;display:flex}.e_G4ZW_row{flex-direction:row;align-items:center;min-width:0;display:flex}.e_G4ZW_gap0{gap:0}.e_G4ZW_gap2{gap:2px}.e_G4ZW_gap4{gap:4px}.e_G4ZW_gap6{gap:6px}.e_G4ZW_gap8{gap:8px}.e_G4ZW_gap10{gap:10px}.e_G4ZW_gap12{gap:12px}.e_G4ZW_gap14{gap:14px}.e_G4ZW_gap16{gap:16px}.e_G4ZW_alignStart{align-items:flex-start}.e_G4ZW_alignCenter{align-items:center}.e_G4ZW_alignEnd{align-items:flex-end}.e_G4ZW_justifyBetween{justify-content:space-between}.e_G4ZW_justifyEnd{justify-content:flex-end}.e_G4ZW_justifyCenter{justify-content:center}.e_G4ZW_wrap{flex-wrap:wrap}.e_G4ZW_grow{flex:auto;min-width:0}.e_G4ZW_push{margin-left:auto}.e_G4ZW_fill{box-sizing:border-box;width:100%;height:100%;overflow:hidden}.e_G4ZW_scroll{flex:auto;min-height:0;overflow-y:auto}.e_G4ZW_plain{margin:0;padding:0;list-style:none}.e_G4ZW_padNone{padding:0}.e_G4ZW_padCard{padding:8px 12px}.e_G4ZW_padBody{padding:8px 0}.e_G4ZW_padPage{padding:24px 28px}.e_G4ZW_padRow{padding:10px 12px}.e_G4ZW_padBlocking{padding:32px 40px}.e_G4ZW_text{margin:0}.e_G4ZW_sizeXs{font-size:11px;line-height:1.5}.e_G4ZW_sizeSm{font-size:12px;line-height:18px}.e_G4ZW_sizeMd{font-size:13px;line-height:20px}.e_G4ZW_sizeBase{font-size:14px;line-height:24px}.e_G4ZW_sizeLg{font-size:16px;line-height:24px}.e_G4ZW_tonePrimary{color:var(--dsw-alias-label-primary)}.e_G4ZW_toneSecondary{color:var(--dsw-alias-label-secondary)}.e_G4ZW_toneTertiary{color:var(--dsw-alias-label-tertiary)}.e_G4ZW_toneDanger{color:var(--dsw-alias-label-error,var(--dsw-alias-label-primary))}.e_G4ZW_weightMedium{font-weight:500}.e_G4ZW_strong{font-weight:600}.e_G4ZW_mono{word-break:break-all;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,monospace}.e_G4ZW_truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.e_G4ZW_tabular{font-variant-numeric:tabular-nums}.e_G4ZW_boxed{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:10px}.e_G4ZW_fixed{flex:none}.e_G4ZW_gapWide{gap:6px 20px}.e_G4ZW_narrow{min-width:0;max-width:min(calc(var(--dsh-chat-content-width,748px) * .702), 82%)}.e_G4ZW_wSearch{flex:none;width:360px;max-width:100%}";
2484
+ const tagId$15 = "@morlay/dsh-session-mode/layout.module.css";
2485
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/layout.module.css\"]") === null) {
2486
+ const tag = document.createElement("style");
2487
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2488
+ tag.dataset.pluginCss = tagId$15;
2489
+ tag.textContent = css$15;
2490
+ document.head.appendChild(tag);
2491
+ }
2492
+ var layout_module_css_default = {
2493
+ "plain": "e_G4ZW_plain",
2494
+ "gap0": "e_G4ZW_gap0",
2495
+ "alignEnd": "e_G4ZW_alignEnd",
2496
+ "justifyCenter": "e_G4ZW_justifyCenter",
2497
+ "fill": "e_G4ZW_fill",
2498
+ "gap14": "e_G4ZW_gap14",
2499
+ "grow": "e_G4ZW_grow",
2500
+ "padBody": "e_G4ZW_padBody",
2501
+ "sizeXs": "e_G4ZW_sizeXs",
2502
+ "toneDanger": "e_G4ZW_toneDanger",
2503
+ "gap12": "e_G4ZW_gap12",
2504
+ "gap16": "e_G4ZW_gap16",
2505
+ "alignCenter": "e_G4ZW_alignCenter",
2506
+ "strong": "e_G4ZW_strong",
2507
+ "gap2": "e_G4ZW_gap2",
2508
+ "row": "e_G4ZW_row",
2509
+ "alignStart": "e_G4ZW_alignStart",
2510
+ "tonePrimary": "e_G4ZW_tonePrimary",
2511
+ "gap8": "e_G4ZW_gap8",
2512
+ "text": "e_G4ZW_text",
2513
+ "gapWide": "e_G4ZW_gapWide",
2514
+ "push": "e_G4ZW_push",
2515
+ "padRow": "e_G4ZW_padRow",
2516
+ "padPage": "e_G4ZW_padPage",
2517
+ "scroll": "e_G4ZW_scroll",
2518
+ "padCard": "e_G4ZW_padCard",
2519
+ "justifyBetween": "e_G4ZW_justifyBetween",
2520
+ "wrap": "e_G4ZW_wrap",
2521
+ "sizeSm": "e_G4ZW_sizeSm",
2522
+ "gap4": "e_G4ZW_gap4",
2523
+ "justifyEnd": "e_G4ZW_justifyEnd",
2524
+ "stack": "e_G4ZW_stack",
2525
+ "gap6": "e_G4ZW_gap6",
2526
+ "padBlocking": "e_G4ZW_padBlocking",
2527
+ "sizeMd": "e_G4ZW_sizeMd",
2528
+ "sizeBase": "e_G4ZW_sizeBase",
2529
+ "sizeLg": "e_G4ZW_sizeLg",
2530
+ "gap10": "e_G4ZW_gap10",
2531
+ "weightMedium": "e_G4ZW_weightMedium",
2532
+ "toneSecondary": "e_G4ZW_toneSecondary",
2533
+ "boxed": "e_G4ZW_boxed",
2534
+ "narrow": "e_G4ZW_narrow",
2535
+ "wSearch": "e_G4ZW_wSearch",
2536
+ "tabular": "e_G4ZW_tabular",
2537
+ "truncate": "e_G4ZW_truncate",
2538
+ "padNone": "e_G4ZW_padNone",
2539
+ "fixed": "e_G4ZW_fixed",
2540
+ "toneTertiary": "e_G4ZW_toneTertiary",
2541
+ "mono": "e_G4ZW_mono"
3679
2542
  };
3680
- styled("div")(styles$1.field);
3681
- styled("div")(styles$1.head);
3682
- styled("div")(styles$1.labelGroup);
3683
- styled("label")(styles$1.label, styles$1.groupLabel);
3684
- styled("label")(styles$1.label);
3685
- styled("button")(styles$1.helpButton);
3686
- styled("div")(styles$1.help);
3687
- styled("span")(styles$1.badges);
3688
- styled("span")(styles$1.badge, styles$1.badgeNeutral);
3689
- styled("span")(styles$1.badge, styles$1.badgeQuiet);
3690
- styled("button")(styles$1.reset);
3691
- styled("input")(styles$1.input);
3692
- styled("p")(styles$1.invalid);
3693
- styled("p")(styles$1.hint);
3694
- const styles = {
3695
- form: {
3696
- display: "flex",
3697
- flexDirection: "column"
3698
- },
3699
- notice: {
3700
- margin: "0 0 12px",
3701
- fontSize: "12px",
3702
- lineHeight: 1.5,
3703
- color: dsw.alias.label.tertiary
3704
- },
3705
- footer: {
3706
- display: "flex",
3707
- alignItems: "center",
3708
- gap: "8px",
3709
- paddingTop: "16px"
3710
- },
3711
- failed: {
3712
- flex: 1,
3713
- minWidth: 0,
3714
- margin: 0,
3715
- fontSize: "12px",
3716
- lineHeight: 1.5,
3717
- color: "var(--dsw-alias-label-error)"
3718
- },
3719
- save: {
3720
- appearance: "none",
3721
- border: "1px solid transparent",
3722
- borderRadius: "8px",
3723
- padding: "5px 14px",
3724
- font: "inherit",
3725
- fontSize: "13px",
3726
- lineHeight: 1.5,
3727
- cursor: "pointer",
3728
- background: dsw.alias.label.primary,
3729
- color: dsw.alias.bg.layer["3"],
3730
- "&:disabled": {
3731
- opacity: .4,
3732
- cursor: "default"
3733
- },
3734
- "&:focus-visible": {
3735
- outline: focusRing,
3736
- outlineOffset: "1px"
3737
- }
2543
+ //#endregion
2544
+ //#region ../../client/ui-primitives/src/client/layout/scales.ts
2545
+ function gapClass(css, gap) {
2546
+ if (gap === void 0) return void 0;
2547
+ return gap === "wide" ? css.gapWide : css[`gap${gap}`];
2548
+ }
2549
+ function alignClass(css, align) {
2550
+ if (align === void 0 || align === "stretch") return void 0;
2551
+ if (align === "start") return css.alignStart;
2552
+ return align === "center" ? css.alignCenter : css.alignEnd;
2553
+ }
2554
+ function justifyClass(css, justify) {
2555
+ if (justify === void 0) return void 0;
2556
+ if (justify === "between") return css.justifyBetween;
2557
+ if (justify === "end") return css.justifyEnd;
2558
+ return justify === "center" ? css.justifyCenter : void 0;
2559
+ }
2560
+ function padClass(css, pad) {
2561
+ if (pad === void 0 || pad === "none") return void 0;
2562
+ if (pad === "card") return css.padCard;
2563
+ if (pad === "body") return css.padBody;
2564
+ if (pad === "page") return css.padPage;
2565
+ return pad === "row" ? css.padRow : css.padBlocking;
2566
+ }
2567
+ function sizeClass(css, size) {
2568
+ if (size === void 0) return void 0;
2569
+ if (size === "xs") return css.sizeXs;
2570
+ if (size === "sm") return css.sizeSm;
2571
+ if (size === "md") return css.sizeMd;
2572
+ return size === "base" ? css.sizeBase : css.sizeLg;
2573
+ }
2574
+ function toneClass(css, tone) {
2575
+ if (tone === void 0) return void 0;
2576
+ if (tone === "primary") return css.tonePrimary;
2577
+ if (tone === "secondary") return css.toneSecondary;
2578
+ return tone === "tertiary" ? css.toneTertiary : css.toneDanger;
2579
+ }
2580
+ function weightClass(css, weight) {
2581
+ if (weight === void 0) return void 0;
2582
+ return weight === "medium" ? css.weightMedium : css.strong;
2583
+ }
2584
+ //#endregion
2585
+ //#region ../../client/ui-primitives/src/client/layout/Row.tsx
2586
+ const Row = (0, react.forwardRef)(function Row({ as: Element = "div", gap, align, justify, wrap = false, grow = false, boxed = false, fixed = false, narrow = false, push = false, plain = false, pad, className, children, ...rest }, ref) {
2587
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Element, {
2588
+ ref,
2589
+ className: classes(layout_module_css_default.row, gapClass(layout_module_css_default, gap), alignClass(layout_module_css_default, align), justifyClass(layout_module_css_default, justify), padClass(layout_module_css_default, pad), wrap ? layout_module_css_default.wrap : void 0, grow ? layout_module_css_default.grow : void 0, boxed ? layout_module_css_default.boxed : void 0, fixed ? layout_module_css_default.fixed : void 0, narrow ? layout_module_css_default.narrow : void 0, push ? layout_module_css_default.push : void 0, boxed ? layout_module_css_default.boxed : void 0, fixed ? layout_module_css_default.fixed : void 0, plain ? layout_module_css_default.plain : void 0, className),
2590
+ ...rest,
2591
+ children
2592
+ });
2593
+ });
2594
+ //#endregion
2595
+ //#region ../../client/ui-primitives/src/client/layout/Stack.tsx
2596
+ const Stack = (0, react.forwardRef)(function Stack({ as: Element = "div", gap, align, pad, grow = false, boxed = false, fixed = false, narrow = false, fill = false, scroll = false, plain = false, className, children, ...rest }, ref) {
2597
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Element, {
2598
+ ref,
2599
+ className: classes(layout_module_css_default.stack, gapClass(layout_module_css_default, gap), alignClass(layout_module_css_default, align), padClass(layout_module_css_default, pad), grow ? layout_module_css_default.grow : void 0, boxed ? layout_module_css_default.boxed : void 0, fixed ? layout_module_css_default.fixed : void 0, narrow ? layout_module_css_default.narrow : void 0, fill ? layout_module_css_default.fill : void 0, scroll ? layout_module_css_default.scroll : void 0, plain ? layout_module_css_default.plain : void 0, className),
2600
+ ...rest,
2601
+ children
2602
+ });
2603
+ });
2604
+ //#endregion
2605
+ //#region ../../client/ui-primitives/src/client/layout/Text.tsx
2606
+ function Text({ as: Element = "span", size, tone, weight, mono = false, truncate = false, tabular = false, className, children }) {
2607
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Element, {
2608
+ className: classes(layout_module_css_default.text, sizeClass(layout_module_css_default, size), toneClass(layout_module_css_default, tone), weightClass(layout_module_css_default, weight), mono ? layout_module_css_default.mono : void 0, truncate ? layout_module_css_default.truncate : void 0, tabular ? layout_module_css_default.tabular : void 0, className),
2609
+ children
2610
+ });
2611
+ }
2612
+ //#endregion
2613
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/settings-form/SettingsFieldRow.module.css.mjs
2614
+ const css$14 = "._72UBVa_row{flex-direction:column;display:flex}._72UBVa_row[data-divider=true]{border-top:.5px solid var(--dsw-alias-border-l2)}._72UBVa_body{flex-direction:column;gap:6px;padding:12px 0;display:flex}._72UBVa_inline{flex-direction:row;justify-content:space-between;align-items:center;gap:16px;padding:12px 0;display:flex}._72UBVa_text{flex-direction:column;gap:2px;min-width:0;display:flex}._72UBVa_label{color:var(--dsw-alias-label-primary);align-items:center;gap:8px;font-size:13px;font-weight:500;line-height:1.5;display:flex}._72UBVa_badge{corner-shape:round;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);border-radius:999px;align-items:center;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}._72UBVa_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}._72UBVa_reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}._72UBVa_reset:disabled{cursor:default}._72UBVa_hint{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}._72UBVa_invalid{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:1.5}";
2615
+ const tagId$14 = "@morlay/dsh-session-mode/SettingsFieldRow.module.css";
2616
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/SettingsFieldRow.module.css\"]") === null) {
2617
+ const tag = document.createElement("style");
2618
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2619
+ tag.dataset.pluginCss = tagId$14;
2620
+ tag.textContent = css$14;
2621
+ document.head.appendChild(tag);
2622
+ }
2623
+ var SettingsFieldRow_module_css_default = {
2624
+ "row": "_72UBVa_row",
2625
+ "inline": "_72UBVa_inline",
2626
+ "badge": "_72UBVa_badge",
2627
+ "invalid": "_72UBVa_invalid",
2628
+ "hint": "_72UBVa_hint",
2629
+ "body": "_72UBVa_body",
2630
+ "reset": "_72UBVa_reset",
2631
+ "text": "_72UBVa_text",
2632
+ "label": "_72UBVa_label"
2633
+ };
2634
+ //#endregion
2635
+ //#region ../../client/ui-primitives/src/client/settings-form/SettingsFieldRow.tsx
2636
+ function SettingsFieldRow({ label, hint, layout = "stack", divider = false, overriddenLabel, resetLabel, onReset, invalid, children, className, ...rest }) {
2637
+ const labelNode = /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
2638
+ className: SettingsFieldRow_module_css_default.label,
2639
+ children: [label, overriddenLabel === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2640
+ className: SettingsFieldRow_module_css_default.badge,
2641
+ children: overriddenLabel
2642
+ }), resetLabel === void 0 || onReset === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2643
+ type: "button",
2644
+ className: SettingsFieldRow_module_css_default.reset,
2645
+ onClick: () => {
2646
+ onReset();
2647
+ },
2648
+ children: resetLabel
2649
+ })] })]
2650
+ });
2651
+ const invalidNode = invalid === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2652
+ className: SettingsFieldRow_module_css_default.invalid,
2653
+ role: "alert",
2654
+ children: invalid
2655
+ });
2656
+ if (layout === "inline") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2657
+ className: classes(SettingsFieldRow_module_css_default.row, className),
2658
+ "data-role": "field-row",
2659
+ "data-divider": divider ? "true" : "false",
2660
+ ...rest,
2661
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2662
+ className: SettingsFieldRow_module_css_default.inline,
2663
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2664
+ className: SettingsFieldRow_module_css_default.text,
2665
+ children: [labelNode, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2666
+ className: SettingsFieldRow_module_css_default.hint,
2667
+ children: hint
2668
+ })]
2669
+ }), children]
2670
+ }), invalidNode]
2671
+ });
2672
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2673
+ className: classes(SettingsFieldRow_module_css_default.row, className),
2674
+ "data-role": "field-row",
2675
+ "data-divider": divider ? "true" : "false",
2676
+ ...rest,
2677
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
2678
+ className: SettingsFieldRow_module_css_default.body,
2679
+ children: [
2680
+ labelNode,
2681
+ children,
2682
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2683
+ className: SettingsFieldRow_module_css_default.hint,
2684
+ children: hint
2685
+ })
2686
+ ]
2687
+ }), invalidNode]
2688
+ });
2689
+ }
2690
+ //#endregion
2691
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/Bubble.module.css.mjs
2692
+ const css$13 = ".dtkLCG_bubble{background:var(--dsw-specific-bubble);border-radius:var(--dsw-radius-xl);max-width:100%;font-size:var(--dsh-content-font-size,14px);line-height:calc(22px + var(--dsh-content-font-delta,0px));color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;padding:10px 16px}";
2693
+ const tagId$13 = "@morlay/dsh-session-mode/Bubble.module.css";
2694
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/Bubble.module.css\"]") === null) {
2695
+ const tag = document.createElement("style");
2696
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2697
+ tag.dataset.pluginCss = tagId$13;
2698
+ tag.textContent = css$13;
2699
+ document.head.appendChild(tag);
2700
+ }
2701
+ var Bubble_module_css_default = { "bubble": "dtkLCG_bubble" };
2702
+ //#endregion
2703
+ //#region ../../client/ui-primitives/src/client/controls/Bubble.tsx
2704
+ function Bubble({ className, children, ...rest }) {
2705
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2706
+ className: classes(Bubble_module_css_default.bubble, className),
2707
+ ...rest,
2708
+ children
2709
+ });
2710
+ }
2711
+ //#endregion
2712
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/Button.module.css.mjs
2713
+ const css$12 = ".WFViLq_label{white-space:nowrap}.WFViLq_danger{--dsw-alias-button-primary-fill:var(--dsw-alias-state-error-primary)}";
2714
+ const tagId$12 = "@morlay/dsh-session-mode/Button.module.css";
2715
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/Button.module.css\"]") === null) {
2716
+ const tag = document.createElement("style");
2717
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2718
+ tag.dataset.pluginCss = tagId$12;
2719
+ tag.textContent = css$12;
2720
+ document.head.appendChild(tag);
2721
+ }
2722
+ var Button_module_css_default = {
2723
+ "label": "WFViLq_label",
2724
+ "danger": "WFViLq_danger"
2725
+ };
2726
+ //#endregion
2727
+ //#region ../../client/ui-primitives/src/client/controls/Button.tsx
2728
+ const Button$1 = (0, react.forwardRef)(function Button({ className, tone, ...rest }, ref) {
2729
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
2730
+ ref,
2731
+ "data-role": "button",
2732
+ className: classes(className, Button_module_css_default.label, tone === "danger" ? Button_module_css_default.danger : void 0),
2733
+ ...rest
2734
+ });
2735
+ });
2736
+ //#endregion
2737
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/DisclosureRow.module.css.mjs
2738
+ const css$11 = ".MBWCEG_content{flex:auto;min-width:0}.MBWCEG_contentLayout{align-items:center;gap:8px;width:100%;min-width:0;display:flex}";
2739
+ const tagId$11 = "@morlay/dsh-session-mode/DisclosureRow.module.css";
2740
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/DisclosureRow.module.css\"]") === null) {
2741
+ const tag = document.createElement("style");
2742
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2743
+ tag.dataset.pluginCss = tagId$11;
2744
+ tag.textContent = css$11;
2745
+ document.head.appendChild(tag);
2746
+ }
2747
+ var DisclosureRow_module_css_default = {
2748
+ "contentLayout": "MBWCEG_contentLayout",
2749
+ "content": "MBWCEG_content"
2750
+ };
2751
+ //#endregion
2752
+ //#region ../../client/ui-primitives/src/client/controls/DisclosureRow.tsx
2753
+ function DisclosureRow(props) {
2754
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.DisclosureRow, {
2755
+ contentClassName: DisclosureRow_module_css_default.content,
2756
+ contentLayoutClassName: DisclosureRow_module_css_default.contentLayout,
2757
+ ...props
2758
+ });
2759
+ }
2760
+ //#endregion
2761
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/SearchInput.module.css.mjs
2762
+ const css$10 = ".KiR4MG_search{flex:none;width:360px;max-width:100%}.KiR4MG_full{flex:none;width:100%}";
2763
+ const tagId$10 = "@morlay/dsh-session-mode/SearchInput.module.css";
2764
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/SearchInput.module.css\"]") === null) {
2765
+ const tag = document.createElement("style");
2766
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2767
+ tag.dataset.pluginCss = tagId$10;
2768
+ tag.textContent = css$10;
2769
+ document.head.appendChild(tag);
2770
+ }
2771
+ var SearchInput_module_css_default = {
2772
+ "search": "KiR4MG_search",
2773
+ "full": "KiR4MG_full"
2774
+ };
2775
+ //#endregion
2776
+ //#region ../../client/ui-primitives/src/client/controls/SearchInput.tsx
2777
+ function SearchInput({ width = "search", className, ...rest }) {
2778
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
2779
+ className: classes(className, width === "search" ? SearchInput_module_css_default.search : SearchInput_module_css_default.full),
2780
+ ...rest
2781
+ });
2782
+ }
2783
+ //#endregion
2784
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/SeatButton.module.css.mjs
2785
+ const css$9 = ".HcNbhG_seat{border-radius:var(--dsw-radius-sm);min-width:0;max-width:min(100%,240px);min-height:28px;color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;background:0 0;border:none;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;line-height:20px;display:inline-flex}.HcNbhG_seat:not(:disabled):hover,.HcNbhG_seat[aria-expanded=true],.HcNbhG_expanded{background:var(--dsw-alias-interactive-bg-hover)}.HcNbhG_seat:disabled{cursor:default;color:var(--dsw-alias-label-quaternary)}.HcNbhG_icon{color:var(--dsw-alias-label-primary);flex:none;align-items:center;display:inline-flex}.HcNbhG_label{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.HcNbhG_chevron{color:var(--dsw-alias-label-caption);flex:none;display:inline-flex}";
2786
+ const tagId$9 = "@morlay/dsh-session-mode/SeatButton.module.css";
2787
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/SeatButton.module.css\"]") === null) {
2788
+ const tag = document.createElement("style");
2789
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2790
+ tag.dataset.pluginCss = tagId$9;
2791
+ tag.textContent = css$9;
2792
+ document.head.appendChild(tag);
2793
+ }
2794
+ var SeatButton_module_css_default = {
2795
+ "icon": "HcNbhG_icon",
2796
+ "expanded": "HcNbhG_expanded",
2797
+ "label": "HcNbhG_label",
2798
+ "chevron": "HcNbhG_chevron",
2799
+ "seat": "HcNbhG_seat"
2800
+ };
2801
+ //#endregion
2802
+ //#region ../../client/ui-primitives/src/client/controls/SeatButton.tsx
2803
+ function SeatButton({ icon, label, expanded = false, chevron, type = "button", className, ...rest }) {
2804
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
2805
+ type,
2806
+ className: classes(SeatButton_module_css_default.seat, expanded ? SeatButton_module_css_default.expanded : void 0, className),
2807
+ ...rest,
2808
+ children: [
2809
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2810
+ className: SeatButton_module_css_default.icon,
2811
+ children: icon
2812
+ }),
2813
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2814
+ className: SeatButton_module_css_default.label,
2815
+ children: label
2816
+ }),
2817
+ chevron === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2818
+ className: SeatButton_module_css_default.chevron,
2819
+ children: chevron
2820
+ })
2821
+ ]
2822
+ });
2823
+ }
2824
+ //#endregion
2825
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/Spinner.module.css.mjs
2826
+ const css$8 = ".HGVDmW_spinner{border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-label-primary);border-radius:50%;width:28px;height:28px;animation:.9s linear infinite HGVDmW_spin}@keyframes HGVDmW_spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}";
2827
+ const tagId$8 = "@morlay/dsh-session-mode/Spinner.module.css";
2828
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/Spinner.module.css\"]") === null) {
2829
+ const tag = document.createElement("style");
2830
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2831
+ tag.dataset.pluginCss = tagId$8;
2832
+ tag.textContent = css$8;
2833
+ document.head.appendChild(tag);
2834
+ }
2835
+ var Spinner_module_css_default = {
2836
+ "spinner": "HGVDmW_spinner",
2837
+ "spin": "HGVDmW_spin"
2838
+ };
2839
+ //#endregion
2840
+ //#region ../../client/ui-primitives/src/client/controls/Spinner.tsx
2841
+ function Spinner({ label }) {
2842
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2843
+ className: Spinner_module_css_default.spinner,
2844
+ role: "status",
2845
+ "aria-label": label
2846
+ });
2847
+ }
2848
+ //#endregion
2849
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/Tabs.module.css.mjs
2850
+ const css$7 = ".GO-36q_tabs{z-index:1;flex:none;gap:36px;margin-top:10px;padding-left:8px;display:flex;position:relative}.GO-36q_tab{color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;padding:0 0 9px;font-size:13px;font-weight:500;line-height:16px;position:relative}.GO-36q_tab:after{content:\"\";background:0 0;border-radius:2px;height:2px;position:absolute;bottom:-1px;left:0;right:0}.GO-36q_tabActive{color:var(--dsw-alias-state-business-primary)}.GO-36q_tabActive:after{background:var(--dsw-alias-state-business-primary)}.GO-36q_tab:disabled{cursor:not-allowed;opacity:.4}";
2851
+ const tagId$7 = "@morlay/dsh-session-mode/Tabs.module.css";
2852
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/Tabs.module.css\"]") === null) {
2853
+ const tag = document.createElement("style");
2854
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2855
+ tag.dataset.pluginCss = tagId$7;
2856
+ tag.textContent = css$7;
2857
+ document.head.appendChild(tag);
2858
+ }
2859
+ var Tabs_module_css_default = {
2860
+ "tab": "GO-36q_tab",
2861
+ "tabActive": "GO-36q_tabActive",
2862
+ "tabs": "GO-36q_tabs"
2863
+ };
2864
+ //#endregion
2865
+ //#region ../../client/ui-primitives/src/client/controls/Tabs.tsx
2866
+ function Tabs({ label, items, value, onChange, role = "tablist", disabled = false }) {
2867
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
2868
+ className: Tabs_module_css_default.tabs,
2869
+ role,
2870
+ "aria-label": label,
2871
+ children: items.map((item) => {
2872
+ const active = item.value === value;
2873
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2874
+ type: "button",
2875
+ role: role === "tablist" ? "tab" : "radio",
2876
+ "data-tab": item.value,
2877
+ "aria-selected": role === "tablist" ? active : void 0,
2878
+ "aria-checked": role === "tablist" ? void 0 : active,
2879
+ disabled,
2880
+ className: classes(Tabs_module_css_default.tab, active ? Tabs_module_css_default.tabActive : void 0),
2881
+ onClick: () => {
2882
+ onChange(item.value);
2883
+ },
2884
+ children: item.label
2885
+ }, item.value);
2886
+ })
2887
+ });
2888
+ }
2889
+ //#endregion
2890
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/TimeLabel.module.css.mjs
2891
+ const css$6 = "._3IuWPG_label{color:var(--dsw-alias-label-tertiary);white-space:nowrap;opacity:0;padding:0;font-size:14px;line-height:24px;transition:opacity 80ms}[data-time-hover-root]:hover ._3IuWPG_label,[data-time-hover-root]:focus-within ._3IuWPG_label{opacity:1}";
2892
+ const tagId$6 = "@morlay/dsh-session-mode/TimeLabel.module.css";
2893
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/TimeLabel.module.css\"]") === null) {
2894
+ const tag = document.createElement("style");
2895
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2896
+ tag.dataset.pluginCss = tagId$6;
2897
+ tag.textContent = css$6;
2898
+ document.head.appendChild(tag);
2899
+ }
2900
+ var TimeLabel_module_css_default = { "label": "_3IuWPG_label" };
2901
+ //#endregion
2902
+ //#region ../../client/ui-primitives/src/client/controls/TimeLabel.tsx
2903
+ function TimeLabel({ className, children, ...rest }) {
2904
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2905
+ className: classes(TimeLabel_module_css_default.label, className),
2906
+ ...rest,
2907
+ children
2908
+ });
2909
+ }
2910
+ //#endregion
2911
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/VisuallyHidden.module.css.mjs
2912
+ const css$5 = ".YAvv4W_hidden{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}";
2913
+ const tagId$5 = "@morlay/dsh-session-mode/VisuallyHidden.module.css";
2914
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/VisuallyHidden.module.css\"]") === null) {
2915
+ const tag = document.createElement("style");
2916
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2917
+ tag.dataset.pluginCss = tagId$5;
2918
+ tag.textContent = css$5;
2919
+ document.head.appendChild(tag);
2920
+ }
2921
+ var VisuallyHidden_module_css_default = { "hidden": "YAvv4W_hidden" };
2922
+ //#endregion
2923
+ //#region ../../client/ui-primitives/src/client/controls/VisuallyHidden.tsx
2924
+ function VisuallyHidden({ children, ...rest }) {
2925
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
2926
+ className: VisuallyHidden_module_css_default.hidden,
2927
+ ...rest,
2928
+ children
2929
+ });
2930
+ }
2931
+ //#endregion
2932
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/IconButton.module.css.mjs
2933
+ const css$4 = ".I3t6Ga_iconButton{box-sizing:border-box;width:28px;height:28px;color:var(--dsw-alias-label-secondary);border-radius:var(--dsw-radius-sm);cursor:pointer;background:0 0;border:none;flex:none;justify-content:center;align-items:center;padding:0;display:inline-flex}.I3t6Ga_iconButton:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}.I3t6Ga_iconButton:disabled{cursor:not-allowed;opacity:.4}.I3t6Ga_iconButton:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}.I3t6Ga_sm{width:20px;height:20px;padding:0}.I3t6Ga_circle{color:var(--dsw-alias-label-tertiary);border-radius:28px;padding:6px}.I3t6Ga_circle:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-secondary)}";
2934
+ const tagId$4 = "@morlay/dsh-session-mode/IconButton.module.css";
2935
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/IconButton.module.css\"]") === null) {
2936
+ const tag = document.createElement("style");
2937
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2938
+ tag.dataset.pluginCss = tagId$4;
2939
+ tag.textContent = css$4;
2940
+ document.head.appendChild(tag);
2941
+ }
2942
+ var IconButton_module_css_default = {
2943
+ "sm": "I3t6Ga_sm",
2944
+ "circle": "I3t6Ga_circle",
2945
+ "iconButton": "I3t6Ga_iconButton"
2946
+ };
2947
+ //#endregion
2948
+ //#region ../../client/ui-primitives/src/client/controls/IconButton.tsx
2949
+ function IconButton({ label, children, type = "button", shape = "square", size = "md", className, ...rest }) {
2950
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
2951
+ type,
2952
+ "data-role": "icon-button",
2953
+ "aria-label": label,
2954
+ className: classes(IconButton_module_css_default.iconButton, size === "sm" ? IconButton_module_css_default.sm : void 0, shape === "circle" ? IconButton_module_css_default.circle : void 0, className),
2955
+ ...rest,
2956
+ children
2957
+ });
2958
+ }
2959
+ //#endregion
2960
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/ModelRouteList.module.css.mjs
2961
+ const css$3 = "._2eBkWq_list{border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-lg);gap:6px;min-width:0;max-height:280px;margin:0;padding:10px;display:grid;overflow:auto}._2eBkWq_group{gap:6px;display:grid}._2eBkWq_group+._2eBkWq_group{border-top:.5px solid var(--dsw-alias-border-l3);margin-top:4px;padding-top:10px}._2eBkWq_provider{color:var(--dsw-alias-label-tertiary);padding:0 6px;font-size:11px;font-weight:500}._2eBkWq_item{border-radius:var(--dsw-radius-md);cursor:pointer;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:8px;min-width:0;padding:6px;display:grid}._2eBkWq_item:hover{background:var(--dsw-alias-bg-layer-4)}._2eBkWq_item:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}._2eBkWq_item[aria-disabled=true]{cursor:not-allowed;opacity:.4}._2eBkWq_picked{background:var(--dsw-alias-interactive-bg-hover)}._2eBkWq_text{min-width:0}._2eBkWq_name{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-primary);font-size:13px;display:block;overflow:hidden}._2eBkWq_id{text-overflow:ellipsis;white-space:nowrap;color:var(--dsw-alias-label-tertiary);margin-top:2px;font-size:11px;display:block;overflow:hidden}._2eBkWq_notice{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:1.5}._2eBkWq_error{color:var(--dsw-alias-state-error-primary);margin:0;font-size:12px;line-height:1.5}";
2962
+ const tagId$3 = "@morlay/dsh-session-mode/ModelRouteList.module.css";
2963
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/ModelRouteList.module.css\"]") === null) {
2964
+ const tag = document.createElement("style");
2965
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
2966
+ tag.dataset.pluginCss = tagId$3;
2967
+ tag.textContent = css$3;
2968
+ document.head.appendChild(tag);
2969
+ }
2970
+ var ModelRouteList_module_css_default = {
2971
+ "list": "_2eBkWq_list",
2972
+ "notice": "_2eBkWq_notice",
2973
+ "error": "_2eBkWq_error",
2974
+ "picked": "_2eBkWq_picked",
2975
+ "group": "_2eBkWq_group",
2976
+ "id": "_2eBkWq_id",
2977
+ "provider": "_2eBkWq_provider",
2978
+ "item": "_2eBkWq_item",
2979
+ "text": "_2eBkWq_text",
2980
+ "name": "_2eBkWq_name"
2981
+ };
2982
+ //#endregion
2983
+ //#region ../../client/ui-primitives/src/client/controls/ModelRouteList.tsx
2984
+ function ModelRouteList({ label, candidates, selectedKey, disabled = false, status, loadingLabel, errorLabel, emptyLabel, onSelect }) {
2985
+ if (status === "loading") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2986
+ className: ModelRouteList_module_css_default.notice,
2987
+ role: "status",
2988
+ children: loadingLabel
2989
+ });
2990
+ if (status === "error") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2991
+ className: ModelRouteList_module_css_default.error,
2992
+ role: "alert",
2993
+ children: errorLabel
2994
+ });
2995
+ if (candidates.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
2996
+ className: ModelRouteList_module_css_default.notice,
2997
+ children: emptyLabel
2998
+ });
2999
+ const groups = /* @__PURE__ */ new Map();
3000
+ for (const candidate of candidates) {
3001
+ const group = groups.get(candidate.provider);
3002
+ if (group === void 0) groups.set(candidate.provider, {
3003
+ name: candidate.providerName,
3004
+ items: [candidate]
3005
+ });
3006
+ else group.items.push(candidate);
3007
+ }
3008
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3009
+ className: ModelRouteList_module_css_default.list,
3010
+ "data-role": "model-route-list",
3011
+ role: "radiogroup",
3012
+ "aria-label": label,
3013
+ "data-control": "model-routes",
3014
+ children: [...groups].map(([provider, group]) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3015
+ className: ModelRouteList_module_css_default.group,
3016
+ "data-route-group": provider,
3017
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3018
+ className: ModelRouteList_module_css_default.provider,
3019
+ children: group.name
3020
+ }), group.items.map((candidate) => {
3021
+ const picked = candidate.key === selectedKey;
3022
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3023
+ className: classes(ModelRouteList_module_css_default.item, picked ? ModelRouteList_module_css_default.picked : void 0),
3024
+ role: "radio",
3025
+ "aria-checked": picked,
3026
+ "aria-label": `${candidate.modelName} ${candidate.provider}/${candidate.model}`,
3027
+ "aria-disabled": disabled ? true : void 0,
3028
+ tabIndex: disabled ? -1 : 0,
3029
+ "data-route": candidate.key,
3030
+ onClick: () => {
3031
+ if (!disabled) onSelect(candidate);
3032
+ },
3033
+ onKeyDown: (event) => {
3034
+ if (event.key !== "Enter" && event.key !== " ") return;
3035
+ event.preventDefault();
3036
+ if (!disabled) onSelect(candidate);
3037
+ },
3038
+ children: [picked ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { "aria-hidden": "true" }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3039
+ className: ModelRouteList_module_css_default.text,
3040
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3041
+ className: ModelRouteList_module_css_default.name,
3042
+ children: candidate.modelName
3043
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3044
+ className: ModelRouteList_module_css_default.id,
3045
+ children: `${candidate.providerName} · ${candidate.provider}/${candidate.model}`
3046
+ })]
3047
+ })]
3048
+ }, candidate.key);
3049
+ })]
3050
+ }, provider))
3051
+ });
3052
+ }
3053
+ //#endregion
3054
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/MultilineField.module.css.mjs
3055
+ const css$2 = "._stHfW_multiline{box-sizing:border-box;width:100%;min-height:64px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);resize:vertical;padding:6px 12px;font-family:inherit;font-size:13px;line-height:1.5}._stHfW_multiline:disabled{cursor:not-allowed;opacity:.4}._stHfW_multiline:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:-2px}";
3056
+ const tagId$2 = "@morlay/dsh-session-mode/MultilineField.module.css";
3057
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/MultilineField.module.css\"]") === null) {
3058
+ const tag = document.createElement("style");
3059
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
3060
+ tag.dataset.pluginCss = tagId$2;
3061
+ tag.textContent = css$2;
3062
+ document.head.appendChild(tag);
3063
+ }
3064
+ var MultilineField_module_css_default = { "multiline": "_stHfW_multiline" };
3065
+ //#endregion
3066
+ //#region ../../client/ui-primitives/src/client/controls/MultilineField.tsx
3067
+ function MultilineField({ rows = 3, className, ...rest }) {
3068
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("textarea", {
3069
+ rows,
3070
+ "data-role": "multiline-field",
3071
+ className: classes(MultilineField_module_css_default.multiline, className),
3072
+ ...rest
3073
+ });
3074
+ }
3075
+ //#endregion
3076
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/SearchSelect.module.css.mjs
3077
+ const css$1 = ".BtUTmW_trigger{white-space:nowrap;height:32px}.BtUTmW_searchRow{border-bottom:.5px solid var(--dsw-alias-border-l2);align-items:center;padding:4px 8px 8px;display:flex}.BtUTmW_searchInput{width:100%;color:var(--dsw-alias-label-primary);background:0 0;border:none;outline:none;padding:2px 0;font-family:inherit;font-size:13px;line-height:1.5}.BtUTmW_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px;font-size:12px;line-height:1.5}";
3078
+ const tagId$1 = "@morlay/dsh-session-mode/SearchSelect.module.css";
3079
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/SearchSelect.module.css\"]") === null) {
3080
+ const tag = document.createElement("style");
3081
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
3082
+ tag.dataset.pluginCss = tagId$1;
3083
+ tag.textContent = css$1;
3084
+ document.head.appendChild(tag);
3085
+ }
3086
+ var SearchSelect_module_css_default = {
3087
+ "trigger": "BtUTmW_trigger",
3088
+ "searchRow": "BtUTmW_searchRow",
3089
+ "searchInput": "BtUTmW_searchInput",
3090
+ "empty": "BtUTmW_empty"
3091
+ };
3092
+ //#endregion
3093
+ //#region ../../client/ui-primitives/src/client/controls/SearchSelect.tsx
3094
+ function SearchSelect({ label, value, emptyLabel, options, disabled = false, searchLabel, noMatchLabel, onSelect }) {
3095
+ const [open, setOpen] = (0, react.useState)(false);
3096
+ const [query, setQuery] = (0, react.useState)("");
3097
+ const searchRef = (0, react.useRef)(null);
3098
+ (0, react.useEffect)(() => {
3099
+ if (open) searchRef.current?.focus();
3100
+ }, [open]);
3101
+ const matches = (0, react.useMemo)(() => (0, _deepseek_ai_dsh_client_ui_primitives.rankByName)(options.map((option) => ({
3102
+ value: option.value,
3103
+ name: option.label ?? option.value,
3104
+ label: option.value
3105
+ })), query), [options, query]);
3106
+ const current = options.find((option) => option.value === value);
3107
+ const close = () => {
3108
+ setOpen(false);
3109
+ setQuery("");
3110
+ };
3111
+ const pick = (next) => {
3112
+ close();
3113
+ onSelect(next);
3114
+ };
3115
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
3116
+ open,
3117
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
3118
+ variant: "outline",
3119
+ size: "sm",
3120
+ "data-role": "search-select",
3121
+ className: classes(SearchSelect_module_css_default.trigger),
3122
+ "data-action": "pick",
3123
+ disabled,
3124
+ "aria-haspopup": "menu",
3125
+ "aria-label": label,
3126
+ onClick: () => {
3127
+ if (open) close();
3128
+ else setOpen(true);
3129
+ },
3130
+ children: value === "" ? emptyLabel : current?.label ?? value
3131
+ }),
3132
+ selectedId: value,
3133
+ onSelect: pick,
3134
+ onClose: close,
3135
+ children: [
3136
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3137
+ className: SearchSelect_module_css_default.searchRow,
3138
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3139
+ className: SearchSelect_module_css_default.searchInput,
3140
+ ref: searchRef,
3141
+ value: query,
3142
+ "aria-label": searchLabel,
3143
+ placeholder: searchLabel,
3144
+ onChange: (event) => {
3145
+ setQuery(event.currentTarget.value);
3146
+ }
3147
+ })
3148
+ }),
3149
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
3150
+ icon: value === "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : void 0,
3151
+ onSelect: () => {
3152
+ pick("");
3153
+ },
3154
+ children: emptyLabel
3155
+ }),
3156
+ matches.map((option) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
3157
+ icon: option.value === value ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : void 0,
3158
+ onSelect: () => {
3159
+ pick(option.value);
3160
+ },
3161
+ children: option.name
3162
+ }, option.value)),
3163
+ matches.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3164
+ className: SearchSelect_module_css_default.empty,
3165
+ children: noMatchLabel
3166
+ }) : null
3167
+ ]
3168
+ });
3169
+ }
3170
+ //#endregion
3171
+ //#region ../../client/ui-primitives/src/client/controls/tags.ts
3172
+ function parseTagList(text) {
3173
+ const seen = /* @__PURE__ */ new Set();
3174
+ const names = [];
3175
+ for (const raw of text.split(/[,,;;\t\n\r]+/u)) {
3176
+ const name = raw.trim();
3177
+ if (name === "" || seen.has(name)) continue;
3178
+ seen.add(name);
3179
+ names.push(name);
3180
+ }
3181
+ return names;
3182
+ }
3183
+ function mergeTags(current, incoming) {
3184
+ const merged = [...current];
3185
+ for (const name of incoming) {
3186
+ if (name === "" || merged.includes(name)) continue;
3187
+ merged.push(name);
3738
3188
  }
3189
+ return merged;
3190
+ }
3191
+ //#endregion
3192
+ //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/client/ui-primitives/src/client/controls/TagInput.module.css.mjs
3193
+ const css = ".Is5kta_row{align-items:flex-start;gap:8px;width:100%;display:flex}.Is5kta_anchor{flex:auto;width:100%;min-width:0;display:flex}.Is5kta_box{box-sizing:border-box;background:var(--dsw-alias-bg-layer-3);border:.5px solid var(--dsw-alias-border-l4);border-radius:var(--dsw-radius-md);flex-flow:wrap;align-items:center;gap:4px 6px;width:100%;min-height:32px;padding:4px 8px;display:flex}.Is5kta_input{min-width:120px;color:var(--dsw-alias-label-primary);background:0 0;border:none;outline:none;flex:120px;padding:2px 0;font-family:inherit;font-size:13px;line-height:1.5}.Is5kta_chip{corner-shape:round;white-space:nowrap;color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-module-platform);border-radius:999px;align-items:center;gap:2px;padding:1px 4px 1px 8px;font-size:11px;font-weight:500;line-height:17px;display:inline-flex}.Is5kta_chipRemove{box-sizing:border-box;width:14px;height:14px;color:var(--dsw-alias-label-tertiary);cursor:pointer;background:0 0;border:none;border-radius:999px;flex:none;justify-content:center;align-items:center;padding:0;line-height:1;display:inline-flex}.Is5kta_chipRemove:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.Is5kta_chipRemove:disabled{cursor:not-allowed;opacity:.4}.Is5kta_chipRemove:focus-visible{outline:var(--dsw-focus-ring-width) solid var(--dsw-focus-ring-color,var(--dsw-alias-state-business-primary));outline-offset:0}.Is5kta_empty{color:var(--dsw-alias-label-tertiary);margin:0;padding:8px;font-size:12px;line-height:1.5}";
3194
+ const tagId = "@morlay/dsh-session-mode/TagInput.module.css";
3195
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/TagInput.module.css\"]") === null) {
3196
+ const tag = document.createElement("style");
3197
+ tag.dataset.plugin = "@morlay/dsh-session-mode";
3198
+ tag.dataset.pluginCss = tagId;
3199
+ tag.textContent = css;
3200
+ document.head.appendChild(tag);
3201
+ }
3202
+ var TagInput_module_css_default = {
3203
+ "chipRemove": "Is5kta_chipRemove",
3204
+ "empty": "Is5kta_empty",
3205
+ "box": "Is5kta_box",
3206
+ "row": "Is5kta_row",
3207
+ "anchor": "Is5kta_anchor",
3208
+ "input": "Is5kta_input",
3209
+ "chip": "Is5kta_chip"
3739
3210
  };
3740
- styled("div")(styles.form);
3741
- styled("p")(styles.notice);
3742
- styled("div")(styles.footer);
3743
- styled("p")(styles.failed);
3744
- styled("button")(styles.save);
3211
+ //#endregion
3212
+ //#region ../../client/ui-primitives/src/client/controls/TagInput.tsx
3213
+ function TagInput({ value, onChange, options, placeholder, label, disabled = false, noMatchLabel = "", removeLabel }) {
3214
+ const [draft, setDraft] = (0, react.useState)("");
3215
+ const [open, setOpen] = (0, react.useState)(false);
3216
+ const commit = (text) => {
3217
+ const names = parseTagList(text);
3218
+ if (names.length === 0) return;
3219
+ onChange(mergeTags(value, names));
3220
+ setDraft("");
3221
+ };
3222
+ const remaining = (0, react.useMemo)(() => (options ?? []).filter((option) => !value.includes(option.value)).map((option) => ({
3223
+ value: option.value,
3224
+ name: option.label ?? option.value,
3225
+ label: option.value
3226
+ })), [options, value]);
3227
+ const matches = (0, react.useMemo)(() => (0, _deepseek_ai_dsh_client_ui_primitives.rankByName)(remaining, draft), [remaining, draft]);
3228
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
3229
+ className: TagInput_module_css_default.row,
3230
+ "data-role": "tag-input",
3231
+ "data-control": "tags",
3232
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
3233
+ open: open && remaining.length > 0,
3234
+ className: TagInput_module_css_default.anchor,
3235
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
3236
+ className: TagInput_module_css_default.box,
3237
+ children: [value.map((name) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
3238
+ className: TagInput_module_css_default.chip,
3239
+ "data-tag": name,
3240
+ children: [name, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
3241
+ type: "button",
3242
+ className: TagInput_module_css_default.chipRemove,
3243
+ "data-action": "remove-tag",
3244
+ disabled,
3245
+ "aria-label": removeLabel(name),
3246
+ onClick: () => {
3247
+ onChange(value.filter((candidate) => candidate !== name));
3248
+ },
3249
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 10 })
3250
+ })]
3251
+ }, name)), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
3252
+ className: TagInput_module_css_default.input,
3253
+ value: draft,
3254
+ placeholder: value.length === 0 ? placeholder : "",
3255
+ "aria-label": label,
3256
+ disabled,
3257
+ onFocus: () => {
3258
+ setOpen(true);
3259
+ },
3260
+ onBlur: () => {
3261
+ setOpen(false);
3262
+ },
3263
+ onChange: (event) => {
3264
+ setDraft(event.currentTarget.value);
3265
+ },
3266
+ onKeyDown: (event) => {
3267
+ if (event.key !== "Enter") return;
3268
+ event.preventDefault();
3269
+ commit(draft);
3270
+ },
3271
+ onPaste: (event) => {
3272
+ const text = event.clipboardData.getData("text");
3273
+ if (parseTagList(text).length < 2) return;
3274
+ event.preventDefault();
3275
+ commit(text);
3276
+ }
3277
+ })]
3278
+ }),
3279
+ onClose: () => {
3280
+ setOpen(false);
3281
+ },
3282
+ children: [matches.map((candidate) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
3283
+ onMouseDown: (event) => {
3284
+ event.preventDefault();
3285
+ },
3286
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MenuItemButton, {
3287
+ onSelect: () => {
3288
+ commit(candidate.value);
3289
+ },
3290
+ children: candidate.name
3291
+ })
3292
+ }, candidate.value)), matches.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
3293
+ className: TagInput_module_css_default.empty,
3294
+ "data-role": "tag-input-empty",
3295
+ children: noMatchLabel
3296
+ }) : null]
3297
+ })
3298
+ });
3299
+ }
3745
3300
  //#endregion
3746
3301
  //#region ../../../node_modules/.pnpm/mdast-util-to-string@4.0.0/node_modules/mdast-util-to-string/lib/index.js
3747
3302
  /**
@@ -16210,6 +15765,7 @@ window.__ModuleLoader__.load({
16210
15765
  const LINE_FRAGMENT = /^L(\d+)(?:C(\d+))?(?:-L(\d+))?$/u;
16211
15766
  const SCHEME = /^([A-Za-z][A-Za-z0-9+.-]*):/u;
16212
15767
  const BARE_PATH = /^([^:]+):(\d+)(?::(\d+))?$/u;
15768
+ const MENTION_WHITESPACE = /\s/u;
16213
15769
  const URI_UNSAFE = /[%#()\s<>"`]/gu;
16214
15770
  const PATH_PUNCTUATION = [
16215
15771
  codes.slash,
@@ -16266,6 +15822,10 @@ window.__ModuleLoader__.load({
16266
15822
  function isLocalReference(reference) {
16267
15823
  return !EXTERNAL_PROTOCOLS.includes(reference.protocol);
16268
15824
  }
15825
+ function formatReferenceMention(reference) {
15826
+ const path = reference.path ?? "";
15827
+ return MENTION_WHITESPACE.test(path) ? `@"${path}"` : `@${path}`;
15828
+ }
16269
15829
  function findReferences(text) {
16270
15830
  const spans = [];
16271
15831
  if (text === "" || !TRIGGERS.some((trigger) => text.includes(trigger))) return spans;
@@ -16495,7 +16055,7 @@ window.__ModuleLoader__.load({
16495
16055
  const child = children[index];
16496
16056
  if (child === void 0) continue;
16497
16057
  if (child.type === "link") {
16498
- const reference = parseReference(child.url ?? "", labelOf(child));
16058
+ const reference = parseReference(child.url ?? "", labelOf$1(child));
16499
16059
  if (reference !== void 0) {
16500
16060
  children[index] = referenceNodeOf(reference, child, children[index - 1]);
16501
16061
  continue;
@@ -16530,14 +16090,14 @@ window.__ModuleLoader__.load({
16530
16090
  end: position.end
16531
16091
  };
16532
16092
  }
16533
- function labelOf(node) {
16534
- const label = textOf(node);
16093
+ function labelOf$1(node) {
16094
+ const label = textOf$1(node);
16535
16095
  return label === "" ? void 0 : label;
16536
16096
  }
16537
- function textOf(node) {
16097
+ function textOf$1(node) {
16538
16098
  if (node.value !== void 0) return node.value;
16539
16099
  let text = "";
16540
- for (const child of node.children ?? []) text += textOf(child);
16100
+ for (const child of node.children ?? []) text += textOf$1(child);
16541
16101
  return text;
16542
16102
  }
16543
16103
  function parseBareReference(raw) {
@@ -16581,127 +16141,1448 @@ window.__ModuleLoader__.load({
16581
16141
  transforms: [transformLinks]
16582
16142
  };
16583
16143
  }
16584
- function isKnownScheme(name) {
16585
- const protocol = name.toLowerCase();
16586
- return protocol === "file" || protocol === "skill";
16587
- }
16588
- function splitLineFragment(value) {
16589
- const hashAt = value.indexOf("#");
16590
- if (hashAt === -1) return {
16591
- head: value,
16592
- lines: {}
16144
+ function isKnownScheme(name) {
16145
+ const protocol = name.toLowerCase();
16146
+ return protocol === "file" || protocol === "skill";
16147
+ }
16148
+ function splitLineFragment(value) {
16149
+ const hashAt = value.indexOf("#");
16150
+ if (hashAt === -1) return {
16151
+ head: value,
16152
+ lines: {}
16153
+ };
16154
+ const matched = LINE_FRAGMENT.exec(value.slice(hashAt + 1));
16155
+ if (matched === null) return {
16156
+ head: value,
16157
+ lines: {}
16158
+ };
16159
+ const lineStart = matched[1];
16160
+ if (lineStart === void 0) return {
16161
+ head: value,
16162
+ lines: {}
16163
+ };
16164
+ const column = matched[2];
16165
+ const lineEnd = matched[3];
16166
+ return {
16167
+ head: value.slice(0, hashAt),
16168
+ lines: {
16169
+ lineStart: Number(lineStart),
16170
+ ...column === void 0 ? {} : { column: Number(column) },
16171
+ ...lineEnd === void 0 ? {} : { lineEnd: Number(lineEnd) }
16172
+ }
16173
+ };
16174
+ }
16175
+ function lineFragmentOf(reference) {
16176
+ if (reference.lineStart === void 0) return "";
16177
+ const column = reference.column === void 0 ? "" : `C${String(reference.column)}`;
16178
+ const lineEnd = reference.lineEnd === void 0 ? "" : `-L${String(reference.lineEnd)}`;
16179
+ return `#L${String(reference.lineStart)}${column}${lineEnd}`;
16180
+ }
16181
+ function authorityEnd(value) {
16182
+ for (let index = 2; index < value.length; index += 1) {
16183
+ const char = value[index];
16184
+ if (char === "/" || char === "?" || char === "#") return index;
16185
+ }
16186
+ return value.length;
16187
+ }
16188
+ function encodeUri(uri) {
16189
+ return uri.replace(URI_UNSAFE, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
16190
+ }
16191
+ function decodeUri(value) {
16192
+ try {
16193
+ return decodeURIComponent(value);
16194
+ } catch {
16195
+ return;
16196
+ }
16197
+ }
16198
+ //#endregion
16199
+ //#region ../../client/ui-primitives/src/reference-markdown.tsx
16200
+ function referenceMentions(actions, tokens) {
16201
+ return { resolve: (value) => {
16202
+ const reference = tokens?.get(value) ?? parseReferenceToken(value);
16203
+ if (reference === void 0) return void 0;
16204
+ return {
16205
+ label: value,
16206
+ title: formatReference(reference),
16207
+ open: () => {
16208
+ openReference(reference, actions);
16209
+ }
16210
+ };
16211
+ } };
16212
+ }
16213
+ const ReferenceMarkdown = (0, react.memo)(function ReferenceMarkdown({ text, labels, actions, streaming = false, pathImages }) {
16214
+ const { source, tokens } = (0, react.useMemo)(() => tokenizeReferences(text), [text]);
16215
+ const mentions = (0, react.useMemo)(() => referenceMentions(actions, tokens), [actions, tokens]);
16216
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, {
16217
+ text: source,
16218
+ streaming,
16219
+ labels,
16220
+ fileMentions: mentions,
16221
+ pathImages
16222
+ });
16223
+ });
16224
+ function displayTextOf(reference) {
16225
+ return (reference.title ?? `${reference.path ?? ""}${rangeOf(reference)}`).replaceAll("`", "'");
16226
+ }
16227
+ function rangeOf(reference) {
16228
+ if (reference.lineStart === void 0) return "";
16229
+ const column = reference.column === void 0 ? "" : `C${String(reference.column)}`;
16230
+ return reference.lineEnd === void 0 ? `#L${String(reference.lineStart)}${column}` : `#L${String(reference.lineStart)}${column}-L${String(reference.lineEnd)}`;
16231
+ }
16232
+ function tokenizeReferences(text) {
16233
+ const tokens = /* @__PURE__ */ new Map();
16234
+ let out = "";
16235
+ let cursor = 0;
16236
+ for (const span of findReferences(text)) {
16237
+ if (!isLocalReference(span.reference) || span.start < cursor) continue;
16238
+ const display = displayTextOf(span.reference);
16239
+ tokens.set(display, span.reference);
16240
+ out += `${text.slice(cursor, span.start)}\`${display}\``;
16241
+ cursor = span.end;
16242
+ }
16243
+ return {
16244
+ source: cursor === 0 ? text : out + text.slice(cursor),
16245
+ tokens
16246
+ };
16247
+ }
16248
+ function openReference(reference, actions) {
16249
+ const path = reference.path;
16250
+ if (actions === void 0 || path === void 0) return;
16251
+ if (reference.protocol === "skill") {
16252
+ actions.openSkill(path);
16253
+ return;
16254
+ }
16255
+ if (reference.protocol === "file") actions.openFile(path);
16256
+ }
16257
+ //#endregion
16258
+ //#region ../../client/ui-primitives/src/client/index.ts
16259
+ var client_exports = /* @__PURE__ */ __exportAll({
16260
+ Bubble: () => Bubble,
16261
+ Button: () => Button$1,
16262
+ DisclosureRow: () => DisclosureRow,
16263
+ IconButton: () => IconButton,
16264
+ ModelRouteList: () => ModelRouteList,
16265
+ MultilineField: () => MultilineField,
16266
+ ReferenceMarkdown: () => ReferenceMarkdown,
16267
+ Row: () => Row,
16268
+ SCHEMA_FORM_NS: () => NS$1,
16269
+ SchemaFormController: () => SchemaFormController,
16270
+ SchemaFormHints: () => SchemaFormHints,
16271
+ SearchInput: () => SearchInput,
16272
+ SearchSelect: () => SearchSelect,
16273
+ SeatButton: () => SeatButton,
16274
+ SettingsFieldRow: () => SettingsFieldRow,
16275
+ Spinner: () => Spinner,
16276
+ Stack: () => Stack,
16277
+ Tabs: () => Tabs,
16278
+ TagInput: () => TagInput,
16279
+ Text: () => Text,
16280
+ TimeLabel: () => TimeLabel,
16281
+ VisuallyHidden: () => VisuallyHidden,
16282
+ apply: () => apply$1,
16283
+ failureOf: () => failureOf,
16284
+ findReferences: () => findReferences,
16285
+ formatReference: () => formatReference,
16286
+ formatReferenceMention: () => formatReferenceMention,
16287
+ inject: () => inject$1,
16288
+ isLocalReference: () => isLocalReference,
16289
+ markdownLabels: () => markdownLabels,
16290
+ mergeTags: () => mergeTags,
16291
+ parseReference: () => parseReference,
16292
+ parseReferenceToken: () => parseReferenceToken,
16293
+ parseTagList: () => parseTagList,
16294
+ projectRoot: () => projectRoot,
16295
+ referenceMentions: () => referenceMentions,
16296
+ rowRegistrations: () => rowRegistrations,
16297
+ schemaForm: () => schema_form_exports,
16298
+ walkFields: () => walkFields
16299
+ });
16300
+ __reExport(client_exports, require("@deepseek-ai/dsh-client-ui-primitives"));
16301
+ const inject$1 = [...inject$2];
16302
+ function apply$1(ctx) {
16303
+ apply$2(ctx);
16304
+ }
16305
+ //#endregion
16306
+ //#region src/catalog-remote.ts
16307
+ const CATALOG_NS = "sessionModeCatalog";
16308
+ const SESSION_MODE_CATALOG_REMOTE = {
16309
+ package: "@morlay/dsh-session-mode",
16310
+ descriptors: [{
16311
+ id: "@morlay/dsh-session-mode#sessionModeCatalog/list",
16312
+ service: CATALOG_NS,
16313
+ namespace: CATALOG_NS,
16314
+ method: "list",
16315
+ implementation: "remoteExportList",
16316
+ invocation: { kind: "direct" },
16317
+ parameters: [],
16318
+ result: { mode: "src-json" }
16319
+ }]
16320
+ };
16321
+ //#endregion
16322
+ //#region src/shared.ts
16323
+ const SESSION_MODE_PATH = "/session-mode";
16324
+ const POLICY_NAMES = ["fs/write-intent", "fs/edit-intent"];
16325
+ //#endregion
16326
+ //#region src/client/llm-directory.ts
16327
+ function routeKey(provider, model) {
16328
+ return `${provider}\u0000${model}`;
16329
+ }
16330
+ function remoteNamespace(scope, namespace) {
16331
+ try {
16332
+ return scope.get(`remote.${namespace}`);
16333
+ } catch {
16334
+ return;
16335
+ }
16336
+ }
16337
+ function readAt(root, path) {
16338
+ return path.reduce((node, segment) => {
16339
+ if (Array.isArray(node)) return node[Number(segment)];
16340
+ if (typeof node !== "object" || node === null) return void 0;
16341
+ return Reflect.get(node, segment);
16342
+ }, root);
16343
+ }
16344
+ function modelsOf(entry, forms) {
16345
+ if (entry.settingsNs === "") return [];
16346
+ const profile = readAt(forms.get(entry.settingsNs).getSnapshot().value, entry.settingsPath);
16347
+ const models = typeof profile === "object" && profile !== null ? Reflect.get(profile, "models") : void 0;
16348
+ if (!Array.isArray(models)) return [];
16349
+ return models.flatMap((model) => {
16350
+ if (typeof model !== "object" || model === null) return [];
16351
+ const id = Reflect.get(model, "id");
16352
+ if (typeof id !== "string") return [];
16353
+ const name = Reflect.get(model, "name");
16354
+ return [{
16355
+ value: id,
16356
+ label: typeof name === "string" && name !== "" ? name : id
16357
+ }];
16358
+ });
16359
+ }
16360
+ async function loadLlmProviders(scope) {
16361
+ const llm = remoteNamespace(scope, "llm");
16362
+ const forms = scope.get("configForms");
16363
+ if (llm === void 0 || forms === void 0) return [];
16364
+ const [routes, directory] = await Promise.all([llm.listProviders(), llm.listConfigurableProviders()]);
16365
+ if (!routes.ok || !directory.ok) return [];
16366
+ const merged = /* @__PURE__ */ new Map();
16367
+ for (const entry of directory.value) merged.set(entry.provider, {
16368
+ value: entry.provider,
16369
+ label: entry.displayName,
16370
+ settingsNs: entry.settingsNs,
16371
+ settingsPath: [...entry.settingsPath]
16372
+ });
16373
+ for (const route of routes.value) if (!merged.has(route.id)) merged.set(route.id, {
16374
+ value: route.id,
16375
+ label: route.name,
16376
+ settingsNs: "",
16377
+ settingsPath: []
16378
+ });
16379
+ return [...merged.values()].map((entry) => ({
16380
+ value: entry.value,
16381
+ label: entry.label,
16382
+ models: modelsOf(entry, forms)
16383
+ }));
16384
+ }
16385
+ function routesOf(providers) {
16386
+ return providers.flatMap((provider) => provider.models.map((model) => ({
16387
+ key: routeKey(provider.value, model.value),
16388
+ provider: provider.value,
16389
+ providerName: provider.label,
16390
+ model: model.value,
16391
+ modelName: model.label
16392
+ })));
16393
+ }
16394
+ //#endregion
16395
+ //#region src/client/bundle-config.ts
16396
+ const SESSION_MODE_NS = "session-mode";
16397
+ const BUNDLE_CONFIG_KEY = "@morlay/session-mode-profile";
16398
+ const PROTECTED_MODE_IDS = ["noop"];
16399
+ const ROLE_VALUES = ["main", "subagent"];
16400
+ const GROUPS = [
16401
+ {
16402
+ key: "identity",
16403
+ labelKey: "group.identity"
16404
+ },
16405
+ {
16406
+ key: "persona",
16407
+ labelKey: "group.persona"
16408
+ },
16409
+ {
16410
+ key: "tools",
16411
+ labelKey: "group.tools"
16412
+ },
16413
+ {
16414
+ key: "rules",
16415
+ labelKey: "group.rules"
16416
+ },
16417
+ {
16418
+ key: "injections",
16419
+ labelKey: "group.injections"
16420
+ },
16421
+ {
16422
+ key: "model",
16423
+ labelKey: "group.model"
16424
+ }
16425
+ ];
16426
+ const MODE_FIELDS = [
16427
+ {
16428
+ path: ["name"],
16429
+ control: "text",
16430
+ labelKey: "field.name",
16431
+ hintKey: "hint.name",
16432
+ group: "identity"
16433
+ },
16434
+ {
16435
+ path: ["description"],
16436
+ control: "text",
16437
+ labelKey: "field.description",
16438
+ hintKey: "hint.description",
16439
+ group: "identity"
16440
+ },
16441
+ {
16442
+ path: ["role"],
16443
+ control: "roles",
16444
+ labelKey: "field.role",
16445
+ hintKey: "hint.role",
16446
+ group: "identity"
16447
+ },
16448
+ {
16449
+ path: ["presetsOnly"],
16450
+ control: "tags",
16451
+ labelKey: "field.presetsOnly",
16452
+ hintKey: "hint.presetsOnly",
16453
+ group: "identity"
16454
+ },
16455
+ {
16456
+ path: ["persona", "prefix"],
16457
+ control: "multiline",
16458
+ labelKey: "field.prefix",
16459
+ hintKey: "hint.prefix",
16460
+ group: "persona"
16461
+ },
16462
+ {
16463
+ path: ["persona", "suffix"],
16464
+ control: "multiline",
16465
+ labelKey: "field.suffix",
16466
+ hintKey: "hint.suffix",
16467
+ group: "persona"
16468
+ },
16469
+ {
16470
+ path: ["allowTools"],
16471
+ control: "tags",
16472
+ labelKey: "field.allowTools",
16473
+ hintKey: "hint.allowTools",
16474
+ group: "tools"
16475
+ },
16476
+ {
16477
+ path: ["denyTools"],
16478
+ control: "tags",
16479
+ labelKey: "field.denyTools",
16480
+ hintKey: "hint.denyTools",
16481
+ group: "tools"
16482
+ },
16483
+ {
16484
+ path: ["allowSkills"],
16485
+ control: "tags",
16486
+ labelKey: "field.allowSkills",
16487
+ hintKey: "hint.allowSkills",
16488
+ group: "tools"
16489
+ },
16490
+ {
16491
+ path: ["denySkills"],
16492
+ control: "tags",
16493
+ labelKey: "field.denySkills",
16494
+ hintKey: "hint.denySkills",
16495
+ group: "tools"
16496
+ },
16497
+ {
16498
+ path: ["allowPolicies"],
16499
+ control: "tags",
16500
+ labelKey: "field.allowPolicies",
16501
+ hintKey: "hint.allowPolicies",
16502
+ group: "rules"
16503
+ },
16504
+ {
16505
+ path: ["denyPolicies"],
16506
+ control: "tags",
16507
+ labelKey: "field.denyPolicies",
16508
+ hintKey: "hint.denyPolicies",
16509
+ group: "rules"
16510
+ },
16511
+ {
16512
+ path: ["instructions"],
16513
+ control: "switch",
16514
+ labelKey: "field.instructions",
16515
+ hintKey: "hint.instructions",
16516
+ group: "injections"
16517
+ },
16518
+ {
16519
+ path: ["skills"],
16520
+ control: "tri",
16521
+ labelKey: "field.skills",
16522
+ hintKey: "hint.skills",
16523
+ group: "injections"
16524
+ },
16525
+ {
16526
+ path: ["runtimeContext"],
16527
+ control: "switch",
16528
+ labelKey: "field.runtimeContext",
16529
+ hintKey: "hint.runtimeContext",
16530
+ group: "injections"
16531
+ },
16532
+ {
16533
+ path: ["defaultModel", "reasoningEffort"],
16534
+ control: "text",
16535
+ labelKey: "field.reasoningEffort",
16536
+ hintKey: "hint.reasoningEffort",
16537
+ group: "model"
16538
+ }
16539
+ ];
16540
+ function unwrapService(value) {
16541
+ if (value === void 0) return void 0;
16542
+ return value[Symbol.for("cordis.original")] ?? value;
16543
+ }
16544
+ function fieldKey(path) {
16545
+ return JSON.stringify(path);
16546
+ }
16547
+ function createBundleConfigFace(ctx, t, hintsOf = () => void 0) {
16548
+ const forms = ctx.configForms;
16549
+ const hints = () => unwrapService(hintsOf());
16550
+ const deps = () => ({
16551
+ form: forms.get(SESSION_MODE_NS),
16552
+ describe: forms.describe(),
16553
+ rehydrate: (serialized) => ctx.settingsSchema.rehydrate(serialized),
16554
+ validate: (schema, value) => validateSection(schema, value, t),
16555
+ t: ctx.locale.bind("settings.schema-form"),
16556
+ hints: {
16557
+ keysFor: () => [],
16558
+ textFor: (path) => hints()?.textFor("session-mode", path) ?? {},
16559
+ selectFor: (path) => hints()?.selectFor(SESSION_MODE_NS, path),
16560
+ sourceFor: (name) => hints()?.sourceFor(name)
16561
+ }
16562
+ });
16563
+ const controller = new SchemaFormController(SESSION_MODE_NS, deps());
16564
+ const face = controller.face();
16565
+ const form = forms.get(SESSION_MODE_NS);
16566
+ const statusStore = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(form.getSnapshot().status);
16567
+ const unsubscribeStatus = form.subscribe(() => {
16568
+ statusStore.set(form.getSnapshot().status);
16569
+ });
16570
+ const modelsStore = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
16571
+ status: "loading",
16572
+ routes: []
16573
+ });
16574
+ const loadModels = async () => {
16575
+ try {
16576
+ const providers = await loadLlmProviders(ctx);
16577
+ modelsStore.set({
16578
+ status: "ready",
16579
+ routes: routesOf(providers)
16580
+ });
16581
+ } catch {
16582
+ modelsStore.set({
16583
+ status: "error",
16584
+ routes: []
16585
+ });
16586
+ }
16587
+ };
16588
+ const remote = ctx.get("remote");
16589
+ const unsubscribeModels = typeof remote?.$on !== "function" ? [] : [remote.$on("llm/adapters-updated", () => {
16590
+ loadModels();
16591
+ }), remote.$on("settings/document-updated", () => {
16592
+ loadModels();
16593
+ })];
16594
+ loadModels();
16595
+ const diagnose = () => {
16596
+ const view = forms.describe().getSnapshot().view;
16597
+ const namespaces = view?.namespaces.map((row) => row.ns) ?? [];
16598
+ const live = controller.face().hooks.schemaForm.getSnapshot();
16599
+ const controllerSummary = `store configured=${String(live.configured)} walked=${String(live.walked.length)}`;
16600
+ const own = view?.namespaces.find((row) => row.ns === SESSION_MODE_NS);
16601
+ if (own === void 0) return {
16602
+ namespaces,
16603
+ controller: controllerSummary,
16604
+ problem: `describe has no namespace "${SESSION_MODE_NS}"`
16605
+ };
16606
+ try {
16607
+ const schema = ctx.settingsSchema.rehydrate(own.schema);
16608
+ const renderable = projectRoot(own.schema, (serialized) => ctx.settingsSchema.rehydrate(serialized)) !== void 0;
16609
+ let probe;
16610
+ try {
16611
+ const rebuilt = new SchemaFormController(SESSION_MODE_NS, deps());
16612
+ probe = `probe configured=${String(rebuilt.face().hooks.schemaForm.getSnapshot().configured)}`;
16613
+ rebuilt.dispose();
16614
+ } catch (error) {
16615
+ probe = `probe threw: ${error instanceof Error ? error.message : String(error)}`;
16616
+ }
16617
+ return {
16618
+ namespaces,
16619
+ controller: `${controllerSummary}; ${probe}`,
16620
+ problem: renderable ? "renderable" : `schema root is "${String(schema.type)}"`
16621
+ };
16622
+ } catch (error) {
16623
+ return {
16624
+ namespaces,
16625
+ controller: controllerSummary,
16626
+ problem: `schema rehydrate failed: ${error instanceof Error ? error.message : String(error)}`
16627
+ };
16628
+ }
16629
+ };
16630
+ const resync = () => {
16631
+ statusStore.set(form.getSnapshot().status);
16632
+ controller.refresh();
16633
+ };
16634
+ return {
16635
+ face: {
16636
+ hooks: {
16637
+ bundleConfig: face.hooks.schemaForm,
16638
+ bundleStatus: statusStore,
16639
+ bundleModels: modelsStore
16640
+ },
16641
+ diagnose,
16642
+ resync,
16643
+ set: (path, value) => {
16644
+ face.set(path, value);
16645
+ },
16646
+ editText: (path, text) => {
16647
+ if (text === "") face.clear(path);
16648
+ else face.setText(path, text, (raw) => ({
16649
+ kind: "value",
16650
+ value: raw
16651
+ }));
16652
+ },
16653
+ clear: (path) => {
16654
+ face.clear(path);
16655
+ },
16656
+ appendItem: (path) => {
16657
+ face.appendItem(path);
16658
+ },
16659
+ removeItem: (path, index) => {
16660
+ face.removeItem(path, index);
16661
+ },
16662
+ addMode: (id) => {
16663
+ const trimmed = id.trim();
16664
+ if (trimmed === "") return;
16665
+ face.addKey(["modes"], trimmed);
16666
+ face.setText([
16667
+ "modes",
16668
+ trimmed,
16669
+ "name"
16670
+ ], trimmed, (raw) => ({
16671
+ kind: "value",
16672
+ value: raw
16673
+ }));
16674
+ },
16675
+ removeMode: (id) => {
16676
+ if (PROTECTED_MODE_IDS.includes(id)) return;
16677
+ face.removeKey(["modes"], id);
16678
+ },
16679
+ save: () => {
16680
+ face.save();
16681
+ },
16682
+ discard: () => {
16683
+ face.discard();
16684
+ }
16685
+ },
16686
+ refresh: resync,
16687
+ dispose: () => {
16688
+ unsubscribeStatus();
16689
+ for (const off of unsubscribeModels) off?.();
16690
+ controller.dispose();
16691
+ }
16692
+ };
16693
+ }
16694
+ function validateSection(schema, value, t) {
16695
+ try {
16696
+ schema(value);
16697
+ } catch (error) {
16698
+ return failureOf(error);
16699
+ }
16700
+ return rosterProblem(value, t);
16701
+ }
16702
+ function rosterProblem(value, t) {
16703
+ if (typeof value !== "object" || value === null) return void 0;
16704
+ const modes = Reflect.get(value, "modes");
16705
+ if (typeof modes !== "object" || modes === null || Array.isArray(modes)) return {
16706
+ message: t("violation.modesEmpty"),
16707
+ path: ["modes"]
16708
+ };
16709
+ const ids = Object.keys(modes);
16710
+ if (ids.length === 0) return {
16711
+ message: t("violation.modesEmpty"),
16712
+ path: ["modes"]
16713
+ };
16714
+ const selected = Reflect.get(value, "default");
16715
+ if (typeof selected === "string" && selected !== "" && !ids.includes(selected)) return {
16716
+ message: t("violation.defaultMissing"),
16717
+ path: ["default"]
16718
+ };
16719
+ for (const id of ids) {
16720
+ const mode = Reflect.get(modes, id);
16721
+ const model = typeof mode === "object" && mode !== null ? Reflect.get(mode, "defaultModel") : void 0;
16722
+ if (typeof model !== "object" || model === null) continue;
16723
+ const provider = Reflect.get(model, "provider");
16724
+ const name = Reflect.get(model, "model");
16725
+ if (provider === void 0 && name === void 0) continue;
16726
+ if (typeof provider === "string" && provider !== "" && typeof name === "string" && name !== "") continue;
16727
+ return {
16728
+ message: t("violation.modelPair"),
16729
+ path: [
16730
+ "modes",
16731
+ id,
16732
+ "defaultModel"
16733
+ ]
16734
+ };
16735
+ }
16736
+ }
16737
+ function projectBundleConfig(state, t, status = "ready") {
16738
+ const read = (path) => state.fields.get(fieldKey(path));
16739
+ const optionsAt = (path) => state.options.get(fieldKey(path)) ?? [];
16740
+ const invalidAt = (path) => state.invalidAt.get(fieldKey(path)) ?? read(path)?.invalid;
16741
+ const modes = collectModeIds(state);
16742
+ const selected = textOf(read(["default"]));
16743
+ return {
16744
+ available: state.available,
16745
+ writable: state.writable,
16746
+ dirty: state.dirty,
16747
+ invalid: state.invalid,
16748
+ saving: state.saving,
16749
+ failed: state.failed,
16750
+ configured: state.configured,
16751
+ readiness: state.configured ? "ready" : status === "loading" ? "loading" : status === "ready" ? "unreadable" : "missing",
16752
+ defaultMode: {
16753
+ value: selected,
16754
+ options: modes.map((id) => ({
16755
+ value: id,
16756
+ label: labelOf(id, read)
16757
+ })),
16758
+ invalid: invalidAt(["default"]) ?? (selected === "" || modes.includes(selected) ? void 0 : t("violation.defaultMissing"))
16759
+ },
16760
+ modes: modes.map((id) => ({
16761
+ id,
16762
+ title: labelOf(id, read),
16763
+ role: arrayOf(read([
16764
+ "modes",
16765
+ id,
16766
+ "role"
16767
+ ])),
16768
+ summary: summaryOf(id, read, t),
16769
+ model: modelOf(id, read),
16770
+ deletable: !PROTECTED_MODE_IDS.includes(id),
16771
+ staged: MODE_FIELDS.some((spec) => read([
16772
+ "modes",
16773
+ id,
16774
+ ...spec.path
16775
+ ])?.staged === true),
16776
+ groups: GROUPS.map((group) => ({
16777
+ key: group.key,
16778
+ label: t(group.labelKey),
16779
+ fields: MODE_FIELDS.filter((spec) => spec.group === group.key).map((spec) => fieldView(id, spec, read, optionsAt, invalidAt, t))
16780
+ }))
16781
+ })),
16782
+ violation: state.violation?.message
16783
+ };
16784
+ }
16785
+ function labelOf(id, read) {
16786
+ const name = textOf(read([
16787
+ "modes",
16788
+ id,
16789
+ "name"
16790
+ ]));
16791
+ return name === "" ? id : name;
16792
+ }
16793
+ function collectModeIds(state) {
16794
+ const ids = [];
16795
+ for (const item of state.walked) {
16796
+ if (item.path.length < 2 || item.path[0] !== "modes") continue;
16797
+ const id = item.path[1];
16798
+ if (id === void 0 || ids.includes(id)) continue;
16799
+ ids.push(id);
16800
+ }
16801
+ return ids;
16802
+ }
16803
+ function modelOf(id, read) {
16804
+ if (read([
16805
+ "modes",
16806
+ id,
16807
+ "defaultModel"
16808
+ ]) === void 0) return void 0;
16809
+ return {
16810
+ provider: textOf(read([
16811
+ "modes",
16812
+ id,
16813
+ "defaultModel",
16814
+ "provider"
16815
+ ])),
16816
+ model: textOf(read([
16817
+ "modes",
16818
+ id,
16819
+ "defaultModel",
16820
+ "model"
16821
+ ]))
16822
+ };
16823
+ }
16824
+ function fieldView(id, spec, read, optionsAt, invalidAt, t) {
16825
+ const path = [
16826
+ "modes",
16827
+ id,
16828
+ ...spec.path
16829
+ ];
16830
+ const field = read(path);
16831
+ const common = {
16832
+ key: fieldKey(path),
16833
+ path,
16834
+ control: spec.control,
16835
+ label: t(spec.labelKey),
16836
+ hint: t(spec.hintKey),
16837
+ present: field !== void 0,
16838
+ overridden: field?.overridden === true,
16839
+ options: optionsAt(path),
16840
+ invalid: invalidAt(path)
16593
16841
  };
16594
- const matched = LINE_FRAGMENT.exec(value.slice(hashAt + 1));
16595
- if (matched === null) return {
16596
- head: value,
16597
- lines: {}
16842
+ if (spec.control === "tags" || spec.control === "roles") return {
16843
+ ...common,
16844
+ text: "",
16845
+ value: arrayOf(field)
16598
16846
  };
16599
- const lineStart = matched[1];
16600
- if (lineStart === void 0) return {
16601
- head: value,
16602
- lines: {}
16847
+ if (spec.control === "switch") return {
16848
+ ...common,
16849
+ text: "",
16850
+ value: field?.value === true
16851
+ };
16852
+ if (spec.control === "tri") return {
16853
+ ...common,
16854
+ text: "",
16855
+ value: triOf(field)
16603
16856
  };
16604
- const column = matched[2];
16605
- const lineEnd = matched[3];
16606
16857
  return {
16607
- head: value.slice(0, hashAt),
16608
- lines: {
16609
- lineStart: Number(lineStart),
16610
- ...column === void 0 ? {} : { column: Number(column) },
16611
- ...lineEnd === void 0 ? {} : { lineEnd: Number(lineEnd) }
16612
- }
16858
+ ...common,
16859
+ text: textOf(field),
16860
+ value: field?.value
16613
16861
  };
16614
16862
  }
16615
- function lineFragmentOf(reference) {
16616
- if (reference.lineStart === void 0) return "";
16617
- const column = reference.column === void 0 ? "" : `C${String(reference.column)}`;
16618
- const lineEnd = reference.lineEnd === void 0 ? "" : `-L${String(reference.lineEnd)}`;
16619
- return `#L${String(reference.lineStart)}${column}${lineEnd}`;
16620
- }
16621
- function authorityEnd(value) {
16622
- for (let index = 2; index < value.length; index += 1) {
16623
- const char = value[index];
16624
- if (char === "/" || char === "?" || char === "#") return index;
16625
- }
16626
- return value.length;
16627
- }
16628
- function encodeUri(uri) {
16629
- return uri.replace(URI_UNSAFE, (char) => `%${char.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
16630
- }
16631
- function decodeUri(value) {
16632
- try {
16633
- return decodeURIComponent(value);
16634
- } catch {
16635
- return;
16636
- }
16637
- }
16863
+ function triOf(field) {
16864
+ if (field === void 0 || field.value === void 0) return "unset";
16865
+ return field.value === true ? "on" : "off";
16866
+ }
16867
+ function summaryOf(id, read, t) {
16868
+ const allowed = arrayOf(read([
16869
+ "modes",
16870
+ id,
16871
+ "allowTools"
16872
+ ]));
16873
+ const denied = arrayOf(read([
16874
+ "modes",
16875
+ id,
16876
+ "denyTools"
16877
+ ]));
16878
+ const provider = read([
16879
+ "modes",
16880
+ id,
16881
+ "defaultModel",
16882
+ "provider"
16883
+ ])?.value;
16884
+ const model = read([
16885
+ "modes",
16886
+ id,
16887
+ "defaultModel",
16888
+ "model"
16889
+ ])?.value;
16890
+ return `${allowed.length > 0 ? t("summary.tools", { n: String(allowed.length) }) : denied.length > 0 ? t("summary.denyTools", { n: String(denied.length) }) : t("summary.allTools")} · ${typeof model === "string" && model !== "" ? `${typeof provider === "string" && provider !== "" ? `${provider} / ` : ""}${model}` : t("summary.globalModel")}`;
16891
+ }
16892
+ function textOf(field) {
16893
+ if (field === void 0) return "";
16894
+ if (typeof field.text === "string") return field.text;
16895
+ return typeof field.value === "string" ? field.value : "";
16896
+ }
16897
+ function arrayOf(field) {
16898
+ const value = field?.value;
16899
+ return Array.isArray(value) ? value.map((item) => String(item)) : [];
16900
+ }
16901
+ const ROLES = ROLE_VALUES;
16638
16902
  //#endregion
16639
- //#region ../../client/ui-primitives/src/reference-markdown.tsx
16640
- function referenceMentions(actions, tokens) {
16641
- return { resolve: (value) => {
16642
- const reference = tokens?.get(value) ?? parseReferenceToken(value);
16643
- if (reference === void 0) return void 0;
16644
- return {
16645
- label: value,
16646
- title: formatReference(reference),
16647
- open: () => {
16648
- openReference(reference, actions);
16649
- }
16650
- };
16651
- } };
16652
- }
16653
- (0, react.memo)(function ReferenceMarkdown({ text, labels, actions, streaming = false, pathImages }) {
16654
- const { source, tokens } = (0, react.useMemo)(() => tokenizeReferences(text), [text]);
16655
- const mentions = (0, react.useMemo)(() => referenceMentions(actions, tokens), [actions, tokens]);
16656
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.MarkdownText, {
16657
- text: source,
16658
- streaming,
16903
+ //#region src/client/BundleConfigPage.tsx
16904
+ function BundleConfigPage(props) {
16905
+ const { t, view } = props;
16906
+ const face = {
16907
+ set: props.set,
16908
+ editText: props.editText,
16909
+ clear: props.clear,
16910
+ appendItem: props.appendItem,
16911
+ removeItem: props.removeItem,
16912
+ addMode: props.addMode,
16913
+ removeMode: props.removeMode,
16914
+ save: props.save,
16915
+ discard: props.discard
16916
+ };
16917
+ const snapshot = props.useBundleConfig((current) => current);
16918
+ const status = props.useBundleStatus((current) => current);
16919
+ const models = props.useBundleModels((current) => current);
16920
+ const state = (0, react.useMemo)(() => projectBundleConfig(snapshot, t, status), [
16921
+ snapshot,
16922
+ t,
16923
+ status
16924
+ ]);
16925
+ const [expanded, setExpanded] = (0, react.useState)(() => /* @__PURE__ */ new Set());
16926
+ const [addingId, setAddingId] = (0, react.useState)("");
16927
+ const [addingOpen, setAddingOpen] = (0, react.useState)(false);
16928
+ const [removing, setRemoving] = (0, react.useState)(null);
16929
+ const resync = props.resync;
16930
+ (0, react.useEffect)(() => {
16931
+ resync();
16932
+ }, [resync]);
16933
+ if (view !== "page") return null;
16934
+ if (state.readiness !== "ready") {
16935
+ const diagnosis = props.diagnose();
16936
+ const message = state.readiness === "loading" ? t("configured.loading") : state.readiness === "missing" ? t("configured.missing") : t("configured.unreadable", { problem: diagnosis.problem });
16937
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
16938
+ "data-bundle-config": state.readiness,
16939
+ "data-namespace": SESSION_MODE_NS,
16940
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
16941
+ as: "p",
16942
+ size: "sm",
16943
+ tone: "tertiary",
16944
+ "data-namespaces": diagnosis.namespaces.join(","),
16945
+ "data-problem": diagnosis.problem,
16946
+ "data-controller": diagnosis.controller,
16947
+ children: message
16948
+ }), state.readiness !== "unreadable" ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
16949
+ as: "p",
16950
+ size: "xs",
16951
+ tone: "tertiary",
16952
+ mono: true,
16953
+ "data-diagnosis": "true",
16954
+ children: `${diagnosis.problem} · ${diagnosis.controller} · namespaces=[${diagnosis.namespaces.join(", ")}]`
16955
+ })]
16956
+ });
16957
+ }
16958
+ const labels = {
16959
+ unavailable: t("unavailable"),
16960
+ readOnly: t("readOnly"),
16961
+ saveFailed: t("saveFailed"),
16962
+ save: t("save"),
16963
+ saving: t("saving")
16964
+ };
16965
+ const toggle = (id) => {
16966
+ setExpanded((previous) => {
16967
+ const next = new Set(previous);
16968
+ if (next.has(id)) next.delete(id);
16969
+ else next.add(id);
16970
+ return next;
16971
+ });
16972
+ };
16973
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(client_exports.SettingsForm, {
16659
16974
  labels,
16660
- fileMentions: mentions,
16661
- pathImages
16975
+ state,
16976
+ onSave: face.save,
16977
+ onDiscard: face.discard,
16978
+ children: [
16979
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
16980
+ gap: 16,
16981
+ "data-bundle-config": "page",
16982
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stack, {
16983
+ as: "section",
16984
+ gap: 8,
16985
+ "data-section": "default",
16986
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsFieldRow, {
16987
+ label: t("default.label"),
16988
+ hint: t("default.hint"),
16989
+ layout: "inline",
16990
+ ...state.defaultMode.invalid === void 0 ? {} : { invalid: state.defaultMode.invalid },
16991
+ "data-field": "default",
16992
+ "data-control": "choice",
16993
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchSelect, {
16994
+ label: t("default.label"),
16995
+ value: state.defaultMode.value,
16996
+ emptyLabel: t("tri.unset"),
16997
+ options: state.defaultMode.options.map((option) => ({
16998
+ value: String(option.value),
16999
+ ...option.label === void 0 ? {} : { label: option.label }
17000
+ })),
17001
+ searchLabel: t("select.search"),
17002
+ noMatchLabel: t("select.noMatch"),
17003
+ disabled: !state.writable,
17004
+ onSelect: (next) => {
17005
+ if (next === "") face.clear(["default"]);
17006
+ else face.set(["default"], next);
17007
+ }
17008
+ })
17009
+ })
17010
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
17011
+ as: "section",
17012
+ gap: 8,
17013
+ "data-section": "modes",
17014
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
17015
+ gap: 8,
17016
+ justify: "between",
17017
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
17018
+ gap: 2,
17019
+ grow: true,
17020
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17021
+ as: "h4",
17022
+ size: "md",
17023
+ tone: "primary",
17024
+ weight: "strong",
17025
+ children: t("modes.label")
17026
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17027
+ as: "p",
17028
+ size: "sm",
17029
+ tone: "tertiary",
17030
+ children: t("modes.hint")
17031
+ })]
17032
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
17033
+ label: t("add.label"),
17034
+ "data-action": "open-add-mode",
17035
+ disabled: !state.writable,
17036
+ onClick: () => {
17037
+ setAddingId("");
17038
+ setAddingOpen(true);
17039
+ },
17040
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconPlusOutlineRegular, {})
17041
+ })]
17042
+ }), state.modes.map((mode) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModeCard, {
17043
+ mode,
17044
+ models,
17045
+ open: expanded.has(mode.id),
17046
+ writable: state.writable,
17047
+ t,
17048
+ face,
17049
+ onRequestRemove: () => {
17050
+ setRemoving(mode);
17051
+ },
17052
+ onToggle: () => {
17053
+ toggle(mode.id);
17054
+ }
17055
+ }, mode.id))]
17056
+ })]
17057
+ }),
17058
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Modal, {
17059
+ open: addingOpen,
17060
+ onClose: () => {
17061
+ setAddingOpen(false);
17062
+ },
17063
+ title: t("add.label"),
17064
+ closeLabel: t("add.close"),
17065
+ description: t("add.hint"),
17066
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
17067
+ variant: "outline",
17068
+ onClick: () => {
17069
+ setAddingOpen(false);
17070
+ },
17071
+ children: t("add.cancel")
17072
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
17073
+ variant: "primary",
17074
+ "data-action": "add-mode",
17075
+ disabled: addingId.trim() === "",
17076
+ onClick: () => {
17077
+ const id = addingId.trim();
17078
+ face.addMode(id);
17079
+ setAddingId("");
17080
+ setAddingOpen(false);
17081
+ setExpanded((previous) => new Set(previous).add(id));
17082
+ },
17083
+ children: t("add.confirm")
17084
+ })] }),
17085
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Input, {
17086
+ "data-field": "new-mode",
17087
+ "data-modal-autofocus": true,
17088
+ value: addingId,
17089
+ placeholder: t("add.placeholder"),
17090
+ "aria-label": t("add.label"),
17091
+ onChange: (event) => {
17092
+ setAddingId(event.currentTarget.value);
17093
+ }
17094
+ })
17095
+ }),
17096
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Modal, {
17097
+ open: removing !== null,
17098
+ onClose: () => {
17099
+ setRemoving(null);
17100
+ },
17101
+ title: t("remove.title"),
17102
+ closeLabel: t("remove.close"),
17103
+ description: t("remove.description", { name: removing?.title ?? "" }),
17104
+ footer: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
17105
+ variant: "outline",
17106
+ onClick: () => {
17107
+ setRemoving(null);
17108
+ },
17109
+ children: t("remove.cancel")
17110
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
17111
+ variant: "primary",
17112
+ tone: "danger",
17113
+ "data-action": "confirm-remove",
17114
+ onClick: () => {
17115
+ if (removing !== null) face.removeMode(removing.id);
17116
+ setRemoving(null);
17117
+ },
17118
+ children: t("remove.confirm")
17119
+ })] })
17120
+ })
17121
+ ]
16662
17122
  });
16663
- });
16664
- function displayTextOf(reference) {
16665
- return (reference.title ?? `${reference.path ?? ""}${rangeOf(reference)}`).replaceAll("`", "'");
16666
17123
  }
16667
- function rangeOf(reference) {
16668
- if (reference.lineStart === void 0) return "";
16669
- const column = reference.column === void 0 ? "" : `C${String(reference.column)}`;
16670
- return reference.lineEnd === void 0 ? `#L${String(reference.lineStart)}${column}` : `#L${String(reference.lineStart)}${column}-L${String(reference.lineEnd)}`;
17124
+ function ModeCard({ mode, models, open, writable, t, face, onRequestRemove, onToggle }) {
17125
+ const hasModel = mode.model !== void 0;
17126
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stack, {
17127
+ boxed: true,
17128
+ pad: "card",
17129
+ "data-mode": mode.id,
17130
+ "data-deletable": mode.deletable ? "true" : "false",
17131
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(DisclosureRow, {
17132
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconAgentPresetOutlineRegular, {}),
17133
+ title: mode.title,
17134
+ open,
17135
+ expandable: true,
17136
+ expandOnRowClick: true,
17137
+ onToggle,
17138
+ keepContentWhenOpen: true,
17139
+ collapsedContent: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17140
+ as: "code",
17141
+ size: "sm",
17142
+ tone: "tertiary",
17143
+ "data-mode-id": true,
17144
+ children: mode.id
17145
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Row, {
17146
+ gap: 8,
17147
+ push: true,
17148
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17149
+ as: "span",
17150
+ size: "sm",
17151
+ tone: "tertiary",
17152
+ children: mode.summary
17153
+ }), mode.deletable ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(IconButton, {
17154
+ size: "sm",
17155
+ "data-action": "remove-mode",
17156
+ disabled: !writable,
17157
+ label: t("removeNamed", { name: mode.title }),
17158
+ onClick: (event) => {
17159
+ event.stopPropagation();
17160
+ onRequestRemove();
17161
+ },
17162
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconTrashOutlineRegular, {})
17163
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17164
+ as: "span",
17165
+ size: "sm",
17166
+ tone: "tertiary",
17167
+ "data-protected": "true",
17168
+ children: t("protected")
17169
+ })]
17170
+ })] }),
17171
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stack, {
17172
+ gap: 14,
17173
+ pad: "body",
17174
+ children: mode.groups.map((group) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
17175
+ gap: 0,
17176
+ "data-group": group.key,
17177
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
17178
+ gap: 8,
17179
+ justify: "between",
17180
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17181
+ size: "sm",
17182
+ tone: "secondary",
17183
+ weight: "strong",
17184
+ children: group.label
17185
+ })
17186
+ }), group.key === "model" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
17187
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsFieldRow, {
17188
+ label: t("field.defaultModel"),
17189
+ hint: t("hint.defaultModel"),
17190
+ layout: "inline",
17191
+ "data-control": "default-model",
17192
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Switch, {
17193
+ checked: hasModel,
17194
+ label: t("field.defaultModel"),
17195
+ disabled: !writable,
17196
+ onChange: (next) => {
17197
+ if (next) face.set([
17198
+ "modes",
17199
+ mode.id,
17200
+ "defaultModel"
17201
+ ], {
17202
+ provider: "",
17203
+ model: ""
17204
+ });
17205
+ else face.clear([
17206
+ "modes",
17207
+ mode.id,
17208
+ "defaultModel"
17209
+ ]);
17210
+ }
17211
+ })
17212
+ }),
17213
+ !hasModel ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsFieldRow, {
17214
+ label: t("field.modelRoute"),
17215
+ hint: t("hint.modelRoute"),
17216
+ divider: true,
17217
+ "data-control": "model-routes",
17218
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(ModelRouteList, {
17219
+ label: t("field.modelRoute"),
17220
+ candidates: models.routes,
17221
+ selectedKey: mode.model === void 0 || mode.model.provider === "" ? void 0 : routeKey(mode.model.provider, mode.model.model),
17222
+ disabled: !writable,
17223
+ status: models.status,
17224
+ loadingLabel: t("model.loading"),
17225
+ errorLabel: t("model.error"),
17226
+ emptyLabel: t("model.empty"),
17227
+ onSelect: (candidate) => {
17228
+ face.set([
17229
+ "modes",
17230
+ mode.id,
17231
+ "defaultModel"
17232
+ ], {
17233
+ provider: candidate.provider,
17234
+ model: candidate.model
17235
+ });
17236
+ }
17237
+ })
17238
+ }),
17239
+ group.fields.map((field, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldRow, {
17240
+ field,
17241
+ writable,
17242
+ t,
17243
+ face,
17244
+ divider: index > 0 || hasModel
17245
+ }, field.key))
17246
+ ] }) : group.fields.map((field, index) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldRow, {
17247
+ field,
17248
+ writable,
17249
+ t,
17250
+ face,
17251
+ divider: index > 0
17252
+ }, field.key))]
17253
+ }, group.key))
17254
+ })
17255
+ })
17256
+ });
16671
17257
  }
16672
- function tokenizeReferences(text) {
16673
- const tokens = /* @__PURE__ */ new Map();
16674
- let out = "";
16675
- let cursor = 0;
16676
- for (const span of findReferences(text)) {
16677
- if (!isLocalReference(span.reference) || span.start < cursor) continue;
16678
- const display = displayTextOf(span.reference);
16679
- tokens.set(display, span.reference);
16680
- out += `${text.slice(cursor, span.start)}\`${display}\``;
16681
- cursor = span.end;
16682
- }
16683
- return {
16684
- source: cursor === 0 ? text : out + text.slice(cursor),
16685
- tokens
16686
- };
17258
+ function FieldRow({ field, writable, divider, t, face }) {
17259
+ if (field.control === "choice" && !field.present) return null;
17260
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SettingsFieldRow, {
17261
+ label: field.label,
17262
+ hint: field.hint,
17263
+ divider,
17264
+ layout: field.control === "switch" || field.control === "tri" || field.control === "roles" ? "inline" : "stack",
17265
+ ...field.overridden ? { overriddenLabel: t("overridden") } : {},
17266
+ ...field.control === "text" ? {
17267
+ resetLabel: t("field.reset"),
17268
+ onReset: () => {
17269
+ face.clear(field.path);
17270
+ }
17271
+ } : {},
17272
+ ...field.invalid === void 0 ? {} : { invalid: field.invalid },
17273
+ "data-field": field.path.join("."),
17274
+ "data-control": field.control,
17275
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FieldControl, {
17276
+ field,
17277
+ writable,
17278
+ t,
17279
+ face
17280
+ })
17281
+ });
16687
17282
  }
16688
- function openReference(reference, actions) {
16689
- const path = reference.path;
16690
- if (actions === void 0 || path === void 0) return;
16691
- if (reference.protocol === "skill") {
16692
- actions.openSkill(path);
16693
- return;
17283
+ function FieldControl({ field, writable, t, face }) {
17284
+ const disabled = !writable;
17285
+ const id = (0, react.useId)();
17286
+ switch (field.control) {
17287
+ case "multiline": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(MultilineField, {
17288
+ value: field.text,
17289
+ rows: 3,
17290
+ disabled,
17291
+ "aria-label": field.label,
17292
+ onChange: (event) => {
17293
+ face.editText(field.path, event.currentTarget.value);
17294
+ }
17295
+ });
17296
+ case "choice": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SearchSelect, {
17297
+ label: field.label,
17298
+ value: field.text,
17299
+ emptyLabel: t("tri.unset"),
17300
+ options: field.options.map((option) => ({
17301
+ value: String(option.value),
17302
+ ...option.label === void 0 ? {} : { label: option.label }
17303
+ })),
17304
+ searchLabel: t("select.search"),
17305
+ noMatchLabel: t("select.noMatch"),
17306
+ disabled,
17307
+ onSelect: (next) => {
17308
+ if (next === "") face.clear(field.path);
17309
+ else face.set(field.path, next);
17310
+ }
17311
+ });
17312
+ case "switch": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Switch, {
17313
+ checked: field.value === true,
17314
+ label: field.label,
17315
+ disabled,
17316
+ onChange: (next) => {
17317
+ face.set(field.path, next);
17318
+ }
17319
+ });
17320
+ case "tri": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.SegmentedControl, {
17321
+ id: `${id}-tri`,
17322
+ label: field.label,
17323
+ value: triValue(field),
17324
+ disabled,
17325
+ options: [
17326
+ {
17327
+ value: "unset",
17328
+ label: t("tri.unset")
17329
+ },
17330
+ {
17331
+ value: "on",
17332
+ label: t("tri.on")
17333
+ },
17334
+ {
17335
+ value: "off",
17336
+ label: t("tri.off")
17337
+ }
17338
+ ],
17339
+ onChange: (next) => {
17340
+ if (next === "unset") face.clear(field.path);
17341
+ else face.set(field.path, next === "on");
17342
+ }
17343
+ });
17344
+ case "roles": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Row, {
17345
+ gap: 6,
17346
+ wrap: true,
17347
+ "data-control": "roles",
17348
+ children: ROLES.map((role) => {
17349
+ const active = Array.isArray(field.value) && field.value.includes(role);
17350
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Button$1, {
17351
+ variant: active ? "primary" : "outline",
17352
+ size: "sm",
17353
+ "data-mode-role": role,
17354
+ disabled,
17355
+ "aria-pressed": active,
17356
+ onClick: () => {
17357
+ const current = Array.isArray(field.value) ? field.value.map(String) : [];
17358
+ const wanted = active ? current.filter((value) => value !== role) : [...current.filter((value) => value !== role), role];
17359
+ face.set(field.path, wanted);
17360
+ },
17361
+ children: t(`role.${role}`)
17362
+ }, role);
17363
+ })
17364
+ });
17365
+ case "tags": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TagInput, {
17366
+ value: Array.isArray(field.value) ? field.value.map(String) : [],
17367
+ options: field.options.map((option) => ({
17368
+ value: String(option.value),
17369
+ ...option.label === void 0 ? {} : { label: option.label }
17370
+ })),
17371
+ placeholder: t("tags.placeholder"),
17372
+ label: field.label,
17373
+ noMatchLabel: t("select.noMatch"),
17374
+ removeLabel: (name) => t("tags.remove", { name }),
17375
+ disabled,
17376
+ onChange: (next) => {
17377
+ face.set(field.path, next);
17378
+ }
17379
+ });
17380
+ case "text": return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Input, {
17381
+ value: field.text,
17382
+ "aria-label": field.label,
17383
+ disabled,
17384
+ onChange: (event) => {
17385
+ face.editText(field.path, event.currentTarget.value);
17386
+ }
17387
+ });
16694
17388
  }
16695
- if (reference.protocol === "file") actions.openFile(path);
16696
17389
  }
16697
- [...inject$2];
16698
- function apply$1(ctx) {
16699
- apply$2(ctx);
17390
+ function triValue(field) {
17391
+ return field.value === "unset" || field.value === "on" || field.value === "off" ? field.value : "unset";
16700
17392
  }
16701
17393
  //#endregion
16702
- //#region src/shared.ts
16703
- const SESSION_MODE_PATH = "/session-mode";
16704
- const POLICY_NAMES = ["fs/write-intent", "fs/edit-intent"];
17394
+ //#region src/client/bundle-locales.ts
17395
+ const BUNDLE_NS = "session-mode-bundle";
17396
+ const bundleZh = {
17397
+ "default.label": "新会话的默认模式",
17398
+ "default.hint": "还没选过模式的会话从这里开始。",
17399
+ "modes.label": "模式",
17400
+ "modes.hint": "展开一个模式,改它的提示词、工具与技能、上游规则和注入内容。",
17401
+ "add.label": "添加模式",
17402
+ "add.placeholder": "模式 id",
17403
+ "add.confirm": "添加",
17404
+ "add.cancel": "取消",
17405
+ "add.close": "关闭",
17406
+ "add.hint": "给新模式一个 id(选择器与列表里也显示它,加好后可以再改名称)。",
17407
+ removeNamed: "删除模式 {name}",
17408
+ protected: "内置模式,不提供删除",
17409
+ untitled: "(未命名)",
17410
+ overridden: "已覆盖",
17411
+ "group.identity": "基本信息",
17412
+ "group.persona": "提示词",
17413
+ "group.tools": "工具与技能",
17414
+ "group.rules": "上游规则",
17415
+ "group.injections": "请求里注入什么",
17416
+ "group.model": "默认模型",
17417
+ "role.main": "会话可选",
17418
+ "role.subagent": "子代理可用",
17419
+ "field.name": "名称",
17420
+ "field.description": "一句话说明",
17421
+ "field.role": "角色",
17422
+ "field.presetsOnly": "允许挂的 preset",
17423
+ "field.prefix": "提示词前缀",
17424
+ "field.suffix": "提示词后缀",
17425
+ "field.allowTools": "允许的工具",
17426
+ "field.denyTools": "禁用的工具",
17427
+ "field.allowSkills": "允许的技能",
17428
+ "field.denySkills": "禁用的技能",
17429
+ "field.allowPolicies": "生效的规则",
17430
+ "field.denyPolicies": "禁用的规则",
17431
+ "field.instructions": "工作区指令",
17432
+ "field.skills": "技能目录",
17433
+ "field.runtimeContext": "动态快照",
17434
+ "field.defaultModel": "设默认模型",
17435
+ "field.modelRoute": "用哪个模型",
17436
+ "field.reasoningEffort": "思考档位",
17437
+ "field.reset": "恢复默认",
17438
+ "hint.name": "选择器和列表里显示的名字。",
17439
+ "hint.description": "一句话说明这个模式做什么。",
17440
+ "hint.role": "「会话可选」= 用户能在会话里选它;「子代理可用」= 可以把子代理跑在这个模式下。",
17441
+ "hint.presetsOnly": "只允许这个模式挂这些 preset(行清单由挂着的那份提供);不填 = 允许全部(哪份 preset 都行,切模式也不动它)。有值时切到这个模式,会话当前那份不在名单里就换成名单第一个。",
17442
+ "hint.prefix": "加在系统提示词开头的一段话。",
17443
+ "hint.suffix": "加在系统提示词结尾的一段话。",
17444
+ "hint.allowTools": "只允许这些工具;不填 = 不限制(用会话当前 preset 的全部工具)。",
17445
+ "hint.denyTools": "从上面那份里去掉这些工具。",
17446
+ "hint.allowSkills": "只允许这些技能;不填 = 不限制。",
17447
+ "hint.denySkills": "这些技能不列进技能目录,`skill` 工具也加载不了。",
17448
+ "hint.allowPolicies": "只让这些上游规则生效;不填 = 全部生效。",
17449
+ "hint.denyPolicies": "禁用这些上游规则,它的判断连拒绝一起丢掉。",
17450
+ "hint.instructions": "每步都把工作区指令(AGENTS.md 之类)发给模型;关掉就不发。",
17451
+ "hint.skills": "每步都把技能目录发给模型;默认按这个模式的工具名单自动判断。",
17452
+ "hint.runtimeContext": "每步都把沙箱与审批策略发给模型。",
17453
+ "hint.defaultModel": "开 = 这个模式自带一个默认模型(会话还没选过模型时用它);关 = 跟随全局模型。",
17454
+ "hint.modelRoute": "从部署里已设置的模型里挑一条:服务商与模型是一对,选它等于两个一起定。",
17455
+ "hint.reasoningEffort": "思考档位;不填用服务商默认。",
17456
+ "model.loading": "正在读部署里已设置的模型…",
17457
+ "model.error": "读不出部署里已设置的模型。",
17458
+ "model.empty": "部署里还没有已设置的模型。",
17459
+ "tags.placeholder": "加一个后回车,或粘贴一串",
17460
+ "tags.add": "添加",
17461
+ "tags.remove": "移除 {name}",
17462
+ "select.search": "搜索候选",
17463
+ "select.noMatch": "没有匹配的候选",
17464
+ "tri.unset": "默认",
17465
+ "tri.on": "开",
17466
+ "tri.off": "关",
17467
+ "remove.title": "删除模式",
17468
+ "remove.description": "删除 {name}?删除只在保存之后生效,保存之前还可以丢弃。",
17469
+ "remove.confirm": "删除",
17470
+ "remove.cancel": "取消",
17471
+ "remove.close": "关闭",
17472
+ "model.set": "设置默认模型",
17473
+ "model.follow": "改为跟随全局",
17474
+ save: "保存",
17475
+ saving: "保存中…",
17476
+ saveFailed: "保存没有生效,请重试。",
17477
+ readOnly: "这份部署的配置是只读的。",
17478
+ unavailable: "这一行当前不可写。",
17479
+ notSaved: "没有保存:{message}",
17480
+ "configured.loading": "正在读取这一行的配置…",
17481
+ "configured.missing": "设置面里没有 `session-mode` 这一行:没装、被禁用,或者还没装配成功(依赖没到齐时会一直 PENDING)。",
17482
+ "configured.unreadable": "`session-mode` 这一行在跑,但这份配置读不出来({problem})。",
17483
+ "violation.modesEmpty": "至少要有一种模式。",
17484
+ "violation.defaultMissing": "默认模式不在模式清单里。",
17485
+ "violation.modelPair": "默认模型要同时给出服务商与模型。",
17486
+ "summary.allTools": "全部工具",
17487
+ "summary.tools": "{n} 件工具",
17488
+ "summary.denyTools": "禁 {n} 件",
17489
+ "summary.globalModel": "跟随全局模型"
17490
+ };
17491
+ const bundleEn = {
17492
+ "default.label": "Mode for new sessions",
17493
+ "default.hint": "Sessions that never picked a mode start here.",
17494
+ "modes.label": "Modes",
17495
+ "modes.hint": "Expand a mode to edit its prompt, tools and skills, upstream rules, and injected content.",
17496
+ "add.label": "Add a mode",
17497
+ "add.placeholder": "mode id",
17498
+ "add.confirm": "Add",
17499
+ "add.cancel": "Cancel",
17500
+ "add.close": "Close",
17501
+ "add.hint": "Give the new mode an id (it also shows in pickers and lists; rename it after adding).",
17502
+ removeNamed: "Delete mode {name}",
17503
+ protected: "Built-in mode: no delete",
17504
+ untitled: "(untitled)",
17505
+ overridden: "Overridden",
17506
+ "group.identity": "Basics",
17507
+ "group.persona": "Prompt",
17508
+ "group.tools": "Tools and skills",
17509
+ "group.rules": "Upstream rules",
17510
+ "group.injections": "Injected into requests",
17511
+ "group.model": "Default model",
17512
+ "role.main": "Selectable in sessions",
17513
+ "role.subagent": "Usable for subagents",
17514
+ "field.name": "Name",
17515
+ "field.description": "One-line description",
17516
+ "field.role": "Roles",
17517
+ "field.presetsOnly": "Presets it may ride on",
17518
+ "field.prefix": "Prompt prefix",
17519
+ "field.suffix": "Prompt suffix",
17520
+ "field.allowTools": "Allowed tools",
17521
+ "field.denyTools": "Denied tools",
17522
+ "field.allowSkills": "Allowed skills",
17523
+ "field.denySkills": "Denied skills",
17524
+ "field.allowPolicies": "Rules in force",
17525
+ "field.denyPolicies": "Rules disabled",
17526
+ "field.instructions": "Workspace instructions",
17527
+ "field.skills": "Skill catalog",
17528
+ "field.runtimeContext": "Runtime snapshot",
17529
+ "field.defaultModel": "Default model",
17530
+ "field.modelRoute": "Which model",
17531
+ "field.reasoningEffort": "Reasoning effort",
17532
+ "field.reset": "Reset",
17533
+ "hint.name": "Shown in the picker and in lists.",
17534
+ "hint.description": "One line saying what this mode is for.",
17535
+ "hint.role": "Selectable in sessions = the user can pick it; usable for subagents = subagents may run in it.",
17536
+ "hint.presetsOnly": "Only these presets may back this mode (the one it rides on supplies the row list); empty = every preset is allowed (and selecting the mode switches nothing). When set, selecting the mode switches to the first entry if the session's current preset is not listed.",
17537
+ "hint.prefix": "Text prepended to the system prompt.",
17538
+ "hint.suffix": "Text appended to the system prompt.",
17539
+ "hint.allowTools": "Only these tools; empty = no restriction (every tool of the session's preset).",
17540
+ "hint.denyTools": "Those tools are removed from the list above.",
17541
+ "hint.allowSkills": "Only these skills; empty = no restriction.",
17542
+ "hint.denySkills": "Those skills leave the catalog, and the `skill` tool cannot load them.",
17543
+ "hint.allowPolicies": "Only these upstream rules stay in force; empty = all of them.",
17544
+ "hint.denyPolicies": "Those upstream rules are disabled, rejection included.",
17545
+ "hint.instructions": "Sends the workspace instructions (AGENTS.md and friends) with every step; off means it is not sent.",
17546
+ "hint.skills": "Sends the skill catalog with every step; default decides from this mode's tool lists.",
17547
+ "hint.runtimeContext": "Sends the sandbox and approval policies with every step.",
17548
+ "hint.defaultModel": "On = this mode carries a default model (used while a session has picked none); off = follow the global model.",
17549
+ "hint.modelRoute": "Pick one model already set up in this deployment: a provider and a model come as one route, so choosing it sets both.",
17550
+ "hint.reasoningEffort": "Reasoning effort; empty uses the provider default.",
17551
+ "model.loading": "Reading the models set up in this deployment…",
17552
+ "model.error": "Could not read the models set up in this deployment.",
17553
+ "model.empty": "No model is set up in this deployment yet.",
17554
+ "tags.placeholder": "Add one and press Enter, or paste a list",
17555
+ "tags.add": "Add",
17556
+ "tags.remove": "Remove {name}",
17557
+ "select.search": "Search candidates",
17558
+ "select.noMatch": "No matching candidate",
17559
+ "tri.unset": "Default",
17560
+ "tri.on": "On",
17561
+ "tri.off": "Off",
17562
+ "remove.title": "Delete mode",
17563
+ "remove.description": "Delete {name}? The deletion applies on save; until then you can discard it.",
17564
+ "remove.confirm": "Delete",
17565
+ "remove.cancel": "Cancel",
17566
+ "remove.close": "Close",
17567
+ "model.set": "Set a default model",
17568
+ "model.follow": "Follow the global model",
17569
+ save: "Save",
17570
+ saving: "Saving…",
17571
+ saveFailed: "The save did not take effect; try again.",
17572
+ readOnly: "This deployment stores settings read-only.",
17573
+ unavailable: "This row is not writable right now.",
17574
+ notSaved: "Not saved: {message}",
17575
+ "configured.loading": "Reading this row's configuration…",
17576
+ "configured.missing": "The settings surface has no `session-mode` row: not installed, disabled, or not composed yet (it stays PENDING while a dependency is missing).",
17577
+ "configured.unreadable": "The `session-mode` row is running, but its configuration cannot be read ({problem}).",
17578
+ "violation.modesEmpty": "At least one mode is required.",
17579
+ "violation.defaultMissing": "The default mode is not in the mode list.",
17580
+ "violation.modelPair": "A default model needs both a provider and a model.",
17581
+ "summary.allTools": "every tool",
17582
+ "summary.tools": "{n} tools",
17583
+ "summary.denyTools": "{n} denied",
17584
+ "summary.globalModel": "global model"
17585
+ };
16705
17586
  //#endregion
16706
17587
  //#region src/client/api.ts
16707
17588
  async function fetchRoster() {
@@ -16751,27 +17632,6 @@ window.__ModuleLoader__.load({
16751
17632
  return roster;
16752
17633
  }
16753
17634
  //#endregion
16754
- //#region \0dsh-css-modules:/Users/morlay/src/github.com/morlay/dsh-plugin/packages/profile/dsh-session-mode/src/client/SessionModeSeat.module.css.mjs
16755
- const css = ".dDMF8q_menuAnchor{min-width:54px;max-width:100%}.dDMF8q_seat{min-width:0;max-width:min(100%,240px);min-height:28px;color:var(--dsw-alias-label-primary);white-space:nowrap;cursor:pointer;background:0 0;border:none;border-radius:16px;align-items:center;gap:4px;padding:0 8px;font-size:13px;font-weight:500;line-height:20px;display:inline-flex}.dDMF8q_seat:not(:disabled):hover,.dDMF8q_seat[aria-expanded=true]{background:var(--dsw-alias-interactive-bg-hover)}.dDMF8q_seat:disabled{cursor:default;color:var(--dsw-alias-label-quaternary)}.dDMF8q_seatIcon{color:var(--dsw-alias-label-primary);flex:none}.dDMF8q_seatLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}.dDMF8q_chevron{color:var(--dsw-alias-label-caption);flex:none}.dDMF8q_item{flex-direction:column;gap:2px;max-width:280px;display:flex}.dDMF8q_itemName{color:var(--dsw-alias-label-primary);font-size:13px;line-height:20px}.dDMF8q_itemDesc{color:var(--dsw-alias-label-caption);white-space:normal;font-size:12px;line-height:16px}";
16756
- const tagId = "@morlay/dsh-session-mode/SessionModeSeat.module.css";
16757
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=\"@morlay/dsh-session-mode/SessionModeSeat.module.css\"]") === null) {
16758
- const tag = document.createElement("style");
16759
- tag.dataset.plugin = "@morlay/dsh-session-mode";
16760
- tag.dataset.pluginCss = tagId;
16761
- tag.textContent = css;
16762
- document.head.appendChild(tag);
16763
- }
16764
- var SessionModeSeat_module_css_default = {
16765
- "itemName": "dDMF8q_itemName",
16766
- "seatIcon": "dDMF8q_seatIcon",
16767
- "seat": "dDMF8q_seat",
16768
- "seatLabel": "dDMF8q_seatLabel",
16769
- "itemDesc": "dDMF8q_itemDesc",
16770
- "chevron": "dDMF8q_chevron",
16771
- "item": "dDMF8q_item",
16772
- "menuAnchor": "dDMF8q_menuAnchor"
16773
- };
16774
- //#endregion
16775
17635
  //#region src/client/SessionModeSeat.tsx
16776
17636
  function SessionModeSeat({ sessionId, useSessions, t }) {
16777
17637
  const roster = useRoster();
@@ -16789,30 +17649,27 @@ window.__ModuleLoader__.load({
16789
17649
  if (roster === void 0) return null;
16790
17650
  const current = selected ?? roster.default;
16791
17651
  const label = roster.modes.find((mode) => mode.id === current)?.name ?? current;
16792
- if (editable === false) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
16793
- type: "button",
16794
- className: SessionModeSeat_module_css_default.seat,
17652
+ if (editable === false) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SeatButton, {
16795
17653
  disabled: true,
16796
17654
  title: t("lockedHint"),
16797
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutlineRegular, { className: SessionModeSeat_module_css_default.seatIcon }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16798
- className: SessionModeSeat_module_css_default.seatLabel,
16799
- children: label
16800
- })]
17655
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconAgentPresetOutlineRegular, {}),
17656
+ label
16801
17657
  });
16802
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Menu, {
17658
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.Menu, {
16803
17659
  open,
16804
17660
  onClose: () => {
16805
17661
  setOpen(false);
16806
17662
  },
16807
17663
  items: roster.modes.map((mode) => ({
16808
17664
  id: mode.id,
16809
- label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
16810
- className: SessionModeSeat_module_css_default.item,
16811
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16812
- className: SessionModeSeat_module_css_default.itemName,
17665
+ label: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Stack, {
17666
+ gap: 2,
17667
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17668
+ size: "md",
16813
17669
  children: mode.name
16814
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16815
- className: SessionModeSeat_module_css_default.itemDesc,
17670
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Text, {
17671
+ size: "sm",
17672
+ tone: "tertiary",
16816
17673
  children: mode.description ?? t("noDescription")
16817
17674
  })]
16818
17675
  })
@@ -16831,25 +17688,17 @@ window.__ModuleLoader__.load({
16831
17688
  },
16832
17689
  align: "start",
16833
17690
  portal: true,
16834
- className: SessionModeSeat_module_css_default.menuAnchor,
16835
- anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
16836
- type: "button",
16837
- className: SessionModeSeat_module_css_default.seat,
17691
+ anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SeatButton, {
16838
17692
  "aria-haspopup": "menu",
16839
17693
  "aria-expanded": open,
16840
17694
  title: error ?? t("seatHint"),
16841
17695
  disabled: busy,
17696
+ icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconAgentPresetOutlineRegular, {}),
17697
+ label,
17698
+ chevron: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(client_exports.IconChevronDownOutlineRegular, {}),
16842
17699
  onClick: () => {
16843
17700
  setOpen((value) => !value);
16844
- },
16845
- children: [
16846
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconAgentPresetOutlineRegular, { className: SessionModeSeat_module_css_default.seatIcon }),
16847
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
16848
- className: SessionModeSeat_module_css_default.seatLabel,
16849
- children: label
16850
- }),
16851
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { className: SessionModeSeat_module_css_default.chevron })
16852
- ]
17701
+ }
16853
17702
  })
16854
17703
  });
16855
17704
  }
@@ -16864,7 +17713,7 @@ window.__ModuleLoader__.load({
16864
17713
  model: "模型",
16865
17714
  modelHint: "模型 id。",
16866
17715
  reasoningEffort: "思考档位",
16867
- reasoningEffortHint: "省略就跟服务商自己的默认。"
17716
+ reasoningEffortHint: "默认就跟服务商自己的默认。"
16868
17717
  };
16869
17718
  const en = {
16870
17719
  seatHint: "Pick the mode for this session",
@@ -16875,7 +17724,7 @@ window.__ModuleLoader__.load({
16875
17724
  model: "Model",
16876
17725
  modelHint: "Model id.",
16877
17726
  reasoningEffort: "Reasoning effort",
16878
- reasoningEffortHint: "Unset keeps the provider's own default."
17727
+ reasoningEffortHint: "Default keeps the provider's own default."
16879
17728
  };
16880
17729
  //#endregion
16881
17730
  //#region src/client/index.ts
@@ -16888,13 +17737,8 @@ window.__ModuleLoader__.load({
16888
17737
  const POLICY_FIELDS = ["allowPolicies", "denyPolicies"];
16889
17738
  const DYNAMIC = "*";
16890
17739
  const inject = ["slots", "locale"];
16891
- const SESSION_MODE_NS = "session-mode";
16892
- function readAt(root, path) {
16893
- return path.reduce((node, segment) => {
16894
- if (Array.isArray(node)) return node[Number(segment)];
16895
- if (typeof node !== "object" || node === null) return void 0;
16896
- return Reflect.get(node, segment);
16897
- }, root);
17740
+ function unwrapHintService(scope) {
17741
+ return unwrapService(scope.schemaFormHints);
16898
17742
  }
16899
17743
  function apply(ctx) {
16900
17744
  apply$1(ctx);
@@ -16904,7 +17748,7 @@ window.__ModuleLoader__.load({
16904
17748
  en
16905
17749
  }), "session-mode: dictionaries");
16906
17750
  ctx.inject(["schemaFormHints"], (scope) => scope.effect(() => {
16907
- const hints = scope.schemaFormHints;
17751
+ const hints = unwrapHintService(scope);
16908
17752
  const offs = FIELDS.map((key) => hints.describe(SESSION_MODE_NS, [
16909
17753
  "modes",
16910
17754
  DYNAMIC,
@@ -16919,7 +17763,7 @@ window.__ModuleLoader__.load({
16919
17763
  };
16920
17764
  }, "session-mode: field wording"));
16921
17765
  ctx.inject(["schemaFormHints"], (scope) => scope.effect(() => {
16922
- const offs = POLICY_FIELDS.map((key) => scope.schemaFormHints.select(SESSION_MODE_NS, [
17766
+ const offs = POLICY_FIELDS.map((key) => unwrapHintService(scope).select(SESSION_MODE_NS, [
16923
17767
  "modes",
16924
17768
  DYNAMIC,
16925
17769
  key,
@@ -16930,42 +17774,14 @@ window.__ModuleLoader__.load({
16930
17774
  };
16931
17775
  }, "session-mode: policy candidates"));
16932
17776
  ctx.inject(["schemaFormHints"], (scope) => scope.effect(() => {
16933
- const hints = scope.schemaFormHints;
17777
+ const hints = unwrapHintService(scope);
16934
17778
  const remote = scope.get("remote");
16935
- const forms = scope.get("configForms");
16936
- if (remote === void 0 || forms === void 0) return () => {};
17779
+ if (remote === void 0) return () => {};
16937
17780
  let providers = [];
16938
17781
  const load = async () => {
16939
- const [routes, directory] = await Promise.all([remote.llm.listProviders(), remote.llm.listConfigurableProviders()]);
16940
- if (!routes.ok || !directory.ok) return;
16941
- const merged = /* @__PURE__ */ new Map();
16942
- for (const entry of directory.value) merged.set(entry.provider, {
16943
- value: entry.provider,
16944
- label: entry.displayName,
16945
- settingsNs: entry.settingsNs,
16946
- settingsPath: [...entry.settingsPath]
16947
- });
16948
- for (const route of routes.value) if (!merged.has(route.id)) merged.set(route.id, {
16949
- value: route.id,
16950
- label: route.name,
16951
- settingsNs: "",
16952
- settingsPath: []
16953
- });
16954
- providers = [...merged.values()];
17782
+ providers = await loadLlmProviders(scope);
16955
17783
  hints.refresh();
16956
17784
  };
16957
- const modelsOf = (provider) => {
16958
- if (typeof provider !== "string") return [];
16959
- const entry = providers.find((candidate) => candidate.value === provider);
16960
- if (entry === void 0 || entry.settingsNs === "") return [];
16961
- const profile = readAt(forms.get(entry.settingsNs).getSnapshot().value, entry.settingsPath);
16962
- const models = typeof profile === "object" && profile !== null ? Reflect.get(profile, "models") : void 0;
16963
- if (!Array.isArray(models)) return [];
16964
- return models.flatMap((model) => {
16965
- const id = typeof model === "object" && model !== null ? Reflect.get(model, "id") : void 0;
16966
- return typeof id === "string" ? [{ value: id }] : [];
16967
- });
16968
- };
16969
17785
  const offs = [
16970
17786
  hints.source("llm-providers", { options: () => providers.map((entry) => ({
16971
17787
  value: entry.value,
@@ -16973,13 +17789,16 @@ window.__ModuleLoader__.load({
16973
17789
  })) }),
16974
17790
  hints.source("llm-models", {
16975
17791
  dependsOn: [["provider"]],
16976
- options: (read) => modelsOf(read(["provider"]))
17792
+ options: (read) => {
17793
+ const provider = read(["provider"]);
17794
+ return typeof provider === "string" ? providers.find((entry) => entry.value === provider)?.models ?? [] : [];
17795
+ }
16977
17796
  }),
16978
17797
  remote.$on("llm/adapters-updated", () => {
16979
17798
  load();
16980
17799
  }),
16981
17800
  remote.$on("settings/document-updated", () => {
16982
- hints.refresh();
17801
+ load();
16983
17802
  })
16984
17803
  ];
16985
17804
  load();
@@ -16987,6 +17806,56 @@ window.__ModuleLoader__.load({
16987
17806
  for (const off of offs) off();
16988
17807
  };
16989
17808
  }, "session-mode: model candidates"));
17809
+ ctx.inject(["schemaFormHints"], (scope) => scope.effect(() => {
17810
+ const hints = unwrapHintService(scope);
17811
+ const remote = scope.get("remote");
17812
+ if (remote === void 0) return () => {};
17813
+ const roster = remoteNamespace(scope, "agentPresets");
17814
+ if (roster === void 0) return () => {};
17815
+ let presets = [];
17816
+ const load = async () => {
17817
+ const listed = await roster.list();
17818
+ if (!listed.ok) return;
17819
+ presets = listed.value.presets.map((preset) => ({
17820
+ value: preset.id,
17821
+ label: preset.name ?? preset.id
17822
+ }));
17823
+ hints.refresh();
17824
+ };
17825
+ const offs = [hints.source("agent-presets", { options: () => presets }), remote.$on("settings/document-updated", () => {
17826
+ load();
17827
+ })];
17828
+ load();
17829
+ return () => {
17830
+ for (const off of offs) off();
17831
+ };
17832
+ }, "session-mode: preset candidates"));
17833
+ ctx.inject(["schemaFormHints", "remote"], (scope) => scope.effect(() => {
17834
+ const hints = unwrapHintService(scope);
17835
+ let tools = [];
17836
+ let skills = [];
17837
+ const offs = [
17838
+ hints.source("catalog-tools", { options: () => tools.map((value) => ({ value })) }),
17839
+ hints.source("catalog-skills", { options: () => skills.map((value) => ({ value })) }),
17840
+ hints.source("policies", { options: () => POLICY_NAMES.map((value) => ({ value })) })
17841
+ ];
17842
+ let disposeMount;
17843
+ if (typeof scope.remote.$mount !== "function") return () => {
17844
+ for (const off of offs) off();
17845
+ };
17846
+ scope.remote.$mount(SESSION_MODE_CATALOG_REMOTE).then(async (dispose) => {
17847
+ disposeMount = dispose;
17848
+ const listed = await remoteNamespace(scope, CATALOG_NS)?.list();
17849
+ if (listed?.ok !== true) return;
17850
+ tools = listed.value.tools;
17851
+ skills = listed.value.skills;
17852
+ hints.refresh();
17853
+ }).catch(() => {});
17854
+ return () => {
17855
+ for (const off of offs) off();
17856
+ disposeMount?.();
17857
+ };
17858
+ }, "session-mode: catalog candidates"));
16990
17859
  ctx.inject(["slots", "conversation"], (scope) => {
16991
17860
  scope.effect(() => {
16992
17861
  const seat = scope.slots.register({
@@ -17000,6 +17869,46 @@ window.__ModuleLoader__.load({
17000
17869
  };
17001
17870
  }, "session-mode: composer chip");
17002
17871
  });
17872
+ let refreshPage;
17873
+ let hints;
17874
+ ctx.inject(["schemaFormHints"], (scope) => scope.effect(() => {
17875
+ const service = unwrapHintService(scope);
17876
+ hints = service;
17877
+ const off = service.subscribe(() => {
17878
+ refreshPage?.();
17879
+ });
17880
+ return () => {
17881
+ off();
17882
+ hints = void 0;
17883
+ };
17884
+ }, "session-mode: bundle page candidates"));
17885
+ ctx.inject([
17886
+ "slots",
17887
+ "locale",
17888
+ "configForms",
17889
+ "settingsSchema"
17890
+ ], (scope) => {
17891
+ scope.effect(() => {
17892
+ const { face, refresh, dispose } = createBundleConfigFace(scope, scope.locale.bind(BUNDLE_NS), () => hints);
17893
+ refreshPage = refresh;
17894
+ const bundleDictionary = scope.locale.register(BUNDLE_NS, {
17895
+ zh: bundleZh,
17896
+ en: bundleEn
17897
+ });
17898
+ const off = scope.slots.inject("plugins.bundle.config", () => scope.slots.register({
17899
+ name: "plugins.bundle.config",
17900
+ key: BUNDLE_CONFIG_KEY,
17901
+ locale: BUNDLE_NS,
17902
+ inject: () => face
17903
+ }, BundleConfigPage));
17904
+ return () => {
17905
+ off();
17906
+ bundleDictionary();
17907
+ refreshPage = void 0;
17908
+ dispose();
17909
+ };
17910
+ }, "session-mode: bundle configuration page");
17911
+ });
17003
17912
  }
17004
17913
  //#endregion
17005
17914
  exports.SESSION_MODE_NS = SESSION_MODE_NS;