@ftai/plugin-host-api 0.0.0-stage → 2.3.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.
Files changed (51) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +4 -2
  3. package/lib/attachments.d.ts +149 -0
  4. package/lib/attachments.js +26 -0
  5. package/lib/capabilities.d.ts +99 -0
  6. package/lib/capabilities.js +21 -0
  7. package/lib/cmdline.d.ts +52 -0
  8. package/lib/cmdline.js +68 -0
  9. package/lib/credentials.d.ts +92 -0
  10. package/lib/credentials.js +41 -0
  11. package/lib/fs.d.ts +117 -0
  12. package/lib/fs.js +14 -0
  13. package/lib/generated.d.ts +4198 -0
  14. package/lib/generated.js +80 -0
  15. package/lib/index.d.ts +665 -0
  16. package/lib/index.js +151 -0
  17. package/lib/jobs.d.ts +88 -0
  18. package/lib/jobs.js +2 -0
  19. package/lib/llm.d.ts +255 -0
  20. package/lib/llm.js +144 -0
  21. package/lib/local-install.d.ts +38 -0
  22. package/lib/local-install.js +9 -0
  23. package/lib/permissions.d.ts +97 -0
  24. package/lib/permissions.js +11 -0
  25. package/lib/platform.d.ts +167 -0
  26. package/lib/platform.js +74 -0
  27. package/lib/porting.d.ts +51 -0
  28. package/lib/porting.js +752 -0
  29. package/lib/prompt.d.ts +117 -0
  30. package/lib/prompt.js +43 -0
  31. package/lib/runtime-context.d.ts +29 -0
  32. package/lib/runtime-context.js +6 -0
  33. package/lib/schedule-types.d.ts +333 -0
  34. package/lib/schedule-types.js +4 -0
  35. package/lib/session-events.d.ts +194 -0
  36. package/lib/session-events.js +2 -0
  37. package/lib/sessions.d.ts +246 -0
  38. package/lib/sessions.js +2 -0
  39. package/lib/settings.d.ts +86 -0
  40. package/lib/settings.js +13 -0
  41. package/lib/storage.d.ts +144 -0
  42. package/lib/storage.js +62 -0
  43. package/lib/subagents.d.ts +57 -0
  44. package/lib/subagents.js +17 -0
  45. package/lib/subprocess.d.ts +97 -0
  46. package/lib/subprocess.js +8 -0
  47. package/lib/tools.d.ts +212 -0
  48. package/lib/tools.js +2 -0
  49. package/lib/web.d.ts +192 -0
  50. package/lib/web.js +53 -0
  51. package/package.json +40 -3
