@lemoncat7/dsh-partner 1.7.0 → 1.8.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/README.md +22 -2
- package/docs/architecture.md +27 -1
- package/lib/agent-runtime.d.ts +2 -0
- package/lib/agent-runtime.d.ts.map +1 -1
- package/lib/agent-runtime.js +13 -0
- package/lib/agent-runtime.js.map +1 -1
- package/lib/capabilities.d.ts +5 -0
- package/lib/capabilities.d.ts.map +1 -0
- package/lib/capabilities.js +9 -0
- package/lib/capabilities.js.map +1 -0
- package/lib/client-api.d.ts +2 -1
- package/lib/client-api.d.ts.map +1 -1
- package/lib/client-api.js.map +1 -1
- package/lib/client.d.ts.map +1 -1
- package/lib/client.js +24 -4
- package/lib/client.js.map +3 -3
- package/lib/collaboration/composition.d.ts +5 -1
- package/lib/collaboration/composition.d.ts.map +1 -1
- package/lib/collaboration/composition.js +13 -2
- package/lib/collaboration/composition.js.map +1 -1
- package/lib/companions/knowledge-mounts.d.ts +16 -0
- package/lib/companions/knowledge-mounts.d.ts.map +1 -0
- package/lib/companions/knowledge-mounts.js +77 -0
- package/lib/companions/knowledge-mounts.js.map +1 -0
- package/lib/companions/management-tool.d.ts +6 -0
- package/lib/companions/management-tool.d.ts.map +1 -0
- package/lib/companions/management-tool.js +66 -0
- package/lib/companions/management-tool.js.map +1 -0
- package/lib/companions/management.d.ts +119 -0
- package/lib/companions/management.d.ts.map +1 -0
- package/lib/companions/management.js +136 -0
- package/lib/companions/management.js.map +1 -0
- package/lib/domain.d.ts +2 -1
- package/lib/domain.d.ts.map +1 -1
- package/lib/domain.js +2 -4
- package/lib/domain.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +17 -2
- package/lib/index.js.map +1 -1
- package/lib/pendant/renderer.d.ts.map +1 -1
- package/lib/pendant/renderer.js +5 -4
- package/lib/pendant/renderer.js.map +1 -1
- package/lib/pendant/surface.d.ts +12 -0
- package/lib/pendant/surface.d.ts.map +1 -0
- package/lib/pendant/surface.js +15 -0
- package/lib/pendant/surface.js.map +1 -0
- package/lib/pendant-renderer.js +166 -166
- package/lib/ui/companion-access-panel.d.ts.map +1 -1
- package/lib/ui/companion-access-panel.js +2 -2
- package/lib/ui/companion-access-panel.js.map +1 -1
- package/package.json +1 -1
package/lib/client.js
CHANGED
|
@@ -5497,8 +5497,25 @@ function companionName(companions, id) {
|
|
|
5497
5497
|
// src/ui/companion-access-panel.tsx
|
|
5498
5498
|
var import_react16 = require("react");
|
|
5499
5499
|
var import_dsh_client_ui_primitives9 = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
5500
|
+
|
|
5501
|
+
// src/capabilities.ts
|
|
5502
|
+
var COMPANION_CAPABILITIES = ["knowledge", "skills", "ssh", "git", "companions", "schedules", "access", "administration"];
|
|
5503
|
+
var CAPABILITY_LABELS = {
|
|
5504
|
+
knowledge: "\u77E5\u8BC6\u5E93",
|
|
5505
|
+
skills: "Skill",
|
|
5506
|
+
ssh: "SSH",
|
|
5507
|
+
git: "Git",
|
|
5508
|
+
companions: "\u521B\u5EFA\u4F19\u4F34",
|
|
5509
|
+
schedules: "\u5B9A\u65F6\u4EFB\u52A1",
|
|
5510
|
+
access: "\u4F19\u4F34\u6388\u6743",
|
|
5511
|
+
administration: "\u4F19\u4F34\u7BA1\u7406\uFF08\u9AD8\u6743\u9650\uFF09"
|
|
5512
|
+
};
|
|
5513
|
+
function isCompanionCapability(value) {
|
|
5514
|
+
return COMPANION_CAPABILITIES.includes(value);
|
|
5515
|
+
}
|
|
5516
|
+
|
|
5517
|
+
// src/ui/companion-access-panel.tsx
|
|
5500
5518
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
5501
|
-
var CAPABILITY_LABELS = { knowledge: "\u77E5\u8BC6\u5E93", skills: "Skill", ssh: "SSH", git: "Git", companions: "\u521B\u5EFA\u4F19\u4F34", schedules: "\u5B9A\u65F6\u4EFB\u52A1", access: "\u4F19\u4F34\u6388\u6743" };
|
|
5502
5519
|
function CompanionAccessPanel({ companionId }) {
|
|
5503
5520
|
const [access, setAccess] = (0, import_react16.useState)({ targetIds: [], companions: [] });
|
|
5504
5521
|
const [busy, setBusy] = (0, import_react16.useState)();
|
|
@@ -5544,7 +5561,7 @@ function CompanionAccessPanel({ companionId }) {
|
|
|
5544
5561
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "dsh-partner-access-note", children: "\u52FE\u9009\u540E\uFF0C\u5F53\u524D\u4F19\u4F34\u80FD\u4E86\u89E3\u5BF9\u65B9\u7684\u516C\u5F00\u80FD\u529B\uFF0C\u5E76\u5728\u4EFB\u52A1\u770B\u677F\u4E2D `@` \u5BF9\u65B9\u6267\u884C\u4EFB\u52A1\u3002\u6388\u6743\u53EA\u6CBF\u5F53\u524D\u65B9\u5411\u751F\u6548\uFF0C\u4E0D\u4F1A\u53CD\u5411\u6388\u6743\uFF0C\u4E5F\u4E0D\u4F1A\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u3001\u6E20\u9053\u6216\u51ED\u636E\u3002" }),
|
|
5545
5562
|
access.companions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CollectionEmpty, { title: "\u8FD8\u6CA1\u6709\u53EF\u6388\u6743\u7684\u4F19\u4F34", detail: "\u521B\u5EFA\u7B2C\u4E8C\u4F4D\u4F19\u4F34\u540E\uFF0C\u53EF\u4EE5\u5728\u8FD9\u91CC\u5EFA\u7ACB\u5355\u5411\u534F\u4F5C\u6388\u6743\u3002" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "dsh-partner-access-list", children: access.companions.map((companion) => {
|
|
5546
5563
|
const selected = access.targetIds.includes(companion.id);
|
|
5547
|
-
const abilities = companion.capabilities.map((capability) => CAPABILITY_LABELS[capability]
|
|
5564
|
+
const abilities = companion.capabilities.map((capability) => isCompanionCapability(capability) ? CAPABILITY_LABELS[capability] : capability);
|
|
5548
5565
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", className: selected ? "is-active" : "", "aria-pressed": selected, disabled: busy === companion.id, onClick: () => {
|
|
5549
5566
|
void toggle(companion.id);
|
|
5550
5567
|
}, children: [
|
|
@@ -5978,7 +5995,7 @@ function HomePanel({ companion, snapshot, navigate, openSession, startSession, r
|
|
|
5978
5995
|
const localSession = sessions2.find((item) => item.kind === "local");
|
|
5979
5996
|
const pending = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "pending").length : 0;
|
|
5980
5997
|
const approved = channel ? snapshot.pairings.filter((item) => item.channelId === channel.id && item.status === "approved").length : 0;
|
|
5981
|
-
const capabilities = companion.capabilities.map((item) =>
|
|
5998
|
+
const capabilities = companion.capabilities.map((item) => CAPABILITY_LABELS[item]);
|
|
5982
5999
|
const online = channel?.runtimeStatus === "running";
|
|
5983
6000
|
return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-home", children: [
|
|
5984
6001
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("header", { className: "dsh-partner-home-heading", children: [
|
|
@@ -6142,6 +6159,9 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
6142
6159
|
{ id: "companions", title: "\u521B\u5EFA\u4F19\u4F34", detail: "\u6309\u660E\u786E\u9700\u6C42\u521B\u5EFA\u9ED8\u8BA4\u65E0\u6743\u9650\u7684\u65B0\u4F19\u4F34\u3002" },
|
|
6143
6160
|
{ id: "access", title: "\u4F19\u4F34\u6388\u6743", detail: "\u6309\u660E\u786E\u8981\u6C42\u914D\u7F6E\u4F19\u4F34\u4E4B\u95F4\u7684\u5355\u5411\u8BBF\u95EE\u5173\u7CFB\u3002" },
|
|
6144
6161
|
{ id: "schedules", title: "\u5B9A\u65F6\u4EFB\u52A1", detail: "\u521B\u5EFA\u5E76\u7BA1\u7406\u7531\u81EA\u5DF1\u6267\u884C\u7684\u5468\u671F\u4EFB\u52A1\u3002" }
|
|
6162
|
+
] },
|
|
6163
|
+
{ id: "administration", eyebrow: "ADMINISTRATION", title: "\u9AD8\u6743\u9650\u7BA1\u7406", detail: "\u4EC5\u6388\u4E88\u53EF\u4FE1\u7684\u7BA1\u7406\u4F19\u4F34\uFF1B\u666E\u901A\u534F\u4F5C\u6388\u6743\u4E0D\u5305\u542B\u4FEE\u6539\u6743\u9650\u3002", choices: [
|
|
6164
|
+
{ id: "administration", title: CAPABILITY_LABELS.administration, detail: "\u4FEE\u6539\u5176\u4ED6\u4F19\u4F34\u7684\u8EAB\u4EFD\u3001\u80FD\u529B\u4E0E Preset\u3001\u534F\u4F5C\u3001Skill \u548C\u77E5\u8BC6\u5E93\u6302\u8F7D\u3002\u4E0D\u5171\u4EAB\u4F1A\u8BDD\u3001\u8BB0\u5FC6\u6216\u51ED\u636E\uFF1B\u4E0D\u80FD\u81EA\u6539\u6216\u8F6C\u6388\u672C\u6743\u9650\u3002" }
|
|
6145
6165
|
] }
|
|
6146
6166
|
];
|
|
6147
6167
|
const selectedProvider = form.provider || modelCatalog?.defaultSelection.provider || "";
|
|
@@ -6202,7 +6222,7 @@ function CapabilityEditor({ companion, presets, onChanged }) {
|
|
|
6202
6222
|
form.capabilities.includes("skills") && companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionSkillSettings, { companionId: companion.id }),
|
|
6203
6223
|
form.capabilities.includes("skills") && !companion.capabilities.includes("skills") && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-note", children: "\u5148\u5E94\u7528\u80FD\u529B\u7EC4\u5408\uFF0C\u518D\u4E3A\u5F53\u524D\u4F19\u4F34\u9009\u62E9\u5177\u4F53 Skill\u3002" }),
|
|
6204
6224
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)(CompanionAccessPanel, { companionId: companion.id }),
|
|
6205
|
-
error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", children: error }),
|
|
6225
|
+
error && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("p", { className: "dsh-partner-inline-error", role: "alert", children: error }),
|
|
6206
6226
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "dsh-partner-form-actions", children: [
|
|
6207
6227
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("span", {}),
|
|
6208
6228
|
/* @__PURE__ */ (0, import_jsx_runtime14.jsx)("button", { type: "button", disabled: saving, onClick: () => {
|