@agent-native/core 0.227.0 → 0.228.0-nightly-20261111004142
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/action.d.ts +6 -2
- package/dist/agent/engine/builder-engine.js +6 -1
- package/dist/agent/engine/tool-call-journal-seed.d.ts +2 -0
- package/dist/agent/engine/tool-call-journal-seed.js +14 -0
- package/dist/agent/harness/store.js +14 -0
- package/dist/agent/production-agent.js +257 -17
- package/dist/agent/reaped-run-thread.js +6 -0
- package/dist/agent/run-manager.js +6 -0
- package/dist/agent/tool-call-journal.d.ts +4 -0
- package/dist/agent/tool-call-journal.js +12 -0
- package/dist/agent/types.d.ts +7 -1
- package/dist/app-config/agent.d.ts +3 -0
- package/dist/app-config/agent.js +7 -0
- package/dist/app-config/schema.d.ts +3 -0
- package/dist/application-state/handlers.d.ts +3 -3
- package/dist/application-state/handlers.js +6 -1
- package/dist/application-state/index.d.ts +3 -2
- package/dist/application-state/index.js +3 -2
- package/dist/application-state/last-used-tab.d.ts +11 -0
- package/dist/application-state/last-used-tab.js +43 -0
- package/dist/application-state/script-helpers.d.ts +26 -0
- package/dist/application-state/script-helpers.js +83 -15
- package/dist/application-state/store.d.ts +8 -0
- package/dist/application-state/store.js +16 -0
- package/dist/cli/agent.js +7 -3
- package/dist/cli/code-agent-executor.d.ts +1 -0
- package/dist/cli/code-agent-executor.js +37 -2
- package/dist/cli/code.js +3 -1
- package/dist/client/agent-sidebar-state.d.ts +2 -0
- package/dist/client/browser-tab-use.d.ts +9 -0
- package/dist/client/browser-tab-use.js +112 -0
- package/dist/client/chat/runtime.js +3 -1
- package/dist/client/error-capture.js +33 -1
- package/dist/client/navigation/index.d.ts +1 -0
- package/dist/client/navigation/index.js +1 -0
- package/dist/client/resources/mcp-integration-logos.js +16 -0
- package/dist/client/review/use-review.d.ts +28 -0
- package/dist/client/review/use-review.js +41 -12
- package/dist/client/route-state.js +2 -0
- package/dist/client/sse-event-processor.d.ts +1 -0
- package/dist/client/sse-event-processor.js +7 -1
- package/dist/client/use-db-sync.d.ts +8 -1
- package/dist/client/use-db-sync.js +6 -5
- package/dist/coding-tools/run-code.js +12 -2
- package/dist/coding-tools/sandbox/executions-store.d.ts +1 -1
- package/dist/coding-tools/sandbox/executions-store.js +9 -3
- package/dist/collab/routes.d.ts +1 -1
- package/dist/data-programs/execute.js +1 -1
- package/dist/db/schema-snapshot.generated.js +17 -3
- package/dist/extensions/url-safety.d.ts +1 -3
- package/dist/extensions/url-safety.js +23 -23
- package/dist/file-upload/actions/upload-image.d.ts +5 -5
- package/dist/file-upload/index.d.ts +1 -1
- package/dist/file-upload/index.js +1 -1
- package/dist/file-upload/s3-client.d.ts +1 -0
- package/dist/file-upload/s3-client.js +70 -13
- package/dist/file-upload/s3.d.ts +9 -0
- package/dist/file-upload/s3.js +14 -1
- package/dist/framework-package-versions.json +8 -8
- package/dist/jobs/run-history.js +10 -3
- package/dist/jobs/scheduler.js +5 -36
- package/dist/localization/core-messages/supplemental/ar-SA.js +35 -0
- package/dist/localization/core-messages/supplemental/de-DE.js +35 -0
- package/dist/localization/core-messages/supplemental/en-US.js +35 -0
- package/dist/localization/core-messages/supplemental/es-ES.js +35 -0
- package/dist/localization/core-messages/supplemental/fr-FR.js +35 -0
- package/dist/localization/core-messages/supplemental/hi-IN.js +35 -0
- package/dist/localization/core-messages/supplemental/ja-JP.js +35 -0
- package/dist/localization/core-messages/supplemental/ko-KR.js +35 -0
- package/dist/localization/core-messages/supplemental/pt-BR.js +35 -0
- package/dist/localization/core-messages/supplemental/zh-CN.js +35 -0
- package/dist/localization/core-messages/supplemental/zh-TW.js +35 -0
- package/dist/localization/default-messages.d.ts +35 -0
- package/dist/localization/default-messages.js +35 -0
- package/dist/localization/mcp-settings-messages.d.ts +35 -0
- package/dist/mcp/actions/list-mcp-client-connections.d.ts +8 -0
- package/dist/mcp/actions/list-mcp-client-connections.js +39 -0
- package/dist/mcp/browser-tab-target.d.ts +16 -0
- package/dist/mcp/browser-tab-target.js +58 -0
- package/dist/mcp/build-server.d.ts +1 -0
- package/dist/mcp/build-server.js +38 -7
- package/dist/mcp/call-attribution.d.ts +4 -1
- package/dist/mcp/call-attribution.js +3 -1
- package/dist/mcp/client-connections.d.ts +6 -0
- package/dist/mcp/client-connections.js +91 -0
- package/dist/mcp/connect-route.js +12 -2
- package/dist/mcp/connect-store.d.ts +3 -0
- package/dist/mcp/connect-store.js +10 -1
- package/dist/mcp/direct-action-call.js +1 -0
- package/dist/mcp/oauth-store.d.ts +6 -0
- package/dist/mcp/oauth-store.js +23 -0
- package/dist/mcp/oauth-token.d.ts +1 -0
- package/dist/mcp/oauth-token.js +1 -0
- package/dist/mcp/server.js +9 -20
- package/dist/mcp-client/config.d.ts +2 -0
- package/dist/mcp-client/manager.js +23 -0
- package/dist/mcp-client/workspace-servers.js +42 -10
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/org/handlers.d.ts +1 -1
- package/dist/org/handlers.js +21 -17
- package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
- package/dist/provider-api/actions/provider-api.d.ts +8 -8
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/provider-api/index.js +17 -36
- package/dist/review/actions/create-review-comment.d.ts +7 -0
- package/dist/review/actions/create-review-comment.js +29 -3
- package/dist/review/actions/delete-review-comment.js +2 -2
- package/dist/review/actions/list-review-comments.d.ts +3 -0
- package/dist/review/actions/list-review-comments.js +41 -17
- package/dist/review/actions/react-to-review-comment.js +2 -2
- package/dist/review/actions/reply-review-comment.d.ts +4 -0
- package/dist/review/actions/reply-review-comment.js +15 -6
- package/dist/review/actions/update-review-comment-anchor.d.ts +6 -0
- package/dist/review/actions/update-review-comment-anchor.js +39 -10
- package/dist/review/actions/update-review-comment.d.ts +3 -0
- package/dist/review/actions/update-review-comment.js +28 -3
- package/dist/review/errors.d.ts +33 -0
- package/dist/review/errors.js +51 -0
- package/dist/review/index.d.ts +5 -4
- package/dist/review/index.js +3 -2
- package/dist/review/registry.d.ts +51 -1
- package/dist/review/registry.js +117 -0
- package/dist/review/store.d.ts +59 -14
- package/dist/review/store.js +622 -101
- package/dist/review/suggestions/actions.js +65 -10
- package/dist/review/suggestions/actor-kind.d.ts +5 -0
- package/dist/review/suggestions/actor-kind.js +20 -0
- package/dist/review/suggestions/store.js +16 -2
- package/dist/review/suggestions/types.d.ts +13 -0
- package/dist/review/types.d.ts +89 -0
- package/dist/scripts/db/dev-query-proxy.d.ts +2 -0
- package/dist/scripts/db/dev-query-proxy.js +4 -1
- package/dist/scripts/db/query.js +3 -0
- package/dist/scripts/dev/shell.js +4 -0
- package/dist/scripts/dev-session.d.ts +31 -0
- package/dist/scripts/dev-session.js +58 -0
- package/dist/scripts/resources/list.js +53 -4
- package/dist/scripts/runner.js +22 -4
- package/dist/search/query.d.ts +11 -5
- package/dist/search/query.js +52 -15
- package/dist/search/tokenize.d.ts +1 -0
- package/dist/search/tokenize.js +3 -0
- package/dist/secrets/api-keys.d.ts +4 -0
- package/dist/secrets/api-keys.js +5 -0
- package/dist/secrets/register.d.ts +2 -0
- package/dist/secrets/routes.d.ts +2 -2
- package/dist/secrets/routes.js +85 -6
- package/dist/secrets/storage.d.ts +2 -0
- package/dist/secrets/storage.js +34 -9
- package/dist/secrets/substitution.d.ts +3 -2
- package/dist/secrets/substitution.js +56 -7
- package/dist/server/action-discovery.js +5 -0
- package/dist/server/action-routes.js +8 -6
- package/dist/server/agent-chat/prompt-resources.js +117 -79
- package/dist/server/agent-chat/script-entries.js +15 -8
- package/dist/server/agent-chat-plugin.js +9 -4
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/agent-engine-ollama-models-route.d.ts +1 -1
- package/dist/server/agents-bundle.d.ts +3 -1
- package/dist/server/agents-bundle.js +4 -4
- package/dist/server/csrf.js +1 -0
- package/dist/server/dev-action-bridge.d.ts +2 -0
- package/dist/server/dev-action-bridge.js +34 -5
- package/dist/server/first-touch-route.d.ts +1 -1
- package/dist/server/http-response-telemetry.js +4 -0
- package/dist/server/loopback.js +3 -1
- package/dist/server/request-context.d.ts +26 -0
- package/dist/shared/app-state-routes.d.ts +7 -0
- package/dist/shared/app-state-routes.js +7 -0
- package/dist/shared/mcp-client-connections.d.ts +41 -0
- package/dist/shared/mcp-client-connections.js +18 -0
- package/dist/shared/mcp-connect-content.d.ts +18 -0
- package/dist/shared/mcp-connect-content.js +200 -172
- package/dist/shared/runtime-config.js +5 -1
- package/dist/templates/chat/.agents/skills/context-awareness/SKILL.md +13 -0
- package/dist/templates/default/.agents/skills/context-awareness/SKILL.md +13 -0
- package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +13 -0
- package/dist/tracking/providers.d.ts +7 -0
- package/dist/tracking/providers.js +39 -17
- package/dist/triggers/condition-evaluator.d.ts +2 -0
- package/dist/triggers/condition-evaluator.js +93 -3
- package/dist/triggers/dispatcher.js +24 -6
- package/docs/AGENTS.md +16 -16
- package/docs/content/create-with-an-agent.mdx +10 -4
- package/docs/content/durable-resume.mdx +11 -2
- package/docs/content/toolkit-comments-review.mdx +54 -1
- package/package.json +5 -4
- package/src/templates/chat/.agents/skills/context-awareness/SKILL.md +13 -0
- package/src/templates/default/.agents/skills/context-awareness/SKILL.md +13 -0
- package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +13 -0
|
@@ -29,7 +29,7 @@ import { actionCallIntent, preparedCallArguments, preparedCallNeedsApproval, rec
|
|
|
29
29
|
import { getAppConfig } from "../app-config/index.js";
|
|
30
30
|
import { runApprovedCliAction } from "../cli/action-approval.js";
|
|
31
31
|
import { getRuntimeDatabaseUrl } from "../db/client.js";
|
|
32
|
-
import { resolveDevUserEmail } from "../scripts/dev-session.js";
|
|
32
|
+
import { resolveDevOrgScope, resolveDevUserEmail, } from "../scripts/dev-session.js";
|
|
33
33
|
import { notifyActionChange } from "./action-change.js";
|
|
34
34
|
import { resolveDeployEnvironment } from "./deploy-environment.js";
|
|
35
35
|
import { DEV_ACTION_DISCOVERY_PATH, readDevActionDiscoveryFile, } from "./dev-action-discovery.js";
|
|
@@ -42,7 +42,31 @@ export const DEV_DB_MIGRATE_ROUTE = "/_agent-native/dev/db-migrate";
|
|
|
42
42
|
export const DEV_ACTION_TOKEN_HEADER = "x-agent-native-dev-token";
|
|
43
43
|
export const DEV_ACTION_USER_HEADER = "x-agent-native-dev-user";
|
|
44
44
|
export const DEV_ACTION_ORG_HEADER = "x-agent-native-dev-org";
|
|
45
|
+
/** "personal" when the CLI caller acts in no org; see AGENT_ORG_SCOPE_ENV. */
|
|
46
|
+
export const DEV_ACTION_ORG_SCOPE_HEADER = "x-agent-native-dev-org-scope";
|
|
45
47
|
export { readDevActionDiscoveryFile } from "./dev-action-discovery.js";
|
|
48
|
+
function devOrgChoiceFromHeaders(event) {
|
|
49
|
+
return {
|
|
50
|
+
orgId: getHeader(event, DEV_ACTION_ORG_HEADER) || undefined,
|
|
51
|
+
personal: getHeader(event, DEV_ACTION_ORG_SCOPE_HEADER) === "personal",
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The caller's org scope, or the route's usual error response when the org
|
|
56
|
+
* lookup fails, so the CLI shows the database's message.
|
|
57
|
+
*/
|
|
58
|
+
async function resolveDevOrgScopeForRoute(event, userEmail) {
|
|
59
|
+
try {
|
|
60
|
+
return await resolveDevOrgScope(userEmail, devOrgChoiceFromHeaders(event));
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
setResponseStatus(event, 500);
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
error: error instanceof Error ? error.message : String(error),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
}
|
|
46
70
|
export function hashDatabaseKey(databaseUrl) {
|
|
47
71
|
return crypto.createHash("sha256").update(databaseUrl).digest("hex");
|
|
48
72
|
}
|
|
@@ -268,10 +292,12 @@ export function mountDevActionForwardRoute(nitroApp, actions, options) {
|
|
|
268
292
|
const params = (body?.input ?? {});
|
|
269
293
|
const userEmail = getHeader(event, DEV_ACTION_USER_HEADER) ||
|
|
270
294
|
(await resolveDevUserEmail());
|
|
271
|
-
const
|
|
295
|
+
const orgScope = await resolveDevOrgScopeForRoute(event, userEmail);
|
|
296
|
+
if ("error" in orgScope)
|
|
297
|
+
return orgScope;
|
|
272
298
|
const context = {
|
|
273
299
|
userEmail,
|
|
274
|
-
|
|
300
|
+
...orgScope,
|
|
275
301
|
requestOrigin: getForwardedRequestOrigin(event),
|
|
276
302
|
};
|
|
277
303
|
return runWithRequestContext(context, async () => {
|
|
@@ -379,8 +405,11 @@ export function mountDevDbQueryForwardRoute(nitroApp) {
|
|
|
379
405
|
const limit = typeof body?.limit === "number" ? body.limit : undefined;
|
|
380
406
|
const userEmail = getHeader(event, DEV_ACTION_USER_HEADER) ||
|
|
381
407
|
(await resolveDevUserEmail());
|
|
382
|
-
const
|
|
383
|
-
|
|
408
|
+
const orgScope = await resolveDevOrgScopeForRoute(event, userEmail);
|
|
409
|
+
if ("error" in orgScope)
|
|
410
|
+
return orgScope;
|
|
411
|
+
const context = { ...(userEmail ? { userEmail } : {}), ...orgScope };
|
|
412
|
+
return runWithRequestContext(context, async () => {
|
|
384
413
|
try {
|
|
385
414
|
const { runDbQuery } = await import("../scripts/db/query.js");
|
|
386
415
|
const databaseUrl = getRuntimeDatabaseUrl("pglite:./data/pglite");
|
|
@@ -17,8 +17,8 @@ export type FirstTouchSyncResult = {
|
|
|
17
17
|
* browser's `an_ft` and `an_lt` again, so Safari keeps them their 30 days.
|
|
18
18
|
*/
|
|
19
19
|
export declare function createFirstTouchHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
|
|
20
|
-
error: string;
|
|
21
20
|
reason?: undefined;
|
|
21
|
+
error: string;
|
|
22
22
|
stored?: undefined;
|
|
23
23
|
firstTouch?: undefined;
|
|
24
24
|
} | {
|
|
@@ -4,6 +4,7 @@ import { claimStartupDatabaseTelemetry, createDatabaseRequestTelemetry, enterDat
|
|
|
4
4
|
import { flushObservability, recordHttpServerHandoff, recordHttpServerRequest, } from "../observability/metrics.js";
|
|
5
5
|
import { createTrackingEventScope, endAgentSpan, flushTrackingEvents, startAgentSpan, } from "../observability/tracing.js";
|
|
6
6
|
import { trackingIdentityProperties } from "../observability/tracking-identity.js";
|
|
7
|
+
import { flushTrackingSendsForResponse } from "../tracking/providers.js";
|
|
7
8
|
import { getAppBasePathFromViteEnv, stripAppBasePath, } from "./app-base-path.js";
|
|
8
9
|
import { platformWaitUntil, runInBackground } from "./background-work.js";
|
|
9
10
|
import { httpRouteForRequest } from "./http-route.js";
|
|
@@ -220,6 +221,9 @@ async function emitTelemetry(event, state, response, durationMs) {
|
|
|
220
221
|
});
|
|
221
222
|
const flush = async () => {
|
|
222
223
|
await flushTrackingEvents(state.trackingScope);
|
|
224
|
+
// After the scope's tracking work, so the events it queues as it finishes
|
|
225
|
+
// are sent along with those still under way when the reply goes out.
|
|
226
|
+
await flushTrackingSendsForResponse();
|
|
223
227
|
await flushObservability();
|
|
224
228
|
};
|
|
225
229
|
const exported = flush().catch((error) => {
|
package/dist/server/loopback.js
CHANGED
|
@@ -27,8 +27,9 @@ export function isDirectLoopbackRequest(event) {
|
|
|
27
27
|
normalizedName.startsWith("x-forwarded-"));
|
|
28
28
|
});
|
|
29
29
|
if (!isLoopbackRequest(event) ||
|
|
30
|
+
!isLoopbackAddress(socket?.remoteAddress) ||
|
|
30
31
|
typeof host !== "string" ||
|
|
31
|
-
!/^127\.0\.0\.1
|
|
32
|
+
!/^127\.0\.0\.1:\d{1,5}$/.test(host) ||
|
|
32
33
|
hasForwardedHeader ||
|
|
33
34
|
!socket ||
|
|
34
35
|
("encrypted" in socket && socket.encrypted) ||
|
|
@@ -41,6 +42,7 @@ export function isDirectLoopbackRequest(event) {
|
|
|
41
42
|
return false;
|
|
42
43
|
const origin = new URL(originValue);
|
|
43
44
|
return (origin.hostname === "127.0.0.1" &&
|
|
45
|
+
Number(origin.port) === socket.localPort &&
|
|
44
46
|
origin.port !== "0" &&
|
|
45
47
|
origin.pathname === "/" &&
|
|
46
48
|
origin.search === "" &&
|
|
@@ -4,10 +4,36 @@ import type { ContextStatus } from "../shared/context-status.js";
|
|
|
4
4
|
import type { FirstRunBuilderCreditsV2RequestAssignment } from "../shared/first-run-builder-credits-experiment.js";
|
|
5
5
|
import type { ReasoningEffort } from "../shared/reasoning-effort.js";
|
|
6
6
|
import type { SignupAttributionContext } from "./attribution.js";
|
|
7
|
+
/**
|
|
8
|
+
* The tab a request from no browser tab acts on for tab-scoped app state:
|
|
9
|
+
* the tab of this app the user used last, or none used recently.
|
|
10
|
+
*/
|
|
11
|
+
export type BrowserTabTarget = {
|
|
12
|
+
kind: "last-used";
|
|
13
|
+
tabId: string;
|
|
14
|
+
usedAt: number;
|
|
15
|
+
} | {
|
|
16
|
+
kind: "unavailable";
|
|
17
|
+
};
|
|
18
|
+
export interface BrowserTabTargetSlot {
|
|
19
|
+
/** Looks the tab up once; later calls get the same answer. */
|
|
20
|
+
resolve(): Promise<BrowserTabTarget>;
|
|
21
|
+
/** Set once something in the request has asked for the tab. */
|
|
22
|
+
resolved?: BrowserTabTarget;
|
|
23
|
+
}
|
|
7
24
|
export interface RequestRunContext {
|
|
8
25
|
waitUntil?: (promise: Promise<unknown>) => void;
|
|
9
26
|
requestOrigin?: string;
|
|
27
|
+
/** The browser tab the request came from. */
|
|
10
28
|
browserTabId?: string;
|
|
29
|
+
/**
|
|
30
|
+
* For an MCP tool call by a signed-in user, which came from no tab: the tab
|
|
31
|
+
* whose tab-scoped app state (navigation, navigate commands, selection) the
|
|
32
|
+
* call reads and writes. Unlike `browserTabId`, it doesn't make the call
|
|
33
|
+
* that tab's own, so the tab still sees the call's changes as someone
|
|
34
|
+
* else's.
|
|
35
|
+
*/
|
|
36
|
+
browserTabTarget?: BrowserTabTargetSlot;
|
|
11
37
|
chatScope?: {
|
|
12
38
|
type: string;
|
|
13
39
|
id: string;
|
|
@@ -18,3 +18,10 @@ export declare const APP_STATE_BATCH_ROUTE_HEADER = "X-Agent-Native-App-State-Ba
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const APP_STATE_WRITER_HEADER = "X-Agent-Native-App-State-Writer";
|
|
20
20
|
export declare const APP_STATE_SEQ_HEADER = "X-Agent-Native-App-State-Seq";
|
|
21
|
+
/**
|
|
22
|
+
* A browser tab writes this key when someone uses it (it gains focus, or
|
|
23
|
+
* changes route while focused) and deletes it when the page goes away. The
|
|
24
|
+
* server stores it once per app and tab, so a call that came from no tab,
|
|
25
|
+
* such as an MCP tool call, can act on the tab of this app used last.
|
|
26
|
+
*/
|
|
27
|
+
export declare const BROWSER_TAB_USED_APP_STATE_KEY = "browser-tab-used";
|
|
@@ -25,3 +25,10 @@ export const APP_STATE_BATCH_ROUTE_HEADER = "X-Agent-Native-App-State-Batch";
|
|
|
25
25
|
*/
|
|
26
26
|
export const APP_STATE_WRITER_HEADER = "X-Agent-Native-App-State-Writer";
|
|
27
27
|
export const APP_STATE_SEQ_HEADER = "X-Agent-Native-App-State-Seq";
|
|
28
|
+
/**
|
|
29
|
+
* A browser tab writes this key when someone uses it (it gains focus, or
|
|
30
|
+
* changes route while focused) and deletes it when the page goes away. The
|
|
31
|
+
* server stores it once per app and tab, so a call that came from no tab,
|
|
32
|
+
* such as an MCP tool call, can act on the tab of this app used last.
|
|
33
|
+
*/
|
|
34
|
+
export const BROWSER_TAB_USED_APP_STATE_KEY = "browser-tab-used";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const mcpClientConnectionSchema: z.ZodObject<{
|
|
3
|
+
client: z.ZodEnum<{
|
|
4
|
+
chatgpt: "chatgpt";
|
|
5
|
+
claude: "claude";
|
|
6
|
+
"claude-code": "claude-code";
|
|
7
|
+
codex: "codex";
|
|
8
|
+
cursor: "cursor";
|
|
9
|
+
grok: "grok";
|
|
10
|
+
other: "other";
|
|
11
|
+
vscode: "vscode";
|
|
12
|
+
}>;
|
|
13
|
+
status: z.ZodEnum<{
|
|
14
|
+
connected: "connected";
|
|
15
|
+
disconnected: "disconnected";
|
|
16
|
+
unknown: "unknown";
|
|
17
|
+
}>;
|
|
18
|
+
lastUsedAt: z.ZodNullable<z.ZodNumber>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
export declare const mcpClientConnectionsSchema: z.ZodObject<{
|
|
21
|
+
connections: z.ZodArray<z.ZodObject<{
|
|
22
|
+
client: z.ZodEnum<{
|
|
23
|
+
chatgpt: "chatgpt";
|
|
24
|
+
claude: "claude";
|
|
25
|
+
"claude-code": "claude-code";
|
|
26
|
+
codex: "codex";
|
|
27
|
+
cursor: "cursor";
|
|
28
|
+
grok: "grok";
|
|
29
|
+
other: "other";
|
|
30
|
+
vscode: "vscode";
|
|
31
|
+
}>;
|
|
32
|
+
status: z.ZodEnum<{
|
|
33
|
+
connected: "connected";
|
|
34
|
+
disconnected: "disconnected";
|
|
35
|
+
unknown: "unknown";
|
|
36
|
+
}>;
|
|
37
|
+
lastUsedAt: z.ZodNullable<z.ZodNumber>;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
}, z.core.$strip>;
|
|
40
|
+
export type McpClientConnection = z.infer<typeof mcpClientConnectionSchema>;
|
|
41
|
+
export type McpClientConnections = z.infer<typeof mcpClientConnectionsSchema>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const mcpClientConnectionSchema = z.object({
|
|
3
|
+
client: z.enum([
|
|
4
|
+
"claude",
|
|
5
|
+
"chatgpt",
|
|
6
|
+
"cursor",
|
|
7
|
+
"vscode",
|
|
8
|
+
"claude-code",
|
|
9
|
+
"codex",
|
|
10
|
+
"grok",
|
|
11
|
+
"other",
|
|
12
|
+
]),
|
|
13
|
+
status: z.enum(["connected", "disconnected", "unknown"]),
|
|
14
|
+
lastUsedAt: z.number().int().nonnegative().nullable(),
|
|
15
|
+
});
|
|
16
|
+
export const mcpClientConnectionsSchema = z.object({
|
|
17
|
+
connections: z.array(mcpClientConnectionSchema),
|
|
18
|
+
});
|
|
@@ -41,6 +41,9 @@ export interface McpConnectGuide {
|
|
|
41
41
|
label: string;
|
|
42
42
|
install?: readonly McpConnectInstallOption[];
|
|
43
43
|
steps?: readonly string[];
|
|
44
|
+
urlStep?: number;
|
|
45
|
+
nameStep?: number;
|
|
46
|
+
stepKinds?: readonly ("open" | "add" | "configure" | "authorize" | "enable")[];
|
|
44
47
|
intro?: string;
|
|
45
48
|
commandTemplate?: string;
|
|
46
49
|
configTemplate?: string;
|
|
@@ -50,6 +53,7 @@ export interface McpConnectGuide {
|
|
|
50
53
|
href?: string;
|
|
51
54
|
};
|
|
52
55
|
note?: string;
|
|
56
|
+
docsHref?: string;
|
|
53
57
|
}
|
|
54
58
|
export declare const MCP_CONNECT_MCP_URL_TEMPLATE = "{appUrl}/mcp";
|
|
55
59
|
export declare const MCP_CONNECT_GUIDES: readonly McpConnectGuide[];
|
|
@@ -57,6 +61,20 @@ export declare const MCP_CONNECT_HOSTS: readonly McpConnectHost[];
|
|
|
57
61
|
export declare const MCP_CONNECT_HOST_SEARCH_TEXT: string;
|
|
58
62
|
export declare function resolveMcpConnectGuideId(query: string | null | undefined): McpConnectGuideId;
|
|
59
63
|
export declare function resolveMcpConnectHostId(query: string): string | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* The host an MCP client says it is: from the name it reported in
|
|
66
|
+
* `clientInfo`, or else its User-Agent, which clients that send `clientInfo`
|
|
67
|
+
* only when they connect (Codex) still send on every call. Both are the
|
|
68
|
+
* client's own claim, so use the result to label its work, never to grant
|
|
69
|
+
* anything. Only whole words count: a typed search may match "cur" to
|
|
70
|
+
* Cursor, a reported name may not.
|
|
71
|
+
*/
|
|
72
|
+
export declare function resolveMcpClientHostId(client: {
|
|
73
|
+
name?: string;
|
|
74
|
+
userAgent?: string;
|
|
75
|
+
} | undefined): string | undefined;
|
|
76
|
+
/** A host's display name, such as "Claude Code", for a host id. */
|
|
77
|
+
export declare function mcpConnectHostLabel(id: string | null | undefined): string | undefined;
|
|
60
78
|
export declare function matchesMcpConnectHost(query: string): boolean;
|
|
61
79
|
export declare function getMcpConnectGuides(locale: LocaleCode): readonly McpConnectGuide[];
|
|
62
80
|
export declare const MCP_STATIC_TOKEN_FALLBACK: {
|