@goodandready/dsh-goal 0.1.10 → 0.2.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/README.md +10 -0
- package/README.ru.md +6 -0
- package/README.zh.md +2 -0
- package/docs/design/DESIGN.md +43 -0
- package/lib/client.js +377 -82
- package/lib/command-handler.js +11 -2
- package/lib/goal-engine.js +1009 -780
- package/lib/index.js +373 -319
- package/package.json +1 -1
package/lib/command-handler.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { randomUUID } from 'node:crypto';
|
|
2
2
|
import { GoalState, detectLanguage } from './goal-engine.js';
|
|
3
3
|
|
|
4
|
-
export const USAGE_RU = 'Использование: /goal [<цель>|clear|pause|resume]';
|
|
5
4
|
export const USAGE_EN = 'Usage: /goal [<goal>|clear|pause|resume]';
|
|
6
|
-
export const
|
|
5
|
+
export const USAGE_ZH = '用法: /goal [<目标描述>|clear|pause|resume]';
|
|
6
|
+
export const USAGE_RU = 'Использование: /goal [<цель>|clear|pause|resume]';
|
|
7
|
+
export const USAGE = USAGE_EN;
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Парсинг строки ввода для команды /goal
|
|
@@ -46,6 +47,14 @@ export function createGoalUserMessage(text) {
|
|
|
46
47
|
*/
|
|
47
48
|
export function formatGoalStartPrompt(goalText, explicitLang) {
|
|
48
49
|
const lang = explicitLang || detectLanguage(goalText);
|
|
50
|
+
if (lang === 'zh') {
|
|
51
|
+
return `🎯 目标模式已激活 (Goal Mode): "${goalText}"\n\n` +
|
|
52
|
+
`自主执行契约:\n` +
|
|
53
|
+
`1. 第一步必选动作:在开展任何工作或回复之前,你的第一个动作必须是调用 goal_set_milestones 工具,提交包含 3-7 个具体连续步骤的工作计划。用户将在界面中实时查看此计划。\n` +
|
|
54
|
+
`2. 第二步:计划确立后开始执行任务。在开始每个步骤前,通过 goal_update_progress(milestone_id, "in_progress") 标记其为进行中。\n` +
|
|
55
|
+
`3. 第三步:完成某一步骤后,通过 goal_update_progress(milestone_id, "completed", "阶段简要成果") 标记为已完成。\n` +
|
|
56
|
+
`4. 第四步:当所有里程碑全部完成后,调用 goal_finish(summary) 工具并附带详尽的最终成果总结。`;
|
|
57
|
+
}
|
|
49
58
|
if (lang === 'ru') {
|
|
50
59
|
return `🎯 Активирован режим цели (Goal Mode): "${goalText}"\n\n` +
|
|
51
60
|
`СТРОГИЙ КОНТРАКТ АВТОНОМНОГО РЕЖИМА:\n` +
|