@matamt-dbg/dsh-studio 0.2.8 → 0.2.9

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.
Files changed (3) hide show
  1. package/client.js +54 -18
  2. package/index.js +1 -1
  3. package/package.json +1 -1
package/client.js CHANGED
@@ -160,11 +160,6 @@ ${adapter}.studio-ui *, .studio-ui *::before, .studio-ui *::after { box-sizing:
160
160
  .studio-ui .studio-selection-detail { padding: 16px; margin-top: 12px; border: 1px solid var(--studio-line); border-radius: var(--studio-radius); }
161
161
  .studio-ui .studio-schema-tool { margin-top: 12px; padding: 10px; border: 1px solid var(--studio-line); border-radius: var(--studio-small-radius); }
162
162
  .studio-ui .studio-schema-tool summary { cursor: pointer; overflow-wrap: anywhere; }
163
- .studio-ui .studio-schema-fields { margin: 8px 0; }
164
- .studio-ui .studio-schema-fields > div { display: grid; grid-template-columns: minmax(70px, 120px) minmax(0, 1fr); gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--studio-line); }
165
- .studio-ui .studio-schema-fields dt { color: var(--studio-muted); overflow-wrap: anywhere; }
166
- .studio-ui .studio-schema-fields dd { margin: 0; min-width: 0; }
167
- .studio-ui .studio-schema-list { padding-inline-start: 20px; }
168
163
  .studio-ui .studio-schema-meta { color: var(--studio-muted); font-size: 12px; }
169
164
  .studio-ui .studio-row button[aria-pressed="true"] { background: var(--studio-hover); border-color: var(--studio-ink); }
170
165
  .studio-ui .studio-tool-description { white-space: pre-wrap; overflow-wrap: anywhere; }
@@ -606,7 +601,17 @@ ${adapter}.studio-ui *, .studio-ui *::before, .studio-ui *::after { box-sizing:
606
601
  .studio-ui .studio-preview .studio-schema-tool { margin-top: 6px; padding: 8px 10px; background: var(--studio-bg); }
607
602
  .studio-ui .studio-preview .studio-schema-tool summary { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
608
603
  .studio-ui .studio-preview .studio-schema-tool p { font-size: 12px; }
609
- .studio-ui .studio-preview .studio-schema-fields > div { grid-template-columns: minmax(60px, 90px) minmax(0, 1fr); font-size: 12px; }
604
+ .studio-ui .studio-schema-params { display: grid; gap: 8px; margin-top: 8px; font-size: 12px; }
605
+ .studio-ui .studio-schema-param { display: grid; gap: 4px; min-width: 0; }
606
+ .studio-ui .studio-schema-param .studio-schema-param { margin-top: 4px; padding-inline-start: 10px; border-inline-start: 1px solid var(--studio-line); }
607
+ .studio-ui .studio-schema-param-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; min-width: 0; }
608
+ .studio-ui .studio-schema-param-head code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 500; overflow-wrap: anywhere; }
609
+ .studio-ui .studio-schema-required { color: var(--studio-warn); font-size: 11px; }
610
+ .studio-ui .studio-schema-param p { margin: 0; color: var(--studio-muted); line-height: 1.5; }
611
+ .studio-ui .studio-schema-constraints { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; padding: 0; list-style: none; }
612
+ .studio-ui .studio-schema-constraints li { padding: 0 6px; border-radius: var(--studio-small-radius); background: var(--studio-neutral-fill); color: var(--studio-muted); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; overflow-wrap: anywhere; }
613
+ .studio-ui .studio-schema-constraints li > span { color: var(--studio-subtle); }
614
+ .studio-ui .studio-schema-constraint { color: var(--studio-muted); overflow-wrap: anywhere; }
610
615
  @container studio-shell (max-width: 900px) { .studio-ui .studio-preview { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 2fr) minmax(0, 1fr); } }
611
616
 
612
617
  /* Width rules follow the Studio surface and its content column, which the host sidebar and the Studio navigation narrow. */
@@ -1059,7 +1064,7 @@ var PACKAGE_NAME = "@matamt-dbg/dsh-studio";
1059
1064
  var POLICY_PLUGIN = `${PACKAGE_NAME}/policy`;
1060
1065
  var ROLE_PLUGIN = `${PACKAGE_NAME}/roles`;
1061
1066
  var BATCH_PLUGIN = `${PACKAGE_NAME}/batch`;
1062
- var STUDIO_VERSION = "0.2.8";
1067
+ var STUDIO_VERSION = "0.2.9";
1063
1068
 
1064
1069
  // src/delegation.ts
1065
1070
  var ROLE_TOOL = "subagent_role";
@@ -1827,7 +1832,7 @@ function PromptToolsPrototype({ locale, prompt, onPromptChange, provided, onProv
1827
1832
  result.tools.length ? result.tools.map((tool) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { className: "studio-schema-tool", children: [
1828
1833
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: tool.name }),
1829
1834
  /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "studio-tool-description", children: tool.description }),
1830
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaValue, { value: tool.parameters })
1835
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaValue, { value: tool.parameters, requiredLabel: t("\uD544\uC218", "required", "\u5FC5\u586B") })
1831
1836
  ] }, tool.name)) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "studio-muted", children: labels.empty })
