neuralos 3.1.7 → 3.1.8
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 +55 -3
- package/package.json +2 -2
package/bin/gybackend.cjs
CHANGED
|
@@ -367406,6 +367406,10 @@ var AgentService_v2 = class {
|
|
|
367406
367406
|
backgroundFileTransferCompleter = null;
|
|
367407
367407
|
unfinishedBackgroundFileTransferProvider = null;
|
|
367408
367408
|
imageAttachmentService = null;
|
|
367409
|
+
/** Plugin tools: name → handler (injected from PluginRegistry at boot). */
|
|
367410
|
+
pluginTools = /* @__PURE__ */ new Map();
|
|
367411
|
+
/** Plugin tool schemas (for toolsForModel injection). */
|
|
367412
|
+
pluginToolSchemas = [];
|
|
367409
367413
|
passChatTempExportService = new PassChatTempExportService();
|
|
367410
367414
|
fallbackCompactionHistoryExportService = null;
|
|
367411
367415
|
activeAgentRunIdsBySession = /* @__PURE__ */ new Map();
|
|
@@ -367452,6 +367456,18 @@ var AgentService_v2 = class {
|
|
|
367452
367456
|
setObservability(obs2) {
|
|
367453
367457
|
this.observability = obs2 ?? void 0;
|
|
367454
367458
|
}
|
|
367459
|
+
/** Wire plugin tools (from PluginRegistry) so the agent can call them in chat.
|
|
367460
|
+
* Each plugin tool has: name, description, params (schema), handler (async fn).
|
|
367461
|
+
* The tools are injected into toolsForModel (so the model sees them) and
|
|
367462
|
+
* pluginTools (so the dispatch switch's default case can call them). */
|
|
367463
|
+
setPluginTools(tools2) {
|
|
367464
|
+
this.pluginTools = new Map(tools2.map((t) => [t.name, t.handler]));
|
|
367465
|
+
this.pluginToolSchemas = tools2.map((t) => ({
|
|
367466
|
+
name: t.name,
|
|
367467
|
+
description: t.description,
|
|
367468
|
+
schema: t.params || {}
|
|
367469
|
+
}));
|
|
367470
|
+
}
|
|
367455
367471
|
/** Wire a session-log handle so list_session_logs / read_session_log work. */
|
|
367456
367472
|
setSessionLogger(logger) {
|
|
367457
367473
|
this.sessionLogger = logger ?? void 0;
|
|
@@ -367640,6 +367656,7 @@ var AgentService_v2 = class {
|
|
|
367640
367656
|
compactionItem?.apiKey ? compactionItem.profile : void 0
|
|
367641
367657
|
);
|
|
367642
367658
|
const toolsForModel = buildToolsForModel(readFileSupport);
|
|
367659
|
+
const allToolsForModel = [...toolsForModel, ...this.pluginToolSchemas];
|
|
367643
367660
|
return {
|
|
367644
367661
|
profileId,
|
|
367645
367662
|
model,
|
|
@@ -367653,7 +367670,7 @@ var AgentService_v2 = class {
|
|
|
367653
367670
|
compactionModelSupportsStructuredOutput,
|
|
367654
367671
|
compactionModelSupportsObjectToolChoice,
|
|
367655
367672
|
readFileSupport,
|
|
367656
|
-
toolsForModel,
|
|
367673
|
+
toolsForModel: allToolsForModel,
|
|
367657
367674
|
globalMaxTokens: typeof globalItem.maxTokens === "number" ? globalItem.maxTokens : 2e5,
|
|
367658
367675
|
thinkingMaxTokens: typeof thinkingItem?.maxTokens === "number" ? thinkingItem.maxTokens : typeof globalItem.maxTokens === "number" ? globalItem.maxTokens : 2e5,
|
|
367659
367676
|
compactionMaxTokens: typeof compactionItem?.maxTokens === "number" ? compactionItem.maxTokens : typeof thinkingItem?.maxTokens === "number" ? thinkingItem.maxTokens : typeof globalItem.maxTokens === "number" ? globalItem.maxTokens : 2e5
|
|
@@ -368952,8 +368969,21 @@ Actually, your intention might be different. Please re-read the description of t
|
|
|
368952
368969
|
}
|
|
368953
368970
|
break;
|
|
368954
368971
|
}
|
|
368955
|
-
default:
|
|
368956
|
-
|
|
368972
|
+
default: {
|
|
368973
|
+
const pluginHandler = this.pluginTools.get(toolCall.name);
|
|
368974
|
+
if (pluginHandler) {
|
|
368975
|
+
try {
|
|
368976
|
+
const pluginArgs = typeof toolCall.args === "string" ? JSON.parse(toolCall.args) : toolCall.args || {};
|
|
368977
|
+
const pluginResult = await pluginHandler(pluginArgs);
|
|
368978
|
+
result = typeof pluginResult === "string" ? pluginResult : JSON.stringify(pluginResult);
|
|
368979
|
+
} catch (err) {
|
|
368980
|
+
result = `Plugin tool "${toolCall.name}" error: ${err.message}`;
|
|
368981
|
+
}
|
|
368982
|
+
} else {
|
|
368983
|
+
result = `Tool "${toolCall.name}" is not supported.`;
|
|
368984
|
+
}
|
|
368985
|
+
break;
|
|
368986
|
+
}
|
|
368957
368987
|
}
|
|
368958
368988
|
toolMessage.content = result;
|
|
368959
368989
|
if (shouldInterruptPendingToolsForQueuedInsertion) {
|
|
@@ -375199,6 +375229,7 @@ function normalizeSynapseSettings(raw) {
|
|
|
375199
375229
|
const hasAuth = auth2 && Object.keys(auth2).length > 0;
|
|
375200
375230
|
return {
|
|
375201
375231
|
enabled: src.enabled !== false,
|
|
375232
|
+
autoServe: src.autoServe !== false,
|
|
375202
375233
|
...url2 ? { url: url2 } : {},
|
|
375203
375234
|
...servers && servers.length > 0 ? { servers } : {},
|
|
375204
375235
|
...prefix ? { prefix } : {},
|
|
@@ -394721,6 +394752,27 @@ async function startGyBackend() {
|
|
|
394721
394752
|
settingsService.onDidChange?.(refreshObservabilityFromSettings);
|
|
394722
394753
|
agentService.setObservability(observability);
|
|
394723
394754
|
terminalService.setSessionRecorder(observability.recording);
|
|
394755
|
+
try {
|
|
394756
|
+
const pluginRecords = await observability.pluginRegistry.reload();
|
|
394757
|
+
const pluginTools = [];
|
|
394758
|
+
for (const record2 of pluginRecords) {
|
|
394759
|
+
if (record2.error || !record2.enabled) continue;
|
|
394760
|
+
for (const tool2 of record2.tools) {
|
|
394761
|
+
pluginTools.push({
|
|
394762
|
+
name: tool2.name,
|
|
394763
|
+
description: tool2.description ?? "",
|
|
394764
|
+
params: tool2.params ?? {},
|
|
394765
|
+
handler: tool2.handler
|
|
394766
|
+
});
|
|
394767
|
+
}
|
|
394768
|
+
}
|
|
394769
|
+
if (pluginTools.length > 0) {
|
|
394770
|
+
agentService.setPluginTools(pluginTools);
|
|
394771
|
+
console.log(`[gybackend] Wired ${pluginTools.length} plugin tools from ${pluginRecords.filter((r) => !r.error && r.enabled).length} plugins into the agent.`);
|
|
394772
|
+
}
|
|
394773
|
+
} catch (e) {
|
|
394774
|
+
console.warn("[gybackend] Plugin tool wiring failed:", e instanceof Error ? e.message : String(e));
|
|
394775
|
+
}
|
|
394724
394776
|
if (settingsService.getSettings().sessionLogging?.enabled) {
|
|
394725
394777
|
const logDir = import_node_path28.default.join(
|
|
394726
394778
|
import_node_process2.default.env.GYSHELL_STORE_DIR || "",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "neuralos",
|
|
3
|
-
"version": "3.1.
|
|
4
|
-
"description": "Headless AI-native backend for RTerm / neuralOS — v3.1.
|
|
3
|
+
"version": "3.1.8",
|
|
4
|
+
"description": "Headless AI-native backend for RTerm / neuralOS — v3.1.8: plugin tools wired into the agent (all 11 plugins callable in chat). 11 plugins. 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",
|