@renanlido/tia-openness-mcp 1.10.6 → 1.10.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.
Files changed (2) hide show
  1. package/dist/index.js +16 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -38549,7 +38549,7 @@ function uploadResumeSteps(reason) {
38549
38549
  function goOnlineResumeSteps() {
38550
38550
  return [
38551
38551
  "1. Confirm with a human that it is safe to connect to the target machine.",
38552
- "2. Re-call tia_online with confirm:true."
38552
+ "2. Re-call tia_online with confirm:true and the SAME connectionMode, pcInterfaceName, pcInterfaceNumber and targetInterfaceName as this plan."
38553
38553
  ];
38554
38554
  }
38555
38555
  function netScanResumeSteps() {
@@ -39208,6 +39208,17 @@ function registerUploadTools(server) {
39208
39208
  }
39209
39209
 
39210
39210
  // src/tools/online.ts
39211
+ function onlineConnectionRefusal(plan) {
39212
+ const missing = ["connectionMode", "pcInterfaceName"].filter((k) => (plan[k] ?? "").trim().length === 0);
39213
+ if (missing.length === 0) return null;
39214
+ return errorResult(
39215
+ new TiaApiError(
39216
+ `tia_online with confirm:true needs connectionMode and pcInterfaceName; missing: ${missing.join(", ")}. Nothing was sent to serve and the PLC is not online.`,
39217
+ { status: 400, kind: "connection_fields_required", details: { missing, plan } }
39218
+ ),
39219
+ "Repeat tia_online with confirm:true and the SAME connectionMode, pcInterfaceName, pcInterfaceNumber and targetInterfaceName shown in the go_online plan the human approved. Never guess them: read the names with tia_pg_interfaces (no network scan) and, if they differ from that plan, ask the human again."
39220
+ );
39221
+ }
39211
39222
  function registerOnlineTools(server) {
39212
39223
  server.registerTool(
39213
39224
  "tia_connection_create",
@@ -39231,7 +39242,7 @@ function registerOnlineTools(server) {
39231
39242
  "tia_online",
39232
39243
  {
39233
39244
  title: "TIA \u2014 go online (GATE G4)",
39234
- description: "Connects ONLINE to the physical PLC. GATE G4: pass confirm:true (after a human confirms it's safe to connect to the target machine); without it, returns a handoff. Maps to POST /plcs/{plc}/online.",
39245
+ description: "Connects ONLINE to the physical PLC. GATE G4: pass confirm:true (after a human confirms it's safe to connect to the target machine); without it, returns a handoff. The confirm:true call must repeat the SAME connectionMode, pcInterfaceName, pcInterfaceNumber and targetInterfaceName as the approved plan: without connectionMode or pcInterfaceName it is refused (connection_fields_required) and nothing is sent. Maps to POST /plcs/{plc}/online.",
39235
39246
  inputSchema: {
39236
39247
  // Stryker disable next-line StringLiteral: handoff prose, facts are tested
39237
39248
  plc: external_exports.string().describe("PLC name"),
@@ -39249,6 +39260,8 @@ function registerOnlineTools(server) {
39249
39260
  async ({ plc, connectionMode, pcInterfaceName, pcInterfaceNumber, targetInterfaceName, confirm }, extra) => {
39250
39261
  const plan = { plc, connectionMode, pcInterfaceName, pcInterfaceNumber, targetInterfaceName };
39251
39262
  if (confirm !== true) return gateHandoff("go_online", { plc, plan });
39263
+ const refusal = onlineConnectionRefusal(plan);
39264
+ if (refusal !== null) return refusal;
39252
39265
  return runWithHumanConfirm(
39253
39266
  server,
39254
39267
  () => ({ message: onlineQuestion(plan), refusal: (verdict) => humanRefusal("go_online", verdict, { plc, plan }) }),
@@ -39780,7 +39793,7 @@ function buildServer(mode, version2, budget = resolveBudget()) {
39780
39793
  }
39781
39794
 
39782
39795
  // src/index.ts
39783
- var VERSION = "1.10.6";
39796
+ var VERSION = "1.10.7";
39784
39797
  async function main() {
39785
39798
  if (process.argv.slice(2).some((a) => a === "--version" || a === "-v")) {
39786
39799
  console.log(VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renanlido/tia-openness-mcp",
3
- "version": "1.10.6",
3
+ "version": "1.10.7",
4
4
  "description": "MCP server (stdio) — thin HTTP client over the TIA Openness `serve` API. Zero Openness/net48 references.",
5
5
  "license": "MIT",
6
6
  "type": "module",