@sparkelf/dsh-dataops-managed 0.3.12 → 0.3.14

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/lib/client.js CHANGED
@@ -46,7 +46,7 @@ window.__ModuleLoader__.load({
46
46
  /** Route the plugin's Host half serves for model sharing. */
47
47
  const MODEL_SYNC_PATH = "/integrations/dataops/model-sync";
48
48
  /** Narrow a response body to the status shape, rejecting anything else. */
49
- function asStatus(value) {
49
+ function asStatus$1(value) {
50
50
  if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
51
51
  const record = value;
52
52
  if (record.followState !== "following" && record.followState !== "detached") return null;
@@ -86,7 +86,7 @@ window.__ModuleLoader__.load({
86
86
  const response = await fetch(MODEL_SYNC_PATH, { headers: { accept: "application/json" } });
87
87
  if (response.status === 503) return null;
88
88
  if (!response.ok) throw new Error("model sync status failed with HTTP " + String(response.status));
89
- return asStatus(await response.json());
89
+ return asStatus$1(await response.json());
90
90
  }
91
91
  /**
92
92
  * Change what this workspace shares.
@@ -104,11 +104,64 @@ window.__ModuleLoader__.load({
104
104
  });
105
105
  if (response.status === 503) return null;
106
106
  if (!response.ok) throw new Error("model sync action failed with HTTP " + String(response.status));
107
+ return asStatus$1(await response.json());
108
+ }
109
+ //#endregion
110
+ //#region src/client/workspace-limits-client.ts
111
+ /** Same-origin workspace-limits calls from the DataOps settings surface. */
112
+ /** Route the plugin's Host half serves for workspace limits. */
113
+ const WORKSPACE_LIMITS_PATH = "/integrations/dataops/workspace-limits";
114
+ /** Narrow a response body to the status, rejecting anything else. */
115
+ function asStatus(value) {
116
+ if (typeof value !== "object" || value === null || Array.isArray(value)) return null;
117
+ const record = value;
118
+ const limits = record.limits;
119
+ if (typeof limits !== "object" || limits === null) return null;
120
+ const fileReadMaxBytes = limits.fileReadMaxBytes;
121
+ const uploadMaxBytes = limits.uploadMaxBytes;
122
+ if (typeof fileReadMaxBytes !== "number" || typeof uploadMaxBytes !== "number") return null;
123
+ return {
124
+ limits: {
125
+ fileReadMaxBytes,
126
+ uploadMaxBytes
127
+ },
128
+ canWrite: record.canWrite === true,
129
+ readOnlyReason: typeof record.readOnlyReason === "string" ? record.readOnlyReason : null
130
+ };
131
+ }
132
+ function readJson(value) {
133
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
134
+ }
135
+ /**
136
+ * Read the workspace limits the panel shows.
137
+ * @returns The status, or null when the workspace is not connected to DataOps.
138
+ */
139
+ async function fetchWorkspaceLimits() {
140
+ const response = await fetch(WORKSPACE_LIMITS_PATH, { credentials: "same-origin" });
141
+ if (response.status === 503) return null;
142
+ if (!response.ok) throw new Error(`Workspace limits read failed with HTTP ${String(response.status)}`);
107
143
  return asStatus(await response.json());
108
144
  }
145
+ /**
146
+ * Store new workspace limits.
147
+ * @param limits - The ceilings to store.
148
+ * @returns The stored status.
149
+ */
150
+ async function saveWorkspaceLimits(limits) {
151
+ const response = await fetch(WORKSPACE_LIMITS_PATH, {
152
+ method: "POST",
153
+ credentials: "same-origin",
154
+ headers: { "content-type": "application/json" },
155
+ body: JSON.stringify(limits)
156
+ });
157
+ if (response.status === 503) return null;
158
+ if (!response.ok) throw new Error(`Workspace limits write failed with HTTP ${String(response.status)}`);
159
+ const body = readJson(await response.json());
160
+ return body === null ? null : asStatus(body);
161
+ }
109
162
  //#endregion
110
163
  //#region \0dsh-css:/root/projects/dsh-plugins-plus/packages/dataops-managed/src/client/ManagedDataOpsSection.module.css.mjs
111
- const css$2 = "._2dqzjG_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:14px;display:flex}._2dqzjG_title{margin:0;font-size:16px;font-weight:500;line-height:24px}._2dqzjG_statusRow{align-items:center;gap:8px;min-height:24px;font-size:14px;line-height:22px;display:flex}._2dqzjG_description{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}._2dqzjG_details{border-top:1px solid var(--dsw-alias-border-l2);margin:2px 0 0}._2dqzjG_detailRow{border-bottom:1px solid var(--dsw-alias-border-l2);grid-template-columns:minmax(140px,2fr) minmax(0,3fr);gap:20px;padding:12px 0;display:grid}._2dqzjG_detailRow dt,._2dqzjG_detailRow dd{margin:0;font-size:14px;line-height:22px}._2dqzjG_detailRow dt{color:var(--dsw-alias-label-secondary)}._2dqzjG_detailRow dd{color:var(--dsw-alias-label-primary)}._2dqzjG_brandingRow{border-top:1px solid var(--dsw-alias-border-l2);border-bottom:1px solid var(--dsw-alias-border-l2);align-items:center;gap:20px;padding:12px 0;display:flex}._2dqzjG_brandingCopy{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._2dqzjG_brandingCopy strong{font-size:14px;font-weight:500;line-height:22px}._2dqzjG_brandingCopy span{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}._2dqzjG_switch{background:var(--dsw-alias-border-l1);cursor:pointer;border:0;border-radius:10px;flex:none;width:34px;height:20px;padding:0;transition:background-color .12s;position:relative}._2dqzjG_switch>span{background:var(--dsw-alias-bg-base);border-radius:50%;width:14px;height:14px;transition:transform .12s;position:absolute;top:3px;left:3px;box-shadow:0 1px 2px #0003}._2dqzjG_switch[data-checked=true]{background:var(--dsw-alias-state-business-primary)}._2dqzjG_switch[data-checked=true]>span{transform:translate(14px)}._2dqzjG_switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}@media (prefers-reduced-motion:reduce){._2dqzjG_switch,._2dqzjG_switch>span{transition:none}}._2dqzjG_modelPanel{border-top:1px solid var(--dsw-alias-border-l2);border-bottom:1px solid var(--dsw-alias-border-l2);flex-direction:column;gap:10px;padding:12px 0;display:flex}._2dqzjG_modelTitle{margin:0;font-size:14px;font-weight:500;line-height:22px}._2dqzjG_modelDescription{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}._2dqzjG_modelList{flex-direction:column;gap:8px;padding-top:4px;display:flex}._2dqzjG_modelListTitle{font-size:13px;font-weight:500;line-height:20px}._2dqzjG_modelListDescription{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}._2dqzjG_modelRow{align-items:center;gap:16px;min-height:28px;display:flex}._2dqzjG_modelId{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}._2dqzjG_modelAction{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:5px 12px;font-size:13px;line-height:20px}._2dqzjG_modelAction:hover:not(:disabled){background:var(--dsw-alias-bg-hover)}._2dqzjG_modelAction:disabled,._2dqzjG_switch:disabled{cursor:default;opacity:.5}";
164
+ const css$2 = "._2dqzjG_section{max-width:720px;color:var(--dsw-alias-label-primary);flex-direction:column;gap:14px;display:flex}._2dqzjG_title{margin:0;font-size:16px;font-weight:500;line-height:24px}._2dqzjG_statusRow{align-items:center;gap:8px;min-height:24px;font-size:14px;line-height:22px;display:flex}._2dqzjG_description{color:var(--dsw-alias-label-tertiary);margin:0;font-size:14px;line-height:22px}._2dqzjG_details{margin:2px 0 0}._2dqzjG_detailRow{grid-template-columns:minmax(140px,2fr) minmax(0,3fr);gap:20px;padding:12px 0;display:grid}._2dqzjG_detailRow+._2dqzjG_detailRow{border-top:1px solid var(--dsw-alias-border-l2)}._2dqzjG_detailRow dt,._2dqzjG_detailRow dd{margin:0;font-size:14px;line-height:22px}._2dqzjG_detailRow dt{color:var(--dsw-alias-label-secondary)}._2dqzjG_detailRow dd{color:var(--dsw-alias-label-primary)}._2dqzjG_brandingRow{border-top:1px solid var(--dsw-alias-border-l2);align-items:center;gap:20px;padding:14px 0 12px;display:flex}._2dqzjG_brandingCopy{flex-direction:column;flex:1;gap:3px;min-width:0;display:flex}._2dqzjG_brandingCopy strong{font-size:14px;font-weight:500;line-height:22px}._2dqzjG_brandingCopy span{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}._2dqzjG_switch{background:var(--dsw-alias-border-l1);cursor:pointer;border:0;border-radius:10px;flex:none;width:34px;height:20px;padding:0;transition:background-color .12s;position:relative}._2dqzjG_switch>span{background:var(--dsw-alias-bg-base);border-radius:50%;width:14px;height:14px;transition:transform .12s;position:absolute;top:3px;left:3px;box-shadow:0 1px 2px #0003}._2dqzjG_switch[data-checked=true]{background:var(--dsw-alias-state-business-primary)}._2dqzjG_switch[data-checked=true]>span{transform:translate(14px)}._2dqzjG_switch:focus-visible{outline:2px solid var(--dsw-alias-state-business-primary);outline-offset:2px}@media (prefers-reduced-motion:reduce){._2dqzjG_switch,._2dqzjG_switch>span{transition:none}}._2dqzjG_modelPanel{border-top:1px solid var(--dsw-alias-border-l2);flex-direction:column;gap:10px;padding:14px 0 12px;display:flex}._2dqzjG_modelTitle{margin:0;font-size:14px;font-weight:500;line-height:22px}._2dqzjG_modelDescription{color:var(--dsw-alias-label-tertiary);margin:0;font-size:12px;line-height:18px}._2dqzjG_modelList{flex-direction:column;gap:8px;padding-top:4px;display:flex}._2dqzjG_modelListTitle{font-size:13px;font-weight:500;line-height:20px}._2dqzjG_modelListDescription{color:var(--dsw-alias-label-tertiary);font-size:12px;line-height:18px}._2dqzjG_modelRow{align-items:center;gap:16px;min-height:28px;display:flex}._2dqzjG_modelId{min-width:0;color:var(--dsw-alias-label-primary);text-overflow:ellipsis;white-space:nowrap;flex:1;font-size:13px;line-height:20px;overflow:hidden}._2dqzjG_modelAction{border:1px solid var(--dsw-alias-border-l2);color:var(--dsw-alias-label-primary);cursor:pointer;background:0 0;border-radius:6px;flex:none;padding:5px 12px;font-size:13px;line-height:20px}._2dqzjG_modelAction:hover:not(:disabled){background:var(--dsw-alias-bg-hover)}._2dqzjG_modelAction:disabled,._2dqzjG_switch:disabled{cursor:default;opacity:.5}._2dqzjG_limitsInput{border:1px solid var(--dsw-alias-border-l2);width:6rem;color:var(--dsw-alias-label-primary);background:0 0;border-radius:6px;padding:4px 8px;font-size:13px;line-height:20px}";
112
165
  const tagId$2 = "@sparkelf/dsh-dataops-managed/ManagedDataOpsSection.module.css";
113
166
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
114
167
  const tag = document.createElement("style");
@@ -118,23 +171,24 @@ window.__ModuleLoader__.load({
118
171
  document.head.appendChild(tag);
119
172
  }
120
173
  var ManagedDataOpsSection_module_css_default = {
121
- "statusRow": "_2dqzjG_statusRow",
122
- "section": "_2dqzjG_section",
123
- "description": "_2dqzjG_description",
124
- "switch": "_2dqzjG_switch",
125
- "modelId": "_2dqzjG_modelId",
174
+ "brandingCopy": "_2dqzjG_brandingCopy",
126
175
  "modelTitle": "_2dqzjG_modelTitle",
127
- "detailRow": "_2dqzjG_detailRow",
176
+ "details": "_2dqzjG_details",
177
+ "limitsInput": "_2dqzjG_limitsInput",
128
178
  "modelPanel": "_2dqzjG_modelPanel",
129
- "modelListTitle": "_2dqzjG_modelListTitle",
179
+ "section": "_2dqzjG_section",
180
+ "statusRow": "_2dqzjG_statusRow",
181
+ "switch": "_2dqzjG_switch",
182
+ "description": "_2dqzjG_description",
183
+ "modelListDescription": "_2dqzjG_modelListDescription",
184
+ "modelRow": "_2dqzjG_modelRow",
130
185
  "title": "_2dqzjG_title",
131
- "brandingCopy": "_2dqzjG_brandingCopy",
132
- "modelAction": "_2dqzjG_modelAction",
133
186
  "modelList": "_2dqzjG_modelList",
134
- "details": "_2dqzjG_details",
135
187
  "brandingRow": "_2dqzjG_brandingRow",
136
- "modelListDescription": "_2dqzjG_modelListDescription",
137
- "modelRow": "_2dqzjG_modelRow",
188
+ "detailRow": "_2dqzjG_detailRow",
189
+ "modelAction": "_2dqzjG_modelAction",
190
+ "modelId": "_2dqzjG_modelId",
191
+ "modelListTitle": "_2dqzjG_modelListTitle",
138
192
  "modelDescription": "_2dqzjG_modelDescription"
139
193
  };
140
194
  //#endregion
@@ -182,6 +236,7 @@ window.__ModuleLoader__.load({
182
236
  })]
183
237
  }),
184
238
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(PublishDefaults, { t }),
239
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(WorkspaceLimitsPanel, { t }),
185
240
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("dl", {
186
241
  className: ManagedDataOpsSection_module_css_default.details,
187
242
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
@@ -288,6 +343,141 @@ window.__ModuleLoader__.load({
288
343
  ]
289
344
  });
290
345
  }
346
+ /** The panel's unit, so a stored byte count survives a round trip through the input. */
347
+ const BYTES_PER_MIB = 1048576;
348
+ /** Render a byte ceiling as the whole MiB the input shows. */
349
+ function toMib(bytes) {
350
+ return String(Math.round(bytes / BYTES_PER_MIB * 100) / 100);
351
+ }
352
+ /**
353
+ * Read and change the file-size ceilings DataOps enforces on this workspace.
354
+ *
355
+ * The values live in DataOps and are read through the plugin, which holds the JWT; the panel only
356
+ * ever holds what the administrator is allowed to see.
357
+ * @param props - Translate function from the section.
358
+ * @returns The limits panel.
359
+ */
360
+ function WorkspaceLimitsPanel({ t }) {
361
+ const [state, setState] = (0, react.useState)({ kind: "loading" });
362
+ const [fileReadMib, setFileReadMib] = (0, react.useState)("");
363
+ const [uploadMib, setUploadMib] = (0, react.useState)("");
364
+ const [busy, setBusy] = (0, react.useState)(false);
365
+ const apply = (0, react.useCallback)((status) => {
366
+ setState({
367
+ kind: "ready",
368
+ status
369
+ });
370
+ setFileReadMib(toMib(status.limits.fileReadMaxBytes));
371
+ setUploadMib(toMib(status.limits.uploadMaxBytes));
372
+ }, []);
373
+ const refresh = (0, react.useCallback)(async () => {
374
+ try {
375
+ const status = await fetchWorkspaceLimits();
376
+ if (status === null) setState({ kind: "unavailable" });
377
+ else apply(status);
378
+ } catch {
379
+ setState({ kind: "failed" });
380
+ }
381
+ }, [apply]);
382
+ (0, react.useEffect)(() => {
383
+ refresh();
384
+ }, [refresh]);
385
+ const submit = (0, react.useCallback)(async () => {
386
+ const fileReadMaxBytes = Math.round(Number(fileReadMib) * BYTES_PER_MIB);
387
+ const uploadMaxBytes = Math.round(Number(uploadMib) * BYTES_PER_MIB);
388
+ if (!Number.isSafeInteger(fileReadMaxBytes) || fileReadMaxBytes <= 0) return;
389
+ if (!Number.isSafeInteger(uploadMaxBytes) || uploadMaxBytes <= 0) return;
390
+ setBusy(true);
391
+ try {
392
+ const status = await saveWorkspaceLimits({
393
+ fileReadMaxBytes,
394
+ uploadMaxBytes
395
+ });
396
+ if (status === null) setState({ kind: "unavailable" });
397
+ else apply(status);
398
+ } catch {
399
+ setState({ kind: "failed" });
400
+ } finally {
401
+ setBusy(false);
402
+ }
403
+ }, [
404
+ fileReadMib,
405
+ uploadMib,
406
+ apply
407
+ ]);
408
+ if (state.kind === "loading") return null;
409
+ if (state.kind !== "ready") return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
410
+ className: ManagedDataOpsSection_module_css_default.modelPanel,
411
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
412
+ className: ManagedDataOpsSection_module_css_default.modelTitle,
413
+ children: t("limitsTitle")
414
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
415
+ className: ManagedDataOpsSection_module_css_default.modelDescription,
416
+ role: state.kind === "failed" ? "alert" : void 0,
417
+ children: state.kind === "failed" ? t("loadFailed") : t("limitsUnavailable")
418
+ })]
419
+ });
420
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
421
+ className: ManagedDataOpsSection_module_css_default.modelPanel,
422
+ children: [
423
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
424
+ className: ManagedDataOpsSection_module_css_default.modelTitle,
425
+ children: t("limitsTitle")
426
+ }),
427
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
428
+ className: ManagedDataOpsSection_module_css_default.modelDescription,
429
+ children: t("limitsDescription")
430
+ }),
431
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
432
+ className: ManagedDataOpsSection_module_css_default.details,
433
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
434
+ className: ManagedDataOpsSection_module_css_default.detailRow,
435
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("limitsFileReadLabel") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
436
+ className: ManagedDataOpsSection_module_css_default.limitsInput,
437
+ type: "number",
438
+ min: "1",
439
+ step: "1",
440
+ "aria-label": t("limitsFileReadLabel"),
441
+ value: fileReadMib,
442
+ disabled: busy || !state.status.canWrite,
443
+ onChange: (event) => {
444
+ setFileReadMib(event.target.value);
445
+ }
446
+ })]
447
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
448
+ className: ManagedDataOpsSection_module_css_default.detailRow,
449
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: t("limitsUploadLabel") }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
450
+ className: ManagedDataOpsSection_module_css_default.limitsInput,
451
+ type: "number",
452
+ min: "1",
453
+ step: "1",
454
+ "aria-label": t("limitsUploadLabel"),
455
+ value: uploadMib,
456
+ disabled: busy || !state.status.canWrite,
457
+ onChange: (event) => {
458
+ setUploadMib(event.target.value);
459
+ }
460
+ })]
461
+ })]
462
+ }),
463
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
464
+ className: ManagedDataOpsSection_module_css_default.brandingRow,
465
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
466
+ className: ManagedDataOpsSection_module_css_default.modelDescription,
467
+ children: t("limitsUnit")
468
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
469
+ type: "button",
470
+ className: ManagedDataOpsSection_module_css_default.modelAction,
471
+ disabled: busy || !state.status.canWrite,
472
+ onClick: () => {
473
+ submit();
474
+ },
475
+ children: busy ? t("limitsSaving") : t("limitsSave")
476
+ })]
477
+ })
478
+ ]
479
+ });
480
+ }
291
481
  //#endregion
292
482
  //#region src/client/skill-plaza-client.ts
293
483
  /** Same-origin skill plaza calls from the DataOps skill center section. */
