@intelli-1113/stratos-sdk 1.3.2 → 1.3.3
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 +1 -1
- package/src/index.js +36 -11
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -51,21 +51,46 @@ function agentDeps() {
|
|
|
51
51
|
|
|
52
52
|
function detectFramework() {
|
|
53
53
|
if (process.env.STRATOS_FRAMEWORK) return process.env.STRATOS_FRAMEWORK;
|
|
54
|
+
|
|
54
55
|
const deps = agentDeps();
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
if (
|
|
60
|
-
if (
|
|
61
|
-
if (
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
if (
|
|
56
|
+
const inDeps = (n) => n in deps;
|
|
57
|
+
const isResolvable = (n) => resolvableFromCwd(n) || resolvable(n);
|
|
58
|
+
|
|
59
|
+
// 1. FIRST PASS: Check explicit dependencies declared in the user's package.json
|
|
60
|
+
if (inDeps("@google/adk") || inDeps("google-adk") || inDeps("@iqai/adk")) return "google-adk";
|
|
61
|
+
if (inDeps("@openai/agents")) return "openai-agents";
|
|
62
|
+
if (inDeps("llamaindex")) return "llamaindex";
|
|
63
|
+
if (inDeps("crewai")) return "crewai";
|
|
64
|
+
|
|
65
|
+
// If the user explicitly declared langgraph in package.json
|
|
66
|
+
if (inDeps("@langchain/langgraph")) return "langgraph";
|
|
67
|
+
// If the user declared langchain or @langchain/core
|
|
68
|
+
if (inDeps("langchain") || inDeps("@langchain/core")) return "langchain";
|
|
69
|
+
|
|
70
|
+
if (inDeps("ai")) return "vercel-ai";
|
|
71
|
+
if (inDeps("@google/generative-ai") || inDeps("@google/genai")) return "google-genai";
|
|
72
|
+
if (inDeps("@anthropic-ai/sdk")) return "anthropic";
|
|
73
|
+
if (inDeps("openai")) return "openai";
|
|
74
|
+
|
|
75
|
+
// 2. SECOND PASS: Fallback to node_modules inspection if package.json has no direct match
|
|
76
|
+
if (isResolvable("@google/adk") || isResolvable("google-adk") || isResolvable("@iqai/adk")) return "google-adk";
|
|
77
|
+
if (isResolvable("@openai/agents")) return "openai-agents";
|
|
78
|
+
if (isResolvable("llamaindex")) return "llamaindex";
|
|
79
|
+
if (isResolvable("crewai")) return "crewai";
|
|
80
|
+
|
|
81
|
+
// Prioritize langchain over internal transitive langgraph
|
|
82
|
+
if (isResolvable("langchain") || isResolvable("@langchain/core")) return "langchain";
|
|
83
|
+
if (isResolvable("@langchain/langgraph")) return "langgraph";
|
|
84
|
+
|
|
85
|
+
if (isResolvable("ai")) return "vercel-ai";
|
|
86
|
+
if (isResolvable("@google/generative-ai") || isResolvable("@google/genai")) return "google-genai";
|
|
87
|
+
if (isResolvable("@anthropic-ai/sdk")) return "anthropic";
|
|
88
|
+
if (isResolvable("openai")) return "openai";
|
|
89
|
+
|
|
66
90
|
return null;
|
|
67
91
|
}
|
|
68
92
|
|
|
93
|
+
|
|
69
94
|
function detectModel(opts) {
|
|
70
95
|
return (
|
|
71
96
|
opts.model ||
|