@plumeai/plugin-sdk 0.1.7 → 0.2.0

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.
@@ -26,6 +26,7 @@ export declare const en: {
26
26
  "override.projectValue": string;
27
27
  "override.globalValue": string;
28
28
  "override.overriddenNote": string;
29
+ "override.looseningIgnored": string;
29
30
  "override.repoBanned": string;
30
31
  "fileAction.exists": string;
31
32
  "fileAction.replaceDetail": string;
@@ -168,9 +169,8 @@ export declare const en: {
168
169
  "sessionCard.input": string;
169
170
  "sessionCard.output": string;
170
171
  "sessionCard.partMain": string;
171
- "sessionCard.partSide": string;
172
- "sessionCard.partSubagents": string;
173
172
  "sessionCard.started": string;
173
+ "sessionCard.stewardedBy": string;
174
174
  "sessionCard.readCache": string;
175
175
  "reorder.saveFailed": string;
176
176
  "sidebar.created": string;
@@ -741,6 +741,8 @@ export declare const en: {
741
741
  "sessionMenu.markRead": string;
742
742
  "sessionMenu.markedUnread": string;
743
743
  "sessionMenu.markedRead": string;
744
+ "sessionMenu.revokeSteward": string;
745
+ "sessionMenu.stewardRevoked": string;
744
746
  "sessionMenu.project": string;
745
747
  "sessionMenu.moveToProject": string;
746
748
  "sessionMenu.currentProject": string;
@@ -790,7 +792,6 @@ export declare const en: {
790
792
  "tools.edit": string;
791
793
  "tools.read": string;
792
794
  "tools.bash": string;
793
- "tools.monitor": string;
794
795
  "tools.output": string;
795
796
  "tools.outputOf": string;
796
797
  "tools.outputOfTimes": {
@@ -807,39 +808,17 @@ export declare const en: {
807
808
  "peers.letter": string;
808
809
  "peers.open": string;
809
810
  "peers.sessionGone": string;
810
- "jobReturn.done": string;
811
- "jobReturn.failed": string;
812
- "jobReturn.exitCode": string;
813
- "jobReturn.killed": string;
814
- "jobReturn.many": {
815
- one: string;
816
- other: string;
817
- };
818
- "jobReturn.failedCount": string;
819
- "jobReturn.monitorLines": {
820
- one: string;
821
- other: string;
822
- };
823
- "jobReturn.monitorStopped": string;
824
- "jobReturn.monitorIdle": string;
825
- "jobReturn.monitorMaxEvents": string;
826
- "jobReturn.manyUpdates": {
827
- one: string;
828
- other: string;
829
- };
830
- "wakeupReturn.fired": string;
831
- "sessionReturn.from": string;
832
- "sessionReturn.failed": string;
811
+ "delivery.fromSession": string;
812
+ "delivery.failed": string;
813
+ "delivery.incomplete": string;
833
814
  "tools.find": string;
834
815
  "tools.grep": string;
835
816
  "tools.ls": string;
836
- "tools.todo": string;
837
- "tools.todoOf": string;
838
- "tools.todoAt": string;
839
817
  "tools.using": string;
840
818
  "tools.countOf": string;
841
819
  "tools.countTimes": string;
842
820
  "tools.run": string;
821
+ "tools.answeredBy": string;
843
822
  "step.thinking": {
844
823
  one: string;
845
824
  other: string;
@@ -857,7 +836,9 @@ export declare const en: {
857
836
  "questionNav.pick": string;
858
837
  "questionNav.goTo": string;
859
838
  "questionNav.imageMessage": string;
860
- "userMessage.fromSideChat": string;
839
+ "userMessage.fromChild": string;
840
+ "userMessage.fromPlugin": string;
841
+ "userMessage.relayedBy": string;
861
842
  "userMessage.showMore": string;
862
843
  "userMessage.showLess": string;
863
844
  "conversation.quoteToComposer": string;
@@ -878,22 +859,6 @@ export declare const en: {
878
859
  "common.send": string;
879
860
  "userMessage.turnRunning": string;
880
861
  "userMessage.editResend": string;
881
- "taskStrip.queued": string;
882
- "taskStrip.mainBusy": string;
883
- "taskStrip.done": string;
884
- "taskStrip.failedWith": string;
885
- "taskStrip.failed": string;
886
- "taskStrip.stalled": string;
887
- "taskStrip.maxTurns": string;
888
- "taskStrip.interrupted": string;
889
- "taskStrip.withdrawn": string;
890
- "taskStrip.runNow": string;
891
- "taskStrip.withdraw": string;
892
- "taskStrip.withdrawOne": string;
893
- "taskStrip.retryOne": string;
894
- "taskStrip.resumeOne": string;
895
- "taskStrip.remove": string;
896
- "taskStrip.removeOne": string;
897
862
  "sideMessage.reask": string;
898
863
  "sideMessage.busy": string;
899
864
  "sideMessage.editAndReask": string;
@@ -1020,6 +985,8 @@ export declare const en: {
1020
985
  "composer.permissionAsk": string;
1021
986
  "composer.permissionAuto": string;
1022
987
  "composer.permissionFull": string;
988
+ "composer.permissionProject": string;
989
+ "permission.projectNote": string;
1023
990
  "permission.mode": string;
1024
991
  "permission.question": string;
1025
992
  "permission.askDetail": string;
@@ -1041,13 +1008,36 @@ export declare const en: {
1041
1008
  "permission.once": string;
1042
1009
  "approval.fromChild": string;
1043
1010
  "approval.childUntitled": string;
1044
- "approval.bash": string;
1045
- "approval.write": string;
1046
- "approval.edit": string;
1047
- "approval.read": string;
1011
+ "approval.command": string;
1012
+ "approval.create": string;
1013
+ "approval.modify": string;
1014
+ "approval.view": string;
1048
1015
  "approval.expiresIn": string;
1016
+ "approval.requestUnavailable": string;
1017
+ "approval.decline": string;
1049
1018
  "running.waitingForAnswer": string;
1050
1019
  "composer.plumePlaceholder": string;
1020
+ "contextMeter.usedPercent": string;
1021
+ "contextMeter.windowUsage": string;
1022
+ "contextMeter.window": string;
1023
+ "contextMeter.usedOfLimit": string;
1024
+ "contextMeter.percentUsed": string;
1025
+ "contextMeter.fileCount": {
1026
+ one: string;
1027
+ other: string;
1028
+ };
1029
+ "contextMeter.nearLimit": string;
1030
+ "contextMeter.used": string;
1031
+ "contextMeter.remaining": string;
1032
+ "contextMeter.memoryFiles": string;
1033
+ "contextMeter.noMemoryFiles": string;
1034
+ "contextMeter.segment.messages": string;
1035
+ "contextMeter.segment.tools": string;
1036
+ "contextMeter.segment.mcpTools": string;
1037
+ "contextMeter.segment.skills": string;
1038
+ "contextMeter.segment.systemPrompt": string;
1039
+ "contextMeter.segment.conventions": string;
1040
+ "contextMeter.segment.memory": string;
1051
1041
  "command.slash": string;
1052
1042
  "command.builtin": string;
1053
1043
  "command.custom": string;
@@ -1064,6 +1054,12 @@ export declare const en: {
1064
1054
  "general.autoReviewDetail": string;
1065
1055
  "general.fullAccess": string;
1066
1056
  "general.fullAccessDetail": string;
1057
+ "general.alwaysAllowDetail": string;
1058
+ "general.alwaysAllowEmpty": string;
1059
+ "general.alwaysAllowClear": string;
1060
+ "general.alwaysAllowRevoke": string;
1061
+ "general.alwaysAllowCore": string;
1062
+ "general.alwaysAllowRead": string;
1067
1063
  "general.section": string;
1068
1064
  "general.hideEmptiedProjects": string;
1069
1065
  "general.hideEmptiedProjectsDetail": string;
@@ -1111,6 +1107,7 @@ export declare const en: {
1111
1107
  "retry.fixedDetail": string;
1112
1108
  "plugins.failed": string;
1113
1109
  "plugins.waiting": string;
1110
+ "plugins.observesAll": string;
1114
1111
  "about.intro": string;
1115
1112
  "about.checking": string;
1116
1113
  "about.checkInterval": string;
@@ -24,6 +24,7 @@ export declare const zhCN: {
24
24
  readonly "override.projectValue": "项目值";
25
25
  readonly "override.globalValue": "全局值";
26
26
  readonly "override.overriddenNote": "⚠ 被项目值{mode},不生效";
27
+ readonly "override.looseningIgnored": "会放宽权限,已被忽略:仓库里的配置只能收紧权限,放宽要在本机的设置里改";
27
28
  readonly "override.repoBanned": "不允许放在仓库文件里,已被忽略";
28
29
  readonly "fileAction.exists": "「{name}」已存在";
29
30
  readonly "fileAction.noTerminal": "请先安装并启用终端插件。";
@@ -145,9 +146,8 @@ export declare const zhCN: {
145
146
  readonly "sessionCard.input": "输入";
146
147
  readonly "sessionCard.output": "输出";
147
148
  readonly "sessionCard.partMain": "主会话";
148
- readonly "sessionCard.partSide": "侧边聊天";
149
- readonly "sessionCard.partSubagents": "子智能体";
150
149
  readonly "sessionCard.started": "{at} 开始";
150
+ readonly "sessionCard.stewardedBy": "由 {name} 代管";
151
151
  readonly "sessionCard.readCache": "读缓存 {n}";
152
152
  readonly "reorder.saveFailed": "排序未能保存:{reason}";
153
153
  readonly "sidebar.created": "最近创建";
@@ -657,6 +657,8 @@ export declare const zhCN: {
657
657
  readonly "sessionMenu.markRead": "标记为已读";
658
658
  readonly "sessionMenu.markedUnread": "已标记为未读";
659
659
  readonly "sessionMenu.markedRead": "已标记为已读";
660
+ readonly "sessionMenu.revokeSteward": "停止代管";
661
+ readonly "sessionMenu.stewardRevoked": "已停止代管,插件不能再往这个会话里转话、答卡";
660
662
  readonly "sessionMenu.project": "项目";
661
663
  readonly "sessionMenu.moveToProject": "移动到项目";
662
664
  readonly "sessionMenu.currentProject": "当前项目";
@@ -706,7 +708,6 @@ export declare const zhCN: {
706
708
  readonly "tools.edit": "修改文件";
707
709
  readonly "tools.read": "读取文件";
708
710
  readonly "tools.bash": "执行命令";
709
- readonly "tools.monitor": "监视命令";
710
711
  readonly "tools.output": "查看输出";
711
712
  readonly "tools.outputOf": "查看「{what}」的输出";
712
713
  readonly "tools.outputOfTimes": "查看「{what}」的输出 {n} 次";
@@ -717,30 +718,17 @@ export declare const zhCN: {
717
718
  readonly "peers.letter": "其他会话的消息";
718
719
  readonly "peers.open": "打开这个会话";
719
720
  readonly "peers.sessionGone": "这个会话已经不在了";
720
- readonly "jobReturn.done": "后台命令完成";
721
- readonly "jobReturn.failed": "后台命令失败";
722
- readonly "jobReturn.exitCode": "退出码 {code}";
723
- readonly "jobReturn.killed": "被终止";
724
- readonly "jobReturn.many": "{n} 个后台命令结束";
725
- readonly "jobReturn.failedCount": "{n} 个失败";
726
- readonly "jobReturn.monitorLines": "监视到 {n} 行新输出";
727
- readonly "jobReturn.monitorStopped": "监视已停止";
728
- readonly "jobReturn.monitorIdle": "长时间没有输出";
729
- readonly "jobReturn.monitorMaxEvents": "达到行数上限";
730
- readonly "jobReturn.manyUpdates": "{n} 个后台命令有新输出";
731
- readonly "wakeupReturn.fired": "定时唤醒";
732
- readonly "sessionReturn.from": "来自新会话";
733
- readonly "sessionReturn.failed": "没跑完";
721
+ readonly "delivery.fromSession": "来自新会话";
722
+ readonly "delivery.failed": "没跑完";
723
+ readonly "delivery.incomplete": "只做了一部分";
734
724
  readonly "tools.find": "查找文件";
735
725
  readonly "tools.grep": "搜索内容";
736
726
  readonly "tools.ls": "列出目录";
737
- readonly "tools.todo": "更新清单";
738
- readonly "tools.todoOf": "更新清单 {done}/{total}";
739
- readonly "tools.todoAt": "更新清单 {done}/{total} · {task}";
740
727
  readonly "tools.using": "使用工具";
741
728
  readonly "tools.countOf": "{kind} {count} 个";
742
729
  readonly "tools.countTimes": "{kind} {count} 次";
743
730
  readonly "tools.run": "工具调用";
731
+ readonly "tools.answeredBy": "由 {name} 代答";
744
732
  readonly "step.thinking": "思考 {n} 次";
745
733
  readonly "step.separator": " · ";
746
734
  readonly "conversation.showEarlier": "显示更早的 {n} 轮(共 {total} 轮)";
@@ -753,7 +741,9 @@ export declare const zhCN: {
753
741
  readonly "questionNav.goTo": "跳转到第 {n} 个问题:{text}";
754
742
  readonly "questionNav.imageMessage": "图片消息";
755
743
  readonly "userMessage.showMore": "展开全文";
756
- readonly "userMessage.fromSideChat": "来自侧边聊天";
744
+ readonly "userMessage.fromChild": "来自子会话";
745
+ readonly "userMessage.fromPlugin": "来自{name}";
746
+ readonly "userMessage.relayedBy": "{name} 转来";
757
747
  readonly "userMessage.showLess": "收起";
758
748
  readonly "conversation.quoteToComposer": "引用到输入框";
759
749
  readonly "composer.quotesTitle": "对话引用";
@@ -767,22 +757,6 @@ export declare const zhCN: {
767
757
  readonly "common.send": "发送";
768
758
  readonly "userMessage.turnRunning": "回合进行中,无法编辑";
769
759
  readonly "userMessage.editResend": "编辑并重新发送";
770
- readonly "taskStrip.queued": "排队中";
771
- readonly "taskStrip.mainBusy": "主会话执行中";
772
- readonly "taskStrip.done": "已完成";
773
- readonly "taskStrip.failedWith": "失败 · {error} · 可重试";
774
- readonly "taskStrip.failed": "失败 · 可重试";
775
- readonly "taskStrip.stalled": "没做完 · 反复做同一个调用后停下 · 可重试";
776
- readonly "taskStrip.maxTurns": "没做完 · 到了轮数上限 · 可重试";
777
- readonly "taskStrip.interrupted": "主会话已暂停,任务一并中断 · 可继续";
778
- readonly "taskStrip.withdrawn": "已撤回";
779
- readonly "taskStrip.runNow": "立即执行";
780
- readonly "taskStrip.withdraw": "撤回,内容回到输入框";
781
- readonly "taskStrip.withdrawOne": "撤回这个任务,内容回到输入框";
782
- readonly "taskStrip.retryOne": "重试这个任务";
783
- readonly "taskStrip.resumeOne": "继续这个任务";
784
- readonly "taskStrip.remove": "从列表移除";
785
- readonly "taskStrip.removeOne": "把这条从列表移除";
786
760
  readonly "sideMessage.reask": "重新提问";
787
761
  readonly "sideMessage.busy": "回答进行中,无法编辑";
788
762
  readonly "sideMessage.editAndReask": "编辑并重新提问";
@@ -876,6 +850,8 @@ export declare const zhCN: {
876
850
  readonly "composer.permissionAsk": "请求批准";
877
851
  readonly "composer.permissionAuto": "帮我批准";
878
852
  readonly "composer.permissionFull": "完全访问";
853
+ readonly "composer.permissionProject": "{mode}:这个项目的 .plume/config.json 要求的";
854
+ readonly "permission.projectNote": "这个项目的 .plume/config.json 要求「{mode}」,这里的对话都按它来。下面改的是本机设置,在这个项目里不会比「{mode}」宽。";
879
855
  readonly "permission.mode": "权限模式";
880
856
  readonly "permission.question": "应如何批准 Plume 操作?";
881
857
  readonly "permission.askDetail": "编辑文件和运行会改动东西的命令时始终询问";
@@ -897,13 +873,33 @@ export declare const zhCN: {
897
873
  readonly "permission.once": "允许一次";
898
874
  readonly "approval.fromChild": "来自「{title}」的请求";
899
875
  readonly "approval.childUntitled": "未命名";
900
- readonly "approval.bash": "执行命令";
901
- readonly "approval.write": "写入文件";
902
- readonly "approval.edit": "修改文件";
903
- readonly "approval.read": "读取文件";
876
+ readonly "approval.command": "执行命令";
877
+ readonly "approval.create": "写入文件";
878
+ readonly "approval.modify": "修改文件";
879
+ readonly "approval.view": "读取文件";
904
880
  readonly "approval.expiresIn": "{time} 后失效";
881
+ readonly "approval.requestUnavailable": "这张卡画不出来(画它的插件停用了或出了错),只能不答。";
882
+ readonly "approval.decline": "不答";
905
883
  readonly "running.waitingForAnswer": "等待你的回答";
906
884
  readonly "composer.plumePlaceholder": "输入消息,/ 命令,@ 引用";
885
+ readonly "contextMeter.usedPercent": "上下文占用 {percent}%";
886
+ readonly "contextMeter.windowUsage": "上下文窗口用量";
887
+ readonly "contextMeter.window": "上下文窗口";
888
+ readonly "contextMeter.usedOfLimit": "{used} / {limit} 个 token";
889
+ readonly "contextMeter.percentUsed": "已用 {percent}%";
890
+ readonly "contextMeter.fileCount": "{n} 个文件";
891
+ readonly "contextMeter.nearLimit": "接近上限,较早的消息会被自动摘要压缩。开新对话可以拿回全部窗口。";
892
+ readonly "contextMeter.used": "上一次请求";
893
+ readonly "contextMeter.remaining": "剩余空间";
894
+ readonly "contextMeter.memoryFiles": "记忆文件";
895
+ readonly "contextMeter.noMemoryFiles": "当前未加载项目指令或记忆";
896
+ readonly "contextMeter.segment.messages": "对话消息";
897
+ readonly "contextMeter.segment.tools": "工具";
898
+ readonly "contextMeter.segment.mcpTools": "MCP 工具";
899
+ readonly "contextMeter.segment.skills": "技能目录";
900
+ readonly "contextMeter.segment.systemPrompt": "系统提示词";
901
+ readonly "contextMeter.segment.conventions": "项目指令";
902
+ readonly "contextMeter.segment.memory": "记忆";
907
903
  readonly "command.slash": "斜杠命令";
908
904
  readonly "command.builtin": "命令";
909
905
  readonly "command.custom": "自定义命令";
@@ -920,6 +916,12 @@ export declare const zhCN: {
920
916
  readonly "general.autoReviewDetail": "开启后命令在沙箱里直接运行,只对检测到的风险操作请求批准,比如递归删除、强制推送、写到项目外。关闭时,只读命令以外的操作都要你批准。";
921
917
  readonly "general.fullAccess": "完全访问";
922
918
  readonly "general.fullAccessDetail": "开启后 Plume 无需批准即可修改文件、执行命令并访问网络。这会显著提高数据丢失或意外行为的风险。";
919
+ readonly "general.alwaysAllowDetail": "在审批卡上点「以后不再问」记下的批准,只存在这台电脑上。撤销后,下次遇到同样的操作会重新询问。";
920
+ readonly "general.alwaysAllowEmpty": "还没有。在审批卡上点「以后不再问」后,批准会列在这里,可以随时撤销。";
921
+ readonly "general.alwaysAllowClear": "全部撤销";
922
+ readonly "general.alwaysAllowRevoke": "撤销";
923
+ readonly "general.alwaysAllowCore": "Plume";
924
+ readonly "general.alwaysAllowRead": "读取 {path}";
923
925
  readonly "general.section": "常规";
924
926
  readonly "general.hideEmptiedProjects": "归档后收起项目";
925
927
  readonly "general.hideEmptiedProjectsDetail": "项目下的会话全部归档后,连项目一起从列表收起。从没有过会话的项目始终保留。";
@@ -967,6 +969,7 @@ export declare const zhCN: {
967
969
  readonly "retry.fixedDetail": "每次大致等这么久,上下浮动两成,免得断线后大家同时重连;服务端明确要求等更久时按服务端(最多 5 分钟)。";
968
970
  readonly "plugins.failed": "加载失败";
969
971
  readonly "plugins.waiting": "等待服务:{services}";
972
+ readonly "plugins.observesAll": "能看到所有会话的运行情况:发给模型的内容、模型的回复、等人答的卡";
970
973
  readonly "about.intro": "查看当前版本、更新内容,手动检查更新、设置自动检查的频率。";
971
974
  readonly "about.checking": "正在检查…";
972
975
  readonly "about.checkInterval": "自动检查更新";
@@ -1,13 +1,15 @@
1
- /** 文件工具留下的本轮净变化;快照和撤销由提供 file.changes 服务的插件负责。 */
1
+ /** 替模型改过的文件:本体记下的改动快照(`ToolResultMessage.changes`)汇总成的净变化、能不能撤销,见 `PluginChanges`。 */
2
2
  export interface ChangeHunk {
3
3
  oldStart: number;
4
4
  newStart: number;
5
- lines: {
6
- type: "context" | "add" | "remove";
7
- text: string;
8
- oldLine?: number;
9
- newLine?: number;
10
- }[];
5
+ lines: ChangeLine[];
6
+ }
7
+ /** diff 里的一行;行号只在那一边有这一行时给。 */
8
+ export interface ChangeLine {
9
+ type: "context" | "add" | "remove";
10
+ text: string;
11
+ oldLine?: number;
12
+ newLine?: number;
11
13
  }
12
14
  export interface ChangedFile {
13
15
  /** 真实绝对路径;界面只在显示时相对化,文件菜单和撤销不丢失工作目录。 */
@@ -27,11 +29,27 @@ export interface FileChangesSummary {
27
29
  files: ChangedFile[];
28
30
  warnings: string[];
29
31
  }
30
- /** 快照标识来自工具结果的 changeId / changeIds,不接受界面传来的文件原文。 */
31
- export interface FileChangesService {
32
- collect(sessionId: string, cwd: string, ids: readonly string[]): Promise<FileChangesSummary>;
33
- /** path 不给时撤销全部;写入前重新校验快照、当前内容和项目边界。 */
34
- undo(sessionId: string, cwd: string, ids: readonly string[], path?: string): Promise<void>;
32
+ /**
33
+ * 工具结果的 `details` 带上这几个字段,就是声明「这次调用改了一个文件,改的是这几处」:转录的通用卡片按它画 diff、写 +N −M,
34
+ * 一段活的那一行把各次的加减合起来。只说这一次改了什么给人看;改了哪些文件、能不能撤销是本体记的 `ToolResultMessage.changes`,
35
+ * 不用工具声明。命令改的文件只有那一份,没有这一份。`details` 里别的字段照旧归插件。
36
+ */
37
+ export interface FileDiffDetails {
38
+ /** 改的是哪个文件,给人看的写法(工作目录里的写相对路径);diff 按它的扩展名配色。 */
39
+ path: string;
40
+ added: number;
41
+ removed: number;
42
+ hunks: ChangeHunk[];
43
+ }
44
+ /**
45
+ * `ctx.changes`:本体记下的改动快照汇总和撤销(交付卡、侧边聊天告诉主会话它改过哪些文件)。快照标识来自工具结果的
46
+ * `ToolResultMessage.changes.ids`,不接受界面传来的文件原文;工作目录用会话自己的。本体提供,别的插件换不掉。
47
+ */
48
+ export interface PluginChanges {
49
+ /** 这组快照的净变化:同一文件只算首次写之前到末次写之后,改回原样的不列;快照读不出来时 `warnings` 不为空。没有这个会话时抛错。 */
50
+ collect(sessionId: string, ids: readonly string[]): Promise<FileChangesSummary>;
51
+ /** 撤销这组快照改过的文件,`path` 不给时全部;写入前重新校验快照、当前内容和项目边界,有一个不对就都不写,抛错的 message 给人看。 */
52
+ undo(sessionId: string, ids: readonly string[], path?: string): Promise<void>;
35
53
  }
36
54
  /** 撤回、编辑重发截掉一段对话时,那段里改过的一个文件。`problem` 为 null 的能安全退回到截断点之前。 */
37
55
  export interface RevertFile {
@@ -30,7 +30,9 @@ export interface SessionObservation {
30
30
  stop: TurnStop;
31
31
  };
32
32
  }
33
- /** 后台进程只按所属会话和任务 id 操作,不能传 pid 或日志路径。 */
33
+ /**
34
+ * 会话里登记着的一项后台任务(`ToolRun.track` 登记的),`ctx.sessions.jobs` 列出的样子。只按所属会话和任务 id 操作,不能传 pid 或日志路径。
35
+ */
34
36
  export interface BackgroundJobInfo {
35
37
  id: string;
36
38
  command: string;
@@ -39,32 +41,32 @@ export interface BackgroundJobInfo {
39
41
  finishedAt?: number;
40
42
  exitCode: number | null;
41
43
  pid?: number;
44
+ /** `stopping`:经 `ctx.sessions.stopJob`(或删会话)叫它停了,还没退出。 */
42
45
  status: "running" | "stopping" | "exited" | "failed";
43
46
  error?: string;
44
- kind?: "monitor";
47
+ /** 每有新输出就叫醒这个会话开一轮(监视命令):人得认得出哪一个在持续花钱。普通后台命令没有。 */
48
+ wakes?: true;
45
49
  }
46
- export interface BackgroundJobsService {
47
- list(sessionId: string): BackgroundJobInfo[];
48
- /** 尾部输出;不标记为模型已读,不消费后台送达。 */
49
- output(sessionId: string, jobId: string): Promise<{
50
- text: string;
51
- done: boolean;
52
- truncated: boolean;
53
- error?: string;
54
- }>;
55
- stop(sessionId: string, jobId: string, force: boolean): boolean;
50
+ /** 一项后台任务的尾部输出(`ctx.sessions.jobOutput`):给人看的,不算模型读过,也不消费它的送达。 */
51
+ export interface BackgroundJobOutput {
52
+ text: string;
53
+ /** 任务结束了、输出也写全了。 */
54
+ done: boolean;
55
+ /** 只给了尾部,前面还有。 */
56
+ truncated: boolean;
57
+ error?: string;
56
58
  }
57
59
  /**
58
- * 模型给一个会话安排的「以后再接着做」:`schedule_wakeup` 的一次性唤醒(`kind: "wakeup"`)或 `cron_create` 的定时触发,还没触发的那一个。
59
- * 只活在 agent 进程的内存里:退出应用、人按停止、撤回或编辑重发都会取消。
60
+ * 一个会话里约好的「以后再接着做」(`ToolRun.schedule`),还没触发的那一个:`kind: "wakeup"` 是到某个时刻的一次性唤醒,
61
+ * `"cron"` 按 cron 表达式触发(一次或循环)。只活在 agent 进程的内存里:退出应用、人按停止、撤回或编辑重发截掉约它的那次调用都会取消。
60
62
  */
61
63
  export interface SessionWakeup {
62
64
  /** `wake-1`、`cron-2`,在会话里唯一。 */
63
65
  id: string;
64
66
  kind: "wakeup" | "cron";
65
- /** 到点时送给模型的那段话,模型写给自己的。 */
67
+ /** 到点时要接着做的事,模型写给自己的。 */
66
68
  prompt: string;
67
- /** 给人看的几个字(一次性唤醒必填);没有时界面用 `prompt` 的第一行。 */
69
+ /** 给人看的几个字;没有时界面用 `prompt` 的第一行。 */
68
70
  reason?: string;
69
71
  /** 5 段 cron 表达式,本地时间;一次性唤醒没有。 */
70
72
  cron?: string;
@@ -77,10 +79,3 @@ export interface SessionWakeup {
77
79
  /** 已经触发过几次。 */
78
80
  fired: number;
79
81
  }
80
- /** 服务 `session.wakeups`:读、取消会话里待触发的定时唤醒。内置插件 plume.tools 提供(它注册 `schedule_wakeup`、`cron_*` 这几件工具)。 */
81
- export interface SessionWakeupsService {
82
- /** 按下一次触发的先后;会话没有、没安排过时是空数组。 */
83
- list(sessionId: string): SessionWakeup[];
84
- /** 取消一个;已经触发了、不存在时返回 false。 */
85
- cancel(sessionId: string, id: string): boolean;
86
- }
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * 共享类型:跨包、跨进程的约定都在这里,只有类型,没有运行时代码。按用途分文件:
3
3
  *
4
- * - `plugin.ts`:插件逻辑入口的 API(钩子、工具、ctx);界面入口的在 `ui.ts`(`@plume/contract/ui`);`resources.ts`:服务 `resources` 的资源地址;
4
+ * - `plugin.ts`:插件逻辑入口的 API(钩子、工具、ctx);界面入口的在 `ui.ts`(`@plume/contract/ui`);`resources.ts`:`ctx.resources` 的资源地址;
5
5
  * - `service.ts`:agent 进程给界面的 AgentService、事件和视图;`usage.ts`:存储页和插件读的使用统计数据;
6
6
  * - `app.ts`:agent 和装配它的应用之间的约定(待加载的插件、日志)。
7
7
  *
8
8
  * 消息类型定义在 `@plume/llm`,在这里转出,使用方一律从 `@plume/contract` 引用。
9
9
  */
10
- export type { ApiFormat, AssistantMessage, DeliveredReport, ImageContent, Message, MessageAttachment, PeerLetter, TextContent, ToolResultMessage, ToolSpec, UserContent, UserMessage, } from "../../core/llm/types.d.ts";
10
+ export type { ApiFormat, AssistantMessage, DeliveredReport, FileChanges, ImageContent, Message, MessageAttachment, PeerLetter, TextContent, ToolResultMessage, ToolSpec, UserContent, UserMessage, } from "../../core/llm/types.d.ts";
11
11
  export type { CallContext } from "../../infra/rpc/src/index.d.ts";
12
12
  export type * from "./app.ts";
13
13
  export type * from "./changes.ts";