oh-my-claude-sisyphus 1.0.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 +21 -0
- package/README.md +416 -0
- package/dist/agents/definitions.d.ts +48 -0
- package/dist/agents/definitions.d.ts.map +1 -0
- package/dist/agents/definitions.js +271 -0
- package/dist/agents/definitions.js.map +1 -0
- package/dist/agents/index.d.ts +5 -0
- package/dist/agents/index.d.ts.map +1 -0
- package/dist/agents/index.js +5 -0
- package/dist/agents/index.js.map +1 -0
- package/dist/cli/index.d.ts +13 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +280 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/config/index.d.ts +5 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +5 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/loader.d.ts +49 -0
- package/dist/config/loader.d.ts.map +1 -0
- package/dist/config/loader.js +329 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/features/continuation-enforcement.d.ts +34 -0
- package/dist/features/continuation-enforcement.d.ts.map +1 -0
- package/dist/features/continuation-enforcement.js +142 -0
- package/dist/features/continuation-enforcement.js.map +1 -0
- package/dist/features/index.d.ts +6 -0
- package/dist/features/index.d.ts.map +1 -0
- package/dist/features/index.js +6 -0
- package/dist/features/index.js.map +1 -0
- package/dist/features/magic-keywords.d.ts +22 -0
- package/dist/features/magic-keywords.d.ts.map +1 -0
- package/dist/features/magic-keywords.js +189 -0
- package/dist/features/magic-keywords.js.map +1 -0
- package/dist/index.d.ts +105 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +146 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +6 -0
- package/dist/mcp/index.d.ts.map +1 -0
- package/dist/mcp/index.js +5 -0
- package/dist/mcp/index.js.map +1 -0
- package/dist/mcp/servers.d.ts +77 -0
- package/dist/mcp/servers.d.ts.map +1 -0
- package/dist/mcp/servers.js +122 -0
- package/dist/mcp/servers.js.map +1 -0
- package/dist/shared/index.d.ts +5 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +5 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/types.d.ts +133 -0
- package/dist/shared/types.d.ts.map +1 -0
- package/dist/shared/types.js +5 -0
- package/dist/shared/types.js.map +1 -0
- package/dist/tools/ast-tools.d.ts +63 -0
- package/dist/tools/ast-tools.d.ts.map +1 -0
- package/dist/tools/ast-tools.js +349 -0
- package/dist/tools/ast-tools.js.map +1 -0
- package/dist/tools/index.d.ts +52 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +120 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/lsp/client.d.ts +201 -0
- package/dist/tools/lsp/client.d.ts.map +1 -0
- package/dist/tools/lsp/client.js +454 -0
- package/dist/tools/lsp/client.js.map +1 -0
- package/dist/tools/lsp/index.d.ts +9 -0
- package/dist/tools/lsp/index.d.ts.map +1 -0
- package/dist/tools/lsp/index.js +7 -0
- package/dist/tools/lsp/index.js.map +1 -0
- package/dist/tools/lsp/servers.d.ts +37 -0
- package/dist/tools/lsp/servers.d.ts.map +1 -0
- package/dist/tools/lsp/servers.js +148 -0
- package/dist/tools/lsp/servers.js.map +1 -0
- package/dist/tools/lsp/utils.d.ts +58 -0
- package/dist/tools/lsp/utils.d.ts.map +1 -0
- package/dist/tools/lsp/utils.js +236 -0
- package/dist/tools/lsp/utils.js.map +1 -0
- package/dist/tools/lsp-tools.d.ts +151 -0
- package/dist/tools/lsp-tools.d.ts.map +1 -0
- package/dist/tools/lsp-tools.js +358 -0
- package/dist/tools/lsp-tools.js.map +1 -0
- package/package.json +75 -0
- package/scripts/install.sh +765 -0
- package/scripts/uninstall.sh +47 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Loader
|
|
3
|
+
*
|
|
4
|
+
* Handles loading and merging configuration from multiple sources:
|
|
5
|
+
* - User config: ~/.config/claude-sisyphus/config.jsonc
|
|
6
|
+
* - Project config: .claude/sisyphus.jsonc
|
|
7
|
+
* - Environment variables
|
|
8
|
+
*/
|
|
9
|
+
import type { PluginConfig } from '../shared/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Default configuration
|
|
12
|
+
*/
|
|
13
|
+
export declare const DEFAULT_CONFIG: PluginConfig;
|
|
14
|
+
/**
|
|
15
|
+
* Configuration file locations
|
|
16
|
+
*/
|
|
17
|
+
export declare function getConfigPaths(): {
|
|
18
|
+
user: string;
|
|
19
|
+
project: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Load and parse a JSONC file
|
|
23
|
+
*/
|
|
24
|
+
export declare function loadJsoncFile(path: string): PluginConfig | null;
|
|
25
|
+
/**
|
|
26
|
+
* Deep merge two objects
|
|
27
|
+
*/
|
|
28
|
+
export declare function deepMerge<T extends Record<string, unknown>>(target: T, source: Partial<T>): T;
|
|
29
|
+
/**
|
|
30
|
+
* Load configuration from environment variables
|
|
31
|
+
*/
|
|
32
|
+
export declare function loadEnvConfig(): Partial<PluginConfig>;
|
|
33
|
+
/**
|
|
34
|
+
* Load and merge all configuration sources
|
|
35
|
+
*/
|
|
36
|
+
export declare function loadConfig(): PluginConfig;
|
|
37
|
+
/**
|
|
38
|
+
* Find and load AGENTS.md or CLAUDE.md files for context injection
|
|
39
|
+
*/
|
|
40
|
+
export declare function findContextFiles(startDir?: string): string[];
|
|
41
|
+
/**
|
|
42
|
+
* Load context from AGENTS.md/CLAUDE.md files
|
|
43
|
+
*/
|
|
44
|
+
export declare function loadContextFromFiles(files: string[]): string;
|
|
45
|
+
/**
|
|
46
|
+
* Generate JSON Schema for configuration (for editor autocomplete)
|
|
47
|
+
*/
|
|
48
|
+
export declare function generateConfigSchema(): object;
|
|
49
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAMH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,cAAc,EAAE,YAuC5B,CAAC;AAEF;;GAEG;AACH,wBAAgB,cAAc,IAAI;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAOlE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI,CAsB/D;AAED;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CA0B7F;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,OAAO,CAAC,YAAY,CAAC,CAqCrD;AAED;;GAEG;AACH,wBAAgB,UAAU,IAAI,YAAY,CAuBzC;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAgC5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAa5D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CA2G7C"}
|
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration Loader
|
|
3
|
+
*
|
|
4
|
+
* Handles loading and merging configuration from multiple sources:
|
|
5
|
+
* - User config: ~/.config/claude-sisyphus/config.jsonc
|
|
6
|
+
* - Project config: .claude/sisyphus.jsonc
|
|
7
|
+
* - Environment variables
|
|
8
|
+
*/
|
|
9
|
+
import { readFileSync, existsSync } from 'fs';
|
|
10
|
+
import { homedir } from 'os';
|
|
11
|
+
import { join, dirname } from 'path';
|
|
12
|
+
import * as jsonc from 'jsonc-parser';
|
|
13
|
+
/**
|
|
14
|
+
* Default configuration
|
|
15
|
+
*/
|
|
16
|
+
export const DEFAULT_CONFIG = {
|
|
17
|
+
agents: {
|
|
18
|
+
sisyphus: { model: 'claude-opus-4-5-20251101' },
|
|
19
|
+
oracle: { model: 'claude-opus-4-5-20251101', enabled: true },
|
|
20
|
+
librarian: { model: 'claude-sonnet-4-5-20250929' },
|
|
21
|
+
explore: { model: 'claude-haiku-4-5-20251001' },
|
|
22
|
+
frontendEngineer: { model: 'claude-sonnet-4-5-20250929', enabled: true },
|
|
23
|
+
documentWriter: { model: 'claude-haiku-4-5-20251001', enabled: true },
|
|
24
|
+
multimodalLooker: { model: 'claude-sonnet-4-5-20250929', enabled: true },
|
|
25
|
+
// New agents from oh-my-opencode
|
|
26
|
+
momus: { model: 'claude-opus-4-5-20251101', enabled: true },
|
|
27
|
+
metis: { model: 'claude-opus-4-5-20251101', enabled: true },
|
|
28
|
+
orchestratorSisyphus: { model: 'claude-sonnet-4-5-20250929', enabled: true },
|
|
29
|
+
sisyphusJunior: { model: 'claude-sonnet-4-5-20250929', enabled: true },
|
|
30
|
+
prometheus: { model: 'claude-opus-4-5-20251101', enabled: true }
|
|
31
|
+
},
|
|
32
|
+
features: {
|
|
33
|
+
parallelExecution: true,
|
|
34
|
+
lspTools: true, // Real LSP integration with language servers
|
|
35
|
+
astTools: true, // Real AST tools using ast-grep
|
|
36
|
+
continuationEnforcement: true,
|
|
37
|
+
autoContextInjection: true
|
|
38
|
+
},
|
|
39
|
+
mcpServers: {
|
|
40
|
+
exa: { enabled: true },
|
|
41
|
+
context7: { enabled: true },
|
|
42
|
+
grepApp: { enabled: true }
|
|
43
|
+
},
|
|
44
|
+
permissions: {
|
|
45
|
+
allowBash: true,
|
|
46
|
+
allowEdit: true,
|
|
47
|
+
allowWrite: true,
|
|
48
|
+
maxBackgroundTasks: 5
|
|
49
|
+
},
|
|
50
|
+
magicKeywords: {
|
|
51
|
+
ultrawork: ['ultrawork', 'ulw', 'uw'],
|
|
52
|
+
search: ['search', 'find', 'locate'],
|
|
53
|
+
analyze: ['analyze', 'investigate', 'examine']
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Configuration file locations
|
|
58
|
+
*/
|
|
59
|
+
export function getConfigPaths() {
|
|
60
|
+
const userConfigDir = process.env.XDG_CONFIG_HOME ?? join(homedir(), '.config');
|
|
61
|
+
return {
|
|
62
|
+
user: join(userConfigDir, 'claude-sisyphus', 'config.jsonc'),
|
|
63
|
+
project: join(process.cwd(), '.claude', 'sisyphus.jsonc')
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Load and parse a JSONC file
|
|
68
|
+
*/
|
|
69
|
+
export function loadJsoncFile(path) {
|
|
70
|
+
if (!existsSync(path)) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
try {
|
|
74
|
+
const content = readFileSync(path, 'utf-8');
|
|
75
|
+
const errors = [];
|
|
76
|
+
const result = jsonc.parse(content, errors, {
|
|
77
|
+
allowTrailingComma: true,
|
|
78
|
+
allowEmptyContent: true
|
|
79
|
+
});
|
|
80
|
+
if (errors.length > 0) {
|
|
81
|
+
console.warn(`Warning: Parse errors in ${path}:`, errors);
|
|
82
|
+
}
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
console.error(`Error loading config from ${path}:`, error);
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Deep merge two objects
|
|
92
|
+
*/
|
|
93
|
+
export function deepMerge(target, source) {
|
|
94
|
+
const result = { ...target };
|
|
95
|
+
for (const key of Object.keys(source)) {
|
|
96
|
+
const sourceValue = source[key];
|
|
97
|
+
const targetValue = result[key];
|
|
98
|
+
if (sourceValue !== undefined &&
|
|
99
|
+
typeof sourceValue === 'object' &&
|
|
100
|
+
sourceValue !== null &&
|
|
101
|
+
!Array.isArray(sourceValue) &&
|
|
102
|
+
typeof targetValue === 'object' &&
|
|
103
|
+
targetValue !== null &&
|
|
104
|
+
!Array.isArray(targetValue)) {
|
|
105
|
+
result[key] = deepMerge(targetValue, sourceValue);
|
|
106
|
+
}
|
|
107
|
+
else if (sourceValue !== undefined) {
|
|
108
|
+
result[key] = sourceValue;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return result;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Load configuration from environment variables
|
|
115
|
+
*/
|
|
116
|
+
export function loadEnvConfig() {
|
|
117
|
+
const config = {};
|
|
118
|
+
// MCP API keys
|
|
119
|
+
if (process.env.EXA_API_KEY) {
|
|
120
|
+
config.mcpServers = {
|
|
121
|
+
...config.mcpServers,
|
|
122
|
+
exa: { enabled: true, apiKey: process.env.EXA_API_KEY }
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
// Feature flags from environment
|
|
126
|
+
if (process.env.SISYPHUS_PARALLEL_EXECUTION !== undefined) {
|
|
127
|
+
config.features = {
|
|
128
|
+
...config.features,
|
|
129
|
+
parallelExecution: process.env.SISYPHUS_PARALLEL_EXECUTION === 'true'
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
if (process.env.SISYPHUS_LSP_TOOLS !== undefined) {
|
|
133
|
+
config.features = {
|
|
134
|
+
...config.features,
|
|
135
|
+
lspTools: process.env.SISYPHUS_LSP_TOOLS === 'true'
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
if (process.env.SISYPHUS_MAX_BACKGROUND_TASKS) {
|
|
139
|
+
const maxTasks = parseInt(process.env.SISYPHUS_MAX_BACKGROUND_TASKS, 10);
|
|
140
|
+
if (!isNaN(maxTasks)) {
|
|
141
|
+
config.permissions = {
|
|
142
|
+
...config.permissions,
|
|
143
|
+
maxBackgroundTasks: maxTasks
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
return config;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Load and merge all configuration sources
|
|
151
|
+
*/
|
|
152
|
+
export function loadConfig() {
|
|
153
|
+
const paths = getConfigPaths();
|
|
154
|
+
// Start with defaults
|
|
155
|
+
let config = { ...DEFAULT_CONFIG };
|
|
156
|
+
// Merge user config
|
|
157
|
+
const userConfig = loadJsoncFile(paths.user);
|
|
158
|
+
if (userConfig) {
|
|
159
|
+
config = deepMerge(config, userConfig);
|
|
160
|
+
}
|
|
161
|
+
// Merge project config (takes precedence over user)
|
|
162
|
+
const projectConfig = loadJsoncFile(paths.project);
|
|
163
|
+
if (projectConfig) {
|
|
164
|
+
config = deepMerge(config, projectConfig);
|
|
165
|
+
}
|
|
166
|
+
// Merge environment variables (highest precedence)
|
|
167
|
+
const envConfig = loadEnvConfig();
|
|
168
|
+
config = deepMerge(config, envConfig);
|
|
169
|
+
return config;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Find and load AGENTS.md or CLAUDE.md files for context injection
|
|
173
|
+
*/
|
|
174
|
+
export function findContextFiles(startDir) {
|
|
175
|
+
const files = [];
|
|
176
|
+
const searchDir = startDir ?? process.cwd();
|
|
177
|
+
// Files to look for
|
|
178
|
+
const contextFileNames = [
|
|
179
|
+
'AGENTS.md',
|
|
180
|
+
'CLAUDE.md',
|
|
181
|
+
'.claude/CLAUDE.md',
|
|
182
|
+
'.claude/AGENTS.md'
|
|
183
|
+
];
|
|
184
|
+
// Search in current directory and parent directories
|
|
185
|
+
let currentDir = searchDir;
|
|
186
|
+
const searchedDirs = new Set();
|
|
187
|
+
while (currentDir && !searchedDirs.has(currentDir)) {
|
|
188
|
+
searchedDirs.add(currentDir);
|
|
189
|
+
for (const fileName of contextFileNames) {
|
|
190
|
+
const filePath = join(currentDir, fileName);
|
|
191
|
+
if (existsSync(filePath) && !files.includes(filePath)) {
|
|
192
|
+
files.push(filePath);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
const parentDir = dirname(currentDir);
|
|
196
|
+
if (parentDir === currentDir)
|
|
197
|
+
break;
|
|
198
|
+
currentDir = parentDir;
|
|
199
|
+
}
|
|
200
|
+
return files;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Load context from AGENTS.md/CLAUDE.md files
|
|
204
|
+
*/
|
|
205
|
+
export function loadContextFromFiles(files) {
|
|
206
|
+
const contexts = [];
|
|
207
|
+
for (const file of files) {
|
|
208
|
+
try {
|
|
209
|
+
const content = readFileSync(file, 'utf-8');
|
|
210
|
+
contexts.push(`## Context from ${file}\n\n${content}`);
|
|
211
|
+
}
|
|
212
|
+
catch (error) {
|
|
213
|
+
console.warn(`Warning: Could not read context file ${file}:`, error);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
return contexts.join('\n\n---\n\n');
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Generate JSON Schema for configuration (for editor autocomplete)
|
|
220
|
+
*/
|
|
221
|
+
export function generateConfigSchema() {
|
|
222
|
+
return {
|
|
223
|
+
$schema: 'http://json-schema.org/draft-07/schema#',
|
|
224
|
+
title: 'Oh-My-Claude-Sisyphus Configuration',
|
|
225
|
+
type: 'object',
|
|
226
|
+
properties: {
|
|
227
|
+
agents: {
|
|
228
|
+
type: 'object',
|
|
229
|
+
description: 'Agent model and feature configuration',
|
|
230
|
+
properties: {
|
|
231
|
+
sisyphus: {
|
|
232
|
+
type: 'object',
|
|
233
|
+
properties: {
|
|
234
|
+
model: { type: 'string', description: 'Model ID for the main orchestrator' }
|
|
235
|
+
}
|
|
236
|
+
},
|
|
237
|
+
oracle: {
|
|
238
|
+
type: 'object',
|
|
239
|
+
properties: {
|
|
240
|
+
model: { type: 'string' },
|
|
241
|
+
enabled: { type: 'boolean' }
|
|
242
|
+
}
|
|
243
|
+
},
|
|
244
|
+
librarian: {
|
|
245
|
+
type: 'object',
|
|
246
|
+
properties: { model: { type: 'string' } }
|
|
247
|
+
},
|
|
248
|
+
explore: {
|
|
249
|
+
type: 'object',
|
|
250
|
+
properties: { model: { type: 'string' } }
|
|
251
|
+
},
|
|
252
|
+
frontendEngineer: {
|
|
253
|
+
type: 'object',
|
|
254
|
+
properties: {
|
|
255
|
+
model: { type: 'string' },
|
|
256
|
+
enabled: { type: 'boolean' }
|
|
257
|
+
}
|
|
258
|
+
},
|
|
259
|
+
documentWriter: {
|
|
260
|
+
type: 'object',
|
|
261
|
+
properties: {
|
|
262
|
+
model: { type: 'string' },
|
|
263
|
+
enabled: { type: 'boolean' }
|
|
264
|
+
}
|
|
265
|
+
},
|
|
266
|
+
multimodalLooker: {
|
|
267
|
+
type: 'object',
|
|
268
|
+
properties: {
|
|
269
|
+
model: { type: 'string' },
|
|
270
|
+
enabled: { type: 'boolean' }
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
},
|
|
275
|
+
features: {
|
|
276
|
+
type: 'object',
|
|
277
|
+
description: 'Feature toggles',
|
|
278
|
+
properties: {
|
|
279
|
+
parallelExecution: { type: 'boolean', default: true },
|
|
280
|
+
lspTools: { type: 'boolean', default: true },
|
|
281
|
+
astTools: { type: 'boolean', default: true },
|
|
282
|
+
continuationEnforcement: { type: 'boolean', default: true },
|
|
283
|
+
autoContextInjection: { type: 'boolean', default: true }
|
|
284
|
+
}
|
|
285
|
+
},
|
|
286
|
+
mcpServers: {
|
|
287
|
+
type: 'object',
|
|
288
|
+
description: 'MCP server configurations',
|
|
289
|
+
properties: {
|
|
290
|
+
exa: {
|
|
291
|
+
type: 'object',
|
|
292
|
+
properties: {
|
|
293
|
+
enabled: { type: 'boolean' },
|
|
294
|
+
apiKey: { type: 'string' }
|
|
295
|
+
}
|
|
296
|
+
},
|
|
297
|
+
context7: {
|
|
298
|
+
type: 'object',
|
|
299
|
+
properties: { enabled: { type: 'boolean' } }
|
|
300
|
+
},
|
|
301
|
+
grepApp: {
|
|
302
|
+
type: 'object',
|
|
303
|
+
properties: { enabled: { type: 'boolean' } }
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
},
|
|
307
|
+
permissions: {
|
|
308
|
+
type: 'object',
|
|
309
|
+
description: 'Permission settings',
|
|
310
|
+
properties: {
|
|
311
|
+
allowBash: { type: 'boolean', default: true },
|
|
312
|
+
allowEdit: { type: 'boolean', default: true },
|
|
313
|
+
allowWrite: { type: 'boolean', default: true },
|
|
314
|
+
maxBackgroundTasks: { type: 'integer', default: 5, minimum: 1, maximum: 20 }
|
|
315
|
+
}
|
|
316
|
+
},
|
|
317
|
+
magicKeywords: {
|
|
318
|
+
type: 'object',
|
|
319
|
+
description: 'Magic keyword triggers',
|
|
320
|
+
properties: {
|
|
321
|
+
ultrawork: { type: 'array', items: { type: 'string' } },
|
|
322
|
+
search: { type: 'array', items: { type: 'string' } },
|
|
323
|
+
analyze: { type: 'array', items: { type: 'string' } }
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loader.js","sourceRoot":"","sources":["../../src/config/loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AAGtC;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAiB;IAC1C,MAAM,EAAE;QACN,QAAQ,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE;QAC/C,MAAM,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,OAAO,EAAE,IAAI,EAAE;QAC5D,SAAS,EAAE,EAAE,KAAK,EAAE,4BAA4B,EAAE;QAClD,OAAO,EAAE,EAAE,KA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|
6
|
+
* - Adds reminders to continue when tasks remain
|
|
7
|
+
* - Prevents premature stopping
|
|
8
|
+
*/
|
|
9
|
+
import type { HookDefinition } from '../shared/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* Create a continuation enforcement hook
|
|
12
|
+
*
|
|
13
|
+
* This hook intercepts stop attempts and checks if there are
|
|
14
|
+
* incomplete tasks. If so, it blocks the stop and reminds
|
|
15
|
+
* the agent to continue.
|
|
16
|
+
*/
|
|
17
|
+
export declare function createContinuationHook(): HookDefinition;
|
|
18
|
+
/**
|
|
19
|
+
* System prompt addition for continuation enforcement
|
|
20
|
+
*/
|
|
21
|
+
export declare const continuationSystemPromptAddition = "\n## Continuation Enforcement\n\nCRITICAL RULES - You MUST follow these:\n\n1. **Never Stop with Incomplete Work**\n - Before stopping, verify ALL tasks in your todo list are complete\n - Check that all requested features are implemented\n - Ensure tests pass (if applicable)\n - Verify no error messages remain unaddressed\n\n2. **Task Completion Verification**\n - Mark tasks complete ONLY when fully done\n - If blocked, create a new task describing the blocker\n - If a task fails, don't mark it complete - fix it\n\n3. **Quality Gates**\n - Code compiles/runs without errors\n - All requested functionality works\n - No obvious bugs or issues remain\n\n4. **When to Stop**\n You may ONLY stop when:\n - All tasks in the todo list are marked complete\n - User explicitly says \"stop\" or \"that's enough\"\n - You've verified the work meets requirements\n\n5. **If Uncertain**\n - Ask the user for clarification\n - Create a verification task\n - Continue investigating rather than stopping prematurely\n";
|
|
22
|
+
/**
|
|
23
|
+
* Check prompt for signals that all work is done
|
|
24
|
+
*/
|
|
25
|
+
export declare function detectCompletionSignals(response: string): {
|
|
26
|
+
claimed: boolean;
|
|
27
|
+
confidence: 'high' | 'medium' | 'low';
|
|
28
|
+
reason: string;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Generate a verification prompt to ensure work is complete
|
|
32
|
+
*/
|
|
33
|
+
export declare function generateVerificationPrompt(taskSummary: string): string;
|
|
34
|
+
//# sourceMappingURL=continuation-enforcement.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-enforcement.d.ts","sourceRoot":"","sources":["../../src/features/continuation-enforcement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,cAAc,EAA2B,MAAM,oBAAoB,CAAC;AAoBlF;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,cAAc,CA2BvD;AAED;;GAEG;AACH,eAAO,MAAM,gCAAgC,uhCA+B5C,CAAC;AAEF;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,QAAQ,EAAE,MAAM,GAAG;IACzD,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,MAAM,GAAG,QAAQ,GAAG,KAAK,CAAC;IACtC,MAAM,EAAE,MAAM,CAAC;CAChB,CAsCA;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAUtE"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Continuation Enforcement Feature
|
|
3
|
+
*
|
|
4
|
+
* Ensures agents complete all tasks before stopping:
|
|
5
|
+
* - Monitors todo list for incomplete items
|
|
6
|
+
* - Adds reminders to continue when tasks remain
|
|
7
|
+
* - Prevents premature stopping
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Messages to remind agents to continue
|
|
11
|
+
*/
|
|
12
|
+
const CONTINUATION_REMINDERS = [
|
|
13
|
+
'You have incomplete tasks remaining. Please continue working until all tasks are complete.',
|
|
14
|
+
'There are still pending items in your task list. Do not stop until everything is done.',
|
|
15
|
+
'REMINDER: Check your todo list - you still have work to do.',
|
|
16
|
+
'Continue working - some tasks are still incomplete.',
|
|
17
|
+
'Please verify all tasks are complete before stopping.'
|
|
18
|
+
];
|
|
19
|
+
/**
|
|
20
|
+
* Get a random continuation reminder
|
|
21
|
+
*/
|
|
22
|
+
function getRandomReminder() {
|
|
23
|
+
return CONTINUATION_REMINDERS[Math.floor(Math.random() * CONTINUATION_REMINDERS.length)];
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Create a continuation enforcement hook
|
|
27
|
+
*
|
|
28
|
+
* This hook intercepts stop attempts and checks if there are
|
|
29
|
+
* incomplete tasks. If so, it blocks the stop and reminds
|
|
30
|
+
* the agent to continue.
|
|
31
|
+
*/
|
|
32
|
+
export function createContinuationHook() {
|
|
33
|
+
return {
|
|
34
|
+
event: 'Stop',
|
|
35
|
+
handler: async (context) => {
|
|
36
|
+
// In a real implementation, this would check the actual todo state
|
|
37
|
+
// For now, we'll provide the structure for integration
|
|
38
|
+
// The hook would examine:
|
|
39
|
+
// 1. The current todo list state
|
|
40
|
+
// 2. Any explicitly stated completion criteria
|
|
41
|
+
// 3. The conversation history for incomplete work
|
|
42
|
+
// Placeholder logic - in practice, integrate with actual todo tracking
|
|
43
|
+
const hasIncompleteTasks = false; // Would be dynamically determined
|
|
44
|
+
if (hasIncompleteTasks) {
|
|
45
|
+
return {
|
|
46
|
+
continue: false,
|
|
47
|
+
message: getRandomReminder()
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return {
|
|
51
|
+
continue: true
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* System prompt addition for continuation enforcement
|
|
58
|
+
*/
|
|
59
|
+
export const continuationSystemPromptAddition = `
|
|
60
|
+
## Continuation Enforcement
|
|
61
|
+
|
|
62
|
+
CRITICAL RULES - You MUST follow these:
|
|
63
|
+
|
|
64
|
+
1. **Never Stop with Incomplete Work**
|
|
65
|
+
- Before stopping, verify ALL tasks in your todo list are complete
|
|
66
|
+
- Check that all requested features are implemented
|
|
67
|
+
- Ensure tests pass (if applicable)
|
|
68
|
+
- Verify no error messages remain unaddressed
|
|
69
|
+
|
|
70
|
+
2. **Task Completion Verification**
|
|
71
|
+
- Mark tasks complete ONLY when fully done
|
|
72
|
+
- If blocked, create a new task describing the blocker
|
|
73
|
+
- If a task fails, don't mark it complete - fix it
|
|
74
|
+
|
|
75
|
+
3. **Quality Gates**
|
|
76
|
+
- Code compiles/runs without errors
|
|
77
|
+
- All requested functionality works
|
|
78
|
+
- No obvious bugs or issues remain
|
|
79
|
+
|
|
80
|
+
4. **When to Stop**
|
|
81
|
+
You may ONLY stop when:
|
|
82
|
+
- All tasks in the todo list are marked complete
|
|
83
|
+
- User explicitly says "stop" or "that's enough"
|
|
84
|
+
- You've verified the work meets requirements
|
|
85
|
+
|
|
86
|
+
5. **If Uncertain**
|
|
87
|
+
- Ask the user for clarification
|
|
88
|
+
- Create a verification task
|
|
89
|
+
- Continue investigating rather than stopping prematurely
|
|
90
|
+
`;
|
|
91
|
+
/**
|
|
92
|
+
* Check prompt for signals that all work is done
|
|
93
|
+
*/
|
|
94
|
+
export function detectCompletionSignals(response) {
|
|
95
|
+
const completionPatterns = [
|
|
96
|
+
/all (?:tasks?|work|items?) (?:are |is )?(?:now )?(?:complete|done|finished)/i,
|
|
97
|
+
/I(?:'ve| have) (?:completed|finished|done) (?:all|everything)/i,
|
|
98
|
+
/everything (?:is|has been) (?:complete|done|finished)/i,
|
|
99
|
+
/no (?:more|remaining|outstanding) (?:tasks?|work|items?)/i
|
|
100
|
+
];
|
|
101
|
+
const uncertaintyPatterns = [
|
|
102
|
+
/(?:should|might|could) (?:be|have)/i,
|
|
103
|
+
/I think|I believe|probably|maybe/i,
|
|
104
|
+
/unless|except|but/i
|
|
105
|
+
];
|
|
106
|
+
const hasCompletion = completionPatterns.some(p => p.test(response));
|
|
107
|
+
const hasUncertainty = uncertaintyPatterns.some(p => p.test(response));
|
|
108
|
+
if (!hasCompletion) {
|
|
109
|
+
return {
|
|
110
|
+
claimed: false,
|
|
111
|
+
confidence: 'high',
|
|
112
|
+
reason: 'No completion claim detected'
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (hasUncertainty) {
|
|
116
|
+
return {
|
|
117
|
+
claimed: true,
|
|
118
|
+
confidence: 'low',
|
|
119
|
+
reason: 'Completion claimed with uncertainty language'
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
claimed: true,
|
|
124
|
+
confidence: 'high',
|
|
125
|
+
reason: 'Clear completion claim detected'
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Generate a verification prompt to ensure work is complete
|
|
130
|
+
*/
|
|
131
|
+
export function generateVerificationPrompt(taskSummary) {
|
|
132
|
+
return `Before concluding, please verify the following:
|
|
133
|
+
|
|
134
|
+
1. Review your todo list - are ALL items marked complete?
|
|
135
|
+
2. Have you addressed: ${taskSummary}
|
|
136
|
+
3. Are there any errors or issues remaining?
|
|
137
|
+
4. Does the implementation meet the original requirements?
|
|
138
|
+
|
|
139
|
+
If everything is truly complete, confirm by saying "All tasks verified complete."
|
|
140
|
+
If anything remains, continue working on it.`;
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=continuation-enforcement.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"continuation-enforcement.js","sourceRoot":"","sources":["../../src/features/continuation-enforcement.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH;;GAEG;AACH,MAAM,sBAAsB,GAAG;IAC7B,4FAA4F;IAC5F,wFAAwF;IACxF,6DAA6D;IAC7D,qDAAqD;IACrD,uDAAuD;CACxD,CAAC;AAEF;;GAEG;AACH,SAAS,iBAAiB;IACxB,OAAO,sBAAsB,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,sBAAsB,CAAC,MAAM,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,sBAAsB;IACpC,OAAO;QACL,KAAK,EAAE,MAAM;QACb,OAAO,EAAE,KAAK,EAAE,OAAoB,EAAuB,EAAE;YAC3D,mEAAmE;YACnE,uDAAuD;YAEvD,0BAA0B;YAC1B,iCAA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AM;QAClB,MAAM,EAAE,iCAAiC;KAC1C,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,WAAmB;IAC5D,OAAO;;;yBAGgB,WAAW;;;;;6CAKS,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features Module Exports
|
|
3
|
+
*/
|
|
4
|
+
export { createMagicKeywordProcessor, detectMagicKeywords, builtInMagicKeywords } from './magic-keywords.js';
|
|
5
|
+
export { createContinuationHook, continuationSystemPromptAddition, detectCompletionSignals, generateVerificationPrompt } from './continuation-enforcement.js';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Features Module Exports
|
|
3
|
+
*/
|
|
4
|
+
export { createMagicKeywordProcessor, detectMagicKeywords, builtInMagicKeywords } from './magic-keywords.js';
|
|
5
|
+
export { createContinuationHook, continuationSystemPromptAddition, detectCompletionSignals, generateVerificationPrompt } from './continuation-enforcement.js';
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/features/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EACL,2BAA2B,EAC3B,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EACL,sBAAsB,EACtB,gCAAgC,EAChC,uBAAuB,EACvB,0BAA0B,EAC3B,MAAM,+BAA+B,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Magic Keywords Feature
|
|
3
|
+
*
|
|
4
|
+
* Detects special keywords in prompts and activates enhanced behaviors:
|
|
5
|
+
* - ultrawork/ulw: Maximum performance mode with parallel orchestration
|
|
6
|
+
* - search/find: Maximized search effort
|
|
7
|
+
* - analyze/investigate: Deep analysis mode
|
|
8
|
+
*/
|
|
9
|
+
import type { MagicKeyword, PluginConfig } from '../shared/types.js';
|
|
10
|
+
/**
|
|
11
|
+
* All built-in magic keyword definitions
|
|
12
|
+
*/
|
|
13
|
+
export declare const builtInMagicKeywords: MagicKeyword[];
|
|
14
|
+
/**
|
|
15
|
+
* Create a magic keyword processor with custom triggers
|
|
16
|
+
*/
|
|
17
|
+
export declare function createMagicKeywordProcessor(config?: PluginConfig['magicKeywords']): (prompt: string) => string;
|
|
18
|
+
/**
|
|
19
|
+
* Check if a prompt contains any magic keywords
|
|
20
|
+
*/
|
|
21
|
+
export declare function detectMagicKeywords(prompt: string, config?: PluginConfig['magicKeywords']): string[];
|
|
22
|
+
//# sourceMappingURL=magic-keywords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"magic-keywords.d.ts","sourceRoot":"","sources":["../../src/features/magic-keywords.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AA4GrE;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,YAAY,EAI9C,CAAC;AAEF;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAyC9G;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,YAAY,CAAC,eAAe,CAAC,GAAG,MAAM,EAAE,CA+BpG"}
|