@evref-bl/pharo-launcher-mcp 0.1.3 → 0.1.4

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.
@@ -0,0 +1,68 @@
1
+ export function isAsciiDigit(char) {
2
+ return char !== undefined && char >= "0" && char <= "9";
3
+ }
4
+ export function isWhitespace(char) {
5
+ return char === " " || char === "\t";
6
+ }
7
+ export function leadingDigits(value) {
8
+ let index = 0;
9
+ while (isAsciiDigit(value[index])) {
10
+ index += 1;
11
+ }
12
+ return index > 0 ? value.slice(0, index) : undefined;
13
+ }
14
+ export function stripLeadingNumber(value) {
15
+ const digits = leadingDigits(value);
16
+ if (!digits || !isWhitespace(value[digits.length])) {
17
+ return value;
18
+ }
19
+ return value.slice(digits.length).trimStart();
20
+ }
21
+ export function afterLeadingDigits(value) {
22
+ const digits = leadingDigits(value);
23
+ if (!digits || !isWhitespace(value[digits.length])) {
24
+ return undefined;
25
+ }
26
+ return value.slice(digits.length).trimStart();
27
+ }
28
+ export function whitespaceTokens(value) {
29
+ const tokens = [];
30
+ let tokenStart;
31
+ for (let index = 0; index < value.length; index += 1) {
32
+ if (isWhitespace(value[index])) {
33
+ if (tokenStart !== undefined) {
34
+ tokens.push(value.slice(tokenStart, index));
35
+ tokenStart = undefined;
36
+ }
37
+ continue;
38
+ }
39
+ tokenStart ??= index;
40
+ }
41
+ if (tokenStart !== undefined) {
42
+ tokens.push(value.slice(tokenStart));
43
+ }
44
+ return tokens;
45
+ }
46
+ export function quotedValues(value) {
47
+ const values = [];
48
+ let quotedStart;
49
+ for (let index = 0; index < value.length; index += 1) {
50
+ if (value[index] !== '"') {
51
+ continue;
52
+ }
53
+ if (quotedStart === undefined) {
54
+ quotedStart = index + 1;
55
+ continue;
56
+ }
57
+ values.push(value.slice(quotedStart, index));
58
+ quotedStart = undefined;
59
+ }
60
+ return values;
61
+ }
62
+ export function hasCaseInsensitiveSuffix(value, suffix) {
63
+ return value.toLowerCase().endsWith(suffix.toLowerCase());
64
+ }
65
+ export function compactTokenText(value) {
66
+ return value.toLowerCase().replaceAll(" ", "").replaceAll("-", "").replaceAll("_", "");
67
+ }
68
+ //# sourceMappingURL=textTokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textTokens.js","sourceRoot":"","sources":["../src/textTokens.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,IAAI,GAAG,IAAI,IAAI,IAAI,GAAG,CAAC;AAC1D,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,IAAwB;IACnD,OAAO,IAAI,KAAK,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC;AACvC,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,KAAa;IACzC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,OAAO,YAAY,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;QAClC,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IAED,OAAO,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QACnD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,SAAS,EAAE,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,KAAa;IAC9C,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC;IACpC,IAAI,CAAC,MAAM,IAAI,CAAC,YAAY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AK,GAAG,CAAC,CAAC;YACxB,SAAS;QACX,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;QAC7C,WAAW,GAAG,SAAS,CAAC;IAC1B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,wBAAwB,CAAC,KAAa,EAAE,MAAc;IACpE,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,CAAC;AAC5D,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,KAAa;IAC5C,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;AACzF,CAAC"}
@@ -163,6 +163,13 @@ Example:
163
163
  The result reports source and destination image metadata, touched paths,
164
164
  metadata repair, verification, and cleanup guidance.
165
165
 
166
+ A failure adds `message`, one line naming both images, both profiles, what went
167
+ wrong and the way out, next to the `diagnostic` and `action` it is built from.
168
+ A destination that already exists is named by its directory, so the caller can
169
+ read `destinationImage`, adopt what is there, copy under another name, or
170
+ delete it with the destination profile active. An existing image is never
171
+ replaced.
172
+
166
173
  ## Cleanup Rules
167
174
 
168
175
  Only clean up caller-owned profile state. Keep command envelopes, log files,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evref-bl/pharo-launcher-mcp",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "MCP server for controlling Pharo Launcher images, templates, VMs, and processes.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -40,6 +40,7 @@
40
40
  "typecheck": "tsc -p tsconfig.json --noEmit",
41
41
  "test": "npm run test:unit",
42
42
  "test:unit": "vitest run --exclude **/*.integration.test.ts",
43
+ "coverage": "vitest run --exclude **/*.integration.test.ts --coverage --coverage.reporter=text --coverage.reporter=lcov",
43
44
  "test:integration": "vitest run src/integration/live.integration.test.ts src/integration/lifecycle.integration.test.ts src/integration/copy.integration.test.ts --testTimeout=900000",
44
45
  "clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\"",
45
46
  "verify:env": "powershell -ExecutionPolicy Bypass -File ./scripts/verify-environment.ps1",
@@ -51,6 +52,7 @@
51
52
  },
52
53
  "devDependencies": {
53
54
  "@types/node": "^22.12.0",
55
+ "@vitest/coverage-v8": "^4.0.0",
54
56
  "typescript": "^5.9.0",
55
57
  "vitest": "^4.0.0"
56
58
  }