osagent 0.2.5 → 0.2.6
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/cli.js +83 -8
- package/package.json +1 -1
package/cli.js
CHANGED
|
@@ -148873,7 +148873,7 @@ function createContentGeneratorConfig(config2, authType, generationConfig) {
|
|
|
148873
148873
|
};
|
|
148874
148874
|
}
|
|
148875
148875
|
async function createContentGenerator(config2, gcConfig, sessionId2, isInitialAuth) {
|
|
148876
|
-
const version3 = "0.2.
|
|
148876
|
+
const version3 = "0.2.6";
|
|
148877
148877
|
const userAgent2 = `OSAgent/${version3} (${process.platform}; ${process.arch})`;
|
|
148878
148878
|
const baseHeaders = {
|
|
148879
148879
|
"User-Agent": userAgent2
|
|
@@ -235980,16 +235980,31 @@ var init_skill_detector = __esm({
|
|
|
235980
235980
|
const agentMatches = this.agentRegistry.findAgentsForPrompt(prompt);
|
|
235981
235981
|
let primaryAgent = null;
|
|
235982
235982
|
const secondaryAgents = [];
|
|
235983
|
+
const isGenericBuildRequest = this.isGenericBuildRequest(prompt);
|
|
235983
235984
|
if (agentMatches.length > 0) {
|
|
235984
|
-
|
|
235985
|
+
const shouldUseOrchestrator = complexity === "complex" && detectedSkills.length > 2 || isGenericBuildRequest || this.isNewProjectRequest(prompt);
|
|
235986
|
+
if (shouldUseOrchestrator) {
|
|
235985
235987
|
const orchestrators = this.agentRegistry.getAgentsByTier("orchestrator");
|
|
235986
235988
|
if (orchestrators.length > 0) {
|
|
235987
235989
|
primaryAgent = orchestrators[0];
|
|
235988
|
-
|
|
235990
|
+
const highConfidenceMatches = agentMatches.filter((m) => m.score > 0.7);
|
|
235991
|
+
secondaryAgents.push(...highConfidenceMatches.slice(0, 3).map((m) => m.agent));
|
|
235989
235992
|
}
|
|
235990
235993
|
} else {
|
|
235991
|
-
|
|
235992
|
-
|
|
235994
|
+
if (agentMatches[0].score > 0.6) {
|
|
235995
|
+
primaryAgent = agentMatches[0].agent;
|
|
235996
|
+
secondaryAgents.push(...agentMatches.slice(1, 3).map((m) => m.agent));
|
|
235997
|
+
} else {
|
|
235998
|
+
const orchestrators = this.agentRegistry.getAgentsByTier("orchestrator");
|
|
235999
|
+
if (orchestrators.length > 0) {
|
|
236000
|
+
primaryAgent = orchestrators[0];
|
|
236001
|
+
}
|
|
236002
|
+
}
|
|
236003
|
+
}
|
|
236004
|
+
} else {
|
|
236005
|
+
const orchestrators = this.agentRegistry.getAgentsByTier("orchestrator");
|
|
236006
|
+
if (orchestrators.length > 0) {
|
|
236007
|
+
primaryAgent = orchestrators[0];
|
|
235993
236008
|
}
|
|
235994
236009
|
}
|
|
235995
236010
|
const maxSkillConfidence = detectedSkills.length > 0 ? Math.max(...detectedSkills.map((s2) => s2.confidence)) : 0;
|
|
@@ -236097,6 +236112,66 @@ var init_skill_detector = __esm({
|
|
|
236097
236112
|
setAutoDispatchThreshold(threshold) {
|
|
236098
236113
|
this.autoDispatchThreshold = Math.max(0, Math.min(1, threshold));
|
|
236099
236114
|
}
|
|
236115
|
+
/**
|
|
236116
|
+
* Check if this is a generic "build/create X" request without specific tech
|
|
236117
|
+
* These should go to orchestrator first, not specialists
|
|
236118
|
+
*/
|
|
236119
|
+
isGenericBuildRequest(prompt) {
|
|
236120
|
+
const promptLower = prompt.toLowerCase();
|
|
236121
|
+
const buildPatterns = [
|
|
236122
|
+
/^(?:let'?s?\s+)?(?:build|create|make|develop|start)\s+(?:a|an|the|my)?\s*\w+\s*(?:app|application|system|platform|os|tool|service)?/i,
|
|
236123
|
+
/(?:i\s+)?want\s+to\s+(?:build|create|make|develop)/i,
|
|
236124
|
+
/(?:help\s+me\s+)?(?:build|create|make|develop)\s+/i
|
|
236125
|
+
];
|
|
236126
|
+
const hasBuildPattern = buildPatterns.some((p) => p.test(prompt));
|
|
236127
|
+
if (!hasBuildPattern)
|
|
236128
|
+
return false;
|
|
236129
|
+
const techKeywords = [
|
|
236130
|
+
"react",
|
|
236131
|
+
"next",
|
|
236132
|
+
"nextjs",
|
|
236133
|
+
"svelte",
|
|
236134
|
+
"vue",
|
|
236135
|
+
"angular",
|
|
236136
|
+
"node",
|
|
236137
|
+
"express",
|
|
236138
|
+
"fastify",
|
|
236139
|
+
"go",
|
|
236140
|
+
"golang",
|
|
236141
|
+
"rust",
|
|
236142
|
+
"python",
|
|
236143
|
+
"django",
|
|
236144
|
+
"flask",
|
|
236145
|
+
"fastapi",
|
|
236146
|
+
"typescript",
|
|
236147
|
+
"tsx",
|
|
236148
|
+
"jsx",
|
|
236149
|
+
"css",
|
|
236150
|
+
"tailwind",
|
|
236151
|
+
".ts",
|
|
236152
|
+
".tsx",
|
|
236153
|
+
".js",
|
|
236154
|
+
".jsx",
|
|
236155
|
+
".svelte",
|
|
236156
|
+
".go",
|
|
236157
|
+
".py"
|
|
236158
|
+
];
|
|
236159
|
+
const hasTechKeyword = techKeywords.some((k) => promptLower.includes(k));
|
|
236160
|
+
return !hasTechKeyword;
|
|
236161
|
+
}
|
|
236162
|
+
/**
|
|
236163
|
+
* Check if this is a new project request
|
|
236164
|
+
* New projects should start with orchestrator
|
|
236165
|
+
*/
|
|
236166
|
+
isNewProjectRequest(prompt) {
|
|
236167
|
+
const newProjectPatterns = [
|
|
236168
|
+
/(?:new|start|init|begin|create)\s+(?:a\s+)?(?:new\s+)?project/i,
|
|
236169
|
+
/(?:from\s+scratch|brand\s+new|fresh\s+start)/i,
|
|
236170
|
+
/(?:let'?s?\s+)?(?:start|begin|kick\s*off)/i,
|
|
236171
|
+
/(?:set\s*up|setup|initialize)\s+(?:a\s+)?(?:new\s+)?/i
|
|
236172
|
+
];
|
|
236173
|
+
return newProjectPatterns.some((p) => p.test(prompt));
|
|
236174
|
+
}
|
|
236100
236175
|
};
|
|
236101
236176
|
}
|
|
236102
236177
|
});
|
|
@@ -337507,7 +337582,7 @@ __name(getPackageJson, "getPackageJson");
|
|
|
337507
337582
|
// packages/cli/src/utils/version.ts
|
|
337508
337583
|
async function getCliVersion() {
|
|
337509
337584
|
const pkgJson = await getPackageJson();
|
|
337510
|
-
return "0.2.
|
|
337585
|
+
return "0.2.6";
|
|
337511
337586
|
}
|
|
337512
337587
|
__name(getCliVersion, "getCliVersion");
|
|
337513
337588
|
|
|
@@ -341709,8 +341784,8 @@ var formatDuration = /* @__PURE__ */ __name((milliseconds) => {
|
|
|
341709
341784
|
|
|
341710
341785
|
// packages/cli/src/generated/git-commit.ts
|
|
341711
341786
|
init_esbuild_shims();
|
|
341712
|
-
var GIT_COMMIT_INFO2 = "
|
|
341713
|
-
var CLI_VERSION2 = "0.2.
|
|
341787
|
+
var GIT_COMMIT_INFO2 = "6ffed9e";
|
|
341788
|
+
var CLI_VERSION2 = "0.2.6";
|
|
341714
341789
|
|
|
341715
341790
|
// packages/cli/src/utils/systemInfo.ts
|
|
341716
341791
|
async function getNpmVersion() {
|