@renanlido/tia-openness-mcp 1.13.0 → 1.13.1

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 +19 -59
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -28958,10 +28958,11 @@ async function tiaFetch(path, init = {}, opts = {}) {
28958
28958
  if (baseProblem) throw new TiaApiError(baseProblem, { kind: "invalid_api_base" });
28959
28959
  const url2 = `${BASE}${path}`;
28960
28960
  const timeout = opts.timeoutMs ?? TIMEOUT_MS;
28961
- const headers = {
28962
- Accept: "application/json",
28963
- ...init.headers
28964
- };
28961
+ const headers = new Headers(init.headers);
28962
+ if (!headers.has("Accept")) headers.set("Accept", "application/json");
28963
+ if (init.body !== void 0 && init.body !== null && !headers.has("Content-Type")) {
28964
+ headers.set("Content-Type", "application/json; charset=utf-8");
28965
+ }
28965
28966
  const dispatcher = timeout > FETCH_HEADERS_TIMEOUT_MS ? unboundedDispatcher() : void 0;
28966
28967
  const controller = new AbortController();
28967
28968
  const timer = setTimeout(() => controller.abort(), timeout);
@@ -37434,10 +37435,7 @@ function resolveBudget(getEnv = (name) => process.env[name]) {
37434
37435
  var PAGING_HINT = "Call the same tool again with limit (1..1000) and pass nextCursor from each page as cursor to read the rest.";
37435
37436
  var PAGED_HINT = "The budget omitted data from this page, so any nextCursor was removed from it: following a cursor now would skip what was omitted. Retry the same request (the same cursor, or none for the first page) with a smaller limit, for example half of the one you used. Only follow a nextCursor from a page that arrives without an omission marker.";
37436
37437
  var EXPORT_XML_HINT = "The XML is too large for the response budget. sha256, normalizedSha256, contentHash (when the serve computed one) and bytes stay in this result. Use tia_export_xml to write the block/type XML files to a directory on the serve host (it returns file paths), or tia_block_compare (block) to check the block against a SimaticML file you already hold without returning XML, or raise TIA_MCP_MAX_VALUE_CHARS/TIA_MCP_MAX_RESPONSE_CHARS on the MCP. tia_export_xml and tia_block_compare are not registered when TIA_MCP_MODE=read-only: in that mode raise the two limits.";
37437
- var EXPORT_SD_HINT = (
37438
- // Stryker disable next-line StringLiteral: static module constant, evaluated once at import; budget.test.ts pins every sentence of the delivered hint
37439
- "The SD text is too large for the response budget. contentHash (when the serve computed one), s7dclBytes and s7resBytes stay in this result. Raise TIA_MCP_MAX_VALUE_CHARS/TIA_MCP_MAX_RESPONSE_CHARS on the MCP, or export the object to a VCI workspace file on the serve host (tia_vci_export, which is not registered when TIA_MCP_MODE=read-only: in that mode raise the two limits). An omitted s7dcl is not the object: do not import or compare it."
37440
- );
37438
+ var EXPORT_SD_HINT = "The SD text is too large for the response budget. contentHash (when the serve computed one), s7dclBytes and s7resBytes stay in this result. Raise TIA_MCP_MAX_VALUE_CHARS/TIA_MCP_MAX_RESPONSE_CHARS on the MCP, or export the object to a VCI workspace file on the serve host (tia_vci_export, which is not registered when TIA_MCP_MODE=read-only: in that mode raise the two limits). An omitted s7dcl is not the object: do not import or compare it.";
37441
37439
  var CROSSREFS_HINT = "Call tia_crossrefs again with limit (1..1000) and pass the nextCursor of each page as cursor to read the sources page by page, or narrow the read with target, kind or filter. summary and coverage stay in this result. An omitted section is NOT complete: do not report the sources, an UnusedObjects list or any claim that nothing uses an object as complete from it.";
37442
37440
  var VCI_STATUS_HINT = "Call tia_vci_status again with limit (recommended 100, up to 1000) and pass the nextCursor of each page as cursor to read the objects page by page. summary and coverage stay in this result and describe the rows of the response, so fold them across every page of a paged read. An omitted section is NOT verified: do not report the workspace as clean, or any object as equal, from it.";
37443
37441
  var IOMAP_HINT = "Call tia_io_map again with limit (1..1000), starting at 100 to 200, and pass the nextCursor of each page as cursor to read the entries page by page. summary and coverage stay in this result. An omitted section is NOT complete: do not report the channels, the matched tags, the unmatched tags or a FAT/SAT I/O list as complete from it.";
@@ -38571,10 +38569,7 @@ function registerReadOnlyTools(server) {
38571
38569
  "tia_instances",
38572
38570
  {
38573
38571
  title: "TIA \u2014 running instances",
38574
- description: (
38575
- // Stryker disable next-line StringLiteral: handoff prose, facts are tested
38576
- "Lists TIA Portal sessions exposed by Openness and native Siemens.Automation.Portal.exe processes on the serve host. Native-only rows include the PID with mode and project path set to null. Maps to GET /instances. Read-only (class R)."
38577
- ),
38572
+ description: "Lists TIA Portal sessions exposed by Openness and native Siemens.Automation.Portal.exe processes on the serve host. Native-only rows include the PID with mode and project path set to null. Maps to GET /instances. Read-only (class R).",
38578
38573
  inputSchema: {}
38579
38574
  },
38580
38575
  async () => getResult("/instances")
@@ -39198,9 +39193,8 @@ function startingUnconfirmedResult(err, operation) {
39198
39193
  kind: err.kind,
39199
39194
  status: err.status,
39200
39195
  type: err.type,
39201
- // Stryker disable next-line LogicalOperator: Client-created timeouts omit `inner` and TiaApiError defaults it to null; the serve emits no timeout kind.
39196
+ // A "timeout" kind is produced by the client, not the serve, so inner and details are null.
39202
39197
  inner: err.inner ?? null,
39203
- // Stryker disable next-line LogicalOperator: Client-created timeouts omit `details` and TiaApiError defaults it to null; the serve emits no timeout kind.
39204
39198
  details: err.details ?? null,
39205
39199
  hint: "The client timeout does not cancel the serve-side operation, so its serial worker may still be occupied. A timeout or reachable /health endpoint proves neither success nor G1.",
39206
39200
  nextSteps: [
@@ -40571,7 +40565,6 @@ var IGNORED_ALWAYS = [
40571
40565
  "indentation and blank lines (also inside multi-line <Text> comments, via a per-line trim)",
40572
40566
  "<Created> (export timestamp)",
40573
40567
  "<InstalledProducts> (TIA hotfix level and installed option packages)",
40574
- // Stryker disable next-line StringLiteral: ignored-field explanation; compare-wiring.test.ts covers the actual normalization
40575
40568
  "UId numbering (canonical first appearance across definitions and references; connectivity is preserved)"
40576
40569
  ];
40577
40570
  var IGNORED_FORMATTING = "<NewLine/> and <Blank/> structured-text formatting tokens";
@@ -42871,10 +42864,7 @@ function renderPseudoScl(xml) {
42871
42864
  }
42872
42865
 
42873
42866
  // src/tools/asCode.ts
42874
- var COMPARISON_HASH_NOTE = (
42875
- // Stryker disable next-line StringLiteral: comparison migration prose; compare-wiring.test.ts covers the hash behavior
42876
- "`normalizedSha256` now uses wiring-safe UId canonicalization: stored values may change; recompute comparison baselines."
42877
- );
42867
+ var COMPARISON_HASH_NOTE = "`normalizedSha256` now uses wiring-safe UId canonicalization: stored values may change; recompute comparison baselines.";
42878
42868
  var HASH_CONTRACT_NOTE = "`contentHash`, `normalizedSha256` and `sha256` are different hash contracts over different normalizations: never substitute one for another, and pass only the `contentHash` of a fresh read as `expectedContentHash`. " + COMPARISON_HASH_NOTE;
42879
42869
  async function fetchXml(path, options) {
42880
42870
  const q = options ? `?options=${encodeURIComponent(options)}` : "";
@@ -42993,8 +42983,7 @@ function registerAsCodeTools(server) {
42993
42983
  "tia_block_compare",
42994
42984
  {
42995
42985
  title: "TIA \u2014 compare a block with given SimaticML",
42996
- description: "Exports the block from the project and compares it with the SimaticML you pass (e.g. the file committed in git). Like tia_export_block, this may compile an inconsistent block first (export requires consistency), which can regenerate its instance DB; read-mostly, treated as read for agent tool policy. Normalized: ignores BOM, line endings, indentation, blank lines, <Created>, <InstalledProducts> and \u2014 unless ignoreFormatting:false \u2014 <NewLine/>/<Blank/> formatting tokens (see the result's `ignored` field for the exact list). UIds are renumbered by first appearance across definitions and references: rewiring differs, pure renumbering matches; UId-like text in comments and values is preserved. Returns verdict equal|different and the first differing line. " + COMPARISON_HASH_NOTE + // Stryker disable next-line StringLiteral: route explanation; compare-wiring.test.ts exercises the comparison flow
42997
- " This is the proof that the project contains what was versioned. Maps to GET /plcs/{plc}/blocks/{block}/xml. Engineering version and schema namespaces remain significant; equality is not cross-version import acceptance. " + LONG_OPERATION_NOTE,
42986
+ description: "Exports the block from the project and compares it with the SimaticML you pass (e.g. the file committed in git). Like tia_export_block, this may compile an inconsistent block first (export requires consistency), which can regenerate its instance DB; read-mostly, treated as read for agent tool policy. Normalized: ignores BOM, line endings, indentation, blank lines, <Created>, <InstalledProducts> and \u2014 unless ignoreFormatting:false \u2014 <NewLine/>/<Blank/> formatting tokens (see the result's `ignored` field for the exact list). UIds are renumbered by first appearance across definitions and references: rewiring differs, pure renumbering matches; UId-like text in comments and values is preserved. Returns verdict equal|different and the first differing line. " + COMPARISON_HASH_NOTE + " This is the proof that the project contains what was versioned. Maps to GET /plcs/{plc}/blocks/{block}/xml. Engineering version and schema namespaces remain significant; equality is not cross-version import acceptance. " + LONG_OPERATION_NOTE,
42998
42987
  inputSchema: {
42999
42988
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43000
42989
  block: external_exports.string().describe("block name"),
@@ -43009,12 +42998,8 @@ function registerAsCodeTools(server) {
43009
42998
  "tia_block_render",
43010
42999
  {
43011
43000
  title: "TIA \u2014 render a block as readable pseudo-SCL (LAD/FBD)",
43012
- description: (
43013
- // Stryker disable next-line StringLiteral: inline-input guidance prose; blockRender.test.ts covers path refusals and BOM XML
43014
- "Class R, pure/offline: never calls serve. Pass XML text, not a file path: use the inline xml field of tia_export_block {plc, block}. Renders ONE SimaticML block as readable pseudo-SCL: LAD/FBD contacts, coils, logic boxes, comparators, MOVE/arithmetic, timers, counters, edges and block calls become SCL-like statements; SCL networks are rebuilt from their tokens; STL/GRAPH networks are marked not rendered. A value read by several statements or assigned to several targets is evaluated once: held in an RLO_<UId> temporary (UId of the part producing it) or read back from the first coil that wrote it. A MOVE/arithmetic output read by another part is inlined only when the box is always enabled; otherwise IF <EN> THEN TMP_<UId> := <value>; END_IF; and the reader uses TMP_<UId>, which keeps its previous (stale) value when EN is false. The output or return value of ONE call is TMP_<UId>_<pin> when it has several targets or, for an FC (no instance), when another part reads it or it is negated: bound in the call (pin => TMP_<UId>_<pin>, or TMP_<UId>_<pin> := call(args); for the return value), and targets and readers copy from it; two calls never share one. A call with an instance and one target is direct or read as #inst.pin. An edge (P_TRIG/N_TRIG) runs every scan: used inside an IF <EN> body it is evaluated before the IF (RLO_<UId> := P_TRIG(...);), not conditional on that EN. A negated output pin shows as NOT (a negated instance or call output: a following line target := NOT #t.Q; under the same EN). TYPE#(x) is x read as TYPE: an absolute address of a non-natural type for its size shows its own type (INT#(%MW0)); a comparator, arithmetic box or Inc/Dec casts with the instruction type every operand but a constant, a boolean or one of that type, values forwarded by MOVE, a box or a call too (INT#(RLO_40), INT#(TMP_41)); constants and written places are never cast. What it cannot translate stays visible as (* unsupported: ... *) and is listed in unsupported, as are a duplicate UId, edge memory shared by several edge parts, a negated operand on an S/R/P/N coil and an invalid name or UId: that part is ambiguous, read it in the XML or report it as not reviewed. A network too large to render is marked not rendered and in unsupported (render budget). Hidden and bidirectional characters show as <U+XXXX>. For review only: not importable, layout not preserved, ENO shown as EN (errors not modeled). Returns {text, blocks, unsupported, note}."
43015
- ),
43001
+ description: "Class R, pure/offline: never calls serve. Pass XML text, not a file path: use the inline xml field of tia_export_block {plc, block}. Renders ONE SimaticML block as readable pseudo-SCL: LAD/FBD contacts, coils, logic boxes, comparators, MOVE/arithmetic, timers, counters, edges and block calls become SCL-like statements; SCL networks are rebuilt from their tokens; STL/GRAPH networks are marked not rendered. A value read by several statements or assigned to several targets is evaluated once: held in an RLO_<UId> temporary (UId of the part producing it) or read back from the first coil that wrote it. A MOVE/arithmetic output read by another part is inlined only when the box is always enabled; otherwise IF <EN> THEN TMP_<UId> := <value>; END_IF; and the reader uses TMP_<UId>, which keeps its previous (stale) value when EN is false. The output or return value of ONE call is TMP_<UId>_<pin> when it has several targets or, for an FC (no instance), when another part reads it or it is negated: bound in the call (pin => TMP_<UId>_<pin>, or TMP_<UId>_<pin> := call(args); for the return value), and targets and readers copy from it; two calls never share one. A call with an instance and one target is direct or read as #inst.pin. An edge (P_TRIG/N_TRIG) runs every scan: used inside an IF <EN> body it is evaluated before the IF (RLO_<UId> := P_TRIG(...);), not conditional on that EN. A negated output pin shows as NOT (a negated instance or call output: a following line target := NOT #t.Q; under the same EN). TYPE#(x) is x read as TYPE: an absolute address of a non-natural type for its size shows its own type (INT#(%MW0)); a comparator, arithmetic box or Inc/Dec casts with the instruction type every operand but a constant, a boolean or one of that type, values forwarded by MOVE, a box or a call too (INT#(RLO_40), INT#(TMP_41)); constants and written places are never cast. What it cannot translate stays visible as (* unsupported: ... *) and is listed in unsupported, as are a duplicate UId, edge memory shared by several edge parts, a negated operand on an S/R/P/N coil and an invalid name or UId: that part is ambiguous, read it in the XML or report it as not reviewed. A network too large to render is marked not rendered and in unsupported (render budget). Hidden and bidirectional characters show as <U+XXXX>. For review only: not importable, layout not preserved, ENO shown as EN (errors not modeled). Returns {text, blocks, unsupported, note}.",
43016
43002
  inputSchema: {
43017
- // Stryker disable next-line StringLiteral: input description prose; path validation and parsing stay in mutation scope
43018
43003
  xml: external_exports.string().describe("XML text of ONE SimaticML block export, NOT a file path. Get it from the inline xml field of tia_export_block {plc, block}")
43019
43004
  }
43020
43005
  },
@@ -43334,10 +43319,7 @@ var expectedContentHashField = {
43334
43319
  )
43335
43320
  };
43336
43321
  var UNGUARDED_WRITE_HINT = "expectedContentHash was sent but the serve did not return `contentGuard`: it does not implement the stale-write guard (an older serve \u2014 update the TIAOpenness app on the host), so this write was NOT guarded against changes made in the project after you read the object. Re-read it (tia_export_block / tia_export_type) and compare before relying on the result.";
43337
- var SOURCE_IMPACT_NOTE = (
43338
- // Stryker disable next-line StringLiteral: description-only receipt catalog and guide pointer; runtime decisions remain in scope
43339
- " Returns changeImpact/compileImpact (flags/members), memberCapture and readGaps (unknown); trackChanges:false skips observation. See tia_guide gotchas. "
43340
- );
43322
+ var SOURCE_IMPACT_NOTE = " Returns changeImpact/compileImpact (flags/members), memberCapture and readGaps (unknown); trackChanges:false skips observation. See tia_guide gotchas. ";
43341
43323
  function guardedSummary(summary, expectedContentHash) {
43342
43324
  return expectedContentHash === void 0 ? summary : `${summary}, guarded by expectedContentHash (verified by the serve only when the write really runs; dryRun never calls it)`;
43343
43325
  }
@@ -43459,11 +43441,8 @@ function registerAuthoringTools(server) {
43459
43441
  description: `Creates a device (CPU/HMI/IO) by typeIdentifier. Optional group is an existing device user-group path (Area/Line, case-insensitive); omitted means project level. For group, GET /status must advertise supportsDeviceGroupCreation:true (app 1.8.1+); older serves are refused before creation. Uses typed CreateWithItem, never the unsafe generic CreateDevices call. The successful receipt identifies the canonical group; missing or different placement is an error naming the created station when available: inspect before retrying, never retry automatically. A dryRun preview does not check serve support. The answer uses the station type identifier, falling back to the first readable DeviceItem.TypeIdentifier, including HMI panels. typeIdentifierSource is device, deviceItem or unavailable; unavailable metadata has typeIdentifier:null and an explicit typeIdentifierUnavailableReason. For a single-item device such as a Classic panel, set its name as deviceItemName and omit deviceName; deviceName is the station name and may be read-only. On 400 device_name_read_only, re-read GET /devices before retrying with only deviceItemName. Guard Gd5: '/V<fw>' (slash), never ':V' \u2014 resolve via tia_catalog. Maps to POST /devices. Class M-off. ${LONG_OPERATION_NOTE}`,
43460
43442
  inputSchema: {
43461
43443
  typeIdentifier: external_exports.string().describe("OrderNumber:<MLFB>/V<fw> (Gd5; resolve via tia_catalog)"),
43462
- // Stryker disable next-line StringLiteral: handoff prose, facts are tested
43463
43444
  deviceItemName: external_exports.string().optional().describe("device-item name; for an HMI, names the panel item (for a single-item device, use this as its name)"),
43464
- // Stryker disable next-line StringLiteral: handoff prose, facts are tested
43465
43445
  deviceName: external_exports.string().optional().describe("station name; may be read-only on some device types"),
43466
- // Stryker disable next-line StringLiteral: tool parameter documentation
43467
43446
  group: external_exports.string().optional().describe("existing device user-group path from the project root, e.g. Area/Line; omitted: project level (app 1.8.1+)"),
43468
43447
  ...dryRunField
43469
43448
  }
@@ -43715,10 +43694,7 @@ function registerAuthoringTools(server) {
43715
43694
  "tia_tag_create",
43716
43695
  {
43717
43696
  title: "TIA \u2014 create tag",
43718
- description: (
43719
- // Stryker disable next-line StringLiteral: refusal guidance prose; validation behavior is covered by PlcValidationTests
43720
- "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or malformed/type-mismatched/out-of-range absolute addresses. Creates a tag in a table. Refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the name matches, ignoring case, any tag, constant or block of the PLC. The result carries `overlaps`: the OTHER tags whose logical address overlaps this one (informational, never a refusal). Maps to POST /plcs/{plc}/tags. M-off."
43721
- ),
43697
+ description: "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or malformed/type-mismatched/out-of-range absolute addresses. Creates a tag in a table. Refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the name matches, ignoring case, any tag, constant or block of the PLC. The result carries `overlaps`: the OTHER tags whose logical address overlaps this one (informational, never a refusal). Maps to POST /plcs/{plc}/tags. M-off.",
43722
43698
  inputSchema: {
43723
43699
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43724
43700
  table: external_exports.string().optional().describe("tag table (default: the standard one)"),
@@ -43748,10 +43724,7 @@ function registerAuthoringTools(server) {
43748
43724
  "tia_tag_update",
43749
43725
  {
43750
43726
  title: "TIA \u2014 update tag",
43751
- description: (
43752
- // Stryker disable next-line StringLiteral: refusal guidance prose; validation behavior is covered by PlcValidationTests
43753
- "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or malformed/type-mismatched/out-of-range absolute addresses, including previews. Updates ONE tag: rename, data type, logical address and the external accessible/visible/writable flags. Only the fields you pass change, and only those that differ from the current value are written (none passed: 400 missing_param; all unchanged: 200 with changes:[]). A rename is refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the new name matches, ignoring case, another tag, constant or block of the PLC; an unknown table or tag is 404 not_found. The result carries `changes` [{field,from,to}] and `overlaps`: the OTHER tags whose address overlaps the final one (informational, never a refusal). dryRun (Gd11) is answered by the serve (needs an open project): it runs the same guards and returns that plan WITHOUT changing anything. Maps to POST /plcs/{plc}/tagtables/{table}/tags/{tag}. M-off."
43754
- ),
43727
+ description: "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or malformed/type-mismatched/out-of-range absolute addresses, including previews. Updates ONE tag: rename, data type, logical address and the external accessible/visible/writable flags. Only the fields you pass change, and only those that differ from the current value are written (none passed: 400 missing_param; all unchanged: 200 with changes:[]). A rename is refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the new name matches, ignoring case, another tag, constant or block of the PLC; an unknown table or tag is 404 not_found. The result carries `changes` [{field,from,to}] and `overlaps`: the OTHER tags whose address overlaps the final one (informational, never a refusal). dryRun (Gd11) is answered by the serve (needs an open project): it runs the same guards and returns that plan WITHOUT changing anything. Maps to POST /plcs/{plc}/tagtables/{table}/tags/{tag}. M-off.",
43755
43728
  inputSchema: {
43756
43729
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43757
43730
  table: external_exports.string().describe("tag table that holds the tag"),
@@ -43776,10 +43749,7 @@ function registerAuthoringTools(server) {
43776
43749
  "tia_constant_create",
43777
43750
  {
43778
43751
  title: "TIA \u2014 create constant",
43779
- description: (
43780
- // Stryker disable next-line StringLiteral: refusal guidance prose; validation behavior is covered by PlcValidationTests
43781
- "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or invalid decimal integer literals; typed/radix literals pass through. Creates a user constant in a tag table. Refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the name matches, ignoring case, any tag, constant or block of the PLC. Maps to POST /plcs/{plc}/constants. M-off."
43782
- ),
43752
+ description: "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or invalid decimal integer literals; typed/radix literals pass through. Creates a user constant in a tag table. Refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the name matches, ignoring case, any tag, constant or block of the PLC. Maps to POST /plcs/{plc}/constants. M-off.",
43783
43753
  inputSchema: {
43784
43754
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43785
43755
  table: external_exports.string().optional().describe("tag table (default: the standard one)"),
@@ -43795,10 +43765,7 @@ function registerAuthoringTools(server) {
43795
43765
  "tia_constant_update",
43796
43766
  {
43797
43767
  title: "TIA \u2014 update constant",
43798
- description: (
43799
- // Stryker disable next-line StringLiteral: refusal guidance prose; validation behavior is covered by PlcValidationTests
43800
- "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or invalid decimal integer literals, including previews; typed/radix literals pass through. Updates ONE user constant: rename, data type and value. Only the fields you pass change, and only those that differ from the current value are written (none passed: 400 missing_param; all unchanged: 200 with changes:[]). A rename is refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the new name matches, ignoring case, another tag, constant or block of the PLC; an unknown table or constant is 404 not_found. dryRun (Gd11) is answered by the serve (needs an open project): it runs the same guards and returns the plan {changes:[{field,from,to}]} WITHOUT changing anything. Maps to POST /plcs/{plc}/tagtables/{table}/constants/{constant}. M-off."
43801
- ),
43768
+ description: "App 1.8+ serve returns 400 bad_request (details.field, rule) for quote-bearing names or invalid decimal integer literals, including previews; typed/radix literals pass through. Updates ONE user constant: rename, data type and value. Only the fields you pass change, and only those that differ from the current value are written (none passed: 400 missing_param; all unchanged: 200 with changes:[]). A rename is refused with 409 name_collision (details.collidesWith = the colliding tag, constant or block) when the new name matches, ignoring case, another tag, constant or block of the PLC; an unknown table or constant is 404 not_found. dryRun (Gd11) is answered by the serve (needs an open project): it runs the same guards and returns the plan {changes:[{field,from,to}]} WITHOUT changing anything. Maps to POST /plcs/{plc}/tagtables/{table}/constants/{constant}. M-off.",
43802
43769
  inputSchema: {
43803
43770
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43804
43771
  table: external_exports.string().describe("tag table that holds the constant"),
@@ -43989,10 +43956,7 @@ function registerAuthoringTools(server) {
43989
43956
  "tia_types_import",
43990
43957
  {
43991
43958
  title: "TIA \u2014 import type/UDT (SimaticML XML)",
43992
- description: (
43993
- // Stryker disable next-line StringLiteral: target-local UDT authoring guidance, not import validation
43994
- "Imports a UDT in SimaticML XML. Use a real export for the selected target; cross-version import compatibility is unverified, and V21 import behavior is unchanged (no new version preflight refusal). See tia_guide recipes, 'TIA version evidence and SimaticML'. Import UDTs BEFORE the blocks that use them (Gd6). Stale-write guard: pass the type's `contentHash` from tia_export_type (or tia_type_source) as `expectedContentHash` and the serve checks it against the type's current export BEFORE importing \u2014 a mismatch is 409 state_changed and NOTHING is imported; a match adds `contentGuard` to the result. " + HASH_CONTRACT_NOTE + " It guards exactly ONE type: the XML (or the file at `path`) must contain exactly one type (else 400 bad_request), and a hash for a type that does not exist (any more) is refused as state_changed \u2014 omit it to create; an existing type whose current export is not well-formed XML cannot be hashed and is refused with 409 unverifiable (NOTHING is imported; repair it, or omit expectedContentHash to write without the guard). " + SOURCE_IMPACT_NOTE + `Needs an app with the guard: an older serve ignores the field and the result says the import was NOT guarded. dryRun never verifies it. Maps to POST /plcs/{plc}/types/import. M-off. ${LONG_OPERATION_NOTE}`
43995
- ),
43959
+ description: "Imports a UDT in SimaticML XML. Use a real export for the selected target; cross-version import compatibility is unverified, and V21 import behavior is unchanged (no new version preflight refusal). See tia_guide recipes, 'TIA version evidence and SimaticML'. Import UDTs BEFORE the blocks that use them (Gd6). Stale-write guard: pass the type's `contentHash` from tia_export_type (or tia_type_source) as `expectedContentHash` and the serve checks it against the type's current export BEFORE importing \u2014 a mismatch is 409 state_changed and NOTHING is imported; a match adds `contentGuard` to the result. " + HASH_CONTRACT_NOTE + " It guards exactly ONE type: the XML (or the file at `path`) must contain exactly one type (else 400 bad_request), and a hash for a type that does not exist (any more) is refused as state_changed \u2014 omit it to create; an existing type whose current export is not well-formed XML cannot be hashed and is refused with 409 unverifiable (NOTHING is imported; repair it, or omit expectedContentHash to write without the guard). " + SOURCE_IMPACT_NOTE + `Needs an app with the guard: an older serve ignores the field and the result says the import was NOT guarded. dryRun never verifies it. Maps to POST /plcs/{plc}/types/import. M-off. ${LONG_OPERATION_NOTE}`,
43996
43960
  inputSchema: {
43997
43961
  plc: external_exports.string().describe("PLC software name from tia_plcs.name, not the device station name"),
43998
43962
  xml: external_exports.string().optional().describe("SimaticML XML content of the UDT (alternative to path)"),
@@ -44141,12 +44105,8 @@ function registerAssetTools(server) {
44141
44105
  "tia_device_from_mastercopy",
44142
44106
  {
44143
44107
  title: "TIA \u2014 station from a prepared master copy",
44144
- description: (
44145
- // Stryker disable next-line StringLiteral: handoff prose, not an executable contract
44146
- `Requires app \u2265 v1.8.0. Creates a new station from a device master copy in the open project's library (name from tia_library_mastercopies), returning {device: actualName}; TIA may rename the copy and its PLC. Known block-only content is refused with 409 mastercopy_not_device; unknown content goes to Openness. Clones an owner-prepared configuration, including PUT/GET, purchased-license selection and OPC UA interface mappings on the validated 1214C V4.4; it is not a setter for an existing CPU and does not grant license entitlement. Certificates are not copied: inspect the new OPC UA item, regenerate its server certificate if needed and compile before any human-gated download. Maps to POST /devices/frommastercopy {masterCopy}. Class M-off. ${LONG_OPERATION_NOTE}`
44147
- ),
44108
+ description: `Requires app \u2265 v1.8.0. Creates a new station from a device master copy in the open project's library (name from tia_library_mastercopies), returning {device: actualName}; TIA may rename the copy and its PLC. Known block-only content is refused with 409 mastercopy_not_device; unknown content goes to Openness. Clones an owner-prepared configuration, including PUT/GET, purchased-license selection and OPC UA interface mappings on the validated 1214C V4.4; it is not a setter for an existing CPU and does not grant license entitlement. Certificates are not copied: inspect the new OPC UA item, regenerate its server certificate if needed and compile before any human-gated download. Maps to POST /devices/frommastercopy {masterCopy}. Class M-off. ${LONG_OPERATION_NOTE}`,
44148
44109
  inputSchema: {
44149
- // Stryker disable next-line StringLiteral: schema description prose; validation stays in mutation scope
44150
44110
  masterCopy: external_exports.string().min(1).describe("owner-prepared device master copy in the project library"),
44151
44111
  ...dryRunField
44152
44112
  }
@@ -46507,7 +46467,7 @@ function buildServer(mode, version2, budget = resolveBudget()) {
46507
46467
  }
46508
46468
 
46509
46469
  // src/index.ts
46510
- var VERSION = "1.13.0";
46470
+ var VERSION = "1.13.1";
46511
46471
  async function main() {
46512
46472
  if (process.argv.slice(2).some((a) => a === "--version" || a === "-v")) {
46513
46473
  console.log(VERSION);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@renanlido/tia-openness-mcp",
3
- "version": "1.13.0",
3
+ "version": "1.13.1",
4
4
  "description": "MCP server (stdio) — thin HTTP client over the TIA Openness `serve` API. Zero Openness/net48 references.",
5
5
  "mcpName": "io.github.renanlido/tia-openness",
6
6
  "keywords": [