neoagent 2.5.2-beta.14 → 2.5.2-beta.16
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/server/public/.last_build_id +1 -1
- package/server/public/flutter_bootstrap.js +1 -1
- package/server/public/main.dart.js +4 -4
- package/server/services/ai/deliverables/artifact_helpers.js +12 -4
- package/server/services/ai/deliverables/selector.js +17 -0
- package/server/services/ai/loop/conversation_loop.js +54 -45
- package/server/services/integrations/github/repos.js +6 -1
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
5acb38c4eeee836df0a631d5ed3f863e
|
|
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"77e2e94772b6eb43759e34ed1ad7da4674e19c
|
|
|
37
37
|
|
|
38
38
|
_flutter.loader.load({
|
|
39
39
|
serviceWorkerSettings: {
|
|
40
|
-
serviceWorkerVersion: "
|
|
40
|
+
serviceWorkerVersion: "1920445875" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
|
|
41
41
|
}
|
|
42
42
|
});
|
|
@@ -134794,7 +134794,7 @@ r===$&&A.b()
|
|
|
134794
134794
|
p.push(A.jP(q,A.j9(!1,new A.a_(B.uG,A.d8(new A.cA(B.jt,new A.a7N(r,q),q),q,q),q),!1,B.H,!0),q,q,0,0,0,q))}r=!1
|
|
134795
134795
|
if(!s.ay)if(!s.ch){r=s.e
|
|
134796
134796
|
r===$&&A.b()
|
|
134797
|
-
r=B.b.u("
|
|
134797
|
+
r=B.b.u("mqgdktti-6bc08d8").length!==0&&r.b}if(r){r=s.d
|
|
134798
134798
|
r===$&&A.b()
|
|
134799
134799
|
r=r.aP&&!r.ai?84:0
|
|
134800
134800
|
s=s.e
|
|
@@ -140506,7 +140506,7 @@ $S:0}
|
|
|
140506
140506
|
A.a_6.prototype={}
|
|
140507
140507
|
A.SQ.prototype={
|
|
140508
140508
|
nb(a){var s=this
|
|
140509
|
-
if(B.b.u("
|
|
140509
|
+
if(B.b.u("mqgdktti-6bc08d8").length===0||s.a!=null)return
|
|
140510
140510
|
s.AU()
|
|
140511
140511
|
s.a=A.on(B.RH,new A.bc8(s))},
|
|
140512
140512
|
AU(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f
|
|
@@ -140524,7 +140524,7 @@ if(!t.f.b(k)){s=1
|
|
|
140524
140524
|
break}i=J.a3(k,"buildId")
|
|
140525
140525
|
h=i==null?null:B.b.u(J.p(i))
|
|
140526
140526
|
j=h==null?"":h
|
|
140527
|
-
if(J.bi(j)===0||J.d(j,"
|
|
140527
|
+
if(J.bi(j)===0||J.d(j,"mqgdktti-6bc08d8")){s=1
|
|
140528
140528
|
break}n.b=!0
|
|
140529
140529
|
n.F()
|
|
140530
140530
|
p=2
|
|
@@ -140541,7 +140541,7 @@ case 2:return A.i(o.at(-1),r)}})
|
|
|
140541
140541
|
return A.k($async$AU,r)},
|
|
140542
140542
|
vE(){var s=0,r=A.l(t.H),q,p=2,o=[],n=this,m,l,k,j,i,h,g,f,e,d,c,b,a,a0,a1
|
|
140543
140543
|
var $async$vE=A.h(function(a2,a3){if(a2===1){o.push(a3)
|
|
140544
|
-
s=p}for(;;)switch(s){case 0:if(B.b.u("
|
|
140544
|
+
s=p}for(;;)switch(s){case 0:if(B.b.u("mqgdktti-6bc08d8").length===0||n.c){s=1
|
|
140545
140545
|
break}n.c=!0
|
|
140546
140546
|
n.F()
|
|
140547
140547
|
p=4
|
|
@@ -138,8 +138,16 @@ function normalizePathOrUri(value) {
|
|
|
138
138
|
if (text.startsWith('/api/artifacts/')) return { uri: text, path: null };
|
|
139
139
|
if (/^https?:\/\//i.test(text)) return { uri: text, path: null };
|
|
140
140
|
if (text.startsWith('//')) return null;
|
|
141
|
-
if (/^[A-Za-z]:\\/.test(text))
|
|
142
|
-
|
|
141
|
+
if (/^[A-Za-z]:\\/.test(text)) {
|
|
142
|
+
const ext = path.extname(text.split('?')[0]).toLowerCase();
|
|
143
|
+
if (!FILE_EXTENSION_TO_KIND[ext]) return null;
|
|
144
|
+
return { path: text, uri: null };
|
|
145
|
+
}
|
|
146
|
+
if (path.isAbsolute(text)) {
|
|
147
|
+
const ext = path.extname(text.split('?')[0]).toLowerCase();
|
|
148
|
+
if (!FILE_EXTENSION_TO_KIND[ext]) return null;
|
|
149
|
+
return { path: text, uri: null };
|
|
150
|
+
}
|
|
143
151
|
return null;
|
|
144
152
|
}
|
|
145
153
|
|
|
@@ -207,8 +215,8 @@ async function extractArtifactsFromResult(toolName, result) {
|
|
|
207
215
|
if (value == null) return;
|
|
208
216
|
if (typeof value === 'string') {
|
|
209
217
|
const explicit = isExplicitCandidateKey(keyHint, parentKeyHint);
|
|
210
|
-
if (explicit
|
|
211
|
-
await pushCandidate(value);
|
|
218
|
+
if (explicit) {
|
|
219
|
+
if (normalizePathOrUri(value)) await pushCandidate(value);
|
|
212
220
|
return;
|
|
213
221
|
}
|
|
214
222
|
for (const candidate of scanStringForCandidates(value, { explicit })) {
|
|
@@ -47,6 +47,23 @@ async function selectDeliverableWorkflow({
|
|
|
47
47
|
tools = [],
|
|
48
48
|
options = {},
|
|
49
49
|
}) {
|
|
50
|
+
if (!engine || typeof engine.requestStructuredJson !== 'function') {
|
|
51
|
+
return {
|
|
52
|
+
selection: {
|
|
53
|
+
status: 'standard',
|
|
54
|
+
type: null,
|
|
55
|
+
confidence: 0,
|
|
56
|
+
goal: '',
|
|
57
|
+
requestedOutputs: [],
|
|
58
|
+
supportingCapabilities: [],
|
|
59
|
+
},
|
|
60
|
+
usage: 0,
|
|
61
|
+
raw: '',
|
|
62
|
+
skipped: true,
|
|
63
|
+
reason: 'structured selector unavailable',
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
50
67
|
const response = await engine.requestStructuredJson({
|
|
51
68
|
provider,
|
|
52
69
|
providerName,
|
|
@@ -904,54 +904,63 @@ async function runConversation(engine, userId, userMessage, options = {}, _model
|
|
|
904
904
|
maxIterations = loopPolicy.maxIterations;
|
|
905
905
|
|
|
906
906
|
if (options.skipDeliverableWorkflow !== true) {
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
provider,
|
|
910
|
-
providerName,
|
|
911
|
-
model,
|
|
912
|
-
messages,
|
|
913
|
-
tools,
|
|
914
|
-
options: { ...options, runId, userId, agentId },
|
|
915
|
-
});
|
|
916
|
-
totalTokens += deliverableSelectionResult.usage || 0;
|
|
917
|
-
const selectedWorkflow = getDeliverableWorkflow(deliverableSelectionResult.selection.type);
|
|
918
|
-
if (selectedWorkflow?.canHandle(deliverableSelectionResult.selection)) {
|
|
919
|
-
deliverableWorkflow = {
|
|
920
|
-
workflow: selectedWorkflow,
|
|
921
|
-
selection: deliverableSelectionResult.selection,
|
|
922
|
-
request: selectedWorkflow.normalizeRequest({
|
|
923
|
-
...deliverableSelectionResult.selection,
|
|
924
|
-
userMessage,
|
|
925
|
-
}),
|
|
926
|
-
};
|
|
927
|
-
deliverablePlan = selectedWorkflow.buildExecutionPlan(deliverableWorkflow.request, {
|
|
928
|
-
analysis,
|
|
929
|
-
tools,
|
|
930
|
-
options,
|
|
931
|
-
});
|
|
932
|
-
await selectedWorkflow.run(deliverablePlan, {
|
|
907
|
+
try {
|
|
908
|
+
const deliverableSelectionResult = await selectDeliverableWorkflow({
|
|
933
909
|
engine,
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
engine.persistRunMetadata(runId, {
|
|
941
|
-
deliverableWorkflow: {
|
|
942
|
-
...deliverableWorkflow.selection,
|
|
943
|
-
plan: deliverablePlan,
|
|
944
|
-
},
|
|
945
|
-
});
|
|
946
|
-
engine.updateRunGoalContract(runId, {
|
|
947
|
-
goal: deliverableWorkflow.selection.goal,
|
|
910
|
+
provider,
|
|
911
|
+
providerName,
|
|
912
|
+
model,
|
|
913
|
+
messages,
|
|
914
|
+
tools,
|
|
915
|
+
options: { ...options, runId, userId, agentId },
|
|
948
916
|
});
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
917
|
+
totalTokens += deliverableSelectionResult.usage || 0;
|
|
918
|
+
const selectedWorkflow = getDeliverableWorkflow(deliverableSelectionResult.selection.type);
|
|
919
|
+
if (selectedWorkflow?.canHandle(deliverableSelectionResult.selection)) {
|
|
920
|
+
deliverableWorkflow = {
|
|
921
|
+
workflow: selectedWorkflow,
|
|
922
|
+
selection: deliverableSelectionResult.selection,
|
|
923
|
+
request: selectedWorkflow.normalizeRequest({
|
|
924
|
+
...deliverableSelectionResult.selection,
|
|
925
|
+
userMessage,
|
|
926
|
+
}),
|
|
927
|
+
};
|
|
928
|
+
deliverablePlan = selectedWorkflow.buildExecutionPlan(deliverableWorkflow.request, {
|
|
929
|
+
analysis,
|
|
930
|
+
tools,
|
|
931
|
+
options,
|
|
932
|
+
});
|
|
933
|
+
await selectedWorkflow.run(deliverablePlan, {
|
|
934
|
+
engine,
|
|
935
|
+
userId,
|
|
936
|
+
agentId,
|
|
937
|
+
runId,
|
|
938
|
+
app,
|
|
939
|
+
});
|
|
940
|
+
engine.persistRunMetadata(runId, {
|
|
941
|
+
deliverableWorkflow: {
|
|
942
|
+
...deliverableWorkflow.selection,
|
|
943
|
+
plan: deliverablePlan,
|
|
944
|
+
},
|
|
945
|
+
});
|
|
946
|
+
engine.updateRunGoalContract(runId, {
|
|
947
|
+
goal: deliverableWorkflow.selection.goal,
|
|
948
|
+
});
|
|
949
|
+
engine.recordRunEvent(userId, runId, 'deliverable_workflow_selected', {
|
|
950
|
+
type: deliverableWorkflow.selection.type,
|
|
951
|
+
confidence: deliverableWorkflow.selection.confidence,
|
|
952
|
+
goal: deliverableWorkflow.selection.goal,
|
|
953
|
+
requestedOutputs: deliverableWorkflow.selection.requestedOutputs,
|
|
954
|
+
}, { agentId });
|
|
955
|
+
}
|
|
956
|
+
} catch (error) {
|
|
957
|
+
engine.recordRunEvent(userId, runId, 'deliverable_workflow_skipped', {
|
|
958
|
+
reason: summarizeForLog(error?.message || error, 240),
|
|
954
959
|
}, { agentId });
|
|
960
|
+
messages.push({
|
|
961
|
+
role: 'system',
|
|
962
|
+
content: 'The optional deliverable workflow classifier failed. Continue with the normal agent loop; do not stop or retry the whole run just because this classifier failed.',
|
|
963
|
+
});
|
|
955
964
|
}
|
|
956
965
|
}
|
|
957
966
|
|
|
@@ -977,10 +977,15 @@ async function executeGithubTool(toolName, args, auth) {
|
|
|
977
977
|
const { owner, repo } = parseOwnerRepo(args.owner_repo);
|
|
978
978
|
const query = {};
|
|
979
979
|
if (args.ref) query.ref = String(args.ref);
|
|
980
|
-
|
|
980
|
+
const result = await githubApiRequest(auth, {
|
|
981
981
|
path: `/repos/${owner}/${repo}/contents/${String(args.path || '')}`,
|
|
982
982
|
query,
|
|
983
983
|
});
|
|
984
|
+
if (result && result.encoding === 'base64' && typeof result.content === 'string') {
|
|
985
|
+
result.content = Buffer.from(result.content.replace(/\n/g, ''), 'base64').toString('utf8');
|
|
986
|
+
result.encoding = 'utf8';
|
|
987
|
+
}
|
|
988
|
+
return result;
|
|
984
989
|
}
|
|
985
990
|
|
|
986
991
|
case 'github_create_or_update_file': {
|