@vetta-org/plugin-sdk 0.0.2 → 0.0.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/index.d.ts +594 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { ComponentType, ReactNode } from "react";
|
|
|
7
7
|
* 否则宿主回传的 scenario 与此 union 不一致会触发编译错误(即为期望的漂移护栏)。
|
|
8
8
|
*/
|
|
9
9
|
export type ConversationScenario = "im-claw" | "conversation" | "project" | "batch" | "automation" | "kb-processing" | "cli";
|
|
10
|
-
export type PluginPermission = "ui.slot.global" | "ui.slot.file-preview" | "ui.slot.activity-tab" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.tool-call" | "ui.slot.turn-card" | "agent.session.read" | "agent.session.write" | "agent.command.run" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.systemPrompt.fullControl" | "agent.skills.control" | "agent.mcp.control" | "agent.tools.control" | "agent.tools.register" | "agent.toolHandler.execute" | "agent.state.read" | "agent.state.write" | "agent.continuation.register" | "agent.runtime.configure" | "fs.read" | "fs.write" | "network.fetch" | "images.generate" | "settings.read" | "settings.write";
|
|
10
|
+
export type PluginPermission = "ui.slot.global" | "ui.slot.file-preview" | "ui.slot.activity-tab" | "ui.slot.input-action" | "ui.slot.message" | "ui.slot.tool-call" | "ui.slot.turn-card" | "agent.session.read" | "agent.session.write" | "agent.command.run" | "agent.systemPrompt.read" | "agent.systemPrompt.write" | "agent.systemPrompt.fullControl" | "agent.skills.control" | "agent.mcp.control" | "agent.tools.control" | "agent.tools.register" | "agent.toolHandler.execute" | "agent.state.read" | "agent.state.write" | "agent.continuation.register" | "agent.runtime.configure" | "app.actions.register" | "app.actionHandler.execute" | "fs.read" | "fs.write" | "network.fetch" | "images.generate" | "settings.read" | "settings.write";
|
|
11
11
|
/**
|
|
12
12
|
* MCP server config declared inside a plugin (stdio or http). Relative paths in
|
|
13
13
|
* stdio `command`/`args`/`cwd` are resolved against the plugin root at contribute time.
|
|
@@ -24,6 +24,8 @@ export type PluginMcpServerConfig = {
|
|
|
24
24
|
debug?: boolean;
|
|
25
25
|
displayName?: string;
|
|
26
26
|
description?: string;
|
|
27
|
+
/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */
|
|
28
|
+
agent_mode?: string | string[];
|
|
27
29
|
} | {
|
|
28
30
|
type: "http";
|
|
29
31
|
url: string;
|
|
@@ -37,6 +39,8 @@ export type PluginMcpServerConfig = {
|
|
|
37
39
|
debug?: boolean;
|
|
38
40
|
displayName?: string;
|
|
39
41
|
description?: string;
|
|
42
|
+
/** 该 server 的工具允许出现的工作模式 slug(agent_mode 轴,缺省/空 = 通用)。见 ADR-0046。 */
|
|
43
|
+
agent_mode?: string | string[];
|
|
40
44
|
};
|
|
41
45
|
export interface PluginAgentManifest {
|
|
42
46
|
systemPrompt?: {
|
|
@@ -478,6 +482,8 @@ export interface PluginAgentToolRegistration<TInput = unknown> {
|
|
|
478
482
|
scope_use?: readonly ConversationScenario[];
|
|
479
483
|
/** 需要的会话能力 slug(如 "knowledge");全满足才激活。一般插件无需设置。 */
|
|
480
484
|
requires?: string[];
|
|
485
|
+
/** 允许该工具出现的工作模式 slug(agent_mode 轴,如 "work"/"coding")。缺省/空 = 通用。见 ADR-0046。 */
|
|
486
|
+
agent_mode?: readonly string[];
|
|
481
487
|
context?: {
|
|
482
488
|
conversation?: "summary" | "messages";
|
|
483
489
|
};
|
|
@@ -658,6 +664,585 @@ export interface PluginContinuationRegistration {
|
|
|
658
664
|
};
|
|
659
665
|
handler: PluginContinuationHandler;
|
|
660
666
|
}
|
|
667
|
+
export type PluginAppActionEffect = "read" | "write" | "execute";
|
|
668
|
+
export interface PluginAppActionExample<TInput = unknown> {
|
|
669
|
+
description: string;
|
|
670
|
+
input: TInput;
|
|
671
|
+
}
|
|
672
|
+
export interface PluginAppActionHandlerContext<TInput = unknown> {
|
|
673
|
+
invocationId: string;
|
|
674
|
+
plugin: {
|
|
675
|
+
id: string;
|
|
676
|
+
actionId: string;
|
|
677
|
+
settings: Readonly<Record<string, unknown>>;
|
|
678
|
+
};
|
|
679
|
+
input: TInput;
|
|
680
|
+
signal: AbortSignal;
|
|
681
|
+
}
|
|
682
|
+
export type PluginAppActionHandler<TInput = unknown> = (context: PluginAppActionHandlerContext<TInput>) => unknown | Promise<unknown>;
|
|
683
|
+
export type PluginAppActionReadyHandler<TInput = unknown> = (context: PluginAppActionHandlerContext<TInput>) => void | Promise<void>;
|
|
684
|
+
/** 插件 Action 向宿主返回稳定错误码与可序列化详情。 */
|
|
685
|
+
export declare class PluginAppActionError extends Error {
|
|
686
|
+
readonly code: string;
|
|
687
|
+
readonly details?: unknown;
|
|
688
|
+
constructor(code: string, message: string, details?: unknown);
|
|
689
|
+
}
|
|
690
|
+
export interface PluginAppActionApprovalPresentation {
|
|
691
|
+
id: string;
|
|
692
|
+
title: string;
|
|
693
|
+
description: string;
|
|
694
|
+
}
|
|
695
|
+
export interface PluginAppActionApproval {
|
|
696
|
+
/** 默认使用的宿主审批界面。 */
|
|
697
|
+
defaultPresentation: string;
|
|
698
|
+
/** 可用的宿主审批界面;仅官方插件可以声明。 */
|
|
699
|
+
presentations: PluginAppActionApprovalPresentation[];
|
|
700
|
+
/** 根据 input.operation 自动选择审批界面,不要求 Agent 传 approvalUi。 */
|
|
701
|
+
presentationByOperation?: Record<string, string>;
|
|
702
|
+
/** 某 operation 明确允许的附加审批界面;宿主仍会拒绝未列出的调用方选择。 */
|
|
703
|
+
alternativePresentationsByOperation?: Record<string, string[]>;
|
|
704
|
+
}
|
|
705
|
+
export interface PluginAppActionRegistration<TInput = unknown> {
|
|
706
|
+
/** 插件内局部 id;宿主公开为 `plugin.<pluginId>.<id>`。 */
|
|
707
|
+
id: string;
|
|
708
|
+
/** 可信官方插件可指定稳定公共 id;若 id 已被占用则后到者忽略(先注册为准)。 */
|
|
709
|
+
publicId?: string;
|
|
710
|
+
title: string;
|
|
711
|
+
summary: string;
|
|
712
|
+
description?: string;
|
|
713
|
+
keywords?: string[];
|
|
714
|
+
effect: PluginAppActionEffect;
|
|
715
|
+
/** 官方插件可引用宿主已有审批界面;不能关闭 effect 对应的审批。 */
|
|
716
|
+
approval?: PluginAppActionApproval;
|
|
717
|
+
inputSchema: PluginJsonSchema;
|
|
718
|
+
examples?: PluginAppActionExample<TInput>[];
|
|
719
|
+
timeoutMs?: number;
|
|
720
|
+
/** 审批前业务就绪校验;失败时不会向用户弹出审批。 */
|
|
721
|
+
assertReady?: PluginAppActionReadyHandler<TInput>;
|
|
722
|
+
handler: PluginAppActionHandler<TInput>;
|
|
723
|
+
}
|
|
724
|
+
export interface PluginAppActionsApi {
|
|
725
|
+
register<TInput = unknown>(registration: PluginAppActionRegistration<TInput>): Disposable;
|
|
726
|
+
}
|
|
727
|
+
export interface PluginOfficialGeneralSettings {
|
|
728
|
+
workspacePath: string;
|
|
729
|
+
defaultExecutionMode?: "sandbox" | "full-access";
|
|
730
|
+
notificationsEnabled: boolean;
|
|
731
|
+
debugMode: boolean;
|
|
732
|
+
sandbox: unknown;
|
|
733
|
+
}
|
|
734
|
+
export type PluginOfficialGeneralSettingsUpdate = {
|
|
735
|
+
operation: "set-notifications";
|
|
736
|
+
enabled: boolean;
|
|
737
|
+
} | {
|
|
738
|
+
operation: "set-execution-mode";
|
|
739
|
+
mode: "sandbox" | "full-access";
|
|
740
|
+
} | {
|
|
741
|
+
operation: "set-workspace";
|
|
742
|
+
path: string;
|
|
743
|
+
};
|
|
744
|
+
export interface PluginOfficialExperimentalSettings {
|
|
745
|
+
vettaCli: boolean;
|
|
746
|
+
promptPrediction: boolean;
|
|
747
|
+
agentSkills: boolean;
|
|
748
|
+
}
|
|
749
|
+
export interface PluginOfficialDownloadItem {
|
|
750
|
+
id: string;
|
|
751
|
+
url: string;
|
|
752
|
+
filename: string;
|
|
753
|
+
path: string;
|
|
754
|
+
totalBytes: number;
|
|
755
|
+
receivedBytes: number;
|
|
756
|
+
status: "queued" | "downloading" | "paused" | "completed" | "failed" | "canceled";
|
|
757
|
+
error?: string;
|
|
758
|
+
createdAt: number;
|
|
759
|
+
completedAt?: number;
|
|
760
|
+
speedBytesPerSec?: number;
|
|
761
|
+
}
|
|
762
|
+
export interface PluginOfficialUpdaterState {
|
|
763
|
+
phase: "idle" | "checking" | "available" | "downloading" | "ready" | "installing" | "error";
|
|
764
|
+
currentVersion: string;
|
|
765
|
+
latestVersion?: string;
|
|
766
|
+
releaseNote?: string;
|
|
767
|
+
progress?: number;
|
|
768
|
+
downloadedBytes?: number;
|
|
769
|
+
totalBytes?: number;
|
|
770
|
+
assetFileName?: string;
|
|
771
|
+
error?: string;
|
|
772
|
+
pendingInstall: boolean;
|
|
773
|
+
}
|
|
774
|
+
export type PluginOfficialWebhookKind = "feishu" | "dingtalk";
|
|
775
|
+
export interface PluginOfficialWebhookEndpoint {
|
|
776
|
+
id: string;
|
|
777
|
+
kind: PluginOfficialWebhookKind;
|
|
778
|
+
name: string;
|
|
779
|
+
enabled: boolean;
|
|
780
|
+
createdAt: string;
|
|
781
|
+
updatedAt: string;
|
|
782
|
+
urlMask?: string;
|
|
783
|
+
hasSignSecret?: boolean;
|
|
784
|
+
}
|
|
785
|
+
export interface PluginOfficialWebhookProvider {
|
|
786
|
+
kind: PluginOfficialWebhookKind;
|
|
787
|
+
displayName: string;
|
|
788
|
+
iconClass?: string;
|
|
789
|
+
}
|
|
790
|
+
export interface PluginOfficialWebhookCreateInput {
|
|
791
|
+
kind: PluginOfficialWebhookKind;
|
|
792
|
+
name: string;
|
|
793
|
+
webhookUrl: string;
|
|
794
|
+
signSecret?: string;
|
|
795
|
+
enabled?: boolean;
|
|
796
|
+
}
|
|
797
|
+
export interface PluginOfficialWebhookUpdateInput {
|
|
798
|
+
name?: string;
|
|
799
|
+
enabled?: boolean;
|
|
800
|
+
webhookUrl?: string;
|
|
801
|
+
signSecret?: string;
|
|
802
|
+
}
|
|
803
|
+
export interface PluginOfficialWebhookMessage {
|
|
804
|
+
title?: string;
|
|
805
|
+
text: string;
|
|
806
|
+
level?: "info" | "warn" | "error" | "success";
|
|
807
|
+
}
|
|
808
|
+
export interface PluginOfficialWebhookSendResult {
|
|
809
|
+
ok: boolean;
|
|
810
|
+
error?: string;
|
|
811
|
+
}
|
|
812
|
+
export interface PluginOfficialSkillInfo {
|
|
813
|
+
name: string;
|
|
814
|
+
alias?: string;
|
|
815
|
+
description: string;
|
|
816
|
+
source: string;
|
|
817
|
+
type: "skill" | "scene";
|
|
818
|
+
}
|
|
819
|
+
export type PluginOfficialInstalledSkill = {
|
|
820
|
+
name: string;
|
|
821
|
+
version: string;
|
|
822
|
+
installedAt: string;
|
|
823
|
+
source: "market" | "custom";
|
|
824
|
+
enabled: boolean;
|
|
825
|
+
type?: "skill" | "scene";
|
|
826
|
+
alias?: string;
|
|
827
|
+
marketDescription?: string;
|
|
828
|
+
description?: string;
|
|
829
|
+
};
|
|
830
|
+
export interface PluginOfficialShortcutBinding {
|
|
831
|
+
id: string;
|
|
832
|
+
defaultShortcut: string;
|
|
833
|
+
shortcut: string;
|
|
834
|
+
isDefault: boolean;
|
|
835
|
+
}
|
|
836
|
+
export interface PluginOfficialQuickPanelSettings {
|
|
837
|
+
trigger: "none" | "mod" | "alt" | "shift";
|
|
838
|
+
postSendBehavior: "foreground" | "background";
|
|
839
|
+
}
|
|
840
|
+
export interface PluginOfficialImStatus {
|
|
841
|
+
enabled: boolean;
|
|
842
|
+
transport: string;
|
|
843
|
+
agentModel: {
|
|
844
|
+
provider: string;
|
|
845
|
+
model: string;
|
|
846
|
+
reasoningLevel?: string;
|
|
847
|
+
} | null;
|
|
848
|
+
wechatBound: boolean;
|
|
849
|
+
feishuAppId: string | null;
|
|
850
|
+
runtime: unknown;
|
|
851
|
+
}
|
|
852
|
+
export interface PluginOfficialImLog {
|
|
853
|
+
level: string;
|
|
854
|
+
msg: string;
|
|
855
|
+
time: string;
|
|
856
|
+
fields?: Record<string, unknown>;
|
|
857
|
+
}
|
|
858
|
+
export interface PluginOfficialMcpServerSummary {
|
|
859
|
+
name: string;
|
|
860
|
+
type: "http" | "stdio";
|
|
861
|
+
disabled: boolean;
|
|
862
|
+
command?: string;
|
|
863
|
+
url?: string;
|
|
864
|
+
}
|
|
865
|
+
export interface PluginOfficialMcpServerDetail {
|
|
866
|
+
name: string;
|
|
867
|
+
type?: "http" | "stdio";
|
|
868
|
+
command?: string;
|
|
869
|
+
args?: string[];
|
|
870
|
+
env?: Record<string, string>;
|
|
871
|
+
cwd?: string;
|
|
872
|
+
url?: string;
|
|
873
|
+
headers?: Record<string, string>;
|
|
874
|
+
disabled?: boolean;
|
|
875
|
+
autoApprove?: string[];
|
|
876
|
+
startupTimeout?: number;
|
|
877
|
+
debug?: boolean;
|
|
878
|
+
}
|
|
879
|
+
export type PluginOfficialMcpUpsertData = {
|
|
880
|
+
type?: "stdio";
|
|
881
|
+
command?: string;
|
|
882
|
+
args?: string[];
|
|
883
|
+
env?: Record<string, string>;
|
|
884
|
+
cwd?: string;
|
|
885
|
+
disabled?: boolean;
|
|
886
|
+
autoApprove?: string[];
|
|
887
|
+
startupTimeout?: number;
|
|
888
|
+
debug?: boolean;
|
|
889
|
+
} | {
|
|
890
|
+
type: "http";
|
|
891
|
+
url?: string;
|
|
892
|
+
headers?: Record<string, string>;
|
|
893
|
+
disabled?: boolean;
|
|
894
|
+
autoApprove?: string[];
|
|
895
|
+
startupTimeout?: number;
|
|
896
|
+
debug?: boolean;
|
|
897
|
+
};
|
|
898
|
+
export type PluginOfficialExecutionMode = "inherit" | "sandbox" | "full-access";
|
|
899
|
+
export interface PluginOfficialSelectedSkill {
|
|
900
|
+
name: string;
|
|
901
|
+
alias?: string;
|
|
902
|
+
type: "skill" | "scene";
|
|
903
|
+
}
|
|
904
|
+
export interface PluginOfficialBatchProjectCreateData {
|
|
905
|
+
name: string;
|
|
906
|
+
prompt: string;
|
|
907
|
+
modelKey?: string;
|
|
908
|
+
folders: string[];
|
|
909
|
+
concurrency: number;
|
|
910
|
+
executionMode?: PluginOfficialExecutionMode;
|
|
911
|
+
artifactPatterns?: string[];
|
|
912
|
+
notifyEnabled?: boolean;
|
|
913
|
+
timeoutMinutes?: number;
|
|
914
|
+
skill?: PluginOfficialSelectedSkill;
|
|
915
|
+
}
|
|
916
|
+
export interface PluginOfficialBatchProjectUpdateData {
|
|
917
|
+
name?: string;
|
|
918
|
+
prompt?: string;
|
|
919
|
+
modelKey?: string;
|
|
920
|
+
concurrency?: number;
|
|
921
|
+
executionMode?: PluginOfficialExecutionMode;
|
|
922
|
+
artifactPatterns?: string[];
|
|
923
|
+
notifyEnabled?: boolean;
|
|
924
|
+
timeoutMinutes?: number;
|
|
925
|
+
newFolders?: string[];
|
|
926
|
+
skill?: PluginOfficialSelectedSkill | null;
|
|
927
|
+
}
|
|
928
|
+
export interface PluginOfficialSchedulerTaskCreateData {
|
|
929
|
+
name: string;
|
|
930
|
+
prompt: string;
|
|
931
|
+
cron: string;
|
|
932
|
+
isOnce: boolean;
|
|
933
|
+
enabled?: boolean;
|
|
934
|
+
cwd: string;
|
|
935
|
+
modelKey?: string;
|
|
936
|
+
executionMode?: PluginOfficialExecutionMode;
|
|
937
|
+
skill?: PluginOfficialSelectedSkill;
|
|
938
|
+
}
|
|
939
|
+
export interface PluginOfficialSchedulerTaskUpdateData {
|
|
940
|
+
name?: string;
|
|
941
|
+
prompt?: string;
|
|
942
|
+
cron?: string;
|
|
943
|
+
isOnce?: boolean;
|
|
944
|
+
enabled?: boolean;
|
|
945
|
+
cwd?: string;
|
|
946
|
+
modelKey?: string | null;
|
|
947
|
+
executionMode?: PluginOfficialExecutionMode;
|
|
948
|
+
skill?: PluginOfficialSelectedSkill | null;
|
|
949
|
+
}
|
|
950
|
+
export interface PluginOfficialModelSummary {
|
|
951
|
+
id: string;
|
|
952
|
+
name?: string;
|
|
953
|
+
api?: string;
|
|
954
|
+
reasoning?: boolean;
|
|
955
|
+
}
|
|
956
|
+
export interface PluginOfficialProviderSummary {
|
|
957
|
+
id: string;
|
|
958
|
+
displayName: string;
|
|
959
|
+
baseUrl?: string;
|
|
960
|
+
api?: string;
|
|
961
|
+
hasApiKey: boolean;
|
|
962
|
+
modelCount: number;
|
|
963
|
+
models: PluginOfficialModelSummary[];
|
|
964
|
+
}
|
|
965
|
+
export interface PluginOfficialProviderDetail {
|
|
966
|
+
baseUrl?: string;
|
|
967
|
+
apiKey?: string;
|
|
968
|
+
api?: string;
|
|
969
|
+
displayName?: string;
|
|
970
|
+
authHeader?: boolean;
|
|
971
|
+
headers?: Record<string, string>;
|
|
972
|
+
models?: Array<{
|
|
973
|
+
id: string;
|
|
974
|
+
name?: string;
|
|
975
|
+
api?: string;
|
|
976
|
+
reasoning?: boolean;
|
|
977
|
+
contextWindow?: number;
|
|
978
|
+
maxTokens?: number;
|
|
979
|
+
}>;
|
|
980
|
+
}
|
|
981
|
+
export interface PluginOfficialProviderUpsertData {
|
|
982
|
+
baseUrl?: string;
|
|
983
|
+
apiKey?: string;
|
|
984
|
+
api?: string;
|
|
985
|
+
displayName?: string;
|
|
986
|
+
authHeader?: boolean;
|
|
987
|
+
headers?: Record<string, string>;
|
|
988
|
+
models?: Array<{
|
|
989
|
+
id: string;
|
|
990
|
+
name?: string;
|
|
991
|
+
api?: string;
|
|
992
|
+
reasoning?: boolean;
|
|
993
|
+
contextWindow?: number;
|
|
994
|
+
maxTokens?: number;
|
|
995
|
+
}>;
|
|
996
|
+
}
|
|
997
|
+
export interface PluginOfficialProjectEntry {
|
|
998
|
+
path: string;
|
|
999
|
+
name?: string;
|
|
1000
|
+
}
|
|
1001
|
+
export interface PluginOfficialPluginSummary {
|
|
1002
|
+
id: string;
|
|
1003
|
+
name: string;
|
|
1004
|
+
version: string;
|
|
1005
|
+
enabled: boolean;
|
|
1006
|
+
required: boolean;
|
|
1007
|
+
source: string;
|
|
1008
|
+
permissions: string[];
|
|
1009
|
+
description?: string;
|
|
1010
|
+
devWatch?: unknown;
|
|
1011
|
+
}
|
|
1012
|
+
export interface PluginOfficialKnowledgeBase {
|
|
1013
|
+
id: string;
|
|
1014
|
+
name: string;
|
|
1015
|
+
updatedAt: number;
|
|
1016
|
+
isDefault: boolean;
|
|
1017
|
+
nodes: unknown[];
|
|
1018
|
+
}
|
|
1019
|
+
export interface PluginOfficialKnowledgeProcessingSettings {
|
|
1020
|
+
enabled?: boolean;
|
|
1021
|
+
pollIntervalMinutes?: number;
|
|
1022
|
+
processingModelKey?: string;
|
|
1023
|
+
processingModelReasoningLevel?: string;
|
|
1024
|
+
agentConcurrency?: number;
|
|
1025
|
+
ocrConcurrency?: number;
|
|
1026
|
+
}
|
|
1027
|
+
/** 仅宿主验证为官方来源的插件可以调用;普通插件调用时由宿主拒绝。 */
|
|
1028
|
+
export interface PluginOfficialApi {
|
|
1029
|
+
general: {
|
|
1030
|
+
getSettings(): Promise<PluginOfficialGeneralSettings>;
|
|
1031
|
+
setSettings(input: PluginOfficialGeneralSettingsUpdate): Promise<PluginOfficialGeneralSettingsUpdate>;
|
|
1032
|
+
};
|
|
1033
|
+
agent: {
|
|
1034
|
+
getExperimental(): Promise<PluginOfficialExperimentalSettings>;
|
|
1035
|
+
setExperimental(input: Partial<PluginOfficialExperimentalSettings>): Promise<PluginOfficialExperimentalSettings>;
|
|
1036
|
+
};
|
|
1037
|
+
downloads: {
|
|
1038
|
+
list(): Promise<PluginOfficialDownloadItem[]>;
|
|
1039
|
+
cancel(id: string): Promise<void>;
|
|
1040
|
+
};
|
|
1041
|
+
updater: {
|
|
1042
|
+
getState(): Promise<PluginOfficialUpdaterState>;
|
|
1043
|
+
getCurrentVersion(): Promise<string>;
|
|
1044
|
+
check(): Promise<PluginOfficialUpdaterState>;
|
|
1045
|
+
download(): Promise<PluginOfficialUpdaterState>;
|
|
1046
|
+
install(): Promise<void>;
|
|
1047
|
+
dismiss(): Promise<void>;
|
|
1048
|
+
cancel(): Promise<void>;
|
|
1049
|
+
};
|
|
1050
|
+
webhook: {
|
|
1051
|
+
list(): Promise<PluginOfficialWebhookEndpoint[]>;
|
|
1052
|
+
listProviders(): Promise<PluginOfficialWebhookProvider[]>;
|
|
1053
|
+
create(input: PluginOfficialWebhookCreateInput): Promise<PluginOfficialWebhookEndpoint>;
|
|
1054
|
+
update(id: string, input: PluginOfficialWebhookUpdateInput): Promise<PluginOfficialWebhookEndpoint>;
|
|
1055
|
+
setEnabled(id: string, enabled: boolean): Promise<PluginOfficialWebhookEndpoint>;
|
|
1056
|
+
delete(id: string): Promise<void>;
|
|
1057
|
+
test(id: string): Promise<PluginOfficialWebhookSendResult>;
|
|
1058
|
+
send(id: string, message: PluginOfficialWebhookMessage): Promise<PluginOfficialWebhookSendResult>;
|
|
1059
|
+
};
|
|
1060
|
+
skills: {
|
|
1061
|
+
list(cwd?: string): Promise<PluginOfficialSkillInfo[]>;
|
|
1062
|
+
getManifest(): Promise<Record<string, PluginOfficialInstalledSkill>>;
|
|
1063
|
+
setEnabled(name: string, enabled: boolean): Promise<{
|
|
1064
|
+
name: string;
|
|
1065
|
+
enabled: boolean;
|
|
1066
|
+
}>;
|
|
1067
|
+
uninstall(name: string, type?: "skill" | "scene"): Promise<void>;
|
|
1068
|
+
};
|
|
1069
|
+
shortcuts: {
|
|
1070
|
+
listAvailableActions(): Array<{
|
|
1071
|
+
id: string;
|
|
1072
|
+
defaultShortcut: string;
|
|
1073
|
+
}>;
|
|
1074
|
+
get(): Promise<{
|
|
1075
|
+
bindings: PluginOfficialShortcutBinding[];
|
|
1076
|
+
quickPanel: PluginOfficialQuickPanelSettings;
|
|
1077
|
+
}>;
|
|
1078
|
+
setBinding(id: string, shortcut: string): Promise<{
|
|
1079
|
+
bindings: PluginOfficialShortcutBinding[];
|
|
1080
|
+
}>;
|
|
1081
|
+
resetBinding(id: string): Promise<{
|
|
1082
|
+
bindings: PluginOfficialShortcutBinding[];
|
|
1083
|
+
shortcut: string;
|
|
1084
|
+
}>;
|
|
1085
|
+
resetAllBindings(): Promise<{
|
|
1086
|
+
bindings: PluginOfficialShortcutBinding[];
|
|
1087
|
+
}>;
|
|
1088
|
+
setQuickPanelTrigger(trigger: PluginOfficialQuickPanelSettings["trigger"]): Promise<PluginOfficialQuickPanelSettings>;
|
|
1089
|
+
setQuickPanelBehavior(behavior: PluginOfficialQuickPanelSettings["postSendBehavior"]): Promise<PluginOfficialQuickPanelSettings>;
|
|
1090
|
+
};
|
|
1091
|
+
im: {
|
|
1092
|
+
getStatus(): Promise<PluginOfficialImStatus>;
|
|
1093
|
+
getLogs(limit?: number): Promise<PluginOfficialImLog[]>;
|
|
1094
|
+
setEnabled(enabled: boolean): Promise<{
|
|
1095
|
+
status: unknown;
|
|
1096
|
+
}>;
|
|
1097
|
+
restart(): Promise<{
|
|
1098
|
+
status: unknown;
|
|
1099
|
+
}>;
|
|
1100
|
+
setAgentModel(modelKey: string | null, reasoningLevel?: string): Promise<{
|
|
1101
|
+
status: unknown;
|
|
1102
|
+
}>;
|
|
1103
|
+
assertModelKeyExists(modelKey: string): Promise<void>;
|
|
1104
|
+
};
|
|
1105
|
+
mcp: {
|
|
1106
|
+
list(): Promise<PluginOfficialMcpServerSummary[]>;
|
|
1107
|
+
get(name: string): Promise<PluginOfficialMcpServerDetail>;
|
|
1108
|
+
listNames(): Promise<string[]>;
|
|
1109
|
+
upsert(name: string, data: PluginOfficialMcpUpsertData): Promise<PluginOfficialMcpServerDetail>;
|
|
1110
|
+
setEnabled(name: string, enabled: boolean): Promise<void>;
|
|
1111
|
+
remove(name: string): Promise<void>;
|
|
1112
|
+
};
|
|
1113
|
+
models: {
|
|
1114
|
+
list(): Promise<{
|
|
1115
|
+
defaultModel: string | null;
|
|
1116
|
+
providers: PluginOfficialProviderSummary[];
|
|
1117
|
+
}>;
|
|
1118
|
+
get(provider?: string): Promise<unknown>;
|
|
1119
|
+
probe(provider: string, model: string): Promise<{
|
|
1120
|
+
ok: boolean;
|
|
1121
|
+
message?: string;
|
|
1122
|
+
error?: string;
|
|
1123
|
+
}>;
|
|
1124
|
+
listProviderIds(): Promise<string[]>;
|
|
1125
|
+
assertModelKeyExists(modelKey: string, operation?: string): Promise<void>;
|
|
1126
|
+
setDefault(modelKey: string): Promise<{
|
|
1127
|
+
defaultModel: string;
|
|
1128
|
+
}>;
|
|
1129
|
+
upsertProvider(provider: string, data: PluginOfficialProviderUpsertData): Promise<PluginOfficialProviderDetail>;
|
|
1130
|
+
removeProvider(provider: string): Promise<void>;
|
|
1131
|
+
};
|
|
1132
|
+
projects: {
|
|
1133
|
+
list(): Promise<{
|
|
1134
|
+
workspacePath: string;
|
|
1135
|
+
projects: PluginOfficialProjectEntry[];
|
|
1136
|
+
archivedProjects: PluginOfficialProjectEntry[];
|
|
1137
|
+
}>;
|
|
1138
|
+
listSessions(cwd: string): Promise<unknown[]>;
|
|
1139
|
+
listRuntimeProjects(): Promise<unknown[]>;
|
|
1140
|
+
create(name: string, path?: string): Promise<PluginOfficialProjectEntry>;
|
|
1141
|
+
open(path: string, name?: string): Promise<PluginOfficialProjectEntry>;
|
|
1142
|
+
rename(path: string, name: string): Promise<PluginOfficialProjectEntry>;
|
|
1143
|
+
archive(path: string): Promise<void>;
|
|
1144
|
+
unarchive(path: string): Promise<void>;
|
|
1145
|
+
remove(path: string): Promise<void>;
|
|
1146
|
+
};
|
|
1147
|
+
plugins: {
|
|
1148
|
+
list(): Promise<PluginOfficialPluginSummary[]>;
|
|
1149
|
+
get(id: string): Promise<PluginOfficialPluginSummary>;
|
|
1150
|
+
setEnabled(id: string, enabled: boolean): Promise<PluginOfficialPluginSummary>;
|
|
1151
|
+
installFromUrl(url: string): Promise<PluginOfficialPluginSummary>;
|
|
1152
|
+
installFromPath(path: string, options?: {
|
|
1153
|
+
grantedPermissions?: string[];
|
|
1154
|
+
enable?: boolean;
|
|
1155
|
+
}): Promise<PluginOfficialPluginSummary>;
|
|
1156
|
+
uninstall(id: string): Promise<void>;
|
|
1157
|
+
reload(id: string): Promise<PluginOfficialPluginSummary>;
|
|
1158
|
+
};
|
|
1159
|
+
knowledge: {
|
|
1160
|
+
list(): Promise<PluginOfficialKnowledgeBase[]>;
|
|
1161
|
+
fileStatuses(): Promise<Record<string, unknown>>;
|
|
1162
|
+
isProcessing(): Promise<boolean>;
|
|
1163
|
+
getProcessing(): Promise<PluginOfficialKnowledgeProcessingSettings>;
|
|
1164
|
+
create(name: string): Promise<void>;
|
|
1165
|
+
rename(name: string, newName: string): Promise<void>;
|
|
1166
|
+
delete(name: string): Promise<void>;
|
|
1167
|
+
addFiles(kbId: string, paths: string[], move?: boolean): Promise<void>;
|
|
1168
|
+
deleteEntry(kbId: string, relPath: string): Promise<void>;
|
|
1169
|
+
scanNow(): Promise<{
|
|
1170
|
+
skipped: boolean;
|
|
1171
|
+
reason?: string;
|
|
1172
|
+
}>;
|
|
1173
|
+
retryFailed(): Promise<{
|
|
1174
|
+
skipped: boolean;
|
|
1175
|
+
reason?: string;
|
|
1176
|
+
}>;
|
|
1177
|
+
setProcessing(data: Partial<{
|
|
1178
|
+
enabled: boolean;
|
|
1179
|
+
pollIntervalMinutes: 3 | 5 | 10 | 30;
|
|
1180
|
+
processingModelKey: string | null;
|
|
1181
|
+
processingModelReasoningLevel: string | null;
|
|
1182
|
+
agentConcurrency: number;
|
|
1183
|
+
ocrConcurrency: number;
|
|
1184
|
+
}>): Promise<PluginOfficialKnowledgeProcessingSettings>;
|
|
1185
|
+
};
|
|
1186
|
+
batchTasks: {
|
|
1187
|
+
listProjects(): Promise<unknown[]>;
|
|
1188
|
+
getProject(projectId: string): Promise<unknown>;
|
|
1189
|
+
listProjectIds(): Promise<string[]>;
|
|
1190
|
+
createProject(data: PluginOfficialBatchProjectCreateData): Promise<unknown>;
|
|
1191
|
+
updateProject(projectId: string, data: PluginOfficialBatchProjectUpdateData): Promise<unknown>;
|
|
1192
|
+
deleteProject(projectId: string): Promise<unknown>;
|
|
1193
|
+
runTask(projectId: string, taskId: string): Promise<unknown>;
|
|
1194
|
+
retryTask(projectId: string, taskId: string): Promise<unknown>;
|
|
1195
|
+
stopTask(projectId: string, taskId: string): Promise<unknown>;
|
|
1196
|
+
deleteTask(projectId: string, taskId: string): Promise<unknown>;
|
|
1197
|
+
resumeTask(projectId: string, taskId: string): Promise<unknown>;
|
|
1198
|
+
resumeTaskWithText(projectId: string, taskId: string, text: string): Promise<unknown>;
|
|
1199
|
+
deleteTaskSession(projectId: string, taskId: string): Promise<unknown>;
|
|
1200
|
+
batchDelete(projectId: string): Promise<unknown>;
|
|
1201
|
+
batchStart(projectId: string): Promise<unknown>;
|
|
1202
|
+
batchStop(projectId: string): Promise<unknown>;
|
|
1203
|
+
batchReset(projectId: string): Promise<unknown>;
|
|
1204
|
+
batchResetFailed(projectId: string, taskIds: string[]): Promise<unknown>;
|
|
1205
|
+
};
|
|
1206
|
+
scheduler: {
|
|
1207
|
+
listTasks(): Promise<unknown[]>;
|
|
1208
|
+
getTask(taskId: string): Promise<unknown>;
|
|
1209
|
+
listTaskIds(): Promise<string[]>;
|
|
1210
|
+
getHistory(taskId: string): Promise<unknown[]>;
|
|
1211
|
+
createTask(data: PluginOfficialSchedulerTaskCreateData): Promise<unknown>;
|
|
1212
|
+
updateTask(taskId: string, data: PluginOfficialSchedulerTaskUpdateData): Promise<unknown>;
|
|
1213
|
+
deleteTask(taskId: string): Promise<unknown>;
|
|
1214
|
+
setEnabled(taskId: string, enabled: boolean): Promise<unknown>;
|
|
1215
|
+
runNow(taskId: string): Promise<unknown>;
|
|
1216
|
+
abort(taskId: string): Promise<unknown>;
|
|
1217
|
+
};
|
|
1218
|
+
appearance: {
|
|
1219
|
+
help(): Promise<unknown>;
|
|
1220
|
+
get(): Promise<unknown>;
|
|
1221
|
+
set(input: {
|
|
1222
|
+
mode?: "light" | "dark" | "auto";
|
|
1223
|
+
themeId?: string;
|
|
1224
|
+
cursorStyle?: "default" | "stoat";
|
|
1225
|
+
}): Promise<unknown>;
|
|
1226
|
+
setLanguage(language: "zh" | "en"): Promise<unknown>;
|
|
1227
|
+
listThemeIds(): string[];
|
|
1228
|
+
};
|
|
1229
|
+
navigation: {
|
|
1230
|
+
help(): unknown;
|
|
1231
|
+
resolveOpen(input: {
|
|
1232
|
+
target: string;
|
|
1233
|
+
tab?: string;
|
|
1234
|
+
section?: string;
|
|
1235
|
+
}): {
|
|
1236
|
+
hashPath: string;
|
|
1237
|
+
resolved: unknown;
|
|
1238
|
+
};
|
|
1239
|
+
open(input: {
|
|
1240
|
+
target: string;
|
|
1241
|
+
tab?: string;
|
|
1242
|
+
section?: string;
|
|
1243
|
+
}): Promise<unknown>;
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
661
1246
|
export interface PluginFsEntry {
|
|
662
1247
|
name: string;
|
|
663
1248
|
path: string;
|
|
@@ -804,6 +1389,8 @@ export interface PluginI18nApi {
|
|
|
804
1389
|
/** Fired when the host language changes. */
|
|
805
1390
|
onChange(listener: (locale: string) => void): Disposable;
|
|
806
1391
|
}
|
|
1392
|
+
/** 工作模式(agent_mode 轴,见 ADR-0046)。宿主 Work/Coding,未来可能扩展。 */
|
|
1393
|
+
export type AgentMode = "work" | "coding";
|
|
807
1394
|
export interface PluginContext {
|
|
808
1395
|
plugin: {
|
|
809
1396
|
id: string;
|
|
@@ -813,11 +1400,17 @@ export interface PluginContext {
|
|
|
813
1400
|
ui: PluginUiApi;
|
|
814
1401
|
conversation: PluginConversationApi;
|
|
815
1402
|
agent: PluginAgentApi;
|
|
1403
|
+
appActions: PluginAppActionsApi;
|
|
1404
|
+
official: PluginOfficialApi;
|
|
816
1405
|
fs: PluginFsApi;
|
|
817
1406
|
command: PluginCommandApi;
|
|
818
1407
|
images: PluginImagesApi;
|
|
819
1408
|
settings: PluginSettingsApi;
|
|
820
1409
|
i18n: PluginI18nApi;
|
|
1410
|
+
/** 当前工作模式(agent_mode 轴)。开发者据此做模式定制。见 ADR-0046。 */
|
|
1411
|
+
getAgentMode(): AgentMode;
|
|
1412
|
+
/** 订阅工作模式变更(纯全局实时切换)。返回 Disposable 取消订阅。 */
|
|
1413
|
+
onAgentModeChanged(listener: (mode: AgentMode) => void): Disposable;
|
|
821
1414
|
}
|
|
822
1415
|
export interface PluginDefinition {
|
|
823
1416
|
activate(ctx: PluginContext): void | Promise<void>;
|