oh-my-claude-sisyphus 3.0.11 → 3.2.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/README.md +26 -2
- package/agents/build-fixer-low.md +83 -0
- package/agents/build-fixer.md +160 -0
- package/agents/code-reviewer-low.md +82 -0
- package/agents/code-reviewer.md +115 -0
- package/agents/planner.md +83 -0
- package/agents/security-reviewer-low.md +83 -0
- package/agents/security-reviewer.md +186 -0
- package/agents/tdd-guide-low.md +81 -0
- package/agents/tdd-guide.md +165 -0
- package/commands/autopilot.md +131 -0
- package/commands/build-fix.md +55 -0
- package/commands/cancel-autopilot.md +35 -0
- package/commands/code-review.md +47 -0
- package/commands/ralph.md +9 -0
- package/commands/security-review.md +47 -0
- package/commands/tdd.md +54 -0
- package/dist/__tests__/hud-agents.test.js +13 -10
- package/dist/__tests__/hud-agents.test.js.map +1 -1
- package/dist/__tests__/installer.test.js +1 -1
- package/dist/__tests__/skills.test.js +8 -4
- package/dist/__tests__/skills.test.js.map +1 -1
- package/dist/agents/definitions.d.ts +32 -0
- package/dist/agents/definitions.d.ts.map +1 -1
- package/dist/agents/definitions.js +93 -1
- package/dist/agents/definitions.js.map +1 -1
- package/dist/agents/delegation-validator.d.ts +31 -0
- package/dist/agents/delegation-validator.d.ts.map +1 -0
- package/dist/agents/delegation-validator.js +75 -0
- package/dist/agents/delegation-validator.js.map +1 -0
- package/dist/agents/prompt-generator.d.ts +95 -0
- package/dist/agents/prompt-generator.d.ts.map +1 -0
- package/dist/agents/prompt-generator.js +140 -0
- package/dist/agents/prompt-generator.js.map +1 -0
- package/dist/agents/prompt-sections/index.d.ts +44 -0
- package/dist/agents/prompt-sections/index.d.ts.map +1 -0
- package/dist/agents/prompt-sections/index.js +194 -0
- package/dist/agents/prompt-sections/index.js.map +1 -0
- package/dist/agents/types.d.ts +2 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/types.js.map +1 -1
- package/dist/features/background-agent/manager.d.ts +10 -1
- package/dist/features/background-agent/manager.d.ts.map +1 -1
- package/dist/features/background-agent/manager.js +79 -11
- package/dist/features/background-agent/manager.js.map +1 -1
- package/dist/features/background-agent/types.d.ts +30 -1
- package/dist/features/background-agent/types.d.ts.map +1 -1
- package/dist/features/delegation-categories/index.d.ts +116 -0
- package/dist/features/delegation-categories/index.d.ts.map +1 -0
- package/dist/features/delegation-categories/index.js +287 -0
- package/dist/features/delegation-categories/index.js.map +1 -0
- package/dist/features/delegation-categories/test-categories.d.ts +7 -0
- package/dist/features/delegation-categories/test-categories.d.ts.map +1 -0
- package/dist/features/delegation-categories/test-categories.js +88 -0
- package/dist/features/delegation-categories/test-categories.js.map +1 -0
- package/dist/features/delegation-categories/types.d.ts +51 -0
- package/dist/features/delegation-categories/types.d.ts.map +1 -0
- package/dist/features/delegation-categories/types.js +8 -0
- package/dist/features/delegation-categories/types.js.map +1 -0
- package/dist/features/index.d.ts +2 -0
- package/dist/features/index.d.ts.map +1 -1
- package/dist/features/index.js +10 -0
- package/dist/features/index.js.map +1 -1
- package/dist/features/model-routing/prompts/index.d.ts +2 -0
- package/dist/features/model-routing/prompts/index.d.ts.map +1 -1
- package/dist/features/model-routing/prompts/index.js +6 -0
- package/dist/features/model-routing/prompts/index.js.map +1 -1
- package/dist/features/notepad-wisdom/extractor.d.ts +30 -0
- package/dist/features/notepad-wisdom/extractor.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/extractor.js +68 -0
- package/dist/features/notepad-wisdom/extractor.js.map +1 -0
- package/dist/features/notepad-wisdom/index.d.ts +39 -0
- package/dist/features/notepad-wisdom/index.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/index.js +169 -0
- package/dist/features/notepad-wisdom/index.js.map +1 -0
- package/dist/features/notepad-wisdom/types.d.ts +18 -0
- package/dist/features/notepad-wisdom/types.d.ts.map +1 -0
- package/dist/features/notepad-wisdom/types.js +7 -0
- package/dist/features/notepad-wisdom/types.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.js +397 -0
- package/dist/hooks/autopilot/__tests__/cancel.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.js +74 -0
- package/dist/hooks/autopilot/__tests__/prompts.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/state.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/state.test.js +75 -0
- package/dist/hooks/autopilot/__tests__/state.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/summary.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/summary.test.js +289 -0
- package/dist/hooks/autopilot/__tests__/summary.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/transition.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/transition.test.js +59 -0
- package/dist/hooks/autopilot/__tests__/transition.test.js.map +1 -0
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts +2 -0
- package/dist/hooks/autopilot/__tests__/validation.test.d.ts.map +1 -0
- package/dist/hooks/autopilot/__tests__/validation.test.js +450 -0
- package/dist/hooks/autopilot/__tests__/validation.test.js.map +1 -0
- package/dist/hooks/autopilot/cancel.d.ts +42 -0
- package/dist/hooks/autopilot/cancel.d.ts.map +1 -0
- package/dist/hooks/autopilot/cancel.js +156 -0
- package/dist/hooks/autopilot/cancel.js.map +1 -0
- package/dist/hooks/autopilot/index.d.ts +15 -0
- package/dist/hooks/autopilot/index.d.ts.map +1 -0
- package/dist/hooks/autopilot/index.js +20 -0
- package/dist/hooks/autopilot/index.js.map +1 -0
- package/dist/hooks/autopilot/prompts.d.ts +37 -0
- package/dist/hooks/autopilot/prompts.d.ts.map +1 -0
- package/dist/hooks/autopilot/prompts.js +353 -0
- package/dist/hooks/autopilot/prompts.js.map +1 -0
- package/dist/hooks/autopilot/state.d.ts +67 -0
- package/dist/hooks/autopilot/state.d.ts.map +1 -0
- package/dist/hooks/autopilot/state.js +244 -0
- package/dist/hooks/autopilot/state.js.map +1 -0
- package/dist/hooks/autopilot/summary.d.ts +27 -0
- package/dist/hooks/autopilot/summary.d.ts.map +1 -0
- package/dist/hooks/autopilot/summary.js +160 -0
- package/dist/hooks/autopilot/summary.js.map +1 -0
- package/dist/hooks/autopilot/transition.d.ts +39 -0
- package/dist/hooks/autopilot/transition.d.ts.map +1 -0
- package/dist/hooks/autopilot/transition.js +216 -0
- package/dist/hooks/autopilot/transition.js.map +1 -0
- package/dist/hooks/autopilot/types.d.ts +211 -0
- package/dist/hooks/autopilot/types.d.ts.map +1 -0
- package/dist/hooks/autopilot/types.js +30 -0
- package/dist/hooks/autopilot/types.js.map +1 -0
- package/dist/hooks/autopilot/validation.d.ts +43 -0
- package/dist/hooks/autopilot/validation.d.ts.map +1 -0
- package/dist/hooks/autopilot/validation.js +191 -0
- package/dist/hooks/autopilot/validation.js.map +1 -0
- package/dist/hooks/bridge.d.ts +1 -1
- package/dist/hooks/bridge.d.ts.map +1 -1
- package/dist/hooks/bridge.js +79 -6
- package/dist/hooks/bridge.js.map +1 -1
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/keyword-detector/index.d.ts +1 -1
- package/dist/hooks/keyword-detector/index.d.ts.map +1 -1
- package/dist/hooks/keyword-detector/index.js +39 -2
- package/dist/hooks/keyword-detector/index.js.map +1 -1
- package/dist/hooks/persistent-mode/index.d.ts +2 -1
- package/dist/hooks/persistent-mode/index.d.ts.map +1 -1
- package/dist/hooks/persistent-mode/index.js +13 -3
- package/dist/hooks/persistent-mode/index.js.map +1 -1
- package/dist/hooks/ralph-loop/index.d.ts +0 -20
- package/dist/hooks/ralph-loop/index.d.ts.map +1 -1
- package/dist/hooks/ralph-loop/index.js +6 -40
- package/dist/hooks/ralph-loop/index.js.map +1 -1
- package/dist/hooks/todo-continuation/index.d.ts +31 -1
- package/dist/hooks/todo-continuation/index.d.ts.map +1 -1
- package/dist/hooks/todo-continuation/index.js +38 -1
- package/dist/hooks/todo-continuation/index.js.map +1 -1
- package/dist/hooks/ultrawork-state/index.d.ts +3 -1
- package/dist/hooks/ultrawork-state/index.d.ts.map +1 -1
- package/dist/hooks/ultrawork-state/index.js +3 -2
- package/dist/hooks/ultrawork-state/index.js.map +1 -1
- package/dist/hud/elements/autopilot.d.ts +29 -0
- package/dist/hud/elements/autopilot.d.ts.map +1 -0
- package/dist/hud/elements/autopilot.js +97 -0
- package/dist/hud/elements/autopilot.js.map +1 -0
- package/dist/hud/elements/index.d.ts +1 -0
- package/dist/hud/elements/index.d.ts.map +1 -1
- package/dist/hud/elements/index.js +1 -0
- package/dist/hud/elements/index.js.map +1 -1
- package/dist/hud/elements/limits.d.ts +1 -1
- package/dist/hud/elements/limits.d.ts.map +1 -1
- package/dist/hud/elements/limits.js +35 -2
- package/dist/hud/elements/limits.js.map +1 -1
- package/dist/hud/elements/todos.d.ts +1 -1
- package/dist/hud/elements/todos.js +3 -3
- package/dist/hud/elements/todos.js.map +1 -1
- package/dist/hud/render.js +6 -6
- package/dist/hud/render.js.map +1 -1
- package/dist/hud/types.d.ts +4 -0
- package/dist/hud/types.d.ts.map +1 -1
- package/dist/hud/types.js.map +1 -1
- package/dist/hud/usage-api.d.ts.map +1 -1
- package/dist/hud/usage-api.js +32 -6
- package/dist/hud/usage-api.js.map +1 -1
- package/dist/installer/hooks.d.ts +5 -0
- package/dist/installer/hooks.d.ts.map +1 -1
- package/dist/installer/hooks.js +20 -0
- package/dist/installer/hooks.js.map +1 -1
- package/dist/installer/index.d.ts +1 -1
- package/dist/installer/index.js +2 -2
- package/dist/installer/index.js.map +1 -1
- package/dist/tools/diagnostics/index.d.ts +29 -0
- package/dist/tools/diagnostics/index.d.ts.map +1 -0
- package/dist/tools/diagnostics/index.js +118 -0
- package/dist/tools/diagnostics/index.js.map +1 -0
- package/dist/tools/diagnostics/lsp-aggregator.d.ts +26 -0
- package/dist/tools/diagnostics/lsp-aggregator.d.ts.map +1 -0
- package/dist/tools/diagnostics/lsp-aggregator.js +99 -0
- package/dist/tools/diagnostics/lsp-aggregator.js.map +1 -0
- package/dist/tools/diagnostics/tsc-runner.d.ts +26 -0
- package/dist/tools/diagnostics/tsc-runner.d.ts.map +1 -0
- package/dist/tools/diagnostics/tsc-runner.js +70 -0
- package/dist/tools/diagnostics/tsc-runner.js.map +1 -0
- package/dist/tools/lsp-tools.d.ts +10 -0
- package/dist/tools/lsp-tools.d.ts.map +1 -1
- package/dist/tools/lsp-tools.js +43 -1
- package/dist/tools/lsp-tools.js.map +1 -1
- package/dist/tools/resume-session.d.ts +63 -0
- package/dist/tools/resume-session.d.ts.map +1 -0
- package/dist/tools/resume-session.js +106 -0
- package/dist/tools/resume-session.js.map +1 -0
- package/dist/utils/__tests__/paths.test.d.ts +2 -0
- package/dist/utils/__tests__/paths.test.d.ts.map +1 -0
- package/dist/utils/__tests__/paths.test.js +88 -0
- package/dist/utils/__tests__/paths.test.js.map +1 -0
- package/dist/utils/paths.d.ts +32 -0
- package/dist/utils/paths.d.ts.map +1 -0
- package/dist/utils/paths.js +55 -0
- package/dist/utils/paths.js.map +1 -0
- package/docs/ARCHITECTURE.md +80 -1
- package/docs/CLAUDE.md +97 -3
- package/docs/FEATURES.md +2167 -0
- package/docs/FULL-README.md +69 -1
- package/package.json +1 -1
- package/skills/autopilot/SKILL.md +168 -0
- package/skills/cancel-autopilot/SKILL.md +53 -0
- package/skills/omc-setup/SKILL.md +95 -0
- package/skills/ralph/SKILL.md +9 -0
- package/skills/ultrawork/SKILL.md +9 -5
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic Prompt Generator for Oh-My-Claude-Sisyphus
|
|
3
|
+
*
|
|
4
|
+
* Generates orchestrator prompts dynamically from agent metadata.
|
|
5
|
+
* Adding a new agent to definitions.ts automatically includes it in the generated prompt.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentConfig } from './types.js';
|
|
8
|
+
import { buildToolSelectionSection } from './prompt-sections/index.js';
|
|
9
|
+
/**
|
|
10
|
+
* Options for controlling what sections are included in generated prompt
|
|
11
|
+
*/
|
|
12
|
+
export interface GeneratorOptions {
|
|
13
|
+
/** Include agent registry section (default: true) */
|
|
14
|
+
includeAgents?: boolean;
|
|
15
|
+
/** Include trigger table section (default: true) */
|
|
16
|
+
includeTriggers?: boolean;
|
|
17
|
+
/** Include tool selection guidance (default: true) */
|
|
18
|
+
includeTools?: boolean;
|
|
19
|
+
/** Include delegation matrix (default: true) */
|
|
20
|
+
includeDelegationTable?: boolean;
|
|
21
|
+
/** Include orchestration principles (default: true) */
|
|
22
|
+
includePrinciples?: boolean;
|
|
23
|
+
/** Include workflow section (default: true) */
|
|
24
|
+
includeWorkflow?: boolean;
|
|
25
|
+
/** Include critical rules (default: true) */
|
|
26
|
+
includeRules?: boolean;
|
|
27
|
+
/** Include completion checklist (default: true) */
|
|
28
|
+
includeChecklist?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generate complete orchestrator prompt from agent definitions
|
|
32
|
+
*
|
|
33
|
+
* @param agents - Array of agent configurations
|
|
34
|
+
* @param options - Options controlling which sections to include
|
|
35
|
+
* @returns Generated orchestrator prompt string
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```typescript
|
|
39
|
+
* import { getAgentDefinitions } from './definitions.js';
|
|
40
|
+
* import { generateOrchestratorPrompt } from './prompt-generator.js';
|
|
41
|
+
*
|
|
42
|
+
* const agents = Object.values(getAgentDefinitions()).map(def => ({
|
|
43
|
+
* name: def.name,
|
|
44
|
+
* description: def.description,
|
|
45
|
+
* prompt: def.prompt,
|
|
46
|
+
* tools: def.tools,
|
|
47
|
+
* model: def.model,
|
|
48
|
+
* metadata: def.metadata
|
|
49
|
+
* }));
|
|
50
|
+
*
|
|
51
|
+
* const prompt = generateOrchestratorPrompt(agents);
|
|
52
|
+
* console.log(prompt);
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function generateOrchestratorPrompt(agents: AgentConfig[], options?: GeneratorOptions): string;
|
|
56
|
+
/**
|
|
57
|
+
* Build agent section only (for embedding in other prompts)
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildAgentSection(agents: AgentConfig[]): string;
|
|
60
|
+
/**
|
|
61
|
+
* Build triggers section only
|
|
62
|
+
*/
|
|
63
|
+
export declare function buildTriggersSection(agents: AgentConfig[]): string;
|
|
64
|
+
/**
|
|
65
|
+
* Build tool selection section only (alias for buildToolSelectionSection from prompt-sections)
|
|
66
|
+
*/
|
|
67
|
+
export { buildToolSelectionSection };
|
|
68
|
+
/**
|
|
69
|
+
* Build delegation table section only
|
|
70
|
+
*/
|
|
71
|
+
export declare function buildDelegationTableSection(agents: AgentConfig[]): string;
|
|
72
|
+
/**
|
|
73
|
+
* Convert agent definitions record to array of AgentConfig for generation
|
|
74
|
+
*
|
|
75
|
+
* @param definitions - Record of agent definitions from getAgentDefinitions()
|
|
76
|
+
* @returns Array of AgentConfig suitable for prompt generation
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* import { getAgentDefinitions } from './definitions.js';
|
|
81
|
+
* import { convertDefinitionsToConfigs, generateOrchestratorPrompt } from './prompt-generator.js';
|
|
82
|
+
*
|
|
83
|
+
* const definitions = getAgentDefinitions();
|
|
84
|
+
* const agents = convertDefinitionsToConfigs(definitions);
|
|
85
|
+
* const prompt = generateOrchestratorPrompt(agents);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
export declare function convertDefinitionsToConfigs(definitions: Record<string, {
|
|
89
|
+
description: string;
|
|
90
|
+
prompt: string;
|
|
91
|
+
tools: string[];
|
|
92
|
+
model?: string;
|
|
93
|
+
metadata?: any;
|
|
94
|
+
}>): AgentConfig[];
|
|
95
|
+
//# sourceMappingURL=prompt-generator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-generator.d.ts","sourceRoot":"","sources":["../../src/agents/prompt-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAC9C,OAAO,EAIL,yBAAyB,EAM1B,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qDAAqD;IACrD,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oDAAoD;IACpD,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,sDAAsD;IACtD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,gDAAgD;IAChD,sBAAsB,CAAC,EAAE,OAAO,CAAC;IACjC,uDAAuD;IACvD,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,+CAA+C;IAC/C,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,WAAW,EAAE,EACrB,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,CAuDR;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAE/D;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAElE;AAED;;GAEG;AACH,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC;;GAEG;AACH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAEzE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,2BAA2B,CACzC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,GAAG,CAAC;CAChB,CAAC,GACD,WAAW,EAAE,CASf"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dynamic Prompt Generator for Oh-My-Claude-Sisyphus
|
|
3
|
+
*
|
|
4
|
+
* Generates orchestrator prompts dynamically from agent metadata.
|
|
5
|
+
* Adding a new agent to definitions.ts automatically includes it in the generated prompt.
|
|
6
|
+
*/
|
|
7
|
+
import { buildHeader, buildAgentRegistry, buildTriggerTable, buildToolSelectionSection, buildDelegationMatrix, buildOrchestrationPrinciples, buildWorkflow, buildCriticalRules, buildCompletionChecklist } from './prompt-sections/index.js';
|
|
8
|
+
/**
|
|
9
|
+
* Default generator options (all sections enabled)
|
|
10
|
+
*/
|
|
11
|
+
const DEFAULT_OPTIONS = {
|
|
12
|
+
includeAgents: true,
|
|
13
|
+
includeTriggers: true,
|
|
14
|
+
includeTools: true,
|
|
15
|
+
includeDelegationTable: true,
|
|
16
|
+
includePrinciples: true,
|
|
17
|
+
includeWorkflow: true,
|
|
18
|
+
includeRules: true,
|
|
19
|
+
includeChecklist: true
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Generate complete orchestrator prompt from agent definitions
|
|
23
|
+
*
|
|
24
|
+
* @param agents - Array of agent configurations
|
|
25
|
+
* @param options - Options controlling which sections to include
|
|
26
|
+
* @returns Generated orchestrator prompt string
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* import { getAgentDefinitions } from './definitions.js';
|
|
31
|
+
* import { generateOrchestratorPrompt } from './prompt-generator.js';
|
|
32
|
+
*
|
|
33
|
+
* const agents = Object.values(getAgentDefinitions()).map(def => ({
|
|
34
|
+
* name: def.name,
|
|
35
|
+
* description: def.description,
|
|
36
|
+
* prompt: def.prompt,
|
|
37
|
+
* tools: def.tools,
|
|
38
|
+
* model: def.model,
|
|
39
|
+
* metadata: def.metadata
|
|
40
|
+
* }));
|
|
41
|
+
*
|
|
42
|
+
* const prompt = generateOrchestratorPrompt(agents);
|
|
43
|
+
* console.log(prompt);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export function generateOrchestratorPrompt(agents, options) {
|
|
47
|
+
const opts = { ...DEFAULT_OPTIONS, ...options };
|
|
48
|
+
const sections = [];
|
|
49
|
+
// Always include header
|
|
50
|
+
sections.push(buildHeader());
|
|
51
|
+
sections.push('');
|
|
52
|
+
// Agent registry
|
|
53
|
+
if (opts.includeAgents) {
|
|
54
|
+
sections.push(buildAgentRegistry(agents));
|
|
55
|
+
}
|
|
56
|
+
// Orchestration principles
|
|
57
|
+
if (opts.includePrinciples) {
|
|
58
|
+
sections.push(buildOrchestrationPrinciples());
|
|
59
|
+
sections.push('');
|
|
60
|
+
}
|
|
61
|
+
// Trigger table
|
|
62
|
+
if (opts.includeTriggers) {
|
|
63
|
+
const triggerSection = buildTriggerTable(agents);
|
|
64
|
+
if (triggerSection) {
|
|
65
|
+
sections.push(triggerSection);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Tool selection guidance
|
|
69
|
+
if (opts.includeTools) {
|
|
70
|
+
sections.push(buildToolSelectionSection(agents));
|
|
71
|
+
}
|
|
72
|
+
// Delegation matrix
|
|
73
|
+
if (opts.includeDelegationTable) {
|
|
74
|
+
sections.push(buildDelegationMatrix(agents));
|
|
75
|
+
}
|
|
76
|
+
// Workflow
|
|
77
|
+
if (opts.includeWorkflow) {
|
|
78
|
+
sections.push(buildWorkflow());
|
|
79
|
+
sections.push('');
|
|
80
|
+
}
|
|
81
|
+
// Critical rules
|
|
82
|
+
if (opts.includeRules) {
|
|
83
|
+
sections.push(buildCriticalRules());
|
|
84
|
+
sections.push('');
|
|
85
|
+
}
|
|
86
|
+
// Completion checklist
|
|
87
|
+
if (opts.includeChecklist) {
|
|
88
|
+
sections.push(buildCompletionChecklist());
|
|
89
|
+
}
|
|
90
|
+
return sections.join('\n');
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Build agent section only (for embedding in other prompts)
|
|
94
|
+
*/
|
|
95
|
+
export function buildAgentSection(agents) {
|
|
96
|
+
return buildAgentRegistry(agents);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Build triggers section only
|
|
100
|
+
*/
|
|
101
|
+
export function buildTriggersSection(agents) {
|
|
102
|
+
return buildTriggerTable(agents);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Build tool selection section only (alias for buildToolSelectionSection from prompt-sections)
|
|
106
|
+
*/
|
|
107
|
+
export { buildToolSelectionSection };
|
|
108
|
+
/**
|
|
109
|
+
* Build delegation table section only
|
|
110
|
+
*/
|
|
111
|
+
export function buildDelegationTableSection(agents) {
|
|
112
|
+
return buildDelegationMatrix(agents);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Convert agent definitions record to array of AgentConfig for generation
|
|
116
|
+
*
|
|
117
|
+
* @param definitions - Record of agent definitions from getAgentDefinitions()
|
|
118
|
+
* @returns Array of AgentConfig suitable for prompt generation
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* import { getAgentDefinitions } from './definitions.js';
|
|
123
|
+
* import { convertDefinitionsToConfigs, generateOrchestratorPrompt } from './prompt-generator.js';
|
|
124
|
+
*
|
|
125
|
+
* const definitions = getAgentDefinitions();
|
|
126
|
+
* const agents = convertDefinitionsToConfigs(definitions);
|
|
127
|
+
* const prompt = generateOrchestratorPrompt(agents);
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
export function convertDefinitionsToConfigs(definitions) {
|
|
131
|
+
return Object.entries(definitions).map(([name, def]) => ({
|
|
132
|
+
name,
|
|
133
|
+
description: def.description,
|
|
134
|
+
prompt: def.prompt,
|
|
135
|
+
tools: def.tools,
|
|
136
|
+
model: def.model,
|
|
137
|
+
metadata: def.metadata
|
|
138
|
+
}));
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=prompt-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompt-generator.js","sourceRoot":"","sources":["../../src/agents/prompt-generator.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,iBAAiB,EACjB,yBAAyB,EACzB,qBAAqB,EACrB,4BAA4B,EAC5B,aAAa,EACb,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,4BAA4B,CAAC;AAwBpC;;GAEG;AACH,MAAM,eAAe,GAA+B;IAClD,aAAa,EAAE,IAAI;IACnB,eAAe,EAAE,IAAI;IACrB,YAAY,EAAE,IAAI;IAClB,sBAAsB,EAAE,IAAI;IAC5B,iBAAiB,EAAE,IAAI;IACvB,eAAe,EAAE,IAAI;IACrB,YAAY,EAAE,IAAI;IAClB,gBAAgB,EAAE,IAAI;CACvB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,0BAA0B,CACxC,MAAqB,EACrB,OAA0B;IAE1B,MAAM,IAAI,GAAG,EAAE,GAAG,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;IAChD,MAAM,QAAQ,GAAa,EAAE,CAAC;IAE9B,wBAAwB;IACxB,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IAC7B,QAAQ,CAAC,IAAI,CAA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AC;QAC1B,QAAQ,CAAC,IAAI,CAAC,wBAAwB,EAAE,CAAC,CAAC;IAC5C,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAC,MAAqB;IACrD,OAAO,kBAAkB,CAAC,MAAM,CAAC,CAAC;AACpC,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,MAAqB;IACxD,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACnC,CAAC;AAED;;GAEG;AACH,OAAO,EAAE,yBAAyB,EAAE,CAAC;AAErC;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAqB;IAC/D,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,2BAA2B,CACzC,WAME;IAEF,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;QACvD,IAAI;QACJ,WAAW,EAAE,GAAG,CAAC,WAAW;QAC5B,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,KAAK,EAAE,GAAG,CAAC,KAAY;QACvB,QAAQ,EAAE,GAAG,CAAC,QAAQ;KACvB,CAAC,CAAC,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Section Builders for Dynamic Orchestrator Prompt Generation
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions to build different sections of the orchestrator prompt
|
|
5
|
+
* dynamically from agent metadata. Adding a new agent automatically updates the orchestrator.
|
|
6
|
+
*/
|
|
7
|
+
import type { AgentConfig } from '../types.js';
|
|
8
|
+
/**
|
|
9
|
+
* Build the header section with core orchestrator identity
|
|
10
|
+
*/
|
|
11
|
+
export declare function buildHeader(): string;
|
|
12
|
+
/**
|
|
13
|
+
* Build the agent registry section with descriptions
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildAgentRegistry(agents: AgentConfig[]): string;
|
|
16
|
+
/**
|
|
17
|
+
* Build the trigger table showing when to use each agent
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildTriggerTable(agents: AgentConfig[]): string;
|
|
20
|
+
/**
|
|
21
|
+
* Build tool selection guidance section
|
|
22
|
+
*/
|
|
23
|
+
export declare function buildToolSelectionSection(agents: AgentConfig[]): string;
|
|
24
|
+
/**
|
|
25
|
+
* Build delegation matrix/guide table
|
|
26
|
+
*/
|
|
27
|
+
export declare function buildDelegationMatrix(agents: AgentConfig[]): string;
|
|
28
|
+
/**
|
|
29
|
+
* Build orchestration principles section
|
|
30
|
+
*/
|
|
31
|
+
export declare function buildOrchestrationPrinciples(): string;
|
|
32
|
+
/**
|
|
33
|
+
* Build workflow section
|
|
34
|
+
*/
|
|
35
|
+
export declare function buildWorkflow(): string;
|
|
36
|
+
/**
|
|
37
|
+
* Build critical rules section
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildCriticalRules(): string;
|
|
40
|
+
/**
|
|
41
|
+
* Build completion checklist section
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildCompletionChecklist(): string;
|
|
44
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agents/prompt-sections/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAsC,MAAM,aAAa,CAAC;AAEnF;;GAEG;AACH,wBAAgB,WAAW,IAAI,MAAM,CASpC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAkChE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAwB/D;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAgCvE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CA6BnE;AAED;;GAEG;AACH,wBAAgB,4BAA4B,IAAI,MAAM,CAOrD;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAUtC;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CAU3C;AAED;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAUjD"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Prompt Section Builders for Dynamic Orchestrator Prompt Generation
|
|
3
|
+
*
|
|
4
|
+
* This module provides functions to build different sections of the orchestrator prompt
|
|
5
|
+
* dynamically from agent metadata. Adding a new agent automatically updates the orchestrator.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Build the header section with core orchestrator identity
|
|
9
|
+
*/
|
|
10
|
+
export function buildHeader() {
|
|
11
|
+
return `You are the relentless orchestrator of a multi-agent development system.
|
|
12
|
+
|
|
13
|
+
## RELENTLESS EXECUTION
|
|
14
|
+
|
|
15
|
+
You are BOUND to your task list. You do not stop. You do not quit. You do not take breaks. Work continues until EVERY task is COMPLETE.
|
|
16
|
+
|
|
17
|
+
## Your Core Duty
|
|
18
|
+
You coordinate specialized subagents to accomplish complex software engineering tasks. Abandoning work mid-task is not an option. If you stop without completing ALL tasks, you have failed.`;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Build the agent registry section with descriptions
|
|
22
|
+
*/
|
|
23
|
+
export function buildAgentRegistry(agents) {
|
|
24
|
+
const lines = ['## Available Subagents', ''];
|
|
25
|
+
// Group agents by tier (base vs variants)
|
|
26
|
+
const baseAgents = agents.filter(a => !a.name.includes('-'));
|
|
27
|
+
const tieredAgents = agents.filter(a => a.name.includes('-'));
|
|
28
|
+
// Base agents
|
|
29
|
+
if (baseAgents.length > 0) {
|
|
30
|
+
lines.push('### Primary Agents');
|
|
31
|
+
for (const agent of baseAgents) {
|
|
32
|
+
const modelInfo = agent.model ? ` (${agent.model})` : '';
|
|
33
|
+
lines.push(`- **${agent.name}**${modelInfo}: ${agent.description}`);
|
|
34
|
+
}
|
|
35
|
+
lines.push('');
|
|
36
|
+
}
|
|
37
|
+
// Tiered variants
|
|
38
|
+
if (tieredAgents.length > 0) {
|
|
39
|
+
lines.push('### Tiered Variants');
|
|
40
|
+
lines.push('Use tiered variants for smart model routing based on task complexity:');
|
|
41
|
+
lines.push('- **HIGH tier (opus)**: Complex analysis, architecture, debugging');
|
|
42
|
+
lines.push('- **MEDIUM tier (sonnet)**: Standard tasks, moderate complexity');
|
|
43
|
+
lines.push('- **LOW tier (haiku)**: Simple lookups, trivial operations');
|
|
44
|
+
lines.push('');
|
|
45
|
+
for (const agent of tieredAgents) {
|
|
46
|
+
const modelInfo = agent.model ? ` (${agent.model})` : '';
|
|
47
|
+
lines.push(`- **${agent.name}**${modelInfo}: ${agent.description}`);
|
|
48
|
+
}
|
|
49
|
+
lines.push('');
|
|
50
|
+
}
|
|
51
|
+
return lines.join('\n');
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Build the trigger table showing when to use each agent
|
|
55
|
+
*/
|
|
56
|
+
export function buildTriggerTable(agents) {
|
|
57
|
+
const lines = ['## Key Triggers', ''];
|
|
58
|
+
// Filter agents with metadata triggers
|
|
59
|
+
const agentsWithTriggers = agents.filter(a => a.metadata?.triggers && a.metadata.triggers.length > 0);
|
|
60
|
+
if (agentsWithTriggers.length === 0) {
|
|
61
|
+
return '';
|
|
62
|
+
}
|
|
63
|
+
lines.push('| Agent | Domain | Trigger Condition |');
|
|
64
|
+
lines.push('|-------|--------|------------------|');
|
|
65
|
+
for (const agent of agentsWithTriggers) {
|
|
66
|
+
const triggers = agent.metadata.triggers;
|
|
67
|
+
for (let i = 0; i < triggers.length; i++) {
|
|
68
|
+
const trigger = triggers[i];
|
|
69
|
+
const agentName = i === 0 ? `**${agent.name}**` : '';
|
|
70
|
+
lines.push(`| ${agentName} | ${trigger.domain} | ${trigger.trigger} |`);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
lines.push('');
|
|
74
|
+
return lines.join('\n');
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Build tool selection guidance section
|
|
78
|
+
*/
|
|
79
|
+
export function buildToolSelectionSection(agents) {
|
|
80
|
+
const lines = ['## Tool Selection Guidance', ''];
|
|
81
|
+
// Group by category
|
|
82
|
+
const categorizedAgents = new Map();
|
|
83
|
+
for (const agent of agents) {
|
|
84
|
+
const category = agent.metadata?.category || 'utility';
|
|
85
|
+
if (!categorizedAgents.has(category)) {
|
|
86
|
+
categorizedAgents.set(category, []);
|
|
87
|
+
}
|
|
88
|
+
categorizedAgents.get(category).push(agent);
|
|
89
|
+
}
|
|
90
|
+
for (const [category, categoryAgents] of categorizedAgents) {
|
|
91
|
+
lines.push(`### ${capitalizeFirst(category)} Agents`);
|
|
92
|
+
for (const agent of categoryAgents) {
|
|
93
|
+
lines.push(`**${agent.name}** (${agent.model || 'sonnet'}):`);
|
|
94
|
+
lines.push(`- Tools: ${agent.tools.join(', ')}`);
|
|
95
|
+
if (agent.metadata?.useWhen && agent.metadata.useWhen.length > 0) {
|
|
96
|
+
lines.push(`- Use when: ${agent.metadata.useWhen.join('; ')}`);
|
|
97
|
+
}
|
|
98
|
+
if (agent.metadata?.avoidWhen && agent.metadata.avoidWhen.length > 0) {
|
|
99
|
+
lines.push(`- Avoid when: ${agent.metadata.avoidWhen.join('; ')}`);
|
|
100
|
+
}
|
|
101
|
+
lines.push('');
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
return lines.join('\n');
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Build delegation matrix/guide table
|
|
108
|
+
*/
|
|
109
|
+
export function buildDelegationMatrix(agents) {
|
|
110
|
+
const lines = ['## Delegation Guide', ''];
|
|
111
|
+
// Group by category
|
|
112
|
+
const categorizedAgents = new Map();
|
|
113
|
+
for (const agent of agents) {
|
|
114
|
+
const category = agent.metadata?.category || 'utility';
|
|
115
|
+
if (!categorizedAgents.has(category)) {
|
|
116
|
+
categorizedAgents.set(category, []);
|
|
117
|
+
}
|
|
118
|
+
categorizedAgents.get(category).push(agent);
|
|
119
|
+
}
|
|
120
|
+
lines.push('| Category | Agent | Model | Use Case |');
|
|
121
|
+
lines.push('|----------|-------|-------|----------|');
|
|
122
|
+
for (const [category, categoryAgents] of categorizedAgents) {
|
|
123
|
+
const categoryName = capitalizeFirst(category);
|
|
124
|
+
for (let i = 0; i < categoryAgents.length; i++) {
|
|
125
|
+
const agent = categoryAgents[i];
|
|
126
|
+
const catDisplay = i === 0 ? categoryName : '';
|
|
127
|
+
const model = agent.model || 'sonnet';
|
|
128
|
+
const useCase = agent.metadata?.useWhen?.[0] || agent.description;
|
|
129
|
+
lines.push(`| ${catDisplay} | **${agent.name}** | ${model} | ${useCase} |`);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
lines.push('');
|
|
133
|
+
return lines.join('\n');
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Build orchestration principles section
|
|
137
|
+
*/
|
|
138
|
+
export function buildOrchestrationPrinciples() {
|
|
139
|
+
return `## Orchestration Principles
|
|
140
|
+
1. **Delegate Aggressively**: Fire off subagents for specialized tasks - don't do everything yourself
|
|
141
|
+
2. **Parallelize Ruthlessly**: Launch multiple subagents concurrently whenever tasks are independent
|
|
142
|
+
3. **PERSIST RELENTLESSLY**: Continue until ALL tasks are VERIFIED complete - check your todo list BEFORE stopping
|
|
143
|
+
4. **Communicate Progress**: Keep the user informed but DON'T STOP to explain when you should be working
|
|
144
|
+
5. **Verify Thoroughly**: Test, check, verify - then verify again`;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Build workflow section
|
|
148
|
+
*/
|
|
149
|
+
export function buildWorkflow() {
|
|
150
|
+
return `## Workflow
|
|
151
|
+
1. Analyze the user's request and break it into tasks using TodoWrite
|
|
152
|
+
2. Mark the first task in_progress and BEGIN WORKING
|
|
153
|
+
3. Delegate to appropriate subagents based on task type
|
|
154
|
+
4. Coordinate results and handle any issues WITHOUT STOPPING
|
|
155
|
+
5. Mark tasks complete ONLY when verified
|
|
156
|
+
6. LOOP back to step 2 until ALL tasks show 'completed'
|
|
157
|
+
7. Final verification: Re-read todo list, confirm 100% completion
|
|
158
|
+
8. Only THEN may you rest`;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Build critical rules section
|
|
162
|
+
*/
|
|
163
|
+
export function buildCriticalRules() {
|
|
164
|
+
return `## CRITICAL RULES - VIOLATION IS FAILURE
|
|
165
|
+
|
|
166
|
+
1. **NEVER STOP WITH INCOMPLETE WORK** - If your todo list has pending/in_progress items, YOU ARE NOT DONE
|
|
167
|
+
2. **ALWAYS VERIFY** - Check your todo list before ANY attempt to conclude
|
|
168
|
+
3. **NO PREMATURE CONCLUSIONS** - Saying "I've completed the task" without verification is a LIE
|
|
169
|
+
4. **PARALLEL EXECUTION** - Use it whenever possible for speed
|
|
170
|
+
5. **CONTINUOUS PROGRESS** - Report progress but keep working
|
|
171
|
+
6. **WHEN BLOCKED, UNBLOCK** - Don't stop because something is hard; find another way
|
|
172
|
+
7. **ASK ONLY WHEN NECESSARY** - Clarifying questions are for ambiguity, not for avoiding work`;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Build completion checklist section
|
|
176
|
+
*/
|
|
177
|
+
export function buildCompletionChecklist() {
|
|
178
|
+
return `## Completion Checklist
|
|
179
|
+
Before concluding, you MUST verify:
|
|
180
|
+
- [ ] Every todo item is marked 'completed'
|
|
181
|
+
- [ ] All requested functionality is implemented
|
|
182
|
+
- [ ] Tests pass (if applicable)
|
|
183
|
+
- [ ] No errors remain unaddressed
|
|
184
|
+
- [ ] The user's original request is FULLY satisfied
|
|
185
|
+
|
|
186
|
+
If ANY checkbox is unchecked, YOU ARE NOT DONE. Continue working.`;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Capitalize first letter of a string
|
|
190
|
+
*/
|
|
191
|
+
function capitalizeFirst(str) {
|
|
192
|
+
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/agents/prompt-sections/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;GAEG;AACH,MAAM,UAAU,WAAW;IACzB,OAAO;;;;;;;6LAOoL,CAAC;AAC9L,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAAqB;IACtD,MAAM,KAAK,GAAa,CAAC,wBAAwB,EAAE,EAAE,CAAC,CAAC;IAEvD,0CAA0C;IAC1C,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAC7D,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IAE9D,cAAc;IACd,IAAI,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC1B,KAAK,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC;QACjC,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE,CAAC;YAC/B,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,KAAK,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,KAAK,CAAC,IAAI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AQ,KAAK,CAAC,IAAI,QAAQ,KAAK,MAAM,OAAO,IAAI,CAAC,CAAC;QAC9E,CAAC;IACH,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACf,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,4BAA4B;IAC1C,OAAO;;;;;kEAKyD,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO;;;;;;;;0BAQiB,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;;;;;;;;+FAQsF,CAAC;AAChG,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB;IACtC,OAAO;;;;;;;;kEAQyD,CAAC;AACnE,CAAC;AAED;;GAEG;AACH,SAAS,eAAe,CAAC,GAAW;IAClC,OAAO,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AACpD,CAAC"}
|
package/dist/agents/types.d.ts
CHANGED
|
@@ -42,6 +42,8 @@ export interface AgentPromptMetadata {
|
|
|
42
42
|
avoidWhen?: string[];
|
|
43
43
|
/** Description for dynamic prompt building */
|
|
44
44
|
promptDescription?: string;
|
|
45
|
+
/** Tools this agent uses (for tool selection guidance) */
|
|
46
|
+
tools?: string[];
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
47
49
|
* Base agent configuration
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhE;;;GAGG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,OAAO,GAA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CAAC;IAClB,uBAAuB;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC,CAAC;AAE1E;;GAEG;AACH,MAAM,MAAM,YAAY,GAAG,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,WAAW,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,QAAQ,EAAE,aAAa,GAAG,SAAS,CAe7E"}
|
package/dist/agents/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agents/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2HH;;GAEG;AACH,MAAM,UAAU,UAAU,CAAC,OAAe;IACxC,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AAC/C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe;IAC3C,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,QAAuB;IAChE,QAAQ,QAAQ,EAAE,CAAC;QACjB,KAAK,aAAa;YAChB,OAAO,OAAO,CAAC,CAAC,cAAc;QAChC,KAAK,YAAY;YACf,OAAO,QAAQ,CAAC,CAAC,WAAW;QAC9B,KAAK,SAAS;YACZ,OAAO,MAAM,CAAC,CAAC,yBAAyB;QAC1C,KAAK,SAAS;YACZ,OAAO,OAAO,CAAC,CAAC,cAAc;QAChC,KAAK,eAAe;YAClB,OAAO,QAAQ,CAAC,CAAC,WAAW;QAC9B;YACE,OAAO,QAAQ,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Adapted from oh-my-opencode's background-agent feature.
|
|
9
9
|
*/
|
|
10
|
-
import type { BackgroundTask, BackgroundTaskStatus, BackgroundTaskConfig, LaunchInput, ResumeInput, TaskProgress } from './types.js';
|
|
10
|
+
import type { BackgroundTask, BackgroundTaskStatus, BackgroundTaskConfig, LaunchInput, ResumeInput, TaskProgress, ResumeContext } from './types.js';
|
|
11
11
|
/**
|
|
12
12
|
* Manages background tasks for the Sisyphus system.
|
|
13
13
|
*/
|
|
@@ -54,6 +54,10 @@ export declare class BackgroundManager {
|
|
|
54
54
|
* Remove stale tasks that have exceeded their TTL
|
|
55
55
|
*/
|
|
56
56
|
private pruneStaleTasksAndNotifications;
|
|
57
|
+
/**
|
|
58
|
+
* Detect sessions with no recent activity and invoke callback
|
|
59
|
+
*/
|
|
60
|
+
private detectAndHandleStaleSessions;
|
|
57
61
|
/**
|
|
58
62
|
* Register a new background task
|
|
59
63
|
*/
|
|
@@ -62,6 +66,11 @@ export declare class BackgroundManager {
|
|
|
62
66
|
* Resume an existing background task
|
|
63
67
|
*/
|
|
64
68
|
resume(input: ResumeInput): Promise<BackgroundTask>;
|
|
69
|
+
/**
|
|
70
|
+
* Get resume context for a session
|
|
71
|
+
* Used by the resume_session tool to prepare continuation prompts
|
|
72
|
+
*/
|
|
73
|
+
getResumeContext(sessionId: string): ResumeContext | null;
|
|
65
74
|
/**
|
|
66
75
|
* Get a task by ID
|
|
67
76
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/features/background-agent/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,YAAY,
|
|
1
|
+
{"version":3,"file":"manager.d.ts","sourceRoot":"","sources":["../../../src/features/background-agent/manager.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH,OAAO,KAAK,EACV,cAAc,EACd,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,EACX,WAAW,EACX,YAAY,EACZ,aAAa,EACd,MAAM,YAAY,CAAC;AAQpB;;GAEG;AACH,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,KAAK,CAA0C;IACvD,OAAO,CAAC,aAAa,CAA4C;IACjE,OAAO,CAAC,kBAAkB,CAAqB;IAC/C,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,aAAa,CAAC,CAAiC;gBAE3C,MAAM,CAAC,EAAE,oBAAoB;IAQzC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAMxB;;OAEG;IACH,OAAO,CAAC,cAAc;IAMtB;;OAEG;IACH,OAAO,CAAC,WAAW;IAInB;;OAEG;IACH,OAAO,CAAC,WAAW;IAKnB;;OAEG;IACH,OAAO,CAAC,aAAa;IAOrB;;OAEG;IACH,OAAO,CAAC,kBAAkB;IAwC1B;;OAEG;IACH,OAAO,CAAC,YAAY;IAapB;;OAEG;IACH,OAAO,CAAC,WAAW;IAOnB;;OAEG;IACH,OAAO,CAAC,+BAA+B;IAuCvC;;OAEG;IACH,OAAO,CAAC,4BAA4B;IAqBpC;;OAEG;IACG,MAAM,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,cAAc,CAAC;IAwEzD;;OAEG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