neuralos 3.2.4 → 3.2.7
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/bin/gybackend.cjs +119 -37
- package/package.json +2 -2
package/bin/gybackend.cjs
CHANGED
|
@@ -296885,6 +296885,13 @@ ${res.stderr}` : "")
|
|
|
296885
296885
|
task2.endTime = Date.now();
|
|
296886
296886
|
task2.exitCode = options?.exitCode;
|
|
296887
296887
|
task2.endOffset = task2.startOffset + task2.output.length;
|
|
296888
|
+
if (task2.capturedOutput !== void 0 && task2.capturedOutput.length < (task2.output || "").length) {
|
|
296889
|
+
task2.captureStatus = "partial";
|
|
296890
|
+
} else if ((task2.output || "").length > MAX_BUFFER_SIZE) {
|
|
296891
|
+
task2.captureStatus = "display-truncated";
|
|
296892
|
+
} else {
|
|
296893
|
+
task2.captureStatus = "complete";
|
|
296894
|
+
}
|
|
296888
296895
|
this.stopCommandTrackingWatcher(taskId);
|
|
296889
296896
|
this.activeTaskByTerminal.delete(terminalId);
|
|
296890
296897
|
this.pendingTaskFinishByTerminal.delete(terminalId);
|
|
@@ -296899,7 +296906,8 @@ ${res.stderr}` : "")
|
|
|
296899
296906
|
callback({
|
|
296900
296907
|
stdoutDelta: task2.output,
|
|
296901
296908
|
exitCode: options?.exitCode,
|
|
296902
|
-
history_command_match_id: taskId
|
|
296909
|
+
history_command_match_id: taskId,
|
|
296910
|
+
captureStatus: task2.captureStatus
|
|
296903
296911
|
});
|
|
296904
296912
|
}
|
|
296905
296913
|
}
|
|
@@ -348625,35 +348633,43 @@ var PROBE_CONNECTIVITY_DESCRIPTION = [
|
|
|
348625
348633
|
var BUILTIN_TOOL_INFO = [
|
|
348626
348634
|
{
|
|
348627
348635
|
name: "exec_command",
|
|
348628
|
-
description: EXEC_COMMAND_DESCRIPTION
|
|
348636
|
+
description: EXEC_COMMAND_DESCRIPTION,
|
|
348637
|
+
shortDescription: "Run a command on a terminal (SSH/WinRM/local)"
|
|
348629
348638
|
},
|
|
348630
348639
|
{
|
|
348631
348640
|
name: "read_terminal_tab",
|
|
348632
|
-
description: READ_TERMINAL_TAB_DESCRIPTION
|
|
348641
|
+
description: READ_TERMINAL_TAB_DESCRIPTION,
|
|
348642
|
+
shortDescription: "Read terminal output"
|
|
348633
348643
|
},
|
|
348634
348644
|
{
|
|
348635
348645
|
name: "read_command_output",
|
|
348636
|
-
description: READ_COMMAND_OUTPUT_DESCRIPTION
|
|
348646
|
+
description: READ_COMMAND_OUTPUT_DESCRIPTION,
|
|
348647
|
+
shortDescription: "Read background command output"
|
|
348637
348648
|
},
|
|
348638
348649
|
{
|
|
348639
348650
|
name: "read_file",
|
|
348640
|
-
description: READ_FILE_DESCRIPTION
|
|
348651
|
+
description: READ_FILE_DESCRIPTION,
|
|
348652
|
+
shortDescription: "Read a file from a host"
|
|
348641
348653
|
},
|
|
348642
348654
|
{
|
|
348643
348655
|
name: "write_stdin",
|
|
348644
|
-
description: WRITE_STDIN_TOOL_DESCRIPTION
|
|
348656
|
+
description: WRITE_STDIN_TOOL_DESCRIPTION,
|
|
348657
|
+
shortDescription: "Send keystrokes to a terminal"
|
|
348645
348658
|
},
|
|
348646
348659
|
{
|
|
348647
348660
|
name: "reconnect_terminal_tab",
|
|
348648
|
-
description: RECONNECT_TERMINAL_TAB_DESCRIPTION
|
|
348661
|
+
description: RECONNECT_TERMINAL_TAB_DESCRIPTION,
|
|
348662
|
+
shortDescription: "Reconnect a disconnected terminal"
|
|
348649
348663
|
},
|
|
348650
348664
|
{
|
|
348651
348665
|
name: "open_terminal_tab",
|
|
348652
|
-
description: OPEN_TERMINAL_TAB_DESCRIPTION
|
|
348666
|
+
description: OPEN_TERMINAL_TAB_DESCRIPTION,
|
|
348667
|
+
shortDescription: "Open a new terminal tab"
|
|
348653
348668
|
},
|
|
348654
348669
|
{
|
|
348655
348670
|
name: "create_or_edit",
|
|
348656
|
-
description: CREATE_OR_EDIT_TOOL_DESCRIPTION
|
|
348671
|
+
description: CREATE_OR_EDIT_TOOL_DESCRIPTION,
|
|
348672
|
+
shortDescription: "Create or edit a file"
|
|
348657
348673
|
},
|
|
348658
348674
|
{
|
|
348659
348675
|
name: "write_file",
|
|
@@ -348667,19 +348683,23 @@ var BUILTIN_TOOL_INFO = [
|
|
|
348667
348683
|
},
|
|
348668
348684
|
{
|
|
348669
348685
|
name: "skill",
|
|
348670
|
-
description: "Load a skill to get detailed instructions for a specific task. Skills provide specialized knowledge, step-by-step guidance, and may include supporting files (scripts, references)."
|
|
348686
|
+
description: "Load a skill to get detailed instructions for a specific task. Skills provide specialized knowledge, step-by-step guidance, and may include supporting files (scripts, references).",
|
|
348687
|
+
shortDescription: "Load a skill for task guidance"
|
|
348671
348688
|
},
|
|
348672
348689
|
{
|
|
348673
348690
|
name: "create_skill",
|
|
348674
|
-
description: "Create a new skill in GyShell skills. This tool only creates new skills and does not modify or overwrite existing ones. If the skill name already exists, the call must fail and you should choose a different name. If you need to modify an existing skill, use edit_file to edit that skill's md file directly, or write_file only when intentionally replacing the full file."
|
|
348691
|
+
description: "Create a new skill in GyShell skills. This tool only creates new skills and does not modify or overwrite existing ones. If the skill name already exists, the call must fail and you should choose a different name. If you need to modify an existing skill, use edit_file to edit that skill's md file directly, or write_file only when intentionally replacing the full file.",
|
|
348692
|
+
shortDescription: "Create a new skill"
|
|
348675
348693
|
},
|
|
348676
348694
|
{
|
|
348677
348695
|
name: "wait",
|
|
348678
|
-
description: WAIT_TOOL_DESCRIPTION
|
|
348696
|
+
description: WAIT_TOOL_DESCRIPTION,
|
|
348697
|
+
shortDescription: "Pause for a fixed duration"
|
|
348679
348698
|
},
|
|
348680
348699
|
{
|
|
348681
348700
|
name: "wait_terminal_idle",
|
|
348682
|
-
description: WAIT_TERMINAL_IDLE_DESCRIPTION
|
|
348701
|
+
description: WAIT_TERMINAL_IDLE_DESCRIPTION,
|
|
348702
|
+
shortDescription: "Wait for terminal output to stabilize"
|
|
348683
348703
|
},
|
|
348684
348704
|
{
|
|
348685
348705
|
name: "copy_between_tabs",
|
|
@@ -348695,87 +348715,108 @@ var BUILTIN_TOOL_INFO = [
|
|
|
348695
348715
|
},
|
|
348696
348716
|
{
|
|
348697
348717
|
name: "manage_ssh_connection",
|
|
348698
|
-
description: MANAGE_SSH_CONNECTION_DESCRIPTION
|
|
348718
|
+
description: MANAGE_SSH_CONNECTION_DESCRIPTION,
|
|
348719
|
+
shortDescription: "Manage SSH connections"
|
|
348699
348720
|
},
|
|
348700
348721
|
{
|
|
348701
348722
|
name: "manage_winrm_connection",
|
|
348702
|
-
description: MANAGE_WINRM_CONNECTION_DESCRIPTION
|
|
348723
|
+
description: MANAGE_WINRM_CONNECTION_DESCRIPTION,
|
|
348724
|
+
shortDescription: "Manage WinRM connections"
|
|
348703
348725
|
},
|
|
348704
348726
|
{
|
|
348705
348727
|
name: "manage_serial_connection",
|
|
348706
|
-
description: MANAGE_SERIAL_CONNECTION_DESCRIPTION
|
|
348728
|
+
description: MANAGE_SERIAL_CONNECTION_DESCRIPTION,
|
|
348729
|
+
shortDescription: "Manage serial connections"
|
|
348707
348730
|
},
|
|
348708
348731
|
{
|
|
348709
348732
|
name: "list_session_logs",
|
|
348710
|
-
description: LIST_SESSION_LOGS_DESCRIPTION
|
|
348733
|
+
description: LIST_SESSION_LOGS_DESCRIPTION,
|
|
348734
|
+
shortDescription: "List recorded sessions"
|
|
348711
348735
|
},
|
|
348712
348736
|
{
|
|
348713
348737
|
name: "read_session_log",
|
|
348714
|
-
description: READ_SESSION_LOG_DESCRIPTION
|
|
348738
|
+
description: READ_SESSION_LOG_DESCRIPTION,
|
|
348739
|
+
shortDescription: "Read a session log"
|
|
348715
348740
|
},
|
|
348716
348741
|
{
|
|
348717
348742
|
name: "search_session_logs",
|
|
348718
|
-
description: SEARCH_SESSION_LOGS_DESCRIPTION
|
|
348743
|
+
description: SEARCH_SESSION_LOGS_DESCRIPTION,
|
|
348744
|
+
shortDescription: "Search session logs"
|
|
348719
348745
|
},
|
|
348720
348746
|
{
|
|
348721
348747
|
name: "get_run_ledger",
|
|
348722
|
-
description: GET_RUN_LEDGER_DESCRIPTION
|
|
348748
|
+
description: GET_RUN_LEDGER_DESCRIPTION,
|
|
348749
|
+
shortDescription: "Query agent run audit ledger"
|
|
348723
348750
|
},
|
|
348724
348751
|
{
|
|
348725
348752
|
name: "run_fleet_command",
|
|
348726
|
-
description: RUN_FLEET_COMMAND_DESCRIPTION
|
|
348753
|
+
description: RUN_FLEET_COMMAND_DESCRIPTION,
|
|
348754
|
+
shortDescription: "Run a command on multiple terminals"
|
|
348727
348755
|
},
|
|
348728
348756
|
{
|
|
348729
348757
|
name: "collect_facts",
|
|
348730
|
-
description: COLLECT_FACTS_DESCRIPTION
|
|
348758
|
+
description: COLLECT_FACTS_DESCRIPTION,
|
|
348759
|
+
shortDescription: "Inventory terminal tabs"
|
|
348731
348760
|
},
|
|
348732
348761
|
{
|
|
348733
348762
|
name: "probe_connectivity",
|
|
348734
|
-
description: PROBE_CONNECTIVITY_DESCRIPTION
|
|
348763
|
+
description: PROBE_CONNECTIVITY_DESCRIPTION,
|
|
348764
|
+
shortDescription: "Probe SSH reachability"
|
|
348735
348765
|
},
|
|
348736
348766
|
{
|
|
348737
348767
|
name: "manage_device_memory",
|
|
348738
|
-
description: MANAGE_DEVICE_MEMORY_DESCRIPTION
|
|
348768
|
+
description: MANAGE_DEVICE_MEMORY_DESCRIPTION,
|
|
348769
|
+
shortDescription: "Per-host memory and incidents"
|
|
348739
348770
|
},
|
|
348740
348771
|
{
|
|
348741
348772
|
name: "manage_script",
|
|
348742
|
-
description: MANAGE_SCRIPT_DESCRIPTION
|
|
348773
|
+
description: MANAGE_SCRIPT_DESCRIPTION,
|
|
348774
|
+
shortDescription: "Manage reusable scripts"
|
|
348743
348775
|
},
|
|
348744
348776
|
{
|
|
348745
348777
|
name: "manage_group",
|
|
348746
|
-
description: MANAGE_GROUP_DESCRIPTION
|
|
348778
|
+
description: MANAGE_GROUP_DESCRIPTION,
|
|
348779
|
+
shortDescription: "Manage connection groups"
|
|
348747
348780
|
},
|
|
348748
348781
|
{
|
|
348749
348782
|
name: "manage_scheduled_task",
|
|
348750
|
-
description: MANAGE_SCHEDULED_TASK_DESCRIPTION
|
|
348783
|
+
description: MANAGE_SCHEDULED_TASK_DESCRIPTION,
|
|
348784
|
+
shortDescription: "Manage cron tasks"
|
|
348751
348785
|
},
|
|
348752
348786
|
{
|
|
348753
348787
|
name: "manage_template",
|
|
348754
|
-
description: MANAGE_TEMPLATE_DESCRIPTION
|
|
348788
|
+
description: MANAGE_TEMPLATE_DESCRIPTION,
|
|
348789
|
+
shortDescription: "Manage Jinja templates"
|
|
348755
348790
|
},
|
|
348756
348791
|
{
|
|
348757
348792
|
name: "import_putty",
|
|
348758
|
-
description: IMPORT_PUTTY_DESCRIPTION
|
|
348793
|
+
description: IMPORT_PUTTY_DESCRIPTION,
|
|
348794
|
+
shortDescription: "Import PuTTY sessions"
|
|
348759
348795
|
},
|
|
348760
348796
|
{
|
|
348761
348797
|
name: "manage_playbook",
|
|
348762
|
-
description: MANAGE_PLAYBOOK_DESCRIPTION
|
|
348798
|
+
description: MANAGE_PLAYBOOK_DESCRIPTION,
|
|
348799
|
+
shortDescription: "Manage playbooks"
|
|
348763
348800
|
},
|
|
348764
348801
|
{
|
|
348765
348802
|
name: "run_playbook",
|
|
348766
|
-
description: RUN_PLAYBOOK_DESCRIPTION
|
|
348803
|
+
description: RUN_PLAYBOOK_DESCRIPTION,
|
|
348804
|
+
shortDescription: "Execute a playbook"
|
|
348767
348805
|
},
|
|
348768
348806
|
{
|
|
348769
348807
|
name: "manage_change",
|
|
348770
|
-
description: MANAGE_CHANGE_DESCRIPTION
|
|
348808
|
+
description: MANAGE_CHANGE_DESCRIPTION,
|
|
348809
|
+
shortDescription: "Drive MOP changes (plan/approve/run)"
|
|
348771
348810
|
},
|
|
348772
348811
|
{
|
|
348773
348812
|
name: "manage_trigger",
|
|
348774
|
-
description: MANAGE_TRIGGER_DESCRIPTION
|
|
348813
|
+
description: MANAGE_TRIGGER_DESCRIPTION,
|
|
348814
|
+
shortDescription: "Manage event triggers"
|
|
348775
348815
|
},
|
|
348776
348816
|
{
|
|
348777
348817
|
name: "get_metrics",
|
|
348778
|
-
description: 'Read host metrics as Prometheus exposition text (for a scraper) or a one-line dashboard summary. Use to answer "how are my hosts doing" or to feed an external Prometheus/OTel collector.'
|
|
348818
|
+
description: 'Read host metrics as Prometheus exposition text (for a scraper) or a one-line dashboard summary. Use to answer "how are my hosts doing" or to feed an external Prometheus/OTel collector.',
|
|
348819
|
+
shortDescription: "Read host metrics"
|
|
348779
348820
|
},
|
|
348780
348821
|
{
|
|
348781
348822
|
name: "manage_secret",
|
|
@@ -348819,7 +348860,8 @@ var BUILTIN_TOOL_INFO = [
|
|
|
348819
348860
|
},
|
|
348820
348861
|
{
|
|
348821
348862
|
name: "ingest_apm_spans",
|
|
348822
|
-
description: "Ingest OTLP/HTTP-JSON distributed-trace spans into the APM trace store (feeds bottleneck/slowest-trace analysis and the dashboard APM section)."
|
|
348863
|
+
description: "Ingest OTLP/HTTP-JSON distributed-trace spans into the APM trace store (feeds bottleneck/slowest-trace analysis and the dashboard APM section).",
|
|
348864
|
+
shortDescription: "Ingest APM trace spans"
|
|
348823
348865
|
},
|
|
348824
348866
|
{
|
|
348825
348867
|
name: "get_apm_summary",
|
|
@@ -349593,10 +349635,11 @@ async function runCommand(args, context2, options) {
|
|
|
349593
349635
|
});
|
|
349594
349636
|
finalResult = `The command has been running for over 120s and has been switched to nowait mode (running in the background). You can use read_command_output to check its progress. history_command_match_id=${historyCommandMatchId}, terminalId=${bestMatch.id}`;
|
|
349595
349637
|
} else {
|
|
349638
|
+
const captureNote = result.captureStatus === "partial" ? "\n[Note: Some output may have been lost during capture. Use read_command_output to retrieve the full output if needed.]" : result.captureStatus === "display-truncated" ? "\n[Note: Output was truncated for display. Use read_command_output to retrieve the full output if needed.]" : "";
|
|
349596
349639
|
finalResult = `The command has finished executing. The following is the output (history_command_match_id=${historyCommandMatchId}):
|
|
349597
349640
|
<terminal_content>
|
|
349598
349641
|
${truncatedOutput}
|
|
349599
|
-
</terminal_content
|
|
349642
|
+
</terminal_content>${captureNote}`;
|
|
349600
349643
|
}
|
|
349601
349644
|
context2.sendEvent(sessionId, {
|
|
349602
349645
|
messageId,
|
|
@@ -367471,6 +367514,35 @@ function canRunInParallel(toolCalls) {
|
|
|
367471
367514
|
}
|
|
367472
367515
|
return true;
|
|
367473
367516
|
}
|
|
367517
|
+
function reconcileToolCalls(toolCalls) {
|
|
367518
|
+
if (!Array.isArray(toolCalls) || toolCalls.length === 0) return [];
|
|
367519
|
+
const seen = /* @__PURE__ */ new Set();
|
|
367520
|
+
const result = [];
|
|
367521
|
+
for (const tc of toolCalls) {
|
|
367522
|
+
if (!tc || typeof tc !== "object") continue;
|
|
367523
|
+
if (!tc.name || typeof tc.name !== "string") continue;
|
|
367524
|
+
let args = tc.args;
|
|
367525
|
+
if (args == null) {
|
|
367526
|
+
args = {};
|
|
367527
|
+
} else if (typeof args === "string") {
|
|
367528
|
+
try {
|
|
367529
|
+
args = JSON.parse(args);
|
|
367530
|
+
} catch {
|
|
367531
|
+
args = {};
|
|
367532
|
+
}
|
|
367533
|
+
}
|
|
367534
|
+
const id = tc.id || "";
|
|
367535
|
+
if (id) {
|
|
367536
|
+
if (seen.has(id)) continue;
|
|
367537
|
+
seen.add(id);
|
|
367538
|
+
}
|
|
367539
|
+
const dedupKey = `${tc.name}::${JSON.stringify(args)}`;
|
|
367540
|
+
if (seen.has(dedupKey)) continue;
|
|
367541
|
+
seen.add(dedupKey);
|
|
367542
|
+
result.push({ ...tc, args });
|
|
367543
|
+
}
|
|
367544
|
+
return result;
|
|
367545
|
+
}
|
|
367474
367546
|
function clipTextMiddle(input, maxChars) {
|
|
367475
367547
|
if (maxChars <= 0) return "";
|
|
367476
367548
|
if (input.length <= maxChars) return input;
|
|
@@ -368437,7 +368509,9 @@ var AgentService_v2 = class {
|
|
|
368437
368509
|
if (!AIMessage.isInstance(lastMessage)) {
|
|
368438
368510
|
return { messages, sessionId, pendingToolCalls };
|
|
368439
368511
|
}
|
|
368440
|
-
const toolCalls =
|
|
368512
|
+
const toolCalls = reconcileToolCalls(
|
|
368513
|
+
Array.isArray(lastMessage.tool_calls) ? lastMessage.tool_calls : []
|
|
368514
|
+
);
|
|
368441
368515
|
if (!toolCalls || toolCalls.length === 0) {
|
|
368442
368516
|
this.cleanupModelToolCallMetadata(lastMessage, []);
|
|
368443
368517
|
return { messages, sessionId, pendingToolCalls };
|
|
@@ -370762,12 +370836,20 @@ ${reminder}`;
|
|
|
370762
370836
|
lastCheckpointOffset: 0,
|
|
370763
370837
|
lastProfileMaxTokens: this.getEffectiveMaxTokensForSession(sessionId)
|
|
370764
370838
|
};
|
|
370839
|
+
const previousFrontier = session.lastCheckpointOffset || 0;
|
|
370840
|
+
const newFrontier = messages.length;
|
|
370765
370841
|
this.updateSessionFromMessages(
|
|
370766
370842
|
session,
|
|
370767
370843
|
messages,
|
|
370768
370844
|
this.getEffectiveMaxTokensForSession(sessionId)
|
|
370769
370845
|
);
|
|
370846
|
+
session.lastCheckpointOffset = newFrontier;
|
|
370770
370847
|
this.chatHistoryService.saveSession(session);
|
|
370848
|
+
if (newFrontier !== previousFrontier) {
|
|
370849
|
+
console.log(
|
|
370850
|
+
`[AgentService_v2] Reading frontier updated: ${previousFrontier} -> ${newFrontier} messages (session ${sessionId}).`
|
|
370851
|
+
);
|
|
370852
|
+
}
|
|
370771
370853
|
} catch (error40) {
|
|
370772
370854
|
console.warn(
|
|
370773
370855
|
"[AgentService_v2] Failed to save session from checkpoint:",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neuralos",
|
|
3
|
-
"version": "3.2.
|
|
4
|
-
"description": "Headless AI-native backend for RTerm / neuralOS — v3.2.
|
|
3
|
+
"version": "3.2.7",
|
|
4
|
+
"description": "Headless AI-native backend for RTerm / neuralOS — v3.2.7: captureStatus for command output + tsconfig spec exclusion fix. 11 plugins, 55 plugin tools wired, parallel tool execution. Transports (SSH/serial/local), SQLite, and NATS libs install automatically.",
|
|
5
5
|
"main": "bin/gybackend.cjs",
|
|
6
6
|
"bin": { "gybackend": "bin/gybackend.cjs" },
|
|
7
7
|
"license": "MIT",
|