1832
1837
  ] })
1833
1838
  ] })
@@ -1836,16 +1841,47 @@ function PromptToolsPrototype({ locale, prompt, onPromptChange, provided, onProv
1836
1841
  )
1837
1842
  ] });
1838
1843
  }
1839
- function SchemaValue({ value }) {
1840
- if (Array.isArray(value)) return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "studio-schema-list", children: value.map((entry, index) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaValue, { value: entry }) }, index)) });
1841
- if (value !== null && typeof value === "object") return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dl", { className: "studio-schema-fields", children: Object.entries(value).map(([key, entry]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1842
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dt", { children: key }),
1843
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("dd", { children: key === "properties" || key === "items" || key === "$defs" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("details", { children: [
1844
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("summary", { children: key }),
1845
- /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaValue, { value: entry })
1846
- ] }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaValue, { value: entry }) })
1847
- ] }, key)) });
1848
- return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "studio-tool-description", children: String(value) });
1844
+ function SchemaValue({ value, requiredLabel }) {
1845
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "studio-schema-params", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaBody, { schema: value, requiredLabel }) });
1846
+ }
1847
+ var STRUCTURAL_KEYS = /* @__PURE__ */ new Set(["type", "description", "properties", "items", "required"]);
1848
+ function schemaType(schema) {
1849
+ if (Array.isArray(schema.type)) return schema.type.join(" | ");
1850
+ if (typeof schema.type === "string") return schema.type;
1851
+ return Array.isArray(schema.enum) ? "enum" : "";
1852
+ }
1853
+ function constraintText(value) {
1854
+ if (Array.isArray(value) && value.every((entry) => entry === null || typeof entry !== "object")) return value.map(String).join(", ");
1855
+ return value !== null && typeof value === "object" ? JSON.stringify(value) : String(value);
1856
+ }
1857
+ function SchemaBody({ schema, requiredLabel }) {
1858
+ if (!schema || typeof schema !== "object" || Array.isArray(schema)) return schema === void 0 ? null : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "studio-schema-constraint", children: constraintText(schema) });
1859
+ const row = schema;
1860
+ const required = Array.isArray(row.required) ? row.required : [];
1861
+ const properties = row.properties && typeof row.properties === "object" && !Array.isArray(row.properties) ? Object.entries(row.properties) : [];
1862
+ const constraints = Object.entries(row).filter(([key]) => !STRUCTURAL_KEYS.has(key) || key === "properties" && !properties.length || key === "required" && !properties.length);
1863
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_jsx_runtime7.Fragment, { children: [
1864
+ constraints.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("ul", { className: "studio-schema-constraints", children: constraints.map(([key, entry]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("li", { children: [
1865
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { children: key }),
1866
+ " ",
1867
+ constraintText(entry)
1868
+ ] }, key)) }),
1869
+ properties.map(([name, child]) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaParam, { name, schema: child, required: required.includes(name), requiredLabel }, name)),
1870
+ row.items !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaParam, { name: "items", schema: row.items, requiredLabel })
1871
+ ] });
1872
+ }
1873
+ function SchemaParam({ name, schema, required, requiredLabel }) {
1874
+ const row = schema && typeof schema === "object" && !Array.isArray(schema) ? schema : void 0;
1875
+ const type = row ? schemaType(row) : "";
1876
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "studio-schema-param", children: [
1877
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "studio-schema-param-head", children: [
1878
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("code", { children: name }),
1879
+ type && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "studio-schema-meta", children: type }),
1880
+ required && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "studio-schema-required", children: requiredLabel })
1881
+ ] }),
1882
+ typeof row?.description === "string" && row.description && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "studio-tool-description", children: row.description }),
1883
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(SchemaBody, { schema: row ? Object.fromEntries(Object.entries(row).filter(([key]) => key !== "type" && key !== "description")) : schema, requiredLabel })
1884
+ ] });
1849
1885
  }
1850
1886
  function parameterFields(schema, prefix = "") {
1851
1887
  if (!schema || typeof schema !== "object" || Array.isArray(schema)) return [];
package/index.js CHANGED
@@ -56,7 +56,7 @@ var BATCH_PLUGIN = `${PACKAGE_NAME}/batch`;
56
56
  function currentPluginName(name) {
57
57
  return name === LEGACY_PACKAGE_NAME || name.startsWith(`${LEGACY_PACKAGE_NAME}/`) ? PACKAGE_NAME + name.slice(LEGACY_PACKAGE_NAME.length) : name;
58
58
  }
59
- var STUDIO_VERSION = "0.2.8";
59
+ var STUDIO_VERSION = "0.2.9";
60
60
 
61
61
  // src/delegation.ts
62
62
  var ROLE_TOOL = "subagent_role";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@matamt-dbg/dsh-studio",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "DSH Studio: build, edit and apply DeepSeek Harness agent presets — tools, prompts, Configs and role-based subagents — from the web GUI.",
5
5
  "keywords": [
6
6
  "deepseek-harness",