veryfront 0.1.510 → 0.1.511
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/esm/deno.js +1 -1
- package/esm/src/agent/agent-service-mcp-server-config.d.ts +33 -0
- package/esm/src/agent/agent-service-mcp-server-config.d.ts.map +1 -0
- package/esm/src/agent/agent-service-mcp-server-config.js +49 -0
- package/esm/src/agent/default-hosted-chat-runtime.d.ts +2 -2
- package/esm/src/agent/default-hosted-chat-runtime.d.ts.map +1 -1
- package/esm/src/agent/default-hosted-invoke-agent-tool.d.ts +2 -2
- package/esm/src/agent/default-hosted-invoke-agent-tool.d.ts.map +1 -1
- package/esm/src/agent/hosted-chat-runtime-tool-assembly.d.ts +3 -2
- package/esm/src/agent/hosted-chat-runtime-tool-assembly.d.ts.map +1 -1
- package/esm/src/agent/hosted-child-fork-tool-sources.d.ts +2 -2
- package/esm/src/agent/hosted-child-fork-tool-sources.d.ts.map +1 -1
- package/esm/src/agent/hosted-child-fork-tool-sources.js +11 -12
- package/esm/src/agent/hosted-project-remote-tool-source.d.ts +3 -24
- package/esm/src/agent/hosted-project-remote-tool-source.d.ts.map +1 -1
- package/esm/src/agent/hosted-project-remote-tool-source.js +11 -51
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts +3 -3
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/deps/esm.sh/@types/react-dom@19.2.3/client.d.ts +1 -1
- package/src/deps/esm.sh/@types/{react@19.2.3 → react@19.2.14}/global.d.ts +1 -0
- package/src/deps/esm.sh/@types/{react@19.2.3 → react@19.2.14}/index.d.ts +93 -24
- package/src/deps/esm.sh/react-dom@19.2.4/client.d.ts +1 -1
- package/src/src/agent/agent-service-mcp-server-config.ts +112 -0
- package/src/src/agent/default-hosted-chat-runtime.ts +2 -2
- package/src/src/agent/default-hosted-invoke-agent-tool.ts +2 -2
- package/src/src/agent/hosted-chat-runtime-tool-assembly.ts +2 -2
- package/src/src/agent/hosted-child-fork-tool-sources.ts +16 -18
- package/src/src/agent/hosted-project-remote-tool-source.ts +17 -103
- package/src/src/agent/veryfront-cloud-agent-service.ts +3 -3
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { RemoteMCPToolSourceConfig } from "../tool/index.js";
|
|
2
|
+
import { type RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
3
|
+
export type AgentServiceVeryfrontApiMcpServerConfig = {
|
|
4
|
+
kind: "veryfront-api";
|
|
5
|
+
id?: string;
|
|
6
|
+
};
|
|
7
|
+
export type AgentServiceVeryfrontStudioMcpServerConfig = {
|
|
8
|
+
kind: "veryfront-studio";
|
|
9
|
+
id?: string;
|
|
10
|
+
};
|
|
11
|
+
export type AgentServiceGenericMcpServerConfig = {
|
|
12
|
+
kind?: "generic";
|
|
13
|
+
id?: string;
|
|
14
|
+
endpoint: RemoteMCPToolSourceConfig["endpoint"];
|
|
15
|
+
headers?: RemoteMCPToolSourceConfig["headers"];
|
|
16
|
+
fetch?: RemoteMCPToolSourceConfig["fetch"];
|
|
17
|
+
listMethod?: RemoteMCPToolSourceConfig["listMethod"];
|
|
18
|
+
callMethod?: RemoteMCPToolSourceConfig["callMethod"];
|
|
19
|
+
};
|
|
20
|
+
export type AgentServiceMcpServerConfig = AgentServiceVeryfrontApiMcpServerConfig | AgentServiceVeryfrontStudioMcpServerConfig | AgentServiceGenericMcpServerConfig;
|
|
21
|
+
export type CreateAgentServiceRemoteMcpConfigInput = {
|
|
22
|
+
server: AgentServiceMcpServerConfig;
|
|
23
|
+
authToken: string;
|
|
24
|
+
apiMcpUrl: string;
|
|
25
|
+
studioMcpUrl?: string | null;
|
|
26
|
+
clientProfile?: RuntimeClientProfile | null;
|
|
27
|
+
getProjectId?: () => string | null | undefined;
|
|
28
|
+
conversationId?: string;
|
|
29
|
+
defaultSourceId?: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function defaultAgentServiceMcpServers(): AgentServiceMcpServerConfig[];
|
|
32
|
+
export declare function createAgentServiceRemoteMcpConfig(input: CreateAgentServiceRemoteMcpConfigInput): RemoteMCPToolSourceConfig | null;
|
|
33
|
+
//# sourceMappingURL=agent-service-mcp-server-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-service-mcp-server-config.d.ts","sourceRoot":"","sources":["../../../src/src/agent/agent-service-mcp-server-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AAElE,OAAO,EAAyB,KAAK,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAE/F,MAAM,MAAM,uCAAuC,GAAG;IACpD,IAAI,EAAE,eAAe,CAAC;IACtB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,0CAA0C,GAAG;IACvD,IAAI,EAAE,kBAAkB,CAAC;IACzB,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,kCAAkC,GAAG;IAC/C,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,yBAAyB,CAAC,UAAU,CAAC,CAAC;IAChD,OAAO,CAAC,EAAE,yBAAyB,CAAC,SAAS,CAAC,CAAC;IAC/C,KAAK,CAAC,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAC;IAC3C,UAAU,CAAC,EAAE,yBAAyB,CAAC,YAAY,CAAC,CAAC;IACrD,UAAU,CAAC,EAAE,yBAAyB,CAAC,YAAY,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,MAAM,2BAA2B,GACnC,uCAAuC,GACvC,0CAA0C,GAC1C,kCAAkC,CAAC;AAEvC,MAAM,MAAM,sCAAsC,GAAG;IACnD,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,aAAa,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,YAAY,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,wBAAgB,6BAA6B,IAAI,2BAA2B,EAAE,CAE7E;AAyDD,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,sCAAsC,GAC5C,yBAAyB,GAAG,IAAI,CAUlC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { buildStudioMcpHeaders } from "./live-studio-mcp-tools.js";
|
|
2
|
+
import { clientAllowsStudioMcp } from "./runtime-client-profile.js";
|
|
3
|
+
export function defaultAgentServiceMcpServers() {
|
|
4
|
+
return [{ kind: "veryfront-api" }];
|
|
5
|
+
}
|
|
6
|
+
function createGenericRemoteMcpConfig(server) {
|
|
7
|
+
const config = {
|
|
8
|
+
endpoint: server.endpoint,
|
|
9
|
+
};
|
|
10
|
+
if (server.id !== undefined)
|
|
11
|
+
config.id = server.id;
|
|
12
|
+
if (server.headers !== undefined)
|
|
13
|
+
config.headers = server.headers;
|
|
14
|
+
if (server.fetch !== undefined)
|
|
15
|
+
config.fetch = server.fetch;
|
|
16
|
+
if (server.listMethod !== undefined)
|
|
17
|
+
config.listMethod = server.listMethod;
|
|
18
|
+
if (server.callMethod !== undefined)
|
|
19
|
+
config.callMethod = server.callMethod;
|
|
20
|
+
return config;
|
|
21
|
+
}
|
|
22
|
+
function createVeryfrontApiRemoteMcpConfig(input, server) {
|
|
23
|
+
return {
|
|
24
|
+
id: server.id ?? input.defaultSourceId ?? "veryfront-mcp",
|
|
25
|
+
endpoint: input.apiMcpUrl,
|
|
26
|
+
headers: {
|
|
27
|
+
Authorization: `Bearer ${input.authToken}`,
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
function createVeryfrontStudioRemoteMcpConfig(input, server) {
|
|
32
|
+
if (!input.studioMcpUrl || !clientAllowsStudioMcp(input.clientProfile)) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
id: server.id ?? "studio-mcp",
|
|
37
|
+
endpoint: input.studioMcpUrl,
|
|
38
|
+
headers: () => buildStudioMcpHeaders(input.authToken, input.getProjectId?.() ?? null, input.conversationId),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export function createAgentServiceRemoteMcpConfig(input) {
|
|
42
|
+
if (input.server.kind === "veryfront-api") {
|
|
43
|
+
return createVeryfrontApiRemoteMcpConfig(input, input.server);
|
|
44
|
+
}
|
|
45
|
+
if (input.server.kind === "veryfront-studio") {
|
|
46
|
+
return createVeryfrontStudioRemoteMcpConfig(input, input.server);
|
|
47
|
+
}
|
|
48
|
+
return createGenericRemoteMcpConfig(input.server);
|
|
49
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HostToolSet, type RemoteMCPToolSourceConfig, type RemoteToolSource } from "../tool/index.js";
|
|
2
2
|
import type { HostedChatRuntimeCreationOptions, HostedChatRuntimeCreationResult } from "./hosted-chat-runtime-contract.js";
|
|
3
3
|
import { type HostedChatRuntimeToolAssemblyResult, type PrepareHostedChatRuntimeToolAssemblyInput } from "./hosted-chat-runtime-tool-assembly.js";
|
|
4
|
-
import type {
|
|
4
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
5
5
|
import { type HostedRuntimeStateResolverContext } from "./hosted-runtime-state-resolver.js";
|
|
6
6
|
import type { ProjectSteeringMutationResult } from "./project-steering-mutation.js";
|
|
7
7
|
import type { RuntimeAgentMarkdownDefinition, RuntimeAgentThinkingConfig } from "./runtime-agent-definition.js";
|
|
@@ -9,7 +9,7 @@ export type DefaultHostedChatRuntimeConfig = {
|
|
|
9
9
|
apiUrl: string;
|
|
10
10
|
apiMcpUrl: string;
|
|
11
11
|
studioMcpUrl?: string | null;
|
|
12
|
-
mcpServers?: readonly
|
|
12
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
13
13
|
};
|
|
14
14
|
export type DefaultHostedChatRuntimeLogger = {
|
|
15
15
|
warn(message: string, metadata?: Record<string, unknown>): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-hosted-chat-runtime.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-hosted-chat-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,mCAAmC,EAExC,KAAK,yCAAyC,EAC/C,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"default-hosted-chat-runtime.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-hosted-chat-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,kBAAkB,CAAC;AAkB1B,OAAO,KAAK,EACV,gCAAgC,EAChC,+BAA+B,EAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,KAAK,mCAAmC,EAExC,KAAK,yCAAyC,EAC/C,MAAM,wCAAwC,CAAC;AAChD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AACxF,OAAO,EAEL,KAAK,iCAAiC,EACvC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,KAAK,EAAE,6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,CAAC,EAAE,8BAA8B,CAAC;CACzC,CAAC;AAsJF,wBAAsB,8BAA8B,CAClD,KAAK,EAAE,qCAAqC,GAC3C,OAAO,CAAC,+BAA+B,CAAC,CAsD1C"}
|
|
@@ -4,7 +4,7 @@ import type { InferSchema } from "../extensions/schema/index.js";
|
|
|
4
4
|
import type { ChildRunExecutionResult } from "./child-run-execution-snapshot.js";
|
|
5
5
|
import type { ConversationRunEvent } from "./conversation-run-events.js";
|
|
6
6
|
import { prepareDefaultHostedChildForkSandboxToolSources } from "./hosted-child-fork-tool-sources.js";
|
|
7
|
-
import type {
|
|
7
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
8
8
|
import { type MutableAgentProjectContext } from "./project-context.js";
|
|
9
9
|
import { type HostedDurableChildInvokeResult } from "./hosted-durable-child-fork-execution.js";
|
|
10
10
|
import { type HostedChildForkRuntimeConfig } from "./hosted-child-tool-input.js";
|
|
@@ -24,7 +24,7 @@ export type DefaultHostedInvokeAgentConfig = {
|
|
|
24
24
|
apiUrl: string;
|
|
25
25
|
apiMcpUrl: string;
|
|
26
26
|
studioMcpUrl?: string | null;
|
|
27
|
-
mcpServers?: readonly
|
|
27
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
28
28
|
enableDurableInvokeAgent?: boolean;
|
|
29
29
|
};
|
|
30
30
|
export type DefaultHostedInvokeAgentLogger = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default-hosted-invoke-agent-tool.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-hosted-invoke-agent-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,gCAAgC,EAChC,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAErB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,+BAA+B,CAAC;AAElF,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKzE,OAAO,EACL,+CAA+C,EAChD,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"default-hosted-invoke-agent-tool.d.ts","sourceRoot":"","sources":["../../../src/src/agent/default-hosted-invoke-agent-tool.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,+BAA+B,EAC/B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAEL,gCAAgC,EAChC,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EAErB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAmB,MAAM,+BAA+B,CAAC;AAElF,OAAO,KAAK,EACV,uBAAuB,EAExB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAKzE,OAAO,EACL,+CAA+C,EAChD,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAQxF,OAAO,EAEL,KAAK,0BAA0B,EAChC,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAML,KAAK,8BAA8B,EACpC,MAAM,0CAA0C,CAAC;AAElD,OAAO,EAGL,KAAK,4BAA4B,EAElC,MAAM,8BAA8B,CAAC;AAMtC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGxE,MAAM,MAAM,+BAA+B,GAAG,0BAA0B,GAAG;IACzE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC5C,K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AmB,CAAC,EAAE,CAAC,KAAK,EAAE,6BAA6B,KAAK,MAAM,CAAC;IACvE,8BAA8B,CAAC,EAAE,CAC/B,KAAK,EAAE,+BAA+B,KACnC,OAAO,CAAC,8BAA8B,CAAC,CAAC;IAC7C,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,yBAAyB,KAAK,gBAAgB,CAAC;IACjF,gCAAgC,CAAC,EAAE,OAAO,gCAAgC,CAAC;IAC3E,qBAAqB,CAAC,EAAE,UAAU,CAAC,OAAO,+CAA+C,CAAC,CAAC,CAAC,CAAC,CAC3F,uBAAuB,CACxB,CAAC;CACH,CAAC;AAMJ,eAAO,MAAM,0CAA0C;;GAEtD,CAAC;AAEF,mEAAmE;AACnE,eAAO,MAAM,uCAAuC;;GAA+C,CAAC;AAEpG,eAAO,MAAM,sCAAsC;;;;;;;;;;;EAElD,CAAC;AAEF,+DAA+D;AAC/D,eAAO,MAAM,mCAAmC;;;;;;;;;;;EAA2C,CAAC;AAE5F,MAAM,MAAM,6BAA6B,GAAG,WAAW,CACrD,UAAU,CAAC,OAAO,sCAAsC,CAAC,CAC1D,CAAC;AAkOF,wBAAsB,mCAAmC,CACvD,QAAQ,SAAS,+BAA+B,EAEhD,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,EACtD,KAAK,EAAE,6BAA6B,EACpC,YAAY,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,oBAAoB,GACtC,OAAO,CAAC,kCAAkC,CAAC,CA6J7C;AAED,wBAAgB,kCAAkC,CAChD,QAAQ,SAAS,+BAA+B,EAEhD,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC;;;;;;;;;;;uCAoBvD"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { ChatSystemMessage } from "../chat/types.js";
|
|
2
2
|
import { type HostToolSet, type HostToolTraceAttributes, type ProjectScopedRemoteToolOptions, type RemoteMCPToolSourceConfig, type RemoteToolSource, type ToolSet, type TraceHostToolsOptions } from "../tool/index.js";
|
|
3
3
|
import { type DefaultResearchArtifactContext } from "./default-research-artifact-support.js";
|
|
4
|
-
import { type
|
|
4
|
+
import { type AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
5
|
+
import { type HostedProjectRemoteToolSourceMutationHandler, type HostedProjectRemoteToolSourcePrepareToolInput, type HostedProjectRemoteToolSourceProjectSwitchHandler, type HostedProjectRemoteToolSourceRetryPolicy } from "./hosted-project-remote-tool-source.js";
|
|
5
6
|
import { type RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
6
7
|
export type HostedChatRuntimeToolAssemblyContext = DefaultResearchArtifactContext & {
|
|
7
8
|
authToken: string;
|
|
@@ -28,7 +29,7 @@ export type PrepareHostedChatRuntimeToolAssemblyInput<TTraceAttributes extends H
|
|
|
28
29
|
apiUrl: string;
|
|
29
30
|
apiMcpUrl: string;
|
|
30
31
|
studioMcpUrl?: string | null;
|
|
31
|
-
mcpServers?: readonly
|
|
32
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
32
33
|
conversationId?: string;
|
|
33
34
|
allowedToolNames?: HostedChatRuntimeAllowedToolNames;
|
|
34
35
|
projectScopedRemoteToolOptions?: ProjectScopedRemoteToolOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-chat-runtime-tool-assembly.d.ts","sourceRoot":"","sources":["../../../src/src/agent/hosted-chat-runtime-tool-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,uBAAuB,EAE5B,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,OAAO,EAEZ,KAAK,qBAAqB,EAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,8BAA8B,EAGpC,MAAM,wCAAwC,CAAC;AAChD,OAAO,
|
|
1
|
+
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AAED,wBAAsB,oCAAoC,CACxD,gBAAgB,SAAS,uBAAuB,GAAG,uBAAuB,EAE1E,KAAK,EAAE,yCAAyC,CAAC,gBAAgB,CAAC,GACjE,OAAO,CAAC,mCAAmC,CAAC,CAwE9C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createToolsFromRemoteDefinitions, type HostToolSet, type RemoteMCPToolSourceConfig, type RemoteToolSource } from "../tool/index.js";
|
|
2
|
+
import { type AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
2
3
|
import { type AgentServiceSandboxToolsOptions, type AgentServiceSandboxToolsResult } from "../sandbox/index.js";
|
|
3
4
|
import { type LiveStudioMcpToolsOptions } from "./live-studio-mcp-tools.js";
|
|
4
|
-
import type { HostedProjectMcpServerConfig } from "./hosted-project-remote-tool-source.js";
|
|
5
5
|
import type { RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
6
6
|
import { type HostedChildProjectSwitchHandler } from "./hosted-child-steering-tools.js";
|
|
7
7
|
import { type DefaultHostedChildForkToolAssemblySourceResult } from "./hosted-child-requested-tools.js";
|
|
@@ -11,7 +11,7 @@ export type HostedChildForkToolSourcesLogger = {
|
|
|
11
11
|
export type PrepareDefaultHostedChildForkToolSourcesInput = {
|
|
12
12
|
authToken: string;
|
|
13
13
|
apiMcpUrl: string;
|
|
14
|
-
mcpServers?: readonly
|
|
14
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
15
15
|
getProjectId: () => string | null | undefined;
|
|
16
16
|
studioMcpUrl?: string | null;
|
|
17
17
|
clientProfile?: RuntimeClientProfile | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-child-fork-tool-sources.d.ts","sourceRoot":"","sources":["../../../src/src/agent/hosted-child-fork-tool-sources.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gCAAgC,EAChC,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACtB,MAAM,kB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,CAAC,CAyCzD"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { createRemoteMCPToolSource, createToolsFromRemoteDefinitions, } from "../tool/index.js";
|
|
2
|
+
import { createAgentServiceRemoteMcpConfig, defaultAgentServiceMcpServers, } from "./agent-service-mcp-server-config.js";
|
|
2
3
|
import { createAgentServiceSandboxTools, } from "../sandbox/index.js";
|
|
3
4
|
import { createLiveStudioMcpTools, } from "./live-studio-mcp-tools.js";
|
|
4
|
-
import { createHostedProjectGenericRemoteMcpConfig, createHostedProjectVeryfrontApiRemoteMcpConfig, } from "./hosted-project-remote-tool-source.js";
|
|
5
5
|
import { wrapHostedChildProjectSwitchTool, } from "./hosted-child-steering-tools.js";
|
|
6
6
|
import { buildDefaultHostedChildForkToolSet, } from "./hosted-child-requested-tools.js";
|
|
7
|
-
function defaultChildForkMcpServers() {
|
|
8
|
-
return [{ kind: "veryfront-api" }];
|
|
9
|
-
}
|
|
10
7
|
export async function prepareDefaultHostedChildForkToolSources(input) {
|
|
11
8
|
throwIfAborted(input.abortSignal);
|
|
12
9
|
let closeStudioMcpTools;
|
|
@@ -17,7 +14,7 @@ export async function prepareDefaultHostedChildForkToolSources(input) {
|
|
|
17
14
|
const materializeRemoteTools = input.createToolsFromRemoteDefinitions ??
|
|
18
15
|
createToolsFromRemoteDefinitions;
|
|
19
16
|
try {
|
|
20
|
-
const mcpServers = input.mcpServers ??
|
|
17
|
+
const mcpServers = input.mcpServers ?? defaultAgentServiceMcpServers();
|
|
21
18
|
for (const server of mcpServers) {
|
|
22
19
|
if (server.kind === "veryfront-studio") {
|
|
23
20
|
const studioTools = await createLiveStudioTools({
|
|
@@ -37,13 +34,15 @@ export async function prepareDefaultHostedChildForkToolSources(input) {
|
|
|
37
34
|
closeStudioMcpTools = studioTools.close;
|
|
38
35
|
continue;
|
|
39
36
|
}
|
|
40
|
-
const remoteConfig =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
const remoteConfig = createAgentServiceRemoteMcpConfig({
|
|
38
|
+
server,
|
|
39
|
+
authToken: input.authToken,
|
|
40
|
+
apiMcpUrl: input.apiMcpUrl,
|
|
41
|
+
defaultSourceId: "veryfront-mcp-fork",
|
|
42
|
+
});
|
|
43
|
+
if (!remoteConfig) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
47
46
|
const remoteSource = createRemoteToolSource(remoteConfig);
|
|
48
47
|
const definitions = await remoteSource.listTools();
|
|
49
48
|
remoteMcpTools = {
|
|
@@ -1,26 +1,9 @@
|
|
|
1
1
|
import { type ProjectScopedRemoteToolDefaultProjectId, type ProjectScopedRemoteToolOptions, type RemoteMCPToolSourceConfig, type RemoteToolSource, type ToolExecutionContext } from "../tool/index.js";
|
|
2
|
-
import { type
|
|
2
|
+
import { type AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
3
|
+
import type { RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
3
4
|
import { type ProjectSteeringMutationResult, type ProjectSteeringPaths } from "./project-steering-mutation.js";
|
|
4
5
|
export type HostedProjectRemoteToolSourceMutationHandler = (mutation: ProjectSteeringMutationResult) => Promise<void> | void;
|
|
5
6
|
export type HostedProjectRemoteToolSourceProjectSwitchHandler = (projectId: string) => Promise<void> | void;
|
|
6
|
-
export type HostedProjectVeryfrontApiMcpServerConfig = {
|
|
7
|
-
kind: "veryfront-api";
|
|
8
|
-
id?: string;
|
|
9
|
-
};
|
|
10
|
-
export type HostedProjectVeryfrontStudioMcpServerConfig = {
|
|
11
|
-
kind: "veryfront-studio";
|
|
12
|
-
id?: string;
|
|
13
|
-
};
|
|
14
|
-
export type HostedProjectGenericMcpServerConfig = {
|
|
15
|
-
kind?: "generic";
|
|
16
|
-
id?: string;
|
|
17
|
-
endpoint: RemoteMCPToolSourceConfig["endpoint"];
|
|
18
|
-
headers?: RemoteMCPToolSourceConfig["headers"];
|
|
19
|
-
fetch?: RemoteMCPToolSourceConfig["fetch"];
|
|
20
|
-
listMethod?: RemoteMCPToolSourceConfig["listMethod"];
|
|
21
|
-
callMethod?: RemoteMCPToolSourceConfig["callMethod"];
|
|
22
|
-
};
|
|
23
|
-
export type HostedProjectMcpServerConfig = HostedProjectVeryfrontApiMcpServerConfig | HostedProjectVeryfrontStudioMcpServerConfig | HostedProjectGenericMcpServerConfig;
|
|
24
7
|
export type HostedProjectRemoteToolSourcePrepareToolInput = (input: {
|
|
25
8
|
toolName: string;
|
|
26
9
|
toolInput: Record<string, unknown>;
|
|
@@ -51,16 +34,12 @@ export type CreateHostedProjectRemoteToolSourcesInput = Omit<CreateHostedProject
|
|
|
51
34
|
authToken: string;
|
|
52
35
|
apiMcpUrl: string;
|
|
53
36
|
studioMcpUrl?: string | null;
|
|
54
|
-
mcpServers?: readonly
|
|
37
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
55
38
|
clientProfile?: RuntimeClientProfile | null;
|
|
56
39
|
getProjectId: () => string | null | undefined;
|
|
57
40
|
conversationId?: string;
|
|
58
41
|
createRemoteToolSource?: (config: RemoteMCPToolSourceConfig) => RemoteToolSource;
|
|
59
42
|
onStudioProjectSwitch?: HostedProjectRemoteToolSourceProjectSwitchHandler;
|
|
60
43
|
};
|
|
61
|
-
export declare function createHostedProjectGenericRemoteMcpConfig(server: HostedProjectGenericMcpServerConfig): RemoteMCPToolSourceConfig;
|
|
62
|
-
export declare function createHostedProjectVeryfrontApiRemoteMcpConfig(input: Pick<CreateHostedProjectRemoteToolSourcesInput, "apiMcpUrl" | "authToken"> & {
|
|
63
|
-
defaultSourceId?: string;
|
|
64
|
-
}, server: HostedProjectVeryfrontApiMcpServerConfig): RemoteMCPToolSourceConfig;
|
|
65
44
|
export declare function createHostedProjectRemoteToolSources(input: CreateHostedProjectRemoteToolSourcesInput): RemoteToolSource[];
|
|
66
45
|
//# sourceMappingURL=hosted-project-remote-tool-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosted-project-remote-tool-source.d.ts","sourceRoot":"","sources":["../../../src/src/agent/hosted-project-remote-tool-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,uCAAuC,EAC5C,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"hosted-project-remote-tool-source.d.ts","sourceRoot":"","sources":["../../../src/src/agent/hosted-project-remote-tool-source.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,uCAAuC,EAC5C,KAAK,8BAA8B,EACnC,KAAK,yBAAyB,EAC9B,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,KAAK,2BAA2B,EAGjC,MAAM,sCAAsC,CAAC;AAE9C,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAExE,OAAO,EAGL,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EAC1B,MAAM,gCAAgC,CAAC;AAExC,MAAM,MAAM,4CAA4C,GAAG,CACzD,QAAQ,EAAE,6BAA6B,KACpC,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE1B,MAAM,MAAM,iDAAiD,GAAG,CAC9D,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AAE1B,MAAM,MAAM,6CAA6C,GAAG,CAAC,KAAK,EAAE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,oBAAoB,CAAC;CAChC,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE9B,MAAM,MAAM,wCAAwC,GAAG,CAAC,KAAK,EAAE;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,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AC,MAAM,EAAE,yBAAyB,KAAK,gBAAgB,CAAC;IACjF,qBAAqB,CAAC,EAAE,iDAAiD,CAAC;CAC3E,CAAC;AA8BJ,wBAAgB,oCAAoC,CAClD,KAAK,EAAE,yCAAyC,GAC/C,gBAAgB,EAAE,CA6BpB"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { createProjectScopedRemoteToolCatalog, createRemoteMCPToolSource, isProjectNavigationRemoteTool, } from "../tool/index.js";
|
|
2
|
+
import { createAgentServiceRemoteMcpConfig, defaultAgentServiceMcpServers, } from "./agent-service-mcp-server-config.js";
|
|
2
3
|
import { toChildRunToolInputRecord } from "./child-run-execution-support.js";
|
|
3
|
-
import { buildStudioMcpHeaders } from "./live-studio-mcp-tools.js";
|
|
4
|
-
import { clientAllowsStudioMcp } from "./runtime-client-profile.js";
|
|
5
4
|
import { getConfirmedProjectContextSwitchId } from "./project-context.js";
|
|
6
5
|
import { getProjectSteeringMutation, isSuccessfulProjectSteeringMutationResult, } from "./project-steering-mutation.js";
|
|
7
6
|
function resolveActiveBranchId(getActiveBranchId) {
|
|
@@ -90,53 +89,6 @@ export function createHostedProjectRemoteToolSource(input) {
|
|
|
90
89
|
},
|
|
91
90
|
};
|
|
92
91
|
}
|
|
93
|
-
function defaultHostedProjectMcpServers() {
|
|
94
|
-
return [{ kind: "veryfront-api" }];
|
|
95
|
-
}
|
|
96
|
-
export function createHostedProjectGenericRemoteMcpConfig(server) {
|
|
97
|
-
const config = {
|
|
98
|
-
endpoint: server.endpoint,
|
|
99
|
-
};
|
|
100
|
-
if (server.id !== undefined)
|
|
101
|
-
config.id = server.id;
|
|
102
|
-
if (server.headers !== undefined)
|
|
103
|
-
config.headers = server.headers;
|
|
104
|
-
if (server.fetch !== undefined)
|
|
105
|
-
config.fetch = server.fetch;
|
|
106
|
-
if (server.listMethod !== undefined)
|
|
107
|
-
config.listMethod = server.listMethod;
|
|
108
|
-
if (server.callMethod !== undefined)
|
|
109
|
-
config.callMethod = server.callMethod;
|
|
110
|
-
return config;
|
|
111
|
-
}
|
|
112
|
-
export function createHostedProjectVeryfrontApiRemoteMcpConfig(input, server) {
|
|
113
|
-
return {
|
|
114
|
-
id: server.id ?? input.defaultSourceId ?? "veryfront-mcp",
|
|
115
|
-
endpoint: input.apiMcpUrl,
|
|
116
|
-
headers: {
|
|
117
|
-
Authorization: `Bearer ${input.authToken}`,
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
function createVeryfrontStudioRemoteMcpConfig(input, server) {
|
|
122
|
-
if (!input.studioMcpUrl || !clientAllowsStudioMcp(input.clientProfile)) {
|
|
123
|
-
return null;
|
|
124
|
-
}
|
|
125
|
-
return {
|
|
126
|
-
id: server.id ?? "studio-mcp",
|
|
127
|
-
endpoint: input.studioMcpUrl,
|
|
128
|
-
headers: () => buildStudioMcpHeaders(input.authToken, input.getProjectId() ?? null, input.conversationId),
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
function createRemoteMcpConfig(input, server) {
|
|
132
|
-
if (server.kind === "veryfront-api") {
|
|
133
|
-
return createHostedProjectVeryfrontApiRemoteMcpConfig(input, server);
|
|
134
|
-
}
|
|
135
|
-
if (server.kind === "veryfront-studio") {
|
|
136
|
-
return createVeryfrontStudioRemoteMcpConfig(input, server);
|
|
137
|
-
}
|
|
138
|
-
return createHostedProjectGenericRemoteMcpConfig(server);
|
|
139
|
-
}
|
|
140
92
|
function createHostedProjectRemoteToolSourceFromConfig(input, source, onProjectSwitch) {
|
|
141
93
|
return createHostedProjectRemoteToolSource({
|
|
142
94
|
source,
|
|
@@ -163,9 +115,17 @@ function createHostedProjectRemoteToolSourceFromConfig(input, source, onProjectS
|
|
|
163
115
|
export function createHostedProjectRemoteToolSources(input) {
|
|
164
116
|
const createRemoteToolSource = input.createRemoteToolSource ?? createRemoteMCPToolSource;
|
|
165
117
|
const sources = [];
|
|
166
|
-
const mcpServers = input.mcpServers ??
|
|
118
|
+
const mcpServers = input.mcpServers ?? defaultAgentServiceMcpServers();
|
|
167
119
|
for (const server of mcpServers) {
|
|
168
|
-
const remoteConfig =
|
|
120
|
+
const remoteConfig = createAgentServiceRemoteMcpConfig({
|
|
121
|
+
server,
|
|
122
|
+
authToken: input.authToken,
|
|
123
|
+
apiMcpUrl: input.apiMcpUrl,
|
|
124
|
+
studioMcpUrl: input.studioMcpUrl,
|
|
125
|
+
clientProfile: input.clientProfile,
|
|
126
|
+
getProjectId: input.getProjectId,
|
|
127
|
+
conversationId: input.conversationId,
|
|
128
|
+
});
|
|
169
129
|
if (!remoteConfig) {
|
|
170
130
|
continue;
|
|
171
131
|
}
|
|
@@ -3,7 +3,7 @@ import { type RunAgentServiceMainOptions } from "./agent-service-bootstrap.js";
|
|
|
3
3
|
import { type HostedChatRuntimeCreationResult } from "./hosted-chat-runtime-contract.js";
|
|
4
4
|
import type { HostedConversationRootRunContext } from "./conversation-root-run-lifecycle.js";
|
|
5
5
|
import { type AgentRuntimeMessage } from "./agent-runtime-message-adapter.js";
|
|
6
|
-
import type {
|
|
6
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
7
7
|
import { type CreateNodeAgentServiceRuntimeInfrastructureOptions } from "./node-agent-service-runtime-infrastructure.js";
|
|
8
8
|
import { type AgentServiceRuntimeBundle, type AgentServiceRuntimeConfig, type StartNodeAgentServiceResult } from "./agent-service-runtime.js";
|
|
9
9
|
import type { PreparedHostedChatExecution } from "./prepared-hosted-chat-execution.js";
|
|
@@ -13,8 +13,8 @@ export type NodeVeryfrontCloudAgentServiceProcessTarget = NonNullable<RunAgentSe
|
|
|
13
13
|
};
|
|
14
14
|
export type NodeVeryfrontCloudAgentServiceAgentSource = "auto" | "code" | "markdown";
|
|
15
15
|
export type VeryfrontMcpServerKind = "api" | "studio";
|
|
16
|
-
export type NodeVeryfrontCloudAgentServiceMcpServer =
|
|
17
|
-
export declare function veryfrontMcpServer(kind?: VeryfrontMcpServerKind):
|
|
16
|
+
export type NodeVeryfrontCloudAgentServiceMcpServer = AgentServiceMcpServerConfig;
|
|
17
|
+
export declare function veryfrontMcpServer(kind?: VeryfrontMcpServerKind): AgentServiceMcpServerConfig;
|
|
18
18
|
type AgentServicePathOption = string | URL;
|
|
19
19
|
export type NodeVeryfrontCloudAgentServiceOptions = {
|
|
20
20
|
serviceName: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"veryfront-cloud-agent-service.d.ts","sourceRoot":"","sources":["../../../src/src/agent/veryfront-cloud-agent-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AA+B3E,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAkB9E,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"veryfront-cloud-agent-service.d.ts","sourceRoot":"","sources":["../../../src/src/agent/veryfront-cloud-agent-service.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,qBAAqB,CAAC;AA+B3E,OAAO,EAGL,KAAK,0BAA0B,EAChC,MAAM,8BAA8B,CAAC;AAItC,OAAO,EAAE,KAAK,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACzF,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAkB9E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAYxF,OAAO,EAEL,KAAK,kDAAkD,EACxD,MAAM,gDAAgD,CAAC;AACxD,OAAO,EACL,KAAK,yBAAyB,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,EAAE,2CAA2C,CAAC;IAC5D,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qBAAqB,CAAC,EAAE,MAAM,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG,qCAAqC,CAAC;AAQtF,MAAM,MAAM,+CAA+C,GAAG,2BAA2B,GAAG;IAC1F,MAAM,EAAE,yBAAyB,CAAC;IAClC,KAAK,EAAE,+BAA+B,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,EAAE,WAAW,CAAC;IACzB,aAAa,EAAE,mBAAmB,EAAE,CAAC;IACrC,QAAQ,EAAE,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAClD,cAAc,EAAE,gCAAgC,CAAC;CAClD,CAAC;AAunBF,wBAAsB,2CAA2C,CAC/D,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,yBAAyB,CAAC,+CAA+C,CAAC,CAAC,CAKrF;AAED,wBAAsB,mCAAmC,CACvD,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,2BAA2B,CAAC,+CAA+C,CAAC,CAAC,CAQvF;AAED,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,qCAAqC,GAC7C,OAAO,CAAC,IAAI,CAAC,CAyCf"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.511";
|
|
2
2
|
//# sourceMappingURL=version-constant.d.ts.map
|
package/package.json
CHANGED
package/src/deno.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
|
|
6
6
|
|
|
7
|
-
import React = require("https://esm.sh/@types/react@19.2.
|
|
7
|
+
import React = require("https://esm.sh/@types/react@19.2.14/index.d.ts");
|
|
8
8
|
|
|
9
9
|
export {};
|
|
10
10
|
|
|
@@ -18,6 +18,7 @@ interface KeyboardEvent extends Event {}
|
|
|
18
18
|
interface MouseEvent extends Event {}
|
|
19
19
|
interface TouchEvent extends Event {}
|
|
20
20
|
interface PointerEvent extends Event {}
|
|
21
|
+
interface SubmitEvent extends Event {}
|
|
21
22
|
interface ToggleEvent extends Event {}
|
|
22
23
|
interface TransitionEvent extends Event {}
|
|
23
24
|
interface UIEvent extends Event {}
|
|
@@ -16,6 +16,7 @@ type NativeKeyboardEvent = KeyboardEvent;
|
|
|
16
16
|
type NativeMouseEvent = MouseEvent;
|
|
17
17
|
type NativeTouchEvent = TouchEvent;
|
|
18
18
|
type NativePointerEvent = PointerEvent;
|
|
19
|
+
type NativeSubmitEvent = SubmitEvent;
|
|
19
20
|
type NativeToggleEvent = ToggleEvent;
|
|
20
21
|
type NativeTransitionEvent = TransitionEvent;
|
|
21
22
|
type NativeUIEvent = UIEvent;
|
|
@@ -225,12 +226,20 @@ declare namespace React {
|
|
|
225
226
|
|
|
226
227
|
type ComponentState = any;
|
|
227
228
|
|
|
229
|
+
interface DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES {}
|
|
230
|
+
|
|
228
231
|
/**
|
|
229
232
|
* A value which uniquely identifies a node among items in an array.
|
|
230
233
|
*
|
|
231
234
|
* @see {@link https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key React Docs}
|
|
232
235
|
*/
|
|
233
|
-
type Key =
|
|
236
|
+
type Key =
|
|
237
|
+
| string
|
|
238
|
+
| number
|
|
239
|
+
| bigint
|
|
240
|
+
| DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES[
|
|
241
|
+
keyof DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_KEY_TYPES
|
|
242
|
+
];
|
|
234
243
|
|
|
235
244
|
/**
|
|
236
245
|
* @internal The props any component can receive.
|
|
@@ -1884,7 +1893,7 @@ declare namespace React {
|
|
|
1884
1893
|
*
|
|
1885
1894
|
* @param callback A synchronous, void callback that will execute as a single, complete React commit.
|
|
1886
1895
|
*
|
|
1887
|
-
* @see https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks
|
|
1896
|
+
* @see {@link https://reactjs.org/blog/2019/02/06/react-v16.8.0.html#testing-hooks}
|
|
1888
1897
|
*/
|
|
1889
1898
|
// NOTES
|
|
1890
1899
|
// - the order of these signatures matters - typescript will check the signatures in source order.
|
|
@@ -1926,7 +1935,31 @@ declare namespace React {
|
|
|
1926
1935
|
reducer: (state: State, action: Action) => State,
|
|
1927
1936
|
): [State, (action: Action) => void];
|
|
1928
1937
|
|
|
1929
|
-
|
|
1938
|
+
interface UntrackedReactPromise<T> extends PromiseLike<T> {
|
|
1939
|
+
status?: void;
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
export interface PendingReactPromise<T> extends PromiseLike<T> {
|
|
1943
|
+
status: "pending";
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
export interface FulfilledReactPromise<T> extends PromiseLike<T> {
|
|
1947
|
+
status: "fulfilled";
|
|
1948
|
+
value: T;
|
|
1949
|
+
}
|
|
1950
|
+
|
|
1951
|
+
export interface RejectedReactPromise<T> extends PromiseLike<T> {
|
|
1952
|
+
status: "rejected";
|
|
1953
|
+
reason: unknown;
|
|
1954
|
+
}
|
|
1955
|
+
|
|
1956
|
+
export type ReactPromise<T> =
|
|
1957
|
+
| UntrackedReactPromise<T>
|
|
1958
|
+
| PendingReactPromise<T>
|
|
1959
|
+
| FulfilledReactPromise<T>
|
|
1960
|
+
| RejectedReactPromise<T>;
|
|
1961
|
+
|
|
1962
|
+
export type Usable<T> = ReactPromise<T> | Context<T>;
|
|
1930
1963
|
|
|
1931
1964
|
export function use<T>(usable: Usable<T>): T;
|
|
1932
1965
|
|
|
@@ -2041,15 +2074,28 @@ declare namespace React {
|
|
|
2041
2074
|
target: EventTarget & Target;
|
|
2042
2075
|
}
|
|
2043
2076
|
|
|
2077
|
+
/**
|
|
2078
|
+
* @deprecated FormEvent doesn't actually exist.
|
|
2079
|
+
* You probably meant to use {@link ChangeEvent}, {@link InputEvent}, {@link SubmitEvent}, or just {@link SyntheticEvent} instead
|
|
2080
|
+
* depending on the event type.
|
|
2081
|
+
*/
|
|
2044
2082
|
interface FormEvent<T = Element> extends SyntheticEvent<T> {
|
|
2045
2083
|
}
|
|
2046
2084
|
|
|
2047
2085
|
interface InvalidEvent<T = Element> extends SyntheticEvent<T> {
|
|
2048
|
-
target: EventTarget & T;
|
|
2049
2086
|
}
|
|
2050
2087
|
|
|
2051
|
-
|
|
2052
|
-
|
|
2088
|
+
/**
|
|
2089
|
+
* change events bubble in React so their target is generally unknown.
|
|
2090
|
+
* Only for form elements we know their target type because form events can't
|
|
2091
|
+
* be nested.
|
|
2092
|
+
* This type exists purely to narrow `target` for form elements. It doesn't
|
|
2093
|
+
* reflect a DOM event. Change events are just fired as standard {@link SyntheticEvent}.
|
|
2094
|
+
*/
|
|
2095
|
+
interface ChangeEvent<CurrentTarget = Element, Target = Element> extends SyntheticEvent<CurrentTarget> {
|
|
2096
|
+
// TODO: This is wrong for change event handlers on arbitrary. Should
|
|
2097
|
+
// be EventTarget & Target, but kept for backward compatibility until React 20.
|
|
2098
|
+
target: EventTarget & CurrentTarget;
|
|
2053
2099
|
}
|
|
2054
2100
|
|
|
2055
2101
|
interface InputEvent<T = Element> extends SyntheticEvent<T, NativeInputEvent> {
|
|
@@ -2119,6 +2165,13 @@ declare namespace React {
|
|
|
2119
2165
|
shiftKey: boolean;
|
|
2120
2166
|
}
|
|
2121
2167
|
|
|
2168
|
+
interface SubmitEvent<T = Element> extends SyntheticEvent<T, NativeSubmitEvent> {
|
|
2169
|
+
// `submitter` is available in react@canary
|
|
2170
|
+
// submitter: HTMLElement | null;
|
|
2171
|
+
// SubmitEvents are always targetted at HTMLFormElements.
|
|
2172
|
+
target: EventTarget & HTMLFormElement;
|
|
2173
|
+
}
|
|
2174
|
+
|
|
2122
2175
|
interface TouchEvent<T = Element> extends UIEvent<T, NativeTouchEvent> {
|
|
2123
2176
|
altKey: boolean;
|
|
2124
2177
|
changedTouches: TouchList;
|
|
@@ -2174,11 +2227,19 @@ declare namespace React {
|
|
|
2174
2227
|
type CompositionEventHandler<T = Element> = EventHandler<CompositionEvent<T>>;
|
|
2175
2228
|
type DragEventHandler<T = Element> = EventHandler<DragEvent<T>>;
|
|
2176
2229
|
type FocusEventHandler<T = Element> = EventHandler<FocusEvent<T>>;
|
|
2230
|
+
/**
|
|
2231
|
+
* @deprecated FormEventHandler doesn't actually exist.
|
|
2232
|
+
* You probably meant to use {@link ChangeEventHandler}, {@link InputEventHandler}, {@link SubmitEventHandler}, or just {@link EventHandler} instead
|
|
2233
|
+
* depending on the event type.
|
|
2234
|
+
*/
|
|
2177
2235
|
type FormEventHandler<T = Element> = EventHandler<FormEvent<T>>;
|
|
2178
|
-
type ChangeEventHandler<
|
|
2236
|
+
type ChangeEventHandler<CurrentTarget = Element, Target = Element> = EventHandler<
|
|
2237
|
+
ChangeEvent<CurrentTarget, Target>
|
|
2238
|
+
>;
|
|
2179
2239
|
type InputEventHandler<T = Element> = EventHandler<InputEvent<T>>;
|
|
2180
2240
|
type KeyboardEventHandler<T = Element> = EventHandler<KeyboardEvent<T>>;
|
|
2181
2241
|
type MouseEventHandler<T = Element> = EventHandler<MouseEvent<T>>;
|
|
2242
|
+
type SubmitEventHandler<T = Element> = EventHandler<SubmitEvent<T>>;
|
|
2182
2243
|
type TouchEventHandler<T = Element> = EventHandler<TouchEvent<T>>;
|
|
2183
2244
|
type PointerEventHandler<T = Element> = EventHandler<PointerEvent<T>>;
|
|
2184
2245
|
type UIEventHandler<T = Element> = EventHandler<UIEvent<T>>;
|
|
@@ -2232,19 +2293,19 @@ declare namespace React {
|
|
|
2232
2293
|
onBlur?: FocusEventHandler<T> | undefined;
|
|
2233
2294
|
onBlurCapture?: FocusEventHandler<T> | undefined;
|
|
2234
2295
|
|
|
2235
|
-
//
|
|
2236
|
-
onChange?:
|
|
2237
|
-
onChangeCapture?:
|
|
2296
|
+
// form related Events
|
|
2297
|
+
onChange?: ChangeEventHandler<T> | undefined;
|
|
2298
|
+
onChangeCapture?: ChangeEventHandler<T> | undefined;
|
|
2238
2299
|
onBeforeInput?: InputEventHandler<T> | undefined;
|
|
2239
|
-
onBeforeInputCapture?:
|
|
2240
|
-
onInput?:
|
|
2241
|
-
onInputCapture?:
|
|
2242
|
-
onReset?:
|
|
2243
|
-
onResetCapture?:
|
|
2244
|
-
onSubmit?:
|
|
2245
|
-
onSubmitCapture?:
|
|
2246
|
-
onInvalid?:
|
|
2247
|
-
onInvalidCapture?:
|
|
2300
|
+
onBeforeInputCapture?: InputEventHandler<T> | undefined;
|
|
2301
|
+
onInput?: InputEventHandler<T> | undefined;
|
|
2302
|
+
onInputCapture?: InputEventHandler<T> | undefined;
|
|
2303
|
+
onReset?: ReactEventHandler<T> | undefined;
|
|
2304
|
+
onResetCapture?: ReactEventHandler<T> | undefined;
|
|
2305
|
+
onSubmit?: SubmitEventHandler<T> | undefined;
|
|
2306
|
+
onSubmitCapture?: SubmitEventHandler<T> | undefined;
|
|
2307
|
+
onInvalid?: ReactEventHandler<T> | undefined;
|
|
2308
|
+
onInvalidCapture?: ReactEventHandler<T> | undefined;
|
|
2248
2309
|
|
|
2249
2310
|
// Image Events
|
|
2250
2311
|
onLoad?: ReactEventHandler<T> | undefined;
|
|
@@ -2788,7 +2849,7 @@ declare namespace React {
|
|
|
2788
2849
|
|
|
2789
2850
|
// Living Standard
|
|
2790
2851
|
/**
|
|
2791
|
-
* @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert
|
|
2852
|
+
* @see {@link https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/inert}
|
|
2792
2853
|
*/
|
|
2793
2854
|
inert?: boolean | undefined;
|
|
2794
2855
|
/**
|
|
@@ -3251,7 +3312,9 @@ declare namespace React {
|
|
|
3251
3312
|
value?: string | readonly string[] | number | undefined;
|
|
3252
3313
|
width?: number | string | undefined;
|
|
3253
3314
|
|
|
3254
|
-
|
|
3315
|
+
// No other element dispatching change events can be nested in a <input>
|
|
3316
|
+
// so we know the target will be a HTMLInputElement.
|
|
3317
|
+
onChange?: ChangeEventHandler<T, HTMLInputElement> | undefined;
|
|
3255
3318
|
}
|
|
3256
3319
|
|
|
3257
3320
|
interface KeygenHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3416,7 +3479,9 @@ declare namespace React {
|
|
|
3416
3479
|
required?: boolean | undefined;
|
|
3417
3480
|
size?: number | undefined;
|
|
3418
3481
|
value?: string | readonly string[] | number | undefined;
|
|
3419
|
-
|
|
3482
|
+
// No other element dispatching change events can be nested in a <select>
|
|
3483
|
+
// so we know the target will be a HTMLSelectElement.
|
|
3484
|
+
onChange?: ChangeEventHandler<T, HTMLSelectElement> | undefined;
|
|
3420
3485
|
}
|
|
3421
3486
|
|
|
3422
3487
|
interface SourceHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3468,7 +3533,9 @@ declare namespace React {
|
|
|
3468
3533
|
value?: string | readonly string[] | number | undefined;
|
|
3469
3534
|
wrap?: string | undefined;
|
|
3470
3535
|
|
|
3471
|
-
|
|
3536
|
+
// No other element dispatching change events can be nested in a <textarea>
|
|
3537
|
+
// so we know the target will be a HTMLTextAreaElement.
|
|
3538
|
+
onChange?: ChangeEventHandler<T, HTMLTextAreaElement> | undefined;
|
|
3472
3539
|
}
|
|
3473
3540
|
|
|
3474
3541
|
interface TdHTMLAttributes<T> extends HTMLAttributes<T> {
|
|
@@ -3540,6 +3607,9 @@ declare namespace React {
|
|
|
3540
3607
|
method?: string | undefined;
|
|
3541
3608
|
min?: number | string | undefined;
|
|
3542
3609
|
name?: string | undefined;
|
|
3610
|
+
nonce?: string | undefined;
|
|
3611
|
+
part?: string | undefined;
|
|
3612
|
+
slot?: string | undefined;
|
|
3543
3613
|
style?: CSSProperties | undefined;
|
|
3544
3614
|
target?: string | undefined;
|
|
3545
3615
|
type?: string | undefined;
|
|
@@ -4057,7 +4127,6 @@ declare namespace React {
|
|
|
4057
4127
|
* Captures which component contained the exception, and its ancestors.
|
|
4058
4128
|
*/
|
|
4059
4129
|
componentStack?: string | null;
|
|
4060
|
-
digest?: string | null;
|
|
4061
4130
|
}
|
|
4062
4131
|
|
|
4063
4132
|
// Keep in sync with JSX namespace in ./jsx-runtime.d.ts and ./jsx-dev-runtime.d.ts
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
// See https://github.com/facebook/react/blob/main/packages/react-dom/client.js to see how the exports are declared,
|
|
6
6
|
|
|
7
|
-
import React = require("https://esm.sh/@types/react@19.2.
|
|
7
|
+
import React = require("https://esm.sh/@types/react@19.2.14/index.d.ts");
|
|
8
8
|
|
|
9
9
|
export {};
|
|
10
10
|
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type { RemoteMCPToolSourceConfig } from "../tool/index.js";
|
|
2
|
+
import { buildStudioMcpHeaders } from "./live-studio-mcp-tools.js";
|
|
3
|
+
import { clientAllowsStudioMcp, type RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
4
|
+
|
|
5
|
+
export type AgentServiceVeryfrontApiMcpServerConfig = {
|
|
6
|
+
kind: "veryfront-api";
|
|
7
|
+
id?: string;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type AgentServiceVeryfrontStudioMcpServerConfig = {
|
|
11
|
+
kind: "veryfront-studio";
|
|
12
|
+
id?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type AgentServiceGenericMcpServerConfig = {
|
|
16
|
+
kind?: "generic";
|
|
17
|
+
id?: string;
|
|
18
|
+
endpoint: RemoteMCPToolSourceConfig["endpoint"];
|
|
19
|
+
headers?: RemoteMCPToolSourceConfig["headers"];
|
|
20
|
+
fetch?: RemoteMCPToolSourceConfig["fetch"];
|
|
21
|
+
listMethod?: RemoteMCPToolSourceConfig["listMethod"];
|
|
22
|
+
callMethod?: RemoteMCPToolSourceConfig["callMethod"];
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type AgentServiceMcpServerConfig =
|
|
26
|
+
| AgentServiceVeryfrontApiMcpServerConfig
|
|
27
|
+
| AgentServiceVeryfrontStudioMcpServerConfig
|
|
28
|
+
| AgentServiceGenericMcpServerConfig;
|
|
29
|
+
|
|
30
|
+
export type CreateAgentServiceRemoteMcpConfigInput = {
|
|
31
|
+
server: AgentServiceMcpServerConfig;
|
|
32
|
+
authToken: string;
|
|
33
|
+
apiMcpUrl: string;
|
|
34
|
+
studioMcpUrl?: string | null;
|
|
35
|
+
clientProfile?: RuntimeClientProfile | null;
|
|
36
|
+
getProjectId?: () => string | null | undefined;
|
|
37
|
+
conversationId?: string;
|
|
38
|
+
defaultSourceId?: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export function defaultAgentServiceMcpServers(): AgentServiceMcpServerConfig[] {
|
|
42
|
+
return [{ kind: "veryfront-api" }];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function createGenericRemoteMcpConfig(
|
|
46
|
+
server: AgentServiceGenericMcpServerConfig,
|
|
47
|
+
): RemoteMCPToolSourceConfig {
|
|
48
|
+
const config: RemoteMCPToolSourceConfig = {
|
|
49
|
+
endpoint: server.endpoint,
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
if (server.id !== undefined) config.id = server.id;
|
|
53
|
+
if (server.headers !== undefined) config.headers = server.headers;
|
|
54
|
+
if (server.fetch !== undefined) config.fetch = server.fetch;
|
|
55
|
+
if (server.listMethod !== undefined) config.listMethod = server.listMethod;
|
|
56
|
+
if (server.callMethod !== undefined) config.callMethod = server.callMethod;
|
|
57
|
+
|
|
58
|
+
return config;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
function createVeryfrontApiRemoteMcpConfig(
|
|
62
|
+
input: Pick<
|
|
63
|
+
CreateAgentServiceRemoteMcpConfigInput,
|
|
64
|
+
"apiMcpUrl" | "authToken" | "defaultSourceId"
|
|
65
|
+
>,
|
|
66
|
+
server: AgentServiceVeryfrontApiMcpServerConfig,
|
|
67
|
+
): RemoteMCPToolSourceConfig {
|
|
68
|
+
return {
|
|
69
|
+
id: server.id ?? input.defaultSourceId ?? "veryfront-mcp",
|
|
70
|
+
endpoint: input.apiMcpUrl,
|
|
71
|
+
headers: {
|
|
72
|
+
Authorization: `Bearer ${input.authToken}`,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function createVeryfrontStudioRemoteMcpConfig(
|
|
78
|
+
input: Pick<
|
|
79
|
+
CreateAgentServiceRemoteMcpConfigInput,
|
|
80
|
+
"authToken" | "clientProfile" | "conversationId" | "getProjectId" | "studioMcpUrl"
|
|
81
|
+
>,
|
|
82
|
+
server: AgentServiceVeryfrontStudioMcpServerConfig,
|
|
83
|
+
): RemoteMCPToolSourceConfig | null {
|
|
84
|
+
if (!input.studioMcpUrl || !clientAllowsStudioMcp(input.clientProfile)) {
|
|
85
|
+
return null;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
return {
|
|
89
|
+
id: server.id ?? "studio-mcp",
|
|
90
|
+
endpoint: input.studioMcpUrl,
|
|
91
|
+
headers: () =>
|
|
92
|
+
buildStudioMcpHeaders(
|
|
93
|
+
input.authToken,
|
|
94
|
+
input.getProjectId?.() ?? null,
|
|
95
|
+
input.conversationId,
|
|
96
|
+
),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export function createAgentServiceRemoteMcpConfig(
|
|
101
|
+
input: CreateAgentServiceRemoteMcpConfigInput,
|
|
102
|
+
): RemoteMCPToolSourceConfig | null {
|
|
103
|
+
if (input.server.kind === "veryfront-api") {
|
|
104
|
+
return createVeryfrontApiRemoteMcpConfig(input, input.server);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
if (input.server.kind === "veryfront-studio") {
|
|
108
|
+
return createVeryfrontStudioRemoteMcpConfig(input, input.server);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
return createGenericRemoteMcpConfig(input.server);
|
|
112
|
+
}
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
prepareHostedChatRuntimeToolAssembly,
|
|
31
31
|
type PrepareHostedChatRuntimeToolAssemblyInput,
|
|
32
32
|
} from "./hosted-chat-runtime-tool-assembly.js";
|
|
33
|
-
import type {
|
|
33
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
34
34
|
import {
|
|
35
35
|
createHostedRuntimeStateResolver,
|
|
36
36
|
type HostedRuntimeStateResolverContext,
|
|
@@ -46,7 +46,7 @@ export type DefaultHostedChatRuntimeConfig = {
|
|
|
46
46
|
apiUrl: string;
|
|
47
47
|
apiMcpUrl: string;
|
|
48
48
|
studioMcpUrl?: string | null;
|
|
49
|
-
mcpServers?: readonly
|
|
49
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
50
50
|
};
|
|
51
51
|
|
|
52
52
|
export type DefaultHostedChatRuntimeLogger = {
|
|
@@ -29,7 +29,7 @@ import { startHostedChildForkRuntimeWithHostTools } from "./hosted-child-fork-ru
|
|
|
29
29
|
import {
|
|
30
30
|
prepareDefaultHostedChildForkSandboxToolSources,
|
|
31
31
|
} from "./hosted-child-fork-tool-sources.js";
|
|
32
|
-
import type {
|
|
32
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
33
33
|
import { executeHostedChildForkToolInput } from "./hosted-child-fork-execution-runner.js";
|
|
34
34
|
import { createHostedChildInvokeTool } from "./hosted-child-invoke-tool.js";
|
|
35
35
|
import {
|
|
@@ -80,7 +80,7 @@ export type DefaultHostedInvokeAgentConfig = {
|
|
|
80
80
|
apiUrl: string;
|
|
81
81
|
apiMcpUrl: string;
|
|
82
82
|
studioMcpUrl?: string | null;
|
|
83
|
-
mcpServers?: readonly
|
|
83
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
84
84
|
enableDurableInvokeAgent?: boolean;
|
|
85
85
|
};
|
|
86
86
|
|
|
@@ -17,9 +17,9 @@ import {
|
|
|
17
17
|
fetchLatestConversationUserText,
|
|
18
18
|
updateDefaultResearchArtifacts,
|
|
19
19
|
} from "./default-research-artifact-support.js";
|
|
20
|
+
import { type AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
20
21
|
import {
|
|
21
22
|
createHostedProjectRemoteToolSources,
|
|
22
|
-
type HostedProjectMcpServerConfig,
|
|
23
23
|
type HostedProjectRemoteToolSourceMutationHandler,
|
|
24
24
|
type HostedProjectRemoteToolSourcePrepareToolInput,
|
|
25
25
|
type HostedProjectRemoteToolSourceProjectSwitchHandler,
|
|
@@ -59,7 +59,7 @@ export type PrepareHostedChatRuntimeToolAssemblyInput<
|
|
|
59
59
|
apiUrl: string;
|
|
60
60
|
apiMcpUrl: string;
|
|
61
61
|
studioMcpUrl?: string | null;
|
|
62
|
-
mcpServers?: readonly
|
|
62
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
63
63
|
conversationId?: string;
|
|
64
64
|
allowedToolNames?: HostedChatRuntimeAllowedToolNames;
|
|
65
65
|
projectScopedRemoteToolOptions?: ProjectScopedRemoteToolOptions;
|
|
@@ -5,6 +5,11 @@ import {
|
|
|
5
5
|
type RemoteMCPToolSourceConfig,
|
|
6
6
|
type RemoteToolSource,
|
|
7
7
|
} from "../tool/index.js";
|
|
8
|
+
import {
|
|
9
|
+
type AgentServiceMcpServerConfig,
|
|
10
|
+
createAgentServiceRemoteMcpConfig,
|
|
11
|
+
defaultAgentServiceMcpServers,
|
|
12
|
+
} from "./agent-service-mcp-server-config.js";
|
|
8
13
|
import {
|
|
9
14
|
type AgentServiceSandboxToolsOptions,
|
|
10
15
|
type AgentServiceSandboxToolsResult,
|
|
@@ -14,11 +19,6 @@ import {
|
|
|
14
19
|
createLiveStudioMcpTools,
|
|
15
20
|
type LiveStudioMcpToolsOptions,
|
|
16
21
|
} from "./live-studio-mcp-tools.js";
|
|
17
|
-
import type { HostedProjectMcpServerConfig } from "./hosted-project-remote-tool-source.js";
|
|
18
|
-
import {
|
|
19
|
-
createHostedProjectGenericRemoteMcpConfig,
|
|
20
|
-
createHostedProjectVeryfrontApiRemoteMcpConfig,
|
|
21
|
-
} from "./hosted-project-remote-tool-source.js";
|
|
22
22
|
import type { RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
23
23
|
import {
|
|
24
24
|
type HostedChildProjectSwitchHandler,
|
|
@@ -36,7 +36,7 @@ export type HostedChildForkToolSourcesLogger = {
|
|
|
36
36
|
export type PrepareDefaultHostedChildForkToolSourcesInput = {
|
|
37
37
|
authToken: string;
|
|
38
38
|
apiMcpUrl: string;
|
|
39
|
-
mcpServers?: readonly
|
|
39
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
40
40
|
getProjectId: () => string | null | undefined;
|
|
41
41
|
studioMcpUrl?: string | null;
|
|
42
42
|
clientProfile?: RuntimeClientProfile | null;
|
|
@@ -75,10 +75,6 @@ export type PrepareDefaultHostedChildForkSandboxToolSourcesInput =
|
|
|
75
75
|
) => Promise<AgentServiceSandboxToolsResult>;
|
|
76
76
|
};
|
|
77
77
|
|
|
78
|
-
function defaultChildForkMcpServers(): HostedProjectMcpServerConfig[] {
|
|
79
|
-
return [{ kind: "veryfront-api" }];
|
|
80
|
-
}
|
|
81
|
-
|
|
82
78
|
export async function prepareDefaultHostedChildForkToolSources(
|
|
83
79
|
input: PrepareDefaultHostedChildForkToolSourcesInput,
|
|
84
80
|
): Promise<DefaultHostedChildForkToolSourcesResult> {
|
|
@@ -93,7 +89,7 @@ export async function prepareDefaultHostedChildForkToolSources(
|
|
|
93
89
|
createToolsFromRemoteDefinitions;
|
|
94
90
|
|
|
95
91
|
try {
|
|
96
|
-
const mcpServers = input.mcpServers ??
|
|
92
|
+
const mcpServers = input.mcpServers ?? defaultAgentServiceMcpServers();
|
|
97
93
|
for (const server of mcpServers) {
|
|
98
94
|
if (server.kind === "veryfront-studio") {
|
|
99
95
|
const studioTools = await createLiveStudioTools({
|
|
@@ -114,13 +110,15 @@ export async function prepareDefaultHostedChildForkToolSources(
|
|
|
114
110
|
continue;
|
|
115
111
|
}
|
|
116
112
|
|
|
117
|
-
const remoteConfig =
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
113
|
+
const remoteConfig = createAgentServiceRemoteMcpConfig({
|
|
114
|
+
server,
|
|
115
|
+
authToken: input.authToken,
|
|
116
|
+
apiMcpUrl: input.apiMcpUrl,
|
|
117
|
+
defaultSourceId: "veryfront-mcp-fork",
|
|
118
|
+
});
|
|
119
|
+
if (!remoteConfig) {
|
|
120
|
+
continue;
|
|
121
|
+
}
|
|
124
122
|
const remoteSource = createRemoteToolSource(remoteConfig);
|
|
125
123
|
const definitions = await remoteSource.listTools();
|
|
126
124
|
remoteMcpTools = {
|
|
@@ -8,9 +8,13 @@ import {
|
|
|
8
8
|
type RemoteToolSource,
|
|
9
9
|
type ToolExecutionContext,
|
|
10
10
|
} from "../tool/index.js";
|
|
11
|
+
import {
|
|
12
|
+
type AgentServiceMcpServerConfig,
|
|
13
|
+
createAgentServiceRemoteMcpConfig,
|
|
14
|
+
defaultAgentServiceMcpServers,
|
|
15
|
+
} from "./agent-service-mcp-server-config.js";
|
|
11
16
|
import { toChildRunToolInputRecord } from "./child-run-execution-support.js";
|
|
12
|
-
import {
|
|
13
|
-
import { clientAllowsStudioMcp, type RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
17
|
+
import type { RuntimeClientProfile } from "./runtime-client-profile.js";
|
|
14
18
|
import { getConfirmedProjectContextSwitchId } from "./project-context.js";
|
|
15
19
|
import {
|
|
16
20
|
getProjectSteeringMutation,
|
|
@@ -27,31 +31,6 @@ export type HostedProjectRemoteToolSourceProjectSwitchHandler = (
|
|
|
27
31
|
projectId: string,
|
|
28
32
|
) => Promise<void> | void;
|
|
29
33
|
|
|
30
|
-
export type HostedProjectVeryfrontApiMcpServerConfig = {
|
|
31
|
-
kind: "veryfront-api";
|
|
32
|
-
id?: string;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
export type HostedProjectVeryfrontStudioMcpServerConfig = {
|
|
36
|
-
kind: "veryfront-studio";
|
|
37
|
-
id?: string;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export type HostedProjectGenericMcpServerConfig = {
|
|
41
|
-
kind?: "generic";
|
|
42
|
-
id?: string;
|
|
43
|
-
endpoint: RemoteMCPToolSourceConfig["endpoint"];
|
|
44
|
-
headers?: RemoteMCPToolSourceConfig["headers"];
|
|
45
|
-
fetch?: RemoteMCPToolSourceConfig["fetch"];
|
|
46
|
-
listMethod?: RemoteMCPToolSourceConfig["listMethod"];
|
|
47
|
-
callMethod?: RemoteMCPToolSourceConfig["callMethod"];
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
export type HostedProjectMcpServerConfig =
|
|
51
|
-
| HostedProjectVeryfrontApiMcpServerConfig
|
|
52
|
-
| HostedProjectVeryfrontStudioMcpServerConfig
|
|
53
|
-
| HostedProjectGenericMcpServerConfig;
|
|
54
|
-
|
|
55
34
|
export type HostedProjectRemoteToolSourcePrepareToolInput = (input: {
|
|
56
35
|
toolName: string;
|
|
57
36
|
toolInput: Record<string, unknown>;
|
|
@@ -213,7 +192,7 @@ export type CreateHostedProjectRemoteToolSourcesInput =
|
|
|
213
192
|
authToken: string;
|
|
214
193
|
apiMcpUrl: string;
|
|
215
194
|
studioMcpUrl?: string | null;
|
|
216
|
-
mcpServers?: readonly
|
|
195
|
+
mcpServers?: readonly AgentServiceMcpServerConfig[];
|
|
217
196
|
clientProfile?: RuntimeClientProfile | null;
|
|
218
197
|
getProjectId: () => string | null | undefined;
|
|
219
198
|
conversationId?: string;
|
|
@@ -221,79 +200,6 @@ export type CreateHostedProjectRemoteToolSourcesInput =
|
|
|
221
200
|
onStudioProjectSwitch?: HostedProjectRemoteToolSourceProjectSwitchHandler;
|
|
222
201
|
};
|
|
223
202
|
|
|
224
|
-
function defaultHostedProjectMcpServers(): HostedProjectMcpServerConfig[] {
|
|
225
|
-
return [{ kind: "veryfront-api" }];
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export function createHostedProjectGenericRemoteMcpConfig(
|
|
229
|
-
server: HostedProjectGenericMcpServerConfig,
|
|
230
|
-
): RemoteMCPToolSourceConfig {
|
|
231
|
-
const config: RemoteMCPToolSourceConfig = {
|
|
232
|
-
endpoint: server.endpoint,
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
if (server.id !== undefined) config.id = server.id;
|
|
236
|
-
if (server.headers !== undefined) config.headers = server.headers;
|
|
237
|
-
if (server.fetch !== undefined) config.fetch = server.fetch;
|
|
238
|
-
if (server.listMethod !== undefined) config.listMethod = server.listMethod;
|
|
239
|
-
if (server.callMethod !== undefined) config.callMethod = server.callMethod;
|
|
240
|
-
|
|
241
|
-
return config;
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
export function createHostedProjectVeryfrontApiRemoteMcpConfig(
|
|
245
|
-
input: Pick<CreateHostedProjectRemoteToolSourcesInput, "apiMcpUrl" | "authToken"> & {
|
|
246
|
-
defaultSourceId?: string;
|
|
247
|
-
},
|
|
248
|
-
server: HostedProjectVeryfrontApiMcpServerConfig,
|
|
249
|
-
): RemoteMCPToolSourceConfig {
|
|
250
|
-
return {
|
|
251
|
-
id: server.id ?? input.defaultSourceId ?? "veryfront-mcp",
|
|
252
|
-
endpoint: input.apiMcpUrl,
|
|
253
|
-
headers: {
|
|
254
|
-
Authorization: `Bearer ${input.authToken}`,
|
|
255
|
-
},
|
|
256
|
-
};
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
function createVeryfrontStudioRemoteMcpConfig(
|
|
260
|
-
input: Pick<
|
|
261
|
-
CreateHostedProjectRemoteToolSourcesInput,
|
|
262
|
-
"authToken" | "clientProfile" | "conversationId" | "getProjectId" | "studioMcpUrl"
|
|
263
|
-
>,
|
|
264
|
-
server: HostedProjectVeryfrontStudioMcpServerConfig,
|
|
265
|
-
): RemoteMCPToolSourceConfig | null {
|
|
266
|
-
if (!input.studioMcpUrl || !clientAllowsStudioMcp(input.clientProfile)) {
|
|
267
|
-
return null;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
return {
|
|
271
|
-
id: server.id ?? "studio-mcp",
|
|
272
|
-
endpoint: input.studioMcpUrl,
|
|
273
|
-
headers: () =>
|
|
274
|
-
buildStudioMcpHeaders(
|
|
275
|
-
input.authToken,
|
|
276
|
-
input.getProjectId() ?? null,
|
|
277
|
-
input.conversationId,
|
|
278
|
-
),
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
|
|
282
|
-
function createRemoteMcpConfig(
|
|
283
|
-
input: CreateHostedProjectRemoteToolSourcesInput,
|
|
284
|
-
server: HostedProjectMcpServerConfig,
|
|
285
|
-
): RemoteMCPToolSourceConfig | null {
|
|
286
|
-
if (server.kind === "veryfront-api") {
|
|
287
|
-
return createHostedProjectVeryfrontApiRemoteMcpConfig(input, server);
|
|
288
|
-
}
|
|
289
|
-
|
|
290
|
-
if (server.kind === "veryfront-studio") {
|
|
291
|
-
return createVeryfrontStudioRemoteMcpConfig(input, server);
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
return createHostedProjectGenericRemoteMcpConfig(server);
|
|
295
|
-
}
|
|
296
|
-
|
|
297
203
|
function createHostedProjectRemoteToolSourceFromConfig(
|
|
298
204
|
input: CreateHostedProjectRemoteToolSourcesInput,
|
|
299
205
|
source: RemoteToolSource,
|
|
@@ -327,10 +233,18 @@ export function createHostedProjectRemoteToolSources(
|
|
|
327
233
|
): RemoteToolSource[] {
|
|
328
234
|
const createRemoteToolSource = input.createRemoteToolSource ?? createRemoteMCPToolSource;
|
|
329
235
|
const sources: RemoteToolSource[] = [];
|
|
330
|
-
const mcpServers = input.mcpServers ??
|
|
236
|
+
const mcpServers = input.mcpServers ?? defaultAgentServiceMcpServers();
|
|
331
237
|
|
|
332
238
|
for (const server of mcpServers) {
|
|
333
|
-
const remoteConfig =
|
|
239
|
+
const remoteConfig = createAgentServiceRemoteMcpConfig({
|
|
240
|
+
server,
|
|
241
|
+
authToken: input.authToken,
|
|
242
|
+
apiMcpUrl: input.apiMcpUrl,
|
|
243
|
+
studioMcpUrl: input.studioMcpUrl,
|
|
244
|
+
clientProfile: input.clientProfile,
|
|
245
|
+
getProjectId: input.getProjectId,
|
|
246
|
+
conversationId: input.conversationId,
|
|
247
|
+
});
|
|
334
248
|
if (!remoteConfig) {
|
|
335
249
|
continue;
|
|
336
250
|
}
|
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
fetchDefaultHostedProjectSteering,
|
|
62
62
|
} from "./default-hosted-project-steering-refresh.js";
|
|
63
63
|
import { type HostedProjectSkillIdsContext } from "./hosted-project-steering-adapter.js";
|
|
64
|
-
import type {
|
|
64
|
+
import type { AgentServiceMcpServerConfig } from "./agent-service-mcp-server-config.js";
|
|
65
65
|
import type { RuntimeLoadSkillToolContext } from "./runtime-load-skill-tool.js";
|
|
66
66
|
import type { RuntimeProjectSteeringLookup } from "./runtime-project-skill-catalog.js";
|
|
67
67
|
import type { RuntimeSkillDefinition } from "./runtime-skill-metadata.js";
|
|
@@ -116,11 +116,11 @@ export type NodeVeryfrontCloudAgentServiceAgentSource = "auto" | "code" | "markd
|
|
|
116
116
|
|
|
117
117
|
export type VeryfrontMcpServerKind = "api" | "studio";
|
|
118
118
|
|
|
119
|
-
export type NodeVeryfrontCloudAgentServiceMcpServer =
|
|
119
|
+
export type NodeVeryfrontCloudAgentServiceMcpServer = AgentServiceMcpServerConfig;
|
|
120
120
|
|
|
121
121
|
export function veryfrontMcpServer(
|
|
122
122
|
kind: VeryfrontMcpServerKind = "api",
|
|
123
|
-
):
|
|
123
|
+
): AgentServiceMcpServerConfig {
|
|
124
124
|
if (kind === "studio") {
|
|
125
125
|
return { kind: "veryfront-studio" };
|
|
126
126
|
}
|