neuralos 3.3.9 → 3.4.0

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 CHANGED
@@ -350712,12 +350712,12 @@ var BUILTIN_TOOL_INFO = [
350712
350712
  {
350713
350713
  name: "write_file",
350714
350714
  description: WRITE_FILE_TOOL_DESCRIPTION,
350715
- hiddenFromSettings: true
350715
+ shortDescription: "Write a full file (replace contents)"
350716
350716
  },
350717
350717
  {
350718
350718
  name: "edit_file",
350719
350719
  description: EDIT_FILE_TOOL_DESCRIPTION,
350720
- hiddenFromSettings: true
350720
+ shortDescription: "Edit a file by replacing an exact string"
350721
350721
  },
350722
350722
  {
350723
350723
  name: "skill",
@@ -354867,6 +354867,7 @@ var CORE_METHODS = [
354867
354867
  m("tools:getMcp", "tools", "List MCP tools.", "1.0.0"),
354868
354868
  m("tools:setMcpEnabled", "tools", "Enable/disable an MCP tool.", "1.0.0"),
354869
354869
  m("tools:getBuiltIn", "tools", "List built-in agent tools with enabled state.", "1.0.0"),
354870
+ m("tools:getPlugins", "tools", "List plugin agent tools (name, plugin, description).", "3.4.0"),
354870
354871
  m("tools:setBuiltInEnabled", "tools", "Enable/disable a built-in tool.", "1.0.0", { name: { type: "string" }, enabled: { type: "boolean" } })
354871
354872
  ];
354872
354873
  var DESCRIBE_METHOD = m(
@@ -369458,6 +369459,7 @@ var AgentService_v2 = class {
369458
369459
  pluginTools = /* @__PURE__ */ new Map();
369459
369460
  /** Plugin tool schemas (for toolsForModel injection). */
369460
369461
  pluginToolSchemas = [];
369462
+ pluginToolMeta = [];
369461
369463
  passChatTempExportService = new PassChatTempExportService();
369462
369464
  fallbackCompactionHistoryExportService = null;
369463
369465
  activeAgentRunIdsBySession = /* @__PURE__ */ new Map();
@@ -369516,11 +369518,35 @@ var AgentService_v2 = class {
369516
369518
  * pluginTools (so the dispatch switch's default case can call them). */
369517
369519
  setPluginTools(tools2) {
369518
369520
  this.pluginTools = new Map(tools2.map((t) => [t.name, t.handler]));
369519
- this.pluginToolSchemas = tools2.map((t) => ({
369521
+ this.pluginToolMeta = tools2.map((t) => ({
369520
369522
  name: t.name,
369521
- description: t.description,
369522
- schema: t.params || {}
369523
+ description: t.description || t.name,
369524
+ plugin: t.plugin || "plugin"
369523
369525
  }));
369526
+ this.pluginToolSchemas = tools2.map((t) => {
369527
+ const params = t.params && typeof t.params === "object" ? t.params : {};
369528
+ const looksJsonSchema = typeof params.type === "string";
369529
+ const parameters = looksJsonSchema ? params : {
369530
+ type: "object",
369531
+ properties: params,
369532
+ additionalProperties: true
369533
+ };
369534
+ return {
369535
+ type: "function",
369536
+ function: {
369537
+ name: t.name,
369538
+ description: t.description || t.name,
369539
+ parameters
369540
+ }
369541
+ };
369542
+ });
369543
+ }
369544
+ /** Plugin tools in OpenAI bindTools shape (empty until setPluginTools). */
369545
+ getPluginToolSchemas() {
369546
+ return this.pluginToolSchemas;
369547
+ }
369548
+ listPluginTools() {
369549
+ return this.pluginToolMeta.map((t) => ({ ...t, enabled: true }));
369524
369550
  }
369525
369551
  /** Wire a session-log handle so list_session_logs / read_session_log work. */
369526
369552
  setSessionLogger(logger) {
@@ -370142,9 +370168,11 @@ var AgentService_v2 = class {
370142
370168
  }
370143
370169
  );
370144
370170
  const baseModel = shouldUseThinkingModelOnThisPass ? sessionBinding.thinkingModel || sessionBinding.model : sessionBinding.model;
370171
+ const pluginOpenAiTools = this.pluginToolSchemas;
370145
370172
  const modelWithTools = baseModel.bindTools([
370146
370173
  ...builtInTools,
370147
- ...mcpTools
370174
+ ...mcpTools,
370175
+ ...pluginOpenAiTools
370148
370176
  ]);
370149
370177
  const messageId = v4_default();
370150
370178
  let partialText = "";
@@ -370180,7 +370208,11 @@ var AgentService_v2 = class {
370180
370208
  shouldUseThinkingModelOnThisPass ? 0.2 : 0.7,
370181
370209
  null
370182
370210
  );
370183
- modelToUse = fallbackChat.bindTools([...builtInTools, ...mcpTools]);
370211
+ modelToUse = fallbackChat.bindTools([
370212
+ ...builtInTools,
370213
+ ...mcpTools,
370214
+ ...pluginOpenAiTools
370215
+ ]);
370184
370216
  }
370185
370217
  return await invokeWithRetryAndSanitizedInput({
370186
370218
  helpers: this.helpers,
@@ -376649,6 +376681,15 @@ var WebSocketGatewayAdapter = class {
376649
376681
  }
376650
376682
  return await this.options.toolsBridge.getBuiltIn();
376651
376683
  }
376684
+ case "tools:getPlugins": {
376685
+ if (!this.options.toolsBridge?.getPlugins) {
376686
+ throw new WebSocketRpcError(
376687
+ "METHOD_NOT_FOUND",
376688
+ "tools:getPlugins is not available on this websocket gateway."
376689
+ );
376690
+ }
376691
+ return await this.options.toolsBridge.getPlugins();
376692
+ }
376652
376693
  case "tools:setBuiltInEnabled": {
376653
376694
  if (!this.options.toolsBridge?.setBuiltInEnabled) {
376654
376695
  throw new WebSocketRpcError(
@@ -392577,6 +392618,23 @@ var PluginRegistry = class {
392577
392618
  allTools() {
392578
392619
  return this.list().filter((p) => p.enabled && !p.error).flatMap((p) => p.tools);
392579
392620
  }
392621
+ /** Flatten enabled plugin tools for AgentService.setPluginTools. */
392622
+ collectAgentTools() {
392623
+ const out = [];
392624
+ for (const record2 of this.list()) {
392625
+ if (record2.error || !record2.enabled) continue;
392626
+ for (const tool2 of record2.tools) {
392627
+ out.push({
392628
+ name: tool2.name,
392629
+ description: tool2.description ?? "",
392630
+ params: tool2.params ?? {},
392631
+ handler: tool2.handler,
392632
+ plugin: record2.manifest.name
392633
+ });
392634
+ }
392635
+ }
392636
+ return out;
392637
+ }
392580
392638
  /** All triggers from enabled plugins. */
392581
392639
  allTriggers() {
392582
392640
  return this.list().filter((p) => p.enabled && !p.error).flatMap((p) => p.triggers);
@@ -398016,25 +398074,15 @@ async function startGyBackend() {
398016
398074
  Promise.race([
398017
398075
  observability.pluginRegistry.reload(),
398018
398076
  new Promise((_, reject) => setTimeout(() => reject(new Error("plugin reload timeout (10s)")), 1e4))
398019
- ]).then((pluginRecords) => {
398020
- const pluginTools = [];
398021
- for (const record2 of pluginRecords) {
398022
- if (record2.error || !record2.enabled) continue;
398023
- for (const tool2 of record2.tools) {
398024
- pluginTools.push({
398025
- name: tool2.name,
398026
- description: tool2.description ?? "",
398027
- params: tool2.params ?? {},
398028
- handler: tool2.handler
398029
- });
398030
- }
398031
- }
398032
- if (pluginTools.length > 0) {
398033
- agentService.setPluginTools(pluginTools);
398034
- console.log(`[gybackend] Wired ${pluginTools.length} plugin tools from ${pluginRecords.filter((r) => !r.error && r.enabled).length} plugins into the agent.`);
398035
- } else {
398036
- console.log("[gybackend] No plugin tools found to wire.");
398077
+ ]).then(() => {
398078
+ const pluginTools = observability.pluginRegistry.collectAgentTools();
398079
+ agentService.setPluginTools(pluginTools);
398080
+ const enabled = observability.pluginRegistry.list().filter((r) => !r.error && r.enabled).length;
398081
+ try {
398082
+ gatewayService.broadcastRaw("tools:pluginsUpdated", agentService.listPluginTools());
398083
+ } catch {
398037
398084
  }
398085
+ console.log(`[gybackend] Wired ${pluginTools.length} plugin tools from ${enabled} plugins into the agent.`);
398038
398086
  }).catch((e) => {
398039
398087
  console.warn("[gybackend] Plugin tool wiring skipped:", e instanceof Error ? e.message : String(e));
398040
398088
  });
@@ -398698,6 +398746,7 @@ async function startGyBackend() {
398698
398746
  const settings = settingsService.getSettings();
398699
398747
  return buildBuiltInToolStatusSummary(settings.tools?.builtIn);
398700
398748
  },
398749
+ getPlugins: () => agentService.listPluginTools(),
398701
398750
  setBuiltInEnabled: async (name, enabled) => {
398702
398751
  const settings = settingsService.getSettings();
398703
398752
  const nextBuiltIn = { ...settings.tools?.builtIn ?? {} };
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neuralos",
3
- "version": "3.3.9",
3
+ "version": "3.4.0",
4
4
  "description": "AI-native terminal & agentic-AI operations platform for Forward Deployed Engineers & SREs: AIOps closed-loop remediation, AI SRE, self-healing infrastructure, runbook automation, ChatOps; executes over SSH/WinRM/serial under policy with tamper-evident audit.",
5
5
  "keywords": [
6
6
  "forward-deployed-engineer",
Binary file