@epoch-agent/core 0.19.0 → 0.20.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
@@ -8280,11 +8280,27 @@ declare function updatePlugin(name: string, opts: InstallOptions): Promise<Insta
8280
8280
 
8281
8281
  /** 市场清单的文件名,同插件清单一样放在根 */
8282
8282
  declare const MARKETPLACE_FILE = "epoch-marketplace.json";
8283
- declare const EntrySchema: z.ZodObject<{
8283
+ /**
8284
+ * 条目**解析之后**的形状 —— {@link EntryShape} 走完「分类那一格归一化成数组」的那一份。
8285
+ *
8286
+ * ## ⚠️ 归一化做在**边界上**,不是让每个消费者各自 `?? []`
8287
+ *
8288
+ * 分类那一格写进文件里有两种形状(字符串 / 数组,判据在它那一格上),而下游三处
8289
+ * 消费者(core 的检索面、server 的网线投影、CLI 的打印)要的是同一个结论。
8290
+ * 让它们各自处理那个联合类型的下场是**漏掉一处**:漏掉的那一处不是报错,
8291
+ * 是"那一条少归了几类"—— 屏幕上少一个桶里的一条,一个字不报。
8292
+ *
8293
+ * ⚠️ **空数组和缺席在归一化之后是同一件事**(都没写分类),所以这儿把 `[]`
8294
+ * 也收掉:下游只需要认一种「没有分类」的形状(判据同 `uploadChoiceHas` 那条
8295
+ * 「全仓只有一处判闭集」)。
8296
+ * ⚠️ 返回的是**新数组**(`[...category]`)而不是原来那个引用:解析产物会被缓存
8297
+ * 下来、也可能被下游就地改动,共享一个数组的话,改一处会改到别人手里那一份。
8298
+ */
8299
+ declare const EntrySchema: z.ZodPipe<z.ZodObject<{
8284
8300
  name: z.ZodString;
8285
8301
  description: z.ZodOptional<z.ZodString>;
8286
8302
  source: z.ZodString;
8287
- category: z.ZodOptional<z.ZodString>;
8303
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8288
8304
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8289
8305
  author: z.ZodOptional<z.ZodObject<{
8290
8306
  name: z.ZodString;
@@ -8309,7 +8325,49 @@ declare const EntrySchema: z.ZodObject<{
8309
8325
  reviewing: "reviewing";
8310
8326
  offline: "offline";
8311
8327
  }>>>;
8312
- }, z.core.$strip>;
8328
+ }, z.core.$strip>, z.ZodTransform<{
8329
+ category?: string[] | undefined;
8330
+ name: string;
8331
+ source: string;
8332
+ description?: string | undefined;
8333
+ keywords?: string[] | undefined;
8334
+ author?: {
8335
+ name: string;
8336
+ email?: string | undefined;
8337
+ url?: string | undefined;
8338
+ } | undefined;
8339
+ downloads?: number | undefined;
8340
+ likes?: number | undefined;
8341
+ displayName?: string | undefined;
8342
+ icon?: string | undefined;
8343
+ version?: string | undefined;
8344
+ changelog?: string | undefined;
8345
+ size?: number | undefined;
8346
+ homepage?: string | undefined;
8347
+ visibility?: "private" | "public" | undefined;
8348
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8349
+ }, {
8350
+ name: string;
8351
+ source: string;
8352
+ description?: string | undefined;
8353
+ category?: string | string[] | undefined;
8354
+ keywords?: string[] | undefined;
8355
+ author?: {
8356
+ name: string;
8357
+ email?: string | undefined;
8358
+ url?: string | undefined;
8359
+ } | undefined;
8360
+ downloads?: number | undefined;
8361
+ likes?: number | undefined;
8362
+ displayName?: string | undefined;
8363
+ icon?: string | undefined;
8364
+ version?: string | undefined;
8365
+ changelog?: string | undefined;
8366
+ size?: number | undefined;
8367
+ homepage?: string | undefined;
8368
+ visibility?: "private" | "public" | undefined;
8369
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8370
+ }>>;
8313
8371
  /**
8314
8372
  * 市场说了算的那几格「要不要印在屏幕上」(2026-09-10)。
8315
8373
  *
@@ -8341,8 +8399,9 @@ declare const DisplaySchema: z.ZodObject<{
8341
8399
  *
8342
8400
  * ## ⚠️ 条目那一侧引用的是**裸 id**,不是一条 `办公/表格` 那样的路径
8343
8401
  *
8344
- * 也就是说 {@link EntrySchema} 的 `category` **一个字都没改** —— 它今天是什么形状
8345
- * 明天还是什么形状,变的只是「那串字符现在可以被这棵树放进层级里」。两条判据:
8402
+ * 也就是说 {@link EntrySchema} 的 `category` 里装的**仍旧是一串 id**(2026-09-28 起
8403
+ * 是**好几个** id),不是一条 `办公/表格` 那样的路径 —— 变的只是「那些字符现在
8404
+ * 可以被这棵树放进层级里」。两条判据:
8346
8405
  *
8347
8406
  * 1. **存量目录加一棵树不用动任何一条插件。** 一份写着 `category: "dev"` 的目录,
8348
8407
  * 只要在顶上补一个 `{ "id": "dev", "label": "开发" }`,那一批条目当场归位。
@@ -8374,11 +8433,11 @@ declare const CatalogSchema: z.ZodObject<{
8374
8433
  fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
8375
8434
  }, z.core.$strip>>;
8376
8435
  categories: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodType<MarketplaceCategoryInput, unknown, z.core.$ZodTypeInternals<MarketplaceCategoryInput, unknown>>>>>;
8377
- plugins: z.ZodArray<z.ZodObject<{
8436
+ plugins: z.ZodArray<z.ZodPipe<z.ZodObject<{
8378
8437
  name: z.ZodString;
8379
8438
  description: z.ZodOptional<z.ZodString>;
8380
8439
  source: z.ZodString;
8381
- category: z.ZodOptional<z.ZodString>;
8440
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8382
8441
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8383
8442
  author: z.ZodOptional<z.ZodObject<{
8384
8443
  name: z.ZodString;
@@ -8403,7 +8462,49 @@ declare const CatalogSchema: z.ZodObject<{
8403
8462
  reviewing: "reviewing";
8404
8463
  offline: "offline";
8405
8464
  }>>>;
8406
- }, z.core.$strip>>;
8465
+ }, z.core.$strip>, z.ZodTransform<{
8466
+ category?: string[] | undefined;
8467
+ name: string;
8468
+ source: string;
8469
+ description?: string | undefined;
8470
+ keywords?: string[] | undefined;
8471
+ author?: {
8472
+ name: string;
8473
+ email?: string | undefined;
8474
+ url?: string | undefined;
8475
+ } | undefined;
8476
+ downloads?: number | undefined;
8477
+ likes?: number | undefined;
8478
+ displayName?: string | undefined;
8479
+ icon?: string | undefined;
8480
+ version?: string | undefined;
8481
+ changelog?: string | undefined;
8482
+ size?: number | undefined;
8483
+ homepage?: string | undefined;
8484
+ visibility?: "private" | "public" | undefined;
8485
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8486
+ }, {
8487
+ name: string;
8488
+ source: string;
8489
+ description?: string | undefined;
8490
+ category?: string | string[] | undefined;
8491
+ keywords?: string[] | undefined;
8492
+ author?: {
8493
+ name: string;
8494
+ email?: string | undefined;
8495
+ url?: string | undefined;
8496
+ } | undefined;
8497
+ downloads?: number | undefined;
8498
+ likes?: number | undefined;
8499
+ displayName?: string | undefined;
8500
+ icon?: string | undefined;
8501
+ version?: string | undefined;
8502
+ changelog?: string | undefined;
8503
+ size?: number | undefined;
8504
+ homepage?: string | undefined;
8505
+ visibility?: "private" | "public" | undefined;
8506
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8507
+ }>>>;
8407
8508
  }, z.core.$strip>;
8408
8509
  declare const RecordSchema: z.ZodObject<{
8409
8510
  name: z.ZodString;
@@ -8420,11 +8521,11 @@ declare const RecordSchema: z.ZodObject<{
8420
8521
  fields: z.ZodOptional<z.ZodArray<z.ZodString>>;
8421
8522
  }, z.core.$strip>>;
8422
8523
  categories: z.ZodCatch<z.ZodOptional<z.ZodArray<z.ZodType<MarketplaceCategoryInput, unknown, z.core.$ZodTypeInternals<MarketplaceCategoryInput, unknown>>>>>;
8423
- plugins: z.ZodArray<z.ZodObject<{
8524
+ plugins: z.ZodArray<z.ZodPipe<z.ZodObject<{
8424
8525
  name: z.ZodString;
8425
8526
  description: z.ZodOptional<z.ZodString>;
8426
8527
  source: z.ZodString;
8427
- category: z.ZodOptional<z.ZodString>;
8528
+ category: z.ZodCatch<z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
8428
8529
  keywords: z.ZodOptional<z.ZodArray<z.ZodString>>;
8429
8530
  author: z.ZodOptional<z.ZodObject<{
8430
8531
  name: z.ZodString;
@@ -8449,7 +8550,49 @@ declare const RecordSchema: z.ZodObject<{
8449
8550
  reviewing: "reviewing";
8450
8551
  offline: "offline";
8451
8552
  }>>>;
8452
- }, z.core.$strip>>;
8553
+ }, z.core.$strip>, z.ZodTransform<{
8554
+ category?: string[] | undefined;
8555
+ name: string;
8556
+ source: string;
8557
+ description?: string | undefined;
8558
+ keywords?: string[] | undefined;
8559
+ author?: {
8560
+ name: string;
8561
+ email?: string | undefined;
8562
+ url?: string | undefined;
8563
+ } | undefined;
8564
+ downloads?: number | undefined;
8565
+ likes?: number | undefined;
8566
+ displayName?: string | undefined;
8567
+ icon?: string | undefined;
8568
+ version?: string | undefined;
8569
+ changelog?: string | undefined;
8570
+ size?: number | undefined;
8571
+ homepage?: string | undefined;
8572
+ visibility?: "private" | "public" | undefined;
8573
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8574
+ }, {
8575
+ name: string;
8576
+ source: string;
8577
+ description?: string | undefined;
8578
+ category?: string | string[] | undefined;
8579
+ keywords?: string[] | undefined;
8580
+ author?: {
8581
+ name: string;
8582
+ email?: string | undefined;
8583
+ url?: string | undefined;
8584
+ } | undefined;
8585
+ downloads?: number | undefined;
8586
+ likes?: number | undefined;
8587
+ displayName?: string | undefined;
8588
+ icon?: string | undefined;
8589
+ version?: string | undefined;
8590
+ changelog?: string | undefined;
8591
+ size?: number | undefined;
8592
+ homepage?: string | undefined;
8593
+ visibility?: "private" | "public" | undefined;
8594
+ status?: "rejected" | "listed" | "reviewing" | "offline" | undefined;
8595
+ }>>>;
8453
8596
  }, z.core.$strip>;
8454
8597
  }, z.core.$strip>;
8455
8598
  type MarketplaceEntry = z.infer<typeof EntrySchema>;
package/dist/index.js CHANGED
@@ -7386,11 +7386,12 @@ async function updatePlugin(name, opts) {
7386
7386
  }
7387
7387
  var MARKETPLACE_FILE = "epoch-marketplace.json";
7388
7388
  var NAME_PATTERN = PLUGIN_NAME_PATTERN;
7389
- var EntrySchema = z.object({
7389
+ var EntryCategoryInput = z.union([z.string().min(1), z.array(z.string().min(1))]).optional().catch(void 0);
7390
+ var EntryShape = z.object({
7390
7391
  name: z.string().regex(NAME_PATTERN),
7391
7392
  description: z.string().min(1).optional(),
7392
7393
  source: z.string().min(1),
7393
- category: z.string().min(1).optional(),
7394
+ category: EntryCategoryInput,
7394
7395
  keywords: z.array(z.string().min(1)).optional(),
7395
7396
  author: PluginAuthorSchema.optional(),
7396
7397
  downloads: z.number().int().nonnegative().optional(),
@@ -7404,6 +7405,10 @@ var EntrySchema = z.object({
7404
7405
  visibility: z.enum(PLUGIN_VISIBILITY).optional().catch(void 0),
7405
7406
  status: z.enum(["listed", "reviewing", "rejected", "offline"]).optional().catch(void 0)
7406
7407
  });
7408
+ var EntrySchema = EntryShape.transform(({ category, ...rest }) => {
7409
+ const picked = category === void 0 ? [] : typeof category === "string" ? [category] : category;
7410
+ return { ...rest, ...picked.length === 0 ? {} : { category: [...picked] } };
7411
+ });
7407
7412
  var MARKETPLACE_DISPLAY_FIELDS = [
7408
7413
  "status",
7409
7414
  "downloads",
@@ -7554,7 +7559,7 @@ function searchMarketplaces(keyword, statePath) {
7554
7559
  const haystack = [
7555
7560
  entry.name,
7556
7561
  entry.description ?? "",
7557
- entry.category ?? "",
7562
+ ...entry.category ?? [],
7558
7563
  entry.author?.name ?? "",
7559
7564
  ...entry.keywords ?? []
7560
7565
  ].join(" ").toLowerCase();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epoch-agent/core",
3
- "version": "0.19.0",
3
+ "version": "0.20.0",
4
4
  "private": false,
5
5
  "description": "epoch-agent 核心引擎:ReAct 循环、Provider 路由、工具调度、记忆管理",
6
6
  "repository": {
@@ -27,8 +27,8 @@
27
27
  "gpt-tokenizer": "^3.4.0",
28
28
  "js-yaml": "^5.2.3",
29
29
  "zod": "^4.4.3",
30
- "@epoch-agent/protocol": "0.19.0",
31
- "@epoch-agent/infra": "0.19.0"
30
+ "@epoch-agent/infra": "0.20.0",
31
+ "@epoch-agent/protocol": "0.20.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@ai-sdk/amazon-bedrock": "^5.0.40",