@coralai/sps-plugin-api 0.2.0 → 0.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.
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;
@@ -202,6 +231,7 @@ export declare const SPS_SERVICES: {
202
231
  readonly systemPrompt: "sps.systemPrompt";
203
232
  readonly llm: "sps.llm";
204
233
  readonly events: "sps.events";
234
+ readonly projects: "sps.projects";
205
235
  readonly subprocess: "sps.subprocess";
206
236
  readonly attachments: "sps.attachments";
207
237
  readonly media: "sps.media";
@@ -221,6 +251,7 @@ export interface SpsPluginContext {
221
251
  'sps.systemPrompt': SpsSystemPrompt;
222
252
  'sps.llm': SpsLlm;
223
253
  'sps.events': SpsEvents;
254
+ 'sps.projects': SpsProjects;
224
255
  'sps.subprocess': SpsSubprocess;
225
256
  'sps.attachments': SpsAttachments;
226
257
  }
package/dist/index.js CHANGED
@@ -21,6 +21,7 @@ export const SPS_SERVICES = {
21
21
  systemPrompt: 'sps.systemPrompt',
22
22
  llm: 'sps.llm',
23
23
  events: 'sps.events',
24
+ projects: 'sps.projects',
24
25
  subprocess: 'sps.subprocess',
25
26
  attachments: 'sps.attachments',
26
27
  media: 'sps.media',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coralai/sps-plugin-api",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "description": "sps 宿主半区的插件契约:ctx 上那些服务的方法签名。插件装它拿类型。",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",