@@ -363,27 +553,27 @@ window.__ModuleLoader__.load({
363
553
  }
364
554
  var SkillPlazaSection_module_css_default = {
365
555
  "search": "_9FdZvq_search",
366
- "cards": "_9FdZvq_cards",
367
- "cardMain": "_9FdZvq_cardMain",
556
+ "titleIcon": "_9FdZvq_titleIcon",
368
557
  "cardMarks": "_9FdZvq_cardMarks",
369
- "intro": "_9FdZvq_intro",
370
- "toolbar": "_9FdZvq_toolbar",
371
558
  "emptyText": "_9FdZvq_emptyText",
372
- "notice": "_9FdZvq_notice",
559
+ "cardHead": "_9FdZvq_cardHead",
560
+ "emptyIcon": "_9FdZvq_emptyIcon",
561
+ "toolbar": "_9FdZvq_toolbar",
562
+ "head": "_9FdZvq_head",
563
+ "intro": "_9FdZvq_intro",
373
564
  "section": "_9FdZvq_section",
374
- "card": "_9FdZvq_card",
375
- "cardIcon": "_9FdZvq_cardIcon",
376
565
  "title": "_9FdZvq_title",
377
- "cardDesc": "_9FdZvq_cardDesc",
566
+ "card": "_9FdZvq_card",
378
567
  "tagBar": "_9FdZvq_tagBar",
379
- "cardEnd": "_9FdZvq_cardEnd",
380
- "empty": "_9FdZvq_empty",
381
- "cardHead": "_9FdZvq_cardHead",
568
+ "cards": "_9FdZvq_cards",
569
+ "cardMain": "_9FdZvq_cardMain",
382
570
  "cardTitle": "_9FdZvq_cardTitle",
383
571
  "mine": "_9FdZvq_mine",
384
- "emptyIcon": "_9FdZvq_emptyIcon",
385
- "titleIcon": "_9FdZvq_titleIcon",
386
- "head": "_9FdZvq_head"
572
+ "notice": "_9FdZvq_notice",
573
+ "empty": "_9FdZvq_empty",
574
+ "cardEnd": "_9FdZvq_cardEnd",
575
+ "cardIcon": "_9FdZvq_cardIcon",
576
+ "cardDesc": "_9FdZvq_cardDesc"
387
577
  };
388
578
  //#endregion
389
579
  //#region src/client/SkillPlazaSection.tsx
@@ -635,18 +825,18 @@ window.__ModuleLoader__.load({
635
825
  document.head.appendChild(tag);
636
826
  }
637
827
  var WanxiangBrand_module_css_default = {
828
+ "animatedMark": "s0HPxG_animatedMark",
829
+ "unitRight": "s0HPxG_unitRight",
830
+ "sidebarName": "s0HPxG_sidebarName",
638
831
  "unit-core": "s0HPxG_unit-core",
639
- "unit-top": "s0HPxG_unit-top",
832
+ "unitCore": "s0HPxG_unitCore",
640
833
  "mark": "s0HPxG_mark",
834
+ "harness": "s0HPxG_harness",
835
+ "unit-top": "s0HPxG_unit-top",
641
836
  "unit-right": "s0HPxG_unit-right",
642
- "unit-left": "s0HPxG_unit-left",
643
837
  "unitLeft": "s0HPxG_unitLeft",
644
- "unitRight": "s0HPxG_unitRight",
645
- "sidebarName": "s0HPxG_sidebarName",
646
- "animatedMark": "s0HPxG_animatedMark",
647
- "harness": "s0HPxG_harness",
648
838
  "unitTop": "s0HPxG_unitTop",
649
- "unitCore": "s0HPxG_unitCore"
839
+ "unit-left": "s0HPxG_unit-left"
650
840
  };
651
841
  //#endregion
652
842
  //#region src/client/WanxiangBrand.tsx
@@ -958,7 +1148,15 @@ window.__ModuleLoader__.load({
958
1148
  plazaLoadFailed: "The skill plaza could not be loaded. Try again.",
959
1149
  plazaActionFailed: "The action could not be completed. Try again.",
960
1150
  plazaRetry: "Try again",
961
- plazaRefresh: "Refresh"
1151
+ plazaRefresh: "Refresh",
1152
+ limitsTitle: "Workspace limits",
1153
+ limitsDescription: "The largest files this workspace may read and upload. Set by an administrator in DataOps.",
1154
+ limitsUnavailable: "Workspace limits are available once this workspace is connected to DataOps.",
1155
+ limitsFileReadLabel: "Largest file to read",
1156
+ limitsUploadLabel: "Largest file to upload",
1157
+ limitsUnit: "Units are MiB.",
1158
+ limitsSave: "Save limits",
1159
+ limitsSaving: "Saving…"
962
1160
  };
963
1161
  /** Chinese managed DataOps Settings copy. */
964
1162
  const zh = {
@@ -1000,7 +1198,15 @@ window.__ModuleLoader__.load({
1000
1198
  plazaLoadFailed: "技能广场加载失败,请重试。",
1001
1199
  plazaActionFailed: "操作未完成,请重试。",
1002
1200
  plazaRetry: "重试",
1003
- plazaRefresh: "刷新"
1201
+ plazaRefresh: "刷新",
1202
+ limitsTitle: "工作区限制",
1203
+ limitsDescription: "本工作区可读取与上传的最大文件。由 DataOps 管理员设置。",
1204
+ limitsUnavailable: "工作区连接到 DataOps 后可用。",
1205
+ limitsFileReadLabel: "最大读取文件",
1206
+ limitsUploadLabel: "最大上传文件",
1207
+ limitsUnit: "单位:MiB。",
1208
+ limitsSave: "保存限制",
1209
+ limitsSaving: "保存中…"
1004
1210
  };
1005
1211
  //#endregion
1006
1212
  //#region src/client/index.ts
package/lib/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","names":["useSyncExternalStore","styles","StateDot","useState","useCallback","styles","IconSkillOutlineRegular","Tag","Button","IconDownloadOutlineRegular","IconTrashOutlineRegular","useState","useCallback","IconSparkleRegular","IconRefreshOutlineRegular","Pill","IconShareOutlineRegular","css"],"sources":["../src/client/brand-store.ts","../src/client/model-sync-client.ts","../src/client/ManagedDataOpsSection.tsx","../src/client/skill-plaza-client.ts","../src/client/SkillPlazaSection.tsx","../src/client/WanxiangBrand.tsx","../src/client/install-branding.tsx","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/** Persisted client preference for the managed DataOps shell identity. */\nexport interface WanxiangBrandPreference {\n enabled: boolean\n}\n\n/** Stable local preference key shared by Settings and brand-slot registration. */\nexport const WANXIANG_BRAND_PREFERENCE_KEY = 'dsh.dataops.wanxiangBrand'\n\nfunction initialPreference(): WanxiangBrandPreference {\n if (typeof localStorage === 'undefined') return { enabled: true }\n try {\n const value = JSON.parse(localStorage.getItem(WANXIANG_BRAND_PREFERENCE_KEY) ?? 'null') as unknown\n return typeof value === 'object' && value !== null && 'enabled' in value\n && typeof (value as { enabled?: unknown }).enabled === 'boolean'\n ? { enabled: (value as { enabled: boolean }).enabled }\n : { enabled: true }\n } catch {\n return { enabled: true }\n }\n}\n\nlet preference = initialPreference()\nconst listeners = new Set<() => void>()\n\n/** Observable preference compatible with React's useSyncExternalStore. */\nexport const wanxiangBrandPreference = {\n getSnapshot: (): WanxiangBrandPreference => preference,\n subscribe: (listener: () => void): (() => void) => {\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n },\n}\n\n/** Toggle the Wanxiang shell identity from the DataOps Settings section. */\nexport function setWanxiangBrandEnabled(enabled: boolean): void {\n if (preference.enabled === enabled) return\n preference = { enabled }\n if (typeof localStorage !== 'undefined') {\n try {\n localStorage.setItem(WANXIANG_BRAND_PREFERENCE_KEY, JSON.stringify(preference))\n } catch {\n // Storage failure must not block an in-memory preference change.\n }\n }\n for (const listener of listeners) listener()\n}\n","/** Same-origin model-sync calls from the DataOps settings surface. */\n\n/** Route the plugin's Host half serves for model sharing. */\nexport const MODEL_SYNC_PATH = '/integrations/dataops/model-sync'\n\n/** One model this workspace holds, and whether it is offered to other users. */\nexport interface ModelSyncModel {\n /** Model id as the settings document stores it. */\n id: string\n /** Whether other users may use it. */\n shared: boolean\n}\n\n/** Model sharing as this workspace currently stands. */\nexport interface ModelSyncStatus {\n /** Whether this workspace follows a publisher. */\n followState: 'following' | 'detached'\n /** Whether an administrator currently shares models. */\n publisherSharing: boolean\n /** How many models this workspace adopts from the publisher. */\n adoptedCount: number\n /** Model ids kept private. */\n privateModelIds: string[]\n /** Publication time, when one is sharing. */\n publishedAt: string | null\n /** Whether the current user may change what this workspace shares. */\n canPublish: boolean\n /** Models this workspace holds. */\n models: ModelSyncModel[]\n /**\n * Settings namespaces this deployment distributes.\n *\n * Present with the models in one response, so the two rows describe the same publication.\n */\n sections: DistributedSection[]\n}\n\n/** One settings namespace the deployment distributes. */\nexport interface DistributedSection {\n /** DSH settings namespace, such as `permission`. */\n ns: string\n /** Whether this workspace still takes the publisher's values for it. */\n followState: 'following' | 'detached'\n /** Whether adoption has applied values for it. */\n applied: boolean\n /** Whether a plugin here owns the namespace, so stopping would affect this workspace. */\n mounted: boolean\n}\n\n/** Narrow a response body to the status shape, rejecting anything else. */\nfunction asStatus(value: unknown): ModelSyncStatus | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const record = value as Record<string, unknown>\n if (record.followState !== 'following' && record.followState !== 'detached') return null\n return {\n followState: record.followState,\n publisherSharing: record.publisherSharing === true,\n adoptedCount: typeof record.adoptedCount === 'number' ? record.adoptedCount : 0,\n privateModelIds: Array.isArray(record.privateModelIds)\n ? record.privateModelIds.filter((id): id is string => typeof id === 'string')\n : [],\n publishedAt: typeof record.publishedAt === 'string' ? record.publishedAt : null,\n canPublish: record.canPublish === true,\n models: Array.isArray(record.models)\n ? record.models.flatMap((entry) => {\n if (typeof entry !== 'object' || entry === null) return []\n const model = entry as Record<string, unknown>\n return typeof model.id === 'string' ? [{ id: model.id, shared: model.shared === true }] : []\n })\n : [],\n sections: Array.isArray(record.sections)\n ? record.sections.flatMap((entry): DistributedSection[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return []\n const section = entry as Record<string, unknown>\n if (typeof section.ns !== 'string' || section.ns === '') return []\n return [{\n ns: section.ns,\n followState: section.followState === 'detached' ? 'detached' : 'following',\n applied: section.applied === true,\n mounted: section.mounted === true,\n }]\n })\n : [],\n }\n}\n\n/**\n * Read the current model sharing state.\n * @returns The status, or null when this workspace is not connected to DataOps.\n */\nexport async function fetchModelSyncStatus(): Promise<ModelSyncStatus | null> {\n const response = await fetch(MODEL_SYNC_PATH, { headers: { accept: 'application/json' } })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('model sync status failed with HTTP ' + String(response.status))\n return asStatus(await response.json())\n}\n\n/**\n * Change what this workspace shares.\n * @param body - Action and its parameters.\n * @returns The status after the change, or null when the plugin is not active.\n */\nexport async function postModelSyncAction(body: Record<string, unknown>): Promise<ModelSyncStatus | null> {\n const response = await fetch(MODEL_SYNC_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(body),\n })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('model sync action failed with HTTP ' + String(response.status))\n return asStatus(await response.json())\n}\n","import { useCallback, useEffect, useState, useSyncExternalStore } from 'react'\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { en } from './locales.ts'\nimport { setWanxiangBrandEnabled, wanxiangBrandPreference } from './brand-store.ts'\nimport { MODEL_SYNC_PATH, fetchModelSyncStatus, postModelSyncAction } from './model-sync-client.ts'\nimport type { ModelSyncStatus } from './model-sync-client.ts'\nimport styles from './ManagedDataOpsSection.module.css'\n\n/** Values injected by the DSH Settings slot. */\nexport interface ManagedDataOpsSectionInjected {\n /** Translate one managed DataOps Settings message key. */\n t: (key: keyof typeof en) => string\n}\n\n/** Props accepted by the managed DataOps Settings section. */\nexport type ManagedDataOpsSectionProps = Partial<InjectFace<ManagedDataOpsSectionInjected>>\n\n/**\n * Explain the DataOps-managed JWT and permission owner, and share model configuration.\n * @param props - Settings slot injection values.\n * @returns The localized managed DataOps section, or nothing before injection.\n */\nexport function ManagedDataOpsSection(props: ManagedDataOpsSectionProps) {\n const { t } = props\n const branding = useSyncExternalStore(\n wanxiangBrandPreference.subscribe,\n wanxiangBrandPreference.getSnapshot,\n wanxiangBrandPreference.getSnapshot,\n )\n if (t === undefined) return null\n\n return (\n <section className={styles.section}>\n <h2 className={styles.title}>{t('title')}</h2>\n <div className={styles.statusRow}>\n <StateDot state=\"done\" />\n <strong>{t('managed')}</strong>\n </div>\n <p className={styles.description}>{t('description')}</p>\n <div className={styles.brandingRow}>\n <div className={styles.brandingCopy}>\n <strong>{t('brandingTitle')}</strong>\n <span>{t('brandingDescription')}</span>\n </div>\n <button\n type=\"button\"\n className={styles.switch}\n role=\"switch\"\n aria-label={t('brandingToggle')}\n aria-checked={branding.enabled}\n data-checked={branding.enabled}\n onClick={() => { setWanxiangBrandEnabled(!branding.enabled) }}\n >\n <span />\n </button>\n </div>\n <PublishDefaults t={t} />\n <dl className={styles.details}>\n <div className={styles.detailRow}>\n <dt>{t('identityLabel')}</dt>\n <dd>{t('identityValue')}</dd>\n </div>\n <div className={styles.detailRow}>\n <dt>{t('toolsLabel')}</dt>\n <dd>{t('toolsValue')}</dd>\n </div>\n </dl>\n </section>\n )\n}\n\n\n/** What the publish panel knows about this workspace. */\ntype PublishState =\n | { kind: 'loading' }\n | { kind: 'unavailable' }\n | { kind: 'ready'; status: ModelSyncStatus }\n | { kind: 'failed' }\n\n/**\n * Publish this workspace's configuration as the default other users start from.\n *\n * One action rather than a set of controls: the configuration is whatever this workspace already\n * holds -- the models, the permission default, the general settings -- and the button copies it to\n * DataOps. Every other user's workspace takes that copy as its starting values and may then change\n * anything, at which point their own version wins and this button never reaches it again.\n * @param props - Translate function from the section.\n * @returns The publish row.\n */\nfunction PublishDefaults({ t }: { t: (key: keyof typeof en) => string }) {\n const [state, setState] = useState<PublishState>({ kind: 'loading' })\n const [busy, setBusy] = useState(false)\n\n const refresh = useCallback(async () => {\n try {\n const status = await fetchModelSyncStatus()\n setState(status === null ? { kind: 'unavailable' } : { kind: 'ready', status })\n } catch {\n setState({ kind: 'failed' })\n }\n }, [])\n\n useEffect(() => { void refresh() }, [refresh])\n\n const publish = useCallback(async () => {\n setBusy(true)\n try {\n const status = await postModelSyncAction({ action: 'publish-defaults' })\n if (status !== null) setState({ kind: 'ready', status })\n } catch {\n setState({ kind: 'failed' })\n } finally {\n setBusy(false)\n }\n }, [])\n\n if (state.kind === 'loading') return null\n if (state.kind === 'unavailable' || state.kind === 'failed') {\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription} role={state.kind === 'failed' ? 'alert' : undefined}>\n {state.kind === 'failed' ? t('loadFailed') : t('modelsUnavailable')}\n </p>\n </div>\n )\n }\n\n const { status } = state\n // A viewer DataOps does not authorize to publish sees the same explanation without the button,\n // because the permission rule lives in DataOps and the browser must not restate it.\n if (!status.canPublish) {\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription}>{t('defaultsNotAdmin')}</p>\n </div>\n )\n }\n\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription}>{t('defaultsDescription')}</p>\n <div className={styles.brandingRow}>\n <div className={styles.brandingCopy}>\n <strong>{t('defaultsActionTitle')}</strong>\n <span>\n {status.publishedAt === null\n ? t('defaultsNeverPublished')\n : t('defaultsPublishedAt') + ' ' + status.publishedAt}\n </span>\n </div>\n <button\n type=\"button\"\n className={styles.modelAction}\n disabled={busy}\n onClick={() => { void publish() }}\n >\n {busy ? t('defaultsPublishing') : t('defaultsPublish')}\n </button>\n </div>\n </div>\n )\n}\n\n/** Re-exported so the settings entry can be discovered from the section alone. */\nexport { MODEL_SYNC_PATH }\n","/** Same-origin skill plaza calls from the DataOps skill center section. */\n\n/** Route the plugin's Host half serves for the plaza. */\nexport const SKILL_PLAZA_PATH = '/integrations/dataops/skill-plaza'\n\n/** One plaza entry as the section reads it. */\nexport interface PlazaSkill {\n id: number\n name: string\n description?: string\n instruction: string\n tags: string[]\n sharedByMe: boolean\n updatedAt: string\n}\n\n/** The plaza listing and the tags in use. */\nexport interface PlazaListing {\n skills: PlazaSkill[]\n tags: string[]\n}\n\n/** Narrow an unknown value to a plaza entry. */\nfunction asSkill(value: unknown): PlazaSkill | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record<string, unknown>\n if (typeof row.id !== 'number' || typeof row.name !== 'string') return null\n return {\n id: row.id,\n name: row.name,\n description: typeof row.description === 'string' ? row.description : undefined,\n instruction: typeof row.instruction === 'string' ? row.instruction : '',\n tags: Array.isArray(row.tags) ? row.tags.filter((tag): tag is string => typeof tag === 'string') : [],\n sharedByMe: row.sharedByMe === true,\n updatedAt: typeof row.updatedAt === 'string' ? row.updatedAt : '',\n }\n}\n\n/** Narrow an unknown value to the listing. */\nfunction asListing(value: unknown): PlazaListing | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record<string, unknown>\n const skills = Array.isArray(row.skills) ? row.skills.flatMap((entry) => asSkill(entry) ?? []) : []\n const tags = Array.isArray(row.tags) ? row.tags.filter((tag): tag is string => typeof tag === 'string') : []\n return { skills, tags }\n}\n\n/**\n * Read the plaza.\n * @param filter - Optional tag and text filters.\n * @returns The listing, or null when this workspace is not connected to DataOps.\n */\nexport async function fetchPlaza(filter: { tag?: string; query?: string } = {}): Promise<PlazaListing | null> {\n const params = new URLSearchParams()\n if (filter.tag !== undefined && filter.tag !== '') params.set('tag', filter.tag)\n if (filter.query !== undefined && filter.query !== '') params.set('q', filter.query)\n const suffix = params.size === 0 ? '' : '?' + params.toString()\n const response = await fetch(SKILL_PLAZA_PATH + suffix, { headers: { accept: 'application/json' } })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('skill plaza read failed with HTTP ' + String(response.status))\n return asListing(await response.json())\n}\n\n/**\n * Change the plaza.\n * @param body - Action and its parameters.\n * @returns The parsed reply, or null when the plugin is not active.\n */\nexport async function postPlazaAction(body: Record<string, unknown>): Promise<unknown> {\n const response = await fetch(SKILL_PLAZA_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(body),\n })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('skill plaza action failed with HTTP ' + String(response.status))\n return await response.json()\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n Button,\n IconDownloadOutlineRegular,\n IconRefreshOutlineRegular,\n IconShareOutlineRegular,\n IconSkillOutlineRegular,\n IconSparkleRegular,\n IconTrashOutlineRegular,\n Pill,\n Tag,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { en } from './locales.ts'\nimport { fetchPlaza, postPlazaAction, type PlazaListing, type PlazaSkill } from './skill-plaza-client.ts'\nimport styles from './SkillPlazaSection.module.css'\n\n/** Values the skill center passes to a contributed section. */\nexport interface SkillPlazaSectionInjected {\n /** Translate one DataOps plaza message key. */\n t: (key: keyof typeof en) => string\n}\n\n/** Props accepted by the plaza section. */\nexport type SkillPlazaSectionProps = Partial<InjectFace<SkillPlazaSectionInjected>>\n\n/** What the section currently knows. */\ntype PlazaState =\n | { kind: 'loading' }\n | { kind: 'unavailable' }\n | { kind: 'ready'; listing: PlazaListing }\n | { kind: 'failed' }\n\n/**\n * One plaza row, laid out like the skill center's own rows so the section reads as part of the\n * page rather than a panel bolted onto it.\n * @param props - the row's skill, its actions, and the dictionary resolver.\n * @returns the rendered row.\n */\nfunction PlazaRow({ skill, busy, onInstall, onUnshare, t }: {\n skill: PlazaSkill\n busy: boolean\n onInstall: () => void\n onUnshare: () => void\n t: (key: keyof typeof en) => string\n}): ReactNode {\n return (\n <li className={styles.card}>\n <div className={styles.cardHead}>\n <span className={styles.cardIcon}><IconSkillOutlineRegular size={22} /></span>\n <div className={styles.cardMain}>\n <div className={styles.cardTitle}>\n {skill.name}\n {skill.sharedByMe ? <Tag tone=\"info\" className={styles.mine}>{t('plazaMine')}</Tag> : null}\n </div>\n {skill.description === undefined ? null : (\n <div className={styles.cardDesc}>{skill.description}</div>\n )}\n {skill.tags.length === 0 ? null : (\n <div className={styles.cardMarks}>\n {skill.tags.map((item) => <Tag tone=\"quiet\" key={item}>{item}</Tag>)}\n </div>\n )}\n </div>\n <div className={styles.cardEnd}>\n <Button\n variant=\"outline\"\n size=\"sm\"\n icon={<IconDownloadOutlineRegular size={16} />}\n disabled={busy}\n onClick={onInstall}\n >\n {t('plazaInstall')}\n </Button>\n {skill.sharedByMe ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<IconTrashOutlineRegular size={16} />}\n disabled={busy}\n onClick={onUnshare}\n >\n {t('plazaUnshare')}\n </Button>\n ) : null}\n </div>\n </div>\n </li>\n )\n}\n\n/**\n * Browse, share, and install skills other users published.\n *\n * The section appears only where this plugin is installed: the skill center renders the slot,\n * and an empty slot renders nothing. Every action goes through this plugin's Host route, so a\n * workspace without DataOps never reaches these calls.\n * @param props - Skill center injection values.\n * @returns The plaza section, or nothing before injection.\n */\nexport function SkillPlazaSection(props: SkillPlazaSectionProps): ReactNode {\n const { t } = props\n const [state, setState] = useState<PlazaState>({ kind: 'loading' })\n const [tag, setTag] = useState('')\n const [query, setQuery] = useState('')\n const [busy, setBusy] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n\n const load = useCallback(async (filter: { tag?: string; query?: string }) => {\n try {\n const listing = await fetchPlaza(filter)\n setState(listing === null ? { kind: 'unavailable' } : { kind: 'ready', listing })\n } catch {\n setState({ kind: 'failed' })\n }\n }, [])\n\n useEffect(() => { void load({}) }, [load])\n\n const refresh = useCallback(async (nextTag = tag, nextQuery = query) => {\n await load({ tag: nextTag, query: nextQuery })\n }, [load, tag, query])\n\n const act = useCallback(async (body: Record<string, unknown>, message: string) => {\n setBusy(true)\n setNotice(null)\n try {\n await postPlazaAction(body)\n setNotice(message)\n await refresh()\n } catch {\n setNotice(t === undefined ? null : t('plazaActionFailed'))\n } finally {\n setBusy(false)\n }\n }, [refresh, t])\n\n if (t === undefined) return null\n if (state.kind === 'loading') return null\n\n // The section names itself once; the states below swap only what sits under the heading.\n const head = (\n <div className={styles.head}>\n <h2 className={styles.title}>\n <span className={styles.titleIcon}><IconSparkleRegular size={18} /></span>\n {t('plazaTitle')}\n </h2>\n <p className={styles.intro}>{t('plazaIntro')}</p>\n </div>\n )\n\n if (state.kind === 'unavailable') {\n return <section className={styles.section}>{head}<p className={styles.intro}>{t('plazaUnavailable')}</p></section>\n }\n if (state.kind === 'failed') {\n return (\n <section className={styles.section}>\n {head}\n <div className={styles.empty} role=\"alert\">\n <span className={styles.emptyIcon}><IconSkillOutlineRegular size={28} /></span>\n <p className={styles.emptyText}>{t('plazaLoadFailed')}</p>\n <Button variant=\"outline\" size=\"sm\" icon={<IconRefreshOutlineRegular size={16} />} onClick={() => { void refresh() }}>\n {t('plazaRetry')}\n </Button>\n </div>\n </section>\n )\n }\n\n const { listing } = state\n return (\n <section className={styles.section}>\n {head}\n\n <div className={styles.toolbar}>\n <input\n className={styles.search}\n placeholder={t('plazaSearch')}\n value={query}\n onChange={(event) => {\n const next = event.target.value\n setQuery(next)\n void refresh(tag, next)\n }}\n />\n </div>\n\n {listing.tags.length === 0 ? null : (\n <div className={styles.tagBar}>\n <Pill active={tag === ''} onClick={() => { setTag(''); void refresh('', query) }}>{t('plazaAllTags')}</Pill>\n {listing.tags.map((item) => (\n <Pill key={item} active={tag === item} onClick={() => { setTag(item); void refresh(item, query) }}>\n {item}\n </Pill>\n ))}\n </div>\n )}\n\n {notice === null ? null : <p className={styles.notice}>{notice}</p>}\n\n {listing.skills.length === 0 ? (\n <div className={styles.empty}>\n <span className={styles.emptyIcon}><IconShareOutlineRegular size={28} /></span>\n <p className={styles.emptyText}>{t('plazaEmpty')}</p>\n </div>\n ) : null}\n\n <ul className={styles.cards}>\n {listing.skills.map((skill) => (\n <PlazaRow\n key={skill.id}\n skill={skill}\n busy={busy}\n t={t}\n onInstall={() => { void act({ action: 'install', id: skill.id }, t('plazaInstalled')) }}\n onUnshare={() => { void act({ action: 'unshare', id: skill.id }, t('plazaUnshared')) }}\n />\n ))}\n </ul>\n </section>\n )\n}\n\n/** Re-exported so the registration site reads the route from one place. */\nexport { SKILL_PLAZA_PATH } from './skill-plaza-client.ts'\n","import type { CSSProperties } from 'react'\nimport css from './WanxiangBrand.module.css'\n\nconst WORDMARK_VIEWBOX = \"1.64 115.64 5927.36 933.38\"\nconst WORDMARK_RATIO = 5927.36 / 933.38\nconst WORDMARK_PATHS = [\n {\n \"d\": \"M62 765V691H333C326 434 312 123 34 -24C53 -38 77 -62 89 -82C287 28 361 217 390 414H767C752 147 735 37 705 9C693 -2 681 -4 657 -3C631 -3 558 -3 483 4C498 -17 508 -48 509 -70C578 -74 648 -75 686 -72C724 -70 749 -62 772 -36C811 5 829 126 846 450C847 460 847 487 847 487H399C406 556 409 625 411 691H939V765Z\",\n \"transform\": \"translate(0.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M546 474H850V300H546ZM546 542V710H850V542ZM546 231H850V57H546ZM473 781V-73H546V-12H850V-70H926V781ZM214 840V626H52V554H205C170 416 99 258 29 175C41 157 60 127 68 107C122 176 175 287 214 402V-79H287V378C325 329 370 267 389 234L435 295C413 322 322 429 287 464V554H430V626H287V840Z\",\n \"transform\": \"translate(1002.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M443 821C425 782 393 723 368 688L417 664C443 697 477 747 506 793ZM88 793C114 751 141 696 150 661L207 686C198 722 171 776 143 815ZM410 260C387 208 355 164 317 126C279 145 240 164 203 180C217 204 233 231 247 260ZM110 153C159 134 214 109 264 83C200 37 123 5 41 -14C54 -28 70 -54 77 -72C169 -47 254 -8 326 50C359 30 389 11 412 -6L460 43C437 59 408 77 375 95C428 152 470 222 495 309L454 326L442 323H278L300 375L233 387C226 367 216 345 206 323H70V260H175C154 220 131 183 110 153ZM257 841V654H50V592H234C186 527 109 465 39 435C54 421 71 395 80 378C141 411 207 467 257 526V404H327V540C375 505 436 458 461 435L503 489C479 506 391 562 342 592H531V654H327V841ZM629 832C604 656 559 488 481 383C497 373 526 349 538 337C564 374 586 418 606 467C628 369 657 278 694 199C638 104 560 31 451 -22C465 -37 486 -67 493 -83C595 -28 672 41 731 129C781 44 843 -24 921 -71C933 -52 955 -26 972 -12C888 33 822 106 771 198C824 301 858 426 880 576H948V646H663C677 702 689 761 698 821ZM809 576C793 461 769 361 733 276C695 366 667 468 648 576Z\",\n \"transform\": \"translate(2004.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M484 238V-81H550V-40H858V-77H927V238H734V362H958V427H734V537H923V796H395V494C395 335 386 117 282 -37C299 -45 330 -67 344 -79C427 43 455 213 464 362H663V238ZM468 731H851V603H468ZM468 537H663V427H467L468 494ZM550 22V174H858V22ZM167 839V638H42V568H167V349C115 333 67 319 29 309L49 235L167 273V14C167 0 162 -4 150 -4C138 -5 99 -5 56 -4C65 -24 75 -55 77 -73C140 -74 179 -71 203 -59C228 -48 237 -27 237 14V296L352 334L341 403L237 370V568H350V638H237V839Z\",\n \"transform\": \"translate(3006.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M174 630C213 556 252 459 266 399L337 424C323 482 282 578 242 650ZM755 655C730 582 684 480 646 417L711 396C750 456 797 552 834 633ZM52 348V273H459V-79H537V273H949V348H537V698H893V773H105V698H459V348Z\",\n \"transform\": \"translate(4008.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M179 342V-79H255V-25H741V-77H821V342ZM255 48V270H741V48ZM126 426C165 441 224 443 800 474C825 443 846 414 861 388L925 434C873 518 756 641 658 727L599 687C647 644 699 591 745 540L231 516C320 598 410 701 490 811L415 844C336 720 219 593 183 559C149 526 124 505 101 500C110 480 122 442 126 426Z\",\n \"transform\": \"translate(5010.00 940.00) scale(0.96000 -0.94000)\"\n }\n] as const\nconst HARNESS_PATHS = [\n {\n \"d\": \"M132.848 8.93205H134.08V16.137H132.848V8.93205ZM136.5 8.93205H137.732V16.137H136.5V8.93205ZM133.365 13.024V11.99H137.193V13.024H133.365Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M140.397 14.432L140.672 13.453H143.202L143.532 14.432H140.397ZM140.287 16.137H139.055L141.277 8.93205H142.201L142.146 9.74605L140.947 13.915H140.969L140.287 16.137ZM145.039 16.137H143.741L143.07 13.948L143.081 13.937L141.871 9.74605L141.926 8.93205H142.817L145.039 16.137Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M146.846 8.93205H149.068C149.852 8.93205 150.443 9.11538 150.839 9.48205C151.235 9.84138 151.433 10.3327 151.433 10.956C151.433 11.22 151.396 11.4657 151.323 11.693C151.249 11.9204 151.125 12.1257 150.949 12.309C150.773 12.4924 150.531 12.65 150.223 12.782C149.922 12.9067 149.541 13.0057 149.079 13.079V13.321H146.846V12.639L148.023 12.485C148.631 12.4044 149.09 12.298 149.398 12.166C149.706 12.034 149.915 11.8764 150.025 11.693C150.135 11.5024 150.19 11.2934 150.19 11.066C150.19 10.6994 150.083 10.417 149.871 10.219C149.658 10.021 149.324 9.92205 148.87 9.92205H146.846V8.93205ZM146.395 8.93205H147.627V16.137H146.395V8.93205ZM151.917 16.093V16.137H150.366L149.024 14.322C148.87 14.1094 148.73 13.9407 148.606 13.816C148.481 13.684 148.345 13.5887 148.199 13.53C148.052 13.464 147.872 13.42 147.66 13.398C147.447 13.3687 147.176 13.3504 146.846 13.343V13.145H149.079C149.233 13.211 149.368 13.2844 149.486 13.365C149.61 13.4457 149.735 13.5447 149.86 13.662C149.992 13.7794 150.138 13.937 150.3 14.135L151.917 16.093Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M153.58 9.57005L153.591 8.93205H154.46L157.584 15.51V16.137H156.704L153.58 9.57005ZM158.024 16.137H156.968L156.88 8.93205H158.024V16.137ZM154.24 16.137H153.096V8.93205H154.152L154.24 16.137Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M159.963 8.93205H161.206V16.137H159.963V8.93205ZM160.095 9.96605V8.93205H164.858V9.96605H160.095ZM160.095 16.137V15.103H164.902V16.137H160.095ZM160.095 13.013V11.99H164.374V13.013H160.095Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M169.052 15.257C169.543 15.257 169.895 15.1654 170.108 14.982C170.328 14.7987 170.438 14.5457 170.438 14.223C170.438 14.047 170.405 13.8967 170.339 13.772C170.273 13.6474 170.152 13.5337 169.976 13.431C169.807 13.321 169.558 13.2147 169.228 13.112L168.491 12.881C167.846 12.6757 167.38 12.4044 167.094 12.067C166.808 11.7297 166.665 11.3007 166.665 10.78C166.665 10.428 166.76 10.1017 166.951 9.80105C167.142 9.50038 167.428 9.25838 167.809 9.07505C168.19 8.89172 168.663 8.80005 169.228 8.80005C169.631 8.80005 169.998 8.82938 170.328 8.88805C170.665 8.93938 171.039 9.01638 171.45 9.11905L171.274 10.175C170.834 10.0504 170.442 9.96238 170.097 9.91105C169.76 9.85238 169.463 9.82305 169.206 9.82305C168.737 9.82305 168.403 9.90738 168.205 10.076C168.007 10.2374 167.908 10.439 167.908 10.681C167.908 10.857 167.941 11.0147 168.007 11.154C168.073 11.286 168.19 11.407 168.359 11.517C168.535 11.627 168.784 11.7334 169.107 11.836L169.866 12.078C170.526 12.276 170.995 12.5327 171.274 12.848C171.553 13.156 171.692 13.585 171.692 14.135C171.692 14.5604 171.589 14.9344 171.384 15.257C171.179 15.5797 170.878 15.8327 170.482 16.016C170.093 16.1994 169.609 16.291 169.03 16.291C168.627 16.291 168.212 16.247 167.787 16.159C167.362 16.071 166.9 15.9427 166.401 15.774L166.665 14.718C167.156 14.894 167.6 15.0297 167.996 15.125C168.399 15.213 168.751 15.257 169.052 15.257Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M175.809 15.257C176.3 15.257 176.652 15.1654 176.865 14.982C177.085 14.7987 177.195 14.5457 177.195 14.223C177.195 14.047 177.162 13.8967 177.096 13.772C177.03 13.6474 176.909 13.5337 176.733 13.431C176.564 13.321 176.315 13.2147 175.985 13.112L175.248 12.881C174.603 12.6757 174.137 12.4044 173.851 12.067C173.565 11.7297 173.422 11.3007 173.422 10.78C173.422 10.428 173.517 10.1017 173.708 9.80105C173.899 9.50038 174.185 9.25838 174.566 9.07505C174.947 8.89172 175.42 8.80005 175.985 8.80005C176.388 8.80005 176.755 8.82938 177.085 8.88805C177.422 8.93938 177.796 9.01638 178.207 9.11905L178.031 10.175C177.591 10.0504 177.199 9.96238 176.854 9.91105C176.517 9.85238 176.22 9.82305 175.963 9.82305C175.494 9.82305 175.16 9.90738 174.962 10.076C174.764 10.2374 174.665 10.439 174.665 10.681C174.665 10.857 174.698 11.0147 174.764 11.154C174.83 11.286 174.947 11.407 175.116 11.517C175.292 11.627 175.541 11.7334 175.864 11.836L176.623 12.078C177.283 12.276 177.752 12.5327 178.031 12.848C178.31 13.156 178.449 13.585 178.449 14.135C178.449 14.5604 178.346 14.9344 178.141 15.257C177.936 15.5797 177.635 15.8327 177.239 16.016C176.85 16.1994 176.366 16.291 175.787 16.291C175.384 16.291 174.969 16.247 174.544 16.159C174.119 16.071 173.657 15.9427 173.158 15.774L173.422 14.718C173.913 14.894 174.357 15.0297 174.753 15.125C175.156 15.213 175.508 15.257 175.809 15.257Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n }\n] as const\n\ninterface MarkProps {\n size: number\n className?: string | undefined\n}\n\nfunction classes(...values: Array<string | undefined>): string {\n return values.filter(Boolean).join(' ')\n}\n\nfunction Cube({ transform, className }: { transform: string; className: string }) {\n return (\n <g transform={transform}>\n <g className={className} stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinejoin=\"round\">\n <path d=\"M12 0 24 7 12 14 0 7 12 0Z\" fill=\"none\" />\n <path d=\"M0 7 12 14v16L0 23V7Z\" fill=\"currentColor\" />\n <path d=\"M12 14 24 7v16L12 30V14Z\" fill=\"currentColor\" fillOpacity=\".18\" />\n </g>\n </g>\n )\n}\n\n/** Four linked data units; its ink follows the host surface through currentColor. */\nexport function WanxiangMark({ size, className, animated = false }: MarkProps & { animated?: boolean }) {\n return (\n <svg\n width={size}\n height={(size * 58) / 54}\n className={classes(css.mark, animated ? css.animatedMark : undefined, className)}\n viewBox=\"0 0 54 58\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <Cube className={css.unitTop} transform=\"translate(15 0)\" />\n <Cube className={css.unitLeft} transform=\"translate(0 16)\" />\n <Cube className={css.unitRight} transform=\"translate(30 16)\" />\n <Cube className={css.unitCore} transform=\"translate(15 27)\" />\n </svg>\n )\n}\n\n/** Approved rounded-Heiti artwork, stored as paths with no runtime font dependency. */\nexport function WanxiangWordmark({ height, accessible = false, className }: {\n height: number\n accessible?: boolean\n className?: string | undefined\n}) {\n const accessibility = accessible\n ? { role: 'img', 'aria-label': '万相数据平台' }\n : { 'aria-hidden': true }\n return (\n <svg\n width={height * WORDMARK_RATIO}\n height={height}\n className={className}\n viewBox={WORDMARK_VIEWBOX}\n {...accessibility}\n >\n <g\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"42\"\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n paintOrder=\"stroke fill\"\n >\n {WORDMARK_PATHS.map(path => <path key={path.transform} d={path.d} transform={path.transform} />)}\n </g>\n </svg>\n )\n}\n\n/** Exact HARNESS badge artwork extracted from the current DSH BrandWordmark. */\nexport function HarnessBadge({ height = 14 }: { height?: number }) {\n const style = { '--dsw-alias-label-primary-inverted': 'var(--dsw-alias-bg-base)' } as CSSProperties\n return (\n <svg\n width={(height * 53) / 15.5}\n height={height}\n className={css.harness}\n viewBox=\"129 5 53 15.5\"\n style={style}\n aria-hidden=\"true\"\n >\n <rect x=\"129.348\" y=\"5.5\" width=\"52\" height=\"14\" rx=\"2\" fill=\"currentColor\" />\n {HARNESS_PATHS.map((path, index) => <path key={index} d={path.d} fill={path.fill} />)}\n </svg>\n )\n}\n\n/** Expanded-sidebar brand name plus the unchanged official HARNESS badge. */\nexport function WanxiangSidebarName() {\n return <span className={css.sidebarName}><WanxiangWordmark height={16} /><HarnessBadge height={14} /></span>\n}\n\n/** Welcome-page logo with four-unit hover motion. */\nexport function WanxiangHeroMark({ size, className }: MarkProps) {\n return <WanxiangMark size={size} className={className} animated />\n}\n","import type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { wanxiangBrandPreference } from './brand-store.ts'\nimport {\n WanxiangHeroMark,\n WanxiangMark,\n WanxiangSidebarName,\n} from './WanxiangBrand.tsx'\n\nconst BRAND_TITLE = '万相数据平台 Harness'\nconst SLOT_PRIORITY = -100\nconst FAVICON_ID = 'dataops-wanxiang-favicon'\nconst FAVICON_SVG = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 54 58\"><style>:root{color:#1b1b1d}@media(prefers-color-scheme:dark){:root{color:#f7f7f8}}</style><g transform=\"translate(15 0)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(0 16)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(30 16)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(15 27)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g></svg>`\n\n\nfunction registerWanxiangSlots(ctx: ClientContext): () => void {\n return ctx.slots.inject('sidebar.brand.mark', () =>\n ctx.slots.inject('sidebar.brand.name', () =>\n ctx.slots.inject('conversation.hero.brand.mark', function* () {\n yield ctx.slots.register({\n name: 'sidebar.brand.mark',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangMark)\n yield ctx.slots.register({\n name: 'sidebar.brand.name',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangSidebarName)\n yield ctx.slots.register({\n name: 'conversation.hero.brand.mark',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangHeroMark)\n })))\n}\n\nfunction installFavicon(): HTMLLinkElement {\n const existing = document.getElementById(FAVICON_ID)\n if (existing instanceof HTMLLinkElement) return existing\n const link = document.createElement('link')\n link.id = FAVICON_ID\n link.rel = 'icon'\n link.type = 'image/svg+xml'\n link.href = `data:image/svg+xml,${encodeURIComponent(FAVICON_SVG)}`\n document.head.append(link)\n return link\n}\n\n/** Keep shell slots, browser title, and favicon on the same persisted preference. */\nexport function installWanxiangBranding(ctx: ClientContext): void {\n const originalTitle = document.title\n let disposeSlots: (() => void) | undefined\n let favicon: HTMLLinkElement | undefined\n let titleObserver: MutationObserver | undefined\n\n const stopTitleObserver = (): void => {\n titleObserver?.disconnect()\n titleObserver = undefined\n }\n const keepBrandTitle = (): void => {\n if (document.title !== BRAND_TITLE) document.title = BRAND_TITLE\n if (titleObserver !== undefined) return\n titleObserver = new MutationObserver(() => {\n if (wanxiangBrandPreference.getSnapshot().enabled && document.title !== BRAND_TITLE) {\n document.title = BRAND_TITLE\n }\n })\n titleObserver.observe(document.head, { childList: true, subtree: true, characterData: true })\n }\n\n const synchronize = (): void => {\n const enabled = wanxiangBrandPreference.getSnapshot().enabled\n if (enabled) {\n disposeSlots ??= registerWanxiangSlots(ctx)\n favicon ??= installFavicon()\n keepBrandTitle()\n document.documentElement.dataset.dataopsBrand = 'wanxiang'\n return\n }\n disposeSlots?.()\n disposeSlots = undefined\n favicon?.remove()\n favicon = undefined\n stopTitleObserver()\n document.title = originalTitle\n delete document.documentElement.dataset.dataopsBrand\n }\n\n ctx.effect(() => {\n synchronize()\n const unsubscribe = wanxiangBrandPreference.subscribe(synchronize)\n return () => {\n unsubscribe()\n disposeSlots?.()\n favicon?.remove()\n stopTitleObserver()\n document.title = originalTitle\n delete document.documentElement.dataset.dataopsBrand\n }\n }, 'dataops-managed: Wanxiang shell branding')\n}\n","/** English managed DataOps Settings copy. */\nexport const en = {\n nav: 'DataOps',\n title: 'DataOps',\n managed: 'Managed by this DataOps workspace',\n description: 'DSH uses your current DataOps session JWT. DataOps applies its role and resource permissions to every tool request.',\n identityLabel: 'Identity and permissions',\n identityValue: 'Current DataOps JWT',\n toolsLabel: 'DataOps tools',\n toolsValue: 'Authorized by DataOps on every request',\n brandingTitle: 'Apply Wanxiang branding',\n brandingDescription: 'Use the Wanxiang Data Platform identity in navigation, the New Session welcome view, browser title, and favicon.',\n brandingToggle: 'Apply Wanxiang branding',\n modelsTitle: 'Model configuration',\n modelsDescription: 'Share the models configured here with other users, and choose which of them they may use.',\n modelsUnavailable: 'Model configuration is unavailable until this workspace is connected to DataOps.',\n defaultsTitle: 'Default configuration',\n defaultsDescription: 'Publish the configuration this workspace holds — models, permissions, and general settings — as the values other users start from. Their workspace takes that copy once and may then change anything, and a change they make is never overwritten.',\n defaultsActionTitle: 'Publish as the default',\n defaultsNotAdmin: 'Only an administrator may publish the default configuration.',\n defaultsNeverPublished: 'Not published yet.',\n defaultsPublishedAt: 'Last published:',\n defaultsPublish: 'Publish default configuration',\n defaultsPublishing: 'Publishing…',\n loadFailed: 'The model configuration could not be loaded. Try again.',\n plazaTitle: 'Skill plaza',\n plazaIntro: 'Skills other users shared. Install one to use it in this workspace, or share a skill of your own.',\n plazaSearch: 'Search skills',\n plazaTagFilter: 'Filter by tag',\n plazaAllTags: 'All tags',\n plazaMine: 'Shared by me',\n plazaInstall: 'Install',\n plazaInstalled: 'Installed. It is now in your skill list.',\n plazaUnshare: 'Stop sharing',\n plazaUnshared: 'Removed from the plaza. Users who installed it keep their copy.',\n plazaEmpty: 'No skills have been shared yet.',\n plazaUnavailable: 'The skill plaza is available once this workspace is connected to DataOps.',\n plazaLoadFailed: 'The skill plaza could not be loaded. Try again.',\n plazaActionFailed: 'The action could not be completed. Try again.',\n plazaRetry: 'Try again',\n plazaRefresh: 'Refresh',\n} as const\n\n/** Stable key set shared by every managed DataOps locale. */\nexport type ManagedDataOpsKey = keyof typeof en\n\n/** Chinese managed DataOps Settings copy. */\nexport const zh: Record<ManagedDataOpsKey, string> = {\n nav: 'DataOps',\n title: 'DataOps',\n managed: '由当前 DataOps 工作区托管',\n description: 'DSH 使用当前 DataOps 会话 JWT;DataOps 对每次工具请求应用角色与资源权限。',\n identityLabel: '身份与权限',\n identityValue: '当前 DataOps JWT',\n toolsLabel: 'DataOps 工具',\n toolsValue: '每次请求均由 DataOps 授权',\n brandingTitle: '应用万相品牌',\n brandingDescription: '在导航、新会话欢迎页、浏览器标题和图标中使用万相数据平台品牌。',\n brandingToggle: '应用万相品牌',\n modelsTitle: '模型配置共享',\n modelsDescription: '把这里配置的模型共享给其他用户,并决定他们可以使用其中哪些。',\n modelsUnavailable: '工作区接入 DataOps 后即可使用模型配置共享。',\n defaultsTitle: '默认配置',\n defaultsDescription: '把本工作区当前的配置(模型、权限、通用设置)发布为其他用户的初始值。对方工作区只取用一次,之后可以随意修改,改过的内容不会被覆盖。',\n defaultsActionTitle: '发布为默认值',\n defaultsNotAdmin: '只有管理员可以发布默认配置。',\n defaultsNeverPublished: '尚未发布。',\n defaultsPublishedAt: '上次发布:',\n defaultsPublish: '发布默认配置',\n defaultsPublishing: '发布中…',\n loadFailed: '模型配置加载失败,请重试。',\n plazaTitle: '技能广场',\n plazaIntro: '其他用户共享的技能。装载后即可在本工作区使用,也可以把自己的技能共享出去。',\n plazaSearch: '搜索技能',\n plazaTagFilter: '按标签筛选',\n plazaAllTags: '全部标签',\n plazaMine: '我共享的',\n plazaInstall: '装载',\n plazaInstalled: '已装载,可在技能列表中使用。',\n plazaUnshare: '取消共享',\n plazaUnshared: '已从广场移除;已装载的用户保留其副本。',\n plazaEmpty: '还没有人共享技能。',\n plazaUnavailable: '工作区接入 DataOps 后即可使用技能广场。',\n plazaLoadFailed: '技能广场加载失败,请重试。',\n plazaActionFailed: '操作未完成,请重试。',\n plazaRetry: '重试',\n plazaRefresh: '刷新',\n}\n","import type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the skill center's slot declaration so this plugin can contribute to it.\nimport type {} from '@sparkelf/dsh-client-ui-skill-center/client'\nimport { ManagedDataOpsSection } from './ManagedDataOpsSection.tsx'\nimport { SkillPlazaSection } from './SkillPlazaSection.tsx'\nimport { installWanxiangBranding } from './install-branding.tsx'\nimport type { ManagedDataOpsSectionInjected } from './ManagedDataOpsSection.tsx'\nimport { en, zh, type ManagedDataOpsKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'settings.dataops-managed': ManagedDataOpsKey\n }\n}\n\nconst NS = 'settings.dataops-managed'\nconst AUTH_UPDATED_MESSAGE = 'dataops-auth-updated'\nconst MANAGED_AUTH_PATH = '/integrations/dataops/managed-auth'\n\n/** Required client services for the managed DataOps Settings section. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Register localized managed DataOps Settings navigation and content.\n * @param ctx - DSH client context with locale and settings slots.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dataops-managed: settings copy')\n installWanxiangBranding(ctx)\n const t = ctx.locale.bind(NS) as ManagedDataOpsSectionInjected['t']\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'dataops',\n order: 25,\n label: () => t('nav'),\n inject: () => ({ t }),\n }, ManagedDataOpsSection))\n\n /**\n * The skill plaza, contributed to the skill center page.\n *\n * The skill center declares the slot and renders whatever it holds; a profile without this\n * plugin leaves it empty, which is what keeps the plaza out of a deployment that never\n * installed DataOps.\n */\n ctx.slots.inject('skill-center.section', () => ctx.slots.register({\n name: 'skill-center.section',\n id: 'dataops-plaza',\n order: 10,\n inject: () => ({ t }),\n }, SkillPlazaSection))\n\n const synchronizeJwt = async (): Promise<void> => {\n const response = await fetch(new URL(MANAGED_AUTH_PATH, window.location.origin), {\n method: 'POST',\n credentials: 'same-origin',\n })\n if (!response.ok) throw new Error(`DataOps managed JWT synchronization failed with HTTP ${String(response.status)}`)\n }\n const onMessage = (event: MessageEvent<unknown>): void => {\n if (event.source !== window.parent\n || (event.data as { type?: unknown } | null)?.type !== AUTH_UPDATED_MESSAGE) return\n void synchronizeJwt().catch(error => console.error('dataops-managed.jwt_sync_failed', error))\n }\n ctx.effect(() => {\n window.addEventListener('message', onMessage)\n void synchronizeJwt().catch(error => console.error('dataops-managed.jwt_sync_failed', error))\n return () => window.removeEventListener('message', onMessage)\n }, 'dataops-managed: JWT synchronization')\n}\n"],"mappings":";;;;;;;;;;;EAMA,MAAa,gCAAgC;EAE7C,SAAS,oBAA6C;GACpD,IAAI,OAAO,iBAAiB,aAAa,OAAO,EAAE,SAAS,KAAK;GAChE,IAAI;IACF,MAAM,QAAQ,KAAK,MAAM,aAAa,QAAA,2BAAqC,KAAK,MAAM;IACtF,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAC9D,OAAQ,MAAgC,YAAY,YACrD,EAAE,SAAU,MAA+B,QAAQ,IACnD,EAAE,SAAS,KAAK;GACtB,QAAQ;IACN,OAAO,EAAE,SAAS,KAAK;GACzB;EACF;EAEA,IAAI,aAAa,kBAAkB;EACnC,MAAM,4BAAY,IAAI,IAAgB;;EAGtC,MAAa,0BAA0B;GACrC,mBAA4C;GAC5C,YAAY,aAAuC;IACjD,UAAU,IAAI,QAAQ;IACtB,aAAa;KAAE,UAAU,OAAO,QAAQ;IAA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;IACpB,eAAe,EAAE,EAAE;GACrB,GAAG,qBAAqB,CAAC;;;;;;;;GASzB,IAAI,MAAM,OAAO,8BAA8B,IAAI,MAAM,SAAS;IAChE,MAAM;IACN,IAAI;IACJ,OAAO;IACP,eAAe,EAAE,EAAE;GACrB,GAAG,iBAAiB,CAAC;GAErB,MAAM,iBAAiB,YAA2B;IAChD,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI,mBAAmB,OAAO,SAAS,MAAM,GAAG;KAC/E,QAAQ;KACR,aAAa;IACf,CAAC;IACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,wDAAwD,OAAO,SAAS,MAAM,GAAG;GACrH;GACA,MAAM,aAAa,UAAuC;IACxD,IAAI,MAAM,WAAW,OAAO,UACtB,MAAM,MAAoC,SAAS,sBAAsB;IAC/E,eAAoB,CAAC,CAAC,OAAM,UAAS,QAAQ,MAAM,mCAAmC,KAAK,CAAC;GAC9F;GACA,IAAI,aAAa;IACf,OAAO,iBAAiB,WAAW,SAAS;IAC5C,eAAoB,CAAC,CAAC,OAAM,UAAS,QAAQ,MAAM,mCAAmC,KAAK,CAAC;IAC5F,aAAa,OAAO,oBAAoB,WAAW,SAAS;GAC9D,GAAG,sCAAsC;EAC3C"}
1
+ {"version":3,"file":"client.js","names":["asStatus","useSyncExternalStore","styles","StateDot","useState","useCallback","styles","IconSkillOutlineRegular","Tag","Button","IconDownloadOutlineRegular","IconTrashOutlineRegular","useState","useCallback","IconSparkleRegular","IconRefreshOutlineRegular","Pill","IconShareOutlineRegular","css"],"sources":["../src/client/brand-store.ts","../src/client/model-sync-client.ts","../src/client/workspace-limits-client.ts","../src/client/ManagedDataOpsSection.tsx","../src/client/skill-plaza-client.ts","../src/client/SkillPlazaSection.tsx","../src/client/WanxiangBrand.tsx","../src/client/install-branding.tsx","../src/client/locales.ts","../src/client/index.ts"],"sourcesContent":["/** Persisted client preference for the managed DataOps shell identity. */\nexport interface WanxiangBrandPreference {\n enabled: boolean\n}\n\n/** Stable local preference key shared by Settings and brand-slot registration. */\nexport const WANXIANG_BRAND_PREFERENCE_KEY = 'dsh.dataops.wanxiangBrand'\n\nfunction initialPreference(): WanxiangBrandPreference {\n if (typeof localStorage === 'undefined') return { enabled: true }\n try {\n const value = JSON.parse(localStorage.getItem(WANXIANG_BRAND_PREFERENCE_KEY) ?? 'null') as unknown\n return typeof value === 'object' && value !== null && 'enabled' in value\n && typeof (value as { enabled?: unknown }).enabled === 'boolean'\n ? { enabled: (value as { enabled: boolean }).enabled }\n : { enabled: true }\n } catch {\n return { enabled: true }\n }\n}\n\nlet preference = initialPreference()\nconst listeners = new Set<() => void>()\n\n/** Observable preference compatible with React's useSyncExternalStore. */\nexport const wanxiangBrandPreference = {\n getSnapshot: (): WanxiangBrandPreference => preference,\n subscribe: (listener: () => void): (() => void) => {\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n },\n}\n\n/** Toggle the Wanxiang shell identity from the DataOps Settings section. */\nexport function setWanxiangBrandEnabled(enabled: boolean): void {\n if (preference.enabled === enabled) return\n preference = { enabled }\n if (typeof localStorage !== 'undefined') {\n try {\n localStorage.setItem(WANXIANG_BRAND_PREFERENCE_KEY, JSON.stringify(preference))\n } catch {\n // Storage failure must not block an in-memory preference change.\n }\n }\n for (const listener of listeners) listener()\n}\n","/** Same-origin model-sync calls from the DataOps settings surface. */\n\n/** Route the plugin's Host half serves for model sharing. */\nexport const MODEL_SYNC_PATH = '/integrations/dataops/model-sync'\n\n/** One model this workspace holds, and whether it is offered to other users. */\nexport interface ModelSyncModel {\n /** Model id as the settings document stores it. */\n id: string\n /** Whether other users may use it. */\n shared: boolean\n}\n\n/** Model sharing as this workspace currently stands. */\nexport interface ModelSyncStatus {\n /** Whether this workspace follows a publisher. */\n followState: 'following' | 'detached'\n /** Whether an administrator currently shares models. */\n publisherSharing: boolean\n /** How many models this workspace adopts from the publisher. */\n adoptedCount: number\n /** Model ids kept private. */\n privateModelIds: string[]\n /** Publication time, when one is sharing. */\n publishedAt: string | null\n /** Whether the current user may change what this workspace shares. */\n canPublish: boolean\n /** Models this workspace holds. */\n models: ModelSyncModel[]\n /**\n * Settings namespaces this deployment distributes.\n *\n * Present with the models in one response, so the two rows describe the same publication.\n */\n sections: DistributedSection[]\n}\n\n/** One settings namespace the deployment distributes. */\nexport interface DistributedSection {\n /** DSH settings namespace, such as `permission`. */\n ns: string\n /** Whether this workspace still takes the publisher's values for it. */\n followState: 'following' | 'detached'\n /** Whether adoption has applied values for it. */\n applied: boolean\n /** Whether a plugin here owns the namespace, so stopping would affect this workspace. */\n mounted: boolean\n}\n\n/** Narrow a response body to the status shape, rejecting anything else. */\nfunction asStatus(value: unknown): ModelSyncStatus | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const record = value as Record<string, unknown>\n if (record.followState !== 'following' && record.followState !== 'detached') return null\n return {\n followState: record.followState,\n publisherSharing: record.publisherSharing === true,\n adoptedCount: typeof record.adoptedCount === 'number' ? record.adoptedCount : 0,\n privateModelIds: Array.isArray(record.privateModelIds)\n ? record.privateModelIds.filter((id): id is string => typeof id === 'string')\n : [],\n publishedAt: typeof record.publishedAt === 'string' ? record.publishedAt : null,\n canPublish: record.canPublish === true,\n models: Array.isArray(record.models)\n ? record.models.flatMap((entry) => {\n if (typeof entry !== 'object' || entry === null) return []\n const model = entry as Record<string, unknown>\n return typeof model.id === 'string' ? [{ id: model.id, shared: model.shared === true }] : []\n })\n : [],\n sections: Array.isArray(record.sections)\n ? record.sections.flatMap((entry): DistributedSection[] => {\n if (typeof entry !== 'object' || entry === null || Array.isArray(entry)) return []\n const section = entry as Record<string, unknown>\n if (typeof section.ns !== 'string' || section.ns === '') return []\n return [{\n ns: section.ns,\n followState: section.followState === 'detached' ? 'detached' : 'following',\n applied: section.applied === true,\n mounted: section.mounted === true,\n }]\n })\n : [],\n }\n}\n\n/**\n * Read the current model sharing state.\n * @returns The status, or null when this workspace is not connected to DataOps.\n */\nexport async function fetchModelSyncStatus(): Promise<ModelSyncStatus | null> {\n const response = await fetch(MODEL_SYNC_PATH, { headers: { accept: 'application/json' } })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('model sync status failed with HTTP ' + String(response.status))\n return asStatus(await response.json())\n}\n\n/**\n * Change what this workspace shares.\n * @param body - Action and its parameters.\n * @returns The status after the change, or null when the plugin is not active.\n */\nexport async function postModelSyncAction(body: Record<string, unknown>): Promise<ModelSyncStatus | null> {\n const response = await fetch(MODEL_SYNC_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(body),\n })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('model sync action failed with HTTP ' + String(response.status))\n return asStatus(await response.json())\n}\n","/** Same-origin workspace-limits calls from the DataOps settings surface. */\n\n/** Route the plugin's Host half serves for workspace limits. */\nexport const WORKSPACE_LIMITS_PATH = '/integrations/dataops/workspace-limits'\n\n/** The two byte ceilings, as the panel edits them. */\nexport interface WorkspaceLimits {\n /** Largest file a sidebar download or agent read may carry. */\n fileReadMaxBytes: number\n /** Largest file an upload may carry. */\n uploadMaxBytes: number\n}\n\n/** Limits as this workspace currently holds them. */\nexport interface WorkspaceLimitsStatus {\n limits: WorkspaceLimits\n canWrite: boolean\n readOnlyReason: string | null\n}\n\n/** Narrow a response body to the status, rejecting anything else. */\nfunction asStatus(value: unknown): WorkspaceLimitsStatus | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const record = value as Record<string, unknown>\n const limits = record.limits as Record<string, unknown> | undefined\n if (typeof limits !== 'object' || limits === null) return null\n const fileReadMaxBytes = limits.fileReadMaxBytes\n const uploadMaxBytes = limits.uploadMaxBytes\n if (typeof fileReadMaxBytes !== 'number' || typeof uploadMaxBytes !== 'number') return null\n return {\n limits: { fileReadMaxBytes, uploadMaxBytes },\n canWrite: record.canWrite === true,\n readOnlyReason: typeof record.readOnlyReason === 'string' ? record.readOnlyReason : null,\n }\n}\n\nfunction readJson(value: unknown): Record<string, unknown> | null {\n return typeof value === 'object' && value !== null && !Array.isArray(value)\n ? value as Record<string, unknown>\n : null\n}\n\n/**\n * Read the workspace limits the panel shows.\n * @returns The status, or null when the workspace is not connected to DataOps.\n */\nexport async function fetchWorkspaceLimits(): Promise<WorkspaceLimitsStatus | null> {\n const response = await fetch(WORKSPACE_LIMITS_PATH, { credentials: 'same-origin' })\n if (response.status === 503) return null\n if (!response.ok) throw new Error(`Workspace limits read failed with HTTP ${String(response.status)}`)\n return asStatus(await response.json())\n}\n\n/**\n * Store new workspace limits.\n * @param limits - The ceilings to store.\n * @returns The stored status.\n */\nexport async function saveWorkspaceLimits(limits: WorkspaceLimits): Promise<WorkspaceLimitsStatus | null> {\n const response = await fetch(WORKSPACE_LIMITS_PATH, {\n method: 'POST',\n credentials: 'same-origin',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(limits),\n })\n if (response.status === 503) return null\n if (!response.ok) throw new Error(`Workspace limits write failed with HTTP ${String(response.status)}`)\n const body = readJson(await response.json())\n return body === null ? null : asStatus(body)\n}","import { useCallback, useEffect, useState, useSyncExternalStore } from 'react'\nimport { StateDot } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { en } from './locales.ts'\nimport { setWanxiangBrandEnabled, wanxiangBrandPreference } from './brand-store.ts'\nimport { MODEL_SYNC_PATH, fetchModelSyncStatus, postModelSyncAction } from './model-sync-client.ts'\nimport type { ModelSyncStatus } from './model-sync-client.ts'\nimport { fetchWorkspaceLimits, saveWorkspaceLimits } from './workspace-limits-client.ts'\nimport type { WorkspaceLimits, WorkspaceLimitsStatus } from './workspace-limits-client.ts'\nimport styles from './ManagedDataOpsSection.module.css'\n\n/** Values injected by the DSH Settings slot. */\nexport interface ManagedDataOpsSectionInjected {\n /** Translate one managed DataOps Settings message key. */\n t: (key: keyof typeof en) => string\n}\n\n/** Props accepted by the managed DataOps Settings section. */\nexport type ManagedDataOpsSectionProps = Partial<InjectFace<ManagedDataOpsSectionInjected>>\n\n/**\n * Explain the DataOps-managed JWT and permission owner, and share model configuration.\n * @param props - Settings slot injection values.\n * @returns The localized managed DataOps section, or nothing before injection.\n */\nexport function ManagedDataOpsSection(props: ManagedDataOpsSectionProps) {\n const { t } = props\n const branding = useSyncExternalStore(\n wanxiangBrandPreference.subscribe,\n wanxiangBrandPreference.getSnapshot,\n wanxiangBrandPreference.getSnapshot,\n )\n if (t === undefined) return null\n\n return (\n <section className={styles.section}>\n <h2 className={styles.title}>{t('title')}</h2>\n <div className={styles.statusRow}>\n <StateDot state=\"done\" />\n <strong>{t('managed')}</strong>\n </div>\n <p className={styles.description}>{t('description')}</p>\n <div className={styles.brandingRow}>\n <div className={styles.brandingCopy}>\n <strong>{t('brandingTitle')}</strong>\n <span>{t('brandingDescription')}</span>\n </div>\n <button\n type=\"button\"\n className={styles.switch}\n role=\"switch\"\n aria-label={t('brandingToggle')}\n aria-checked={branding.enabled}\n data-checked={branding.enabled}\n onClick={() => { setWanxiangBrandEnabled(!branding.enabled) }}\n >\n <span />\n </button>\n </div>\n <PublishDefaults t={t} />\n <WorkspaceLimitsPanel t={t} />\n <dl className={styles.details}>\n <div className={styles.detailRow}>\n <dt>{t('identityLabel')}</dt>\n <dd>{t('identityValue')}</dd>\n </div>\n <div className={styles.detailRow}>\n <dt>{t('toolsLabel')}</dt>\n <dd>{t('toolsValue')}</dd>\n </div>\n </dl>\n </section>\n )\n}\n\n\n/** What the publish panel knows about this workspace. */\ntype PublishState =\n | { kind: 'loading' }\n | { kind: 'unavailable' }\n | { kind: 'ready'; status: ModelSyncStatus }\n | { kind: 'failed' }\n\n/**\n * Publish this workspace's configuration as the default other users start from.\n *\n * One action rather than a set of controls: the configuration is whatever this workspace already\n * holds -- the models, the permission default, the general settings -- and the button copies it to\n * DataOps. Every other user's workspace takes that copy as its starting values and may then change\n * anything, at which point their own version wins and this button never reaches it again.\n * @param props - Translate function from the section.\n * @returns The publish row.\n */\nfunction PublishDefaults({ t }: { t: (key: keyof typeof en) => string }) {\n const [state, setState] = useState<PublishState>({ kind: 'loading' })\n const [busy, setBusy] = useState(false)\n\n const refresh = useCallback(async () => {\n try {\n const status = await fetchModelSyncStatus()\n setState(status === null ? { kind: 'unavailable' } : { kind: 'ready', status })\n } catch {\n setState({ kind: 'failed' })\n }\n }, [])\n\n useEffect(() => { void refresh() }, [refresh])\n\n const publish = useCallback(async () => {\n setBusy(true)\n try {\n const status = await postModelSyncAction({ action: 'publish-defaults' })\n if (status !== null) setState({ kind: 'ready', status })\n } catch {\n setState({ kind: 'failed' })\n } finally {\n setBusy(false)\n }\n }, [])\n\n if (state.kind === 'loading') return null\n if (state.kind === 'unavailable' || state.kind === 'failed') {\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription} role={state.kind === 'failed' ? 'alert' : undefined}>\n {state.kind === 'failed' ? t('loadFailed') : t('modelsUnavailable')}\n </p>\n </div>\n )\n }\n\n const { status } = state\n // A viewer DataOps does not authorize to publish sees the same explanation without the button,\n // because the permission rule lives in DataOps and the browser must not restate it.\n if (!status.canPublish) {\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription}>{t('defaultsNotAdmin')}</p>\n </div>\n )\n }\n\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('defaultsTitle')}</h3>\n <p className={styles.modelDescription}>{t('defaultsDescription')}</p>\n <div className={styles.brandingRow}>\n <div className={styles.brandingCopy}>\n <strong>{t('defaultsActionTitle')}</strong>\n <span>\n {status.publishedAt === null\n ? t('defaultsNeverPublished')\n : t('defaultsPublishedAt') + ' ' + status.publishedAt}\n </span>\n </div>\n <button\n type=\"button\"\n className={styles.modelAction}\n disabled={busy}\n onClick={() => { void publish() }}\n >\n {busy ? t('defaultsPublishing') : t('defaultsPublish')}\n </button>\n </div>\n </div>\n )\n}\n\n/** What the limits panel knows. */\ntype LimitsState =\n | { kind: 'loading' }\n | { kind: 'unavailable' }\n | { kind: 'ready'; status: WorkspaceLimitsStatus }\n | { kind: 'failed' }\n\n/** The panel's unit, so a stored byte count survives a round trip through the input. */\nconst BYTES_PER_MIB = 1024 * 1024\n\n/** Render a byte ceiling as the whole MiB the input shows. */\nfunction toMib(bytes: number): string {\n return String(Math.round((bytes / BYTES_PER_MIB) * 100) / 100)\n}\n\n/**\n * Read and change the file-size ceilings DataOps enforces on this workspace.\n *\n * The values live in DataOps and are read through the plugin, which holds the JWT; the panel only\n * ever holds what the administrator is allowed to see.\n * @param props - Translate function from the section.\n * @returns The limits panel.\n */\nfunction WorkspaceLimitsPanel({ t }: { t: (key: keyof typeof en) => string }) {\n const [state, setState] = useState<LimitsState>({ kind: 'loading' })\n const [fileReadMib, setFileReadMib] = useState('')\n const [uploadMib, setUploadMib] = useState('')\n const [busy, setBusy] = useState(false)\n\n const apply = useCallback((status: WorkspaceLimitsStatus) => {\n setState({ kind: 'ready', status })\n setFileReadMib(toMib(status.limits.fileReadMaxBytes))\n setUploadMib(toMib(status.limits.uploadMaxBytes))\n }, [])\n\n const refresh = useCallback(async () => {\n try {\n const status = await fetchWorkspaceLimits()\n if (status === null) setState({ kind: 'unavailable' })\n else apply(status)\n } catch {\n setState({ kind: 'failed' })\n }\n }, [apply])\n\n useEffect(() => { void refresh() }, [refresh])\n\n const submit = useCallback(async () => {\n const fileReadMaxBytes = Math.round(Number(fileReadMib) * BYTES_PER_MIB)\n const uploadMaxBytes = Math.round(Number(uploadMib) * BYTES_PER_MIB)\n if (!Number.isSafeInteger(fileReadMaxBytes) || fileReadMaxBytes <= 0) return\n if (!Number.isSafeInteger(uploadMaxBytes) || uploadMaxBytes <= 0) return\n setBusy(true)\n try {\n const limits: WorkspaceLimits = { fileReadMaxBytes, uploadMaxBytes }\n const status = await saveWorkspaceLimits(limits)\n if (status === null) setState({ kind: 'unavailable' })\n else apply(status)\n } catch {\n setState({ kind: 'failed' })\n } finally {\n setBusy(false)\n }\n }, [fileReadMib, uploadMib, apply])\n\n if (state.kind === 'loading') return null\n if (state.kind !== 'ready') {\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('limitsTitle')}</h3>\n <p className={styles.modelDescription} role={state.kind === 'failed' ? 'alert' : undefined}>\n {state.kind === 'failed' ? t('loadFailed') : t('limitsUnavailable')}\n </p>\n </div>\n )\n }\n\n return (\n <div className={styles.modelPanel}>\n <h3 className={styles.modelTitle}>{t('limitsTitle')}</h3>\n <p className={styles.modelDescription}>{t('limitsDescription')}</p>\n <div className={styles.details}>\n <label className={styles.detailRow}>\n <span>{t('limitsFileReadLabel')}</span>\n <input\n className={styles.limitsInput}\n type=\"number\"\n min=\"1\"\n step=\"1\"\n aria-label={t('limitsFileReadLabel')}\n value={fileReadMib}\n disabled={busy || !state.status.canWrite}\n onChange={event => { setFileReadMib(event.target.value) }}\n />\n </label>\n <label className={styles.detailRow}>\n <span>{t('limitsUploadLabel')}</span>\n <input\n className={styles.limitsInput}\n type=\"number\"\n min=\"1\"\n step=\"1\"\n aria-label={t('limitsUploadLabel')}\n value={uploadMib}\n disabled={busy || !state.status.canWrite}\n onChange={event => { setUploadMib(event.target.value) }}\n />\n </label>\n </div>\n <div className={styles.brandingRow}>\n <span className={styles.modelDescription}>{t('limitsUnit')}</span>\n <button\n type=\"button\"\n className={styles.modelAction}\n disabled={busy || !state.status.canWrite}\n onClick={() => { void submit() }}\n >\n {busy ? t('limitsSaving') : t('limitsSave')}\n </button>\n </div>\n </div>\n )\n}\n\n/** Re-exported so the settings entry can be discovered from the section alone. */\nexport { MODEL_SYNC_PATH }\n","/** Same-origin skill plaza calls from the DataOps skill center section. */\n\n/** Route the plugin's Host half serves for the plaza. */\nexport const SKILL_PLAZA_PATH = '/integrations/dataops/skill-plaza'\n\n/** One plaza entry as the section reads it. */\nexport interface PlazaSkill {\n id: number\n name: string\n description?: string\n instruction: string\n tags: string[]\n sharedByMe: boolean\n updatedAt: string\n}\n\n/** The plaza listing and the tags in use. */\nexport interface PlazaListing {\n skills: PlazaSkill[]\n tags: string[]\n}\n\n/** Narrow an unknown value to a plaza entry. */\nfunction asSkill(value: unknown): PlazaSkill | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record<string, unknown>\n if (typeof row.id !== 'number' || typeof row.name !== 'string') return null\n return {\n id: row.id,\n name: row.name,\n description: typeof row.description === 'string' ? row.description : undefined,\n instruction: typeof row.instruction === 'string' ? row.instruction : '',\n tags: Array.isArray(row.tags) ? row.tags.filter((tag): tag is string => typeof tag === 'string') : [],\n sharedByMe: row.sharedByMe === true,\n updatedAt: typeof row.updatedAt === 'string' ? row.updatedAt : '',\n }\n}\n\n/** Narrow an unknown value to the listing. */\nfunction asListing(value: unknown): PlazaListing | null {\n if (typeof value !== 'object' || value === null || Array.isArray(value)) return null\n const row = value as Record<string, unknown>\n const skills = Array.isArray(row.skills) ? row.skills.flatMap((entry) => asSkill(entry) ?? []) : []\n const tags = Array.isArray(row.tags) ? row.tags.filter((tag): tag is string => typeof tag === 'string') : []\n return { skills, tags }\n}\n\n/**\n * Read the plaza.\n * @param filter - Optional tag and text filters.\n * @returns The listing, or null when this workspace is not connected to DataOps.\n */\nexport async function fetchPlaza(filter: { tag?: string; query?: string } = {}): Promise<PlazaListing | null> {\n const params = new URLSearchParams()\n if (filter.tag !== undefined && filter.tag !== '') params.set('tag', filter.tag)\n if (filter.query !== undefined && filter.query !== '') params.set('q', filter.query)\n const suffix = params.size === 0 ? '' : '?' + params.toString()\n const response = await fetch(SKILL_PLAZA_PATH + suffix, { headers: { accept: 'application/json' } })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('skill plaza read failed with HTTP ' + String(response.status))\n return asListing(await response.json())\n}\n\n/**\n * Change the plaza.\n * @param body - Action and its parameters.\n * @returns The parsed reply, or null when the plugin is not active.\n */\nexport async function postPlazaAction(body: Record<string, unknown>): Promise<unknown> {\n const response = await fetch(SKILL_PLAZA_PATH, {\n method: 'POST',\n headers: { 'content-type': 'application/json', accept: 'application/json' },\n body: JSON.stringify(body),\n })\n if (response.status === 503) return null\n if (!response.ok) throw new Error('skill plaza action failed with HTTP ' + String(response.status))\n return await response.json()\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport {\n Button,\n IconDownloadOutlineRegular,\n IconRefreshOutlineRegular,\n IconShareOutlineRegular,\n IconSkillOutlineRegular,\n IconSparkleRegular,\n IconTrashOutlineRegular,\n Pill,\n Tag,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { InjectFace } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { en } from './locales.ts'\nimport { fetchPlaza, postPlazaAction, type PlazaListing, type PlazaSkill } from './skill-plaza-client.ts'\nimport styles from './SkillPlazaSection.module.css'\n\n/** Values the skill center passes to a contributed section. */\nexport interface SkillPlazaSectionInjected {\n /** Translate one DataOps plaza message key. */\n t: (key: keyof typeof en) => string\n}\n\n/** Props accepted by the plaza section. */\nexport type SkillPlazaSectionProps = Partial<InjectFace<SkillPlazaSectionInjected>>\n\n/** What the section currently knows. */\ntype PlazaState =\n | { kind: 'loading' }\n | { kind: 'unavailable' }\n | { kind: 'ready'; listing: PlazaListing }\n | { kind: 'failed' }\n\n/**\n * One plaza row, laid out like the skill center's own rows so the section reads as part of the\n * page rather than a panel bolted onto it.\n * @param props - the row's skill, its actions, and the dictionary resolver.\n * @returns the rendered row.\n */\nfunction PlazaRow({ skill, busy, onInstall, onUnshare, t }: {\n skill: PlazaSkill\n busy: boolean\n onInstall: () => void\n onUnshare: () => void\n t: (key: keyof typeof en) => string\n}): ReactNode {\n return (\n <li className={styles.card}>\n <div className={styles.cardHead}>\n <span className={styles.cardIcon}><IconSkillOutlineRegular size={22} /></span>\n <div className={styles.cardMain}>\n <div className={styles.cardTitle}>\n {skill.name}\n {skill.sharedByMe ? <Tag tone=\"info\" className={styles.mine}>{t('plazaMine')}</Tag> : null}\n </div>\n {skill.description === undefined ? null : (\n <div className={styles.cardDesc}>{skill.description}</div>\n )}\n {skill.tags.length === 0 ? null : (\n <div className={styles.cardMarks}>\n {skill.tags.map((item) => <Tag tone=\"quiet\" key={item}>{item}</Tag>)}\n </div>\n )}\n </div>\n <div className={styles.cardEnd}>\n <Button\n variant=\"outline\"\n size=\"sm\"\n icon={<IconDownloadOutlineRegular size={16} />}\n disabled={busy}\n onClick={onInstall}\n >\n {t('plazaInstall')}\n </Button>\n {skill.sharedByMe ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n icon={<IconTrashOutlineRegular size={16} />}\n disabled={busy}\n onClick={onUnshare}\n >\n {t('plazaUnshare')}\n </Button>\n ) : null}\n </div>\n </div>\n </li>\n )\n}\n\n/**\n * Browse, share, and install skills other users published.\n *\n * The section appears only where this plugin is installed: the skill center renders the slot,\n * and an empty slot renders nothing. Every action goes through this plugin's Host route, so a\n * workspace without DataOps never reaches these calls.\n * @param props - Skill center injection values.\n * @returns The plaza section, or nothing before injection.\n */\nexport function SkillPlazaSection(props: SkillPlazaSectionProps): ReactNode {\n const { t } = props\n const [state, setState] = useState<PlazaState>({ kind: 'loading' })\n const [tag, setTag] = useState('')\n const [query, setQuery] = useState('')\n const [busy, setBusy] = useState(false)\n const [notice, setNotice] = useState<string | null>(null)\n\n const load = useCallback(async (filter: { tag?: string; query?: string }) => {\n try {\n const listing = await fetchPlaza(filter)\n setState(listing === null ? { kind: 'unavailable' } : { kind: 'ready', listing })\n } catch {\n setState({ kind: 'failed' })\n }\n }, [])\n\n useEffect(() => { void load({}) }, [load])\n\n const refresh = useCallback(async (nextTag = tag, nextQuery = query) => {\n await load({ tag: nextTag, query: nextQuery })\n }, [load, tag, query])\n\n const act = useCallback(async (body: Record<string, unknown>, message: string) => {\n setBusy(true)\n setNotice(null)\n try {\n await postPlazaAction(body)\n setNotice(message)\n await refresh()\n } catch {\n setNotice(t === undefined ? null : t('plazaActionFailed'))\n } finally {\n setBusy(false)\n }\n }, [refresh, t])\n\n if (t === undefined) return null\n if (state.kind === 'loading') return null\n\n // The section names itself once; the states below swap only what sits under the heading.\n const head = (\n <div className={styles.head}>\n <h2 className={styles.title}>\n <span className={styles.titleIcon}><IconSparkleRegular size={18} /></span>\n {t('plazaTitle')}\n </h2>\n <p className={styles.intro}>{t('plazaIntro')}</p>\n </div>\n )\n\n if (state.kind === 'unavailable') {\n return <section className={styles.section}>{head}<p className={styles.intro}>{t('plazaUnavailable')}</p></section>\n }\n if (state.kind === 'failed') {\n return (\n <section className={styles.section}>\n {head}\n <div className={styles.empty} role=\"alert\">\n <span className={styles.emptyIcon}><IconSkillOutlineRegular size={28} /></span>\n <p className={styles.emptyText}>{t('plazaLoadFailed')}</p>\n <Button variant=\"outline\" size=\"sm\" icon={<IconRefreshOutlineRegular size={16} />} onClick={() => { void refresh() }}>\n {t('plazaRetry')}\n </Button>\n </div>\n </section>\n )\n }\n\n const { listing } = state\n return (\n <section className={styles.section}>\n {head}\n\n <div className={styles.toolbar}>\n <input\n className={styles.search}\n placeholder={t('plazaSearch')}\n value={query}\n onChange={(event) => {\n const next = event.target.value\n setQuery(next)\n void refresh(tag, next)\n }}\n />\n </div>\n\n {listing.tags.length === 0 ? null : (\n <div className={styles.tagBar}>\n <Pill active={tag === ''} onClick={() => { setTag(''); void refresh('', query) }}>{t('plazaAllTags')}</Pill>\n {listing.tags.map((item) => (\n <Pill key={item} active={tag === item} onClick={() => { setTag(item); void refresh(item, query) }}>\n {item}\n </Pill>\n ))}\n </div>\n )}\n\n {notice === null ? null : <p className={styles.notice}>{notice}</p>}\n\n {listing.skills.length === 0 ? (\n <div className={styles.empty}>\n <span className={styles.emptyIcon}><IconShareOutlineRegular size={28} /></span>\n <p className={styles.emptyText}>{t('plazaEmpty')}</p>\n </div>\n ) : null}\n\n <ul className={styles.cards}>\n {listing.skills.map((skill) => (\n <PlazaRow\n key={skill.id}\n skill={skill}\n busy={busy}\n t={t}\n onInstall={() => { void act({ action: 'install', id: skill.id }, t('plazaInstalled')) }}\n onUnshare={() => { void act({ action: 'unshare', id: skill.id }, t('plazaUnshared')) }}\n />\n ))}\n </ul>\n </section>\n )\n}\n\n/** Re-exported so the registration site reads the route from one place. */\nexport { SKILL_PLAZA_PATH } from './skill-plaza-client.ts'\n","import type { CSSProperties } from 'react'\nimport css from './WanxiangBrand.module.css'\n\nconst WORDMARK_VIEWBOX = \"1.64 115.64 5927.36 933.38\"\nconst WORDMARK_RATIO = 5927.36 / 933.38\nconst WORDMARK_PATHS = [\n {\n \"d\": \"M62 765V691H333C326 434 312 123 34 -24C53 -38 77 -62 89 -82C287 28 361 217 390 414H767C752 147 735 37 705 9C693 -2 681 -4 657 -3C631 -3 558 -3 483 4C498 -17 508 -48 509 -70C578 -74 648 -75 686 -72C724 -70 749 -62 772 -36C811 5 829 126 846 450C847 460 847 487 847 487H399C406 556 409 625 411 691H939V765Z\",\n \"transform\": \"translate(0.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M546 474H850V300H546ZM546 542V710H850V542ZM546 231H850V57H546ZM473 781V-73H546V-12H850V-70H926V781ZM214 840V626H52V554H205C170 416 99 258 29 175C41 157 60 127 68 107C122 176 175 287 214 402V-79H287V378C325 329 370 267 389 234L435 295C413 322 322 429 287 464V554H430V626H287V840Z\",\n \"transform\": \"translate(1002.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M443 821C425 782 393 723 368 688L417 664C443 697 477 747 506 793ZM88 793C114 751 141 696 150 661L207 686C198 722 171 776 143 815ZM410 260C387 208 355 164 317 126C279 145 240 164 203 180C217 204 233 231 247 260ZM110 153C159 134 214 109 264 83C200 37 123 5 41 -14C54 -28 70 -54 77 -72C169 -47 254 -8 326 50C359 30 389 11 412 -6L460 43C437 59 408 77 375 95C428 152 470 222 495 309L454 326L442 323H278L300 375L233 387C226 367 216 345 206 323H70V260H175C154 220 131 183 110 153ZM257 841V654H50V592H234C186 527 109 465 39 435C54 421 71 395 80 378C141 411 207 467 257 526V404H327V540C375 505 436 458 461 435L503 489C479 506 391 562 342 592H531V654H327V841ZM629 832C604 656 559 488 481 383C497 373 526 349 538 337C564 374 586 418 606 467C628 369 657 278 694 199C638 104 560 31 451 -22C465 -37 486 -67 493 -83C595 -28 672 41 731 129C781 44 843 -24 921 -71C933 -52 955 -26 972 -12C888 33 822 106 771 198C824 301 858 426 880 576H948V646H663C677 702 689 761 698 821ZM809 576C793 461 769 361 733 276C695 366 667 468 648 576Z\",\n \"transform\": \"translate(2004.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M484 238V-81H550V-40H858V-77H927V238H734V362H958V427H734V537H923V796H395V494C395 335 386 117 282 -37C299 -45 330 -67 344 -79C427 43 455 213 464 362H663V238ZM468 731H851V603H468ZM468 537H663V427H467L468 494ZM550 22V174H858V22ZM167 839V638H42V568H167V349C115 333 67 319 29 309L49 235L167 273V14C167 0 162 -4 150 -4C138 -5 99 -5 56 -4C65 -24 75 -55 77 -73C140 -74 179 -71 203 -59C228 -48 237 -27 237 14V296L352 334L341 403L237 370V568H350V638H237V839Z\",\n \"transform\": \"translate(3006.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M174 630C213 556 252 459 266 399L337 424C323 482 282 578 242 650ZM755 655C730 582 684 480 646 417L711 396C750 456 797 552 834 633ZM52 348V273H459V-79H537V273H949V348H537V698H893V773H105V698H459V348Z\",\n \"transform\": \"translate(4008.00 940.00) scale(0.96000 -0.94000)\"\n },\n {\n \"d\": \"M179 342V-79H255V-25H741V-77H821V342ZM255 48V270H741V48ZM126 426C165 441 224 443 800 474C825 443 846 414 861 388L925 434C873 518 756 641 658 727L599 687C647 644 699 591 745 540L231 516C320 598 410 701 490 811L415 844C336 720 219 593 183 559C149 526 124 505 101 500C110 480 122 442 126 426Z\",\n \"transform\": \"translate(5010.00 940.00) scale(0.96000 -0.94000)\"\n }\n] as const\nconst HARNESS_PATHS = [\n {\n \"d\": \"M132.848 8.93205H134.08V16.137H132.848V8.93205ZM136.5 8.93205H137.732V16.137H136.5V8.93205ZM133.365 13.024V11.99H137.193V13.024H133.365Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M140.397 14.432L140.672 13.453H143.202L143.532 14.432H140.397ZM140.287 16.137H139.055L141.277 8.93205H142.201L142.146 9.74605L140.947 13.915H140.969L140.287 16.137ZM145.039 16.137H143.741L143.07 13.948L143.081 13.937L141.871 9.74605L141.926 8.93205H142.817L145.039 16.137Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M146.846 8.93205H149.068C149.852 8.93205 150.443 9.11538 150.839 9.48205C151.235 9.84138 151.433 10.3327 151.433 10.956C151.433 11.22 151.396 11.4657 151.323 11.693C151.249 11.9204 151.125 12.1257 150.949 12.309C150.773 12.4924 150.531 12.65 150.223 12.782C149.922 12.9067 149.541 13.0057 149.079 13.079V13.321H146.846V12.639L148.023 12.485C148.631 12.4044 149.09 12.298 149.398 12.166C149.706 12.034 149.915 11.8764 150.025 11.693C150.135 11.5024 150.19 11.2934 150.19 11.066C150.19 10.6994 150.083 10.417 149.871 10.219C149.658 10.021 149.324 9.92205 148.87 9.92205H146.846V8.93205ZM146.395 8.93205H147.627V16.137H146.395V8.93205ZM151.917 16.093V16.137H150.366L149.024 14.322C148.87 14.1094 148.73 13.9407 148.606 13.816C148.481 13.684 148.345 13.5887 148.199 13.53C148.052 13.464 147.872 13.42 147.66 13.398C147.447 13.3687 147.176 13.3504 146.846 13.343V13.145H149.079C149.233 13.211 149.368 13.2844 149.486 13.365C149.61 13.4457 149.735 13.5447 149.86 13.662C149.992 13.7794 150.138 13.937 150.3 14.135L151.917 16.093Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M153.58 9.57005L153.591 8.93205H154.46L157.584 15.51V16.137H156.704L153.58 9.57005ZM158.024 16.137H156.968L156.88 8.93205H158.024V16.137ZM154.24 16.137H153.096V8.93205H154.152L154.24 16.137Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M159.963 8.93205H161.206V16.137H159.963V8.93205ZM160.095 9.96605V8.93205H164.858V9.96605H160.095ZM160.095 16.137V15.103H164.902V16.137H160.095ZM160.095 13.013V11.99H164.374V13.013H160.095Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M169.052 15.257C169.543 15.257 169.895 15.1654 170.108 14.982C170.328 14.7987 170.438 14.5457 170.438 14.223C170.438 14.047 170.405 13.8967 170.339 13.772C170.273 13.6474 170.152 13.5337 169.976 13.431C169.807 13.321 169.558 13.2147 169.228 13.112L168.491 12.881C167.846 12.6757 167.38 12.4044 167.094 12.067C166.808 11.7297 166.665 11.3007 166.665 10.78C166.665 10.428 166.76 10.1017 166.951 9.80105C167.142 9.50038 167.428 9.25838 167.809 9.07505C168.19 8.89172 168.663 8.80005 169.228 8.80005C169.631 8.80005 169.998 8.82938 170.328 8.88805C170.665 8.93938 171.039 9.01638 171.45 9.11905L171.274 10.175C170.834 10.0504 170.442 9.96238 170.097 9.91105C169.76 9.85238 169.463 9.82305 169.206 9.82305C168.737 9.82305 168.403 9.90738 168.205 10.076C168.007 10.2374 167.908 10.439 167.908 10.681C167.908 10.857 167.941 11.0147 168.007 11.154C168.073 11.286 168.19 11.407 168.359 11.517C168.535 11.627 168.784 11.7334 169.107 11.836L169.866 12.078C170.526 12.276 170.995 12.5327 171.274 12.848C171.553 13.156 171.692 13.585 171.692 14.135C171.692 14.5604 171.589 14.9344 171.384 15.257C171.179 15.5797 170.878 15.8327 170.482 16.016C170.093 16.1994 169.609 16.291 169.03 16.291C168.627 16.291 168.212 16.247 167.787 16.159C167.362 16.071 166.9 15.9427 166.401 15.774L166.665 14.718C167.156 14.894 167.6 15.0297 167.996 15.125C168.399 15.213 168.751 15.257 169.052 15.257Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n },\n {\n \"d\": \"M175.809 15.257C176.3 15.257 176.652 15.1654 176.865 14.982C177.085 14.7987 177.195 14.5457 177.195 14.223C177.195 14.047 177.162 13.8967 177.096 13.772C177.03 13.6474 176.909 13.5337 176.733 13.431C176.564 13.321 176.315 13.2147 175.985 13.112L175.248 12.881C174.603 12.6757 174.137 12.4044 173.851 12.067C173.565 11.7297 173.422 11.3007 173.422 10.78C173.422 10.428 173.517 10.1017 173.708 9.80105C173.899 9.50038 174.185 9.25838 174.566 9.07505C174.947 8.89172 175.42 8.80005 175.985 8.80005C176.388 8.80005 176.755 8.82938 177.085 8.88805C177.422 8.93938 177.796 9.01638 178.207 9.11905L178.031 10.175C177.591 10.0504 177.199 9.96238 176.854 9.91105C176.517 9.85238 176.22 9.82305 175.963 9.82305C175.494 9.82305 175.16 9.90738 174.962 10.076C174.764 10.2374 174.665 10.439 174.665 10.681C174.665 10.857 174.698 11.0147 174.764 11.154C174.83 11.286 174.947 11.407 175.116 11.517C175.292 11.627 175.541 11.7334 175.864 11.836L176.623 12.078C177.283 12.276 177.752 12.5327 178.031 12.848C178.31 13.156 178.449 13.585 178.449 14.135C178.449 14.5604 178.346 14.9344 178.141 15.257C177.936 15.5797 177.635 15.8327 177.239 16.016C176.85 16.1994 176.366 16.291 175.787 16.291C175.384 16.291 174.969 16.247 174.544 16.159C174.119 16.071 173.657 15.9427 173.158 15.774L173.422 14.718C173.913 14.894 174.357 15.0297 174.753 15.125C175.156 15.213 175.508 15.257 175.809 15.257Z\",\n \"fill\": \"var(--dsw-alias-label-primary-inverted)\"\n }\n] as const\n\ninterface MarkProps {\n size: number\n className?: string | undefined\n}\n\nfunction classes(...values: Array<string | undefined>): string {\n return values.filter(Boolean).join(' ')\n}\n\nfunction Cube({ transform, className }: { transform: string; className: string }) {\n return (\n <g transform={transform}>\n <g className={className} stroke=\"currentColor\" strokeWidth=\"1.7\" strokeLinejoin=\"round\">\n <path d=\"M12 0 24 7 12 14 0 7 12 0Z\" fill=\"none\" />\n <path d=\"M0 7 12 14v16L0 23V7Z\" fill=\"currentColor\" />\n <path d=\"M12 14 24 7v16L12 30V14Z\" fill=\"currentColor\" fillOpacity=\".18\" />\n </g>\n </g>\n )\n}\n\n/** Four linked data units; its ink follows the host surface through currentColor. */\nexport function WanxiangMark({ size, className, animated = false }: MarkProps & { animated?: boolean }) {\n return (\n <svg\n width={size}\n height={(size * 58) / 54}\n className={classes(css.mark, animated ? css.animatedMark : undefined, className)}\n viewBox=\"0 0 54 58\"\n fill=\"none\"\n aria-hidden=\"true\"\n >\n <Cube className={css.unitTop} transform=\"translate(15 0)\" />\n <Cube className={css.unitLeft} transform=\"translate(0 16)\" />\n <Cube className={css.unitRight} transform=\"translate(30 16)\" />\n <Cube className={css.unitCore} transform=\"translate(15 27)\" />\n </svg>\n )\n}\n\n/** Approved rounded-Heiti artwork, stored as paths with no runtime font dependency. */\nexport function WanxiangWordmark({ height, accessible = false, className }: {\n height: number\n accessible?: boolean\n className?: string | undefined\n}) {\n const accessibility = accessible\n ? { role: 'img', 'aria-label': '万相数据平台' }\n : { 'aria-hidden': true }\n return (\n <svg\n width={height * WORDMARK_RATIO}\n height={height}\n className={className}\n viewBox={WORDMARK_VIEWBOX}\n {...accessibility}\n >\n <g\n fill=\"currentColor\"\n stroke=\"currentColor\"\n strokeWidth=\"42\"\n strokeLinejoin=\"round\"\n strokeLinecap=\"round\"\n paintOrder=\"stroke fill\"\n >\n {WORDMARK_PATHS.map(path => <path key={path.transform} d={path.d} transform={path.transform} />)}\n </g>\n </svg>\n )\n}\n\n/** Exact HARNESS badge artwork extracted from the current DSH BrandWordmark. */\nexport function HarnessBadge({ height = 14 }: { height?: number }) {\n const style = { '--dsw-alias-label-primary-inverted': 'var(--dsw-alias-bg-base)' } as CSSProperties\n return (\n <svg\n width={(height * 53) / 15.5}\n height={height}\n className={css.harness}\n viewBox=\"129 5 53 15.5\"\n style={style}\n aria-hidden=\"true\"\n >\n <rect x=\"129.348\" y=\"5.5\" width=\"52\" height=\"14\" rx=\"2\" fill=\"currentColor\" />\n {HARNESS_PATHS.map((path, index) => <path key={index} d={path.d} fill={path.fill} />)}\n </svg>\n )\n}\n\n/** Expanded-sidebar brand name plus the unchanged official HARNESS badge. */\nexport function WanxiangSidebarName() {\n return <span className={css.sidebarName}><WanxiangWordmark height={16} /><HarnessBadge height={14} /></span>\n}\n\n/** Welcome-page logo with four-unit hover motion. */\nexport function WanxiangHeroMark({ size, className }: MarkProps) {\n return <WanxiangMark size={size} className={className} animated />\n}\n","import type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\nimport { wanxiangBrandPreference } from './brand-store.ts'\nimport {\n WanxiangHeroMark,\n WanxiangMark,\n WanxiangSidebarName,\n} from './WanxiangBrand.tsx'\n\nconst BRAND_TITLE = '万相数据平台 Harness'\nconst SLOT_PRIORITY = -100\nconst FAVICON_ID = 'dataops-wanxiang-favicon'\nconst FAVICON_SVG = `<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 54 58\"><style>:root{color:#1b1b1d}@media(prefers-color-scheme:dark){:root{color:#f7f7f8}}</style><g transform=\"translate(15 0)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(0 16)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(30 16)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g><g transform=\"translate(15 27)\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linejoin=\"round\"><path d=\"M12 0 24 7 12 14 0 7Z\" fill=\"none\"/><path d=\"M0 7 12 14v16L0 23Z\" fill=\"currentColor\"/><path d=\"M12 14 24 7v16L12 30Z\" fill=\"currentColor\" fill-opacity=\".18\"/></g></svg>`\n\n\nfunction registerWanxiangSlots(ctx: ClientContext): () => void {\n return ctx.slots.inject('sidebar.brand.mark', () =>\n ctx.slots.inject('sidebar.brand.name', () =>\n ctx.slots.inject('conversation.hero.brand.mark', function* () {\n yield ctx.slots.register({\n name: 'sidebar.brand.mark',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangMark)\n yield ctx.slots.register({\n name: 'sidebar.brand.name',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangSidebarName)\n yield ctx.slots.register({\n name: 'conversation.hero.brand.mark',\n priority: SLOT_PRIORITY,\n registrant: 'dataops-managed',\n }, WanxiangHeroMark)\n })))\n}\n\nfunction installFavicon(): HTMLLinkElement {\n const existing = document.getElementById(FAVICON_ID)\n if (existing instanceof HTMLLinkElement) return existing\n const link = document.createElement('link')\n link.id = FAVICON_ID\n link.rel = 'icon'\n link.type = 'image/svg+xml'\n link.href = `data:image/svg+xml,${encodeURIComponent(FAVICON_SVG)}`\n document.head.append(link)\n return link\n}\n\n/** Keep shell slots, browser title, and favicon on the same persisted preference. */\nexport function installWanxiangBranding(ctx: ClientContext): void {\n const originalTitle = document.title\n let disposeSlots: (() => void) | undefined\n let favicon: HTMLLinkElement | undefined\n let titleObserver: MutationObserver | undefined\n\n const stopTitleObserver = (): void => {\n titleObserver?.disconnect()\n titleObserver = undefined\n }\n const keepBrandTitle = (): void => {\n if (document.title !== BRAND_TITLE) document.title = BRAND_TITLE\n if (titleObserver !== undefined) return\n titleObserver = new MutationObserver(() => {\n if (wanxiangBrandPreference.getSnapshot().enabled && document.title !== BRAND_TITLE) {\n document.title = BRAND_TITLE\n }\n })\n titleObserver.observe(document.head, { childList: true, subtree: true, characterData: true })\n }\n\n const synchronize = (): void => {\n const enabled = wanxiangBrandPreference.getSnapshot().enabled\n if (enabled) {\n disposeSlots ??= registerWanxiangSlots(ctx)\n favicon ??= installFavicon()\n keepBrandTitle()\n document.documentElement.dataset.dataopsBrand = 'wanxiang'\n return\n }\n disposeSlots?.()\n disposeSlots = undefined\n favicon?.remove()\n favicon = undefined\n stopTitleObserver()\n document.title = originalTitle\n delete document.documentElement.dataset.dataopsBrand\n }\n\n ctx.effect(() => {\n synchronize()\n const unsubscribe = wanxiangBrandPreference.subscribe(synchronize)\n return () => {\n unsubscribe()\n disposeSlots?.()\n favicon?.remove()\n stopTitleObserver()\n document.title = originalTitle\n delete document.documentElement.dataset.dataopsBrand\n }\n }, 'dataops-managed: Wanxiang shell branding')\n}\n","/** English managed DataOps Settings copy. */\nexport const en = {\n nav: 'DataOps',\n title: 'DataOps',\n managed: 'Managed by this DataOps workspace',\n description: 'DSH uses your current DataOps session JWT. DataOps applies its role and resource permissions to every tool request.',\n identityLabel: 'Identity and permissions',\n identityValue: 'Current DataOps JWT',\n toolsLabel: 'DataOps tools',\n toolsValue: 'Authorized by DataOps on every request',\n brandingTitle: 'Apply Wanxiang branding',\n brandingDescription: 'Use the Wanxiang Data Platform identity in navigation, the New Session welcome view, browser title, and favicon.',\n brandingToggle: 'Apply Wanxiang branding',\n modelsTitle: 'Model configuration',\n modelsDescription: 'Share the models configured here with other users, and choose which of them they may use.',\n modelsUnavailable: 'Model configuration is unavailable until this workspace is connected to DataOps.',\n defaultsTitle: 'Default configuration',\n defaultsDescription: 'Publish the configuration this workspace holds — models, permissions, and general settings — as the values other users start from. Their workspace takes that copy once and may then change anything, and a change they make is never overwritten.',\n defaultsActionTitle: 'Publish as the default',\n defaultsNotAdmin: 'Only an administrator may publish the default configuration.',\n defaultsNeverPublished: 'Not published yet.',\n defaultsPublishedAt: 'Last published:',\n defaultsPublish: 'Publish default configuration',\n defaultsPublishing: 'Publishing…',\n loadFailed: 'The model configuration could not be loaded. Try again.',\n plazaTitle: 'Skill plaza',\n plazaIntro: 'Skills other users shared. Install one to use it in this workspace, or share a skill of your own.',\n plazaSearch: 'Search skills',\n plazaTagFilter: 'Filter by tag',\n plazaAllTags: 'All tags',\n plazaMine: 'Shared by me',\n plazaInstall: 'Install',\n plazaInstalled: 'Installed. It is now in your skill list.',\n plazaUnshare: 'Stop sharing',\n plazaUnshared: 'Removed from the plaza. Users who installed it keep their copy.',\n plazaEmpty: 'No skills have been shared yet.',\n plazaUnavailable: 'The skill plaza is available once this workspace is connected to DataOps.',\n plazaLoadFailed: 'The skill plaza could not be loaded. Try again.',\n plazaActionFailed: 'The action could not be completed. Try again.',\n plazaRetry: 'Try again',\n plazaRefresh: 'Refresh',\n limitsTitle: 'Workspace limits',\n limitsDescription: 'The largest files this workspace may read and upload. Set by an administrator in DataOps.',\n limitsUnavailable: 'Workspace limits are available once this workspace is connected to DataOps.',\n limitsFileReadLabel: 'Largest file to read',\n limitsUploadLabel: 'Largest file to upload',\n limitsUnit: 'Units are MiB.',\n limitsSave: 'Save limits',\n limitsSaving: 'Saving…',\n} as const\n\n/** Stable key set shared by every managed DataOps locale. */\nexport type ManagedDataOpsKey = keyof typeof en\n\n/** Chinese managed DataOps Settings copy. */\nexport const zh: Record<ManagedDataOpsKey, string> = {\n nav: 'DataOps',\n title: 'DataOps',\n managed: '由当前 DataOps 工作区托管',\n description: 'DSH 使用当前 DataOps 会话 JWT;DataOps 对每次工具请求应用角色与资源权限。',\n identityLabel: '身份与权限',\n identityValue: '当前 DataOps JWT',\n toolsLabel: 'DataOps 工具',\n toolsValue: '每次请求均由 DataOps 授权',\n brandingTitle: '应用万相品牌',\n brandingDescription: '在导航、新会话欢迎页、浏览器标题和图标中使用万相数据平台品牌。',\n brandingToggle: '应用万相品牌',\n modelsTitle: '模型配置共享',\n modelsDescription: '把这里配置的模型共享给其他用户,并决定他们可以使用其中哪些。',\n modelsUnavailable: '工作区接入 DataOps 后即可使用模型配置共享。',\n defaultsTitle: '默认配置',\n defaultsDescription: '把本工作区当前的配置(模型、权限、通用设置)发布为其他用户的初始值。对方工作区只取用一次,之后可以随意修改,改过的内容不会被覆盖。',\n defaultsActionTitle: '发布为默认值',\n defaultsNotAdmin: '只有管理员可以发布默认配置。',\n defaultsNeverPublished: '尚未发布。',\n defaultsPublishedAt: '上次发布:',\n defaultsPublish: '发布默认配置',\n defaultsPublishing: '发布中…',\n loadFailed: '模型配置加载失败,请重试。',\n plazaTitle: '技能广场',\n plazaIntro: '其他用户共享的技能。装载后即可在本工作区使用,也可以把自己的技能共享出去。',\n plazaSearch: '搜索技能',\n plazaTagFilter: '按标签筛选',\n plazaAllTags: '全部标签',\n plazaMine: '我共享的',\n plazaInstall: '装载',\n plazaInstalled: '已装载,可在技能列表中使用。',\n plazaUnshare: '取消共享',\n plazaUnshared: '已从广场移除;已装载的用户保留其副本。',\n plazaEmpty: '还没有人共享技能。',\n plazaUnavailable: '工作区接入 DataOps 后即可使用技能广场。',\n plazaLoadFailed: '技能广场加载失败,请重试。',\n plazaActionFailed: '操作未完成,请重试。',\n plazaRetry: '重试',\n plazaRefresh: '刷新',\n limitsTitle: '工作区限制',\n limitsDescription: '本工作区可读取与上传的最大文件。由 DataOps 管理员设置。',\n limitsUnavailable: '工作区连接到 DataOps 后可用。',\n limitsFileReadLabel: '最大读取文件',\n limitsUploadLabel: '最大上传文件',\n limitsUnit: '单位:MiB。',\n limitsSave: '保存限制',\n limitsSaving: '保存中…',\n}\n","import type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the skill center's slot declaration so this plugin can contribute to it.\nimport type {} from '@sparkelf/dsh-client-ui-skill-center/client'\nimport { ManagedDataOpsSection } from './ManagedDataOpsSection.tsx'\nimport { SkillPlazaSection } from './SkillPlazaSection.tsx'\nimport { installWanxiangBranding } from './install-branding.tsx'\nimport type { ManagedDataOpsSectionInjected } from './ManagedDataOpsSection.tsx'\nimport { en, zh, type ManagedDataOpsKey } from './locales.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n 'settings.dataops-managed': ManagedDataOpsKey\n }\n}\n\nconst NS = 'settings.dataops-managed'\nconst AUTH_UPDATED_MESSAGE = 'dataops-auth-updated'\nconst MANAGED_AUTH_PATH = '/integrations/dataops/managed-auth'\n\n/** Required client services for the managed DataOps Settings section. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Register localized managed DataOps Settings navigation and content.\n * @param ctx - DSH client context with locale and settings slots.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'dataops-managed: settings copy')\n installWanxiangBranding(ctx)\n const t = ctx.locale.bind(NS) as ManagedDataOpsSectionInjected['t']\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings.section',\n id: 'dataops',\n order: 25,\n label: () => t('nav'),\n inject: () => ({ t }),\n }, ManagedDataOpsSection))\n\n /**\n * The skill plaza, contributed to the skill center page.\n *\n * The skill center declares the slot and renders whatever it holds; a profile without this\n * plugin leaves it empty, which is what keeps the plaza out of a deployment that never\n * installed DataOps.\n */\n ctx.slots.inject('skill-center.section', () => ctx.slots.register({\n name: 'skill-center.section',\n id: 'dataops-plaza',\n order: 10,\n inject: () => ({ t }),\n }, SkillPlazaSection))\n\n const synchronizeJwt = async (): Promise<void> => {\n const response = await fetch(new URL(MANAGED_AUTH_PATH, window.location.origin), {\n method: 'POST',\n credentials: 'same-origin',\n })\n if (!response.ok) throw new Error(`DataOps managed JWT synchronization failed with HTTP ${String(response.status)}`)\n }\n const onMessage = (event: MessageEvent<unknown>): void => {\n if (event.source !== window.parent\n || (event.data as { type?: unknown } | null)?.type !== AUTH_UPDATED_MESSAGE) return\n void synchronizeJwt().catch(error => console.error('dataops-managed.jwt_sync_failed', error))\n }\n ctx.effect(() => {\n window.addEventListener('message', onMessage)\n void synchronizeJwt().catch(error => console.error('dataops-managed.jwt_sync_failed', error))\n return () => window.removeEventListener('message', onMessage)\n }, 'dataops-managed: JWT synchronization')\n}\n"],"mappings":";;;;;;;;;;;EAMA,MAAa,gCAAgC;EAE7C,SAAS,oBAA6C;GACpD,IAAI,OAAO,iBAAiB,aAAa,OAAO,EAAE,SAAS,KAAK;GAChE,IAAI;IACF,MAAM,QAAQ,KAAK,MAAM,aAAa,QAAA,2BAAqC,KAAK,MAAM;IACtF,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,aAAa,SAC9D,OAAQ,MAAgC,YAAY,YACrD,EAAE,SAAU,MAA+B,QAAQ,IACnD,EAAE,SAAS,KAAK;GACtB,QAAQ;IACN,OAAO,EAAE,SAAS,KAAK;GACzB;EACF;EAEA,IAAI,aAAa,kBAAkB;EACnC,MAAM,4BAAY,IAAI,IAAgB;;EAGtC,MAAa,0BAA0B;GACrC,mBAA4C;GAC5C,YAAY,aAAuC;IACjD,UAAU,IAAI,QAAQ;IACtB,aAAa;KAAE,UAAU,OAAO,QAAQ;IAAE;GAC5C;EACF;;EAGA,SAAgB,wBAAwB,SAAwB;GAC9D,IAAI,WAAW,YAAY,SAAS;GACpC,aAAa,EAAE,QAAQ;GACvB,IAAI,OAAO,iBAAiB,aAC1B,IAAI;IACF,aAAa,QAAQ,+BAA+B,KAAK,UAAU,UAAU,CAAC;GAChF,QAAQ,CAER;GAEF,KAAK,MAAM,YAAY,WAAW,SAAS;EAC7C;;;;;EC1CA,MAAa,kBAAkB;;EA+C/B,SAASA,WAAS,OAAwC;GACxD,IAAI,OAAO,UAAU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rB,GAAG,iBAAiB,CAAC;GAErB,MAAM,iBAAiB,YAA2B;IAChD,MAAM,WAAW,MAAM,MAAM,IAAI,IAAI,mBAAmB,OAAO,SAAS,MAAM,GAAG;KAC/E,QAAQ;KACR,aAAa;IACf,CAAC;IACD,IAAI,CAAC,SAAS,IAAI,MAAM,IAAI,MAAM,wDAAwD,OAAO,SAAS,MAAM,GAAG;GACrH;GACA,MAAM,aAAa,UAAuC;IACxD,IAAI,MAAM,WAAW,OAAO,UACtB,MAAM,MAAoC,SAAS,sBAAsB;IAC/E,eAAoB,CAAC,CAAC,OAAM,UAAS,QAAQ,MAAM,mCAAmC,KAAK,CAAC;GAC9F;GACA,IAAI,aAAa;IACf,OAAO,iBAAiB,WAAW,SAAS;IAC5C,eAAoB,CAAC,CAAC,OAAM,UAAS,QAAQ,MAAM,mCAAmC,KAAK,CAAC;IAC5F,aAAa,OAAO,oBAAoB,WAAW,SAAS;GAC9D,GAAG,sCAAsC;EAC3C"}
package/lib/index.js CHANGED
@@ -14,17 +14,17 @@ function modelIdOf(entry) {
14
14
  return typeof id === "string" && id.trim() !== "" ? id : null;
15
15
  }
16
16
  /** Narrow an unknown value to a plain object. */
17
- function asRecord$3(value) {
17
+ function asRecord$4(value) {
18
18
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
19
19
  }
20
20
  /** Read provider profiles out of a settings value. */
21
21
  function providersOf(value) {
22
- const root = asRecord$3(value);
23
- const providers = root === null ? null : asRecord$3(root[PROVIDERS_FIELD]);
22
+ const root = asRecord$4(value);
23
+ const providers = root === null ? null : asRecord$4(root[PROVIDERS_FIELD]);
24
24
  if (providers === null) return {};
25
25
  const result = {};
26
26
  for (const [providerId, profile] of Object.entries(providers)) {
27
- const narrowed = asRecord$3(profile);
27
+ const narrowed = asRecord$4(profile);
28
28
  if (narrowed !== null) result[providerId] = narrowed;
29
29
  }
30
30
  return result;
@@ -58,7 +58,7 @@ function modelIdsByProvider(providers) {
58
58
  for (const [providerId, profile] of Object.entries(providers)) {
59
59
  const models = profile[MODELS_FIELD];
60
60
  if (!Array.isArray(models)) continue;
61
- result[providerId] = models.map((entry) => asRecord$3(entry)).filter((entry) => entry !== null).map((entry) => modelIdOf(entry)).filter((id) => id !== null);
61
+ result[providerId] = models.map((entry) => asRecord$4(entry)).filter((entry) => entry !== null).map((entry) => modelIdOf(entry)).filter((id) => id !== null);
62
62
  }
63
63
  return result;
64
64
  }
@@ -79,7 +79,7 @@ function selectSharedModels(providers, sharedModelIds) {
79
79
  const models = profile[MODELS_FIELD];
80
80
  if (!Array.isArray(models)) continue;
81
81
  const kept = models.filter((entry) => {
82
- const narrowed = asRecord$3(entry);
82
+ const narrowed = asRecord$4(entry);
83
83
  const id = narrowed === null ? null : modelIdOf(narrowed);
84
84
  return id !== null && offered.has(id);
85
85
  });
@@ -113,9 +113,9 @@ function mergeProviders(local, adopted) {
113
113
  continue;
114
114
  }
115
115
  const localModels = Array.isArray(localProfile[MODELS_FIELD]) ? localProfile[MODELS_FIELD] : [];
116
- const localIds = new Set(localModels.map((entry) => asRecord$3(entry)).filter((entry) => entry !== null).map((entry) => modelIdOf(entry)).filter((id) => id !== null));
116
+ const localIds = new Set(localModels.map((entry) => asRecord$4(entry)).filter((entry) => entry !== null).map((entry) => modelIdOf(entry)).filter((id) => id !== null));
117
117
  const missing = adoptedModels.filter((entry) => {
118
- const narrowed = asRecord$3(entry);
118
+ const narrowed = asRecord$4(entry);
119
119
  const id = narrowed === null ? null : modelIdOf(narrowed);
120
120
  return id !== null && !localIds.has(id);
121
121
  });
@@ -147,7 +147,7 @@ async function writeModels(ctx, providers, revision) {
147
147
  //#endregion
148
148
  //#region src/model-sync.ts
149
149
  /** Narrow an unknown value to a plain object. */
150
- function asRecord$2(value) {
150
+ function asRecord$3(value) {
151
151
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
152
152
  }
153
153
  /**
@@ -190,10 +190,10 @@ var ModelSync = class {
190
190
  });
191
191
  if (response.status === 401) return void 0;
192
192
  if (!response.ok) throw new Error(`Shared model read failed with HTTP ${String(response.status)}`);
193
- const body = asRecord$2(await response.json());
193
+ const body = asRecord$3(await response.json());
194
194
  if (body === null) return void 0;
195
- const payload = asRecord$2(body.payload);
196
- const providers = payload === null ? null : asRecord$2(payload.providers);
195
+ const payload = asRecord$3(body.payload);
196
+ const providers = payload === null ? null : asRecord$3(payload.providers);
197
197
  return {
198
198
  sharingEnabled: body.sharingEnabled === true,
199
199
  payload: {
@@ -257,7 +257,7 @@ var ModelSync = class {
257
257
  const response = await fetch(new URL("/api/ai/shared-models/publication", this.apiBase()), { headers: { authorization: `Bearer ${token}` } });
258
258
  if (response.status === 401) return null;
259
259
  if (!response.ok) throw new Error(`Shared model status read failed with HTTP ${String(response.status)}`);
260
- const body = asRecord$2(await response.json());
260
+ const body = asRecord$3(await response.json());
261
261
  return {
262
262
  sharingEnabled: body?.sharingEnabled === true,
263
263
  canPublish: body?.canPublish === true
@@ -391,7 +391,7 @@ var ModelSync = class {
391
391
  /** Default state before this workspace stored anything. */
392
392
  const SECTION_SYNC_DEFAULT = { sections: {} };
393
393
  /** Narrow an unknown value to a plain object. */
394
- function asRecord$1(value) {
394
+ function asRecord$2(value) {
395
395
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
396
396
  }
397
397
  /**
@@ -430,7 +430,7 @@ var SettingsSync = class {
430
430
  readSection(ns) {
431
431
  const descriptor = this.ctx.settings.describe().find((entry) => entry.ns === ns);
432
432
  if (descriptor === void 0) return void 0;
433
- const value = asRecord$1(descriptor.value);
433
+ const value = asRecord$2(descriptor.value);
434
434
  if (value === null) return void 0;
435
435
  return {
436
436
  value,
@@ -534,7 +534,7 @@ var SettingsSync = class {
534
534
  //#endregion
535
535
  //#region src/skill-plaza.ts
536
536
  /** Narrow an unknown value to a plain object. */
537
- function asRecord(value) {
537
+ function asRecord$1(value) {
538
538
  return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
539
539
  }
540
540
  /**
@@ -658,7 +658,7 @@ var SkillPlaza = class {
658
658
  method: "POST",
659
659
  body: JSON.stringify({ skillId })
660
660
  });
661
- const record = body === void 0 ? null : asRecord(body);
661
+ const record = body === void 0 ? null : asRecord$1(body);
662
662
  if (record === null) return null;
663
663
  return {
664
664
  installed: record.installed === true,
@@ -668,7 +668,7 @@ var SkillPlaza = class {
668
668
  }
669
669
  /** Project one API row into the shape the browser reads. */
670
670
  toPlazaSkill(value) {
671
- const row = asRecord(value);
671
+ const row = asRecord$1(value);
672
672
  if (row === null || typeof row.id !== "number" || typeof row.name !== "string") return [];
673
673
  return [{
674
674
  id: row.id,
@@ -682,6 +682,96 @@ var SkillPlaza = class {
682
682
  }
683
683
  };
684
684
  //#endregion
685
+ //#region src/workspace-limits.ts
686
+ /** Narrow a value to a plain object. */
687
+ function asRecord(value) {
688
+ return typeof value === "object" && value !== null && !Array.isArray(value) ? value : null;
689
+ }
690
+ /** Narrow a value to a positive integer. */
691
+ function asByteCount(value) {
692
+ return typeof value === "number" && Number.isSafeInteger(value) && value > 0 ? value : null;
693
+ }
694
+ /**
695
+ * The workspace limits an administrator sets in DataOps.
696
+ *
697
+ * The plugin holds the DataOps JWT, so the browser cannot read these itself; this class is the
698
+ * only path from the Settings panel to that document.
699
+ */
700
+ var WorkspaceLimits = class {
701
+ ctx;
702
+ config;
703
+ constructor(ctx, config) {
704
+ this.ctx = ctx;
705
+ this.config = config;
706
+ }
707
+ /**
708
+ * Read the DataOps JWT this workspace is currently authorized with.
709
+ * @returns The token, or undefined when the workspace has no session yet.
710
+ */
711
+ async token() {
712
+ return (await this.ctx.credentials.resolve(credentialRef(this.config.credentialRef)))?.value;
713
+ }
714
+ /** The DataOps API origin this workspace reports to. */
715
+ apiBase() {
716
+ return new URL(this.config.baseUrl).origin;
717
+ }
718
+ /**
719
+ * Read the current ceilings.
720
+ * @returns The status, or undefined when the workspace is not authorized.
721
+ */
722
+ async status() {
723
+ const token = await this.token();
724
+ if (token === void 0) return void 0;
725
+ const response = await fetch(new URL("/api/ai/attachment-settings", this.apiBase()), { headers: { authorization: `Bearer ${token}` } });
726
+ if (response.status === 401) return void 0;
727
+ if (!response.ok) throw new Error(`Workspace limits read failed with HTTP ${String(response.status)}`);
728
+ const body = asRecord(await response.json());
729
+ const settings = body === null ? null : asRecord(body.settings);
730
+ const size = settings === null ? null : asRecord(settings.workspaceSize);
731
+ const fileReadMaxBytes = size === null ? null : asByteCount(size.fileReadMaxBytes);
732
+ const uploadMaxBytes = size === null ? null : asByteCount(size.uploadMaxBytes);
733
+ if (fileReadMaxBytes === null || uploadMaxBytes === null) throw new Error("Workspace limits read returned an unrecognized document");
734
+ return {
735
+ limits: {
736
+ fileReadMaxBytes,
737
+ uploadMaxBytes
738
+ },
739
+ canWrite: true,
740
+ readOnlyReason: null
741
+ };
742
+ }
743
+ /**
744
+ * Write new ceilings.
745
+ * @param limits - The ceilings to store.
746
+ * @returns The stored status.
747
+ */
748
+ async save(limits) {
749
+ const token = await this.token();
750
+ if (token === void 0) return void 0;
751
+ const response = await fetch(new URL("/api/ai/attachment-settings", this.apiBase()), {
752
+ method: "PATCH",
753
+ headers: {
754
+ authorization: `Bearer ${token}`,
755
+ "content-type": "application/json"
756
+ },
757
+ body: JSON.stringify({ workspaceSize: limits })
758
+ });
759
+ if (response.status === 401) return void 0;
760
+ if (!response.ok) throw new Error(`Workspace limits write failed with HTTP ${String(response.status)}`);
761
+ return this.status();
762
+ }
763
+ };
764
+ /** The live instance, so the Settings route can act on it after activation. */
765
+ let limitsRef;
766
+ /** @param next - Instance to publish, or undefined to clear. */
767
+ function setWorkspaceLimits(next) {
768
+ limitsRef = next;
769
+ }
770
+ /** @returns The live workspace-limits instance, when the plugin activated. */
771
+ function currentWorkspaceLimits() {
772
+ return limitsRef;
773
+ }
774
+ //#endregion
685
775
  //#region src/index.ts
686
776
  /** Cordis plugin name for the DataOps-managed integration. */
687
777
  const name = "dataops-managed";
@@ -700,6 +790,8 @@ const MANAGED_PLUGIN_ID = "dataops-managed";
700
790
  const MODEL_SYNC_PATH = "/integrations/dataops/model-sync";
701
791
  /** Same-origin route the skill center uses to read and change plaza sharing. */
702
792
  const SKILL_PLAZA_PATH = "/integrations/dataops/skill-plaza";
793
+ /** Same-origin route the Settings panel uses to read and change this workspace's limits. */
794
+ const WORKSPACE_LIMITS_PATH = "/integrations/dataops/workspace-limits";
703
795
  /** The live sync instance, so the settings routes can act on it after activation. */
704
796
  let modelSyncRef;
705
797
  /** The live plaza instance, so the skill center routes can act on it after activation. */
@@ -723,7 +815,7 @@ const Config = z.object({
723
815
  baseUrl: z.string().default("http://host.docker.internal:3101"),
724
816
  serverName: z.string().default("dataops"),
725
817
  credentialRef: z.string().role("credential-ref").default("DATAOPS_ACCESS_TOKEN"),
726
- toolCallTimeoutMs: z.number().min(1).default(12e4),
818
+ toolCallTimeoutMs: z.number().min(1).default(3e5),
727
819
  /**
728
820
  * Volatile so the settings service persists it in this workspace's document. The shape is
729
821
  * left open because the sync state is this plugin's own record, not user configuration.
@@ -843,6 +935,10 @@ async function apply(ctx, config) {
843
935
  baseUrl,
844
936
  credentialRef: config.credentialRef
845
937
  });
938
+ setWorkspaceLimits(new WorkspaceLimits(ctx, {
939
+ baseUrl,
940
+ credentialRef: config.credentialRef
941
+ }));
846
942
  /**
847
943
  * Adopt the publisher's models once the workspace has a session.
848
944
  *
@@ -1052,6 +1148,62 @@ async function apply(ctx, config) {
1052
1148
  }
1053
1149
  }
1054
1150
  }), "dataops-managed: skill plaza routes");
1151
+ /**
1152
+ * The workspace limits an administrator sets in DataOps.
1153
+ *
1154
+ * Read through the plugin because it holds the DataOps JWT; the page cannot reach those settings
1155
+ * itself. Same-origin only, like its neighbours.
1156
+ */
1157
+ ctx.effect(() => ctx.webServer.register({
1158
+ kind: "exact",
1159
+ path: WORKSPACE_LIMITS_PATH,
1160
+ handler: async (request, response) => {
1161
+ const limits = currentWorkspaceLimits();
1162
+ if (limits === void 0) {
1163
+ writeJson(response, 503, { error: "workspace limits are not active" });
1164
+ return;
1165
+ }
1166
+ try {
1167
+ if (request.method === "GET") {
1168
+ const status = await limits.status();
1169
+ if (status === void 0) {
1170
+ writeJson(response, 503, { error: "workspace limits are not active" });
1171
+ return;
1172
+ }
1173
+ writeJson(response, 200, status);
1174
+ return;
1175
+ }
1176
+ if (request.method !== "POST") {
1177
+ response.writeHead(405, {
1178
+ allow: "GET, POST",
1179
+ "content-length": "0"
1180
+ });
1181
+ response.end();
1182
+ return;
1183
+ }
1184
+ const body = await readJson(request);
1185
+ const fileReadMaxBytes = body?.fileReadMaxBytes;
1186
+ const uploadMaxBytes = body?.uploadMaxBytes;
1187
+ if (typeof fileReadMaxBytes !== "number" || typeof uploadMaxBytes !== "number") {
1188
+ writeJson(response, 400, { error: "both byte ceilings are required" });
1189
+ return;
1190
+ }
1191
+ const status = await limits.save({
1192
+ fileReadMaxBytes,
1193
+ uploadMaxBytes
1194
+ });
1195
+ if (status === void 0) {
1196
+ writeJson(response, 503, { error: "workspace limits are not active" });
1197
+ return;
1198
+ }
1199
+ writeJson(response, 200, status);
1200
+ } catch (error) {
1201
+ ctx.logger.warn("dataops-managed: workspace limits request failed");
1202
+ ctx.logger.warn(error);
1203
+ writeJson(response, 500, { error: error instanceof Error ? error.message : String(error) });
1204
+ }
1205
+ }
1206
+ }), "dataops-managed: workspace limits route");
1055
1207
  }
1056
1208
  /** Read and parse a JSON request body, tolerating an absent one. */
1057
1209
  async function readJson(request) {
@@ -1075,4 +1227,4 @@ function writeJson(response, status, body) {
1075
1227
  response.end(payload);
1076
1228
  }
1077
1229
  //#endregion
1078
- export { Config, MANAGED_AUTH_PATH, MANAGED_PLUGIN_ID, MODEL_SYNC_PATH, SKILL_PLAZA_PATH, apply, currentModelSync, currentSettingsSync, currentSkillPlaza, inject, name };
1230
+ export { Config, MANAGED_AUTH_PATH, MANAGED_PLUGIN_ID, MODEL_SYNC_PATH, SKILL_PLAZA_PATH, WORKSPACE_LIMITS_PATH, apply, currentModelSync, currentSettingsSync, currentSkillPlaza, currentWorkspaceLimits, inject, name };
@@ -39,6 +39,14 @@ export declare const en: {
39
39
  readonly plazaActionFailed: "The action could not be completed. Try again.";
40
40
  readonly plazaRetry: "Try again";
41
41
  readonly plazaRefresh: "Refresh";
42
+ readonly limitsTitle: "Workspace limits";
43
+ readonly limitsDescription: "The largest files this workspace may read and upload. Set by an administrator in DataOps.";
44
+ readonly limitsUnavailable: "Workspace limits are available once this workspace is connected to DataOps.";
45
+ readonly limitsFileReadLabel: "Largest file to read";
46
+ readonly limitsUploadLabel: "Largest file to upload";
47
+ readonly limitsUnit: "Units are MiB.";
48
+ readonly limitsSave: "Save limits";
49
+ readonly limitsSaving: "Saving…";
42
50
  };
43
51
  /** Stable key set shared by every managed DataOps locale. */
44
52
  export type ManagedDataOpsKey = keyof typeof en;
@@ -0,0 +1,27 @@
1
+ /** Same-origin workspace-limits calls from the DataOps settings surface. */
2
+ /** Route the plugin's Host half serves for workspace limits. */
3
+ export declare const WORKSPACE_LIMITS_PATH = "/integrations/dataops/workspace-limits";
4
+ /** The two byte ceilings, as the panel edits them. */
5
+ export interface WorkspaceLimits {
6
+ /** Largest file a sidebar download or agent read may carry. */
7
+ fileReadMaxBytes: number;
8
+ /** Largest file an upload may carry. */
9
+ uploadMaxBytes: number;
10
+ }
11
+ /** Limits as this workspace currently holds them. */
12
+ export interface WorkspaceLimitsStatus {
13
+ limits: WorkspaceLimits;
14
+ canWrite: boolean;
15
+ readOnlyReason: string | null;
16
+ }
17
+ /**
18
+ * Read the workspace limits the panel shows.
19
+ * @returns The status, or null when the workspace is not connected to DataOps.
20
+ */
21
+ export declare function fetchWorkspaceLimits(): Promise<WorkspaceLimitsStatus | null>;
22
+ /**
23
+ * Store new workspace limits.
24
+ * @param limits - The ceilings to store.
25
+ * @returns The stored status.
26
+ */
27
+ export declare function saveWorkspaceLimits(limits: WorkspaceLimits): Promise<WorkspaceLimitsStatus | null>;
@@ -4,6 +4,7 @@ import z from '@deepseek-ai/schemastery';
4
4
  import { ModelSync } from './model-sync.ts';
5
5
  import { SettingsSync, type SectionSyncState } from './settings-sync.ts';
6
6
  import { SkillPlaza } from './skill-plaza.ts';
7
+ import { currentWorkspaceLimits } from './workspace-limits.ts';
7
8
  /** Cordis plugin name for the DataOps-managed integration. */
8
9
  export declare const name = "dataops-managed";
9
10
  /** Host services required by managed JWT and MCP ownership. */
@@ -15,10 +16,13 @@ export declare const MANAGED_PLUGIN_ID = "dataops-managed";
15
16
  export declare const MODEL_SYNC_PATH = "/integrations/dataops/model-sync";
16
17
  /** Same-origin route the skill center uses to read and change plaza sharing. */
17
18
  export declare const SKILL_PLAZA_PATH = "/integrations/dataops/skill-plaza";
19
+ /** Same-origin route the Settings panel uses to read and change this workspace's limits. */
20
+ export declare const WORKSPACE_LIMITS_PATH = "/integrations/dataops/workspace-limits";
18
21
  /** The live skill plaza, once this plugin activated. */
19
22
  export declare function currentSkillPlaza(): SkillPlaza | undefined;
20
23
  /** The live model-sync instance, once this plugin activated. */
21
24
  export declare function currentModelSync(): ModelSync | undefined;
25
+ export { currentWorkspaceLimits };
22
26
  /** @returns The live instance, or undefined before this plugin activated. */
23
27
  export declare function currentSettingsSync(): SettingsSync | undefined;
24
28
  /** Configuration for the DataOps-managed MCP connection. */
@@ -0,0 +1,58 @@
1
+ /** Read and write the DataOps workspace limits this deployment enforces. */
2
+ import type { Context } from '@deepseek-ai/cordis';
3
+ /** The two byte ceilings one workspace size setting carries. */
4
+ export interface WorkspaceSizeLimits {
5
+ /** Largest file a sidebar download or agent read may carry. */
6
+ fileReadMaxBytes: number;
7
+ /** Largest file an upload may carry. */
8
+ uploadMaxBytes: number;
9
+ }
10
+ /** What the Settings panel reads. */
11
+ export interface WorkspaceLimitsStatus {
12
+ /** Current ceilings. */
13
+ limits: WorkspaceSizeLimits;
14
+ /** Whether the signed-in user may change them. */
15
+ canWrite: boolean;
16
+ /** Why the limits are read-only, when they are. */
17
+ readOnlyReason: string | null;
18
+ }
19
+ /** Configuration the host half receives from the profile. */
20
+ export interface WorkspaceLimitsConfig {
21
+ /** DataOps browser/API origin reachable from the DSH Host. */
22
+ baseUrl: string;
23
+ /** DSH credential reference holding the current DataOps access JWT. */
24
+ credentialRef: string;
25
+ }
26
+ /**
27
+ * The workspace limits an administrator sets in DataOps.
28
+ *
29
+ * The plugin holds the DataOps JWT, so the browser cannot read these itself; this class is the
30
+ * only path from the Settings panel to that document.
31
+ */
32
+ export declare class WorkspaceLimits {
33
+ private readonly ctx;
34
+ private readonly config;
35
+ constructor(ctx: Context, config: WorkspaceLimitsConfig);
36
+ /**
37
+ * Read the DataOps JWT this workspace is currently authorized with.
38
+ * @returns The token, or undefined when the workspace has no session yet.
39
+ */
40
+ private token;
41
+ /** The DataOps API origin this workspace reports to. */
42
+ private apiBase;
43
+ /**
44
+ * Read the current ceilings.
45
+ * @returns The status, or undefined when the workspace is not authorized.
46
+ */
47
+ status(): Promise<WorkspaceLimitsStatus | undefined>;
48
+ /**
49
+ * Write new ceilings.
50
+ * @param limits - The ceilings to store.
51
+ * @returns The stored status.
52
+ */
53
+ save(limits: WorkspaceSizeLimits): Promise<WorkspaceLimitsStatus | undefined>;
54
+ }
55
+ /** @param next - Instance to publish, or undefined to clear. */
56
+ export declare function setWorkspaceLimits(next: WorkspaceLimits | undefined): void;
57
+ /** @returns The live workspace-limits instance, when the plugin activated. */
58
+ export declare function currentWorkspaceLimits(): WorkspaceLimits | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sparkelf/dsh-dataops-managed",
3
- "version": "0.3.12",
3
+ "version": "0.3.14",
4
4
  "description": "DataOps JWT intake and credential-backed MCP tools for managed DeepSeek Harness workspaces.",
5
5
  "type": "module",
6
6
  "main": "./lib/index.js",