@tempad-dev/mcp 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{acquire-TEiVy85j.mjs → acquire-BtKFZ9Lz.mjs} +1 -1
- package/dist/{acquire-DkkzoJ5Z.mjs → acquire-DHwsqq0j.mjs} +6 -7
- package/dist/{acquire-DkkzoJ5Z.mjs.map → acquire-DHwsqq0j.mjs.map} +1 -1
- package/dist/{bootstrap-Cz9cxf6f.mjs → bootstrap-B9-RyWlM.mjs} +14 -15
- package/dist/{bootstrap-Cz9cxf6f.mjs.map → bootstrap-B9-RyWlM.mjs.map} +1 -1
- package/dist/cli.mjs +12 -13
- package/dist/cli.mjs.map +1 -1
- package/dist/{client-binding-CuHY1-__.mjs → client-binding-CvSSv9JC.mjs} +4 -5
- package/dist/{client-binding-CuHY1-__.mjs.map → client-binding-CvSSv9JC.mjs.map} +1 -1
- package/dist/{cold-start-DnlXxs4o.mjs → cold-start-DOy9JsIQ.mjs} +11 -12
- package/dist/{cold-start-DnlXxs4o.mjs.map → cold-start-DOy9JsIQ.mjs.map} +1 -1
- package/dist/{cold-start-r07QQPSK.mjs → cold-start-U3cW0q9T.mjs} +1 -1
- package/dist/{config-CM4LsvW5.mjs → config-Busa_Dqv.mjs} +42 -31
- package/dist/config-Busa_Dqv.mjs.map +1 -0
- package/dist/{design-task-store-C9DJ_EQq.mjs → design-task-store-BHR54v8-.mjs} +8 -10
- package/dist/{design-task-store-C9DJ_EQq.mjs.map → design-task-store-BHR54v8-.mjs.map} +1 -1
- package/dist/{durable-json-dsqpwT93.mjs → durable-json-_WKesGDj.mjs} +2 -3
- package/dist/{durable-json-dsqpwT93.mjs.map → durable-json-_WKesGDj.mjs.map} +1 -1
- package/dist/{edge-DBOKhsN4.mjs → edge-BUf7gs4J.mjs} +14 -15
- package/dist/{edge-DBOKhsN4.mjs.map → edge-BUf7gs4J.mjs.map} +1 -1
- package/dist/{edge-C5SyBEy3.mjs → edge-CHzaTUFt.mjs} +1 -1
- package/dist/{hook-receipts-DcO9rRhi.mjs → hook-receipts-QJU3AMoY.mjs} +4 -5
- package/dist/{hook-receipts-DcO9rRhi.mjs.map → hook-receipts-QJU3AMoY.mjs.map} +1 -1
- package/dist/{host-context-CRMK5AI5.mjs → host-context-9TVtjsSm.mjs} +3 -4
- package/dist/{host-context-CRMK5AI5.mjs.map → host-context-9TVtjsSm.mjs.map} +1 -1
- package/dist/{hub-control-591ZGr_p.mjs → hub-control-UlA4Fncg.mjs} +7 -9
- package/dist/{hub-control-591ZGr_p.mjs.map → hub-control-UlA4Fncg.mjs.map} +1 -1
- package/dist/{hub-runtime-_GWa0RDc.mjs → hub-runtime-DjdqIgGl.mjs} +1 -1
- package/dist/{hub-runtime-j_CZJnWz.mjs → hub-runtime-DsEO9zvX.mjs} +130 -150
- package/dist/hub-runtime-DsEO9zvX.mjs.map +1 -0
- package/dist/hub.mjs +3 -4
- package/dist/{identity-BgzOQE2L.mjs → identity-CCaDEwgc.mjs} +4 -5
- package/dist/{identity-BgzOQE2L.mjs.map → identity-CCaDEwgc.mjs.map} +1 -1
- package/dist/{indexes-CCA-CTcL.mjs → indexes-zYqwqnU6.mjs} +10 -12
- package/dist/{indexes-CCA-CTcL.mjs.map → indexes-zYqwqnU6.mjs.map} +1 -1
- package/dist/log-transport.mjs +234 -143
- package/dist/log-transport.mjs.map +1 -1
- package/dist/managed-runtime.mjs +15 -17
- package/dist/managed-runtime.mjs.map +1 -1
- package/dist/{on-exit-leak-free-BvimJ0rP.mjs → on-exit-leak-free-By20-eFK.mjs} +6 -8
- package/dist/{on-exit-leak-free-BvimJ0rP.mjs.map → on-exit-leak-free-By20-eFK.mjs.map} +1 -1
- package/dist/{pino-CLoB7tK6.mjs → pino-BiEyUxFF.mjs} +56 -82
- package/dist/pino-BiEyUxFF.mjs.map +1 -0
- package/dist/{pino-abstract-transport-B0ISte63.mjs → pino-abstract-transport-BBwCGDga.mjs} +4 -6
- package/dist/{pino-abstract-transport-B0ISte63.mjs.map → pino-abstract-transport-BBwCGDga.mjs.map} +1 -1
- package/dist/pino-file.mjs +3 -4
- package/dist/pino-worker.mjs +6 -8
- package/dist/pino-worker.mjs.map +1 -1
- package/dist/{probe-B6KQJxXU.mjs → probe-BeWkMbzQ.mjs} +40 -55
- package/dist/probe-BeWkMbzQ.mjs.map +1 -0
- package/dist/{process-environment-DJDtCcdv.mjs → process-environment-DRRIdoL8.mjs} +2 -3
- package/dist/{process-environment-DJDtCcdv.mjs.map → process-environment-DRRIdoL8.mjs.map} +1 -1
- package/dist/{processes-CQvuh1Sl.mjs → processes-BCCE8As7.mjs} +17 -23
- package/dist/{processes-CQvuh1Sl.mjs.map → processes-BCCE8As7.mjs.map} +1 -1
- package/dist/{processes-n0G2xAWb.mjs → processes-CBoalzSk.mjs} +1 -1
- package/dist/{proper-lockfile-CisPoFAZ.mjs → proper-lockfile-BgKrOq5D.mjs} +19 -32
- package/dist/{proper-lockfile-CisPoFAZ.mjs.map → proper-lockfile-BgKrOq5D.mjs.map} +1 -1
- package/dist/{protocol-DNswG6F2.mjs → protocol-7m-E_iFu.mjs} +57 -108
- package/dist/protocol-7m-E_iFu.mjs.map +1 -0
- package/dist/{protocol-0jvK718o.mjs → protocol-COK3rM6m.mjs} +1 -1
- package/dist/{rolldown-runtime-CLlik3RS.mjs → rolldown-runtime-BH1-_iVd.mjs} +2 -3
- package/dist/{runtime-identity-BiWIlGgw.mjs → runtime-identity-D9V-g5M-.mjs} +2 -3
- package/dist/{runtime-identity-BiWIlGgw.mjs.map → runtime-identity-D9V-g5M-.mjs.map} +1 -1
- package/dist/runtime-installer.mjs +4 -5
- package/dist/runtime-manifest.json +107 -107
- package/dist/{runtime-platform-EULgJm_w.mjs → runtime-platform-C-Yk9F3L.mjs} +2 -3
- package/dist/{runtime-platform-EULgJm_w.mjs.map → runtime-platform-C-Yk9F3L.mjs.map} +1 -1
- package/dist/{runtime-recovery-Dq3hD3IT.mjs → runtime-recovery-DAYSaVV2.mjs} +1 -1
- package/dist/{runtime-recovery-DpqftTl9.mjs → runtime-recovery-DaRaQ8qY.mjs} +5 -6
- package/dist/{runtime-recovery-DpqftTl9.mjs.map → runtime-recovery-DaRaQ8qY.mjs.map} +1 -1
- package/dist/runtime-verification.mjs +6 -6
- package/dist/{schemas-BgOH6OcJ.mjs → schemas-ZDdPV7RQ.mjs} +23 -39
- package/dist/schemas-ZDdPV7RQ.mjs.map +1 -0
- package/dist/{server-C-tcoOT7.mjs → server-CsCpY0Ft.mjs} +645 -287
- package/dist/server-CsCpY0Ft.mjs.map +1 -0
- package/dist/{shared--CO_WPTx.mjs → shared--othnF1c.mjs} +16 -21
- package/dist/{shared--CO_WPTx.mjs.map → shared--othnF1c.mjs.map} +1 -1
- package/dist/{state-3mPLv7lh.mjs → shared-S0dtOYq8.mjs} +1 -1
- package/dist/{src-BGNQgTr6.mjs → src-BSnzZMvK.mjs} +3 -4
- package/dist/{src-BGNQgTr6.mjs.map → src-BSnzZMvK.mjs.map} +1 -1
- package/dist/{stable-edge-DQmYi4Mf.mjs → stable-edge-VAAxSYSS.mjs} +10 -14
- package/dist/stable-edge-VAAxSYSS.mjs.map +1 -0
- package/dist/{startup-log-iSoBU74r.mjs → startup-log-CYlFgdy5.mjs} +3 -4
- package/dist/{startup-log-iSoBU74r.mjs.map → startup-log-CYlFgdy5.mjs.map} +1 -1
- package/dist/{startup-log-C4DVL-6M.mjs → startup-log-DqK2uwBd.mjs} +1 -1
- package/dist/{state-CnkSwi5E.mjs → state-6qFcvi-I.mjs} +5 -6
- package/dist/{state-CnkSwi5E.mjs.map → state-6qFcvi-I.mjs.map} +1 -1
- package/dist/{shared-B8lb63iG.mjs → state-BrWBtYNG.mjs} +1 -1
- package/dist/{stdio-CZb1NNIa.mjs → stdio-20SBFdww.mjs} +3 -4
- package/dist/{stdio-CZb1NNIa.mjs.map → stdio-20SBFdww.mjs.map} +1 -1
- package/dist/{supervisor-B9lkK4ey.mjs → supervisor-CesT-H5_.mjs} +23 -27
- package/dist/{supervisor-B9lkK4ey.mjs.map → supervisor-CesT-H5_.mjs.map} +1 -1
- package/dist/{task-storage-recovery-_JdAWD5X.mjs → task-storage-recovery-I9lpYYX6.mjs} +6 -7
- package/dist/{task-storage-recovery-_JdAWD5X.mjs.map → task-storage-recovery-I9lpYYX6.mjs.map} +1 -1
- package/dist/thread-stream-worker.mjs +5 -6
- package/dist/thread-stream-worker.mjs.map +1 -1
- package/dist/{types-BEqvvpHh.mjs → types-C8GH0osr.mjs} +1 -1
- package/dist/{types-gJ5HkL66.mjs → types-kNTSQOnR.mjs} +4 -6
- package/dist/{types-gJ5HkL66.mjs.map → types-kNTSQOnR.mjs.map} +1 -1
- package/package.json +1 -1
- package/dist/config-CM4LsvW5.mjs.map +0 -1
- package/dist/hub-runtime-j_CZJnWz.mjs.map +0 -1
- package/dist/pino-CLoB7tK6.mjs.map +0 -1
- package/dist/probe-B6KQJxXU.mjs.map +0 -1
- package/dist/protocol-DNswG6F2.mjs.map +0 -1
- package/dist/schemas-BgOH6OcJ.mjs.map +0 -1
- package/dist/server-C-tcoOT7.mjs.map +0 -1
- package/dist/stable-edge-DQmYi4Mf.mjs.map +0 -1
|
@@ -4,26 +4,26 @@ globalThis.__bundlerPathsOverrides = {
|
|
|
4
4
|
'pino-worker': runtimeFilePath(new URL('./pino-worker.mjs', import.meta.url)),
|
|
5
5
|
'pino/file': runtimeFilePath(new URL('./pino-file.mjs', import.meta.url))
|
|
6
6
|
};
|
|
7
|
-
import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-
|
|
8
|
-
import { t as
|
|
9
|
-
import {
|
|
10
|
-
import { Bn as assertCompleteRequestResourceTemplate, F as ErrorCode, L as GetPromptRequestSchema, Vt as ReadResourceRequestSchema, ct as ListResourcesRequestSchema, g as CompleteRequestSchema, it as ListPromptsRequestSchema, mt as ListToolsRequestSchema, ot as ListResourceTemplatesRequestSchema, s as CallToolRequestSchema, yt as McpError, zn as assertCompleteRequestPrompt } from "./types-
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import { t as
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { t as
|
|
20
|
-
import { i as
|
|
21
|
-
import {
|
|
22
|
-
import { t as DesignTaskStore } from "./design-task-store-
|
|
23
|
-
import { a as removeHubRuntimeIdentityIfOwned, n as getExtensionRuntimeIssues, o as writeHubRuntimeIdentity, t as createHubRuntimeIdentity } from "./runtime-identity-
|
|
24
|
-
import { o as listenPrivate } from "./processes-
|
|
25
|
-
import { d as writeEndpoints, o as readEndpoints } from "./state-
|
|
26
|
-
import { n as attachRuntimeRecovery, t as RECOVERY_METHODS } from "./runtime-recovery-
|
|
7
|
+
import { i as __toESM, r as __require, t as __commonJSMin } from "./rolldown-runtime-BH1-_iVd.mjs";
|
|
8
|
+
import { t as Server } from "./server-CsCpY0Ft.mjs";
|
|
9
|
+
import { C as getSchemaDescription, E as objectFromShape, O as safeParseAsync, S as getParseErrorMessage, T as normalizeObjectSchema, a as IdSchema, b as getLiteralValue, d as RuntimeDataTransport, f as SocketTransport, g as ConsumerTransport, h as unavailable, w as isSchemaOptional, x as getObjectShape, y as toJsonSchemaCompat } from "./protocol-7m-E_iFu.mjs";
|
|
10
|
+
import { Bn as assertCompleteRequestResourceTemplate, F as ErrorCode, L as GetPromptRequestSchema, Vt as ReadResourceRequestSchema, ct as ListResourcesRequestSchema, g as CompleteRequestSchema, it as ListPromptsRequestSchema, mt as ListToolsRequestSchema, ot as ListResourceTemplatesRequestSchema, s as CallToolRequestSchema, yt as McpError, zn as assertCompleteRequestPrompt } from "./types-kNTSQOnR.mjs";
|
|
11
|
+
import { m as object$3, n as ZodOptional, o as array } from "./schemas-ZDdPV7RQ.mjs";
|
|
12
|
+
import { r as deserializeMessage } from "./stdio-20SBFdww.mjs";
|
|
13
|
+
import { A as TEMPAD_MCP_ERROR_CODES, B as RESUMABLE_DESIGN_TASK_STATUSES, C as measureCallToolResultBytes, E as MessageFromExtensionSchema, F as DesignTaskIdSchema, G as MCP_NODE_READ_BATCH_WORK_BUDGET_MS, H as formatDesignFeedback, I as DesignTaskSchema, J as TEMPAD_MCP_BRIDGE_SUPPORTED_PROTOCOL_VERSIONS, K as MCP_TOOL_INLINE_BUDGET_BYTES, L as FigmaSessionSchema, O as sameRuntimeProfile, P as DesignAnchorSchema, S as buildUploadAssetToolResult, T as LegacyMessageFromExtensionSchema, V as SetDesignAnchorParametersSchema, W as MCP_MAX_ASSET_BYTES, _ as buildApplyCanvasToolResult, a as ClientHookRequestSchema, b as buildGetScreenshotToolResult, c as GetDesignSystemResultSchema, d as UploadAssetParametersSchema, f as UploadAssetResultSchema, h as CanvasPageSnapshotSchema, i as ClientHookParamsSchema, j as AGENT_CLIENTS, k as LegacyToolCallPayloadSchema, l as GetScreenshotParametersSchema, m as ApplyCanvasResultSchema, o as GetCodeParametersSchema, p as ApplyCanvasParametersSchema, q as TEMPAD_MCP_BRIDGE_SUBPROTOCOL, s as GetDesignSystemParametersSchema, t as getMcpServerConfig, u as GetStructureParametersSchema, v as buildGetCodeToolResult, w as utf8Bytes, x as buildGetStructureToolResult, y as buildGetDesignSystemToolResult, z as ManageDesignTaskParametersSchema } from "./config-Busa_Dqv.mjs";
|
|
14
|
+
import { t as require_proper_lockfile } from "./proper-lockfile-BgKrOq5D.mjs";
|
|
15
|
+
import { t as hostEnvironment } from "./process-environment-DRRIdoL8.mjs";
|
|
16
|
+
import { a as codexConversationKey, c as hostConversationKey, l as requireHostContext, n as HostContextSchema, o as codexStoreKey, r as MISSING_HOST_CONTEXT_MESSAGE, s as hostContextKey, t as HostContextNotificationSchema } from "./host-context-9TVtjsSm.mjs";
|
|
17
|
+
import { i as ClientHooks, n as HubControl } from "./hub-control-UlA4Fncg.mjs";
|
|
18
|
+
import { n as bindRequestMetadata, r as clientDescriptor, t as ClientEventSchema } from "./identity-CCaDEwgc.mjs";
|
|
19
|
+
import { a as LEGACY_HOOK_EXHAUSTED_RESULT, c as hookPressureCutoff, d as isExpiredHookResult, l as hookRetentionCutoff, n as ExpiredHookError, o as LegacyHookCapacityError, s as hookCutoff, t as EXPIRED_HOOK_RESULT, u as hookSignature } from "./hook-receipts-QJU3AMoY.mjs";
|
|
20
|
+
import { a as HUB_RUNTIME_IDENTITY_PATH, b as resolveStateDir, c as PACKAGE_VERSION, d as SOCK_PATH, g as log, h as getRecordProperty, i as HUB_LOCK_UPDATE_MS, l as RUNTIME_DIR, m as ensureFile, n as HUB_LOCK_PATH, p as ensureDir, r as HUB_LOCK_STALE_MS, t as ASSET_DIR, u as RUNTIME_PROFILE, x as assertTrustedSocket } from "./shared--othnF1c.mjs";
|
|
21
|
+
import { n as ClientBindingSubscribeSchema, r as ClientBindingUpdateSchema } from "./client-binding-CvSSv9JC.mjs";
|
|
22
|
+
import { t as DesignTaskStore } from "./design-task-store-BHR54v8-.mjs";
|
|
23
|
+
import { a as removeHubRuntimeIdentityIfOwned, n as getExtensionRuntimeIssues, o as writeHubRuntimeIdentity, t as createHubRuntimeIdentity } from "./runtime-identity-D9V-g5M-.mjs";
|
|
24
|
+
import { o as listenPrivate } from "./processes-BCCE8As7.mjs";
|
|
25
|
+
import { d as writeEndpoints, o as readEndpoints } from "./state-6qFcvi-I.mjs";
|
|
26
|
+
import { n as attachRuntimeRecovery, t as RECOVERY_METHODS } from "./runtime-recovery-DaRaQ8qY.mjs";
|
|
27
27
|
import { execFile, spawn } from "node:child_process";
|
|
28
28
|
import { connect, createServer } from "node:net";
|
|
29
29
|
import { dirname, join } from "node:path";
|
|
@@ -36,7 +36,7 @@ import { lstat, mkdir, opendir, readFile, rename, stat, unlink, writeFile } from
|
|
|
36
36
|
import { setTimeout as setTimeout$1 } from "node:timers/promises";
|
|
37
37
|
import { createInterface } from "node:readline";
|
|
38
38
|
import { createServer as createServer$1 } from "node:http";
|
|
39
|
-
|
|
39
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js
|
|
40
40
|
const COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
|
|
41
41
|
/**
|
|
42
42
|
* Checks if a schema is completable (has completion metadata).
|
|
@@ -54,8 +54,7 @@ var McpZodTypeKind;
|
|
|
54
54
|
(function(McpZodTypeKind) {
|
|
55
55
|
McpZodTypeKind["Completable"] = "McpCompletable";
|
|
56
56
|
})(McpZodTypeKind || (McpZodTypeKind = {}));
|
|
57
|
-
|
|
58
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
57
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js
|
|
59
58
|
/**
|
|
60
59
|
* Tool name validation utilities according to SEP: Specify Format for Tool Names
|
|
61
60
|
*
|
|
@@ -125,8 +124,7 @@ function validateAndWarnToolName(name) {
|
|
|
125
124
|
issueToolNameWarning(name, result.warnings);
|
|
126
125
|
return result.isValid;
|
|
127
126
|
}
|
|
128
|
-
|
|
129
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
127
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js
|
|
130
128
|
/**
|
|
131
129
|
* Experimental McpServer task features for MCP SDK.
|
|
132
130
|
* WARNING: These APIs are experimental and may change without notice.
|
|
@@ -156,8 +154,7 @@ var ExperimentalMcpServerTasks = class {
|
|
|
156
154
|
return this._mcpServer._createRegisteredTool(name, config.title, config.description, config.inputSchema, config.outputSchema, config.annotations, execution, config._meta, handler);
|
|
157
155
|
}
|
|
158
156
|
};
|
|
159
|
-
|
|
160
|
-
//#region ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.1_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
157
|
+
// ../../node_modules/.pnpm/@modelcontextprotocol+sdk@1.32.2_supports-color@7.2.0_zod@4.6.7/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js
|
|
161
158
|
function toolInputElementCount(value, max) {
|
|
162
159
|
let count = 0;
|
|
163
160
|
const stack = [value];
|
|
@@ -178,7 +175,7 @@ function toolInputElementCount(value, max) {
|
|
|
178
175
|
return count;
|
|
179
176
|
}
|
|
180
177
|
function resolveMaxToolInputElements(value) {
|
|
181
|
-
if (value === void 0 || value ===
|
|
178
|
+
if (value === void 0 || value === 1e400) return void 0;
|
|
182
179
|
if (typeof value !== "number" || Number.isNaN(value) || value < 1) throw new RangeError(`maxToolInputElements must be a number of at least 1, or Infinity, got ${String(value)}`);
|
|
183
180
|
return value;
|
|
184
181
|
}
|
|
@@ -199,6 +196,9 @@ var McpServer = class {
|
|
|
199
196
|
this._promptHandlersInitialized = false;
|
|
200
197
|
this.server = new Server(serverInfo, options);
|
|
201
198
|
this._maxToolInputElements = resolveMaxToolInputElements(options?.maxToolInputElements);
|
|
199
|
+
if (options?.capabilities?.tools) this.setToolRequestHandlers();
|
|
200
|
+
if (options?.capabilities?.resources) this.setResourceRequestHandlers();
|
|
201
|
+
if (options?.capabilities?.prompts) this.setPromptRequestHandlers();
|
|
202
202
|
}
|
|
203
203
|
/**
|
|
204
204
|
* Access experimental features.
|
|
@@ -814,8 +814,7 @@ const EMPTY_COMPLETION_RESULT = { completion: {
|
|
|
814
814
|
values: [],
|
|
815
815
|
hasMore: false
|
|
816
816
|
} };
|
|
817
|
-
|
|
818
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/constants.js
|
|
817
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/constants.js
|
|
819
818
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
820
819
|
const BINARY_TYPES = [
|
|
821
820
|
"nodebuffer",
|
|
@@ -837,9 +836,9 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
837
836
|
NOOP: () => {}
|
|
838
837
|
};
|
|
839
838
|
}));
|
|
840
|
-
|
|
841
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/buffer-util.js
|
|
839
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/buffer-util.js
|
|
842
840
|
var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
841
|
+
const { websocketMask, websocketUnmask } = __require("http");
|
|
843
842
|
const { EMPTY_BUFFER } = require_constants();
|
|
844
843
|
const FastBuffer = Buffer[Symbol.species];
|
|
845
844
|
/**
|
|
@@ -924,8 +923,16 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
924
923
|
toBuffer,
|
|
925
924
|
unmask: _unmask
|
|
926
925
|
};
|
|
927
|
-
|
|
928
|
-
|
|
926
|
+
if (websocketMask) {
|
|
927
|
+
module.exports.mask = function(source, mask, output, offset, length) {
|
|
928
|
+
if (length < 24) _mask(source, mask, output, offset, length);
|
|
929
|
+
else websocketMask(source, mask, output, offset, length);
|
|
930
|
+
};
|
|
931
|
+
module.exports.unmask = function(buffer, mask) {
|
|
932
|
+
if (buffer.length < 24) _unmask(buffer, mask);
|
|
933
|
+
else websocketUnmask(buffer, mask);
|
|
934
|
+
};
|
|
935
|
+
} else if (!process.env.WS_NO_BUFFER_UTIL) try {
|
|
929
936
|
const bufferUtil = __require("bufferutil");
|
|
930
937
|
module.exports.mask = function(source, mask, output, offset, length) {
|
|
931
938
|
if (length < 48) _mask(source, mask, output, offset, length);
|
|
@@ -937,8 +944,7 @@ var require_buffer_util = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
937
944
|
};
|
|
938
945
|
} catch (e) {}
|
|
939
946
|
}));
|
|
940
|
-
|
|
941
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/limiter.js
|
|
947
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/limiter.js
|
|
942
948
|
var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
943
949
|
const kDone = Symbol("kDone");
|
|
944
950
|
const kRun = Symbol("kRun");
|
|
@@ -958,7 +964,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
958
964
|
this.pending--;
|
|
959
965
|
this[kRun]();
|
|
960
966
|
};
|
|
961
|
-
this.concurrency = concurrency ||
|
|
967
|
+
this.concurrency = concurrency || 1e400;
|
|
962
968
|
this.jobs = [];
|
|
963
969
|
this.pending = 0;
|
|
964
970
|
}
|
|
@@ -988,8 +994,7 @@ var require_limiter = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
988
994
|
};
|
|
989
995
|
module.exports = Limiter;
|
|
990
996
|
}));
|
|
991
|
-
|
|
992
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/permessage-deflate.js
|
|
997
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/permessage-deflate.js
|
|
993
998
|
var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
994
999
|
const zlib = __require("zlib");
|
|
995
1000
|
const bufferUtil = require_buffer_util();
|
|
@@ -1324,8 +1329,7 @@ var require_permessage_deflate = /* @__PURE__ */ __commonJSMin(((exports, module
|
|
|
1324
1329
|
this[kCallback](err);
|
|
1325
1330
|
}
|
|
1326
1331
|
}));
|
|
1327
|
-
|
|
1328
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/validation.js
|
|
1332
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/validation.js
|
|
1329
1333
|
var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1330
1334
|
const { isUtf8 } = __require("buffer");
|
|
1331
1335
|
const { hasBlob } = require_constants();
|
|
@@ -1520,10 +1524,9 @@ var require_validation = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1520
1524
|
};
|
|
1521
1525
|
} catch (e) {}
|
|
1522
1526
|
}));
|
|
1523
|
-
|
|
1524
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/receiver.js
|
|
1527
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/receiver.js
|
|
1525
1528
|
var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1526
|
-
const { Writable
|
|
1529
|
+
const { Writable } = __require("stream");
|
|
1527
1530
|
const PerMessageDeflate = require_permessage_deflate();
|
|
1528
1531
|
const { BINARY_TYPES, EMPTY_BUFFER, kStatusCode, kWebSocket } = require_constants();
|
|
1529
1532
|
const { concat, toArrayBuffer, unmask } = require_buffer_util();
|
|
@@ -1541,7 +1544,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1541
1544
|
*
|
|
1542
1545
|
* @extends Writable
|
|
1543
1546
|
*/
|
|
1544
|
-
var Receiver = class extends Writable
|
|
1547
|
+
var Receiver = class extends Writable {
|
|
1545
1548
|
/**
|
|
1546
1549
|
* Creates a Receiver instance.
|
|
1547
1550
|
*
|
|
@@ -1821,6 +1824,7 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1821
1824
|
data = this.consume(this._payloadLength);
|
|
1822
1825
|
if (this._masked && (this._mask[0] | this._mask[1] | this._mask[2] | this._mask[3]) !== 0) unmask(data, this._mask);
|
|
1823
1826
|
}
|
|
1827
|
+
this._mask = void 0;
|
|
1824
1828
|
if (this._opcode > 7) {
|
|
1825
1829
|
this.controlMessage(data, cb);
|
|
1826
1830
|
return;
|
|
@@ -1983,10 +1987,9 @@ var require_receiver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
1983
1987
|
};
|
|
1984
1988
|
module.exports = Receiver;
|
|
1985
1989
|
}));
|
|
1986
|
-
|
|
1987
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/sender.js
|
|
1990
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/sender.js
|
|
1988
1991
|
var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
1989
|
-
const { Duplex
|
|
1992
|
+
const { Duplex } = __require("stream");
|
|
1990
1993
|
const { randomFillSync } = __require("crypto");
|
|
1991
1994
|
const { types: { isUint8Array } } = __require("util");
|
|
1992
1995
|
const PerMessageDeflate = require_permessage_deflate();
|
|
@@ -2097,12 +2100,13 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2097
2100
|
target[2] = target[3] = 0;
|
|
2098
2101
|
target.writeUIntBE(dataLength, 4, 6);
|
|
2099
2102
|
}
|
|
2100
|
-
if (!options.mask) return [target, data];
|
|
2103
|
+
if (!options.mask) return dataLength ? [target, data] : [target];
|
|
2101
2104
|
target[1] |= 128;
|
|
2102
2105
|
target[offset - 4] = mask[0];
|
|
2103
2106
|
target[offset - 3] = mask[1];
|
|
2104
2107
|
target[offset - 2] = mask[2];
|
|
2105
2108
|
target[offset - 1] = mask[3];
|
|
2109
|
+
if (!dataLength) return [target];
|
|
2106
2110
|
if (skipMasking) return [target, data];
|
|
2107
2111
|
if (merge) {
|
|
2108
2112
|
applyMask(data, mask, target, offset, dataLength);
|
|
@@ -2481,8 +2485,7 @@ var require_sender = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2481
2485
|
sender.onerror(err);
|
|
2482
2486
|
}
|
|
2483
2487
|
}));
|
|
2484
|
-
|
|
2485
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/event-target.js
|
|
2488
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/event-target.js
|
|
2486
2489
|
var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2487
2490
|
const { kForOnEventAttribute, kListener } = require_constants();
|
|
2488
2491
|
const kCode = Symbol("kCode");
|
|
@@ -2712,8 +2715,7 @@ var require_event_target = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2712
2715
|
else listener.call(thisArg, event);
|
|
2713
2716
|
}
|
|
2714
2717
|
}));
|
|
2715
|
-
|
|
2716
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/extension.js
|
|
2718
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/extension.js
|
|
2717
2719
|
var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2718
2720
|
const { tokenChars } = require_validation();
|
|
2719
2721
|
/**
|
|
@@ -2858,17 +2860,17 @@ var require_extension = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2858
2860
|
parse
|
|
2859
2861
|
};
|
|
2860
2862
|
}));
|
|
2861
|
-
|
|
2862
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket.js
|
|
2863
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket.js
|
|
2863
2864
|
var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2864
|
-
const EventEmitter
|
|
2865
|
+
const EventEmitter = __require("events");
|
|
2865
2866
|
const https = __require("https");
|
|
2866
|
-
const http
|
|
2867
|
+
const http = __require("http");
|
|
2867
2868
|
const net = __require("net");
|
|
2869
|
+
const querystring = __require("querystring");
|
|
2868
2870
|
const tls = __require("tls");
|
|
2869
|
-
const { randomBytes
|
|
2870
|
-
const { Duplex
|
|
2871
|
-
const { URL
|
|
2871
|
+
const { randomBytes, createHash } = __require("crypto");
|
|
2872
|
+
const { Duplex, Readable } = __require("stream");
|
|
2873
|
+
const { URL } = __require("url");
|
|
2872
2874
|
const PerMessageDeflate = require_permessage_deflate();
|
|
2873
2875
|
const Receiver = require_receiver();
|
|
2874
2876
|
const Sender = require_sender();
|
|
@@ -2891,7 +2893,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2891
2893
|
*
|
|
2892
2894
|
* @extends EventEmitter
|
|
2893
2895
|
*/
|
|
2894
|
-
var WebSocket = class WebSocket extends EventEmitter
|
|
2896
|
+
var WebSocket = class WebSocket extends EventEmitter {
|
|
2895
2897
|
/**
|
|
2896
2898
|
* Create a new `WebSocket`.
|
|
2897
2899
|
*
|
|
@@ -3417,14 +3419,16 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3417
3419
|
websocket._closeTimeout = opts.closeTimeout;
|
|
3418
3420
|
if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
|
|
3419
3421
|
let parsedUrl;
|
|
3420
|
-
if (address instanceof URL
|
|
3422
|
+
if (address instanceof URL) parsedUrl = address;
|
|
3421
3423
|
else try {
|
|
3422
|
-
parsedUrl = new URL
|
|
3424
|
+
parsedUrl = new URL(address);
|
|
3423
3425
|
} catch {
|
|
3424
3426
|
throw new SyntaxError(`Invalid URL: ${address}`);
|
|
3425
3427
|
}
|
|
3426
|
-
if (parsedUrl.protocol === "http:"
|
|
3427
|
-
|
|
3428
|
+
if (parsedUrl.protocol === "http:" || parsedUrl.protocol === "https:") {
|
|
3429
|
+
parsedUrl = new URL(parsedUrl);
|
|
3430
|
+
parsedUrl.protocol = parsedUrl.protocol === "http:" ? "ws:" : "wss:";
|
|
3431
|
+
}
|
|
3428
3432
|
websocket._url = parsedUrl.href;
|
|
3429
3433
|
const isSecure = parsedUrl.protocol === "wss:";
|
|
3430
3434
|
const isIpcUrl = parsedUrl.protocol === "ws+unix:";
|
|
@@ -3441,8 +3445,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3441
3445
|
}
|
|
3442
3446
|
}
|
|
3443
3447
|
const defaultPort = isSecure ? 443 : 80;
|
|
3444
|
-
const key = randomBytes
|
|
3445
|
-
const request = isSecure ? https.request : http
|
|
3448
|
+
const key = randomBytes(16).toString("base64");
|
|
3449
|
+
const request = isSecure ? https.request : http.request;
|
|
3446
3450
|
const protocolSet = /* @__PURE__ */ new Set();
|
|
3447
3451
|
let perMessageDeflate;
|
|
3448
3452
|
opts.createConnection = opts.createConnection || (isSecure ? tlsConnect : netConnect);
|
|
@@ -3477,11 +3481,16 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3477
3481
|
if (opts.protocolVersion < 13) opts.headers["Sec-WebSocket-Origin"] = opts.origin;
|
|
3478
3482
|
else opts.headers.Origin = opts.origin;
|
|
3479
3483
|
}
|
|
3480
|
-
if (parsedUrl.username || parsedUrl.password) opts.auth = `${parsedUrl.username}:${parsedUrl.password}`;
|
|
3484
|
+
if (parsedUrl.username || parsedUrl.password) opts.auth = `${querystring.unescape(parsedUrl.username)}:${querystring.unescape(parsedUrl.password)}`;
|
|
3481
3485
|
if (isIpcUrl) {
|
|
3482
|
-
const
|
|
3483
|
-
|
|
3484
|
-
|
|
3486
|
+
const i = opts.path.indexOf(":");
|
|
3487
|
+
if (i === -1) {
|
|
3488
|
+
opts.socketPath = opts.path;
|
|
3489
|
+
opts.path = "";
|
|
3490
|
+
} else {
|
|
3491
|
+
opts.socketPath = opts.path.slice(0, i);
|
|
3492
|
+
opts.path = opts.path.slice(i + 1);
|
|
3493
|
+
}
|
|
3485
3494
|
}
|
|
3486
3495
|
let req;
|
|
3487
3496
|
if (opts.followRedirects) {
|
|
@@ -3527,7 +3536,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3527
3536
|
req.abort();
|
|
3528
3537
|
let addr;
|
|
3529
3538
|
try {
|
|
3530
|
-
addr = new URL
|
|
3539
|
+
addr = new URL(location, address);
|
|
3531
3540
|
} catch (e) {
|
|
3532
3541
|
emitErrorAndClose(websocket, /* @__PURE__ */ new SyntaxError(`Invalid URL: ${location}`));
|
|
3533
3542
|
return;
|
|
@@ -3544,7 +3553,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3544
3553
|
abortHandshake(websocket, socket, "Invalid Upgrade header");
|
|
3545
3554
|
return;
|
|
3546
3555
|
}
|
|
3547
|
-
const digest = createHash
|
|
3556
|
+
const digest = createHash("sha1").update(key + GUID).digest("base64");
|
|
3548
3557
|
if (res.headers["sec-websocket-accept"] !== digest) {
|
|
3549
3558
|
abortHandshake(websocket, socket, "Invalid Sec-WebSocket-Accept header");
|
|
3550
3559
|
return;
|
|
@@ -3688,8 +3697,12 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3688
3697
|
function receiverOnConclude(code, reason) {
|
|
3689
3698
|
const websocket = this[kWebSocket];
|
|
3690
3699
|
websocket._closeFrameReceived = true;
|
|
3691
|
-
websocket._closeMessage = reason;
|
|
3692
3700
|
websocket._closeCode = code;
|
|
3701
|
+
if (reason.length === 0) websocket._closeMessage = EMPTY_BUFFER;
|
|
3702
|
+
else {
|
|
3703
|
+
websocket._closeMessage = Buffer.allocUnsafeSlow(reason.length);
|
|
3704
|
+
websocket._closeMessage.set(reason);
|
|
3705
|
+
}
|
|
3693
3706
|
if (websocket._socket[kWebSocket] === void 0) return;
|
|
3694
3707
|
websocket._socket.removeListener("data", socketOnData);
|
|
3695
3708
|
process.nextTick(resume, websocket._socket);
|
|
@@ -3857,11 +3870,10 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3857
3870
|
}
|
|
3858
3871
|
}
|
|
3859
3872
|
}));
|
|
3860
|
-
|
|
3861
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/stream.js
|
|
3873
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/stream.js
|
|
3862
3874
|
var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3863
3875
|
require_websocket();
|
|
3864
|
-
const { Duplex
|
|
3876
|
+
const { Duplex } = __require("stream");
|
|
3865
3877
|
/**
|
|
3866
3878
|
* Emits the `'close'` event on a stream.
|
|
3867
3879
|
*
|
|
@@ -3900,7 +3912,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3900
3912
|
*/
|
|
3901
3913
|
function createWebSocketStream(ws, options) {
|
|
3902
3914
|
let terminateOnDestroy = true;
|
|
3903
|
-
const duplex = new Duplex
|
|
3915
|
+
const duplex = new Duplex({
|
|
3904
3916
|
...options,
|
|
3905
3917
|
autoDestroy: false,
|
|
3906
3918
|
emitClose: false,
|
|
@@ -3973,8 +3985,7 @@ var require_stream = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3973
3985
|
}
|
|
3974
3986
|
module.exports = createWebSocketStream;
|
|
3975
3987
|
}));
|
|
3976
|
-
|
|
3977
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/subprotocol.js
|
|
3988
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/subprotocol.js
|
|
3978
3989
|
var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3979
3990
|
const { tokenChars } = require_validation();
|
|
3980
3991
|
/**
|
|
@@ -4012,13 +4023,12 @@ var require_subprotocol = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
4012
4023
|
}
|
|
4013
4024
|
module.exports = { parse };
|
|
4014
4025
|
}));
|
|
4015
|
-
|
|
4016
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/lib/websocket-server.js
|
|
4026
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/lib/websocket-server.js
|
|
4017
4027
|
var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
4018
4028
|
const EventEmitter = __require("events");
|
|
4019
4029
|
const http = __require("http");
|
|
4020
4030
|
const { Duplex } = __require("stream");
|
|
4021
|
-
const { createHash
|
|
4031
|
+
const { createHash } = __require("crypto");
|
|
4022
4032
|
const extension = require_extension();
|
|
4023
4033
|
const PerMessageDeflate = require_permessage_deflate();
|
|
4024
4034
|
const subprotocol = require_subprotocol();
|
|
@@ -4288,7 +4298,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
4288
4298
|
"HTTP/1.1 101 Switching Protocols",
|
|
4289
4299
|
"Upgrade: websocket",
|
|
4290
4300
|
"Connection: Upgrade",
|
|
4291
|
-
`Sec-WebSocket-Accept: ${createHash
|
|
4301
|
+
`Sec-WebSocket-Accept: ${createHash("sha1").update(key + GUID).digest("base64")}`
|
|
4292
4302
|
];
|
|
4293
4303
|
const ws = new this.options.WebSocket(null, void 0, this.options);
|
|
4294
4304
|
if (protocols.size) {
|
|
@@ -4399,8 +4409,7 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
|
|
|
4399
4409
|
} else abortHandshake(socket, code, message, headers);
|
|
4400
4410
|
}
|
|
4401
4411
|
}));
|
|
4402
|
-
|
|
4403
|
-
//#region ../../node_modules/.pnpm/ws@8.22.0/node_modules/ws/wrapper.mjs
|
|
4412
|
+
// ../../node_modules/.pnpm/ws@8.22.2/node_modules/ws/wrapper.mjs
|
|
4404
4413
|
var import_proper_lockfile = /* @__PURE__ */ __toESM(require_proper_lockfile(), 1);
|
|
4405
4414
|
require_stream();
|
|
4406
4415
|
require_extension();
|
|
@@ -4410,12 +4419,10 @@ require_sender();
|
|
|
4410
4419
|
require_subprotocol();
|
|
4411
4420
|
var import_websocket = /* @__PURE__ */ __toESM(require_websocket(), 1);
|
|
4412
4421
|
var import_websocket_server = /* @__PURE__ */ __toESM(require_websocket_server(), 1);
|
|
4413
|
-
|
|
4414
|
-
//#region src/history-retention.ts
|
|
4422
|
+
// src/history-retention.ts
|
|
4415
4423
|
/** Closed task details and settled feedback receipts share a local retention window. */
|
|
4416
4424
|
const HISTORY_RETENTION_MS = 2592e6;
|
|
4417
|
-
|
|
4418
|
-
//#region src/agent-clients/codex-ipc.ts
|
|
4425
|
+
// src/agent-clients/codex-ipc.ts
|
|
4419
4426
|
const WINDOWS_PIPE = String.raw`\\.\pipe\codex-ipc`;
|
|
4420
4427
|
var CodexIpcError = class extends Error {
|
|
4421
4428
|
uncertain;
|
|
@@ -4622,8 +4629,7 @@ var CodexIpc = class CodexIpc {
|
|
|
4622
4629
|
this.socket.destroy();
|
|
4623
4630
|
}
|
|
4624
4631
|
};
|
|
4625
|
-
|
|
4626
|
-
//#region src/agent-clients/codex-queue-rpc.ts
|
|
4632
|
+
// src/agent-clients/codex-queue-rpc.ts
|
|
4627
4633
|
/** Use the running desktop's bundled binary, never an unrelated CLI on PATH. */
|
|
4628
4634
|
async function codexQueueExecutable(context) {
|
|
4629
4635
|
const options = {
|
|
@@ -4799,8 +4805,7 @@ var CodexQueueRpc = class {
|
|
|
4799
4805
|
this.disconnect();
|
|
4800
4806
|
}
|
|
4801
4807
|
};
|
|
4802
|
-
|
|
4803
|
-
//#region src/agent-clients/codex-server-queue.ts
|
|
4808
|
+
// src/agent-clients/codex-server-queue.ts
|
|
4804
4809
|
/** A missing database identifies an older store; an unreadable store is never empty. */
|
|
4805
4810
|
async function readCodexServerQueue(conversationId, home) {
|
|
4806
4811
|
const path = join(home, "queue_1.sqlite");
|
|
@@ -4823,8 +4828,7 @@ async function readCodexServerQueue(conversationId, home) {
|
|
|
4823
4828
|
throw new Error("The Codex server queue could not be checked. Comments remain saved.", { cause: error });
|
|
4824
4829
|
}
|
|
4825
4830
|
}
|
|
4826
|
-
|
|
4827
|
-
//#region src/agent-clients/codex-queue.ts
|
|
4831
|
+
// src/agent-clients/codex-queue.ts
|
|
4828
4832
|
function object$2(value) {
|
|
4829
4833
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Codex queue state has an unsupported format.");
|
|
4830
4834
|
return value;
|
|
@@ -4997,8 +5001,7 @@ var CodexNativeQueue = class CodexNativeQueue {
|
|
|
4997
5001
|
if (response.handledByClientId !== owner || object$2(response.result).ok !== true) throw new CodexIpcError("Codex did not confirm queue admission.", true);
|
|
4998
5002
|
}
|
|
4999
5003
|
};
|
|
5000
|
-
|
|
5001
|
-
//#region src/agent-clients/types.ts
|
|
5004
|
+
// src/agent-clients/types.ts
|
|
5002
5005
|
/** Only clients with a verified native conversation channel can carry comments or interruption. */
|
|
5003
5006
|
function nativeFeedback(client) {
|
|
5004
5007
|
return AGENT_CLIENTS[client.kind].feedback;
|
|
@@ -5018,8 +5021,7 @@ const CODEX_FEEDBACK_UNAVAILABLE = {
|
|
|
5018
5021
|
...CANVAS_ONLY,
|
|
5019
5022
|
reason: "Codex App comment delivery is unavailable. Open the original conversation in Codex App and retry. Comments stay saved; they are never delivered through hooks."
|
|
5020
5023
|
};
|
|
5021
|
-
|
|
5022
|
-
//#region src/agent-clients/codex-feedback.ts
|
|
5024
|
+
// src/agent-clients/codex-feedback.ts
|
|
5023
5025
|
const CODEX_APP_FEEDBACK = {
|
|
5024
5026
|
interrupt: false,
|
|
5025
5027
|
continue: false,
|
|
@@ -5557,7 +5559,7 @@ var CodexAppFeedback = class {
|
|
|
5557
5559
|
const entries = [];
|
|
5558
5560
|
const files = background ? this.receiptScan ??= this.receiptFiles() : this.receiptFiles();
|
|
5559
5561
|
try {
|
|
5560
|
-
for (let index = 0; index < (background ? 128 :
|
|
5562
|
+
for (let index = 0; index < (background ? 128 : 1e400); index++) {
|
|
5561
5563
|
const next = await files.next();
|
|
5562
5564
|
if (next.done) {
|
|
5563
5565
|
if (background) this.receiptScan = void 0;
|
|
@@ -5612,8 +5614,7 @@ var CodexAppFeedback = class {
|
|
|
5612
5614
|
this.hostQueues.clear();
|
|
5613
5615
|
}
|
|
5614
5616
|
};
|
|
5615
|
-
|
|
5616
|
-
//#region src/agent-clients/codex-turn-state.ts
|
|
5617
|
+
// src/agent-clients/codex-turn-state.ts
|
|
5617
5618
|
function object$1(value) {
|
|
5618
5619
|
if (!value || typeof value !== "object" || Array.isArray(value)) throw new Error("Unsupported Codex lifecycle value.");
|
|
5619
5620
|
return value;
|
|
@@ -5760,8 +5761,7 @@ var CodexTurnState = class {
|
|
|
5760
5761
|
else throw new Error("Unsupported Codex turn field.");
|
|
5761
5762
|
}
|
|
5762
5763
|
};
|
|
5763
|
-
|
|
5764
|
-
//#region src/agent-clients/codex-lifecycle.ts
|
|
5764
|
+
// src/agent-clients/codex-lifecycle.ts
|
|
5765
5765
|
function object(value) {
|
|
5766
5766
|
return value && typeof value === "object" && !Array.isArray(value) ? value : {};
|
|
5767
5767
|
}
|
|
@@ -5932,8 +5932,7 @@ var CodexAppLifecycle = class {
|
|
|
5932
5932
|
this.retain(/* @__PURE__ */ new Set());
|
|
5933
5933
|
}
|
|
5934
5934
|
};
|
|
5935
|
-
|
|
5936
|
-
//#region src/legacy-extension.ts
|
|
5935
|
+
// src/legacy-extension.ts
|
|
5937
5936
|
function extensionUpgradeRequired() {
|
|
5938
5937
|
return Object.assign(/* @__PURE__ */ new Error("This operation requires a current TemPad Dev extension compatible with this Hub. Update the extension in Chrome, then reload the Figma tab and reconnect Agent integration. Until then, get_code, get_screenshot, and node-based get_structure remain available without a design task."), { code: TEMPAD_MCP_ERROR_CODES.EXTENSION_UPGRADE_REQUIRED });
|
|
5939
5938
|
}
|
|
@@ -5946,8 +5945,7 @@ function legacyToolPayload(name, args) {
|
|
|
5946
5945
|
if (result.data.name === "get_code" && result.data.args?.resolveTokens) throw Object.assign(/* @__PURE__ */ new Error("resolveTokens requires matching current Hub and extension builds. Update the extension, then reload the Figma tab and reconnect Agent integration. Older extensions flatten token definitions and cannot return consumer-aware code with preserved aliases."), { code: TEMPAD_MCP_ERROR_CODES.EXTENSION_UPGRADE_REQUIRED });
|
|
5947
5946
|
return result.data;
|
|
5948
5947
|
}
|
|
5949
|
-
|
|
5950
|
-
//#region src/design-tasks.ts
|
|
5948
|
+
// src/design-tasks.ts
|
|
5951
5949
|
const ENDED_STATUSES = ["completed", "cancelled"];
|
|
5952
5950
|
const RUNNING_STATUSES = ["active", "stopping"];
|
|
5953
5951
|
/** Only a Hub begin request establishes a client binding; browser migration leaves it empty. */
|
|
@@ -5989,7 +5987,7 @@ var DesignTasks = class {
|
|
|
5989
5987
|
readGeneration = 0;
|
|
5990
5988
|
fileFences = /* @__PURE__ */ new Map();
|
|
5991
5989
|
expiredRequests = /* @__PURE__ */ new Map();
|
|
5992
|
-
nextHistorySweep =
|
|
5990
|
+
nextHistorySweep = 1e400;
|
|
5993
5991
|
now;
|
|
5994
5992
|
leaseMs;
|
|
5995
5993
|
revision = 0;
|
|
@@ -6497,7 +6495,7 @@ var DesignTasks = class {
|
|
|
6497
6495
|
}
|
|
6498
6496
|
pruneHistory(now) {
|
|
6499
6497
|
if (now < this.nextHistorySweep || this.persistenceError) return;
|
|
6500
|
-
this.nextHistorySweep =
|
|
6498
|
+
this.nextHistorySweep = 1e400;
|
|
6501
6499
|
const pendingTasks = new Set([...this.operations.values()].map(({ taskId }) => taskId));
|
|
6502
6500
|
let changed = false;
|
|
6503
6501
|
for (const [taskId, record] of this.records) {
|
|
@@ -6670,8 +6668,7 @@ var DesignTasks = class {
|
|
|
6670
6668
|
if (this.options.store?.recoveryError || this.persistenceError) fail("DESIGN_TASK_INACTIVE", this.options.store?.recoveryError ?? "Design task state could not be saved. Canvas writes are blocked until storage recovers; stopped tasks remain fenced.");
|
|
6671
6669
|
}
|
|
6672
6670
|
};
|
|
6673
|
-
|
|
6674
|
-
//#region src/agent-clients/registry.ts
|
|
6671
|
+
// src/agent-clients/registry.ts
|
|
6675
6672
|
/** A turn is a safe target only when the conversation has exactly one in progress. */
|
|
6676
6673
|
function soleActiveTurn(state) {
|
|
6677
6674
|
const active = state?.turns.filter((turn) => turn.status === "inProgress");
|
|
@@ -7171,8 +7168,7 @@ var AgentClients = class {
|
|
|
7171
7168
|
}
|
|
7172
7169
|
}
|
|
7173
7170
|
};
|
|
7174
|
-
|
|
7175
|
-
//#region src/asset-data-url.ts
|
|
7171
|
+
// src/asset-data-url.ts
|
|
7176
7172
|
const IMAGE_DATA_URL_PATTERN = /^data:(image\/(?:png|jpeg|gif));base64,([A-Za-z0-9+/]+={0,2})$/;
|
|
7177
7173
|
function decodeImageDataUrl(dataUrl, maxBytes = MCP_MAX_ASSET_BYTES) {
|
|
7178
7174
|
const match = IMAGE_DATA_URL_PATTERN.exec(dataUrl);
|
|
@@ -7190,11 +7186,9 @@ function decodeImageDataUrl(dataUrl, maxBytes = MCP_MAX_ASSET_BYTES) {
|
|
|
7190
7186
|
mimeType
|
|
7191
7187
|
};
|
|
7192
7188
|
}
|
|
7193
|
-
|
|
7194
|
-
//#region ../../node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/url-alphabet/index.js
|
|
7189
|
+
// ../../node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/url-alphabet/index.js
|
|
7195
7190
|
let urlAlphabet = "57X6y3wQZNzYjJB2L_10pxbackgroundhimselfUTF-8DEMOGRAPHICSVqvt4KW9";
|
|
7196
|
-
|
|
7197
|
-
//#region ../../node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/index.js
|
|
7191
|
+
// ../../node_modules/.pnpm/nanoid@6.0.2/node_modules/nanoid/index.js
|
|
7198
7192
|
const GET_RANDOM_LIMIT = 65536;
|
|
7199
7193
|
function fillRandom(buffer) {
|
|
7200
7194
|
let from = 0;
|
|
@@ -7287,8 +7281,7 @@ function customAlphabet(alphabet, defaultSize = 21) {
|
|
|
7287
7281
|
};
|
|
7288
7282
|
}
|
|
7289
7283
|
const nanoid = customAlphabet(urlAlphabet);
|
|
7290
|
-
|
|
7291
|
-
//#region src/asset-utils.ts
|
|
7284
|
+
// src/asset-utils.ts
|
|
7292
7285
|
const HASH_FILENAME_PATTERN = new RegExp(`^([a-f0-9]{64}|[a-f0-9]{8})(?:\\.[a-z0-9-]+)?$`);
|
|
7293
7286
|
const SAFE_IMAGE_EXTENSION_PATTERN = /^[a-z0-9-]+$/;
|
|
7294
7287
|
function normalizeMimeType(mimeType) {
|
|
@@ -7313,8 +7306,7 @@ function buildAssetFilename(hash, mimeType) {
|
|
|
7313
7306
|
function getHashFromAssetFilename(filename) {
|
|
7314
7307
|
return HASH_FILENAME_PATTERN.exec(filename)?.[1] ?? null;
|
|
7315
7308
|
}
|
|
7316
|
-
|
|
7317
|
-
//#region src/security.ts
|
|
7309
|
+
// src/security.ts
|
|
7318
7310
|
const CHROME_EXTENSION_ORIGIN_PATTERN = /^chrome-extension:\/\/[a-p]{32}$/;
|
|
7319
7311
|
function createCapabilityToken() {
|
|
7320
7312
|
return randomBytes(32).toString("base64url");
|
|
@@ -7354,8 +7346,7 @@ function secretsEqual(candidate, expected) {
|
|
|
7354
7346
|
function isChromeExtensionOrigin(origin) {
|
|
7355
7347
|
return CHROME_EXTENSION_ORIGIN_PATTERN.test(origin);
|
|
7356
7348
|
}
|
|
7357
|
-
|
|
7358
|
-
//#region src/asset-http-server.ts
|
|
7349
|
+
// src/asset-http-server.ts
|
|
7359
7350
|
const LOOPBACK_HOST = "127.0.0.1";
|
|
7360
7351
|
const ASSET_REQUEST_TIMEOUT_MS = 15e3;
|
|
7361
7352
|
const ASSET_HEADERS_TIMEOUT_MS = 5e3;
|
|
@@ -7758,8 +7749,7 @@ function getStoredAssetBytes(store, excludeHash) {
|
|
|
7758
7749
|
return Number.isFinite(record.size) && record.size > 0 ? total + record.size : total;
|
|
7759
7750
|
}, 0);
|
|
7760
7751
|
}
|
|
7761
|
-
|
|
7762
|
-
//#region src/asset-store.ts
|
|
7752
|
+
// src/asset-store.ts
|
|
7763
7753
|
const INDEX_FILENAME = "assets.json";
|
|
7764
7754
|
const DEFAULT_INDEX_PATH = join(ASSET_DIR, INDEX_FILENAME);
|
|
7765
7755
|
const IMAGE_MIME_TYPES = {
|
|
@@ -7938,8 +7928,7 @@ function createAssetStore(options = {}) {
|
|
|
7938
7928
|
flush
|
|
7939
7929
|
};
|
|
7940
7930
|
}
|
|
7941
|
-
|
|
7942
|
-
//#region src/extension-registry.ts
|
|
7931
|
+
// src/extension-registry.ts
|
|
7943
7932
|
var ExtensionRegistry = class {
|
|
7944
7933
|
#autoActivateGraceMs;
|
|
7945
7934
|
#extensions = [];
|
|
@@ -8010,8 +7999,7 @@ function unrefTimer(timer) {
|
|
|
8010
7999
|
const handle = timer;
|
|
8011
8000
|
if (typeof handle.unref === "function") handle.unref();
|
|
8012
8001
|
}
|
|
8013
|
-
|
|
8014
|
-
//#region src/extension-socket.ts
|
|
8002
|
+
// src/extension-socket.ts
|
|
8015
8003
|
const CHECKOUT_HANDSHAKE_TIMEOUT_MS = 5e3;
|
|
8016
8004
|
function attachExtensionSocket(ws, options) {
|
|
8017
8005
|
const extension = {
|
|
@@ -8206,11 +8194,9 @@ function rawDataToBuffer(raw) {
|
|
|
8206
8194
|
if (raw instanceof ArrayBuffer) return Buffer.from(raw);
|
|
8207
8195
|
return Buffer.concat(raw);
|
|
8208
8196
|
}
|
|
8209
|
-
|
|
8210
|
-
//#region src/instructions.md?raw
|
|
8197
|
+
// src/instructions.md?raw
|
|
8211
8198
|
var instructions_default = "You are connected to Figma through TemPad Dev. An active MCP badge selects the default file;\nbrowser focus does not. When the target is unclear, call `list_design_sessions` and pass the exact\n`sessionId` to `manage_design_task` with action `begin` or an independent read. Task targets never follow browser focus;\ntask-bound reads stay on their task's session. Independent reads need no task. Run calls against\nthe same file sequentially, including reads.\n\nFor new design work, call `manage_design_task` with action `begin` before research or writing,\nthen carry its `taskId`.\nChoose a known Frame with `set_design_anchor` once the region is clear; otherwise the first new\ntop-level Frame anchors automatically. Reads, selections, and later writes never change the anchor\nunless `set_design_anchor` does. Task identity survives turns. A pause or idle lease expiry releases\ncanvas ownership without cancelling the task;\nuse action `resume` with the current `epoch`, carry its returned `epoch` as `taskEpoch`, and reread the\nbound canvas with `get_structure` or `get_code` before writing. Use `get_design_task` for recovery,\nnot routine polling. Never replay a stale write or queue a write against an occupied file.\nActions `complete` and `cancel` require the current `epoch` and end a verified pass or explicitly\nabandon it; they are not for a wait for input.\nCompletion releases ownership but keeps the review and same task open for comments until the user\nclicks Done; resume that task for follow-up comments. Cancelled, closed, or replaced tasks cannot\nresume. The Figma Stop control permanently cancels the current task after its running operation\nsettles; do not resume or automatically replace it. If further work is necessary or requested,\nuse action `begin` with a fresh requestId; no separate\nFigma unlock or user turn is required. No progress or heartbeat calls are needed.\n\nFeedback drafts contain individually numbered elements captured when saved. Reread each exact node\nbefore acting; do not substitute the current selection. Supported hosts deliver submitted feedback\nthrough native conversation messages. Do not poll, launch helpers, or configure a control endpoint.\n\nTreat tool outputs as file-scoped facts. Never invent node IDs, resource refs, library keys, token\norigins, or design-system intent. Tool descriptions give mechanical affordances; the applicable host\nskill governs workflow, representation, and design judgment. For Figma-to-code, use `get_code` as\nvisible implementation evidence. Use `get_structure` only for hierarchy, geometry, managed-key\nuncertainty, or targeted mask, IMAGE paint, layout-grid, and frame-guide read-back via\n`options.native`.\n\nFor canvas authoring, choose the native representation through the skill, then describe one desired\nresult with `apply_canvas`. Canvas HTML serializes ordinary layers; typed fields carry selected\nnative state, resources, and bindings. Never send raw Plugin API operations or arbitrary JavaScript.\n`get_design_system` is optional when existing-resource reuse is relevant and permitted; new local\nresources do not require it. `scope: \"fonts\"` independently reads environment availability.\nFor large files, `scope: \"pages\"` finds a relevant component page before `pageId`-scoped discovery;\nvariables, styles, and shaders remain file-wide. Use catalog CSS names or a call-scoped `theme` for\nvariable utilities and native text-style classes. Load skill references only after choosing a\nnative concept.\n\nWhen design evidence is limited to the current page or an independent system without reuse, stay\non the Direct path: do not discover resource catalogs, inspect other pages, or use catalog refs.\n`scope: \"fonts\"` remains available. Local variables and styles remain file-wide Figma resources,\nand the extension may still check file-wide identities internally for safe reconciliation.\n\nCreates add and automatically place one root. Updates use exact node identity: omission preserves\nlive state; explicit removal removes managed content. Read structural verification and resolve\nwarnings before claiming completion. Use `get_screenshot` when pixels affect a decision and open\nits image before claiming visual verification. Use `asset.localPath` when present, otherwise\n`asset.url`; native media hashes identify assets within one Figma file, not preview bytes. Never\nship `data-hint-*` attributes from read-tool output.\n";
|
|
8212
|
-
|
|
8213
|
-
//#region src/request.ts
|
|
8199
|
+
// src/request.ts
|
|
8214
8200
|
const pendingCalls = /* @__PURE__ */ new Map();
|
|
8215
8201
|
const UNKNOWN_WRITE_OUTCOME = "The canvas operation outcome is unknown. Do not replay this write; inspect the canvas or reload the executing Figma tab before continuing.";
|
|
8216
8202
|
function createToolError(code, message) {
|
|
@@ -8281,7 +8267,7 @@ function pendingResponse(requestId, extensionId, outcome) {
|
|
|
8281
8267
|
}
|
|
8282
8268
|
return call;
|
|
8283
8269
|
}
|
|
8284
|
-
function resolve
|
|
8270
|
+
function resolve(requestId, extensionId, payload) {
|
|
8285
8271
|
const call = pendingResponse(requestId, extensionId, "result");
|
|
8286
8272
|
if (!call) return;
|
|
8287
8273
|
call.resolve(payload);
|
|
@@ -8311,8 +8297,7 @@ function cleanupAll() {
|
|
|
8311
8297
|
});
|
|
8312
8298
|
pendingCalls.clear();
|
|
8313
8299
|
}
|
|
8314
|
-
|
|
8315
|
-
//#region src/terminal-receipts.ts
|
|
8300
|
+
// src/terminal-receipts.ts
|
|
8316
8301
|
const MAX_RECEIPTS = 128;
|
|
8317
8302
|
/** Persist write exclusion, never requests to replay or authority to resume a task. */
|
|
8318
8303
|
var TerminalReceipts = class {
|
|
@@ -8439,8 +8424,7 @@ var TerminalReceipts = class {
|
|
|
8439
8424
|
}
|
|
8440
8425
|
}
|
|
8441
8426
|
};
|
|
8442
|
-
|
|
8443
|
-
//#region src/tools.ts
|
|
8427
|
+
// src/tools.ts
|
|
8444
8428
|
const READ_ONLY_ANNOTATIONS = {
|
|
8445
8429
|
readOnlyHint: true,
|
|
8446
8430
|
destructiveHint: false,
|
|
@@ -8553,7 +8537,7 @@ const TOOL_DEFS = [
|
|
|
8553
8537
|
}),
|
|
8554
8538
|
extTool({
|
|
8555
8539
|
name: "get_structure",
|
|
8556
|
-
description: "Read a compact hierarchy and geometry outline for exact nodeId/nodeIds, exact page id/key, or the current selection. Exact roots are preserved before descendants consume the budget; options.depth: 0 returns roots only. Inspect errors and continue remainingNodeIds with nodeIds. Every x/y is relative to the node's actual Figma parent; page-query roots are page-relative. Includes stable keys on TemPad-managed nodes and exact page context for page queries. Set options.native for
|
|
8540
|
+
description: "Read a compact hierarchy and geometry outline for exact nodeId/nodeIds, exact page id/key, or the current selection. Exact roots are preserved before descendants consume the budget; options.depth: 0 returns roots only. Inspect errors and continue remainingNodeIds with nodeIds. Every x/y is relative to the node's actual Figma parent; page-query roots are page-relative. Includes stable keys on TemPad-managed nodes and exact page context for page queries. Set options.native for sparse native read-back, including 3D transforms, origins, and scenes: default/empty 3D fields are omitted, configured disabled states are retained. Missing fields alone do not prove API support or a successful clear. This does not provide rendered pixels or general appearance.",
|
|
8557
8541
|
annotations: READ_ONLY_ANNOTATIONS,
|
|
8558
8542
|
parameters: GetStructureParametersSchema,
|
|
8559
8543
|
target: "extension",
|
|
@@ -8706,8 +8690,7 @@ function getBudgetRetryGuidance(toolName) {
|
|
|
8706
8690
|
case "upload_asset": return "Generate a smaller PNG, JPEG, or GIF and retry without printing its data URL.";
|
|
8707
8691
|
}
|
|
8708
8692
|
}
|
|
8709
|
-
|
|
8710
|
-
//#region src/versioned-extension.ts
|
|
8693
|
+
// src/versioned-extension.ts
|
|
8711
8694
|
const NODE_READS = /* @__PURE__ */ new Set([
|
|
8712
8695
|
"get_code",
|
|
8713
8696
|
"get_screenshot",
|
|
@@ -8724,8 +8707,7 @@ function versionedReadNotice(protocolVersion, name) {
|
|
|
8724
8707
|
if (name === "get_code" || name === "get_token_defs") return "Protocol 13 compatibility: token metadata uses the installed extension’s original semantics; complete modes and alias dependencies are not guaranteed. Use exact nodeId reads for code. Upgrade the extension and reload Figma for consumer-aware resolution and complete definitions.";
|
|
8725
8708
|
if (name === "get_structure" || name === "get_screenshot") return "Protocol 13 compatibility: omitted nodeId uses the installed extension’s original selection behavior; structure may use a common ancestor. Use exact nodeId reads to preserve each requested root.";
|
|
8726
8709
|
}
|
|
8727
|
-
|
|
8728
|
-
//#region src/websocket-server.ts
|
|
8710
|
+
// src/websocket-server.ts
|
|
8729
8711
|
async function startExtensionWebSocketServer({ maxPayloadBytes, maxConnections, originPolicy, portCandidates, onPortInUse, onConnectionLimit, onRejectedHandshake }) {
|
|
8730
8712
|
for (const candidate of portCandidates) {
|
|
8731
8713
|
const server = new import_websocket_server.default({
|
|
@@ -8780,8 +8762,7 @@ function resolveListeningPort(server, candidate) {
|
|
|
8780
8762
|
const address = server.address();
|
|
8781
8763
|
return address && typeof address === "object" ? address.port : candidate;
|
|
8782
8764
|
}
|
|
8783
|
-
|
|
8784
|
-
//#region src/hub-runtime.ts
|
|
8765
|
+
// src/hub-runtime.ts
|
|
8785
8766
|
function hasCanvasReadEvidence(tool, payload) {
|
|
8786
8767
|
if (tool === "get_structure") {
|
|
8787
8768
|
const roots = getRecordProperty(payload, "roots");
|
|
@@ -10149,7 +10130,7 @@ async function startHub(options = {}) {
|
|
|
10149
10130
|
onToolResult: (requestId, extensionId, payload) => {
|
|
10150
10131
|
terminalReceipts.settle(requestId, extensionId);
|
|
10151
10132
|
designTasks.finishOperation(requestId, extensionId);
|
|
10152
|
-
resolve
|
|
10133
|
+
resolve(requestId, extensionId, payload);
|
|
10153
10134
|
}
|
|
10154
10135
|
});
|
|
10155
10136
|
});
|
|
@@ -10160,7 +10141,6 @@ async function startHub(options = {}) {
|
|
|
10160
10141
|
process.on("SIGINT", shutdown);
|
|
10161
10142
|
process.on("SIGTERM", shutdown);
|
|
10162
10143
|
}
|
|
10163
|
-
//#endregion
|
|
10164
10144
|
export { startHub as t };
|
|
10165
10145
|
|
|
10166
|
-
//# sourceMappingURL=hub-runtime-
|
|
10146
|
+
//# sourceMappingURL=hub-runtime-DsEO9zvX.mjs.map
|