diff --git a/.github/workflows/ci-docs.yml b/.github/workflows/ci-docs.yml index 88f7eb59..490920db 100644 --- a/.github/workflows/ci-docs.yml +++ b/.github/workflows/ci-docs.yml @@ -17,6 +17,8 @@ on: - 'reme_studio/README*.md' - 'reme_studio/public/og.jpg' - 'typescript/README*.md' + - 'typescript/docs/**' + - 'typescript/figures/**' - 'plugins/*/README*.md' - 'benchmark/*/README*.md' - 'benchmark/toolmemory/gitcha.png' @@ -36,6 +38,8 @@ on: - 'reme_studio/README*.md' - 'reme_studio/public/og.jpg' - 'typescript/README*.md' + - 'typescript/docs/**' + - 'typescript/figures/**' - 'plugins/*/README*.md' - 'benchmark/*/README*.md' - 'benchmark/toolmemory/gitcha.png' diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index 488f086d..1d812b79 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -14,6 +14,8 @@ on: - "reme_studio/README*.md" - "reme_studio/public/og.jpg" - "typescript/README*.md" + - "typescript/docs/**" + - "typescript/figures/**" - "plugins/*/README*.md" - "benchmark/*/README*.md" - "benchmark/toolmemory/gitcha.png" diff --git a/.github/workflows/release-typescript.yml b/.github/workflows/release-typescript.yml index b9461c6e..4d6fd06e 100644 --- a/.github/workflows/release-typescript.yml +++ b/.github/workflows/release-typescript.yml @@ -2,8 +2,9 @@ # 1. Update typescript/package.json and package-lock.json to the release version and merge them. # 2. Configure npm Trusted Publishing for agentscope-ai/ReMe and this workflow file. # 3. Run this workflow manually with the exact package version (an optional v prefix is accepted). -# 4. Configure ClawHub Trusted Publishing for agentscope-ai/ReMe and this workflow file. -# 5. Use the `next` tag for prereleases and `latest` only for stable releases. +# 4. Keep the ClawHub publication docs in typescript/docs/openclaw.md and openclaw.zh-CN.md. +# 5. Configure ClawHub Trusted Publishing for agentscope-ai/ReMe and this workflow file. +# 6. Use the `next` tag for prereleases and `latest` only for stable releases. name: Release / TypeScript integrations @@ -112,6 +113,8 @@ jobs: - name: Pack ClawHub tarball working-directory: typescript run: | + test -f docs/openclaw.md + test -f docs/openclaw.zh-CN.md mkdir -p "${RUNNER_TEMP}/reme-clawhub-package" npm run pack:clawhub -- "${RUNNER_TEMP}/reme-clawhub-package" diff --git a/docs/.vitepress/config.mts b/docs/.vitepress/config.mts index 17411bae..91ecf2cf 100644 --- a/docs/.vitepress/config.mts +++ b/docs/.vitepress/config.mts @@ -153,7 +153,9 @@ function sidebar(language: "zh" | "en"): DefaultTheme.SidebarItem[] { { text: zh ? "集成总览" : "Overview", link: `/${language}/integrations` }, { text: "Claude Code", link: `/${language}/integrations/claude-code` }, { text: "Hermes Agent", link: `/${language}/integrations/hermes` }, - { text: "TypeScript / OpenClaw / DSH", link: `/${language}/integrations/typescript` }, + { text: zh ? "TypeScript 客户端" : "TypeScript Client", link: `/${language}/integrations/typescript` }, + { text: "DeepSeek Harness", link: `/${language}/integrations/dsh` }, + { text: "OpenClaw", link: `/${language}/integrations/openclaw` }, ], }, { diff --git a/docs/en/integrations.md b/docs/en/integrations.md index 03b2cf0a..1e9bddc0 100644 --- a/docs/en/integrations.md +++ b/docs/en/integrations.md @@ -43,7 +43,7 @@ It deliberately avoids silently modifying Python environments, stopping unknown ## TypeScript, OpenClaw, and DeepSeek Harness -See [TypeScript Agent Integrations](./integrations/typescript.md) for the shared HTTP client, DeepSeek Harness adapter, OpenClaw adapter, and package validation. +The [`@agentscope-ai/reme` TypeScript package](./integrations/typescript.md) provides the shared HTTP client and host adapters. See the dedicated guides for [DeepSeek Harness](./integrations/dsh.md) and [OpenClaw](./integrations/openclaw.md). ## Claude Code diff --git a/docs/zh/integrations.md b/docs/zh/integrations.md index ab239c15..ce3dd841 100644 --- a/docs/zh/integrations.md +++ b/docs/zh/integrations.md @@ -57,7 +57,7 @@ Skill 不应: ## TypeScript、OpenClaw 与 DeepSeek Harness -统一 TypeScript 客户端和宿主适配器见 [TypeScript Agent 集成](./integrations/typescript.md)。它包含: +统一 HTTP 客户端和包能力见 [TypeScript Agent 集成](./integrations/typescript.md)。宿主的完整安装、配置和运行说明见 [DeepSeek Harness](./integrations/dsh.md) 与 [OpenClaw](./integrations/openclaw.md) 指南。它们包含: - HTTP Client; - DeepSeek Harness adapter; diff --git a/github-pages/scripts/generate-content.mjs b/github-pages/scripts/generate-content.mjs index 1a01f1f5..bc8e33e7 100644 --- a/github-pages/scripts/generate-content.mjs +++ b/github-pages/scripts/generate-content.mjs @@ -12,6 +12,10 @@ const externalDocuments = [ ["en/integrations/hermes.md", "integrations/hermes_agent/README.md"], ["zh/integrations/typescript.md", "typescript/README_ZH.md"], ["en/integrations/typescript.md", "typescript/README.md"], + ["zh/integrations/dsh.md", "typescript/docs/dsh.zh-CN.md"], + ["en/integrations/dsh.md", "typescript/docs/dsh.md"], + ["zh/integrations/openclaw.md", "typescript/docs/openclaw.zh-CN.md"], + ["en/integrations/openclaw.md", "typescript/docs/openclaw.md"], ["zh/workspace/studio.md", "reme_studio/README_ZH.md"], ["en/workspace/studio.md", "reme_studio/README.md"], ["zh/plugins/daily-paper.md", "plugins/daily_paper/README_ZH.md"], @@ -32,6 +36,39 @@ const externalDocuments = [ ["en/benchmarks/toolmemory.md", "benchmark/toolmemory/README.md"], ]; +const externalDocumentRewrites = { + "typescript/README.md": [ + ["(./README_ZH.md)", "(/zh/integrations/typescript)"], + ["(./docs/dsh.md)", "(/en/integrations/dsh)"], + ["(./docs/dsh.zh-CN.md)", "(/zh/integrations/dsh)"], + ["(./docs/openclaw.md)", "(/en/integrations/openclaw)"], + ["(./docs/openclaw.zh-CN.md)", "(/zh/integrations/openclaw)"], + ["(./figures/dsh/", "(/figures/dsh/"], + ], + "typescript/README_ZH.md": [ + ["(./README.md)", "(/en/integrations/typescript)"], + ["(./docs/dsh.md)", "(/en/integrations/dsh)"], + ["(./docs/dsh.zh-CN.md)", "(/zh/integrations/dsh)"], + ["(./docs/openclaw.md)", "(/en/integrations/openclaw)"], + ["(./docs/openclaw.zh-CN.md)", "(/zh/integrations/openclaw)"], + ["(./figures/dsh/", "(/figures/dsh/"], + ], + "typescript/docs/dsh.md": [ + ["(./dsh.zh-CN.md)", "(/zh/integrations/dsh)"], + ["(../figures/dsh/", "(/figures/dsh/"], + ], + "typescript/docs/dsh.zh-CN.md": [ + ["(./dsh.md)", "(/en/integrations/dsh)"], + ["(../figures/dsh/", "(/figures/dsh/"], + ], + "typescript/docs/openclaw.md": [ + ["(./openclaw.zh-CN.md)", "(/zh/integrations/openclaw)"], + ], + "typescript/docs/openclaw.zh-CN.md": [ + ["(./openclaw.md)", "(/en/integrations/openclaw)"], + ], +}; + const groupNames = { zh: { system: "系统与诊断", @@ -169,10 +206,16 @@ const sourceMap = {}; for (const [destination, source] of externalDocuments) { const destinationPath = path.join(outputDir, destination); await mkdir(path.dirname(destinationPath), { recursive: true }); - await cp(path.join(repoDir, source), destinationPath); + let content = await readFile(path.join(repoDir, source), "utf8"); + for (const [from, to] of externalDocumentRewrites[source] || []) content = content.replaceAll(from, to); + await writeFile(destinationPath, content); sourceMap[destination] = source; } +await cp(path.join(repoDir, "typescript/figures/dsh"), path.join(outputDir, "public/figures/dsh"), { + recursive: true, +}); + for (const language of ["zh", "en"]) { await cp( path.join(repoDir, "benchmark/toolmemory/gitcha.png"), diff --git a/github-pages/tests/generated-content.test.mjs b/github-pages/tests/generated-content.test.mjs index cf699a5d..a4caf955 100644 --- a/github-pages/tests/generated-content.test.mjs +++ b/github-pages/tests/generated-content.test.mjs @@ -28,11 +28,18 @@ test("generates every required bilingual guide", async () => { await access(path.join(generatedDir, "en/integrations/claude-code.md")); await access(path.join(generatedDir, "zh/integrations/hermes.md")); await access(path.join(generatedDir, "en/integrations/hermes.md")); + await access(path.join(generatedDir, "zh/integrations/dsh.md")); + await access(path.join(generatedDir, "en/integrations/dsh.md")); + await access(path.join(generatedDir, "zh/integrations/openclaw.md")); + await access(path.join(generatedDir, "en/integrations/openclaw.md")); + await access(path.join(generatedDir, "public/figures/dsh/reme-status-overview.png")); }); test("maps mirrored pages back to their canonical repository sources", async () => { const sourceMap = JSON.parse(await readFile(path.join(generatedDir, ".source-map.json"), "utf8")); assert.equal(sourceMap["zh/integrations/typescript.md"], "typescript/README_ZH.md"); + assert.equal(sourceMap["en/integrations/dsh.md"], "typescript/docs/dsh.md"); + assert.equal(sourceMap["zh/integrations/openclaw.md"], "typescript/docs/openclaw.zh-CN.md"); assert.equal(sourceMap["en/integrations/claude-code.md"], "integrations/claude_code/README.md"); assert.equal(sourceMap["en/integrations/hermes.md"], "integrations/hermes_agent/README.md"); assert.equal(sourceMap["en/workspace/studio.md"], "reme_studio/README.md"); @@ -40,6 +47,15 @@ test("maps mirrored pages back to their canonical repository sources", async () assert.equal(sourceMap["en/reference/jobs.md"], "reme/config/default.yaml"); }); +test("publishes portable and accurate DSH instructions", async () => { + const english = await readFile(path.join(generatedDir, "en/integrations/dsh.md"), "utf8"); + const chinese = await readFile(path.join(generatedDir, "zh/integrations/dsh.md"), "utf8"); + assert.doesNotMatch(english, /\/Users\//); + assert.doesNotMatch(chinese, /\/Users\//); + assert.match(english, /runtime counters refresh every 5 seconds/); + assert.match(chinese, /每 5 秒仅刷新 DSH 插件的运行时计数/); +}); + test("generates the callable Job reference from default.yaml", async () => { const config = parseYaml(await readFile(path.join(repoDir, "reme/config/default.yaml"), "utf8")); const callableJobs = Object.entries(config.jobs) @@ -81,6 +97,8 @@ test("tracks every generated input in documentation CI and deployment", async () "reme/config/default.yaml", "integrations/claude_code/README.md", "integrations/hermes_agent/README.md", + "typescript/docs/**", + "typescript/figures/**", "benchmark/toolmemory/gitcha.png", ]; for (const workflow of ["ci-docs.yml", "deploy-docs.yml"]) { diff --git a/typescript/README.md b/typescript/README.md index 19ec084c..9357adf1 100644 --- a/typescript/README.md +++ b/typescript/README.md @@ -2,145 +2,51 @@ [中文说明](./README_ZH.md) -`@agentscope-ai/reme` provides one shared ReMe HTTP client and host adapters for DeepSeek Harness and OpenClaw. Each -adapter uses its host's native lifecycle and tool interfaces; importing the root package does not load either host. +`@agentscope-ai/reme` connects DeepSeek Harness and OpenClaw to ReMe's local-first, file-native long-term memory. The package also exposes a host-independent ReMe HTTP client. -The package expects a running ReMe HTTP service with the `search`, `auto_memory`, and `auto_dream` jobs required by the -selected adapter: +![ReMe Status in DeepSeek Harness](./figures/dsh/reme-status-overview.png) + +## Capabilities + +- Injects memory guidance and provides explicit `reme_search` lookup. +- Captures completed conversations through background `auto_memory` batches. +- Runs optional daily `auto_dream` consolidation in the workspace timezone. +- Keeps durable memory in user-owned `daily` and `digest` Markdown files. +- Uses each host's native lifecycle, tools, settings, and shutdown hooks. +- Excludes plugin context and tool results from automatic memory capture. + +## Documentation + +| Host | English | 中文 | +| ---------------- | --------------------------- | ------------------------------------ | +| DeepSeek Harness | [Guide](./docs/dsh.md) | [使用指南](./docs/dsh.zh-CN.md) | +| OpenClaw | [Guide](./docs/openclaw.md) | [使用指南](./docs/openclaw.zh-CN.md) | + +## Quick start + +Start ReMe: ```bash +pip install "reme-ai[core]" reme start workspace_dir=/absolute/path/to/workspace ``` -The default endpoint is `http://127.0.0.1:2333`. All entries support `REME_URL`, or `REME_HOST` plus `REME_PORT`. -ReMe's HTTP service does not use API-key authentication. - -## Requirements - -- A running ReMe HTTP service with the jobs required by the selected adapter. -- Node.js `22.22.3+`, `24.15.0+`, or `25.9.0+` on the corresponding supported major-version line. -- DeepSeek Harness or OpenClaw only when using that host-specific entry; the root client has no host runtime dependency. - -## DeepSeek Harness - -Install the package as a DSH profile bundle: +Install the adapter for your host: ```bash +# DeepSeek Harness dsh plugin --profile web add @agentscope-ai/reme + +# OpenClaw +openclaw plugins install clawhub:@agentscope-ai/reme ``` -The bundle loads `@agentscope-ai/reme/dsh` in an isolated `remeMemory` realm. It injects durable memory guidance, -registers `reme_search`, submits completed main-agent turns to `auto_memory`, and runs the optional daily `auto_dream` -schedule. Recalled plugin context and tool results are excluded from automatic memory capture. +The default endpoint is `http://127.0.0.1:2333`. ReMe HTTP does not use API-key authentication, so keep it on loopback or another trusted network unless it is protected by a proxy. -Configure the bundle by replacing its row in the profile's `cordis.patch.yml`: - -```yaml -- id: reme-memory - config: - - id: reme-memory-runtime - name: "@agentscope-ai/reme/dsh" - config: - endpoint: http://127.0.0.1:2333 - language: zh - timezone: Asia/Shanghai - autoMemoryInterval: 5 - autoDreamEnabled: true - dreamCron: "0 23 * * *" -``` - -On the DSH Web profile, the same fields are available under **Settings → Plugins → Plugin configuration → ReMe -Memory**. Changes are stored in DSH's user settings document and apply to subsequent requests and captures. Changing -the daily dream controls reschedules the next run; changing the guidance language affects newly started sessions. -The test-only `dreamIntervalMs` value remains outside the user-settings section. - -| Option | Default | Meaning | -| --------------------- | ----------------------- | --------------------------------------------- | -| `endpoint` | `http://127.0.0.1:2333` | ReMe HTTP service URL | -| `language` | `en` | Memory guidance language: `en` or `zh` | -| `autoMemoryEnabled` | `true` | Capture completed main-agent turns | -| `autoMemoryInterval` | `5` | Submit after this many completed turns | -| `autoDreamEnabled` | `true` | Enable daily dream maintenance | -| `dreamCron` | `0 23 * * *` | Daily schedule in the workspace timezone | -| `dreamHint` | empty | Optional guidance sent to `auto_dream` | -| `rootAgentsOnly` | `true` | Exclude subagents from guidance and capture | -| `searchLimit` | `5` | Maximum results returned by `reme_search` | -| `requestTimeoutMs` | `10000` | Search request timeout | -| `backgroundTimeoutMs` | `3600000` | Automatic-memory and dream timeout | -| `shutdownTimeoutMs` | `5000` | Best-effort shutdown drain budget | -| `timezone` | `Asia/Shanghai` | IANA timezone used for batches and scheduling | - -The ReMe card reads the service's `health_check` and `status` jobs on demand. It shows the ReMe version, component -health, chunk/index counts, process RSS, and estimated component memory; it can also display the redacted `app_config` -response and trigger one `auto_dream` run. Diagnostics are refreshed when the card first opens or when the user asks, -not polled continuously. The page calls the configured ReMe HTTP endpoint from the local browser, so that service must -remain browser-reachable and allow the DSH origin. - -## OpenClaw - -OpenClaw `2026.7.1` or later can install the same package. The current SDK and -OpenClaw Gateway require Node.js `22.22.3+`, `24.15.0+`, or `25.9.0+` on their -respective major-version lines: - -```bash -openclaw plugins install @agentscope-ai/reme -``` - -Select `reme` for `plugins.slots.memory` when another memory plugin is active. The adapter uses OpenClaw's current -`before_prompt_build` hook, registers the `reme_search` action, injects durable memory guidance, and recalls relevant -memory before conversational root-agent runs. Completed user/assistant pairs are grouped into per-session, -date-consistent batches for `auto_memory`; failed batches are retained for retry and pending work is flushed within a -bounded Gateway shutdown budget. One plugin-owned daily schedule runs `auto_dream`. Recall is wrapped in -`` and marked as untrusted historical data. Cron, heartbeat, memory, overflow, and subagent runs do not -recall or capture conversational memory by default. - -OpenClaw plugin configuration accepts: - -| Option | Default | Meaning | -| --------------------- | ----------------------- | --------------------------------------------- | -| `endpoint` | `http://127.0.0.1:2333` | ReMe HTTP service URL | -| `language` | `en` | Memory guidance language: `en` or `zh` | -| `autoRecall` | `true` | Recall before conversational root-agent runs | -| `searchLimit` | `5` | Maximum search results | -| `recallMinScore` | `0` | Minimum search score | -| `autoMemoryEnabled` | `true` | Capture completed conversational turns | -| `autoMemoryInterval` | `5` | Submit after this many completed turns | -| `autoDreamEnabled` | `true` | Enable daily memory consolidation | -| `dreamCron` | `0 23 * * *` | Daily schedule in the workspace timezone | -| `dreamHint` | empty | Optional guidance sent to `auto_dream` | -| `rootAgentsOnly` | `true` | Exclude subagents from guidance and capture | -| `timezone` | `Asia/Shanghai` | IANA timezone used for batches and scheduling | -| `requestTimeoutMs` | `10000` | Recall and explicit search timeout | -| `backgroundTimeoutMs` | `3600000` | Automatic-memory and dream timeout | -| `shutdownTimeoutMs` | `5000` | Best-effort shutdown drain budget | - -OpenClaw's conversation-access and prompt-injection permissions remain host settings; enable them for ReMe when your -OpenClaw policy requires explicit grants. The adapter does not modify Gateway configuration. - -## Library entry - -Consumers that only need the transport can import the root package: +## Client library ```ts import { ReMeClient, formatReMeContext } from "@agentscope-ai/reme"; ``` -Host code is available only through `@agentscope-ai/reme/dsh` and `@agentscope-ai/reme/openclaw`. - -## Development - -```bash -cd typescript -npm ci -npm run format:check -npm run lint -npm run typecheck -npm test -npm run test:package -``` - -`npm pack` runs the TypeScript build and includes only `dist`, the DSH patch, the OpenClaw manifest, and the English and -Chinese READMEs. `npm run pack:clawhub -- ` creates the ClawHub artifact with the same runtime files -and the OpenClaw-only `README_OPENCLAW.md` and `README_OPENCLAW_ZH.md` content at the package README paths. - -Stable releases use npm's `latest` distribution tag; prereleases use `next`. +Host adapters are exported from `@agentscope-ai/reme/dsh` and `@agentscope-ai/reme/openclaw`. See the host guides for requirements, configuration, screenshots, troubleshooting, and release behavior. diff --git a/typescript/README_ZH.md b/typescript/README_ZH.md index 3e81cf29..5b108fac 100644 --- a/typescript/README_ZH.md +++ b/typescript/README_ZH.md @@ -1,136 +1,52 @@ # 面向 TypeScript Agent 的 ReMe -`@agentscope-ai/reme` 提供统一的 ReMe HTTP 客户端,以及 DeepSeek Harness(DSH)和 OpenClaw 适配器。每个适配器都使用宿主原生的生命周期与工具接口;导入包根入口不会加载任何宿主适配器。 +[English](./README.md) -使用前需要启动 ReMe HTTP 服务,并确保所选适配器需要的 `search`、`auto_memory` 和 `auto_dream` 任务可用: +`@agentscope-ai/reme` 将 DeepSeek Harness 和 OpenClaw 连接到 ReMe 本地优先、文件原生的长期记忆,并提供不依赖宿主的 ReMe HTTP 客户端。 + +![DeepSeek Harness 中的 ReMe 状态页](./figures/dsh/reme-status-overview.png) + +## 核心能力 + +- 注入长期记忆使用指引,并提供显式的 `reme_search` 检索。 +- 通过后台 `auto_memory` 批次沉淀已完成的对话。 +- 按 workspace 时区运行可选的每日 `auto_dream` 记忆整理。 +- 将持久记忆保存在用户拥有的 `daily` 和 `digest` Markdown 文件中。 +- 使用各宿主原生的生命周期、工具、设置和关停 Hook。 +- 自动记忆会排除插件上下文和工具结果,避免循环写回。 + +## 使用文档 + +| 宿主 | English | 中文 | +| ---------------- | --------------------------- | ------------------------------------ | +| DeepSeek Harness | [Guide](./docs/dsh.md) | [使用指南](./docs/dsh.zh-CN.md) | +| OpenClaw | [Guide](./docs/openclaw.md) | [使用指南](./docs/openclaw.zh-CN.md) | + +## 快速开始 + +启动 ReMe: ```bash +pip install "reme-ai[core]" reme start workspace_dir=/absolute/path/to/workspace ``` -默认服务地址为 `http://127.0.0.1:2333`。所有入口均支持 `REME_URL`,也支持组合使用 `REME_HOST` 和 `REME_PORT`。ReMe HTTP 服务不使用 API Key 认证。 - -## 环境要求 - -- 已启动 ReMe HTTP 服务,并提供所选适配器需要的 Job。 -- 对应受支持主版本线上的 Node.js `22.22.3+`、`24.15.0+` 或 `25.9.0+`。 -- 只有使用宿主专用入口时才需要 DeepSeek Harness 或 OpenClaw;包根 client 不依赖宿主 runtime。 - -## DeepSeek Harness - -将本包安装为 DSH profile bundle: +安装对应宿主的适配器: ```bash +# DeepSeek Harness dsh plugin --profile web add @agentscope-ai/reme + +# OpenClaw +openclaw plugins install clawhub:@agentscope-ai/reme ``` -安装后可在 **设置 → 插件 → 插件配置 → ReMe Memory** 中配置服务地址、记忆指引语言、自动记忆、每日记忆整理和超时时间,并查看服务健康状态。每日记忆整理和每日批次统一使用配置的 workspace 时区。 - -Bundle 会在隔离的 `remeMemory` realm 中加载 `@agentscope-ai/reme/dsh`,注入长期记忆指引,注册 -`reme_search`,将主 Agent 已完成的对话提交给 `auto_memory`,并按可选的每日计划运行 `auto_dream`。召回的 -plugin context 和工具结果不会再次进入自动记忆。 - -如需直接修改 profile,可以替换 `cordis.patch.yml` 中对应条目: - -```yaml -- id: reme-memory - config: - - id: reme-memory-runtime - name: "@agentscope-ai/reme/dsh" - config: - endpoint: http://127.0.0.1:2333 - language: zh - timezone: Asia/Shanghai - autoMemoryInterval: 5 - autoDreamEnabled: true - dreamCron: "0 23 * * *" -``` - -DSH Web profile 也可以在 **设置 → 插件 → 插件配置 → ReMe Memory** 中编辑同一组配置。设置会保存到 DSH -用户设置文档,并从后续请求和捕获开始生效;修改每日计划会重新调度下一次任务,修改语言只影响新会话。 -仅供测试的 `dreamIntervalMs` 不属于用户设置。 - -| 配置项 | 默认值 | 作用 | -| --------------------- | ----------------------- | ------------------------------- | -| `endpoint` | `http://127.0.0.1:2333` | ReMe HTTP 服务地址 | -| `language` | `en` | 记忆指引语言:`en` 或 `zh` | -| `autoMemoryEnabled` | `true` | 捕获主 Agent 已完成的对话 | -| `autoMemoryInterval` | `5` | 每完成多少轮提交一次 | -| `autoDreamEnabled` | `true` | 启用每日记忆整理 | -| `dreamCron` | `0 23 * * *` | workspace 时区下的每日计划 | -| `dreamHint` | 空字符串 | 传给 `auto_dream` 的可选指引 | -| `rootAgentsOnly` | `true` | 不为子 Agent 注入指引或捕获对话 | -| `searchLimit` | `5` | `reme_search` 返回结果上限 | -| `requestTimeoutMs` | `10000` | 搜索请求超时 | -| `backgroundTimeoutMs` | `3600000` | 自动记忆和 Auto Dream 超时 | -| `shutdownTimeoutMs` | `5000` | 退出时尽力排空任务的时间预算 | -| `timezone` | `Asia/Shanghai` | 每日批次和计划使用的 IANA 时区 | - -ReMe 配置卡会按需调用 `health_check` 和 `status`,显示 ReMe 版本、组件健康状态、chunk/index 数量、进程 RSS -与组件内存估算;它也可以显示脱敏后的 `app_config`,并手动触发一次 `auto_dream`。页面首次打开或用户主动刷新时才会 -更新诊断,不会持续轮询。浏览器必须能够访问所配置的 ReMe HTTP 地址,且 ReMe 服务需要允许 DSH 页面所在的 origin。 - -## OpenClaw - -OpenClaw `2026.7.1` 或更高版本可以直接安装本包。当前 SDK 和 Gateway 支持各主版本线上的 -Node.js `22.22.3+`、`24.15.0+` 或 `25.9.0+`: - -```bash -openclaw plugins install @agentscope-ai/reme -``` - -当其他记忆插件已启用时,请将 `plugins.slots.memory` 设为 `reme`。适配器使用最新的 -`before_prompt_build` Hook,注册 `reme_search` Action,并为根 Agent 注入记忆使用指引和相关历史。 -已完成的用户/助手消息按会话、日期分批提交给 `auto_memory`;失败批次会保留重试,Gateway 退出时会在有限时间内刷新。 -插件还会按 workspace 时区运行一份每日 `auto_dream` 计划。默认不会处理子 Agent、Cron、Heartbeat、Memory 或 Overflow 触发的运行。 - -召回内容包裹在 `` 中并标记为不可信历史数据。OpenClaw 插件配置如下: - -| 配置项 | 默认值 | 作用 | -| --------------------- | ----------------------- | ------------------------------------ | -| `endpoint` | `http://127.0.0.1:2333` | ReMe HTTP 服务地址 | -| `language` | `en` | 记忆指引语言:`en` 或 `zh` | -| `autoRecall` | `true` | 在根 Agent 对话运行前自动召回 | -| `searchLimit` | `5` | 搜索结果上限 | -| `recallMinScore` | `0` | 自动召回的最低搜索分数 | -| `autoMemoryEnabled` | `true` | 捕获已完成的对话 | -| `autoMemoryInterval` | `5` | 每完成多少轮提交一次 | -| `autoDreamEnabled` | `true` | 启用每日记忆整理 | -| `dreamCron` | `0 23 * * *` | workspace 时区下的每日计划 | -| `dreamHint` | 空字符串 | 传给 `auto_dream` 的可选指引 | -| `rootAgentsOnly` | `true` | 不为子 Agent 注入指引或捕获对话 | -| `timezone` | `Asia/Shanghai` | 每日批次和计划使用的 IANA 时区 | -| `requestTimeoutMs` | `10000` | 自动召回和显式搜索超时 | -| `backgroundTimeoutMs` | `3600000` | 自动记忆和 Auto Dream 超时 | -| `shutdownTimeoutMs` | `5000` | Gateway 退出时尽力排空任务的时间预算 | - -OpenClaw 的会话访问和 Prompt 注入权限仍由宿主侧配置;策略要求显式授权时,需要为 ReMe 开启相应权限。本适配器不会修改 -Gateway 配置。 +默认地址为 `http://127.0.0.1:2333`。ReMe HTTP 不使用 API Key 认证;除非前面有受保护的代理,否则应只监听 loopback 或其他可信网络。 ## 客户端库 -仅需要 HTTP 客户端时,可以从包根入口导入: - ```ts import { ReMeClient, formatReMeContext } from "@agentscope-ai/reme"; ``` -宿主适配器分别通过 `@agentscope-ai/reme/dsh` 和 `@agentscope-ai/reme/openclaw` 提供。 - -## 开发与发布检查 - -```bash -cd typescript -npm ci -npm run format:check -npm run lint -npm run typecheck -npm test -npm run test:package -``` - -`npm pack` 会先构建 TypeScript,并且只打包 `dist`、DSH patch、OpenClaw manifest 和中英文 README。 -`npm run pack:clawhub -- <输出目录>` 会使用相同的运行时文件生成 ClawHub 产物,并将仅包含 OpenClaw -说明的 `README_OPENCLAW.md` 和 `README_OPENCLAW_ZH.md` 放到包内 README 路径。 - -稳定版本使用 npm 的 `latest` distribution tag 发布,预发布版本使用 `next`。 +宿主适配器分别从 `@agentscope-ai/reme/dsh` 和 `@agentscope-ai/reme/openclaw` 导出。环境要求、完整配置、截图、排障和发布行为请查看对应的宿主文档。 diff --git a/typescript/docs/dsh.md b/typescript/docs/dsh.md new file mode 100644 index 00000000..cac2b204 --- /dev/null +++ b/typescript/docs/dsh.md @@ -0,0 +1,224 @@ +# ReMe plugin guide for DeepSeek Harness + +[中文说明](./dsh.zh-CN.md) + +This guide explains how to install, configure, and use `@agentscope-ai/reme` with DeepSeek Harness (DSH), including memory guidance injection, the `reme_search` tool, automatic memory, daily consolidation, and the ReMe Status page. + +The screenshots come from a real local integration test. DSH uses the `default` workspace, both the interface and ReMe guidance are set to English, and ReMe uses an isolated temporary workspace containing only the fictional Project Polaris test data. No `.env` values, API keys, or personal memories appear in the screenshots. + +## 1. How the plugin works + +When a DSH session starts, the plugin injects guidance that tells the root agent when and how to use long-term memory. It also registers the read-only `reme_search` tool. After a turn completes, the plugin can submit user and assistant messages to ReMe `auto_memory`; a daily schedule can run `auto_dream` to consolidate journal entries into durable personal knowledge. + +```text +New session + └─ Inject long-term-memory guidance + └─ Agent decides whether the request depends on history + └─ reme_search → ReMe search → daily / digest files + +Completed conversation + └─ Automatic-memory batch → ReMe auto_memory → daily files + └─ Scheduled consolidation → ReMe auto_dream → digest files +``` + +The DSH adapter injects **usage guidance**, not every historical memory. Relevant memories enter the conversation only when the agent calls `reme_search`. This keeps unrelated history out of the prompt and helps prevent historical content from being treated as new instructions. + +## 2. Requirements + +- ReMe is installed and its configuration exposes the `search`, `auto_memory`, and `auto_dream` jobs. +- DeepSeek Harness `0.1.2-rc.1` or later. +- Node.js `22.22.3+`, `24.15.0+`, or `25.9.0+` on the corresponding supported major-version line. +- The browser running DSH can reach the configured ReMe HTTP endpoint. Cross-machine deployments must also allow the DSH browser origin. + +The default ReMe endpoint is `http://127.0.0.1:2333`. ReMe HTTP does not use API-key authentication, so do not expose it directly to an untrusted network. + +## 3. Install and start + +### 3.1 Start ReMe + +```bash +reme start workspace_dir=/absolute/path/to/your/reme-workspace +``` + +For development and screenshots, use an isolated directory outside the repository, such as `/tmp/reme-dsh-demo`. Do not write runtime memory into the repository's `.reme/` directory. + +### 3.2 Install the DSH bundle + +Install the published package: + +```bash +dsh plugin --profile web add @agentscope-ai/reme +``` + +For local package development: + +```bash +cd /path/to/deepseek-harness +pnpm link /path/to/ReMe/typescript --workspace-root +dsh plugin --profile web add @agentscope-ai/reme +``` + +The package declares `dsh/cordis.patch.yml` through `package.json#dsh.bundle.patch`. The patch loads `@agentscope-ai/reme/dsh` and the Web client in an isolated `remeMemory` realm, following the DSH `0.1.2-rc.1` plugin protocol. + +### 3.3 Start DSH Web + +```bash +dsh web --no-open --port 3080 +``` + +Open the local URL printed by DSH and select the `default` workspace. If DSH enables an access token, use the authenticated URL from its startup output and do not copy the token into documentation or screenshots. + +## 4. Configure ReMe Memory + +Open **Settings → Plugins → Plugin configuration → ReMe Memory**. Save changes before starting the next session. Settings are stored in DSH's user settings document and apply to subsequent requests and captures. A language change affects new sessions; a schedule change immediately reschedules the next consolidation. + +![ReMe Memory plugin configuration](../figures/dsh/reme-memory-settings.png) + +| UI meaning | Configuration key | Default | Description | +| ---------------------- | --------------------- | ----------------------- | --------------------------------------------------------------- | +| Service URL | `endpoint` | `http://127.0.0.1:2333` | Absolute ReMe HTTP URL using `http` or `https`. | +| Guidance language | `language` | `en` | `en` or `zh`; controls guidance injected into new sessions. | +| Default search results | `searchLimit` | `5` | Default `reme_search` result limit, from 1 to 50. | +| Search timeout | `requestTimeoutMs` | `10000` | Search timeout in milliseconds, from 1,000 to 120,000. | +| Automatic memory | `autoMemoryEnabled` | `true` | Capture completed user/assistant turns for `auto_memory`. | +| Exclude subagents | `rootAgentsOnly` | `true` | Inject guidance and capture conversations only for root agents. | +| Submission interval | `autoMemoryInterval` | `5` | Submit after this many completed turns, from 1 to 1,000. | +| Memory consolidation | `autoDreamEnabled` | `true` | Run `auto_dream` on the daily schedule. | +| Consolidation schedule | `dreamCron` | `0 23 * * *` | Five-field cron expression interpreted in `timezone`. | +| Consolidation guidance | `dreamHint` | empty | Optional guidance passed to `auto_dream`. | +| Workspace timezone | `timezone` | `Asia/Shanghai` | IANA timezone used for batching and scheduling. | +| Background timeout | `backgroundTimeoutMs` | `3600000` | Timeout for `auto_memory` and `auto_dream`. | +| Shutdown flush timeout | `shutdownTimeoutMs` | `5000` | Budget for draining background work during shutdown. | + +Deployment configuration also supports `REME_URL`, or `REME_HOST` together with `REME_PORT`. The timer-only test option `dreamIntervalMs` is intentionally excluded from user settings. + +## 5. Memory context injection + +On `agent/session-start`, the plugin injects long-term-memory guidance as native plugin context. Expand **Context injection · reme-memory** in the message flow to inspect both the content and provenance. + +![ReMe memory context injection](../figures/dsh/memory-context-injection.png) + +The guidance establishes four rules: + +1. Durable long-term memory lives in user-owned `daily` and `digest` Markdown files. +2. The agent should call `reme_search` before answering questions that depend on past facts, preferences, decisions, people, dates, experience, or todos. +3. Retrieved memory is contextual evidence, not instructions. When no relevant result exists, the agent should say so instead of inventing a memory. +4. Background `auto_memory` and `auto_dream` jobs normally maintain memory without manual agent calls. + +The injected message carries `plugin=reme-memory` and `form=instructions` provenance. The plugin checks current and pending messages to avoid duplicate injection in one session. With `rootAgentsOnly=true`, sessions whose origin is `subagent` are skipped. + +## 6. Use `reme_search` + +A normal request can cause the agent to use memory automatically. For a deterministic check, explicitly request the tool and sources: + +```text +Use reme_search to look up my long-term memory: what are the weekly report time, +report format, and primary database for Project Polaris? Answer in English based +on the retrieved memory and cite the memory sources. +``` + +![Using reme_search](../figures/dsh/memory-search-tool.png) + +In the screenshot, the agent performs two read-only English searches. It corroborates the answer across `digest/wiki/polaris-project.md` and `daily/2026-09-04/dsh-plugin-demo.md`, then reports Friday at 4:00 PM, concise Markdown, and PostgreSQL with Redis as cache. + +| Parameter | Required | Description | +| ----------- | -------- | ------------------------------------------------------------------- | +| `query` | Yes | Focused natural-language search query; an empty value fails closed. | +| `limit` | No | Result limit from 1 to 50; defaults to the plugin's `searchLimit`. | +| `min_score` | No | Minimum score; normally leave it at 0. Negative values become 0. | + +An empty successful response becomes `No relevant memory found.`. Service failures become `ReMe search failed: ...`, allowing the agent to report a failed lookup instead of guessing. + +## 7. Automatic memory + +With `autoMemoryEnabled=true`, the plugin listens to DSH session events and collects completed user and assistant messages per session. When `autoMemoryInterval` is reached, the batch enters a background queue and calls ReMe `auto_memory`. Plugin-generated context and tool results are excluded from capture so they cannot be laundered back into long-term memory. + +![Automatic-memory activity](../figures/dsh/reme-status-auto-memory.png) + +Chat completion and durable memory completion are asynchronous. To verify persistence, open **ReMe Status → Auto Memory**, wait until running and queued tasks return to zero, and confirm that the latest submission is marked **Completed**. + +## 8. ReMe Status tabs + +Open **Settings → ReMe Status**. Full service diagnostics load when the page opens or the user refreshes them. While the page is visible, only the DSH plugin runtime counters refresh every 5 seconds. + +### 8.1 Overview + +![ReMe Status overview](../figures/dsh/reme-status-overview.png) + +Overview shows connectivity, ReMe version, endpoint, refresh time, automatic-memory and consolidation settings, process RSS, estimated component memory, active sessions, and queued turns. **Server configuration (redacted)** exposes a safe view of `app_config`. A green **Connected** badge confirms the health request, but optional component availability should still be checked under Components. + +### 8.2 Auto Memory + +![ReMe Status Auto Memory](../figures/dsh/reme-status-auto-memory.png) + +This tab reports active sessions, queued turns, running tasks, queued tasks, and the pipeline from conversation turns through the submission queue to long-term memory. Activity states include **Queued**, **Running**, **Completed**, **Failed**, and **Cancelled**. Activity is process-local diagnostic history; ReMe workspace files remain the durable source of truth. + +### 8.3 Memory Consolidation + +![ReMe Status Memory Consolidation](../figures/dsh/reme-status-auto-dream.png) + +This tab shows the next run, cron schedule, timezone, and most recent result. The flow is **Journal entries → Organize and connect → Personal knowledge base**. **Consolidate Memory Now** manually invokes `auto_dream`, which may call a model and modify workspace files. + +### 8.4 Components + +![ReMe Status Components](../figures/dsh/reme-status-components.png) + +Components displays health and resource usage for the file graph, file store, keyword index, and optional embedding store. An unconfigured embedding instance is not itself a failure. If a derived index is unhealthy, rebuild it from source Markdown instead of deleting or rewriting user memory. + +### 8.5 Journal + +![ReMe Status Journal](../figures/dsh/reme-status-journal.png) + +Journal browses the workspace's `daily` files. The left pane searches and selects files; the right pane previews paths, frontmatter metadata, and Markdown content. The list is capped at the newest 5,000 files. + +### 8.6 Personal Knowledge Base + +![ReMe Status Personal Knowledge Base](../figures/dsh/reme-status-knowledge.png) + +Personal Knowledge Base browses consolidated `digest` files. Journal entries preserve time-oriented source material, while digest documents hold stable, deduplicated knowledge for long-term recall. Wikilinks can preserve provenance back to the source journal entry. + +## 9. Troubleshooting + +### ReMe Status reports Unavailable + +- Confirm `reme start` is still running and verify the endpoint protocol, host, and port. +- In containers or cross-machine deployments, `127.0.0.1` refers to each machine separately; configure a browser-reachable address. +- Verify that ReMe allows the DSH Web origin. +- Increase `requestTimeoutMs` when the service legitimately needs more than ten seconds. + +### No memory context appears + +- Create a new session after changing `language`; existing sessions are not reinjected. +- Subagents are intentionally skipped when `rootAgentsOnly=true`. +- One session receives the guidance only once, deduplicated by provenance metadata. + +### The agent does not call `reme_search` + +- Explicitly ask it to use `reme_search`, base the answer on the result, and cite sources. +- Confirm the selected agent preset allows global tools. +- Check that the package was loaded through its DSH bundle patch, not merely installed as a dependency. + +### Search returns no useful result + +- Confirm the source file exists under Journal or Personal Knowledge Base. +- Use a focused query and adjust `limit` or `min_score` only when needed. +- Check file store, keyword index, and embedding-store health under Components. +- Rebuild derived indexes from source files; never rewrite source memory just to satisfy an index. + +### A completed chat has not appeared in Journal + +- Confirm `autoMemoryEnabled=true` and check whether `autoMemoryInterval` has been reached. +- Inspect queued, running, and failed states under Auto Memory. +- Allow for background completion. Shutdown only has the configured `shutdownTimeoutMs` drain budget. + +## 10. Validation represented by these screenshots + +The test used the DSH `default` workspace and verified: + +- DSH UI and ReMe guidance language set to English. +- English `reme-memory` plugin context with correct provenance. +- Two real `reme_search` calls returning consistent `daily` and `digest` evidence. +- Successful background `auto_memory` submission with no queued task remaining. +- Working Overview, Auto Memory, Memory Consolidation, Components, Journal, and Personal Knowledge Base tabs. + +DSH screenshots live in `typescript/figures/dsh/`. Future hosts can use parallel directories such as `typescript/figures/openclaw/`. diff --git a/typescript/docs/dsh.zh-CN.md b/typescript/docs/dsh.zh-CN.md new file mode 100644 index 00000000..04ca9245 --- /dev/null +++ b/typescript/docs/dsh.zh-CN.md @@ -0,0 +1,281 @@ +# ReMe DeepSeek Harness 插件使用指南 + +本文介绍如何在 DeepSeek Harness(DSH)中安装、配置和使用 `@agentscope-ai/reme`,并解释插件提供的长期记忆指引、`reme_search` 工具、自动记忆和 ReMe 状态页面。 + +本文截图来自一次真实的本地联调:DSH 选择 `default` 工作区,界面和 ReMe 指引均设置为 English,ReMe 使用隔离的临时 workspace,示例“Project Polaris”是为演示创建的英文数据。截图不包含 `.env` 内容、API Key 或真实个人记忆。 + +## 1. 插件做了什么 + +DSH 启动新会话时,插件向根 Agent 注入一段“如何使用长期记忆”的指引,并注册只读工具 `reme_search`。会话完成后,插件可以把用户与助手的对话按批次交给 ReMe `auto_memory`;每天还可以按计划调用 `auto_dream`,把日记进一步整理成个人知识。 + +一次典型的数据流如下: + +```text +新会话 + └─ 注入长期记忆使用指引 + └─ Agent 判断问题是否依赖历史信息 + └─ reme_search → ReMe search → daily / digest 文件 + +完成的对话 + └─ 自动记忆批次 → ReMe auto_memory → daily 文件 + └─ 定时记忆整理 → ReMe auto_dream → digest 文件 +``` + +重要区别:DSH 适配器在普通对话开始时注入的是**记忆使用指引**,不是把所有历史记忆自动塞进上下文。真正与问题相关的记忆由 Agent 调用 `reme_search` 获取。这能减少无关上下文,也避免把历史内容误当成新指令。 + +## 2. 环境要求 + +- ReMe Python 服务已安装,且配置中提供 `search`、`auto_memory` 和 `auto_dream` Job。 +- DeepSeek Harness `0.1.2-rc.1` 或更高版本。 +- Node.js `22.22.3+`、`24.15.0+` 或 `25.9.0+` 中的一条受支持版本线。 +- DSH 页面能够访问 ReMe HTTP 地址;跨机器部署时还要允许 DSH 页面所在的浏览器 Origin。 + +ReMe HTTP 服务默认监听 `http://127.0.0.1:2333`,不使用 API Key 认证。因此不建议未经网络隔离直接暴露到公网。 + +## 3. 安装与启动 + +### 3.1 启动 ReMe + +```bash +reme start workspace_dir=/absolute/path/to/your/reme-workspace +``` + +开发或截图测试时建议使用仓库外的独立目录,例如 `/tmp/reme-dsh-demo`,不要把运行时记忆写入 ReMe 仓库自身的 `.reme/`。 + +### 3.2 安装插件 + +安装已发布版本: + +```bash +dsh plugin --profile web add @agentscope-ai/reme +``` + +开发本仓库时,也可以把本地 TypeScript 包链接到 DSH workspace,然后仍按 DSH 的 bundle 协议加载: + +```bash +cd /path/to/deepseek-harness +pnpm link /path/to/ReMe/typescript --workspace-root +dsh plugin --profile web add @agentscope-ai/reme +``` + +包通过 `package.json` 的 `dsh.bundle.patch` 声明 `dsh/cordis.patch.yml`。该 patch 在独立 `remeMemory` realm 中加载运行时入口 `@agentscope-ai/reme/dsh` 和 Web 客户端入口 `@agentscope-ai/reme`,符合 DSH `0.1.2-rc.1` 的插件协议。 + +### 3.3 启动 DSH Web + +```bash +cd /path/to/deepseek-harness +set -a +source .env +set +a + +dsh web --no-open --port 3080 +``` + +打开输出中的本地地址,选择工作区 `default`。如果服务启用了访问令牌,使用启动日志给出的地址或按 DSH 提示完成认证;不要把令牌写进文档和截图。 + +## 4. ReMe Memory 配置 + +进入 **设置 → 插件 → 插件配置 → ReMe Memory**。修改后点击保存;设置存入 DSH 用户设置文档,并从后续请求或捕获开始生效。修改 `language` 只影响之后创建的新会话,修改每日计划会重新安排下一次整理。 + +![ReMe Memory 插件配置](../figures/dsh/reme-memory-settings.png) + +截图中的测试配置使用 `http://127.0.0.1:2333`、English 指引、默认搜索数量 5、搜索超时 10 秒,并启用了自动记忆和“Exclude subagents”。完整字段如下: + +| 界面含义 | 配置键 | 默认值 | 说明 | +| -------------------- | --------------------- | ----------------------- | -------------------------------------------------------------------------- | +| 服务地址 | `endpoint` | `http://127.0.0.1:2333` | DSH 访问的 ReMe HTTP 服务绝对地址,只支持 `http`/`https`。 | +| 记忆指引语言 | `language` | `en` | `en` 或 `zh`;决定新会话中注入的指引语言。 | +| 默认搜索数量 | `searchLimit` | `5` | `reme_search` 未传 `limit` 时的默认结果上限,范围 1–50。 | +| 搜索超时(毫秒) | `requestTimeoutMs` | `10000` | `search` 请求的超时,范围 1,000–120,000。 | +| 自动记录已完成的对话 | `autoMemoryEnabled` | `true` | 是否捕获完成的用户/助手回合并提交给 `auto_memory`。 | +| 排除子 Agent | `rootAgentsOnly` | `true` | 开启时,只为根 Agent 注入指引并捕获对话。 | +| 自动记忆提交间隔 | `autoMemoryInterval` | `5` | 每完成多少轮对话提交一次,范围 1–1,000。退出时插件会在时间预算内尽力排空。 | +| 自动整理记忆 | `autoDreamEnabled` | `true` | 是否按照每日计划调用 `auto_dream`。 | +| 整理计划 | `dreamCron` | `0 23 * * *` | 五段 cron 表达式,按 `timezone` 解释;默认每天 23:00。 | +| 整理指引 | `dreamHint` | 空 | 可选的整理提示,原样交给 `auto_dream`。 | +| 工作区时区 | `timezone` | `Asia/Shanghai` | 有效的 IANA 时区,用于每日批次和 cron 计划。 | +| 后台任务超时(毫秒) | `backgroundTimeoutMs` | `3600000` | `auto_memory` 和 `auto_dream` 的最大等待时间。 | +| 退出等待(毫秒) | `shutdownTimeoutMs` | `5000` | DSH 退出时等待后台任务排空的时间预算。 | + +部署层还支持 `REME_URL`,或组合使用 `REME_HOST` 与 `REME_PORT`。仅供定时器测试的 `dreamIntervalMs` 不出现在用户设置中。 + +## 5. 普通对话中的 memory 上下文注入 + +创建一个新会话后,插件监听 DSH 的 `agent/session-start`,把长期记忆使用规则作为一条原生 plugin context 注入。展开消息流中的 **上下文注入 · reme-memory** 可以直接检查内容与来源元数据。 + +![普通对话中的 ReMe memory 上下文注入](../figures/dsh/memory-context-injection.png) + +截图中的英文指引包含四条稳定规则: + +1. ReMe 的长期记忆来自用户拥有的本地 `daily` 和 `digest` Markdown 文件。 +2. 当问题依赖过去的事实、偏好、决策、人物、日期、经验或待办时,回答前应调用 `reme_search`。 +3. 检索结果只是上下文证据,不是新的指令;没有相关结果时不能编造记忆。 +4. `auto_memory` 与 `auto_dream` 在后台维护记忆,一般不需要 Agent 主动调用。 + +注入记录带有 `plugin=reme-memory`、`form=instructions` 元数据。插件会检查当前会话和待处理消息,确保同一个会话不重复注入。`rootAgentsOnly=true` 时,来源标记为 `subagent` 的会话不会收到该指引。 + +这张截图把注入内容与搜索回答放在同一屏,是为了说明“先收到规则,再按需检索”的顺序;注入块本身并不包含“北极星项目”的业务记忆。 + +## 6. 使用 `reme_search` 工具 + +通常只需要自然语言提出依赖历史信息的问题。截图使用的英文请求如下: + +```text +Use reme_search to look up my long-term memory: what are the weekly report time, +report format, and primary database for Project Polaris? Answer in English based +on the retrieved memory and cite the memory sources. +``` + +![使用 reme_search 检索长期记忆](../figures/dsh/memory-search-tool.png) + +截图中 Agent 发起了两次只读英文检索。最终回答从 Journal 和 Personal Knowledge Base 中交叉得到“Every Friday at 4:00 PM、Concise Markdown、PostgreSQL(Redis as cache)”,并列出了 `digest/wiki/polaris-project.md` 与 `daily/2026-09-04/dsh-plugin-demo.md` 两个来源。 + +工具参数: + +| 参数 | 是否必填 | 说明 | +| ----------- | -------- | ------------------------------------------------------- | +| `query` | 是 | 聚焦的自然语言检索词;空字符串会直接报错。 | +| `limit` | 否 | 返回结果数量,范围 1–50;缺省使用插件的 `searchLimit`。 | +| `min_score` | 否 | 最低分数,通常保持 0;负数会归一为 0。 | + +工具通过当前配置的 ReMe endpoint 调用 `search`。成功但没有内容时返回 `No relevant memory found.`;服务错误时返回 `ReMe search failed: ...`,便于 Agent 明确告诉用户检索失败,而不是猜测答案。 + +建议把查询拆成少量、语义明确的短句。如果答案涉及多个独立事实,可以像截图一样分别搜索,再让 Agent 对来源进行交叉核对。 + +## 7. 自动记忆如何工作 + +启用 `autoMemoryEnabled` 后,插件监听 DSH `session/event`,按会话收集完成的用户和助手消息。达到 `autoMemoryInterval` 后进入提交队列,后台调用 ReMe `auto_memory`。插件生成的上下文以及工具结果不会再次进入自动记忆,避免把指引或检索回显循环写回长期记忆。 + +截图测试把间隔临时设为 1;运行记录中可以看到多个英文测试会话形成的已完成提交: + +![自动记忆运行记录](../figures/dsh/reme-status-auto-memory.png) + +自动记忆是后台任务:聊天回答完成不代表磁盘写入已经在同一毫秒完成。需要确认时,打开 **ReMe 状态 → 自动记忆**,等待“运行中任务”和“排队任务”归零,并检查最近提交是否为“已完成”。 + +## 8. ReMe 状态页六个标签 + +进入 **Settings → ReMe Status**。页面首次打开或主动刷新时读取完整服务诊断;页面可见时,每 5 秒仅刷新 DSH 插件的运行时计数。这里的“标签”指页面顶部的六个 tab:Overview、Auto Memory、Memory Consolidation、Components、Journal、Personal Knowledge Base。 + +### 8.1 总览 + +![ReMe 状态总览](../figures/dsh/reme-status-overview.png) + +总览用于快速判断集成是否可用: + +- 顶部展示连接状态、ReMe 版本、endpoint 和最近刷新时间。 +- 自动记忆卡显示开关和提交间隔;记忆整理卡显示开关及下一次执行时间。 +- 进程内存是 ReMe 服务 RSS;组件内存是状态接口汇总的组件内存估算。 +- 活跃会话、待处理回合来自当前 DSH 插件运行时,不是历史累计值。 +- “服务配置(已脱敏)”展示 ReMe 返回的 `app_config` 安全视图,敏感字段不会原样显示。 +- “打开 ReMe”访问服务提供的 ReMe 页面;“ReMe 官网”打开项目网站。 + +绿色“已连接”意味着健康检查成功,不代表每个可选组件都已配置;组件详情应查看“组件”标签。 + +### 8.2 自动记忆 + +![ReMe 状态自动记忆](../figures/dsh/reme-status-auto-memory.png) + +该页把会话捕获状态拆成四个计数:活跃会话、待处理回合、运行中任务、排队任务。流程图表示“对话回合 → 提交队列 → 长期记忆”。 + +状态含义: + +- **空闲**:当前没有正在执行或排队的提交;不等于功能关闭。 +- **运行中/排队中**:批次正在请求 ReMe,或等待前面的任务完成。 +- **已完成**:ReMe 接受并完成该批次;行尾显示回合数和消息数。 +- **失败**:请求或 Job 执行失败,页面会显示最近错误。 +- **已取消**:关停期间任务未能在退出预算内完成。 + +运行记录保存在当前 DSH 进程的内存中,重启 DSH 后会重新计数;真正的长期数据仍以 ReMe workspace 文件为准。 + +### 8.3 记忆整理 + +![ReMe 状态记忆整理](../figures/dsh/reme-status-auto-dream.png) + +该页展示下一次整理时间、cron、时区和本次进程中的最近执行结果。流程为“日记记录 → 整理与关联 → 个人知识库”。点击 **立即整理** 会手动发起一次 `auto_dream`,可能调用模型并修改 ReMe workspace,应只在确实需要整理时使用。 + +cron 按插件配置的 IANA 时区解释。截图中的 `0 23 * * *` 与 `Asia/Shanghai` 表示每天北京时间 23:00。修改计划后无需重启 DSH,插件会重新调度。 + +### 8.4 组件 + +![ReMe 状态组件](../figures/dsh/reme-status-components.png) + +组件页展示 ReMe 的索引与存储基础设施。顶部 `3 / 3` 表示三个已配置的组件均健康;“向量存储未配置实例”是可选能力未启用,不等同于故障。 + +- **文件图谱**:显示节点、边、虚拟节点、待处理节点和内存占用,用于文件间关系与 wikilink。 +- **文件存储**:显示切分后的内容块、已生成向量的块数和内存占用。 +- **关键词索引**:显示已索引文档、词汇量和内存占用,为本次演示的文本检索提供能力。 +- **向量存储**:若启用,会显示模型、向量维度、缓存条目和内存;未配置时仍可使用服务端已有的其他搜索能力。 + +如果组件显示“需要处理”或“未启动”,优先查看 ReMe 服务日志和服务端配置,不要删除源 Markdown 文件来修复派生索引。 + +### 8.5 日记 + +![ReMe 状态日记](../figures/dsh/reme-status-journal.png) + +日记页浏览 ReMe workspace 的 `daily` 内容。左侧可以搜索和选择文件,右侧显示路径、frontmatter 元数据和 Markdown 正文。截图中除英文手工演示笔记外,还能看到英文搜索对话经 `auto_memory` 生成的条目。 + +列表最多显示最新 5,000 个文件。此页面用于查看,不改变“workspace 文件是持久事实源”的原则;索引、目录和缓存都应能够从这些文件重建。 + +### 8.6 个人知识库 + +![ReMe 状态个人知识库](../figures/dsh/reme-status-knowledge.png) + +个人知识库页浏览 `digest` 下经过整理的长期知识。布局与日记页一致:左侧文件列表,右侧元数据与内容预览。截图中的 `polaris-project.md` 汇总了长期偏好和技术决策,并通过 wikilink 指回原始日记来源。 + +日记更接近按天产生的原始记录,个人知识库更适合稳定、去重、可持续召回的知识。`reme_search` 可以同时从服务配置允许的这些来源中检索。 + +## 9. 日常使用建议 + +1. 先确认 **ReMe 状态 → 总览** 为“已连接”。 +2. 新建会话后,可在消息详情中展开 `reme-memory` 上下文确认指引已注入。 +3. 问题依赖历史事实时,明确要求 Agent 调用 `reme_search`,并要求列出来源。 +4. 对话结束后,到“自动记忆”确认批次完成,再到“日记”检查落盘内容。 +5. 用“记忆整理”的定时计划做日常归纳;只有需要立即验证时才手动触发。 +6. 定期查看“组件”健康,但修复索引时始终从 workspace 源文件重建,不要反向覆盖用户记忆。 + +## 10. 常见问题 + +### 状态页显示“连接失败” + +- 确认 `reme start` 仍在运行,并检查 `endpoint` 的协议、主机和端口。 +- DSH 与 ReMe 在容器或不同机器时,`127.0.0.1` 指向各自本机,需要改成浏览器可访问的地址。 +- 检查 ReMe 的 CORS 是否允许 DSH Web 的 Origin。 +- 超过 10 秒才响应时,按实际情况提高 `requestTimeoutMs`。 + +### 新会话没有看到上下文注入 + +- 保存 `language` 或开关设置后需要新建会话;已有会话不会补注入或更换语言。 +- 子 Agent 在 `rootAgentsOnly=true` 时会被主动跳过。 +- 同一会话只注入一次,插件会通过来源元数据去重。 + +### Agent 没有调用 `reme_search` + +- 用明确措辞说明问题依赖长期记忆,并要求“使用 `reme_search`、基于结果回答、标明来源”。 +- 检查当前 Agent 预设是否允许全局工具,以及消息详情中是否出现 ReMe 指引。 +- 检查插件是否按 DSH bundle patch 正常加载,而不只是把 npm 包安装到了依赖目录。 + +### 搜索无结果或结果过多 + +- 在“日记”和“个人知识库”中确认源文件确实存在。 +- 使用更聚焦的查询,必要时调整 `limit` 或 `min_score`。 +- 检查“组件”中的文件存储、关键词索引或向量存储状态。 +- 索引异常时重建派生状态,不要删除或改写源记忆来迁就索引。 + +### 聊天完成但日记还没更新 + +- 确认 `autoMemoryEnabled=true`,并了解 `autoMemoryInterval` 是达到多少个完成回合才提交。 +- 打开“自动记忆”检查待处理、排队、运行和失败状态。 +- 后台 Job 可能比聊天响应稍晚完成;DSH 退出时只有 `shutdownTimeoutMs` 的排空预算。 + +## 11. 本文联调结果 + +本次使用 `default` DSH 工作区完成了以下真实链路验证: + +- ReMe `0.4.1.11` 服务连接成功。 +- DSH 界面语言与 ReMe `Guidance language` 均已切换并保存为 English。 +- 新会话出现英文 `reme-memory` plugin context,来源元数据正确。 +- Agent 两次调用 `reme_search` 并从英文 `daily`、`digest` 返回一致答案。 +- 英文会话通过 `auto_memory` 完成后台提交,状态页无排队任务。 +- 总览、自动记忆、记忆整理、组件、日记、个人知识库六个标签均能读取并展示数据。 + +DSH 截图统一放在 `typescript/figures/dsh/`,本文位于 `typescript/docs/`。后续其他宿主的截图可以使用并列目录,例如 `typescript/figures/openclaw/`。运行时演示记忆位于仓库外的临时 workspace,不属于项目产物。 diff --git a/typescript/README_OPENCLAW.md b/typescript/docs/openclaw.md similarity index 99% rename from typescript/README_OPENCLAW.md rename to typescript/docs/openclaw.md index 8ee632c0..de9a616a 100644 --- a/typescript/README_OPENCLAW.md +++ b/typescript/docs/openclaw.md @@ -1,6 +1,6 @@ # ReMe memory for OpenClaw -[中文说明](./README_ZH.md) +[中文说明](./openclaw.zh-CN.md) ReMe gives OpenClaw file-native long-term memory while keeping durable memory in a workspace you own. The plugin uses OpenClaw's native lifecycle, hooks, tools, and memory slot. diff --git a/typescript/README_OPENCLAW_ZH.md b/typescript/docs/openclaw.zh-CN.md similarity index 99% rename from typescript/README_OPENCLAW_ZH.md rename to typescript/docs/openclaw.zh-CN.md index d518b506..01444319 100644 --- a/typescript/README_OPENCLAW_ZH.md +++ b/typescript/docs/openclaw.zh-CN.md @@ -1,6 +1,6 @@ # OpenClaw 的 ReMe 长期记忆插件 -[English](./README.md) +[English](./openclaw.md) ReMe 为 OpenClaw 提供文件原生的长期记忆,并将持久记忆保存在用户拥有的 workspace 中。插件使用 OpenClaw 原生的生命周期、Hook、工具接口和 memory slot。 diff --git a/typescript/figures/dsh/memory-context-injection.png b/typescript/figures/dsh/memory-context-injection.png new file mode 100644 index 00000000..c105deb9 Binary files /dev/null and b/typescript/figures/dsh/memory-context-injection.png differ diff --git a/typescript/figures/dsh/memory-search-tool.png b/typescript/figures/dsh/memory-search-tool.png new file mode 100644 index 00000000..42b8b114 Binary files /dev/null and b/typescript/figures/dsh/memory-search-tool.png differ diff --git a/typescript/figures/dsh/reme-memory-settings.png b/typescript/figures/dsh/reme-memory-settings.png new file mode 100644 index 00000000..fceeeede Binary files /dev/null and b/typescript/figures/dsh/reme-memory-settings.png differ diff --git a/typescript/figures/dsh/reme-status-auto-dream.png b/typescript/figures/dsh/reme-status-auto-dream.png new file mode 100644 index 00000000..d9e197c8 Binary files /dev/null and b/typescript/figures/dsh/reme-status-auto-dream.png differ diff --git a/typescript/figures/dsh/reme-status-auto-memory.png b/typescript/figures/dsh/reme-status-auto-memory.png new file mode 100644 index 00000000..0ddb845f Binary files /dev/null and b/typescript/figures/dsh/reme-status-auto-memory.png differ diff --git a/typescript/figures/dsh/reme-status-components.png b/typescript/figures/dsh/reme-status-components.png new file mode 100644 index 00000000..0ee26116 Binary files /dev/null and b/typescript/figures/dsh/reme-status-components.png differ diff --git a/typescript/figures/dsh/reme-status-journal.png b/typescript/figures/dsh/reme-status-journal.png new file mode 100644 index 00000000..2775ab79 Binary files /dev/null and b/typescript/figures/dsh/reme-status-journal.png differ diff --git a/typescript/figures/dsh/reme-status-knowledge.png b/typescript/figures/dsh/reme-status-knowledge.png new file mode 100644 index 00000000..d219c852 Binary files /dev/null and b/typescript/figures/dsh/reme-status-knowledge.png differ diff --git a/typescript/figures/dsh/reme-status-overview.png b/typescript/figures/dsh/reme-status-overview.png new file mode 100644 index 00000000..df0dcf7b Binary files /dev/null and b/typescript/figures/dsh/reme-status-overview.png differ diff --git a/typescript/package-lock.json b/typescript/package-lock.json index 911e3f93..a36cc88b 100644 --- a/typescript/package-lock.json +++ b/typescript/package-lock.json @@ -12,13 +12,13 @@ "typebox": "1.3.19" }, "devDependencies": { - "@deepseek-ai/cordis": "4.0.1", - "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "0.1.0-rc.8", - "@deepseek-ai/dsh-settings": "0.1.0-rc.8", - "@deepseek-ai/dsh-tools": "0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8", - "@deepseek-ai/schemastery": "3.18.1", + "@deepseek-ai/cordis": "4.0.2", + "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "0.1.2-rc.1", + "@deepseek-ai/dsh-settings": "0.1.2-rc.1", + "@deepseek-ai/dsh-tools": "0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "0.1.2-rc.1", + "@deepseek-ai/schemastery": "3.18.2", "@eslint/js": "9.39.4", "@types/node": "^22.15.0", "@types/react": "~18.3.1", @@ -36,13 +36,13 @@ "node": "^22.22.3 || ^24.15.0 || >=25.9.0" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-settings": "^0.1.0-rc.8", - "@deepseek-ai/dsh-tools": "^0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8", - "@deepseek-ai/schemastery": "^3.18.1", + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-settings": "^0.1.2-rc.1", + "@deepseek-ai/dsh-tools": "^0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "^0.1.2-rc.1", + "@deepseek-ai/schemastery": "^3.18.2", "openclaw": ">=2026.7.1" }, "peerDependenciesMeta": { @@ -313,21 +313,21 @@ } }, "node_modules/@deepseek-ai/cordis": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@deepseek-ai/cordis/-/cordis-4.0.1.tgz", - "integrity": "sha512-YBdskTU2Po1kru3GgcUWUbkTsPMA9LkSQDAY8rBkFJeajdgcQad3QPJZE26JyK99Xb6HaASvoXg2DSUTeN/0Nw==", + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@deepseek-ai/cordis/-/cordis-4.0.2.tgz", + "integrity": "sha512-asOnXP1TzFSFQlHb1iegDZp0z/8WD1c7YNrwJR/Tx2bzNuMXfcekE/I67Iv6SQXeLB4csxqCngzQKANP7gdw0g==", "dev": true, "license": "MIT", "dependencies": { - "@deepseek-ai/cosmokit": "^1.8.2", + "@deepseek-ai/cosmokit": "^1.8.3", "@standard-schema/spec": "^1.1.0" }, "bin": { "cordis": "bin.js" }, "peerDependencies": { - "@deepseek-ai/cordis-plugin-include": "^1.0.6", - "@deepseek-ai/cordis-plugin-loader": "^1.0.2" + "@deepseek-ai/cordis-plugin-include": "^1.0.7", + "@deepseek-ai/cordis-plugin-loader": "^1.0.3" }, "peerDependenciesMeta": { "@deepseek-ai/cordis-plugin-include": { @@ -339,58 +339,44 @@ } }, "node_modules/@deepseek-ai/cosmokit": { - "version": "1.8.2", - "resolved": "https://registry.npmjs.org/@deepseek-ai/cosmokit/-/cosmokit-1.8.2.tgz", - "integrity": "sha512-muBOKtSrUKU5m/xpq8ZXWL6hQ/jgd4PhU2PqH97bcxIiLEJfNwZOGQEx4t/aS/GgxRAR+ra9pMHPMtTHU4sqqA==", + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/@deepseek-ai/cosmokit/-/cosmokit-1.8.3.tgz", + "integrity": "sha512-qBo+ronVM6Eu2WNVJXi8JcMiqZ19T9BRIpV+5qJUFPXjGH/Z0QKcQMC/IZJ7L394YTOtJgcovbk9qP0w2GsBXQ==", "dev": true, "license": "MIT" }, "node_modules/@deepseek-ai/dsh-agent": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-agent/-/dsh-agent-0.1.0-rc.8.tgz", - "integrity": "sha512-fOl46ZvzoYHalrlyfOJAHNhzyKeVDTUnZZKNSJEr9GY/98WJTjcV21agVEofTXldkJ7a/ws2HpJkVNJVFMtslg==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-agent/-/dsh-agent-0.1.2-rc.1.tgz", + "integrity": "sha512-lfaqN34vUCWvbn1kJVHrhfJ6Dvt1HDHCm33ZCpmKkl07/5q6FxWqVv6rOdVX5QnM/9xz/uYiN0nQwUtBg4+Skg==", "dev": true, "license": "MIT", "peer": true, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-scope": "^0.1.0-rc.8", - "@deepseek-ai/dsh-session": "^0.1.0-rc.8", - "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8" - } - }, - "node_modules/@deepseek-ai/dsh-attachment": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-attachment/-/dsh-attachment-0.1.0-rc.8.tgz", - "integrity": "sha512-cCrg4WWiav7pGtbdU8dJTpAG28cPnkWVB2YPOrlBCgBbhQziGcG9Dv67Ti6L3PI4OQKC55gYBFinQghFO/7FGg==", - "dev": true, - "license": "MIT", - "peer": true, - "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-brand": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-scope": "^0.1.2-rc.1", + "@deepseek-ai/dsh-session": "^0.1.2-rc.1", + "@deepseek-ai/dsh-session-projection": "^0.1.2-rc.1", + "@deepseek-ai/dsh-system-prompt": "^0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "^0.1.2-rc.1" } }, "node_modules/@deepseek-ai/dsh-brand": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-brand/-/dsh-brand-0.1.0-rc.8.tgz", - "integrity": "sha512-402aUAfHxIZJrArBV4gDf0I/A/69A/By26FX6HTIOyFmCnB4wUBKh8jnglz1CorKWdZy8AKldAhh8HQhQEbGOQ==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-brand/-/dsh-brand-0.1.2-rc.1.tgz", + "integrity": "sha512-y2RHIag3kzLdY8kTBuSUSTsKzWPscJrysNObXTiNM7stXLpa3jXpshsB1caqGzNx50vYcmHeN1gFVECgx3NZHg==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-client-ui-primitives": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-client-ui-primitives/-/dsh-client-ui-primitives-0.1.0-rc.8.tgz", - "integrity": "sha512-P3/n4jWT5kp4kTH67h+nmLu8LhKl9KsbFn8plumQFPXKGj2ythwmVoK3Nc329ANcYlxKXVtnoLPwYrTxkSeIpA==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-client-ui-primitives/-/dsh-client-ui-primitives-0.1.2-rc.1.tgz", + "integrity": "sha512-4gZS+tXAHbSxAjP91+lENpxKb49XVKcO80m7ATNNgD6lJHOwbuWVGv9IwEnmQ5ebZvI8Yrp8C1J+jDe1pB9jXw==", "dev": true, "license": "MIT", "dependencies": { @@ -416,184 +402,223 @@ "shiki": "^4.3.1" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-code-runtime": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-code-runtime/-/dsh-code-runtime-0.1.0-rc.8.tgz", - "integrity": "sha512-6ZKyEE7dHH1UkKe5b0lg18Byww/7ocZyrNMVjAoUWEWp5i96Brf9Eavu9q3zepBMDMZJErCfV0pyt7KDhBJSig==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-code-runtime/-/dsh-code-runtime-0.1.2-rc.1.tgz", + "integrity": "sha512-dv5UszPJb/AFcarZc2c6h5z/X80bsrSd3bfIOugwNVclSI6P+L3ixseoZKgyks7T0Ap0h6ngXGk2WeoUkmYxnQ==", "dev": true, "license": "MIT", "peer": true, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-invariants": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-invariants/-/dsh-invariants-0.1.0-rc.8.tgz", - "integrity": "sha512-u0lYqyxOYwfsVnbsfGXZos5vFvA4cqFnBEW3/ezgljNwkYwzeUP/Y5wjPnQjP+ZzBn3CnVeIF6s2N2Vk3iA5mQ==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-invariants/-/dsh-invariants-0.1.2-rc.1.tgz", + "integrity": "sha512-zSjuFJYcEB94kPwn7SicqAV1dfVWZkjt1I8luDboxtjfp5CN6ziwJhLv3KaB+Dh9tgkyGY4mvo886W/HhE9L9g==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/schemastery": "^3.18.2" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-llm": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-llm/-/dsh-llm-0.1.0-rc.8.tgz", - "integrity": "sha512-hf6RmX2Stn1UtzpktSHQLkIktQkBm9i/3yFfJlbGSkwyw5Cv9sTYJbyoHzsSnnh6i8nRRcMcBhvMgm23I00oIw==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-llm/-/dsh-llm-0.1.2-rc.1.tgz", + "integrity": "sha512-7VYsha5AXsVLnsAwYJffWXz9bwUbElw8i5N8tlTSdai9Bupk3sMbsotzPf8ZbsuGAxQYErahMwQwgGEu4qZO6g==", "dev": true, "license": "MIT", "dependencies": { - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/dsh-brand": "^0.1.2-rc.1", + "@deepseek-ai/dsh-timeout": "^0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "^0.1.2-rc.1", + "@deepseek-ai/dsh-util-crypto": "^0.1.2-rc.1", + "@deepseek-ai/dsh-util-values": "^0.1.2-rc.1", + "@deepseek-ai/schemastery": "^3.18.2", + "zod": "^4.4.3" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-attachment": "^0.1.0-rc.8", - "@deepseek-ai/dsh-brand": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-timeout": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-scope": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-scope/-/dsh-scope-0.1.0-rc.8.tgz", - "integrity": "sha512-/o+PxkVV2zUy9lYlMFr4TWSb+ESW4DE+fI891yIbsLzOJdFgfbmmLpGrlWgnz8/unIGJZxjeXdwyppV04Z277Q==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-scope/-/dsh-scope-0.1.2-rc.1.tgz", + "integrity": "sha512-GHwbzWrGbmE0ZGzAZsXBudpyCM9ENCpXxlKODIaPFbIWhRePh6nH2jW47TAOqCIsPPedWC2p3w8Tx5WAa3I/2A==", "dev": true, "license": "MIT", "peer": true, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1" } }, "node_modules/@deepseek-ai/dsh-session": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-session/-/dsh-session-0.1.0-rc.8.tgz", - "integrity": "sha512-Qs5Mgn32WPPVB4rKHjsZBgLOkh0TQurUAcc9GaDVudK4dUkpno2HDh++qu/PrwRA3CZ/iwPAoFHCpB3AMMaoLg==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-session/-/dsh-session-0.1.2-rc.1.tgz", + "integrity": "sha512-jRGNPTbQcvIx1F2MVmmkoiHLgpC3Btqo1wkl/3JDLlOWRVWKOuaC+5fQiMrFPOYfno6YiX/c2UvmA0td8qB92w==", "dev": true, "license": "MIT", "peer": true, + "dependencies": { + "@deepseek-ai/dsh-brand": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-util-values": "^0.1.2-rc.1" + }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-brand": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-scope": "^0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-scope": "^0.1.2-rc.1" + } + }, + "node_modules/@deepseek-ai/dsh-session-projection": { + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-session-projection/-/dsh-session-projection-0.1.2-rc.1.tgz", + "integrity": "sha512-qVWlIzPm4u9vzQ5G/QtE6jeSJ3b3b42hWVJj664BurEZlHbAfdqkhYc1QsoBU+5k5kUEJFHh07z8HxuXA9kTnQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "zod": "^4.4.3" + }, + "peerDependencies": { + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-session": "^0.1.2-rc.1" } }, "node_modules/@deepseek-ai/dsh-settings": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-settings/-/dsh-settings-0.1.0-rc.8.tgz", - "integrity": "sha512-pqbMoiSP+Ieww9/4gcHYXcBCDlno1zYDu2OPq+5xdZ+McnK+5YBtHsiRpnR9cHQxGTH7lkfIv+adkOueQW0utg==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-settings/-/dsh-settings-0.1.2-rc.1.tgz", + "integrity": "sha512-wMmJ2w5S6I7hgmgPppuAVemltEcTmAa8gvii7fk4T2KGVCuBYgig8xPwQ8Lp2ukLZSzzE6ZVCQxhdYZyJX/USA==", "dev": true, "license": "MIT", + "dependencies": { + "@deepseek-ai/dsh-util-values": "^0.1.2-rc.1" + }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-brand": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-brand": "^0.1.2-rc.1", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1", + "@deepseek-ai/dsh-session": "^0.1.2-rc.1", + "@deepseek-ai/schemastery": "^3.18.2" } }, "node_modules/@deepseek-ai/dsh-system-prompt": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-system-prompt/-/dsh-system-prompt-0.1.0-rc.8.tgz", - "integrity": "sha512-yk8Z85rzX2EwpKNWA5i+K3I3mqsIIUc9niwbDpXO8vlHvpC2qR3RNHjJIJN2EZYDqfSzTVtkbxHFsuMzDXIbew==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-system-prompt/-/dsh-system-prompt-0.1.2-rc.1.tgz", + "integrity": "sha512-7W93PZKIk4CHvjZGgLIxrrEKpk+6t8nQXje1vKR5vG73dfXH0t1MJ5WWH/fngadYc7c6KzM84ihQ66tJqJqyNQ==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/schemastery": "^3.18.2" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-scope": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-scope": "^0.1.2-rc.1" } }, "node_modules/@deepseek-ai/dsh-timeout": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-timeout/-/dsh-timeout-0.1.0-rc.8.tgz", - "integrity": "sha512-RwOC/qHribE6b+LStAO7aAgweefLE5sqDO7Uz6/mnTDyJxCt7HNQnE/Op8sAvRa33d752aUkPfO9S0mgzVAoFQ==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-timeout/-/dsh-timeout-0.1.2-rc.1.tgz", + "integrity": "sha512-llz11yxWeJB8suKCa6hRLjNBWVaPn3Fbd0XoBS0bkZLhPFzO1mDorx/XMca2GhI7XF9A86CURQcDt+aGjjvqJA==", "dev": true, "license": "MIT", - "peer": true, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-tools": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-tools/-/dsh-tools-0.1.0-rc.8.tgz", - "integrity": "sha512-tvuGAVUS4yoPW9zH7CGWJgMlAzGjfu2UlRiricldlcwSKAaJZPZx/K/YfTivUyDTER6aK1DJUnIpVG7RD/DoHQ==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-tools/-/dsh-tools-0.1.2-rc.1.tgz", + "integrity": "sha512-W9kUio00s7WbM8kEwniyd4hfb3CeUxVczsjXbOcKtakfiTywNLeyRWkpx2fvwRAH2rBfg3qCgczVfS0DOw1csg==", "dev": true, "license": "MIT", "dependencies": { - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/dsh-brand": "^0.1.2-rc.1", + "@deepseek-ai/dsh-util-values": "^0.1.2-rc.1", + "@deepseek-ai/schemastery": "^3.18.2" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-agent": "^0.1.0-rc.8", - "@deepseek-ai/dsh-code-runtime": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-scope": "^0.1.0-rc.8", - "@deepseek-ai/dsh-session": "^0.1.0-rc.8", - "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.8", - "@deepseek-ai/dsh-user-approval": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-agent": "^0.1.2-rc.1", + "@deepseek-ai/dsh-code-runtime": "^0.1.2-rc.1", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-scope": "^0.1.2-rc.1", + "@deepseek-ai/dsh-session": "^0.1.2-rc.1", + "@deepseek-ai/dsh-system-prompt": "^0.1.2-rc.1", + "@deepseek-ai/dsh-user-approval": "^0.1.2-rc.1" } }, "node_modules/@deepseek-ai/dsh-typert-protocol": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-typert-protocol/-/dsh-typert-protocol-0.1.0-rc.8.tgz", - "integrity": "sha512-scwEAefRBL7gRpaXiEdiHRMvlr8dLmUbiEvy0LOAX/8X3FZBd/5tHQ/8lCppAQNTDZMI/LSiSMpu5XrFId+7cQ==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-typert-protocol/-/dsh-typert-protocol-0.1.2-rc.1.tgz", + "integrity": "sha512-vBWD0NpriPd96ltbWaAw+iKeWFIEjiAcCWYtmqEcV1Ms+FaV02usjjm7LCmhSQhMZpBSBc7EZUX0spGlpjI1bA==", "dev": true, "license": "MIT", "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/dsh-user-approval": { - "version": "0.1.0-rc.8", - "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-user-approval/-/dsh-user-approval-0.1.0-rc.8.tgz", - "integrity": "sha512-6SFCxp7dgNFEyzQIcs5i9C+5djgXsAeV0iKmZUCLlcIeVM1chcCMHyGcoXlw8yyB14qFMrMs+TPvhvpu2WWxAw==", + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-user-approval/-/dsh-user-approval-0.1.2-rc.1.tgz", + "integrity": "sha512-oYkLE4a/TwqVNi299pUf/QP1Yku6KScdUCTUyYbjaRBcN+/pXPpHikl2aoE2thH9D0uT/Kj6T2kz+wDDcFd9Xg==", "dev": true, "license": "MIT", "peer": true, "dependencies": { - "@deepseek-ai/schemastery": "^3.18.1" + "@deepseek-ai/schemastery": "^3.18.2" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-agent": "^0.1.0-rc.8", - "@deepseek-ai/dsh-brand": "^0.1.0-rc.8", - "@deepseek-ai/dsh-invariants": "^0.1.0-rc.8", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-scope": "^0.1.0-rc.8", - "@deepseek-ai/dsh-session": "^0.1.0-rc.8", - "@deepseek-ai/dsh-system-prompt": "^0.1.0-rc.8" + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-agent": "^0.1.2-rc.1", + "@deepseek-ai/dsh-brand": "^0.1.2-rc.1", + "@deepseek-ai/dsh-invariants": "^0.1.2-rc.1", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-scope": "^0.1.2-rc.1", + "@deepseek-ai/dsh-session": "^0.1.2-rc.1", + "@deepseek-ai/dsh-system-prompt": "^0.1.2-rc.1" + } + }, + "node_modules/@deepseek-ai/dsh-util-crypto": { + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-util-crypto/-/dsh-util-crypto-0.1.2-rc.1.tgz", + "integrity": "sha512-gE8FznQ1hkknw9QMrHNSlm3UEyRYuj3MLVvlJ6NyH1kmOsdjnbrVbSs+Pn72k2oIV4Fiyu3Umg0sLznUEcsiXw==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@deepseek-ai/cordis": "^4.0.2" + } + }, + "node_modules/@deepseek-ai/dsh-util-values": { + "version": "0.1.2-rc.1", + "resolved": "https://registry.npmjs.org/@deepseek-ai/dsh-util-values/-/dsh-util-values-0.1.2-rc.1.tgz", + "integrity": "sha512-FQdgoK+KYVR0pBQb9fTsajvGb3gzUxEzJQEYnFOt+Qdwc4nkxJOPwJJdIvXuqvZaQ33DaOoqpnpcr2p5HpLu4g==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@deepseek-ai/cordis": "^4.0.2" } }, "node_modules/@deepseek-ai/schemastery": { - "version": "3.18.1", - "resolved": "https://registry.npmjs.org/@deepseek-ai/schemastery/-/schemastery-3.18.1.tgz", - "integrity": "sha512-Qn0FCSwCQnpnj6SB31I6i2sIKgKWnkbJM8O0EU91Gv2UsYVvtZTl6IA0sCwk2e2MZf5S8w5hpq9QkeVvK9qwxg==", + "version": "3.18.2", + "resolved": "https://registry.npmjs.org/@deepseek-ai/schemastery/-/schemastery-3.18.2.tgz", + "integrity": "sha512-njDtZsznjYxok7KLLlHOPyuv2efdWVbSflAHgztSfbMsg+CVraEoRe2DjOCgClYv3ZCSm7WXoaUkbB/+RY7tWQ==", "dev": true, "license": "MIT", "dependencies": { - "@deepseek-ai/cosmokit": "^1.8.2", + "@deepseek-ai/cosmokit": "^1.8.3", "@standard-schema/spec": "^1.1.0" } }, diff --git a/typescript/package.json b/typescript/package.json index e5093de9..c64572ae 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -28,13 +28,15 @@ "dsh/cordis.patch.yml", "openclaw.plugin.json", "README.md", - "README_ZH.md" + "README_ZH.md", + "docs", + "figures/dsh" ], "dsh": { "client": { "inject": [ "@deepseek-ai/dsh-client-locale", - "@deepseek-ai/dsh-client-runtime", + "@deepseek-ai/dsh-client-connection", "@deepseek-ai/dsh-client-ui-settings", "@deepseek-ai/dsh-client-ui-settings-plugins", "@deepseek-ai/dsh-client-ui-primitives" @@ -75,13 +77,13 @@ "typebox": "1.3.19" }, "peerDependencies": { - "@deepseek-ai/cordis": "^4.0.1", - "@deepseek-ai/dsh-llm": "^0.1.0-rc.8", - "@deepseek-ai/dsh-settings": "^0.1.0-rc.8", - "@deepseek-ai/dsh-client-ui-primitives": "^0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "^0.1.0-rc.8", - "@deepseek-ai/dsh-tools": "^0.1.0-rc.8", - "@deepseek-ai/schemastery": "^3.18.1", + "@deepseek-ai/cordis": "^4.0.2", + "@deepseek-ai/dsh-llm": "^0.1.2-rc.1", + "@deepseek-ai/dsh-settings": "^0.1.2-rc.1", + "@deepseek-ai/dsh-client-ui-primitives": "^0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "^0.1.2-rc.1", + "@deepseek-ai/dsh-tools": "^0.1.2-rc.1", + "@deepseek-ai/schemastery": "^3.18.2", "openclaw": ">=2026.7.1" }, "peerDependenciesMeta": { @@ -111,13 +113,13 @@ } }, "devDependencies": { - "@deepseek-ai/cordis": "4.0.1", - "@deepseek-ai/dsh-llm": "0.1.0-rc.8", - "@deepseek-ai/dsh-settings": "0.1.0-rc.8", - "@deepseek-ai/dsh-client-ui-primitives": "0.1.0-rc.8", - "@deepseek-ai/dsh-typert-protocol": "0.1.0-rc.8", - "@deepseek-ai/dsh-tools": "0.1.0-rc.8", - "@deepseek-ai/schemastery": "3.18.1", + "@deepseek-ai/cordis": "4.0.2", + "@deepseek-ai/dsh-llm": "0.1.2-rc.1", + "@deepseek-ai/dsh-settings": "0.1.2-rc.1", + "@deepseek-ai/dsh-client-ui-primitives": "0.1.2-rc.1", + "@deepseek-ai/dsh-typert-protocol": "0.1.2-rc.1", + "@deepseek-ai/dsh-tools": "0.1.2-rc.1", + "@deepseek-ai/schemastery": "3.18.2", "@eslint/js": "9.39.4", "@types/node": "^22.15.0", "@types/react": "~18.3.1", diff --git a/typescript/scripts/pack-clawhub.mjs b/typescript/scripts/pack-clawhub.mjs index d42e8970..415fc063 100644 --- a/typescript/scripts/pack-clawhub.mjs +++ b/typescript/scripts/pack-clawhub.mjs @@ -21,6 +21,14 @@ const temporaryDirectory = await mkdtemp( ); const stagingDirectory = path.join(temporaryDirectory, "package"); +async function stageReadme(source, destination, oldLink, newLink) { + const content = await readFile(path.join(packageDirectory, source), "utf8"); + await writeFile( + path.join(stagingDirectory, destination), + content.replace(oldLink, newLink), + ); +} + try { await mkdir(stagingDirectory, { recursive: true }); await mkdir(destinationDirectory, { recursive: true }); @@ -49,13 +57,17 @@ try { path.join(packageDirectory, "openclaw.plugin.json"), path.join(stagingDirectory, "openclaw.plugin.json"), ), - copyFile( - path.join(packageDirectory, "README_OPENCLAW.md"), - path.join(stagingDirectory, "README.md"), + stageReadme( + "docs/openclaw.md", + "README.md", + "(./openclaw.zh-CN.md)", + "(./README_ZH.md)", ), - copyFile( - path.join(packageDirectory, "README_OPENCLAW_ZH.md"), - path.join(stagingDirectory, "README_ZH.md"), + stageReadme( + "docs/openclaw.zh-CN.md", + "README_ZH.md", + "(./openclaw.md)", + "(./README.md)", ), ]); diff --git a/typescript/scripts/test-package.mjs b/typescript/scripts/test-package.mjs index 3a9e7654..c976241c 100644 --- a/typescript/scripts/test-package.mjs +++ b/typescript/scripts/test-package.mjs @@ -56,6 +56,9 @@ try { sourceManifest.version, )});`, 'assert.match(await readFile(new URL("README_ZH.md", manifestUrl), "utf8"), /TypeScript Agent/);', + 'assert.match(await readFile(new URL("docs/dsh.md", manifestUrl), "utf8"), /Memory context injection/);', + 'assert.match(await readFile(new URL("docs/openclaw.md", manifestUrl), "utf8"), /OpenClaw/);', + 'assert.ok((await readFile(new URL("figures/dsh/reme-status-overview.png", manifestUrl))).length > 0);', ].join("\n"), ); await execFileAsync("node", [consumerEntry], { cwd: temporaryDirectory }); @@ -101,8 +104,10 @@ try { ); assert.match(clawHubReadme, /^# ReMe memory for OpenClaw/m); assert.doesNotMatch(clawHubReadme, /DeepSeek Harness/); + assert.match(clawHubReadme, /\[中文说明\]\(\.\/README_ZH\.md\)/); assert.match(clawHubReadmeZh, /^# OpenClaw 的 ReMe 长期记忆插件/m); assert.doesNotMatch(clawHubReadmeZh, /DeepSeek Harness/); + assert.match(clawHubReadmeZh, /\[English\]\(\.\/README\.md\)/); assert.equal( JSON.parse( await readFile( diff --git a/typescript/src/dsh/client/status-page.tsx b/typescript/src/dsh/client/status-page.tsx index 62958648..8aa70e92 100644 --- a/typescript/src/dsh/client/status-page.tsx +++ b/typescript/src/dsh/client/status-page.tsx @@ -121,6 +121,9 @@ export const statusEn = { documentContent: "Document content", selectFile: "Select a file to preview its contents.", fileLoadFailed: "Could not load this file.", + copyCode: "Copy", + copiedCode: "Copied", + footnotes: "Footnotes", journalDescription: "Daily notes captured from conversations and sources.", knowledgeDescription: "Consolidated knowledge organized for long-term recall.", @@ -229,6 +232,9 @@ export const statusZh: typeof statusEn = { documentContent: "文档内容", selectFile: "选择一个文件查看内容。", fileLoadFailed: "无法读取这个文件。", + copyCode: "复制", + copiedCode: "已复制", + footnotes: "脚注", journalDescription: "从对话和其他来源自动沉淀的每日记录。", knowledgeDescription: "经过整理、适合长期检索和持续积累的个人知识。", }; @@ -929,6 +935,13 @@ function MemoryFiles({ directory: string; t: StatusTranslator; }): JSX.Element { + const markdownLabels = useMemo( + () => ({ + code: { copyLabel: t("copyCode"), copiedLabel: t("copiedCode") }, + footnotes: t("footnotes"), + }), + [t], + ); const [files, setFiles] = useState([]); const [limited, setLimited] = useState(false); const [loading, setLoading] = useState(true); @@ -1084,7 +1097,7 @@ function MemoryFiles({

