oh-my-claude-sisyphus 1.9.0 → 1.10.2
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/agents/definitions.js +1 -1
- package/dist/agents/orchestrator-sisyphus.js +1 -1
- package/dist/features/auto-update.d.ts +20 -0
- package/dist/features/auto-update.d.ts.map +1 -1
- package/dist/features/auto-update.js +35 -0
- package/dist/features/auto-update.js.map +1 -1
- package/dist/features/builtin-skills/skills.d.ts.map +1 -1
- package/dist/features/builtin-skills/skills.js +146 -13
- package/dist/features/builtin-skills/skills.js.map +1 -1
- package/dist/hooks/bridge.d.ts +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +97 -1
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +12 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +40 -0
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -0
- package/dist/hooks/persistent-mode/index.js +322 -0
- package/dist/hooks/persistent-mode/index.js.map +1 -0
- package/dist/hooks/plugin-patterns/index.d.ts +107 -0
- package/dist/hooks/plugin-patterns/index.d.ts.map +1 -0
- package/dist/hooks/plugin-patterns/index.js +286 -0
- package/dist/hooks/plugin-patterns/index.js.map +1 -0
- package/dist/hooks/preemptive-compaction/index.js +2 -2
- package/dist/hooks/preemptive-compaction/index.js.map +1 -1
- package/dist/hooks/ralph-verifier/index.d.ts +72 -0
- package/dist/hooks/ralph-verifier/index.d.ts.map +1 -0
- package/dist/hooks/ralph-verifier/index.js +223 -0
- package/dist/hooks/ralph-verifier/index.js.map +1 -0
- package/dist/hooks/thinking-block-validator/index.d.ts +3 -34
- package/dist/hooks/thinking-block-validator/index.d.ts.map +1 -1
- package/dist/hooks/thinking-block-validator/index.js +21 -70
- package/dist/hooks/thinking-block-validator/index.js.map +1 -1
- package/dist/hooks/ultrawork-state/index.d.ts +60 -0
- package/dist/hooks/ultrawork-state/index.d.ts.map +1 -0
- package/dist/hooks/ultrawork-state/index.js +207 -0
- package/dist/hooks/ultrawork-state/index.js.map +1 -0
- package/dist/installer/hooks.d.ts +38 -2
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +682 -8
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +126 -10
- package/dist/installer/index.js.map +1 -1
- package/dist/tools/ast-tools.d.ts +3 -3
- package/dist/tools/ast-tools.d.ts.map +1 -1
- package/dist/tools/ast-tools.js +205 -104
- package/dist/tools/ast-tools.js.map +1 -1
- package/package.json +1 -1
- package/scripts/install.sh +70 -3
- package/scripts/uninstall.sh +116 -3
|
@@ -15,48 +15,17 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Ported from oh-my-opencode's thinking-block-validator hook.
|
|
17
17
|
*/
|
|
18
|
-
import type { MessagePart, MessageWithParts, MessagesTransformHook, ValidationResult } from
|
|
19
|
-
export * from
|
|
20
|
-
export * from
|
|
21
|
-
/**
|
|
22
|
-
* Check if a model has extended thinking enabled
|
|
23
|
-
* Uses patterns from think-mode/switcher.ts for consistency
|
|
24
|
-
*/
|
|
18
|
+
import type { MessagePart, MessageWithParts, MessagesTransformHook, ValidationResult } from "./types.js";
|
|
19
|
+
export * from "./types.js";
|
|
20
|
+
export * from "./constants.js";
|
|
25
21
|
export declare function isExtendedThinkingModel(modelID: string): boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Check if a message has any content parts (tool_use, text, or other non-thinking content)
|
|
28
|
-
*/
|
|
29
22
|
export declare function hasContentParts(parts: MessagePart[]): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Check if a message starts with a thinking/reasoning block
|
|
32
|
-
*/
|
|
33
23
|
export declare function startsWithThinkingBlock(parts: MessagePart[]): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Find the most recent thinking content from previous assistant messages
|
|
36
|
-
*/
|
|
37
24
|
export declare function findPreviousThinkingContent(messages: MessageWithParts[], currentIndex: number): string;
|
|
38
|
-
/**
|
|
39
|
-
* Prepend a thinking block to a message's parts array
|
|
40
|
-
*/
|
|
41
25
|
export declare function prependThinkingBlock(message: MessageWithParts, thinkingContent: string): void;
|
|
42
|
-
/**
|
|
43
|
-
* Validate a single assistant message
|
|
44
|
-
* Returns validation result with details
|
|
45
|
-
*/
|
|
46
26
|
export declare function validateMessage(message: MessageWithParts, messages: MessageWithParts[], index: number, modelID: string): ValidationResult;
|
|
47
|
-
/**
|
|
48
|
-
* Validate and fix assistant messages that have tool_use but no thinking block
|
|
49
|
-
* This is the main hook function
|
|
50
|
-
*/
|
|
51
27
|
export declare function createThinkingBlockValidatorHook(): MessagesTransformHook;
|
|
52
|
-
/**
|
|
53
|
-
* Validate all messages in a conversation
|
|
54
|
-
* Returns array of validation results
|
|
55
|
-
*/
|
|
56
28
|
export declare function validateMessages(messages: MessageWithParts[], modelID: string): ValidationResult[];
|
|
57
|
-
/**
|
|
58
|
-
* Get statistics about validation results
|
|
59
|
-
*/
|
|
60
29
|
export declare function getValidationStats(results: ValidationResult[]): {
|
|
61
30
|
total: number;
|
|
62
31
|
valid: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/thinking-block-validator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/thinking-block-validator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EACV,WAAW,EACX,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EACjB,MAAM,YAAY,CAAC;AAUpB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAU/B,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAahE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAI7D;AAED,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,OAAO,CAKrE;AAED,wBAAgB,2BAA2B,CACzC,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,YAAY,EAAE,MAAM,GACnB,MAAM,CAqBR;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,gBAAgB,EACzB,eAAe,EAAE,MAAM,GACtB,IAAI,CAeN;AAED,wBAAgB,eAAe,CAC7B,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,MAAM,GACd,gBAAgB,CA2BlB;AAED,wBAAgB,gCAAgC,IAAI,qBAAqB,CA4CxE;AAED,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,gBAAgB,EAAE,EAC5B,OAAO,EAAE,MAAM,GACd,gBAAgB,EAAE,CASpB;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG;IAC/D,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,CAOA"}
|
|
@@ -15,67 +15,50 @@
|
|
|
15
15
|
*
|
|
16
16
|
* Ported from oh-my-opencode's thinking-block-validator hook.
|
|
17
17
|
*/
|
|
18
|
-
import { CONTENT_PART_TYPES, THINKING_PART_TYPES, DEFAULT_THINKING_CONTENT, SYNTHETIC_THINKING_ID_PREFIX, HOOK_NAME } from
|
|
19
|
-
|
|
20
|
-
export * from
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
import { CONTENT_PART_TYPES, THINKING_PART_TYPES, DEFAULT_THINKING_CONTENT, SYNTHETIC_THINKING_ID_PREFIX, HOOK_NAME, } from "./constants.js";
|
|
19
|
+
export * from "./types.js";
|
|
20
|
+
export * from "./constants.js";
|
|
21
|
+
function isContentPartType(type) {
|
|
22
|
+
return CONTENT_PART_TYPES.includes(type);
|
|
23
|
+
}
|
|
24
|
+
function isThinkingPartType(type) {
|
|
25
|
+
return THINKING_PART_TYPES.includes(type);
|
|
26
|
+
}
|
|
26
27
|
export function isExtendedThinkingModel(modelID) {
|
|
27
28
|
if (!modelID)
|
|
28
29
|
return false;
|
|
29
30
|
const lower = modelID.toLowerCase();
|
|
30
|
-
// Check for explicit thinking/high variants (always enabled)
|
|
31
31
|
if (lower.includes("thinking") || lower.endsWith("-high")) {
|
|
32
32
|
return true;
|
|
33
33
|
}
|
|
34
|
-
// Check for thinking-capable models (claude-4 family, claude-3)
|
|
35
|
-
// Aligns with THINKING_CAPABLE_MODELS in think-mode/switcher.ts
|
|
36
34
|
return (lower.includes("claude-sonnet-4") ||
|
|
37
35
|
lower.includes("claude-opus-4") ||
|
|
38
36
|
lower.includes("claude-3"));
|
|
39
37
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Check if a message has any content parts (tool_use, text, or other non-thinking content)
|
|
42
|
-
*/
|
|
43
38
|
export function hasContentParts(parts) {
|
|
44
39
|
if (!parts || parts.length === 0)
|
|
45
40
|
return false;
|
|
46
|
-
return parts.some((part) =>
|
|
47
|
-
const type = part.type;
|
|
48
|
-
// Include tool parts and text parts (anything that's not thinking/reasoning)
|
|
49
|
-
return CONTENT_PART_TYPES.includes(type);
|
|
50
|
-
});
|
|
41
|
+
return parts.some((part) => isContentPartType(part.type));
|
|
51
42
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Check if a message starts with a thinking/reasoning block
|
|
54
|
-
*/
|
|
55
43
|
export function startsWithThinkingBlock(parts) {
|
|
56
44
|
if (!parts || parts.length === 0)
|
|
57
45
|
return false;
|
|
58
46
|
const firstPart = parts[0];
|
|
59
|
-
|
|
60
|
-
return THINKING_PART_TYPES.includes(type);
|
|
47
|
+
return isThinkingPartType(firstPart.type);
|
|
61
48
|
}
|
|
62
|
-
/**
|
|
63
|
-
* Find the most recent thinking content from previous assistant messages
|
|
64
|
-
*/
|
|
65
49
|
export function findPreviousThinkingContent(messages, currentIndex) {
|
|
66
|
-
// Search backwards from current message
|
|
67
50
|
for (let i = currentIndex - 1; i >= 0; i--) {
|
|
68
51
|
const msg = messages[i];
|
|
69
52
|
if (msg.info.role !== "assistant")
|
|
70
53
|
continue;
|
|
71
|
-
// Look for thinking parts
|
|
72
54
|
if (!msg.parts)
|
|
73
55
|
continue;
|
|
74
56
|
for (const part of msg.parts) {
|
|
75
|
-
|
|
76
|
-
if (THINKING_PART_TYPES.includes(type)) {
|
|
57
|
+
if (isThinkingPartType(part.type)) {
|
|
77
58
|
const thinking = part.thinking || part.text;
|
|
78
|
-
if (thinking &&
|
|
59
|
+
if (thinking &&
|
|
60
|
+
typeof thinking === "string" &&
|
|
61
|
+
thinking.trim().length > 0) {
|
|
79
62
|
return thinking;
|
|
80
63
|
}
|
|
81
64
|
}
|
|
@@ -83,14 +66,10 @@ export function findPreviousThinkingContent(messages, currentIndex) {
|
|
|
83
66
|
}
|
|
84
67
|
return "";
|
|
85
68
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Prepend a thinking block to a message's parts array
|
|
88
|
-
*/
|
|
89
69
|
export function prependThinkingBlock(message, thinkingContent) {
|
|
90
70
|
if (!message.parts) {
|
|
91
71
|
message.parts = [];
|
|
92
72
|
}
|
|
93
|
-
// Create synthetic thinking part
|
|
94
73
|
const thinkingPart = {
|
|
95
74
|
type: "thinking",
|
|
96
75
|
id: SYNTHETIC_THINKING_ID_PREFIX,
|
|
@@ -99,42 +78,29 @@ export function prependThinkingBlock(message, thinkingContent) {
|
|
|
99
78
|
thinking: thinkingContent,
|
|
100
79
|
synthetic: true,
|
|
101
80
|
};
|
|
102
|
-
// Prepend to parts array
|
|
103
81
|
message.parts.unshift(thinkingPart);
|
|
104
82
|
}
|
|
105
|
-
/**
|
|
106
|
-
* Validate a single assistant message
|
|
107
|
-
* Returns validation result with details
|
|
108
|
-
*/
|
|
109
83
|
export function validateMessage(message, messages, index, modelID) {
|
|
110
|
-
// Only validate assistant messages
|
|
111
84
|
if (message.info.role !== "assistant") {
|
|
112
85
|
return { valid: true, fixed: false };
|
|
113
86
|
}
|
|
114
|
-
// Only validate if extended thinking might be enabled
|
|
115
87
|
if (!isExtendedThinkingModel(modelID)) {
|
|
116
88
|
return { valid: true, fixed: false };
|
|
117
89
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
// Find thinking content from previous turns
|
|
90
|
+
if (hasContentParts(message.parts) &&
|
|
91
|
+
!startsWithThinkingBlock(message.parts)) {
|
|
121
92
|
const previousThinking = findPreviousThinkingContent(messages, index);
|
|
122
|
-
// Prepend thinking block with content from previous turn or placeholder
|
|
123
93
|
const thinkingContent = previousThinking || DEFAULT_THINKING_CONTENT;
|
|
124
94
|
prependThinkingBlock(message, thinkingContent);
|
|
125
95
|
return {
|
|
126
96
|
valid: false,
|
|
127
97
|
fixed: true,
|
|
128
98
|
issue: "Assistant message has content but no thinking block",
|
|
129
|
-
action: `Prepended synthetic thinking block: "${thinkingContent.substring(0, 50)}..."
|
|
99
|
+
action: `Prepended synthetic thinking block: "${thinkingContent.substring(0, 50)}..."`,
|
|
130
100
|
};
|
|
131
101
|
}
|
|
132
102
|
return { valid: true, fixed: false };
|
|
133
103
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Validate and fix assistant messages that have tool_use but no thinking block
|
|
136
|
-
* This is the main hook function
|
|
137
|
-
*/
|
|
138
104
|
export function createThinkingBlockValidatorHook() {
|
|
139
105
|
return {
|
|
140
106
|
"experimental.chat.messages.transform": async (_input, output) => {
|
|
@@ -142,7 +108,6 @@ export function createThinkingBlockValidatorHook() {
|
|
|
142
108
|
if (!messages || messages.length === 0) {
|
|
143
109
|
return;
|
|
144
110
|
}
|
|
145
|
-
// Get the model info from the last user message
|
|
146
111
|
let lastUserMessage;
|
|
147
112
|
for (let i = messages.length - 1; i >= 0; i--) {
|
|
148
113
|
if (messages[i].info.role === "user") {
|
|
@@ -151,38 +116,27 @@ export function createThinkingBlockValidatorHook() {
|
|
|
151
116
|
}
|
|
152
117
|
}
|
|
153
118
|
const modelID = lastUserMessage?.info?.modelID || "";
|
|
154
|
-
// Only process if extended thinking might be enabled
|
|
155
119
|
if (!isExtendedThinkingModel(modelID)) {
|
|
156
120
|
return;
|
|
157
121
|
}
|
|
158
|
-
// Process all assistant messages
|
|
159
122
|
let fixedCount = 0;
|
|
160
123
|
for (let i = 0; i < messages.length; i++) {
|
|
161
124
|
const msg = messages[i];
|
|
162
|
-
// Only check assistant messages
|
|
163
125
|
if (msg.info.role !== "assistant")
|
|
164
126
|
continue;
|
|
165
|
-
// Check if message has content parts but doesn't start with thinking
|
|
166
127
|
if (hasContentParts(msg.parts) && !startsWithThinkingBlock(msg.parts)) {
|
|
167
|
-
// Find thinking content from previous turns
|
|
168
128
|
const previousThinking = findPreviousThinkingContent(messages, i);
|
|
169
|
-
// Prepend thinking block with content from previous turn or placeholder
|
|
170
129
|
const thinkingContent = previousThinking || DEFAULT_THINKING_CONTENT;
|
|
171
130
|
prependThinkingBlock(msg, thinkingContent);
|
|
172
131
|
fixedCount++;
|
|
173
132
|
}
|
|
174
133
|
}
|
|
175
|
-
// Optional: Log validation results in development
|
|
176
134
|
if (fixedCount > 0 && process.env.DEBUG_THINKING_VALIDATOR) {
|
|
177
135
|
console.log(`[${HOOK_NAME}] Fixed ${fixedCount} message(s) by prepending thinking blocks`);
|
|
178
136
|
}
|
|
179
137
|
},
|
|
180
138
|
};
|
|
181
139
|
}
|
|
182
|
-
/**
|
|
183
|
-
* Validate all messages in a conversation
|
|
184
|
-
* Returns array of validation results
|
|
185
|
-
*/
|
|
186
140
|
export function validateMessages(messages, modelID) {
|
|
187
141
|
const results = [];
|
|
188
142
|
for (let i = 0; i < messages.length; i++) {
|
|
@@ -191,15 +145,12 @@ export function validateMessages(messages, modelID) {
|
|
|
191
145
|
}
|
|
192
146
|
return results;
|
|
193
147
|
}
|
|
194
|
-
/**
|
|
195
|
-
* Get statistics about validation results
|
|
196
|
-
*/
|
|
197
148
|
export function getValidationStats(results) {
|
|
198
149
|
return {
|
|
199
150
|
total: results.length,
|
|
200
|
-
valid: results.filter(r => r.valid && !r.fixed).length,
|
|
201
|
-
fixed: results.filter(r => r.fixed).length,
|
|
202
|
-
issues: results.filter(r => !r.valid).length
|
|
151
|
+
valid: results.filter((r) => r.valid && !r.fixed).length,
|
|
152
|
+
fixed: results.filter((r) => r.fixed).length,
|
|
153
|
+
issues: results.filter((r) => !r.valid).length,
|
|
203
154
|
};
|
|
204
155
|
}
|
|
205
156
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/thinking-block-validator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/thinking-block-validator/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,wBAAwB,EACxB,4BAA4B,EAC5B,SAAS,GACV,MAAM,gBAAgB,CAAC;AAExB,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAE/B,SAAS,iBAAiB,CAAC,IAAY;IACrC,OAAQ,kBAAwC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAClE,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAY;IACtC,OAAQ,mBAAyC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AAC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OAAO,CAAC,CAAC;QAClE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,OAA2B;IAM5D,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,MAAM;QACrB,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM;QACxD,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM;QAC5C,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM;KAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ultrawork State Management
|
|
3
|
+
*
|
|
4
|
+
* Manages persistent ultrawork mode state across sessions.
|
|
5
|
+
* When ultrawork is activated and todos remain incomplete,
|
|
6
|
+
* this module ensures the mode persists until all work is done.
|
|
7
|
+
*/
|
|
8
|
+
export interface UltraworkState {
|
|
9
|
+
/** Whether ultrawork mode is currently active */
|
|
10
|
+
active: boolean;
|
|
11
|
+
/** When ultrawork was activated */
|
|
12
|
+
started_at: string;
|
|
13
|
+
/** The original prompt that triggered ultrawork */
|
|
14
|
+
original_prompt: string;
|
|
15
|
+
/** Session ID the mode is bound to */
|
|
16
|
+
session_id?: string;
|
|
17
|
+
/** Number of times the mode has been reinforced (for metrics) */
|
|
18
|
+
reinforcement_count: number;
|
|
19
|
+
/** Last time the mode was checked/reinforced */
|
|
20
|
+
last_checked_at: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read Ultrawork state from disk (checks both local and global)
|
|
24
|
+
*/
|
|
25
|
+
export declare function readUltraworkState(directory?: string): UltraworkState | null;
|
|
26
|
+
/**
|
|
27
|
+
* Write Ultrawork state to disk (both local and global for redundancy)
|
|
28
|
+
*/
|
|
29
|
+
export declare function writeUltraworkState(state: UltraworkState, directory?: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Activate ultrawork mode
|
|
32
|
+
*/
|
|
33
|
+
export declare function activateUltrawork(prompt: string, sessionId?: string, directory?: string): boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Deactivate ultrawork mode
|
|
36
|
+
*/
|
|
37
|
+
export declare function deactivateUltrawork(directory?: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Increment reinforcement count (called when mode is reinforced on stop)
|
|
40
|
+
*/
|
|
41
|
+
export declare function incrementReinforcement(directory?: string): UltraworkState | null;
|
|
42
|
+
/**
|
|
43
|
+
* Check if ultrawork should be reinforced (active with pending todos)
|
|
44
|
+
*/
|
|
45
|
+
export declare function shouldReinforceUltrawork(sessionId?: string, directory?: string): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Get ultrawork persistence message for injection
|
|
48
|
+
*/
|
|
49
|
+
export declare function getUltraworkPersistenceMessage(state: UltraworkState): string;
|
|
50
|
+
/**
|
|
51
|
+
* Create an Ultrawork State hook instance
|
|
52
|
+
*/
|
|
53
|
+
export declare function createUltraworkStateHook(directory: string): {
|
|
54
|
+
activate: (prompt: string, sessionId?: string) => boolean;
|
|
55
|
+
deactivate: () => boolean;
|
|
56
|
+
getState: () => UltraworkState | null;
|
|
57
|
+
shouldReinforce: (sessionId?: string) => boolean;
|
|
58
|
+
incrementReinforcement: () => UltraworkState | null;
|
|
59
|
+
};
|
|
60
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/ultrawork-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,WAAW,cAA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5
|
+
* When ultrawork is activated and todos remain incomplete,
|
|
6
|
+
* this module ensures the mode persists until all work is done.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync, readFileSync, writeFileSync, mkdirSync, unlinkSync } from 'fs';
|
|
9
|
+
import { join } from 'path';
|
|
10
|
+
import { homedir } from 'os';
|
|
11
|
+
const DEFAULT_STATE = {
|
|
12
|
+
active: false,
|
|
13
|
+
started_at: '',
|
|
14
|
+
original_prompt: '',
|
|
15
|
+
reinforcement_count: 0,
|
|
16
|
+
last_checked_at: ''
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Get the state file path for Ultrawork
|
|
20
|
+
*/
|
|
21
|
+
function getStateFilePath(directory) {
|
|
22
|
+
const baseDir = directory || process.cwd();
|
|
23
|
+
const sisyphusDir = join(baseDir, '.sisyphus');
|
|
24
|
+
return join(sisyphusDir, 'ultrawork-state.json');
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get global state file path (for cross-session persistence)
|
|
28
|
+
*/
|
|
29
|
+
function getGlobalStateFilePath() {
|
|
30
|
+
return join(homedir(), '.claude', 'ultrawork-state.json');
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Ensure the .sisyphus directory exists
|
|
34
|
+
*/
|
|
35
|
+
function ensureStateDir(directory) {
|
|
36
|
+
const baseDir = directory || process.cwd();
|
|
37
|
+
const sisyphusDir = join(baseDir, '.sisyphus');
|
|
38
|
+
if (!existsSync(sisyphusDir)) {
|
|
39
|
+
mkdirSync(sisyphusDir, { recursive: true });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Ensure the ~/.claude directory exists
|
|
44
|
+
*/
|
|
45
|
+
function ensureGlobalStateDir() {
|
|
46
|
+
const claudeDir = join(homedir(), '.claude');
|
|
47
|
+
if (!existsSync(claudeDir)) {
|
|
48
|
+
mkdirSync(claudeDir, { recursive: true });
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Read Ultrawork state from disk (checks both local and global)
|
|
53
|
+
*/
|
|
54
|
+
export function readUltraworkState(directory) {
|
|
55
|
+
// Check local state first
|
|
56
|
+
const localStateFile = getStateFilePath(directory);
|
|
57
|
+
if (existsSync(localStateFile)) {
|
|
58
|
+
try {
|
|
59
|
+
const content = readFileSync(localStateFile, 'utf-8');
|
|
60
|
+
return JSON.parse(content);
|
|
61
|
+
}
|
|
62
|
+
catch {
|
|
63
|
+
// Fall through to global check
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
// Check global state
|
|
67
|
+
const globalStateFile = getGlobalStateFilePath();
|
|
68
|
+
if (existsSync(globalStateFile)) {
|
|
69
|
+
try {
|
|
70
|
+
const content = readFileSync(globalStateFile, 'utf-8');
|
|
71
|
+
return JSON.parse(content);
|
|
72
|
+
}
|
|
73
|
+
catch {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return null;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Write Ultrawork state to disk (both local and global for redundancy)
|
|
81
|
+
*/
|
|
82
|
+
export function writeUltraworkState(state, directory) {
|
|
83
|
+
try {
|
|
84
|
+
// Write to local .sisyphus
|
|
85
|
+
ensureStateDir(directory);
|
|
86
|
+
const localStateFile = getStateFilePath(directory);
|
|
87
|
+
writeFileSync(localStateFile, JSON.stringify(state, null, 2));
|
|
88
|
+
// Write to global ~/.claude for cross-session persistence
|
|
89
|
+
ensureGlobalStateDir();
|
|
90
|
+
const globalStateFile = getGlobalStateFilePath();
|
|
91
|
+
writeFileSync(globalStateFile, JSON.stringify(state, null, 2));
|
|
92
|
+
return true;
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Activate ultrawork mode
|
|
100
|
+
*/
|
|
101
|
+
export function activateUltrawork(prompt, sessionId, directory) {
|
|
102
|
+
const state = {
|
|
103
|
+
active: true,
|
|
104
|
+
started_at: new Date().toISOString(),
|
|
105
|
+
original_prompt: prompt,
|
|
106
|
+
session_id: sessionId,
|
|
107
|
+
reinforcement_count: 0,
|
|
108
|
+
last_checked_at: new Date().toISOString()
|
|
109
|
+
};
|
|
110
|
+
return writeUltraworkState(state, directory);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Deactivate ultrawork mode
|
|
114
|
+
*/
|
|
115
|
+
export function deactivateUltrawork(directory) {
|
|
116
|
+
// Remove local state
|
|
117
|
+
const localStateFile = getStateFilePath(directory);
|
|
118
|
+
if (existsSync(localStateFile)) {
|
|
119
|
+
try {
|
|
120
|
+
unlinkSync(localStateFile);
|
|
121
|
+
}
|
|
122
|
+
catch {
|
|
123
|
+
// Continue to global cleanup
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
// Remove global state
|
|
127
|
+
const globalStateFile = getGlobalStateFilePath();
|
|
128
|
+
if (existsSync(globalStateFile)) {
|
|
129
|
+
try {
|
|
130
|
+
unlinkSync(globalStateFile);
|
|
131
|
+
return true;
|
|
132
|
+
}
|
|
133
|
+
catch {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return true;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Increment reinforcement count (called when mode is reinforced on stop)
|
|
141
|
+
*/
|
|
142
|
+
export function incrementReinforcement(directory) {
|
|
143
|
+
const state = readUltraworkState(directory);
|
|
144
|
+
if (!state || !state.active) {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
state.reinforcement_count += 1;
|
|
148
|
+
state.last_checked_at = new Date().toISOString();
|
|
149
|
+
if (writeUltraworkState(state, directory)) {
|
|
150
|
+
return state;
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Check if ultrawork should be reinforced (active with pending todos)
|
|
156
|
+
*/
|
|
157
|
+
export function shouldReinforceUltrawork(sessionId, directory) {
|
|
158
|
+
const state = readUltraworkState(directory);
|
|
159
|
+
if (!state || !state.active) {
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
// If bound to a session, only reinforce for that session
|
|
163
|
+
if (state.session_id && sessionId && state.session_id !== sessionId) {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Get ultrawork persistence message for injection
|
|
170
|
+
*/
|
|
171
|
+
export function getUltraworkPersistenceMessage(state) {
|
|
172
|
+
return `<ultrawork-persistence>
|
|
173
|
+
|
|
174
|
+
[ULTRAWORK MODE STILL ACTIVE - Reinforcement #${state.reinforcement_count + 1}]
|
|
175
|
+
|
|
176
|
+
Your ultrawork session is NOT complete. Incomplete todos remain.
|
|
177
|
+
|
|
178
|
+
REMEMBER THE ULTRAWORK RULES:
|
|
179
|
+
- **PARALLEL**: Fire independent calls simultaneously - NEVER wait sequentially
|
|
180
|
+
- **BACKGROUND FIRST**: Use Task(run_in_background=true) for exploration (10+ concurrent)
|
|
181
|
+
- **TODO**: Track EVERY step. Mark complete IMMEDIATELY after each
|
|
182
|
+
- **VERIFY**: Check ALL requirements met before done
|
|
183
|
+
- **NO Premature Stopping**: ALL TODOs must be complete
|
|
184
|
+
|
|
185
|
+
Continue working on the next pending task. DO NOT STOP until all tasks are marked complete.
|
|
186
|
+
|
|
187
|
+
Original task: ${state.original_prompt}
|
|
188
|
+
|
|
189
|
+
</ultrawork-persistence>
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
`;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Create an Ultrawork State hook instance
|
|
197
|
+
*/
|
|
198
|
+
export function createUltraworkStateHook(directory) {
|
|
199
|
+
return {
|
|
200
|
+
activate: (prompt, sessionId) => activateUltrawork(prompt, sessionId, directory),
|
|
201
|
+
deactivate: () => deactivateUltrawork(directory),
|
|
202
|
+
getState: () => readUltraworkState(directory),
|
|
203
|
+
shouldReinforce: (sessionId) => shouldReinforceUltrawork(sessionId, directory),
|
|
204
|
+
incrementReinforcement: () => incrementReinforcement(directory)
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/ultrawork-state/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAiB7B,MAAM,aAAa,GAAmB;IACpC,MAAM,EAAE,KAAK;IACb,UAAU,EAAE,EAAE;IACd,eAAe,EAAE,EAAE;IACnB,mBAAmB,EAAE,CAAC;IACtB,eAAe,EAAE,EAAE;CACpB,CAAC;AAEF;;GAEG;AACH,SAAS,gBAAgB,CAAC,SAAkB;IAC1C,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,SAAS,sBAAsB;IAC7B,OAAO,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,sBAAsB,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAS,cAAc,CAAC,SAAkB;IACxC,MAAM,OAAO,GAAG,SAAS,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,IAAI,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAC/C,IAAI,CAAC,UAA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