@kioku-memory/cli 0.6.1-edge.20261125022612.gfab47ff → 0.6.1
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/dist/index.mjs +39 -5
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4659,7 +4659,7 @@ const ADD_USAGE = `用法:kioku add [标题] [--title <标题>] [--content <
|
|
|
4659
4659
|
[标题] 记忆标题(也可改用 --title;省略时取正文首个一级标题或短 ID)
|
|
4660
4660
|
--content <正文> 记忆正文;省略时读取管道标准输入或打开编辑器
|
|
4661
4661
|
--topic <标签> 主题标签(可重复传入或逗号分隔)
|
|
4662
|
-
--env <环境>
|
|
4662
|
+
--env <环境> 适用环境或自定义主机标识,如 mac、linux、win、home-24(可重复或逗号分隔;多标签任一命中,单机隔离仅标主机标识)
|
|
4663
4663
|
--realm <场域> 适用场域标签,例如 work、personal(可重复或逗号分隔)
|
|
4664
4664
|
--project <项目> 适用项目标识(可重复或逗号分隔)
|
|
4665
4665
|
--runtime <客户端> 适用客户端标识(可重复或逗号分隔)
|
|
@@ -4894,7 +4894,7 @@ const EDIT_USAGE = `用法:kioku edit <短ID或标题> [--title <标题>] [--c
|
|
|
4894
4894
|
--content <正文> 更新记忆正文
|
|
4895
4895
|
--stdin 从管道标准输入读取新正文
|
|
4896
4896
|
--topic <标签> 覆盖主题标签列表(可重复或逗号分隔,传 clear 清空)
|
|
4897
|
-
--env <环境>
|
|
4897
|
+
--env <环境> 覆盖环境或自定义主机标识列表(如 mac、home-24;可重复或逗号分隔,传 clear 清空)
|
|
4898
4898
|
--realm <场域> 覆盖场域标签列表(可重复或逗号分隔,传 clear 清空)
|
|
4899
4899
|
--project <项目> 覆盖项目标签列表(可重复或逗号分隔,传 clear 清空)
|
|
4900
4900
|
--runtime <客户端> 覆盖客户端标签列表(可重复或逗号分隔,传 clear 清空)
|
|
@@ -5188,12 +5188,18 @@ async function bootCommand(argv, { env = process.env, out = process.stdout, stdi
|
|
|
5188
5188
|
const entries = Array.isArray(boot.entries) ? boot.entries : [];
|
|
5189
5189
|
const episodes = Array.isArray(boot.episodes) ? boot.episodes : [];
|
|
5190
5190
|
const omitted = Array.isArray(boot.omitted) ? boot.omitted : [];
|
|
5191
|
+
const omittedItems = Array.isArray(boot.omittedItems) ? boot.omittedItems : [];
|
|
5192
|
+
const isCatalogItem = (item) => item.reason === "index" || !item.reason && item.bootMode === "index";
|
|
5193
|
+
const catalogItems = omittedItems.filter(isCatalogItem);
|
|
5194
|
+
const overflowItems = omittedItems.filter((item) => !isCatalogItem(item));
|
|
5195
|
+
const overflowCount = overflowItems.length || (!omittedItems.length ? omitted.length : 0);
|
|
5191
5196
|
const theme = createTheme({
|
|
5192
5197
|
stream: out,
|
|
5193
5198
|
env
|
|
5194
5199
|
});
|
|
5195
5200
|
const width = boxWidthFor(out);
|
|
5196
|
-
|
|
5201
|
+
const indentWrapWidth = Math.max(20, width - 6);
|
|
5202
|
+
if (!entries.length && !episodes.length && !omittedItems.length && !omitted.length) {
|
|
5197
5203
|
const emptyBox = renderBox({
|
|
5198
5204
|
title: "启动加载",
|
|
5199
5205
|
width,
|
|
@@ -5209,6 +5215,8 @@ async function bootCommand(argv, { env = process.env, out = process.stdout, stdi
|
|
|
5209
5215
|
entries.forEach((entry, idx) => {
|
|
5210
5216
|
if (idx > 0) entryLines.push("");
|
|
5211
5217
|
entryLines.push(`${theme.bold(plain(entry.title))} ${theme.muted(`${kindLabel(entry.kind)} · ${plain(entry.shortId)}`)}`);
|
|
5218
|
+
const scene = formatSceneInline(entry);
|
|
5219
|
+
if (scene) entryLines.push(...wrapWidth(`场景:${scene}`, indentWrapWidth).map((l) => ` ${theme.muted(l)}`));
|
|
5212
5220
|
entryLines.push(...wrapWidth(sanitizeBody(entry.content), width - 4));
|
|
5213
5221
|
});
|
|
5214
5222
|
sections.push({
|
|
@@ -5216,6 +5224,20 @@ async function bootCommand(argv, { env = process.env, out = process.stdout, stdi
|
|
|
5216
5224
|
lines: entryLines
|
|
5217
5225
|
});
|
|
5218
5226
|
}
|
|
5227
|
+
if (catalogItems.length) {
|
|
5228
|
+
const catalogLines = [];
|
|
5229
|
+
catalogItems.forEach((item) => {
|
|
5230
|
+
catalogLines.push(`${theme.bold(plain(item.title))} ${theme.muted(plain(item.shortId))}`);
|
|
5231
|
+
const scene = formatSceneInline(item);
|
|
5232
|
+
if (scene) catalogLines.push(...wrapWidth(`场景:${scene}`, indentWrapWidth).map((l) => ` ${theme.muted(l)}`));
|
|
5233
|
+
const note = plain(stripAnsi(item.summary ?? "")) || plain(stripAnsi(item.disclosure ?? ""));
|
|
5234
|
+
if (note) catalogLines.push(...wrapWidth(note, indentWrapWidth).map((l) => ` ${theme.muted(l)}`));
|
|
5235
|
+
});
|
|
5236
|
+
sections.push({
|
|
5237
|
+
title: `常驻目录(${catalogItems.length})`,
|
|
5238
|
+
lines: catalogLines
|
|
5239
|
+
});
|
|
5240
|
+
}
|
|
5219
5241
|
if (episodes.length) {
|
|
5220
5242
|
const episodeLines = [];
|
|
5221
5243
|
episodes.forEach((episode, idx) => {
|
|
@@ -5229,12 +5251,24 @@ async function bootCommand(argv, { env = process.env, out = process.stdout, stdi
|
|
|
5229
5251
|
lines: episodeLines
|
|
5230
5252
|
});
|
|
5231
5253
|
}
|
|
5232
|
-
if (
|
|
5254
|
+
if (overflowItems.length) {
|
|
5255
|
+
const overflowLines = [];
|
|
5256
|
+
overflowItems.forEach((item) => {
|
|
5257
|
+
const reasonText = item.reason === "oversized" ? "单条超限" : "预算外";
|
|
5258
|
+
overflowLines.push(`${plain(item.title)} ${theme.muted(`${plain(item.shortId)} · ${reasonText}`)}`);
|
|
5259
|
+
const scene = formatSceneInline(item);
|
|
5260
|
+
if (scene) overflowLines.push(...wrapWidth(`场景:${scene}`, indentWrapWidth).map((l) => ` ${theme.muted(l)}`));
|
|
5261
|
+
});
|
|
5262
|
+
sections.push({
|
|
5263
|
+
title: `字数预算外(${overflowItems.length})`,
|
|
5264
|
+
lines: overflowLines
|
|
5265
|
+
});
|
|
5266
|
+
} else if (!omittedItems.length && omitted.length) sections.push({
|
|
5233
5267
|
title: `字数预算外(${omitted.length})`,
|
|
5234
5268
|
lines: [theme.muted(omitted.map((id) => plain(id)).join("、"))]
|
|
5235
5269
|
});
|
|
5236
5270
|
const box = renderBox({
|
|
5237
|
-
title: entries.length ? `启动加载预览 · 常驻记忆(${entries.length})` : `启动加载预览 · 近期会话摘要(${episodes.length}
|
|
5271
|
+
title: entries.length ? `启动加载预览 · 常驻记忆(${entries.length})` : catalogItems.length ? `启动加载预览 · 常驻目录(${catalogItems.length})` : episodes.length ? `启动加载预览 · 近期会话摘要(${episodes.length})` : overflowCount ? `启动加载预览 · 字数预算外(${overflowCount})` : "启动加载预览",
|
|
5238
5272
|
width,
|
|
5239
5273
|
theme,
|
|
5240
5274
|
sections
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kioku-memory/cli",
|
|
3
|
-
"version": "0.6.1
|
|
3
|
+
"version": "0.6.1",
|
|
4
4
|
"description": "Kioku 的命令行:接入各平台的向导、把凭据交给命令(kioku run)、停用各平台自带的长期记忆(kioku setup)、检查配置(kioku doctor)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/lonelyman0108/kioku-plugins/tree/main/packages/cli",
|