open-agents-ai 0.138.66 → 0.138.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +33 -4
- package/package.json +1 -1
- package/prompts/agentic/system-small.md +6 -0
package/dist/index.js
CHANGED
|
@@ -22353,6 +22353,35 @@ This task has multiple parts. Do them one at a time:
|
|
|
22353
22353
|
Start with step 1 \u2014 read the relevant files NOW.`
|
|
22354
22354
|
});
|
|
22355
22355
|
}
|
|
22356
|
+
const isGreenfield = /\bcreate\b.*\bnew\b|\bimplement\b.*\bclass\b|\bwrite\b.*\bfrom scratch\b|\bbuild\b.*\bmodule\b/i.test(goal);
|
|
22357
|
+
if (isGreenfield && !isComplex) {
|
|
22358
|
+
messages.push({
|
|
22359
|
+
role: "user",
|
|
22360
|
+
content: `[GREENFIELD TASK \u2014 Write code immediately]
|
|
22361
|
+
|
|
22362
|
+
MANDATORY: Your FIRST tool call MUST be file_write.
|
|
22363
|
+
Write a skeleton with method signatures and inline comments describing each method's logic.
|
|
22364
|
+
Use placeholder implementations (e.g., \`throw new Error("not implemented")\` or empty bodies).
|
|
22365
|
+
|
|
22366
|
+
Do NOT plan. Do NOT explain. Call file_write NOW with the skeleton.
|
|
22367
|
+
After writing the skeleton, fill in each method one at a time, testing after each.
|
|
22368
|
+
|
|
22369
|
+
Example structure:
|
|
22370
|
+
\`\`\`
|
|
22371
|
+
class MyClass {
|
|
22372
|
+
// Store data in a Map
|
|
22373
|
+
private data = new Map();
|
|
22374
|
+
|
|
22375
|
+
// Add an item \u2014 validates input, stores in map
|
|
22376
|
+
add(key: string, value: any): void {
|
|
22377
|
+
this.data.set(key, value);
|
|
22378
|
+
}
|
|
22379
|
+
}
|
|
22380
|
+
\`\`\`
|
|
22381
|
+
|
|
22382
|
+
Now call file_write with YOUR skeleton for this task.`
|
|
22383
|
+
});
|
|
22384
|
+
}
|
|
22356
22385
|
}
|
|
22357
22386
|
const turnBudget = turnTier === "small" ? 5 : turnTier === "medium" ? 8 : 0;
|
|
22358
22387
|
if (turnBudget > 0 && turn > 0 && turn % turnBudget === 0) {
|
|
@@ -54012,7 +54041,7 @@ async function runSelfImprovementCycle(repoRoot) {
|
|
|
54012
54041
|
const { ReflectionIntegrityTool: ReflectionIntegrityTool2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
|
|
54013
54042
|
const ik = new IdentityKernelTool2(repoRoot);
|
|
54014
54043
|
const reflect = new ReflectionIntegrityTool2(repoRoot);
|
|
54015
|
-
const state = await ik.execute({
|
|
54044
|
+
const state = await ik.execute({ op: "hydrate" });
|
|
54016
54045
|
if (!state.success)
|
|
54017
54046
|
return;
|
|
54018
54047
|
const diagnosis = await reflect.execute({
|
|
@@ -54022,7 +54051,7 @@ async function runSelfImprovementCycle(repoRoot) {
|
|
|
54022
54051
|
if (diagnosis.success && diagnosis.output) {
|
|
54023
54052
|
const diagText = String(diagnosis.output).slice(0, 500);
|
|
54024
54053
|
await ik.execute({
|
|
54025
|
-
|
|
54054
|
+
op: "propose_update",
|
|
54026
54055
|
field: "narrative_summary",
|
|
54027
54056
|
value: diagText,
|
|
54028
54057
|
justification: "Self-improvement cycle: reflection diagnostic after " + SELF_IMPROVE_INTERVAL + " tasks"
|
|
@@ -54790,7 +54819,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
54790
54819
|
Promise.resolve().then(() => (init_dist2(), dist_exports)).then(({ IdentityKernelTool: IdentityKernelTool2 }) => {
|
|
54791
54820
|
const ik = new IdentityKernelTool2(repoRoot);
|
|
54792
54821
|
ik.execute({
|
|
54793
|
-
|
|
54822
|
+
op: "observe",
|
|
54794
54823
|
event: `Task completed: ${result.summary.slice(0, 200)}`,
|
|
54795
54824
|
context: JSON.stringify({ turns: result.turns, toolCalls: result.toolCalls, durationMs: result.durationMs, model: config.model, completed: true })
|
|
54796
54825
|
}).catch(() => {
|
|
@@ -54807,7 +54836,7 @@ When done, either call task_complete with your answer, or use FINAL_VAR(variable
|
|
|
54807
54836
|
Promise.resolve().then(() => (init_dist2(), dist_exports)).then(({ IdentityKernelTool: IdentityKernelTool2 }) => {
|
|
54808
54837
|
const ik = new IdentityKernelTool2(repoRoot);
|
|
54809
54838
|
ik.execute({
|
|
54810
|
-
|
|
54839
|
+
op: "observe",
|
|
54811
54840
|
event: `Task incomplete after ${result.turns} turns`,
|
|
54812
54841
|
context: JSON.stringify({ turns: result.turns, toolCalls: result.toolCalls, durationMs: result.durationMs, completed: false })
|
|
54813
54842
|
}).catch(() => {
|
package/package.json
CHANGED
|
@@ -38,6 +38,12 @@ When a test fails — TWO-STEP debug:
|
|
|
38
38
|
2. PATCH: Based on what you SAW (not guessed), edit ONLY the failing line(s). Re-run test.
|
|
39
39
|
Do NOT rewrite whole functions. Patch the specific fault.
|
|
40
40
|
|
|
41
|
+
Creating new files — WRITE FIRST, refine later:
|
|
42
|
+
- Your FIRST tool call MUST be file_write with a skeleton (class + method signatures + comments).
|
|
43
|
+
- Do NOT plan or explain before writing. Write the skeleton immediately.
|
|
44
|
+
- After writing: fill in each method, test after each one.
|
|
45
|
+
- A bad first draft you can fix is better than no draft at all.
|
|
46
|
+
|
|
41
47
|
Complex tasks — DECOMPOSE first:
|
|
42
48
|
1. LOCATE: Find and read the relevant file(s).
|
|
43
49
|
2. UNDERSTAND: Describe current behavior in one sentence.
|