@botpress/adk 1.19.0-beta.7 → 1.19.0-beta.9
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.map +1 -1
- package/dist/agent-project/agent-project.d.ts.map +1 -1
- package/dist/agent-project/config-writer.d.ts.map +1 -1
- package/dist/agent-project/dependencies-parser.d.ts.map +1 -1
- package/dist/agent-project/file-watcher.d.ts.map +1 -1
- package/dist/agent0/config/schema.d.ts.map +1 -1
- package/dist/agent0/config/store.d.ts +8 -3
- package/dist/agent0/config/store.d.ts.map +1 -1
- package/dist/agent0/index.js +174 -41
- package/dist/agent0/index.js.map +15 -13
- package/dist/agent0/providers/catalog.d.ts.map +1 -1
- package/dist/agent0/providers/registry.d.ts.map +1 -1
- package/dist/agent0/providers/source.d.ts +8 -3
- package/dist/agent0/providers/source.d.ts.map +1 -1
- package/dist/agent0/runtime/client.d.ts +2 -3
- package/dist/agent0/runtime/client.d.ts.map +1 -1
- package/dist/agent0/runtime/engine.d.ts +5 -0
- package/dist/agent0/runtime/engine.d.ts.map +1 -1
- package/dist/agent0/runtime/manager.d.ts +2 -3
- package/dist/agent0/runtime/manager.d.ts.map +1 -1
- package/dist/agent0/runtime/process.d.ts +9 -0
- package/dist/agent0/runtime/process.d.ts.map +1 -1
- package/dist/assets/manager.d.ts.map +1 -1
- package/dist/auth/credentials.d.ts.map +1 -1
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/service.d.ts.map +1 -1
- package/dist/bot-generator/generator.d.ts.map +1 -1
- package/dist/bot-generator/integration-sync.d.ts +2 -0
- package/dist/bot-generator/integration-sync.d.ts.map +1 -1
- package/dist/bot-generator/interface-sync.d.ts +2 -0
- package/dist/bot-generator/interface-sync.d.ts.map +1 -1
- package/dist/bot-generator/plugin-sync.d.ts +2 -0
- package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
- package/dist/cognitive/models.d.ts.map +1 -1
- package/dist/commands/bp-cli.d.ts.map +1 -1
- package/dist/commands/bp-cli.js +147 -0
- package/dist/commands/bp-cli.js.map +12 -0
- package/dist/commands/bp-dev-command.d.ts +2 -0
- package/dist/commands/bp-dev-command.d.ts.map +1 -1
- package/dist/commands/bp-dev-worker-env.d.ts +7 -0
- package/dist/commands/bp-dev-worker-env.d.ts.map +1 -0
- package/dist/config/manager.d.ts.map +1 -1
- package/dist/dependencies/dependency-manager.d.ts.map +1 -1
- package/dist/dependencies/errors.d.ts +7 -4
- package/dist/dependencies/errors.d.ts.map +1 -1
- package/dist/dependencies/index.js +255 -62
- package/dist/dependencies/index.js.map +23 -21
- package/dist/dependencies/types.d.ts +12 -12
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +807 -417
- package/dist/index.js.map +40 -37
- package/dist/integrations/hub-cache.d.ts.map +1 -1
- package/dist/integrations/manager.d.ts.map +1 -1
- package/dist/interfaces/manager.d.ts.map +1 -1
- package/dist/interfaces/parser.d.ts.map +1 -1
- package/dist/knowledge/manager.d.ts.map +1 -1
- package/dist/plugins/manager.d.ts.map +1 -1
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/secrets/manager.d.ts.map +1 -1
- package/dist/tables/table-manager.d.ts.map +1 -1
- package/dist/test-utils/mock-module.d.ts +29 -0
- package/dist/test-utils/mock-module.d.ts.map +1 -0
- package/dist/utils/require-chat.d.ts.map +1 -1
- package/dist/utils/source-map-optimizer.d.ts +10 -11
- package/dist/utils/source-map-optimizer.d.ts.map +1 -1
- package/package.json +7 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-project-generator.d.ts","sourceRoot":"","sources":["../../src/agent-init/agent-project-generator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agent-project-generator.d.ts","sourceRoot":"","sources":["../../src/agent-init/agent-project-generator.ts"],"names":[],"mappings":"AAuCA,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAA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","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;AAShH,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;AAOxD,OAAO,EACL,WAAW,EACX,SAAS,EAET,cAAc,EACd,YAAY,EAEZ,WAAW,EACX,WAAW,EACX,YAAY,EAGZ,gBAAgB,EAEhB,aAAa,EACd,MAAM,YAAY,CAAA;AAOnB,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,YAAY,CAAA;IACnD,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,WAAW,EAAE,MAAM,KAAK,OAAO,CAAC,YAAY,CAAC,CAAA;AAG/E,KAAK,sBAAsB,GAAG,UAAU,CAAC,WAAW,CAAC,sBAAsB,CAAA;AAC3E,KAAK,mBAAmB,GAAG,UAAU,CAAC,WAAW,CAAC,mBAAmB,CAAA;AACrE,KAAK,iBAAiB,GAAG,UAAU,CAAC,WAAW,CAAC,iBAAiB,CAAA;AACjE,KAAK,kBAAkB,GAAG,UAAU,CAAC,WAAW,CAAC,kBAAkB,CAAA;AACnE,KAAK,gBAAgB,GAAG,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAA;AAC/D,KAAK,eAAe,GAAG,UAAU,CAAC,WAAW,CAAC,eAAe,CAAA;AA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AmB,IAAI,OAAO,CAAC,aAAa,CAAC;IAa7C,UAAU,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,eAAe,CAAC;IAchE,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAI5C,IAAI,aAAa,IAAI,aAAa,CAEjC;IAGK,eAAe,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC;IAa/C,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAyB3D,oBAAoB,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IA4BzD,oBAAoB,CAAC,OAAO,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IA6D3E,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;YAc5B,UAAU;YAiLV,aAAa;YAkBb,oBAAoB;YAapB,kBAAkB;YAclB,2BAA2B;IAkCzC;;;;OAIG;IACH;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,oBAAoB;IAW5B,OAAO,CAAC,0BAA0B;IAOlC,OAAO,CAAC,eAAe;YAUT,mBAAmB;CA0VlC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/agent-project/config-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"config-writer.d.ts","sourceRoot":"","sources":["../../src/agent-project/config-writer.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAI3C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,KAAK,GAAG,QAAQ,GAAG,QAAQ,CAAA;IACnC,KAAK,EAAE,MAAM,CAAA;IACb,gFAAgF;IAChF,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M,EAAE,CAAC;IAoB5D;;;OAGG;IACH,kCAAkC,IAAI,+BAA+B;IAkBrE;;;OAGG;IACH,2BAA2B,IAAI,MAAM,EAAE;IAIvC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAI9B;;;;OAIG;IACH,OAAO,CAAC,sBAAsB;IAW9B;;;;;;;;;;OAUG;IACG,aAAa,CAAC,OAAO,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAsEtE;;OAEG;IACG,mBAAmB,CAAC,OAAO,EAAE,uBAAuB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgE5E;;;OAGG;IACG,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAS/C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dependencies-parser.d.ts","sourceRoot":"","sources":["../../src/agent-project/dependencies-parser.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dependencies-parser.d.ts","sourceRoot":"","sources":["../../src/agent-project/dependencies-parser.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAsD5C,qBAAa,iBAAiB;IAC5B;;;;;OAKG;IACH,MAAM,CAAC,mBAAmB,CAAC,aAAa,EAAE,MAAM,GAAG,cAAc;IAYjE;;OAEG;IACH,MAAM,CAAC,iBAAiB,CAAC,YAAY,EAAE,YAAY,GAAG;QACpD,YAAY,EAAE,iBAAiB,EAAE,CAAA;QACjC,MAAM,EAAE,eAAe,EAAE,CAAA;KAC1B;IA+CD;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,YAAY,EAAE,iBAAiB,EAAE,GAAG,eAAe,EAAE;CA6C7E;AAyCD,qBAAa,YAAY;IACvB;;;;;OAKG;IACH,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,SAAS;IAYvD;;OAEG;IACH,MAAM,CAAC,YAAY,CAAC,YAAY,EAAE,YAAY,GAAG;QAC/C,OAAO,EAAE,YAAY,EAAE,CAAA;QACvB,MAAM,EAAE,eAAe,EAAE,CAAA;KAC1B;IAwCD;;;OAGG;IACH,MAAM,CAAC,4BAA4B,CAAC,YAAY,EAAE,YAAY,GAAG,eAAe,EAAE;IAwBlF;;OAEG;IACH,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE;CA0CnE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-watcher.d.ts","sourceRoot":"","sources":["../../src/agent-project/file-watcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;
|
|
1
|
+
{"version":3,"file":"file-watcher.d.ts","sourceRoot":"","sources":["../../src/agent-project/file-watcher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAKrC,MAAM,WAAW,kBAAkB;IACjC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAED,qBAAa,WAAY,SAAQ,YAAY;IAOzC,OAAO,CAAC,QAAQ;IANlB,OAAO,CAAC,OAAO,CAAC,CAAW;IAC3B,OAAO,CAAC,cAAc,CAAwD;IAC9E,OAAO,CAAC,eAAe,CAAU;IACjC,OAAO,CAAC,UAAU,CAAQ;gBAGhB,QAAQ,EAAE,MAAM,EACxB,OAAO,GAAE,kBAAuB;IAWlC,KAAK,IAAI,IAAI;IAmDb,IAAI,IAAI,IAAI;IAgBZ,OAAO,CAAC,YAAY;CAOrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/agent0/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/agent0/config/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,eAAe,CAAA;AAEjC,OAAO,EAAgC,KAAK,YAAY,EAAE,KAAK,uBAAuB,EAAE,MAAM,aAAa,CAAA;AAE3G,eAAO,MAAM,wBAAwB;;;;;;;;;;;;EAM1B,CAAA;AAEX,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQhC,CAAA;AAEX,eAAO,MAAM,6BAA6B;;;;;;;;;;;;EAM/B,CAAA;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EASpB,CAAA;AAEX,eAAO,MAAM,0BAA0B,EAAE,uBAGxC,CAAA;AAED,wBAAgB,yBAAyB,CAAC,GAAG,OAAa,GAAG,YAAY,CAUxE;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,CAc9D"}
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import { AdkError } from '@botpress/analytics';
|
|
1
2
|
import type { Agent0Config } from '../types.js';
|
|
2
3
|
import { type Agent0PathOptions } from './paths.js';
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
export type Agent0ConfigErrorCode = 'AGENT0_CONFIG_READ_FAILED' | 'AGENT0_CONFIG_INVALID';
|
|
5
|
+
/**
|
|
6
|
+
* The Agent(0) config file is user-owned (hand-editable, on-disk), so both
|
|
7
|
+
* read and parse failures are expected user/environment conditions.
|
|
8
|
+
*/
|
|
9
|
+
export declare class Agent0ConfigError extends AdkError<Agent0ConfigErrorCode> {
|
|
10
|
+
constructor(message: string, cause?: unknown, code?: Agent0ConfigErrorCode);
|
|
6
11
|
}
|
|
7
12
|
export interface Agent0ConfigStoreOptions extends Agent0PathOptions {
|
|
8
13
|
configPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/agent0/config/store.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG/F,qBAAa,iBAAkB,SAAQ,
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../../src/agent0/config/store.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAA;AAG/F,MAAM,MAAM,qBAAqB,GAAG,2BAA2B,GAAG,uBAAuB,CAAA;AAEzF;;;GAGG;AACH,qBAAa,iBAAkB,SAAQ,QAAQ,CAAC,qBAAqB,CAAC;gBACxD,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,OAAO,EAAE,IAAI,GAAE,qBAA+C;CAGpG;AAED,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,MAAM,IAAI,CAAA;CACjB;AAED,qBAAa,iBAAiB;IAC5B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAY;IAChC,OAAO,CAAC,SAAS,CAAmC;gBAExC,OAAO,GAAE,wBAA6B;IAK5C,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IAoB7B,KAAK,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAK1C,KAAK,IAAI,OAAO,CAAC,YAAY,CAAC;IAM9B,MAAM,CAAC,OAAO,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,YAAY,GAAG,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC;CAkB5F"}
|
package/dist/agent0/index.js
CHANGED
|
@@ -46,6 +46,42 @@ var __export = (target, all) => {
|
|
|
46
46
|
var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
47
47
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
48
48
|
|
|
49
|
+
// ../analytics/src/errors.ts
|
|
50
|
+
function isAdkError(error) {
|
|
51
|
+
if (error instanceof AdkError)
|
|
52
|
+
return true;
|
|
53
|
+
if (!(error instanceof Error))
|
|
54
|
+
return false;
|
|
55
|
+
return error.constructor?.__IS_ADK_BASE_ERROR === true;
|
|
56
|
+
}
|
|
57
|
+
var AdkError;
|
|
58
|
+
var init_errors = __esm(() => {
|
|
59
|
+
AdkError = class AdkError extends Error {
|
|
60
|
+
static __IS_ADK_BASE_ERROR = true;
|
|
61
|
+
code;
|
|
62
|
+
expected;
|
|
63
|
+
details;
|
|
64
|
+
suggestion;
|
|
65
|
+
constructor(opts) {
|
|
66
|
+
super(opts.message, opts.cause !== undefined ? { cause: opts.cause } : undefined);
|
|
67
|
+
this.name = this.constructor.name;
|
|
68
|
+
this.code = opts.code;
|
|
69
|
+
this.expected = opts.expected ?? false;
|
|
70
|
+
if (opts.details !== undefined) {
|
|
71
|
+
this.details = opts.details;
|
|
72
|
+
}
|
|
73
|
+
if (opts.suggestion !== undefined) {
|
|
74
|
+
this.suggestion = opts.suggestion;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// ../analytics/src/index.ts
|
|
81
|
+
var init_src = __esm(() => {
|
|
82
|
+
init_errors();
|
|
83
|
+
});
|
|
84
|
+
|
|
49
85
|
// src/agent0/types.ts
|
|
50
86
|
var AGENT0_CONFIG_SCHEMA_VERSION = 1;
|
|
51
87
|
var AGENT0_SESSION_MODES = ["default", "guided"];
|
|
@@ -498,6 +534,7 @@ async function ensureAgent0ProjectDirs(projectPath, options = {}) {
|
|
|
498
534
|
return paths;
|
|
499
535
|
}
|
|
500
536
|
// src/agent0/config/schema.ts
|
|
537
|
+
init_src();
|
|
501
538
|
import { z } from "@botpress/sdk";
|
|
502
539
|
var agent0ProviderAuthSchema = z.object({
|
|
503
540
|
type: z.literal("api_key"),
|
|
@@ -543,7 +580,11 @@ function parseAgent0Config(value) {
|
|
|
543
580
|
const config = agent0ConfigSchema.parse(value);
|
|
544
581
|
for (const [key, connection] of Object.entries(config.providers)) {
|
|
545
582
|
if (key !== connection.providerId) {
|
|
546
|
-
throw new
|
|
583
|
+
throw new AdkError({
|
|
584
|
+
code: "AGENT0_CONFIG_KEY_MISMATCH",
|
|
585
|
+
message: `Provider connection key "${key}" does not match providerId "${connection.providerId}"`,
|
|
586
|
+
expected: false
|
|
587
|
+
});
|
|
547
588
|
}
|
|
548
589
|
}
|
|
549
590
|
return config;
|
|
@@ -577,14 +618,12 @@ function hasAgent0ProviderAuth(connection) {
|
|
|
577
618
|
return Boolean(connection?.auth?.apiKey);
|
|
578
619
|
}
|
|
579
620
|
// src/agent0/config/store.ts
|
|
621
|
+
init_src();
|
|
580
622
|
import { readFile, rename, writeFile, chmod as chmod2 } from "node:fs/promises";
|
|
581
623
|
import { dirname as dirname2 } from "node:path";
|
|
582
|
-
class Agent0ConfigError extends
|
|
583
|
-
cause
|
|
584
|
-
|
|
585
|
-
super(message);
|
|
586
|
-
this.cause = cause;
|
|
587
|
-
this.name = "Agent0ConfigError";
|
|
624
|
+
class Agent0ConfigError extends AdkError {
|
|
625
|
+
constructor(message, cause, code = "AGENT0_CONFIG_INVALID") {
|
|
626
|
+
super({ code, message, expected: true, cause });
|
|
588
627
|
}
|
|
589
628
|
}
|
|
590
629
|
|
|
@@ -603,7 +642,7 @@ class Agent0ConfigStore {
|
|
|
603
642
|
} catch (error) {
|
|
604
643
|
if (isFileNotFoundError(error))
|
|
605
644
|
return createDefaultAgent0Config(this.now());
|
|
606
|
-
throw new Agent0ConfigError(`Failed to read Agent(0) config at ${this.configPath}`, error);
|
|
645
|
+
throw new Agent0ConfigError(`Failed to read Agent(0) config at ${this.configPath}`, error, "AGENT0_CONFIG_READ_FAILED");
|
|
607
646
|
}
|
|
608
647
|
try {
|
|
609
648
|
return parseAgent0Config(JSON.parse(content));
|
|
@@ -649,6 +688,7 @@ function isFileNotFoundError(error) {
|
|
|
649
688
|
return typeof error === "object" && error !== null && "code" in error && error.code === "ENOENT";
|
|
650
689
|
}
|
|
651
690
|
// src/agent0/providers/catalog.ts
|
|
691
|
+
init_src();
|
|
652
692
|
var apiKey = (apiKeyLabel = "API key", baseURL) => ({
|
|
653
693
|
type: "api_key",
|
|
654
694
|
apiKeyLabel,
|
|
@@ -885,12 +925,20 @@ function getAgent0ProviderCatalogEntry(providerId) {
|
|
|
885
925
|
function requireAgent0ProviderCatalogEntry(providerId) {
|
|
886
926
|
const entry = getAgent0ProviderCatalogEntry(providerId);
|
|
887
927
|
if (!entry)
|
|
888
|
-
throw new
|
|
928
|
+
throw new AdkError({
|
|
929
|
+
code: "AGENT0_PROVIDER_UNKNOWN",
|
|
930
|
+
message: `Unknown Agent(0) provider: ${providerId}`,
|
|
931
|
+
expected: false
|
|
932
|
+
});
|
|
889
933
|
return entry;
|
|
890
934
|
}
|
|
891
935
|
function toAgent0AvailableModel(entry, model) {
|
|
892
936
|
if (model.providerId !== entry.id) {
|
|
893
|
-
throw new
|
|
937
|
+
throw new AdkError({
|
|
938
|
+
code: "AGENT0_MODEL_MISMATCH",
|
|
939
|
+
message: `Agent(0) model ${model.modelId} belongs to ${model.providerId}, not ${entry.id}`,
|
|
940
|
+
expected: false
|
|
941
|
+
});
|
|
894
942
|
}
|
|
895
943
|
return {
|
|
896
944
|
id: `${entry.id}/${model.modelId}`,
|
|
@@ -905,6 +953,12 @@ function toAgent0AvailableModel(entry, model) {
|
|
|
905
953
|
tags: model.tags ? [...model.tags] : undefined
|
|
906
954
|
};
|
|
907
955
|
}
|
|
956
|
+
// src/agent0/providers/registry.ts
|
|
957
|
+
init_src();
|
|
958
|
+
|
|
959
|
+
// src/agent0/providers/source.ts
|
|
960
|
+
init_src();
|
|
961
|
+
|
|
908
962
|
// src/cognitive/models.ts
|
|
909
963
|
import { z as z2 } from "@botpress/sdk";
|
|
910
964
|
var DEFAULT_BOTPRESS_API_URL = "https://api.botpress.cloud";
|
|
@@ -962,12 +1016,9 @@ var DEFAULT_MODELS_DEV_API_URL = "https://models.dev/api.json";
|
|
|
962
1016
|
var DEFAULT_CACHE_TTL_MS = 5 * 60 * 1000;
|
|
963
1017
|
var DEFAULT_MODELS_DEV_FETCH_TIMEOUT_MS = 1e4;
|
|
964
1018
|
|
|
965
|
-
class Agent0ProviderCatalogSourceError extends
|
|
966
|
-
cause;
|
|
1019
|
+
class Agent0ProviderCatalogSourceError extends AdkError {
|
|
967
1020
|
constructor(message, cause) {
|
|
968
|
-
super(message);
|
|
969
|
-
this.cause = cause;
|
|
970
|
-
this.name = "Agent0ProviderCatalogSourceError";
|
|
1021
|
+
super({ code: "AGENT0_PROVIDER_CATALOG_UNAVAILABLE", message, expected: true, cause });
|
|
971
1022
|
}
|
|
972
1023
|
}
|
|
973
1024
|
|
|
@@ -1295,7 +1346,11 @@ class Agent0ProviderRegistry {
|
|
|
1295
1346
|
async putProviderAuth(providerId, input) {
|
|
1296
1347
|
const entry = requireAgent0ProviderCatalogEntry(providerId);
|
|
1297
1348
|
if (entry.auth.type !== "api_key") {
|
|
1298
|
-
throw new
|
|
1349
|
+
throw new AdkError({
|
|
1350
|
+
code: "AGENT0_PROVIDER_KEY_UNSUPPORTED",
|
|
1351
|
+
message: `Agent(0) provider ${providerId} does not support API-key authentication`,
|
|
1352
|
+
expected: true
|
|
1353
|
+
});
|
|
1299
1354
|
}
|
|
1300
1355
|
const now = this.now().toISOString();
|
|
1301
1356
|
const config = await this.store.update((draft) => {
|
|
@@ -1332,11 +1387,20 @@ class Agent0ProviderRegistry {
|
|
|
1332
1387
|
async setProviderEnabled(providerId, enabled) {
|
|
1333
1388
|
const entry = requireAgent0ProviderCatalogEntry(providerId);
|
|
1334
1389
|
if (enabled && entry.status !== "available") {
|
|
1335
|
-
throw new
|
|
1390
|
+
throw new AdkError({
|
|
1391
|
+
code: "AGENT0_PROVIDER_UNAVAILABLE",
|
|
1392
|
+
message: `Agent(0) provider ${providerId} is not available yet`,
|
|
1393
|
+
expected: true
|
|
1394
|
+
});
|
|
1336
1395
|
}
|
|
1337
1396
|
const current = await this.store.read();
|
|
1338
1397
|
if (enabled && entry.auth.type === "api_key" && !hasAgent0ProviderAuth(current.providers[providerId])) {
|
|
1339
|
-
throw new
|
|
1398
|
+
throw new AdkError({
|
|
1399
|
+
code: "AGENT0_PROVIDER_NOT_CONNECTED",
|
|
1400
|
+
message: `Agent(0) provider ${providerId} must be connected before it can be enabled`,
|
|
1401
|
+
expected: true,
|
|
1402
|
+
suggestion: `Connect the ${providerId} provider before enabling it.`
|
|
1403
|
+
});
|
|
1340
1404
|
}
|
|
1341
1405
|
const now = this.now().toISOString();
|
|
1342
1406
|
const config = await this.store.update((draft) => {
|
|
@@ -1421,7 +1485,11 @@ function countModelsByProvider(models) {
|
|
|
1421
1485
|
}
|
|
1422
1486
|
return counts;
|
|
1423
1487
|
}
|
|
1488
|
+
// src/agent0/runtime/client.ts
|
|
1489
|
+
init_src();
|
|
1490
|
+
|
|
1424
1491
|
// src/agent0/runtime/process.ts
|
|
1492
|
+
init_src();
|
|
1425
1493
|
import { execFileSync, spawn } from "node:child_process";
|
|
1426
1494
|
import { randomUUID } from "node:crypto";
|
|
1427
1495
|
import { chmodSync, copyFileSync, createWriteStream, existsSync as existsSync3, mkdirSync, renameSync, rmSync } from "node:fs";
|
|
@@ -1430,6 +1498,9 @@ import { arch, homedir as homedir2, platform as platform2, tmpdir } from "node:o
|
|
|
1430
1498
|
import { delimiter, dirname as dirname3, join as join4, resolve as resolve2 } from "node:path";
|
|
1431
1499
|
import { pipeline } from "node:stream/promises";
|
|
1432
1500
|
|
|
1501
|
+
// src/agent0/runtime/engine.ts
|
|
1502
|
+
init_src();
|
|
1503
|
+
|
|
1433
1504
|
// src/agent0/runtime/permissions.ts
|
|
1434
1505
|
var AGENT0_BUILT_IN_MCP_PERMISSION = "adk_*";
|
|
1435
1506
|
var AGENT0_HIDDEN_OPENCODE_SKILL = "customize-opencode";
|
|
@@ -1601,7 +1672,8 @@ function buildAgent0CognitiveProvider(options) {
|
|
|
1601
1672
|
{
|
|
1602
1673
|
id: model.modelId,
|
|
1603
1674
|
name: model.name,
|
|
1604
|
-
...renderCognitiveModelCostAndLimits(model)
|
|
1675
|
+
...renderCognitiveModelCostAndLimits(model),
|
|
1676
|
+
...renderCognitiveModelModalities(model)
|
|
1605
1677
|
}
|
|
1606
1678
|
]));
|
|
1607
1679
|
return {
|
|
@@ -1652,12 +1724,20 @@ function getAgent0OpenCodeAuthenticatedProviders(config) {
|
|
|
1652
1724
|
return [];
|
|
1653
1725
|
const entry = getAgent0ProviderCatalogEntry(connection.providerId);
|
|
1654
1726
|
if (!entry)
|
|
1655
|
-
throw new
|
|
1727
|
+
throw new AdkError({
|
|
1728
|
+
code: "AGENT0_PROVIDER_UNKNOWN",
|
|
1729
|
+
message: `Unknown Agent(0) provider: ${connection.providerId}`,
|
|
1730
|
+
expected: false
|
|
1731
|
+
});
|
|
1656
1732
|
if (entry.firstParty || entry.auth.type !== "api_key")
|
|
1657
1733
|
return [];
|
|
1658
1734
|
const providerId = entry.modelSource?.type === "models.dev" ? entry.modelSource.providerId ?? entry.id : undefined;
|
|
1659
1735
|
if (!providerId)
|
|
1660
|
-
throw new
|
|
1736
|
+
throw new AdkError({
|
|
1737
|
+
code: "AGENT0_PROVIDER_SOURCE_MISSING",
|
|
1738
|
+
message: `Agent(0) provider ${connection.providerId} has no OpenCode provider source`,
|
|
1739
|
+
expected: false
|
|
1740
|
+
});
|
|
1661
1741
|
return [[providerId, { ...connection, auth: connection.auth }]];
|
|
1662
1742
|
});
|
|
1663
1743
|
}
|
|
@@ -1676,6 +1756,17 @@ function renderCognitiveModelCostAndLimits(model) {
|
|
|
1676
1756
|
}
|
|
1677
1757
|
};
|
|
1678
1758
|
}
|
|
1759
|
+
function renderCognitiveModelModalities(model) {
|
|
1760
|
+
if (!model.tags?.includes("vision"))
|
|
1761
|
+
return {};
|
|
1762
|
+
return {
|
|
1763
|
+
attachment: true,
|
|
1764
|
+
modalities: {
|
|
1765
|
+
input: ["text", "image"],
|
|
1766
|
+
output: ["text"]
|
|
1767
|
+
}
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1679
1770
|
|
|
1680
1771
|
// src/agent0/runtime/process.ts
|
|
1681
1772
|
var DEFAULT_STARTUP_TIMEOUT_MS = 15000;
|
|
@@ -1710,6 +1801,25 @@ var PROVIDER_AUTH_ENV_KEYS = new Set([
|
|
|
1710
1801
|
"TOGETHERAI_API_KEY",
|
|
1711
1802
|
"XAI_API_KEY"
|
|
1712
1803
|
]);
|
|
1804
|
+
|
|
1805
|
+
class Agent0OpenCodeStartupTimeoutError extends AdkError {
|
|
1806
|
+
timeoutMs;
|
|
1807
|
+
startupOutput;
|
|
1808
|
+
constructor(timeoutMs, options = {}) {
|
|
1809
|
+
super({
|
|
1810
|
+
code: "AGENT0_OPENCODE_STARTUP_TIMEOUT",
|
|
1811
|
+
message: `Agent(0) private OpenCode runtime did not start within ${timeoutMs}ms` + (options.startupOutput ? `
|
|
1812
|
+
${options.startupOutput}` : ""),
|
|
1813
|
+
expected: true,
|
|
1814
|
+
details: { timeoutMs },
|
|
1815
|
+
cause: options.cause
|
|
1816
|
+
});
|
|
1817
|
+
this.timeoutMs = timeoutMs;
|
|
1818
|
+
if (options.startupOutput !== undefined) {
|
|
1819
|
+
this.startupOutput = options.startupOutput;
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1713
1823
|
function sanitizeAgent0OpenCodeBaseEnv(env) {
|
|
1714
1824
|
return Object.fromEntries(Object.entries(env).filter(([key]) => !shouldStripEnv(key)));
|
|
1715
1825
|
}
|
|
@@ -1753,7 +1863,11 @@ function getCachedAgent0OpenCodeBinary(options) {
|
|
|
1753
1863
|
async function downloadAgent0OpenCodeBinary(options) {
|
|
1754
1864
|
const version = options.version ?? OPENCODE_VERSION;
|
|
1755
1865
|
if (version === "0.0.0") {
|
|
1756
|
-
throw new
|
|
1866
|
+
throw new AdkError({
|
|
1867
|
+
code: "AGENT0_OPENCODE_VERSION_UNRESOLVED",
|
|
1868
|
+
message: "Unable to resolve pinned opencode-ai version",
|
|
1869
|
+
expected: false
|
|
1870
|
+
});
|
|
1757
1871
|
}
|
|
1758
1872
|
const { name, binary } = getAgent0OpenCodePlatformPackage();
|
|
1759
1873
|
const tarballUrl = `https://registry.npmjs.org/${name}/-/${name}-${version}.tgz`;
|
|
@@ -1767,7 +1881,11 @@ async function downloadAgent0OpenCodeBinary(options) {
|
|
|
1767
1881
|
const tarPath = join4(tmpDirPath, "opencode.tgz");
|
|
1768
1882
|
const response = await fetchImpl(tarballUrl);
|
|
1769
1883
|
if (!response.ok || !response.body) {
|
|
1770
|
-
throw new
|
|
1884
|
+
throw new AdkError({
|
|
1885
|
+
code: "AGENT0_OPENCODE_DOWNLOAD_FAILED",
|
|
1886
|
+
message: `Failed to download ${tarballUrl}: ${response.status} ${response.statusText}`,
|
|
1887
|
+
expected: true
|
|
1888
|
+
});
|
|
1771
1889
|
}
|
|
1772
1890
|
await pipeline(response.body, createWriteStream(tarPath));
|
|
1773
1891
|
const extractDir = join4(tmpDirPath, "extracted");
|
|
@@ -1775,7 +1893,11 @@ async function downloadAgent0OpenCodeBinary(options) {
|
|
|
1775
1893
|
execFileSync("tar", ["xzf", tarPath, "-C", extractDir, `package/bin/${binary}`]);
|
|
1776
1894
|
const extractedBinary = join4(extractDir, "package", "bin", binary);
|
|
1777
1895
|
if (!existsSync3(extractedBinary)) {
|
|
1778
|
-
throw new
|
|
1896
|
+
throw new AdkError({
|
|
1897
|
+
code: "AGENT0_OPENCODE_DOWNLOAD_FAILED",
|
|
1898
|
+
message: `Binary not found at expected path package/bin/${binary} in ${name}@${version} tarball`,
|
|
1899
|
+
expected: true
|
|
1900
|
+
});
|
|
1779
1901
|
}
|
|
1780
1902
|
const destBinary = join4(cacheDir, binary);
|
|
1781
1903
|
const tmpBinary = `${destBinary}.tmp`;
|
|
@@ -1865,7 +1987,7 @@ async function waitForOpenCodeServer(child, options) {
|
|
|
1865
1987
|
return new Promise((resolveReady, rejectReady) => {
|
|
1866
1988
|
let settled = false;
|
|
1867
1989
|
const timeout = setTimeout(() => {
|
|
1868
|
-
finish(new
|
|
1990
|
+
finish(new Agent0OpenCodeStartupTimeoutError(options.timeoutMs));
|
|
1869
1991
|
}, options.timeoutMs);
|
|
1870
1992
|
const finish = (error, url) => {
|
|
1871
1993
|
if (settled)
|
|
@@ -1913,23 +2035,32 @@ function appendStartupOutput(error, chunks) {
|
|
|
1913
2035
|
const output = chunks.join("").trim();
|
|
1914
2036
|
if (!output)
|
|
1915
2037
|
return error;
|
|
1916
|
-
|
|
2038
|
+
if (error instanceof Agent0OpenCodeStartupTimeoutError) {
|
|
2039
|
+
return new Agent0OpenCodeStartupTimeoutError(error.timeoutMs, {
|
|
2040
|
+
cause: error.cause,
|
|
2041
|
+
startupOutput: output
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
const wrapped = new Error(`${error.message}
|
|
1917
2045
|
${output}`);
|
|
2046
|
+
wrapped.cause = error;
|
|
2047
|
+
return wrapped;
|
|
1918
2048
|
}
|
|
1919
2049
|
function prependPath(dir, currentPath) {
|
|
1920
2050
|
return currentPath ? `${dir}${delimiter}${currentPath}` : dir;
|
|
1921
2051
|
}
|
|
1922
2052
|
|
|
1923
2053
|
// src/agent0/runtime/client.ts
|
|
1924
|
-
class Agent0RuntimeClientError extends
|
|
1925
|
-
cause;
|
|
1926
|
-
code;
|
|
2054
|
+
class Agent0RuntimeClientError extends AdkError {
|
|
1927
2055
|
status;
|
|
1928
2056
|
constructor(code, message, options = {}) {
|
|
1929
|
-
super(
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
2057
|
+
super({
|
|
2058
|
+
code,
|
|
2059
|
+
message,
|
|
2060
|
+
expected: code === "ENGINE_UNAVAILABLE",
|
|
2061
|
+
cause: options.cause,
|
|
2062
|
+
details: options.status !== undefined ? { status: options.status } : undefined
|
|
2063
|
+
});
|
|
1933
2064
|
this.status = options.status;
|
|
1934
2065
|
}
|
|
1935
2066
|
}
|
|
@@ -2942,14 +3073,15 @@ function isRecord2(value) {
|
|
|
2942
3073
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2943
3074
|
}
|
|
2944
3075
|
// src/agent0/runtime/manager.ts
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
cause;
|
|
3076
|
+
init_src();
|
|
3077
|
+
class Agent0RuntimeManagerError extends AdkError {
|
|
2948
3078
|
constructor(code, message, options = {}) {
|
|
2949
|
-
super(
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
3079
|
+
super({
|
|
3080
|
+
code,
|
|
3081
|
+
message,
|
|
3082
|
+
expected: code === "RUNTIME_NOT_RUNNING",
|
|
3083
|
+
cause: options.cause
|
|
3084
|
+
});
|
|
2953
3085
|
}
|
|
2954
3086
|
}
|
|
2955
3087
|
|
|
@@ -3225,6 +3357,7 @@ export {
|
|
|
3225
3357
|
Agent0RuntimeClientError,
|
|
3226
3358
|
Agent0ProviderRegistry,
|
|
3227
3359
|
Agent0ProviderCatalogSourceError,
|
|
3360
|
+
Agent0OpenCodeStartupTimeoutError,
|
|
3228
3361
|
Agent0ModelsDevCatalogSource,
|
|
3229
3362
|
Agent0ConfigStore,
|
|
3230
3363
|
Agent0ConfigError,
|
|
@@ -3245,4 +3378,4 @@ export {
|
|
|
3245
3378
|
AGENT0_BUILT_IN_MCP_PERMISSION
|
|
3246
3379
|
};
|
|
3247
3380
|
|
|
3248
|
-
//# debugId=
|
|
3381
|
+
//# debugId=10FBA9A02201263864756E2164756E21
|