@qilin-agent/client-ui-agent-preset 3.1.5 → 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 +63 -24
- package/lib/types/client/analytics.d.ts +8 -0
- package/lib/types/client/locales.d.ts +1 -1
- package/package.json +21 -20
package/lib/client.js
CHANGED
|
@@ -706,10 +706,16 @@ window.__ModuleLoader__.load({
|
|
|
706
706
|
};
|
|
707
707
|
//#endregion
|
|
708
708
|
//#region ../../preset/agent-presets/src/display.ts
|
|
709
|
-
const BUILT_IN_PRESET_KEYS = {
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
709
|
+
const BUILT_IN_PRESET_KEYS = {
|
|
710
|
+
standard: {
|
|
711
|
+
name: "presetStandardName",
|
|
712
|
+
description: "presetStandardDescription"
|
|
713
|
+
},
|
|
714
|
+
ptc: {
|
|
715
|
+
name: "presetPtcName",
|
|
716
|
+
description: "presetPtcDescription"
|
|
717
|
+
}
|
|
718
|
+
};
|
|
713
719
|
/**
|
|
714
720
|
* Resolve preset display copy without making user-authored metadata translatable.
|
|
715
721
|
* @param preset - roster row whose copy is being rendered.
|
|
@@ -741,8 +747,10 @@ window.__ModuleLoader__.load({
|
|
|
741
747
|
builtIn: "Built-in",
|
|
742
748
|
setDefault: "Set as default",
|
|
743
749
|
view: "View",
|
|
750
|
+
presetStandardName: "Standard mode",
|
|
751
|
+
presetStandardDescription: "A general-purpose agent for everyday and office work — writing, research, files, and spreadsheets — with full coding, shell, skills, planning, and subagent capabilities.",
|
|
744
752
|
presetPtcName: "Coding mode",
|
|
745
|
-
presetPtcDescription: "
|
|
753
|
+
presetPtcDescription: "An agent optimized for coding beyond the standard capabilities: a custom program composition wraps coding tasks before they reach the model, cutting calls and context, with deeper coding-focused tool and flow optimizations.",
|
|
746
754
|
duplicate: "Duplicate",
|
|
747
755
|
duplicateUnavailable: "This deployment has no writable preset directory",
|
|
748
756
|
delete: "Delete",
|
|
@@ -800,8 +808,10 @@ window.__ModuleLoader__.load({
|
|
|
800
808
|
builtIn: "内置",
|
|
801
809
|
setDefault: "设为默认",
|
|
802
810
|
view: "查看",
|
|
811
|
+
presetStandardName: "普通模式",
|
|
812
|
+
presetStandardDescription: "面向日常与办公任务的通用 Agent:写作、检索、文件与表格处理都能胜任,也具备完整的编码、Shell、Skills、计划与子代理能力。",
|
|
803
813
|
presetPtcName: "编码模式",
|
|
804
|
-
presetPtcDescription: "
|
|
814
|
+
presetPtcDescription: "在普通能力之上为编码任务深度优化的 Agent:以自定义程序组合把编码任务封装后与模型交互,减少调用次数与上下文占用,并针对编码场景做了更深的工具与流程优化。",
|
|
805
815
|
duplicate: "复制",
|
|
806
816
|
duplicateUnavailable: "此部署未配置可写的预设目录",
|
|
807
817
|
delete: "删除",
|
|
@@ -894,7 +904,7 @@ window.__ModuleLoader__.load({
|
|
|
894
904
|
return (0, react_jsx_runtime.jsxs)("span", {
|
|
895
905
|
className: AgentPresetLabel_module_css_default.label,
|
|
896
906
|
title: text?.description ?? t("headerHint"),
|
|
897
|
-
children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
907
|
+
children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutlineRegular, {
|
|
898
908
|
size: 14,
|
|
899
909
|
className: AgentPresetLabel_module_css_default.icon
|
|
900
910
|
}), text?.name ?? preset]
|
|
@@ -1069,12 +1079,12 @@ window.__ModuleLoader__.load({
|
|
|
1069
1079
|
setOpen((value) => !value);
|
|
1070
1080
|
},
|
|
1071
1081
|
children: [
|
|
1072
|
-
(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
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 }),
|
|
1073
1083
|
(0, react_jsx_runtime.jsx)("span", {
|
|
1074
1084
|
className: AgentPresetSeat_module_css_default.seatLabel,
|
|
1075
1085
|
children: shownLabel
|
|
1076
1086
|
}),
|
|
1077
|
-
(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
1087
|
+
(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconChevronDownOutlineRegular, { className: AgentPresetSeat_module_css_default.chevron })
|
|
1078
1088
|
]
|
|
1079
1089
|
})
|
|
1080
1090
|
}), toast !== null && (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.Toast, {
|
|
@@ -1082,7 +1092,7 @@ window.__ModuleLoader__.load({
|
|
|
1082
1092
|
name: presetDisplayText(toast.error.preset, t).name,
|
|
1083
1093
|
reason: toast.error.reason
|
|
1084
1094
|
}),
|
|
1085
|
-
icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
1095
|
+
icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconWarningOutlineRegular, {}),
|
|
1086
1096
|
holdMs: REFUSAL_HOLD_MS,
|
|
1087
1097
|
anchor: document.querySelector("[data-composer-card]"),
|
|
1088
1098
|
onDone: () => {
|
|
@@ -1125,7 +1135,7 @@ window.__ModuleLoader__.load({
|
|
|
1125
1135
|
else if (roster.status === "error" || roster.status === "unavailable") description = t("createPluginUnavailable");
|
|
1126
1136
|
else if (!enabled) description = t("createPluginMissing");
|
|
1127
1137
|
return (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.MenuItemButton, {
|
|
1128
|
-
icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
1138
|
+
icon: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconAgentPresetOutlineRegular, { size: 14 }),
|
|
1129
1139
|
disabled: !enabled,
|
|
1130
1140
|
onSelect: () => {
|
|
1131
1141
|
onDismiss();
|
|
@@ -1870,7 +1880,7 @@ window.__ModuleLoader__.load({
|
|
|
1870
1880
|
props.startCreatorDraft?.();
|
|
1871
1881
|
props.close();
|
|
1872
1882
|
},
|
|
1873
|
-
children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
1883
|
+
children: [(0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }), t("creatorDraft")]
|
|
1874
1884
|
}) : null;
|
|
1875
1885
|
return (0, react_jsx_runtime.jsxs)("div", {
|
|
1876
1886
|
className: AgentPresetSection_module_css_default.section,
|
|
@@ -1980,7 +1990,7 @@ window.__ModuleLoader__.load({
|
|
|
1980
1990
|
}),
|
|
1981
1991
|
(0, react_jsx_runtime.jsx)("code", {
|
|
1982
1992
|
className: AgentPresetSection_module_css_default.cardId,
|
|
1983
|
-
children: row.id
|
|
1993
|
+
children: row.trust === "user" ? row.id : ""
|
|
1984
1994
|
})
|
|
1985
1995
|
]
|
|
1986
1996
|
}),
|
|
@@ -1995,7 +2005,7 @@ window.__ModuleLoader__.load({
|
|
|
1995
2005
|
onClick: () => {
|
|
1996
2006
|
props.view(row.id);
|
|
1997
2007
|
},
|
|
1998
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
2008
|
+
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconBrowseOutlineRegular, {})
|
|
1999
2009
|
}) : null : (0, react_jsx_runtime.jsx)("button", {
|
|
2000
2010
|
type: "button",
|
|
2001
2011
|
className: AgentPresetSection_module_css_default.iconButton,
|
|
@@ -2004,7 +2014,7 @@ window.__ModuleLoader__.load({
|
|
|
2004
2014
|
onClick: () => {
|
|
2005
2015
|
props.openLocation(row.id);
|
|
2006
2016
|
},
|
|
2007
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
2017
|
+
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconFolderOpenOutlineRegular, {})
|
|
2008
2018
|
}),
|
|
2009
2019
|
(0, react_jsx_runtime.jsx)("button", {
|
|
2010
2020
|
type: "button",
|
|
@@ -2015,7 +2025,7 @@ window.__ModuleLoader__.load({
|
|
|
2015
2025
|
onClick: () => {
|
|
2016
2026
|
props.beginCopy(row.id);
|
|
2017
2027
|
},
|
|
2018
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
2028
|
+
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconCopyOutlineRegular, {})
|
|
2019
2029
|
}),
|
|
2020
2030
|
row.trust === "user" ? (0, react_jsx_runtime.jsx)("button", {
|
|
2021
2031
|
type: "button",
|
|
@@ -2025,7 +2035,7 @@ window.__ModuleLoader__.load({
|
|
|
2025
2035
|
onClick: () => {
|
|
2026
2036
|
props.confirmDelete(row.id);
|
|
2027
2037
|
},
|
|
2028
|
-
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.
|
|
2038
|
+
children: (0, react_jsx_runtime.jsx)(_qilin_agent_client_ui_primitives.IconTrashOutlineRegular, {})
|
|
2029
2039
|
}) : null
|
|
2030
2040
|
]
|
|
2031
2041
|
}),
|
|
@@ -2318,6 +2328,22 @@ window.__ModuleLoader__.load({
|
|
|
2318
2328
|
return typeof value === "string" ? value : void 0;
|
|
2319
2329
|
}
|
|
2320
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
|
|
2321
2347
|
//#region lib/types/client/index.js
|
|
2322
2348
|
/**
|
|
2323
2349
|
* Agent-preset surface plugin, browser half — three surfaces over one roster:
|
|
@@ -2372,11 +2398,12 @@ window.__ModuleLoader__.load({
|
|
|
2372
2398
|
unboundSeat.load();
|
|
2373
2399
|
for (const seat of seats.values) seat.load();
|
|
2374
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
|
+
});
|
|
2375
2405
|
const mainBlankSeat = (scope) => {
|
|
2376
|
-
const summary =
|
|
2377
|
-
/* v8 ignore next -- retained source counts omit zero-valued entries. */
|
|
2378
|
-
return session.blank && (session.retainedBy.mainView ?? 0) > 0;
|
|
2379
|
-
});
|
|
2406
|
+
const summary = mainBlank(scope);
|
|
2380
2407
|
const binding = summary === void 0 ? void 0 : scope.sessions.binding(summary.id);
|
|
2381
2408
|
return binding === void 0 ? void 0 : seatFor(scope, binding);
|
|
2382
2409
|
};
|
|
@@ -2414,7 +2441,18 @@ window.__ModuleLoader__.load({
|
|
|
2414
2441
|
return {
|
|
2415
2442
|
hooks: { agentPresetSeat: seat.store },
|
|
2416
2443
|
load: () => seat.load(),
|
|
2417
|
-
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
|
+
},
|
|
2418
2456
|
dismissRefusal: (error) => {
|
|
2419
2457
|
seat.dismissRefusal(error);
|
|
2420
2458
|
},
|
|
@@ -2429,9 +2467,10 @@ window.__ModuleLoader__.load({
|
|
|
2429
2467
|
});
|
|
2430
2468
|
const startCreatorDraft = () => {
|
|
2431
2469
|
if (!section.store.getSnapshot().showPicker) return;
|
|
2470
|
+
const listed = mainBlank(scope)?.projectionValues?.agentPreset;
|
|
2432
2471
|
const seat = mainBlankSeat(scope) ?? unboundSeat;
|
|
2433
|
-
seat.stage("ptc", true);
|
|
2434
|
-
scope.uiWorkspace.startSession();
|
|
2472
|
+
if (typeof listed !== "string" || listed === "ptc") seat.stage("ptc", true);
|
|
2473
|
+
scope.uiWorkspace.startSession(void 0, { agentPreset: "ptc" });
|
|
2435
2474
|
seat.apply();
|
|
2436
2475
|
};
|
|
2437
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Locale bundles for the agent-preset hero chip, header label, and management section. */
|
|
2
2
|
/** Locale keys these surfaces render. */
|
|
3
|
-
export type AgentPresetSettingsKey = 'error' | 'userTrust' | 'seatHint' | 'headerHint' | 'nav' | 'sectionIntro' | 'builtIn' | 'setDefault' | 'view' | 'presetPtcName' | 'presetPtcDescription' | 'duplicate' | 'duplicateUnavailable' | 'delete' | 'presetId' | 'presetIdPlaceholder' | 'copyOf' | 'displayName' | 'displayNamePlaceholder' | 'inUse' | 'selectionOffDefault' | 'noDescription' | 'builtInGroup' | 'customGroup' | 'brokenBadge' | 'brokenNoCopy' | 'switchRefused' | 'composition' | 'cancel' | 'close' | 'retry' | 'copyTitle' | 'copyIntro' | 'create' | 'creating' | 'creatorDraft' | 'createPlugin' | 'createPluginDescription' | 'createPluginChecking' | 'createPluginUnavailable' | 'createPluginMissing' | 'openLocation' | 'showLocation' | 'revealedPathLabel' | 'idRequired' | 'idInvalid' | 'idTaken' | 'deleteTitle' | 'deleteDescription' | 'deleteConfirm' | 'deleting' | 'showPicker' | 'showPickerBeta' | 'showPickerDescription' | 'enablePickerToSetDefault' | 'enablePickerToCreate';
|
|
3
|
+
export type AgentPresetSettingsKey = 'error' | 'userTrust' | 'seatHint' | 'headerHint' | 'nav' | 'sectionIntro' | 'builtIn' | 'setDefault' | 'view' | 'presetStandardName' | 'presetStandardDescription' | 'presetPtcName' | 'presetPtcDescription' | 'duplicate' | 'duplicateUnavailable' | 'delete' | 'presetId' | 'presetIdPlaceholder' | 'copyOf' | 'displayName' | 'displayNamePlaceholder' | 'inUse' | 'selectionOffDefault' | 'noDescription' | 'builtInGroup' | 'customGroup' | 'brokenBadge' | 'brokenNoCopy' | 'switchRefused' | 'composition' | 'cancel' | 'close' | 'retry' | 'copyTitle' | 'copyIntro' | 'create' | 'creating' | 'creatorDraft' | 'createPlugin' | 'createPluginDescription' | 'createPluginChecking' | 'createPluginUnavailable' | 'createPluginMissing' | 'openLocation' | 'showLocation' | 'revealedPathLabel' | 'idRequired' | 'idInvalid' | 'idTaken' | 'deleteTitle' | 'deleteDescription' | 'deleteConfirm' | 'deleting' | 'showPicker' | 'showPickerBeta' | 'showPickerDescription' | 'enablePickerToSetDefault' | 'enablePickerToCreate';
|
|
4
4
|
/** English copy. */
|
|
5
5
|
export declare const en: Record<AgentPresetSettingsKey, string>;
|
|
6
6
|
/** Simplified Chinese copy. */
|
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.
|
|
4
|
+
"version": "3.1.7",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -45,29 +45,30 @@
|
|
|
45
45
|
},
|
|
46
46
|
"license": "MIT",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@qilin-agent/kylin": "~4.0.
|
|
48
|
+
"@qilin-agent/kylin": "~4.0.5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/react": "~18.3.1",
|
|
52
52
|
"react": "^18.2.0",
|
|
53
|
-
"@qilin-agent/api-remotes": "3.1.
|
|
54
|
-
"@qilin-agent/api-session-controller": "3.1.
|
|
55
|
-
"@qilin-agent/agent-presets": "3.1.
|
|
56
|
-
"@qilin-agent/client-connection": "3.1.
|
|
57
|
-
"@qilin-agent/client-locale": "3.1.
|
|
58
|
-
"@qilin-agent/client-
|
|
59
|
-
"@qilin-agent/client-
|
|
60
|
-
"@qilin-agent/client-
|
|
61
|
-
"@qilin-agent/client-ui-
|
|
62
|
-
"@qilin-agent/client-ui-
|
|
63
|
-
"@qilin-agent/client-
|
|
64
|
-
"@qilin-agent/client-ui-
|
|
65
|
-
"@qilin-agent/
|
|
66
|
-
"@qilin-agent/util-values": "3.1.
|
|
67
|
-
"@qilin-agent/kylin": "~4.0.
|
|
68
|
-
"@qilin-agent/
|
|
69
|
-
"@qilin-agent/client-ui-
|
|
70
|
-
"@qilin-agent/client-ui-renderer": "3.1.
|
|
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",
|
|
67
|
+
"@qilin-agent/kylin": "~4.0.5",
|
|
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",
|