dsh-plugin-subagent-director 0.4.0 → 0.5.0-beta.0
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/CHANGELOG.md +37 -0
- package/README.md +8 -7
- package/lib/bridge-contract.d.ts +20 -0
- package/lib/bridge-contract.d.ts.map +1 -1
- package/lib/bridge-contract.js +8 -0
- package/lib/bridge-contract.js.map +1 -1
- package/lib/client/RoleCard.d.ts +4 -4
- package/lib/client/RoleCard.d.ts.map +1 -1
- package/lib/client/RoleCard.js +9 -13
- package/lib/client/RoleCard.js.map +1 -1
- package/lib/client/SubagentOptionsSection.d.ts +0 -2
- package/lib/client/SubagentOptionsSection.d.ts.map +1 -1
- package/lib/client/SubagentOptionsSection.js +11 -17
- package/lib/client/SubagentOptionsSection.js.map +1 -1
- package/lib/client/allowed-routes.d.ts +34 -0
- package/lib/client/allowed-routes.d.ts.map +1 -0
- package/lib/client/allowed-routes.js +47 -0
- package/lib/client/allowed-routes.js.map +1 -0
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +133 -77
- package/lib/client/index.js.map +1 -1
- package/lib/client/locales.d.ts +1 -1
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +2 -0
- package/lib/client/locales.js.map +1 -1
- package/lib/client/store.d.ts +24 -18
- package/lib/client/store.d.ts.map +1 -1
- package/lib/client/store.js +14 -16
- package/lib/client/store.js.map +1 -1
- package/lib/config.d.ts +2 -13
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +0 -1
- package/lib/config.js.map +1 -1
- package/lib/delegation-tool.d.ts +36 -8
- package/lib/delegation-tool.d.ts.map +1 -1
- package/lib/delegation-tool.js +49 -6
- package/lib/delegation-tool.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -8
- package/lib/index.js.map +1 -1
- package/lib/remote.d.ts +13 -1
- package/lib/remote.d.ts.map +1 -1
- package/lib/remote.js +47 -6
- package/lib/remote.js.map +1 -1
- package/lib/route-resolver.d.ts +44 -12
- package/lib/route-resolver.d.ts.map +1 -1
- package/lib/route-resolver.js +64 -4
- package/lib/route-resolver.js.map +1 -1
- package/lib/settings.d.ts +18 -10
- package/lib/settings.d.ts.map +1 -1
- package/lib/settings.js +18 -10
- package/lib/settings.js.map +1 -1
- package/package.json +41 -35
- package/lib/default-route.d.ts +0 -46
- package/lib/default-route.d.ts.map +0 -1
- package/lib/default-route.js +0 -56
- package/lib/default-route.js.map +0 -1
package/lib/client/index.js
CHANGED
|
@@ -38,6 +38,7 @@ window.__ModuleLoader__.load({
|
|
|
38
38
|
"sectionIntro": "Choose the LLM provider and model each subagent uses, and define role templates that bind a model and persona to a delegation.",
|
|
39
39
|
"defaultsHeading": "Default model",
|
|
40
40
|
"defaultsHint": "Used when a call or role does not name a provider/model.",
|
|
41
|
+
"noAllowedModels": "No authorized models yet. Select models in the official Subagent model-selection list (plugin settings → Subagent); picks here are limited to that list.",
|
|
41
42
|
"defaultProvider": "Provider",
|
|
42
43
|
"defaultModel": "Model",
|
|
43
44
|
"defaultReasoningEffort": "Reasoning effort",
|
|
@@ -108,6 +109,7 @@ window.__ModuleLoader__.load({
|
|
|
108
109
|
"sectionIntro": "为每个子代理选择 LLM 供应商与模型,并以角色模板把模型与 persona 绑定到每次委派。",
|
|
109
110
|
"defaultsHeading": "默认模型",
|
|
110
111
|
"defaultsHint": "当某次调用或角色未指定供应商/模型时使用。",
|
|
112
|
+
"noAllowedModels": "尚未配置已授权的模型。请先在官方 Subagent 模型选择列表(插件设置 → Subagent)中选择模型;此处只能从该列表中选择。",
|
|
111
113
|
"defaultProvider": "供应商",
|
|
112
114
|
"defaultModel": "模型",
|
|
113
115
|
"defaultReasoningEffort": "推理强度",
|
|
@@ -186,6 +188,14 @@ window.__ModuleLoader__.load({
|
|
|
186
188
|
const SUBAGENT_DIRECTOR_RPC_MODEL = "subagentModel";
|
|
187
189
|
/** Endpoint that returns the model-visible tool catalog for role tool-set editing. */
|
|
188
190
|
const SUBAGENT_DIRECTOR_RPC_TOOLS = "toolCatalog";
|
|
191
|
+
/**
|
|
192
|
+
* Endpoint that returns the Subagent model-selection allowlist the page must
|
|
193
|
+
* constrain picks to (the official `subagent-model-selection` section: the
|
|
194
|
+
* "Subagent" plugin-config model list). Additive endpoint for alpha.4: the
|
|
195
|
+
* llm catalog RPC is gone from the client, and Subagent Director may select a
|
|
196
|
+
* provider/model ONLY from this list.
|
|
197
|
+
*/
|
|
198
|
+
const SUBAGENT_DIRECTOR_RPC_CATALOG = "settingsCatalog";
|
|
189
199
|
//#endregion
|
|
190
200
|
//#region src/client/store-logic.ts
|
|
191
201
|
/** Path of the roles map from the section root. */
|
|
@@ -361,8 +371,8 @@ window.__ModuleLoader__.load({
|
|
|
361
371
|
namespace: void 0,
|
|
362
372
|
section: void 0,
|
|
363
373
|
revision: 0,
|
|
364
|
-
|
|
365
|
-
|
|
374
|
+
modelSelectionEnabled: false,
|
|
375
|
+
allowedRoutes: [],
|
|
366
376
|
tools: [],
|
|
367
377
|
loading: false
|
|
368
378
|
};
|
|
@@ -431,10 +441,15 @@ window.__ModuleLoader__.load({
|
|
|
431
441
|
s.loading = true;
|
|
432
442
|
});
|
|
433
443
|
try {
|
|
434
|
-
const [
|
|
435
|
-
this.wire.llm.providers({}),
|
|
436
|
-
this.wire.llm.models({}),
|
|
444
|
+
const [viewResult, catalogResult, toolsResult] = await Promise.all([
|
|
437
445
|
this.callBridge(SUBAGENT_DIRECTOR_RPC_VIEW),
|
|
446
|
+
this.callBridge(SUBAGENT_DIRECTOR_RPC_CATALOG).catch(() => ({
|
|
447
|
+
ok: false,
|
|
448
|
+
error: {
|
|
449
|
+
code: "internal",
|
|
450
|
+
message: "model-selection catalog unavailable"
|
|
451
|
+
}
|
|
452
|
+
})),
|
|
438
453
|
this.callBridge(SUBAGENT_DIRECTOR_RPC_TOOLS, { sessionId: effectiveSessionId }).catch(() => ({
|
|
439
454
|
ok: false,
|
|
440
455
|
error: {
|
|
@@ -443,22 +458,22 @@ window.__ModuleLoader__.load({
|
|
|
443
458
|
}
|
|
444
459
|
}))
|
|
445
460
|
]);
|
|
446
|
-
if (!providersResponse.result.ok) throw new Error(providersResponse.result.error.message);
|
|
447
|
-
if (!modelsResponse.result.ok) throw new Error(modelsResponse.result.error.message);
|
|
448
461
|
if (!viewResult.ok) throw new Error(this.errorMessage(viewResult.error));
|
|
449
462
|
if (generation !== this.generation) return;
|
|
450
463
|
const view = viewResult.value.view;
|
|
451
464
|
const section = view?.value ?? {};
|
|
452
465
|
const writable = viewResult.value.writable;
|
|
453
|
-
const
|
|
454
|
-
|
|
466
|
+
const catalog = catalogResult.ok ? catalogResult.value : {
|
|
467
|
+
modelSelectionEnabled: false,
|
|
468
|
+
allowedRoutes: []
|
|
469
|
+
};
|
|
455
470
|
const tools = toolsResult.ok ? toolsResult.value.tools : [];
|
|
456
471
|
this.store.update((s) => {
|
|
457
472
|
s.status = "ready";
|
|
458
473
|
s.error = null;
|
|
459
474
|
s.writable = writable;
|
|
460
|
-
s.
|
|
461
|
-
s.
|
|
475
|
+
s.modelSelectionEnabled = catalog.modelSelectionEnabled;
|
|
476
|
+
s.allowedRoutes = catalog.allowedRoutes;
|
|
462
477
|
s.tools = tools;
|
|
463
478
|
s.namespace = view;
|
|
464
479
|
s.section = section;
|
|
@@ -586,6 +601,46 @@ window.__ModuleLoader__.load({
|
|
|
586
601
|
}
|
|
587
602
|
};
|
|
588
603
|
//#endregion
|
|
604
|
+
//#region src/client/allowed-routes.ts
|
|
605
|
+
/** One-line display label for an exact route. */
|
|
606
|
+
function allowedRouteLabel(route) {
|
|
607
|
+
return `${route.provider}/${route.model}`;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* Map the authorized route list to selectable options, preserving order and
|
|
611
|
+
* dropping duplicates of the exact same provider/model pair.
|
|
612
|
+
*/
|
|
613
|
+
function buildRouteOptions(routes) {
|
|
614
|
+
const seen = /* @__PURE__ */ new Set();
|
|
615
|
+
const options = [];
|
|
616
|
+
for (const route of routes) {
|
|
617
|
+
const key = `${route.provider}\u0000${route.model}`;
|
|
618
|
+
if (seen.has(key)) continue;
|
|
619
|
+
seen.add(key);
|
|
620
|
+
options.push({
|
|
621
|
+
provider: route.provider,
|
|
622
|
+
model: route.model,
|
|
623
|
+
label: allowedRouteLabel(route)
|
|
624
|
+
});
|
|
625
|
+
}
|
|
626
|
+
return options;
|
|
627
|
+
}
|
|
628
|
+
/** Unique providers in first-seen order, for the provider select. */
|
|
629
|
+
function providerNames(routes) {
|
|
630
|
+
const seen = /* @__PURE__ */ new Set();
|
|
631
|
+
const names = [];
|
|
632
|
+
for (const route of routes) {
|
|
633
|
+
if (seen.has(route.provider)) continue;
|
|
634
|
+
seen.add(route.provider);
|
|
635
|
+
names.push(route.provider);
|
|
636
|
+
}
|
|
637
|
+
return names;
|
|
638
|
+
}
|
|
639
|
+
/** The allowed options available for one exact provider, for the model select. */
|
|
640
|
+
function modelsForProvider(routes, provider) {
|
|
641
|
+
return buildRouteOptions(routes).filter((option) => option.provider === provider);
|
|
642
|
+
}
|
|
643
|
+
//#endregion
|
|
589
644
|
//#region src/client/toolset-logic.ts
|
|
590
645
|
/**
|
|
591
646
|
* Pure tool-set picker logic for the role editor (search / select-all /
|
|
@@ -879,13 +934,11 @@ window.__ModuleLoader__.load({
|
|
|
879
934
|
//#endregion
|
|
880
935
|
//#region src/client/RoleCard.tsx
|
|
881
936
|
/** One role template card: read-only summary plus an inline editor.
|
|
882
|
-
* Provider/model
|
|
883
|
-
*
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
function RoleCard({ id, role, isDefault, groups, tools, t, onSave, onDelete, onSetDefault }) {
|
|
937
|
+
* Provider/model picks are limited to the routes authorized in the official
|
|
938
|
+
* Subagent model-selection list; reasoning effort is a free-text field (the
|
|
939
|
+
* alpha.4 client has no effort catalog). Writes go through the controller as
|
|
940
|
+
* path ops, and failures return a localized message. */
|
|
941
|
+
function RoleCard({ id, role, isDefault, routes, tools, t, onSave, onDelete, onSetDefault }) {
|
|
889
942
|
const [editing, setEditing] = (0, react.useState)(false);
|
|
890
943
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
891
944
|
const [failure, setFailure] = (0, react.useState)(void 0);
|
|
@@ -899,9 +952,9 @@ window.__ModuleLoader__.load({
|
|
|
899
952
|
toolFilter: { allow: role.toolFilter?.allow ?? [] }
|
|
900
953
|
});
|
|
901
954
|
const provider = draft.provider || role.provider;
|
|
902
|
-
|
|
903
|
-
const
|
|
904
|
-
const
|
|
955
|
+
draft.model || role.model;
|
|
956
|
+
const providers = providerNames(routes);
|
|
957
|
+
const modelOptions = provider ? modelsForProvider(routes, provider) : [];
|
|
905
958
|
const save = async () => {
|
|
906
959
|
setBusy(true);
|
|
907
960
|
setFailure(void 0);
|
|
@@ -1008,15 +1061,15 @@ window.__ModuleLoader__.load({
|
|
|
1008
1061
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1009
1062
|
style: selectStyle,
|
|
1010
1063
|
value: draft.provider,
|
|
1011
|
-
disabled:
|
|
1064
|
+
disabled: providers.length === 0,
|
|
1012
1065
|
onChange: (e) => setField("provider", e.target.value),
|
|
1013
1066
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1014
1067
|
value: "",
|
|
1015
1068
|
children: "—"
|
|
1016
|
-
}),
|
|
1017
|
-
value:
|
|
1018
|
-
children:
|
|
1019
|
-
},
|
|
1069
|
+
}), providers.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1070
|
+
value: id,
|
|
1071
|
+
children: id
|
|
1072
|
+
}, id))]
|
|
1020
1073
|
})]
|
|
1021
1074
|
}),
|
|
1022
1075
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1033,9 +1086,9 @@ window.__ModuleLoader__.load({
|
|
|
1033
1086
|
value: "",
|
|
1034
1087
|
children: "—"
|
|
1035
1088
|
}), modelOptions.map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1036
|
-
value: m.
|
|
1037
|
-
children: m.
|
|
1038
|
-
}, m.
|
|
1089
|
+
value: m.model,
|
|
1090
|
+
children: m.label
|
|
1091
|
+
}, m.model))]
|
|
1039
1092
|
})]
|
|
1040
1093
|
}),
|
|
1041
1094
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1043,18 +1096,11 @@ window.__ModuleLoader__.load({
|
|
|
1043
1096
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1044
1097
|
style: fieldLabelStyle,
|
|
1045
1098
|
children: t("reasoningEffort")
|
|
1046
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1047
|
-
style:
|
|
1099
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1100
|
+
style: textInputStyle,
|
|
1048
1101
|
value: draft.reasoningEffort,
|
|
1049
|
-
|
|
1050
|
-
onChange: (e) => setField("reasoningEffort", e.target.value)
|
|
1051
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1052
|
-
value: "",
|
|
1053
|
-
children: "—"
|
|
1054
|
-
}), effortOptions.map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1055
|
-
value: e.id,
|
|
1056
|
-
children: e.name
|
|
1057
|
-
}, e.id))]
|
|
1102
|
+
placeholder: "(advisory)",
|
|
1103
|
+
onChange: (e) => setField("reasoningEffort", e.target.value)
|
|
1058
1104
|
})]
|
|
1059
1105
|
})
|
|
1060
1106
|
]
|
|
@@ -1240,11 +1286,6 @@ window.__ModuleLoader__.load({
|
|
|
1240
1286
|
* section only ever echoes the acknowledge-and-reload outcome. Failures return
|
|
1241
1287
|
* a localized message that the save/delete/restore controls surface inline.
|
|
1242
1288
|
*/
|
|
1243
|
-
/** Derive reasoning-effort options from the catalog for an exact provider+model. */
|
|
1244
|
-
function effortsFor(groups, provider, model) {
|
|
1245
|
-
if (!provider || !model) return [];
|
|
1246
|
-
return (groups.find((g) => g.id === provider)?.models.find((m) => m.id === model))?.reasoning?.efforts ?? [];
|
|
1247
|
-
}
|
|
1248
1289
|
/**
|
|
1249
1290
|
* Render the Subagent Director settings section content column.
|
|
1250
1291
|
* @param props - slot-delivered injected dependencies.
|
|
@@ -1310,7 +1351,7 @@ window.__ModuleLoader__.load({
|
|
|
1310
1351
|
const writable = state.writable;
|
|
1311
1352
|
const roles = section?.roles ?? {};
|
|
1312
1353
|
const entries = Object.entries(roles);
|
|
1313
|
-
const
|
|
1354
|
+
const routes = state.allowedRoutes;
|
|
1314
1355
|
const tools = state.tools;
|
|
1315
1356
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1316
1357
|
style: sectionWidth,
|
|
@@ -1326,7 +1367,8 @@ window.__ModuleLoader__.load({
|
|
|
1326
1367
|
}),
|
|
1327
1368
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(DefaultModelRow, {
|
|
1328
1369
|
controller,
|
|
1329
|
-
|
|
1370
|
+
routes,
|
|
1371
|
+
modelSelectionEnabled: state.modelSelectionEnabled,
|
|
1330
1372
|
writable,
|
|
1331
1373
|
current: {
|
|
1332
1374
|
provider: section?.defaultProvider,
|
|
@@ -1337,7 +1379,7 @@ window.__ModuleLoader__.load({
|
|
|
1337
1379
|
}),
|
|
1338
1380
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(RolesBlock, {
|
|
1339
1381
|
controller,
|
|
1340
|
-
|
|
1382
|
+
routes,
|
|
1341
1383
|
tools,
|
|
1342
1384
|
writable,
|
|
1343
1385
|
roles: entries,
|
|
@@ -1348,7 +1390,7 @@ window.__ModuleLoader__.load({
|
|
|
1348
1390
|
});
|
|
1349
1391
|
}
|
|
1350
1392
|
/** The default-model row: provider → model → reasoning-effort cascade + restore. */
|
|
1351
|
-
function DefaultModelRow({ controller,
|
|
1393
|
+
function DefaultModelRow({ controller, routes, modelSelectionEnabled, writable, current, t }) {
|
|
1352
1394
|
const [draft, setDraft] = (0, react.useState)({
|
|
1353
1395
|
provider: current.provider ?? "",
|
|
1354
1396
|
model: current.model ?? "",
|
|
@@ -1370,9 +1412,10 @@ window.__ModuleLoader__.load({
|
|
|
1370
1412
|
current.reasoningEffort
|
|
1371
1413
|
]);
|
|
1372
1414
|
const provider = draft.provider;
|
|
1373
|
-
|
|
1374
|
-
const
|
|
1375
|
-
const
|
|
1415
|
+
draft.model;
|
|
1416
|
+
const providers = providerNames(routes);
|
|
1417
|
+
const modelOptions = provider ? modelsForProvider(routes, provider) : [];
|
|
1418
|
+
const noAllowed = routes.length === 0;
|
|
1376
1419
|
const save = async () => {
|
|
1377
1420
|
setBusy(true);
|
|
1378
1421
|
setFailure(void 0);
|
|
@@ -1437,6 +1480,15 @@ window.__ModuleLoader__.load({
|
|
|
1437
1480
|
},
|
|
1438
1481
|
children: t("defaultsHint")
|
|
1439
1482
|
}),
|
|
1483
|
+
noAllowed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
1484
|
+
style: {
|
|
1485
|
+
margin: "6px 0 0",
|
|
1486
|
+
color: token.danger,
|
|
1487
|
+
fontSize: 12,
|
|
1488
|
+
lineHeight: "16px"
|
|
1489
|
+
},
|
|
1490
|
+
children: t("noAllowedModels")
|
|
1491
|
+
}) : null,
|
|
1440
1492
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
1441
1493
|
style: {
|
|
1442
1494
|
display: "grid",
|
|
@@ -1449,10 +1501,16 @@ window.__ModuleLoader__.load({
|
|
|
1449
1501
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1450
1502
|
style: fieldLabelStyle,
|
|
1451
1503
|
children: t("defaultProvider")
|
|
1452
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1504
|
+
}), noAllowed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1505
|
+
style: {
|
|
1506
|
+
color: token.labelSecondary,
|
|
1507
|
+
fontSize: 12
|
|
1508
|
+
},
|
|
1509
|
+
children: "—"
|
|
1510
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1453
1511
|
style: selectStyle,
|
|
1454
1512
|
value: draft.provider,
|
|
1455
|
-
disabled: !writable ||
|
|
1513
|
+
disabled: !writable || providers.length === 0,
|
|
1456
1514
|
onChange: (e) => setDraft((d) => ({
|
|
1457
1515
|
provider: e.target.value,
|
|
1458
1516
|
model: "",
|
|
@@ -1461,10 +1519,10 @@ window.__ModuleLoader__.load({
|
|
|
1461
1519
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1462
1520
|
value: "",
|
|
1463
1521
|
children: "—"
|
|
1464
|
-
}),
|
|
1465
|
-
value:
|
|
1466
|
-
children:
|
|
1467
|
-
},
|
|
1522
|
+
}), providers.map((id) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1523
|
+
value: id,
|
|
1524
|
+
children: id
|
|
1525
|
+
}, id))]
|
|
1468
1526
|
})]
|
|
1469
1527
|
}),
|
|
1470
1528
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1472,7 +1530,13 @@ window.__ModuleLoader__.load({
|
|
|
1472
1530
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1473
1531
|
style: fieldLabelStyle,
|
|
1474
1532
|
children: t("defaultModel")
|
|
1475
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1533
|
+
}), noAllowed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
1534
|
+
style: {
|
|
1535
|
+
color: token.labelSecondary,
|
|
1536
|
+
fontSize: 12
|
|
1537
|
+
},
|
|
1538
|
+
children: "—"
|
|
1539
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1476
1540
|
style: selectStyle,
|
|
1477
1541
|
value: draft.model,
|
|
1478
1542
|
disabled: !writable || modelOptions.length === 0,
|
|
@@ -1485,9 +1549,9 @@ window.__ModuleLoader__.load({
|
|
|
1485
1549
|
value: "",
|
|
1486
1550
|
children: "—"
|
|
1487
1551
|
}), modelOptions.map((m) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1488
|
-
value: m.
|
|
1489
|
-
children: m.
|
|
1490
|
-
}, m.
|
|
1552
|
+
value: m.model,
|
|
1553
|
+
children: m.label
|
|
1554
|
+
}, m.model))]
|
|
1491
1555
|
})]
|
|
1492
1556
|
}),
|
|
1493
1557
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1495,21 +1559,15 @@ window.__ModuleLoader__.load({
|
|
|
1495
1559
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
1496
1560
|
style: fieldLabelStyle,
|
|
1497
1561
|
children: t("defaultReasoningEffort")
|
|
1498
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.
|
|
1499
|
-
style:
|
|
1562
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1563
|
+
style: textInputStyle,
|
|
1500
1564
|
value: draft.reasoningEffort,
|
|
1501
|
-
disabled: !writable
|
|
1565
|
+
disabled: !writable,
|
|
1566
|
+
placeholder: modelSelectionEnabled ? "" : "(advisory)",
|
|
1502
1567
|
onChange: (e) => setDraft((d) => ({
|
|
1503
1568
|
...d,
|
|
1504
1569
|
reasoningEffort: e.target.value
|
|
1505
|
-
}))
|
|
1506
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1507
|
-
value: "",
|
|
1508
|
-
children: "—"
|
|
1509
|
-
}), effortOptions.map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1510
|
-
value: e.id,
|
|
1511
|
-
children: e.name
|
|
1512
|
-
}, e.id))]
|
|
1570
|
+
}))
|
|
1513
1571
|
})]
|
|
1514
1572
|
})
|
|
1515
1573
|
]
|
|
@@ -1544,7 +1602,7 @@ window.__ModuleLoader__.load({
|
|
|
1544
1602
|
});
|
|
1545
1603
|
}
|
|
1546
1604
|
/** The role-template roster: cards plus an inline add form. */
|
|
1547
|
-
function RolesBlock({ controller,
|
|
1605
|
+
function RolesBlock({ controller, routes, tools, writable, roles, defaultRole, t }) {
|
|
1548
1606
|
const [adding, setAdding] = (0, react.useState)(false);
|
|
1549
1607
|
const [draft, setDraft] = (0, react.useState)({
|
|
1550
1608
|
displayName: "",
|
|
@@ -1707,7 +1765,7 @@ window.__ModuleLoader__.load({
|
|
|
1707
1765
|
id,
|
|
1708
1766
|
role,
|
|
1709
1767
|
isDefault: defaultRole === id,
|
|
1710
|
-
|
|
1768
|
+
routes,
|
|
1711
1769
|
tools,
|
|
1712
1770
|
t,
|
|
1713
1771
|
onSave: (d) => controller.updateRole(id, role, d),
|
|
@@ -2032,14 +2090,12 @@ window.__ModuleLoader__.load({
|
|
|
2032
2090
|
const t = ctx.locale.bind(NS);
|
|
2033
2091
|
const controller = new SubagentOptionsStore({
|
|
2034
2092
|
rpc: connection.rpc,
|
|
2035
|
-
llm: connection.api.llm,
|
|
2036
2093
|
t
|
|
2037
2094
|
});
|
|
2038
2095
|
const useSnapshot = bindSnapshotSelector(controller.store);
|
|
2039
2096
|
const injected = () => ({
|
|
2040
2097
|
controller,
|
|
2041
2098
|
useSnapshot,
|
|
2042
|
-
api: connection.api,
|
|
2043
2099
|
t
|
|
2044
2100
|
});
|
|
2045
2101
|
const dockInjected = () => ({ rpc: connection.rpc });
|
package/lib/client/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,EAAE,EAAE,EAAE,EA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,CACF,CAAC;IAEF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,4BAA4B,EAAE,GAAG,EAAE,CAClD,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB;QACE,IAAI,EAAE,4BAA4B;QAClC,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,YAAY;KACrB,EACD,iBAAiB,CAClB,CACF,CAAC;IAEF,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,qCAAqC,EAAE,GAAG,EAAE,CAC3D,GAAG,CAAC,KAAK,CAAC,QAAQ,CAChB;QACE,IAAI,EAAE,qCAAqC;QAC3C,EAAE,EAAE,yBAAyB;QAC7B,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,aAAa;KACtB,EACD,mBAAmB,CACpB,CACF,CAAC;AACJ,CAAC"}
|
package/lib/client/locales.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* ever reaches the runtime's bilingual balance check.
|
|
6
6
|
*/
|
|
7
7
|
/** Keys for the settings.subagentDirector namespace (bilingual, enforced). */
|
|
8
|
-
export type SubagentDirectorKey = 'nav' | 'sectionIntro' | 'defaultsHeading' | 'defaultsHint' | 'defaultProvider' | 'defaultModel' | 'defaultReasoningEffort' | 'restoreDefaults' | 'provider' | 'model' | 'reasoningEffort' | 'persona' | 'rolesHeading' | 'rolesHint' | 'addRole' | 'emptyRoles' | 'roleId' | 'roleDisplayName' | 'roleDescription' | 'rolePersona' | 'setDefaultRole' | 'defaultRoleBadge' | 'deleteRole' | 'confirmDeleteRole' | 'removeRoleDone' | 'addedRole' | 'roleUpdated' | 'conflict' | 'rejected' | 'fatal' | 'loadError' | 'readonly' | 'save' | 'cancel' | 'edit' | 'retry' | 'fallbackOnInvalid' | 'roleIdPlaceholder' | 'displayNamePlaceholder' | 'descriptionPlaceholder' | 'personaPlaceholder' | 'modelOptional' | 'providerMissing' | 'toolFilter' | 'toolFilterHint' | 'toolFilterNone' | 'toolFilterEmpty' | 'toolFilterSearch' | 'toolFilterSelectAll' | 'toolFilterDeselectAll' | 'toolFilterCount' | 'toolFilterExpand' | 'toolFilterCollapse' | 'toolFilterNoMatch' | 'restoreDone' | 'invalidRoleId' | 'bridgeUnavailable' | 'modelRanOn' | 'modelNotRecorded' | 'modelQueryFailed' | 'modelRanOnTitle' | 'closeContinuable' | 'closeContinuableTitle' | 'closingContinuable' | 'closedSubagent' | 'confirmCloseContinuable' | 'closeFailed';
|
|
8
|
+
export type SubagentDirectorKey = 'nav' | 'sectionIntro' | 'defaultsHeading' | 'defaultsHint' | 'noAllowedModels' | 'defaultProvider' | 'defaultModel' | 'defaultReasoningEffort' | 'restoreDefaults' | 'provider' | 'model' | 'reasoningEffort' | 'persona' | 'rolesHeading' | 'rolesHint' | 'addRole' | 'emptyRoles' | 'roleId' | 'roleDisplayName' | 'roleDescription' | 'rolePersona' | 'setDefaultRole' | 'defaultRoleBadge' | 'deleteRole' | 'confirmDeleteRole' | 'removeRoleDone' | 'addedRole' | 'roleUpdated' | 'conflict' | 'rejected' | 'fatal' | 'loadError' | 'readonly' | 'save' | 'cancel' | 'edit' | 'retry' | 'fallbackOnInvalid' | 'roleIdPlaceholder' | 'displayNamePlaceholder' | 'descriptionPlaceholder' | 'personaPlaceholder' | 'modelOptional' | 'providerMissing' | 'toolFilter' | 'toolFilterHint' | 'toolFilterNone' | 'toolFilterEmpty' | 'toolFilterSearch' | 'toolFilterSelectAll' | 'toolFilterDeselectAll' | 'toolFilterCount' | 'toolFilterExpand' | 'toolFilterCollapse' | 'toolFilterNoMatch' | 'restoreDone' | 'invalidRoleId' | 'bridgeUnavailable' | 'modelRanOn' | 'modelNotRecorded' | 'modelQueryFailed' | 'modelRanOnTitle' | 'closeContinuable' | 'closeContinuableTitle' | 'closingContinuable' | 'closedSubagent' | 'confirmCloseContinuable' | 'closeFailed';
|
|
9
9
|
/** English dictionary ($subagentDirector). */
|
|
10
10
|
export declare const en: Record<SubagentDirectorKey, string>;
|
|
11
11
|
/** Chinese dictionary. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,wBAAwB,GACxB,iBAAiB,GACjB,UAAU,GACV,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,WAAW,GACX,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,UAAU,GACV,UAAU,GACV,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,uBAAuB,GACvB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,gBAAgB,GAChB,yBAAyB,GACzB,aAAa,CAAC;AAElB,8CAA8C;AAC9C,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"locales.d.ts","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,mBAAmB,GAC3B,KAAK,GACL,cAAc,GACd,iBAAiB,GACjB,cAAc,GACd,iBAAiB,GACjB,iBAAiB,GACjB,cAAc,GACd,wBAAwB,GACxB,iBAAiB,GACjB,UAAU,GACV,OAAO,GACP,iBAAiB,GACjB,SAAS,GACT,cAAc,GACd,WAAW,GACX,SAAS,GACT,YAAY,GACZ,QAAQ,GACR,iBAAiB,GACjB,iBAAiB,GACjB,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,YAAY,GACZ,mBAAmB,GACnB,gBAAgB,GAChB,WAAW,GACX,aAAa,GACb,UAAU,GACV,UAAU,GACV,OAAO,GACP,WAAW,GACX,UAAU,GACV,MAAM,GACN,QAAQ,GACR,MAAM,GACN,OAAO,GACP,mBAAmB,GACnB,mBAAmB,GACnB,wBAAwB,GACxB,wBAAwB,GACxB,oBAAoB,GACpB,eAAe,GACf,iBAAiB,GACjB,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,iBAAiB,GACjB,kBAAkB,GAClB,qBAAqB,GACrB,uBAAuB,GACvB,iBAAiB,GACjB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,aAAa,GACb,eAAe,GACf,mBAAmB,GACnB,YAAY,GACZ,kBAAkB,GAClB,kBAAkB,GAClB,iBAAiB,GACjB,kBAAkB,GAClB,uBAAuB,GACvB,oBAAoB,GACpB,gBAAgB,GAChB,yBAAyB,GACzB,aAAa,CAAC;AAElB,8CAA8C;AAC9C,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAqElD,CAAC;AAEF,0BAA0B;AAC1B,eAAO,MAAM,EAAE,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAqElD,CAAC"}
|
package/lib/client/locales.js
CHANGED
|
@@ -10,6 +10,7 @@ export const en = {
|
|
|
10
10
|
"sectionIntro": "Choose the LLM provider and model each subagent uses, and define role templates that bind a model and persona to a delegation.",
|
|
11
11
|
"defaultsHeading": "Default model",
|
|
12
12
|
"defaultsHint": "Used when a call or role does not name a provider/model.",
|
|
13
|
+
"noAllowedModels": "No authorized models yet. Select models in the official Subagent model-selection list (plugin settings \u2192 Subagent); picks here are limited to that list.",
|
|
13
14
|
"defaultProvider": "Provider",
|
|
14
15
|
"defaultModel": "Model",
|
|
15
16
|
"defaultReasoningEffort": "Reasoning effort",
|
|
@@ -80,6 +81,7 @@ export const zh = {
|
|
|
80
81
|
"sectionIntro": "为每个子代理选择 LLM 供应商与模型,并以角色模板把模型与 persona 绑定到每次委派。",
|
|
81
82
|
"defaultsHeading": "默认模型",
|
|
82
83
|
"defaultsHint": "当某次调用或角色未指定供应商/模型时使用。",
|
|
84
|
+
"noAllowedModels": "尚未配置已授权的模型。请先在官方 Subagent 模型选择列表(插件设置 → Subagent)中选择模型;此处只能从该列表中选择。",
|
|
83
85
|
"defaultProvider": "供应商",
|
|
84
86
|
"defaultModel": "模型",
|
|
85
87
|
"defaultReasoningEffort": "推理强度",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"locales.js","sourceRoot":"","sources":["../../src/client/locales.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAyEH,8CAA8C;AAC9C,MAAM,CAAC,MAAM,EAAE,GAAwC;IACrD,KAAK,EAAE,mBAAmB;IAC1B,cAAc,EAAE,gIAAgI;IAChJ,iBAAiB,EAAE,eAAe;IAClC,cAAc,EAAE,0DAA0D;IAC1E,iBAAiB,EAAE,+JAA+J;IAClL,iBAAiB,EAAE,UAAU;IAC7B,cAAc,EAAE,OAAO;IACvB,wBAAwB,EAAE,kBAAkB;IAC5C,iBAAiB,EAAE,kBAAkB;IACrC,UAAU,EAAE,UAAU;IACtB,OAAO,EA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AAa;IACzB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,IAAI;IACb,mBAAmB,EAAE,mBAAmB;IACxC,mBAAmB,EAAE,kBAAkB;IACvC,wBAAwB,EAAE,UAAU;IACpC,wBAAwB,EAAE,kBAAkB;IAC5C,oBAAoB,EAAE,mBAAmB;IACzC,eAAe,EAAE,WAAW;IAC5B,iBAAiB,EAAE,QAAQ;IAC3B,YAAY,EAAE,KAAK;IACnB,gBAAgB,EAAE,6BAA6B;IAC/C,gBAAgB,EAAE,cAAc;IAChC,iBAAiB,EAAE,OAAO;IAC1B,kBAAkB,EAAE,OAAO;IAC3B,qBAAqB,EAAE,IAAI;IAC3B,uBAAuB,EAAE,KAAK;IAC9B,iBAAiB,EAAE,wBAAwB;IAC3C,kBAAkB,EAAE,IAAI;IACxB,oBAAoB,EAAE,IAAI;IAC1B,mBAAmB,EAAE,YAAY;IACjC,aAAa,EAAE,OAAO;IACtB,eAAe,EAAE,sCAAsC;IACvD,mBAAmB,EAAE,4EAA4E;IACjG,YAAY,EAAE,UAAU;IACxB,kBAAkB,EAAE,YAAY;IAChC,kBAAkB,EAAE,aAAa;IACjC,iBAAiB,EAAE,cAAc;IACjC,kBAAkB,EAAE,SAAS;IAC7B,uBAAuB,EAAE,mBAAmB;IAC5C,oBAAoB,EAAE,OAAO;IAC7B,gBAAgB,EAAE,KAAK;IACvB,yBAAyB,EAAE,gDAAgD;IAC3E,aAAa,EAAE,gBAAgB;CAChC,CAAC"}
|
package/lib/client/store.d.ts
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Subagent Director settings page store: one snapshot joining the
|
|
3
|
-
*
|
|
4
|
-
* plugin's own settings namespace
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
2
|
+
* Subagent Director settings page store: one snapshot joining the authorized
|
|
3
|
+
* Subagent model-selection allowlist (the official `subagent-model-selection`
|
|
4
|
+
* section), the plugin's own settings namespace, and the model-visible tool
|
|
5
|
+
* catalog. The settings namespace and the allowlist are read through the
|
|
6
|
+
* plugin's self-published `/subagent-director` RPC channel (see ../remote.ts)
|
|
7
|
+
* because the Host apiproxy's exposedNamespaces() allowlist answers
|
|
8
|
+
* `settings-not-exposed` for namespaces outside the model-provider plane, and
|
|
9
|
+
* the alpha.4 client no longer has a full llm catalog RPC. The host stays the
|
|
10
|
+
* single fact source: every write travels as path ops through the bridge's
|
|
11
|
+
* settingsMutate endpoint with an expectedRevision optimistic lock, and pushed
|
|
12
|
+
* invalidations (settings/document-updated, llm/adapters-updated,
|
|
12
13
|
* connection/reset) refresh the page.
|
|
13
14
|
*/
|
|
14
|
-
import type { ClientConnectionRpc
|
|
15
|
+
import type { ClientConnectionRpc } from '@deepseek-ai/dsh-client-connection/client';
|
|
16
|
+
import type { SettingsNamespaceView } from '@deepseek-ai/dsh-host-apiproxy/api';
|
|
17
|
+
import { type DirectorAllowedRoute } from '../bridge-contract.js';
|
|
15
18
|
import type { SubagentDirectorKey } from './locales.js';
|
|
16
19
|
import { type SnapshotStore } from '@deepseek-ai/dsh-client-runtime/client';
|
|
17
20
|
import { type DefaultModelEdits, type MutationErrorKind, type RoleDraft, type StoredRole, type StoredSection } from './store-logic.js';
|
|
@@ -30,10 +33,15 @@ export interface SubagentOptionsState {
|
|
|
30
33
|
section: StoredSection | undefined;
|
|
31
34
|
/** Current expectedRevision for the next mutate. */
|
|
32
35
|
revision: number;
|
|
33
|
-
/**
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
|
|
36
|
+
/** Whether the official Subagent model selection is enabled. */
|
|
37
|
+
modelSelectionEnabled: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The authorized exact routes — the ONLY selectable provider/model pairs.
|
|
40
|
+
* Empty when the official selection is off or no model is authorized yet;
|
|
41
|
+
* the page then shows the "no authorized models" notice and the host-side
|
|
42
|
+
* resolver inherits the parent model.
|
|
43
|
+
*/
|
|
44
|
+
allowedRoutes: readonly DirectorAllowedRoute[];
|
|
37
45
|
/** Distinct model-visible tool names for role tool-set editing. */
|
|
38
46
|
tools: readonly string[];
|
|
39
47
|
/** The plugin name surfaced to the section. */
|
|
@@ -54,12 +62,10 @@ export declare class BridgeUnavailableError extends Error {
|
|
|
54
62
|
}
|
|
55
63
|
/** Whether a thrown value means the bridge channel could not be called at all. */
|
|
56
64
|
export declare function isBridgeUnavailable(error: unknown): boolean;
|
|
57
|
-
/** Wire faces the settings page needs: the bridge RPC caller
|
|
65
|
+
/** Wire faces the settings page needs: the bridge RPC caller and copy. */
|
|
58
66
|
export interface StoreWire {
|
|
59
67
|
/** Generic RPC caller for the self-published /subagent-director channel. */
|
|
60
68
|
rpc: ClientConnectionRpc;
|
|
61
|
-
/** llm catalog/adapters face (still connection.api.llm). */
|
|
62
|
-
llm: IApiClient['llm'];
|
|
63
69
|
/** Section copy binder (for the localized bridge-unavailable message). */
|
|
64
70
|
t: (key: SubagentDirectorKey) => string;
|
|
65
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/client/store.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/client/store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2CAA2C,CAAC;AACrF,OAAO,KAAK,EAAE,qBAAqB,EAAsB,MAAM,oCAAoC,CAAC;AACpG,OAAO,EAML,KAAK,oBAAoB,EAI1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AACxD,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,wCAAwC,CAAC;AACjG,OAAO,EAQL,KAAK,iBAA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