@evref-bl/plexus 0.23.0 → 1.0.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/LICENSE +202 -0
- package/README.md +2 -1
- package/dist/answers/index.d.ts +19 -2
- package/dist/answers/index.d.ts.map +1 -1
- package/dist/answers/index.js +71 -3
- package/dist/answers/index.js.map +1 -1
- package/dist/answers/texts.d.ts +20 -2
- package/dist/answers/texts.d.ts.map +1 -1
- package/dist/answers/texts.js +48 -9
- package/dist/answers/texts.js.map +1 -1
- package/dist/commandLine.d.ts +2 -1
- package/dist/commandLine.d.ts.map +1 -1
- package/dist/commandLine.js +32 -15
- package/dist/commandLine.js.map +1 -1
- package/dist/config/pharoMcpVersion.d.ts +1 -1
- package/dist/config/pharoMcpVersion.js +1 -1
- package/dist/errors.d.ts +16 -3
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/forward/index.d.ts +2 -1
- package/dist/forward/index.d.ts.map +1 -1
- package/dist/forward/index.js +9 -11
- package/dist/forward/index.js.map +1 -1
- package/dist/forward/jsonRpc.d.ts +18 -5
- package/dist/forward/jsonRpc.d.ts.map +1 -1
- package/dist/forward/jsonRpc.js +72 -29
- package/dist/forward/jsonRpc.js.map +1 -1
- package/dist/home.d.ts +1 -1
- package/dist/home.d.ts.map +1 -1
- package/dist/home.js.map +1 -1
- package/dist/images/bases.js +2 -2
- package/dist/images/bases.js.map +1 -1
- package/dist/images/claims.d.ts +3 -0
- package/dist/images/claims.d.ts.map +1 -1
- package/dist/images/claims.js +9 -0
- package/dist/images/claims.js.map +1 -1
- package/dist/images/context.d.ts.map +1 -1
- package/dist/images/context.js +2 -1
- package/dist/images/context.js.map +1 -1
- package/dist/images/create.d.ts +3 -7
- package/dist/images/create.d.ts.map +1 -1
- package/dist/images/create.js +9 -20
- package/dist/images/create.js.map +1 -1
- package/dist/images/delete.d.ts.map +1 -1
- package/dist/images/delete.js +5 -4
- package/dist/images/delete.js.map +1 -1
- package/dist/images/endpoint.d.ts.map +1 -1
- package/dist/images/endpoint.js +2 -0
- package/dist/images/endpoint.js.map +1 -1
- package/dist/images/index.d.ts +4 -18
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/index.js +4 -4
- package/dist/images/index.js.map +1 -1
- package/dist/images/list.d.ts +1 -1
- package/dist/images/list.d.ts.map +1 -1
- package/dist/images/list.js +8 -11
- package/dist/images/list.js.map +1 -1
- package/dist/images/names.d.ts +3 -1
- package/dist/images/names.d.ts.map +1 -1
- package/dist/images/names.js +9 -4
- package/dist/images/names.js.map +1 -1
- package/dist/images/prepare.js +4 -4
- package/dist/images/prepare.js.map +1 -1
- package/dist/images/processes.d.ts +1 -1
- package/dist/images/processes.js +3 -11
- package/dist/images/processes.js.map +1 -1
- package/dist/images/start.d.ts +3 -13
- package/dist/images/start.d.ts.map +1 -1
- package/dist/images/start.js +32 -19
- package/dist/images/start.js.map +1 -1
- package/dist/images/stop.d.ts +2 -10
- package/dist/images/stop.d.ts.map +1 -1
- package/dist/images/stop.js +11 -3
- package/dist/images/stop.js.map +1 -1
- package/dist/images/store.d.ts +6 -0
- package/dist/images/store.d.ts.map +1 -1
- package/dist/images/store.js +24 -3
- package/dist/images/store.js.map +1 -1
- package/dist/images/templates.d.ts +25 -2
- package/dist/images/templates.d.ts.map +1 -1
- package/dist/images/templates.js +206 -15
- package/dist/images/templates.js.map +1 -1
- package/dist/index.d.ts +3 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.d.ts +3 -3
- package/dist/launcher/pharoLauncherMcpClient.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.js +9 -9
- package/dist/launcher/pharoLauncherMcpClient.js.map +1 -1
- package/dist/launcher/pharoLauncherProfile.d.ts +7 -2
- package/dist/launcher/pharoLauncherProfile.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherProfile.js +7 -14
- package/dist/launcher/pharoLauncherProfile.js.map +1 -1
- package/dist/launcher/vmRenewal.d.ts +1 -1
- package/dist/launcher/vmRenewal.d.ts.map +1 -1
- package/dist/mcp/server.d.ts +5 -5
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +190 -70
- package/dist/mcp/server.js.map +1 -1
- package/dist/telemetry/trace.d.ts +11 -3
- package/dist/telemetry/trace.d.ts.map +1 -1
- package/dist/telemetry/trace.js +30 -8
- package/dist/telemetry/trace.js.map +1 -1
- package/dist/types.d.ts +59 -15
- package/dist/types.d.ts.map +1 -1
- package/package.json +3 -3
package/dist/telemetry/trace.js
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What PLexus records about its own work, through the OpenTelemetry API
|
|
3
3
|
* alone: every call here is a no-op until the application running PLexus
|
|
4
|
-
* registers an SDK. A span carries names, kinds and outcomes,
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* registers an SDK. A span carries names, kinds and outcomes, and what the
|
|
5
|
+
* OpenTelemetry MCP conventions ask of its side: a request's id, the address
|
|
6
|
+
* and port of the image it goes to, and, as its status description, the
|
|
7
|
+
* message of the JSON-RPC error that failed it. A tool call's arguments and
|
|
8
|
+
* result are on its span only when the conventions' content switch turns
|
|
9
|
+
* them on (`capturesContent`); beyond them, no span names an image or a path.
|
|
7
10
|
*
|
|
8
11
|
* Every span carries the `session.id` of the work it belongs to: the session
|
|
9
12
|
* `plexus mcp` runs a call in, or else one made at random for the process.
|
|
@@ -61,6 +64,24 @@ export function clientAttributes(client) {
|
|
|
61
64
|
...(typeof version === "string" && clientVersionPattern.test(version) ? { "plexus.client.version": version } : {}),
|
|
62
65
|
};
|
|
63
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* The JSON-RPC codes that say the caller sent a request its receiver could
|
|
69
|
+
* not serve. The OpenTelemetry MCP conventions do not count them as an error
|
|
70
|
+
* on a server's span, and count every JSON-RPC code as one on a client's.
|
|
71
|
+
*/
|
|
72
|
+
const callersCodes = new Set([-32700, -32600, -32601, -32602, -32002]);
|
|
73
|
+
/** Whether a server's span counts a JSON-RPC error code as its own error: every code but the caller's. */
|
|
74
|
+
export function serverFailedWith(code) {
|
|
75
|
+
return !callersCodes.has(code);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* The JSON-RPC code a request handler's error is answered with: its own
|
|
79
|
+
* `code` when that is an integer, as the MCP SDK answers it, else -32603.
|
|
80
|
+
*/
|
|
81
|
+
export function answeredCode(error) {
|
|
82
|
+
const code = error?.code;
|
|
83
|
+
return typeof code === "number" && Number.isSafeInteger(code) ? code : -32603;
|
|
84
|
+
}
|
|
64
85
|
/**
|
|
65
86
|
* Marks the span failed: status ERROR and `error.type`, with the JSON-RPC
|
|
66
87
|
* error's message as the status description when a JSON-RPC error failed it.
|
|
@@ -80,9 +101,10 @@ export function capturesContent(env = process.env) {
|
|
|
80
101
|
}
|
|
81
102
|
/**
|
|
82
103
|
* A tool call's arguments and, when it succeeded, its result, as the
|
|
83
|
-
* conventions' opt-in content attributes, each
|
|
84
|
-
*
|
|
85
|
-
* content.
|
|
104
|
+
* conventions' opt-in content attributes, each the value itself, which the
|
|
105
|
+
* conventions ask for and OTLP sends as a map or a list; nothing while
|
|
106
|
+
* content is off. The result is its structured content when it has some,
|
|
107
|
+
* else its content.
|
|
86
108
|
*/
|
|
87
109
|
export function contentAttributes(args, result, env = process.env) {
|
|
88
110
|
if (!capturesContent(env)) {
|
|
@@ -90,8 +112,8 @@ export function contentAttributes(args, result, env = process.env) {
|
|
|
90
112
|
}
|
|
91
113
|
const answered = result === undefined || result.isError === true ? undefined : (result.structuredContent ?? result.content);
|
|
92
114
|
return {
|
|
93
|
-
...(args === undefined ? {} : { "gen_ai.tool.call.arguments":
|
|
94
|
-
...(answered === undefined ? {} : { "gen_ai.tool.call.result":
|
|
115
|
+
...(args === undefined ? {} : { "gen_ai.tool.call.arguments": args }),
|
|
116
|
+
...(answered === undefined ? {} : { "gen_ai.tool.call.result": answered }),
|
|
95
117
|
};
|
|
96
118
|
}
|
|
97
119
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/telemetry/trace.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/telemetry/trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,WAAW,EACX,cAAc,EACd,KAAK,GAKN,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE9C,MAAM,UAAU,GAAG,gCAAgC,CAAC;AAEpD,4GAA4G;AAC5G,MAAM,UAAU,iBAAiB,CAAC,IAAY;IAC5C,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;AACjD,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,kBAAkB,CAChC,IAA6B,EAC7B,QAA6B,EAC7B,UAAiC,EAAE;IAEnC,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IACxE,MAAM,KAAK,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,KAAK,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE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AAU,gBAAgB,CAAC,MAAe,EAAE,GAAW,EAAE,KAAa;IAC1E,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,WAAW,CAAC,aAAa,EAAE,CAAC;IAC9E,OAAO,WAAW,CAAC,UAAU,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC;AAC1E,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAAC,IAAa;IAC3C,OAAO,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE;QACvE,GAAG,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;YACpB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;YAC3B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;QACvD,CAAC;QACD,IAAI,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;KACxC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,CAAC,KAAK,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -8,13 +8,19 @@ export interface Endpoint {
|
|
|
8
8
|
export interface Template {
|
|
9
9
|
name: string;
|
|
10
10
|
category: string;
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The name is in more than one category: a create takes the one in
|
|
13
|
+
* `Official distributions`, else in `Deprecated distributions`, and
|
|
14
|
+
* otherwise needs the category.
|
|
15
|
+
*/
|
|
12
16
|
ambiguous?: true;
|
|
13
17
|
}
|
|
14
18
|
/**
|
|
15
19
|
* What an image is doing, as observed when asked:
|
|
16
20
|
*
|
|
17
21
|
* - `creating`: a create is still preparing it, whatever VM runs it.
|
|
22
|
+
* - `unfinished`: the create that made it ended before it was done; only
|
|
23
|
+
* `delete` takes it.
|
|
18
24
|
* - `stopped`: no VM runs it.
|
|
19
25
|
* - `starting`: a start of this PLexus launched it, and its MCP server has
|
|
20
26
|
* not said where it answers yet.
|
|
@@ -22,7 +28,7 @@ export interface Template {
|
|
|
22
28
|
* - `unreachable`: a VM runs it and it takes no calls through PLexus;
|
|
23
29
|
* `endpointProblem` says why.
|
|
24
30
|
*/
|
|
25
|
-
export type ImageState = "creating" | "stopped" | "starting" | "running" | "unreachable";
|
|
31
|
+
export type ImageState = "creating" | "unfinished" | "stopped" | "starting" | "running" | "unreachable";
|
|
26
32
|
/**
|
|
27
33
|
* Why an image records no calls through OpenTelemetry:
|
|
28
34
|
*
|
|
@@ -43,6 +49,18 @@ export type ImageTelemetry = {
|
|
|
43
49
|
reason?: TelemetryOffReason;
|
|
44
50
|
detail?: string;
|
|
45
51
|
};
|
|
52
|
+
/**
|
|
53
|
+
* How MCP got into an image: the pinned release, or a script, which every
|
|
54
|
+
* start files in again when `everyStart` says so.
|
|
55
|
+
*/
|
|
56
|
+
export type ImageMcp = {
|
|
57
|
+
source: "pin";
|
|
58
|
+
version: string;
|
|
59
|
+
} | {
|
|
60
|
+
source: "script";
|
|
61
|
+
script: string;
|
|
62
|
+
everyStart?: true;
|
|
63
|
+
};
|
|
46
64
|
/** One image, as observed when asked. */
|
|
47
65
|
export interface ImageInfo {
|
|
48
66
|
/** The name the caller uses, without the scope. */
|
|
@@ -61,18 +79,7 @@ export interface ImageInfo {
|
|
|
61
79
|
template?: string;
|
|
62
80
|
/** As Pharo says it: `14.0`. */
|
|
63
81
|
pharoVersion?: string;
|
|
64
|
-
|
|
65
|
-
* How MCP got into it: the pinned release, or a script, which every start
|
|
66
|
-
* files in again when `everyStart` says so.
|
|
67
|
-
*/
|
|
68
|
-
mcp?: {
|
|
69
|
-
source: "pin";
|
|
70
|
-
version: string;
|
|
71
|
-
} | {
|
|
72
|
-
source: "script";
|
|
73
|
-
script: string;
|
|
74
|
-
everyStart?: true;
|
|
75
|
-
};
|
|
82
|
+
mcp?: ImageMcp;
|
|
76
83
|
/**
|
|
77
84
|
* Whether it records its calls through OpenTelemetry: for a running image,
|
|
78
85
|
* what its start did; otherwise what its create gave it, whether a start
|
|
@@ -87,8 +94,40 @@ export interface ImageInfo {
|
|
|
87
94
|
/** The size of its image file, in bytes. */
|
|
88
95
|
imageBytes?: number;
|
|
89
96
|
}
|
|
97
|
+
/** The image a create made, as `list` would show it, and how long the create took. */
|
|
98
|
+
export type CreateResult = ImageInfo & {
|
|
99
|
+
seconds: number;
|
|
100
|
+
};
|
|
101
|
+
export interface StartResult {
|
|
102
|
+
name: string;
|
|
103
|
+
pids: number[];
|
|
104
|
+
endpoint: Endpoint;
|
|
105
|
+
display: Display;
|
|
106
|
+
seconds: number;
|
|
107
|
+
/** Whether its server records its calls through OpenTelemetry, and why not: see `ImageInfo.telemetry`. */
|
|
108
|
+
telemetry?: ImageTelemetry;
|
|
109
|
+
/** The image was already running and answering, and was left as it was. */
|
|
110
|
+
alreadyRunning?: true;
|
|
111
|
+
}
|
|
112
|
+
export interface StopResult {
|
|
113
|
+
name: string;
|
|
114
|
+
/** The VMs killed: those left after the image quit or saved, or every one that ran it when it did neither. */
|
|
115
|
+
killed: number[];
|
|
116
|
+
/** The image quit without saving when asked. */
|
|
117
|
+
quit?: true;
|
|
118
|
+
/** The image saved itself and quit. */
|
|
119
|
+
saved?: true;
|
|
120
|
+
}
|
|
121
|
+
export interface DeleteResult {
|
|
122
|
+
name: string;
|
|
123
|
+
}
|
|
90
124
|
export interface CreateOptions {
|
|
91
|
-
|
|
125
|
+
/**
|
|
126
|
+
* The template's name, found in the template list as `chooseTemplate` says:
|
|
127
|
+
* a mainline Pharo or Moose version such as `14` names its template, and
|
|
128
|
+
* none is the current stable Pharo.
|
|
129
|
+
*/
|
|
130
|
+
template?: string;
|
|
92
131
|
/** Resolved from the template list when absent. */
|
|
93
132
|
category?: string;
|
|
94
133
|
/** Filed in instead of loading the pinned MCP; relative to the working directory. */
|
|
@@ -112,6 +151,11 @@ export interface StopOptions {
|
|
|
112
151
|
export interface ImagesOptions {
|
|
113
152
|
/** `~/.plexus` unless given; `plexusHome()` is where the `plexus` command keeps them. */
|
|
114
153
|
home?: string;
|
|
154
|
+
/**
|
|
155
|
+
* Where Pharo Launcher is installed, when not in its usual place for the
|
|
156
|
+
* platform. The `plexus` command takes it from `PHARO_LAUNCHER_DIR`.
|
|
157
|
+
*/
|
|
158
|
+
launcherDir?: string;
|
|
115
159
|
/**
|
|
116
160
|
* A name prefix, without dashes: image `dev` is the directory `<scope>-dev`.
|
|
117
161
|
* Without one, an image is named by its directory, so `shop-dev` is image
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AAEjD,oEAAoE;AACpE,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,aAAa,CAAC;AAEjD,oEAAoE;AACpE,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,uDAAuD;IACvD,GAAG,CAAC,EAAE,MAAM,CAAC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,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,yFAAyF;IACzF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,uDAAuD;AACvD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IACnH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,wDAAwD;AACxD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC,CAAC;IACzD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBAAiB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@evref-bl/plexus",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "PLexus: Pharo images as directories and processes, and forwarding to the MCP servers they run.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
16
|
"types": "./dist/index.d.ts",
|
|
17
|
-
"
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
18
|
},
|
|
19
19
|
"./package.json": "./package.json"
|
|
20
20
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"clean": "node -e \"require('node:fs').rmSync('dist', { recursive: true, force: true })\""
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@evref-bl/pharo-launcher-mcp": "0.
|
|
44
|
+
"@evref-bl/pharo-launcher-mcp": "1.0.0",
|
|
45
45
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
46
46
|
"@opentelemetry/api": "1.10.0"
|
|
47
47
|
},
|