@botpress/adk 3.0.0-beta.0 → 3.0.0-beta.2
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/types.d.ts +6 -90
- package/dist/agent-project/types.d.ts.map +1 -1
- package/dist/agent0/config/schema.d.ts +8 -130
- package/dist/agent0/config/schema.d.ts.map +1 -1
- package/dist/agent0/index.js +2 -2
- package/dist/agent0/index.js.map +3 -3
- package/dist/bot-generator/install-package.d.ts +10 -5
- package/dist/bot-generator/install-package.d.ts.map +1 -1
- package/dist/bot-generator/integration-sync.d.ts +2 -2
- package/dist/bot-generator/integration-sync.d.ts.map +1 -1
- package/dist/bot-generator/interface-sync.d.ts +2 -2
- package/dist/bot-generator/interface-sync.d.ts.map +1 -1
- package/dist/bot-generator/plugin-sync.d.ts +1 -2
- package/dist/bot-generator/plugin-sync.d.ts.map +1 -1
- package/dist/build/__fixtures__/minimal-bot/bot.definition.d.ts +3 -15
- package/dist/build/__fixtures__/minimal-bot/bot.definition.d.ts.map +1 -1
- package/dist/chat-bundle.cjs +23 -22
- package/dist/dependencies/catalog/catalog-service.d.ts +2 -0
- package/dist/dependencies/catalog/catalog-service.d.ts.map +1 -1
- package/dist/dependencies/catalog/client-factory.d.ts +3 -0
- package/dist/dependencies/catalog/client-factory.d.ts.map +1 -1
- package/dist/dependencies/catalog/integration-source.d.ts +1 -0
- package/dist/dependencies/catalog/integration-source.d.ts.map +1 -1
- package/dist/dependencies/catalog/interface-source.d.ts +1 -0
- package/dist/dependencies/catalog/interface-source.d.ts.map +1 -1
- package/dist/dependencies/catalog/plugin-source.d.ts +1 -0
- package/dist/dependencies/catalog/plugin-source.d.ts.map +1 -1
- package/dist/dependencies/catalog/resolution-cache.d.ts +8 -6
- package/dist/dependencies/catalog/resolution-cache.d.ts.map +1 -1
- package/dist/dependencies/index.js +51 -26
- package/dist/dependencies/index.js.map +10 -10
- package/dist/dependencies/types.d.ts +18 -340
- package/dist/dependencies/types.d.ts.map +1 -1
- package/dist/deploy-manifest/index.d.ts +23 -491
- package/dist/deploy-manifest/index.d.ts.map +1 -1
- package/dist/generators/tests.d.ts.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9140 -8288
- package/dist/index.js.map +24 -23
- package/dist/knowledge/manager.d.ts.map +1 -1
- package/dist/runner/script-runner.d.ts.map +1 -1
- package/dist/tables/failure-details.d.ts +4 -0
- package/dist/tables/failure-details.d.ts.map +1 -0
- package/dist/tables/index.d.ts +1 -0
- package/dist/tables/index.d.ts.map +1 -1
- package/dist/tables/table-manager.d.ts.map +1 -1
- package/dist/tables/types.d.ts +11 -4
- package/dist/tables/types.d.ts.map +1 -1
- package/package.json +6 -6
|
@@ -20,6 +20,8 @@ export interface ResolvedSpec<TDef> {
|
|
|
20
20
|
export interface CatalogSource<TDef, TRef extends CatalogRef = CatalogRef> {
|
|
21
21
|
/** Cache bucket + on-disk id-field name for this resource type. */
|
|
22
22
|
readonly cacheConfig: ResolutionCacheConfig;
|
|
23
|
+
/** API endpoint + workspace scope used to isolate resolution cache entries. */
|
|
24
|
+
getCacheScope(): Promise<string>;
|
|
23
25
|
/**
|
|
24
26
|
* Resolve a ref to its identity + definition from cloud. MUST throw a typed
|
|
25
27
|
* `AdkError` (not return null) when the ref cannot be resolved, so the caller
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalog-service.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/catalog-service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,KAAK,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAEnF,uFAAuF;AACvF,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,4DAA4D;AAC5D,MAAM,WAAW,YAAY,CAAC,IAAI;IAChC,EAAE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ACvE,mEAAmE;IACnE,QAAQ,CAAC,WAAW,EAAE,qBAAqB,CAAA;IAC3C,+EAA+E;IAC/E,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAAA;IAChC;;;;OAIG;IACH,UAAU,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAA;CACnD;AAED;;;;;;;GAOG;AACH,qBAAa,cAAc,CAAC,IAAI,EAAE,IAAI,SAAS,UAAU,GAAG,UAAU;IAIlE,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHzB,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,CAAA;gBAGlB,MAAM,EAAE,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,EAClD,OAAO,GAAE,OAAe;IAK1B,iFAAiF;IAC3E,aAAa,CAAC,GAAG,EAAE,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAmC7C,uFAAuF;YACzE,kBAAkB;IAShC,0FAA0F;IACpF,aAAa,IAAI,OAAO,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IAQ9D,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;CAGlC"}
|
|
@@ -21,7 +21,10 @@ export interface CatalogClientOptions {
|
|
|
21
21
|
export declare class CatalogClientFactory {
|
|
22
22
|
readonly options: CatalogClientOptions;
|
|
23
23
|
private client?;
|
|
24
|
+
private resolvedCredentials?;
|
|
24
25
|
constructor(options?: CatalogClientOptions);
|
|
26
|
+
private getCredentials;
|
|
27
|
+
getCacheScope(): Promise<string>;
|
|
25
28
|
getClient(): Promise<Client>;
|
|
26
29
|
}
|
|
27
30
|
//# sourceMappingURL=client-factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEnH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAKD;;;;;;GAMG;AACH,qBAAa,oBAAoB;
|
|
1
|
+
{"version":3,"file":"client-factory.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/client-factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACzC,OAAO,EAA+B,KAAK,WAAW,EAAE,KAAK,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAEnH;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,CAAC,EAAE,yBAAyB,CAAA;IACnC,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,WAAW,CAAA;CAC1B;AAKD;;;;;;GAMG;AACH,qBAAa,oBAAoB;aAIH,OAAO,EAAE,oBAAoB;IAHzD,OAAO,CAAC,MAAM,CAAC,CAAQ;IACvB,OAAO,CAAC,mBAAmB,CAAC,CAAyD;gBAEzD,OAAO,GAAE,oBAAyB;YAEhD,cAAc;IAatB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAKhC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC;CAcnC"}
|
|
@@ -15,6 +15,7 @@ export declare class IntegrationCatalogSource implements CatalogSource<Integrati
|
|
|
15
15
|
idField: string;
|
|
16
16
|
};
|
|
17
17
|
constructor(clientFactory: CatalogClientFactory);
|
|
18
|
+
getCacheScope(): Promise<string>;
|
|
18
19
|
fetchByRef(ref: IntegrationRef): Promise<ResolvedSpec<IntegrationDefinition>>;
|
|
19
20
|
/** Search public integrations in the Botpress hub. */
|
|
20
21
|
search(query: string, limit?: number): Promise<HubCacheEntry[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration-source.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/integration-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAOpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,aAAa,CAAC,qBAAqB,EAAE,cAAc,CAAC;IAGvF,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAA0D;gBAEjD,aAAa,EAAE,oBAAoB;IAE1D,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAUnF,sDAAsD;IAChD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA4BzE;;;OAGG;IACG,2BAA2B,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAgBtG,0DAA0D;IACpD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAerC,+BAA+B;YAe/B,uBAAuB;YAqBvB,sBAAsB;IAkBpC,OAAO,CAAC,wBAAwB;YAOlB,8BAA8B;CAuE7C"}
|
|
1
|
+
{"version":3,"file":"integration-source.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/integration-source.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,qBAAqB,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACxF,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAA;AAOpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;;;;GAKG;AACH,qBAAa,wBAAyB,YAAW,aAAa,CAAC,qBAAqB,EAAE,cAAc,CAAC;IAGvF,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAA0D;gBAEjD,aAAa,EAAE,oBAAoB;IAE1D,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC,UAAU,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,qBAAqB,CAAC,CAAC;IAUnF,sDAAsD;IAChD,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IA4BzE;;;OAGG;IACG,2BAA2B,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC;IAgBtG,0DAA0D;IACpD,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;YAerC,+BAA+B;YAe/B,uBAAuB;YAqBvB,sBAAsB;IAkBpC,OAAO,CAAC,wBAAwB;YAOlB,8BAA8B;CAuE7C"}
|
|
@@ -18,6 +18,7 @@ export declare class InterfaceCatalogSource implements CatalogSource<InterfaceDe
|
|
|
18
18
|
idField: string;
|
|
19
19
|
};
|
|
20
20
|
constructor(clientFactory: CatalogClientFactory);
|
|
21
|
+
getCacheScope(): Promise<string>;
|
|
21
22
|
fetchByRef(ref: InterfaceRef): Promise<ResolvedSpec<InterfaceDefinition>>;
|
|
22
23
|
}
|
|
23
24
|
//# sourceMappingURL=interface-source.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interface-source.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/interface-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,YAAW,aAAa,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAGjF,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAAsD;gBAE7C,aAAa,EAAE,oBAAoB;IAE1D,UAAU,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;CA2DhF"}
|
|
1
|
+
{"version":3,"file":"interface-source.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/interface-source.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAA;AAClF,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvE;;;;;;;;;GASG;AACH,qBAAa,sBAAuB,YAAW,aAAa,CAAC,mBAAmB,EAAE,YAAY,CAAC;IAGjF,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAAsD;gBAE7C,aAAa,EAAE,oBAAoB;IAE1D,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC,UAAU,CAAC,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;CA2DhF"}
|
|
@@ -27,6 +27,7 @@ export declare class PluginCatalogSource implements CatalogSource<PluginDefiniti
|
|
|
27
27
|
idField: string;
|
|
28
28
|
};
|
|
29
29
|
constructor(clientFactory: CatalogClientFactory);
|
|
30
|
+
getCacheScope(): Promise<string>;
|
|
30
31
|
fetchByRef(ref: PluginRef): Promise<ResolvedSpec<PluginDefinition>>;
|
|
31
32
|
/**
|
|
32
33
|
* Search public plugins in the Botpress hub.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-source.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/plugin-source.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAOzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAEvE,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,MAAM,CAAA;IACf,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,UAAU,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAA;IAC7C,eAAe,EAAE,WAAW,GAAG,YAAY,CAAA;CAC5C;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,aAAa,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAGxE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAAgD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,mBAAoB,YAAW,aAAa,CAAC,gBAAgB,EAAE,SAAS,CAAC;IAGxE,OAAO,CAAC,QAAQ,CAAC,aAAa;IAF1C,QAAQ,CAAC,WAAW;;;MAAgD;gBAEvC,aAAa,EAAE,oBAAoB;IAE1D,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC;IAIhC,UAAU,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;IAezE;;;;;;OAMG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,GAAE,MAAW,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;IAW9E;;;;OAIG;IACG,SAAS,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC;IAM1D,oDAAoD;IAC9C,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAWnD;;;OAGG;YACW,2BAA2B;YAU3B,iBAAiB;IAe/B,OAAO,CAAC,wBAAwB;CAMjC"}
|
|
@@ -14,8 +14,8 @@ export interface ResolutionCacheConfig {
|
|
|
14
14
|
cacheType: string;
|
|
15
15
|
/**
|
|
16
16
|
* Field name the resolution value is stored under on disk. Kept type-specific
|
|
17
|
-
* (e.g. `integrationId`) so the
|
|
18
|
-
*
|
|
17
|
+
* (e.g. `integrationId`) so the stored value remains compatible with the three
|
|
18
|
+
* separate caches this class replaced.
|
|
19
19
|
*/
|
|
20
20
|
idField: string;
|
|
21
21
|
/**
|
|
@@ -36,9 +36,10 @@ export interface ResolutionCacheConfig {
|
|
|
36
36
|
* expiry — the `(id, updatedAt)` tuple is content-addressed (same tuple ⇒ same
|
|
37
37
|
* spec), so it is immutable by contract.
|
|
38
38
|
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
39
|
+
* Key sanitization (`[^a-zA-Z0-9_-] → _`), TTL, and compact JSON serialization
|
|
40
|
+
* match the pre-WS4 caches. Catalog callers prefix resolution keys with the API
|
|
41
|
+
* endpoint and workspace so different environments cannot share a resolution.
|
|
42
|
+
* `noCache` disables reads and still allows writes through `set*`.
|
|
42
43
|
*/
|
|
43
44
|
export declare class ResolutionCache<TDef> {
|
|
44
45
|
private readonly cacheDir;
|
|
@@ -55,8 +56,9 @@ export declare class ResolutionCache<TDef> {
|
|
|
55
56
|
*/
|
|
56
57
|
getResolution(name: string, version: string, workspace?: string, options?: {
|
|
57
58
|
allowStale?: boolean;
|
|
59
|
+
cacheScope?: string;
|
|
58
60
|
}): Promise<VersionResolution | null>;
|
|
59
|
-
setResolution(name: string, version: string, workspace: string | undefined, id: string, updatedAt: string): Promise<void>;
|
|
61
|
+
setResolution(name: string, version: string, workspace: string | undefined, id: string, updatedAt: string, cacheScope?: string): Promise<void>;
|
|
60
62
|
getDefinition(id: string, updatedAt: string): Promise<TDef | null>;
|
|
61
63
|
setDefinition(id: string, updatedAt: string, definition: TDef): Promise<void>;
|
|
62
64
|
clear(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolution-cache.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/resolution-cache.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,qBAAqB;IACpC,qFAAqF;IACrF,SAAS,EAAE,MAAM,CAAA;IACjB;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAUD
|
|
1
|
+
{"version":3,"file":"resolution-cache.d.ts","sourceRoot":"","sources":["../../../src/dependencies/catalog/resolution-cache.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;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AG,OAAO,CAAC,IAAI,CAAC;IAc7E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,QAAQ,IAAI,OAAO,CAAC;QACxB,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;QACjD,WAAW,EAAE;YAAE,KAAK,EAAE,MAAM,CAAC;YAAC,SAAS,EAAE,MAAM,CAAA;SAAE,CAAA;KAClD,CAAC;IAyBF,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,gBAAgB;CAIzB"}
|
|
@@ -72,7 +72,7 @@ var init_types = __esm(() => {
|
|
|
72
72
|
name: z.string(),
|
|
73
73
|
version: z.string(),
|
|
74
74
|
enabled: z.boolean(),
|
|
75
|
-
config: z.record(z.any()).default({}),
|
|
75
|
+
config: z.record(z.string(), z.any()).default({}),
|
|
76
76
|
configurationType: z.string().optional(),
|
|
77
77
|
missingFields: z.array(z.string()).optional(),
|
|
78
78
|
authorizationPending: z.boolean().optional()
|
|
@@ -85,8 +85,8 @@ var init_types = __esm(() => {
|
|
|
85
85
|
name: z.string(),
|
|
86
86
|
version: z.string(),
|
|
87
87
|
enabled: z.boolean().default(true),
|
|
88
|
-
config: z.record(z.any()).default({}),
|
|
89
|
-
dependencies: z.record(pluginDependencyMappingSchema).default({}),
|
|
88
|
+
config: z.record(z.string(), z.any()).default({}),
|
|
89
|
+
dependencies: z.record(z.string(), pluginDependencyMappingSchema).default({}),
|
|
90
90
|
missingFields: z.array(z.string()).optional()
|
|
91
91
|
});
|
|
92
92
|
integrationSnapshotEntrySchema = integrationDependencyEntrySchema.extend({
|
|
@@ -103,8 +103,8 @@ var init_types = __esm(() => {
|
|
|
103
103
|
$schema: z.string().optional(),
|
|
104
104
|
version: z.literal(1),
|
|
105
105
|
env: z.enum(["dev", "prod"]),
|
|
106
|
-
integrations: z.record(integrationDependencyEntrySchema).default({}),
|
|
107
|
-
plugins: z.record(pluginDependencyEntrySchema).default({})
|
|
106
|
+
integrations: z.record(z.string(), integrationDependencyEntrySchema).default({}),
|
|
107
|
+
plugins: z.record(z.string(), pluginDependencyEntrySchema).default({})
|
|
108
108
|
});
|
|
109
109
|
dependencySnapshotSchema = z.object({
|
|
110
110
|
$schema: z.string().optional(),
|
|
@@ -114,8 +114,8 @@ var init_types = __esm(() => {
|
|
|
114
114
|
fetchedAt: z.string(),
|
|
115
115
|
botUpdatedAt: z.string().optional(),
|
|
116
116
|
stale: z.boolean().optional(),
|
|
117
|
-
integrations: z.record(integrationSnapshotEntrySchema).default({}),
|
|
118
|
-
plugins: z.record(pluginSnapshotEntrySchema).default({})
|
|
117
|
+
integrations: z.record(z.string(), integrationSnapshotEntrySchema).default({}),
|
|
118
|
+
plugins: z.record(z.string(), pluginSnapshotEntrySchema).default({})
|
|
119
119
|
});
|
|
120
120
|
dependencyMigrationMarkerSchema = z.object({
|
|
121
121
|
version: z.literal(1),
|
|
@@ -385,13 +385,13 @@ var init_types2 = __esm(() => {
|
|
|
385
385
|
version: z2.string(),
|
|
386
386
|
enabled: z2.boolean(),
|
|
387
387
|
configurationType: z2.string().optional(),
|
|
388
|
-
config: z2.record(z2.any()).optional()
|
|
388
|
+
config: z2.record(z2.string(), z2.any()).optional()
|
|
389
389
|
})
|
|
390
390
|
])).optional(),
|
|
391
391
|
plugins: z2.record(z2.object({
|
|
392
392
|
version: z2.string(),
|
|
393
|
-
config: z2.record(z2.any()).optional(),
|
|
394
|
-
dependencies: z2.record(pluginDependencyMappingSchema2).optional(),
|
|
393
|
+
config: z2.record(z2.string(), z2.any()).optional(),
|
|
394
|
+
dependencies: z2.record(z2.string(), pluginDependencyMappingSchema2).optional(),
|
|
395
395
|
missingFields: z2.array(z2.string()).optional()
|
|
396
396
|
})).optional()
|
|
397
397
|
});
|
|
@@ -1674,19 +1674,30 @@ import { Client as Client3 } from "@botpress/client";
|
|
|
1674
1674
|
class CatalogClientFactory {
|
|
1675
1675
|
options;
|
|
1676
1676
|
client;
|
|
1677
|
+
resolvedCredentials;
|
|
1677
1678
|
constructor(options = {}) {
|
|
1678
1679
|
this.options = options;
|
|
1679
1680
|
}
|
|
1680
|
-
async
|
|
1681
|
-
if (this.
|
|
1682
|
-
return this.
|
|
1681
|
+
async getCredentials() {
|
|
1682
|
+
if (this.resolvedCredentials)
|
|
1683
|
+
return this.resolvedCredentials;
|
|
1683
1684
|
const { project, workspaceId, credentials, apiUrl } = this.options;
|
|
1684
|
-
|
|
1685
|
+
this.resolvedCredentials = await resolveWorkspaceCredentials({
|
|
1685
1686
|
project,
|
|
1686
1687
|
credentials,
|
|
1687
1688
|
apiUrl,
|
|
1688
1689
|
workspaceId
|
|
1689
1690
|
});
|
|
1691
|
+
return this.resolvedCredentials;
|
|
1692
|
+
}
|
|
1693
|
+
async getCacheScope() {
|
|
1694
|
+
const resolved = await this.getCredentials();
|
|
1695
|
+
return `${resolved.apiUrl.replace(/\/+$/, "")}|${resolved.workspaceId}`;
|
|
1696
|
+
}
|
|
1697
|
+
async getClient() {
|
|
1698
|
+
if (this.client)
|
|
1699
|
+
return this.client;
|
|
1700
|
+
const resolved = await this.getCredentials();
|
|
1690
1701
|
this.client = new Client3({
|
|
1691
1702
|
token: resolved.token,
|
|
1692
1703
|
apiUrl: resolved.apiUrl,
|
|
@@ -1730,7 +1741,7 @@ class ResolutionCache {
|
|
|
1730
1741
|
return null;
|
|
1731
1742
|
}
|
|
1732
1743
|
try {
|
|
1733
|
-
const key = this.getResolutionKey(name, version, workspace);
|
|
1744
|
+
const key = this.getResolutionKey(name, version, workspace, options?.cacheScope);
|
|
1734
1745
|
const cachePath = path3.join(this.resolutionsDir, `${key}.json`);
|
|
1735
1746
|
const data = await fs3.readFile(cachePath, "utf-8");
|
|
1736
1747
|
const raw = JSON.parse(data);
|
|
@@ -1750,9 +1761,9 @@ class ResolutionCache {
|
|
|
1750
1761
|
return null;
|
|
1751
1762
|
}
|
|
1752
1763
|
}
|
|
1753
|
-
async setResolution(name, version, workspace, id, updatedAt) {
|
|
1764
|
+
async setResolution(name, version, workspace, id, updatedAt, cacheScope) {
|
|
1754
1765
|
await this.ensureCacheDirs();
|
|
1755
|
-
const key = this.getResolutionKey(name, version, workspace);
|
|
1766
|
+
const key = this.getResolutionKey(name, version, workspace, cacheScope);
|
|
1756
1767
|
const cachePath = path3.join(this.resolutionsDir, `${key}.json`);
|
|
1757
1768
|
const resolution = {
|
|
1758
1769
|
[this.idField]: id,
|
|
@@ -1813,9 +1824,10 @@ class ResolutionCache {
|
|
|
1813
1824
|
]);
|
|
1814
1825
|
return { resolutions, definitions };
|
|
1815
1826
|
}
|
|
1816
|
-
getResolutionKey(name, version, workspace) {
|
|
1827
|
+
getResolutionKey(name, version, workspace, cacheScope) {
|
|
1828
|
+
const scopePrefix = cacheScope ? `${cacheScope}_` : "";
|
|
1817
1829
|
const prefix = workspace ? `${workspace}_` : "";
|
|
1818
|
-
const key = `${prefix}${name}_${version}`;
|
|
1830
|
+
const key = `${scopePrefix}${prefix}${name}_${version}`;
|
|
1819
1831
|
return key.replace(/[^a-zA-Z0-9_-]/g, "_");
|
|
1820
1832
|
}
|
|
1821
1833
|
getDefinitionKey(id, updatedAt) {
|
|
@@ -1835,7 +1847,8 @@ class CatalogService {
|
|
|
1835
1847
|
this.cache = new ResolutionCache(source.cacheConfig, noCache);
|
|
1836
1848
|
}
|
|
1837
1849
|
async getDefinition(ref) {
|
|
1838
|
-
const
|
|
1850
|
+
const cacheScope = await this.source.getCacheScope();
|
|
1851
|
+
const cachedResolution = await this.cache.getResolution(ref.name, ref.version, ref.workspace, { cacheScope });
|
|
1839
1852
|
if (cachedResolution) {
|
|
1840
1853
|
const cachedDefinition = await this.cache.getDefinition(cachedResolution.id, cachedResolution.updatedAt);
|
|
1841
1854
|
if (cachedDefinition) {
|
|
@@ -1844,12 +1857,12 @@ class CatalogService {
|
|
|
1844
1857
|
}
|
|
1845
1858
|
try {
|
|
1846
1859
|
const { id, updatedAt, definition } = await this.source.fetchByRef(ref);
|
|
1847
|
-
await this.cache.setResolution(ref.name, ref.version, ref.workspace, id, updatedAt);
|
|
1860
|
+
await this.cache.setResolution(ref.name, ref.version, ref.workspace, id, updatedAt, cacheScope);
|
|
1848
1861
|
await this.cache.setDefinition(id, updatedAt, definition);
|
|
1849
1862
|
return definition;
|
|
1850
1863
|
} catch (err) {
|
|
1851
1864
|
if (!(err instanceof AdkError && err.expected)) {
|
|
1852
|
-
const stale = await this.getStaleDefinition(ref);
|
|
1865
|
+
const stale = await this.getStaleDefinition(ref, cacheScope);
|
|
1853
1866
|
if (stale !== null) {
|
|
1854
1867
|
return stale;
|
|
1855
1868
|
}
|
|
@@ -1857,8 +1870,11 @@ class CatalogService {
|
|
|
1857
1870
|
throw err;
|
|
1858
1871
|
}
|
|
1859
1872
|
}
|
|
1860
|
-
async getStaleDefinition(ref) {
|
|
1861
|
-
const stale = await this.cache.getResolution(ref.name, ref.version, ref.workspace, {
|
|
1873
|
+
async getStaleDefinition(ref, cacheScope) {
|
|
1874
|
+
const stale = await this.cache.getResolution(ref.name, ref.version, ref.workspace, {
|
|
1875
|
+
allowStale: true,
|
|
1876
|
+
cacheScope
|
|
1877
|
+
});
|
|
1862
1878
|
if (!stale)
|
|
1863
1879
|
return null;
|
|
1864
1880
|
return this.cache.getDefinition(stale.id, stale.updatedAt);
|
|
@@ -1952,6 +1968,9 @@ class IntegrationCatalogSource {
|
|
|
1952
1968
|
constructor(clientFactory) {
|
|
1953
1969
|
this.clientFactory = clientFactory;
|
|
1954
1970
|
}
|
|
1971
|
+
async getCacheScope() {
|
|
1972
|
+
return this.clientFactory.getCacheScope();
|
|
1973
|
+
}
|
|
1955
1974
|
async fetchByRef(ref) {
|
|
1956
1975
|
const client = await this.clientFactory.getClient();
|
|
1957
1976
|
const integration = await this._findPrivateOrPublicIntegration(client, ref);
|
|
@@ -2971,6 +2990,9 @@ class InterfaceCatalogSource {
|
|
|
2971
2990
|
constructor(clientFactory) {
|
|
2972
2991
|
this.clientFactory = clientFactory;
|
|
2973
2992
|
}
|
|
2993
|
+
async getCacheScope() {
|
|
2994
|
+
return this.clientFactory.getCacheScope();
|
|
2995
|
+
}
|
|
2974
2996
|
async fetchByRef(ref) {
|
|
2975
2997
|
const client = await this.clientFactory.getClient();
|
|
2976
2998
|
let interfaceResponse;
|
|
@@ -5000,7 +5022,7 @@ var _format = null, _formatLoaded = false, formatCode = async (code, filepath) =
|
|
|
5000
5022
|
`));
|
|
5001
5023
|
return code;
|
|
5002
5024
|
}
|
|
5003
|
-
}, ADK_VERSION = "3.0.0-beta.
|
|
5025
|
+
}, ADK_VERSION = "3.0.0-beta.2", relative = (from, to) => {
|
|
5004
5026
|
const fromDir = path12.dirname(from);
|
|
5005
5027
|
const relative2 = path12.relative(fromDir, to);
|
|
5006
5028
|
return relative2.startsWith(".") ? relative2 : `./${relative2}`;
|
|
@@ -5223,6 +5245,9 @@ class PluginCatalogSource {
|
|
|
5223
5245
|
constructor(clientFactory) {
|
|
5224
5246
|
this.clientFactory = clientFactory;
|
|
5225
5247
|
}
|
|
5248
|
+
async getCacheScope() {
|
|
5249
|
+
return this.clientFactory.getCacheScope();
|
|
5250
|
+
}
|
|
5226
5251
|
async fetchByRef(ref) {
|
|
5227
5252
|
const client = await this.clientFactory.getClient();
|
|
5228
5253
|
const plugin = await this._findPublicPlugin(client, ref);
|
|
@@ -6878,4 +6903,4 @@ export {
|
|
|
6878
6903
|
DEPENDENCY_ERROR_CODES
|
|
6879
6904
|
};
|
|
6880
6905
|
|
|
6881
|
-
//# debugId=
|
|
6906
|
+
//# debugId=925FEC63B63E28EE64756E2164756E21
|