@clawos-dev/clawd 0.2.23 → 0.2.24
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/cli.cjs +56 -0
- package/package.json +1 -1
package/dist/cli.cjs
CHANGED
|
@@ -8144,6 +8144,7 @@ var METHOD_NAMES = [
|
|
|
8144
8144
|
"session:subscribe",
|
|
8145
8145
|
"session:unsubscribe",
|
|
8146
8146
|
"session:pin",
|
|
8147
|
+
"session:reorderPins",
|
|
8147
8148
|
"permission:respond",
|
|
8148
8149
|
// AskUserQuestion 表单回写:UI 答完所有 question 后调用,daemon 把答案合并进 updated_input
|
|
8149
8150
|
// 写一条 control_response 到 CC stdin(详见 events.ts session:question JSDoc)
|
|
@@ -12326,6 +12327,9 @@ var SessionFileSchema = external_exports.object({
|
|
|
12326
12327
|
permissionRules: external_exports.array(AllowRuleSchema).optional(),
|
|
12327
12328
|
// Sidebar 置顶时间戳;null/undefined 表示未置顶
|
|
12328
12329
|
pinnedAt: external_exports.number().int().nonnegative().nullable().optional(),
|
|
12330
|
+
// pinned 行手动拖拽顺序;越小越靠前。session:reorderPins 整体重写所有 pinned 的此字段。
|
|
12331
|
+
// 缺失时 view-state 排序回退到 pinnedAt desc(旧数据兼容)
|
|
12332
|
+
pinSortOrder: external_exports.number().int().nullable().optional(),
|
|
12329
12333
|
// 用户在 NewSessionDialog 或 Edit modal 选择的 icon 标识;UI 端做 enum 兜底
|
|
12330
12334
|
iconKey: external_exports.string().optional(),
|
|
12331
12335
|
// NewSessionDialog 勾选 worktree 创建的 session 才会持久化这两个字段
|
|
@@ -12657,6 +12661,9 @@ var SessionPinArgs = external_exports.object({
|
|
|
12657
12661
|
sessionId: external_exports.string().min(1),
|
|
12658
12662
|
pinned: external_exports.boolean()
|
|
12659
12663
|
});
|
|
12664
|
+
var SessionReorderPinsArgs = external_exports.object({
|
|
12665
|
+
orderedIds: external_exports.array(external_exports.string().min(1)).min(1)
|
|
12666
|
+
});
|
|
12660
12667
|
var GitRootArgs = external_exports.object({ cwd: external_exports.string().min(1) });
|
|
12661
12668
|
var GitRootResponseSchema = external_exports.object({
|
|
12662
12669
|
isGitRoot: external_exports.boolean(),
|
|
@@ -13890,6 +13897,49 @@ var SessionManager = class {
|
|
|
13890
13897
|
this.deps.store.write(updated);
|
|
13891
13898
|
return { response: updated, broadcast: [] };
|
|
13892
13899
|
}
|
|
13900
|
+
// sidebar 拖拽完成 → 整体重写 pinned root 的 pinSortOrder(按 orderedIds 下标 0,1,2...)
|
|
13901
|
+
// orderedIds 必须正好覆盖所有当前 pinned root(既不能漏,也不能含 unpinned id)
|
|
13902
|
+
reorderPins(args) {
|
|
13903
|
+
const all = this.deps.store.list();
|
|
13904
|
+
const currentPinnedIds = new Set(
|
|
13905
|
+
all.filter((f) => typeof f.pinnedAt === "number").map((f) => f.sessionId)
|
|
13906
|
+
);
|
|
13907
|
+
const incoming = new Set(args.orderedIds);
|
|
13908
|
+
if (incoming.size !== args.orderedIds.length) {
|
|
13909
|
+
throw new Error("reorderPins: orderedIds contains duplicate ids");
|
|
13910
|
+
}
|
|
13911
|
+
if (currentPinnedIds.size !== incoming.size || [...currentPinnedIds].some((id) => !incoming.has(id))) {
|
|
13912
|
+
throw new Error(
|
|
13913
|
+
"reorderPins: orderedIds must cover exactly the current pinned root set"
|
|
13914
|
+
);
|
|
13915
|
+
}
|
|
13916
|
+
const broadcast = [];
|
|
13917
|
+
const updatedFiles = [];
|
|
13918
|
+
args.orderedIds.forEach((sessionId, index) => {
|
|
13919
|
+
const runner = this.runners.get(sessionId);
|
|
13920
|
+
if (runner) {
|
|
13921
|
+
const { value, broadcast: b } = this.withCollector(() => {
|
|
13922
|
+
runner.input({
|
|
13923
|
+
kind: "command",
|
|
13924
|
+
command: { kind: "update", patch: { pinSortOrder: index } }
|
|
13925
|
+
});
|
|
13926
|
+
return runner.getState().file;
|
|
13927
|
+
});
|
|
13928
|
+
updatedFiles.push(value);
|
|
13929
|
+
broadcast.push(...b);
|
|
13930
|
+
} else {
|
|
13931
|
+
const existing = this.getFile(sessionId);
|
|
13932
|
+
const updated = {
|
|
13933
|
+
...existing,
|
|
13934
|
+
pinSortOrder: index,
|
|
13935
|
+
updatedAt: nowIso2(this.deps)
|
|
13936
|
+
};
|
|
13937
|
+
this.deps.store.write(updated);
|
|
13938
|
+
updatedFiles.push(updated);
|
|
13939
|
+
}
|
|
13940
|
+
});
|
|
13941
|
+
return { response: { sessions: updatedFiles }, broadcast };
|
|
13942
|
+
}
|
|
13893
13943
|
list() {
|
|
13894
13944
|
return { response: { sessions: this.deps.store.list() }, broadcast: [] };
|
|
13895
13945
|
}
|
|
@@ -17825,6 +17875,11 @@ function buildSessionHandlers(deps) {
|
|
|
17825
17875
|
const { response, broadcast } = manager.pin(args);
|
|
17826
17876
|
return { response: { type: "session:info", ...response }, broadcast };
|
|
17827
17877
|
};
|
|
17878
|
+
const reorderPins = async (frame) => {
|
|
17879
|
+
const args = SessionReorderPinsArgs.parse(frame);
|
|
17880
|
+
const { response, broadcast } = manager.reorderPins(args);
|
|
17881
|
+
return { response: { type: "session:reorderPins", ...response }, broadcast };
|
|
17882
|
+
};
|
|
17828
17883
|
const answerQuestion = async (frame) => {
|
|
17829
17884
|
const args = AnswerQuestionArgs.parse(frame);
|
|
17830
17885
|
const { response, broadcast } = manager.answerQuestion(args);
|
|
@@ -17850,6 +17905,7 @@ function buildSessionHandlers(deps) {
|
|
|
17850
17905
|
"session:subscribe": subscribe,
|
|
17851
17906
|
"session:unsubscribe": unsubscribe,
|
|
17852
17907
|
"session:pin": pin,
|
|
17908
|
+
"session:reorderPins": reorderPins,
|
|
17853
17909
|
"session:answerQuestion": answerQuestion
|
|
17854
17910
|
};
|
|
17855
17911
|
}
|