@botpress/adk 1.16.2 → 1.16.3
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/eval/client.d.ts.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +39 -27
- package/dist/index.js.map +5 -4
- package/dist/utils/require-chat.d.ts +28 -0
- package/dist/utils/require-chat.d.ts.map +1 -0
- package/package.json +3 -2
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to load @botpress/chat via CJS resolution from within the ADK's dependency tree.
|
|
3
|
+
*
|
|
4
|
+
* ## Why CJS?
|
|
5
|
+
*
|
|
6
|
+
* @botpress/chat ships two bundles:
|
|
7
|
+
* - index.mjs (browser build): axios 1.2.5 fully inlined with http adapter set to null
|
|
8
|
+
* - index.cjs (Node build): uses external require("axios") with real Node.js http adapter
|
|
9
|
+
*
|
|
10
|
+
* ESM `import()` resolves via the "module" field to index.mjs, which has a broken http
|
|
11
|
+
* adapter in any server runtime (Node, Bun, compiled binary). CJS `require()` resolves
|
|
12
|
+
* via "main" to index.cjs with a working adapter.
|
|
13
|
+
*
|
|
14
|
+
* ## Why two hops?
|
|
15
|
+
*
|
|
16
|
+
* In a compiled Bun binary, `import.meta.url` points to `/$bunfs/root/` (a virtual FS
|
|
17
|
+
* with no node_modules), so `createRequire` must anchor to `process.cwd()`. But
|
|
18
|
+
* `@botpress/chat` is a dependency of `@botpress/adk`, not the agent project at cwd.
|
|
19
|
+
* So we first resolve `@botpress/adk` from cwd, then resolve `@botpress/chat` from
|
|
20
|
+
* the ADK's location on disk.
|
|
21
|
+
*/
|
|
22
|
+
export type ChatClient = typeof import('@botpress/chat').Client;
|
|
23
|
+
/**
|
|
24
|
+
* Returns the @botpress/chat Client class, resolved via CJS from the ADK's dependency tree.
|
|
25
|
+
* Result is cached per resolved ADK package path after first call.
|
|
26
|
+
*/
|
|
27
|
+
export declare function getChatClient(cwd?: string): ChatClient;
|
|
28
|
+
//# sourceMappingURL=require-chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"require-chat.d.ts","sourceRoot":"","sources":["../../src/utils/require-chat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAMH,MAAM,MAAM,UAAU,GAAG,cAAc,gBAAgB,EAAE,MAAM,CAAA;AAK/D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,GAAG,SAAgB,GAAG,UAAU,CAY7D"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@botpress/adk",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.3",
|
|
4
4
|
"description": "Core ADK library for building AI agents on Botpress",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
"types": "./dist/index.d.ts",
|
|
16
16
|
"import": "./dist/index.js"
|
|
17
17
|
},
|
|
18
|
+
"./package.json": "./package.json",
|
|
18
19
|
"./schemas/*": "./schemas/*"
|
|
19
20
|
},
|
|
20
21
|
"scripts": {
|
|
@@ -48,7 +49,7 @@
|
|
|
48
49
|
"@botpress/cli": "^5.2.0",
|
|
49
50
|
"@botpress/client": "^1.35.0",
|
|
50
51
|
"@botpress/cognitive": "^0.3.14",
|
|
51
|
-
"@botpress/runtime": "^1.16.
|
|
52
|
+
"@botpress/runtime": "^1.16.3",
|
|
52
53
|
"@botpress/sdk": "^5.4.3",
|
|
53
54
|
"@bpinternal/jex": "^1.2.4",
|
|
54
55
|
"@bpinternal/yargs-extra": "^0.0.21",
|