@clawos-dev/clawd 0.2.23-beta.32.62648eb → 0.2.23-beta.34.136a698
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(),
|
|
@@ -13822,6 +13829,49 @@ var SessionManager = class {
|
|
|
13822
13829
|
this.deps.store.write(updated);
|
|
13823
13830
|
return { response: updated, broadcast: [] };
|
|
13824
13831
|
}
|
|
13832
|
+
// sidebar 拖拽完成 → 整体重写 pinned root 的 pinSortOrder(按 orderedIds 下标 0,1,2...)
|
|
13833
|
+
// orderedIds 必须正好覆盖所有当前 pinned root(既不能漏,也不能含 unpinned id)
|
|
13834
|
+
reorderPins(args) {
|
|
13835
|
+
const all = this.deps.store.list();
|
|
13836
|
+
const currentPinnedIds = new Set(
|
|
13837
|
+
all.filter((f) => typeof f.pinnedAt === "number").map((f) => f.sessionId)
|
|
13838
|
+
);
|
|
13839
|
+
const incoming = new Set(args.orderedIds);
|
|
13840
|
+
if (incoming.size !== args.orderedIds.length) {
|
|
13841
|
+
throw new Error("reorderPins: orderedIds contains duplicate ids");
|
|
13842
|
+
}
|
|
13843
|
+
if (currentPinnedIds.size !== incoming.size || [...currentPinnedIds].some((id) => !incoming.has(id))) {
|
|
13844
|
+
throw new Error(
|
|
13845
|
+
"reorderPins: orderedIds must cover exactly the current pinned root set"
|
|
13846
|
+
);
|
|
13847
|
+
}
|
|
13848
|
+
const broadcast = [];
|
|
13849
|
+
const updatedFiles = [];
|
|
13850
|
+
args.orderedIds.forEach((sessionId, index) => {
|
|
13851
|
+
const runner = this.runners.get(sessionId);
|
|
13852
|
+
if (runner) {
|
|
13853
|
+
const { value, broadcast: b } = this.withCollector(() => {
|
|
13854
|
+
runner.input({
|
|
13855
|
+
kind: "command",
|
|
13856
|
+
command: { kind: "update", patch: { pinSortOrder: index } }
|
|
13857
|
+
});
|
|
13858
|
+
return runner.getState().file;
|
|
13859
|
+
});
|
|
13860
|
+
updatedFiles.push(value);
|
|
13861
|
+
broadcast.push(...b);
|
|
13862
|
+
} else {
|
|
13863
|
+
const existing = this.getFile(sessionId);
|
|
13864
|
+
const updated = {
|
|
13865
|
+
...existing,
|
|
13866
|
+
pinSortOrder: index,
|
|
13867
|
+
updatedAt: nowIso2(this.deps)
|
|
13868
|
+
};
|
|
13869
|
+
this.deps.store.write(updated);
|
|
13870
|
+
updatedFiles.push(updated);
|
|
13871
|
+
}
|
|
13872
|
+
});
|
|
13873
|
+
return { response: { sessions: updatedFiles }, broadcast };
|
|
13874
|
+
}
|
|
13825
13875
|
list() {
|
|
13826
13876
|
return { response: { sessions: this.deps.store.list() }, broadcast: [] };
|
|
13827
13877
|
}
|
|
@@ -17757,6 +17807,11 @@ function buildSessionHandlers(deps) {
|
|
|
17757
17807
|
const { response, broadcast } = manager.pin(args);
|
|
17758
17808
|
return { response: { type: "session:info", ...response }, broadcast };
|
|
17759
17809
|
};
|
|
17810
|
+
const reorderPins = async (frame) => {
|
|
17811
|
+
const args = SessionReorderPinsArgs.parse(frame);
|
|
17812
|
+
const { response, broadcast } = manager.reorderPins(args);
|
|
17813
|
+
return { response: { type: "session:reorderPins", ...response }, broadcast };
|
|
17814
|
+
};
|
|
17760
17815
|
const answerQuestion = async (frame) => {
|
|
17761
17816
|
const args = AnswerQuestionArgs.parse(frame);
|
|
17762
17817
|
const { response, broadcast } = manager.answerQuestion(args);
|
|
@@ -17782,6 +17837,7 @@ function buildSessionHandlers(deps) {
|
|
|
17782
17837
|
"session:subscribe": subscribe,
|
|
17783
17838
|
"session:unsubscribe": unsubscribe,
|
|
17784
17839
|
"session:pin": pin,
|
|
17840
|
+
"session:reorderPins": reorderPins,
|
|
17785
17841
|
"session:answerQuestion": answerQuestion
|
|
17786
17842
|
};
|
|
17787
17843
|
}
|
package/package.json
CHANGED