ralph-starter 0.0.1 → 0.1.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +707 -17
- package/dist/auth/browser.d.ts +10 -0
- package/dist/auth/browser.d.ts.map +1 -0
- package/dist/auth/browser.js +56 -0
- package/dist/auth/browser.js.map +1 -0
- package/dist/auth/index.d.ts +5 -0
- package/dist/auth/index.d.ts.map +1 -0
- package/dist/auth/index.js +5 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/auth/oauth-server.d.ts +20 -0
- package/dist/auth/oauth-server.d.ts.map +1 -0
- package/dist/auth/oauth-server.js +168 -0
- package/dist/auth/oauth-server.js.map +1 -0
- package/dist/auth/pkce.d.ts +46 -0
- package/dist/auth/pkce.d.ts.map +1 -0
- package/dist/auth/pkce.js +57 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/providers/base.d.ts +52 -0
- package/dist/auth/providers/base.d.ts.map +1 -0
- package/dist/auth/providers/base.js +70 -0
- package/dist/auth/providers/base.js.map +1 -0
- package/dist/auth/providers/index.d.ts +23 -0
- package/dist/auth/providers/index.d.ts.map +1 -0
- package/dist/auth/providers/index.js +39 -0
- package/dist/auth/providers/index.js.map +1 -0
- package/dist/auth/providers/linear.d.ts +37 -0
- package/dist/auth/providers/linear.d.ts.map +1 -0
- package/dist/auth/providers/linear.js +46 -0
- package/dist/auth/providers/linear.js.map +1 -0
- package/dist/auth/providers/notion.d.ts +36 -0
- package/dist/auth/providers/notion.d.ts.map +1 -0
- package/dist/auth/providers/notion.js +75 -0
- package/dist/auth/providers/notion.js.map +1 -0
- package/dist/auth/providers/todoist.d.ts +29 -0
- package/dist/auth/providers/todoist.d.ts.map +1 -0
- package/dist/auth/providers/todoist.js +40 -0
- package/dist/auth/providers/todoist.js.map +1 -0
- package/dist/automation/git.d.ts +15 -0
- package/dist/automation/git.d.ts.map +1 -0
- package/dist/automation/git.js +73 -0
- package/dist/automation/git.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +192 -19
- package/dist/cli.js.map +1 -0
- package/dist/commands/auth.d.ts +14 -0
- package/dist/commands/auth.d.ts.map +1 -0
- package/dist/commands/auth.js +243 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/check.d.ts +12 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +124 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/config.d.ts +13 -0
- package/dist/commands/config.d.ts.map +1 -0
- package/dist/commands/config.js +374 -0
- package/dist/commands/config.js.map +1 -0
- package/dist/commands/init.d.ts +31 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +353 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/integrations.d.ts +17 -0
- package/dist/commands/integrations.d.ts.map +1 -0
- package/dist/commands/integrations.js +193 -0
- package/dist/commands/integrations.js.map +1 -0
- package/dist/commands/plan.d.ts +5 -0
- package/dist/commands/plan.d.ts.map +1 -0
- package/dist/commands/plan.js +80 -0
- package/dist/commands/plan.js.map +1 -0
- package/dist/commands/run.d.ts +26 -0
- package/dist/commands/run.d.ts.map +1 -0
- package/dist/commands/run.js +351 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/scaffold.d.ts +9 -0
- package/dist/commands/scaffold.d.ts.map +1 -0
- package/dist/commands/scaffold.js +128 -0
- package/dist/commands/scaffold.js.map +1 -0
- package/dist/commands/setup.d.ts +12 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +27 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/skill.d.ts +6 -0
- package/dist/commands/skill.d.ts.map +1 -0
- package/dist/commands/skill.js +151 -0
- package/dist/commands/skill.js.map +1 -0
- package/dist/commands/source.d.ts +17 -0
- package/dist/commands/source.d.ts.map +1 -0
- package/dist/commands/source.js +173 -0
- package/dist/commands/source.js.map +1 -0
- package/dist/config/manager.d.ts +70 -0
- package/dist/config/manager.d.ts.map +1 -0
- package/dist/config/manager.js +227 -0
- package/dist/config/manager.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -0
- package/dist/integrations/_template/auth.d.ts +29 -0
- package/dist/integrations/_template/auth.d.ts.map +1 -0
- package/dist/integrations/_template/auth.js +42 -0
- package/dist/integrations/_template/auth.js.map +1 -0
- package/dist/integrations/_template/index.d.ts +8 -0
- package/dist/integrations/_template/index.d.ts.map +1 -0
- package/dist/integrations/_template/index.js +8 -0
- package/dist/integrations/_template/index.js.map +1 -0
- package/dist/integrations/_template/source.d.ts +34 -0
- package/dist/integrations/_template/source.d.ts.map +1 -0
- package/dist/integrations/_template/source.js +124 -0
- package/dist/integrations/_template/source.js.map +1 -0
- package/dist/integrations/base.d.ts +158 -0
- package/dist/integrations/base.d.ts.map +1 -0
- package/dist/integrations/base.js +109 -0
- package/dist/integrations/base.js.map +1 -0
- package/dist/integrations/github/index.d.ts +8 -0
- package/dist/integrations/github/index.d.ts.map +1 -0
- package/dist/integrations/github/index.js +8 -0
- package/dist/integrations/github/index.js.map +1 -0
- package/dist/integrations/github/source.d.ts +26 -0
- package/dist/integrations/github/source.d.ts.map +1 -0
- package/dist/integrations/github/source.js +190 -0
- package/dist/integrations/github/source.js.map +1 -0
- package/dist/integrations/index.d.ts +37 -0
- package/dist/integrations/index.d.ts.map +1 -0
- package/dist/integrations/index.js +71 -0
- package/dist/integrations/index.js.map +1 -0
- package/dist/integrations/linear/auth.d.ts +37 -0
- package/dist/integrations/linear/auth.d.ts.map +1 -0
- package/dist/integrations/linear/auth.js +45 -0
- package/dist/integrations/linear/auth.js.map +1 -0
- package/dist/integrations/linear/index.d.ts +9 -0
- package/dist/integrations/linear/index.d.ts.map +1 -0
- package/dist/integrations/linear/index.js +9 -0
- package/dist/integrations/linear/index.js.map +1 -0
- package/dist/integrations/linear/source.d.ts +26 -0
- package/dist/integrations/linear/source.d.ts.map +1 -0
- package/dist/integrations/linear/source.js +248 -0
- package/dist/integrations/linear/source.js.map +1 -0
- package/dist/integrations/notion/index.d.ts +8 -0
- package/dist/integrations/notion/index.d.ts.map +1 -0
- package/dist/integrations/notion/index.js +8 -0
- package/dist/integrations/notion/index.js.map +1 -0
- package/dist/integrations/notion/source.d.ts +53 -0
- package/dist/integrations/notion/source.d.ts.map +1 -0
- package/dist/integrations/notion/source.js +463 -0
- package/dist/integrations/notion/source.js.map +1 -0
- package/dist/llm/api.d.ts +29 -0
- package/dist/llm/api.d.ts.map +1 -0
- package/dist/llm/api.js +152 -0
- package/dist/llm/api.js.map +1 -0
- package/dist/llm/index.d.ts +7 -0
- package/dist/llm/index.d.ts.map +1 -0
- package/dist/llm/index.js +7 -0
- package/dist/llm/index.js.map +1 -0
- package/dist/llm/providers.d.ts +24 -0
- package/dist/llm/providers.d.ts.map +1 -0
- package/dist/llm/providers.js +51 -0
- package/dist/llm/providers.js.map +1 -0
- package/dist/loop/__tests__/agents.test.d.ts +2 -0
- package/dist/loop/__tests__/agents.test.d.ts.map +1 -0
- package/dist/loop/__tests__/agents.test.js +183 -0
- package/dist/loop/__tests__/agents.test.js.map +1 -0
- package/dist/loop/__tests__/circuit-breaker.test.d.ts +2 -0
- package/dist/loop/__tests__/circuit-breaker.test.d.ts.map +1 -0
- package/dist/loop/__tests__/circuit-breaker.test.js +161 -0
- package/dist/loop/__tests__/circuit-breaker.test.js.map +1 -0
- package/dist/loop/__tests__/cost-tracker.test.d.ts +2 -0
- package/dist/loop/__tests__/cost-tracker.test.d.ts.map +1 -0
- package/dist/loop/__tests__/cost-tracker.test.js +200 -0
- package/dist/loop/__tests__/cost-tracker.test.js.map +1 -0
- package/dist/loop/__tests__/rate-limiter.test.d.ts +2 -0
- package/dist/loop/__tests__/rate-limiter.test.d.ts.map +1 -0
- package/dist/loop/__tests__/rate-limiter.test.js +198 -0
- package/dist/loop/__tests__/rate-limiter.test.js.map +1 -0
- package/dist/loop/__tests__/validation.test.d.ts +2 -0
- package/dist/loop/__tests__/validation.test.d.ts.map +1 -0
- package/dist/loop/__tests__/validation.test.js +234 -0
- package/dist/loop/__tests__/validation.test.js.map +1 -0
- package/dist/loop/agents.d.ts +26 -0
- package/dist/loop/agents.d.ts.map +1 -0
- package/dist/loop/agents.js +188 -0
- package/dist/loop/agents.js.map +1 -0
- package/dist/loop/circuit-breaker.d.ts +61 -0
- package/dist/loop/circuit-breaker.d.ts.map +1 -0
- package/dist/loop/circuit-breaker.js +143 -0
- package/dist/loop/circuit-breaker.js.map +1 -0
- package/dist/loop/cost-tracker.d.ts +90 -0
- package/dist/loop/cost-tracker.d.ts.map +1 -0
- package/dist/loop/cost-tracker.js +229 -0
- package/dist/loop/cost-tracker.js.map +1 -0
- package/dist/loop/estimator.d.ts +20 -0
- package/dist/loop/estimator.d.ts.map +1 -0
- package/dist/loop/estimator.js +123 -0
- package/dist/loop/estimator.js.map +1 -0
- package/dist/loop/executor.d.ts +44 -0
- package/dist/loop/executor.d.ts.map +1 -0
- package/dist/loop/executor.js +646 -0
- package/dist/loop/executor.js.map +1 -0
- package/dist/loop/progress.d.ts +34 -0
- package/dist/loop/progress.d.ts.map +1 -0
- package/dist/loop/progress.js +186 -0
- package/dist/loop/progress.js.map +1 -0
- package/dist/loop/rate-limiter.d.ts +71 -0
- package/dist/loop/rate-limiter.d.ts.map +1 -0
- package/dist/loop/rate-limiter.js +151 -0
- package/dist/loop/rate-limiter.js.map +1 -0
- package/dist/loop/semantic-analyzer.d.ts +33 -0
- package/dist/loop/semantic-analyzer.d.ts.map +1 -0
- package/dist/loop/semantic-analyzer.js +153 -0
- package/dist/loop/semantic-analyzer.js.map +1 -0
- package/dist/loop/skills.d.ts +29 -0
- package/dist/loop/skills.d.ts.map +1 -0
- package/dist/loop/skills.js +174 -0
- package/dist/loop/skills.js.map +1 -0
- package/dist/loop/step-detector.d.ts +17 -0
- package/dist/loop/step-detector.d.ts.map +1 -0
- package/dist/loop/step-detector.js +280 -0
- package/dist/loop/step-detector.js.map +1 -0
- package/dist/loop/task-counter.d.ts +41 -0
- package/dist/loop/task-counter.d.ts.map +1 -0
- package/dist/loop/task-counter.js +99 -0
- package/dist/loop/task-counter.js.map +1 -0
- package/dist/loop/validation.d.ts +28 -0
- package/dist/loop/validation.d.ts.map +1 -0
- package/dist/loop/validation.js +138 -0
- package/dist/loop/validation.js.map +1 -0
- package/dist/mcp/core/init.d.ts +15 -0
- package/dist/mcp/core/init.d.ts.map +1 -0
- package/dist/mcp/core/init.js +272 -0
- package/dist/mcp/core/init.js.map +1 -0
- package/dist/mcp/core/plan.d.ts +15 -0
- package/dist/mcp/core/plan.d.ts.map +1 -0
- package/dist/mcp/core/plan.js +90 -0
- package/dist/mcp/core/plan.js.map +1 -0
- package/dist/mcp/core/run.d.ts +26 -0
- package/dist/mcp/core/run.d.ts.map +1 -0
- package/dist/mcp/core/run.js +114 -0
- package/dist/mcp/core/run.js.map +1 -0
- package/dist/mcp/prompts.d.ts +10 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +163 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +16 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +114 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +10 -0
- package/dist/mcp/server.d.ts.map +1 -0
- package/dist/mcp/server.js +73 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.d.ts +15 -0
- package/dist/mcp/tools.d.ts.map +1 -0
- package/dist/mcp/tools.js +316 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/presets/index.d.ts +36 -0
- package/dist/presets/index.d.ts.map +1 -0
- package/dist/presets/index.js +236 -0
- package/dist/presets/index.js.map +1 -0
- package/dist/setup/agent-detector.d.ts +57 -0
- package/dist/setup/agent-detector.d.ts.map +1 -0
- package/dist/setup/agent-detector.js +170 -0
- package/dist/setup/agent-detector.js.map +1 -0
- package/dist/setup/index.d.ts +7 -0
- package/dist/setup/index.d.ts.map +1 -0
- package/dist/setup/index.js +7 -0
- package/dist/setup/index.js.map +1 -0
- package/dist/setup/llm-tester.d.ts +33 -0
- package/dist/setup/llm-tester.d.ts.map +1 -0
- package/dist/setup/llm-tester.js +105 -0
- package/dist/setup/llm-tester.js.map +1 -0
- package/dist/setup/wizard.d.ts +19 -0
- package/dist/setup/wizard.d.ts.map +1 -0
- package/dist/setup/wizard.js +313 -0
- package/dist/setup/wizard.js.map +1 -0
- package/dist/sources/__tests__/file.test.d.ts +2 -0
- package/dist/sources/__tests__/file.test.d.ts.map +1 -0
- package/dist/sources/__tests__/file.test.js +126 -0
- package/dist/sources/__tests__/file.test.js.map +1 -0
- package/dist/sources/__tests__/github.test.d.ts +2 -0
- package/dist/sources/__tests__/github.test.d.ts.map +1 -0
- package/dist/sources/__tests__/github.test.js +157 -0
- package/dist/sources/__tests__/github.test.js.map +1 -0
- package/dist/sources/base.d.ts +72 -0
- package/dist/sources/base.d.ts.map +1 -0
- package/dist/sources/base.js +127 -0
- package/dist/sources/base.js.map +1 -0
- package/dist/sources/builtin/file.d.ts +21 -0
- package/dist/sources/builtin/file.d.ts.map +1 -0
- package/dist/sources/builtin/file.js +129 -0
- package/dist/sources/builtin/file.js.map +1 -0
- package/dist/sources/builtin/github-scraper.d.ts +65 -0
- package/dist/sources/builtin/github-scraper.d.ts.map +1 -0
- package/dist/sources/builtin/github-scraper.js +324 -0
- package/dist/sources/builtin/github-scraper.js.map +1 -0
- package/dist/sources/builtin/pdf.d.ts +24 -0
- package/dist/sources/builtin/pdf.d.ts.map +1 -0
- package/dist/sources/builtin/pdf.js +174 -0
- package/dist/sources/builtin/pdf.js.map +1 -0
- package/dist/sources/builtin/url.d.ts +47 -0
- package/dist/sources/builtin/url.d.ts.map +1 -0
- package/dist/sources/builtin/url.js +429 -0
- package/dist/sources/builtin/url.js.map +1 -0
- package/dist/sources/config.d.ts +72 -0
- package/dist/sources/config.d.ts.map +1 -0
- package/dist/sources/config.js +215 -0
- package/dist/sources/config.js.map +1 -0
- package/dist/sources/index.d.ts +47 -0
- package/dist/sources/index.d.ts.map +1 -0
- package/dist/sources/index.js +210 -0
- package/dist/sources/index.js.map +1 -0
- package/dist/sources/integrations/github.d.ts +24 -0
- package/dist/sources/integrations/github.d.ts.map +1 -0
- package/dist/sources/integrations/github.js +193 -0
- package/dist/sources/integrations/github.js.map +1 -0
- package/dist/sources/integrations/linear.d.ts +18 -0
- package/dist/sources/integrations/linear.d.ts.map +1 -0
- package/dist/sources/integrations/linear.js +197 -0
- package/dist/sources/integrations/linear.js.map +1 -0
- package/dist/sources/integrations/notion.d.ts +39 -0
- package/dist/sources/integrations/notion.d.ts.map +1 -0
- package/dist/sources/integrations/notion.js +343 -0
- package/dist/sources/integrations/notion.js.map +1 -0
- package/dist/sources/integrations/todoist.d.ts +18 -0
- package/dist/sources/integrations/todoist.d.ts.map +1 -0
- package/dist/sources/integrations/todoist.js +154 -0
- package/dist/sources/integrations/todoist.js.map +1 -0
- package/dist/sources/types.d.ts +106 -0
- package/dist/sources/types.d.ts.map +1 -0
- package/dist/sources/types.js +9 -0
- package/dist/sources/types.js.map +1 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/progress-renderer.d.ts +54 -0
- package/dist/ui/progress-renderer.d.ts.map +1 -0
- package/dist/ui/progress-renderer.js +118 -0
- package/dist/ui/progress-renderer.js.map +1 -0
- package/dist/ui/shimmer.d.ts +16 -0
- package/dist/ui/shimmer.d.ts.map +1 -0
- package/dist/ui/shimmer.js +31 -0
- package/dist/ui/shimmer.js.map +1 -0
- package/dist/wizard/ascii-art.d.ts +93 -0
- package/dist/wizard/ascii-art.d.ts.map +1 -0
- package/dist/wizard/ascii-art.js +378 -0
- package/dist/wizard/ascii-art.js.map +1 -0
- package/dist/wizard/idea-prompts.d.ts +18 -0
- package/dist/wizard/idea-prompts.d.ts.map +1 -0
- package/dist/wizard/idea-prompts.js +154 -0
- package/dist/wizard/idea-prompts.js.map +1 -0
- package/dist/wizard/idea-ui.d.ts +34 -0
- package/dist/wizard/idea-ui.d.ts.map +1 -0
- package/dist/wizard/idea-ui.js +225 -0
- package/dist/wizard/idea-ui.js.map +1 -0
- package/dist/wizard/ideas.d.ts +27 -0
- package/dist/wizard/ideas.d.ts.map +1 -0
- package/dist/wizard/ideas.js +511 -0
- package/dist/wizard/ideas.js.map +1 -0
- package/dist/wizard/index.d.ts +11 -0
- package/dist/wizard/index.d.ts.map +1 -0
- package/dist/wizard/index.js +472 -0
- package/dist/wizard/index.js.map +1 -0
- package/dist/wizard/llm.d.ts +14 -0
- package/dist/wizard/llm.d.ts.map +1 -0
- package/dist/wizard/llm.js +420 -0
- package/dist/wizard/llm.js.map +1 -0
- package/dist/wizard/prompts.d.ts +75 -0
- package/dist/wizard/prompts.d.ts.map +1 -0
- package/dist/wizard/prompts.js +455 -0
- package/dist/wizard/prompts.js.map +1 -0
- package/dist/wizard/spec-generator.d.ts +14 -0
- package/dist/wizard/spec-generator.d.ts.map +1 -0
- package/dist/wizard/spec-generator.js +200 -0
- package/dist/wizard/spec-generator.js.map +1 -0
- package/dist/wizard/types.d.ts +53 -0
- package/dist/wizard/types.d.ts.map +1 -0
- package/dist/wizard/types.js +10 -0
- package/dist/wizard/types.js.map +1 -0
- package/dist/wizard/ui.d.ts +57 -0
- package/dist/wizard/ui.d.ts.map +1 -0
- package/dist/wizard/ui.js +211 -0
- package/dist/wizard/ui.js.map +1 -0
- package/package.json +67 -8
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
// Import core functions (these will be created/extracted)
|
|
5
|
+
import { initCore } from './core/init.js';
|
|
6
|
+
import { planCore } from './core/plan.js';
|
|
7
|
+
import { runCore } from './core/run.js';
|
|
8
|
+
/**
|
|
9
|
+
* Tool definitions for ralph-starter MCP server
|
|
10
|
+
*/
|
|
11
|
+
const toolSchemas = {
|
|
12
|
+
ralph_init: z.object({
|
|
13
|
+
path: z.string().describe('Project path to initialize'),
|
|
14
|
+
name: z.string().optional().describe('Project name'),
|
|
15
|
+
}),
|
|
16
|
+
ralph_plan: z.object({
|
|
17
|
+
path: z.string().describe('Project path'),
|
|
18
|
+
auto: z.boolean().optional().describe('Run in automated mode'),
|
|
19
|
+
}),
|
|
20
|
+
ralph_run: z.object({
|
|
21
|
+
path: z.string().describe('Project path'),
|
|
22
|
+
task: z.string().optional().describe('Task to execute'),
|
|
23
|
+
auto: z.boolean().optional().describe('Run in automated mode'),
|
|
24
|
+
commit: z.boolean().optional().describe('Auto-commit changes'),
|
|
25
|
+
validate: z.boolean().optional().describe('Run validation after changes'),
|
|
26
|
+
from: z.string().optional().describe('Source to fetch spec from'),
|
|
27
|
+
project: z.string().optional().describe('Project filter for source'),
|
|
28
|
+
label: z.string().optional().describe('Label filter for source'),
|
|
29
|
+
}),
|
|
30
|
+
ralph_status: z.object({
|
|
31
|
+
path: z.string().describe('Project path'),
|
|
32
|
+
}),
|
|
33
|
+
ralph_validate: z.object({
|
|
34
|
+
path: z.string().describe('Project path'),
|
|
35
|
+
}),
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Get all available tools
|
|
39
|
+
*/
|
|
40
|
+
export function getTools() {
|
|
41
|
+
return [
|
|
42
|
+
{
|
|
43
|
+
name: 'ralph_init',
|
|
44
|
+
description: 'Initialize Ralph Playbook in a project. Creates AGENTS.md, PROMPT_plan.md, PROMPT_build.md, specs/, and IMPLEMENTATION_PLAN.md.',
|
|
45
|
+
inputSchema: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
path: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
description: 'Project path to initialize',
|
|
51
|
+
},
|
|
52
|
+
name: {
|
|
53
|
+
type: 'string',
|
|
54
|
+
description: 'Project name',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
required: ['path'],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'ralph_plan',
|
|
62
|
+
description: 'Create an implementation plan from specs. Analyzes specs/ directory and generates IMPLEMENTATION_PLAN.md.',
|
|
63
|
+
inputSchema: {
|
|
64
|
+
type: 'object',
|
|
65
|
+
properties: {
|
|
66
|
+
path: {
|
|
67
|
+
type: 'string',
|
|
68
|
+
description: 'Project path',
|
|
69
|
+
},
|
|
70
|
+
auto: {
|
|
71
|
+
type: 'boolean',
|
|
72
|
+
description: 'Run in automated mode (skip permissions)',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
required: ['path'],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'ralph_run',
|
|
80
|
+
description: 'Execute an autonomous coding loop. Uses the implementation plan and agents to build the project.',
|
|
81
|
+
inputSchema: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
path: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
description: 'Project path',
|
|
87
|
+
},
|
|
88
|
+
task: {
|
|
89
|
+
type: 'string',
|
|
90
|
+
description: 'Task to execute (optional if using Ralph Playbook)',
|
|
91
|
+
},
|
|
92
|
+
auto: {
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
description: 'Run in automated mode (skip permissions)',
|
|
95
|
+
},
|
|
96
|
+
commit: {
|
|
97
|
+
type: 'boolean',
|
|
98
|
+
description: 'Auto-commit changes after each task',
|
|
99
|
+
},
|
|
100
|
+
validate: {
|
|
101
|
+
type: 'boolean',
|
|
102
|
+
description: 'Run tests/lint/build validation',
|
|
103
|
+
},
|
|
104
|
+
from: {
|
|
105
|
+
type: 'string',
|
|
106
|
+
description: 'Source to fetch spec from (file, url, github, todoist, linear, notion)',
|
|
107
|
+
},
|
|
108
|
+
project: {
|
|
109
|
+
type: 'string',
|
|
110
|
+
description: 'Project/repo name for source integrations',
|
|
111
|
+
},
|
|
112
|
+
label: {
|
|
113
|
+
type: 'string',
|
|
114
|
+
description: 'Label filter for source integrations',
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
required: ['path'],
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: 'ralph_status',
|
|
122
|
+
description: 'Check Ralph Playbook status. Shows available files, implementation progress, and agent availability.',
|
|
123
|
+
inputSchema: {
|
|
124
|
+
type: 'object',
|
|
125
|
+
properties: {
|
|
126
|
+
path: {
|
|
127
|
+
type: 'string',
|
|
128
|
+
description: 'Project path',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
required: ['path'],
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'ralph_validate',
|
|
136
|
+
description: 'Run validation commands (tests, lint, build). Checks project health and reports issues.',
|
|
137
|
+
inputSchema: {
|
|
138
|
+
type: 'object',
|
|
139
|
+
properties: {
|
|
140
|
+
path: {
|
|
141
|
+
type: 'string',
|
|
142
|
+
description: 'Project path',
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
required: ['path'],
|
|
146
|
+
},
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Handle a tool call
|
|
152
|
+
*/
|
|
153
|
+
export async function handleToolCall(name, args) {
|
|
154
|
+
try {
|
|
155
|
+
switch (name) {
|
|
156
|
+
case 'ralph_init':
|
|
157
|
+
return await handleInit(args);
|
|
158
|
+
case 'ralph_plan':
|
|
159
|
+
return await handlePlan(args);
|
|
160
|
+
case 'ralph_run':
|
|
161
|
+
return await handleRun(args);
|
|
162
|
+
case 'ralph_status':
|
|
163
|
+
return await handleStatus(args);
|
|
164
|
+
case 'ralph_validate':
|
|
165
|
+
return await handleValidate(args);
|
|
166
|
+
default:
|
|
167
|
+
return {
|
|
168
|
+
content: [
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
text: `Unknown tool: ${name}`,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
catch (error) {
|
|
178
|
+
return {
|
|
179
|
+
content: [
|
|
180
|
+
{
|
|
181
|
+
type: 'text',
|
|
182
|
+
text: `Error: ${error.message}`,
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
async function handleInit(args) {
|
|
189
|
+
const parsed = toolSchemas.ralph_init.parse(args);
|
|
190
|
+
const result = await initCore({
|
|
191
|
+
path: parsed.path,
|
|
192
|
+
name: parsed.name,
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
content: [
|
|
196
|
+
{
|
|
197
|
+
type: 'text',
|
|
198
|
+
text: formatInitResult(result),
|
|
199
|
+
},
|
|
200
|
+
],
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
async function handlePlan(args) {
|
|
204
|
+
const parsed = toolSchemas.ralph_plan.parse(args);
|
|
205
|
+
const result = await planCore({
|
|
206
|
+
path: parsed.path,
|
|
207
|
+
auto: parsed.auto,
|
|
208
|
+
});
|
|
209
|
+
return {
|
|
210
|
+
content: [
|
|
211
|
+
{
|
|
212
|
+
type: 'text',
|
|
213
|
+
text: formatPlanResult(result),
|
|
214
|
+
},
|
|
215
|
+
],
|
|
216
|
+
};
|
|
217
|
+
}
|
|
218
|
+
async function handleRun(args) {
|
|
219
|
+
const parsed = toolSchemas.ralph_run.parse(args);
|
|
220
|
+
const result = await runCore({
|
|
221
|
+
path: parsed.path,
|
|
222
|
+
task: parsed.task,
|
|
223
|
+
auto: parsed.auto,
|
|
224
|
+
commit: parsed.commit,
|
|
225
|
+
validate: parsed.validate,
|
|
226
|
+
from: parsed.from,
|
|
227
|
+
project: parsed.project,
|
|
228
|
+
label: parsed.label,
|
|
229
|
+
});
|
|
230
|
+
return {
|
|
231
|
+
content: [
|
|
232
|
+
{
|
|
233
|
+
type: 'text',
|
|
234
|
+
text: formatRunResult(result),
|
|
235
|
+
},
|
|
236
|
+
],
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async function handleStatus(args) {
|
|
240
|
+
const parsed = toolSchemas.ralph_status.parse(args);
|
|
241
|
+
const path = parsed.path;
|
|
242
|
+
// Check for Ralph Playbook files
|
|
243
|
+
const files = {
|
|
244
|
+
'AGENTS.md': existsSync(join(path, 'AGENTS.md')),
|
|
245
|
+
'PROMPT_plan.md': existsSync(join(path, 'PROMPT_plan.md')),
|
|
246
|
+
'PROMPT_build.md': existsSync(join(path, 'PROMPT_build.md')),
|
|
247
|
+
'IMPLEMENTATION_PLAN.md': existsSync(join(path, 'IMPLEMENTATION_PLAN.md')),
|
|
248
|
+
'specs/': existsSync(join(path, 'specs')),
|
|
249
|
+
};
|
|
250
|
+
const hasPlaybook = files['AGENTS.md'] && files['IMPLEMENTATION_PLAN.md'];
|
|
251
|
+
// Read implementation plan if exists
|
|
252
|
+
let planProgress = '';
|
|
253
|
+
if (files['IMPLEMENTATION_PLAN.md']) {
|
|
254
|
+
const planContent = readFileSync(join(path, 'IMPLEMENTATION_PLAN.md'), 'utf-8');
|
|
255
|
+
const completedTasks = (planContent.match(/- \[x\]/gi) || []).length;
|
|
256
|
+
const totalTasks = (planContent.match(/- \[[ x]\]/gi) || []).length;
|
|
257
|
+
planProgress = `${completedTasks}/${totalTasks} tasks completed`;
|
|
258
|
+
}
|
|
259
|
+
// List specs if directory exists
|
|
260
|
+
let specs = [];
|
|
261
|
+
if (files['specs/']) {
|
|
262
|
+
specs = readdirSync(join(path, 'specs')).filter((f) => f.endsWith('.md'));
|
|
263
|
+
}
|
|
264
|
+
const status = {
|
|
265
|
+
hasPlaybook,
|
|
266
|
+
files,
|
|
267
|
+
planProgress,
|
|
268
|
+
specs,
|
|
269
|
+
};
|
|
270
|
+
return {
|
|
271
|
+
content: [
|
|
272
|
+
{
|
|
273
|
+
type: 'text',
|
|
274
|
+
text: JSON.stringify(status, null, 2),
|
|
275
|
+
},
|
|
276
|
+
],
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
async function handleValidate(args) {
|
|
280
|
+
const parsed = toolSchemas.ralph_validate.parse(args);
|
|
281
|
+
// Import validation functions
|
|
282
|
+
const { detectValidationCommands, runAllValidations } = await import('../loop/validation.js');
|
|
283
|
+
const commands = detectValidationCommands(parsed.path);
|
|
284
|
+
const results = await runAllValidations(parsed.path, commands);
|
|
285
|
+
return {
|
|
286
|
+
content: [
|
|
287
|
+
{
|
|
288
|
+
type: 'text',
|
|
289
|
+
text: JSON.stringify({ commands, results }, null, 2),
|
|
290
|
+
},
|
|
291
|
+
],
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
function formatInitResult(result) {
|
|
295
|
+
if (result.success) {
|
|
296
|
+
return `Successfully initialized Ralph Playbook at ${result.path}\n\nFiles created:\n${result.filesCreated.map((f) => `- ${f}`).join('\n')}`;
|
|
297
|
+
}
|
|
298
|
+
return `Failed to initialize: ${result.error}`;
|
|
299
|
+
}
|
|
300
|
+
function formatPlanResult(result) {
|
|
301
|
+
if (result.success) {
|
|
302
|
+
return `Implementation plan created at ${result.planPath}\n\nTasks: ${result.taskCount}`;
|
|
303
|
+
}
|
|
304
|
+
return `Failed to create plan: ${result.error}`;
|
|
305
|
+
}
|
|
306
|
+
function formatRunResult(result) {
|
|
307
|
+
if (result.success) {
|
|
308
|
+
let text = `Loop completed successfully!\n\nIterations: ${result.iterations}`;
|
|
309
|
+
if (result.commits.length > 0) {
|
|
310
|
+
text += `\nCommits: ${result.commits.length}`;
|
|
311
|
+
}
|
|
312
|
+
return text;
|
|
313
|
+
}
|
|
314
|
+
return `Loop failed: ${result.error}`;
|
|
315
|
+
}
|
|
316
|
+
//# sourceMappingURL=tools.js.map
|
|
@@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AC,KAAK,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAC/I,CAAC;IACD,OAAO,yBAAyB,MAAM,CAAC,KAAK,EAAE,CAAC;AACjD,CAAC;AAED,SAAS,gBAAgB,CAAC,MAAsB;IAC9C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,OAAO,kCAAkC,MAAM,CAAC,QAAQ,cAAc,MAAM,CAAC,SAAS,EAAE,CAAC;IAC3F,CAAC;IACD,OAAO,0BAA0B,MAAM,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,SAAS,eAAe,CAAC,MAAqB;IAC5C,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,IAAI,IAAI,GAAG,+CAA+C,MAAM,CAAC,UAAU,EAAE,CAAC;QAC9E,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9B,IAAI,IAAI,cAAc,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;QAChD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,gBAAgB,MAAM,CAAC,KAAK,EAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Presets for Ralph Loop
|
|
3
|
+
* Pre-configured settings for common development scenarios
|
|
4
|
+
*/
|
|
5
|
+
export interface PresetConfig {
|
|
6
|
+
name: string;
|
|
7
|
+
description: string;
|
|
8
|
+
maxIterations: number;
|
|
9
|
+
validate: boolean;
|
|
10
|
+
commit: boolean;
|
|
11
|
+
completionPromise?: string;
|
|
12
|
+
promptPrefix?: string;
|
|
13
|
+
rateLimit?: number;
|
|
14
|
+
circuitBreaker?: {
|
|
15
|
+
maxConsecutiveFailures: number;
|
|
16
|
+
maxSameErrorCount: number;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
export declare const PRESETS: Record<string, PresetConfig>;
|
|
20
|
+
/**
|
|
21
|
+
* Get a preset by name
|
|
22
|
+
*/
|
|
23
|
+
export declare function getPreset(name: string): PresetConfig | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Get all available preset names
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPresetNames(): string[];
|
|
28
|
+
/**
|
|
29
|
+
* Get presets grouped by category
|
|
30
|
+
*/
|
|
31
|
+
export declare function getPresetsByCategory(): Record<string, PresetConfig[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Format presets for CLI help
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatPresetsHelp(): string;
|
|
36
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,OAAO,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE;QACf,sBAAsB,EAAE,MAAM,CAAC;QAC/B,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAqNhD,CAAC;AAEF;;GAEG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAEhE;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,EAAE,CAEzC;AAED;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,CAqBrE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAa1C"}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workflow Presets for Ralph Loop
|
|
3
|
+
* Pre-configured settings for common development scenarios
|
|
4
|
+
*/
|
|
5
|
+
export const PRESETS = {
|
|
6
|
+
// Development presets
|
|
7
|
+
feature: {
|
|
8
|
+
name: 'feature',
|
|
9
|
+
description: 'Standard feature implementation with validation and commits',
|
|
10
|
+
maxIterations: 30,
|
|
11
|
+
validate: true,
|
|
12
|
+
commit: true,
|
|
13
|
+
completionPromise: 'FEATURE_COMPLETE',
|
|
14
|
+
circuitBreaker: {
|
|
15
|
+
maxConsecutiveFailures: 3,
|
|
16
|
+
maxSameErrorCount: 5,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
'feature-minimal': {
|
|
20
|
+
name: 'feature-minimal',
|
|
21
|
+
description: 'Quick feature implementation without validation',
|
|
22
|
+
maxIterations: 20,
|
|
23
|
+
validate: false,
|
|
24
|
+
commit: true,
|
|
25
|
+
},
|
|
26
|
+
'tdd-red-green': {
|
|
27
|
+
name: 'tdd-red-green',
|
|
28
|
+
description: 'Test-driven development: write failing test, then implement',
|
|
29
|
+
maxIterations: 50,
|
|
30
|
+
validate: true,
|
|
31
|
+
commit: true,
|
|
32
|
+
promptPrefix: 'Follow strict TDD: 1) Write a failing test first, 2) Run tests to confirm failure, 3) Implement minimum code to pass, 4) Refactor if needed. Commit after each green test.',
|
|
33
|
+
circuitBreaker: {
|
|
34
|
+
maxConsecutiveFailures: 5,
|
|
35
|
+
maxSameErrorCount: 3,
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
'spec-driven': {
|
|
39
|
+
name: 'spec-driven',
|
|
40
|
+
description: 'Implementation driven by specification files',
|
|
41
|
+
maxIterations: 40,
|
|
42
|
+
validate: true,
|
|
43
|
+
commit: true,
|
|
44
|
+
promptPrefix: 'Read the specification files in specs/ directory. Implement according to the requirements. Mark tasks complete in IMPLEMENTATION_PLAN.md as you finish them.',
|
|
45
|
+
completionPromise: '<promise>COMPLETE</promise>',
|
|
46
|
+
},
|
|
47
|
+
refactor: {
|
|
48
|
+
name: 'refactor',
|
|
49
|
+
description: 'Safe refactoring with continuous test validation',
|
|
50
|
+
maxIterations: 40,
|
|
51
|
+
validate: true,
|
|
52
|
+
commit: true,
|
|
53
|
+
promptPrefix: 'Refactor the code while maintaining all tests passing. Make small, incremental changes. Commit after each successful refactoring step.',
|
|
54
|
+
circuitBreaker: {
|
|
55
|
+
maxConsecutiveFailures: 2,
|
|
56
|
+
maxSameErrorCount: 3,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
// Debugging presets
|
|
60
|
+
debug: {
|
|
61
|
+
name: 'debug',
|
|
62
|
+
description: 'Debugging session without auto-commits',
|
|
63
|
+
maxIterations: 20,
|
|
64
|
+
validate: false,
|
|
65
|
+
commit: false,
|
|
66
|
+
promptPrefix: 'Debug the issue step by step. Add logging, analyze outputs, identify root cause. Document findings.',
|
|
67
|
+
},
|
|
68
|
+
'incident-response': {
|
|
69
|
+
name: 'incident-response',
|
|
70
|
+
description: 'Quick fix for production incidents',
|
|
71
|
+
maxIterations: 15,
|
|
72
|
+
validate: true,
|
|
73
|
+
commit: true,
|
|
74
|
+
promptPrefix: 'This is a production incident. Focus on the minimal fix. Avoid refactoring. Document the issue and solution.',
|
|
75
|
+
circuitBreaker: {
|
|
76
|
+
maxConsecutiveFailures: 2,
|
|
77
|
+
maxSameErrorCount: 2,
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
'code-archaeology': {
|
|
81
|
+
name: 'code-archaeology',
|
|
82
|
+
description: 'Investigate and document legacy code',
|
|
83
|
+
maxIterations: 30,
|
|
84
|
+
validate: false,
|
|
85
|
+
commit: false,
|
|
86
|
+
promptPrefix: 'Investigate the codebase to understand how it works. Add documentation and comments. Create diagrams if helpful.',
|
|
87
|
+
},
|
|
88
|
+
// Review presets
|
|
89
|
+
review: {
|
|
90
|
+
name: 'review',
|
|
91
|
+
description: 'Code review and suggestions',
|
|
92
|
+
maxIterations: 10,
|
|
93
|
+
validate: true,
|
|
94
|
+
commit: false,
|
|
95
|
+
promptPrefix: 'Review the code for: bugs, security issues, performance problems, code quality. Suggest improvements but do not implement.',
|
|
96
|
+
},
|
|
97
|
+
'pr-review': {
|
|
98
|
+
name: 'pr-review',
|
|
99
|
+
description: 'Pull request review',
|
|
100
|
+
maxIterations: 10,
|
|
101
|
+
validate: true,
|
|
102
|
+
commit: false,
|
|
103
|
+
promptPrefix: 'Review the changes in this PR. Check for: correctness, test coverage, documentation, breaking changes. Provide actionable feedback.',
|
|
104
|
+
},
|
|
105
|
+
'adversarial-review': {
|
|
106
|
+
name: 'adversarial-review',
|
|
107
|
+
description: 'Security-focused adversarial review',
|
|
108
|
+
maxIterations: 15,
|
|
109
|
+
validate: false,
|
|
110
|
+
commit: false,
|
|
111
|
+
promptPrefix: 'Perform an adversarial security review. Look for: injection vulnerabilities, authentication bypasses, authorization issues, data leaks, OWASP Top 10.',
|
|
112
|
+
},
|
|
113
|
+
// Documentation presets
|
|
114
|
+
docs: {
|
|
115
|
+
name: 'docs',
|
|
116
|
+
description: 'Generate documentation',
|
|
117
|
+
maxIterations: 20,
|
|
118
|
+
validate: false,
|
|
119
|
+
commit: true,
|
|
120
|
+
promptPrefix: 'Generate comprehensive documentation. Include: API docs, usage examples, architecture overview. Use clear language.',
|
|
121
|
+
},
|
|
122
|
+
'documentation-first': {
|
|
123
|
+
name: 'documentation-first',
|
|
124
|
+
description: 'Write docs before implementation',
|
|
125
|
+
maxIterations: 30,
|
|
126
|
+
validate: false,
|
|
127
|
+
commit: true,
|
|
128
|
+
promptPrefix: 'Write documentation first, then implement. Document: purpose, API, usage examples, edge cases. Implementation must match documentation.',
|
|
129
|
+
},
|
|
130
|
+
// Specialized presets
|
|
131
|
+
'api-design': {
|
|
132
|
+
name: 'api-design',
|
|
133
|
+
description: 'API design and implementation',
|
|
134
|
+
maxIterations: 35,
|
|
135
|
+
validate: true,
|
|
136
|
+
commit: true,
|
|
137
|
+
promptPrefix: 'Design and implement the API following REST best practices. Include: proper HTTP methods, status codes, error handling, validation, documentation.',
|
|
138
|
+
},
|
|
139
|
+
'migration-safety': {
|
|
140
|
+
name: 'migration-safety',
|
|
141
|
+
description: 'Safe database/data migrations',
|
|
142
|
+
maxIterations: 25,
|
|
143
|
+
validate: true,
|
|
144
|
+
commit: true,
|
|
145
|
+
promptPrefix: 'Create safe migrations. Ensure: reversibility, no data loss, backward compatibility, proper testing. Create rollback scripts.',
|
|
146
|
+
circuitBreaker: {
|
|
147
|
+
maxConsecutiveFailures: 1,
|
|
148
|
+
maxSameErrorCount: 2,
|
|
149
|
+
},
|
|
150
|
+
},
|
|
151
|
+
'performance-optimization': {
|
|
152
|
+
name: 'performance-optimization',
|
|
153
|
+
description: 'Performance analysis and optimization',
|
|
154
|
+
maxIterations: 30,
|
|
155
|
+
validate: true,
|
|
156
|
+
commit: true,
|
|
157
|
+
promptPrefix: 'Analyze and optimize performance. Profile first, identify bottlenecks, make targeted improvements. Document performance gains.',
|
|
158
|
+
},
|
|
159
|
+
'scientific-method': {
|
|
160
|
+
name: 'scientific-method',
|
|
161
|
+
description: 'Hypothesis-driven development',
|
|
162
|
+
maxIterations: 40,
|
|
163
|
+
validate: true,
|
|
164
|
+
commit: true,
|
|
165
|
+
promptPrefix: 'Follow the scientific method: 1) Observe the problem, 2) Form a hypothesis, 3) Design an experiment (test), 4) Implement and test, 5) Analyze results, 6) Iterate.',
|
|
166
|
+
},
|
|
167
|
+
research: {
|
|
168
|
+
name: 'research',
|
|
169
|
+
description: 'Research and exploration',
|
|
170
|
+
maxIterations: 25,
|
|
171
|
+
validate: false,
|
|
172
|
+
commit: false,
|
|
173
|
+
promptPrefix: 'Research the topic thoroughly. Explore options, compare alternatives, document findings. Create a summary report.',
|
|
174
|
+
},
|
|
175
|
+
'gap-analysis': {
|
|
176
|
+
name: 'gap-analysis',
|
|
177
|
+
description: 'Compare spec to implementation',
|
|
178
|
+
maxIterations: 20,
|
|
179
|
+
validate: true,
|
|
180
|
+
commit: false,
|
|
181
|
+
promptPrefix: 'Compare the specification to the current implementation. Identify gaps, missing features, and discrepancies. Create a prioritized TODO list.',
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
/**
|
|
185
|
+
* Get a preset by name
|
|
186
|
+
*/
|
|
187
|
+
export function getPreset(name) {
|
|
188
|
+
return PRESETS[name];
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Get all available preset names
|
|
192
|
+
*/
|
|
193
|
+
export function getPresetNames() {
|
|
194
|
+
return Object.keys(PRESETS);
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Get presets grouped by category
|
|
198
|
+
*/
|
|
199
|
+
export function getPresetsByCategory() {
|
|
200
|
+
return {
|
|
201
|
+
Development: [
|
|
202
|
+
PRESETS.feature,
|
|
203
|
+
PRESETS['feature-minimal'],
|
|
204
|
+
PRESETS['tdd-red-green'],
|
|
205
|
+
PRESETS['spec-driven'],
|
|
206
|
+
PRESETS.refactor,
|
|
207
|
+
],
|
|
208
|
+
Debugging: [PRESETS.debug, PRESETS['incident-response'], PRESETS['code-archaeology']],
|
|
209
|
+
Review: [PRESETS.review, PRESETS['pr-review'], PRESETS['adversarial-review']],
|
|
210
|
+
Documentation: [PRESETS.docs, PRESETS['documentation-first']],
|
|
211
|
+
Specialized: [
|
|
212
|
+
PRESETS['api-design'],
|
|
213
|
+
PRESETS['migration-safety'],
|
|
214
|
+
PRESETS['performance-optimization'],
|
|
215
|
+
PRESETS['scientific-method'],
|
|
216
|
+
PRESETS.research,
|
|
217
|
+
PRESETS['gap-analysis'],
|
|
218
|
+
],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* Format presets for CLI help
|
|
223
|
+
*/
|
|
224
|
+
export function formatPresetsHelp() {
|
|
225
|
+
const categories = getPresetsByCategory();
|
|
226
|
+
const lines = ['Available presets:', ''];
|
|
227
|
+
for (const [category, presets] of Object.entries(categories)) {
|
|
228
|
+
lines.push(` ${category}:`);
|
|
229
|
+
for (const preset of presets) {
|
|
230
|
+
lines.push(` ${preset.name.padEnd(22)} ${preset.description}`);
|
|
231
|
+
}
|
|
232
|
+
lines.push('');
|
|
233
|
+
}
|
|
234
|
+
return lines.join('\n');
|
|
235
|
+
}
|
|
236
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/presets/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAiBH,MAAM,CAAC,MAAM,OAAO,GAAiC;IACnD,sBAAsB;IACtB,OAAO,EAAE;QACP,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,6DAA6D;QAC1E,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,iBAAiB,EAAE,kBAAkB;QACrC,cAAc,EAAE;YACd,sBAAsB,EAAE,CAAC;YACzB,iBAAiB,EAAE,CAAC;SACrB;KACF;IAED,iBAAiB,EAAE;QACjB,IAAI,EAAE,iBAAiB;QACvB,WAAW,EAAE,iDAAiD;QAC9D,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,KAAK;QACf,MAAM,EAAE,IAAI;KACb;IAED,eAAe,EAAE;QACf,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,6DAA6D;QAC1E,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,EAAE,IAAI;QACZ,YAAY,EACV,4KAA4K;QAC9K,cAAc,EAAE;YACd,sBAAsB,EAAE,CAAC;YACzB,iBAAiB,EAAE,CAAC;SACrB;KACF;IAED,aAAa,EAAE;QACb,IAAI,EAAE,aAAa;QACnB,WAAW,EAAE,8CAA8C;QAC3D,aAAa,EAAE,EAAE;QACjB,QAAQ,EAAE,IAAI;QACd,MAAM,E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,WAAW,EAAE;YACX,OAAO,CAAC,YAAY,CAAC;YACrB,OAAO,CAAC,kBAAkB,CAAC;YAC3B,OAAO,CAAC,0BAA0B,CAAC;YACnC,OAAO,CAAC,mBAAmB,CAAC;YAC5B,OAAO,CAAC,QAAQ;YAChB,OAAO,CAAC,cAAc,CAAC;SACxB;KACF,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAC1C,MAAM,KAAK,GAAa,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IAEnD,KAAK,MAAM,CAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC7D,KAAK,CAAC,IAAI,CAAC,KAAK,QAAQ,GAAG,CAAC,CAAC;QAC7B,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC7B,KAAK,CAAC,IAAI,CAAC,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;QACpE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACjB,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent Detection for ralph-starter
|
|
3
|
+
* Detects installed AI coding agents (Claude Code, OpenCode, Codex, Aider)
|
|
4
|
+
*/
|
|
5
|
+
export interface AgentInfo {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
command: string;
|
|
9
|
+
versionFlag: string;
|
|
10
|
+
description: string;
|
|
11
|
+
}
|
|
12
|
+
export interface AgentDetectionResult {
|
|
13
|
+
id: string;
|
|
14
|
+
name: string;
|
|
15
|
+
available: boolean;
|
|
16
|
+
version?: string;
|
|
17
|
+
executablePath?: string;
|
|
18
|
+
error?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* List of supported AI agents
|
|
22
|
+
*/
|
|
23
|
+
export declare const SUPPORTED_AGENTS: AgentInfo[];
|
|
24
|
+
/**
|
|
25
|
+
* Detect a single agent
|
|
26
|
+
*/
|
|
27
|
+
export declare function detectAgent(agent: AgentInfo): Promise<AgentDetectionResult>;
|
|
28
|
+
/**
|
|
29
|
+
* Detect all supported agents
|
|
30
|
+
*/
|
|
31
|
+
export declare function detectAllAgents(): Promise<AgentDetectionResult[]>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the first available agent
|
|
34
|
+
*/
|
|
35
|
+
export declare function getFirstAvailableAgent(): Promise<AgentDetectionResult | null>;
|
|
36
|
+
/**
|
|
37
|
+
* Check if Claude Code CLI is available
|
|
38
|
+
*/
|
|
39
|
+
export declare function isClaudeCodeAvailable(): Promise<AgentDetectionResult>;
|
|
40
|
+
/**
|
|
41
|
+
* Quick test to verify Claude Code CLI is functional
|
|
42
|
+
* Uses --version which is fast and doesn't require authentication
|
|
43
|
+
*/
|
|
44
|
+
export declare function testClaudeCodeConnection(): Promise<{
|
|
45
|
+
success: boolean;
|
|
46
|
+
responseTime?: number;
|
|
47
|
+
error?: string;
|
|
48
|
+
}>;
|
|
49
|
+
/**
|
|
50
|
+
* Full test with actual LLM prompt (slower, requires auth)
|
|
51
|
+
*/
|
|
52
|
+
export declare function testClaudeCodeWithPrompt(): Promise<{
|
|
53
|
+
success: boolean;
|
|
54
|
+
responseTime?: number;
|
|
55
|
+
error?: string;
|
|
56
|
+
}>;
|
|
57
|
+
//# sourceMappingURL=agent-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-detector.d.ts","sourceRoot":"","sources":["../../src/setup/agent-detector.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAIH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAA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