prompt-skill-armory 0.10.5 → 0.11.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.en.md +3 -3
- package/README.md +3 -3
- package/package.json +1 -1
- package/packages/client-ui-switchblade/lib/client.js +95 -27
- package/packages/client-ui-switchblade/lib/client.js.map +1 -1
- package/packages/client-ui-switchblade/package.json +1 -1
- package/packages/client-ui-switchblade/src/client/SwitchbladeSection.tsx +71 -21
- package/packages/client-ui-switchblade/src/client/store.ts +7 -2
- package/packages/switchblade/lib/index.js +12 -8
- package/packages/switchblade/lib/switchblade.js +12 -8
- package/packages/switchblade/package.json +1 -1
- package/packages/switchblade/src/switchblade.ts +21 -11
package/README.en.md
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
|--|--|--|--|
|
|
13
13
|
| <img src="docs/preview/preview-6.png" width="220"/> | <img src="docs/preview/preview-7.png" width="220"/> | | |
|
|
14
14
|
|
|
15
|
-

|
|
16
16
|

|
|
17
17
|

|
|
18
18
|

|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
✦ Armory v0.
|
|
21
|
+
✦ Armory v0.11.0
|
|
22
22
|
┌─────────┬─────────┬─────┬────────────┬──────┬──────┐
|
|
23
23
|
│ Prompts │ Skills │ MCP │ Wallpaper │ Chat │ Stats│
|
|
24
24
|
│ global │ merged │ hub │ wallpaper │ sync │ usage│
|
|
@@ -125,7 +125,7 @@ Achieved via profile composition (the installer mounts the panel into each profi
|
|
|
125
125
|
|
|
126
126
|
Every time the panel opens it queries npm for the latest `prompt-skill-armory` version; when a newer version exists a banner appears:
|
|
127
127
|
|
|
128
|
-
> New version vX.Y.Z (current v0.
|
|
128
|
+
> New version vX.Y.Z (current v0.11.0) [Update now]
|
|
129
129
|
|
|
130
130
|
Clicking "Update now" makes the Host re-run the official installer in place → "Update complete, please restart the client".
|
|
131
131
|
|
package/README.md
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
|--|--|--|--|
|
|
13
13
|
| <img src="docs/preview/preview-6.png" width="220"/> | <img src="docs/preview/preview-7.png" width="220"/> | | |
|
|
14
14
|
|
|
15
|
-

|
|
16
16
|

|
|
17
17
|

|
|
18
18
|

|
|
19
19
|
|
|
20
20
|
```
|
|
21
|
-
✦ Armory v0.
|
|
21
|
+
✦ Armory v0.11.0
|
|
22
22
|
┌─────────┬─────────┬─────┬────────────┬──────┬──────┐
|
|
23
23
|
│ 提示词 │ 技能 │ MCP │ Wallpaper │ 对话 │ 统计 │
|
|
24
24
|
│ 全局注入 │ 合并管理 │ 连接 │ 壁纸·特效 │ 导入 │ 用量 │
|
|
@@ -128,7 +128,7 @@ pnpm dsh web
|
|
|
128
128
|
|
|
129
129
|
插件面板每次打开会自动查询 npm 上 `prompt-skill-armory` 的最新版本;发现新版本时顶部显示横幅:
|
|
130
130
|
|
|
131
|
-
> 有新版本 vX.Y.Z(当前 v0.
|
|
131
|
+
> 有新版本 vX.Y.Z(当前 v0.11.0) [一键更新]
|
|
132
132
|
|
|
133
133
|
点击「一键更新」→ Host 端运行官方安装器原地重装 → 提示「更新完成,请重启客户端生效」。
|
|
134
134
|
|
package/package.json
CHANGED
|
@@ -949,7 +949,7 @@ window.__ModuleLoader__.load({
|
|
|
949
949
|
});
|
|
950
950
|
}
|
|
951
951
|
/** Bump with every release; keep in sync with package.json version + CHANGELOG. */
|
|
952
|
-
const ARMORY_VERSION = "0.
|
|
952
|
+
const ARMORY_VERSION = "0.11.0";
|
|
953
953
|
/** Compact duration: 45.2s / 2m42s / 1h05m. */
|
|
954
954
|
function fmtDuration(ms) {
|
|
955
955
|
const s = ms / 1e3;
|
|
@@ -1387,6 +1387,26 @@ window.__ModuleLoader__.load({
|
|
|
1387
1387
|
if (chatProject === "" && chatProjects.length > 0) setChatProject(chatProjects[0].key);
|
|
1388
1388
|
else if (chatProject !== "" && !chatProjects.some((p) => p.key === chatProject)) setChatProject(chatProjects[0]?.key ?? "");
|
|
1389
1389
|
}, [chatProjects, chatProject]);
|
|
1390
|
+
const scopeProjectOptions = (0, react.useMemo)(() => chatProjects.map((p) => ({
|
|
1391
|
+
value: p.name,
|
|
1392
|
+
label: p.name
|
|
1393
|
+
})), [chatProjects]);
|
|
1394
|
+
const scopeSessionOptions = (0, react.useMemo)(() => {
|
|
1395
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1396
|
+
const out = [];
|
|
1397
|
+
for (const row of chatRows) {
|
|
1398
|
+
if (seen.has(row.sessionId)) continue;
|
|
1399
|
+
seen.add(row.sessionId);
|
|
1400
|
+
const title = (row.title || "").trim();
|
|
1401
|
+
const short = row.sessionId.replace(/^session-/, "").slice(0, 8);
|
|
1402
|
+
const proj = row.cwd ? row.cwd.split(/[\\/]/).filter(Boolean).pop() ?? "" : row.projectKey;
|
|
1403
|
+
out.push({
|
|
1404
|
+
value: row.sessionId,
|
|
1405
|
+
label: `${title !== "" ? title : "(无标题)"} · ${proj} · ${short}`
|
|
1406
|
+
});
|
|
1407
|
+
}
|
|
1408
|
+
return out;
|
|
1409
|
+
}, [chatRows]);
|
|
1390
1410
|
const doExportChat = async () => {
|
|
1391
1411
|
setChatBusy(true);
|
|
1392
1412
|
setChatMsg("");
|
|
@@ -1546,13 +1566,21 @@ window.__ModuleLoader__.load({
|
|
|
1546
1566
|
};
|
|
1547
1567
|
const submitPrompt = () => {
|
|
1548
1568
|
if (promptName.trim() === "" || promptContent.trim() === "") return;
|
|
1569
|
+
if (promptScopeType !== "global" && promptScopeKey.trim() === "") return;
|
|
1549
1570
|
setBusy(true);
|
|
1571
|
+
const key = promptScopeKey.trim();
|
|
1550
1572
|
const scope = promptScopeType === "global" ? void 0 : promptScopeType === "project" ? {
|
|
1551
1573
|
type: "project",
|
|
1552
|
-
key
|
|
1553
|
-
} : {
|
|
1574
|
+
key
|
|
1575
|
+
} : promptScopeType === "session" ? {
|
|
1554
1576
|
type: "session",
|
|
1555
|
-
id:
|
|
1577
|
+
id: key
|
|
1578
|
+
} : promptScopeType === "exclude-project" ? {
|
|
1579
|
+
type: "exclude-project",
|
|
1580
|
+
key
|
|
1581
|
+
} : {
|
|
1582
|
+
type: "exclude-session",
|
|
1583
|
+
id: key
|
|
1556
1584
|
};
|
|
1557
1585
|
(editingPromptId !== void 0 ? updatePrompt(editingPromptId, {
|
|
1558
1586
|
name: promptName,
|
|
@@ -1580,9 +1608,9 @@ window.__ModuleLoader__.load({
|
|
|
1580
1608
|
setPromptDesc(row.desc);
|
|
1581
1609
|
setPromptContent(row.content ?? "");
|
|
1582
1610
|
const s = row.scope;
|
|
1583
|
-
if (s !== void 0 &&
|
|
1611
|
+
if (s !== void 0 && s.type !== "global") {
|
|
1584
1612
|
setPromptScopeType(s.type);
|
|
1585
|
-
setPromptScopeKey(s.type === "project" ? s.key ?? "" : s.id ?? "");
|
|
1613
|
+
setPromptScopeKey(s.type === "project" || s.type === "exclude-project" ? s.key ?? "" : s.id ?? "");
|
|
1586
1614
|
} else {
|
|
1587
1615
|
setPromptScopeType("global");
|
|
1588
1616
|
setPromptScopeKey("");
|
|
@@ -1856,29 +1884,60 @@ window.__ModuleLoader__.load({
|
|
|
1856
1884
|
},
|
|
1857
1885
|
children: "作用域"
|
|
1858
1886
|
}),
|
|
1859
|
-
|
|
1860
|
-
"global",
|
|
1861
|
-
"project",
|
|
1862
|
-
"session"
|
|
1863
|
-
].map((st) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
1864
|
-
style: {
|
|
1865
|
-
...CSS.actionBtn,
|
|
1866
|
-
...promptScopeType === st ? CSS.tabActive : {}
|
|
1867
|
-
},
|
|
1868
|
-
onClick: () => setPromptScopeType(st),
|
|
1869
|
-
children: st === "global" ? "全局" : st === "project" ? "指定项目" : "指定会话"
|
|
1870
|
-
}, st)),
|
|
1871
|
-
promptScopeType !== "global" && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
1887
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1872
1888
|
style: {
|
|
1873
1889
|
...CSS.input,
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
minWidth: "120px"
|
|
1890
|
+
flex: "none",
|
|
1891
|
+
minWidth: "150px"
|
|
1877
1892
|
},
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1893
|
+
value: promptScopeType,
|
|
1894
|
+
onChange: (e) => {
|
|
1895
|
+
setPromptScopeType(e.target.value);
|
|
1896
|
+
setPromptScopeKey("");
|
|
1897
|
+
},
|
|
1898
|
+
children: [
|
|
1899
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1900
|
+
value: "global",
|
|
1901
|
+
children: "全局(所有项目/会话)"
|
|
1902
|
+
}),
|
|
1903
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1904
|
+
value: "project",
|
|
1905
|
+
children: "仅指定项目"
|
|
1906
|
+
}),
|
|
1907
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1908
|
+
value: "session",
|
|
1909
|
+
children: "仅指定会话"
|
|
1910
|
+
}),
|
|
1911
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1912
|
+
value: "exclude-project",
|
|
1913
|
+
children: "除指定项目外(其余全部生效)"
|
|
1914
|
+
}),
|
|
1915
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1916
|
+
value: "exclude-session",
|
|
1917
|
+
children: "除指定会话外(其余全部生效)"
|
|
1918
|
+
})
|
|
1919
|
+
]
|
|
1920
|
+
}),
|
|
1921
|
+
promptScopeType !== "global" && (() => {
|
|
1922
|
+
const opts = promptScopeType === "project" || promptScopeType === "exclude-project" ? scopeProjectOptions : scopeSessionOptions;
|
|
1923
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("select", {
|
|
1924
|
+
style: {
|
|
1925
|
+
...CSS.input,
|
|
1926
|
+
flex: 1,
|
|
1927
|
+
minWidth: "180px",
|
|
1928
|
+
maxWidth: "320px"
|
|
1929
|
+
},
|
|
1930
|
+
value: promptScopeKey,
|
|
1931
|
+
onChange: (e) => setPromptScopeKey(e.target.value),
|
|
1932
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1933
|
+
value: "",
|
|
1934
|
+
children: opts.length === 0 ? "(暂无数据,请先到「对话」标签刷新)" : "请选择…"
|
|
1935
|
+
}), opts.map((o) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("option", {
|
|
1936
|
+
value: o.value,
|
|
1937
|
+
children: o.label
|
|
1938
|
+
}, o.value))]
|
|
1939
|
+
});
|
|
1940
|
+
})()
|
|
1882
1941
|
]
|
|
1883
1942
|
}),
|
|
1884
1943
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -1936,7 +1995,16 @@ window.__ModuleLoader__.load({
|
|
|
1936
1995
|
...CSS.badge,
|
|
1937
1996
|
...CSS.badgeInstalled
|
|
1938
1997
|
},
|
|
1939
|
-
children:
|
|
1998
|
+
children: (() => {
|
|
1999
|
+
const s = row.scope;
|
|
2000
|
+
switch (s.type) {
|
|
2001
|
+
case "project": return `仅项目:${s.key}`;
|
|
2002
|
+
case "session": return `仅会话:${(s.id ?? "").replace(/^session-/, "").slice(0, 8)}`;
|
|
2003
|
+
case "exclude-project": return `除项目 ${s.key} 外`;
|
|
2004
|
+
case "exclude-session": return `除会话 ${(s.id ?? "").replace(/^session-/, "").slice(0, 8)} 外`;
|
|
2005
|
+
default: return "";
|
|
2006
|
+
}
|
|
2007
|
+
})()
|
|
1940
2008
|
})
|
|
1941
2009
|
]
|
|
1942
2010
|
}),
|