@probelabs/probe 0.6.0-rc271 → 0.6.0-rc273
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/bin/binaries/{probe-v0.6.0-rc271-aarch64-apple-darwin.tar.gz → probe-v0.6.0-rc273-aarch64-apple-darwin.tar.gz} +0 -0
- package/bin/binaries/probe-v0.6.0-rc273-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc273-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc273-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc273-x86_64-unknown-linux-musl.tar.gz +0 -0
- package/build/agent/contextCompactor.js +42 -25
- package/build/agent/index.js +78 -177
- package/build/agent/shared/prompts.js +4 -3
- package/build/agent/tasks/taskTool.js +46 -235
- package/build/tools/analyzeAll.js +3 -4
- package/build/tools/edit.js +3 -3
- package/build/tools/vercel.js +1 -1
- package/cjs/agent/ProbeAgent.cjs +95 -202
- package/cjs/index.cjs +95 -202
- package/package.json +1 -1
- package/src/agent/contextCompactor.js +42 -25
- package/src/agent/shared/prompts.js +4 -3
- package/src/agent/tasks/taskTool.js +46 -235
- package/src/tools/analyzeAll.js +3 -4
- package/src/tools/edit.js +3 -3
- package/src/tools/vercel.js +1 -1
- package/bin/binaries/probe-v0.6.0-rc271-aarch64-unknown-linux-musl.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc271-x86_64-apple-darwin.tar.gz +0 -0
- package/bin/binaries/probe-v0.6.0-rc271-x86_64-pc-windows-msvc.zip +0 -0
- package/bin/binaries/probe-v0.6.0-rc271-x86_64-unknown-linux-musl.tar.gz +0 -0
package/cjs/agent/ProbeAgent.cjs
CHANGED
|
@@ -11508,22 +11508,16 @@ var init_JsonShapeDeserializer = __esm({
|
|
|
11508
11508
|
if (Array.isArray(value) && ns.isListSchema()) {
|
|
11509
11509
|
const listMember = ns.getValueSchema();
|
|
11510
11510
|
const out = [];
|
|
11511
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
11512
11511
|
for (const item of value) {
|
|
11513
|
-
|
|
11514
|
-
out.push(this._read(listMember, item));
|
|
11515
|
-
}
|
|
11512
|
+
out.push(this._read(listMember, item));
|
|
11516
11513
|
}
|
|
11517
11514
|
return out;
|
|
11518
11515
|
}
|
|
11519
11516
|
if (ns.isMapSchema()) {
|
|
11520
11517
|
const mapMember = ns.getValueSchema();
|
|
11521
11518
|
const out = {};
|
|
11522
|
-
const sparse = !!ns.getMergedTraits().sparse;
|
|
11523
11519
|
for (const [_k, _v] of Object.entries(value)) {
|
|
11524
|
-
|
|
11525
|
-
out[_k] = this._read(mapMember, _v);
|
|
11526
|
-
}
|
|
11520
|
+
out[_k] = this._read(mapMember, _v);
|
|
11527
11521
|
}
|
|
11528
11522
|
return out;
|
|
11529
11523
|
}
|
|
@@ -13172,18 +13166,18 @@ var init_XmlShapeDeserializer = __esm({
|
|
|
13172
13166
|
return value;
|
|
13173
13167
|
}
|
|
13174
13168
|
if (typeof value === "object") {
|
|
13175
|
-
const sparse = !!traits.sparse;
|
|
13176
13169
|
const flat = !!traits.xmlFlattened;
|
|
13177
13170
|
if (ns.isListSchema()) {
|
|
13178
13171
|
const listValue = ns.getValueSchema();
|
|
13179
13172
|
const buffer2 = [];
|
|
13180
13173
|
const sourceKey = listValue.getMergedTraits().xmlName ?? "member";
|
|
13181
13174
|
const source = flat ? value : (value[0] ?? value)[sourceKey];
|
|
13175
|
+
if (source == null) {
|
|
13176
|
+
return buffer2;
|
|
13177
|
+
}
|
|
13182
13178
|
const sourceArray = Array.isArray(source) ? source : [source];
|
|
13183
13179
|
for (const v5 of sourceArray) {
|
|
13184
|
-
|
|
13185
|
-
buffer2.push(this.readSchema(listValue, v5));
|
|
13186
|
-
}
|
|
13180
|
+
buffer2.push(this.readSchema(listValue, v5));
|
|
13187
13181
|
}
|
|
13188
13182
|
return buffer2;
|
|
13189
13183
|
}
|
|
@@ -13202,9 +13196,7 @@ var init_XmlShapeDeserializer = __esm({
|
|
|
13202
13196
|
for (const entry of entries) {
|
|
13203
13197
|
const key = entry[keyProperty];
|
|
13204
13198
|
const value2 = entry[valueProperty];
|
|
13205
|
-
|
|
13206
|
-
buffer[key] = this.readSchema(memberNs, value2);
|
|
13207
|
-
}
|
|
13199
|
+
buffer[key] = this.readSchema(memberNs, value2);
|
|
13208
13200
|
}
|
|
13209
13201
|
return buffer;
|
|
13210
13202
|
}
|
|
@@ -17546,7 +17538,7 @@ var require_package2 = __commonJS({
|
|
|
17546
17538
|
module2.exports = {
|
|
17547
17539
|
name: "@aws-sdk/client-bedrock-runtime",
|
|
17548
17540
|
description: "AWS SDK for JavaScript Bedrock Runtime Client for Node.js, Browser and React Native",
|
|
17549
|
-
version: "3.
|
|
17541
|
+
version: "3.1002.0",
|
|
17550
17542
|
scripts: {
|
|
17551
17543
|
build: "concurrently 'yarn:build:types' 'yarn:build:es' && yarn build:cjs",
|
|
17552
17544
|
"build:cjs": "node ../../scripts/compilation/inline client-bedrock-runtime",
|
|
@@ -17570,21 +17562,21 @@ var require_package2 = __commonJS({
|
|
|
17570
17562
|
dependencies: {
|
|
17571
17563
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
17572
17564
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
17573
|
-
"@aws-sdk/core": "^3.973.
|
|
17574
|
-
"@aws-sdk/credential-provider-node": "^3.972.
|
|
17565
|
+
"@aws-sdk/core": "^3.973.17",
|
|
17566
|
+
"@aws-sdk/credential-provider-node": "^3.972.16",
|
|
17575
17567
|
"@aws-sdk/eventstream-handler-node": "^3.972.9",
|
|
17576
17568
|
"@aws-sdk/middleware-eventstream": "^3.972.6",
|
|
17577
17569
|
"@aws-sdk/middleware-host-header": "^3.972.6",
|
|
17578
17570
|
"@aws-sdk/middleware-logger": "^3.972.6",
|
|
17579
17571
|
"@aws-sdk/middleware-recursion-detection": "^3.972.6",
|
|
17580
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
17572
|
+
"@aws-sdk/middleware-user-agent": "^3.972.17",
|
|
17581
17573
|
"@aws-sdk/middleware-websocket": "^3.972.11",
|
|
17582
17574
|
"@aws-sdk/region-config-resolver": "^3.972.6",
|
|
17583
|
-
"@aws-sdk/token-providers": "3.
|
|
17575
|
+
"@aws-sdk/token-providers": "3.1002.0",
|
|
17584
17576
|
"@aws-sdk/types": "^3.973.4",
|
|
17585
17577
|
"@aws-sdk/util-endpoints": "^3.996.3",
|
|
17586
17578
|
"@aws-sdk/util-user-agent-browser": "^3.972.6",
|
|
17587
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
17579
|
+
"@aws-sdk/util-user-agent-node": "^3.973.2",
|
|
17588
17580
|
"@smithy/config-resolver": "^4.4.9",
|
|
17589
17581
|
"@smithy/core": "^3.23.7",
|
|
17590
17582
|
"@smithy/eventstream-serde-browser": "^4.2.10",
|
|
@@ -18333,7 +18325,7 @@ var init_package = __esm({
|
|
|
18333
18325
|
"node_modules/@aws-sdk/nested-clients/package.json"() {
|
|
18334
18326
|
package_default = {
|
|
18335
18327
|
name: "@aws-sdk/nested-clients",
|
|
18336
|
-
version: "3.996.
|
|
18328
|
+
version: "3.996.5",
|
|
18337
18329
|
description: "Nested clients for AWS SDK packages.",
|
|
18338
18330
|
main: "./dist-cjs/index.js",
|
|
18339
18331
|
module: "./dist-es/index.js",
|
|
@@ -18362,16 +18354,16 @@ var init_package = __esm({
|
|
|
18362
18354
|
dependencies: {
|
|
18363
18355
|
"@aws-crypto/sha256-browser": "5.2.0",
|
|
18364
18356
|
"@aws-crypto/sha256-js": "5.2.0",
|
|
18365
|
-
"@aws-sdk/core": "^3.973.
|
|
18357
|
+
"@aws-sdk/core": "^3.973.17",
|
|
18366
18358
|
"@aws-sdk/middleware-host-header": "^3.972.6",
|
|
18367
18359
|
"@aws-sdk/middleware-logger": "^3.972.6",
|
|
18368
18360
|
"@aws-sdk/middleware-recursion-detection": "^3.972.6",
|
|
18369
|
-
"@aws-sdk/middleware-user-agent": "^3.972.
|
|
18361
|
+
"@aws-sdk/middleware-user-agent": "^3.972.17",
|
|
18370
18362
|
"@aws-sdk/region-config-resolver": "^3.972.6",
|
|
18371
18363
|
"@aws-sdk/types": "^3.973.4",
|
|
18372
18364
|
"@aws-sdk/util-endpoints": "^3.996.3",
|
|
18373
18365
|
"@aws-sdk/util-user-agent-browser": "^3.972.6",
|
|
18374
|
-
"@aws-sdk/util-user-agent-node": "^3.973.
|
|
18366
|
+
"@aws-sdk/util-user-agent-node": "^3.973.2",
|
|
18375
18367
|
"@smithy/config-resolver": "^4.4.9",
|
|
18376
18368
|
"@smithy/core": "^3.23.7",
|
|
18377
18369
|
"@smithy/fetch-http-handler": "^5.3.12",
|
|
@@ -31736,8 +31728,7 @@ Instructions:
|
|
|
31736
31728
|
- Format as a structured list if multiple items found
|
|
31737
31729
|
- If nothing relevant is found in this chunk, respond with "No relevant items found in this chunk."
|
|
31738
31730
|
- Do NOT summarize the code - extract the specific information requested
|
|
31739
|
-
-
|
|
31740
|
-
- Do NOT use the shorthand <attempt_complete></attempt_complete> format`;
|
|
31731
|
+
- When done, use the attempt_completion tool with your answer as the result.`;
|
|
31741
31732
|
try {
|
|
31742
31733
|
const result = await delegate({
|
|
31743
31734
|
task,
|
|
@@ -31802,7 +31793,7 @@ async function aggregateResults(chunkResults2, aggregation, extractionPrompt, op
|
|
|
31802
31793
|
${stripResultTags(r5.result)}`).join("\n\n");
|
|
31803
31794
|
const completionNote = `
|
|
31804
31795
|
|
|
31805
|
-
|
|
31796
|
+
When done, use the attempt_completion tool with your answer as the result.`;
|
|
31806
31797
|
const aggregationPrompts = {
|
|
31807
31798
|
summarize: `Synthesize these analyses into a comprehensive summary. Combine related findings, remove redundancy, and present a coherent overview.
|
|
31808
31799
|
|
|
@@ -31960,7 +31951,7 @@ Your answer should:
|
|
|
31960
31951
|
|
|
31961
31952
|
Format your response as a well-structured document that fully answers: "${question}"
|
|
31962
31953
|
|
|
31963
|
-
|
|
31954
|
+
When done, use the attempt_completion tool with your answer as the result.`;
|
|
31964
31955
|
try {
|
|
31965
31956
|
const result = await delegate({
|
|
31966
31957
|
task: synthesisTask,
|
|
@@ -36527,7 +36518,7 @@ function buildSearchDelegateTask({ searchQuery, searchPath, exact, language, all
|
|
|
36527
36518
|
"",
|
|
36528
36519
|
"Strategy for complex queries:",
|
|
36529
36520
|
"1. Analyze the query - identify key concepts, entities, and relationships",
|
|
36530
|
-
'2. Run focused searches for each concept (e.g., "
|
|
36521
|
+
'2. Run focused searches for each independent concept (e.g., for "how do payments work and how are emails sent", search "payments" and "emails" separately since they are unrelated)',
|
|
36531
36522
|
"3. Use extract to verify relevance of promising results",
|
|
36532
36523
|
"4. Combine all relevant targets in your final response",
|
|
36533
36524
|
"",
|
|
@@ -39191,9 +39182,7 @@ Example: <edit><file_path>${file_path}</file_path><symbol>${allMatches[0].qualif
|
|
|
39191
39182
|
if (fileTracker) {
|
|
39192
39183
|
const check = fileTracker.checkSymbolContent(resolvedPath2, symbol15, symbolInfo.code);
|
|
39193
39184
|
if (!check.ok && check.reason === "stale") {
|
|
39194
|
-
return `Error editing ${file_path}: Symbol "${symbol15}" has changed since you last read it. Use extract to re-read the current content, then retry
|
|
39195
|
-
|
|
39196
|
-
Example: <extract><targets>${file_path}#${symbol15}</targets></extract>`;
|
|
39185
|
+
return `Error editing ${file_path}: Symbol "${symbol15}" has changed since you last read it. Use the extract tool with targets="${file_path}#${symbol15}" to re-read the current content, then retry.`;
|
|
39197
39186
|
}
|
|
39198
39187
|
}
|
|
39199
39188
|
const content = await import_fs6.promises.readFile(resolvedPath2, "utf-8");
|
|
@@ -39431,9 +39420,7 @@ Parameters:
|
|
|
39431
39420
|
}
|
|
39432
39421
|
if (options.fileTracker && !options.fileTracker.isFileSeen(resolvedPath2)) {
|
|
39433
39422
|
const displayPath = toRelativePath(resolvedPath2, workspaceRoot);
|
|
39434
|
-
return `Error editing ${displayPath}: This file has not been read yet in this session. Use
|
|
39435
|
-
|
|
39436
|
-
Example: <extract><targets>${displayPath}</targets></extract>`;
|
|
39423
|
+
return `Error editing ${displayPath}: This file has not been read yet in this session. Use the extract tool with targets="${displayPath}" to read the file first, then retry your edit.`;
|
|
39437
39424
|
}
|
|
39438
39425
|
if (symbol15 !== void 0 && symbol15 !== null) {
|
|
39439
39426
|
return await handleSymbolEdit({ resolvedPath: resolvedPath2, file_path, symbol: symbol15, new_string, position, debug, cwd, fileTracker: options.fileTracker });
|
|
@@ -39453,7 +39440,7 @@ Example: <extract><targets>${displayPath}</targets></extract>`;
|
|
|
39453
39440
|
const displayPath = toRelativePath(resolvedPath2, workspaceRoot);
|
|
39454
39441
|
return `Error editing ${displayPath}: ${staleCheck.message}
|
|
39455
39442
|
|
|
39456
|
-
|
|
39443
|
+
Use the extract tool with targets="${displayPath}" to re-read the file, then retry.`;
|
|
39457
39444
|
}
|
|
39458
39445
|
}
|
|
39459
39446
|
const content = await import_fs6.promises.readFile(resolvedPath2, "utf-8");
|
|
@@ -58640,20 +58627,15 @@ ${taskLines.join("\n")}
|
|
|
58640
58627
|
|
|
58641
58628
|
// src/agent/tasks/taskTool.js
|
|
58642
58629
|
function createTaskCompletionBlockedMessage(taskSummary) {
|
|
58643
|
-
return
|
|
58644
|
-
You cannot complete yet. The following tasks are still unresolved:
|
|
58630
|
+
return `You cannot complete yet. The following tasks are still unresolved:
|
|
58645
58631
|
|
|
58646
58632
|
${taskSummary}
|
|
58647
58633
|
|
|
58648
|
-
|
|
58649
|
-
|
|
58650
|
-
|
|
58651
|
-
- Or cancel if no longer needed: <task><action>update</action><id>task-X</id><status>cancelled</status></task>
|
|
58652
|
-
|
|
58653
|
-
2. After ALL tasks are resolved (completed or cancelled), call attempt_completion again.
|
|
58634
|
+
For each pending/in_progress task, either:
|
|
58635
|
+
- Complete it: call task tool with action="complete", id="task-X"
|
|
58636
|
+
- Cancel it: call task tool with action="update", id="task-X", status="cancelled"
|
|
58654
58637
|
|
|
58655
|
-
|
|
58656
|
-
</task_completion_blocked>`;
|
|
58638
|
+
After all tasks are resolved, call attempt_completion again.`;
|
|
58657
58639
|
}
|
|
58658
58640
|
function createTaskTool(options = {}) {
|
|
58659
58641
|
const { taskManager, tracer, debug = false } = options;
|
|
@@ -58876,145 +58858,46 @@ var init_taskTool = __esm({
|
|
|
58876
58858
|
dependencies: external_exports.array(external_exports.string()).optional(),
|
|
58877
58859
|
after: external_exports.string().optional()
|
|
58878
58860
|
});
|
|
58879
|
-
taskSystemPrompt = `[Task Management
|
|
58880
|
-
|
|
58881
|
-
|
|
58882
|
-
|
|
58883
|
-
## When to
|
|
58884
|
-
|
|
58885
|
-
CREATE
|
|
58886
|
-
- "Fix bug A AND add feature B" \u2192
|
|
58887
|
-
- "Investigate auth, payments, AND notifications" \u2192
|
|
58888
|
-
- "Implement X, then add tests, then update docs" \u2192
|
|
58889
|
-
|
|
58890
|
-
|
|
58891
|
-
|
|
58892
|
-
- "
|
|
58893
|
-
|
|
58894
|
-
|
|
58895
|
-
|
|
58896
|
-
|
|
58897
|
-
|
|
58898
|
-
|
|
58899
|
-
|
|
58900
|
-
|
|
58901
|
-
|
|
58902
|
-
|
|
58903
|
-
|
|
58904
|
-
|
|
58905
|
-
|
|
58906
|
-
|
|
58907
|
-
|
|
58908
|
-
|
|
58909
|
-
|
|
58910
|
-
-
|
|
58911
|
-
-
|
|
58912
|
-
-
|
|
58913
|
-
|
|
58914
|
-
**Good patterns**:
|
|
58915
|
-
- One task per distinct deliverable \u2713
|
|
58916
|
-
- One task per phase (implement, test, document) \u2713
|
|
58917
|
-
- One task per different type of work \u2713
|
|
58918
|
-
|
|
58919
|
-
MODIFY TASKS when (during execution):
|
|
58920
|
-
- You discover the problem is more complex than expected \u2192 Add new tasks
|
|
58921
|
-
- A single task covers too much scope \u2192 Split into smaller tasks
|
|
58922
|
-
- You find related work that needs attention \u2192 Add dependent tasks
|
|
58923
|
-
- A task becomes irrelevant based on findings \u2192 Cancel it
|
|
58924
|
-
- Task priorities change based on discoveries \u2192 Update priority
|
|
58925
|
-
- You learn new context \u2192 Update task description
|
|
58926
|
-
|
|
58927
|
-
## Task Workflow
|
|
58928
|
-
|
|
58929
|
-
**STEP 1 - Plan (at start):**
|
|
58930
|
-
Analyze the request and create tasks for each logical step:
|
|
58931
|
-
|
|
58932
|
-
<task>
|
|
58933
|
-
<action>create</action>
|
|
58934
|
-
<tasks>[
|
|
58935
|
-
{"title": "Search for authentication module", "priority": "high"},
|
|
58936
|
-
{"title": "Analyze login flow implementation", "dependencies": ["task-1"]},
|
|
58937
|
-
{"title": "Find session management code", "dependencies": ["task-1"]},
|
|
58938
|
-
{"title": "Summarize authentication architecture", "dependencies": ["task-2", "task-3"]}
|
|
58939
|
-
]</tasks>
|
|
58940
|
-
</task>
|
|
58941
|
-
|
|
58942
|
-
**STEP 2 - Execute (during work):**
|
|
58943
|
-
Update task status as you work:
|
|
58944
|
-
|
|
58945
|
-
<task>
|
|
58946
|
-
<action>update</action>
|
|
58947
|
-
<id>task-1</id>
|
|
58948
|
-
<status>in_progress</status>
|
|
58949
|
-
</task>
|
|
58950
|
-
|
|
58951
|
-
... do the work (search, extract, etc.) ...
|
|
58952
|
-
|
|
58953
|
-
<task>
|
|
58954
|
-
<action>complete</action>
|
|
58955
|
-
<id>task-1</id>
|
|
58956
|
-
</task>
|
|
58957
|
-
|
|
58958
|
-
**STEP 2b - Adapt (when you discover new work):**
|
|
58959
|
-
As you work, you may discover that:
|
|
58960
|
-
- A task is more complex than expected \u2192 Split it into subtasks
|
|
58961
|
-
- New areas need investigation \u2192 Add new tasks
|
|
58962
|
-
- Some tasks are no longer needed \u2192 Cancel them
|
|
58963
|
-
- Task order should change \u2192 Update dependencies
|
|
58964
|
-
|
|
58965
|
-
*Adding a new task when you discover more work:*
|
|
58966
|
-
<task>
|
|
58967
|
-
<action>create</action>
|
|
58968
|
-
<title>Investigate caching layer</title>
|
|
58969
|
-
<description>Found references to Redis caching in auth module</description>
|
|
58970
|
-
</task>
|
|
58971
|
-
|
|
58972
|
-
*Inserting a task after a specific task (to maintain logical order):*
|
|
58973
|
-
<task>
|
|
58974
|
-
<action>create</action>
|
|
58975
|
-
<title>Check rate limiting</title>
|
|
58976
|
-
<after>task-2</after>
|
|
58977
|
-
</task>
|
|
58978
|
-
|
|
58979
|
-
*Cancelling and splitting a complex task:*
|
|
58980
|
-
<task>
|
|
58981
|
-
<action>update</action>
|
|
58982
|
-
<id>task-3</id>
|
|
58983
|
-
<status>cancelled</status>
|
|
58984
|
-
</task>
|
|
58985
|
-
<task>
|
|
58986
|
-
<action>create</action>
|
|
58987
|
-
<tasks>[
|
|
58988
|
-
{"title": "Review JWT token generation", "priority": "high"},
|
|
58989
|
-
{"title": "Review token refresh logic"}
|
|
58990
|
-
]</tasks>
|
|
58991
|
-
</task>
|
|
58992
|
-
|
|
58993
|
-
**STEP 3 - Finish (before completion):**
|
|
58994
|
-
Before calling attempt_completion, ensure ALL tasks are either:
|
|
58995
|
-
- \`completed\` - you finished the work
|
|
58996
|
-
- \`cancelled\` - no longer needed
|
|
58997
|
-
|
|
58998
|
-
If you created tasks, you MUST resolve them all before completing.
|
|
58999
|
-
|
|
59000
|
-
## Key Rules
|
|
59001
|
-
|
|
59002
|
-
1. **Dependencies are enforced**: A task cannot start until its dependencies are completed
|
|
59003
|
-
2. **Circular dependencies are rejected**: task-1 \u2192 task-2 \u2192 task-1 is invalid
|
|
59004
|
-
3. **Completion is blocked**: attempt_completion will fail if tasks remain unresolved
|
|
59005
|
-
4. **List to review**: Use <task><action>list</action></task> to see current task status
|
|
59006
|
-
5. **Tasks are living documents**: Add, split, or cancel tasks as you learn more about the problem
|
|
58861
|
+
taskSystemPrompt = `[Task Management]
|
|
58862
|
+
|
|
58863
|
+
Use the task tool to track progress on complex requests with multiple distinct goals.
|
|
58864
|
+
|
|
58865
|
+
## When to Use Tasks
|
|
58866
|
+
|
|
58867
|
+
CREATE tasks when the request has **multiple separate deliverables**:
|
|
58868
|
+
- "Fix bug A AND add feature B" \u2192 two tasks
|
|
58869
|
+
- "Investigate auth, payments, AND notifications" \u2192 three tasks
|
|
58870
|
+
- "Implement X, then add tests, then update docs" \u2192 three sequential tasks
|
|
58871
|
+
|
|
58872
|
+
SKIP tasks for single-goal requests, even complex ones:
|
|
58873
|
+
- "How does ranking work?" \u2014 just investigate and answer
|
|
58874
|
+
- "Explain the authentication flow" \u2014 just trace and explain
|
|
58875
|
+
Multiple internal steps (search, read, analyze) for one goal \u2260 multiple tasks.
|
|
58876
|
+
|
|
58877
|
+
## Granularity
|
|
58878
|
+
|
|
58879
|
+
Tasks = logical units of work, not files or steps.
|
|
58880
|
+
- "Fix 8 similar test files" \u2192 ONE task (same fix repeated)
|
|
58881
|
+
- "Update API + tests + docs" \u2192 THREE tasks (different work types)
|
|
58882
|
+
- Max 3\u20134 tasks. More means you're too granular.
|
|
58883
|
+
|
|
58884
|
+
## Workflow
|
|
58885
|
+
|
|
58886
|
+
1. **Plan**: Call task tool with action="create" and a tasks array up front
|
|
58887
|
+
2. **Execute**: Update status to "in_progress" / "completed" as you work. Add, split, or cancel tasks as you learn more.
|
|
58888
|
+
3. **Finish**: All tasks must be "completed" or "cancelled" before calling attempt_completion.
|
|
58889
|
+
|
|
58890
|
+
## Rules
|
|
58891
|
+
|
|
58892
|
+
- Dependencies are enforced: a task cannot start until its dependencies are completed
|
|
58893
|
+
- Circular dependencies are rejected
|
|
58894
|
+
- attempt_completion is blocked while tasks remain unresolved
|
|
59007
58895
|
`;
|
|
59008
|
-
taskGuidancePrompt =
|
|
59009
|
-
Does this request have MULTIPLE DISTINCT GOALS?
|
|
58896
|
+
taskGuidancePrompt = `Does this request have MULTIPLE DISTINCT GOALS?
|
|
59010
58897
|
- "Do A AND B AND C" (multiple goals) \u2192 Create tasks for each goal
|
|
59011
58898
|
- "Investigate/explain/find X" (single goal) \u2192 Skip tasks, just answer directly
|
|
59012
|
-
|
|
59013
|
-
|
|
59014
|
-
Only create tasks when there are separate deliverables the user is asking for.
|
|
59015
|
-
|
|
59016
|
-
If creating tasks, use the task tool with action="create" first.
|
|
59017
|
-
</task_guidance>`;
|
|
58899
|
+
Multiple internal steps for ONE goal = NO tasks needed.
|
|
58900
|
+
If creating tasks, use the task tool with action="create" first.`;
|
|
59018
58901
|
}
|
|
59019
58902
|
});
|
|
59020
58903
|
|
|
@@ -97784,9 +97667,10 @@ If the solution is clear, you can jump to implementation right away. If not, ask
|
|
|
97784
97667
|
- After every significant change, verify the project still builds and passes linting. Do not wait until the end to discover breakage.
|
|
97785
97668
|
|
|
97786
97669
|
# After Implementation
|
|
97787
|
-
-
|
|
97788
|
-
- Run lint and typecheck commands if known for the project.
|
|
97789
|
-
-
|
|
97670
|
+
- Verify the project builds successfully. If it doesn't, fix the build before moving on.
|
|
97671
|
+
- Run lint and typecheck commands if known for the project. Fix any new warnings or errors you introduced.
|
|
97672
|
+
- Add tests for any new or changed functionality. Tests must cover the main path and important edge cases.
|
|
97673
|
+
- Run the project's full test suite. If any tests fail (including pre-existing ones you may have broken), fix them before finishing.
|
|
97790
97674
|
- When the task is done, respond to the user with a concise summary of what was implemented, what files were changed, and any relevant details. Include links (e.g. pull request URL) so the user has everything they need.
|
|
97791
97675
|
|
|
97792
97676
|
# GitHub Integration
|
|
@@ -106999,6 +106883,19 @@ function isContextLimitError(error2) {
|
|
|
106999
106883
|
}
|
|
107000
106884
|
return false;
|
|
107001
106885
|
}
|
|
106886
|
+
function messageContainsCompletion(msg) {
|
|
106887
|
+
if (Array.isArray(msg.toolInvocations)) {
|
|
106888
|
+
if (msg.toolInvocations.some((t5) => t5.toolName === "attempt_completion")) return true;
|
|
106889
|
+
}
|
|
106890
|
+
if (Array.isArray(msg.tool_calls)) {
|
|
106891
|
+
if (msg.tool_calls.some((t5) => t5.function?.name === "attempt_completion")) return true;
|
|
106892
|
+
}
|
|
106893
|
+
if (Array.isArray(msg.content)) {
|
|
106894
|
+
if (msg.content.some((p5) => p5.type === "tool-call" && p5.toolName === "attempt_completion")) return true;
|
|
106895
|
+
}
|
|
106896
|
+
const text = typeof msg.content === "string" ? msg.content : "";
|
|
106897
|
+
return text.includes("attempt_completion");
|
|
106898
|
+
}
|
|
107002
106899
|
function identifyMessageSegments(messages) {
|
|
107003
106900
|
const segments = [];
|
|
107004
106901
|
let currentSegment = null;
|
|
@@ -107007,27 +106904,23 @@ function identifyMessageSegments(messages) {
|
|
|
107007
106904
|
if (msg.role === "system") {
|
|
107008
106905
|
continue;
|
|
107009
106906
|
}
|
|
106907
|
+
if (msg.role === "tool" && currentSegment) {
|
|
106908
|
+
currentSegment.monologueIndices.push(i5);
|
|
106909
|
+
continue;
|
|
106910
|
+
}
|
|
107010
106911
|
if (msg.role === "user") {
|
|
107011
|
-
|
|
107012
|
-
const isToolResult = content.includes("<tool_result>");
|
|
107013
|
-
if (isToolResult && currentSegment) {
|
|
107014
|
-
currentSegment.finalIndex = i5;
|
|
106912
|
+
if (currentSegment) {
|
|
107015
106913
|
segments.push(currentSegment);
|
|
107016
|
-
currentSegment = null;
|
|
107017
|
-
} else {
|
|
107018
|
-
if (currentSegment) {
|
|
107019
|
-
segments.push(currentSegment);
|
|
107020
|
-
}
|
|
107021
|
-
currentSegment = {
|
|
107022
|
-
userIndex: i5,
|
|
107023
|
-
monologueIndices: [],
|
|
107024
|
-
finalIndex: null
|
|
107025
|
-
};
|
|
107026
106914
|
}
|
|
106915
|
+
currentSegment = {
|
|
106916
|
+
userIndex: i5,
|
|
106917
|
+
monologueIndices: [],
|
|
106918
|
+
finalIndex: null
|
|
106919
|
+
};
|
|
107027
106920
|
}
|
|
107028
106921
|
if (msg.role === "assistant" && currentSegment) {
|
|
107029
|
-
const
|
|
107030
|
-
if (
|
|
106922
|
+
const hasCompletion = messageContainsCompletion(msg);
|
|
106923
|
+
if (hasCompletion) {
|
|
107031
106924
|
currentSegment.monologueIndices.push(i5);
|
|
107032
106925
|
currentSegment.finalIndex = i5;
|
|
107033
106926
|
segments.push(currentSegment);
|