@@ -0,0 +1,117 @@
1
+ /**
2
+ * 系统提示词(0.12 的 `ctx.systemPrompt`,0.12 的 `system-prompt` 包):名字与写法照 0.12。
3
+ *
4
+ * 与 0.12 不同的地方:
5
+ * - 组装在宿主上,插件在另一个进程:函数形式的段、运行环境段、变量与工具提供者在每一步组装之前经回调取好,可以返回 Promise;取值失败或
6
+ * 超时(30 秒)时这一轮以错误结束,不会缺段或少工具地继续;
7
+ * - `{{变量}}` 只在写了 `interpolate: true` 的段与运行环境段里替换,不写时文本原样保留(0.12 不写就替换);
8
+ * - 运行环境段不写 `required` 时不可收起(0.12 不写就能收起),写 `required: false` 才是可选的;沙箱与审批说明的名字保留给宿主;
9
+ * - `tools` 与 `system-prompt/assemble` 给出的工具都要有执行者:名字得是这个 agent 看得到的工具(`ctx.tools.register` 注册的),否则这一轮
10
+ * 以错误结束。0.12 只给 schema 的工具到调用时才报 `UNKNOWN_TOOL`;同名的 schema 同 0.12 不去重;
11
+ * - `refreshContext` 跨进程,返回 Promise;`AssembleContext` 只有 `agent`、`scope`、`signal`,插件自己加的字段不跨进程。
12
+ * @module
13
+ */
14
+ import type { AgentHandle } from './index.ts';
15
+ import type { PromptAssembly, ToolProviderResult } from './generated.ts';
16
+ /** 提示词段的位置(同 0.12,FtAi 自己的段沿用这些数字)。 */
17
+ export declare const SECTION_ORDERS: {
18
+ readonly HARNESS_IDENTITY: -1000;
19
+ readonly DEPLOYMENT_PERSONA_PREFIX: 0;
20
+ readonly PLAN_POLICY: 500;
21
+ readonly TEAM_POLICY: 600;
22
+ readonly PTC_ONLY: 800;
23
+ readonly FILE_REFERENCE: 900;
24
+ readonly TOOL_BASH: 1000;
25
+ readonly TOOL_PWSH: 1010;
26
+ readonly TOOL_READ: 1100;
27
+ readonly TOOL_WRITE: 1200;
28
+ readonly TOOL_EDIT: 1300;
29
+ readonly TOOL_GLOB: 1400;
30
+ readonly TOOL_GREP: 1500;
31
+ readonly TOOL_JOBS: 1600;
32
+ readonly TOOL_PTY: 1700;
33
+ readonly TOOL_WEB_SEARCH: 2000;
34
+ readonly TOOL_WEB_FETCH: 2100;
35
+ readonly TOOL_LSP: 2200;
36
+ readonly TOOL_SESSION_QUERY: 2300;
37
+ readonly TOOL_GOAL: 2400;
38
+ readonly TOOL_WORKFLOW: 2600;
39
+ readonly TOOL_RALPH: 2700;
40
+ readonly TOOL_SUBAGENT: 2800;
41
+ readonly TOOL_REPORT: 2900;
42
+ readonly TOOL_COMPUTER_USE: 3000;
43
+ readonly MCP_SERVERS: 3100;
44
+ readonly TOOLS_SDK: 5000;
45
+ readonly DELIVERABLE_FILE_REFERENCES: 9000;
46
+ readonly STRUCTURED_OUTPUT: 9900;
47
+ readonly HARNESS_SOURCE: 10000;
48
+ readonly WEB_SURFACE: 10100;
49
+ readonly DEPLOYMENT_PERSONA_SUFFIX: 10200;
50
+ };
51
+ /** 运行环境段的位置(同 0.12)。 */
52
+ export declare const CONTEXT_ORDERS: {
53
+ readonly WORKING_DIRECTORY: 100;
54
+ readonly SANDBOX_POLICY: 110;
55
+ readonly APPROVAL_POLICY: 115;
56
+ readonly SUBAGENT_DELEGATION: 120;
57
+ };
58
+ export type PromptSectionOrderName = keyof typeof SECTION_ORDERS;
59
+ export type PromptContextOrderName = keyof typeof CONTEXT_ORDERS;
60
+ /** 一次组装的上下文:取值函数与 `system-prompt/assemble` 的监听者收到它。 */
61
+ export interface AssembleContext {
62
+ /** 这次组装所属的 agent;不带 agent 的显式组装里没有,只有全局的注册参与。 */
63
+ readonly agent?: AgentHandle;
64
+ /** 同 `agent`(0.12 的作用域键)。 */
65
+ readonly scope?: AgentHandle;
66
+ /** 宿主不再等这次组装(这一轮取消或超时)时触发,只对这一次有效。 */
67
+ readonly signal?: AbortSignal;
68
+ }
69
+ /** 取值函数:同 0.12,另外可以返回 Promise。 */
70
+ type Provide<T> = (context: AssembleContext) => T | Promise<T>;
71
+ export interface PromptSection {
72
+ /** 同一层(全局,或同一个 agent)里重名时注册失败;agent 的段遮蔽同名的全局段。 */
73
+ readonly name: string;
74
+ /** 整数,小的在前;相同时按名字。 */
75
+ readonly order: number;
76
+ readonly text: string | Provide<string>;
77
+ /** 写 true 才替换 `{{变量}}`。引用写错、没有定义或这一步没有值时这一轮以错误结束。 */
78
+ readonly interpolate?: boolean;
79
+ /** 这一段就是完整的系统提示;同时生效的多于一段时这一轮以错误结束。 */
80
+ readonly complete?: boolean;
81
+ }
82
+ export interface PromptContext {
83
+ readonly name: string;
84
+ readonly order: number;
85
+ /** 空串表示这一步没有这一段。 */
86
+ readonly text: string | Provide<string>;
87
+ readonly interpolate?: boolean;
88
+ /** 写 false 才是可选的段:能被 `suppressRuntimeContext` 收起,能被 `system-prompt/assemble` 去掉。 */
89
+ readonly required?: boolean;
90
+ }
91
+ export interface SystemPromptService {
92
+ section(section: PromptSection): () => void;
93
+ getSectionOrder(name: PromptSectionOrderName): number;
94
+ getContextOrder(name: PromptContextOrderName): number;
95
+ context(context: PromptContext): () => void;
96
+ /** 收起可选的运行环境段(沙箱与审批的说明不可收起),在 `agent.ctx` 上调用时只对那个 agent 生效。 */
97
+ suppressRuntimeContext(): () => void;
98
+ /** 每一步取一次;给出的名字必须是这个 agent 看得到的工具。 */
99
+ tools(provider: Provide<ToolProviderResult>): () => void;
100
+ /** 名字要符合 `[a-z][a-z0-9_]*`。可以返回 undefined:引用它的段让这一轮以错误结束。 */
101
+ variable(name: string, provider: Provide<string | undefined>): () => void;
102
+ /** 形状有变:0.12 里是同步的。按已接受的组装刷新运行环境段。 */
103
+ refreshContext(assembly: PromptAssembly, context?: AssembleContext): Promise<PromptAssembly>;
104
+ /** 只读地组装一次:取值、跑瀑布,不写会话。`context.scope` 给出 agent,不给时只有全局的注册。 */
105
+ assemble(context?: AssembleContext): Promise<PromptAssembly>;
106
+ }
107
+ declare module 'cordis' {
108
+ interface Events {
109
+ /**
110
+ * 每一步组装之前的瀑布:调用 `next` 得到下游的组装,返回值就是这次的组装,可以改身份段(`deployment:persona-prefix`)。之后宿主恢复完整段;没有完整段时回复语言段
111
+ * (`deployment:reply-language`)原样固定回身份段之后,改写、去掉都不生效;运行环境段按注册的取值
112
+ * 刷新(改文字不生效),只有瀑布加上的段保留,去掉的不可收起的段补回;工具只认有执行者的。超时(60 秒)或插件进程不在时这一轮以错误结束。
113
+ */
114
+ 'system-prompt/assemble'(assembly: PromptAssembly, context: AssembleContext, next: () => Promise<PromptAssembly>): Promise<PromptAssembly> | PromptAssembly;
115
+ }
116
+ }
117
+ export {};
package/lib/prompt.js ADDED
@@ -0,0 +1,43 @@
1
+ /** 提示词段的位置(同 0.12,FtAi 自己的段沿用这些数字)。 */
2
+ export const SECTION_ORDERS = {
3
+ HARNESS_IDENTITY: -1000,
4
+ DEPLOYMENT_PERSONA_PREFIX: 0,
5
+ PLAN_POLICY: 500,
6
+ TEAM_POLICY: 600,
7
+ PTC_ONLY: 800,
8
+ FILE_REFERENCE: 900,
9
+ TOOL_BASH: 1000,
10
+ TOOL_PWSH: 1010,
11
+ TOOL_READ: 1100,
12
+ TOOL_WRITE: 1200,
13
+ TOOL_EDIT: 1300,
14
+ TOOL_GLOB: 1400,
15
+ TOOL_GREP: 1500,
16
+ TOOL_JOBS: 1600,
17
+ TOOL_PTY: 1700,
18
+ TOOL_WEB_SEARCH: 2000,
19
+ TOOL_WEB_FETCH: 2100,
20
+ TOOL_LSP: 2200,
21
+ TOOL_SESSION_QUERY: 2300,
22
+ TOOL_GOAL: 2400,
23
+ TOOL_WORKFLOW: 2600,
24
+ TOOL_RALPH: 2700,
25
+ TOOL_SUBAGENT: 2800,
26
+ TOOL_REPORT: 2900,
27
+ TOOL_COMPUTER_USE: 3000,
28
+ MCP_SERVERS: 3100,
29
+ TOOLS_SDK: 5000,
30
+ DELIVERABLE_FILE_REFERENCES: 9000,
31
+ STRUCTURED_OUTPUT: 9900,
32
+ HARNESS_SOURCE: 10000,
33
+ WEB_SURFACE: 10100,
34
+ DEPLOYMENT_PERSONA_SUFFIX: 10200,
35
+ };
36
+ /** 运行环境段的位置(同 0.12)。 */
37
+ export const CONTEXT_ORDERS = {
38
+ WORKING_DIRECTORY: 100,
39
+ SANDBOX_POLICY: 110,
40
+ APPROVAL_POLICY: 115,
41
+ SUBAGENT_DELEGATION: 120,
42
+ };
43
+ //# sourceMappingURL=prompt.js.map
@@ -0,0 +1,29 @@
1
+ /**
2
+ * 插件进程本身给插件的两件事:remote 方法里读这次调用(`ctx.invocation`),进程结束前的通知(`exit`)。
3
+ * @module
4
+ */
5
+ /** 这次 remote 调用(0.12 的 `RemoteInvocation`,没有 `peer`、`uplink`;`args` 按位置,不含最后的 `signal`)。 */
6
+ export interface RemoteCallInvocation {
7
+ readonly request: {
8
+ readonly namespace: string;
9
+ readonly method: string;
10
+ readonly args: readonly unknown[];
11
+ };
12
+ /** 接这次调用的服务名。 */
13
+ readonly service: string;
14
+ /** 界面取消时触发,同方法的最后一个参数。 */
15
+ readonly signal: AbortSignal;
16
+ }
17
+ declare module 'cordis' {
18
+ interface Context {
19
+ /** `@Remote` 方法(含流式方法的迭代)与它发起的异步链路里是这次调用,其余地方是 undefined。 */
20
+ readonly invocation: RemoteCallInvocation | undefined;
21
+ }
22
+ interface Events {
23
+ /**
24
+ * 宿主结束插件进程之前(应用退出、装卸插件换进程)通知,`signal` 恒为 `SIGTERM`;之后撤销各插件。监听者最多等 1 秒,
25
+ * 进程崩溃时送不到。收尾放进 `ctx.effect` 更合适:停用插件时也会跑。
26
+ */
27
+ exit(signal: 'SIGTERM'): void | Promise<void>;
28
+ }
29
+ }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 插件进程本身给插件的两件事:remote 方法里读这次调用(`ctx.invocation`),进程结束前的通知(`exit`)。
3
+ * @module
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=runtime-context.js.map
@@ -0,0 +1,333 @@
1
+ /**
2
+ * 一个任务的记录。`scheduledAt` 是下一次(重复任务是最早还没投递的那次)的 UTC 时刻。
3
+ */
4
+ export type ScheduleRecord = {
5
+ id: string;
6
+ /**
7
+ * 任务名:trim 过、非空、不超过 120 个字符。
8
+ */
9
+ title: string;
10
+ prompt: string;
11
+ /**
12
+ * 四位年份的 RFC 3339 UTC 时刻(三位毫秒)。
13
+ */
14
+ scheduledAt: string;
15
+ } & ({
16
+ "kind": "after";
17
+ afterSeconds: number;
18
+ } | {
19
+ "kind": "at";
20
+ } | {
21
+ "kind": "every";
22
+ everySeconds: number;
23
+ } | {
24
+ "kind": "daily";
25
+ time: string;
26
+ timeZone: string;
27
+ } | {
28
+ "kind": "weekly";
29
+ time: string;
30
+ timeZone: string;
31
+ weekdays: Array<number>;
32
+ } | {
33
+ "kind": "cron";
34
+ expression: string;
35
+ timeZone: string;
36
+ });
37
+ /**
38
+ * 界面的目录里的一项:记录加上绑定的会话、状态与最后一次投递。
39
+ */
40
+ export type ScheduleCatalogEntry = {
41
+ /**
42
+ * 到点时投递到的会话。
43
+ */
44
+ sessionId: string;
45
+ status: ScheduleTaskStatus;
46
+ /**
47
+ * 最近一次被会话落盘确认的投递;还没投递过时没有。
48
+ */
49
+ lastDelivery?: ScheduleDeliveryReceipt;
50
+ id: string;
51
+ /**
52
+ * 任务名:trim 过、非空、不超过 120 个字符。
53
+ */
54
+ title: string;
55
+ prompt: string;
56
+ /**
57
+ * 四位年份的 RFC 3339 UTC 时刻(三位毫秒)。
58
+ */
59
+ scheduledAt: string;
60
+ } & ({
61
+ "kind": "after";
62
+ afterSeconds: number;
63
+ } | {
64
+ "kind": "at";
65
+ } | {
66
+ "kind": "every";
67
+ everySeconds: number;
68
+ } | {
69
+ "kind": "daily";
70
+ time: string;
71
+ timeZone: string;
72
+ } | {
73
+ "kind": "weekly";
74
+ time: string;
75
+ timeZone: string;
76
+ weekdays: Array<number>;
77
+ } | {
78
+ "kind": "cron";
79
+ expression: string;
80
+ timeZone: string;
81
+ });
82
+ /**
83
+ * 一次投递的回执:投的是哪一次、什么时候投进会话、消息 id(同一批一起到期的重复任务共用一条消息)。
84
+ */
85
+ export type ScheduleDeliveryReceipt = {
86
+ scheduledAt: string;
87
+ deliveredAt: string;
88
+ messageId: string;
89
+ };
90
+ /**
91
+ * 任务的状态:`active` 按时投递,`paused` 由用户暂停(不投递、不参与定时),`inactive` 已经结束(一次性任务投递之后,
92
+ * 或重复任务没有可表示的下一次)。
93
+ */
94
+ export type ScheduleTaskStatus = "active" | "paused" | "inactive";
95
+ /**
96
+ * 发送记录里的一条:回执加上当时发出的指令(旧数据只记了回执,没有指令)。
97
+ */
98
+ export type ScheduleDeliveryRecord = {
99
+ prompt?: string;
100
+ scheduledAt: string;
101
+ deliveredAt: string;
102
+ messageId: string;
103
+ };
104
+ /**
105
+ * 只改时间:种类可以与原来的不同,一次性的时刻用 `at`。
106
+ */
107
+ export type ScheduleTimingChange = {
108
+ "kind": "at";
109
+ at: AtInput;
110
+ } | {
111
+ "kind": "every";
112
+ every_seconds: number;
113
+ } | {
114
+ "kind": "daily";
115
+ daily: DailyInput;
116
+ } | {
117
+ "kind": "weekly";
118
+ weekly: WeeklyInput;
119
+ } | {
120
+ "kind": "cron";
121
+ cron: CronInput;
122
+ };
123
+ /**
124
+ * 一次性的时刻:带偏移的 RFC 3339 字符串,或本地日历时刻。
125
+ */
126
+ export type AtInput = string | LocalAtInput;
127
+ /**
128
+ * `at` 的本地日历写法。
129
+ */
130
+ export type LocalAtInput = {
131
+ /**
132
+ * 四位年份的 ISO 日期。
133
+ */
134
+ date: string;
135
+ /**
136
+ * 本地钟点 `HH:mm:ss`,可带一到三位小数。
137
+ */
138
+ time: string;
139
+ /**
140
+ * `UTC` 或 IANA 的 Area/Location 时区名。
141
+ */
142
+ time_zone: string;
143
+ };
144
+ /**
145
+ * 五段 cron(分 时 日 月 星期),在给出的时区里算。
146
+ */
147
+ export type CronInput = {
148
+ expression: string;
149
+ /**
150
+ * `UTC` 或 IANA 的 Area/Location 时区名。
151
+ */
152
+ time_zone: string;
153
+ };
154
+ /**
155
+ * 每天的本地钟点。
156
+ */
157
+ export type DailyInput = {
158
+ /**
159
+ * 本地钟点 `HH:mm:ss`,可带一到三位小数。
160
+ */
161
+ time: string;
162
+ /**
163
+ * `UTC` 或 IANA 的 Area/Location 时区名。
164
+ */
165
+ time_zone: string;
166
+ };
167
+ /**
168
+ * 每周的本地钟点与星期。
169
+ */
170
+ export type WeeklyInput = {
171
+ /**
172
+ * 本地钟点 `HH:mm:ss`,可带一到三位小数。
173
+ */
174
+ time: string;
175
+ /**
176
+ * `UTC` 或 IANA 的 Area/Location 时区名。
177
+ */
178
+ time_zone: string;
179
+ /**
180
+ * 非空的 ISO 星期集合,周一 1 到周日 7,不重复。
181
+ */
182
+ weekdays: Array<number>;
183
+ };
184
+ /**
185
+ * 输入不合规时的错误值,与模型工具返回的同一套:`invalid_prompt`、`invalid_selector`、`invalid_rule`、
186
+ * `invalid_time_zone`、`not_future`、`time_out_of_range`、`frequency_too_high`、`subagent_session`。
187
+ */
188
+ export type ScheduleToolError = {
189
+ code: string;
190
+ /**
191
+ * 英文说明(同 0.12),界面按 `code` 翻译。
192
+ */
193
+ message: string;
194
+ };
195
+ /**
196
+ * 没做成的原因:找不到这个任务(或它不属于这个会话)、任务已结束、调用方看到的记录已经不是现在的,或者翻页的游标
197
+ * 找不到了。
198
+ */
199
+ export type ScheduleMissCode = "schedule_not_found" | "schedule_ended" | "schedule_conflict" | "delivery_cursor_not_found";
200
+ /**
201
+ * 定位一个任务:任务 id 与它绑定的会话(宿主按两者一起核对)。暂停、恢复、立即运行与删除用它。
202
+ */
203
+ export type ScheduleTaskRequest = {
204
+ sessionId: string;
205
+ id: string;
206
+ };
207
+ /**
208
+ * 建任务的名字、指令与恰好一种规则(模型工具 `schedule_create` 的参数)。
209
+ */
210
+ export type ScheduleCreateRequest = {
211
+ /**
212
+ * 到点时的提醒内容,trim 之后非空。
213
+ */
214
+ prompt: string;
215
+ /**
216
+ * 任务名:trim 之后非空,不超过 120 个字符。
217
+ */
218
+ title: string;
219
+ /**
220
+ * 一次性:从现在起的秒数。
221
+ */
222
+ after_seconds?: number | null;
223
+ /**
224
+ * 一次性:指定的时刻。
225
+ */
226
+ at?: AtInput | null;
227
+ /**
228
+ * 重复:固定间隔的秒数。
229
+ */
230
+ every_seconds?: number | null;
231
+ daily?: DailyInput | null;
232
+ weekly?: WeeklyInput | null;
233
+ cron?: CronInput | null;
234
+ };
235
+ /**
236
+ * 先核对再修改:给出的名字、指令与时间替换原来的,没给的不变。
237
+ */
238
+ export type ScheduleUpdateRequest = {
239
+ sessionId: string;
240
+ id: string;
241
+ /**
242
+ * 打开编辑时看到的整份记录(含已定的下一次)。
243
+ */
244
+ expected: ScheduleRecord;
245
+ /**
246
+ * 新的时间;没给时保留已定的下一次。
247
+ */
248
+ change?: ScheduleTimingChange | null;
249
+ /**
250
+ * 新的任务名(trim 之后非空,不超过 120 个字符);没给时不变。
251
+ */
252
+ title?: string | null;
253
+ /**
254
+ * 新的指令(trim 之后非空);没给时不变。
255
+ */
256
+ prompt?: string | null;
257
+ };
258
+ /**
259
+ * 修改的结果。
260
+ */
261
+ export type ScheduleUpdateResult = {
262
+ id: string;
263
+ updated: boolean;
264
+ record: ScheduleRecord;
265
+ } | {
266
+ id: string;
267
+ updated: boolean;
268
+ code: ScheduleMissCode;
269
+ } | ScheduleToolError;
270
+ /**
271
+ * 删除的结果:删掉了,或者找不到(`deleted` 为 false 时带 `code`)。
272
+ */
273
+ export type ScheduleDeleteResult = {
274
+ id: string;
275
+ deleted: boolean;
276
+ code?: ScheduleMissCode;
277
+ };
278
+ /**
279
+ * 发送记录的一页(从新到旧)。
280
+ */
281
+ export type ScheduleDeliveryHistoryRequest = {
282
+ sessionId: string;
283
+ id: string;
284
+ /**
285
+ * 一页的条数:1 到 100 的安全整数。
286
+ */
287
+ limit: number;
288
+ /**
289
+ * 上一页最后一条的消息 id(这一页不含它);没给时从最新的开始。
290
+ */
291
+ before?: string | null;
292
+ };
293
+ /**
294
+ * 发送记录的一页,或找不到任务、找不到游标。
295
+ */
296
+ export type ScheduleDeliveryHistoryResult = ScheduleDeliveryHistoryPage | ScheduleMiss;
297
+ /**
298
+ * 发送记录的一页,从新到旧。
299
+ */
300
+ export type ScheduleDeliveryHistoryPage = {
301
+ id: string;
302
+ records: Array<ScheduleDeliveryRecord>;
303
+ /**
304
+ * 更早的记录可能看不到了(旧数据只有最后一次,或者被裁掉过);缺的回执不会补出来。
305
+ */
306
+ earlierRecordsUnavailable: boolean;
307
+ /**
308
+ * 追加时裁掉过记录才为 true;旧数据里没有这项时为 false。
309
+ */
310
+ earlierRecordsPruned: boolean;
311
+ /**
312
+ * 宿主现在的保留设置(追加发送记录时按它裁剪)。
313
+ */
314
+ retention: DeliveryRetentionBounds;
315
+ /**
316
+ * 这一页最早一条的消息 id,只在还有更早的记录时给出;作为下一页的 `before`。
317
+ */
318
+ nextBefore?: string;
319
+ };
320
+ /**
321
+ * 发送记录的保留:天数窗口(从追加的这次投递往回算)与每个任务的条数上限(留最新的)。
322
+ */
323
+ export type DeliveryRetentionBounds = {
324
+ days: number;
325
+ records: number;
326
+ };
327
+ /**
328
+ * 没做成,任务不变。
329
+ */
330
+ export type ScheduleMiss = {
331
+ id: string;
332
+ code: ScheduleMissCode;
333
+ };
@@ -0,0 +1,4 @@
1
+ // 由 Rust 宿主 ftai-plugin-schedule 的边界类型生成,不要手改:改了类型之后运行
2
+ // UPDATE_GENERATED=1 cargo test --manifest-path apps/rust-host/Cargo.toml -p ftai-plugin-schedule --test typescript
3
+ export {};
4
+ //# sourceMappingURL=schedule-types.js.map