Invoice-Downloader
EthanYoQ
电子发票整理与报销准备工具:从邮箱批量收集 PDF/OFD/XML 发票,OCR 识别、分类归档并生成 Excel 汇总;提供 Windows/macOS 桌面版与 DSH 插件。
PROJECT TOPICS
INSTALL REFERENCE
dsh plugin --profile web add github:xiaopei-sd/dsh-rename-chats
该命令指向仓库当前默认分支;尚无绑定当前 commit 的完整验证结果。
PROJECT README
A local, loopback-only bridge that lets a DSH Skill read DSH session titles and
rename them through the official session-title service. It does not edit
session.v4.jsonl.zstd, SQLite, or browser cookies.
This package is one half of a two-part tool:
dsh-rename-chats (this package) — a DSH host plugin that exposes
GET /health, GET /sessions, POST /read, and POST /rename on a
process-scoped capability URL.rename-chats Skill — preview/confirm, batching, protection, lease,
throttle, retry, write verification, and interruption recovery.The split is intentional. The plugin is generic; the Skill owns the policy.
DSH's Web API is authenticated. The desktop host generates a launch token in
memory, sends it to Electron over IPC, and uses it to mint a signed cookie.
A standalone Skill script cannot obtain that token without reading credentials
or browser state. A host plugin can call sessionQuery, sessionController
and sessionTitle directly, in the same process that owns the sessions, without
scraping secrets. sessionController.rename also resumes a cold session.
The bridge never exposes the title service to the network beyond loopback. The capability URL contains a random 192-bit path segment and is written to:
$DSH_HOME/rename-chats/bridge.json (mode 0600)
DSH_HOME defaults to ~/.dsh. On Windows the file lives at
C:\Users\<user>\.dsh\rename-chats\bridge.json.
0.2.0-rc.2 through 0.2.2 (the 0.2.3 line is excluded because the
session-title contract has not been verified there).dsh web host that mounts the webServer, sessions,
sessionQuery, sessionController, and workspaceRegistry services.From npm:
dsh plugin --profile desktop add dsh-rename-chats
Or from this checkout:
dsh plugin --profile desktop add "D:\app\DSH workspace\DS-RSI\dsh-rename-chats"
Then restart the DSH desktop app (or the dsh web process). Check:
curl --fail --silent "$(python -c 'import json,os,pathlib; p=pathlib.Path(os.environ.get("DSH_HOME", pathlib.Path.home()/".dsh"))/"rename-chats"/"bridge.json"; print(json.loads(p.read_text())["baseUrl"] + "/health")')"
A healthy host returns the plugin identity and a redacted workspace list:
{"ok":true,"plugin":"rename-chats","pluginVersion":"0.1.1","bridgeVersion":1,"pid":1234,"workspaces":[{"id":"492bbba8-3b91-4a43-8414-b79375ce4f1c","path":"D:\\\\app\\\\DSH workspace\\\\DS-RSI","title":"DS-RSI","sessionCount":7}]}
After a restart the capability URL changes; the old file is replaced. A stale URL fails with connection refused, not with a title write.
All paths below are relative to the capability baseUrl from bridge.json.
GET /healthReturns plugin and host identity. No session data.
GET /sessions?workspaceId=<id>&limit=40Lists ordinary, non-archived sessions for one workspace. Subagent rows are
excluded unless includeSubagents=1; archived rows are excluded unless
includeArchived=1. limit is capped at 40 to match the Skill's batch bound.
Each row:
{
"id": "session-...",
"title": "1109|功能|标题整理",
"displayTitle": "1109|功能|标题整理",
"titleSource": "user",
"titleEventSeq": 42,
"createdAt": 1794207137483,
"createdAtUnit": "milliseconds",
"cwd": "D:\\app\\DSH workspace\\DS-RSI",
"origin": "ordinary",
"parentSession": null,
"archived": false,
"pinned": false,
"live": true
}
createdAt is milliseconds in DSH, unlike Codex's seconds. The Skill passes
unit: "milliseconds" explicitly; it never infers seconds from the value.
POST /read{"sessionId": "session-..."}
Returns the latest title snapshot, its source, the creation time, the latest
event time, and the real human messages. DSH records system context as
user/message too; this bridge
returns only events whose data.source.kind is "user". It keeps the first
three and last nine human messages (up to 4,000 characters each), which is
enough to identify the task without flooding the preview.
lastActivityAt is the maximum numeric time across the session event log,
in milliseconds. Use it to select conversations active today instead of
re-reading every session on each pass.
POST /rename{
"sessionId": "session-...",
"expectedTitle": "1109|功能|旧标题",
"title": "1109|功能|新标题"
}
expectedTitle is mandatory. The bridge resolves the session through the same
agent resolver that the official API controller uses, reads the current title,
refuses a mismatch with 409 title-changed, appends a session/title event
with source: {kind: "user"}, then re-folds the log and verifies that the
accepted title is visible. It returns the normalized title and event
sequence; callers must record the returned title, not the requested one.
The write is not a compare-and-swap. A third-party edit between the pre-check
and the append can still win. The Skill re-reads the title after the write and
records changed_during_write if a third title appears. This is the known
concurrency window, reduced but not eliminated.
127.0.0.1:0 by the desktop host. The handler also rejects non-loopback
socket addresses.maxTitleBytes
setting. The bridge returns the effective title; the Skill records it.npm test
npm pack --dry-run
The unit tests cover message extraction, injected-context filtering, date unit metadata, and ordinary/subagent/archive classification. A live host write test is deliberately separate; run it only against a disposable session.
MIT
CLASSIFICATION EVIDENCE
系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: chat。