@coralai/sps-plugin-api 0.4.0 → 0.5.1
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 +50 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,54 @@ 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
|
+
* 失败**抛**(建卡没成功而静默返回,你会以为建好了)。
|
|
134
|
+
*
|
|
135
|
+
* 🔴 **你传的 `labels` 会被核对**:落不上会抛,并把 `seq` 带出来。
|
|
136
|
+
* 底层 `setLabels` 失败是被吞掉的,而回执在某些路径下会拿你传的值填 ——
|
|
137
|
+
* 两处叠加就是"卡建了、label 没落上、回执还说落上了"。
|
|
138
|
+
* 对 `AI-PIPELINE` 那只是"没走流水线";
|
|
139
|
+
* 但拿 label 当**幂等键**时,下一轮找不到键就会**重复建一整套**,全程不报错。
|
|
140
|
+
* ⇒ 这一层替你核过了。抛的时候卡**已经建了**,`seq` 在错误消息里,自己收拾。
|
|
141
|
+
*/
|
|
142
|
+
create(project: string, card: SpsNewCard): Promise<SpsCardRef>;
|
|
143
|
+
list(project: string): Promise<SpsCardRef[]>;
|
|
144
|
+
}
|
|
97
145
|
/**
|
|
98
146
|
* 一个项目的**身份**信息。
|
|
99
147
|
*
|
|
@@ -248,6 +296,7 @@ export declare const SPS_SERVICES: {
|
|
|
248
296
|
readonly llm: "sps.llm";
|
|
249
297
|
readonly events: "sps.events";
|
|
250
298
|
readonly projects: "sps.projects";
|
|
299
|
+
readonly cards: "sps.cards";
|
|
251
300
|
readonly subprocess: "sps.subprocess";
|
|
252
301
|
readonly attachments: "sps.attachments";
|
|
253
302
|
readonly media: "sps.media";
|
|
@@ -268,6 +317,7 @@ export interface SpsPluginContext {
|
|
|
268
317
|
'sps.llm': SpsLlm;
|
|
269
318
|
'sps.events': SpsEvents;
|
|
270
319
|
'sps.projects': SpsProjects;
|
|
320
|
+
'sps.cards': SpsCards;
|
|
271
321
|
'sps.subprocess': SpsSubprocess;
|
|
272
322
|
'sps.attachments': SpsAttachments;
|
|
273
323
|
}
|
package/dist/index.js
CHANGED