@michengai/dsh-automation 0.1.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 +201 -0
- package/NOTICE +9 -0
- package/README.md +136 -0
- package/README.zh-CN.md +136 -0
- package/cordis.patch.yml +9 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/00-/351/230/205/350/257/273/345/257/274/350/210/252.md +11 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/01-/351/241/271/347/233/256/346/246/202/350/247/210.md +22 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/02-/345/275/223/345/211/215/347/212/266/346/200/201.md +9 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/03-/345/276/205/345/212/236/344/270/216/351/230/273/345/241/236.md +7 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/04-/350/277/255/344/273/243/350/267/257/347/272/277/345/233/276.md +5 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/05-/346/212/200/346/234/257/346/236/266/346/236/204/345/237/272/347/272/277.md +10 -0
- package/docs/00-/344/272/244/346/216/245/345/205/245/345/217/243/06-/346/226/207/346/241/243/347/274/226/345/206/231/350/247/204/350/214/203.md +8 -0
- package/docs/01-/345/275/223/345/211/215/345/267/245/344/275/234/I001-/344/273/273/345/212/241/350/207/252/345/212/250/345/214/226/346/217/222/344/273/266/00-/350/277/255/344/273/243/346/200/273/350/247/210.md +47 -0
- package/docs/03-/346/212/200/346/234/257/346/236/266/346/236/204/00-/351/242/206/345/237/237/347/264/242/345/274/225.md +5 -0
- package/docs/03-/346/212/200/346/234/257/346/236/266/346/236/204/01-/350/260/203/345/272/246/344/270/216/346/211/247/350/241/214/346/250/241/345/236/213.md +30 -0
- package/lib/client.js +2792 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +22869 -0
- package/lib/types/client/AutomationView.d.ts +2 -0
- package/lib/types/client/ScheduleRail.d.ts +34 -0
- package/lib/types/client/contracts.d.ts +57 -0
- package/lib/types/client/create-modal.d.ts +30 -0
- package/lib/types/client/helpers.d.ts +67 -0
- package/lib/types/client/icons.d.ts +28 -0
- package/lib/types/client/index.d.ts +4 -0
- package/lib/types/client/locales.d.ts +187 -0
- package/lib/types/client/menu.d.ts +53 -0
- package/lib/types/client/native-session-list.d.ts +14 -0
- package/lib/types/client/native-tabs.d.ts +23 -0
- package/lib/types/client/prefill.d.ts +6 -0
- package/lib/types/client/protocol.d.ts +153 -0
- package/lib/types/client/runtime.d.ts +29 -0
- package/lib/types/client/schedule-rail-model.d.ts +87 -0
- package/lib/types/client/styles.d.ts +1 -0
- package/lib/types/domain.d.ts +67 -0
- package/lib/types/executor.d.ts +30 -0
- package/lib/types/index.d.ts +20 -0
- package/lib/types/recurrence.d.ts +7 -0
- package/lib/types/rpc.d.ts +13 -0
- package/lib/types/run-title.d.ts +3 -0
- package/lib/types/service.d.ts +110 -0
- package/lib/types/tools.d.ts +12 -0
- package/lib/types/types.d.ts +146 -0
- package/package.json +99 -0
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
export type AutomationStatus = 'active' | 'paused';
|
|
2
|
+
export type AutomationRunStatus = 'queued' | 'running' | 'succeeded' | 'failed' | 'skipped' | 'cancelled';
|
|
3
|
+
export type Weekday = 'MO' | 'TU' | 'WE' | 'TH' | 'FR' | 'SA' | 'SU';
|
|
4
|
+
export type PermissionPreset = 'read-only' | 'workspace-write' | 'full-access';
|
|
5
|
+
export interface OnceSchedule {
|
|
6
|
+
readonly kind: 'once';
|
|
7
|
+
readonly at: string;
|
|
8
|
+
readonly timeZone: string;
|
|
9
|
+
}
|
|
10
|
+
export interface IntervalSchedule {
|
|
11
|
+
readonly kind: 'interval';
|
|
12
|
+
readonly everyMinutes: number;
|
|
13
|
+
readonly anchor: string;
|
|
14
|
+
readonly timeZone: string;
|
|
15
|
+
}
|
|
16
|
+
export interface DailySchedule {
|
|
17
|
+
readonly kind: 'daily';
|
|
18
|
+
readonly time: string;
|
|
19
|
+
readonly timeZone: string;
|
|
20
|
+
}
|
|
21
|
+
export interface WeeklySchedule {
|
|
22
|
+
readonly kind: 'weekly';
|
|
23
|
+
readonly weekdays: readonly Weekday[];
|
|
24
|
+
readonly time: string;
|
|
25
|
+
readonly timeZone: string;
|
|
26
|
+
}
|
|
27
|
+
export interface HourlySchedule {
|
|
28
|
+
readonly kind: 'hourly';
|
|
29
|
+
readonly minute: number;
|
|
30
|
+
readonly timeZone: string;
|
|
31
|
+
}
|
|
32
|
+
export interface MonthlySchedule {
|
|
33
|
+
readonly kind: 'monthly';
|
|
34
|
+
readonly day: number;
|
|
35
|
+
readonly time: string;
|
|
36
|
+
readonly timeZone: string;
|
|
37
|
+
}
|
|
38
|
+
export interface CustomSchedule {
|
|
39
|
+
readonly kind: 'custom';
|
|
40
|
+
readonly everyDays: number;
|
|
41
|
+
readonly time: string;
|
|
42
|
+
readonly timeZone: string;
|
|
43
|
+
}
|
|
44
|
+
export type AutomationSchedule = OnceSchedule | IntervalSchedule | DailySchedule | WeeklySchedule | HourlySchedule | MonthlySchedule | CustomSchedule;
|
|
45
|
+
export interface AutomationCreator {
|
|
46
|
+
readonly kind: 'agent' | 'web';
|
|
47
|
+
readonly sessionId: string;
|
|
48
|
+
}
|
|
49
|
+
/** 一次无人值守运行的首条消息来源,不能伪装成人类输入。 */
|
|
50
|
+
export interface AutomationMessageSource {
|
|
51
|
+
readonly kind: 'automation';
|
|
52
|
+
readonly automationId: string;
|
|
53
|
+
readonly runId: string;
|
|
54
|
+
readonly scheduledFor: string;
|
|
55
|
+
}
|
|
56
|
+
declare module '@deepseek-ai/dsh-llm' {
|
|
57
|
+
interface MessageSourceMap {
|
|
58
|
+
automation: AutomationMessageSource;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
export interface AutomationDefinition {
|
|
62
|
+
readonly version: 1;
|
|
63
|
+
readonly id: string;
|
|
64
|
+
readonly revision: number;
|
|
65
|
+
readonly name: string;
|
|
66
|
+
readonly prompt: string;
|
|
67
|
+
readonly status: AutomationStatus;
|
|
68
|
+
readonly schedule: AutomationSchedule;
|
|
69
|
+
readonly rrule: string;
|
|
70
|
+
readonly timeZone: string;
|
|
71
|
+
readonly workspaceId: string;
|
|
72
|
+
readonly cwd: string;
|
|
73
|
+
readonly agentPreset: string;
|
|
74
|
+
readonly provider: string | null;
|
|
75
|
+
readonly model: string | null;
|
|
76
|
+
readonly reasoningEffort?: string | null | undefined;
|
|
77
|
+
readonly permissionPreset: PermissionPreset;
|
|
78
|
+
readonly createdBy: AutomationCreator;
|
|
79
|
+
readonly createdAt: string;
|
|
80
|
+
readonly updatedAt: string;
|
|
81
|
+
}
|
|
82
|
+
export interface AutomationTargetSnapshot {
|
|
83
|
+
readonly workspaceId: string;
|
|
84
|
+
readonly cwd: string;
|
|
85
|
+
readonly agentPreset: string;
|
|
86
|
+
readonly provider: string | null;
|
|
87
|
+
readonly model: string | null;
|
|
88
|
+
readonly reasoningEffort?: string | null | undefined;
|
|
89
|
+
readonly permissionPreset: PermissionPreset;
|
|
90
|
+
}
|
|
91
|
+
export interface AutomationRunError {
|
|
92
|
+
readonly code: string;
|
|
93
|
+
readonly message: string;
|
|
94
|
+
}
|
|
95
|
+
export interface AutomationRun {
|
|
96
|
+
readonly version: 1;
|
|
97
|
+
readonly id: string;
|
|
98
|
+
readonly automationId: string;
|
|
99
|
+
readonly automationName?: string | undefined;
|
|
100
|
+
readonly definitionRevision: number;
|
|
101
|
+
readonly occurrenceKey: string;
|
|
102
|
+
readonly trigger: 'schedule' | 'manual';
|
|
103
|
+
readonly scheduledFor: string;
|
|
104
|
+
readonly status: AutomationRunStatus;
|
|
105
|
+
readonly promptSnapshot: string;
|
|
106
|
+
readonly targetSnapshot: AutomationTargetSnapshot;
|
|
107
|
+
readonly sessionId: string | null;
|
|
108
|
+
readonly startedAt: string | null;
|
|
109
|
+
readonly finishedAt: string | null;
|
|
110
|
+
readonly summary: string | null;
|
|
111
|
+
readonly error: AutomationRunError | null;
|
|
112
|
+
readonly unread: boolean;
|
|
113
|
+
}
|
|
114
|
+
export interface CreateAutomationInput {
|
|
115
|
+
readonly id: string;
|
|
116
|
+
readonly name: string;
|
|
117
|
+
readonly prompt: string;
|
|
118
|
+
readonly schedule: AutomationSchedule;
|
|
119
|
+
readonly workspaceId: string;
|
|
120
|
+
readonly cwd: string;
|
|
121
|
+
readonly agentPreset: string;
|
|
122
|
+
readonly provider?: string | null;
|
|
123
|
+
readonly model?: string | null;
|
|
124
|
+
readonly reasoningEffort?: string | null | undefined;
|
|
125
|
+
readonly permissionPreset?: PermissionPreset;
|
|
126
|
+
readonly createdBy: AutomationCreator;
|
|
127
|
+
readonly now: string;
|
|
128
|
+
}
|
|
129
|
+
export interface UpdateAutomationInput {
|
|
130
|
+
readonly name?: string;
|
|
131
|
+
readonly prompt?: string;
|
|
132
|
+
readonly status?: AutomationStatus;
|
|
133
|
+
readonly schedule?: AutomationSchedule;
|
|
134
|
+
readonly agentPreset?: string;
|
|
135
|
+
readonly provider?: string | null;
|
|
136
|
+
readonly model?: string | null;
|
|
137
|
+
readonly reasoningEffort?: string | null | undefined;
|
|
138
|
+
readonly permissionPreset?: PermissionPreset;
|
|
139
|
+
readonly workspaceId?: string;
|
|
140
|
+
readonly cwd?: string;
|
|
141
|
+
readonly now: string;
|
|
142
|
+
}
|
|
143
|
+
export interface DeleteAutomationPlan {
|
|
144
|
+
readonly id: string;
|
|
145
|
+
readonly preserveRunHistory: true;
|
|
146
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@michengai/dsh-automation",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "在独立 DSH Session 中按计划执行编码任务,支持 Web 设置页与 Agent 双入口管理。",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/index.js",
|
|
7
|
+
"types": "./lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./lib/types/index.d.ts",
|
|
11
|
+
"default": "./lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./client": {
|
|
14
|
+
"types": "./lib/types/client/index.d.ts",
|
|
15
|
+
"default": "./lib/client.js"
|
|
16
|
+
},
|
|
17
|
+
"./package.json": "./package.json"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"lib",
|
|
21
|
+
"docs",
|
|
22
|
+
"cordis.patch.yml",
|
|
23
|
+
"README.md",
|
|
24
|
+
"README.zh-CN.md",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"NOTICE"
|
|
27
|
+
],
|
|
28
|
+
"license": "Apache-2.0",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "git+https://github.com/MichengAI/dsh-automation.git"
|
|
32
|
+
},
|
|
33
|
+
"bugs": {
|
|
34
|
+
"url": "https://github.com/MichengAI/dsh-automation/issues"
|
|
35
|
+
},
|
|
36
|
+
"homepage": "https://github.com/MichengAI/dsh-automation#readme",
|
|
37
|
+
"engines": {
|
|
38
|
+
"node": "^22.19.0 || >=24.0.0"
|
|
39
|
+
},
|
|
40
|
+
"dsh": {
|
|
41
|
+
"bundle": {
|
|
42
|
+
"patch": "./cordis.patch.yml"
|
|
43
|
+
},
|
|
44
|
+
"client": {
|
|
45
|
+
"platform": "web",
|
|
46
|
+
"inject": [
|
|
47
|
+
"@deepseek-ai/dsh-client-connection",
|
|
48
|
+
"@deepseek-ai/dsh-client-runtime",
|
|
49
|
+
"@deepseek-ai/dsh-client-locale",
|
|
50
|
+
"@deepseek-ai/dsh-client-ui-settings",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-conversation"
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"scripts": {
|
|
56
|
+
"build": "node scripts/build.mjs",
|
|
57
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
58
|
+
"test": "node --import ./tests/register-dsh-stubs.mjs --import tsx --test tests/*.test.ts",
|
|
59
|
+
"check": "pnpm typecheck && pnpm test && pnpm build"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"luxon": "^3.7.2",
|
|
63
|
+
"zod": "^4.1.5"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"react": "^18.2.0"
|
|
67
|
+
},
|
|
68
|
+
"peerDependenciesMeta": {
|
|
69
|
+
"react": {
|
|
70
|
+
"optional": true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/luxon": "^3.7.1",
|
|
75
|
+
"@types/node": "^22.0.0",
|
|
76
|
+
"@types/react": "~18.3.1",
|
|
77
|
+
"esbuild": "^0.25.0",
|
|
78
|
+
"react": "^18.3.1",
|
|
79
|
+
"tsx": "^4.20.0",
|
|
80
|
+
"typescript": "^5.9.0"
|
|
81
|
+
},
|
|
82
|
+
"keywords": [
|
|
83
|
+
"deepseek-harness",
|
|
84
|
+
"dsh",
|
|
85
|
+
"automation",
|
|
86
|
+
"scheduled-task",
|
|
87
|
+
"coding-agent",
|
|
88
|
+
"cordis"
|
|
89
|
+
],
|
|
90
|
+
"publishConfig": {
|
|
91
|
+
"access": "public",
|
|
92
|
+
"registry": "https://registry.npmjs.org/"
|
|
93
|
+
},
|
|
94
|
+
"pnpm": {
|
|
95
|
+
"onlyBuiltDependencies": [
|
|
96
|
+
"esbuild"
|
|
97
|
+
]
|
|
98
|
+
}
|
|
99
|
+
}
|