dsh-task-ledger 0.0.132 → 0.0.133

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/client.js CHANGED
@@ -67929,7 +67929,7 @@ body[data-ds-dark-theme]{
67929
67929
  variant: "outline",
67930
67930
  size: "md",
67931
67931
  onClick: onBack
67932
- }, `← ${t("backToConversation")}`), (0, react$1.createElement)("div", { style: titleStyle }, t("panelTitle"), (0, react$1.createElement)("span", { style: buildTagStyle }, `v0.0.132 261105-171117-450`))), (0, react$1.createElement)("div", { style: {
67932
+ }, `← ${t("backToConversation")}`), (0, react$1.createElement)("div", { style: titleStyle }, t("panelTitle"), (0, react$1.createElement)("span", { style: buildTagStyle }, `v0.0.133 261105-173822-799`))), (0, react$1.createElement)("div", { style: {
67933
67933
  display: "flex",
67934
67934
  alignItems: "center",
67935
67935
  gap: "var(--dtl-space-3)"
@@ -1,3 +1,4 @@
1
+ import { gzipSync } from "node:zlib";
1
2
  import { codeOf, messageOf } from "./errors.js";
2
3
  import { invalidate } from "./repositories/cache.js";
3
4
  import { scriptPath } from "./repositories/runner.js";
@@ -12,9 +13,37 @@ import { resolveWorkspaces } from "./services/workspaces.service.js";
12
13
  const API_PREFIX = "/api/task-ledger";
13
14
  /** 核心 explorer 的只读文件路由(`serveFsRoute` 挂这里,client 的 `connectFs` 用同一个值)。 */
14
15
  export const FS_ROUTE = `${API_PREFIX}/fs`;
16
+ /**
17
+ * JSON 响应出口(全仓唯一):客户端声明收 gzip 且响应够大就压。
18
+ * 宿主的压缩默认关闭(`DEFAULT_COMPRESSION = "none"`),趋势页那份 166KB 原样发出去太贵 ——
19
+ * 由路由自己压,插件侧一行配置都不需要(浏览器 / fetch 自动解压)。小响应压完反而更大,故留门槛。
20
+ */
15
21
  function sendJson(res, status, body) {
16
- res.writeHead(status, { "content-type": "application/json; charset=utf-8" });
17
- res.end(JSON.stringify(body));
22
+ const raw = Buffer.from(JSON.stringify(body), "utf8");
23
+ if (raw.length > GZIP_MIN_BYTES && acceptsGzip(res)) {
24
+ const zipped = gzipSync(raw);
25
+ res.writeHead(status, {
26
+ "content-type": "application/json; charset=utf-8",
27
+ "content-encoding": "gzip",
28
+ // 同一 URL 可能回压过 / 没压过两种字节,缓存要按这个头分开
29
+ vary: "accept-encoding",
30
+ "content-length": String(zipped.length),
31
+ });
32
+ res.end(zipped);
33
+ return;
34
+ }
35
+ res.writeHead(status, {
36
+ "content-type": "application/json; charset=utf-8",
37
+ "content-length": String(raw.length),
38
+ });
39
+ res.end(raw);
40
+ }
41
+ /** 压缩门槛:比这还小,gzip 头 + 字典开销反倒让线上字节变多。 */
42
+ const GZIP_MIN_BYTES = 1024;
43
+ function acceptsGzip(res) {
44
+ // res.req 是 Node 自带的引用(ServerResponse.req),不用把 req 逐层传进 20 多个调用点
45
+ const header = res.req?.headers["accept-encoding"];
46
+ return String(header ?? "").includes("gzip");
18
47
  }
19
48
  /**
20
49
  * 失败统一出口:500 + 人话 + **机器可读码**。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-task-ledger",
3
- "version": "0.0.132",
3
+ "version": "0.0.133",
4
4
  "description": "Tasks are created, claimed, advanced and closed by the agent and written straight into a plain-text ledger in the workspace, so the owner, the current state and the next step are always on record. It is not limited to development work — research, documentation, presentations and video production all fit. No cloud service is involved: everything is managed locally. Single-user and multi-user both work, with Git synchronisation, and every action is on record. The control panel summarises in-flight, overdue and stalled work with weekly trends.",
5
5
  "icon": "./assets/icon.svg",
6
6
  "keywords": [
package/skill/SKILL.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: task-ledger
3
3
  description: 本地任务台账,跨会话记录在办任务的归属、进度与起止。当用户要登记一件新的事(新建任务 / 建个坑 / 这活我领了)、记录已有任务的进展(接着做 / 记一条进展 / 这轮先记下)、查看任务状态或历史(现在该做什么 / 这活谁在做 / 上周做过什么)、给任务结案 / 取消作废 / 退回(做完了 / 验收通过 / 取消 / 作废 / 退回待认领)、删除建错的或垃圾任务(只认「删除」二字)、整理标签或检查台账一致性时加载;只是改代码、讨论方案时不要用。
4
- version: 1.3.53
4
+ version: 1.3.55
5
5
  allowed-tools: Read,Edit,Bash,Grep
6
6
  ---
7
7
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "task-ledger",
3
- "version": "1.3.54",
3
+ "version": "1.3.55",
4
4
  "description": "Task-ledger skill for coding agents: per-workspace progress tracking (ledger/pool.json + owners/<hash>.json shards + owners.json index, history, worklog) driven by a CLI script. Standalone install for CodeBuddy and other agents; also bundled inside the dsh-task-ledger DSH plugin.",
5
5
  "keywords": [
6
6
  "skill",