{t("documentContent")}

- +
diff --git a/typescript/src/dsh/config.ts b/typescript/src/dsh/config.ts index 76f55823..addd077a 100644 --- a/typescript/src/dsh/config.ts +++ b/typescript/src/dsh/config.ts @@ -1,11 +1,10 @@ import z from "@deepseek-ai/schemastery"; -import { settingsNamespace } from "@deepseek-ai/dsh-settings"; import { nextDailyRun, validTimezone } from "../core/scheduling.js"; import type { ReMeConfig, ReMeConfigInput, ReMeSettings } from "./types.js"; /** Durable DSH settings section owned by the ReMe integration. */ -export const REME_SETTINGS_NAMESPACE = settingsNamespace("reme-memory"); +export const REME_SETTINGS_NAMESPACE = "reme-memory"; export const Config = z.object({ endpoint: z.string().description("ReMe HTTP service URL"), diff --git a/typescript/src/dsh/index.ts b/typescript/src/dsh/index.ts index 6a08fb34..a7333ad0 100644 --- a/typescript/src/dsh/index.ts +++ b/typescript/src/dsh/index.ts @@ -1,6 +1,6 @@ import { createUserMessage } from "@deepseek-ai/dsh-llm"; import type { Context } from "@deepseek-ai/cordis"; -import { installSettingsSection } from "@deepseek-ai/dsh-settings"; +import type {} from "@deepseek-ai/dsh-settings"; import { ReMeClient } from "../core/client.js"; import { @@ -22,25 +22,26 @@ export const inject = ["agents", "sessions", "tools"]; export function apply(ctx: Context, input: ReMeConfigInput = {}): void { const base = resolveConfig(input); - let settingsSource: () => ReMeSettings = () => settingsFrom(base); + const defaultSettings = settingsFrom(base); + let settingsSource: () => ReMeSettings = () => defaultSettings; const current = () => mergeSettings(base, settingsSource()); const client = new ReMeClient(current); const runtime = new ReMeRuntime(client, current, ctx.logger); - installSettingsSection( - ctx, - REME_SETTINGS_NAMESPACE, - SettingsConfig, - settingsFrom(base), - { - setSource: (source) => { - settingsSource = source; + ctx.inject(["settings"], (settingsCtx) => { + settingsCtx.settings.installSection( + ctx, + REME_SETTINGS_NAMESPACE, + SettingsConfig, + defaultSettings, + { + setSource(source) { + settingsSource = source; + }, + onChange: () => runtime.reconfigure(), + validate: validateSettings, }, - onChange: () => { - runtime.reconfigure(); - }, - validate: validateSettings, - }, - ); + ); + }); ctx.provide("remeMemory", runtime); void ctx.plugin(ReMeStatusGateway); ctx.effect( diff --git a/typescript/tests/bundle.test.mjs b/typescript/tests/bundle.test.mjs index 0b9a9387..7f1216e3 100644 --- a/typescript/tests/bundle.test.mjs +++ b/typescript/tests/bundle.test.mjs @@ -32,15 +32,21 @@ test("declares DSH and OpenClaw entries in one installable package", async () => "@deepseek-ai/dsh-client-ui-primitives", ), ); + assert.ok( + manifest.dsh.client.inject.includes("@deepseek-ai/dsh-client-connection"), + ); + assert.ok( + !manifest.dsh.client.inject.includes("@deepseek-ai/dsh-client-runtime"), + ); assert.equal(manifest.dsh.bundle.patch, "./dsh/cordis.patch.yml"); assert.deepEqual(manifest.openclaw.extensions, ["./dist/openclaw/index.js"]); assert.equal( manifest.peerDependencies["@deepseek-ai/dsh-llm"], - "^0.1.0-rc.8", + "^0.1.2-rc.1", ); assert.equal( manifest.peerDependencies["@deepseek-ai/dsh-tools"], - "^0.1.0-rc.8", + "^0.1.2-rc.1", ); assert.match(patch, /remeMemory: true/); assert.match(patch, /@agentscope-ai\/reme\/dsh/); diff --git a/typescript/tests/dsh-index.test.mjs b/typescript/tests/dsh-index.test.mjs index 9e49f885..29eec1cd 100644 --- a/typescript/tests/dsh-index.test.mjs +++ b/typescript/tests/dsh-index.test.mjs @@ -137,23 +137,18 @@ test("registers a ReMe settings namespace and reads changed values for new sessi }, inject(names, callback) { if (!names.includes("settings")) return; - callback({ + const settingsCtx = { settings: { - register(ns, _schema, options) { - section = options.base; + installSection(owner, ns, _schema, base, hooks) { + assert.equal(owner, ctx); + section = base; assert.equal(String(ns), "reme-memory"); - return { - get: () => section, - watch(listener) { - notify = listener; - }, - }; + hooks.setSource(() => section); + notify = hooks.onChange; }, }, - effect(execute) { - return execute(); - }, - }); + }; + callback(settingsCtx); }, }; apply(ctx, {