veryfront 0.1.1012 → 0.1.1013
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/hosted/cloud-prepared-chat-execution-runtime.d.ts +4 -0
- package/esm/src/agent/hosted/cloud-prepared-chat-execution-runtime.d.ts.map +1 -1
- package/esm/src/agent/hosted/cloud-prepared-chat-execution-runtime.js +21 -1
- package/esm/src/agent/hosted/prepared-chat-execution.d.ts +1 -1
- package/esm/src/agent/hosted/prepared-chat-execution.d.ts.map +1 -1
- package/esm/src/agent/hosted/prepared-chat-execution.js +6 -0
- 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/esm/deno.js
CHANGED
|
@@ -9,6 +9,8 @@ export declare const VERYFRONT_CHAT_STREAM_TOOL_TIMEOUT_ENV = "VERYFRONT_CHAT_ST
|
|
|
9
9
|
type ChatStreamWatchdogEnv = Record<string, string | undefined>;
|
|
10
10
|
/** Resolve Veryfront Cloud chat stream watchdog timeout overrides from environment values. */
|
|
11
11
|
export declare function resolveVeryfrontCloudChatStreamWatchdogOptions(env?: ChatStreamWatchdogEnv): Pick<ChatStreamWatchdogOptions, "idleTimeoutMs" | "toolRunningTimeoutMs">;
|
|
12
|
+
/** Derive hosted chat bootstrap watchdog options from resolved root stream watchdog options. */
|
|
13
|
+
export declare function resolveVeryfrontCloudStreamBootstrapWatchdogOptions(options: Pick<ChatStreamWatchdogOptions, "idleTimeoutMs" | "toolRunningTimeoutMs">): Pick<PreparedHostedChatExecutionRuntimeOptions, "streamBootstrapKeepaliveIntervalMs" | "streamBootstrapTimeoutMs">;
|
|
12
14
|
/** Input payload for create Veryfront Cloud prepared hosted chat execution runtime options. */
|
|
13
15
|
export type CreateVeryfrontCloudPreparedHostedChatExecutionRuntimeOptionsInput = {
|
|
14
16
|
apiUrl: string | URL;
|
|
@@ -18,6 +20,8 @@ export type CreateVeryfrontCloudPreparedHostedChatExecutionRuntimeOptionsInput =
|
|
|
18
20
|
traceStream?: <TResult>(operation: () => Promise<TResult>) => Promise<TResult>;
|
|
19
21
|
setActiveSpanAttributes?: (attributes: AgentTraceAttributes) => void;
|
|
20
22
|
createRootStreamWatchdog?: PreparedHostedChatExecutionRuntimeOptions["createRootStreamWatchdog"];
|
|
23
|
+
streamBootstrapKeepaliveIntervalMs?: PreparedHostedChatExecutionRuntimeOptions["streamBootstrapKeepaliveIntervalMs"];
|
|
24
|
+
streamBootstrapTimeoutMs?: PreparedHostedChatExecutionRuntimeOptions["streamBootstrapTimeoutMs"];
|
|
21
25
|
};
|
|
22
26
|
/** Options accepted by create Veryfront Cloud prepared hosted chat execution runtime. */
|
|
23
27
|
export declare function createVeryfrontCloudPreparedHostedChatExecutionRuntimeOptions(input: CreateVeryfrontCloudPreparedHostedChatExecutionRuntimeOptionsInput): PreparedHostedChatExecutionRuntimeOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloud-prepared-chat-execution-runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/cloud-prepared-chat-execution-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAE9F,2DAA2D;AAC3D,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAC9F,kEAAkE;AAClE,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAE9F,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAWhE,8FAA8F;AAC9F,wBAAgB,8CAA8C,CAC5D,GAAG,GAAE,qBAGJ,GACA,IAAI,CAAC,yBAAyB,EAAE,eAAe,GAAG,sBAAsB,CAAC,CAQ3E;AAED,+FAA+F;AAC/F,MAAM,MAAM,kEAAkE,GAAG;IAC/E,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;IACrB,MAAM,EAAE,yCAAyC,CAAC,QAAQ,CAAC,CAAC;IAC5D,MAAM,CAAC,EAAE,gCAAgC,CAAC;IAC1C,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChG,WAAW,CAAC,EAAE,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/E,uBAAuB,CAAC,EAAE,CAAC,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACrE,wBAAwB,CAAC,EAAE,yCAAyC,CAAC,0BAA0B,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"cloud-prepared-chat-execution-runtime.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/cloud-prepared-chat-execution-runtime.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,6BAA6B,CAAC;AACpF,OAAO,KAAK,EAAE,yCAAyC,EAAE,MAAM,8BAA8B,CAAC;AAE9F,2DAA2D;AAC3D,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAC9F,kEAAkE;AAClE,eAAO,MAAM,sCAAsC,0CAA0C,CAAC;AAE9F,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC;AAWhE,8FAA8F;AAC9F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
|
27
27
|
}
|
|
28
|
+
/** Derive hosted chat bootstrap watchdog options from resolved root stream watchdog options. */
|
|
29
|
+
export function resolveVeryfrontCloudStreamBootstrapWatchdogOptions(options) {
|
|
30
|
+
const streamBootstrapKeepaliveIntervalMs = typeof options.idleTimeoutMs === "number"
|
|
31
|
+
? Math.max(1, Math.floor(options.idleTimeoutMs / 2))
|
|
32
|
+
: undefined;
|
|
33
|
+
return {
|
|
34
|
+
...(streamBootstrapKeepaliveIntervalMs !== undefined
|
|
35
|
+
? { streamBootstrapKeepaliveIntervalMs }
|
|
36
|
+
: {}),
|
|
37
|
+
...(options.toolRunningTimeoutMs !== undefined
|
|
38
|
+
? { streamBootstrapTimeoutMs: options.toolRunningTimeoutMs }
|
|
39
|
+
: {}),
|
|
40
|
+
};
|
|
41
|
+
}
|
|
28
42
|
/** Options accepted by create Veryfront Cloud prepared hosted chat execution runtime. */
|
|
29
43
|
export function createVeryfrontCloudPreparedHostedChatExecutionRuntimeOptions(input) {
|
|
44
|
+
const watchdogOptions = resolveVeryfrontCloudChatStreamWatchdogOptions();
|
|
45
|
+
const streamBootstrapOptions = resolveVeryfrontCloudStreamBootstrapWatchdogOptions(watchdogOptions);
|
|
30
46
|
return {
|
|
31
47
|
apiUrl: input.apiUrl,
|
|
32
48
|
tracer: input.tracer,
|
|
@@ -35,10 +51,14 @@ export function createVeryfrontCloudPreparedHostedChatExecutionRuntimeOptions(in
|
|
|
35
51
|
traceStream: input.traceStream,
|
|
36
52
|
createRootStreamWatchdog: input.createRootStreamWatchdog ??
|
|
37
53
|
(() => createChatStreamWatchdog({
|
|
38
|
-
...
|
|
54
|
+
...watchdogOptions,
|
|
39
55
|
setTimeoutFn: dntShim.dntGlobalThis.setTimeout,
|
|
40
56
|
clearTimeoutFn: globalThis.clearTimeout,
|
|
41
57
|
})),
|
|
58
|
+
streamBootstrapKeepaliveIntervalMs: input.streamBootstrapKeepaliveIntervalMs ??
|
|
59
|
+
streamBootstrapOptions.streamBootstrapKeepaliveIntervalMs,
|
|
60
|
+
streamBootstrapTimeoutMs: input.streamBootstrapTimeoutMs ??
|
|
61
|
+
streamBootstrapOptions.streamBootstrapTimeoutMs,
|
|
42
62
|
logger: input.logger,
|
|
43
63
|
setActiveSpanAttributes: input.setActiveSpanAttributes,
|
|
44
64
|
};
|
|
@@ -6,7 +6,7 @@ export type PreparedHostedChatExecution = Omit<CreateBootstrappedHostedChatExecu
|
|
|
6
6
|
runtimeKind?: string;
|
|
7
7
|
};
|
|
8
8
|
/** Options accepted by prepared hosted chat execution runtime. */
|
|
9
|
-
export type PreparedHostedChatExecutionRuntimeOptions = Pick<CreateBootstrappedHostedChatExecutionRuntimeInput, "tracer" | "resolveProvider" | "traceStream" | "logger" | "spanName" | "terminalErrorCode" | "incompleteToolCallsPartErrorText" | "createRootStreamWatchdog" | "createTerminalAdapter"> & {
|
|
9
|
+
export type PreparedHostedChatExecutionRuntimeOptions = Pick<CreateBootstrappedHostedChatExecutionRuntimeInput, "tracer" | "resolveProvider" | "traceStream" | "logger" | "spanName" | "terminalErrorCode" | "incompleteToolCallsPartErrorText" | "createRootStreamWatchdog" | "streamBootstrapKeepaliveIntervalMs" | "streamBootstrapTimeoutMs" | "createTerminalAdapter"> & {
|
|
10
10
|
apiUrl: string | URL;
|
|
11
11
|
trace?: <TResult>(operationName: string, operation: () => Promise<TResult>) => Promise<TResult>;
|
|
12
12
|
setActiveSpanAttributes?: (attributes: AgentTraceAttributes) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepared-chat-execution.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/prepared-chat-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAGL,KAAK,iDAAiD,EACvD,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAEvE,8DAA8D;AAC9D,MAAM,MAAM,2BAA2B,GACnC,IAAI,CACJ,iDAAiD,EAC/C,QAAQ,GACR,aAAa,GACb,mBAAmB,GACnB,QAAQ,GACR,iBAAiB,GACjB,aAAa,GACb,QAAQ,GACR,UAAU,GACV,mBAAmB,GACnB,kCAAkC,GAClC,0BAA0B,GAC1B,uBAAuB,CAC1B,GACC;IACA,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEJ,kEAAkE;AAClE,MAAM,MAAM,yCAAyC,GACjD,IAAI,CACJ,iDAAiD,EAC/C,QAAQ,GACR,iBAAiB,GACjB,aAAa,GACb,QAAQ,GACR,UAAU,GACV,mBAAmB,GACnB,kCAAkC,GAClC,0BAA0B,GAC1B,uBAAuB,CAC1B,GACC;IACA,MAAM,EAAE,MAAM,GAAG,GAAG,CAAC;IACrB,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAChG,uBAAuB,CAAC,EAAE,CAAC,UAAU,EAAE,oBAAoB,KAAK,IAAI,CAAC;CACtE,CAAC;AAEJ,+DAA+D;AAC/D,MAAM,MAAM,sCAAsC,CAChD,UAAU,SAAS,2BAA2B,GAAG,2BAA2B,IAC1E,UAAU,GAAG;IACf,kBAAkB,EAAE,WAAW,CAAC;IAChC,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,iEAAiE;AACjE,MAAM,MAAM,wCAAwC,CAClD,UAAU,SAAS,2BAA2B,GAAG,2BAA2B,IAC1E,UAAU,GAAG;IACf,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;
|
|
1
|
+
{"version":3,"file":"prepared-chat-execution.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/hosted/prepared-chat-execution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO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AAC3E,wBAAsB,+CAA+C,CACnE,UAAU,SAAS,2BAA2B,EAC9C,KAAK,EAAE;IACP,SAAS,EAAE,sCAAsC,CAAC,UAAU,CAAC,CAAC;IAC9D,OAAO,EAAE,yCAAyC,CAAC;CACpD,GAAG,OAAO,CAAC,QAAQ,CAAC,CA2BpB;AAED,mDAAmD;AACnD,wBAAsB,sCAAsC,CAC1D,UAAU,SAAS,2BAA2B,EAC9C,KAAK,EAAE;IACP,SAAS,EAAE,wCAAwC,CAAC,UAAU,CAAC,CAAC;IAChE,OAAO,EAAE,yCAAyC,CAAC;CACpD,GAAG,OAAO,CAAC,IAAI,CAAC,CAyChB"}
|
|
@@ -28,6 +28,12 @@ function createBootstrappedPreparedHostedChatExecutionRuntime(input) {
|
|
|
28
28
|
terminalErrorCode: input.runtime.terminalErrorCode,
|
|
29
29
|
incompleteToolCallsPartErrorText: input.runtime.incompleteToolCallsPartErrorText,
|
|
30
30
|
createRootStreamWatchdog: input.runtime.createRootStreamWatchdog,
|
|
31
|
+
...(input.runtime.streamBootstrapKeepaliveIntervalMs !== undefined
|
|
32
|
+
? { streamBootstrapKeepaliveIntervalMs: input.runtime.streamBootstrapKeepaliveIntervalMs }
|
|
33
|
+
: {}),
|
|
34
|
+
...(input.runtime.streamBootstrapTimeoutMs !== undefined
|
|
35
|
+
? { streamBootstrapTimeoutMs: input.runtime.streamBootstrapTimeoutMs }
|
|
36
|
+
: {}),
|
|
31
37
|
createTerminalAdapter: input.runtime.createTerminalAdapter,
|
|
32
38
|
...(input.responseMessageId ? { responseMessageId: input.responseMessageId } : {}),
|
|
33
39
|
});
|