@lazyingart/agintiflow 0.20.230 → 0.20.231
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lazyingart/agintiflow",
|
|
3
|
-
"version": "0.20.
|
|
3
|
+
"version": "0.20.231",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "AgInTiFlow is a project-aware agent workspace for hybrid wet-dry R&D, hardware-aware intelligence, software automation, and industrial workflows.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -48,6 +48,21 @@ async function main() {
|
|
|
48
48
|
assert(!excessiveResearch.allowed, "deep_research accepted an excessive query/source budget");
|
|
49
49
|
|
|
50
50
|
assert(hasExplicitDeepResearchIntent("literature review with primary papers"), "explicit research intent was not detected");
|
|
51
|
+
assert(
|
|
52
|
+
!hasExplicitDeepResearchIntent("Create a phone-friendly document from this folder.", [
|
|
53
|
+
{
|
|
54
|
+
role: "user",
|
|
55
|
+
content:
|
|
56
|
+
'Step 2/30. Latest runtime snapshot:\n{"pageText":"Web search and resumable deep research are available when current evidence is required."}',
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
role: "user",
|
|
60
|
+
content:
|
|
61
|
+
"The previous tool-call batch was rejected before dispatch. Tools offered in that turn: deep_research, finish.",
|
|
62
|
+
},
|
|
63
|
+
]),
|
|
64
|
+
"runtime control prose was misclassified as genuine deep-research intent"
|
|
65
|
+
);
|
|
51
66
|
assert(
|
|
52
67
|
toolChoiceForProvider({ provider: "deepseek" }, []) === "auto",
|
|
53
68
|
"provider-neutral research routing added an unsupported named tool_choice"
|
|
@@ -1475,6 +1475,49 @@ const explicitDeepResearchFollowup = selectProgressiveTools(allTools, {
|
|
|
1475
1475
|
});
|
|
1476
1476
|
assert(names(explicitDeepResearchFollowup).includes("web_search"), "deep-research follow-up did not restore targeted recovery tools");
|
|
1477
1477
|
|
|
1478
|
+
const documentRuntimeSnapshot =
|
|
1479
|
+
'Step 1/30. Latest runtime snapshot:\n{"pageText":"Workspace file tools are ready. Web search and resumable deep research are available when current evidence is required."}';
|
|
1480
|
+
const localDocumentStarter = selectProgressiveTools(allTools, {
|
|
1481
|
+
config: { provider: "deepseek" },
|
|
1482
|
+
goal: "Turn the files in this folder into an editable, phone-friendly handoff and finish it properly.",
|
|
1483
|
+
profile: "word",
|
|
1484
|
+
messages: [
|
|
1485
|
+
{ role: "user", content: "Turn the files in this folder into an editable, phone-friendly handoff and finish it properly." },
|
|
1486
|
+
{ role: "user", content: documentRuntimeSnapshot },
|
|
1487
|
+
],
|
|
1488
|
+
});
|
|
1489
|
+
assert(names(localDocumentStarter).includes("read_file"), "local document start omitted workspace reading tools");
|
|
1490
|
+
assert(names(localDocumentStarter).includes("write_file"), "local document start omitted workspace writing tools");
|
|
1491
|
+
assert(
|
|
1492
|
+
!(names(localDocumentStarter).length === 2 && names(localDocumentStarter)[0] === "deep_research"),
|
|
1493
|
+
"runtime snapshot prose forced a local document task into deep research"
|
|
1494
|
+
);
|
|
1495
|
+
|
|
1496
|
+
const documentRepairAfterCompaction = selectProgressiveTools(allTools, {
|
|
1497
|
+
config: { provider: "deepseek" },
|
|
1498
|
+
goal: "Turn the files in this folder into an editable, phone-friendly handoff and finish it properly.",
|
|
1499
|
+
profile: "word",
|
|
1500
|
+
messages: [
|
|
1501
|
+
{
|
|
1502
|
+
role: "user",
|
|
1503
|
+
content:
|
|
1504
|
+
"The runtime proactively compacted a long agent history before the provider context became inefficient or unstable. Authoritative current goal: create the document.",
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
role: "user",
|
|
1508
|
+
content:
|
|
1509
|
+
"The previous tool-call batch was rejected before dispatch. Reason code: TOOL_NOT_OFFERED. Rejected request: apply_patch. Tools offered in that turn: deep_research, finish.",
|
|
1510
|
+
},
|
|
1511
|
+
{ role: "user", content: documentRuntimeSnapshot },
|
|
1512
|
+
],
|
|
1513
|
+
});
|
|
1514
|
+
assert(names(documentRepairAfterCompaction).includes("apply_patch"), "document repair after compaction omitted apply_patch");
|
|
1515
|
+
assert(names(documentRepairAfterCompaction).includes("run_command"), "document repair after compaction omitted build verification");
|
|
1516
|
+
assert(
|
|
1517
|
+
!(names(documentRepairAfterCompaction).length === 2 && names(documentRepairAfterCompaction)[0] === "deep_research"),
|
|
1518
|
+
"post-failure runtime scaffolding regressed a local document repair into deep research"
|
|
1519
|
+
);
|
|
1520
|
+
|
|
1478
1521
|
const scopedArtifactPrompt = `You are a persistent workspace agent. The surrounding policy mentions an evidence review.
|
|
1479
1522
|
AGINTI_EVIDENCE_SCOPE_JSON: {"mode":"task","request":"Create one plain-text artifact and verify it."}
|
|
1480
1523
|
Repository evidence to consult as relevant: literature review, evidence review, research report.`;
|
package/src/research-routing.js
CHANGED
|
@@ -6,11 +6,36 @@ function messageText(content) {
|
|
|
6
6
|
return content.map((part) => part?.text || part?.content || "").filter(Boolean).join("\n");
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
+
const RUNTIME_USER_MESSAGE_PATTERNS = Object.freeze([
|
|
10
|
+
/^Step \d+\/\d+\b.*Latest runtime snapshot:/i,
|
|
11
|
+
/^Retained runtime tool evidence\./i,
|
|
12
|
+
/^The runtime proactively compacted a long agent history/i,
|
|
13
|
+
/^A previous agent-step model request timed out/i,
|
|
14
|
+
/^Continue from this compacted, valid transcript/i,
|
|
15
|
+
/^Previous assistant response retained as compacted history/i,
|
|
16
|
+
/^Highest-priority retained state:/i,
|
|
17
|
+
/^Bounded failed-test evidence packet(?: v\d+)?\./i,
|
|
18
|
+
/^Verification is still failing,/i,
|
|
19
|
+
/^The previous tool-call batch was rejected before dispatch\./i,
|
|
20
|
+
/^Loop guard:/i,
|
|
21
|
+
/^Runtime phase transition:/i,
|
|
22
|
+
]);
|
|
23
|
+
|
|
24
|
+
function isRuntimeUserMessage(content = "") {
|
|
25
|
+
const text = String(content || "").trim();
|
|
26
|
+
return RUNTIME_USER_MESSAGE_PATTERNS.some((pattern) => pattern.test(text));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function genuineUserMessages(messages = []) {
|
|
30
|
+
return messages.filter(
|
|
31
|
+
(message) => message?.role === "user" && !isRuntimeUserMessage(messageText(message.content))
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
|
|
9
35
|
export function hasExplicitDeepResearchIntent(goal = "", messages = []) {
|
|
10
36
|
const recent = hasAgintiEvidenceScope(goal)
|
|
11
37
|
? ""
|
|
12
|
-
: messages
|
|
13
|
-
.filter((message) => message?.role === "user")
|
|
38
|
+
: genuineUserMessages(messages)
|
|
14
39
|
.slice(-4)
|
|
15
40
|
.map((message) => scopedChatopsEvidenceGoal(messageText(message.content)))
|
|
16
41
|
.join("\n");
|
|
@@ -24,12 +49,19 @@ export function hasExplicitDeepResearchIntent(goal = "", messages = []) {
|
|
|
24
49
|
}
|
|
25
50
|
|
|
26
51
|
export function toolWasRequested(messages = [], toolName = "") {
|
|
27
|
-
return messages.some(
|
|
28
|
-
(
|
|
52
|
+
return messages.some((message) => {
|
|
53
|
+
if (
|
|
29
54
|
message?.role === "assistant" &&
|
|
30
55
|
Array.isArray(message.tool_calls) &&
|
|
31
56
|
message.tool_calls.some((call) => call?.function?.name === toolName)
|
|
32
|
-
|
|
57
|
+
) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
if (message?.role !== "user") return false;
|
|
61
|
+
const content = messageText(message.content);
|
|
62
|
+
if (!/^Retained runtime tool evidence\./i.test(content.trim())) return false;
|
|
63
|
+
return new RegExp(`^Tool:\\s*${String(toolName).replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\s*$`, "im").test(content);
|
|
64
|
+
});
|
|
33
65
|
}
|
|
34
66
|
|
|
35
67
|
export function shouldStartWithDeepResearch(goal = "", messages = []) {
|