@jshookmcp/jshook 0.2.7 → 0.2.8
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/README.zh.md +1 -1
- package/dist/ExtensionManager-CPTJhHFg.mjs +2 -0
- package/dist/{ExtensionManager-CZ6IveoV.mjs → ExtensionManager-D5-bO9D8.mjs} +1 -1
- package/dist/{ToolCatalog-CnwmMIw3.mjs → ToolCatalog-Bq4V2sbJ.mjs} +7180 -1462
- package/dist/index.mjs +9 -2
- package/package.json +35 -65
- package/dist/ExtensionManager-DqUSOamB.mjs +0 -2
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as logger } from "./logger-BmWzC2lM.mjs";
|
|
3
3
|
import { $t as SEARCH_BM25_K1, A as COMPOUND_EVENT_WINDOW_MS, At as PREDICTIVE_MAX_HISTORY, Cn as SEARCH_VECTOR_LEARN_TOP_N, Dn as SHUTDOWN_TIMEOUT_MS, En as SEARCH_WORKFLOW_DOMAIN_BOOST_MULTIPLIER, Ft as RUNTIME_ERROR_WINDOW_MS, Ot as PREDICTIVE_CONFIDENCE_THRESHOLD, Pt as RUNTIME_ERROR_THRESHOLD, Qt as SEARCH_BM25_B, Sn as SEARCH_VECTOR_LEARN_DOWN, Xt as SEARCH_AFFINITY_BOOST_FACTOR, Yt as SEARCH_AFFINITY_BASE_WEIGHT, Zt as SEARCH_AFFINITY_TOP_N, _n as SEARCH_TRIGRAM_THRESHOLD, a as ACTIVATION_TTL_MINUTES, an as SEARCH_PARAM_TOKEN_WEIGHT, cn as SEARCH_RECENCY_MAX_BOOST, dn as SEARCH_RRF_BM25_BLEND, en as SEARCH_CACHE_VECTOR_WEIGHT_TOLERANCE, fn as SEARCH_RRF_K, gn as SEARCH_TIER_PENALTY, gt as MCP_HTTP_REQUEST_TIMEOUT_MS, h as AUTOPRUNE_MANUAL_INACTIVITY_MS, hn as SEARCH_TFIDF_COSINE_WEIGHT, ht as MCP_HTTP_KEEPALIVE_TIMEOUT_MS, i as ACTIVATION_EVENT_HISTORY_MAX, in as SEARCH_EXACT_NAME_MATCH_MULTIPLIER, j as COMPOUND_LONG_WINDOW_MS, jt as PREDICTIVE_MAX_SECOND_ORDER_KEYS, kt as PREDICTIVE_DECAY_FACTOR, ln as SEARCH_RECENCY_TRACKER_MAX, m as AUTOPRUNE_CHECK_INTERVAL_MS, mn as SEARCH_SYNONYM_EXPANSION_LIMIT, mt as MCP_HTTP_HEADERS_TIMEOUT_MS, n as ACTIVATION_COMPOUND_EVAL_EVERY, nn as SEARCH_DOMAIN_HUB_BOOST_MULTIPLIER, on as SEARCH_PREFIX_MATCH_MULTIPLIER, ot as HTTP_CLEANUP_INTERVAL_MS, p as AUTOPRUNE_AUTO_INACTIVITY_MS, pn as SEARCH_RRF_RESCALE_FACTOR, pt as MCP_HTTP_FORCE_CLOSE_TIMEOUT_MS, r as ACTIVATION_COOLDOWN_MS, rn as SEARCH_DOMAIN_HUB_THRESHOLD, sn as SEARCH_QUERY_CACHE_CAPACITY, st as HTTP_RATE_LIMIT_MAX_IPS, t as ACTIVATION_BOOST_WINDOW_MS, tn as SEARCH_COVERAGE_PRECISION_FACTOR, un as SEARCH_RECENCY_WINDOW_MS, vn as SEARCH_TRIGRAM_WEIGHT, wn as SEARCH_VECTOR_LEARN_UP, xn as SEARCH_VECTOR_ENABLED, yn as SEARCH_VECTOR_COSINE_WEIGHT } from "./constants-CCvsN80K.mjs";
|
|
4
|
-
import { A as validateToolNameArray, B as
|
|
4
|
+
import { A as validateToolNameArray, B as asErrorResponse, C as getAvailableToolNames, D as getToolInputSchema, E as getToolDomainFromContext, F as createServerEventBus, H as DetailedDataManager, I as getInjectionInstructions, L as generateAntiDebugBypass, M as isBrowserOrNetworkTask, N as isMaintenanceTask, O as isToolActive, P as matchWorkflowRoute, R as ProcessRegistry, S as rerankResultsForContext, T as getToolDescription, U as UnifiedCacheManager, V as asTextResponse, W as TokenBudgetManager, _ as buildPresetRecommendations, a as getToolsForProfile, b as buildWorkflowToolSequence, c as getAllDomains, d as initRegistry, h as startArtifactRetentionScheduler, i as getToolsByDomains, j as detectWorkflowIntent, k as normalizeToolName, l as getAllManifests, m as getArtifactRetentionConfig, n as getProfileDomains, o as parseToolDomains, p as cleanupArtifacts, r as getToolDomain, s as buildHandlerMapFromRegistry, t as allTools, u as getAllRegistrations, v as buildRouteMatchMetadata, w as getRoutingState, x as getEffectivePrerequisites, y as buildWorkflowRouteRecommendation, z as ToolError } from "./ToolCatalog-Bq4V2sbJ.mjs";
|
|
5
5
|
import { f as getConfig, h as DEFAULT_SEARCH_CONFIG, m as validateConfig } from "./artifacts-BbdOMET5.mjs";
|
|
6
|
-
import { n as listExtensions, r as reloadExtensions, t as ensureWorkflowsLoaded } from "./ExtensionManager-
|
|
6
|
+
import { n as listExtensions, r as reloadExtensions, t as ensureWorkflowsLoaded } from "./ExtensionManager-D5-bO9D8.mjs";
|
|
7
7
|
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
8
8
|
import { CompleteRequestSchema, ErrorCode, McpError } from "@modelcontextprotocol/sdk/types.js";
|
|
9
9
|
import { promises } from "fs";
|
|
@@ -1097,6 +1097,11 @@ async function closeServer(ctx) {
|
|
|
1097
1097
|
} catch (error) {
|
|
1098
1098
|
logger.warn("MCP server close failed:", error);
|
|
1099
1099
|
}
|
|
1100
|
+
try {
|
|
1101
|
+
await ProcessRegistry.terminateAll();
|
|
1102
|
+
} catch (error) {
|
|
1103
|
+
logger.warn("ProcessRegistry cleanup failed:", error);
|
|
1104
|
+
}
|
|
1100
1105
|
logger.success("MCP server closed");
|
|
1101
1106
|
})();
|
|
1102
1107
|
return ctx.shutdownPromise;
|
|
@@ -1758,6 +1763,8 @@ var EmbeddingEngine = class {
|
|
|
1758
1763
|
ensureWorker() {
|
|
1759
1764
|
if (this.worker) return;
|
|
1760
1765
|
this.worker = new Worker(new URL("./EmbeddingWorker.js", import.meta.url));
|
|
1766
|
+
if (typeof this.worker.unref === "function") this.worker.unref();
|
|
1767
|
+
ProcessRegistry.register(this.worker);
|
|
1761
1768
|
this.worker.on("message", (msg) => {
|
|
1762
1769
|
const req = this.pending.get(msg.id);
|
|
1763
1770
|
if (!req) return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jshookmcp/jshook",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.8",
|
|
4
4
|
"description": "MCP server with built-in tools across multiple domains for AI-assisted JavaScript analysis and security analysis — browser automation, CDP debugging, network monitoring, JS hooks, code analysis, and workflow orchestration",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -66,40 +66,6 @@
|
|
|
66
66
|
"access": "public",
|
|
67
67
|
"registry": "https://registry.npmjs.org"
|
|
68
68
|
},
|
|
69
|
-
"scripts": {
|
|
70
|
-
"build": "node scripts/clean-dist.mjs && node scripts/generate-domains-index.mjs && tsdown && corepack pnpm -C packages/extension-sdk build",
|
|
71
|
-
"typecheck": "tsc --noEmit -p tsconfig.json && corepack pnpm -C packages/extension-sdk typecheck",
|
|
72
|
-
"deps:update": "corepack pnpm update -r",
|
|
73
|
-
"dev": "tsx --conditions=development watch src/index.ts",
|
|
74
|
-
"start": "node dist/index.mjs",
|
|
75
|
-
"doctor": "tsx src/cli/doctor.ts",
|
|
76
|
-
"docs:generate": "node scripts/generate-vitepress-reference.mjs",
|
|
77
|
-
"docs:dev": "vitepress dev docs --host 127.0.0.1 --port 5173",
|
|
78
|
-
"docs:build": "corepack pnpm run docs:generate && vitepress build docs",
|
|
79
|
-
"docs:preview": "vitepress preview docs --host 127.0.0.1 --port 4173",
|
|
80
|
-
"lint:md": "corepack pnpm dlx markdownlint-cli2 README.md README.zh.md CONTRIBUTING.md docs/**/*.md",
|
|
81
|
-
"lint": "oxlint src/ tests/",
|
|
82
|
-
"lint:fix": "oxlint --fix src/ tests/",
|
|
83
|
-
"format": "oxfmt \"src/**\" \"tests/**\" \"!tests/tmp/**\" --write --no-error-on-unmatched-pattern",
|
|
84
|
-
"format:check": "oxfmt \"src/**\" \"tests/**\" \"!tests/tmp/**\" --check --no-error-on-unmatched-pattern",
|
|
85
|
-
"test": "node scripts/run-vitest-smart.mjs run",
|
|
86
|
-
"test:e2e": "cross-env E2E_TARGET_URL=https://vmoranv.github.io/jshookmcp/ vitest run --config tests/e2e/vitest.e2e.config.ts",
|
|
87
|
-
"test:coverage": "node -e \"require('fs').mkdirSync('coverage/.tmp', { recursive: true })\" && cross-env ENABLE_INJECTION_TOOLS=true COVERAGE_FULL=true node scripts/run-vitest-smart.mjs run --coverage",
|
|
88
|
-
"prepack": "corepack pnpm run metadata:check && corepack pnpm run build",
|
|
89
|
-
"package:verify-bin": "node scripts/verify-packed-bin.mjs",
|
|
90
|
-
"package:verify-install": "node scripts/verify-packed-install.mjs",
|
|
91
|
-
"package:verify-release": "node scripts/verify-release-artifact.mjs",
|
|
92
|
-
"audit:tools": "tsx scripts/audit-tools.mjs",
|
|
93
|
-
"git:refresh-noise": "node scripts/refresh-git-noise.mjs",
|
|
94
|
-
"check": "corepack pnpm run metadata:check && corepack pnpm run lint && corepack pnpm run format:check && corepack pnpm run typecheck && corepack pnpm run test",
|
|
95
|
-
"package": "corepack pnpm pack",
|
|
96
|
-
"prepublishOnly": "corepack pnpm run check",
|
|
97
|
-
"postinstall": "node scripts/postinstall.cjs",
|
|
98
|
-
"install:full": "corepack pnpm install && corepack pnpm exec camoufox-js fetch",
|
|
99
|
-
"metadata:sync": "node scripts/generate-metadata.mjs --write",
|
|
100
|
-
"metadata:check": "node scripts/generate-metadata.mjs --check",
|
|
101
|
-
"check:docs-format": "corepack pnpm run lint:md"
|
|
102
|
-
},
|
|
103
69
|
"dependencies": {
|
|
104
70
|
"@babel/generator": "^7.29.1",
|
|
105
71
|
"@babel/parser": "^7.29.2",
|
|
@@ -153,33 +119,37 @@
|
|
|
153
119
|
"engines": {
|
|
154
120
|
"node": "^20.19.0 || >=22.12.0"
|
|
155
121
|
},
|
|
156
|
-
"
|
|
157
|
-
"
|
|
158
|
-
"
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
"
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
122
|
+
"mcpName": "io.github.vmoranv/jshookmcp",
|
|
123
|
+
"scripts": {
|
|
124
|
+
"build": "node scripts/clean-dist.mjs && node scripts/generate-domains-index.mjs && tsdown && corepack pnpm -C packages/extension-sdk build",
|
|
125
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && corepack pnpm -C packages/extension-sdk typecheck",
|
|
126
|
+
"deps:update": "corepack pnpm update -r",
|
|
127
|
+
"dev": "tsx --conditions=development watch src/index.ts",
|
|
128
|
+
"start": "node dist/index.mjs",
|
|
129
|
+
"doctor": "tsx src/cli/doctor.ts",
|
|
130
|
+
"docs:generate": "node scripts/generate-vitepress-reference.mjs",
|
|
131
|
+
"docs:dev": "vitepress dev docs --host 127.0.0.1 --port 5173",
|
|
132
|
+
"docs:build": "corepack pnpm run docs:generate && vitepress build docs",
|
|
133
|
+
"docs:preview": "vitepress preview docs --host 127.0.0.1 --port 4173",
|
|
134
|
+
"lint:md": "corepack pnpm dlx markdownlint-cli2 README.md README.zh.md CONTRIBUTING.md docs/**/*.md",
|
|
135
|
+
"lint": "oxlint src/ tests/",
|
|
136
|
+
"lint:fix": "oxlint --fix src/ tests/",
|
|
137
|
+
"format": "oxfmt \"src/**\" \"tests/**\" \"!tests/tmp/**\" --write --no-error-on-unmatched-pattern",
|
|
138
|
+
"format:check": "oxfmt \"src/**\" \"tests/**\" \"!tests/tmp/**\" --check --no-error-on-unmatched-pattern",
|
|
139
|
+
"test": "node scripts/run-vitest-smart.mjs run",
|
|
140
|
+
"test:e2e": "cross-env E2E_TARGET_URL=https://vmoranv.github.io/jshookmcp/ vitest run --config tests/e2e/vitest.e2e.config.ts",
|
|
141
|
+
"test:coverage": "node -e \"require('fs').mkdirSync('coverage/.tmp', { recursive: true })\" && cross-env ENABLE_INJECTION_TOOLS=true COVERAGE_FULL=true node scripts/run-vitest-smart.mjs run --coverage",
|
|
142
|
+
"package:verify-bin": "node scripts/verify-packed-bin.mjs",
|
|
143
|
+
"package:verify-install": "node scripts/verify-packed-install.mjs",
|
|
144
|
+
"package:verify-release": "node scripts/verify-release-artifact.mjs",
|
|
145
|
+
"audit:tools": "tsx scripts/audit-tools.mjs",
|
|
146
|
+
"git:refresh-noise": "node scripts/refresh-git-noise.mjs",
|
|
147
|
+
"check": "corepack pnpm run metadata:check && corepack pnpm run lint && corepack pnpm run format:check && corepack pnpm run typecheck && corepack pnpm run test",
|
|
148
|
+
"package": "corepack pnpm pack",
|
|
149
|
+
"postinstall": "node scripts/postinstall.cjs",
|
|
150
|
+
"install:full": "corepack pnpm install && corepack pnpm exec camoufox-js fetch",
|
|
151
|
+
"metadata:sync": "node scripts/generate-metadata.mjs --write",
|
|
152
|
+
"metadata:check": "node scripts/generate-metadata.mjs --check",
|
|
153
|
+
"check:docs-format": "corepack pnpm run lint:md"
|
|
154
|
+
}
|
|
155
|
+
}
|