@qilin-agent/client-ui-agent-preset 3.1.6 → 3.1.7

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
@@ -904,7 +904,7 @@ window.__ModuleLoader__.load({
904
904
  return (0, react_jsx_runtime.jsxs)("span", {
905
905
  className: AgentPresetLabel_module_css_default.label,
906
906
  title: text?.description ?? t("headerHint"),
907
- children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutline16, {
907
+ children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutlineRegular, {
908
908
  size: 14,
909
909
  className: AgentPresetLabel_module_css_default.icon
910
910
  }), text?.name ?? preset]
@@ -1079,12 +1079,12 @@ window.__ModuleLoader__.load({
1079
1079
  setOpen((value) => !value);
1080
1080
  },
1081
1081
  children: [
1082
- (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutline16, { className: introducing ? `${AgentPresetSeat_module_css_default.seatIcon} ${AgentPresetSeat_module_css_default.introIcon}` : AgentPresetSeat_module_css_default.seatIcon }),
1082
+ (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutlineRegular, { className: introducing ? `${AgentPresetSeat_module_css_default.seatIcon} ${AgentPresetSeat_module_css_default.introIcon}` : AgentPresetSeat_module_css_default.seatIcon }),
1083
1083
  (0, react_jsx_runtime.jsx)("span", {
1084
1084
  className: AgentPresetSeat_module_css_default.seatLabel,
1085
1085
  children: shownLabel
1086
1086
  }),
1087
- (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconChevronDownOutline14, { className: AgentPresetSeat_module_css_default.chevron })
1087
+ (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconChevronDownOutlineRegular, { className: AgentPresetSeat_module_css_default.chevron })
1088
1088
  ]
1089
1089
  })
1090
1090
  }), toast !== null && (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.Toast, {
@@ -1092,7 +1092,7 @@ window.__ModuleLoader__.load({
1092
1092
  name: presetDisplayText(toast.error.preset, t).name,
1093
1093
  reason: toast.error.reason
1094
1094
  }),
1095
- icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconWarningOutline16, {}),
1095
+ icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconWarningOutlineRegular, {}),
1096
1096
  holdMs: REFUSAL_HOLD_MS,
1097
1097
  anchor: document.querySelector("[data-composer-card]"),
1098
1098
  onDone: () => {
@@ -1135,7 +1135,7 @@ window.__ModuleLoader__.load({
1135
1135
  else if (roster.status === "error" || roster.status === "unavailable") description = t("createPluginUnavailable");
1136
1136
  else if (!enabled) description = t("createPluginMissing");
1137
1137
  return (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.MenuItemButton, {
1138
- icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutline16, { size: 14 }),
1138
+ icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutlineRegular, { size: 14 }),
1139
1139
  disabled: !enabled,
1140
1140
  onSelect: () => {
1141
1141
  onDismiss();
@@ -1880,7 +1880,7 @@ window.__ModuleLoader__.load({
1880
1880
  props.startCreatorDraft?.();
1881
1881
  props.close();
1882
1882
  },
1883
- children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconPlusOutline16, { size: 14 }), t("creatorDraft")]
1883
+ children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }), t("creatorDraft")]
1884
1884
  }) : null;
1885
1885
  return (0, react_jsx_runtime.jsxs)("div", {
1886
1886
  className: AgentPresetSection_module_css_default.section,
@@ -2005,7 +2005,7 @@ window.__ModuleLoader__.load({
2005
2005
  onClick: () => {
2006
2006
  props.view(row.id);
2007
2007
  },
2008
- children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconBrowseOutline16, {})
2008
+ children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconBrowseOutlineRegular, {})
2009
2009
  }) : null : (0, react_jsx_runtime.jsx)("button", {
2010
2010
  type: "button",
2011
2011
  className: AgentPresetSection_module_css_default.iconButton,
@@ -2014,7 +2014,7 @@ window.__ModuleLoader__.load({
2014
2014
  onClick: () => {
2015
2015
  props.openLocation(row.id);
2016
2016
  },
2017
- children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconFolderOpenOutline16, {})
2017
+ children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconFolderOpenOutlineRegular, {})
2018
2018
  }),
