@botpress/adk 1.19.0-beta.2 → 1.19.0-beta.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-init/agent-project-generator.d.ts +1 -1
- package/dist/agent-init/agent-project-generator.d.ts.map +1 -1
- package/dist/agent0/capabilities/commands/adk-build.md +39 -0
- package/dist/agent0/capabilities/commands/adk-debug.md +23 -0
- package/dist/agent0/capabilities/commands/adk-dev-console.md +17 -0
- package/dist/agent0/capabilities/commands/adk-document.md +68 -0
- package/dist/agent0/capabilities/commands/adk-eval.md +17 -0
- package/dist/agent0/capabilities/commands/adk-explain.md +22 -0
- package/dist/agent0/capabilities/commands/adk-init.md +30 -0
- package/dist/agent0/capabilities/commands/adk-ship.md +29 -0
- package/dist/agent0/capabilities/commands/adk-test.md +27 -0
- package/dist/agent0/capabilities/commands/adk-validate.md +31 -0
- package/dist/agent0/capabilities/skills/adk/SKILL.md +548 -0
- package/dist/agent0/capabilities/skills/adk/references/actions.md +823 -0
- package/dist/agent0/capabilities/skills/adk/references/advanced-patterns.md +669 -0
- package/dist/agent0/capabilities/skills/adk/references/agent-config.md +450 -0
- package/dist/agent0/capabilities/skills/adk/references/assets.md +237 -0
- package/dist/agent0/capabilities/skills/adk/references/autonomous-execution.md +747 -0
- package/dist/agent0/capabilities/skills/adk/references/cli.md +1334 -0
- package/dist/agent0/capabilities/skills/adk/references/context-api.md +461 -0
- package/dist/agent0/capabilities/skills/adk/references/conversation-lifecycle.md +311 -0
- package/dist/agent0/capabilities/skills/adk/references/conversations.md +1111 -0
- package/dist/agent0/capabilities/skills/adk/references/custom-components.md +167 -0
- package/dist/agent0/capabilities/skills/adk/references/desk.md +852 -0
- package/dist/agent0/capabilities/skills/adk/references/evals.md +11 -0
- package/dist/agent0/capabilities/skills/adk/references/explain-config.md +424 -0
- package/dist/agent0/capabilities/skills/adk/references/files.md +918 -0
- package/dist/agent0/capabilities/skills/adk/references/integration-actions.md +659 -0
- package/dist/agent0/capabilities/skills/adk/references/integrations.md +266 -0
- package/dist/agent0/capabilities/skills/adk/references/interfaces.md +97 -0
- package/dist/agent0/capabilities/skills/adk/references/knowledge-bases.md +456 -0
- package/dist/agent0/capabilities/skills/adk/references/mcp-server.md +112 -0
- package/dist/agent0/capabilities/skills/adk/references/messages.md +769 -0
- package/dist/agent0/capabilities/skills/adk/references/model-configuration.md +201 -0
- package/dist/agent0/capabilities/skills/adk/references/patterns-mistakes.md +469 -0
- package/dist/agent0/capabilities/skills/adk/references/plugins.md +280 -0
- package/dist/agent0/capabilities/skills/adk/references/tables.md +1136 -0
- package/dist/agent0/capabilities/skills/adk/references/tags.md +516 -0
- package/dist/agent0/capabilities/skills/adk/references/tools.md +581 -0
- package/dist/agent0/capabilities/skills/adk/references/triggers.md +719 -0
- package/dist/agent0/capabilities/skills/adk/references/workflow-steps.md +851 -0
- package/dist/agent0/capabilities/skills/adk/references/workflows.md +1408 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-agent-reference.md +454 -0
- package/dist/agent0/capabilities/skills/adk/references/zai-complete-guide.md +1408 -0
- package/dist/agent0/capabilities/skills/adk-debugger/SKILL.md +257 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/common-failures.md +231 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/conversation-analysis.md +420 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/debug-workflow.md +239 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/llm-debugging.md +209 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/trace-summarization.md +313 -0
- package/dist/agent0/capabilities/skills/adk-debugger/references/traces-and-logs.md +203 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/SKILL.md +111 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/agent-steps.md +115 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/component-registry.md +43 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/multi-agent-dashboard.md +70 -0
- package/dist/agent0/capabilities/skills/adk-dev-console/references/pages.md +273 -0
- package/dist/agent0/capabilities/skills/adk-docs/SKILL.md +114 -0
- package/dist/agent0/capabilities/skills/adk-docs/references/doc-standards.md +124 -0
- package/dist/agent0/capabilities/skills/adk-evals/SKILL.md +244 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/eval-format.md +354 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/test-patterns.md +355 -0
- package/dist/agent0/capabilities/skills/adk-evals/references/testing-workflow.md +225 -0
- package/dist/agent0/config/index.d.ts +5 -0
- package/dist/agent0/config/index.d.ts.map +1 -0
- package/dist/agent0/config/paths.d.ts +12 -0
- package/dist/agent0/config/paths.d.ts.map +1 -0
- package/dist/agent0/config/schema.d.ts +171 -0
- package/dist/agent0/config/schema.d.ts.map +1 -0
- package/dist/agent0/config/secrets.d.ts +4 -0
- package/dist/agent0/config/secrets.d.ts.map +1 -0
- package/dist/agent0/config/store.d.ts +21 -0
- package/dist/agent0/config/store.d.ts.map +1 -0
- package/dist/agent0/index.d.ts +6 -0
- package/dist/agent0/index.d.ts.map +1 -0
- package/dist/agent0/index.js +3226 -0
- package/dist/agent0/index.js.map +27 -0
- package/dist/agent0/providers/catalog.d.ts +189 -0
- package/dist/agent0/providers/catalog.d.ts.map +1 -0
- package/dist/agent0/providers/index.d.ts +4 -0
- package/dist/agent0/providers/index.d.ts.map +1 -0
- package/dist/agent0/providers/registry.d.ts +32 -0
- package/dist/agent0/providers/registry.d.ts.map +1 -0
- package/dist/agent0/providers/source.d.ts +100 -0
- package/dist/agent0/providers/source.d.ts.map +1 -0
- package/dist/agent0/runtime/client.d.ts +50 -0
- package/dist/agent0/runtime/client.d.ts.map +1 -0
- package/dist/agent0/runtime/engine.d.ts +74 -0
- package/dist/agent0/runtime/engine.d.ts.map +1 -0
- package/dist/agent0/runtime/index.d.ts +7 -0
- package/dist/agent0/runtime/index.d.ts.map +1 -0
- package/dist/agent0/runtime/manager.d.ts +82 -0
- package/dist/agent0/runtime/manager.d.ts.map +1 -0
- package/dist/agent0/runtime/permissions.d.ts +9 -0
- package/dist/agent0/runtime/permissions.d.ts.map +1 -0
- package/dist/agent0/runtime/process.d.ts +43 -0
- package/dist/agent0/runtime/process.d.ts.map +1 -0
- package/dist/agent0/runtime/project-discovery.d.ts +5 -0
- package/dist/agent0/runtime/project-discovery.d.ts.map +1 -0
- package/dist/agent0/types.d.ts +447 -0
- package/dist/agent0/types.d.ts.map +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/cognitive/models.d.ts +32 -0
- package/dist/cognitive/models.d.ts.map +1 -0
- package/dist/commands/bp-dev-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-stderr.d.ts +21 -0
- package/dist/commands/bp-dev-stderr.d.ts.map +1 -0
- package/dist/commands/index.d.ts +0 -5
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/dependencies/dependency-manager.d.ts +0 -1
- package/dist/dependencies/dependency-manager.d.ts.map +1 -1
- package/dist/dependencies/errors.d.ts +1 -1
- package/dist/dependencies/errors.d.ts.map +1 -1
- package/dist/dependencies/index.d.ts +0 -2
- package/dist/dependencies/index.d.ts.map +1 -1
- package/dist/dependencies/index.js +125 -149
- package/dist/dependencies/index.js.map +11 -13
- package/dist/dependencies/migration.d.ts +0 -2
- package/dist/dependencies/migration.d.ts.map +1 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/integration-resolver.d.ts.map +1 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts +0 -1
- package/dist/dependencies/resolvers/plugin-resolver.d.ts.map +1 -1
- package/dist/dependencies/types.d.ts +1 -2
- package/dist/dependencies/types.d.ts.map +1 -1
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/index.js +501 -998
- package/dist/index.js.map +16 -20
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/runner/supervise-child.d.ts +24 -0
- package/dist/runner/supervise-child.d.ts.map +1 -0
- package/dist/templates/blank/package.json +0 -1
- package/dist/templates/template.config.json +10 -9
- package/package.json +12 -8
- package/dist/commands/copilot-config-reader.d.ts +0 -3
- package/dist/commands/copilot-config-reader.d.ts.map +0 -1
- package/dist/commands/copilot-config.d.ts +0 -42
- package/dist/commands/copilot-config.d.ts.map +0 -1
- package/dist/commands/copilot-server.d.ts +0 -29
- package/dist/commands/copilot-server.d.ts.map +0 -1
- package/dist/commands/opencode-config.d.ts +0 -30
- package/dist/commands/opencode-config.d.ts.map +0 -1
- package/dist/dependencies/env-substitution.d.ts +0 -3
- package/dist/dependencies/env-substitution.d.ts.map +0 -1
- package/dist/dependencies/secrets-rewriter.d.ts +0 -25
- package/dist/dependencies/secrets-rewriter.d.ts.map +0 -1
- package/dist/templates/blank/dependencies.dev.lock.json +0 -6
- package/dist/templates/botpress-desk/dependencies.dev.lock.json +0 -6
- package/dist/templates/crm-enrichment/dependencies.dev.lock.json +0 -6
- package/dist/templates/hello-world/dependencies.dev.lock.json +0 -6
- package/dist/templates/knowledge-assistant/dependencies.dev.lock.json +0 -6
- package/dist/templates/slack-triage/dependencies.dev.lock.json +0 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependency-manager.d.ts","sourceRoot":"","sources":["../../src/dependencies/dependency-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"dependency-manager.d.ts","sourceRoot":"","sources":["../../src/dependencies/dependency-manager.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAK9C,OAAO,KAAK,EACV,WAAW,EACX,YAAY,EACZ,OAAO,EACP,cAAc,EAId,WAAW,EACX,UAAU,EACV,UAAU,EACV,WAAW,EAEZ,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAA;AACzE,OAAO,EAAE,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AAK,CAAC,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;IAyKvE,IAAI,CAAC,IAAI,EAAE;QAAE,IAAI,EAAE,WAAW,CAAC;QAAC,EAAE,EAAE,WAAW,CAAC;QAAC,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;YAoDjG,oBAAoB;IASlC,OAAO,CAAC,gBAAgB;IA0CxB,OAAO,CAAC,gBAAgB;CAmBzB"}
|
|
@@ -11,6 +11,6 @@ export declare class DependencyError extends Error {
|
|
|
11
11
|
suggestion?: string;
|
|
12
12
|
});
|
|
13
13
|
}
|
|
14
|
-
export declare const DEPENDENCY_WARNING_CODES: readonly ["DEPRECATED_COMMAND", "MIGRATED_DEPENDENCIES", "
|
|
14
|
+
export declare const DEPENDENCY_WARNING_CODES: readonly ["DEPRECATED_COMMAND", "MIGRATED_DEPENDENCIES", "CLOUD_FETCH_PARTIAL", "NO_PROD_BOT"];
|
|
15
15
|
export type DependencyWarningCode = (typeof DEPENDENCY_WARNING_CODES)[number];
|
|
16
16
|
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/dependencies/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,qaAmBzB,CAAA;AAEV,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;gBAEhB,IAAI,EAAE;QAChB,IAAI,EAAE,mBAAmB,CAAA;QACzB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACjC,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB;CAOF;AAED,eAAO,MAAM,wBAAwB,
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/dependencies/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,qaAmBzB,CAAA;AAEV,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzE,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAA;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC1C,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAA;gBAEhB,IAAI,EAAE;QAChB,IAAI,EAAE,mBAAmB,CAAA;QACzB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;QACjC,UAAU,CAAC,EAAE,MAAM,CAAA;KACpB;CAOF;AAED,eAAO,MAAM,wBAAwB,gGAK3B,CAAA;AACV,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAA"}
|
|
@@ -6,8 +6,6 @@ export { type Environment, type ResourceType, type IntegrationLockEntry, type Pl
|
|
|
6
6
|
export { DependencyError, DEPENDENCY_ERROR_CODES, DEPENDENCY_WARNING_CODES } from './errors.js';
|
|
7
7
|
export type { DependencyErrorCode, DependencyWarningCode } from './errors.js';
|
|
8
8
|
export { sortKeysDeep, jsonEqual } from './json-utils.js';
|
|
9
|
-
export { substituteEnvRefs, collectEnvRefs } from './env-substitution.js';
|
|
10
|
-
export { rewriteSecrets } from './secrets-rewriter.js';
|
|
11
9
|
export { IntegrationRegistry } from './registry/integration-registry.js';
|
|
12
10
|
export { PluginRegistry } from './registry/plugin-registry.js';
|
|
13
11
|
export { InterfaceRegistry } from './registry/interface-registry.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dependencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAEtF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AACzC,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,YAAY,CAAA;AAEnB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAC/F,YAAY,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/dependencies/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAA;AAC3D,YAAY,EAAE,wBAAwB,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA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PARTIAL",
|
|
118
117
|
"NO_PROD_BOT"
|
|
119
118
|
];
|
|
@@ -1087,9 +1086,11 @@ class Auth {
|
|
|
1087
1086
|
this.credentialsManager = new CredentialsManager;
|
|
1088
1087
|
}
|
|
1089
1088
|
async login(token, options = {}) {
|
|
1090
|
-
const
|
|
1089
|
+
const apiUrl = options.apiUrl ?? "https://api.botpress.cloud";
|
|
1091
1090
|
const authService = new AuthService(apiUrl);
|
|
1092
1091
|
const authResult = await authService.validateToken(token);
|
|
1092
|
+
const autoResolved = options.profile == null;
|
|
1093
|
+
const profile = options.profile ?? await this.resolveProfileName(authResult);
|
|
1093
1094
|
try {
|
|
1094
1095
|
const client = new Client2({ apiUrl, token });
|
|
1095
1096
|
await client.setAccountPreference({ key: "adkCliConnected", value: true });
|
|
@@ -1106,8 +1107,41 @@ class Auth {
|
|
|
1106
1107
|
accountId: authResult.accountId,
|
|
1107
1108
|
createdAt: authResult.createdAt
|
|
1108
1109
|
});
|
|
1110
|
+
if (autoResolved) {
|
|
1111
|
+
await this.credentialsManager.setCurrentProfile(profile);
|
|
1112
|
+
}
|
|
1109
1113
|
clearProjectClientCache();
|
|
1110
1114
|
}
|
|
1115
|
+
async resolveProfileName(authResult) {
|
|
1116
|
+
const profiles = await this.credentialsManager.listProfiles();
|
|
1117
|
+
if (profiles.length === 0) {
|
|
1118
|
+
return "default";
|
|
1119
|
+
}
|
|
1120
|
+
if (authResult.accountId) {
|
|
1121
|
+
const existing = profiles.find((p) => p.accountId === authResult.accountId);
|
|
1122
|
+
if (existing) {
|
|
1123
|
+
return existing.name;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
if (authResult.email) {
|
|
1127
|
+
const baseName = authResult.email.split("@")[0] || "profile";
|
|
1128
|
+
const existingNames2 = new Set(profiles.map((p) => p.name));
|
|
1129
|
+
if (!existingNames2.has(baseName)) {
|
|
1130
|
+
return baseName;
|
|
1131
|
+
}
|
|
1132
|
+
let i2 = 2;
|
|
1133
|
+
while (existingNames2.has(`${baseName}-${i2}`)) {
|
|
1134
|
+
i2++;
|
|
1135
|
+
}
|
|
1136
|
+
return `${baseName}-${i2}`;
|
|
1137
|
+
}
|
|
1138
|
+
const existingNames = new Set(profiles.map((p) => p.name));
|
|
1139
|
+
let i = profiles.length + 1;
|
|
1140
|
+
while (existingNames.has(`profile-${i}`)) {
|
|
1141
|
+
i++;
|
|
1142
|
+
}
|
|
1143
|
+
return `profile-${i}`;
|
|
1144
|
+
}
|
|
1111
1145
|
async logout(profile) {
|
|
1112
1146
|
if (profile) {
|
|
1113
1147
|
await this.credentialsManager.deleteProfile(profile);
|
|
@@ -4337,7 +4371,7 @@ var _format = null, _formatLoaded = false, formatCode = async (code, filepath) =
|
|
|
4337
4371
|
`));
|
|
4338
4372
|
return code;
|
|
4339
4373
|
}
|
|
4340
|
-
}, ADK_VERSION = "1.19.0-beta.
|
|
4374
|
+
}, ADK_VERSION = "1.19.0-beta.4", relative = (from, to) => {
|
|
4341
4375
|
const fromDir = path14.dirname(from);
|
|
4342
4376
|
const relative2 = path14.relative(fromDir, to);
|
|
4343
4377
|
return relative2.startsWith(".") ? relative2 : `./${relative2}`;
|
|
@@ -4347,12 +4381,9 @@ var init_utils = () => {};
|
|
|
4347
4381
|
// src/dependencies/index.ts
|
|
4348
4382
|
var exports_dependencies = {};
|
|
4349
4383
|
__export(exports_dependencies, {
|
|
4350
|
-
substituteEnvRefs: () => substituteEnvRefs,
|
|
4351
4384
|
sortKeysDeep: () => sortKeysDeep,
|
|
4352
|
-
rewriteSecrets: () => rewriteSecrets,
|
|
4353
4385
|
migrateFromConfig: () => migrateFromConfig,
|
|
4354
4386
|
jsonEqual: () => jsonEqual,
|
|
4355
|
-
collectEnvRefs: () => collectEnvRefs,
|
|
4356
4387
|
PluginResolver: () => PluginResolver,
|
|
4357
4388
|
PluginRegistry: () => PluginRegistry,
|
|
4358
4389
|
LockFile: () => LockFile,
|
|
@@ -4367,6 +4398,7 @@ __export(exports_dependencies, {
|
|
|
4367
4398
|
|
|
4368
4399
|
// src/dependencies/dependency-manager.ts
|
|
4369
4400
|
init_lock_file();
|
|
4401
|
+
import * as semver2 from "semver";
|
|
4370
4402
|
|
|
4371
4403
|
// src/dependencies/alias-utils.ts
|
|
4372
4404
|
var FRIENDLY_ALIAS_RE = /^[a-z0-9_-]{2,100}$/;
|
|
@@ -4397,54 +4429,6 @@ init_errors();
|
|
|
4397
4429
|
// src/dependencies/resolvers/integration-resolver.ts
|
|
4398
4430
|
init_errors();
|
|
4399
4431
|
|
|
4400
|
-
// src/dependencies/env-substitution.ts
|
|
4401
|
-
init_errors();
|
|
4402
|
-
var ENV_REF_RE = /\$\{env:([A-Z0-9_]+)\}/g;
|
|
4403
|
-
function substituteEnvRefs(value, env) {
|
|
4404
|
-
if (typeof value === "string") {
|
|
4405
|
-
return value.replace(ENV_REF_RE, (_match, key) => {
|
|
4406
|
-
const v = env[key];
|
|
4407
|
-
if (v === undefined) {
|
|
4408
|
-
throw new DependencyError({
|
|
4409
|
-
code: "INVALID_CONFIG",
|
|
4410
|
-
message: `Env var ${key} referenced in config but not set`,
|
|
4411
|
-
details: { key },
|
|
4412
|
-
suggestion: `Set ${key} in your .env or environment`
|
|
4413
|
-
});
|
|
4414
|
-
}
|
|
4415
|
-
return v;
|
|
4416
|
-
});
|
|
4417
|
-
}
|
|
4418
|
-
if (Array.isArray(value))
|
|
4419
|
-
return value.map((v) => substituteEnvRefs(v, env));
|
|
4420
|
-
if (value && typeof value === "object") {
|
|
4421
|
-
const obj = value;
|
|
4422
|
-
const out = {};
|
|
4423
|
-
for (const [k, v] of Object.entries(obj))
|
|
4424
|
-
out[k] = substituteEnvRefs(v, env);
|
|
4425
|
-
return out;
|
|
4426
|
-
}
|
|
4427
|
-
return value;
|
|
4428
|
-
}
|
|
4429
|
-
function collectEnvRefs(value, into = new Set) {
|
|
4430
|
-
if (typeof value === "string") {
|
|
4431
|
-
for (const m of value.matchAll(ENV_REF_RE))
|
|
4432
|
-
into.add(m[1]);
|
|
4433
|
-
return into;
|
|
4434
|
-
}
|
|
4435
|
-
if (Array.isArray(value)) {
|
|
4436
|
-
for (const v of value)
|
|
4437
|
-
collectEnvRefs(v, into);
|
|
4438
|
-
return into;
|
|
4439
|
-
}
|
|
4440
|
-
if (value && typeof value === "object") {
|
|
4441
|
-
for (const v of Object.values(value))
|
|
4442
|
-
collectEnvRefs(v, into);
|
|
4443
|
-
}
|
|
4444
|
-
return into;
|
|
4445
|
-
}
|
|
4446
|
-
|
|
4447
|
-
// src/dependencies/resolvers/integration-resolver.ts
|
|
4448
4432
|
class IntegrationResolver {
|
|
4449
4433
|
registry;
|
|
4450
4434
|
client;
|
|
@@ -4469,14 +4453,13 @@ class IntegrationResolver {
|
|
|
4469
4453
|
message: `Could not resolve integrationId for ${opts.entry.name}@${opts.entry.version}`
|
|
4470
4454
|
});
|
|
4471
4455
|
}
|
|
4472
|
-
const resolvedConfig = opts.env ? substituteEnvRefs(opts.entry.config, opts.env) : opts.entry.config;
|
|
4473
4456
|
await this.client.updateBot({
|
|
4474
4457
|
id: opts.botId,
|
|
4475
4458
|
integrations: {
|
|
4476
4459
|
[opts.alias]: {
|
|
4477
4460
|
integrationId,
|
|
4478
4461
|
enabled: opts.entry.enabled,
|
|
4479
|
-
configuration:
|
|
4462
|
+
configuration: opts.entry.config
|
|
4480
4463
|
}
|
|
4481
4464
|
}
|
|
4482
4465
|
});
|
|
@@ -4491,6 +4474,7 @@ class IntegrationResolver {
|
|
|
4491
4474
|
|
|
4492
4475
|
// src/dependencies/resolvers/plugin-resolver.ts
|
|
4493
4476
|
init_errors();
|
|
4477
|
+
|
|
4494
4478
|
class PluginResolver {
|
|
4495
4479
|
registry;
|
|
4496
4480
|
integrationRegistry;
|
|
@@ -4559,14 +4543,13 @@ class PluginResolver {
|
|
|
4559
4543
|
message: `Could not resolve plugin id for ${opts.entry.name}@${opts.entry.version}`
|
|
4560
4544
|
});
|
|
4561
4545
|
}
|
|
4562
|
-
const resolvedConfig = opts.env ? substituteEnvRefs(opts.entry.config, opts.env) : opts.entry.config;
|
|
4563
4546
|
await this.client.updateBot({
|
|
4564
4547
|
id: opts.botId,
|
|
4565
4548
|
plugins: {
|
|
4566
4549
|
[opts.alias]: {
|
|
4567
4550
|
id: pluginId,
|
|
4568
4551
|
enabled: opts.entry.enabled,
|
|
4569
|
-
configuration:
|
|
4552
|
+
configuration: opts.entry.config,
|
|
4570
4553
|
interfaces: resolvedInterfaces
|
|
4571
4554
|
}
|
|
4572
4555
|
}
|
|
@@ -4873,7 +4856,6 @@ class DependencyManager {
|
|
|
4873
4856
|
pluginRegistry;
|
|
4874
4857
|
integrationResolver;
|
|
4875
4858
|
pluginResolver;
|
|
4876
|
-
envSource;
|
|
4877
4859
|
constructor(opts) {
|
|
4878
4860
|
this.projectPath = opts.projectPath;
|
|
4879
4861
|
this.env = opts.env;
|
|
@@ -4888,7 +4870,6 @@ class DependencyManager {
|
|
|
4888
4870
|
integrationRegistry: this.integrationRegistry,
|
|
4889
4871
|
client: this.client
|
|
4890
4872
|
});
|
|
4891
|
-
this.envSource = Object.fromEntries(Object.entries(process.env).filter(([, v]) => typeof v === "string"));
|
|
4892
4873
|
}
|
|
4893
4874
|
static async fromProject(opts) {
|
|
4894
4875
|
const project = await AgentProject.load(opts.projectPath);
|
|
@@ -4971,7 +4952,7 @@ class DependencyManager {
|
|
|
4971
4952
|
};
|
|
4972
4953
|
let installedDisabled;
|
|
4973
4954
|
try {
|
|
4974
|
-
await this.integrationResolver.applyToCloud({ botId: this.botId, alias, entry: desired
|
|
4955
|
+
await this.integrationResolver.applyToCloud({ botId: this.botId, alias, entry: desired });
|
|
4975
4956
|
} catch (err) {
|
|
4976
4957
|
const missingFields = extractMissingRequiredFields(err);
|
|
4977
4958
|
if (!missingFields)
|
|
@@ -4979,8 +4960,7 @@ class DependencyManager {
|
|
|
4979
4960
|
await this.integrationResolver.applyToCloud({
|
|
4980
4961
|
botId: this.botId,
|
|
4981
4962
|
alias,
|
|
4982
|
-
entry: { ...desired, enabled: false }
|
|
4983
|
-
env: this.envSource
|
|
4963
|
+
entry: { ...desired, enabled: false }
|
|
4984
4964
|
});
|
|
4985
4965
|
installedDisabled = { missingFields };
|
|
4986
4966
|
}
|
|
@@ -5001,7 +4981,7 @@ class DependencyManager {
|
|
|
5001
4981
|
config: spec.config ?? {},
|
|
5002
4982
|
dependencies: resolvedDeps
|
|
5003
4983
|
};
|
|
5004
|
-
await this.pluginResolver.applyToCloud({ botId: this.botId, alias, entry: desired, lock
|
|
4984
|
+
await this.pluginResolver.applyToCloud({ botId: this.botId, alias, entry: desired, lock });
|
|
5005
4985
|
const refreshed = await this.refreshLockFromCloud();
|
|
5006
4986
|
const resolvedVersion = refreshed.plugins[alias]?.version ?? version;
|
|
5007
4987
|
return { ok: true, resource: { type, alias, name: spec.name, version: resolvedVersion }, autoResolved };
|
|
@@ -5115,16 +5095,14 @@ class DependencyManager {
|
|
|
5115
5095
|
await this.integrationResolver.applyToCloud({
|
|
5116
5096
|
botId: this.botId,
|
|
5117
5097
|
alias,
|
|
5118
|
-
entry
|
|
5119
|
-
env: this.envSource
|
|
5098
|
+
entry
|
|
5120
5099
|
});
|
|
5121
5100
|
} else {
|
|
5122
5101
|
await this.pluginResolver.applyToCloud({
|
|
5123
5102
|
botId: this.botId,
|
|
5124
5103
|
alias,
|
|
5125
5104
|
entry,
|
|
5126
|
-
lock
|
|
5127
|
-
env: this.envSource
|
|
5105
|
+
lock
|
|
5128
5106
|
});
|
|
5129
5107
|
}
|
|
5130
5108
|
}
|
|
@@ -5278,36 +5256,100 @@ class DependencyManager {
|
|
|
5278
5256
|
for (const [alias, entry] of Object.entries(lock.integrations)) {
|
|
5279
5257
|
const c = cloud.integrations[alias];
|
|
5280
5258
|
if (!c) {
|
|
5281
|
-
actions.push({
|
|
5259
|
+
actions.push({
|
|
5260
|
+
type: "integration",
|
|
5261
|
+
alias,
|
|
5262
|
+
action: "install",
|
|
5263
|
+
details: { name: entry.name, version: entry.version }
|
|
5264
|
+
});
|
|
5282
5265
|
} else if (c.version !== entry.version) {
|
|
5283
|
-
|
|
5266
|
+
const isDowngrade = semver2.valid(c.version) && semver2.valid(entry.version) && semver2.gt(c.version, entry.version);
|
|
5267
|
+
actions.push({
|
|
5268
|
+
type: "integration",
|
|
5269
|
+
alias,
|
|
5270
|
+
action: isDowngrade ? "downgrade" : "upgrade",
|
|
5271
|
+
details: { name: entry.name, fromVersion: c.version, toVersion: entry.version }
|
|
5272
|
+
});
|
|
5284
5273
|
} else {
|
|
5285
5274
|
if (c.enabled !== entry.enabled)
|
|
5286
|
-
actions.push({
|
|
5275
|
+
actions.push({
|
|
5276
|
+
type: "integration",
|
|
5277
|
+
alias,
|
|
5278
|
+
action: entry.enabled ? "enable" : "disable",
|
|
5279
|
+
details: { name: entry.name, version: entry.version, previous: c.enabled }
|
|
5280
|
+
});
|
|
5287
5281
|
if (!jsonEqual(c.config, entry.config))
|
|
5288
|
-
actions.push({
|
|
5282
|
+
actions.push({
|
|
5283
|
+
type: "integration",
|
|
5284
|
+
alias,
|
|
5285
|
+
action: "reconfigure",
|
|
5286
|
+
details: { name: entry.name, version: entry.version, changedFields: ["config"] }
|
|
5287
|
+
});
|
|
5289
5288
|
}
|
|
5290
5289
|
}
|
|
5291
5290
|
for (const alias of Object.keys(cloud.integrations)) {
|
|
5292
|
-
if (!lock.integrations[alias])
|
|
5293
|
-
|
|
5291
|
+
if (!lock.integrations[alias]) {
|
|
5292
|
+
const c = cloud.integrations[alias];
|
|
5293
|
+
actions.push({
|
|
5294
|
+
type: "integration",
|
|
5295
|
+
alias,
|
|
5296
|
+
action: "uninstall",
|
|
5297
|
+
details: { name: c.name, version: c.version }
|
|
5298
|
+
});
|
|
5299
|
+
}
|
|
5294
5300
|
}
|
|
5295
5301
|
for (const [alias, entry] of Object.entries(lock.plugins)) {
|
|
5296
5302
|
const c = cloud.plugins[alias];
|
|
5297
5303
|
if (!c) {
|
|
5298
|
-
actions.push({
|
|
5304
|
+
actions.push({
|
|
5305
|
+
type: "plugin",
|
|
5306
|
+
alias,
|
|
5307
|
+
action: "install",
|
|
5308
|
+
details: { name: entry.name, version: entry.version }
|
|
5309
|
+
});
|
|
5299
5310
|
} else if (c.version !== entry.version) {
|
|
5300
|
-
|
|
5311
|
+
const isDowngrade = semver2.valid(c.version) && semver2.valid(entry.version) && semver2.gt(c.version, entry.version);
|
|
5312
|
+
actions.push({
|
|
5313
|
+
type: "plugin",
|
|
5314
|
+
alias,
|
|
5315
|
+
action: isDowngrade ? "downgrade" : "upgrade",
|
|
5316
|
+
details: { name: entry.name, fromVersion: c.version, toVersion: entry.version }
|
|
5317
|
+
});
|
|
5301
5318
|
} else {
|
|
5302
5319
|
if (c.enabled !== entry.enabled)
|
|
5303
|
-
actions.push({
|
|
5304
|
-
|
|
5305
|
-
|
|
5320
|
+
actions.push({
|
|
5321
|
+
type: "plugin",
|
|
5322
|
+
alias,
|
|
5323
|
+
action: entry.enabled ? "enable" : "disable",
|
|
5324
|
+
details: { name: entry.name, version: entry.version, previous: c.enabled }
|
|
5325
|
+
});
|
|
5326
|
+
const configChanged = !jsonEqual(c.config, entry.config);
|
|
5327
|
+
const depsChanged = !jsonEqual(c.dependencies, entry.dependencies);
|
|
5328
|
+
if (configChanged || depsChanged) {
|
|
5329
|
+
const changedFields = [];
|
|
5330
|
+
if (configChanged)
|
|
5331
|
+
changedFields.push("config");
|
|
5332
|
+
if (depsChanged)
|
|
5333
|
+
changedFields.push("dependencies");
|
|
5334
|
+
actions.push({
|
|
5335
|
+
type: "plugin",
|
|
5336
|
+
alias,
|
|
5337
|
+
action: "reconfigure",
|
|
5338
|
+
details: { name: entry.name, version: entry.version, changedFields }
|
|
5339
|
+
});
|
|
5340
|
+
}
|
|
5306
5341
|
}
|
|
5307
5342
|
}
|
|
5308
5343
|
for (const alias of Object.keys(cloud.plugins)) {
|
|
5309
|
-
if (!lock.plugins[alias])
|
|
5310
|
-
|
|
5344
|
+
if (!lock.plugins[alias]) {
|
|
5345
|
+
const c = cloud.plugins[alias];
|
|
5346
|
+
actions.push({
|
|
5347
|
+
type: "plugin",
|
|
5348
|
+
alias,
|
|
5349
|
+
action: "uninstall",
|
|
5350
|
+
details: { name: c.name, version: c.version }
|
|
5351
|
+
});
|
|
5352
|
+
}
|
|
5311
5353
|
}
|
|
5312
5354
|
if (opts?.dryRun) {
|
|
5313
5355
|
return { target: this.env, applied: [], skipped: actions, errors: [], dryRun: true };
|
|
@@ -5425,7 +5467,6 @@ class DependencyManager {
|
|
|
5425
5467
|
});
|
|
5426
5468
|
usedIntegrationAliases.add(alias);
|
|
5427
5469
|
const entry = this.integrationResolver.toLockEntry(c);
|
|
5428
|
-
entry.config = preserveEnvRefs(previous.integrations[alias]?.config, entry.config);
|
|
5429
5470
|
integrations[alias] = entry;
|
|
5430
5471
|
}
|
|
5431
5472
|
const plugins = {};
|
|
@@ -5440,7 +5481,6 @@ class DependencyManager {
|
|
|
5440
5481
|
});
|
|
5441
5482
|
usedPluginAliases.add(alias);
|
|
5442
5483
|
const entry = this.pluginResolver.toLockEntry(c);
|
|
5443
|
-
entry.config = preserveEnvRefs(previous.plugins[alias]?.config, entry.config);
|
|
5444
5484
|
plugins[alias] = entry;
|
|
5445
5485
|
}
|
|
5446
5486
|
return { integrations, plugins };
|
|
@@ -5485,65 +5525,11 @@ function extractMissingRequiredFields(err) {
|
|
|
5485
5525
|
}
|
|
5486
5526
|
return fields.size > 0 ? [...fields] : null;
|
|
5487
5527
|
}
|
|
5488
|
-
function preserveEnvRefs(previous, next) {
|
|
5489
|
-
if (typeof previous === "string" && /\$\{env:[A-Z0-9_]+\}/.test(previous)) {
|
|
5490
|
-
return previous;
|
|
5491
|
-
}
|
|
5492
|
-
if (Array.isArray(next)) {
|
|
5493
|
-
const prevArray = Array.isArray(previous) ? previous : [];
|
|
5494
|
-
return next.map((value, index) => preserveEnvRefs(prevArray[index], value));
|
|
5495
|
-
}
|
|
5496
|
-
if (next && typeof next === "object") {
|
|
5497
|
-
const prevObject = previous && typeof previous === "object" ? previous : {};
|
|
5498
|
-
const out = {};
|
|
5499
|
-
for (const [key, value] of Object.entries(next)) {
|
|
5500
|
-
out[key] = preserveEnvRefs(prevObject[key], value);
|
|
5501
|
-
}
|
|
5502
|
-
return out;
|
|
5503
|
-
}
|
|
5504
|
-
return next;
|
|
5505
|
-
}
|
|
5506
5528
|
|
|
5507
5529
|
// src/dependencies/index.ts
|
|
5508
5530
|
init_lock_file();
|
|
5509
5531
|
init_errors();
|
|
5510
5532
|
|
|
5511
|
-
// src/dependencies/secrets-rewriter.ts
|
|
5512
|
-
var HEURISTIC_SECRET_PATTERN = /secret|token|key|password|credential/i;
|
|
5513
|
-
var EXISTING_REF_PATTERN = /^\$\{env:[A-Z0-9_]+\}$/;
|
|
5514
|
-
function rewriteSecrets(input) {
|
|
5515
|
-
const result = { ...input.config };
|
|
5516
|
-
const envVars = [];
|
|
5517
|
-
const warnings = [];
|
|
5518
|
-
for (const [field, value] of Object.entries(result)) {
|
|
5519
|
-
if (typeof value !== "string")
|
|
5520
|
-
continue;
|
|
5521
|
-
if (EXISTING_REF_PATTERN.test(value)) {
|
|
5522
|
-
const match = value.match(/^\$\{env:([A-Z0-9_]+)\}$/);
|
|
5523
|
-
if (match)
|
|
5524
|
-
envVars.push(match[1]);
|
|
5525
|
-
continue;
|
|
5526
|
-
}
|
|
5527
|
-
const markedSecret = input.schema?.properties?.[field]?.["x-zui"]?.secret === true;
|
|
5528
|
-
const heuristic = !markedSecret && HEURISTIC_SECRET_PATTERN.test(field);
|
|
5529
|
-
if (markedSecret || heuristic) {
|
|
5530
|
-
const envName = toEnvVar(input.alias, field);
|
|
5531
|
-
result[field] = `\${env:${envName}}`;
|
|
5532
|
-
envVars.push(envName);
|
|
5533
|
-
if (heuristic) {
|
|
5534
|
-
warnings.push({
|
|
5535
|
-
code: "HEURISTIC_SECRET_MASKED",
|
|
5536
|
-
message: `Heuristically masked ${input.alias}.${field} as \${env:${envName}}. Confirm and set the env var.`
|
|
5537
|
-
});
|
|
5538
|
-
}
|
|
5539
|
-
}
|
|
5540
|
-
}
|
|
5541
|
-
return { config: result, envVars, warnings };
|
|
5542
|
-
}
|
|
5543
|
-
function toEnvVar(alias, field) {
|
|
5544
|
-
const norm = (s) => s.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").toUpperCase().replace(/^_+|_+$/g, "");
|
|
5545
|
-
return `${norm(alias)}_${norm(field)}`;
|
|
5546
|
-
}
|
|
5547
5533
|
// src/dependencies/registry/interface-registry.ts
|
|
5548
5534
|
init_constants();
|
|
5549
5535
|
|
|
@@ -5871,7 +5857,6 @@ init_agent_project();
|
|
|
5871
5857
|
async function migrateFromConfig(opts) {
|
|
5872
5858
|
const result = {
|
|
5873
5859
|
migrated: [],
|
|
5874
|
-
envVarsToSet: [],
|
|
5875
5860
|
warnings: [],
|
|
5876
5861
|
skipped: []
|
|
5877
5862
|
};
|
|
@@ -5934,16 +5919,11 @@ async function migrateFromConfig(opts) {
|
|
|
5934
5919
|
const declaredAlias = Object.entries(declaredAliases.integrations).find(([, decl]) => decl.name === cloud.name)?.[0];
|
|
5935
5920
|
const alias = declaredAlias ?? generateFriendlyAlias(cloud.name, cloudAlias, usedIntegrationAliases);
|
|
5936
5921
|
usedIntegrationAliases.add(alias);
|
|
5937
|
-
const spec = await opts.integrationRegistry.getSpec(cloud.name, cloud.version).catch(() => ({}));
|
|
5938
|
-
const schema = spec?.configuration?.schema;
|
|
5939
|
-
const rewritten = rewriteSecrets({ alias, config: cloud.configuration ?? {}, schema });
|
|
5940
|
-
result.envVarsToSet.push(...rewritten.envVars);
|
|
5941
|
-
result.warnings.push(...rewritten.warnings);
|
|
5942
5922
|
lockData.integrations[alias] = {
|
|
5943
5923
|
name: cloud.name,
|
|
5944
5924
|
version: cloud.version,
|
|
5945
5925
|
enabled: cloud.enabled ?? false,
|
|
5946
|
-
config:
|
|
5926
|
+
config: cloud.configuration ?? {}
|
|
5947
5927
|
};
|
|
5948
5928
|
}
|
|
5949
5929
|
const usedPluginAliases = new Set(Object.keys(declaredAliases.plugins));
|
|
@@ -5974,7 +5954,6 @@ async function migrateFromConfig(opts) {
|
|
|
5974
5954
|
message: `Migrated dependencies to ${result.migrated.map((e) => `dependencies.${e}.lock.json`).join(", ")}. Review the diff and commit.`
|
|
5975
5955
|
});
|
|
5976
5956
|
}
|
|
5977
|
-
result.envVarsToSet = [...new Set(result.envVarsToSet)];
|
|
5978
5957
|
return result;
|
|
5979
5958
|
}
|
|
5980
5959
|
async function readAliasesFromConfig(projectPath) {
|
|
@@ -6035,12 +6014,9 @@ async function readAliasesFromConfig(projectPath) {
|
|
|
6035
6014
|
return { integrations, plugins };
|
|
6036
6015
|
}
|
|
6037
6016
|
export {
|
|
6038
|
-
substituteEnvRefs,
|
|
6039
6017
|
sortKeysDeep,
|
|
6040
|
-
rewriteSecrets,
|
|
6041
6018
|
migrateFromConfig,
|
|
6042
6019
|
jsonEqual,
|
|
6043
|
-
collectEnvRefs,
|
|
6044
6020
|
PluginResolver,
|
|
6045
6021
|
PluginRegistry,
|
|
6046
6022
|
LockFile,
|
|
@@ -6053,4 +6029,4 @@ export {
|
|
|
6053
6029
|
DEPENDENCY_ERROR_CODES
|
|
6054
6030
|
};
|
|
6055
6031
|
|
|
6056
|
-
//# debugId=
|
|
6032
|
+
//# debugId=468173047DB3911564756E2164756E21
|