veryfront 0.1.510 → 0.1.512
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/runtime-agent-definition-files.d.ts +5 -0
- package/esm/src/agent/runtime-agent-definition-files.d.ts.map +1 -1
- package/esm/src/agent/runtime-agent-definition-files.js +37 -9
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts +8 -4
- package/esm/src/agent/veryfront-cloud-agent-service.d.ts.map +1 -1
- package/esm/src/agent/veryfront-cloud-agent-service.js +74 -29
- 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/runtime-agent-definition-files.ts +52 -9
- package/src/src/agent/veryfront-cloud-agent-service.ts +115 -37
- package/src/src/utils/version-constant.ts +1 -1
|
@@ -14,12 +14,12 @@ import { buildAgentRunTraceAttributes, buildExecuteToolTraceAttributes, filterAg
|
|
|
14
14
|
import { runAgentServiceMain, } from "./agent-service-bootstrap.js";
|
|
15
15
|
import { loadAgentServiceEnvFiles } from "./agent-service-env-files.js";
|
|
16
16
|
import { createHostedFormInputTool } from "./hosted-form-input-tool.js";
|
|
17
|
-
import { createHostedAgentProjectSteering } from "./hosted-agent-project-steering.js";
|
|
17
|
+
import { createHostedAgentProjectSteering, } from "./hosted-agent-project-steering.js";
|
|
18
18
|
import { createLiveStudioMcpTools } from "./live-studio-mcp-tools.js";
|
|
19
19
|
import { createDefaultHostedChatRuntime, } from "./default-hosted-chat-runtime.js";
|
|
20
20
|
import { createDefaultHostedInvokeAgentTool } from "./default-hosted-invoke-agent-tool.js";
|
|
21
21
|
import { createDefaultHostedProjectSteeringRefresh, fetchDefaultHostedProjectSteering, } from "./default-hosted-project-steering-refresh.js";
|
|
22
|
-
import {
|
|
22
|
+
import { listRuntimeAgentMarkdownDefinitionIds } from "./runtime-agent-definition-files.js";
|
|
23
23
|
import { buildVeryfrontCloudRuntimeInstructions, } from "./veryfront-cloud-runtime-system-messages.js";
|
|
24
24
|
import { createNodeAgentServiceRuntimeInfrastructure, } from "./node-agent-service-runtime-infrastructure.js";
|
|
25
25
|
import { createAgentServiceRuntime, startAgentServiceRuntime, startNodeAgentService, } from "./agent-service-runtime.js";
|
|
@@ -127,20 +127,14 @@ function createNodeVeryfrontCloudAgentServiceContext(options) {
|
|
|
127
127
|
function trace(operationName, operation) {
|
|
128
128
|
return infrastructure.tracer.trace(operationName, operation);
|
|
129
129
|
}
|
|
130
|
-
const projectSteering = createHostedAgentProjectSteering({
|
|
131
|
-
baseDir: resolveBaseDir(options),
|
|
132
|
-
agentId: options.agentId,
|
|
133
|
-
getApiUrl: () => infrastructure.getConfig().VERYFRONT_API_URL,
|
|
134
|
-
logger: infrastructure.logger,
|
|
135
|
-
trace,
|
|
136
|
-
});
|
|
137
130
|
return {
|
|
138
131
|
options,
|
|
139
132
|
processTarget,
|
|
140
133
|
projectDir: resolveProjectDir(options),
|
|
141
134
|
infrastructure,
|
|
142
135
|
trace,
|
|
143
|
-
|
|
136
|
+
defaultAgentId: null,
|
|
137
|
+
projectSteeringByAgentId: new Map(),
|
|
144
138
|
tracker: createDetachedRunTracker(),
|
|
145
139
|
discoveryResult: null,
|
|
146
140
|
agentConfig: null,
|
|
@@ -160,21 +154,11 @@ async function createRuntimeAgentDefinitionFromCodeAgent(codeAgent) {
|
|
|
160
154
|
maxSteps: codeAgent.config.maxSteps,
|
|
161
155
|
};
|
|
162
156
|
}
|
|
163
|
-
function getMarkdownAgentConfig(context) {
|
|
164
|
-
return context.
|
|
157
|
+
function getMarkdownAgentConfig(context, agentId) {
|
|
158
|
+
return getProjectSteering(context, agentId).getAgentConfig();
|
|
165
159
|
}
|
|
166
160
|
function loadMarkdownAgentConfig(context, agentId) {
|
|
167
|
-
|
|
168
|
-
return getMarkdownAgentConfig(context);
|
|
169
|
-
}
|
|
170
|
-
const agentsDir = resolveRuntimeAgentDefinitionsDir({
|
|
171
|
-
baseDir: resolveBaseDir(context.options),
|
|
172
|
-
id: agentId,
|
|
173
|
-
});
|
|
174
|
-
return loadRuntimeAgentMarkdownDefinitionFromFile({
|
|
175
|
-
agentsDir,
|
|
176
|
-
id: agentId,
|
|
177
|
-
});
|
|
161
|
+
return getMarkdownAgentConfig(context, agentId);
|
|
178
162
|
}
|
|
179
163
|
async function resolveAgentConfig(context, agentId) {
|
|
180
164
|
const cachedAgentConfig = context.agentConfigs.get(agentId);
|
|
@@ -213,28 +197,89 @@ async function discoverProjectPrimitives(context) {
|
|
|
213
197
|
});
|
|
214
198
|
context.discoveryResult = await discoverAll(discoveryOptions);
|
|
215
199
|
}
|
|
200
|
+
function getDiscoveredCodeAgentIds(context) {
|
|
201
|
+
return [...(context.discoveryResult?.agents.keys() ?? [])].sort((left, right) => left.localeCompare(right));
|
|
202
|
+
}
|
|
203
|
+
function getDiscoveredMarkdownAgentIds(context) {
|
|
204
|
+
return listRuntimeAgentMarkdownDefinitionIds({
|
|
205
|
+
baseDir: resolveBaseDir(context.options),
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
function describeAgentIdCandidates(input) {
|
|
209
|
+
const ids = [...new Set([...input.codeAgentIds, ...input.markdownAgentIds])]
|
|
210
|
+
.sort((left, right) => left.localeCompare(right));
|
|
211
|
+
return ids.length > 0 ? ids.join(", ") : "none";
|
|
212
|
+
}
|
|
213
|
+
function resolveSingleAgentId(input) {
|
|
214
|
+
if (input.source === "code") {
|
|
215
|
+
return input.codeAgentIds.length === 1 ? input.codeAgentIds[0] ?? null : null;
|
|
216
|
+
}
|
|
217
|
+
if (input.source === "markdown") {
|
|
218
|
+
return input.markdownAgentIds.length === 1 ? input.markdownAgentIds[0] ?? null : null;
|
|
219
|
+
}
|
|
220
|
+
const candidateIds = [...new Set([...input.codeAgentIds, ...input.markdownAgentIds])];
|
|
221
|
+
return candidateIds.length === 1 ? candidateIds[0] ?? null : null;
|
|
222
|
+
}
|
|
223
|
+
function resolveDefaultAgentId(context) {
|
|
224
|
+
if (context.options.agentId) {
|
|
225
|
+
return context.options.agentId;
|
|
226
|
+
}
|
|
227
|
+
const source = context.options.agentSource ?? "auto";
|
|
228
|
+
const codeAgentIds = getDiscoveredCodeAgentIds(context);
|
|
229
|
+
const markdownAgentIds = getDiscoveredMarkdownAgentIds(context);
|
|
230
|
+
const agentId = resolveSingleAgentId({ codeAgentIds, markdownAgentIds, source });
|
|
231
|
+
if (agentId) {
|
|
232
|
+
return agentId;
|
|
233
|
+
}
|
|
234
|
+
throw new Error([
|
|
235
|
+
"agentId is required when agent discovery does not resolve to exactly one agent.",
|
|
236
|
+
`Discovered agents: ${describeAgentIdCandidates({ codeAgentIds, markdownAgentIds })}.`,
|
|
237
|
+
].join(" "));
|
|
238
|
+
}
|
|
216
239
|
async function initializeNodeVeryfrontCloudAgentServiceContext(context) {
|
|
217
240
|
await discoverProjectPrimitives(context);
|
|
218
|
-
context.
|
|
241
|
+
context.defaultAgentId = resolveDefaultAgentId(context);
|
|
242
|
+
context.agentConfig = await resolveAgentConfig(context, context.defaultAgentId);
|
|
243
|
+
}
|
|
244
|
+
function getDefaultAgentId(context) {
|
|
245
|
+
if (!context.defaultAgentId) {
|
|
246
|
+
throw new Error("Agent service context has not been initialized.");
|
|
247
|
+
}
|
|
248
|
+
return context.defaultAgentId;
|
|
249
|
+
}
|
|
250
|
+
function getProjectSteering(context, agentId = getDefaultAgentId(context)) {
|
|
251
|
+
const cachedProjectSteering = context.projectSteeringByAgentId.get(agentId);
|
|
252
|
+
if (cachedProjectSteering) {
|
|
253
|
+
return cachedProjectSteering;
|
|
254
|
+
}
|
|
255
|
+
const projectSteering = createHostedAgentProjectSteering({
|
|
256
|
+
baseDir: resolveBaseDir(context.options),
|
|
257
|
+
agentId,
|
|
258
|
+
getApiUrl: () => context.infrastructure.getConfig().VERYFRONT_API_URL,
|
|
259
|
+
logger: context.infrastructure.logger,
|
|
260
|
+
trace: context.trace,
|
|
261
|
+
});
|
|
262
|
+
context.projectSteeringByAgentId.set(agentId, projectSteering);
|
|
263
|
+
return projectSteering;
|
|
219
264
|
}
|
|
220
265
|
function getDiscoveredHostTools() {
|
|
221
266
|
return Object.fromEntries([...toolRegistry.getAll()].sort(([left], [right]) => left.localeCompare(right)));
|
|
222
267
|
}
|
|
223
268
|
function getProjectInstructions(context, lookup) {
|
|
224
269
|
return context.trace("chat.getProjectInstructions", async () => {
|
|
225
|
-
return await context.
|
|
270
|
+
return await getProjectSteering(context).getProjectInstructions(lookup);
|
|
226
271
|
});
|
|
227
272
|
}
|
|
228
273
|
function getSkillsConfig(context, lookup) {
|
|
229
274
|
return context.trace("chat.getSkillsConfig", async () => {
|
|
230
|
-
return await context.
|
|
275
|
+
return await getProjectSteering(context).getSkillsConfig(lookup);
|
|
231
276
|
});
|
|
232
277
|
}
|
|
233
278
|
function createLoadSkillTool(context, toolContext) {
|
|
234
|
-
return context.
|
|
279
|
+
return getProjectSteering(context).createLoadSkillTool(toolContext);
|
|
235
280
|
}
|
|
236
281
|
async function refreshProjectSkillIds(context, skillContext) {
|
|
237
|
-
await context.
|
|
282
|
+
await getProjectSteering(context).refreshProjectSkillIds(skillContext);
|
|
238
283
|
}
|
|
239
284
|
function setFilteredTraceAttributes(context, attributes) {
|
|
240
285
|
context.infrastructure.setActiveSpanAttributes(filterAgentTraceAttributes(attributes));
|
|
@@ -381,7 +426,7 @@ async function prepareChatExecution(context, req) {
|
|
|
381
426
|
const { userId, authToken, projectId, conversationId, upstreamParentConversationId, upstreamParentRunId, spawnedFromToolCallId, } = req;
|
|
382
427
|
const config = context.infrastructure.getConfig();
|
|
383
428
|
setPrepareChatExecutionStartAttributes(context, { projectId, userId });
|
|
384
|
-
const agentConfig = await resolveAgentConfig(context, req.agentId ?? context
|
|
429
|
+
const agentConfig = await resolveAgentConfig(context, req.agentId ?? getDefaultAgentId(context));
|
|
385
430
|
const { effectiveMessages, rootRunContext, runtime: { agent, runtimeKind, modelId, cleanup }, finalMessages, } = await prepareVeryfrontCloudHostedChatExecution({
|
|
386
431
|
request: req,
|
|
387
432
|
agentConfig,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.1.
|
|
1
|
+
export declare const VERSION = "0.1.512";
|
|
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;
|