@evref-bl/plexus 0.7.0 → 0.8.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/README.md +1 -1
- package/dist/cli.js +79 -187
- package/dist/cli.js.map +1 -1
- package/dist/config/config.d.ts +0 -14
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js +0 -49
- package/dist/config/config.js.map +1 -1
- package/dist/config/projectConfig.d.ts +0 -81
- package/dist/config/projectConfig.d.ts.map +1 -1
- package/dist/config/projectConfig.js +0 -410
- package/dist/config/projectConfig.js.map +1 -1
- package/dist/gateway/projectImageMcpEndpoint.d.ts +0 -1
- package/dist/gateway/projectImageMcpEndpoint.d.ts.map +1 -1
- package/dist/gateway/projectImageMcpEndpoint.js +3 -43
- package/dist/gateway/projectImageMcpEndpoint.js.map +1 -1
- package/dist/gateway/server/index.d.ts +8 -0
- package/dist/gateway/server/index.d.ts.map +1 -0
- package/dist/gateway/server/index.js +34 -0
- package/dist/gateway/server/index.js.map +1 -0
- package/dist/gateway/server/mcp/server.d.ts +66 -0
- package/dist/gateway/server/mcp/server.d.ts.map +1 -0
- package/dist/gateway/server/mcp/server.js +458 -0
- package/dist/gateway/server/mcp/server.js.map +1 -0
- package/dist/gateway/server/routing/endpointHandoffFormat.d.ts +26 -0
- package/dist/gateway/server/routing/endpointHandoffFormat.d.ts.map +1 -0
- package/dist/gateway/server/routing/endpointHandoffFormat.js +52 -0
- package/dist/gateway/server/routing/endpointHandoffFormat.js.map +1 -0
- package/dist/gateway/server/routing/gateway.d.ts +167 -0
- package/dist/gateway/server/routing/gateway.d.ts.map +1 -0
- package/dist/gateway/server/routing/gateway.js +863 -0
- package/dist/gateway/server/routing/gateway.js.map +1 -0
- package/dist/gateway/server/routing/imageMcpRouter.d.ts +59 -0
- package/dist/gateway/server/routing/imageMcpRouter.d.ts.map +1 -0
- package/dist/gateway/server/routing/imageMcpRouter.js +248 -0
- package/dist/gateway/server/routing/imageMcpRouter.js.map +1 -0
- package/dist/gateway/server/routing/pharoFacade.d.ts +12 -0
- package/dist/gateway/server/routing/pharoFacade.d.ts.map +1 -0
- package/dist/gateway/server/routing/pharoFacade.js +67 -0
- package/dist/gateway/server/routing/pharoFacade.js.map +1 -0
- package/dist/gateway/server/routing/routeDiscovery.d.ts +26 -0
- package/dist/gateway/server/routing/routeDiscovery.d.ts.map +1 -0
- package/dist/gateway/server/routing/routeDiscovery.js +46 -0
- package/dist/gateway/server/routing/routeDiscovery.js.map +1 -0
- package/dist/gateway/server/routing/routingTable.d.ts +116 -0
- package/dist/gateway/server/routing/routingTable.d.ts.map +1 -0
- package/dist/gateway/server/routing/routingTable.js +215 -0
- package/dist/gateway/server/routing/routingTable.js.map +1 -0
- package/dist/gateway/server/support/processLiveness.d.ts +10 -0
- package/dist/gateway/server/support/processLiveness.d.ts.map +1 -0
- package/dist/gateway/server/support/processLiveness.js +25 -0
- package/dist/gateway/server/support/processLiveness.js.map +1 -0
- package/dist/gateway/server/support/sourceBuildPreflight.d.ts +15 -0
- package/dist/gateway/server/support/sourceBuildPreflight.d.ts.map +1 -0
- package/dist/gateway/server/support/sourceBuildPreflight.js +88 -0
- package/dist/gateway/server/support/sourceBuildPreflight.js.map +1 -0
- package/dist/gateway/server/support/toolResultFormatting.d.ts +8 -0
- package/dist/gateway/server/support/toolResultFormatting.d.ts.map +1 -0
- package/dist/gateway/server/support/toolResultFormatting.js +81 -0
- package/dist/gateway/server/support/toolResultFormatting.js.map +1 -0
- package/dist/images/homeImageCache.d.ts +0 -2
- package/dist/images/homeImageCache.d.ts.map +1 -1
- package/dist/images/homeImageCache.js +2 -6
- package/dist/images/homeImageCache.js.map +1 -1
- package/dist/images/imageRescue.d.ts +1 -4
- package/dist/images/imageRescue.d.ts.map +1 -1
- package/dist/images/imageRescue.js +30 -42
- package/dist/images/imageRescue.js.map +1 -1
- package/dist/images/imageRuntime.d.ts +60 -0
- package/dist/images/imageRuntime.d.ts.map +1 -0
- package/dist/images/imageRuntime.js +94 -0
- package/dist/images/imageRuntime.js.map +1 -0
- package/dist/images/preparedImageCache.d.ts +0 -1
- package/dist/images/preparedImageCache.d.ts.map +1 -1
- package/dist/images/preparedImageCache.js +0 -4
- package/dist/images/preparedImageCache.js.map +1 -1
- package/dist/images/scopedTemplateCatalog.js +2 -2
- package/dist/images/scopedTemplateCatalog.js.map +1 -1
- package/dist/index.d.ts +1 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -9
- package/dist/index.js.map +1 -1
- package/dist/launcher/pharoLauncherProfile.d.ts +0 -1
- package/dist/launcher/pharoLauncherProfile.d.ts.map +1 -1
- package/dist/launcher/pharoLauncherProfile.js.map +1 -1
- package/dist/launcher/scopedPharoLauncherServer.d.ts +96 -26
- package/dist/launcher/scopedPharoLauncherServer.d.ts.map +1 -1
- package/dist/launcher/scopedPharoLauncherServer.js +260 -172
- package/dist/launcher/scopedPharoLauncherServer.js.map +1 -1
- package/dist/lifecycle/projectClose.d.ts +10 -6
- package/dist/lifecycle/projectClose.d.ts.map +1 -1
- package/dist/lifecycle/projectClose.js +47 -99
- package/dist/lifecycle/projectClose.js.map +1 -1
- package/dist/lifecycle/projectOpen.d.ts +38 -5
- package/dist/lifecycle/projectOpen.d.ts.map +1 -1
- package/dist/lifecycle/projectOpen.js +111 -476
- package/dist/lifecycle/projectOpen.js.map +1 -1
- package/dist/mcp/agentServer.d.ts +15 -0
- package/dist/mcp/agentServer.d.ts.map +1 -0
- package/dist/mcp/agentServer.js +71 -0
- package/dist/mcp/agentServer.js.map +1 -0
- package/dist/mcp/imageOperations.d.ts +0 -5
- package/dist/mcp/imageOperations.d.ts.map +1 -1
- package/dist/mcp/imageOperations.js +0 -15
- package/dist/mcp/imageOperations.js.map +1 -1
- package/dist/workspace/projectStartupScript.d.ts +3 -10
- package/dist/workspace/projectStartupScript.d.ts.map +1 -1
- package/dist/workspace/projectStartupScript.js +21 -170
- package/dist/workspace/projectStartupScript.js.map +1 -1
- package/dist/workspace/projectState.d.ts +4 -121
- package/dist/workspace/projectState.d.ts.map +1 -1
- package/dist/workspace/projectState.js +4 -212
- package/dist/workspace/projectState.js.map +1 -1
- package/package.json +10 -5
- package/dist/config/target.d.ts +0 -19
- package/dist/config/target.d.ts.map +0 -1
- package/dist/config/target.js +0 -2
- package/dist/config/target.js.map +0 -1
- package/dist/gateway/projectGateway.d.ts +0 -80
- package/dist/gateway/projectGateway.d.ts.map +0 -1
- package/dist/gateway/projectGateway.js +0 -435
- package/dist/gateway/projectGateway.js.map +0 -1
- package/dist/lifecycle/projectCleanup.d.ts +0 -59
- package/dist/lifecycle/projectCleanup.d.ts.map +0 -1
- package/dist/lifecycle/projectCleanup.js +0 -483
- package/dist/lifecycle/projectCleanup.js.map +0 -1
- package/dist/lifecycle/projectLifecycle.d.ts +0 -422
- package/dist/lifecycle/projectLifecycle.d.ts.map +0 -1
- package/dist/lifecycle/projectLifecycle.js +0 -2114
- package/dist/lifecycle/projectLifecycle.js.map +0 -1
- package/dist/mcp/server.d.ts +0 -86
- package/dist/mcp/server.d.ts.map +0 -1
- package/dist/mcp/server.js +0 -358
- package/dist/mcp/server.js.map +0 -1
- package/dist/ports/imagePortClaims.d.ts +0 -41
- package/dist/ports/imagePortClaims.d.ts.map +0 -1
- package/dist/ports/imagePortClaims.js +0 -337
- package/dist/ports/imagePortClaims.js.map +0 -1
- package/dist/ports/portClaims.d.ts +0 -116
- package/dist/ports/portClaims.d.ts.map +0 -1
- package/dist/ports/portClaims.js +0 -393
- package/dist/ports/portClaims.js.map +0 -1
- package/dist/support/runtimeIdentity.d.ts +0 -13
- package/dist/support/runtimeIdentity.d.ts.map +0 -1
- package/dist/support/runtimeIdentity.js +0 -38
- package/dist/support/runtimeIdentity.js.map +0 -1
- package/dist/workspace/projectRepositoryWorkspace.d.ts +0 -74
- package/dist/workspace/projectRepositoryWorkspace.d.ts.map +0 -1
- package/dist/workspace/projectRepositoryWorkspace.js +0 -553
- package/dist/workspace/projectRepositoryWorkspace.js.map +0 -1
- package/dist/workspace/scopedProjectContext.d.ts +0 -169
- package/dist/workspace/scopedProjectContext.d.ts.map +0 -1
- package/dist/workspace/scopedProjectContext.js +0 -358
- package/dist/workspace/scopedProjectContext.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectConfig.d.ts","sourceRoot":"","sources":["../../src/config/projectConfig.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,2BAA2B,gBAAgB,CAAC;AAEzD,MAAM,WAAW,qBAAqB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,0BAA0B,CAAC;IACzC,UAAU,CAAC,EAAE,yBAAyB,CAAC;CACxC;AAED,MAAM,MAAM,0BAA0B,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAC9E,MAAM,MAAM,yBAAyB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AACzE,MAAM,MAAM,uBAAuB,GAAG,UAAU,GAAG,aAAa,CAAC;AAEjE,MAAM,WAAW,+BAA+B;IAC9C,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,+BAA+B,CAAC;IAC7C,WAAW,CAAC,EAAE,0BAA0B,CAAC;CAC1C;AAED,MAAM,MAAM,wBAAwB,GAAG,KAAK,GAAG,OAAO,GAAG,MAAM,CAAC;AAEhE,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IAC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,kBAAkB,EAAE,CAAC;CAC9B;AAED,MAAM,MAAM,mBAAmB,GAAG,aAAa,CAAC;AAEhD,qBAAa,kBAAmB,SAAQ,KAAK;aAGzB,MAAM,EAAE,MAAM,EAAE;gBADhC,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM,EAAE;CAKnC;AAMD,wBAAgB,2BAA2B,IAAI,oBAAoB,CAalE;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,CAAC,GACrC,oBAAoB,CAEtB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,MAAM,CAEzE;AAED,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,aAAa,CAAC,GAC9C,0BAA0B,CAE5B;AAED,wBAAgB,oBAAoB,CAClC,GAAG,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,CAAC,GAC7C,yBAAyB,CAE3B;AAED,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,IAAI,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAC7C,uBAAuB,CAEzB;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,wBAAwB,GAC/B,iCAAiC,CAEnC;AAqlCD,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,CAgDhE;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAE7D;AAED,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,CAKpE"}
|
|
@@ -16,30 +16,9 @@ function isObject(value) {
|
|
|
16
16
|
}
|
|
17
17
|
export function defaultProjectRuntimePolicy() {
|
|
18
18
|
return {
|
|
19
|
-
scope: "project",
|
|
20
19
|
stateRoot: {
|
|
21
20
|
mode: "project-local",
|
|
22
21
|
},
|
|
23
|
-
gateway: {
|
|
24
|
-
mode: "project-local",
|
|
25
|
-
host: "127.0.0.1",
|
|
26
|
-
portRange: {
|
|
27
|
-
start: 8_133,
|
|
28
|
-
end: 8_199,
|
|
29
|
-
},
|
|
30
|
-
mcpPath: "/mcp",
|
|
31
|
-
routeControlMcpPath: "/control-mcp",
|
|
32
|
-
},
|
|
33
|
-
imagePorts: {
|
|
34
|
-
allocation: "configured-or-dynamic",
|
|
35
|
-
range: {
|
|
36
|
-
start: 7_100,
|
|
37
|
-
end: 7_199,
|
|
38
|
-
},
|
|
39
|
-
coordination: {
|
|
40
|
-
mode: "host-local",
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
22
|
launcherProfile: {
|
|
44
23
|
mode: "project-owned",
|
|
45
24
|
},
|
|
@@ -177,16 +156,6 @@ function optionalPositiveIntegerField(object, key, issues, pathPrefix) {
|
|
|
177
156
|
issues.push(`${pathPrefix}.${key} must be a positive integer`);
|
|
178
157
|
return undefined;
|
|
179
158
|
}
|
|
180
|
-
function requiredPortField(object, key, issues, pathPrefix, fallback) {
|
|
181
|
-
const value = optionalPortField(object, key, issues, pathPrefix);
|
|
182
|
-
if (value !== undefined) {
|
|
183
|
-
return value;
|
|
184
|
-
}
|
|
185
|
-
if (object[key] === undefined) {
|
|
186
|
-
issues.push(`${pathPrefix}.${key} must be an integer between 1 and 65535`);
|
|
187
|
-
}
|
|
188
|
-
return fallback;
|
|
189
|
-
}
|
|
190
159
|
function optionalStringField(object, key, issues, pathPrefix) {
|
|
191
160
|
const value = object[key];
|
|
192
161
|
if (value === undefined) {
|
|
@@ -242,18 +211,6 @@ function pathFieldWithDefault(object, key, issues, pathPrefix, defaultValue) {
|
|
|
242
211
|
}
|
|
243
212
|
return value;
|
|
244
213
|
}
|
|
245
|
-
function parseRuntimePortRange(value, issues, pathPrefix, fallback) {
|
|
246
|
-
if (!isObject(value)) {
|
|
247
|
-
issues.push(`${pathPrefix} must be an object`);
|
|
248
|
-
return { ...fallback };
|
|
249
|
-
}
|
|
250
|
-
const start = requiredPortField(value, "start", issues, pathPrefix, fallback.start);
|
|
251
|
-
const end = requiredPortField(value, "end", issues, pathPrefix, fallback.end);
|
|
252
|
-
if (start > end) {
|
|
253
|
-
issues.push(`${pathPrefix}.start must be less than or equal to ${pathPrefix}.end`);
|
|
254
|
-
}
|
|
255
|
-
return { start, end };
|
|
256
|
-
}
|
|
257
214
|
function parsePositiveIntegerArray(value, issues, pathPrefix, fallback) {
|
|
258
215
|
if (value === undefined) {
|
|
259
216
|
return [...fallback];
|
|
@@ -492,93 +449,6 @@ function parseImagePreparedImage(value, issues, pathPrefix) {
|
|
|
492
449
|
copyMode,
|
|
493
450
|
};
|
|
494
451
|
}
|
|
495
|
-
function parseImageRepositoryIdentity(value, issues, pathPrefix) {
|
|
496
|
-
if (!isObject(value)) {
|
|
497
|
-
issues.push(`${pathPrefix}.repository must be an object`);
|
|
498
|
-
return { id: "" };
|
|
499
|
-
}
|
|
500
|
-
const componentId = optionalStringField(value, "componentId", issues, `${pathPrefix}.repository`);
|
|
501
|
-
const remoteUrl = optionalStringField(value, "remoteUrl", issues, `${pathPrefix}.repository`);
|
|
502
|
-
const originPath = optionalStringField(value, "originPath", issues, `${pathPrefix}.repository`);
|
|
503
|
-
if (!componentId && !remoteUrl && !originPath) {
|
|
504
|
-
issues.push(`${pathPrefix}.repository must set at least one of componentId, remoteUrl, or originPath`);
|
|
505
|
-
}
|
|
506
|
-
return {
|
|
507
|
-
id: stringField(value, "id", issues, `${pathPrefix}.repository`),
|
|
508
|
-
...(componentId ? { componentId } : {}),
|
|
509
|
-
...(remoteUrl ? { remoteUrl } : {}),
|
|
510
|
-
...(originPath ? { originPath } : {}),
|
|
511
|
-
};
|
|
512
|
-
}
|
|
513
|
-
function parseImageRepositoryWorkspaceMaterialization(value, issues, pathPrefix) {
|
|
514
|
-
const materializationPath = `${pathPrefix}.materialization`;
|
|
515
|
-
if (value === undefined) {
|
|
516
|
-
return { strategy: "copy" };
|
|
517
|
-
}
|
|
518
|
-
if (!isObject(value)) {
|
|
519
|
-
issues.push(`${materializationPath} must be an object`);
|
|
520
|
-
return { strategy: "copy" };
|
|
521
|
-
}
|
|
522
|
-
const strategyValue = value.strategy ?? "copy";
|
|
523
|
-
const strategy = strategyValue === "copy" ||
|
|
524
|
-
strategyValue === "git-worktree" ||
|
|
525
|
-
strategyValue === "clone"
|
|
526
|
-
? strategyValue
|
|
527
|
-
: "copy";
|
|
528
|
-
if (strategy !== strategyValue) {
|
|
529
|
-
issues.push(`${materializationPath}.strategy must be one of copy, git-worktree, clone`);
|
|
530
|
-
}
|
|
531
|
-
const path = optionalStringField(value, "path", issues, materializationPath);
|
|
532
|
-
return {
|
|
533
|
-
strategy,
|
|
534
|
-
...(path ? { path } : {}),
|
|
535
|
-
};
|
|
536
|
-
}
|
|
537
|
-
function parseImageRepositoryWorkspace(value, issues, workspacePath) {
|
|
538
|
-
if (value === undefined) {
|
|
539
|
-
return undefined;
|
|
540
|
-
}
|
|
541
|
-
if (!isObject(value)) {
|
|
542
|
-
issues.push(`${workspacePath} must be an object`);
|
|
543
|
-
return undefined;
|
|
544
|
-
}
|
|
545
|
-
const pharoVersion = optionalPositiveIntegerField(value, "pharoVersion", issues, workspacePath);
|
|
546
|
-
return {
|
|
547
|
-
repository: parseImageRepositoryIdentity(value.repository, issues, workspacePath),
|
|
548
|
-
sourceDirectory: stringField(value, "sourceDirectory", issues, workspacePath),
|
|
549
|
-
baseline: stringField(value, "baseline", issues, workspacePath),
|
|
550
|
-
loadGroup: optionalStringField(value, "loadGroup", issues, workspacePath),
|
|
551
|
-
...(pharoVersion !== undefined ? { pharoVersion } : {}),
|
|
552
|
-
templateName: optionalStringField(value, "templateName", issues, workspacePath),
|
|
553
|
-
templateCategory: optionalStringField(value, "templateCategory", issues, workspacePath),
|
|
554
|
-
branch: optionalStringField(value, "branch", issues, workspacePath),
|
|
555
|
-
baseBranch: optionalStringField(value, "baseBranch", issues, workspacePath),
|
|
556
|
-
baseCommit: optionalStringField(value, "baseCommit", issues, workspacePath),
|
|
557
|
-
materialization: parseImageRepositoryWorkspaceMaterialization(value.materialization, issues, workspacePath),
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
function parseImageRepositoryWorkspaces(value, issues, pathPrefix) {
|
|
561
|
-
if (value === undefined) {
|
|
562
|
-
return undefined;
|
|
563
|
-
}
|
|
564
|
-
const workspacesPath = `${pathPrefix}.repositoryWorkspaces`;
|
|
565
|
-
if (!Array.isArray(value)) {
|
|
566
|
-
issues.push(`${workspacesPath} must be an array`);
|
|
567
|
-
return undefined;
|
|
568
|
-
}
|
|
569
|
-
return value.map((workspace, index) => parseImageRepositoryWorkspace(workspace, issues, `${workspacesPath}[${index}]`) ?? {
|
|
570
|
-
repository: { id: "" },
|
|
571
|
-
sourceDirectory: "",
|
|
572
|
-
baseline: "",
|
|
573
|
-
materialization: { strategy: "copy" },
|
|
574
|
-
});
|
|
575
|
-
}
|
|
576
|
-
export function imageRepositoryWorkspaceConfigs(image) {
|
|
577
|
-
if (image.repositoryWorkspaces && image.repositoryWorkspaces.length > 0) {
|
|
578
|
-
return image.repositoryWorkspaces;
|
|
579
|
-
}
|
|
580
|
-
return image.repositoryWorkspace ? [image.repositoryWorkspace] : [];
|
|
581
|
-
}
|
|
582
452
|
function parseImages(value, issues) {
|
|
583
453
|
if (!Array.isArray(value)) {
|
|
584
454
|
issues.push("images must be an array");
|
|
@@ -591,26 +461,16 @@ function parseImages(value, issues) {
|
|
|
591
461
|
return {
|
|
592
462
|
id: "",
|
|
593
463
|
imageName: "",
|
|
594
|
-
active: false,
|
|
595
464
|
mcp: { loadScript: "" },
|
|
596
465
|
};
|
|
597
466
|
}
|
|
598
|
-
const repositoryWorkspace = parseImageRepositoryWorkspace(image.repositoryWorkspace, issues, `${pathPrefix}.repositoryWorkspace`);
|
|
599
|
-
const repositoryWorkspaces = parseImageRepositoryWorkspaces(image.repositoryWorkspaces, issues, pathPrefix);
|
|
600
|
-
const effectiveRepositoryWorkspaces = repositoryWorkspaces ??
|
|
601
|
-
(repositoryWorkspace ? [repositoryWorkspace] : undefined);
|
|
602
467
|
return {
|
|
603
468
|
id: stringField(image, "id", issues, pathPrefix),
|
|
604
469
|
imageName: stringField(image, "imageName", issues, pathPrefix),
|
|
605
|
-
active: booleanField(image, "active", issues, pathPrefix),
|
|
606
470
|
displayMode: optionalImageDisplayModeField(image, "displayMode", issues, pathPrefix),
|
|
607
471
|
mcp: parseImageMcp(image.mcp, issues, pathPrefix),
|
|
608
472
|
create: parseImageCreate(image.create, issues, pathPrefix),
|
|
609
473
|
preparedImage: parseImagePreparedImage(image.preparedImage, issues, pathPrefix),
|
|
610
|
-
repositoryWorkspace: repositoryWorkspace ?? effectiveRepositoryWorkspaces?.[0],
|
|
611
|
-
...(effectiveRepositoryWorkspaces
|
|
612
|
-
? { repositoryWorkspaces: effectiveRepositoryWorkspaces }
|
|
613
|
-
: {}),
|
|
614
474
|
git: parseImageGit(image.git, issues, pathPrefix),
|
|
615
475
|
};
|
|
616
476
|
});
|
|
@@ -693,195 +553,6 @@ function parseRuntimeStateRoot(value, issues) {
|
|
|
693
553
|
}
|
|
694
554
|
return { mode };
|
|
695
555
|
}
|
|
696
|
-
function parseProjectLocalGateway(value, issues) {
|
|
697
|
-
const defaultGateway = defaultProjectRuntimePolicy()
|
|
698
|
-
.gateway;
|
|
699
|
-
const port = optionalPortField(value, "port", issues, "runtime.gateway");
|
|
700
|
-
const hasPortRange = value.portRange !== undefined;
|
|
701
|
-
const parsedPortRange = hasPortRange
|
|
702
|
-
? parseRuntimePortRange(value.portRange, issues, "runtime.gateway.portRange", defaultGateway.portRange ?? { start: 8_133, end: 8_199 })
|
|
703
|
-
: undefined;
|
|
704
|
-
if (port !== undefined && hasPortRange) {
|
|
705
|
-
issues.push("runtime.gateway must use either port or portRange, not both");
|
|
706
|
-
}
|
|
707
|
-
const portPolicy = port !== undefined
|
|
708
|
-
? { port }
|
|
709
|
-
: { portRange: parsedPortRange ?? defaultGateway.portRange };
|
|
710
|
-
return {
|
|
711
|
-
mode: "project-local",
|
|
712
|
-
host: stringFieldWithDefault(value, "host", issues, "runtime.gateway", defaultGateway.host),
|
|
713
|
-
...portPolicy,
|
|
714
|
-
mcpPath: pathFieldWithDefault(value, "mcpPath", issues, "runtime.gateway", defaultGateway.mcpPath),
|
|
715
|
-
routeControlMcpPath: pathFieldWithDefault(value, "routeControlMcpPath", issues, "runtime.gateway", defaultGateway.routeControlMcpPath),
|
|
716
|
-
};
|
|
717
|
-
}
|
|
718
|
-
function parseSharedGateway(value, issues) {
|
|
719
|
-
return {
|
|
720
|
-
mode: "shared",
|
|
721
|
-
mcpUrl: urlField(value, "mcpUrl", issues, "runtime.gateway"),
|
|
722
|
-
routeControlMcpUrl: urlField(value, "routeControlMcpUrl", issues, "runtime.gateway"),
|
|
723
|
-
};
|
|
724
|
-
}
|
|
725
|
-
function parseRuntimeGateway(value, issues) {
|
|
726
|
-
if (value === undefined) {
|
|
727
|
-
return {
|
|
728
|
-
...defaultProjectRuntimePolicy().gateway,
|
|
729
|
-
};
|
|
730
|
-
}
|
|
731
|
-
if (!isObject(value)) {
|
|
732
|
-
issues.push("runtime.gateway must be an object");
|
|
733
|
-
return {
|
|
734
|
-
...defaultProjectRuntimePolicy().gateway,
|
|
735
|
-
};
|
|
736
|
-
}
|
|
737
|
-
const modeValue = value.mode ?? "project-local";
|
|
738
|
-
if (modeValue === "shared") {
|
|
739
|
-
return parseSharedGateway(value, issues);
|
|
740
|
-
}
|
|
741
|
-
if (modeValue !== "project-local") {
|
|
742
|
-
issues.push("runtime.gateway.mode must be one of project-local, shared");
|
|
743
|
-
}
|
|
744
|
-
return parseProjectLocalGateway(value, issues);
|
|
745
|
-
}
|
|
746
|
-
function parseRemoteNodeTargetMappings(value, issues, pathPrefix) {
|
|
747
|
-
if (value === undefined) {
|
|
748
|
-
return undefined;
|
|
749
|
-
}
|
|
750
|
-
if (!Array.isArray(value)) {
|
|
751
|
-
issues.push(`${pathPrefix}.targets must be an array`);
|
|
752
|
-
return undefined;
|
|
753
|
-
}
|
|
754
|
-
return value.map((item, index) => {
|
|
755
|
-
const itemPath = `${pathPrefix}.targets[${index}]`;
|
|
756
|
-
if (!isObject(item)) {
|
|
757
|
-
issues.push(`${itemPath} must be an object`);
|
|
758
|
-
return {
|
|
759
|
-
targetId: "",
|
|
760
|
-
};
|
|
761
|
-
}
|
|
762
|
-
const remoteTargetId = optionalStringField(item, "remoteTargetId", issues, itemPath);
|
|
763
|
-
return {
|
|
764
|
-
targetId: stringField(item, "targetId", issues, itemPath),
|
|
765
|
-
...(remoteTargetId ? { remoteTargetId } : {}),
|
|
766
|
-
};
|
|
767
|
-
});
|
|
768
|
-
}
|
|
769
|
-
function parseRemoteNodeWorkspaceMappings(value, issues, pathPrefix) {
|
|
770
|
-
if (value === undefined) {
|
|
771
|
-
return undefined;
|
|
772
|
-
}
|
|
773
|
-
if (!Array.isArray(value)) {
|
|
774
|
-
issues.push(`${pathPrefix}.workspaces must be an array`);
|
|
775
|
-
return undefined;
|
|
776
|
-
}
|
|
777
|
-
return value.map((item, index) => {
|
|
778
|
-
const itemPath = `${pathPrefix}.workspaces[${index}]`;
|
|
779
|
-
if (!isObject(item)) {
|
|
780
|
-
issues.push(`${itemPath} must be an object`);
|
|
781
|
-
return {
|
|
782
|
-
workspaceId: "",
|
|
783
|
-
};
|
|
784
|
-
}
|
|
785
|
-
const remoteWorkspaceId = optionalStringField(item, "remoteWorkspaceId", issues, itemPath);
|
|
786
|
-
const remoteProjectPath = optionalStringField(item, "remoteProjectPath", issues, itemPath);
|
|
787
|
-
const targets = parseRemoteNodeTargetMappings(item.targets, issues, itemPath);
|
|
788
|
-
return {
|
|
789
|
-
workspaceId: stringField(item, "workspaceId", issues, itemPath),
|
|
790
|
-
...(remoteWorkspaceId ? { remoteWorkspaceId } : {}),
|
|
791
|
-
...(remoteProjectPath ? { remoteProjectPath } : {}),
|
|
792
|
-
...(targets ? { targets } : {}),
|
|
793
|
-
};
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
function parseRemoteNodes(value, issues) {
|
|
797
|
-
if (value === undefined) {
|
|
798
|
-
return undefined;
|
|
799
|
-
}
|
|
800
|
-
if (!Array.isArray(value)) {
|
|
801
|
-
issues.push("runtime.remoteNodes must be an array");
|
|
802
|
-
return undefined;
|
|
803
|
-
}
|
|
804
|
-
return value.map((item, index) => {
|
|
805
|
-
const itemPath = `runtime.remoteNodes[${index}]`;
|
|
806
|
-
if (!isObject(item)) {
|
|
807
|
-
issues.push(`${itemPath} must be an object`);
|
|
808
|
-
return {
|
|
809
|
-
id: "",
|
|
810
|
-
projectMcpUrl: "",
|
|
811
|
-
gatewayMcpUrl: "",
|
|
812
|
-
};
|
|
813
|
-
}
|
|
814
|
-
const workspaces = parseRemoteNodeWorkspaceMappings(item.workspaces, issues, itemPath);
|
|
815
|
-
const parentNodeId = optionalStringField(item, "parentNodeId", issues, itemPath);
|
|
816
|
-
return {
|
|
817
|
-
id: stringField(item, "id", issues, itemPath),
|
|
818
|
-
...(parentNodeId ? { parentNodeId } : {}),
|
|
819
|
-
projectMcpUrl: urlField(item, "projectMcpUrl", issues, itemPath),
|
|
820
|
-
gatewayMcpUrl: urlField(item, "gatewayMcpUrl", issues, itemPath),
|
|
821
|
-
...(workspaces ? { workspaces } : {}),
|
|
822
|
-
};
|
|
823
|
-
});
|
|
824
|
-
}
|
|
825
|
-
function parseImagePortCoordination(value, issues) {
|
|
826
|
-
if (value === undefined) {
|
|
827
|
-
return { ...defaultProjectRuntimePolicy().imagePorts.coordination };
|
|
828
|
-
}
|
|
829
|
-
if (!isObject(value)) {
|
|
830
|
-
issues.push("runtime.imagePorts.coordination must be an object");
|
|
831
|
-
return { ...defaultProjectRuntimePolicy().imagePorts.coordination };
|
|
832
|
-
}
|
|
833
|
-
const defaultMode = defaultProjectRuntimePolicy().imagePorts.coordination.mode;
|
|
834
|
-
const modeValue = value.mode ?? defaultMode;
|
|
835
|
-
const mode = modeValue === "project-state" || modeValue === "host-local"
|
|
836
|
-
? modeValue
|
|
837
|
-
: defaultMode;
|
|
838
|
-
if (mode !== modeValue) {
|
|
839
|
-
issues.push("runtime.imagePorts.coordination.mode must be one of project-state, host-local");
|
|
840
|
-
}
|
|
841
|
-
const root = optionalStringField(value, "root", issues, "runtime.imagePorts.coordination");
|
|
842
|
-
if (root && mode !== "host-local") {
|
|
843
|
-
issues.push("runtime.imagePorts.coordination.root can only be used when mode is \"host-local\"");
|
|
844
|
-
}
|
|
845
|
-
return {
|
|
846
|
-
mode,
|
|
847
|
-
...(root && mode === "host-local" ? { root } : {}),
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
function parseImagePortPolicy(value, issues) {
|
|
851
|
-
const defaults = defaultProjectRuntimePolicy().imagePorts;
|
|
852
|
-
if (value === undefined) {
|
|
853
|
-
return {
|
|
854
|
-
allocation: defaults.allocation,
|
|
855
|
-
range: { ...defaults.range },
|
|
856
|
-
coordination: { ...defaults.coordination },
|
|
857
|
-
};
|
|
858
|
-
}
|
|
859
|
-
if (!isObject(value)) {
|
|
860
|
-
issues.push("runtime.imagePorts must be an object");
|
|
861
|
-
return {
|
|
862
|
-
allocation: defaults.allocation,
|
|
863
|
-
range: { ...defaults.range },
|
|
864
|
-
coordination: { ...defaults.coordination },
|
|
865
|
-
};
|
|
866
|
-
}
|
|
867
|
-
const allocationValue = value.allocation ?? defaults.allocation;
|
|
868
|
-
const allocation = allocationValue === "configured-or-dynamic" ||
|
|
869
|
-
allocationValue === "dynamic-only" ||
|
|
870
|
-
allocationValue === "configured-only"
|
|
871
|
-
? allocationValue
|
|
872
|
-
: defaults.allocation;
|
|
873
|
-
if (allocation !== allocationValue) {
|
|
874
|
-
issues.push("runtime.imagePorts.allocation must be one of " +
|
|
875
|
-
"configured-or-dynamic, dynamic-only, configured-only");
|
|
876
|
-
}
|
|
877
|
-
return {
|
|
878
|
-
allocation,
|
|
879
|
-
range: value.range === undefined
|
|
880
|
-
? { ...defaults.range }
|
|
881
|
-
: parseRuntimePortRange(value.range, issues, "runtime.imagePorts.range", defaults.range),
|
|
882
|
-
coordination: parseImagePortCoordination(value.coordination, issues),
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
556
|
function parseLauncherProfilePolicy(value, issues) {
|
|
886
557
|
if (value === undefined) {
|
|
887
558
|
return { ...defaultProjectRuntimePolicy().launcherProfile };
|
|
@@ -989,16 +660,11 @@ function parseRuntimePolicy(value, issues) {
|
|
|
989
660
|
issues.push("runtime.scope must be \"project\"");
|
|
990
661
|
}
|
|
991
662
|
const workspaceImages = parseWorkspaceImagePolicy(value.workspaceImages, issues);
|
|
992
|
-
const remoteNodes = parseRemoteNodes(value.remoteNodes, issues);
|
|
993
663
|
const nodeId = optionalStringField(value, "nodeId", issues, "runtime");
|
|
994
664
|
return {
|
|
995
|
-
scope: "project",
|
|
996
665
|
...(nodeId ? { nodeId } : {}),
|
|
997
666
|
stateRoot: parseRuntimeStateRoot(value.stateRoot, issues),
|
|
998
|
-
gateway: parseRuntimeGateway(value.gateway, issues),
|
|
999
|
-
imagePorts: parseImagePortPolicy(value.imagePorts, issues),
|
|
1000
667
|
...(workspaceImages ? { workspaceImages } : {}),
|
|
1001
|
-
...(remoteNodes ? { remoteNodes } : {}),
|
|
1002
668
|
launcherProfile: parseLauncherProfilePolicy(value.launcherProfile, issues),
|
|
1003
669
|
pharoMcp: parsePharoMcpPolicy(value.pharoMcp, issues),
|
|
1004
670
|
};
|
|
@@ -1035,56 +701,6 @@ function collectDuplicatePorts(images, issues) {
|
|
|
1035
701
|
}
|
|
1036
702
|
}
|
|
1037
703
|
}
|
|
1038
|
-
function collectDuplicateActiveRepositoryWorkspacePaths(images, issues) {
|
|
1039
|
-
const seen = new Set();
|
|
1040
|
-
for (const image of images) {
|
|
1041
|
-
if (!image.active) {
|
|
1042
|
-
continue;
|
|
1043
|
-
}
|
|
1044
|
-
for (const workspace of imageRepositoryWorkspaceConfigs(image)) {
|
|
1045
|
-
const path = workspace.materialization.path;
|
|
1046
|
-
if (!path) {
|
|
1047
|
-
continue;
|
|
1048
|
-
}
|
|
1049
|
-
if (seen.has(path)) {
|
|
1050
|
-
issues.push(`active image repository workspace paths must be unique: ${path}`);
|
|
1051
|
-
}
|
|
1052
|
-
else {
|
|
1053
|
-
seen.add(path);
|
|
1054
|
-
}
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
}
|
|
1058
|
-
function collectDuplicateRepositoryWorkspaceIds(images, issues) {
|
|
1059
|
-
images.forEach((image, imageIndex) => {
|
|
1060
|
-
const seen = new Set();
|
|
1061
|
-
for (const workspace of imageRepositoryWorkspaceConfigs(image)) {
|
|
1062
|
-
const repositoryId = workspace.repository.id;
|
|
1063
|
-
if (seen.has(repositoryId)) {
|
|
1064
|
-
issues.push(`images[${imageIndex}] repository workspace ids must be unique: ${repositoryId}`);
|
|
1065
|
-
}
|
|
1066
|
-
else {
|
|
1067
|
-
seen.add(repositoryId);
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
});
|
|
1071
|
-
}
|
|
1072
|
-
function validateImagePortPolicy(config, issues) {
|
|
1073
|
-
const allocation = resolveProjectRuntimePolicy(config).imagePorts.allocation;
|
|
1074
|
-
config.images.forEach((image, index) => {
|
|
1075
|
-
if (projectMcpStartupMode(image.mcp) === "disabled") {
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
if (allocation === "dynamic-only" && image.mcp.port !== undefined) {
|
|
1079
|
-
issues.push(`images[${index}].mcp.port cannot be used when ` +
|
|
1080
|
-
`runtime.imagePorts.allocation is "dynamic-only"`);
|
|
1081
|
-
}
|
|
1082
|
-
if (allocation === "configured-only" && image.mcp.port === undefined) {
|
|
1083
|
-
issues.push(`images[${index}].mcp.port is required when ` +
|
|
1084
|
-
`runtime.imagePorts.allocation is "configured-only"`);
|
|
1085
|
-
}
|
|
1086
|
-
});
|
|
1087
|
-
}
|
|
1088
704
|
function validatePreparedImageReferences(config, issues) {
|
|
1089
705
|
const preparedImageIds = new Set(config.preparedImages?.map((preparedImage) => preparedImage.id) ?? []);
|
|
1090
706
|
config.images.forEach((image, index) => {
|
|
@@ -1094,28 +710,6 @@ function validatePreparedImageReferences(config, issues) {
|
|
|
1094
710
|
}
|
|
1095
711
|
});
|
|
1096
712
|
}
|
|
1097
|
-
function validateRemoteNodeConfig(config, issues) {
|
|
1098
|
-
const runtime = resolveProjectRuntimePolicy(config);
|
|
1099
|
-
const localNodeId = runtime.nodeId ?? projectConfigId(config);
|
|
1100
|
-
const remoteNodes = runtime.remoteNodes ?? [];
|
|
1101
|
-
collectDuplicates(remoteNodes.map((remoteNode) => remoteNode.id), "remote node ids", issues);
|
|
1102
|
-
remoteNodes.forEach((remoteNode, remoteNodeIndex) => {
|
|
1103
|
-
if (remoteNode.id === localNodeId) {
|
|
1104
|
-
issues.push(`runtime.remoteNodes[${remoteNodeIndex}].id must differ from runtime node id: ${localNodeId}`);
|
|
1105
|
-
}
|
|
1106
|
-
if (remoteNode.parentNodeId === remoteNode.id) {
|
|
1107
|
-
issues.push(`runtime.remoteNodes[${remoteNodeIndex}].parentNodeId must not equal its own id: ${remoteNode.id}`);
|
|
1108
|
-
}
|
|
1109
|
-
else if (remoteNode.parentNodeId !== undefined &&
|
|
1110
|
-
remoteNode.parentNodeId !== localNodeId) {
|
|
1111
|
-
issues.push(`runtime.remoteNodes[${remoteNodeIndex}].parentNodeId must be omitted or match runtime node id ${localNodeId} for flat-tree topology`);
|
|
1112
|
-
}
|
|
1113
|
-
collectDuplicates(remoteNode.workspaces?.map((workspace) => workspace.workspaceId) ?? [], `runtime.remoteNodes[${remoteNodeIndex}].workspaces.workspaceId`, issues);
|
|
1114
|
-
remoteNode.workspaces?.forEach((workspace, workspaceIndex) => {
|
|
1115
|
-
collectDuplicates(workspace.targets?.map((target) => target.targetId) ?? [], `runtime.remoteNodes[${remoteNodeIndex}].workspaces[${workspaceIndex}].targets.targetId`, issues);
|
|
1116
|
-
});
|
|
1117
|
-
});
|
|
1118
|
-
}
|
|
1119
713
|
export function parseProjectConfig(value) {
|
|
1120
714
|
const issues = [];
|
|
1121
715
|
if (!isObject(value)) {
|
|
@@ -1138,11 +732,7 @@ export function parseProjectConfig(value) {
|
|
|
1138
732
|
collectDuplicates(config.preparedImages?.map((preparedImage) => preparedImage.id) ?? [], "prepared image ids", issues);
|
|
1139
733
|
collectDuplicates(config.preparedImages?.map((preparedImage) => preparedImage.imageName) ?? [], "prepared image names", issues);
|
|
1140
734
|
collectDuplicatePorts(config.images, issues);
|
|
1141
|
-
collectDuplicateRepositoryWorkspaceIds(config.images, issues);
|
|
1142
|
-
collectDuplicateActiveRepositoryWorkspacePaths(config.images, issues);
|
|
1143
|
-
validateImagePortPolicy(config, issues);
|
|
1144
735
|
validatePreparedImageReferences(config, issues);
|
|
1145
|
-
validateRemoteNodeConfig(config, issues);
|
|
1146
736
|
if (issues.length > 0) {
|
|
1147
737
|
throw new ProjectConfigError("Invalid Plexus project config", issues);
|
|
1148
738
|
}
|