neoagent 2.5.2-beta.15 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neoagent",
3
- "version": "2.5.2-beta.15",
3
+ "version": "2.5.2-beta.16",
4
4
  "description": "Proactive personal AI agent with no limits",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "server/index.js",
@@ -1 +1 @@
1
- 1d10248cc582c1ba92c1198aac6710a0
1
+ 5acb38c4eeee836df0a631d5ed3f863e
@@ -37,6 +37,6 @@ _flutter.buildConfig = {"engineRevision":"77e2e94772b6eb43759e34ed1ad7da4674e19c
37
37
 
38
38
  _flutter.loader.load({
39
39
  serviceWorkerSettings: {
40
- serviceWorkerVersion: "250173635" /* Flutter's service worker is deprecated and will be removed in a future Flutter release. */
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("mqgcr48m-8bfb25e").length!==0&&r.b}if(r){r=s.d
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("mqgcr48m-8bfb25e").length===0||s.a!=null)return
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,"mqgcr48m-8bfb25e")){s=1
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("mqgcr48m-8bfb25e").length===0||n.c){s=1
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
@@ -215,8 +215,8 @@ async function extractArtifactsFromResult(toolName, result) {
215
215
  if (value == null) return;
216
216
  if (typeof value === 'string') {
217
217
  const explicit = isExplicitCandidateKey(keyHint, parentKeyHint);
218
- if (explicit && normalizePathOrUri(value)) {
219
- await pushCandidate(value);
218
+ if (explicit) {
219
+ if (normalizePathOrUri(value)) await pushCandidate(value);
220
220
  return;
221
221
  }
222
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
- const deliverableSelectionResult = await selectDeliverableWorkflow({
908
- engine,
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
- userId,
935
- agentId,
936
- runId,
937
- agentId,
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,
910
+ provider,
911
+ providerName,
912
+ model,
913
+ messages,
914
+ tools,
915
+ options: { ...options, runId, userId, agentId },
948
916
  });
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,
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
- return await githubApiRequest(auth, {
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': {