dsh-background-task-engine 0.0.0-stage → 1.0.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 +91 -0
- package/LICENSE +21 -0
- package/README.md +263 -2
- package/README.zh.md +179 -0
- package/cordis.patch.yml +20 -0
- package/dist/config.d.ts +86 -0
- package/dist/config.js +106 -0
- package/dist/domain/records.d.ts +543 -0
- package/dist/domain/records.js +135 -0
- package/dist/domain/state.d.ts +61 -0
- package/dist/domain/state.js +128 -0
- package/dist/errors.d.ts +38 -0
- package/dist/errors.js +99 -0
- package/dist/host.d.ts +165 -0
- package/dist/host.js +56 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +78 -0
- package/dist/prompt/guidance.d.ts +30 -0
- package/dist/prompt/guidance.js +62 -0
- package/dist/services/audit.d.ts +39 -0
- package/dist/services/audit.js +48 -0
- package/dist/services/engine.d.ts +435 -0
- package/dist/services/engine.js +150 -0
- package/dist/services/run-service.d.ts +145 -0
- package/dist/services/run-service.js +569 -0
- package/dist/services/schedule-adapter.d.ts +92 -0
- package/dist/services/schedule-adapter.js +220 -0
- package/dist/services/task-service.d.ts +146 -0
- package/dist/services/task-service.js +490 -0
- package/dist/storage/repository.d.ts +65 -0
- package/dist/storage/repository.js +194 -0
- package/dist/storage/spec.d.ts +97 -0
- package/dist/storage/spec.js +149 -0
- package/dist/tools/run-tools.d.ts +14 -0
- package/dist/tools/run-tools.js +402 -0
- package/dist/tools/schedule-tool.d.ts +11 -0
- package/dist/tools/schedule-tool.js +238 -0
- package/dist/tools/shared.d.ts +108 -0
- package/dist/tools/shared.js +278 -0
- package/dist/tools/task-tools.d.ts +7 -0
- package/dist/tools/task-tools.js +321 -0
- package/dist/utils/id.d.ts +8 -0
- package/dist/utils/id.js +29 -0
- package/dist/utils/page.d.ts +36 -0
- package/dist/utils/page.js +71 -0
- package/dist/utils/text.d.ts +20 -0
- package/dist/utils/text.js +46 -0
- package/dist/utils/time.d.ts +7 -0
- package/dist/utils/time.js +38 -0
- package/docs/API-COMPATIBILITY-AUDIT.md +203 -0
- package/docs/DETAIL.md +1 -0
- package/docs/DETAIL.zh.md +1 -0
- package/docs/TEST-REPORT.md +232 -0
- package/docs/preview.svg +68 -0
- package/icon.svg +23 -0
- package/locale/en.json +7 -0
- package/locale/zh.json +7 -0
- package/package.json +71 -4
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared tool plumbing: uniform error envelope, argument validation, JSON Schema
|
|
3
|
+
* shapes and rendering (PRD 6.3, FR-009, 12.3).
|
|
4
|
+
*
|
|
5
|
+
* Every task_* tool returns `{ success: true, ... }` or
|
|
6
|
+
* `{ success: false, error: { code, message, retryable, relatedRunId? } }`.
|
|
7
|
+
* Tools never throw: an Agent only has to branch on `success`.
|
|
8
|
+
*/
|
|
9
|
+
import type { ZodTypeAny } from 'zod';
|
|
10
|
+
import type { ContentBlock, ToolDefinitionLike } from '../host.js';
|
|
11
|
+
import type { TaskEngine } from '../services/engine.js';
|
|
12
|
+
import { type RunStepRecord, type StepDefinition } from '../domain/records.js';
|
|
13
|
+
/**
|
|
14
|
+
* The JSON Schema subset accepted by `assertSupportedJsonSchema`. Keys outside
|
|
15
|
+
* this set (minLength, pattern, maximum, format) throw at registration, so all
|
|
16
|
+
* range and length rules are enforced in code.
|
|
17
|
+
*/
|
|
18
|
+
export interface JsonSchemaNode {
|
|
19
|
+
type?: 'object' | 'array' | 'string' | 'number' | 'integer' | 'boolean' | 'null';
|
|
20
|
+
oneOf?: JsonSchemaNode[];
|
|
21
|
+
properties?: Record<string, JsonSchemaNode>;
|
|
22
|
+
required?: string[];
|
|
23
|
+
additionalProperties?: boolean;
|
|
24
|
+
items?: JsonSchemaNode;
|
|
25
|
+
enum?: Array<string | number | boolean | null>;
|
|
26
|
+
const?: string | number | boolean | null;
|
|
27
|
+
description?: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
default?: unknown;
|
|
30
|
+
examples?: unknown[];
|
|
31
|
+
}
|
|
32
|
+
export declare const ERROR_SCHEMA: JsonSchemaNode;
|
|
33
|
+
/** Object-rooted output schema with the shared `success` / `error` pair. */
|
|
34
|
+
export declare function out(properties: Record<string, JsonSchemaNode>, required?: string[]): JsonSchemaNode;
|
|
35
|
+
export declare const STEP_SCHEMA: JsonSchemaNode;
|
|
36
|
+
export declare const STEPS_ARRAY_SCHEMA: JsonSchemaNode;
|
|
37
|
+
export declare const TASK_FIELDS: Record<string, JsonSchemaNode>;
|
|
38
|
+
export declare const RUN_FIELDS: Record<string, JsonSchemaNode>;
|
|
39
|
+
export interface TaskLike {
|
|
40
|
+
taskId: string;
|
|
41
|
+
title: string;
|
|
42
|
+
description?: string;
|
|
43
|
+
status: string;
|
|
44
|
+
revision: number;
|
|
45
|
+
steps: StepDefinition[];
|
|
46
|
+
scheduleRef?: {
|
|
47
|
+
scheduleId: string;
|
|
48
|
+
state: string;
|
|
49
|
+
timingKind: string;
|
|
50
|
+
timing: Record<string, unknown>;
|
|
51
|
+
};
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
}
|
|
55
|
+
export interface RunLike {
|
|
56
|
+
runId: string;
|
|
57
|
+
templateSnapshot?: {
|
|
58
|
+
revision: number;
|
|
59
|
+
title: string;
|
|
60
|
+
steps: StepDefinition[];
|
|
61
|
+
};
|
|
62
|
+
taskId: string;
|
|
63
|
+
taskRevision: number;
|
|
64
|
+
status: string;
|
|
65
|
+
triggerType: string;
|
|
66
|
+
sessionId: string;
|
|
67
|
+
scheduleId?: string;
|
|
68
|
+
occurrenceKey?: string;
|
|
69
|
+
progress: number;
|
|
70
|
+
requiredCompleted: number;
|
|
71
|
+
requiredTotal: number;
|
|
72
|
+
currentStepId?: string;
|
|
73
|
+
startedAt: string;
|
|
74
|
+
finishedAt?: string;
|
|
75
|
+
summary?: string;
|
|
76
|
+
error?: {
|
|
77
|
+
code: string;
|
|
78
|
+
message: string;
|
|
79
|
+
};
|
|
80
|
+
resumesRunId?: string;
|
|
81
|
+
}
|
|
82
|
+
export declare function taskView(task: TaskLike): Record<string, unknown>;
|
|
83
|
+
export declare function runView(run: RunLike, steps: RunStepRecord[]): Record<string, unknown>;
|
|
84
|
+
/** Compact progress block used by list/get/history renderers. */
|
|
85
|
+
export declare function progressLine(run: RunLike): string;
|
|
86
|
+
/**
|
|
87
|
+
* Render helper for custom presenters: a failed call always renders through the
|
|
88
|
+
* generic error line, so one broken custom renderer cannot hide an error.
|
|
89
|
+
*/
|
|
90
|
+
export declare function isFailure(value: unknown): value is {
|
|
91
|
+
success: false;
|
|
92
|
+
error: Record<string, unknown>;
|
|
93
|
+
};
|
|
94
|
+
export declare function renderGeneric(_args: unknown, value: unknown): ContentBlock[];
|
|
95
|
+
export interface ToolBuilderInput {
|
|
96
|
+
name: string;
|
|
97
|
+
description: string;
|
|
98
|
+
/** Property schemas; buildTool wraps them in an object root. */
|
|
99
|
+
parameters: Record<string, JsonSchemaNode>;
|
|
100
|
+
/** Names that must be present (standard JSON Schema `required`). */
|
|
101
|
+
requiredParams?: string[];
|
|
102
|
+
/** Zod schema for server-side validation, coercion and defaults. */
|
|
103
|
+
args: ZodTypeAny;
|
|
104
|
+
output: JsonSchemaNode;
|
|
105
|
+
render?: (args: unknown, value: unknown) => ContentBlock[];
|
|
106
|
+
execute: (args: Record<string, unknown>, engine: TaskEngine) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
107
|
+
}
|
|
108
|
+
export declare function buildTool(input: ToolBuilderInput, engine: TaskEngine | null | (() => TaskEngine)): ToolDefinitionLike;
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared tool plumbing: uniform error envelope, argument validation, JSON Schema
|
|
3
|
+
* shapes and rendering (PRD 6.3, FR-009, 12.3).
|
|
4
|
+
*
|
|
5
|
+
* Every task_* tool returns `{ success: true, ... }` or
|
|
6
|
+
* `{ success: false, error: { code, message, retryable, relatedRunId? } }`.
|
|
7
|
+
* Tools never throw: an Agent only has to branch on `success`.
|
|
8
|
+
*/
|
|
9
|
+
import { sessionIdOf } from '../host.js';
|
|
10
|
+
import { TaskEngineError, TASK_ERROR_CODES, toErrorPayload } from '../errors.js';
|
|
11
|
+
import { RUN_STATUSES } from '../domain/records.js';
|
|
12
|
+
import { elapsedLabel } from '../utils/time.js';
|
|
13
|
+
export const ERROR_SCHEMA = {
|
|
14
|
+
type: 'object',
|
|
15
|
+
additionalProperties: true,
|
|
16
|
+
properties: {
|
|
17
|
+
code: { type: 'string', enum: [...TASK_ERROR_CODES] },
|
|
18
|
+
message: { type: 'string' },
|
|
19
|
+
retryable: { type: 'boolean' },
|
|
20
|
+
relatedRunId: { type: 'string' },
|
|
21
|
+
},
|
|
22
|
+
required: ['code', 'message', 'retryable'],
|
|
23
|
+
};
|
|
24
|
+
/** Object-rooted output schema with the shared `success` / `error` pair. */
|
|
25
|
+
export function out(properties, required = []) {
|
|
26
|
+
return {
|
|
27
|
+
type: 'object',
|
|
28
|
+
additionalProperties: true,
|
|
29
|
+
properties: {
|
|
30
|
+
success: { type: 'boolean' },
|
|
31
|
+
error: ERROR_SCHEMA,
|
|
32
|
+
...properties,
|
|
33
|
+
},
|
|
34
|
+
required: ['success', ...required],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
export const STEP_SCHEMA = {
|
|
38
|
+
type: 'object',
|
|
39
|
+
additionalProperties: true,
|
|
40
|
+
properties: {
|
|
41
|
+
stepId: { type: 'string' },
|
|
42
|
+
title: { type: 'string' },
|
|
43
|
+
instruction: { type: 'string' },
|
|
44
|
+
completionCriteria: { type: 'string' },
|
|
45
|
+
order: { type: 'integer' },
|
|
46
|
+
required: { type: 'boolean' },
|
|
47
|
+
status: { type: 'string', enum: ['pending', 'running', 'completed', 'failed', 'skipped'] },
|
|
48
|
+
summary: { type: 'string' },
|
|
49
|
+
errorSummary: { type: 'string' },
|
|
50
|
+
startedAt: { type: 'string' },
|
|
51
|
+
finishedAt: { type: 'string' },
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const STEPS_ARRAY_SCHEMA = { type: 'array', items: STEP_SCHEMA };
|
|
55
|
+
export const TASK_FIELDS = {
|
|
56
|
+
taskId: { type: 'string' },
|
|
57
|
+
title: { type: 'string' },
|
|
58
|
+
description: { type: 'string' },
|
|
59
|
+
status: { type: 'string', enum: ['active', 'paused', 'archived'] },
|
|
60
|
+
revision: { type: 'integer' },
|
|
61
|
+
stepCount: { type: 'integer' },
|
|
62
|
+
steps: STEPS_ARRAY_SCHEMA,
|
|
63
|
+
schedule: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
additionalProperties: true,
|
|
66
|
+
properties: {
|
|
67
|
+
scheduleId: { type: 'string' },
|
|
68
|
+
state: { type: 'string', enum: ['active', 'paused', 'unlinked'] },
|
|
69
|
+
kind: { type: 'string' },
|
|
70
|
+
timing: { type: 'string' },
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
createdAt: { type: 'string' },
|
|
74
|
+
updatedAt: { type: 'string' },
|
|
75
|
+
};
|
|
76
|
+
export const RUN_FIELDS = {
|
|
77
|
+
runId: { type: 'string' },
|
|
78
|
+
taskId: { type: 'string' },
|
|
79
|
+
taskRevision: { type: 'integer' },
|
|
80
|
+
status: { type: 'string', enum: [...RUN_STATUSES] },
|
|
81
|
+
triggerType: { type: 'string', enum: ['manual', 'schedule'] },
|
|
82
|
+
sessionId: { type: 'string' },
|
|
83
|
+
scheduleId: { type: 'string' },
|
|
84
|
+
occurrenceKey: { type: 'string' },
|
|
85
|
+
progress: { type: 'integer' },
|
|
86
|
+
completedRequired: { type: 'integer' },
|
|
87
|
+
totalRequired: { type: 'integer' },
|
|
88
|
+
currentStepId: { type: 'string' },
|
|
89
|
+
steps: STEPS_ARRAY_SCHEMA,
|
|
90
|
+
summary: { type: 'string' },
|
|
91
|
+
errorSummary: { type: 'string' },
|
|
92
|
+
resumesRunId: { type: 'string' },
|
|
93
|
+
startedAt: { type: 'string' },
|
|
94
|
+
finishedAt: { type: 'string' },
|
|
95
|
+
duration: { type: 'string' },
|
|
96
|
+
};
|
|
97
|
+
function defectView(step) {
|
|
98
|
+
const view = {
|
|
99
|
+
stepId: step.stepId,
|
|
100
|
+
title: step.title,
|
|
101
|
+
instruction: step.instruction,
|
|
102
|
+
order: step.order,
|
|
103
|
+
required: step.required,
|
|
104
|
+
};
|
|
105
|
+
if (step.completionCriteria)
|
|
106
|
+
view.completionCriteria = step.completionCriteria;
|
|
107
|
+
return view;
|
|
108
|
+
}
|
|
109
|
+
function stepRecordView(step) {
|
|
110
|
+
const view = {
|
|
111
|
+
stepId: step.stepId,
|
|
112
|
+
title: step.title,
|
|
113
|
+
order: step.order,
|
|
114
|
+
required: step.required,
|
|
115
|
+
status: step.status,
|
|
116
|
+
};
|
|
117
|
+
if (step.summary)
|
|
118
|
+
view.summary = step.summary;
|
|
119
|
+
if (step.error)
|
|
120
|
+
view.errorSummary = `${step.error.code}: ${step.error.message}`;
|
|
121
|
+
if (step.startedAt)
|
|
122
|
+
view.startedAt = step.startedAt;
|
|
123
|
+
if (step.finishedAt)
|
|
124
|
+
view.finishedAt = step.finishedAt;
|
|
125
|
+
return view;
|
|
126
|
+
}
|
|
127
|
+
export function taskView(task) {
|
|
128
|
+
const view = {
|
|
129
|
+
taskId: task.taskId,
|
|
130
|
+
title: task.title,
|
|
131
|
+
status: task.status,
|
|
132
|
+
revision: task.revision,
|
|
133
|
+
stepCount: task.steps.length,
|
|
134
|
+
steps: task.steps.map(defectView),
|
|
135
|
+
createdAt: task.createdAt,
|
|
136
|
+
updatedAt: task.updatedAt,
|
|
137
|
+
};
|
|
138
|
+
if (task.description)
|
|
139
|
+
view.description = task.description;
|
|
140
|
+
if (task.scheduleRef) {
|
|
141
|
+
view.schedule = {
|
|
142
|
+
scheduleId: task.scheduleRef.scheduleId,
|
|
143
|
+
state: task.scheduleRef.state,
|
|
144
|
+
kind: task.scheduleRef.timingKind,
|
|
145
|
+
timing: String(task.scheduleRef.timing?.kind ?? task.scheduleRef.timingKind),
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
return view;
|
|
149
|
+
}
|
|
150
|
+
export function runView(run, steps) {
|
|
151
|
+
// The run's own snapshot is the only source of instructions for this
|
|
152
|
+
// execution: later task edits must not change what the agent was asked to do.
|
|
153
|
+
const definitions = new Map((run.templateSnapshot?.steps ?? []).map((step) => [step.stepId, step]));
|
|
154
|
+
const view = {
|
|
155
|
+
runId: run.runId,
|
|
156
|
+
taskId: run.taskId,
|
|
157
|
+
taskRevision: run.taskRevision,
|
|
158
|
+
status: run.status,
|
|
159
|
+
triggerType: run.triggerType,
|
|
160
|
+
sessionId: run.sessionId,
|
|
161
|
+
progress: run.progress,
|
|
162
|
+
completedRequired: run.requiredCompleted,
|
|
163
|
+
totalRequired: run.requiredTotal,
|
|
164
|
+
steps: steps
|
|
165
|
+
.sort((a, b) => a.order - b.order)
|
|
166
|
+
.map((step) => {
|
|
167
|
+
const definition = definitions.get(step.stepId);
|
|
168
|
+
const rendered = stepRecordView(step);
|
|
169
|
+
if (definition) {
|
|
170
|
+
rendered.instruction = definition.instruction;
|
|
171
|
+
if (definition.completionCriteria)
|
|
172
|
+
rendered.completionCriteria = definition.completionCriteria;
|
|
173
|
+
}
|
|
174
|
+
return rendered;
|
|
175
|
+
}),
|
|
176
|
+
startedAt: run.startedAt,
|
|
177
|
+
duration: elapsedLabel(run.startedAt, run.finishedAt),
|
|
178
|
+
};
|
|
179
|
+
if (run.scheduleId)
|
|
180
|
+
view.scheduleId = run.scheduleId;
|
|
181
|
+
if (run.occurrenceKey)
|
|
182
|
+
view.occurrenceKey = run.occurrenceKey;
|
|
183
|
+
if (run.currentStepId)
|
|
184
|
+
view.currentStepId = run.currentStepId;
|
|
185
|
+
if (run.summary)
|
|
186
|
+
view.summary = run.summary;
|
|
187
|
+
if (run.error)
|
|
188
|
+
view.errorSummary = `${run.error.code}: ${run.error.message}`;
|
|
189
|
+
if (run.resumesRunId)
|
|
190
|
+
view.resumesRunId = run.resumesRunId;
|
|
191
|
+
if (run.finishedAt)
|
|
192
|
+
view.finishedAt = run.finishedAt;
|
|
193
|
+
return view;
|
|
194
|
+
}
|
|
195
|
+
/** Compact progress block used by list/get/history renderers. */
|
|
196
|
+
export function progressLine(run) {
|
|
197
|
+
const marks = ['pending', 'running', 'completed', 'failed', 'skipped'];
|
|
198
|
+
void marks;
|
|
199
|
+
return `${run.status} ${run.progress}% (${run.requiredCompleted}/${run.requiredTotal})`;
|
|
200
|
+
}
|
|
201
|
+
// ----------------------------------------------------------------- render
|
|
202
|
+
function formatValue(value) {
|
|
203
|
+
if (value === null || value === undefined || value === '')
|
|
204
|
+
return '';
|
|
205
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean')
|
|
206
|
+
return String(value);
|
|
207
|
+
if (Array.isArray(value))
|
|
208
|
+
return value.map((item) => formatValue(item)).filter(Boolean).join(';');
|
|
209
|
+
try {
|
|
210
|
+
return JSON.stringify(value);
|
|
211
|
+
}
|
|
212
|
+
catch {
|
|
213
|
+
return String(value);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Render helper for custom presenters: a failed call always renders through the
|
|
218
|
+
* generic error line, so one broken custom renderer cannot hide an error.
|
|
219
|
+
*/
|
|
220
|
+
export function isFailure(value) {
|
|
221
|
+
return typeof value === 'object' && value !== null && value.success === false;
|
|
222
|
+
}
|
|
223
|
+
export function renderGeneric(_args, value) {
|
|
224
|
+
const record = (value ?? {});
|
|
225
|
+
if (record.success === false) {
|
|
226
|
+
const error = (record.error ?? {});
|
|
227
|
+
return [{ type: 'text', text: `❌ ${String(error.code ?? 'ERROR')}: ${String(error.message ?? '')}` }];
|
|
228
|
+
}
|
|
229
|
+
const lines = Object.entries(record)
|
|
230
|
+
.filter(([key]) => key !== 'success' && key !== 'error')
|
|
231
|
+
.map(([key, item]) => `${key}: ${formatValue(item)}`)
|
|
232
|
+
.filter((line) => !line.endsWith(': '));
|
|
233
|
+
return [{ type: 'text', text: lines.length > 0 ? `✅ ${lines.join('\n')}` : '✅ 完成' }];
|
|
234
|
+
}
|
|
235
|
+
export function buildTool(input, engine) {
|
|
236
|
+
const resolveEngine = () => {
|
|
237
|
+
if (typeof engine === 'function')
|
|
238
|
+
return engine();
|
|
239
|
+
if (engine)
|
|
240
|
+
return engine;
|
|
241
|
+
throw new TaskEngineError('TASK_STORAGE_ERROR', '任务引擎尚未初始化');
|
|
242
|
+
};
|
|
243
|
+
return {
|
|
244
|
+
name: input.name,
|
|
245
|
+
description: input.description,
|
|
246
|
+
parameters: {
|
|
247
|
+
type: 'object',
|
|
248
|
+
additionalProperties: false,
|
|
249
|
+
properties: input.parameters,
|
|
250
|
+
...(input.requiredParams && input.requiredParams.length > 0 ? { required: input.requiredParams } : {}),
|
|
251
|
+
},
|
|
252
|
+
output: {
|
|
253
|
+
schema: input.output,
|
|
254
|
+
render: (args, value) => typeof input.render === 'function' ? input.render(args, value) : renderGeneric(args, value),
|
|
255
|
+
},
|
|
256
|
+
execute: async (rawArgs, exec) => {
|
|
257
|
+
try {
|
|
258
|
+
const sessionId = sessionIdOf(exec);
|
|
259
|
+
if (!sessionId) {
|
|
260
|
+
throw new TaskEngineError('TASK_PERMISSION_DENIED', '无法确定调用方会话,已拒绝执行');
|
|
261
|
+
}
|
|
262
|
+
const parsed = input.args.safeParse(rawArgs ?? {});
|
|
263
|
+
if (!parsed.success) {
|
|
264
|
+
const issue = parsed.error.issues[0];
|
|
265
|
+
const path = issue?.path?.join('.') || '参数';
|
|
266
|
+
throw new TaskEngineError('TASK_INVALID_ARGUMENTS', `${path} ${issue?.message ?? '不合法'}`.trim());
|
|
267
|
+
}
|
|
268
|
+
const active = resolveEngine();
|
|
269
|
+
await active.waitReady();
|
|
270
|
+
const value = await input.execute({ ...parsed.data, sessionId }, active);
|
|
271
|
+
return { success: true, ...value };
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
return { success: false, error: toErrorPayload(error) };
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
};
|
|
278
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Task template tools: task_create / task_list / task_get / task_update /
|
|
3
|
+
* task_archive (PRD 4.1, 4.2, 5.2, FR-001).
|
|
4
|
+
*/
|
|
5
|
+
import type { ToolDefinitionLike } from '../host.js';
|
|
6
|
+
import type { TaskEngine } from '../services/engine.js';
|
|
7
|
+
export declare function createTaskTools(engine: () => TaskEngine): ToolDefinitionLike[];
|