@coralai/sps-plugin-api 0.2.0 → 0.4.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 +51 -4
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,35 @@ export interface SpsPromptSection {
|
|
|
94
94
|
export interface SpsSystemPrompt {
|
|
95
95
|
section(section: SpsPromptSection): () => void;
|
|
96
96
|
}
|
|
97
|
+
/**
|
|
98
|
+
* 一个项目的**身份**信息。
|
|
99
|
+
*
|
|
100
|
+
* ⚠️ 刻意不带卡片/worker 统计:那些每次都要扫盘。要统计走 HTTP API。
|
|
101
|
+
*/
|
|
102
|
+
export interface SpsProjectRef {
|
|
103
|
+
name: string;
|
|
104
|
+
/** 显示名。无则 null。 */
|
|
105
|
+
label: string | null;
|
|
106
|
+
/**
|
|
107
|
+
* 目录布局用的分段。
|
|
108
|
+
* ⚠️ **不是权限主体** —— sps 里它只决定工作区目录长什么样,不参与任何决策。
|
|
109
|
+
* 要按租户过滤是你自己的事。
|
|
110
|
+
*/
|
|
111
|
+
namespace: string | null;
|
|
112
|
+
/** 创建方标记(`sps` / 平台名)。 */
|
|
113
|
+
origin: string;
|
|
114
|
+
repoDir: string | null;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* 项目注册表(**只读**)。
|
|
118
|
+
*
|
|
119
|
+
* 🔴 v1 不开"建项目" —— 那牵着注册边界那一摊(建项目会改写被认领的树)。
|
|
120
|
+
*/
|
|
121
|
+
export interface SpsProjects {
|
|
122
|
+
list(): Promise<SpsProjectRef[]>;
|
|
123
|
+
/** 不存在返回 `undefined`,**不抛**。 */
|
|
124
|
+
get(name: string): Promise<SpsProjectRef | undefined>;
|
|
125
|
+
}
|
|
97
126
|
export interface SpsEvent {
|
|
98
127
|
/** 事件名。点分层级,订阅时按前缀过滤(`'card.'` 收全部卡片事件)。 */
|
|
99
128
|
type: string;
|
|
@@ -113,11 +142,27 @@ export interface SpsEvent {
|
|
|
113
142
|
* 🔴 **别在回调里做慢事**:宿主不 await 你,但你占着的是发布方的调用栈。
|
|
114
143
|
* 要发网络请求就自己排队。
|
|
115
144
|
*
|
|
116
|
-
*
|
|
145
|
+
* 今天宿主发的(三个前缀,订阅时按前缀过滤):
|
|
117
146
|
* ```
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
147
|
+
* 卡片 —— 发在**写入漏斗**上,不管是流水线改的、界面改的还是 CLI 改的都收得到
|
|
148
|
+
* card.moved { seq, to } card.labeled { seq, label }
|
|
149
|
+
* card.unlabeled { seq, label } card.claimed { seq, slot }
|
|
150
|
+
* card.released { seq } card.created { seq, title, state }
|
|
151
|
+
* card.flagged { seq, label, reason } ← 被标成 NEEDS-FIX / BLOCKED 之类
|
|
152
|
+
*
|
|
153
|
+
* worker —— 发在**引擎判定的那一刻**(它没有写入漏斗:"这个 worker 丢了"是判断)
|
|
154
|
+
* worker.started { seq, slot }
|
|
155
|
+
* worker.stageCompleted { seq, stage, reason }
|
|
156
|
+
* worker.completed { seq, ok, errors? } ← ok 分开报:干完了 vs 干完了但收尾出错
|
|
157
|
+
* worker.failed { seq, reason, exitCode? }
|
|
158
|
+
* worker.lost { seq, reason, recovered }
|
|
159
|
+
* worker.timeout { seq, elapsedHours }
|
|
160
|
+
* worker.retrying { seq, attempt, limit, reason }
|
|
161
|
+
* worker.blocked { seq, limit } ← 重试用尽,要人介入
|
|
162
|
+
* worker.waiting { seq, kind, prompt } ← **要人点头才能继续**
|
|
163
|
+
*
|
|
164
|
+
* pipeline
|
|
165
|
+
* pipeline.started { pid? } pipeline.stopped {} pipeline.completed {}
|
|
121
166
|
* ```
|
|
122
167
|
*/
|
|
123
168
|
export interface SpsEvents {
|
|
@@ -202,6 +247,7 @@ export declare const SPS_SERVICES: {
|
|
|
202
247
|
readonly systemPrompt: "sps.systemPrompt";
|
|
203
248
|
readonly llm: "sps.llm";
|
|
204
249
|
readonly events: "sps.events";
|
|
250
|
+
readonly projects: "sps.projects";
|
|
205
251
|
readonly subprocess: "sps.subprocess";
|
|
206
252
|
readonly attachments: "sps.attachments";
|
|
207
253
|
readonly media: "sps.media";
|
|
@@ -221,6 +267,7 @@ export interface SpsPluginContext {
|
|
|
221
267
|
'sps.systemPrompt': SpsSystemPrompt;
|
|
222
268
|
'sps.llm': SpsLlm;
|
|
223
269
|
'sps.events': SpsEvents;
|
|
270
|
+
'sps.projects': SpsProjects;
|
|
224
271
|
'sps.subprocess': SpsSubprocess;
|
|
225
272
|
'sps.attachments': SpsAttachments;
|
|
226
273
|
}
|
package/dist/index.js
CHANGED