@dsh-workbench/core 1.1.15 → 1.1.16

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/dist/host/index.js +22 -16
  2. package/package.json +3 -3
@@ -12405,30 +12405,36 @@ function argvOf(command, session, args) {
12405
12405
  "background"
12406
12406
  ];
12407
12407
  }
12408
+ function parsedRecord(text) {
12409
+ let parsed;
12410
+ try {
12411
+ parsed = JSON.parse(text);
12412
+ } catch {
12413
+ return;
12414
+ }
12415
+ return plainOf(parsed);
12416
+ }
12417
+ function withoutStatic(record) {
12418
+ const inside = (Array.isArray(record["entries"]) ? record["entries"] : []).filter((one) => !STATIC_URL.test(String(plainOf(one)?.["url"] ?? "")));
12419
+ return inside.length === 0 ? "" : JSON.stringify({
12420
+ ...record,
12421
+ entries: inside
12422
+ });
12423
+ }
12408
12424
  function filterStaticLines(raw) {
12425
+ const document = parsedRecord(raw.trim());
12426
+ if (document !== void 0 && Array.isArray(document["entries"])) return withoutStatic(document);
12409
12427
  const kept = [];
12410
12428
  for (const line of raw.split("\n")) {
12411
12429
  const text = line.trim();
12412
12430
  if (text === "") continue;
12413
- let parsed;
12414
- try {
12415
- parsed = JSON.parse(text);
12416
- } catch {
12431
+ const record = parsedRecord(text);
12432
+ if (record === void 0 || !Array.isArray(record["entries"])) {
12417
12433
  kept.push(text);
12418
12434
  continue;
12419
12435
  }
12420
- const record = plainOf(parsed);
12421
- const entries = record === void 0 ? void 0 : record["entries"];
12422
- if (record === void 0 || !Array.isArray(entries)) {
12423
- kept.push(text);
12424
- continue;
12425
- }
12426
- const inside = entries.filter((one) => !STATIC_URL.test(String(plainOf(one)?.["url"] ?? "")));
12427
- if (inside.length === 0) continue;
12428
- kept.push(JSON.stringify({
12429
- ...record,
12430
- entries: inside
12431
- }));
12436
+ const compact = withoutStatic(record);
12437
+ if (compact !== "") kept.push(compact);
12432
12438
  }
12433
12439
  return kept.join("\n");
12434
12440
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dsh-workbench/core",
3
- "version": "1.1.15",
3
+ "version": "1.1.16",
4
4
  "description": "个人工作台:Agent 工作台(左栏 + 常驻对话 + 自研右侧数据面板)。",
5
5
  "type": "module",
6
6
  "icon": "./icon.svg",
@@ -97,8 +97,8 @@
97
97
  "proper-lockfile": "^4.1.2",
98
98
  "which": "^7.0.0",
99
99
  "write-file-atomic": "^8.0.0",
100
- "@dsh-workbench/adapters-default": "1.1.15",
101
- "@dsh-workbench/shared": "1.1.15"
100
+ "@dsh-workbench/adapters-default": "1.1.16",
101
+ "@dsh-workbench/shared": "1.1.16"
102
102
  },
103
103
  "license": "MIT",
104
104
  "repository": {