dsh-llm-codebuddy-power 1.0.0 → 1.2.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/LICENSE +22 -22
- package/README.md +85 -66
- package/README.zh.md +85 -66
- package/cordis.patch.yml +7 -7
- package/icon.svg +6 -0
- package/lib/cli-login.js +4 -4
- package/lib/client.js +368 -270
- package/lib/index.js +321 -172
- package/lib/types/adapter.d.ts +7 -1
- package/lib/types/auth-service.d.ts +58 -11
- package/lib/types/client/CodeBuddySection.d.ts +14 -7
- package/lib/types/client/index.d.ts +6 -6
- package/lib/types/client/locales.d.ts +1 -1
- package/lib/types/client/store.d.ts +17 -9
- package/lib/types/client/wire.d.ts +18 -1
- package/lib/types/constants.d.ts +8 -0
- package/lib/types/index.d.ts +43 -21
- package/lib/types/prefs.d.ts +17 -13
- package/lib/types/serialize.d.ts +19 -10
- package/lib/types/session.d.ts +3 -3
- package/lib/types/settings.d.ts +10 -7
- package/lib/types/storage.d.ts +2 -2
- package/package.json +37 -30
- package/lib/types/client/UsageIndicator.d.ts +0 -21
- package/lib/types/client/poll.d.ts +0 -19
- package/lib/types/credit-store.d.ts +0 -25
- package/lib/types/selection.d.ts +0 -35
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-llm-codebuddy-power",
|
|
3
|
-
"description": "
|
|
4
|
-
"version": "1.
|
|
3
|
+
"description": "A full-featured CodeBuddy (WorkBuddy) provider plugin.",
|
|
4
|
+
"version": "1.2.0",
|
|
5
|
+
"icon": "./icon.svg",
|
|
5
6
|
"license": "MIT",
|
|
6
7
|
"contributors": [
|
|
7
8
|
"pgnqukezrdxmhjso"
|
|
@@ -19,7 +20,8 @@
|
|
|
19
20
|
"dsh-plugin",
|
|
20
21
|
"cordis",
|
|
21
22
|
"llm",
|
|
22
|
-
"codebuddy"
|
|
23
|
+
"codebuddy",
|
|
24
|
+
"workbuddy"
|
|
23
25
|
],
|
|
24
26
|
"type": "module",
|
|
25
27
|
"main": "lib/index.js",
|
|
@@ -39,6 +41,7 @@
|
|
|
39
41
|
"./package.json": "./package.json"
|
|
40
42
|
},
|
|
41
43
|
"files": [
|
|
44
|
+
"icon.svg",
|
|
42
45
|
"cordis.patch.yml",
|
|
43
46
|
"lib/index.js",
|
|
44
47
|
"lib/client.js",
|
|
@@ -49,11 +52,11 @@
|
|
|
49
52
|
"LICENSE"
|
|
50
53
|
],
|
|
51
54
|
"peerDependencies": {
|
|
52
|
-
"@deepseek-ai/dsh-home-paths": "^0.1.
|
|
53
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
54
|
-
"@deepseek-ai/dsh-
|
|
55
|
-
"@deepseek-ai/dsh-
|
|
56
|
-
"@deepseek-ai/schemastery": "^3.18.
|
|
55
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.7-rc.2",
|
|
56
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
57
|
+
"@deepseek-ai/dsh-llm": "^0.1.7-rc.2",
|
|
58
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2",
|
|
59
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
57
60
|
},
|
|
58
61
|
"devDependencies": {
|
|
59
62
|
"@types/node": "^22.15.0",
|
|
@@ -62,28 +65,30 @@
|
|
|
62
65
|
"react": "^18.2.0",
|
|
63
66
|
"react-dom": "^18.2.0",
|
|
64
67
|
"typescript": "^6.0.3",
|
|
65
|
-
"@deepseek-ai/dsh-
|
|
66
|
-
"@deepseek-ai/dsh-
|
|
67
|
-
"@deepseek-ai/
|
|
68
|
-
"@deepseek-ai/dsh-
|
|
69
|
-
"@deepseek-ai/
|
|
70
|
-
"@deepseek-ai/dsh-
|
|
71
|
-
"@deepseek-ai/dsh-client-
|
|
72
|
-
"@deepseek-ai/dsh-client-
|
|
73
|
-
"@deepseek-ai/dsh-
|
|
74
|
-
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.
|
|
75
|
-
"@deepseek-ai/dsh-client-ui-
|
|
76
|
-
"@deepseek-ai/dsh-client-ui-
|
|
77
|
-
"@deepseek-ai/dsh-client-ui-
|
|
78
|
-
"@deepseek-ai/dsh-client-ui-
|
|
79
|
-
"@deepseek-ai/dsh-
|
|
80
|
-
"@deepseek-ai/dsh-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-
|
|
86
|
-
"@deepseek-ai/
|
|
68
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.7-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-agent": "^0.1.7-rc.2",
|
|
70
|
+
"@deepseek-ai/cordis": "^4.0.4",
|
|
71
|
+
"@deepseek-ai/dsh-attachment": "^0.1.7-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-client-connection": "^0.1.7-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-client-ui-chat": "^0.1.7-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-settings": "^0.1.7-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-rc.2",
|
|
81
|
+
"@deepseek-ai/dsh-client-ui-model-selection": "^0.1.7-rc.2",
|
|
82
|
+
"@deepseek-ai/dsh-client-ui-tool": "^0.1.7-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-fs": "^0.1.7-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-home-paths": "^0.1.7-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-host-webserver": "^0.1.7-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-llm": "^0.1.7-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager": "^0.1.7-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-session": "^0.1.7-rc.2",
|
|
89
|
+
"@deepseek-ai/dsh-settings": "^0.1.7-rc.2",
|
|
90
|
+
"@deepseek-ai/dsh-tools": "^0.1.7-rc.2",
|
|
91
|
+
"@deepseek-ai/schemastery": "^3.18.4"
|
|
87
92
|
},
|
|
88
93
|
"dependencies": {
|
|
89
94
|
"eventsource-parser": "^3.1.0"
|
|
@@ -99,6 +104,7 @@
|
|
|
99
104
|
"@deepseek-ai/dsh-client-connection",
|
|
100
105
|
"@deepseek-ai/dsh-client-locale",
|
|
101
106
|
"@deepseek-ai/dsh-client-ui-model-selection",
|
|
107
|
+
"@deepseek-ai/dsh-client-ui-plugin-manager",
|
|
102
108
|
"@deepseek-ai/dsh-client-ui-settings",
|
|
103
109
|
"@deepseek-ai/dsh-client-ui-renderer"
|
|
104
110
|
]
|
|
@@ -110,6 +116,7 @@
|
|
|
110
116
|
"verify": "node ../dsh-pgnqukezrdxmhjso-base/verify.mjs",
|
|
111
117
|
"pub": "pnpm run build && pnpm login --registry=https://registry.npmjs.org && pnpm publish --registry=https://registry.npmjs.org --no-git-checks",
|
|
112
118
|
"pack": "pnpm run build && pnpm pack --pack-destination lib",
|
|
119
|
+
"link-test-i": "pnpm run build && (pnpm dsh plugin --profile pkgtest remove %npm_package_name% & pnpm dsh plugin --profile pkgtest add link:./)",
|
|
113
120
|
"pack-test-i": "pnpm run pack && (pnpm dsh plugin --profile pkgtest remove %npm_package_name% & pnpm dsh plugin --profile pkgtest add ./lib/%npm_package_name%-%npm_package_version%.tgz)",
|
|
114
121
|
"npm-test-i": "pnpm dsh plugin --profile pkgtest remove %npm_package_name% & pnpm dsh plugin --profile pkgtest add --registry=https://registry.npmjs.org %npm_package_name%@%npm_package_version%",
|
|
115
122
|
"test-create": "pnpm dsh --profile pkgtest --from-default-profile web",
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 渲染在侧边栏底部 Settings 触发项上方的用量指示器。
|
|
3
|
-
*
|
|
4
|
-
* 宽列在赠送剩余额度的纯文本行上方显示主池的进度条(可续期额度 —— 自定义配额
|
|
5
|
-
* 上限与危险阈值仅作用于该进度条);赠送行的 tooltip 列出五个最早过期的有效赠送
|
|
6
|
-
* 窗口及其剩余/总量数值。未登录的账号、计量服务故障或空池都不渲染任何内容 ——
|
|
7
|
-
* 该提示纯属附加。窄栏列为主池保留单个圆环,其下是赠送剩余的裸数值。
|
|
8
|
-
*/
|
|
9
|
-
import type { ReactElement } from 'react';
|
|
10
|
-
import type { PropsLocale, PropsRuntime, PropsStore } from '@deepseek-ai/dsh-client-ui-slots';
|
|
11
|
-
import { createCodeBuddyStore } from './store.ts';
|
|
12
|
-
import type { CodeBuddySectionInjected } from './CodeBuddySection.tsx';
|
|
13
|
-
/** 完整组件 props:footer-action 运行时份额 + store + locale + 注入 face。 */
|
|
14
|
-
export type CodeBuddyUsageIndicatorProps = PropsRuntime<'sidebar.footer.action'> & PropsStore<ReturnType<typeof createCodeBuddyStore>> & PropsLocale<'settings.codebuddy'> & CodeBuddySectionInjected;
|
|
15
|
-
/**
|
|
16
|
-
* 两条用量进度条(宽列)或主池圆环(窄栏),仅在存在可用池时渲染。
|
|
17
|
-
* @param props - 组合后的 slot props。
|
|
18
|
-
* @returns 指示器元素;无内容显示时为 null。
|
|
19
|
-
*/
|
|
20
|
-
export declare function UsageIndicator(props: CodeBuddyUsageIndicatorProps): ReactElement | null;
|
|
21
|
-
//# sourceMappingURL=UsageIndicator.d.ts.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 参数化的轮询钩子:入参说明「查什么数据」「多久查一次」「这里是否需要它」。
|
|
3
|
-
*
|
|
4
|
-
* 抽成共享钩子而不是各组件自建定时器,是为了让计时器的建立与清理只写一次;节奏仍由
|
|
5
|
-
* 每个消费方按自己那份数据的更新速度给出 —— 两份数据的更新速度不同,不该被迫取同一个值。
|
|
6
|
-
*
|
|
7
|
-
* @module dsh-llm-codebuddy-power/client/poll
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* 启用时立即读取一次数据源,其后每 `intervalMs` 重复;停用时不读取也不计时。
|
|
11
|
-
*
|
|
12
|
-
* `read` 经 ref 持有,因此调用方可以传内联闭包:轮询节奏只由 `intervalMs` 与
|
|
13
|
-
* `active` 决定,不会因为闭包每次渲染都是新身份而反复重建计时器。
|
|
14
|
-
* @param read - 每次轮询要读取的数据。
|
|
15
|
-
* @param intervalMs - 两次读取之间的间隔,单位 ms;由该数据自身的更新速度决定。
|
|
16
|
-
* @param active - 这里是否需要这份数据;为假时不读取也不轮询,由假转真会立即读取一次。
|
|
17
|
-
*/
|
|
18
|
-
export declare function usePolledRead(read: () => void, intervalMs: number, active: boolean): void;
|
|
19
|
-
//# sourceMappingURL=poll.d.ts.map
|
|
@@ -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
|
package/lib/types/selection.d.ts
DELETED
|
@@ -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
|