@humain/terminal 0.0.3-beta.0 → 0.0.3-beta.2
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/CHANGELOG.md +13 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +4 -3
- package/dist/config.js.map +1 -1
- package/dist/humain/mcp-adapter/vendor/CHANGELOG.md +13 -0
- package/dist/humain/mcp-adapter/vendor/README.md +4 -1
- package/dist/humain/mcp-adapter/vendor/agent-dir.ts +12 -4
- package/dist/humain/mcp-adapter/vendor/cli.js +25 -4
- package/dist/humain/mcp-adapter/vendor/config.ts +4 -4
- package/dist/humain/mcp-adapter/vendor/direct-tools.ts +18 -15
- package/dist/humain/mcp-adapter/vendor/index.bundle.mjs +416 -60
- package/dist/humain/mcp-adapter/vendor/mcp-setup-panel.ts +2 -1
- package/dist/humain/mcp-adapter/vendor/metadata-cache.ts +18 -8
- package/dist/humain/mcp-adapter/vendor/package.json +177 -176
- package/dist/humain/mcp-adapter/vendor/request-headers-command.ts +336 -0
- package/dist/humain/mcp-adapter/vendor/server-manager.ts +5 -0
- package/dist/humain/mcp-adapter/vendor/tool-metadata.ts +38 -18
- package/dist/humain/mcp-adapter/vendor/types.ts +93 -10
- package/dist/humain/web-access/vendor/auth-fetch.d.ts +13 -0
- package/dist/humain/web-access/vendor/auth-fetch.d.ts.map +1 -0
- package/dist/humain/web-access/vendor/auth-fetch.js +134 -0
- package/dist/humain/web-access/vendor/auth-fetch.js.map +1 -0
- package/dist/humain/web-access/vendor/chrome-cookies.d.ts +13 -0
- package/dist/humain/web-access/vendor/chrome-cookies.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/chrome-cookies.js +106 -22
- package/dist/humain/web-access/vendor/chrome-cookies.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.d.ts +1 -0
- package/dist/humain/web-access/vendor/curator-page.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-page.js +3 -1
- package/dist/humain/web-access/vendor/curator-page.js.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.d.ts +1 -0
- package/dist/humain/web-access/vendor/curator-server.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/curator-server.js +2 -0
- package/dist/humain/web-access/vendor/curator-server.js.map +1 -1
- package/dist/humain/web-access/vendor/extract.d.ts +2 -0
- package/dist/humain/web-access/vendor/extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/extract.js +79 -17
- package/dist/humain/web-access/vendor/extract.js.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.d.ts +2 -0
- package/dist/humain/web-access/vendor/fetch-params.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/fetch-params.js +17 -3
- package/dist/humain/web-access/vendor/fetch-params.js.map +1 -1
- package/dist/humain/web-access/vendor/firecrawl.d.ts +7 -0
- package/dist/humain/web-access/vendor/firecrawl.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/firecrawl.js +141 -10
- package/dist/humain/web-access/vendor/firecrawl.js.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.d.ts +2 -2
- package/dist/humain/web-access/vendor/gemini-search.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/gemini-search.js +22 -4
- package/dist/humain/web-access/vendor/gemini-search.js.map +1 -1
- package/dist/humain/web-access/vendor/index.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/index.js +122 -48
- package/dist/humain/web-access/vendor/index.js.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts +3 -1
- package/dist/humain/web-access/vendor/summary-review.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/summary-review.js +6 -3
- package/dist/humain/web-access/vendor/summary-review.js.map +1 -1
- package/dist/humain/web-access/vendor/youtube-extract.d.ts.map +1 -1
- package/dist/humain/web-access/vendor/youtube-extract.js +2 -2
- package/dist/humain/web-access/vendor/youtube-extract.js.map +1 -1
- package/dist/utils/clipboard-image.d.ts.map +1 -1
- package/dist/utils/clipboard-image.js +2 -0
- package/dist/utils/clipboard-image.js.map +1 -1
- package/npm-shrinkwrap.json +7 -7
- package/package.json +6 -6
- package/src/humain/mcp-adapter/UPSTREAM.md +1 -1
- package/src/humain/mcp-adapter/upstream.json +3 -3
- package/src/humain/mcp-adapter/vendor/CHANGELOG.md +13 -0
- package/src/humain/web-access/UPSTREAM.md +1 -1
- package/src/humain/web-access/upstream.json +4 -4
|
@@ -11,7 +11,7 @@ import { formatSchema } from "./tool-metadata.ts";
|
|
|
11
11
|
import { resolveMcpResultContent, transformMcpContent, transformMcpResourceContents } from "./tool-registrar.ts";
|
|
12
12
|
import { guardMcpOutput, guardedMcpDetails, resolveMcpOutputGuardOptions } from "./mcp-output-guard.ts";
|
|
13
13
|
import { maybeStartUiSession, summarizeUiSessionResult, type UiSessionRuntime } from "./ui-session.ts";
|
|
14
|
-
import { formatToolName, getToolNameCandidates, isServerDisabled, isToolAllowed, resolveToolPrefix } from "./types.ts";
|
|
14
|
+
import { createToolSelectorCandidateIndex, formatToolName, getToolNameCandidates, isServerDisabled, isToolAllowed, resolveToolPrefix } from "./types.ts";
|
|
15
15
|
import { isUiToolVisibleToModel } from "./ui-tool-visibility.ts";
|
|
16
16
|
import { resourceNameToToolName } from "./resource-tools.ts";
|
|
17
17
|
import { authenticate, supportsOAuth } from "./mcp-auth-flow.ts";
|
|
@@ -150,7 +150,10 @@ export function resolveDirectTools(
|
|
|
150
150
|
if (!toolFilter) continue;
|
|
151
151
|
|
|
152
152
|
const effectivePrefix = resolveToolPrefix(definition, prefix);
|
|
153
|
-
const
|
|
153
|
+
const hasToolFilters =
|
|
154
|
+
(Array.isArray(definition.includeTools) && definition.includeTools.length > 0) ||
|
|
155
|
+
(Array.isArray(definition.excludeTools) && definition.excludeTools.length > 0);
|
|
156
|
+
const selectorCandidateIndex = hasToolFilters ? (() => {
|
|
154
157
|
const candidates = new Set<string>();
|
|
155
158
|
for (const [otherServerName, otherDefinition] of Object.entries(config.mcpServers)) {
|
|
156
159
|
const otherCache = cache.servers[otherServerName];
|
|
@@ -167,14 +170,13 @@ export function resolveDirectTools(
|
|
|
167
170
|
}
|
|
168
171
|
}
|
|
169
172
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
};
|
|
173
|
+
return createToolSelectorCandidateIndex(candidates);
|
|
174
|
+
})() : undefined;
|
|
173
175
|
|
|
174
176
|
for (const tool of serverCache.tools ?? []) {
|
|
175
177
|
if (!isUiToolVisibleToModel(tool.uiVisibility)) continue;
|
|
176
178
|
if (toolFilter !== true && !toolFilter.includes(tool.name)) continue;
|
|
177
|
-
if (!isToolAllowed(tool.name, serverName, effectivePrefix, definition.includeTools, definition.excludeTools,
|
|
179
|
+
if (!isToolAllowed(tool.name, serverName, effectivePrefix, definition.includeTools, definition.excludeTools, selectorCandidateIndex)) continue;
|
|
178
180
|
const prefixedName = formatToolName(tool.name, serverName, effectivePrefix);
|
|
179
181
|
if (BUILTIN_NAMES.has(prefixedName)) {
|
|
180
182
|
console.warn(`MCP: skipping direct tool "${prefixedName}" (collides with builtin)`);
|
|
@@ -200,7 +202,7 @@ export function resolveDirectTools(
|
|
|
200
202
|
for (const resource of serverCache.resources ?? []) {
|
|
201
203
|
const baseName = `read_${resourceNameToToolName(resource.name)}`;
|
|
202
204
|
if (toolFilter !== true && !toolFilter.includes(baseName)) continue;
|
|
203
|
-
if (!isToolAllowed(baseName, serverName, effectivePrefix, definition.includeTools, definition.excludeTools,
|
|
205
|
+
if (!isToolAllowed(baseName, serverName, effectivePrefix, definition.includeTools, definition.excludeTools, selectorCandidateIndex)) continue;
|
|
204
206
|
const prefixedName = formatToolName(baseName, serverName, effectivePrefix);
|
|
205
207
|
if (BUILTIN_NAMES.has(prefixedName)) {
|
|
206
208
|
console.warn(`MCP: skipping direct resource tool "${prefixedName}" (collides with builtin)`);
|
|
@@ -222,7 +224,7 @@ export function resolveDirectTools(
|
|
|
222
224
|
}
|
|
223
225
|
}
|
|
224
226
|
|
|
225
|
-
if (specs.length >= DIRECT_TOOLS_ADVISORY_THRESHOLD) {
|
|
227
|
+
if (config.settings?.warnOnLargeDirectTools !== false && specs.length >= DIRECT_TOOLS_ADVISORY_THRESHOLD) {
|
|
226
228
|
console.warn(`MCP: ${specs.length} direct tools resolved. Each direct tool adds prompt context; README guidance recommends targeted sets of 5-20 tools and using the proxy or an explicit string[] when 75+ direct tools would be registered.`);
|
|
227
229
|
}
|
|
228
230
|
|
|
@@ -255,8 +257,10 @@ export function buildProxyDescription(
|
|
|
255
257
|
const cachedEntry = cache?.servers?.[serverName];
|
|
256
258
|
const entry = cachedEntry && isServerCacheValid(cachedEntry, definition) ? cachedEntry : undefined;
|
|
257
259
|
const effectivePrefix = resolveToolPrefix(definition, prefix);
|
|
258
|
-
const
|
|
259
|
-
|
|
260
|
+
const hasToolFilters =
|
|
261
|
+
(Array.isArray(definition.includeTools) && definition.includeTools.length > 0) ||
|
|
262
|
+
(Array.isArray(definition.excludeTools) && definition.excludeTools.length > 0);
|
|
263
|
+
const selectorCandidateIndex = hasToolFilters && cache ? (() => {
|
|
260
264
|
const candidates = new Set<string>();
|
|
261
265
|
for (const [otherServerName, otherDefinition] of Object.entries(config.mcpServers)) {
|
|
262
266
|
const otherEntry = cache.servers[otherServerName];
|
|
@@ -273,17 +277,16 @@ export function buildProxyDescription(
|
|
|
273
277
|
}
|
|
274
278
|
}
|
|
275
279
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
};
|
|
280
|
+
return createToolSelectorCandidateIndex(candidates);
|
|
281
|
+
})() : undefined;
|
|
279
282
|
const toolCount = (entry?.tools ?? []).filter(
|
|
280
283
|
(tool) => isUiToolVisibleToModel(tool.uiVisibility)
|
|
281
|
-
&& isToolAllowed(tool.name, serverName, effectivePrefix, definition.includeTools, definition.excludeTools,
|
|
284
|
+
&& isToolAllowed(tool.name, serverName, effectivePrefix, definition.includeTools, definition.excludeTools, selectorCandidateIndex),
|
|
282
285
|
).length;
|
|
283
286
|
const resourceCount = definition?.exposeResources !== false
|
|
284
287
|
? (entry?.resources ?? []).filter((resource) => {
|
|
285
288
|
const baseName = `read_${resourceNameToToolName(resource.name)}`;
|
|
286
|
-
return isToolAllowed(baseName, serverName, effectivePrefix, definition.includeTools, definition.excludeTools,
|
|
289
|
+
return isToolAllowed(baseName, serverName, effectivePrefix, definition.includeTools, definition.excludeTools, selectorCandidateIndex);
|
|
287
290
|
}).length
|
|
288
291
|
: 0;
|
|
289
292
|
const totalItems = toolCount + resourceCount;
|