@steerable/pack-sdk 0.6.56 → 0.6.57

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 (2) hide show
  1. package/package.json +1 -1
  2. package/types/index.d.ts +18 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steerable/pack-sdk",
3
- "version": "0.6.56",
3
+ "version": "0.6.57",
4
4
  "type": "module",
5
5
  "description": "Scenario pack contract for @steerable/agent-shell (pure types, zero runtime). A scenario pack declares every extension a vertical scenario needs — services, tools, tables, skills, agent seeds, HTTP routes, renderer slots, branding — and the host composes the selected packs at build time.",
6
6
  "license": "Apache-2.0",
package/types/index.d.ts CHANGED
@@ -227,6 +227,22 @@ export interface BrandSpec {
227
227
  readonly defaultAgentId: string;
228
228
  }
229
229
 
230
+ /**
231
+ * 包贡献给产品命令行的一个子命令。产品组装根在启动 CLI 时注册。
232
+ * `request` 走进程内宿主,和桌面版同一套路由。
233
+ */
234
+ export interface CliCommandIO {
235
+ write(text: string): void;
236
+ writeError(text: string): void;
237
+ request(method: string, path: string, body?: unknown): Promise<{ status: number; data: unknown }>;
238
+ }
239
+
240
+ export interface CliCommandSpec {
241
+ readonly name: string;
242
+ readonly summary: string;
243
+ readonly run: (args: readonly string[], io: CliCommandIO) => number | Promise<number>;
244
+ }
245
+
230
246
  /** 打包覆盖:产品组装期消费,不进运行时。 */
231
247
  export interface PackagingSpec {
232
248
  readonly appId: string;
@@ -248,6 +264,8 @@ export interface ScenarioPack {
248
264
  readonly main?: MainContribution;
249
265
  readonly renderer?: RendererContribution;
250
266
  readonly packaging?: PackagingSpec;
267
+ /** 命令行子命令。产品组装根注册后,由 agent-cli 在内置命令之后分发。 */
268
+ readonly cliCommands?: () => readonly CliCommandSpec[];
251
269
  }
252
270
 
253
271
  // ─── local-backend 包路由(/api/v2/<包前缀>/*)契约 ───