2019
2019
  (0, react_jsx_runtime.jsx)("button", {
2020
2020
  type: "button",
@@ -2025,7 +2025,7 @@ window.__ModuleLoader__.load({
2025
2025
  onClick: () => {
2026
2026
  props.beginCopy(row.id);
2027
2027
  },
2028
- children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconCopyOutline16, {})
2028
+ children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconCopyOutlineRegular, {})
2029
2029
  }),
2030
2030
  row.trust === "user" ? (0, react_jsx_runtime.jsx)("button", {
2031
2031
  type: "button",
@@ -2035,7 +2035,7 @@ window.__ModuleLoader__.load({
2035
2035
  onClick: () => {
2036
2036
  props.confirmDelete(row.id);
2037
2037
  },
2038
- children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconTrashOutline16, {})
2038
+ children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconTrashOutlineRegular, {})
2039
2039
  }) : null
2040
2040
  ]
2041
2041
  }),
@@ -2328,6 +2328,22 @@ window.__ModuleLoader__.load({
2328
2328
  return typeof value === "string" ? value : void 0;
2329
2329
  }
2330
2330
  //#endregion
2331
+ //#region lib/types/client/analytics.js
2332
+ /** Resolve a known selection by preset id without treating an unloaded state as a default.
2333
+ * @param id - selected preset id; an empty id means unknown.
2334
+ * @returns the built-in category for a shipped id, other for any other id, or undefined until known.
2335
+ */
2336
+ function analyticsMode(id) {
2337
+ if (id === "") return void 0;
2338
+ switch (id) {
2339
+ case "cordis": return "creator";
2340
+ case "ptc": return "ptc";
2341
+ case "minimal": return "minimal";
2342
+ case "standard": return "standard";
2343
+ default: return "other";
2344
+ }
2345
+ }
2346
+ //#endregion
2331
2347
  //#region lib/types/client/index.js
2332
2348
  /**
2333
2349
  * Agent-preset surface plugin, browser half — three surfaces over one roster:
@@ -2382,11 +2398,12 @@ window.__ModuleLoader__.load({
2382
2398
  unboundSeat.load();
2383
2399
  for (const seat of seats.values) seat.load();
2384
2400
  });
2401
+ const mainBlank = (scope) => Object.values(scope.sessions.list.getSnapshot().byId).find((session) => {
2402
+ /* v8 ignore next -- retained source counts omit zero-valued entries. */
2403
+ return session.blank && (session.retainedBy.mainView ?? 0) > 0;
2404
+ });
2385
2405
  const mainBlankSeat = (scope) => {
2386
- const summary = Object.values(scope.sessions.list.getSnapshot().byId).find((session) => {
2387
- /* v8 ignore next -- retained source counts omit zero-valued entries. */
2388
- return session.blank && (session.retainedBy.mainView ?? 0) > 0;
2389
- });
2406
+ const summary = mainBlank(scope);
2390
2407
  const binding = summary === void 0 ? void 0 : scope.sessions.binding(summary.id);
2391
2408
  return binding === void 0 ? void 0 : seatFor(scope, binding);
2392
2409
  };
