@nextclaw/runtime 0.2.45 → 0.2.46
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/index.d.ts +6 -4
- package/dist/index.js +30 -31
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { ProviderCatalogPlugin, ProviderCatalogPlugin as ProviderCatalogPlugin$1,
|
|
1
|
+
import { ProviderCatalogPlugin, ProviderCatalogPlugin as ProviderCatalogPlugin$1, ProviderSpec, ProviderSpec as ProviderSpec$1 } from "@nextclaw/core";
|
|
2
2
|
|
|
3
3
|
//#region src/channels/builtin.d.ts
|
|
4
4
|
declare const BUILTIN_CHANNEL_PLUGIN_IDS: readonly ["telegram", "whatsapp", "discord", "feishu", "mochat", "dingtalk", "wecom", "email", "slack", "qq", "weixin"];
|
|
5
5
|
type BuiltinChannelPluginId = (typeof BUILTIN_CHANNEL_PLUGIN_IDS)[number];
|
|
6
6
|
declare function isBuiltinChannelPluginId(value: string): value is BuiltinChannelPluginId;
|
|
7
7
|
//#endregion
|
|
8
|
-
//#region src/providers/
|
|
9
|
-
declare function installBuiltinProviderRegistry(): ProviderRegistry;
|
|
8
|
+
//#region src/providers/builtin-provider-registry.provider.d.ts
|
|
10
9
|
declare function listBuiltinProviderPlugins(): ProviderCatalogPlugin$1[];
|
|
11
10
|
declare function listBuiltinProviders(): ProviderSpec$1[];
|
|
12
11
|
declare function findBuiltinProviderByName(name: string): ProviderSpec$1 | undefined;
|
|
13
12
|
declare function builtinProviderIds(): string[];
|
|
14
13
|
//#endregion
|
|
15
|
-
|
|
14
|
+
//#region src/providers/plugins/index.d.ts
|
|
15
|
+
declare const BUILTIN_PROVIDER_PLUGINS: ProviderCatalogPlugin$1[];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { BUILTIN_CHANNEL_PLUGIN_IDS, BUILTIN_PROVIDER_PLUGINS, type BuiltinChannelPluginId, type ProviderCatalogPlugin, type ProviderSpec, builtinProviderIds, findBuiltinProviderByName, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,24 @@
|
|
|
1
|
-
import { ProviderRegistry
|
|
1
|
+
import { ProviderRegistry } from "@nextclaw/core";
|
|
2
|
+
//#region src/channels/builtin.ts
|
|
3
|
+
const BUILTIN_CHANNEL_PLUGIN_IDS = [
|
|
4
|
+
"telegram",
|
|
5
|
+
"whatsapp",
|
|
6
|
+
"discord",
|
|
7
|
+
"feishu",
|
|
8
|
+
"mochat",
|
|
9
|
+
"dingtalk",
|
|
10
|
+
"wecom",
|
|
11
|
+
"email",
|
|
12
|
+
"slack",
|
|
13
|
+
"qq",
|
|
14
|
+
"weixin"
|
|
15
|
+
];
|
|
16
|
+
function isBuiltinChannelPluginId(value) {
|
|
17
|
+
return BUILTIN_CHANNEL_PLUGIN_IDS.includes(value);
|
|
18
|
+
}
|
|
2
19
|
//#endregion
|
|
3
|
-
//#region src/providers/index.ts
|
|
4
|
-
const
|
|
20
|
+
//#region src/providers/plugins/index.ts
|
|
21
|
+
const BUILTIN_PROVIDER_PLUGINS = [{
|
|
5
22
|
id: "builtin-runtime-providers",
|
|
6
23
|
providers: [
|
|
7
24
|
{
|
|
@@ -493,43 +510,25 @@ const builtinProviderRegistry = new ProviderRegistry([{
|
|
|
493
510
|
logo: "groq.svg"
|
|
494
511
|
}
|
|
495
512
|
]
|
|
496
|
-
}]
|
|
497
|
-
|
|
498
|
-
|
|
513
|
+
}];
|
|
514
|
+
//#endregion
|
|
515
|
+
//#region src/providers/builtin-provider-registry.provider.ts
|
|
516
|
+
let builtinProviderRegistry = null;
|
|
517
|
+
function getBuiltinProviderRegistry() {
|
|
518
|
+
builtinProviderRegistry ??= new ProviderRegistry(BUILTIN_PROVIDER_PLUGINS);
|
|
499
519
|
return builtinProviderRegistry;
|
|
500
520
|
}
|
|
501
521
|
function listBuiltinProviderPlugins() {
|
|
502
|
-
return
|
|
522
|
+
return getBuiltinProviderRegistry().listProviderPlugins();
|
|
503
523
|
}
|
|
504
524
|
function listBuiltinProviders() {
|
|
505
|
-
return
|
|
525
|
+
return getBuiltinProviderRegistry().listProviderSpecs();
|
|
506
526
|
}
|
|
507
527
|
function findBuiltinProviderByName(name) {
|
|
508
|
-
return
|
|
528
|
+
return getBuiltinProviderRegistry().findProviderByName(name);
|
|
509
529
|
}
|
|
510
530
|
function builtinProviderIds() {
|
|
511
531
|
return listBuiltinProviders().map((provider) => provider.name);
|
|
512
532
|
}
|
|
513
533
|
//#endregion
|
|
514
|
-
|
|
515
|
-
const BUILTIN_CHANNEL_PLUGIN_IDS = [
|
|
516
|
-
"telegram",
|
|
517
|
-
"whatsapp",
|
|
518
|
-
"discord",
|
|
519
|
-
"feishu",
|
|
520
|
-
"mochat",
|
|
521
|
-
"dingtalk",
|
|
522
|
-
"wecom",
|
|
523
|
-
"email",
|
|
524
|
-
"slack",
|
|
525
|
-
"qq",
|
|
526
|
-
"weixin"
|
|
527
|
-
];
|
|
528
|
-
function isBuiltinChannelPluginId(value) {
|
|
529
|
-
return BUILTIN_CHANNEL_PLUGIN_IDS.includes(value);
|
|
530
|
-
}
|
|
531
|
-
//#endregion
|
|
532
|
-
//#region src/index.ts
|
|
533
|
-
installBuiltinProviderRegistry();
|
|
534
|
-
//#endregion
|
|
535
|
-
export { BUILTIN_CHANNEL_PLUGIN_IDS, builtinProviderIds, findBuiltinProviderByName, installBuiltinProviderRegistry, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
|
|
534
|
+
export { BUILTIN_CHANNEL_PLUGIN_IDS, BUILTIN_PROVIDER_PLUGINS, builtinProviderIds, findBuiltinProviderByName, isBuiltinChannelPluginId, listBuiltinProviderPlugins, listBuiltinProviders };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nextclaw/runtime",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.46",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "NextClaw runtime assembly for builtin providers and channels.",
|
|
6
6
|
"type": "module",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"dist"
|
|
16
16
|
],
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@nextclaw/core": "0.12.
|
|
18
|
+
"@nextclaw/core": "0.12.14"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^20.17.6",
|