dskcode 0.1.33 → 0.1.35
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.js +103 -18
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2098,6 +2098,79 @@ function TodoListPanel({ items }) {
|
|
|
2098
2098
|
] });
|
|
2099
2099
|
}
|
|
2100
2100
|
|
|
2101
|
+
// package.json
|
|
2102
|
+
var package_default = {
|
|
2103
|
+
name: "dskcode",
|
|
2104
|
+
version: "0.1.35",
|
|
2105
|
+
repository: {
|
|
2106
|
+
type: "git",
|
|
2107
|
+
url: "git+https://github.com/Awu12277/deepseek-agent-cli/tree/main"
|
|
2108
|
+
},
|
|
2109
|
+
keywords: [
|
|
2110
|
+
"cli",
|
|
2111
|
+
"ink",
|
|
2112
|
+
"commander",
|
|
2113
|
+
"deepseek",
|
|
2114
|
+
"asciichart"
|
|
2115
|
+
],
|
|
2116
|
+
description: "A DeepSeek-native AI coding agent for your terminal",
|
|
2117
|
+
type: "module",
|
|
2118
|
+
bin: {
|
|
2119
|
+
dskcode: "dist/index.js"
|
|
2120
|
+
},
|
|
2121
|
+
exports: {
|
|
2122
|
+
".": {
|
|
2123
|
+
import: "./dist/index.js",
|
|
2124
|
+
types: "./dist/index.d.ts"
|
|
2125
|
+
}
|
|
2126
|
+
},
|
|
2127
|
+
files: [
|
|
2128
|
+
"dist",
|
|
2129
|
+
"README.md",
|
|
2130
|
+
"LICENSE"
|
|
2131
|
+
],
|
|
2132
|
+
scripts: {
|
|
2133
|
+
dev: "tsup --watch",
|
|
2134
|
+
build: "tsup",
|
|
2135
|
+
"type-check": "tsc --noEmit",
|
|
2136
|
+
lint: "oxlint src/ tests/",
|
|
2137
|
+
"lint:fix": "oxlint --fix src/ tests/",
|
|
2138
|
+
format: "prettier --write src/ tests/",
|
|
2139
|
+
"format:check": "prettier --check src/ tests/",
|
|
2140
|
+
test: "vitest run",
|
|
2141
|
+
"test:watch": "vitest",
|
|
2142
|
+
"test:coverage": "vitest run --coverage",
|
|
2143
|
+
prepublishOnly: "npm run build && npm run test"
|
|
2144
|
+
},
|
|
2145
|
+
dependencies: {
|
|
2146
|
+
asciichart: "^1.5.25",
|
|
2147
|
+
chalk: "^5.6.2",
|
|
2148
|
+
commander: "^13.1.0",
|
|
2149
|
+
handlebars: "^4.7.9",
|
|
2150
|
+
ink: "^7.1.0",
|
|
2151
|
+
"ink-spinner": "^5.0.0",
|
|
2152
|
+
"ink-text-input": "^6.0.0",
|
|
2153
|
+
react: "^19.2.7"
|
|
2154
|
+
},
|
|
2155
|
+
devDependencies: {
|
|
2156
|
+
"@types/node": "^22.14.0",
|
|
2157
|
+
"@types/react": "^19.2.17",
|
|
2158
|
+
oxlint: "^1.71.0",
|
|
2159
|
+
"oxlint-tsgolint": "^0.23.0",
|
|
2160
|
+
prettier: "^3.5.3",
|
|
2161
|
+
tsup: "^8.4.0",
|
|
2162
|
+
typescript: "^5.8.3",
|
|
2163
|
+
vitest: "^3.1.1"
|
|
2164
|
+
},
|
|
2165
|
+
engines: {
|
|
2166
|
+
node: ">=22.0.0"
|
|
2167
|
+
},
|
|
2168
|
+
license: "MIT"
|
|
2169
|
+
};
|
|
2170
|
+
|
|
2171
|
+
// src/utils/version.ts
|
|
2172
|
+
var VERSION = package_default.version;
|
|
2173
|
+
|
|
2101
2174
|
// src/provider/registry.ts
|
|
2102
2175
|
var ProviderRegistry = class {
|
|
2103
2176
|
#factories = /* @__PURE__ */ new Map();
|
|
@@ -2952,9 +3025,9 @@ var TodoList = class {
|
|
|
2952
3025
|
(it) => it.status === "done" || it.status === "failed" || it.status === "skipped"
|
|
2953
3026
|
);
|
|
2954
3027
|
}
|
|
2955
|
-
/**
|
|
3028
|
+
/** 全部条目(只读快照 — 每次返回新数组,避免上游拿到内部引用后被原地修改) */
|
|
2956
3029
|
get items() {
|
|
2957
|
-
return this.#items;
|
|
3030
|
+
return this.#items.map((it) => ({ ...it }));
|
|
2958
3031
|
}
|
|
2959
3032
|
/**
|
|
2960
3033
|
* 把 todo 列表拼成 markdown,用于注入 system prompt。
|
|
@@ -3954,7 +4027,7 @@ var Session = class _Session {
|
|
|
3954
4027
|
};
|
|
3955
4028
|
});
|
|
3956
4029
|
for (const item of results.items) {
|
|
3957
|
-
const todoSnapshot = item.name.startsWith("todo_") && this.#todoList ? this.#todoList.items : void 0;
|
|
4030
|
+
const todoSnapshot = item.name.startsWith("todo_") && this.#todoList ? this.#todoList.items.map((it) => ({ ...it })) : void 0;
|
|
3958
4031
|
yield {
|
|
3959
4032
|
type: "tool_result",
|
|
3960
4033
|
name: item.name,
|
|
@@ -5918,7 +5991,7 @@ registerCommand("/help", {
|
|
|
5918
5991
|
registerCommand("/clear", { desc: "\u6E05\u7A7A\u5BF9\u8BDD\u5386\u53F2", handler: () => ({ kind: "clear" }) });
|
|
5919
5992
|
registerCommand("/version", {
|
|
5920
5993
|
desc: "\u663E\u793A\u7248\u672C\u4FE1\u606F",
|
|
5921
|
-
handler: () => ({ kind: "text", content:
|
|
5994
|
+
handler: () => ({ kind: "text", content: `dskcode v${VERSION}` })
|
|
5922
5995
|
});
|
|
5923
5996
|
registerCommand("/model", {
|
|
5924
5997
|
desc: "\u5207\u6362\u6A21\u578B",
|
|
@@ -6087,7 +6160,14 @@ function ChatSession({
|
|
|
6087
6160
|
const hasUnfinished = todoSnapshot.some(
|
|
6088
6161
|
(it) => it.status === "pending" || it.status === "running" || it.status === "failed"
|
|
6089
6162
|
);
|
|
6090
|
-
|
|
6163
|
+
if (hasUnfinished) {
|
|
6164
|
+
setTodoPanelVisible(true);
|
|
6165
|
+
} else {
|
|
6166
|
+
todoHideTimerRef.current = setTimeout(() => {
|
|
6167
|
+
setTodoPanelVisible(false);
|
|
6168
|
+
todoHideTimerRef.current = null;
|
|
6169
|
+
}, 2e3);
|
|
6170
|
+
}
|
|
6091
6171
|
}, [todoSnapshot]);
|
|
6092
6172
|
const getFilteredSkills = useCallback2(
|
|
6093
6173
|
(value) => {
|
|
@@ -6739,6 +6819,12 @@ function ChatSession({
|
|
|
6739
6819
|
clearTimeout(rewindHintTimerRef.current);
|
|
6740
6820
|
rewindHintTimerRef.current = null;
|
|
6741
6821
|
}
|
|
6822
|
+
setTodoSnapshot([]);
|
|
6823
|
+
if (todoHideTimerRef.current) {
|
|
6824
|
+
clearTimeout(todoHideTimerRef.current);
|
|
6825
|
+
todoHideTimerRef.current = null;
|
|
6826
|
+
}
|
|
6827
|
+
setTodoPanelVisible(false);
|
|
6742
6828
|
const session = sessionRef.current;
|
|
6743
6829
|
const abortController = new AbortController();
|
|
6744
6830
|
abortRef.current = abortController;
|
|
@@ -6796,14 +6882,7 @@ function ChatSession({
|
|
|
6796
6882
|
currentToolCallsRef.current = [];
|
|
6797
6883
|
const r = event.result;
|
|
6798
6884
|
if (event.name.startsWith("todo_") && event.todoSnapshot) {
|
|
6799
|
-
|
|
6800
|
-
(it) => it.status === "done" || it.status === "failed" || it.status === "skipped"
|
|
6801
|
-
);
|
|
6802
|
-
if (allTerminated) {
|
|
6803
|
-
setTodoSnapshot([]);
|
|
6804
|
-
} else {
|
|
6805
|
-
setTodoSnapshot(event.todoSnapshot);
|
|
6806
|
-
}
|
|
6885
|
+
setTodoSnapshot([...event.todoSnapshot]);
|
|
6807
6886
|
} else {
|
|
6808
6887
|
const line = r.success ? r.summary ?? `\u2705 ${event.name}: ${r.data.slice(0, 500)}${r.data.length > 500 ? "..." : ""}` : `\u274C ${event.name}: ${r.error ?? "\u6267\u884C\u5931\u8D25"}`;
|
|
6809
6888
|
setDisplayMessages((prev) => [
|
|
@@ -6908,10 +6987,16 @@ function ChatSession({
|
|
|
6908
6987
|
}, [isStreaming, externalCostTracker]);
|
|
6909
6988
|
return /* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", paddingLeft: 1, paddingRight: 1, children: [
|
|
6910
6989
|
!hasConversationStarted && /* @__PURE__ */ jsxs10(Box10, { flexDirection: "row", marginBottom: 1, children: [
|
|
6911
|
-
/* @__PURE__ */
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6990
|
+
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", marginRight: 4, children: [
|
|
6991
|
+
LOGO_LINES.map((line, i) => {
|
|
6992
|
+
const colorIndex = (i + offset) % CYBER_PALETTE.length;
|
|
6993
|
+
return /* @__PURE__ */ jsx10(Box10, { children: /* @__PURE__ */ jsx10(Text11, { bold: true, color: CYBER_PALETTE[colorIndex], children: line }) }, i);
|
|
6994
|
+
}),
|
|
6995
|
+
/* @__PURE__ */ jsx10(Box10, { marginTop: 1, children: /* @__PURE__ */ jsxs10(Text11, { color: "#808080", children: [
|
|
6996
|
+
" \u{1F4E6} v",
|
|
6997
|
+
VERSION
|
|
6998
|
+
] }) })
|
|
6999
|
+
] }),
|
|
6915
7000
|
/* @__PURE__ */ jsxs10(Box10, { flexDirection: "column", justifyContent: "center", children: [
|
|
6916
7001
|
/* @__PURE__ */ jsxs10(Text11, { color: "#00ff41", children: [
|
|
6917
7002
|
" \u2714 ",
|
|
@@ -8790,7 +8875,7 @@ var SUBCOMMANDS = ["chat", "run", "setup", "init", "completion", "game", "stock"
|
|
|
8790
8875
|
function createCli() {
|
|
8791
8876
|
const program2 = new Command();
|
|
8792
8877
|
program2.exitOverride();
|
|
8793
|
-
program2.name("dskcode").description("\u57FA\u4E8E DeepSeek \u7684 AI \u7F16\u7A0B\u52A9\u624B\u7EC8\u7AEF\u5DE5\u5177").version(
|
|
8878
|
+
program2.name("dskcode").description("\u57FA\u4E8E DeepSeek \u7684 AI \u7F16\u7A0B\u52A9\u624B\u7EC8\u7AEF\u5DE5\u5177").version(VERSION, "-V, --version", "\u663E\u793A\u7248\u672C\u53F7").option("--verbose", "\u5F00\u542F\u8BE6\u7EC6\u65E5\u5FD7\u8F93\u51FA").option("--config <path>", "\u6307\u5B9A\u914D\u7F6E\u6587\u4EF6\u8DEF\u5F84");
|
|
8794
8879
|
program2.helpInformation = () => customHelp(program2);
|
|
8795
8880
|
program2.hook("preAction", async (thisCommand, actionCommand) => {
|
|
8796
8881
|
const ctx = await loadConfigMiddleware.call(thisCommand);
|