@coralai/sps-plugin-api 0.3.0 → 0.5.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.
- package/dist/index.d.ts +61 -4
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,45 @@ export interface SpsPromptSection {
|
|
|
94
94
|
export interface SpsSystemPrompt {
|
|
95
95
|
section(section: SpsPromptSection): () => void;
|
|
96
96
|
}
|
|
97
|
+
/** 建一张卡。形状照 MCP 面上的 `add_card`,不另发明。 */
|
|
98
|
+
export interface SpsNewCard {
|
|
99
|
+
title: string;
|
|
100
|
+
description?: string;
|
|
101
|
+
skills?: string[];
|
|
102
|
+
/** `['AI-PIPELINE']` 让它走流水线;缺省不走。 */
|
|
103
|
+
labels?: string[];
|
|
104
|
+
/** 执行波次(正整数)。缺省 = seq(串行)。 */
|
|
105
|
+
order?: number;
|
|
106
|
+
/** 只接受 `'tool' | 'join'`;缺省即 worker。 */
|
|
107
|
+
kind?: 'tool' | 'join';
|
|
108
|
+
tool?: string;
|
|
109
|
+
input?: Record<string, unknown>;
|
|
110
|
+
checklist?: string[];
|
|
111
|
+
}
|
|
112
|
+
export interface SpsCardRef {
|
|
113
|
+
seq: number;
|
|
114
|
+
title: string;
|
|
115
|
+
state: string;
|
|
116
|
+
order: number;
|
|
117
|
+
labels: string[];
|
|
118
|
+
skills: string[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* 卡片(**建 / 列**)。
|
|
122
|
+
*
|
|
123
|
+
* 🔴 它存在的理由是"知识住哪":按你自己的规则建卡(几张、什么内容),
|
|
124
|
+
* 而 sps **不必认识那些规则**。你在进程内,读工作区文件直接用 fs,
|
|
125
|
+
* 不需要 sps 开 HTTP 读口、也不需要一张越长越长的文件白名单。
|
|
126
|
+
*
|
|
127
|
+
* ⚠️ **幂等归你**:建卡天然不幂等(建两次就是两张),而"什么算重复"只有你知道。
|
|
128
|
+
* 用 `list` 自己判 —— 别指望这一层替你去重。
|
|
129
|
+
* ⚠️ 不开 move / delete:那些是流水线在做的事,掺进来就有两个写入方。
|
|
130
|
+
*/
|
|
131
|
+
export interface SpsCards {
|
|
132
|
+
/** 失败**抛**(建卡没成功而静默返回,你会以为建好了)。 */
|
|
133
|
+
create(project: string, card: SpsNewCard): Promise<SpsCardRef>;
|
|
134
|
+
list(project: string): Promise<SpsCardRef[]>;
|
|
135
|
+
}
|
|
97
136
|
/**
|
|
98
137
|
* 一个项目的**身份**信息。
|
|
99
138
|
*
|
|
@@ -142,11 +181,27 @@ export interface SpsEvent {
|
|
|
142
181
|
* 🔴 **别在回调里做慢事**:宿主不 await 你,但你占着的是发布方的调用栈。
|
|
143
182
|
* 要发网络请求就自己排队。
|
|
144
183
|
*
|
|
145
|
-
*
|
|
184
|
+
* 今天宿主发的(三个前缀,订阅时按前缀过滤):
|
|
146
185
|
* ```
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
186
|
+
* 卡片 —— 发在**写入漏斗**上,不管是流水线改的、界面改的还是 CLI 改的都收得到
|
|
187
|
+
* card.moved { seq, to } card.labeled { seq, label }
|
|
188
|
+
* card.unlabeled { seq, label } card.claimed { seq, slot }
|
|
189
|
+
* card.released { seq } card.created { seq, title, state }
|
|
190
|
+
* card.flagged { seq, label, reason } ← 被标成 NEEDS-FIX / BLOCKED 之类
|
|
191
|
+
*
|
|
192
|
+
* worker —— 发在**引擎判定的那一刻**(它没有写入漏斗:"这个 worker 丢了"是判断)
|
|
193
|
+
* worker.started { seq, slot }
|
|
194
|
+
* worker.stageCompleted { seq, stage, reason }
|
|
195
|
+
* worker.completed { seq, ok, errors? } ← ok 分开报:干完了 vs 干完了但收尾出错
|
|
196
|
+
* worker.failed { seq, reason, exitCode? }
|
|
197
|
+
* worker.lost { seq, reason, recovered }
|
|
198
|
+
* worker.timeout { seq, elapsedHours }
|
|
199
|
+
* worker.retrying { seq, attempt, limit, reason }
|
|
200
|
+
* worker.blocked { seq, limit } ← 重试用尽,要人介入
|
|
201
|
+
* worker.waiting { seq, kind, prompt } ← **要人点头才能继续**
|
|
202
|
+
*
|
|
203
|
+
* pipeline
|
|
204
|
+
* pipeline.started { pid? } pipeline.stopped {} pipeline.completed {}
|
|
150
205
|
* ```
|
|
151
206
|
*/
|
|
152
207
|
export interface SpsEvents {
|
|
@@ -232,6 +287,7 @@ export declare const SPS_SERVICES: {
|
|
|
232
287
|
readonly llm: "sps.llm";
|
|
233
288
|
readonly events: "sps.events";
|
|
234
289
|
readonly projects: "sps.projects";
|
|
290
|
+
readonly cards: "sps.cards";
|
|
235
291
|
readonly subprocess: "sps.subprocess";
|
|
236
292
|
readonly attachments: "sps.attachments";
|
|
237
293
|
readonly media: "sps.media";
|
|
@@ -252,6 +308,7 @@ export interface SpsPluginContext {
|
|
|
252
308
|
'sps.llm': SpsLlm;
|
|
253
309
|
'sps.events': SpsEvents;
|
|
254
310
|
'sps.projects': SpsProjects;
|
|
311
|
+
'sps.cards': SpsCards;
|
|
255
312
|
'sps.subprocess': SpsSubprocess;
|
|
256
313
|
'sps.attachments': SpsAttachments;
|
|
257
314
|
}
|
package/dist/index.js
CHANGED