@@ -2424,7 +2441,18 @@ window.__ModuleLoader__.load({
2424
2441
  return {
2425
2442
  hooks: { agentPresetSeat: seat.store },
2426
2443
  load: () => seat.load(),
2427
- select: (id) => seat.select(id),
2444
+ select: async (id) => {
2445
+ const from = analyticsMode(seat.store.getSnapshot().current);
2446
+ const to = analyticsMode(id);
2447
+ const enabled = ctx.get("configForms")?.developerTools.enabled.getSnapshot();
2448
+ const refused = await seat.select(id);
2449
+ if (refused === void 0 && seat.store.getSnapshot().current === id && from !== void 0 && to !== void 0 && to !== "other" && from !== to && enabled !== void 0) ctx.get("productAnalytics")?.track("agent_preset_switch", {
2450
+ switch_from: from,
2451
+ switch_to: to,
2452
+ code_work_view_enabled: enabled
2453
+ });
2454
+ return refused;
2455
+ },
2428
2456
  dismissRefusal: (error) => {
2429
2457
  seat.dismissRefusal(error);
2430
2458
  },
@@ -2439,9 +2467,10 @@ window.__ModuleLoader__.load({
2439
2467
  });
2440
2468
  const startCreatorDraft = () => {
2441
2469
  if (!section.store.getSnapshot().showPicker) return;
2470
+ const listed = mainBlank(scope)?.projectionValues?.agentPreset;
2442
2471
  const seat = mainBlankSeat(scope) ?? unboundSeat;
2443
- seat.stage("ptc", true);
2444
- scope.uiWorkspace.startSession();
2472
+ if (typeof listed !== "string" || listed === "ptc") seat.stage("ptc", true);
2473
+ scope.uiWorkspace.startSession(void 0, { agentPreset: "ptc" });
2445
2474
  seat.apply();
2446
2475
  };
2447
2476
  scope.effect(() => {
@@ -0,0 +1,8 @@
1
+ /** Fixed analytics categories for the picker; custom preset ids never leave this package. */
2
+ import type { AnalyticsPreset } from '@qilin-agent/client-product-analytics/client';
3
+ /** Resolve a known selection by preset id without treating an unloaded state as a default.
4
+ * @param id - selected preset id; an empty id means unknown.
5
+ * @returns the built-in category for a shipped id, other for any other id, or undefined until known.
6
+ */
7
+ export declare function analyticsMode(id: string): AnalyticsPreset | 'other' | undefined;
8
+ //# sourceMappingURL=analytics.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@qilin-agent/client-ui-agent-preset",
3
3
  "description": "Agent-preset surfaces: the default for later sessions, this session's seat, and the composition editor",
4
- "version": "3.1.6",
4
+ "version": "3.1.7",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -50,24 +50,25 @@
50
50
  "devDependencies": {
51
51
  "@types/react": "~18.3.1",
52
52
  "react": "^18.2.0",
53
- "@qilin-agent/api-session-controller": "3.1.6",
54
- "@qilin-agent/agent-presets": "3.1.6",
55
- "@qilin-agent/api-remotes": "3.1.6",
56
- "@qilin-agent/client-connection": "3.1.6",
57
- "@qilin-agent/client-store": "3.1.6",
58
- "@qilin-agent/client-locale": "3.1.6",
59
- "@qilin-agent/client-ui-conversation": "3.1.6",
60
- "@qilin-agent/client-test-runtime": "3.1.6",
61
- "@qilin-agent/client-ui-plugin-manager": "3.1.6",
62
- "@qilin-agent/client-ui-settings": "3.1.6",
63
- "@qilin-agent/session": "3.1.6",
64
- "@qilin-agent/util-values": "3.1.6",
53
+ "@qilin-agent/api-remotes": "3.1.7",
54
+ "@qilin-agent/api-session-controller": "3.1.7",
55
+ "@qilin-agent/agent-presets": "3.1.7",
56
+ "@qilin-agent/client-connection": "3.1.7",
57
+ "@qilin-agent/client-locale": "3.1.7",
58
+ "@qilin-agent/client-store": "3.1.7",
59
+ "@qilin-agent/client-product-analytics": "3.1.7",
60
+ "@qilin-agent/client-test-runtime": "3.1.7",
61
+ "@qilin-agent/client-ui-conversation": "3.1.7",
62
+ "@qilin-agent/client-ui-plugin-manager": "3.1.7",
63
+ "@qilin-agent/client-ui-primitives": "3.1.7",
64
+ "@qilin-agent/client-ui-settings": "3.1.7",
65
+ "@qilin-agent/client-ui-slots": "3.1.7",
66
+ "@qilin-agent/util-values": "3.1.7",
65
67
  "@qilin-agent/kylin": "~4.0.5",
66
- "@qilin-agent/client-ui-primitives": "3.1.6",
67
- "@qilin-agent/client-ui-renderer": "3.1.6",
68
- "@qilin-agent/client-ui-session": "3.1.6",
69
- "@qilin-agent/client-ui-workspace": "3.1.6",
70
- "@qilin-agent/client-ui-slots": "3.1.6"
68
+ "@qilin-agent/session": "3.1.7",
69
+ "@qilin-agent/client-ui-session": "3.1.7",
70
+ "@qilin-agent/client-ui-renderer": "3.1.7",
71
+ "@qilin-agent/client-ui-workspace": "3.1.7"
71
72
  },
72
73
  "files": [
73
74
  "lib/index.js",