dsh-llm-codebuddy-power 1.0.0 → 1.3.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.
@@ -1,25 +0,0 @@
1
- /**
2
- * 插件自有的每轮积分持久化:按会话存到独立文件,绕过 dsh 会话日志白名单。
3
- *
4
- * 每会话一个 JSON 文件,内容为 `{ [turn]: { credit } }`(轮次号 → 该轮扣分)。
5
- * 文件是纯增量记录:缺文件等价于空记录,写入是合并回写(原子替换)。模型不存
6
- * ——dsh 用量自带。文件只增不删:会话被销毁(一次性子代理跑完即如此)不等于
7
- * 用户删除了会话,此时删除会让那一轮的扣分永远查不到。
8
- *
9
- * @module dsh-llm-codebuddy-power/credit-store
10
- */
11
- import type { TurnCreditRecord } from './session.ts';
12
- /**
13
- * 读取一个会话的全部积分记录。
14
- * @param sessionId - dsh 会话 id。
15
- * @returns 轮次号 → 记录的映射;缺文件或损坏返回空对象(纯增量记录,无文件=无记录)。
16
- */
17
- export declare function loadCredits(sessionId: string): Promise<Record<string, TurnCreditRecord>>;
18
- /**
19
- * 合并写入一个会话某轮的积分(原子替换,文件不存在则新建)。
20
- * @param sessionId - dsh 会话 id。
21
- * @param turn - 轮次号。
22
- * @param record - 该轮消耗的积分。
23
- */
24
- export declare function saveCredit(sessionId: string, turn: number, record: TurnCreditRecord): Promise<void>;
25
- //# sourceMappingURL=credit-store.d.ts.map
@@ -1,35 +0,0 @@
1
- /**
2
- * 每个会话选用的账号,以及“最后一次手动切换”的账号。
3
- *
4
- * 单独放在 `codebuddy-selection.json`,而不是并进凭据文件:凭据文件有两个写者
5
- * (运行中的 harness 与 CLI),会话选择只有 harness 写,分开后两边不会各自基于
6
- * 旧内容覆盖对方。文件里的 uid 指向已退出的账号时按“没有选择”处理 —— 兜底放在
7
- * 读取侧,磁盘记录因此只增不删(与每轮积分一致);同一个 uid 账号日后重新登录
8
- * 时,原来的选择会重新生效。
9
- *
10
- * @module dsh-llm-codebuddy-power/selection
11
- */
12
- /** 会话选择文件的内容。 */
13
- export interface CodeBuddySelection {
14
- /** 会话 id → 该会话显式选用的账号 uid。 */
15
- sessions: Record<string, string>;
16
- /** 最后一次被手动切换到的账号 uid;没有默认账号时作为兜底。 */
17
- lastUid?: string;
18
- }
19
- /**
20
- * 读取会话选择;文件缺失或损坏时按空内容处理。
21
- * @returns 会话选择;没有任何选择时 `sessions` 为空对象。
22
- */
23
- export declare function loadSelection(): Promise<CodeBuddySelection>;
24
- /**
25
- * 记下一个会话选用的账号,并把它记为最后一次手动切换的账号。
26
- * @param sessionId - dsh 会话 id。
27
- * @param uid - 该会话要使用的账号 uid。
28
- */
29
- export declare function selectAccount(sessionId: string, uid: string): Promise<void>;
30
- /**
31
- * 选择文件的不透明新鲜度令牌,与 {@link storageFreshness} 同形。
32
- * @returns 一个令牌;文件不存在时返回 `undefined`。
33
- */
34
- export declare function selectionFreshness(): Promise<string | undefined>;
35
- //# sourceMappingURL=selection.d.ts.map