@botpress/adk 1.12.3 → 1.13.0
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-project/agent-project.d.ts.map +1 -1
- package/dist/agent-project/types.d.ts +11 -11
- package/dist/bot-generator/generator.d.ts.map +1 -1
- package/dist/commands/bp-cli.d.ts.map +1 -1
- package/dist/index.js +90 -23
- package/dist/index.js.map +6 -6
- package/dist/integrations/sync-manager.d.ts.map +1 -1
- package/package.json +13 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-project.d.ts","sourceRoot":"","sources":["../../src/agent-project/agent-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,UAAU,EAAiB,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"agent-project.d.ts","sourceRoot":"","sources":["../../src/agent-project/agent-project.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4C,UAAU,EAAiB,MAAM,4BAA4B,CAAA;AAOhH,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAE5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAKxD,OAAO,EACL,WAAW,EACX,SAAS,EACT,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,YAAY,EAGZ,gBAAgB,EAEjB,MAAM,YAAY,CAAA;AAGnB,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAA;CACpD;AAGD,KAAK,sBAAsB,GAAG,UAAU,CAAC,WAAW,CAAC,sBAAsB,CAAA;AAC3E,KAAK,mBAAmB,GAAG,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAA;AACrE,KAAK,iBAAiB,GAAG,UAAU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AO,CAAC,OAAO,CAAC;IAI5C,IAAI,aAAa,IAAI,aAAa,CAEjC;IAGK,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAO/C,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAYjE,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;YAU5B,UAAU;YAmJV,aAAa;YAkBb,oBAAoB;YAapB,kBAAkB;YAalB,2BAA2B;IAkCzC;;;;OAIG;IACH,OAAO,CAAC,eAAe;YAUT,mBAAmB;CA0NlC"}
|
|
@@ -2,12 +2,12 @@ import { z } from '@botpress/sdk';
|
|
|
2
2
|
import { defineConfig } from '@botpress/runtime';
|
|
3
3
|
import { ValidationErrors } from './validation-errors';
|
|
4
4
|
export type AgentConfig = ReturnType<typeof defineConfig>;
|
|
5
|
-
export declare const dependenciesSchema: import("@
|
|
6
|
-
integrations: import("@
|
|
7
|
-
version: import("@
|
|
8
|
-
enabled: import("@
|
|
9
|
-
configurationType: import("@
|
|
10
|
-
config: import("@
|
|
5
|
+
export declare const dependenciesSchema: import("@bpinternal/zui").ZodObject<{
|
|
6
|
+
integrations: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodObject<{
|
|
7
|
+
version: import("@bpinternal/zui").ZodString;
|
|
8
|
+
enabled: import("@bpinternal/zui").ZodBoolean;
|
|
9
|
+
configurationType: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
10
|
+
config: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodRecord<import("@bpinternal/zui").ZodString, import("@bpinternal/zui").ZodAny>>;
|
|
11
11
|
}, "strip", {
|
|
12
12
|
version: string;
|
|
13
13
|
enabled: boolean;
|
|
@@ -35,11 +35,11 @@ export declare const dependenciesSchema: import("@botpress/sdk").ZodObject<{
|
|
|
35
35
|
}> | undefined;
|
|
36
36
|
}>;
|
|
37
37
|
export type Dependencies = z.infer<typeof dependenciesSchema>;
|
|
38
|
-
export declare const agentInfoSchema: import("@
|
|
39
|
-
botId: import("@
|
|
40
|
-
workspaceId: import("@
|
|
41
|
-
apiUrl: import("@
|
|
42
|
-
devId: import("@
|
|
38
|
+
export declare const agentInfoSchema: import("@bpinternal/zui").ZodObject<{
|
|
39
|
+
botId: import("@bpinternal/zui").ZodString;
|
|
40
|
+
workspaceId: import("@bpinternal/zui").ZodString;
|
|
41
|
+
apiUrl: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
42
|
+
devId: import("@bpinternal/zui").ZodOptional<import("@bpinternal/zui").ZodString>;
|
|
43
43
|
}, "strip", {
|
|
44
44
|
botId: string;
|
|
45
45
|
workspaceId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/bot-generator/generator.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAA;CACpD;AAkBD,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,UAAU,CAAQ;gBAEd,OAAO,EAAE,mBAAmB;YAK1B,kBAAkB;YAuBlB,sBAAsB;IAsB9B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BjB,yBAAyB;YAkEzB,kBAAkB;YAKlB,oBAAoB;YAKpB,gBAAgB;YAKhB,kBAAkB;YAKlB,0BAA0B;YAK1B,kBAAkB;YAKlB,qBAAqB;YAKrB,yBAAyB;YAKzB,mBAAmB;YAMnB,8BAA8B;YAM9B,oBAAoB;YAyEpB,uBAAuB;YA8FvB,8BAA8B;YAiC9B,4BAA4B;YA2B5B,qBAAqB;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/bot-generator/generator.ts"],"names":[],"mappings":"AA6BA,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAA;CACpD;AAkBD,qBAAa,YAAY;IACvB,OAAO,CAAC,WAAW,CAAQ;IAC3B,OAAO,CAAC,UAAU,CAAQ;gBAEd,OAAO,EAAE,mBAAmB;YAK1B,kBAAkB;YAuBlB,sBAAsB;IAsB9B,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;YA+BjB,yBAAyB;YAkEzB,kBAAkB;YAKlB,oBAAoB;YAKpB,gBAAgB;YAKhB,kBAAkB;YAKlB,0BAA0B;YAK1B,kBAAkB;YAKlB,qBAAqB;YAKrB,yBAAyB;YAKzB,mBAAmB;YAMnB,8BAA8B;YAM9B,oBAAoB;YAyEpB,uBAAuB;YA8FvB,8BAA8B;YAiC9B,4BAA4B;YA2B5B,qBAAqB;YA+XrB,gBAAgB;YAoChB,mBAAmB;YAgBnB,gBAAgB;YAiChB,mBAAmB;YAyBnB,UAAU;YAWV,aAAa;IAgBrB,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IA6ZnC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;CAOzC;AAED,wBAAsB,kBAAkB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8CpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bp-cli.d.ts","sourceRoot":"","sources":["../../src/commands/bp-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bp-cli.d.ts","sourceRoot":"","sources":["../../src/commands/bp-cli.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;CAChB;AAKD,eAAO,MAAM,cAAc,QAAqB,CAAA;AAChD,eAAO,MAAM,kBAAkB,QAA4C,CAAA;AAC3E,eAAO,MAAM,kBAAkB,QAAgD,CAAA;AAC/E,eAAO,MAAM,eAAe,QAA8E,CAAA;AAO1G;;GAEG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAqBpC"}
|
package/dist/index.js
CHANGED
|
@@ -654,7 +654,7 @@ var PRETTIER_CONFIG, formatCode = async (code, filepath) => {
|
|
|
654
654
|
`));
|
|
655
655
|
return code;
|
|
656
656
|
}
|
|
657
|
-
}, ADK_VERSION = "1.
|
|
657
|
+
}, ADK_VERSION = "1.13.0", relative2 = (from, to) => {
|
|
658
658
|
const fromDir = path10.dirname(from);
|
|
659
659
|
const relative3 = path10.relative(fromDir, to);
|
|
660
660
|
return relative3.startsWith(".") ? relative3 : `./${relative3}`;
|
|
@@ -797,7 +797,7 @@ var init_integration_action_types = __esm(() => {
|
|
|
797
797
|
var require_package = __commonJS((exports, module) => {
|
|
798
798
|
module.exports = {
|
|
799
799
|
name: "@botpress/adk",
|
|
800
|
-
version: "1.
|
|
800
|
+
version: "1.13.0",
|
|
801
801
|
description: "Core ADK library for building AI agents on Botpress",
|
|
802
802
|
type: "module",
|
|
803
803
|
main: "dist/index.js",
|
|
@@ -841,26 +841,28 @@ var require_package = __commonJS((exports, module) => {
|
|
|
841
841
|
url: "https://github.com/botpress/adk"
|
|
842
842
|
},
|
|
843
843
|
dependencies: {
|
|
844
|
-
"@botpress/cli": "^
|
|
844
|
+
"@botpress/cli": "^5.1.1",
|
|
845
845
|
"@botpress/client": "^1.28.0",
|
|
846
|
-
"@botpress/cognitive": "^0.
|
|
847
|
-
"@botpress/runtime": "^1.
|
|
848
|
-
"@botpress/sdk": "^
|
|
846
|
+
"@botpress/cognitive": "^0.3.3",
|
|
847
|
+
"@botpress/runtime": "^1.13.0",
|
|
848
|
+
"@botpress/sdk": "^5.0.2",
|
|
849
849
|
"@bpinternal/jex": "^1.2.4",
|
|
850
850
|
"@bpinternal/yargs-extra": "^0.0.21",
|
|
851
851
|
"@parcel/watcher": "^2.5.1",
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
execa: "9.6.0",
|
|
857
|
-
glob: "^11.0.3",
|
|
852
|
+
debug: "^4.4.3",
|
|
853
|
+
dedent: "^1.7.1",
|
|
854
|
+
execa: "9.6.1",
|
|
855
|
+
glob: "^11.1.0",
|
|
858
856
|
luxon: "^3.7.2",
|
|
859
857
|
prettier: "^3.6.2",
|
|
860
858
|
semver: "^7.7.2",
|
|
861
859
|
"ts-morph": "^27.0.2"
|
|
862
860
|
},
|
|
863
861
|
devDependencies: {
|
|
862
|
+
"@types/debug": "^4.1.12",
|
|
863
|
+
"@types/glob": "^9.0.0",
|
|
864
|
+
"@types/luxon": "^3.7.1",
|
|
865
|
+
"@types/semver": "^7.7.1",
|
|
864
866
|
dotenv: "^17.2.3"
|
|
865
867
|
},
|
|
866
868
|
peerDependencies: {
|
|
@@ -1081,18 +1083,31 @@ import { execa } from "execa";
|
|
|
1081
1083
|
import { existsSync } from "fs";
|
|
1082
1084
|
import os3 from "os";
|
|
1083
1085
|
import path4 from "path";
|
|
1084
|
-
|
|
1086
|
+
import createDebug from "debug";
|
|
1087
|
+
var debug = createDebug("adk:bp-cli");
|
|
1088
|
+
var BP_CLI_VERSION = "5.1.1";
|
|
1085
1089
|
var BP_CLI_INSTALL_ALL = path4.join(os3.homedir(), ".adk", `bp-cli`);
|
|
1086
1090
|
var BP_CLI_INSTALL_DIR = path4.join(BP_CLI_INSTALL_ALL, BP_CLI_VERSION);
|
|
1087
1091
|
var BP_CLI_BIN_PATH = path4.join(BP_CLI_INSTALL_DIR, "node_modules", "@botpress", "cli", "bin.js");
|
|
1092
|
+
debug("BP_CLI_VERSION=%s (injected at build time)", BP_CLI_VERSION);
|
|
1093
|
+
debug("BP_CLI_INSTALL_ALL=%s", BP_CLI_INSTALL_ALL);
|
|
1094
|
+
debug("BP_CLI_INSTALL_DIR=%s", BP_CLI_INSTALL_DIR);
|
|
1095
|
+
debug("BP_CLI_BIN_PATH=%s", BP_CLI_BIN_PATH);
|
|
1088
1096
|
function getBpCli() {
|
|
1089
|
-
|
|
1097
|
+
debug("getBpCli() called");
|
|
1098
|
+
debug("checking if BP_CLI_BIN_PATH exists: %s", BP_CLI_BIN_PATH);
|
|
1099
|
+
const exists = existsSync(BP_CLI_BIN_PATH);
|
|
1100
|
+
debug("BP_CLI_BIN_PATH exists=%s", exists);
|
|
1101
|
+
if (!exists) {
|
|
1102
|
+
debug("ERROR: bp CLI not found at expected path");
|
|
1090
1103
|
throw new Error(`@botpress/cli version ${BP_CLI_VERSION} is not installed in the ADK directory "${BP_CLI_INSTALL_DIR}". This is a bug, please report it to the Botpress team.`);
|
|
1091
1104
|
}
|
|
1092
|
-
|
|
1105
|
+
const info = {
|
|
1093
1106
|
path: BP_CLI_BIN_PATH,
|
|
1094
1107
|
version: BP_CLI_VERSION
|
|
1095
1108
|
};
|
|
1109
|
+
debug("returning BpCliInfo: %O", info);
|
|
1110
|
+
return info;
|
|
1096
1111
|
}
|
|
1097
1112
|
|
|
1098
1113
|
// src/commands/bp-add-command.ts
|
|
@@ -1918,6 +1933,8 @@ function stringifyWithOrder(obj, keyOrder, space = 2) {
|
|
|
1918
1933
|
}
|
|
1919
1934
|
// src/agent-project/agent-project.ts
|
|
1920
1935
|
import { BuiltInActions, BuiltInWorkflows, Errors as Errors2, Primitives as Primitives2, setAdkCommand } from "@botpress/runtime/internal";
|
|
1936
|
+
import createDebug2 from "debug";
|
|
1937
|
+
import { createRequire as createRequire2 } from "module";
|
|
1921
1938
|
import fs10 from "fs/promises";
|
|
1922
1939
|
import path13 from "path";
|
|
1923
1940
|
// src/assets/manager.ts
|
|
@@ -3539,6 +3556,13 @@ class IntegrationChecker {
|
|
|
3539
3556
|
}
|
|
3540
3557
|
// src/integrations/sync-manager.ts
|
|
3541
3558
|
import { Client as Client9 } from "@botpress/client";
|
|
3559
|
+
function normalizeConfigurationType(configType) {
|
|
3560
|
+
if (configType === "default" || configType === null) {
|
|
3561
|
+
return;
|
|
3562
|
+
}
|
|
3563
|
+
return configType;
|
|
3564
|
+
}
|
|
3565
|
+
|
|
3542
3566
|
class IntegrationSyncManager {
|
|
3543
3567
|
projectPath;
|
|
3544
3568
|
client;
|
|
@@ -3597,7 +3621,7 @@ class IntegrationSyncManager {
|
|
|
3597
3621
|
integrationId: result.desiredIntegrationId || result.definition.id,
|
|
3598
3622
|
enabled: result.desiredInstallStatus === "enabled",
|
|
3599
3623
|
configuration: result.desiredConfiguration || {},
|
|
3600
|
-
configurationType: result.desiredConfigurationType
|
|
3624
|
+
configurationType: normalizeConfigurationType(result.desiredConfigurationType)
|
|
3601
3625
|
}
|
|
3602
3626
|
}
|
|
3603
3627
|
});
|
|
@@ -3616,7 +3640,7 @@ class IntegrationSyncManager {
|
|
|
3616
3640
|
integrationId: result.desiredIntegrationId || result.definition.id,
|
|
3617
3641
|
enabled: result.desiredInstallStatus === "enabled",
|
|
3618
3642
|
configuration: result.desiredConfiguration || {},
|
|
3619
|
-
configurationType: result.desiredConfigurationType
|
|
3643
|
+
configurationType: normalizeConfigurationType(result.desiredConfigurationType)
|
|
3620
3644
|
}
|
|
3621
3645
|
}
|
|
3622
3646
|
});
|
|
@@ -4060,6 +4084,7 @@ async function expandExports(options) {
|
|
|
4060
4084
|
init_agent_resolver();
|
|
4061
4085
|
init_types();
|
|
4062
4086
|
init_validation_errors();
|
|
4087
|
+
var debug2 = createDebug2("adk:agent-project");
|
|
4063
4088
|
|
|
4064
4089
|
class AgentProject {
|
|
4065
4090
|
static _projectCache = new Map;
|
|
@@ -4338,7 +4363,29 @@ class AgentProject {
|
|
|
4338
4363
|
async loadConfig() {
|
|
4339
4364
|
try {
|
|
4340
4365
|
const configPath = path13.join(this._path, "agent.config.ts");
|
|
4341
|
-
|
|
4366
|
+
debug2("loading agent.config.ts from %s", configPath);
|
|
4367
|
+
const projectRequire = createRequire2(path13.join(this._path, "package.json"));
|
|
4368
|
+
debug2("created projectRequire from %s", path13.join(this._path, "package.json"));
|
|
4369
|
+
try {
|
|
4370
|
+
const resolvedPath = projectRequire.resolve(configPath);
|
|
4371
|
+
debug2("resolved config path: %s", resolvedPath);
|
|
4372
|
+
if (projectRequire.cache[resolvedPath]) {
|
|
4373
|
+
debug2("clearing require.cache for %s", resolvedPath);
|
|
4374
|
+
delete projectRequire.cache[resolvedPath];
|
|
4375
|
+
}
|
|
4376
|
+
} catch {
|
|
4377
|
+
debug2("config not in require.cache (first load)");
|
|
4378
|
+
}
|
|
4379
|
+
let configModule;
|
|
4380
|
+
try {
|
|
4381
|
+
const configUrl = `${configPath}?t=${Date.now()}`;
|
|
4382
|
+
debug2("importing from: %s", configUrl);
|
|
4383
|
+
configModule = await import(configUrl);
|
|
4384
|
+
debug2("successfully loaded agent.config.ts");
|
|
4385
|
+
} catch (importError) {
|
|
4386
|
+
debug2("failed to load agent.config.ts: %O", importError);
|
|
4387
|
+
throw importError;
|
|
4388
|
+
}
|
|
4342
4389
|
if (!configModule || !configModule.default) {
|
|
4343
4390
|
this._errors.push({
|
|
4344
4391
|
$type: "ValidationError",
|
|
@@ -4407,12 +4454,32 @@ class AgentProject {
|
|
|
4407
4454
|
this._interfaces = [];
|
|
4408
4455
|
}
|
|
4409
4456
|
} catch (error) {
|
|
4457
|
+
const err = error;
|
|
4458
|
+
debug2("loadConfig error: %O", err);
|
|
4459
|
+
let detailedMessage = `Failed to load agent.config.ts: ${err.message}`;
|
|
4460
|
+
if (err.stack) {
|
|
4461
|
+
debug2(`stack trace:
|
|
4462
|
+
%s`, err.stack);
|
|
4463
|
+
}
|
|
4464
|
+
let hint;
|
|
4465
|
+
if (err.message.includes("Cannot find module")) {
|
|
4466
|
+
const moduleMatch = err.message.match(/Cannot find module '([^']+)'/);
|
|
4467
|
+
const moduleName = moduleMatch?.[1] || "unknown";
|
|
4468
|
+
hint = `Module "${moduleName}" is not installed. Run "bun install" to install dependencies.`;
|
|
4469
|
+
detailedMessage += `
|
|
4470
|
+
|
|
4471
|
+
Stack trace:
|
|
4472
|
+
${err.stack?.split(`
|
|
4473
|
+
`).slice(0, 5).join(`
|
|
4474
|
+
`)}`;
|
|
4475
|
+
}
|
|
4410
4476
|
this._errors.push({
|
|
4411
4477
|
$type: "ValidationError",
|
|
4412
4478
|
code: "INVALID_CONFIG_SYNTAX" /* INVALID_CONFIG_SYNTAX */,
|
|
4413
4479
|
severity: "error" /* ERROR */,
|
|
4414
|
-
message:
|
|
4415
|
-
file: "agent.config.ts"
|
|
4480
|
+
message: detailedMessage,
|
|
4481
|
+
file: "agent.config.ts",
|
|
4482
|
+
hint
|
|
4416
4483
|
});
|
|
4417
4484
|
}
|
|
4418
4485
|
}
|
|
@@ -6163,7 +6230,7 @@ class AgentProjectGenerator {
|
|
|
6163
6230
|
deploy: "adk deploy"
|
|
6164
6231
|
},
|
|
6165
6232
|
dependencies: {
|
|
6166
|
-
"@botpress/runtime": `^${"1.
|
|
6233
|
+
"@botpress/runtime": `^${"1.13.0"}`
|
|
6167
6234
|
},
|
|
6168
6235
|
devDependencies: {
|
|
6169
6236
|
typescript: "^5.9.3"
|
|
@@ -8270,7 +8337,7 @@ declare module "@botpress/runtime/_types/state" {
|
|
|
8270
8337
|
const { alias, configurationType, config } = integration;
|
|
8271
8338
|
const importName = `integration_${getIntegrationAlias(alias)}`;
|
|
8272
8339
|
imports.push(`import ${importName} from "./bp_modules/${importName}";`);
|
|
8273
|
-
const configType = configurationType ? `, configurationType: "${configurationType}"` : "";
|
|
8340
|
+
const configType = configurationType && configurationType !== "default" ? `, configurationType: "${configurationType}"` : "";
|
|
8274
8341
|
const configData = config && Object.keys(config).length > 0 ? `, configuration: ${JSON.stringify(config)}` : "";
|
|
8275
8342
|
addIntegrations.push(`bot.addIntegration(${importName}, { alias: "${alias}", enabled: true${configType}${configData} });`);
|
|
8276
8343
|
}
|
|
@@ -11053,5 +11120,5 @@ export {
|
|
|
11053
11120
|
AgentProject
|
|
11054
11121
|
};
|
|
11055
11122
|
|
|
11056
|
-
//# debugId=
|
|
11123
|
+
//# debugId=8BA495E3EF86E38B64756E2164756E21
|
|
11057
11124
|
//# sourceMappingURL=index.js.map
|