veryfront 0.1.206 → 0.1.208
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/data-stream.d.ts.map +1 -1
- package/esm/src/agent/data-stream.js +19 -4
- package/esm/src/agent/runtime/tool-helpers.d.ts.map +1 -1
- package/esm/src/agent/runtime/tool-helpers.js +11 -2
- package/esm/src/provider/runtime-loader.d.ts +46 -0
- package/esm/src/provider/runtime-loader.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader.js +847 -70
- package/esm/src/provider/types.d.ts +2 -0
- package/esm/src/provider/types.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/src/agent/data-stream.ts +22 -4
- package/src/src/agent/runtime/tool-helpers.ts +13 -2
- package/src/src/provider/runtime-loader.ts +1216 -101
- package/src/src/provider/types.ts +2 -0
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../../../src/src/agent/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMzE,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"data-stream.d.ts","sourceRoot":"","sources":["../../../src/src/agent/data-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAMzE,wBAAgB,kCAAkC,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAmB1E;AAED,wBAAgB,mBAAmB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAavF;AAED,wBAAgB,kBAAkB,CAAC,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CActF;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAiB5E;AAED,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG;IACvD,MAAM,EAAE,sBAAsB,EAAE,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;CACnB,CAoBA;AAED,wBAAuB,sBAAsB,CAC3C,MAAM,EAAE,cAAc,CAAC,UAAU,CAAC,GACjC,cAAc,CAAC,sBAAsB,CAAC,CAkCxC"}
|
|
@@ -3,14 +3,29 @@ function isRecord(value) {
|
|
|
3
3
|
}
|
|
4
4
|
export function stripLeadingEmptyObjectPlaceholder(rawArgs) {
|
|
5
5
|
let normalized = rawArgs.trim();
|
|
6
|
-
while (normalized.startsWith("{}")
|
|
7
|
-
|
|
6
|
+
while (normalized.startsWith("{}")) {
|
|
7
|
+
const remainder = normalized.slice(2).trimStart();
|
|
8
|
+
if (remainder.startsWith("{")) {
|
|
9
|
+
normalized = remainder;
|
|
10
|
+
continue;
|
|
11
|
+
}
|
|
12
|
+
if (remainder.startsWith('"')) {
|
|
13
|
+
normalized = `{${remainder}`;
|
|
14
|
+
continue;
|
|
15
|
+
}
|
|
16
|
+
break;
|
|
8
17
|
}
|
|
9
18
|
return normalized;
|
|
10
19
|
}
|
|
11
20
|
export function mergeToolInputDelta(currentArguments, nextDelta) {
|
|
12
|
-
if (currentArguments === "{}"
|
|
13
|
-
|
|
21
|
+
if (currentArguments === "{}") {
|
|
22
|
+
const normalizedDelta = nextDelta.trimStart();
|
|
23
|
+
if (normalizedDelta.startsWith("{")) {
|
|
24
|
+
return normalizedDelta;
|
|
25
|
+
}
|
|
26
|
+
if (normalizedDelta.startsWith('"')) {
|
|
27
|
+
return `{${normalizedDelta}`;
|
|
28
|
+
}
|
|
14
29
|
}
|
|
15
30
|
return currentArguments + nextDelta;
|
|
16
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/tool-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAaxG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"tool-helpers.d.ts","sourceRoot":"","sources":["../../../../src/src/agent/runtime/tool-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAaxG;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAuBD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACxC,cAAc,CAyBhB;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAED;;;GAGG;AAEH,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,OAAO,CAAC;AAqHvD,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,EAC/D,QAAQ,EAAE,MAAM,GACf,IAAI,GAAG,IAAI,CAmBb;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,EAC/D,OAAO,CAAC,EAAE,oBAAoB,EAC9B,sBAAsB,CAAC,EAAE,MAAM,EAAE,EACjC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,GACrC,OAAO,CAAC,OAAO,CAAC,CAoClB;AAoBD;;;;;;;GAOG;AACH,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,GAAG,SAAS,EAC/D,OAAO,CAAC,EAAE;IACR,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,sBAAsB,CAAC,EAAE,MAAM,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACvC,iBAAiB,CAAC,EAAE,oBAAoB,CAAC;CAC1C,GACA,OAAO,CAAC,cAAc,EAAE,CAAC,CA+E3B"}
|
|
@@ -14,8 +14,17 @@ import { executeRemoteIntegrationTool, isRemoteIntegrationTool, } from "../../in
|
|
|
14
14
|
const logger = serverLogger.component("agent");
|
|
15
15
|
function stripLeadingEmptyObjectPlaceholder(rawArgs) {
|
|
16
16
|
let normalized = rawArgs.trim();
|
|
17
|
-
while (normalized.startsWith("{}")
|
|
18
|
-
|
|
17
|
+
while (normalized.startsWith("{}")) {
|
|
18
|
+
const remainder = normalized.slice(2).trimStart();
|
|
19
|
+
if (remainder.startsWith("{")) {
|
|
20
|
+
normalized = remainder;
|
|
21
|
+
continue;
|
|
22
|
+
}
|
|
23
|
+
if (remainder.startsWith('"')) {
|
|
24
|
+
normalized = `{${remainder}`;
|
|
25
|
+
continue;
|
|
26
|
+
}
|
|
27
|
+
break;
|
|
19
28
|
}
|
|
20
29
|
return normalized;
|
|
21
30
|
}
|
|
@@ -18,9 +18,55 @@ export interface GoogleRuntimeConfig {
|
|
|
18
18
|
name?: string;
|
|
19
19
|
fetch?: typeof globalThis.fetch;
|
|
20
20
|
}
|
|
21
|
+
type ProviderKind = "anthropic" | "openai" | "google";
|
|
22
|
+
/**
|
|
23
|
+
* Structured warning emitted when a provider runtime drops or rewrites a
|
|
24
|
+
* caller-provided option. Mirrors the AI ecosystem convention (Vercel AI
|
|
25
|
+
* SDK, LangChain) of returning `unsupported-setting` warnings on the
|
|
26
|
+
* runtime result so callers can discover silently-dropped fields without
|
|
27
|
+
* having to read the source.
|
|
28
|
+
*/
|
|
29
|
+
export type ProviderWarning = {
|
|
30
|
+
type: "unsupported-setting" | "other";
|
|
31
|
+
setting?: string;
|
|
32
|
+
details?: string;
|
|
33
|
+
provider: ProviderKind;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Base class for typed provider errors. The `retryable` flag is the
|
|
37
|
+
* primary signal for callers (or a retry wrapper) to decide whether to
|
|
38
|
+
* re-issue the request. `retryAfterMs` is set when the provider gave an
|
|
39
|
+
* explicit delay hint (Retry-After header, Retry-Info trailer).
|
|
40
|
+
*/
|
|
41
|
+
export declare class ProviderError extends Error {
|
|
42
|
+
readonly provider: ProviderKind;
|
|
43
|
+
readonly status: number;
|
|
44
|
+
readonly retryable: boolean;
|
|
45
|
+
readonly retryAfterMs?: number;
|
|
46
|
+
constructor(options: {
|
|
47
|
+
provider: ProviderKind;
|
|
48
|
+
status: number;
|
|
49
|
+
message: string;
|
|
50
|
+
retryable: boolean;
|
|
51
|
+
retryAfterMs?: number;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/** Provider reports it is overloaded (Anthropic 529, OpenAI/Google 503). */
|
|
55
|
+
export declare class ProviderOverloadedError extends ProviderError {
|
|
56
|
+
}
|
|
57
|
+
/** Provider is rate limiting this API key (OpenAI/Google 429 with Retry-After). */
|
|
58
|
+
export declare class ProviderRateLimitError extends ProviderError {
|
|
59
|
+
}
|
|
60
|
+
/** Provider account quota is exhausted — non-retryable. */
|
|
61
|
+
export declare class ProviderQuotaError extends ProviderError {
|
|
62
|
+
}
|
|
63
|
+
/** Non-retryable 4xx/5xx that doesn't fit another bucket. */
|
|
64
|
+
export declare class ProviderRequestError extends ProviderError {
|
|
65
|
+
}
|
|
21
66
|
export declare function createOpenAIModelRuntime(config: OpenAIRuntimeConfig, modelId: string): ModelRuntime;
|
|
22
67
|
export declare function createAnthropicModelRuntime(config: AnthropicRuntimeConfig, modelId: string): ModelRuntime;
|
|
23
68
|
export declare function createGoogleModelRuntime(config: GoogleRuntimeConfig, modelId: string): ModelRuntime;
|
|
24
69
|
export declare function createOpenAIEmbeddingRuntime(config: OpenAIRuntimeConfig, modelId: string): EmbeddingRuntime;
|
|
25
70
|
export declare function createGoogleEmbeddingRuntime(config: GoogleRuntimeConfig, modelId: string): EmbeddingRuntime;
|
|
71
|
+
export {};
|
|
26
72
|
//# sourceMappingURL=runtime-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-loader.d.ts","sourceRoot":"","sources":["../../../src/src/provider/runtime-loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAEjE,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CACjC;AAED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