@downcity/plugins 1.0.210 → 1.0.212
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/bin/chat.d.ts +20 -0
- package/bin/chat.d.ts.map +1 -0
- package/bin/chat.js +15 -0
- package/bin/chat.js.map +1 -0
- package/bin/contact.d.ts +8 -0
- package/bin/contact.d.ts.map +1 -0
- package/bin/contact.js +7 -0
- package/bin/contact.js.map +1 -0
- package/bin/image.d.ts +8 -0
- package/bin/image.d.ts.map +1 -0
- package/bin/image.js +7 -0
- package/bin/image.js.map +1 -0
- package/bin/index.d.ts +10 -28
- package/bin/index.d.ts.map +1 -1
- package/bin/index.js +10 -17
- package/bin/index.js.map +1 -1
- package/bin/memory.d.ts +8 -0
- package/bin/memory.d.ts.map +1 -0
- package/bin/memory.js +7 -0
- package/bin/memory.js.map +1 -0
- package/bin/skill.d.ts +10 -0
- package/bin/skill.d.ts.map +1 -0
- package/bin/skill.js +9 -0
- package/bin/skill.js.map +1 -0
- package/bin/sound.d.ts +8 -0
- package/bin/sound.d.ts.map +1 -0
- package/bin/sound.js +7 -0
- package/bin/sound.js.map +1 -0
- package/bin/task.d.ts +8 -0
- package/bin/task.d.ts.map +1 -0
- package/bin/task.js +7 -0
- package/bin/task.js.map +1 -0
- package/bin/web.d.ts +9 -0
- package/bin/web.d.ts.map +1 -0
- package/bin/web.js +8 -0
- package/bin/web.js.map +1 -0
- package/bin/workboard.d.ts +8 -0
- package/bin/workboard.d.ts.map +1 -0
- package/bin/workboard.js +7 -0
- package/bin/workboard.js.map +1 -0
- package/package.json +41 -4
- package/scripts/plugin-subpaths.test.mjs +50 -0
- package/src/chat.ts +62 -0
- package/src/contact.ts +8 -0
- package/src/image.ts +26 -0
- package/src/index.ts +10 -132
- package/src/memory.ts +34 -0
- package/src/skill.ts +17 -0
- package/src/sound.ts +18 -0
- package/src/task.ts +8 -0
- package/src/web.ts +16 -0
- package/src/workboard.ts +18 -0
- package/bin/BuiltinPlugins.d.ts +0 -49
- package/bin/BuiltinPlugins.d.ts.map +0 -1
- package/bin/BuiltinPlugins.js +0 -49
- package/bin/BuiltinPlugins.js.map +0 -1
- package/src/BuiltinPlugins.ts +0 -89
package/bin/chat.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/chat` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 汇总 ChatPlugin、运行渠道、账号管理与 Chat Access 公开能力。
|
|
6
|
+
* - 不加载其他内建 plugin 的入口模块。
|
|
7
|
+
*/
|
|
8
|
+
export { ChatPlugin } from "./chat/ChatPlugin.js";
|
|
9
|
+
export { FeishuChannel, QqChannel, TelegramChannel, } from "./chat/channels/RuntimeChannel.js";
|
|
10
|
+
export { ChatChannelAccountManager } from "./chat/accounts/ChannelAccountManager.js";
|
|
11
|
+
export { ChatAccessService, is_chat_access_channel, resolve_chat_access_scope, resolve_chat_access_scopes, } from "./chat/access/ChatAccessService.js";
|
|
12
|
+
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
13
|
+
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
14
|
+
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
15
|
+
export type { ChatChannelAccountListItem } from "./chat/types/ChannelAccount.js";
|
|
16
|
+
export type { ChatStorageCleanInput, ChatStorageCleanResult, } from "./chat/types/ChatStorage.js";
|
|
17
|
+
export type { BaseChatChannelOptions, ChatChannelEnv, FeishuChannelOptions, QqChannelOptions, TelegramChannelOptions, } from "./chat/channels/RuntimeChannel.js";
|
|
18
|
+
export type { ChatChannel, ChatPluginOptions, } from "./chat/types/ChatPluginOptions.js";
|
|
19
|
+
export type { ApproveChatAccessRequestInput, ChatAccessDecision, ChatAccessDecisionReason, ChatAccessEffect, ChatAccessGrant, ChatAccessIdentityInput, ChatAccessPrincipal, ChatAccessPrincipalView, ChatAccessRequest, ChatAccessRequestStatus, ChatAccessRequestView, ChatAccessScope, ChatAccessScopeInput, ChatAccessServiceOptions, ChatAccessSnapshot, DenyChatAccessRequestInput, ListChatAccessRequestsInput, RevokeChatAccessGrantInput, SetChatAccessPrincipalEffectInput, } from "./chat/types/ChatAccess.js";
|
|
20
|
+
//# sourceMappingURL=chat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,aAAa,EACb,SAAS,EACT,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;AAEnE,YAAY,EAAE,0BAA0B,EAAE,MAAM,gCAAgC,CAAC;AACjF,YAAY,EACV,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,6BAA6B,CAAC;AACrC,YAAY,EACV,sBAAsB,EACtB,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,WAAW,EACX,iBAAiB,GAClB,MAAM,mCAAmC,CAAC;AAC3C,YAAY,EACV,6BAA6B,EAC7B,kBAAkB,EAClB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EACf,uBAAuB,EACvB,mBAAmB,EACnB,uBAAuB,EACvB,iBAAiB,EACjB,uBAAuB,EACvB,qBAAqB,EACrB,eAAe,EACf,oBAAoB,EACpB,wBAAwB,EACxB,kBAAkB,EAClB,0BAA0B,EAC1B,2BAA2B,EAC3B,0BAA0B,EAC1B,iCAAiC,GAClC,MAAM,4BAA4B,CAAC"}
|
package/bin/chat.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/chat` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 汇总 ChatPlugin、运行渠道、账号管理与 Chat Access 公开能力。
|
|
6
|
+
* - 不加载其他内建 plugin 的入口模块。
|
|
7
|
+
*/
|
|
8
|
+
export { ChatPlugin } from "./chat/ChatPlugin.js";
|
|
9
|
+
export { FeishuChannel, QqChannel, TelegramChannel, } from "./chat/channels/RuntimeChannel.js";
|
|
10
|
+
export { ChatChannelAccountManager } from "./chat/accounts/ChannelAccountManager.js";
|
|
11
|
+
export { ChatAccessService, is_chat_access_channel, resolve_chat_access_scope, resolve_chat_access_scopes, } from "./chat/access/ChatAccessService.js";
|
|
12
|
+
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
13
|
+
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
14
|
+
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
15
|
+
//# sourceMappingURL=chat.js.map
|
package/bin/chat.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../src/chat.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,aAAa,EACb,SAAS,EACT,eAAe,GAChB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AACrF,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,GAC3B,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC"}
|
package/bin/contact.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/contact` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只导出 ContactPlugin 及其公开构造参数类型。
|
|
5
|
+
*/
|
|
6
|
+
export { ContactPlugin } from "./contact/ContactPlugin.js";
|
|
7
|
+
export type { ContactPluginOptions } from "./contact/types/ContactPluginOptions.js";
|
|
8
|
+
//# sourceMappingURL=contact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../src/contact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,YAAY,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC"}
|
package/bin/contact.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contact.js","sourceRoot":"","sources":["../src/contact.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC"}
|
package/bin/image.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/image` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 ImagePlugin 及其宿主能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
export { ImagePlugin } from "./image/ImagePlugin.js";
|
|
7
|
+
export type { ImagePluginContent, ImagePluginDefaultModel, ImagePluginDefaultModelResolverInput, ImagePluginFileContent, ImagePluginInput, ImagePluginJobCreateResult, ImagePluginJobResult, ImagePluginJobResultInput, ImagePluginJobStatus, ImagePluginModel, ImagePluginModelsResult, ImagePluginOptions, ImagePluginResolvedContent, ImagePluginResolvedInput, ImagePluginResolvedMessage, ImagePluginResult, ImagePluginTextContent, } from "./image/types/ImagePlugin.js";
|
|
8
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,oCAAoC,EACpC,sBAAsB,EACtB,gBAAgB,EAChB,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,0BAA0B,EAC1B,wBAAwB,EACxB,0BAA0B,EAC1B,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,8BAA8B,CAAC"}
|
package/bin/image.js
ADDED
package/bin/image.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../src/image.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC"}
|
package/bin/index.d.ts
CHANGED
|
@@ -3,34 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这个包专门承载 Downcity 内建 plugin 的对外消费入口。
|
|
6
|
-
* -
|
|
6
|
+
* - 本包根入口汇总具体 plugin class;按需消费应优先使用对应子路径。
|
|
7
7
|
* - 注册、目录、HTTP、CLI、action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export { SoundPlugin } from "./sound/Plugin.js";
|
|
19
|
-
export { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
20
|
-
export { TaskPlugin } from "./task/TaskPlugin.js";
|
|
21
|
-
export { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
22
|
-
export { ChatAccessService, is_chat_access_channel, resolve_chat_access_scope, resolve_chat_access_scopes, } from "./chat/access/ChatAccessService.js";
|
|
23
|
-
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
24
|
-
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
25
|
-
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
26
|
-
export type { ChatChannelAccountListItem, } from "./chat/types/ChannelAccount.js";
|
|
27
|
-
export type { ChatStorageCleanInput, ChatStorageCleanResult, } from "./chat/types/ChatStorage.js";
|
|
28
|
-
export type { BaseChatChannelOptions, ChatChannelEnv, FeishuChannelOptions, QqChannelOptions, TelegramChannelOptions, } from "./chat/channels/RuntimeChannel.js";
|
|
29
|
-
export type { ChatChannel, ChatPluginOptions, } from "./chat/types/ChatPluginOptions.js";
|
|
30
|
-
export type { ContactPluginOptions } from "./contact/types/ContactPluginOptions.js";
|
|
31
|
-
export type { TaskPluginOptions } from "./task/types/TaskPluginOptions.js";
|
|
32
|
-
export type { MemoryActionPayload, MemoryDefaults, MemoryDigestHandler, MemoryDigestHandlerInput, MemoryDigestHandlerOutput, MemoryDigestPayload, MemoryDigestResponse, MemoryPluginOptions, MemoryReadPayload, MemoryReadResponse, MemoryRememberPayload, MemoryRememberResponse, MemoryReviseHandler, MemoryReviseHandlerInput, MemoryReviseHandlerOutput, MemoryRevisePayload, MemoryReviseResponse, MemorySearchMode, MemorySearchPayload, MemorySearchResponse, MemorySearchResultItem, MemorySourceStat, MemorySourceType, MemoryStatusResponse, MemoryWikiPageDraft, } from "./memory/types/Memory.js";
|
|
33
|
-
export type { SoundPluginAsrInput, SoundPluginAsrResult, SoundPluginAsrSegment, SoundPluginCapability, SoundPluginModel, SoundPluginModelsResult, SoundPluginOptions, SoundPluginTtsInput, SoundPluginTtsResult, } from "./sound/types/SoundPlugin.js";
|
|
34
|
-
export type { ImagePluginContent, ImagePluginDefaultModel, ImagePluginDefaultModelResolverInput, ImagePluginFileContent, ImagePluginInput, ImagePluginJobCreateResult, ImagePluginJobResult, ImagePluginJobResultInput, ImagePluginJobStatus, ImagePluginModel, ImagePluginModelsResult, ImagePluginOptions, ImagePluginResolvedContent, ImagePluginResolvedInput, ImagePluginResolvedMessage, ImagePluginResult, ImagePluginTextContent, } from "./image/types/ImagePlugin.js";
|
|
35
|
-
export type { ApproveChatAccessRequestInput, ChatAccessDecision, ChatAccessDecisionReason, ChatAccessEffect, ChatAccessGrant, ChatAccessIdentityInput, ChatAccessPrincipal, ChatAccessPrincipalView, ChatAccessRequest, ChatAccessRequestStatus, ChatAccessRequestView, ChatAccessScope, ChatAccessScopeInput, ChatAccessServiceOptions, ChatAccessSnapshot, DenyChatAccessRequestInput, ListChatAccessRequestsInput, RevokeChatAccessGrantInput, SetChatAccessPrincipalEffectInput, } from "./chat/types/ChatAccess.js";
|
|
9
|
+
export * from "./chat.js";
|
|
10
|
+
export * from "./contact.js";
|
|
11
|
+
export * from "./image.js";
|
|
12
|
+
export * from "./memory.js";
|
|
13
|
+
export * from "./skill.js";
|
|
14
|
+
export * from "./sound.js";
|
|
15
|
+
export * from "./task.js";
|
|
16
|
+
export * from "./web.js";
|
|
17
|
+
export * from "./workboard.js";
|
|
36
18
|
//# sourceMappingURL=index.d.ts.map
|
package/bin/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/bin/index.js
CHANGED
|
@@ -3,23 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这个包专门承载 Downcity 内建 plugin 的对外消费入口。
|
|
6
|
-
* -
|
|
6
|
+
* - 本包根入口汇总具体 plugin class;按需消费应优先使用对应子路径。
|
|
7
7
|
* - 注册、目录、HTTP、CLI、action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
8
8
|
*/
|
|
9
|
-
export
|
|
10
|
-
export
|
|
11
|
-
export
|
|
12
|
-
export
|
|
13
|
-
export
|
|
14
|
-
export
|
|
15
|
-
export
|
|
16
|
-
export
|
|
17
|
-
export
|
|
18
|
-
export { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
19
|
-
export { TaskPlugin } from "./task/TaskPlugin.js";
|
|
20
|
-
export { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
21
|
-
export { ChatAccessService, is_chat_access_channel, resolve_chat_access_scope, resolve_chat_access_scopes, } from "./chat/access/ChatAccessService.js";
|
|
22
|
-
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
23
|
-
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
24
|
-
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
9
|
+
export * from "./chat.js";
|
|
10
|
+
export * from "./contact.js";
|
|
11
|
+
export * from "./image.js";
|
|
12
|
+
export * from "./memory.js";
|
|
13
|
+
export * from "./skill.js";
|
|
14
|
+
export * from "./sound.js";
|
|
15
|
+
export * from "./task.js";
|
|
16
|
+
export * from "./web.js";
|
|
17
|
+
export * from "./workboard.js";
|
|
25
18
|
//# sourceMappingURL=index.js.map
|
package/bin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,gBAAgB,CAAC"}
|
package/bin/memory.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/memory` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 MemoryPlugin 及其存取、检索与 Wiki 能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
export { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
7
|
+
export type { MemoryActionPayload, MemoryDefaults, MemoryDigestHandler, MemoryDigestHandlerInput, MemoryDigestHandlerOutput, MemoryDigestPayload, MemoryDigestResponse, MemoryPluginOptions, MemoryReadPayload, MemoryReadResponse, MemoryRememberPayload, MemoryRememberResponse, MemoryReviseHandler, MemoryReviseHandlerInput, MemoryReviseHandlerOutput, MemoryRevisePayload, MemoryReviseResponse, MemorySearchMode, MemorySearchPayload, MemorySearchResponse, MemorySearchResultItem, MemorySourceStat, MemorySourceType, MemoryStatusResponse, MemoryWikiPageDraft, } from "./memory/types/Memory.js";
|
|
8
|
+
//# sourceMappingURL=memory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,YAAY,EACV,mBAAmB,EACnB,cAAc,EACd,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,oBAAoB,EACpB,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,0BAA0B,CAAC"}
|
package/bin/memory.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"memory.js","sourceRoot":"","sources":["../src/memory.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC"}
|
package/bin/skill.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/skill` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 只导出 SkillPlugin,不加载其他内建 plugin 的入口模块。
|
|
6
|
+
* - 适合扩展运行时按需加载 Skill 能力,避免无关 plugin 的依赖进入 bundle。
|
|
7
|
+
*/
|
|
8
|
+
export { SkillPlugin } from "./skill/Plugin.js";
|
|
9
|
+
export type { ResolvedSkillPluginOptions, SkillPluginFindPayload, SkillPluginIgnoreRule, SkillPluginInstallPayload, SkillPluginLookupPayload, SkillPluginOptions, } from "./skill/types/SkillPlugin.js";
|
|
10
|
+
//# sourceMappingURL=skill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.d.ts","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,kBAAkB,GACnB,MAAM,8BAA8B,CAAC"}
|
package/bin/skill.js
ADDED
package/bin/skill.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skill.js","sourceRoot":"","sources":["../src/skill.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/bin/sound.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/sound` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 SoundPlugin 及其模型、ASR、TTS 宿主能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
export { SoundPlugin } from "./sound/Plugin.js";
|
|
7
|
+
export type { SoundPluginAsrInput, SoundPluginAsrResult, SoundPluginAsrSegment, SoundPluginCapability, SoundPluginModel, SoundPluginModelsResult, SoundPluginOptions, SoundPluginTtsInput, SoundPluginTtsResult, } from "./sound/types/SoundPlugin.js";
|
|
8
|
+
//# sourceMappingURL=sound.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sound.d.ts","sourceRoot":"","sources":["../src/sound.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EACV,mBAAmB,EACnB,oBAAoB,EACpB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,8BAA8B,CAAC"}
|
package/bin/sound.js
ADDED
package/bin/sound.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sound.js","sourceRoot":"","sources":["../src/sound.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/bin/task.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.d.ts","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,YAAY,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC"}
|
package/bin/task.js
ADDED
package/bin/task.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"task.js","sourceRoot":"","sources":["../src/task.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
package/bin/web.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/web` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 WebPlugin 及其安装指引 action 协议。
|
|
5
|
+
*/
|
|
6
|
+
export { WebPlugin } from "./web/Plugin.js";
|
|
7
|
+
export { WEB_PLUGIN_ACTIONS, } from "./web/types/WebPlugin.js";
|
|
8
|
+
export type { WebPluginInstallInstructions, WebPluginInstallPayload, WebPluginInstallScope, WebPluginInstallTarget, } from "./web/types/WebPlugin.js";
|
|
9
|
+
//# sourceMappingURL=web.d.ts.map
|
package/bin/web.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.d.ts","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EACV,4BAA4B,EAC5B,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,0BAA0B,CAAC"}
|
package/bin/web.js
ADDED
package/bin/web.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.js","sourceRoot":"","sources":["../src/web.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EACL,kBAAkB,GACnB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/workboard` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 WorkboardPlugin 及其公开快照协议类型。
|
|
5
|
+
*/
|
|
6
|
+
export { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
7
|
+
export type { WorkboardActivityItem, WorkboardActivityKind, WorkboardActivityStatus, WorkboardAgentSummary, WorkboardSignalItem, WorkboardSignalTone, WorkboardSnapshot, WorkboardSnapshotResponse, WorkboardSummary, } from "./workboard/types/Workboard.js";
|
|
8
|
+
//# sourceMappingURL=workboard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workboard.d.ts","sourceRoot":"","sources":["../src/workboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,YAAY,EACV,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,qBAAqB,EACrB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,GACjB,MAAM,gCAAgC,CAAC"}
|
package/bin/workboard.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workboard.js","sourceRoot":"","sources":["../src/workboard.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,19 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@downcity/plugins",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.212",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Downcity 内建 plugin 集合包",
|
|
6
6
|
"main": "./bin/index.js",
|
|
7
7
|
"types": "./bin/index.d.ts",
|
|
8
8
|
"exports": {
|
|
9
9
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
10
|
+
"types": "./bin/index.d.ts",
|
|
11
|
+
"import": "./bin/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./chat": {
|
|
14
|
+
"types": "./bin/chat.d.ts",
|
|
15
|
+
"import": "./bin/chat.js"
|
|
16
|
+
},
|
|
17
|
+
"./contact": {
|
|
18
|
+
"types": "./bin/contact.d.ts",
|
|
19
|
+
"import": "./bin/contact.js"
|
|
20
|
+
},
|
|
21
|
+
"./image": {
|
|
22
|
+
"types": "./bin/image.d.ts",
|
|
23
|
+
"import": "./bin/image.js"
|
|
24
|
+
},
|
|
25
|
+
"./memory": {
|
|
26
|
+
"types": "./bin/memory.d.ts",
|
|
27
|
+
"import": "./bin/memory.js"
|
|
28
|
+
},
|
|
29
|
+
"./skill": {
|
|
30
|
+
"types": "./bin/skill.d.ts",
|
|
31
|
+
"import": "./bin/skill.js"
|
|
32
|
+
},
|
|
33
|
+
"./sound": {
|
|
34
|
+
"types": "./bin/sound.d.ts",
|
|
35
|
+
"import": "./bin/sound.js"
|
|
36
|
+
},
|
|
37
|
+
"./task": {
|
|
38
|
+
"types": "./bin/task.d.ts",
|
|
39
|
+
"import": "./bin/task.js"
|
|
40
|
+
},
|
|
41
|
+
"./web": {
|
|
42
|
+
"types": "./bin/web.d.ts",
|
|
43
|
+
"import": "./bin/web.js"
|
|
44
|
+
},
|
|
45
|
+
"./workboard": {
|
|
46
|
+
"types": "./bin/workboard.d.ts",
|
|
47
|
+
"import": "./bin/workboard.js"
|
|
12
48
|
}
|
|
13
49
|
},
|
|
14
50
|
"dependencies": {
|
|
15
51
|
"@downcity/agent": "^1.1.281",
|
|
16
|
-
"@downcity/shell": "^0.1.
|
|
52
|
+
"@downcity/shell": "^0.1.133",
|
|
17
53
|
"ai": "^6.0.193",
|
|
18
54
|
"better-sqlite3": "^12.10.0",
|
|
19
55
|
"commander": "^15.0.0",
|
|
@@ -41,6 +77,7 @@
|
|
|
41
77
|
"test:chat-access": "pnpm build && node --test scripts/chat-access.test.mjs",
|
|
42
78
|
"test:chat-config": "pnpm build && node --test scripts/chat-channel-config.test.mjs",
|
|
43
79
|
"test:chat-storage": "pnpm build && node --test scripts/chat-storage.test.mjs",
|
|
80
|
+
"test:exports": "pnpm build && node --test scripts/plugin-subpaths.test.mjs",
|
|
44
81
|
"test:skill": "pnpm build && node --test scripts/skill-plugin.test.mjs",
|
|
45
82
|
"test:sound": "pnpm build && node --test scripts/sound-plugin.test.mjs",
|
|
46
83
|
"test:web": "pnpm build && node --test scripts/web-plugin.test.mjs"
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 内建 plugin 独立子路径入口回归测试。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 每个子路径必须通过 package exports 独立解析并暴露对应 plugin class。
|
|
6
|
+
* - 子路径入口不能回流根入口或已删除的内建集合工厂。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import assert from "node:assert/strict";
|
|
10
|
+
import fs from "node:fs/promises";
|
|
11
|
+
import test from "node:test";
|
|
12
|
+
|
|
13
|
+
const plugin_entries = [
|
|
14
|
+
["chat", "ChatPlugin"],
|
|
15
|
+
["contact", "ContactPlugin"],
|
|
16
|
+
["image", "ImagePlugin"],
|
|
17
|
+
["memory", "MemoryPlugin"],
|
|
18
|
+
["skill", "SkillPlugin"],
|
|
19
|
+
["sound", "SoundPlugin"],
|
|
20
|
+
["task", "TaskPlugin"],
|
|
21
|
+
["web", "WebPlugin"],
|
|
22
|
+
["workboard", "WorkboardPlugin"],
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
test("所有内建 plugin 子路径均可独立导入", async () => {
|
|
26
|
+
for (const [plugin_name, class_name] of plugin_entries) {
|
|
27
|
+
const plugin_module = await import(`@downcity/plugins/${plugin_name}`);
|
|
28
|
+
assert.equal(
|
|
29
|
+
typeof plugin_module[class_name],
|
|
30
|
+
"function",
|
|
31
|
+
`${plugin_name} 应导出 ${class_name}`,
|
|
32
|
+
);
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
test("内建 plugin 子路径不加载根入口或集合工厂", async () => {
|
|
37
|
+
for (const [plugin_name] of plugin_entries) {
|
|
38
|
+
const entry_source = await fs.readFile(
|
|
39
|
+
new URL(`../bin/${plugin_name}.js`, import.meta.url),
|
|
40
|
+
"utf8",
|
|
41
|
+
);
|
|
42
|
+
assert.doesNotMatch(entry_source, /BuiltinPlugins|from ["']\.\/index\.js/);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
test("根入口不再导出默认内建集合工厂", async () => {
|
|
47
|
+
const plugin_module = await import("@downcity/plugins");
|
|
48
|
+
assert.equal("createBuiltinPlugins" in plugin_module, false);
|
|
49
|
+
assert.equal("BUILTIN_PLUGIN_CLASSES" in plugin_module, false);
|
|
50
|
+
});
|
package/src/chat.ts
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/chat` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 汇总 ChatPlugin、运行渠道、账号管理与 Chat Access 公开能力。
|
|
6
|
+
* - 不加载其他内建 plugin 的入口模块。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { ChatPlugin } from "./chat/ChatPlugin.js";
|
|
10
|
+
export {
|
|
11
|
+
FeishuChannel,
|
|
12
|
+
QqChannel,
|
|
13
|
+
TelegramChannel,
|
|
14
|
+
} from "./chat/channels/RuntimeChannel.js";
|
|
15
|
+
export { ChatChannelAccountManager } from "./chat/accounts/ChannelAccountManager.js";
|
|
16
|
+
export {
|
|
17
|
+
ChatAccessService,
|
|
18
|
+
is_chat_access_channel,
|
|
19
|
+
resolve_chat_access_scope,
|
|
20
|
+
resolve_chat_access_scopes,
|
|
21
|
+
} from "./chat/access/ChatAccessService.js";
|
|
22
|
+
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
23
|
+
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
24
|
+
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
25
|
+
|
|
26
|
+
export type { ChatChannelAccountListItem } from "./chat/types/ChannelAccount.js";
|
|
27
|
+
export type {
|
|
28
|
+
ChatStorageCleanInput,
|
|
29
|
+
ChatStorageCleanResult,
|
|
30
|
+
} from "./chat/types/ChatStorage.js";
|
|
31
|
+
export type {
|
|
32
|
+
BaseChatChannelOptions,
|
|
33
|
+
ChatChannelEnv,
|
|
34
|
+
FeishuChannelOptions,
|
|
35
|
+
QqChannelOptions,
|
|
36
|
+
TelegramChannelOptions,
|
|
37
|
+
} from "./chat/channels/RuntimeChannel.js";
|
|
38
|
+
export type {
|
|
39
|
+
ChatChannel,
|
|
40
|
+
ChatPluginOptions,
|
|
41
|
+
} from "./chat/types/ChatPluginOptions.js";
|
|
42
|
+
export type {
|
|
43
|
+
ApproveChatAccessRequestInput,
|
|
44
|
+
ChatAccessDecision,
|
|
45
|
+
ChatAccessDecisionReason,
|
|
46
|
+
ChatAccessEffect,
|
|
47
|
+
ChatAccessGrant,
|
|
48
|
+
ChatAccessIdentityInput,
|
|
49
|
+
ChatAccessPrincipal,
|
|
50
|
+
ChatAccessPrincipalView,
|
|
51
|
+
ChatAccessRequest,
|
|
52
|
+
ChatAccessRequestStatus,
|
|
53
|
+
ChatAccessRequestView,
|
|
54
|
+
ChatAccessScope,
|
|
55
|
+
ChatAccessScopeInput,
|
|
56
|
+
ChatAccessServiceOptions,
|
|
57
|
+
ChatAccessSnapshot,
|
|
58
|
+
DenyChatAccessRequestInput,
|
|
59
|
+
ListChatAccessRequestsInput,
|
|
60
|
+
RevokeChatAccessGrantInput,
|
|
61
|
+
SetChatAccessPrincipalEffectInput,
|
|
62
|
+
} from "./chat/types/ChatAccess.js";
|
package/src/contact.ts
ADDED
package/src/image.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/image` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 ImagePlugin 及其宿主能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { ImagePlugin } from "./image/ImagePlugin.js";
|
|
8
|
+
export type {
|
|
9
|
+
ImagePluginContent,
|
|
10
|
+
ImagePluginDefaultModel,
|
|
11
|
+
ImagePluginDefaultModelResolverInput,
|
|
12
|
+
ImagePluginFileContent,
|
|
13
|
+
ImagePluginInput,
|
|
14
|
+
ImagePluginJobCreateResult,
|
|
15
|
+
ImagePluginJobResult,
|
|
16
|
+
ImagePluginJobResultInput,
|
|
17
|
+
ImagePluginJobStatus,
|
|
18
|
+
ImagePluginModel,
|
|
19
|
+
ImagePluginModelsResult,
|
|
20
|
+
ImagePluginOptions,
|
|
21
|
+
ImagePluginResolvedContent,
|
|
22
|
+
ImagePluginResolvedInput,
|
|
23
|
+
ImagePluginResolvedMessage,
|
|
24
|
+
ImagePluginResult,
|
|
25
|
+
ImagePluginTextContent,
|
|
26
|
+
} from "./image/types/ImagePlugin.js";
|
package/src/index.ts
CHANGED
|
@@ -3,138 +3,16 @@
|
|
|
3
3
|
*
|
|
4
4
|
* 关键点(中文)
|
|
5
5
|
* - 这个包专门承载 Downcity 内建 plugin 的对外消费入口。
|
|
6
|
-
* -
|
|
6
|
+
* - 本包根入口汇总具体 plugin class;按需消费应优先使用对应子路径。
|
|
7
7
|
* - 注册、目录、HTTP、CLI、action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export
|
|
19
|
-
export { ContactPlugin } from "./contact/ContactPlugin.js";
|
|
20
|
-
export {
|
|
21
|
-
FeishuChannel,
|
|
22
|
-
QqChannel,
|
|
23
|
-
TelegramChannel,
|
|
24
|
-
} from "./chat/channels/RuntimeChannel.js";
|
|
25
|
-
export { ImagePlugin } from "./image/ImagePlugin.js";
|
|
26
|
-
export { ChatChannelAccountManager } from "./chat/accounts/ChannelAccountManager.js";
|
|
27
|
-
export { SkillPlugin } from "./skill/Plugin.js";
|
|
28
|
-
export { WebPlugin } from "./web/Plugin.js";
|
|
29
|
-
export { SoundPlugin } from "./sound/Plugin.js";
|
|
30
|
-
export { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
31
|
-
export { TaskPlugin } from "./task/TaskPlugin.js";
|
|
32
|
-
export { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
33
|
-
export {
|
|
34
|
-
ChatAccessService,
|
|
35
|
-
is_chat_access_channel,
|
|
36
|
-
resolve_chat_access_scope,
|
|
37
|
-
resolve_chat_access_scopes,
|
|
38
|
-
} from "./chat/access/ChatAccessService.js";
|
|
39
|
-
export { get_chat_access_db_path } from "./chat/access/ChatAccessStore.js";
|
|
40
|
-
export { CHAT_ACCESS_ACTIONS } from "./chat/types/ChatAccess.js";
|
|
41
|
-
export { clean_chat_storage } from "./chat/runtime/ChatStorage.js";
|
|
42
|
-
|
|
43
|
-
export type {
|
|
44
|
-
ChatChannelAccountListItem,
|
|
45
|
-
} from "./chat/types/ChannelAccount.js";
|
|
46
|
-
export type {
|
|
47
|
-
ChatStorageCleanInput,
|
|
48
|
-
ChatStorageCleanResult,
|
|
49
|
-
} from "./chat/types/ChatStorage.js";
|
|
50
|
-
export type {
|
|
51
|
-
BaseChatChannelOptions,
|
|
52
|
-
ChatChannelEnv,
|
|
53
|
-
FeishuChannelOptions,
|
|
54
|
-
QqChannelOptions,
|
|
55
|
-
TelegramChannelOptions,
|
|
56
|
-
} from "./chat/channels/RuntimeChannel.js";
|
|
57
|
-
export type {
|
|
58
|
-
ChatChannel,
|
|
59
|
-
ChatPluginOptions,
|
|
60
|
-
} from "./chat/types/ChatPluginOptions.js";
|
|
61
|
-
export type { ContactPluginOptions } from "./contact/types/ContactPluginOptions.js";
|
|
62
|
-
export type { TaskPluginOptions } from "./task/types/TaskPluginOptions.js";
|
|
63
|
-
export type {
|
|
64
|
-
MemoryActionPayload,
|
|
65
|
-
MemoryDefaults,
|
|
66
|
-
MemoryDigestHandler,
|
|
67
|
-
MemoryDigestHandlerInput,
|
|
68
|
-
MemoryDigestHandlerOutput,
|
|
69
|
-
MemoryDigestPayload,
|
|
70
|
-
MemoryDigestResponse,
|
|
71
|
-
MemoryPluginOptions,
|
|
72
|
-
MemoryReadPayload,
|
|
73
|
-
MemoryReadResponse,
|
|
74
|
-
MemoryRememberPayload,
|
|
75
|
-
MemoryRememberResponse,
|
|
76
|
-
MemoryReviseHandler,
|
|
77
|
-
MemoryReviseHandlerInput,
|
|
78
|
-
MemoryReviseHandlerOutput,
|
|
79
|
-
MemoryRevisePayload,
|
|
80
|
-
MemoryReviseResponse,
|
|
81
|
-
MemorySearchMode,
|
|
82
|
-
MemorySearchPayload,
|
|
83
|
-
MemorySearchResponse,
|
|
84
|
-
MemorySearchResultItem,
|
|
85
|
-
MemorySourceStat,
|
|
86
|
-
MemorySourceType,
|
|
87
|
-
MemoryStatusResponse,
|
|
88
|
-
MemoryWikiPageDraft,
|
|
89
|
-
} from "./memory/types/Memory.js";
|
|
90
|
-
export type {
|
|
91
|
-
SoundPluginAsrInput,
|
|
92
|
-
SoundPluginAsrResult,
|
|
93
|
-
SoundPluginAsrSegment,
|
|
94
|
-
SoundPluginCapability,
|
|
95
|
-
SoundPluginModel,
|
|
96
|
-
SoundPluginModelsResult,
|
|
97
|
-
SoundPluginOptions,
|
|
98
|
-
SoundPluginTtsInput,
|
|
99
|
-
SoundPluginTtsResult,
|
|
100
|
-
} from "./sound/types/SoundPlugin.js";
|
|
101
|
-
export type {
|
|
102
|
-
ImagePluginContent,
|
|
103
|
-
ImagePluginDefaultModel,
|
|
104
|
-
ImagePluginDefaultModelResolverInput,
|
|
105
|
-
ImagePluginFileContent,
|
|
106
|
-
ImagePluginInput,
|
|
107
|
-
ImagePluginJobCreateResult,
|
|
108
|
-
ImagePluginJobResult,
|
|
109
|
-
ImagePluginJobResultInput,
|
|
110
|
-
ImagePluginJobStatus,
|
|
111
|
-
ImagePluginModel,
|
|
112
|
-
ImagePluginModelsResult,
|
|
113
|
-
ImagePluginOptions,
|
|
114
|
-
ImagePluginResolvedContent,
|
|
115
|
-
ImagePluginResolvedInput,
|
|
116
|
-
ImagePluginResolvedMessage,
|
|
117
|
-
ImagePluginResult,
|
|
118
|
-
ImagePluginTextContent,
|
|
119
|
-
} from "./image/types/ImagePlugin.js";
|
|
120
|
-
export type {
|
|
121
|
-
ApproveChatAccessRequestInput,
|
|
122
|
-
ChatAccessDecision,
|
|
123
|
-
ChatAccessDecisionReason,
|
|
124
|
-
ChatAccessEffect,
|
|
125
|
-
ChatAccessGrant,
|
|
126
|
-
ChatAccessIdentityInput,
|
|
127
|
-
ChatAccessPrincipal,
|
|
128
|
-
ChatAccessPrincipalView,
|
|
129
|
-
ChatAccessRequest,
|
|
130
|
-
ChatAccessRequestStatus,
|
|
131
|
-
ChatAccessRequestView,
|
|
132
|
-
ChatAccessScope,
|
|
133
|
-
ChatAccessScopeInput,
|
|
134
|
-
ChatAccessServiceOptions,
|
|
135
|
-
ChatAccessSnapshot,
|
|
136
|
-
DenyChatAccessRequestInput,
|
|
137
|
-
ListChatAccessRequestsInput,
|
|
138
|
-
RevokeChatAccessGrantInput,
|
|
139
|
-
SetChatAccessPrincipalEffectInput,
|
|
140
|
-
} from "./chat/types/ChatAccess.js";
|
|
10
|
+
export * from "./chat.js";
|
|
11
|
+
export * from "./contact.js";
|
|
12
|
+
export * from "./image.js";
|
|
13
|
+
export * from "./memory.js";
|
|
14
|
+
export * from "./skill.js";
|
|
15
|
+
export * from "./sound.js";
|
|
16
|
+
export * from "./task.js";
|
|
17
|
+
export * from "./web.js";
|
|
18
|
+
export * from "./workboard.js";
|
package/src/memory.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/memory` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 MemoryPlugin 及其存取、检索与 Wiki 能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
8
|
+
export type {
|
|
9
|
+
MemoryActionPayload,
|
|
10
|
+
MemoryDefaults,
|
|
11
|
+
MemoryDigestHandler,
|
|
12
|
+
MemoryDigestHandlerInput,
|
|
13
|
+
MemoryDigestHandlerOutput,
|
|
14
|
+
MemoryDigestPayload,
|
|
15
|
+
MemoryDigestResponse,
|
|
16
|
+
MemoryPluginOptions,
|
|
17
|
+
MemoryReadPayload,
|
|
18
|
+
MemoryReadResponse,
|
|
19
|
+
MemoryRememberPayload,
|
|
20
|
+
MemoryRememberResponse,
|
|
21
|
+
MemoryReviseHandler,
|
|
22
|
+
MemoryReviseHandlerInput,
|
|
23
|
+
MemoryReviseHandlerOutput,
|
|
24
|
+
MemoryRevisePayload,
|
|
25
|
+
MemoryReviseResponse,
|
|
26
|
+
MemorySearchMode,
|
|
27
|
+
MemorySearchPayload,
|
|
28
|
+
MemorySearchResponse,
|
|
29
|
+
MemorySearchResultItem,
|
|
30
|
+
MemorySourceStat,
|
|
31
|
+
MemorySourceType,
|
|
32
|
+
MemoryStatusResponse,
|
|
33
|
+
MemoryWikiPageDraft,
|
|
34
|
+
} from "./memory/types/Memory.js";
|
package/src/skill.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/skill` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文)
|
|
5
|
+
* - 只导出 SkillPlugin,不加载其他内建 plugin 的入口模块。
|
|
6
|
+
* - 适合扩展运行时按需加载 Skill 能力,避免无关 plugin 的依赖进入 bundle。
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export { SkillPlugin } from "./skill/Plugin.js";
|
|
10
|
+
export type {
|
|
11
|
+
ResolvedSkillPluginOptions,
|
|
12
|
+
SkillPluginFindPayload,
|
|
13
|
+
SkillPluginIgnoreRule,
|
|
14
|
+
SkillPluginInstallPayload,
|
|
15
|
+
SkillPluginLookupPayload,
|
|
16
|
+
SkillPluginOptions,
|
|
17
|
+
} from "./skill/types/SkillPlugin.js";
|
package/src/sound.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/sound` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 SoundPlugin 及其模型、ASR、TTS 宿主能力协议类型。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { SoundPlugin } from "./sound/Plugin.js";
|
|
8
|
+
export type {
|
|
9
|
+
SoundPluginAsrInput,
|
|
10
|
+
SoundPluginAsrResult,
|
|
11
|
+
SoundPluginAsrSegment,
|
|
12
|
+
SoundPluginCapability,
|
|
13
|
+
SoundPluginModel,
|
|
14
|
+
SoundPluginModelsResult,
|
|
15
|
+
SoundPluginOptions,
|
|
16
|
+
SoundPluginTtsInput,
|
|
17
|
+
SoundPluginTtsResult,
|
|
18
|
+
} from "./sound/types/SoundPlugin.js";
|
package/src/task.ts
ADDED
package/src/web.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/web` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 WebPlugin 及其安装指引 action 协议。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { WebPlugin } from "./web/Plugin.js";
|
|
8
|
+
export {
|
|
9
|
+
WEB_PLUGIN_ACTIONS,
|
|
10
|
+
} from "./web/types/WebPlugin.js";
|
|
11
|
+
export type {
|
|
12
|
+
WebPluginInstallInstructions,
|
|
13
|
+
WebPluginInstallPayload,
|
|
14
|
+
WebPluginInstallScope,
|
|
15
|
+
WebPluginInstallTarget,
|
|
16
|
+
} from "./web/types/WebPlugin.js";
|
package/src/workboard.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@downcity/plugins/workboard` 独立公开入口。
|
|
3
|
+
*
|
|
4
|
+
* 关键点(中文):只汇总 WorkboardPlugin 及其公开快照协议类型。
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
8
|
+
export type {
|
|
9
|
+
WorkboardActivityItem,
|
|
10
|
+
WorkboardActivityKind,
|
|
11
|
+
WorkboardActivityStatus,
|
|
12
|
+
WorkboardAgentSummary,
|
|
13
|
+
WorkboardSignalItem,
|
|
14
|
+
WorkboardSignalTone,
|
|
15
|
+
WorkboardSnapshot,
|
|
16
|
+
WorkboardSnapshotResponse,
|
|
17
|
+
WorkboardSummary,
|
|
18
|
+
} from "./workboard/types/Workboard.js";
|
package/bin/BuiltinPlugins.d.ts
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BuiltinPlugins:Downcity 内建 plugin 实例工厂。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 本包只提供具体内建 plugin class 和默认集合创建能力。
|
|
6
|
-
* - 注册、目录视图、HTTP 装配、CLI action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
7
|
-
* - 调用方需要完整内建集合时,显式调用 `createBuiltinPlugins()` 并传给 Agent 或通用 helper。
|
|
8
|
-
*/
|
|
9
|
-
import type { BasePlugin } from "@downcity/agent";
|
|
10
|
-
import type { ImagePluginOptions } from "./image/types/ImagePlugin.js";
|
|
11
|
-
import type { SoundPluginOptions } from "./sound/types/SoundPlugin.js";
|
|
12
|
-
import type { TaskPluginOptions } from "./task/types/TaskPluginOptions.js";
|
|
13
|
-
import type { MemoryPluginOptions } from "./memory/types/Memory.js";
|
|
14
|
-
/**
|
|
15
|
-
* 内建 plugin class 构造器。
|
|
16
|
-
*/
|
|
17
|
-
export type BuiltinPluginClass<T extends BasePlugin = BasePlugin> = new () => T;
|
|
18
|
-
/**
|
|
19
|
-
* 可直接无参创建的内建 plugin classes。
|
|
20
|
-
*
|
|
21
|
-
* 关键点(中文):image / sound 需要宿主注入 City AI 能力,不能放入无参 class 列表。
|
|
22
|
-
*/
|
|
23
|
-
export declare const BUILTIN_PLUGIN_CLASSES: BuiltinPluginClass[];
|
|
24
|
-
/**
|
|
25
|
-
* 内建 plugin 工厂参数。
|
|
26
|
-
*/
|
|
27
|
-
export interface BuiltinPluginOptions {
|
|
28
|
-
/**
|
|
29
|
-
* 图片生成 plugin 的 City AI 能力注入。
|
|
30
|
-
*/
|
|
31
|
-
image?: ImagePluginOptions;
|
|
32
|
-
/**
|
|
33
|
-
* 统一语音 plugin 的 FED 模型目录、ASR 与 TTS 能力注入。
|
|
34
|
-
*/
|
|
35
|
-
sound?: SoundPluginOptions;
|
|
36
|
-
/**
|
|
37
|
-
* task plugin 的定时任务运行参数。
|
|
38
|
-
*/
|
|
39
|
-
task?: TaskPluginOptions;
|
|
40
|
-
/**
|
|
41
|
-
* memory plugin 的 LLM Wiki 能力注入。
|
|
42
|
-
*/
|
|
43
|
-
memory?: MemoryPluginOptions;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* 创建完整内建 plugin 实例集合。
|
|
47
|
-
*/
|
|
48
|
-
export declare function createBuiltinPlugins(options?: BuiltinPluginOptions): BasePlugin[];
|
|
49
|
-
//# sourceMappingURL=BuiltinPlugins.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuiltinPlugins.d.ts","sourceRoot":"","sources":["../src/BuiltinPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAUlD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAEpE;;GAEG;AACH,MAAM,MAAM,kBAAkB,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI,UAAU,CAAC,CAAC;AAEhF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,EAQtD,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAE3B;;OAEG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAE3B;;OAEG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,mBAAmB,CAAC;CAE9B;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,GAAE,oBAAyB,GAAG,UAAU,EAAE,CAerF"}
|
package/bin/BuiltinPlugins.js
DELETED
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BuiltinPlugins:Downcity 内建 plugin 实例工厂。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 本包只提供具体内建 plugin class 和默认集合创建能力。
|
|
6
|
-
* - 注册、目录视图、HTTP 装配、CLI action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
7
|
-
* - 调用方需要完整内建集合时,显式调用 `createBuiltinPlugins()` 并传给 Agent 或通用 helper。
|
|
8
|
-
*/
|
|
9
|
-
import { SkillPlugin } from "./skill/Plugin.js";
|
|
10
|
-
import { WebPlugin } from "./web/Plugin.js";
|
|
11
|
-
import { WorkboardPlugin } from "./workboard/Plugin.js";
|
|
12
|
-
import { ChatPlugin } from "./chat/ChatPlugin.js";
|
|
13
|
-
import { ContactPlugin } from "./contact/ContactPlugin.js";
|
|
14
|
-
import { TaskPlugin } from "./task/TaskPlugin.js";
|
|
15
|
-
import { MemoryPlugin } from "./memory/MemoryPlugin.js";
|
|
16
|
-
import { ImagePlugin } from "./image/ImagePlugin.js";
|
|
17
|
-
import { SoundPlugin } from "./sound/Plugin.js";
|
|
18
|
-
/**
|
|
19
|
-
* 可直接无参创建的内建 plugin classes。
|
|
20
|
-
*
|
|
21
|
-
* 关键点(中文):image / sound 需要宿主注入 City AI 能力,不能放入无参 class 列表。
|
|
22
|
-
*/
|
|
23
|
-
export const BUILTIN_PLUGIN_CLASSES = [
|
|
24
|
-
SkillPlugin,
|
|
25
|
-
WebPlugin,
|
|
26
|
-
WorkboardPlugin,
|
|
27
|
-
ChatPlugin,
|
|
28
|
-
ContactPlugin,
|
|
29
|
-
TaskPlugin,
|
|
30
|
-
MemoryPlugin,
|
|
31
|
-
];
|
|
32
|
-
/**
|
|
33
|
-
* 创建完整内建 plugin 实例集合。
|
|
34
|
-
*/
|
|
35
|
-
export function createBuiltinPlugins(options = {}) {
|
|
36
|
-
const plugins = BUILTIN_PLUGIN_CLASSES.map((PluginClass) => PluginClass === TaskPlugin
|
|
37
|
-
? new TaskPlugin(options.task)
|
|
38
|
-
: PluginClass === MemoryPlugin
|
|
39
|
-
? new MemoryPlugin(options.memory)
|
|
40
|
-
: new PluginClass());
|
|
41
|
-
if (options.image?.image_create && options.image?.image_result) {
|
|
42
|
-
plugins.push(new ImagePlugin(options.image));
|
|
43
|
-
}
|
|
44
|
-
if (options.sound) {
|
|
45
|
-
plugins.push(new SoundPlugin(options.sound));
|
|
46
|
-
}
|
|
47
|
-
return plugins;
|
|
48
|
-
}
|
|
49
|
-
//# sourceMappingURL=BuiltinPlugins.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BuiltinPlugins.js","sourceRoot":"","sources":["../src/BuiltinPlugins.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAWhD;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAyB;IAC1D,WAAW;IACX,SAAS;IACT,eAAe;IACf,UAAU;IACV,aAAa;IACb,UAAU;IACV,YAAY;CACb,CAAC;AA4BF;;GAEG;AACH,MAAM,UAAU,oBAAoB,CAAC,UAAgC,EAAE;IACrE,MAAM,OAAO,GAAG,sBAAsB,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,EAAE,CACzD,WAAW,KAAK,UAAU;QACxB,CAAC,CAAC,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC;QAC9B,CAAC,CAAC,WAAW,KAAK,YAAY;YAC5B,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,CAAC;YACpC,CAAC,CAAC,IAAI,WAAW,EAAE,CACtB,CAAC;IACF,IAAI,OAAO,CAAC,KAAK,EAAE,YAAY,IAAI,OAAO,CAAC,KAAK,EAAE,YAAY,EAAE,CAAC;QAC/D,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,CAAC;QAClB,OAAO,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;IAC/C,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/src/BuiltinPlugins.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* BuiltinPlugins:Downcity 内建 plugin 实例工厂。
|
|
3
|
-
*
|
|
4
|
-
* 关键点(中文)
|
|
5
|
-
* - 本包只提供具体内建 plugin class 和默认集合创建能力。
|
|
6
|
-
* - 注册、目录视图、HTTP 装配、CLI action 执行都由 `@downcity/agent` 的通用能力处理。
|
|
7
|
-
* - 调用方需要完整内建集合时,显式调用 `createBuiltinPlugins()` 并传给 Agent 或通用 helper。
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import type { BasePlugin } from "@downcity/agent";
|
|
11
|
-
import { SkillPlugin } from "@/skill/Plugin.js";
|
|
12
|
-
import { WebPlugin } from "@/web/Plugin.js";
|
|
13
|
-
import { WorkboardPlugin } from "@/workboard/Plugin.js";
|
|
14
|
-
import { ChatPlugin } from "@/chat/ChatPlugin.js";
|
|
15
|
-
import { ContactPlugin } from "@/contact/ContactPlugin.js";
|
|
16
|
-
import { TaskPlugin } from "@/task/TaskPlugin.js";
|
|
17
|
-
import { MemoryPlugin } from "@/memory/MemoryPlugin.js";
|
|
18
|
-
import { ImagePlugin } from "@/image/ImagePlugin.js";
|
|
19
|
-
import { SoundPlugin } from "@/sound/Plugin.js";
|
|
20
|
-
import type { ImagePluginOptions } from "@/image/types/ImagePlugin.js";
|
|
21
|
-
import type { SoundPluginOptions } from "@/sound/types/SoundPlugin.js";
|
|
22
|
-
import type { TaskPluginOptions } from "@/task/types/TaskPluginOptions.js";
|
|
23
|
-
import type { MemoryPluginOptions } from "@/memory/types/Memory.js";
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 内建 plugin class 构造器。
|
|
27
|
-
*/
|
|
28
|
-
export type BuiltinPluginClass<T extends BasePlugin = BasePlugin> = new () => T;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 可直接无参创建的内建 plugin classes。
|
|
32
|
-
*
|
|
33
|
-
* 关键点(中文):image / sound 需要宿主注入 City AI 能力,不能放入无参 class 列表。
|
|
34
|
-
*/
|
|
35
|
-
export const BUILTIN_PLUGIN_CLASSES: BuiltinPluginClass[] = [
|
|
36
|
-
SkillPlugin,
|
|
37
|
-
WebPlugin,
|
|
38
|
-
WorkboardPlugin,
|
|
39
|
-
ChatPlugin,
|
|
40
|
-
ContactPlugin,
|
|
41
|
-
TaskPlugin,
|
|
42
|
-
MemoryPlugin,
|
|
43
|
-
];
|
|
44
|
-
|
|
45
|
-
/**
|
|
46
|
-
* 内建 plugin 工厂参数。
|
|
47
|
-
*/
|
|
48
|
-
export interface BuiltinPluginOptions {
|
|
49
|
-
/**
|
|
50
|
-
* 图片生成 plugin 的 City AI 能力注入。
|
|
51
|
-
*/
|
|
52
|
-
image?: ImagePluginOptions;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* 统一语音 plugin 的 FED 模型目录、ASR 与 TTS 能力注入。
|
|
56
|
-
*/
|
|
57
|
-
sound?: SoundPluginOptions;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* task plugin 的定时任务运行参数。
|
|
61
|
-
*/
|
|
62
|
-
task?: TaskPluginOptions;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* memory plugin 的 LLM Wiki 能力注入。
|
|
66
|
-
*/
|
|
67
|
-
memory?: MemoryPluginOptions;
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* 创建完整内建 plugin 实例集合。
|
|
73
|
-
*/
|
|
74
|
-
export function createBuiltinPlugins(options: BuiltinPluginOptions = {}): BasePlugin[] {
|
|
75
|
-
const plugins = BUILTIN_PLUGIN_CLASSES.map((PluginClass) =>
|
|
76
|
-
PluginClass === TaskPlugin
|
|
77
|
-
? new TaskPlugin(options.task)
|
|
78
|
-
: PluginClass === MemoryPlugin
|
|
79
|
-
? new MemoryPlugin(options.memory)
|
|
80
|
-
: new PluginClass(),
|
|
81
|
-
);
|
|
82
|
-
if (options.image?.image_create && options.image?.image_result) {
|
|
83
|
-
plugins.push(new ImagePlugin(options.image));
|
|
84
|
-
}
|
|
85
|
-
if (options.sound) {
|
|
86
|
-
plugins.push(new SoundPlugin(options.sound));
|
|
87
|
-
}
|
|
88
|
-
return plugins;
|
|
89
|
-
}
|