@enhance-eng/enhance 0.1.21 → 0.1.22
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/main.mjs +2 -2
- package/dist/{mcp-invocation.adapter-NrVhm7y8.mjs → mcp-invocation.adapter-vsj77GBt.mjs} +1 -1
- package/dist/mcp-main.mjs +5 -5
- package/dist/{mutation-key.adapter-x3QOYrKY.mjs → mutation-key.adapter-B3ugNA3r.mjs} +44 -10
- package/dist/remote-mcp-main.mjs +3 -3
- package/package.json +1 -1
package/dist/main.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { $ as createOrganisationOutputSchema, A as parseCanvasReference, At as canvasLayoutPriorityDeclarations, D as assertCanvasReferenceOperations, Dt as canvasAuthoredStyleDeclarations, E as assertCanvasReferenceNodes, Et as canvasAuthoredLayoutValueOf, F as completeScreenOutputSchema, I as createScreenOutputSchema, L as appendRecordingChunkOutputSchema, M as CliError, Mt as canvasSchema, O as canvasReferenceNodeIds, Ot as canvasAxisStyleProperties, P as appErrorSchema, R as completeRecordingOutputSchema, T as canvasEditsSchema, Tt as canvasReadableSceneDocumentSchema, _t as RENDER_MIN_SCALE, a as toExitCode, at as beginCanvasActivityOutputSchema, bt as canvasWorldBoundsSchema, c as toSharedCapabilities, ct as getCanvasDocumentOutputSchema, d as createCapabilityCatalogAdapter, et as emptyFixtureDocument, f as createRouterShapeAdapter, g as PROCEDURE_DESCRIPTIONS, h as OPTION_DESCRIPTIONS, i as toCanvasAuthoringResult, it as canvasTextRunsOf, j as PartialBatchError, k as fromCanvasReference, kt as canvasLayoutMainAxisOf, l as createMcpCapabilityDiscoveryAdapter, lt as saveCanvasDocumentOutputSchema, n as withCommandName, o as toFailurePayload, ot as canvasAgentActivityPhaseSchema, p as createCapabilityPolicyAdapter, pt as canvasOperationSchema, t as withCommandInFailure, tt as withFixtureScreen, u as ProcessExitError, ut as MAX_CANVAS_OPERATIONS, z as startRecordingOutputSchema } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
-
import { a as createOauthLoopbackAdapter, c as createWriteHtmlCanvasComposite, d as createApplyCanvasComposite, f as createCanvasActivityComposite, l as createEditCanvasComposite, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, p as createRenderCanvasComposite, r as CLI_CONFIG, s as createRenderFileAdapter, t as createMutationKeyAdapter, u as sceneAtVersion } from "./mutation-key.adapter-
|
|
3
|
+
import { a as createOauthLoopbackAdapter, c as createWriteHtmlCanvasComposite, d as createApplyCanvasComposite, f as createCanvasActivityComposite, l as createEditCanvasComposite, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, p as createRenderCanvasComposite, r as CLI_CONFIG, s as createRenderFileAdapter, t as createMutationKeyAdapter, u as sceneAtVersion } from "./mutation-key.adapter-B3ugNA3r.mjs";
|
|
4
4
|
import { t as toCapabilityInventory } from "./capability-inventory.mapper-DyYXyVBJ.mjs";
|
|
5
5
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-rI5HpMEo.mjs";
|
|
6
6
|
import { Command } from "commander";
|
|
@@ -2321,7 +2321,7 @@ const main = async () => {
|
|
|
2321
2321
|
const credentials = createFileCredentialAdapter(CLI_CONFIG.configDirectory);
|
|
2322
2322
|
const mutationKey = createMutationKeyAdapter();
|
|
2323
2323
|
const cli = createCliProgram({
|
|
2324
|
-
version: "0.1.
|
|
2324
|
+
version: "0.1.22",
|
|
2325
2325
|
credentials,
|
|
2326
2326
|
remote: createHttpRemoteAdapter(CLI_CONFIG.apiUrl, credentials, mutationKey),
|
|
2327
2327
|
mutationKey,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { o as toFailurePayload } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
-
import { a as createOauthLoopbackAdapter, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-
|
|
3
|
+
import { a as createOauthLoopbackAdapter, m as createAuthUseCase, n as createHttpRemoteAdapter, o as createCapabilityInvocationAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-B3ugNA3r.mjs";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
|
|
6
6
|
//#region src/infrastructure/mcp-auth.adapter.ts
|
package/dist/mcp-main.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { d as createCapabilityCatalogAdapter, m as toCapabilityDefinition } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
-
import { r as CLI_CONFIG } from "./mutation-key.adapter-
|
|
3
|
+
import { r as CLI_CONFIG } from "./mutation-key.adapter-B3ugNA3r.mjs";
|
|
4
4
|
import { t as createFileCredentialAdapter } from "./file-credential.adapter-rI5HpMEo.mjs";
|
|
5
|
-
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
5
|
+
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-vsj77GBt.mjs";
|
|
6
6
|
import { t as createMcpServerAdapter } from "./mcp-server.adapter-Cgp05gfi.mjs";
|
|
7
7
|
import { z } from "zod";
|
|
8
8
|
import process from "node:process";
|
|
@@ -152,7 +152,7 @@ const capabilities = [
|
|
|
152
152
|
exampleInput: {},
|
|
153
153
|
exampleOutput: {
|
|
154
154
|
status: "ok",
|
|
155
|
-
runtimeVersion: "0.1.
|
|
155
|
+
runtimeVersion: "0.1.22",
|
|
156
156
|
api: {
|
|
157
157
|
reachable: true,
|
|
158
158
|
status: 200
|
|
@@ -167,10 +167,10 @@ const createMcpTransportCapabilityAdapter = () => capabilities;
|
|
|
167
167
|
//#endregion
|
|
168
168
|
//#region src/mcp-main.ts
|
|
169
169
|
const credentials = createFileCredentialAdapter(CLI_CONFIG.configDirectory);
|
|
170
|
-
const invocation = createMcpInvocationAdapter(CLI_CONFIG.apiUrl, credentials, CLI_CONFIG.configDirectory, "0.1.
|
|
170
|
+
const invocation = createMcpInvocationAdapter(CLI_CONFIG.apiUrl, credentials, CLI_CONFIG.configDirectory, "0.1.22");
|
|
171
171
|
const catalog = [...createCapabilityCatalogAdapter(), ...createMcpTransportCapabilityAdapter()];
|
|
172
172
|
serveStdio(() => createMcpServerAdapter({
|
|
173
|
-
version: "0.1.
|
|
173
|
+
version: "0.1.22",
|
|
174
174
|
name: CLI_CONFIG.mcpServiceName,
|
|
175
175
|
commandName: CLI_CONFIG.commandName,
|
|
176
176
|
invocation,
|
|
@@ -8,7 +8,7 @@ import { chmodSync, createReadStream, createWriteStream, mkdirSync, writeFileSyn
|
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { createHash, randomBytes, randomUUID } from "node:crypto";
|
|
10
10
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
11
|
-
import { mkdtemp, realpath, rm, stat } from "node:fs/promises";
|
|
11
|
+
import { mkdtemp, readFile, realpath, rm, stat } from "node:fs/promises";
|
|
12
12
|
import { Readable, Transform } from "node:stream";
|
|
13
13
|
import { pipeline } from "node:stream/promises";
|
|
14
14
|
import { ZipFile } from "yazl";
|
|
@@ -1431,6 +1431,8 @@ const createSnapshotRecordingComposite = (remote, progress) => ({ execute: async
|
|
|
1431
1431
|
const NORMALIZED_MTIME = /* @__PURE__ */ new Date("1980-01-01T00:00:00.000Z");
|
|
1432
1432
|
const REGULAR_FILE_MODE = 33188;
|
|
1433
1433
|
const ZIP64_ENTRY_FLOOR = 65535;
|
|
1434
|
+
const SMALL_FILE_BYTES = 128;
|
|
1435
|
+
const READ_BATCH_SIZE = 32;
|
|
1434
1436
|
const badRequest$1 = (message, remediation) => new CliError("BAD_REQUEST", message, remediation);
|
|
1435
1437
|
const hashingTransform = (source, completed) => {
|
|
1436
1438
|
const hash = createHash("sha256");
|
|
@@ -1476,6 +1478,41 @@ const addManifest = (input) => {
|
|
|
1476
1478
|
});
|
|
1477
1479
|
return manifest;
|
|
1478
1480
|
};
|
|
1481
|
+
const addPrototypeFile = (zip, input, complete) => {
|
|
1482
|
+
const { source, content } = input;
|
|
1483
|
+
const options = {
|
|
1484
|
+
mtime: NORMALIZED_MTIME,
|
|
1485
|
+
mode: REGULAR_FILE_MODE,
|
|
1486
|
+
compress: content === null,
|
|
1487
|
+
forceDosTimestamp: true
|
|
1488
|
+
};
|
|
1489
|
+
if (content === null) {
|
|
1490
|
+
zip.addReadStreamLazy(source.path, {
|
|
1491
|
+
...options,
|
|
1492
|
+
size: source.bytes
|
|
1493
|
+
}, (callback) => {
|
|
1494
|
+
callback(null, createReadStream(source.absolutePath).pipe(hashingTransform(source, complete)));
|
|
1495
|
+
});
|
|
1496
|
+
return;
|
|
1497
|
+
}
|
|
1498
|
+
if (content.byteLength !== source.bytes) throw new Error(`prototype file ${source.path} changed while it was packaged`);
|
|
1499
|
+
zip.addBuffer(content, source.path, options);
|
|
1500
|
+
complete({
|
|
1501
|
+
path: source.path,
|
|
1502
|
+
contentType: source.contentType,
|
|
1503
|
+
bytes: content.byteLength,
|
|
1504
|
+
sha256: createHash("sha256").update(content).digest("hex")
|
|
1505
|
+
});
|
|
1506
|
+
};
|
|
1507
|
+
const addPrototypeFiles = async (zip, files, complete) => {
|
|
1508
|
+
for (let offset = 0; offset < files.length; offset += READ_BATCH_SIZE) {
|
|
1509
|
+
const batch = await Promise.all(files.slice(offset, offset + READ_BATCH_SIZE).map(async (source) => ({
|
|
1510
|
+
source,
|
|
1511
|
+
content: source.bytes <= SMALL_FILE_BYTES ? await readFile(source.absolutePath) : null
|
|
1512
|
+
})));
|
|
1513
|
+
for (const input of batch) addPrototypeFile(zip, input, complete);
|
|
1514
|
+
}
|
|
1515
|
+
};
|
|
1479
1516
|
const createPrototypeZipAdapter = async (input) => {
|
|
1480
1517
|
const zip = new ZipFile();
|
|
1481
1518
|
const hash = createHash("sha256");
|
|
@@ -1495,15 +1532,12 @@ const createPrototypeZipAdapter = async (input) => {
|
|
|
1495
1532
|
...input
|
|
1496
1533
|
});
|
|
1497
1534
|
};
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
}, (callback) => {
|
|
1505
|
-
callback(null, createReadStream(source.absolutePath).pipe(hashingTransform(source, complete)));
|
|
1506
|
-
});
|
|
1535
|
+
try {
|
|
1536
|
+
await addPrototypeFiles(zip, input.files, complete);
|
|
1537
|
+
} catch (error) {
|
|
1538
|
+
hashing.destroy(error instanceof Error ? error : /* @__PURE__ */ new Error("prototype ZIP failed"));
|
|
1539
|
+
await output;
|
|
1540
|
+
}
|
|
1507
1541
|
await output;
|
|
1508
1542
|
if (packaged.manifest === null) throw new Error("prototype ZIP completed without a manifest");
|
|
1509
1543
|
const artifactStats = await stat(input.artifactPath);
|
package/dist/remote-mcp-main.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { X as MCP_AUTH_SCOPE, Y as getMeOutputSchema, d as createCapabilityCatalogAdapter } from "./cli-output-identity.lib-a1wTreJ6.mjs";
|
|
3
|
-
import { i as readRemoteMcpEnvironment, n as createHttpRemoteAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-
|
|
4
|
-
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-
|
|
3
|
+
import { i as readRemoteMcpEnvironment, n as createHttpRemoteAdapter, t as createMutationKeyAdapter } from "./mutation-key.adapter-B3ugNA3r.mjs";
|
|
4
|
+
import { t as createMcpInvocationAdapter } from "./mcp-invocation.adapter-vsj77GBt.mjs";
|
|
5
5
|
import { t as createMcpServerAdapter } from "./mcp-server.adapter-Cgp05gfi.mjs";
|
|
6
6
|
import os from "node:os";
|
|
7
7
|
import process from "node:process";
|
|
@@ -145,7 +145,7 @@ const server = await createRemoteMcpHttpAdapter({
|
|
|
145
145
|
configDirectory: path.join(os.tmpdir(), "enhance-remote-mcp"),
|
|
146
146
|
allowedHosts: config.MCP_ALLOWED_HOSTS.split(",").map((value) => value.trim()),
|
|
147
147
|
allowedOrigins: config.MCP_ALLOWED_ORIGINS.split(",").map((value) => value.trim()),
|
|
148
|
-
version: "0.1.
|
|
148
|
+
version: "0.1.22",
|
|
149
149
|
onerror: (error) => process.stderr.write(`${error.message}\n`)
|
|
150
150
|
});
|
|
151
151
|
await server.listen(config.PORT, config.MCP_HOST);
|