@eko-ai/eko 2.0.3-alpha.6 → 2.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/browser/browser_base.d.ts +2 -0
- package/dist/agent/browser/browser_base.d.ts.map +1 -1
- package/dist/agent/browser/browser_labels.d.ts +2 -1
- package/dist/agent/browser/browser_labels.d.ts.map +1 -1
- package/dist/agent/browser/browser_screen.d.ts +2 -1
- package/dist/agent/browser/browser_screen.d.ts.map +1 -1
- package/dist/agent/browser/index.d.ts +2 -3
- package/dist/agent/browser/index.d.ts.map +1 -1
- package/dist/common/utils.d.ts.map +1 -1
- package/dist/index.cjs.js +87 -177
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.esm.js +87 -177
- package/dist/index.esm.js.map +1 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/package.json +8 -8
- package/README.md +0 -159
- package/dist/mcp/client.d.ts +0 -28
- package/dist/mcp/client.d.ts.map +0 -1
|
@@ -2,6 +2,7 @@ import { LanguageModelV1Prompt } from "@ai-sdk/provider";
|
|
|
2
2
|
import { Agent } from "../base";
|
|
3
3
|
import { AgentContext } from "../../core/context";
|
|
4
4
|
import { ToolExecuter, IMcpClient } from "../../types";
|
|
5
|
+
export declare const AGENT_NAME = "Browser";
|
|
5
6
|
export default abstract class BaseBrowserAgent extends Agent {
|
|
6
7
|
protected abstract screenshot(agentContext: AgentContext): Promise<{
|
|
7
8
|
imageBase64: string;
|
|
@@ -43,4 +44,5 @@ export default abstract class BaseBrowserAgent extends Agent {
|
|
|
43
44
|
protected abstract execute_script(agentContext: AgentContext, func: (...args: any[]) => void, args: any[]): Promise<any>;
|
|
44
45
|
protected execute_mcp_script(agentContext: AgentContext, script: string): Promise<string | number | Record<string, any> | undefined>;
|
|
45
46
|
}
|
|
47
|
+
export { BaseBrowserAgent };
|
|
46
48
|
//# sourceMappingURL=browser_base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
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AC1B,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,CAAC;IAyBtE,SAAS,CAAC,YAAY,CAAC,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,YAAY;cAmDzD,gBAAgB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC;QACpE,GAAG,EAAE,MAAM,CAAC;QACZ,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,KAAK,CAAC,EAAE,MAAM,CAAC;KAChB,CAAC;IAaF,SAAS,CAAC,cAAc,CAAC,QAAQ,EAAE,qBAAqB,GAAG;QACzD,EAAE,EAAE,MAAM,CAAC;QACX,QAAQ,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,OAAO,CAAC;QACd,MAAM,EAAE,OAAO,CAAC;QAChB,OAAO,CAAC,EAAE,OAAO,CAAC;KACnB,GAAG,IAAI;IAyCR,SAAS,CAAC,QAAQ,CAAC,cAAc,CAC/B,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,EAC9B,IAAI,EAAE,GAAG,EAAE,GACV,OAAO,CAAC,GAAG,CAAC;cAEC,kBAAkB,CAChC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,SAAS,CAAC;CAG9D;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseBrowserAgent from "./browser_base";
|
|
1
|
+
import { BaseBrowserAgent } from "./browser_base";
|
|
2
2
|
import { AgentContext } from "../../core/context";
|
|
3
3
|
import { Tool, IMcpClient } from "../../types";
|
|
4
4
|
import { LanguageModelV1Prompt } from "@ai-sdk/provider";
|
|
@@ -20,4 +20,5 @@ export default abstract class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
20
20
|
private buildInitTools;
|
|
21
21
|
protected handleMessages(agentContext: AgentContext, messages: LanguageModelV1Prompt, tools: Tool[]): Promise<void>;
|
|
22
22
|
}
|
|
23
|
+
export { BaseBrowserLabelsAgent };
|
|
23
24
|
//# sourceMappingURL=browser_labels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,gBAAgB;gBAC/D,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,EAAE,UAAU;cAqCvD,UAAU,CACxB,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,IAAI,CAAC;cAOA,aAAa,CAC3B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GAClC,OAAO,CAAC,IAAI,CAAC;cAMA,iBAAiB,CAC/B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;cAaA,kBAAkB,CAChC,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;cAgBA,gBAAgB,CAC9B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC;cAIA,kBAAkB,CAChC,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,GAAG,CAAC;cAMC,aAAa,CAC3B,YAAY,EAAE,YAAY,EAC1B,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,GAAG,CAAC;cAMC,mBAAmB,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC;QACvE,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,YAAY,GAAG,WAAW,CAAC;QACtC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAuCF,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInD,OAAO,CAAC,cAAc;cAkVN,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,IAAI,EAAE,GACZ,OAAO,CAAC,IAAI,CAAC;CA8BjB;AAiKD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseBrowserAgent from "./browser_base";
|
|
1
|
+
import { BaseBrowserAgent } from "./browser_base";
|
|
2
2
|
import { AgentContext } from "../../core/context";
|
|
3
3
|
import { Tool, IMcpClient } from "../../types";
|
|
4
4
|
import { LanguageModelV1Prompt } from "@ai-sdk/provider";
|
|
@@ -13,4 +13,5 @@ export default abstract class BaseBrowserScreenAgent extends BaseBrowserAgent {
|
|
|
13
13
|
private buildInitTools;
|
|
14
14
|
protected handleMessages(agentContext: AgentContext, messages: LanguageModelV1Prompt, tools: Tool[]): Promise<void>;
|
|
15
15
|
}
|
|
16
|
+
export { BaseBrowserScreenAgent };
|
|
16
17
|
//# sourceMappingURL=browser_screen.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_screen.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_screen.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"browser_screen.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_screen.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,gBAAgB;gBAC/D,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,EAAE,UAAU;IA6BvE,SAAS,CAAC,QAAQ,CAAC,MAAM,CACvB,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,IAAI,CAAC;IAEhB,SAAS,CAAC,QAAQ,CAAC,KAAK,CACtB,YAAY,EAAE,YAAY,EAC1B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,EACT,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,GACvC,OAAO,CAAC,IAAI,CAAC;IAEhB,SAAS,CAAC,QAAQ,CAAC,MAAM,CACvB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAEhB,SAAS,CAAC,QAAQ,CAAC,OAAO,CACxB,YAAY,EAAE,YAAY,EAC1B,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,OAAO,CAAC,IAAI,CAAC;IAEhB,SAAS,CAAC,QAAQ,CAAC,KAAK,CACtB,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,QAAQ,GACtD,OAAO,CAAC,IAAI,CAAC;IAEhB,SAAS,CAAC,QAAQ,CAAC,aAAa,CAC9B,YAAY,EAAE,YAAY,EAC1B,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,EACV,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,IAAI,CAAC;IAEhB,OAAO,CAAC,cAAc;cAsUN,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,IAAI,EAAE,GACZ,OAAO,CAAC,IAAI,CAAC;CA4BjB;AAED,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import BaseBrowserAgent from "./browser_base";
|
|
1
|
+
import { BaseBrowserAgent, AGENT_NAME } from "./browser_base";
|
|
2
2
|
import BaseBrowserLabelsAgent from "./browser_labels";
|
|
3
3
|
import BaseBrowserScreenAgent from "./browser_screen";
|
|
4
|
-
export
|
|
5
|
-
export { BaseBrowserAgent, BaseBrowserScreenAgent, BaseBrowserLabelsAgent };
|
|
4
|
+
export { AGENT_NAME, BaseBrowserAgent, BaseBrowserScreenAgent, BaseBrowserLabelsAgent };
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,gBAAgB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC9D,OAAO,sBAAsB,MAAM,kBAAkB,CAAC;AACtD,OAAO,sBAAsB,MAAM,kBAAkB,CAAC;AAEtD,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjD;AAED,wBAAgB,MAAM,IAAI,MAAM,CAM/B;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EACjD,GAAG,EAAE,MAAM,CAAC,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACnC,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,GACf,2BAA2B,CA8B7B;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/common/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAEjC,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjD;AAED,wBAAgB,MAAM,IAAI,MAAM,CAM/B;AAED,wBAAgB,YAAY,CAAC,CAAC,SAAS,OAAO,CAAC,GAAG,CAAC,EACjD,GAAG,EAAE,MAAM,CAAC,EACZ,OAAO,EAAE,MAAM,EACf,cAAc,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,GACnC,OAAO,CAAC,CAAC,CAAC,CAgBZ;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,UAAU,GACf,2BAA2B,CA8B7B;AAED,wBAAgB,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,UAAU,GAAG,GAAG,CAsB3D;AAED,wBAAgB,UAAU,CAAC,CAAC,SAAS,IAAI,GAAG,2BAA2B,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,CAAC,EAAE,CAuBtG;AAED,wBAAgB,WAAW,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,CAuBvE;AAED,wBAAgB,GAAG,CACjB,GAAG,EAAE,MAAM,EACX,SAAS,EAAE,MAAM,EACjB,WAAW,GAAE,OAAc,GAC1B,MAAM,CAQR;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,UA6ErC"}
|
package/dist/index.cjs.js
CHANGED
|
@@ -512,13 +512,13 @@ function getDefaultExportFromCjs (x) {
|
|
|
512
512
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
513
513
|
}
|
|
514
514
|
|
|
515
|
-
var secureJsonParse
|
|
515
|
+
var secureJsonParse = {exports: {}};
|
|
516
516
|
|
|
517
|
-
var hasRequiredSecureJsonParse
|
|
517
|
+
var hasRequiredSecureJsonParse;
|
|
518
518
|
|
|
519
|
-
function requireSecureJsonParse
|
|
520
|
-
if (hasRequiredSecureJsonParse
|
|
521
|
-
hasRequiredSecureJsonParse
|
|
519
|
+
function requireSecureJsonParse () {
|
|
520
|
+
if (hasRequiredSecureJsonParse) return secureJsonParse.exports;
|
|
521
|
+
hasRequiredSecureJsonParse = 1;
|
|
522
522
|
|
|
523
523
|
const hasBuffer = typeof Buffer !== 'undefined';
|
|
524
524
|
const suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
@@ -639,16 +639,16 @@ function requireSecureJsonParse$1 () {
|
|
|
639
639
|
}
|
|
640
640
|
}
|
|
641
641
|
|
|
642
|
-
secureJsonParse
|
|
643
|
-
secureJsonParse
|
|
644
|
-
secureJsonParse
|
|
645
|
-
secureJsonParse
|
|
646
|
-
secureJsonParse
|
|
647
|
-
return secureJsonParse
|
|
642
|
+
secureJsonParse.exports = parse;
|
|
643
|
+
secureJsonParse.exports.default = parse;
|
|
644
|
+
secureJsonParse.exports.parse = parse;
|
|
645
|
+
secureJsonParse.exports.safeParse = safeParse;
|
|
646
|
+
secureJsonParse.exports.scan = filter;
|
|
647
|
+
return secureJsonParse.exports;
|
|
648
648
|
}
|
|
649
649
|
|
|
650
|
-
var secureJsonParseExports
|
|
651
|
-
var SecureJSON
|
|
650
|
+
var secureJsonParseExports = requireSecureJsonParse();
|
|
651
|
+
var SecureJSON = /*@__PURE__*/getDefaultExportFromCjs(secureJsonParseExports);
|
|
652
652
|
|
|
653
653
|
// src/combine-headers.ts
|
|
654
654
|
function combineHeaders$1(...headers) {
|
|
@@ -743,7 +743,7 @@ function splitLines$1(buffer, chunk) {
|
|
|
743
743
|
} else if (char === "\r") {
|
|
744
744
|
lines.push(currentLine);
|
|
745
745
|
currentLine = "";
|
|
746
|
-
if (chunk[i
|
|
746
|
+
if (chunk[i] === "\n") {
|
|
747
747
|
i++;
|
|
748
748
|
}
|
|
749
749
|
} else {
|
|
@@ -935,7 +935,7 @@ function parseJSON$1({
|
|
|
935
935
|
schema
|
|
936
936
|
}) {
|
|
937
937
|
try {
|
|
938
|
-
const value = SecureJSON
|
|
938
|
+
const value = SecureJSON.parse(text);
|
|
939
939
|
if (schema == null) {
|
|
940
940
|
return value;
|
|
941
941
|
}
|
|
@@ -952,7 +952,7 @@ function safeParseJSON$1({
|
|
|
952
952
|
schema
|
|
953
953
|
}) {
|
|
954
954
|
try {
|
|
955
|
-
const value = SecureJSON
|
|
955
|
+
const value = SecureJSON.parse(text);
|
|
956
956
|
if (schema == null) {
|
|
957
957
|
return { success: true, value, rawValue: value };
|
|
958
958
|
}
|
|
@@ -967,7 +967,7 @@ function safeParseJSON$1({
|
|
|
967
967
|
}
|
|
968
968
|
function isParsableJson$1(input) {
|
|
969
969
|
try {
|
|
970
|
-
SecureJSON
|
|
970
|
+
SecureJSON.parse(input);
|
|
971
971
|
return true;
|
|
972
972
|
} catch (e) {
|
|
973
973
|
return false;
|
|
@@ -2240,15 +2240,15 @@ const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z
|
|
|
2240
2240
|
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
2241
2241
|
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
2242
2242
|
function timeRegexSource(args) {
|
|
2243
|
-
|
|
2244
|
-
let regex = `([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d`;
|
|
2243
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
2245
2244
|
if (args.precision) {
|
|
2246
|
-
|
|
2245
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
2247
2246
|
}
|
|
2248
2247
|
else if (args.precision == null) {
|
|
2249
|
-
|
|
2248
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
2250
2249
|
}
|
|
2251
|
-
|
|
2250
|
+
const secondsQuantifier = args.precision ? "+" : "?"; // require seconds if precision is nonzero
|
|
2251
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
2252
2252
|
}
|
|
2253
2253
|
function timeRegex(args) {
|
|
2254
2254
|
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
@@ -6661,7 +6661,7 @@ var openaiChatChunkSchema = z.union([
|
|
|
6661
6661
|
z.object({
|
|
6662
6662
|
index: z.number(),
|
|
6663
6663
|
id: z.string().nullish(),
|
|
6664
|
-
type: z.literal("function").
|
|
6664
|
+
type: z.literal("function").nullish(),
|
|
6665
6665
|
function: z.object({
|
|
6666
6666
|
name: z.string().nullish(),
|
|
6667
6667
|
arguments: z.string().nullish()
|
|
@@ -6683,7 +6683,7 @@ var openaiChatChunkSchema = z.union([
|
|
|
6683
6683
|
})
|
|
6684
6684
|
).nullable()
|
|
6685
6685
|
}).nullish(),
|
|
6686
|
-
finish_reason: z.string().
|
|
6686
|
+
finish_reason: z.string().nullish(),
|
|
6687
6687
|
index: z.number()
|
|
6688
6688
|
})
|
|
6689
6689
|
),
|
|
@@ -6717,11 +6717,23 @@ var reasoningModels = {
|
|
|
6717
6717
|
"o1-preview-2024-09-12": {
|
|
6718
6718
|
systemMessageMode: "remove"
|
|
6719
6719
|
},
|
|
6720
|
+
o3: {
|
|
6721
|
+
systemMessageMode: "developer"
|
|
6722
|
+
},
|
|
6723
|
+
"o3-2025-04-16": {
|
|
6724
|
+
systemMessageMode: "developer"
|
|
6725
|
+
},
|
|
6720
6726
|
"o3-mini": {
|
|
6721
6727
|
systemMessageMode: "developer"
|
|
6722
6728
|
},
|
|
6723
6729
|
"o3-mini-2025-01-31": {
|
|
6724
6730
|
systemMessageMode: "developer"
|
|
6731
|
+
},
|
|
6732
|
+
"o4-mini": {
|
|
6733
|
+
systemMessageMode: "developer"
|
|
6734
|
+
},
|
|
6735
|
+
"o4-mini-2025-04-16": {
|
|
6736
|
+
systemMessageMode: "developer"
|
|
6725
6737
|
}
|
|
6726
6738
|
};
|
|
6727
6739
|
function convertToOpenAICompletionPrompt({
|
|
@@ -8502,7 +8514,9 @@ function toImage(imageData) {
|
|
|
8502
8514
|
if (imageData.startsWith("data:image/")) {
|
|
8503
8515
|
imageData = imageData.substring(imageData.indexOf(",") + 1);
|
|
8504
8516
|
}
|
|
8517
|
+
// @ts-ignore
|
|
8505
8518
|
if (typeof Buffer != "undefined") {
|
|
8519
|
+
// @ts-ignore
|
|
8506
8520
|
const buffer = Buffer.from(imageData, "base64");
|
|
8507
8521
|
image = new Uint8Array(buffer);
|
|
8508
8522
|
}
|
|
@@ -10181,7 +10195,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10181
10195
|
seed,
|
|
10182
10196
|
providerMetadata
|
|
10183
10197
|
}) {
|
|
10184
|
-
var _a, _b;
|
|
10198
|
+
var _a, _b, _c;
|
|
10185
10199
|
const type = mode.type;
|
|
10186
10200
|
const warnings = [];
|
|
10187
10201
|
const googleOptions = parseProviderOptions({
|
|
@@ -10189,6 +10203,12 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10189
10203
|
providerOptions: providerMetadata,
|
|
10190
10204
|
schema: googleGenerativeAIProviderOptionsSchema
|
|
10191
10205
|
});
|
|
10206
|
+
if (((_a = googleOptions == null ? void 0 : googleOptions.thinkingConfig) == null ? void 0 : _a.includeThoughts) === true && !this.config.provider.startsWith("google.vertex.")) {
|
|
10207
|
+
warnings.push({
|
|
10208
|
+
type: "other",
|
|
10209
|
+
message: `The 'includeThoughts' option is only supported with the Google Vertex provider and might not be supported or could behave unexpectedly with the current Google provider (${this.config.provider}).`
|
|
10210
|
+
});
|
|
10211
|
+
}
|
|
10192
10212
|
const generationConfig = {
|
|
10193
10213
|
// standardized settings:
|
|
10194
10214
|
maxOutputTokens: maxTokens,
|
|
@@ -10216,7 +10236,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10216
10236
|
case "regular": {
|
|
10217
10237
|
const { tools, toolConfig, toolWarnings } = prepareTools$1(
|
|
10218
10238
|
mode,
|
|
10219
|
-
(
|
|
10239
|
+
(_b = this.settings.useSearchGrounding) != null ? _b : false,
|
|
10220
10240
|
this.settings.dynamicRetrievalConfig,
|
|
10221
10241
|
this.modelId
|
|
10222
10242
|
);
|
|
@@ -10260,7 +10280,7 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10260
10280
|
functionDeclarations: [
|
|
10261
10281
|
{
|
|
10262
10282
|
name: mode.tool.name,
|
|
10263
|
-
description: (
|
|
10283
|
+
description: (_c = mode.tool.description) != null ? _c : "",
|
|
10264
10284
|
parameters: convertJSONSchemaToOpenAPISchema(
|
|
10265
10285
|
mode.tool.parameters
|
|
10266
10286
|
)
|
|
@@ -10311,11 +10331,13 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10311
10331
|
const parts = candidate.content == null || typeof candidate.content !== "object" || !("parts" in candidate.content) ? [] : candidate.content.parts;
|
|
10312
10332
|
const toolCalls = getToolCallsFromParts({
|
|
10313
10333
|
parts,
|
|
10334
|
+
// Use candidateParts
|
|
10314
10335
|
generateId: this.config.generateId
|
|
10315
10336
|
});
|
|
10316
10337
|
const usageMetadata = response.usageMetadata;
|
|
10317
10338
|
return {
|
|
10318
10339
|
text: getTextFromParts(parts),
|
|
10340
|
+
reasoning: getReasoningDetailsFromParts(parts),
|
|
10319
10341
|
files: (_a = getInlineDataParts(parts)) == null ? void 0 : _a.map((part) => ({
|
|
10320
10342
|
data: part.inlineData.data,
|
|
10321
10343
|
mimeType: part.inlineData.mimeType
|
|
@@ -10402,6 +10424,17 @@ var GoogleGenerativeAILanguageModel = class {
|
|
|
10402
10424
|
textDelta: deltaText
|
|
10403
10425
|
});
|
|
10404
10426
|
}
|
|
10427
|
+
const reasoningDeltaText = getReasoningDetailsFromParts(
|
|
10428
|
+
content.parts
|
|
10429
|
+
);
|
|
10430
|
+
if (reasoningDeltaText != null) {
|
|
10431
|
+
for (const part of reasoningDeltaText) {
|
|
10432
|
+
controller.enqueue({
|
|
10433
|
+
type: "reasoning",
|
|
10434
|
+
textDelta: part.text
|
|
10435
|
+
});
|
|
10436
|
+
}
|
|
10437
|
+
}
|
|
10405
10438
|
const inlineDataParts = getInlineDataParts(content.parts);
|
|
10406
10439
|
if (inlineDataParts != null) {
|
|
10407
10440
|
for (const part of inlineDataParts) {
|
|
@@ -10488,9 +10521,17 @@ function getToolCallsFromParts({
|
|
|
10488
10521
|
}));
|
|
10489
10522
|
}
|
|
10490
10523
|
function getTextFromParts(parts) {
|
|
10491
|
-
const textParts = parts == null ? void 0 : parts.filter(
|
|
10524
|
+
const textParts = parts == null ? void 0 : parts.filter(
|
|
10525
|
+
(part) => "text" in part && part.thought !== true
|
|
10526
|
+
);
|
|
10492
10527
|
return textParts == null || textParts.length === 0 ? void 0 : textParts.map((part) => part.text).join("");
|
|
10493
10528
|
}
|
|
10529
|
+
function getReasoningDetailsFromParts(parts) {
|
|
10530
|
+
const reasoningParts = parts == null ? void 0 : parts.filter(
|
|
10531
|
+
(part) => "text" in part && part.thought === true
|
|
10532
|
+
);
|
|
10533
|
+
return reasoningParts == null || reasoningParts.length === 0 ? void 0 : reasoningParts.map((part) => ({ type: "text", text: part.text }));
|
|
10534
|
+
}
|
|
10494
10535
|
function getInlineDataParts(parts) {
|
|
10495
10536
|
return parts == null ? void 0 : parts.filter(
|
|
10496
10537
|
(part) => "inlineData" in part
|
|
@@ -10515,7 +10556,8 @@ var contentSchema = z.object({
|
|
|
10515
10556
|
parts: z.array(
|
|
10516
10557
|
z.union([
|
|
10517
10558
|
z.object({
|
|
10518
|
-
text: z.string()
|
|
10559
|
+
text: z.string(),
|
|
10560
|
+
thought: z.boolean().nullish()
|
|
10519
10561
|
}),
|
|
10520
10562
|
z.object({
|
|
10521
10563
|
functionCall: z.object({
|
|
@@ -10563,8 +10605,8 @@ var groundingMetadataSchema = z.object({
|
|
|
10563
10605
|
]).nullish()
|
|
10564
10606
|
});
|
|
10565
10607
|
var safetyRatingSchema = z.object({
|
|
10566
|
-
category: z.string(),
|
|
10567
|
-
probability: z.string(),
|
|
10608
|
+
category: z.string().nullish(),
|
|
10609
|
+
probability: z.string().nullish(),
|
|
10568
10610
|
probabilityScore: z.number().nullish(),
|
|
10569
10611
|
severity: z.string().nullish(),
|
|
10570
10612
|
severityScore: z.number().nullish(),
|
|
@@ -10603,7 +10645,8 @@ var chunkSchema = z.object({
|
|
|
10603
10645
|
var googleGenerativeAIProviderOptionsSchema = z.object({
|
|
10604
10646
|
responseModalities: z.array(z.enum(["TEXT", "IMAGE"])).nullish(),
|
|
10605
10647
|
thinkingConfig: z.object({
|
|
10606
|
-
thinkingBudget: z.number().nullish()
|
|
10648
|
+
thinkingBudget: z.number().nullish(),
|
|
10649
|
+
includeThoughts: z.boolean().nullish()
|
|
10607
10650
|
}).nullish()
|
|
10608
10651
|
});
|
|
10609
10652
|
var GoogleGenerativeAIEmbeddingModel = class {
|
|
@@ -13039,144 +13082,6 @@ var UnsupportedFunctionalityError = class extends AISDKError {
|
|
|
13039
13082
|
};
|
|
13040
13083
|
_a14 = symbol14;
|
|
13041
13084
|
|
|
13042
|
-
var secureJsonParse = {exports: {}};
|
|
13043
|
-
|
|
13044
|
-
var hasRequiredSecureJsonParse;
|
|
13045
|
-
|
|
13046
|
-
function requireSecureJsonParse () {
|
|
13047
|
-
if (hasRequiredSecureJsonParse) return secureJsonParse.exports;
|
|
13048
|
-
hasRequiredSecureJsonParse = 1;
|
|
13049
|
-
|
|
13050
|
-
const hasBuffer = typeof Buffer !== 'undefined';
|
|
13051
|
-
const suspectProtoRx = /"(?:_|\\u005[Ff])(?:_|\\u005[Ff])(?:p|\\u0070)(?:r|\\u0072)(?:o|\\u006[Ff])(?:t|\\u0074)(?:o|\\u006[Ff])(?:_|\\u005[Ff])(?:_|\\u005[Ff])"\s*:/;
|
|
13052
|
-
const suspectConstructorRx = /"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/;
|
|
13053
|
-
|
|
13054
|
-
function _parse (text, reviver, options) {
|
|
13055
|
-
// Normalize arguments
|
|
13056
|
-
if (options == null) {
|
|
13057
|
-
if (reviver !== null && typeof reviver === 'object') {
|
|
13058
|
-
options = reviver;
|
|
13059
|
-
reviver = undefined;
|
|
13060
|
-
}
|
|
13061
|
-
}
|
|
13062
|
-
|
|
13063
|
-
if (hasBuffer && Buffer.isBuffer(text)) {
|
|
13064
|
-
text = text.toString();
|
|
13065
|
-
}
|
|
13066
|
-
|
|
13067
|
-
// BOM checker
|
|
13068
|
-
if (text && text.charCodeAt(0) === 0xFEFF) {
|
|
13069
|
-
text = text.slice(1);
|
|
13070
|
-
}
|
|
13071
|
-
|
|
13072
|
-
// Parse normally, allowing exceptions
|
|
13073
|
-
const obj = JSON.parse(text, reviver);
|
|
13074
|
-
|
|
13075
|
-
// Ignore null and non-objects
|
|
13076
|
-
if (obj === null || typeof obj !== 'object') {
|
|
13077
|
-
return obj
|
|
13078
|
-
}
|
|
13079
|
-
|
|
13080
|
-
const protoAction = (options && options.protoAction) || 'error';
|
|
13081
|
-
const constructorAction = (options && options.constructorAction) || 'error';
|
|
13082
|
-
|
|
13083
|
-
// options: 'error' (default) / 'remove' / 'ignore'
|
|
13084
|
-
if (protoAction === 'ignore' && constructorAction === 'ignore') {
|
|
13085
|
-
return obj
|
|
13086
|
-
}
|
|
13087
|
-
|
|
13088
|
-
if (protoAction !== 'ignore' && constructorAction !== 'ignore') {
|
|
13089
|
-
if (suspectProtoRx.test(text) === false && suspectConstructorRx.test(text) === false) {
|
|
13090
|
-
return obj
|
|
13091
|
-
}
|
|
13092
|
-
} else if (protoAction !== 'ignore' && constructorAction === 'ignore') {
|
|
13093
|
-
if (suspectProtoRx.test(text) === false) {
|
|
13094
|
-
return obj
|
|
13095
|
-
}
|
|
13096
|
-
} else {
|
|
13097
|
-
if (suspectConstructorRx.test(text) === false) {
|
|
13098
|
-
return obj
|
|
13099
|
-
}
|
|
13100
|
-
}
|
|
13101
|
-
|
|
13102
|
-
// Scan result for proto keys
|
|
13103
|
-
return filter(obj, { protoAction, constructorAction, safe: options && options.safe })
|
|
13104
|
-
}
|
|
13105
|
-
|
|
13106
|
-
function filter (obj, { protoAction = 'error', constructorAction = 'error', safe } = {}) {
|
|
13107
|
-
let next = [obj];
|
|
13108
|
-
|
|
13109
|
-
while (next.length) {
|
|
13110
|
-
const nodes = next;
|
|
13111
|
-
next = [];
|
|
13112
|
-
|
|
13113
|
-
for (const node of nodes) {
|
|
13114
|
-
if (protoAction !== 'ignore' && Object.prototype.hasOwnProperty.call(node, '__proto__')) { // Avoid calling node.hasOwnProperty directly
|
|
13115
|
-
if (safe === true) {
|
|
13116
|
-
return null
|
|
13117
|
-
} else if (protoAction === 'error') {
|
|
13118
|
-
throw new SyntaxError('Object contains forbidden prototype property')
|
|
13119
|
-
}
|
|
13120
|
-
|
|
13121
|
-
delete node.__proto__; // eslint-disable-line no-proto
|
|
13122
|
-
}
|
|
13123
|
-
|
|
13124
|
-
if (constructorAction !== 'ignore' &&
|
|
13125
|
-
Object.prototype.hasOwnProperty.call(node, 'constructor') &&
|
|
13126
|
-
Object.prototype.hasOwnProperty.call(node.constructor, 'prototype')) { // Avoid calling node.hasOwnProperty directly
|
|
13127
|
-
if (safe === true) {
|
|
13128
|
-
return null
|
|
13129
|
-
} else if (constructorAction === 'error') {
|
|
13130
|
-
throw new SyntaxError('Object contains forbidden prototype property')
|
|
13131
|
-
}
|
|
13132
|
-
|
|
13133
|
-
delete node.constructor;
|
|
13134
|
-
}
|
|
13135
|
-
|
|
13136
|
-
for (const key in node) {
|
|
13137
|
-
const value = node[key];
|
|
13138
|
-
if (value && typeof value === 'object') {
|
|
13139
|
-
next.push(value);
|
|
13140
|
-
}
|
|
13141
|
-
}
|
|
13142
|
-
}
|
|
13143
|
-
}
|
|
13144
|
-
return obj
|
|
13145
|
-
}
|
|
13146
|
-
|
|
13147
|
-
function parse (text, reviver, options) {
|
|
13148
|
-
const stackTraceLimit = Error.stackTraceLimit;
|
|
13149
|
-
Error.stackTraceLimit = 0;
|
|
13150
|
-
try {
|
|
13151
|
-
return _parse(text, reviver, options)
|
|
13152
|
-
} finally {
|
|
13153
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
13154
|
-
}
|
|
13155
|
-
}
|
|
13156
|
-
|
|
13157
|
-
function safeParse (text, reviver) {
|
|
13158
|
-
const stackTraceLimit = Error.stackTraceLimit;
|
|
13159
|
-
Error.stackTraceLimit = 0;
|
|
13160
|
-
try {
|
|
13161
|
-
return _parse(text, reviver, { safe: true })
|
|
13162
|
-
} catch (_e) {
|
|
13163
|
-
return null
|
|
13164
|
-
} finally {
|
|
13165
|
-
Error.stackTraceLimit = stackTraceLimit;
|
|
13166
|
-
}
|
|
13167
|
-
}
|
|
13168
|
-
|
|
13169
|
-
secureJsonParse.exports = parse;
|
|
13170
|
-
secureJsonParse.exports.default = parse;
|
|
13171
|
-
secureJsonParse.exports.parse = parse;
|
|
13172
|
-
secureJsonParse.exports.safeParse = safeParse;
|
|
13173
|
-
secureJsonParse.exports.scan = filter;
|
|
13174
|
-
return secureJsonParse.exports;
|
|
13175
|
-
}
|
|
13176
|
-
|
|
13177
|
-
var secureJsonParseExports = requireSecureJsonParse();
|
|
13178
|
-
var SecureJSON = /*@__PURE__*/getDefaultExportFromCjs(secureJsonParseExports);
|
|
13179
|
-
|
|
13180
13085
|
class ParseError extends Error {
|
|
13181
13086
|
constructor(message, options) {
|
|
13182
13087
|
super(message), this.name = "ParseError", this.type = options.type, this.field = options.field, this.value = options.value, this.line = options.line;
|
|
@@ -13768,7 +13673,7 @@ function convertToOpenRouterChatMessages(prompt) {
|
|
|
13768
13673
|
const messageCacheControl = getCacheControl(providerMetadata);
|
|
13769
13674
|
const contentParts = content.map(
|
|
13770
13675
|
(part) => {
|
|
13771
|
-
var _a2, _b2, _c2, _d;
|
|
13676
|
+
var _a2, _b2, _c2, _d, _e, _f;
|
|
13772
13677
|
switch (part.type) {
|
|
13773
13678
|
case "text":
|
|
13774
13679
|
return {
|
|
@@ -13790,9 +13695,14 @@ function convertToOpenRouterChatMessages(prompt) {
|
|
|
13790
13695
|
};
|
|
13791
13696
|
case "file":
|
|
13792
13697
|
return {
|
|
13793
|
-
type: "
|
|
13794
|
-
|
|
13795
|
-
|
|
13698
|
+
type: "file",
|
|
13699
|
+
file: {
|
|
13700
|
+
filename: String(
|
|
13701
|
+
(_e = (_d = part.providerMetadata) == null ? void 0 : _d.openrouter) == null ? void 0 : _e.filename
|
|
13702
|
+
),
|
|
13703
|
+
file_data: part.data instanceof Uint8Array ? `data:${part.mimeType};base64,${convertUint8ArrayToBase64(part.data)}` : `data:${part.mimeType};base64,${part.data}`
|
|
13704
|
+
},
|
|
13705
|
+
cache_control: (_f = getCacheControl(part.providerMetadata)) != null ? _f : messageCacheControl
|
|
13796
13706
|
};
|
|
13797
13707
|
default: {
|
|
13798
13708
|
const _exhaustiveCheck = part;
|
|
@@ -14968,7 +14878,7 @@ class RetryLanguageModel {
|
|
|
14968
14878
|
accessKeyId: keys[0],
|
|
14969
14879
|
secretAccessKey: keys[1],
|
|
14970
14880
|
baseURL: llm.config?.baseURL,
|
|
14971
|
-
region: llm.config?.region || "us-
|
|
14881
|
+
region: llm.config?.region || "us-west-1",
|
|
14972
14882
|
}).languageModel(llm.model);
|
|
14973
14883
|
}
|
|
14974
14884
|
else if (llm.provider == "openrouter") {
|
|
@@ -19970,6 +19880,7 @@ This is a computer GUI interface, observe the execution through screenshots, and
|
|
|
19970
19880
|
}
|
|
19971
19881
|
}
|
|
19972
19882
|
|
|
19883
|
+
const AGENT_NAME = "Browser";
|
|
19973
19884
|
class BaseBrowserAgent extends Agent {
|
|
19974
19885
|
async go_back(agentContext) {
|
|
19975
19886
|
try {
|
|
@@ -21540,8 +21451,6 @@ class BaseBrowserScreenAgent extends BaseBrowserAgent {
|
|
|
21540
21451
|
}
|
|
21541
21452
|
}
|
|
21542
21453
|
|
|
21543
|
-
const AGENT_NAME = "Browser";
|
|
21544
|
-
|
|
21545
21454
|
exports.Agent = Agent;
|
|
21546
21455
|
exports.AgentChain = AgentChain;
|
|
21547
21456
|
exports.AgentContext = AgentContext;
|
|
@@ -21569,3 +21478,4 @@ exports.convertToolSchema = convertToolSchema;
|
|
|
21569
21478
|
exports.default = Eko;
|
|
21570
21479
|
exports.mergeTools = mergeTools;
|
|
21571
21480
|
exports.toImage = toImage;
|
|
21481
|
+
//# sourceMappingURL=index.cjs.js.map
|