dsh-taskflow 0.1.0 → 0.1.1
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/CHANGELOG.md +35 -26
- package/LICENSE +201 -201
- package/NOTICE +1 -1
- package/README.md +139 -169
- package/README_en.md +139 -0
- package/docs/DETAIL.md +1 -1
- package/docs/DETAIL.zh-CN.md +1 -1
- package/locale/en.json +3 -3
- package/locale/zh.json +3 -3
- package/package.json +134 -133
- package/src/server/index.mjs +38 -38
package/package.json
CHANGED
|
@@ -1,133 +1,134 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "dsh-taskflow",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "智能任务编排:持久层级计划、按需递归子会话与完成通知",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "index.js",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": "./index.js",
|
|
9
|
-
"./client": "./client.js",
|
|
10
|
-
"./package.json": "./package.json",
|
|
11
|
-
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
-
"./icon": "./assets/icon.svg",
|
|
13
|
-
"./locale/*.json": "./locale/*.json"
|
|
14
|
-
},
|
|
15
|
-
"files": [
|
|
16
|
-
"index.js",
|
|
17
|
-
"client.js",
|
|
18
|
-
"src/domain/*.mjs",
|
|
19
|
-
"src/application/*.mjs",
|
|
20
|
-
"src/storage/*.mjs",
|
|
21
|
-
"src/server/*.mjs",
|
|
22
|
-
"assets/icon.svg",
|
|
23
|
-
"assets/icon.png",
|
|
24
|
-
"locale/*.json",
|
|
25
|
-
"cordis.patch.yml",
|
|
26
|
-
"README.md",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"docs/DETAIL.
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"build
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"check
|
|
40
|
-
"check:
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
"
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
"@deepseek-ai/dsh-client-ui-
|
|
58
|
-
"@deepseek-ai/dsh-client-ui-
|
|
59
|
-
"@deepseek-ai/dsh-client-ui-
|
|
60
|
-
"@deepseek-ai/dsh-client-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"@deepseek-ai/
|
|
67
|
-
"@deepseek-ai/dsh-
|
|
68
|
-
"@deepseek-ai/
|
|
69
|
-
"
|
|
70
|
-
"react
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"@deepseek-ai/
|
|
75
|
-
"@deepseek-ai/dsh-agent
|
|
76
|
-
"@deepseek-ai/dsh-agent-loop
|
|
77
|
-
"@deepseek-ai/dsh-
|
|
78
|
-
"@deepseek-ai/dsh-client-
|
|
79
|
-
"@deepseek-ai/dsh-client-ui-
|
|
80
|
-
"@deepseek-ai/dsh-client-ui-
|
|
81
|
-
"@deepseek-ai/dsh-
|
|
82
|
-
"@deepseek-ai/dsh-
|
|
83
|
-
"@deepseek-ai/dsh-session
|
|
84
|
-
"@deepseek-ai/dsh-
|
|
85
|
-
"@deepseek-ai/dsh-subagent
|
|
86
|
-
"@deepseek-ai/dsh-
|
|
87
|
-
"@deepseek-ai/dsh-
|
|
88
|
-
"@deepseek-ai/
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"react
|
|
93
|
-
"
|
|
94
|
-
"
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
"
|
|
98
|
-
"
|
|
99
|
-
|
|
100
|
-
"
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
"
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
"
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
"
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
"
|
|
118
|
-
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "dsh-taskflow",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "智能任务编排:持久层级计划、按需递归子会话与完成通知",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./index.js",
|
|
9
|
+
"./client": "./client.js",
|
|
10
|
+
"./package.json": "./package.json",
|
|
11
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
12
|
+
"./icon": "./assets/icon.svg",
|
|
13
|
+
"./locale/*.json": "./locale/*.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"index.js",
|
|
17
|
+
"client.js",
|
|
18
|
+
"src/domain/*.mjs",
|
|
19
|
+
"src/application/*.mjs",
|
|
20
|
+
"src/storage/*.mjs",
|
|
21
|
+
"src/server/*.mjs",
|
|
22
|
+
"assets/icon.svg",
|
|
23
|
+
"assets/icon.png",
|
|
24
|
+
"locale/*.json",
|
|
25
|
+
"cordis.patch.yml",
|
|
26
|
+
"README.md",
|
|
27
|
+
"README_en.md",
|
|
28
|
+
"CHANGELOG.md",
|
|
29
|
+
"NOTICE",
|
|
30
|
+
"LICENSE",
|
|
31
|
+
"licenses/*.txt",
|
|
32
|
+
"docs/DETAIL.md",
|
|
33
|
+
"docs/DETAIL.zh-CN.md"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "node scripts/build.mjs",
|
|
37
|
+
"build:check": "node scripts/build.mjs --check",
|
|
38
|
+
"test": "node --test test/*.test.mjs",
|
|
39
|
+
"check": "npm run build:check && npm test && npm run check:release",
|
|
40
|
+
"check:release": "node scripts/check-release.mjs",
|
|
41
|
+
"check:package": "node scripts/check-package.mjs",
|
|
42
|
+
"prepack": "npm run build && npm test && npm run check:release",
|
|
43
|
+
"dev": "node scripts/dev.mjs",
|
|
44
|
+
"check:hosts": "node scripts/check-hosts.mjs"
|
|
45
|
+
},
|
|
46
|
+
"engines": {
|
|
47
|
+
"node": ">=24.9.0",
|
|
48
|
+
"dsh": ">=0.2.1-rc.3 <1.0.0-0 || >=0.2.2-0 <1.0.0-0 || >=0.2.3-0 <1.0.0-0 || >=0.3.0-0 <1.0.0-0"
|
|
49
|
+
},
|
|
50
|
+
"dsh": {
|
|
51
|
+
"bundle": {
|
|
52
|
+
"patch": "./cordis.patch.yml"
|
|
53
|
+
},
|
|
54
|
+
"client": {
|
|
55
|
+
"platform": "web",
|
|
56
|
+
"inject": [
|
|
57
|
+
"@deepseek-ai/dsh-client-ui-conversation",
|
|
58
|
+
"@deepseek-ai/dsh-client-ui-workspace",
|
|
59
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right",
|
|
60
|
+
"@deepseek-ai/dsh-client-ui-layout",
|
|
61
|
+
"@deepseek-ai/dsh-client-connection"
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@deepseek-ai/cordis": "~4.0.5 || ~4.1.0",
|
|
67
|
+
"@deepseek-ai/dsh-llm": ">=0.2.1-rc.3 <1.0.0-0 || >=0.2.2-0 <1.0.0-0 || >=0.2.3-0 <1.0.0-0 || >=0.3.0-0 <1.0.0-0",
|
|
68
|
+
"@deepseek-ai/dsh-tools": ">=0.2.1-rc.3 <1.0.0-0 || >=0.2.2-0 <1.0.0-0 || >=0.2.3-0 <1.0.0-0 || >=0.3.0-0 <1.0.0-0",
|
|
69
|
+
"@deepseek-ai/schemastery": "~3.18.5 || ~3.19.0",
|
|
70
|
+
"react": "^18.3.1",
|
|
71
|
+
"react-dom": "^18.3.1"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@deepseek-ai/cordis": "4.1.0",
|
|
75
|
+
"@deepseek-ai/dsh-agent": "0.2.2-rc.2",
|
|
76
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.2-rc.2",
|
|
77
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-rc.2",
|
|
78
|
+
"@deepseek-ai/dsh-client-connection": "0.2.2-rc.2",
|
|
79
|
+
"@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.2",
|
|
80
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.2",
|
|
81
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.2",
|
|
82
|
+
"@deepseek-ai/dsh-llm": "0.2.2-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-session": "0.2.2-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.2.2-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-subagent": "0.2.2-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-subagent-spawn-in-process": "0.2.2-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-tools": "0.2.2-rc.2",
|
|
89
|
+
"@deepseek-ai/schemastery": "3.19.0",
|
|
90
|
+
"esbuild": "0.25.12",
|
|
91
|
+
"jsdom": "26.1.0",
|
|
92
|
+
"react": "18.3.1",
|
|
93
|
+
"react-dom": "18.3.1",
|
|
94
|
+
"yaml": "2.8.1",
|
|
95
|
+
"semver": "7.7.3"
|
|
96
|
+
},
|
|
97
|
+
"license": "(Apache-2.0 AND MIT)",
|
|
98
|
+
"author": "Oak-liuhj",
|
|
99
|
+
"repository": {
|
|
100
|
+
"type": "git",
|
|
101
|
+
"url": "git+https://github.com/Oak-liuhj/dsh-taskflow.git"
|
|
102
|
+
},
|
|
103
|
+
"keywords": [
|
|
104
|
+
"dsh-plugin",
|
|
105
|
+
"deepseek-harness",
|
|
106
|
+
"dsh",
|
|
107
|
+
"taskflow",
|
|
108
|
+
"task-tree",
|
|
109
|
+
"workflow",
|
|
110
|
+
"orchestration",
|
|
111
|
+
"subagents"
|
|
112
|
+
],
|
|
113
|
+
"homepage": "https://github.com/Oak-liuhj/dsh-taskflow#readme",
|
|
114
|
+
"bugs": {
|
|
115
|
+
"url": "https://github.com/Oak-liuhj/dsh-taskflow/issues"
|
|
116
|
+
},
|
|
117
|
+
"icon": "assets/icon.png",
|
|
118
|
+
"publishConfig": {
|
|
119
|
+
"access": "public",
|
|
120
|
+
"registry": "https://registry.npmjs.org/",
|
|
121
|
+
"tag": "latest"
|
|
122
|
+
},
|
|
123
|
+
"peerDependenciesMeta": {
|
|
124
|
+
"@deepseek-ai/cordis": {
|
|
125
|
+
"optional": true
|
|
126
|
+
},
|
|
127
|
+
"react": {
|
|
128
|
+
"optional": true
|
|
129
|
+
},
|
|
130
|
+
"react-dom": {
|
|
131
|
+
"optional": true
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
package/src/server/index.mjs
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { join } from 'node:path';
|
|
2
|
-
import { homedir } from 'node:os';
|
|
3
|
-
import { FileStore } from '../storage/task-store.mjs';
|
|
4
|
-
import { TaskService } from '../domain/task-service.mjs';
|
|
5
|
-
import { TaskRuntime } from '../application/task-runtime.mjs';
|
|
6
|
-
import { createNoticeSender } from './notifications.mjs';
|
|
7
|
-
import { registerTools } from './tools.mjs';
|
|
8
|
-
import { registerSessionContext } from './session-context.mjs';
|
|
9
|
-
import { registerToolViews } from './tool-views.mjs';
|
|
10
|
-
import { registerRpc } from './rpc.mjs';
|
|
11
|
-
export { Config } from './config.mjs';
|
|
12
|
-
export const name = 'taskflow';
|
|
13
|
-
export const inject = ['tools', 'agents', 'sessions', 'systemPrompt', 'subagents'];
|
|
14
|
-
|
|
15
|
-
// 生命周期装配入口;状态、调度与宿主 API 适配各自独立。
|
|
16
|
-
export async function apply(ctx, config = {}) {
|
|
17
|
-
const dataDir = config.dataDir || join(process.env.DSH_HOME || join(homedir(), '.dsh'), 'taskflow');
|
|
18
|
-
const store = await new FileStore(dataDir).init();
|
|
19
|
-
let runtime, timer;
|
|
20
|
-
ctx.effect(() => async () => { clearInterval(timer); await runtime?.dispose(); await store.close(); });
|
|
21
|
-
const service = new TaskService(store, config); await service.recover();
|
|
22
|
-
const log = error => ctx.logger?.warn?.(`taskflow: ${error.message ?? error}`);
|
|
23
|
-
runtime = new TaskRuntime(service, {
|
|
24
|
-
agent: sid => ctx.agents.get(sid), log,
|
|
25
|
-
// DSH 0.2.1-rc.3 accepts a nested request; 0.2.2-rc.2+ uses top-level fields.
|
|
26
|
-
// Supply both shapes in one call so neither host needs a retry or a second activation.
|
|
27
|
-
start: request => ctx.subagents.startActivation({ provider: config.provider || 'spawn', ...request, request, delivery: 'caller' }),
|
|
28
|
-
notify: createNoticeSender(ctx),
|
|
29
|
-
});
|
|
30
|
-
ctx.provide('taskflow', { service, runtime });
|
|
31
|
-
registerTools(ctx, service, runtime);
|
|
32
|
-
registerSessionContext(ctx, service, config);
|
|
33
|
-
registerToolViews(ctx, service, log);
|
|
34
|
-
registerRpc(ctx, service);
|
|
35
|
-
ctx.on('agent/created', () => { runtime.kick(); return undefined; }, { global: true });
|
|
36
|
-
timer = setInterval(() => runtime.kick(), 3000); timer.unref?.();
|
|
37
|
-
runtime.kick();
|
|
38
|
-
}
|
|
1
|
+
import { join } from 'node:path';
|
|
2
|
+
import { homedir } from 'node:os';
|
|
3
|
+
import { FileStore } from '../storage/task-store.mjs';
|
|
4
|
+
import { TaskService } from '../domain/task-service.mjs';
|
|
5
|
+
import { TaskRuntime } from '../application/task-runtime.mjs';
|
|
6
|
+
import { createNoticeSender } from './notifications.mjs';
|
|
7
|
+
import { registerTools } from './tools.mjs';
|
|
8
|
+
import { registerSessionContext } from './session-context.mjs';
|
|
9
|
+
import { registerToolViews } from './tool-views.mjs';
|
|
10
|
+
import { registerRpc } from './rpc.mjs';
|
|
11
|
+
export { Config } from './config.mjs';
|
|
12
|
+
export const name = 'taskflow';
|
|
13
|
+
export const inject = ['tools', 'agents', 'sessions', 'systemPrompt', 'subagents'];
|
|
14
|
+
|
|
15
|
+
// 生命周期装配入口;状态、调度与宿主 API 适配各自独立。
|
|
16
|
+
export async function apply(ctx, config = {}) {
|
|
17
|
+
const dataDir = config.dataDir || join(process.env.DSH_HOME || join(homedir(), '.dsh'), 'taskflow');
|
|
18
|
+
const store = await new FileStore(dataDir).init();
|
|
19
|
+
let runtime, timer;
|
|
20
|
+
ctx.effect(() => async () => { clearInterval(timer); await runtime?.dispose(); await store.close(); });
|
|
21
|
+
const service = new TaskService(store, config); await service.recover();
|
|
22
|
+
const log = error => ctx.logger?.warn?.(`taskflow: ${error.message ?? error}`);
|
|
23
|
+
runtime = new TaskRuntime(service, {
|
|
24
|
+
agent: sid => ctx.agents.get(sid), log,
|
|
25
|
+
// DSH 0.2.1-rc.3 accepts a nested request; 0.2.2-rc.2+ uses top-level fields.
|
|
26
|
+
// Supply both shapes in one call so neither host needs a retry or a second activation.
|
|
27
|
+
start: request => ctx.subagents.startActivation({ provider: config.provider || 'spawn', ...request, request, delivery: 'caller' }),
|
|
28
|
+
notify: createNoticeSender(ctx),
|
|
29
|
+
});
|
|
30
|
+
ctx.provide('taskflow', { service, runtime });
|
|
31
|
+
registerTools(ctx, service, runtime);
|
|
32
|
+
registerSessionContext(ctx, service, config);
|
|
33
|
+
registerToolViews(ctx, service, log);
|
|
34
|
+
registerRpc(ctx, service);
|
|
35
|
+
ctx.on('agent/created', () => { runtime.kick(); return undefined; }, { global: true });
|
|
36
|
+
timer = setInterval(() => runtime.kick(), 3000); timer.unref?.();
|
|
37
|
+
runtime.kick();
|
|
38
|
+
}
|