@lazyingart/agintiflow 0.20.240 → 0.20.241

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.240",
3
+ "version": "0.20.241",
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",
@@ -8,7 +8,11 @@ import { checkToolUse } from "../src/guardrails.js";
8
8
  import { flushHousekeeping } from "../src/housekeeping.js";
9
9
  import { requestNextStep, toolChoiceForProvider } from "../src/model-client.js";
10
10
  import { providerStructuredOutputAttempts } from "../src/provider-contract.js";
11
- import { hasExplicitDeepResearchIntent } from "../src/research-routing.js";
11
+ import {
12
+ hasExplicitDeepResearchIntent,
13
+ hasLocalResearchWorkspaceIntent,
14
+ shouldStartWithDeepResearch,
15
+ } from "../src/research-routing.js";
12
16
  import { SessionStore } from "../src/session-store.js";
13
17
  import { canonicalizeWebUrl, isPublicWebUrl, readWebPage, searchWeb } from "../src/web-search.js";
14
18
 
@@ -48,6 +52,17 @@ async function main() {
48
52
  assert(!excessiveResearch.allowed, "deep_research accepted an excessive query/source budget");
49
53
 
50
54
  assert(hasExplicitDeepResearchIntent("literature review with primary papers"), "explicit research intent was not detected");
55
+ const localEvidenceGoal =
56
+ "Turn the messy project notes in this folder into an evidence review, write sources.json, and commit the intentional work.";
57
+ assert(hasLocalResearchWorkspaceIntent(localEvidenceGoal), "local research workspace intent was not detected");
58
+ assert(
59
+ !shouldStartWithDeepResearch(localEvidenceGoal),
60
+ "local-source research incorrectly forced deep_research before workspace inspection"
61
+ );
62
+ assert(
63
+ shouldStartWithDeepResearch("Write a deep web research report comparing three primary papers."),
64
+ "standalone deep research no longer starts with the bounded research workflow"
65
+ );
51
66
  assert(
52
67
  !hasExplicitDeepResearchIntent("Create a phone-friendly document from this folder.", [
53
68
  {
@@ -1475,6 +1475,21 @@ 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 localEvidenceResearchStarter = selectProgressiveTools(allTools, {
1479
+ config: { provider: "deepseek" },
1480
+ goal:
1481
+ "Investigate the reliability problem in this folder, correct PROJECT_NOTES.md, write an evidence review and sources.json, then commit the intentional work.",
1482
+ profile: "research",
1483
+ });
1484
+ assert(names(localEvidenceResearchStarter).includes("deep_research"), "local evidence research omitted deep_research");
1485
+ assert(names(localEvidenceResearchStarter).includes("read_file"), "local evidence research omitted read_file");
1486
+ assert(names(localEvidenceResearchStarter).includes("write_file"), "local evidence research omitted write_file");
1487
+ assert(names(localEvidenceResearchStarter).includes("run_command"), "local evidence research omitted shell/git access");
1488
+ assert(
1489
+ !(names(localEvidenceResearchStarter).length === 2 && names(localEvidenceResearchStarter)[0] === "deep_research"),
1490
+ "local evidence research was trapped on deep_research before reading its source material"
1491
+ );
1492
+
1478
1493
  const documentRuntimeSnapshot =
1479
1494
  '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
1495
  const localDocumentStarter = selectProgressiveTools(allTools, {
@@ -1,4 +1,7 @@
1
- import { shouldStartWithDeepResearch } from "./research-routing.js";
1
+ import {
2
+ hasLocalResearchWorkspaceIntent,
3
+ shouldStartWithDeepResearch,
4
+ } from "./research-routing.js";
2
5
  import { hasAgintiEvidenceScope, scopedChatopsEvidenceGoal } from "./scs-evidence.js";
3
6
  import {
4
7
  INTEGRATION_TEXT_WORKSPACE_PROFILE_ID,
@@ -1241,6 +1244,13 @@ function compactToolNames({ config, goal, profile, messages }) {
1241
1244
  for (const bundle of inferred) {
1242
1245
  if (!bundleOrder.includes(bundle)) bundleOrder.push(bundle);
1243
1246
  }
1247
+ if (
1248
+ bundleOrder.includes("research") &&
1249
+ hasLocalResearchWorkspaceIntent(goal || config.goal, messages) &&
1250
+ !bundleOrder.includes("code")
1251
+ ) {
1252
+ bundleOrder.push("code");
1253
+ }
1244
1254
  if (bundleOrder.length === 0 && explicitProfileTools.length === 0) bundleOrder.push("general");
1245
1255
 
1246
1256
  const names = [];
@@ -48,6 +48,22 @@ export function hasExplicitDeepResearchIntent(goal = "", messages = []) {
48
48
  );
49
49
  }
50
50
 
51
+ export function hasLocalResearchWorkspaceIntent(goal = "", messages = []) {
52
+ const recent = hasAgintiEvidenceScope(goal)
53
+ ? ""
54
+ : genuineUserMessages(messages)
55
+ .slice(-4)
56
+ .map((message) => scopedChatopsEvidenceGoal(messageText(message.content)))
57
+ .join("\n");
58
+ const text = `${scopedChatopsEvidenceGoal(goal)}\n${recent}`;
59
+ return (
60
+ /\b(?:this|current|existing|project|workspace|local)\s+(?:folder|directory|repo(?:sitory)?|files?|notes?|sources?|artifacts?)\b/i.test(text) ||
61
+ /\b(?:task|project|source|research|evidence|notes?|manifest|readme)[-_A-Za-z0-9]*\.(?:md|json|ya?ml|txt|csv|bib|tex)\b/i.test(text) ||
62
+ /\b(?:inspect|read|reconcile|correct|rewrite|update)\b.{0,120}\b(?:workspace|folder|directory|repo(?:sitory)?|local files?|project notes?|existing notes?)\b/i.test(text) ||
63
+ /\b(?:git\s+)?commit\b/i.test(text)
64
+ );
65
+ }
66
+
51
67
  export function toolWasRequested(messages = [], toolName = "") {
52
68
  return messages.some((message) => {
53
69
  if (
@@ -65,5 +81,9 @@ export function toolWasRequested(messages = [], toolName = "") {
65
81
  }
66
82
 
67
83
  export function shouldStartWithDeepResearch(goal = "", messages = []) {
68
- return hasExplicitDeepResearchIntent(goal, messages) && !toolWasRequested(messages, "deep_research");
84
+ return (
85
+ hasExplicitDeepResearchIntent(goal, messages) &&
86
+ !hasLocalResearchWorkspaceIntent(goal, messages) &&
87
+ !toolWasRequested(messages, "deep_research")
88
+ );
69
89
  }