plm-upload-mcp 1.3.3 → 1.3.5

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 (3) hide show
  1. package/README.md +2 -2
  2. package/index.mjs +8 -7
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -43,7 +43,7 @@ Uploads one or more files, each paired with its target SKU.
43
43
  - `files`: array of `{ path, sku, category? }`
44
44
  - `path` — absolute local path to the file
45
45
  - `sku` — component SKU, e.g. `MNT-1234-A0`; it must already exist in the PLM
46
- - `category` — optional: `Compliance` | `Datasheets` | `Software` | `Drawings` | `3D files` (left out = the PLM guesses from the file name)
46
+ - `category` — optional: `Compliance` | `Datasheet` | `Quotation` | `Software` | `Drawing` | `3D file` (left out = the PLM guesses from the file name)
47
47
 
48
48
  Each file lands in PLM storage and is mirrored into that SKU's Google Drive folder on
49
49
  the part's own drive (staging or main, from the component; created automatically if it
@@ -70,7 +70,7 @@ Uprevs a staging prototype to its next X revision (`MNT-1234-X1` → `MNT-1234-X
70
70
  same as **Uprev** in the PLM: a new component carrying the old one's details, with its
71
71
  own staging Drive folder; the old revision stays as history.
72
72
 
73
- - `sku`: the current staging SKU (X0–X8; releasing to A0 is a promotion request in the PLM)
73
+ - `sku`: the current staging SKU (X0–X98; releasing to A0 is a promotion request in the PLM)
74
74
  - `drawing_pdf`: optional path to the new revision's drawing PDF
75
75
  - `step`: optional path to the new revision's STEP model
76
76
  - `proceed_despite_warnings`: optional, see below
package/index.mjs CHANGED
@@ -140,11 +140,11 @@ const IM_METHOD = /\binjection\b|\bmou?ld(ed|ing)?\s+plastic/i
140
140
  const isXRev = (sku) => /-X\d+$/.test(sku)
141
141
  const familyOf = (sku) => sku.replace(/-(X\d+|[A-Z]\d|\d\d)$/, '')
142
142
 
143
- /** Next prototype revision, same rule as the edge `uprev` (X0–X8 only). */
143
+ /** Next prototype revision, same rule as the edge `uprev` (X0–X98 only). */
144
144
  function nextRev(sku) {
145
- const m = /^([A-Z]{3})-(\d{4})-X(\d)$/.exec(sku)
146
- if (!m) return { error: `${sku}: only staging prototype revisions (X0–X8) can be uprevved` }
147
- if (Number(m[3]) >= 9) return { error: 'X9 is the last prototype revision — release to A0 instead' }
145
+ const m = /^([A-Z]{3})-(\d{4})-X(\d|[1-9]\d)$/.exec(sku)
146
+ if (!m) return { error: `${sku}: only staging prototype revisions (X0–X98) can be uprevved` }
147
+ if (Number(m[3]) >= 99) return { error: 'X99 is the last prototype revision — release to A0 instead' }
148
148
  return { newSku: `${m[1]}-${m[2]}-X${Number(m[3]) + 1}` }
149
149
  }
150
150
 
@@ -301,7 +301,7 @@ server.registerTool(
301
301
  path: z.string().describe('Absolute local path to the file to upload.'),
302
302
  sku: z.string().describe('Component SKU this file belongs to, e.g. MNT-1234-A0.'),
303
303
  category: z
304
- .enum(['Compliance', 'Datasheets', 'Software', 'Drawings', '3D files'])
304
+ .enum(['Compliance', 'Datasheet', 'Quotation', 'Software', 'Drawing', '3D file'])
305
305
  .optional()
306
306
  .describe('PLM file category. Leave it out and the PLM guesses one from the file name.'),
307
307
  }),
@@ -418,7 +418,7 @@ server.registerTool(
418
418
  "if its title block still shows the old SKU, no SKU/REV, or another part, NOTHING is uprevved and " +
419
419
  "the warnings come back. Show them to the user and only call again with " +
420
420
  "proceed_despite_warnings: true if they say to go ahead. A file name that is not " +
421
- "`[new SKU] Part Name REV0X` is uploaded but flagged (name_issue): tell the user. Only staging X0-X8 parts can be uprevved; " +
421
+ "`[new SKU] Part Name REV0X` is uploaded but flagged (name_issue): tell the user. Only staging X0-X98 parts can be uprevved; " +
422
422
  "releasing to A0 is a promotion request in the PLM.",
423
423
  inputSchema: {
424
424
  sku: z.string().describe('Current SKU of the staging part, e.g. MNT-1234-X1.'),
@@ -760,7 +760,8 @@ if (process.argv.includes('--selftest')) {
760
760
  assert(fileNameIssue('[SKN-0176-X1] DEPTH CAMERA COVER LEFT.pdf', 'SKN-0176-X1'), 'no REV flagged')
761
761
  assert(fileNameIssue('[SKN-0176-X0] DEPTH CAMERA COVER LEFT REV00.pdf', 'SKN-0176-X1'), 'other rev flagged')
762
762
  assert(nextRev('MNT-1234-X1').newSku === 'MNT-1234-X2', 'X1 -> X2')
763
- assert(nextRev('MNT-1234-X9').error && nextRev('MNT-1234-A0').error, 'X9 and A0 refused')
763
+ assert(nextRev('MNT-1234-X9').newSku === 'MNT-1234-X10' && nextRev('MNT-1234-X98').newSku === 'MNT-1234-X99', 'X9 → X10, X98 → X99')
764
+ assert(nextRev('MNT-1234-X99').error && nextRev('MNT-1234-A0').error, 'X99 and A0 refused')
764
765
  const prev = { sku: 'MNT-1234-X1', drawing_rev: '01' }
765
766
  assert(drawingWarnings({ is_lionsbot: true, sku: 'MNT-1234-X2', rev: '02' }, 'MNT-1234-X2', prev).length === 0, 'clean drawing')
766
767
  assert(/No difference/.test(drawingWarnings({ is_lionsbot: true, sku: 'MNT-1234-X1', rev: '01' }, 'MNT-1234-X2', prev)[0]), 'same sku + rev')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plm-upload-mcp",
3
- "version": "1.3.3",
3
+ "version": "1.3.5",
4
4
  "description": "MCP server to read the LionsBot PLM (SKU folders, component metadata, extracted drawing metadata, product & staging BOMs) bulk-upload SolidWorks exports (STEP/PDF) into it by SKU, create components' Drive folders and uprev staging prototypes.",
5
5
  "license": "UNLICENSED",
6
6
  "keywords": ["mcp", "modelcontextprotocol", "lionsbot", "plm", "solidworks"],