@evref-bl/plexus 0.19.0 → 0.21.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/dist/answers/index.d.ts +35 -13
- package/dist/answers/index.d.ts.map +1 -1
- package/dist/answers/index.js +96 -48
- package/dist/answers/index.js.map +1 -1
- package/dist/answers/texts.d.ts +36 -9
- package/dist/answers/texts.d.ts.map +1 -1
- package/dist/answers/texts.js +54 -14
- package/dist/answers/texts.js.map +1 -1
- package/dist/cli.js +2 -1
- package/dist/cli.js.map +1 -1
- package/dist/commandLine.d.ts +5 -1
- package/dist/commandLine.d.ts.map +1 -1
- package/dist/commandLine.js +7 -5
- package/dist/commandLine.js.map +1 -1
- package/dist/config/pharoMcpVersion.d.ts +3 -4
- package/dist/config/pharoMcpVersion.d.ts.map +1 -1
- package/dist/config/pharoMcpVersion.js +3 -4
- package/dist/config/pharoMcpVersion.js.map +1 -1
- package/dist/forward/index.d.ts +7 -2
- package/dist/forward/index.d.ts.map +1 -1
- package/dist/forward/index.js +3 -12
- package/dist/forward/index.js.map +1 -1
- package/dist/forward/jsonRpc.d.ts +3 -1
- package/dist/forward/jsonRpc.d.ts.map +1 -1
- package/dist/forward/jsonRpc.js +8 -2
- package/dist/forward/jsonRpc.js.map +1 -1
- package/dist/home.d.ts +6 -1
- package/dist/home.d.ts.map +1 -1
- package/dist/home.js +7 -2
- package/dist/home.js.map +1 -1
- package/dist/images/bases.d.ts +37 -9
- package/dist/images/bases.d.ts.map +1 -1
- package/dist/images/bases.js +194 -62
- package/dist/images/bases.js.map +1 -1
- package/dist/images/context.d.ts +2 -0
- package/dist/images/context.d.ts.map +1 -1
- package/dist/images/context.js +1 -0
- package/dist/images/context.js.map +1 -1
- package/dist/images/create.d.ts +2 -1
- package/dist/images/create.d.ts.map +1 -1
- package/dist/images/create.js +11 -9
- package/dist/images/create.js.map +1 -1
- package/dist/images/endpoint.d.ts +7 -5
- package/dist/images/endpoint.d.ts.map +1 -1
- package/dist/images/endpoint.js +5 -2
- package/dist/images/endpoint.js.map +1 -1
- package/dist/images/index.d.ts +14 -4
- package/dist/images/index.d.ts.map +1 -1
- package/dist/images/index.js +28 -8
- package/dist/images/index.js.map +1 -1
- package/dist/images/list.d.ts +24 -1
- package/dist/images/list.d.ts.map +1 -1
- package/dist/images/list.js +91 -15
- package/dist/images/list.js.map +1 -1
- package/dist/images/prepare.d.ts +9 -2
- package/dist/images/prepare.d.ts.map +1 -1
- package/dist/images/prepare.js +46 -7
- package/dist/images/prepare.js.map +1 -1
- package/dist/images/scripts.d.ts +18 -6
- package/dist/images/scripts.d.ts.map +1 -1
- package/dist/images/scripts.js +63 -15
- package/dist/images/scripts.js.map +1 -1
- package/dist/images/start.d.ts +10 -3
- package/dist/images/start.d.ts.map +1 -1
- package/dist/images/start.js +29 -15
- package/dist/images/start.js.map +1 -1
- package/dist/images/stop.d.ts +9 -5
- package/dist/images/stop.d.ts.map +1 -1
- package/dist/images/stop.js +69 -8
- package/dist/images/stop.js.map +1 -1
- package/dist/images/store.d.ts +7 -1
- package/dist/images/store.d.ts.map +1 -1
- package/dist/images/store.js +34 -0
- package/dist/images/store.js.map +1 -1
- package/dist/images/templates.js +4 -3
- package/dist/images/templates.js.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.d.ts +4 -4
- package/dist/launcher/pharoLauncherMcpClient.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherMcpClient.js +23 -34
- package/dist/launcher/pharoLauncherMcpClient.js.map +1 -1
- package/dist/launcher/vmRenewal.d.ts +6 -5
- package/dist/launcher/vmRenewal.d.ts.map +1 -1
- package/dist/launcher/vmRenewal.js +9 -19
- package/dist/launcher/vmRenewal.js.map +1 -1
- package/dist/mcp/server.d.ts +28 -2
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +222 -54
- package/dist/mcp/server.js.map +1 -1
- package/dist/telemetry/reachability.d.ts +21 -3
- package/dist/telemetry/reachability.d.ts.map +1 -1
- package/dist/telemetry/reachability.js +50 -9
- package/dist/telemetry/reachability.js.map +1 -1
- package/dist/telemetry/sdk.d.ts +17 -6
- package/dist/telemetry/sdk.d.ts.map +1 -1
- package/dist/telemetry/sdk.js +18 -9
- package/dist/telemetry/sdk.js.map +1 -1
- package/dist/telemetry/settings.d.ts +19 -7
- package/dist/telemetry/settings.d.ts.map +1 -1
- package/dist/telemetry/settings.js +49 -22
- package/dist/telemetry/settings.js.map +1 -1
- package/dist/telemetry/trace.d.ts +22 -14
- package/dist/telemetry/trace.d.ts.map +1 -1
- package/dist/telemetry/trace.js +44 -8
- package/dist/telemetry/trace.js.map +1 -1
- package/dist/types.d.ts +28 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { type EndpointHandoff } from "../forward/endpointHandoffFormat.js";
|
|
2
2
|
import type { LauncherProcess } from "../launcher/pharoLauncherMcpClient.js";
|
|
3
|
-
import type { Endpoint, ImageInfo } from "../types.js";
|
|
4
|
-
import type
|
|
3
|
+
import type { Endpoint, ImageInfo, ImageTelemetry } from "../types.js";
|
|
4
|
+
import { type ImageFiles } from "./store.js";
|
|
5
5
|
/**
|
|
6
|
-
* Where a running image answers
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* Where a running image answers, and whether its server records its calls
|
|
7
|
+
* when its start said; or that a start of this PLexus launched it and its
|
|
8
|
+
* server has not written where yet, so it is starting and will; or why it
|
|
9
|
+
* takes no calls.
|
|
9
10
|
*/
|
|
10
11
|
export type EndpointObservation = {
|
|
11
12
|
endpoint: Endpoint;
|
|
13
|
+
telemetry?: ImageTelemetry;
|
|
12
14
|
} | {
|
|
13
15
|
starting: true;
|
|
14
16
|
} | {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/images/endpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/images/endpoint.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,eAAe,EACrB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AACvE,OAAO,EAAgC,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,SAAS,CAAC,EAAE,cAAc,CAAA;CAAE,GAClD;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,GAClB;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAExB;;;;GAIG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,UAAU,EACjB,GAAG,EAAE,SAAS,eAAe,EAAE,GAC9B,mBAAmB,CAmCrB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,SAAS,GAAG,QAAQ,CAwBnD;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,CAK5D"}
|
package/dist/images/endpoint.js
CHANGED
|
@@ -2,6 +2,7 @@ import fs from "node:fs";
|
|
|
2
2
|
import * as texts from "../answers/texts.js";
|
|
3
3
|
import { PlexusError } from "../errors.js";
|
|
4
4
|
import { parseEndpointHandoff, } from "../forward/endpointHandoffFormat.js";
|
|
5
|
+
import { parseProperties, telemetryOf } from "./store.js";
|
|
5
6
|
/**
|
|
6
7
|
* The endpoint a running image wrote, when it belongs to one of the VMs
|
|
7
8
|
* running it now. A port outlives the VM that bound it, so a file alone says
|
|
@@ -30,15 +31,17 @@ export function observeEndpoint(files, vms) {
|
|
|
30
31
|
};
|
|
31
32
|
}
|
|
32
33
|
const url = endpointUrl(handoff);
|
|
34
|
+
const telemetry = telemetryOf(parseProperties(text));
|
|
35
|
+
const said = telemetry === undefined ? {} : { telemetry };
|
|
33
36
|
if (handoff.pid !== undefined) {
|
|
34
37
|
return vms.some((vm) => vm.pid === handoff.pid)
|
|
35
|
-
? { endpoint: { url, pid: handoff.pid } }
|
|
38
|
+
? { endpoint: { url, pid: handoff.pid }, ...said }
|
|
36
39
|
: { problem: `the endpoint names pid ${handoff.pid}, which does not run this image` };
|
|
37
40
|
}
|
|
38
41
|
// An image that cannot tell its pid writes none. A VM this PLexus launched
|
|
39
42
|
// names the start script on its command line, and that VM is the writer.
|
|
40
43
|
return vms.some((vm) => namesStartScript(vm, files))
|
|
41
|
-
? { endpoint: { url } }
|
|
44
|
+
? { endpoint: { url }, ...said }
|
|
42
45
|
: { problem: "not started by this PLexus" };
|
|
43
46
|
}
|
|
44
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/images/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,oBAAoB,GAErB,MAAM,qCAAqC,CAAC;
|
|
1
|
+
{"version":3,"file":"endpoint.js","sourceRoot":"","sources":["../../src/images/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,KAAK,KAAK,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EACL,oBAAoB,GAErB,MAAM,qCAAqC,C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AW,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC9E,CAAC"}
|
package/dist/images/index.d.ts
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { CreateOptions, Endpoint, ImageInfo, ImagesOptions, StartOptions, StopOptions, Template } from "../types.js";
|
|
2
2
|
import { type CreateResult } from "./create.js";
|
|
3
|
+
import { type Answering } from "./list.js";
|
|
3
4
|
import { type StartResult } from "./start.js";
|
|
4
5
|
import { type StopResult } from "./stop.js";
|
|
5
6
|
/**
|
|
6
7
|
* Pharo images as directories and processes.
|
|
7
8
|
*
|
|
8
9
|
* An image exists when its directory holds its image file; it runs when a VM
|
|
9
|
-
* runs that file. Every call looks at the store and the host when it is made
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* runs that file. Every call looks at the store and the host when it is made,
|
|
11
|
+
* so, like `ps`, its answer is as old as the call that gave it. Only
|
|
12
|
+
* `answering` keeps something between calls: the VM each look saw answering
|
|
13
|
+
* for an image, which it trusts while that process runs.
|
|
12
14
|
*
|
|
13
15
|
* Making, starting, stopping and deleting are each an INTERNAL span,
|
|
14
16
|
* `plexus.image.create`, `.start`, `.stop` and `.delete`, that says how it
|
|
@@ -18,10 +20,18 @@ export declare class Images {
|
|
|
18
20
|
private readonly context;
|
|
19
21
|
constructor(options?: ImagesOptions);
|
|
20
22
|
templates(): Promise<Template[]>;
|
|
23
|
+
/** The VM each look saw answering for an image, by image name. */
|
|
24
|
+
private readonly seen;
|
|
21
25
|
list(name?: string): Promise<ImageInfo[]>;
|
|
26
|
+
/**
|
|
27
|
+
* Where a forwarded call goes, when an earlier look saw the VM that
|
|
28
|
+
* answers for it and that VM still runs: the image named, or, naming
|
|
29
|
+
* none, the only image that answers. Undefined when only `list` can say.
|
|
30
|
+
*/
|
|
31
|
+
answering(name?: string): Answering | undefined;
|
|
22
32
|
create(name: string, options: CreateOptions): Promise<CreateResult>;
|
|
23
33
|
start(name: string, options?: StartOptions): Promise<StartResult>;
|
|
24
|
-
/**
|
|
34
|
+
/** Have the image quit without saving and kill what is left, or, with `save`, have it save itself and quit. */
|
|
25
35
|
stop(name: string, options?: StopOptions): Promise<StopResult>;
|
|
26
36
|
delete(name: string): Promise<{
|
|
27
37
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,SAAS,EACT,aAAa,EACb,YAAY,EACZ,WAAW,EACX,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,OAAO,EAAU,KAAK,YAAY,EAAE,MAAM,aAAa,CAAC;AAGxD,OAAO,EAAgC,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AACzE,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAGlD;;;;;;;;;;;;GAYG;AACH,qBAAa,MAAM;IACjB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;gBAE5B,OAAO,GAAE,aAAkB;IAIvC,SAAS,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;IAIhC,kEAAkE;IAClE,OAAO,CAAC,QAAQ,CAAC,IAAI,CAA6B;IAE5C,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IAY/C;;;;OAIG;IACH,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS;IAI/C,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IAQnE,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,WAAW,CAAC;IAIjE,+GAA+G;IAC/G,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC;IAM9D,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAI/C,uFAAuF;IACjF,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;CAGhD"}
|
package/dist/images/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { imagesContext } from "./context.js";
|
|
|
4
4
|
import { create } from "./create.js";
|
|
5
5
|
import { deleteImage } from "./delete.js";
|
|
6
6
|
import { endpointOf } from "./endpoint.js";
|
|
7
|
-
import { list } from "./list.js";
|
|
7
|
+
import { answeringFromEndpoints, list } from "./list.js";
|
|
8
8
|
import { start } from "./start.js";
|
|
9
9
|
import { stop } from "./stop.js";
|
|
10
10
|
import { templates } from "./templates.js";
|
|
@@ -12,9 +12,10 @@ import { templates } from "./templates.js";
|
|
|
12
12
|
* Pharo images as directories and processes.
|
|
13
13
|
*
|
|
14
14
|
* An image exists when its directory holds its image file; it runs when a VM
|
|
15
|
-
* runs that file. Every call looks at the store and the host when it is made
|
|
16
|
-
*
|
|
17
|
-
*
|
|
15
|
+
* runs that file. Every call looks at the store and the host when it is made,
|
|
16
|
+
* so, like `ps`, its answer is as old as the call that gave it. Only
|
|
17
|
+
* `answering` keeps something between calls: the VM each look saw answering
|
|
18
|
+
* for an image, which it trusts while that process runs.
|
|
18
19
|
*
|
|
19
20
|
* Making, starting, stopping and deleting are each an INTERNAL span,
|
|
20
21
|
* `plexus.image.create`, `.start`, `.stop` and `.delete`, that says how it
|
|
@@ -28,8 +29,27 @@ export class Images {
|
|
|
28
29
|
templates() {
|
|
29
30
|
return templates(this.context);
|
|
30
31
|
}
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
/** The VM each look saw answering for an image, by image name. */
|
|
33
|
+
seen = new Map();
|
|
34
|
+
async list(name) {
|
|
35
|
+
const rows = await list(this.context, name);
|
|
36
|
+
for (const row of rows) {
|
|
37
|
+
if (row.state === "running" && row.endpoint?.pid !== undefined) {
|
|
38
|
+
this.seen.set(row.name, row.endpoint.pid);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
this.seen.delete(row.name);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return rows;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Where a forwarded call goes, when an earlier look saw the VM that
|
|
48
|
+
* answers for it and that VM still runs: the image named, or, naming
|
|
49
|
+
* none, the only image that answers. Undefined when only `list` can say.
|
|
50
|
+
*/
|
|
51
|
+
answering(name) {
|
|
52
|
+
return answeringFromEndpoints(this.context, this.seen, name);
|
|
33
53
|
}
|
|
34
54
|
create(name, options) {
|
|
35
55
|
return inSpan("plexus.image.create", SpanKind.INTERNAL, {}, async (span) => {
|
|
@@ -41,7 +61,7 @@ export class Images {
|
|
|
41
61
|
start(name, options) {
|
|
42
62
|
return inSpan("plexus.image.start", SpanKind.INTERNAL, {}, () => start(this.context, name, options));
|
|
43
63
|
}
|
|
44
|
-
/**
|
|
64
|
+
/** Have the image quit without saving and kill what is left, or, with `save`, have it save itself and quit. */
|
|
45
65
|
stop(name, options) {
|
|
46
66
|
return inSpan("plexus.image.stop", SpanKind.INTERNAL, { "plexus.image.save": options?.save === true }, () => stop(this.context, name, options));
|
|
47
67
|
}
|
|
@@ -50,7 +70,7 @@ export class Images {
|
|
|
50
70
|
}
|
|
51
71
|
/** Where a call to the image goes, or a refusal saying why none can and what to do. */
|
|
52
72
|
async endpoint(name) {
|
|
53
|
-
return endpointOf((await list(
|
|
73
|
+
return endpointOf((await this.list(name))[0]);
|
|
54
74
|
}
|
|
55
75
|
}
|
|
56
76
|
//# sourceMappingURL=index.js.map
|
package/dist/images/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/images/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAU/C,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,MAAM,EAAqB,MAAM,aAAa,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AACzE,OAAO,EAAE,KAAK,EAAoB,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,IAAI,EAAmB,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C;;;;;;;;;;;;GAYG;AACH,MAAM,OAAO,MAAM;IACA,OAAO,CAAgB;IAExC,YAA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C,CAAC;YACtD,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAY,EAAE,OAAsB;QACxC,OAAO,MAAM,CAAC,oBAAoB,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC;IACvG,CAAC;IAED,+GAA+G;IAC/G,IAAI,CAAC,IAAY,EAAE,OAAqB;QACtC,OAAO,MAAM,CAAC,mBAAmB,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,mBAAmB,EAAE,OAAO,EAAE,IAAI,KAAK,IAAI,EAAE,EAAE,GAAG,EAAE,CAC1G,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,CAClC,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,IAAY;QACjB,OAAO,MAAM,CAAC,qBAAqB,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC;IACrG,CAAC;IAED,uFAAuF;IACvF,KAAK,CAAC,QAAQ,CAAC,IAAY;QACzB,OAAO,UAAU,CAAC,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAChD,CAAC;CACF"}
|
package/dist/images/list.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { LauncherProcess } from "../launcher/pharoLauncherMcpClient.js";
|
|
2
|
-
import type { ImageInfo } from "../types.js";
|
|
2
|
+
import type { Endpoint, ImageInfo, ImageTelemetry } from "../types.js";
|
|
3
3
|
import type { ImagesContext } from "./context.js";
|
|
4
|
+
import { type EndpointObservation } from "./endpoint.js";
|
|
4
5
|
import { type ImageFiles } from "./store.js";
|
|
5
6
|
/**
|
|
6
7
|
* The images in scope, or the one named, with what runs them now: one look
|
|
@@ -8,5 +9,27 @@ import { type ImageFiles } from "./store.js";
|
|
|
8
9
|
* nothing.
|
|
9
10
|
*/
|
|
10
11
|
export declare function list(context: ImagesContext, name?: string): Promise<ImageInfo[]>;
|
|
12
|
+
/** Where a forwarded call goes: the image and its endpoint. */
|
|
13
|
+
export interface Answering {
|
|
14
|
+
name: string;
|
|
15
|
+
endpoint: Endpoint;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The image a forwarded call goes to when the endpoint files alone can say:
|
|
19
|
+
* the image named, or, naming none, the only image whose endpoint names a
|
|
20
|
+
* live process, when that process is the VM an earlier look saw running the
|
|
21
|
+
* image (`seen`, by image name). Undefined whenever only the look `list`
|
|
22
|
+
* takes can say, refusals included. Listing the host's processes reads every
|
|
23
|
+
* process's command line, tens of milliseconds where there are many, which
|
|
24
|
+
* each call would pay; a VM keeps its pid and its endpoint while it runs.
|
|
25
|
+
*/
|
|
26
|
+
export declare function answeringFromEndpoints(context: ImagesContext, seen: ReadonlyMap<string, number>, name?: string): Answering | undefined;
|
|
11
27
|
export declare function describe(files: ImageFiles, processes: readonly LauncherProcess[]): ImageInfo;
|
|
28
|
+
/**
|
|
29
|
+
* Whether the image records its calls: running, what its start said, else
|
|
30
|
+
* what its create said. A server with no backend to record with, in an image
|
|
31
|
+
* whose create said why it has none, is said by that reason, which says what
|
|
32
|
+
* to do.
|
|
33
|
+
*/
|
|
34
|
+
export declare function imageTelemetry(observed: EndpointObservation | undefined, created: ImageTelemetry | undefined): ImageTelemetry | undefined;
|
|
12
35
|
//# sourceMappingURL=list.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/images/list.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["../../src/images/list.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAAgC,KAAK,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAGvF,OAAO,EAQL,KAAK,UAAU,EAChB,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,wBAAsB,IAAI,CAAC,OAAO,EAAE,aAAa,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC,CAQtF;AAED,+DAA+D;AAC/D,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,aAAa,EACtB,IAAI,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACjC,IAAI,CAAC,EAAE,MAAM,GACZ,SAAS,GAAG,SAAS,CAsCvB;AA4BD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,eAAe,EAAE,GAAG,SAAS,CAyB5F;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,mBAAmB,GAAG,SAAS,EACzC,OAAO,EAAE,cAAc,GAAG,SAAS,GAClC,cAAc,GAAG,SAAS,CAQ5B"}
|
package/dist/images/list.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { readImageDirectory, readLauncherImage, } from "@evref-bl/pharo-launcher-mcp/launcher";
|
|
3
4
|
import { storeRoot } from "../home.js";
|
|
4
|
-
import {
|
|
5
|
+
import { parseEndpointHandoff } from "../forward/endpointHandoffFormat.js";
|
|
6
|
+
import { endpointUrl, observeEndpoint } from "./endpoint.js";
|
|
5
7
|
import { nameOfDisk } from "./names.js";
|
|
6
8
|
import { displayOf, hostProcesses, vmsOn } from "./processes.js";
|
|
7
|
-
import { existingImage, filesOfDirectory, isImage, mcpSourceOf, readFirstLine, readProperties, } from "./store.js";
|
|
9
|
+
import { existingImage, filesOfDirectory, isImage, mcpSourceOf, readFirstLine, readProperties, telemetryOf, } from "./store.js";
|
|
8
10
|
/**
|
|
9
11
|
* The images in scope, or the one named, with what runs them now: one look
|
|
10
12
|
* at the store and one at the host's processes. It pings nothing and writes
|
|
@@ -18,6 +20,66 @@ export async function list(context, name) {
|
|
|
18
20
|
const processes = await hostProcesses(context);
|
|
19
21
|
return images.map((files) => describe(files, processes));
|
|
20
22
|
}
|
|
23
|
+
/**
|
|
24
|
+
* The image a forwarded call goes to when the endpoint files alone can say:
|
|
25
|
+
* the image named, or, naming none, the only image whose endpoint names a
|
|
26
|
+
* live process, when that process is the VM an earlier look saw running the
|
|
27
|
+
* image (`seen`, by image name). Undefined whenever only the look `list`
|
|
28
|
+
* takes can say, refusals included. Listing the host's processes reads every
|
|
29
|
+
* process's command line, tens of milliseconds where there are many, which
|
|
30
|
+
* each call would pay; a VM keeps its pid and its endpoint while it runs.
|
|
31
|
+
*/
|
|
32
|
+
export function answeringFromEndpoints(context, seen, name) {
|
|
33
|
+
let images;
|
|
34
|
+
try {
|
|
35
|
+
images = name === undefined ? imagesInScope(context) : [existingImage(context, name)];
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const live = [];
|
|
41
|
+
for (const files of images) {
|
|
42
|
+
if (fs.existsSync(files.building)) {
|
|
43
|
+
if (name !== undefined) {
|
|
44
|
+
return undefined;
|
|
45
|
+
}
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
let text;
|
|
49
|
+
try {
|
|
50
|
+
text = fs.readFileSync(files.endpoint, "utf8");
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
let handoff;
|
|
56
|
+
try {
|
|
57
|
+
handoff = parseEndpointHandoff(text);
|
|
58
|
+
}
|
|
59
|
+
catch {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
if (handoff.pid === undefined) {
|
|
63
|
+
return undefined;
|
|
64
|
+
}
|
|
65
|
+
if (isAlive(handoff.pid)) {
|
|
66
|
+
live.push({ files, url: endpointUrl(handoff), pid: handoff.pid });
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (live.length !== 1 || seen.get(live[0].files.name) !== live[0].pid) {
|
|
70
|
+
return undefined;
|
|
71
|
+
}
|
|
72
|
+
return { name: live[0].files.name, endpoint: { url: live[0].url, pid: live[0].pid } };
|
|
73
|
+
}
|
|
74
|
+
function isAlive(pid) {
|
|
75
|
+
try {
|
|
76
|
+
process.kill(pid, 0);
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
catch (error) {
|
|
80
|
+
return error.code === "EPERM";
|
|
81
|
+
}
|
|
82
|
+
}
|
|
21
83
|
function imagesInScope(context) {
|
|
22
84
|
const store = storeRoot(context.home);
|
|
23
85
|
let entries;
|
|
@@ -38,11 +100,13 @@ function imagesInScope(context) {
|
|
|
38
100
|
export function describe(files, processes) {
|
|
39
101
|
const vms = vmsOn(files.imagePath, processes);
|
|
40
102
|
const created = readProperties(files.created);
|
|
41
|
-
const
|
|
42
|
-
const
|
|
103
|
+
const recorded = launcherRecord(files);
|
|
104
|
+
const template = recorded?.template?.name ?? created?.template;
|
|
105
|
+
const pharoVersion = recorded?.pharoVersion;
|
|
43
106
|
const mcp = mcpSourceOf(created?.mcp);
|
|
44
107
|
const everyStart = readFirstLine(files.onStart) !== undefined;
|
|
45
108
|
const observed = vms.length > 0 ? observeEndpoint(files, vms) : undefined;
|
|
109
|
+
const telemetry = imageTelemetry(observed, telemetryOf(created));
|
|
46
110
|
return {
|
|
47
111
|
name: files.name,
|
|
48
112
|
path: files.imagePath,
|
|
@@ -55,8 +119,24 @@ export function describe(files, processes) {
|
|
|
55
119
|
...(template === undefined ? {} : { template }),
|
|
56
120
|
...(pharoVersion === undefined ? {} : { pharoVersion: pharoVersionOf(pharoVersion) }),
|
|
57
121
|
...(mcp === undefined ? {} : { mcp: mcp.source === "script" && everyStart ? { ...mcp, everyStart: true } : mcp }),
|
|
122
|
+
...(telemetry === undefined ? {} : { telemetry }),
|
|
58
123
|
};
|
|
59
124
|
}
|
|
125
|
+
/**
|
|
126
|
+
* Whether the image records its calls: running, what its start said, else
|
|
127
|
+
* what its create said. A server with no backend to record with, in an image
|
|
128
|
+
* whose create said why it has none, is said by that reason, which says what
|
|
129
|
+
* to do.
|
|
130
|
+
*/
|
|
131
|
+
export function imageTelemetry(observed, created) {
|
|
132
|
+
const started = observed !== undefined && "endpoint" in observed ? observed.telemetry : undefined;
|
|
133
|
+
if (started === undefined) {
|
|
134
|
+
return created;
|
|
135
|
+
}
|
|
136
|
+
return !started.on && started.reason === "no-backend" && created?.on === false && created.reason !== undefined
|
|
137
|
+
? created
|
|
138
|
+
: started;
|
|
139
|
+
}
|
|
60
140
|
/**
|
|
61
141
|
* A create still making the image wins whatever VM runs it: a script
|
|
62
142
|
* create's own VM runs the image it prepares.
|
|
@@ -74,16 +154,12 @@ function stateOf(building, observed) {
|
|
|
74
154
|
function pharoVersionOf(raw) {
|
|
75
155
|
return /^\d{2,3}$/.test(raw) ? `${raw.slice(0, -1)}.${raw.slice(-1)}` : raw;
|
|
76
156
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
return undefined;
|
|
85
|
-
}
|
|
86
|
-
const name = /#originTemplate\s*:\s*\w+\s*\{[\s\S]*?#name\s*:\s*'((?:''|[^'])*)'/.exec(metadata)?.[1];
|
|
87
|
-
return name?.replaceAll("''", "'");
|
|
157
|
+
/**
|
|
158
|
+
* What the launcher records about an image, read as the launcher reads it:
|
|
159
|
+
* the template it came from and its Pharo version.
|
|
160
|
+
*/
|
|
161
|
+
function launcherRecord(files) {
|
|
162
|
+
const directory = readImageDirectory(path.dirname(files.dir), files.diskName);
|
|
163
|
+
return directory.kind === "image" ? readLauncherImage(directory.image) : undefined;
|
|
88
164
|
}
|
|
89
165
|
//# sourceMappingURL=list.js.map
|
package/dist/images/list.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/images/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,eAAe,EAA4B,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"list.js","sourceRoot":"","sources":["../../src/images/list.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,GAElB,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAIvC,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qCAAqC,CAAC;AACjG,OAAO,EAAE,WAAW,EAAE,eAAe,EAA4B,MAAM,eAAe,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,aAAa,EACb,cAAc,EACd,WAAW,GAEZ,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAsB,EAAE,IAA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SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,IAAI,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,CAAC;AAClG,CAAC;AAED,iGAAiG;AACjG,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9E,CAAC;AAED;;;GAGG;AACH,SAAS,cAAc,CAAC,KAAiB;IACvC,MAAM,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9E,OAAO,SAAS,CAAC,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrF,CAAC"}
|
package/dist/images/prepare.d.ts
CHANGED
|
@@ -12,7 +12,14 @@ export declare function createFromTemplate(context: ImagesContext, files: ImageF
|
|
|
12
12
|
/**
|
|
13
13
|
* Run the preparation in the image, which loads MCP, saves and quits. What
|
|
14
14
|
* failed, when it did: the image's own report first, since it names the
|
|
15
|
-
* Smalltalk error, then the launcher's.
|
|
15
|
+
* Smalltalk error, then the launcher's. Otherwise whether MCP has its
|
|
16
|
+
* OpenTelemetry backend, as the image said, once the clones it forgot are
|
|
17
|
+
* deleted.
|
|
16
18
|
*/
|
|
17
|
-
export declare function prepare(context: ImagesContext, files: ImageFiles, source: PrepareSource): Promise<
|
|
19
|
+
export declare function prepare(context: ImagesContext, files: ImageFiles, source: PrepareSource): Promise<{
|
|
20
|
+
failure: string;
|
|
21
|
+
} | {
|
|
22
|
+
failure?: undefined;
|
|
23
|
+
telemetry?: boolean;
|
|
24
|
+
}>;
|
|
18
25
|
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/images/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/images/prepare.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EAAiB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7D;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,UAAU,EACjB,QAAQ,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAC3C,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAO7B;AAED;;;;;;GAMG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,aAAa,EACtB,KAAK,EAAE,UAAU,EACjB,MAAM,EAAE,aAAa,GACpB,OAAO,CAAC;IAAE,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,OAAO,CAAC,EAAE,SAAS,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC,CAmC7E"}
|
package/dist/images/prepare.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
+
import path from "node:path";
|
|
2
3
|
import { launcherFailureMessage, launchLogPaths, launchOutputTail, } from "../launcher/pharoLauncherMcpClient.js";
|
|
3
4
|
import { prepareScript } from "./scripts.js";
|
|
4
5
|
import { readProperties } from "./store.js";
|
|
@@ -11,14 +12,15 @@ export async function createFromTemplate(context, files, template) {
|
|
|
11
12
|
templateName: template.name,
|
|
12
13
|
templateCategory: template.category,
|
|
13
14
|
newImageName: files.diskName,
|
|
14
|
-
noLaunch: true,
|
|
15
15
|
});
|
|
16
16
|
return result.ok ? undefined : launcherFailureMessage("createImage", result);
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
19
19
|
* Run the preparation in the image, which loads MCP, saves and quits. What
|
|
20
20
|
* failed, when it did: the image's own report first, since it names the
|
|
21
|
-
* Smalltalk error, then the launcher's.
|
|
21
|
+
* Smalltalk error, then the launcher's. Otherwise whether MCP has its
|
|
22
|
+
* OpenTelemetry backend, as the image said, once the clones it forgot are
|
|
23
|
+
* deleted.
|
|
22
24
|
*/
|
|
23
25
|
export async function prepare(context, files, source) {
|
|
24
26
|
fs.mkdirSync(files.plexusDir, { recursive: true });
|
|
@@ -29,15 +31,13 @@ export async function prepare(context, files, source) {
|
|
|
29
31
|
script: files.prepareScript,
|
|
30
32
|
detached: false,
|
|
31
33
|
displayMode: "headless",
|
|
32
|
-
// The VM's output and the launcher's report of which VM it ran: a VM that
|
|
33
|
-
// cannot run an image says there how to renew it.
|
|
34
|
-
includeRaw: true,
|
|
35
34
|
});
|
|
36
35
|
const status = readProperties(files.prepareStatus);
|
|
37
36
|
if (result.ok && status?.status === "ok") {
|
|
37
|
+
deleteForgottenClones(files);
|
|
38
38
|
fs.rmSync(files.prepareScript, { force: true });
|
|
39
39
|
fs.rmSync(files.prepareStatus, { force: true });
|
|
40
|
-
return
|
|
40
|
+
return status.telemetry === "on" || status.telemetry === "off" ? { telemetry: status.telemetry === "on" } : {};
|
|
41
41
|
}
|
|
42
42
|
const reasons = [
|
|
43
43
|
status?.status === "failed"
|
|
@@ -46,7 +46,7 @@ export async function prepare(context, files, source) {
|
|
|
46
46
|
result.ok ? undefined : launcherFailureMessage("startImage", result),
|
|
47
47
|
].filter((reason) => reason !== undefined);
|
|
48
48
|
const logs = launchLogPaths(result);
|
|
49
|
-
|
|
49
|
+
const failure = [
|
|
50
50
|
// A launch that failed says how in its own message. One that ended well
|
|
51
51
|
// without a status leaves only what the VM printed to say why.
|
|
52
52
|
...(reasons.length > 0
|
|
@@ -54,5 +54,44 @@ export async function prepare(context, files, source) {
|
|
|
54
54
|
: ["The preparation ended without saying whether MCP loaded.", ...launchOutputTail(result)]),
|
|
55
55
|
...(logs.length > 0 ? [`Launcher logs: ${logs.join(", ")}`] : []),
|
|
56
56
|
].join("\n");
|
|
57
|
+
return { failure };
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Deletes the clones the preparation forgot, which its status names one per
|
|
61
|
+
* `clone=` line: each within the image's directory, and nothing else. A clone
|
|
62
|
+
* that cannot be deleted is left.
|
|
63
|
+
*/
|
|
64
|
+
function deleteForgottenClones(files) {
|
|
65
|
+
let text;
|
|
66
|
+
try {
|
|
67
|
+
text = fs.readFileSync(files.prepareStatus, "utf8");
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
const dir = realPath(files.dir);
|
|
73
|
+
for (const line of text.split(/\r\n|\n|\r/)) {
|
|
74
|
+
if (!line.startsWith("clone=")) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const clone = realPath(line.slice("clone=".length).trim());
|
|
78
|
+
const inside = path.relative(dir, clone);
|
|
79
|
+
if (inside !== "" && !inside.startsWith("..") && !path.isAbsolute(inside)) {
|
|
80
|
+
try {
|
|
81
|
+
fs.rmSync(clone, { recursive: true, force: true, maxRetries: 3 });
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Left: a later load of that project may then need it deleted by hand.
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function realPath(file) {
|
|
90
|
+
try {
|
|
91
|
+
return fs.realpathSync.native(file);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
return path.resolve(file);
|
|
95
|
+
}
|
|
57
96
|
}
|
|
58
97
|
//# sourceMappingURL=prepare.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/images/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAsB,EACtB,KAAiB,EACjB,QAA4C;IAE5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;QAClD,YAAY,EAAE,QAAQ,CAAC,IAAI;QAC3B,gBAAgB,EAAE,QAAQ,CAAC,QAAQ;QACnC,YAAY,EAAE,KAAK,CAAC,QAAQ;
|
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/images/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,cAAc,EACd,gBAAgB,GACjB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,cAAc,EAAmB,MAAM,YAAY,CAAC;AAE7D;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,OAAsB,EACtB,KAAiB,EACjB,QAA4C;IAE5C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;QAClD,YAAY,EAAE,QAAQ,CAAC,IAAI;QAC3B,gBAAgB,EAAE,QAAQ,CAAC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,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC/B,SAAS;QACX,CAAC;QACD,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QACzC,IAAI,MAAM,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1E,IAAI,CAAC;gBACH,EAAE,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;YACpE,CAAC;YAAC,MAAM,CAAC;gBACP,uEAAuE;YACzE,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,IAAY;IAC5B,IAAI,CAAC;QACH,OAAO,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACtC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
package/dist/images/scripts.d.ts
CHANGED
|
@@ -22,11 +22,19 @@ export type PrepareSource = {
|
|
|
22
22
|
* Get MCP into a fresh image, save it and quit. The pinned release is loaded
|
|
23
23
|
* with the Metacello expression PLexus has always used, with its `Telemetry`
|
|
24
24
|
* group beside its default one when telemetry is asked for; a script is filed
|
|
25
|
-
* in instead.
|
|
25
|
+
* in instead. The status says whether MCP then has its OpenTelemetry backend
|
|
26
|
+
* (`telemetry=on`), which a script may or may not have loaded.
|
|
26
27
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
28
|
+
* The image clones `github://` repositories over HTTPS, as a public one needs
|
|
29
|
+
* no credentials that way, before it loads anything and in the image saved.
|
|
30
|
+
*
|
|
31
|
+
* A pinned load forgets the Iceberg repositories it registered whose clone is
|
|
32
|
+
* in the build directory, which a base is renamed away from, and the status
|
|
33
|
+
* names those clones (`clone=`) for PLexus to delete once the image has quit:
|
|
34
|
+
* a clone left without its repository is taken by a later load of the same
|
|
35
|
+
* project for one it must not overwrite, which then fails. A clone elsewhere,
|
|
36
|
+
* in a location every image shares, stays registered. A script's are kept,
|
|
37
|
+
* since its image is built where it stays.
|
|
30
38
|
*/
|
|
31
39
|
export declare function prepareScript(source: PrepareSource): string;
|
|
32
40
|
/**
|
|
@@ -36,11 +44,15 @@ export declare function prepareScript(source: PrepareSource): string;
|
|
|
36
44
|
*
|
|
37
45
|
* Port 0 asks the system for a free port; the file names the port bound and
|
|
38
46
|
* the pid that bound it, written under another name and renamed so that a
|
|
39
|
-
* reader never sees half of it.
|
|
47
|
+
* reader never sees half of it. The pid is `LibC>>#getpid`'s where the image
|
|
48
|
+
* has it, else `LibC>>#currentProcessId`'s, which Pharo 10 has. It never
|
|
49
|
+
* saves the image.
|
|
40
50
|
*
|
|
41
51
|
* With telemetry, a server that has an OpenTelemetry backend is switched to
|
|
42
52
|
* it before it starts; one without is started as it is, and a backend that
|
|
43
|
-
* fails to switch leaves it so too.
|
|
53
|
+
* fails to switch leaves it so too. The file says whether the server records
|
|
54
|
+
* through OpenTelemetry (`telemetry=on`), and when not, why
|
|
55
|
+
* (`telemetry.reason`, `telemetry.detail`): see `TelemetryOffReason`.
|
|
44
56
|
*/
|
|
45
57
|
export declare function startScript(options?: {
|
|
46
58
|
telemetry?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/images/scripts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;;;;;;EAQjD;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"scripts.d.ts","sourceRoot":"","sources":["../../src/images/scripts.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM;;;;;;EAQjD;AAED,MAAM,MAAM,aAAa,GACrB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AA0BvC;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CA8D3D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,WAAW,CAAC,OAAO,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAoEzE"}
|