workspace-maxxing 0.1.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/.agents/skills/workspace-maxxing/.workspace-templates/CONTEXT.md +44 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/SYSTEM.md +44 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/anti-patterns.md +16 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/iron-laws.md +26 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/references/reporting-format.md +52 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/benchmark.ts +171 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/dispatch.ts +473 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/generate-tests.ts +158 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/install-tool.ts +82 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/iterate.ts +265 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/orchestrator.ts +539 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/scaffold.ts +282 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/scripts/validate.ts +452 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/architecture/SKILL.md +95 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/fixer/SKILL.md +109 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/iteration/SKILL.md +89 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/research/SKILL.md +94 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/testing/SKILL.md +89 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/tooling/SKILL.md +87 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/validation/SKILL.md +103 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/skills/worker/SKILL.md +79 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
- package/.agents/skills/workspace-maxxing/.workspace-templates/workspace/README.md +14 -0
- package/.agents/skills/workspace-maxxing/SKILL.md +312 -0
- package/.agents/skills/workspace-maxxing/scripts/benchmark.ts +171 -0
- package/.agents/skills/workspace-maxxing/scripts/dispatch.ts +473 -0
- package/.agents/skills/workspace-maxxing/scripts/generate-tests.ts +158 -0
- package/.agents/skills/workspace-maxxing/scripts/install-tool.ts +82 -0
- package/.agents/skills/workspace-maxxing/scripts/iterate.ts +265 -0
- package/.agents/skills/workspace-maxxing/scripts/orchestrator.ts +539 -0
- package/.agents/skills/workspace-maxxing/scripts/scaffold.ts +282 -0
- package/.agents/skills/workspace-maxxing/scripts/validate.ts +452 -0
- package/README.md +144 -0
- package/dist/agent-creator.d.ts +9 -0
- package/dist/agent-creator.d.ts.map +1 -0
- package/dist/agent-creator.js +199 -0
- package/dist/agent-creator.js.map +1 -0
- package/dist/agent-iterator.d.ts +38 -0
- package/dist/agent-iterator.d.ts.map +1 -0
- package/dist/agent-iterator.js +327 -0
- package/dist/agent-iterator.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +197 -0
- package/dist/index.js.map +1 -0
- package/dist/install.d.ts +18 -0
- package/dist/install.d.ts.map +1 -0
- package/dist/install.js +117 -0
- package/dist/install.js.map +1 -0
- package/dist/platforms/claude.d.ts +7 -0
- package/dist/platforms/claude.d.ts.map +1 -0
- package/dist/platforms/claude.js +70 -0
- package/dist/platforms/claude.js.map +1 -0
- package/dist/platforms/copilot.d.ts +7 -0
- package/dist/platforms/copilot.d.ts.map +1 -0
- package/dist/platforms/copilot.js +75 -0
- package/dist/platforms/copilot.js.map +1 -0
- package/dist/platforms/gemini.d.ts +7 -0
- package/dist/platforms/gemini.d.ts.map +1 -0
- package/dist/platforms/gemini.js +81 -0
- package/dist/platforms/gemini.js.map +1 -0
- package/dist/platforms/index.d.ts +8 -0
- package/dist/platforms/index.d.ts.map +1 -0
- package/dist/platforms/index.js +41 -0
- package/dist/platforms/index.js.map +1 -0
- package/dist/platforms/opencode.d.ts +7 -0
- package/dist/platforms/opencode.d.ts.map +1 -0
- package/dist/platforms/opencode.js +70 -0
- package/dist/platforms/opencode.js.map +1 -0
- package/dist/scripts/benchmark.d.ts +20 -0
- package/dist/scripts/benchmark.d.ts.map +1 -0
- package/dist/scripts/benchmark.js +170 -0
- package/dist/scripts/benchmark.js.map +1 -0
- package/dist/scripts/dispatch.d.ts +32 -0
- package/dist/scripts/dispatch.d.ts.map +1 -0
- package/dist/scripts/dispatch.js +386 -0
- package/dist/scripts/dispatch.js.map +1 -0
- package/dist/scripts/generate-tests.d.ts +11 -0
- package/dist/scripts/generate-tests.d.ts.map +1 -0
- package/dist/scripts/generate-tests.js +118 -0
- package/dist/scripts/generate-tests.js.map +1 -0
- package/dist/scripts/install-tool.d.ts +8 -0
- package/dist/scripts/install-tool.d.ts.map +1 -0
- package/dist/scripts/install-tool.js +98 -0
- package/dist/scripts/install-tool.js.map +1 -0
- package/dist/scripts/iterate.d.ts +44 -0
- package/dist/scripts/iterate.d.ts.map +1 -0
- package/dist/scripts/iterate.js +260 -0
- package/dist/scripts/iterate.js.map +1 -0
- package/dist/scripts/orchestrator.d.ts +40 -0
- package/dist/scripts/orchestrator.d.ts.map +1 -0
- package/dist/scripts/orchestrator.js +378 -0
- package/dist/scripts/orchestrator.js.map +1 -0
- package/dist/scripts/scaffold.d.ts +8 -0
- package/dist/scripts/scaffold.d.ts.map +1 -0
- package/dist/scripts/scaffold.js +279 -0
- package/dist/scripts/scaffold.js.map +1 -0
- package/dist/scripts/validate.d.ts +11 -0
- package/dist/scripts/validate.d.ts.map +1 -0
- package/dist/scripts/validate.js +472 -0
- package/dist/scripts/validate.js.map +1 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-iteration-plan.md +1123 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-iteration-sub-agent-batches.md +1923 -0
- package/docs/superpowers/plans/2026-04-07-autonomous-workflow-sub-skill-plan.md +1505 -0
- package/docs/superpowers/plans/2026-04-07-benchmarking-multi-agent-plan.md +854 -0
- package/docs/superpowers/plans/2026-04-07-workspace-builder-logic-plan.md +1426 -0
- package/docs/superpowers/plans/2026-04-07-workspace-maxxing-plan.md +1299 -0
- package/docs/superpowers/plans/2026-04-08-session-294c-subagent-invocation-plan.md +320 -0
- package/docs/superpowers/plans/2026-04-08-workflow-prompt-hardening-plan.md +1025 -0
- package/docs/superpowers/plans/2026-04-12-workspace-agent-creation-plan.md +992 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-iteration-design.md +214 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-iteration-sub-agent-batches-design.md +188 -0
- package/docs/superpowers/specs/2026-04-07-autonomous-workflow-sub-skill-design.md +137 -0
- package/docs/superpowers/specs/2026-04-07-benchmarking-multi-agent-design.md +105 -0
- package/docs/superpowers/specs/2026-04-07-workspace-builder-logic-design.md +179 -0
- package/docs/superpowers/specs/2026-04-07-workspace-maxxing-design.md +227 -0
- package/docs/superpowers/specs/2026-04-08-session-294c-subagent-invocation-design.md +265 -0
- package/docs/superpowers/specs/2026-04-08-workflow-prompt-hardening-design.md +146 -0
- package/docs/superpowers/specs/2026-04-12-workspace-agent-creation-design.md +239 -0
- package/jest.config.js +8 -0
- package/package.json +32 -0
- package/src/agent-creator.ts +180 -0
- package/src/agent-iterator.ts +397 -0
- package/src/index.ts +189 -0
- package/src/install.ts +105 -0
- package/src/platforms/claude.ts +40 -0
- package/src/platforms/copilot.ts +50 -0
- package/src/platforms/gemini.ts +55 -0
- package/src/platforms/index.ts +45 -0
- package/src/platforms/opencode.ts +41 -0
- package/src/scripts/benchmark.ts +171 -0
- package/src/scripts/dispatch.ts +473 -0
- package/src/scripts/generate-tests.ts +112 -0
- package/src/scripts/install-tool.ts +82 -0
- package/src/scripts/iterate.ts +271 -0
- package/src/scripts/orchestrator.ts +539 -0
- package/src/scripts/scaffold.ts +282 -0
- package/src/scripts/validate.ts +516 -0
- package/templates/.workspace-templates/CONTEXT.md +44 -0
- package/templates/.workspace-templates/SYSTEM.md +44 -0
- package/templates/.workspace-templates/references/anti-patterns.md +16 -0
- package/templates/.workspace-templates/references/iron-laws.md +26 -0
- package/templates/.workspace-templates/references/reporting-format.md +52 -0
- package/templates/.workspace-templates/scripts/benchmark.ts +171 -0
- package/templates/.workspace-templates/scripts/dispatch.ts +473 -0
- package/templates/.workspace-templates/scripts/generate-tests.ts +158 -0
- package/templates/.workspace-templates/scripts/install-tool.ts +82 -0
- package/templates/.workspace-templates/scripts/iterate.ts +265 -0
- package/templates/.workspace-templates/scripts/orchestrator.ts +539 -0
- package/templates/.workspace-templates/scripts/scaffold.ts +282 -0
- package/templates/.workspace-templates/scripts/validate.ts +452 -0
- package/templates/.workspace-templates/skills/architecture/SKILL.md +95 -0
- package/templates/.workspace-templates/skills/fixer/SKILL.md +109 -0
- package/templates/.workspace-templates/skills/iteration/SKILL.md +89 -0
- package/templates/.workspace-templates/skills/prompt-engineering/SKILL.md +87 -0
- package/templates/.workspace-templates/skills/research/SKILL.md +94 -0
- package/templates/.workspace-templates/skills/testing/SKILL.md +89 -0
- package/templates/.workspace-templates/skills/tooling/SKILL.md +87 -0
- package/templates/.workspace-templates/skills/validation/SKILL.md +103 -0
- package/templates/.workspace-templates/skills/worker/SKILL.md +79 -0
- package/templates/.workspace-templates/workspace/00-meta/CONTEXT.md +6 -0
- package/templates/.workspace-templates/workspace/00-meta/execution-log.md +27 -0
- package/templates/.workspace-templates/workspace/01-input/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/02-process/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/03-output/CONTEXT.md +29 -0
- package/templates/.workspace-templates/workspace/README.md +14 -0
- package/templates/SKILL.md +347 -0
- package/tests/benchmark.test.ts +158 -0
- package/tests/cli.test.ts +109 -0
- package/tests/dispatch-parallel.test.ts +124 -0
- package/tests/dispatch.test.ts +218 -0
- package/tests/fixer-skill.test.ts +203 -0
- package/tests/generate-tests.test.ts +101 -0
- package/tests/install-tool.test.ts +141 -0
- package/tests/install.test.ts +144 -0
- package/tests/integration.test.ts +324 -0
- package/tests/iterate.test.ts +219 -0
- package/tests/orchestrator.test.ts +710 -0
- package/tests/scaffold.test.ts +238 -0
- package/tests/templates-enhanced.test.ts +208 -0
- package/tests/templates.test.ts +219 -0
- package/tests/validate.test.ts +421 -0
- package/tests/validation-enhanced.test.ts +303 -0
- package/tests/worker-skill.test.ts +88 -0
- package/tsconfig.json +19 -0
- package/workspace/00-meta/CONTEXT.md +3 -0
- package/workspace/00-meta/execution-log.md +17 -0
- package/workspace/00-meta/tools.md +11 -0
- package/workspace/01-input/CONTEXT.md +27 -0
- package/workspace/CONTEXT.md +35 -0
- package/workspace/README.md +14 -0
- package/workspace/SYSTEM.md +36 -0
- package/workspace-maxxing-0.1.0.tgz +0 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.generateAgentName = generateAgentName;
|
|
37
|
+
exports.createAgent = createAgent;
|
|
38
|
+
const fs = __importStar(require("fs"));
|
|
39
|
+
const path = __importStar(require("path"));
|
|
40
|
+
function generateAgentName(purpose) {
|
|
41
|
+
// Convert "Daily Digest" -> "@daily-digest"
|
|
42
|
+
// Convert "AI News Aggregator" -> "@ai-news-aggregator"
|
|
43
|
+
const cleaned = purpose
|
|
44
|
+
.toLowerCase()
|
|
45
|
+
.replace(/[^a-z0-9\s-]/g, '')
|
|
46
|
+
.replace(/\s+/g, '-')
|
|
47
|
+
.replace(/-+/g, '-')
|
|
48
|
+
.trim();
|
|
49
|
+
return `@${cleaned}`;
|
|
50
|
+
}
|
|
51
|
+
function createAgent(options) {
|
|
52
|
+
const { name, purpose, workspacePath } = options;
|
|
53
|
+
// Remove @ prefix for directory name
|
|
54
|
+
const dirName = name.startsWith('@') ? name.slice(1) : name;
|
|
55
|
+
const agentDir = path.join(workspacePath, '.agents', 'skills', dirName);
|
|
56
|
+
// Create directory structure
|
|
57
|
+
fs.mkdirSync(path.join(agentDir, 'prompts', 'tasks'), { recursive: true });
|
|
58
|
+
fs.mkdirSync(path.join(agentDir, 'tools'), { recursive: true });
|
|
59
|
+
fs.mkdirSync(path.join(agentDir, 'tests'), { recursive: true });
|
|
60
|
+
// Write SKILL.md
|
|
61
|
+
const skillContent = generateSkillMd(name, purpose);
|
|
62
|
+
fs.writeFileSync(path.join(agentDir, 'SKILL.md'), skillContent);
|
|
63
|
+
// Write config.json
|
|
64
|
+
const configContent = JSON.stringify({
|
|
65
|
+
name,
|
|
66
|
+
purpose,
|
|
67
|
+
platforms: options.platforms ?? ['opencode', 'claude', 'copilot', 'gemini'],
|
|
68
|
+
robustnessThreshold: 85,
|
|
69
|
+
iterationCount: 0,
|
|
70
|
+
testCases: [],
|
|
71
|
+
}, null, 2);
|
|
72
|
+
fs.writeFileSync(path.join(agentDir, 'config.json'), configContent);
|
|
73
|
+
// Write prompts/system.md
|
|
74
|
+
const systemPrompt = generateSystemPrompt(name, purpose);
|
|
75
|
+
fs.writeFileSync(path.join(agentDir, 'prompts', 'system.md'), systemPrompt);
|
|
76
|
+
// Write prompts/tasks/ default task prompt
|
|
77
|
+
const taskPrompt = generateTaskPrompt(name, purpose);
|
|
78
|
+
fs.writeFileSync(path.join(agentDir, 'prompts', 'tasks', 'default.md'), taskPrompt);
|
|
79
|
+
console.log(`Agent "${name}" created at: ${agentDir}`);
|
|
80
|
+
}
|
|
81
|
+
function generateSkillMd(name, purpose) {
|
|
82
|
+
const dirName = name.startsWith('@') ? name.slice(1) : name;
|
|
83
|
+
return `---
|
|
84
|
+
name: ${name}
|
|
85
|
+
description: "${purpose}. Use when user wants to run this workflow."
|
|
86
|
+
triggers: ["${name}", "${purpose.toLowerCase()}", "run ${dirName} workflow"]
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
# ${name} Agent
|
|
90
|
+
|
|
91
|
+
## Purpose
|
|
92
|
+
${purpose}
|
|
93
|
+
|
|
94
|
+
## When to Use
|
|
95
|
+
- User wants to execute the workflow
|
|
96
|
+
- User asks to process inputs and generate outputs
|
|
97
|
+
- User wants to run automated tasks
|
|
98
|
+
|
|
99
|
+
## The Iron Law
|
|
100
|
+
|
|
101
|
+
NO SKIPPING WORKFLOW STEPS
|
|
102
|
+
NO IMPLEMENTATION BEFORE PLAN
|
|
103
|
+
NO CLAIMING DONE WITHOUT OUTPUT
|
|
104
|
+
|
|
105
|
+
## Capabilities
|
|
106
|
+
- Execute workflow tasks following ICM stage boundaries
|
|
107
|
+
- Process inputs from 01-input/ and generate outputs in 03-output/
|
|
108
|
+
- Read workspace context (SYSTEM.md, stage CONTEXT.md)
|
|
109
|
+
- Produce structured markdown outputs
|
|
110
|
+
|
|
111
|
+
## How It Works
|
|
112
|
+
|
|
113
|
+
1. **Read Context** - Load SYSTEM.md, root CONTEXT.md, and relevant stage CONTEXT.md
|
|
114
|
+
2. **Process Task** - Execute the requested workflow step
|
|
115
|
+
3. **Write Output** - Save results to appropriate stage folder
|
|
116
|
+
4. **Report** - Provide summary in chat + log to file
|
|
117
|
+
|
|
118
|
+
## Output Format
|
|
119
|
+
|
|
120
|
+
- Stage outputs as markdown files in numbered folders
|
|
121
|
+
- Progress reported in hybrid format (chat summary + file details)
|
|
122
|
+
- Results logged for traceability
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
See config.json for agent configuration options.
|
|
126
|
+
|
|
127
|
+
## Anti-Rationalization
|
|
128
|
+
|
|
129
|
+
| Thought | Reality |
|
|
130
|
+
|---------|----------|
|
|
131
|
+
| "I know what to do" | Read the stage CONTEXT.md first |
|
|
132
|
+
| "Good enough" | Follow the workflow exactly |
|
|
133
|
+
| "Skip a stage" | Workflow stages exist for a reason |
|
|
134
|
+
| "No output needed" | Every task produces artifacts |
|
|
135
|
+
`;
|
|
136
|
+
}
|
|
137
|
+
function generateSystemPrompt(name, purpose) {
|
|
138
|
+
const dirName = name.startsWith('@') ? name.slice(1) : name;
|
|
139
|
+
return `# ${name} - System Prompt
|
|
140
|
+
|
|
141
|
+
## Role
|
|
142
|
+
You are ${name}, an autonomous workflow agent that executes the ${purpose} workflow.
|
|
143
|
+
|
|
144
|
+
## Workspace Context
|
|
145
|
+
- Read \`SYSTEM.md\` first for global rules
|
|
146
|
+
- Load root \`CONTEXT.md\` for routing
|
|
147
|
+
- Read relevant stage \`CONTEXT.md\` for specific instructions
|
|
148
|
+
|
|
149
|
+
## Workflow Execution
|
|
150
|
+
|
|
151
|
+
1. **Understand the request** - What does the user want to accomplish?
|
|
152
|
+
2. **Load appropriate context** - Read only the needed stage files
|
|
153
|
+
3. **Execute the task** - Follow the stage-specific instructions
|
|
154
|
+
4. **Produce output** - Write results to the appropriate folder
|
|
155
|
+
5. **Report progress** - Provide summary in chat + log to file
|
|
156
|
+
|
|
157
|
+
## Stage Boundaries
|
|
158
|
+
- \`01-input/\` - Input collection and validation
|
|
159
|
+
- \`02-process/\` - Processing and transformation
|
|
160
|
+
- \`03-output/\` - Output generation and delivery
|
|
161
|
+
- \`00-meta/\` - Configuration and tools
|
|
162
|
+
|
|
163
|
+
## Constraints
|
|
164
|
+
- Stay within workspace scope
|
|
165
|
+
- Follow ICM folder boundaries strictly
|
|
166
|
+
- Do not create product implementation code
|
|
167
|
+
- Keep outputs as markdown artifacts
|
|
168
|
+
- Report progress in hybrid format (chat + files)
|
|
169
|
+
|
|
170
|
+
## Error Handling
|
|
171
|
+
- If context is missing, ask for clarification
|
|
172
|
+
- If stage dependencies are unclear, check execution-log.md
|
|
173
|
+
- If task is outside workspace scope, redirect to workflow design
|
|
174
|
+
`;
|
|
175
|
+
}
|
|
176
|
+
function generateTaskPrompt(name, purpose) {
|
|
177
|
+
return `# Default Task Prompt
|
|
178
|
+
|
|
179
|
+
## Task
|
|
180
|
+
Execute the workflow request from the user.
|
|
181
|
+
|
|
182
|
+
## Input
|
|
183
|
+
Read the user's request and determine which workflow stage applies.
|
|
184
|
+
|
|
185
|
+
## Process
|
|
186
|
+
1. Load the relevant stage context
|
|
187
|
+
2. Follow the stage's completion criteria
|
|
188
|
+
3. Produce the required outputs
|
|
189
|
+
|
|
190
|
+
## Output
|
|
191
|
+
Write results to the appropriate stage folder as markdown artifacts.
|
|
192
|
+
|
|
193
|
+
## Success Criteria
|
|
194
|
+
- Output conforms to stage purpose
|
|
195
|
+
- Required evidence is produced
|
|
196
|
+
- Handoff notes updated for next stage
|
|
197
|
+
`;
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=agent-creator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-creator.js","sourceRoot":"","sources":["../src/agent-creator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,8CAUC;AAED,kCAoCC;AA1DD,uCAAyB;AACzB,2CAA6B;AAS7B,SAAgB,iBAAiB,CAAC,OAAe;IAC/C,4CAA4C;IAC5C,wDAAwD;IACxD,MAAM,OAAO,GAAG,OAAO;SACpB,WAAW,EAAE;SACb,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC;SAC5B,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC;SACnB,IAAI,EAAE,CAAC;IACV,OAAO,IAAI,OAAO,EAAE,CAAC;AACvB,CAAC;AAED,SAAgB,WAAW,CAAC,OAAqB;IAC/C,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC;IAEjD,qCAAqC;IACrC,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,C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38 @@
|
|
|
1
|
+
export interface AgentIterationOptions {
|
|
2
|
+
agentPath: string;
|
|
3
|
+
workspacePath: string;
|
|
4
|
+
threshold?: number;
|
|
5
|
+
maxIterations?: number;
|
|
6
|
+
}
|
|
7
|
+
export interface AgentIterationResult {
|
|
8
|
+
score: number;
|
|
9
|
+
iterations: number;
|
|
10
|
+
testCases: TestCaseResult[];
|
|
11
|
+
passed: boolean;
|
|
12
|
+
improvements: string[];
|
|
13
|
+
}
|
|
14
|
+
export interface TestCaseResult {
|
|
15
|
+
id: string;
|
|
16
|
+
input: string;
|
|
17
|
+
expected: string;
|
|
18
|
+
output: string;
|
|
19
|
+
passed: boolean;
|
|
20
|
+
issues: string[];
|
|
21
|
+
}
|
|
22
|
+
export interface AgentConfig {
|
|
23
|
+
name: string;
|
|
24
|
+
purpose: string;
|
|
25
|
+
platforms: string[];
|
|
26
|
+
robustnessThreshold: number;
|
|
27
|
+
iterationCount: number;
|
|
28
|
+
lastScore?: number;
|
|
29
|
+
testCases: TestCaseRecord[];
|
|
30
|
+
}
|
|
31
|
+
interface TestCaseRecord {
|
|
32
|
+
id: string;
|
|
33
|
+
input: string;
|
|
34
|
+
expected: string;
|
|
35
|
+
}
|
|
36
|
+
export declare function iterateAgent(options: AgentIterationOptions): Promise<AgentIterationResult>;
|
|
37
|
+
export {};
|
|
38
|
+
//# sourceMappingURL=agent-iterator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-iterator.d.ts","sourceRoot":"","sources":["../src/agent-iterator.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,qBAAqB;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,cAAc,EAAE,CAAC;IAC5B,MAAM,EAAE,OAAO,CAAC;IAChB,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,OAAO,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,cAAc,EAAE,CAAC;CAC7B;AAED,UAAU,cAAc;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAkFhG"}
|
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.iterateAgent = iterateAgent;
|
|
37
|
+
const fs = __importStar(require("fs"));
|
|
38
|
+
const path = __importStar(require("path"));
|
|
39
|
+
async function iterateAgent(options) {
|
|
40
|
+
const { agentPath, workspacePath, threshold = 85, maxIterations = 3, } = options;
|
|
41
|
+
console.log(`\n=== Agent Self-Improvement Loop ===`);
|
|
42
|
+
console.log(`Agent: ${path.basename(agentPath)}`);
|
|
43
|
+
console.log(`Threshold: ${threshold}`);
|
|
44
|
+
console.log(`Max iterations: ${maxIterations}`);
|
|
45
|
+
console.log('');
|
|
46
|
+
const testCasesDir = path.join(agentPath, 'tests');
|
|
47
|
+
// Ensure tests directory exists
|
|
48
|
+
if (!fs.existsSync(testCasesDir)) {
|
|
49
|
+
fs.mkdirSync(testCasesDir, { recursive: true });
|
|
50
|
+
}
|
|
51
|
+
// Load or generate test cases
|
|
52
|
+
const testCases = loadOrGenerateTestCases(testCasesDir, agentPath);
|
|
53
|
+
console.log(`Loaded ${testCases.length} test cases\n`);
|
|
54
|
+
const improvements = [];
|
|
55
|
+
let currentScore = 0;
|
|
56
|
+
for (let iteration = 0; iteration < maxIterations; iteration++) {
|
|
57
|
+
console.log(`--- Iteration ${iteration + 1}/${maxIterations} ---`);
|
|
58
|
+
// Run each test case
|
|
59
|
+
const results = await runTestCases(testCases, agentPath, workspacePath);
|
|
60
|
+
// Calculate score
|
|
61
|
+
const passedCount = results.filter(r => r.passed).length;
|
|
62
|
+
currentScore = Math.round((passedCount / results.length) * 100);
|
|
63
|
+
console.log(`Results: ${passedCount}/${results.length} passed (${currentScore}%)`);
|
|
64
|
+
// Log issues for failed tests
|
|
65
|
+
for (const result of results) {
|
|
66
|
+
if (!result.passed) {
|
|
67
|
+
console.log(` - ${result.id}: ${result.issues.join(', ')}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
if (currentScore >= threshold) {
|
|
71
|
+
console.log(`\n✓ Threshold met (${currentScore} >= ${threshold})! Stopping iteration.`);
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
// Identify issues and attempt improvement
|
|
75
|
+
const allIssues = results.flatMap(r => r.issues);
|
|
76
|
+
if (allIssues.length > 0 && iteration < maxIterations - 1) {
|
|
77
|
+
const improvement = await improveAgent(agentPath, allIssues, iteration + 1);
|
|
78
|
+
if (improvement) {
|
|
79
|
+
improvements.push(improvement);
|
|
80
|
+
console.log(`Improvement applied: ${improvement}\n`);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else if (iteration === maxIterations - 1) {
|
|
84
|
+
console.log(`\n✗ Max iterations reached. Score: ${currentScore}/${threshold}`);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Update config with iteration count
|
|
88
|
+
updateIterationConfig(agentPath, improvements.length, currentScore);
|
|
89
|
+
console.log(`\n=== Iteration Complete ===`);
|
|
90
|
+
console.log(`Final score: ${currentScore}`);
|
|
91
|
+
console.log(`Iterations: ${improvements.length}`);
|
|
92
|
+
console.log(`Passed: ${currentScore >= threshold ? 'Yes' : 'No'}\n`);
|
|
93
|
+
return {
|
|
94
|
+
score: currentScore,
|
|
95
|
+
iterations: improvements.length,
|
|
96
|
+
testCases: [], // Could return detailed results if needed
|
|
97
|
+
passed: currentScore >= threshold,
|
|
98
|
+
improvements,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
function loadOrGenerateTestCases(testsDir, agentPath) {
|
|
102
|
+
const casesPath = path.join(testsDir, 'cases.json');
|
|
103
|
+
// Try to load existing test cases
|
|
104
|
+
if (fs.existsSync(casesPath)) {
|
|
105
|
+
try {
|
|
106
|
+
const loaded = JSON.parse(fs.readFileSync(casesPath, 'utf-8'));
|
|
107
|
+
if (Array.isArray(loaded) && loaded.length > 0) {
|
|
108
|
+
return loaded;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
// Fall through to generation
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// Generate default test cases based on agent purpose
|
|
116
|
+
const config = loadAgentConfig(agentPath);
|
|
117
|
+
const testCases = generateDefaultTestCases(config.purpose);
|
|
118
|
+
// Save generated test cases
|
|
119
|
+
fs.writeFileSync(casesPath, JSON.stringify(testCases, null, 2));
|
|
120
|
+
return testCases;
|
|
121
|
+
}
|
|
122
|
+
function loadAgentConfig(agentPath) {
|
|
123
|
+
const configPath = path.join(agentPath, 'config.json');
|
|
124
|
+
if (fs.existsSync(configPath)) {
|
|
125
|
+
try {
|
|
126
|
+
return JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
// Fall through to defaults
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
name: path.basename(agentPath),
|
|
134
|
+
purpose: 'Execute workflow tasks',
|
|
135
|
+
platforms: ['opencode'],
|
|
136
|
+
robustnessThreshold: 85,
|
|
137
|
+
iterationCount: 0,
|
|
138
|
+
testCases: [],
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
function generateDefaultTestCases(purpose) {
|
|
142
|
+
// Generate edge case, empty, and varied test cases
|
|
143
|
+
return [
|
|
144
|
+
{
|
|
145
|
+
id: 'tc-edge-001',
|
|
146
|
+
input: 'complex input with special characters !@#$%^&*()',
|
|
147
|
+
expected: 'valid output with proper handling',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'tc-empty-001',
|
|
151
|
+
input: '',
|
|
152
|
+
expected: 'graceful handling of empty input',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
id: 'tc-normal-001',
|
|
156
|
+
input: 'standard workflow request',
|
|
157
|
+
expected: 'proper response with required sections',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
id: 'tc-edge-002',
|
|
161
|
+
input: 'a', // Single character
|
|
162
|
+
expected: 'handle minimal input',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
id: 'tc-edge-003',
|
|
166
|
+
input: 'very long input '.repeat(100), // Very long input
|
|
167
|
+
expected: 'handle large input gracefully',
|
|
168
|
+
},
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
async function runTestCases(testCases, agentPath, workspacePath) {
|
|
172
|
+
const results = [];
|
|
173
|
+
for (const tc of testCases) {
|
|
174
|
+
const result = await runSingleTestCase(tc, agentPath, workspacePath);
|
|
175
|
+
results.push(result);
|
|
176
|
+
}
|
|
177
|
+
return results;
|
|
178
|
+
}
|
|
179
|
+
async function runSingleTestCase(tc, agentPath, workspacePath) {
|
|
180
|
+
// Load agent prompts
|
|
181
|
+
const systemPromptPath = path.join(agentPath, 'prompts', 'system.md');
|
|
182
|
+
const config = loadAgentConfig(agentPath);
|
|
183
|
+
let passed = true;
|
|
184
|
+
const issues = [];
|
|
185
|
+
// Simulate validation based on test case characteristics
|
|
186
|
+
// In a real implementation, this would actually execute the agent
|
|
187
|
+
// Check: Empty input handling
|
|
188
|
+
if (tc.input === '') {
|
|
189
|
+
const systemPrompt = fs.existsSync(systemPromptPath)
|
|
190
|
+
? fs.readFileSync(systemPromptPath, 'utf-8')
|
|
191
|
+
: '';
|
|
192
|
+
if (!systemPrompt.toLowerCase().includes('empty') &&
|
|
193
|
+
!systemPrompt.toLowerCase().includes('handle')) {
|
|
194
|
+
passed = false;
|
|
195
|
+
issues.push('No empty input handling in system prompt');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
// Check: Long input handling
|
|
199
|
+
if (tc.input.length > 500) {
|
|
200
|
+
const systemPrompt = fs.existsSync(systemPromptPath)
|
|
201
|
+
? fs.readFileSync(systemPromptPath, 'utf-8')
|
|
202
|
+
: '';
|
|
203
|
+
if (!systemPrompt.toLowerCase().includes('large') &&
|
|
204
|
+
!systemPrompt.toLowerCase().includes('long')) {
|
|
205
|
+
passed = false;
|
|
206
|
+
issues.push('No large input handling in system prompt');
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
// Check: Special characters handling
|
|
210
|
+
if (/[!@#$%^&*()]/.test(tc.input)) {
|
|
211
|
+
const taskPromptPath = path.join(agentPath, 'prompts', 'tasks', 'default.md');
|
|
212
|
+
const taskPrompt = fs.existsSync(taskPromptPath)
|
|
213
|
+
? fs.readFileSync(taskPromptPath, 'utf-8')
|
|
214
|
+
: '';
|
|
215
|
+
if (!taskPrompt.toLowerCase().includes('special') &&
|
|
216
|
+
!taskPrompt.toLowerCase().includes('character')) {
|
|
217
|
+
// Not a critical issue, just a note
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Check: Configuration completeness
|
|
221
|
+
if (!config.purpose || config.purpose.length < 10) {
|
|
222
|
+
passed = false;
|
|
223
|
+
issues.push('Agent purpose not properly configured');
|
|
224
|
+
}
|
|
225
|
+
// Check: Required files exist
|
|
226
|
+
if (!fs.existsSync(systemPromptPath)) {
|
|
227
|
+
passed = false;
|
|
228
|
+
issues.push('Missing system prompt file');
|
|
229
|
+
}
|
|
230
|
+
return {
|
|
231
|
+
id: tc.id,
|
|
232
|
+
input: tc.input,
|
|
233
|
+
expected: tc.expected,
|
|
234
|
+
output: passed ? 'validated' : 'issues found',
|
|
235
|
+
passed,
|
|
236
|
+
issues,
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async function improveAgent(agentPath, issues, iteration) {
|
|
240
|
+
const promptsDir = path.join(agentPath, 'prompts');
|
|
241
|
+
const systemPromptPath = path.join(promptsDir, 'system.md');
|
|
242
|
+
if (!fs.existsSync(systemPromptPath)) {
|
|
243
|
+
// Create prompts directory and system prompt if missing
|
|
244
|
+
fs.mkdirSync(promptsDir, { recursive: true });
|
|
245
|
+
const config = loadAgentConfig(agentPath);
|
|
246
|
+
const systemPrompt = `# ${config.name} - System Prompt
|
|
247
|
+
|
|
248
|
+
## Role
|
|
249
|
+
You are ${config.name}, an autonomous workflow agent that executes the ${config.purpose} workflow.
|
|
250
|
+
|
|
251
|
+
## Workspace Context
|
|
252
|
+
- Read \`SYSTEM.md\` first for global rules
|
|
253
|
+
- Load root \`CONTEXT.md\` for routing
|
|
254
|
+
- Read relevant stage \`CONTEXT.md\` for specific instructions
|
|
255
|
+
|
|
256
|
+
## Workflow Execution
|
|
257
|
+
1. Understand the request
|
|
258
|
+
2. Load appropriate context
|
|
259
|
+
3. Execute the task
|
|
260
|
+
4. Produce output
|
|
261
|
+
5. Report progress
|
|
262
|
+
|
|
263
|
+
## Constraints
|
|
264
|
+
- Stay within workspace scope
|
|
265
|
+
- Follow ICM folder boundaries
|
|
266
|
+
- Produce markdown artifacts
|
|
267
|
+
`;
|
|
268
|
+
fs.writeFileSync(systemPromptPath, systemPrompt);
|
|
269
|
+
}
|
|
270
|
+
const currentContent = fs.readFileSync(systemPromptPath, 'utf-8');
|
|
271
|
+
// Add improvement note to system prompt
|
|
272
|
+
const improvementNote = `\n## Iteration ${iteration} Improvements
|
|
273
|
+
${issues.map(i => `- ${i}`).join('\n')}
|
|
274
|
+
|
|
275
|
+
### Added Constraints
|
|
276
|
+
- Handle empty inputs gracefully
|
|
277
|
+
- Handle large inputs efficiently
|
|
278
|
+
- Handle special characters properly
|
|
279
|
+
`;
|
|
280
|
+
const newContent = currentContent + improvementNote;
|
|
281
|
+
fs.writeFileSync(systemPromptPath, newContent);
|
|
282
|
+
return `Iteration ${iteration}: Added handling for ${issues.length} issue(s)`;
|
|
283
|
+
}
|
|
284
|
+
function updateIterationConfig(agentPath, iterations, score) {
|
|
285
|
+
const configPath = path.join(agentPath, 'config.json');
|
|
286
|
+
if (fs.existsSync(configPath)) {
|
|
287
|
+
try {
|
|
288
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf-8'));
|
|
289
|
+
config.iterationCount = iterations;
|
|
290
|
+
config.lastScore = score;
|
|
291
|
+
fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
// Best effort
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Entry point for CLI
|
|
299
|
+
if (require.main === module) {
|
|
300
|
+
const args = process.argv.slice(2);
|
|
301
|
+
const parseArg = (flag) => {
|
|
302
|
+
const idx = args.indexOf(flag);
|
|
303
|
+
return idx !== -1 ? args[idx + 1] : undefined;
|
|
304
|
+
};
|
|
305
|
+
const agentPath = parseArg('--agent-path');
|
|
306
|
+
const workspacePath = parseArg('--workspace-path') ?? process.cwd();
|
|
307
|
+
const threshold = parseArg('--threshold') ? parseInt(parseArg('--threshold'), 10) : 85;
|
|
308
|
+
const maxIterations = parseArg('--max-iterations') ? parseInt(parseArg('--max-iterations'), 10) : 3;
|
|
309
|
+
if (!agentPath) {
|
|
310
|
+
console.error('Usage: node agent-iterator.ts --agent-path <path> [--workspace-path <path>] [--threshold <n>] [--max-iterations <n>]');
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
iterateAgent({
|
|
314
|
+
agentPath,
|
|
315
|
+
workspacePath,
|
|
316
|
+
threshold,
|
|
317
|
+
maxIterations,
|
|
318
|
+
}).then((result) => {
|
|
319
|
+
console.log('\n=== Final Result ===');
|
|
320
|
+
console.log(JSON.stringify(result, null, 2));
|
|
321
|
+
process.exit(result.passed ? 0 : 1);
|
|
322
|
+
}).catch((error) => {
|
|
323
|
+
console.error('Error:', error);
|
|
324
|
+
process.exit(1);
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=agent-iterator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-iterator.js","sourceRoot":"","sources":["../src/agent-iterator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,oCAkFC;AA7HD,uCAAyB;AACzB,2CAA6B;AA0CtB,KAAK,UAAU,YAAY,CAAC,OAA8B;IAC/D,MAAM,EACJ,SAAS,EACT,aAAa,EACb,SAAS,GAAG,EAAE,EACd,aAAa,GAAG,CAAC,GAClB,GAAG,OAAO,CAAC;IAEZ,OAAO,CAAC,GAAG,CAAC,uCAAuC,CAAC,CAAC;IACrD,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,cAAc,SAAS,EAAE,CAAC,CAAC;IACvC,OAAO,CAAC,GAAG,CAAC,mBAAmB,aAAa,EAAE,CAAC,CAAC;IAChD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IAEnD,gCAAgC;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,EAAE,CAAC,SAAS,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACl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