From c889ac86fb752e22041c62c0ac0754b1eb1c3a07 Mon Sep 17 00:00:00 2001 From: PsiACE Date: Tue, 1 Sep 2026 10:11:27 +0800 Subject: [PATCH 1/8] feat(web): simplify product language --- docs/en/index.md | 44 +++--- docs/zh/index.md | 48 +++---- src/powercontext/server/static/dashboard.js | 126 +++++++++--------- .../server/static/handoff-report.js | 8 +- src/powercontext/server/static/review.js | 8 +- src/powercontext/server/static/skills.js | 8 +- .../components/activity_heatmap.html | 14 +- .../server/templates/components/footer.html | 2 +- .../server/templates/components/header.html | 4 +- .../templates/components/recall_trend.html | 6 +- .../server/templates/pages/dashboard.html | 32 ++--- tests/test_dashboard.py | 2 +- tests/test_dashboard_locale.py | 32 ++++- 13 files changed, 182 insertions(+), 152 deletions(-) diff --git a/docs/en/index.md b/docs/en/index.md index 2bebebbfc..539258602 100644 --- a/docs/en/index.md +++ b/docs/en/index.md @@ -1,50 +1,50 @@ --- template: home.html title: PowerContext -description: Add Memory to your own AI over HTTP, or choose a supported agent for cross-session recovery and Handoff. +description: Continue work in a new session without restating decisions, constraints, and progress. Use a supported Agent or connect your own AI over HTTP. hide: - navigation - toc - footer home: hero: - label: Open source · Project scoped · Local by default + label: Open source. Data stays local by default. title: - Start a new session. - - Keep moving. - lead: PowerContext keeps decisions, constraints, next steps, and work boundaries outside the chat. Existing AI applications can call HTTP directly; Codex, Claude Code, DSH, OpenCode, and other agents can connect to the same Server. - note: You control the model, identity, and write authorization; PowerContext provides cited Memory, request-time context, and history-preserving revisions. + - Pick up where you left off. + lead: Save confirmed decisions, constraints, and progress in PowerContext. Supported Agents and AI applications connected over HTTP can use them in later sessions. + note: You choose the model and control identity and write access. PowerContext keeps Memory with its sources and version history. actions: - - label: Choose your agent + - label: Start with an Agent href: en/docs/tutorials/agent-quickstart/ kind: primary - - label: Add the API to your AI + - label: Connect your AI over HTTP href: en/docs/tutorials/api-quickstart/ kind: secondary continuity: - label: One project, multiple sessions - title: One agent stops. Work continues. - lead: Different agents can implement, review, and validate compatibility. Handoff transfers an inspected boundary; a human decides whether to continue. + label: Continue across sessions + title: You do not have to repeat the background. + lead: Save information once when it needs to last. Later sessions can find it, check where it came from, and see how it changed. steps: - - title: Agent A implements - description: Record decisions, constraints, and next steps, then assemble the objective, changes, checks, and omissions as a Handoff. - - title: Agent B checks independently - description: Receive the exact Revision in another host and verify its evidence and risks against the current repository. - - title: A human decides - description: Confirm scope, capability, and authorization, then continue, request clarification, or decline. Receipt is not completion. + - title: Save + description: Record the decisions, constraints, and next steps that should outlast the current chat. + - title: Continue + description: Open the same work in another Agent or application without pasting the earlier conversation. + - title: Check + description: Review the saved objective, progress, evidence, and omissions before continuing. ownership: label: Memory and Handoff title: - - Keep what lasts. - - Hand off the work. - lead: Memory keeps decisions, constraints, conventions, and next steps in a searchable history. Revise or retire an entry without losing the record. - handoff: A Handoff captures the current objective, verified progress, blockers, and next action. Commit it when the work becomes a project milestone. + - Remember what will matter later. + - Hand off what is in progress. + lead: Memory keeps information that stands on its own and will matter later. You can revise or retire an entry while preserving its history. + handoff: A Handoff saves the current objective and progress. It also records blockers and the next action so another person, Agent, or later session can continue. Proven approaches can become Experience. Recurring work can become Skills, which are reviewed before publication to an Agent. result: "LOCOMO: 90.78% correct · 1.38 s p95 search latency" command: powercontext server run primary_action: - label: Open the Agent quickstart + label: Read the Agent quickstart href: en/docs/tutorials/agent-quickstart/ secondary_action: - label: Open the API lifecycle tutorial + label: Connect your AI over HTTP href: en/docs/tutorials/api-quickstart/ --- diff --git a/docs/zh/index.md b/docs/zh/index.md index f5d2c47b7..dcc4a7d33 100644 --- a/docs/zh/index.md +++ b/docs/zh/index.md @@ -1,50 +1,50 @@ --- template: home.html title: PowerContext -description: 通过 HTTP 为自己的 AI 接入 Memory,或选择受支持的 Agent 跑通跨会话恢复与 Handoff。 +description: 换个会话继续工作,不必重新交代决定、约束和进展。可以使用受支持的 Agent,也可以通过 HTTP 接入自己的 AI。 hide: - navigation - toc - footer home: hero: - label: 开源 · 项目级 · 默认本地 + label: 开源,数据默认保存在本地 title: - - 换一个会话, - - 项目继续向前。 - lead: PowerContext 把决定、约束、下一步和任务边界保存在对话之外。现有 AI 应用可以直接调用 HTTP API;Codex、Claude Code、DSH、OpenCode 等 Agent 也可以连接同一个 Server。 - note: 你控制模型、身份和写入授权;PowerContext 提供带 citation 的 Memory、请求时上下文和保留历史的修订。 + - 换个会话, + - 接着做。 + lead: 把已确认的决定、约束和进展存进 PowerContext。受支持的 Agent 和通过 HTTP 接入的 AI 应用可以在后续会话中继续使用。 + note: 模型、身份和写入权限由你控制。PowerContext 保存带来源和版本历史的记忆。 actions: - - label: 选择你的 Agent + - label: 从 Agent 开始 href: zh/docs/tutorials/agent-quickstart/ kind: primary - - label: 为自己的 AI 接入 API + - label: 通过 HTTP 接入 AI href: zh/docs/tutorials/api-quickstart/ kind: secondary continuity: - label: 同一项目,多个会话 - title: 一个 Agent 停下,工作仍能继续。 - lead: 实现、独立检查和兼容性验证可以由不同 Agent 完成;Handoff 传递经过检查的边界,人决定是否继续。 + label: 跨会话继续 + title: 背景不必再讲一遍。 + lead: 需要长期保留的信息,只需记下一次。后续会话可以找回它,核对来源,也可以查看变更记录。 steps: - - title: Agent A 实现 - description: 记录项目决定、约束和下一步,并把目标、改动、检查与遗漏整理为 Handoff。 - - title: Agent B 独立核对 - description: 在另一个 Host 中按 exact Revision 接收,再用当前仓库重新验证证据和风险。 - - title: 人决定 - description: 人确认范围、能力和授权,决定继续、澄清或拒绝;接收不等于任务已经完成。 + - title: 记下 + description: 保存应该在当前对话结束后继续使用的决定、约束和下一步。 + - title: 继续 + description: 换到另一个 Agent 或应用继续工作,不必粘贴之前的聊天记录。 + - title: 核对 + description: 继续之前,查看已保存的目标、进展、依据和遗漏。 ownership: - label: Memory 与 Handoff + label: 记忆与交接 title: - - 留下长期信息, - - 交接当前工作。 - lead: Memory 保存决定、约束、约定和下一步,并保留可检索的历史。修订或停用条目,不会丢失记录。 - handoff: Handoff 记录当前目标、已验证进展、阻塞项和下一步行动。工作形成项目里程碑后再提交。 + - 记住以后还要用的, + - 交接手头正在做的。 + lead: 记忆保存以后仍会用到、单独拿出来也能理解的信息。更新或停用其中一条,不会丢失历史版本。 + handoff: 交接保存当前目标和进度,也说明哪里卡住、下一步做什么。换人、换 Agent 或稍后再做时,可以从这里继续。已经验证的做法可以整理成经验,需要反复执行的工作可以整理成技能。技能经过审核后再发布给 Agent。 result: "LOCOMO:答对率 90.78% · 搜索 p95 延迟 1.38 秒" command: powercontext server run primary_action: - label: 打开 Agent 分步入门 + label: 阅读 Agent 快速入门 href: zh/docs/tutorials/agent-quickstart/ secondary_action: - label: 打开 HTTP API 生命周期教程 + label: 通过 HTTP 接入 AI href: zh/docs/tutorials/api-quickstart/ --- diff --git a/src/powercontext/server/static/dashboard.js b/src/powercontext/server/static/dashboard.js index b4e9f34e9..49a4b3434 100644 --- a/src/powercontext/server/static/dashboard.js +++ b/src/powercontext/server/static/dashboard.js @@ -26,12 +26,12 @@ import {createPageUi, createRequestGate} from "./page-ui.js?v=locale-complete"; const translations = { en: { - pageTitle: "PowerContext Dashboard", - dashboardTitle: "Dashboard", + pageTitle: "PowerContext Overview", + dashboardTitle: "Overview", skillsTitle: "Skills", reviewTitle: "Review", handoffReportTitle: "Handoff Report", - brandHomeLabel: "PowerContext Dashboard", + brandHomeLabel: "PowerContext Overview", primaryNavigation: "Primary navigation", maintainedBy: "Maintained by OceanBase.", signOut: "Sign out", @@ -39,31 +39,31 @@ const translations = { authIntro: "Enter the bearer token configured for this PowerContext Server. The token stays in this browser tab.", tokenLabel: "Server token", continue: "Continue", - selectScope: "Scope", + selectScope: "View", period30: "Last 30 days", - estimatedReduction: "Estimated token reduction", - sources: "Sources", - memoryEntries: "Memory entries", - artifacts: "Artifacts", - pendingReview: "Pending review", - artifactFamilies: "Artifact families", - artifactSubtitle: "Current Artifacts and pending Candidates", - family: "Family", - currentArtifacts: "Current Artifacts", - pendingCandidates: "Pending Candidates", + estimatedReduction: "Estimated change in context length", + sources: "Recorded materials", + memoryEntries: "Memory", + artifacts: "Saved content", + pendingReview: "Awaiting review", + artifactFamilies: "Saved content", + artifactSubtitle: "What is available now and what still needs review", + family: "Type", + currentArtifacts: "Available", + pendingCandidates: "Awaiting review", experience: "Experience", handoff: "Handoff", memory: "Memory", skill: "Skill", - dailyActivity: "Daily recall", - noRecall: "No hit", - hitNoReduction: "Hit · ≤0", - reductionLow: "1–255", - reductionMedium: "256–1,023", - reductionHigh: "1,024+", - recallTrend: "Recall savings trend", - trendSubtitle: "Estimated token reduction over the last 30 days", - estimatedReductionSeries: "Estimated reduction", + dailyActivity: "Daily context use", + noRecall: "No context", + hitNoReduction: "Context · no reduction", + reductionLow: "1-255 fewer", + reductionMedium: "256-1,023 fewer", + reductionHigh: "1,024+ fewer", + recallTrend: "Context length comparison", + trendSubtitle: "Positive values mean fewer tokens; negative values mean more.", + estimatedReductionSeries: "Estimated fewer tokens", dark: "Dark", light: "Light", switchDark: "Switch to dark mode", @@ -73,26 +73,26 @@ const translations = { languageChinese: "中文", languageEnglish: "EN", updated: "Updated {value}", - recallHits: "{hits} recall hits from {preparations} preparations", - activitySummary: "{hits} recall hits · estimated token reduction {savings} in the last 30 days", - activityAria: "30 days of scoped recall hits and estimated token reduction", - activityHit: "{date}: {hits} recall hits · estimated token reduction {savings}", - trendDescription: "{hits} recall hits. Estimated token reduction {savings}.", + recallHits: "{hits} of {preparations} preparations returned context. Positive values mean fewer tokens.", + activitySummary: "Context returned {hits} times in the last 30 days. Estimated difference: {savings} tokens. Positive means fewer.", + activityAria: "30 days of returned context and estimated change in length", + activityHit: "{date}: context returned {hits} times · estimated difference {savings} tokens", + trendDescription: "Context returned {hits} times. Estimated difference: {savings} tokens. Positive values mean fewer tokens.", authRejected: "The Server rejected this token.", - requestFailed: "The Dashboard request failed with HTTP {status}.", + requestFailed: "The Overview request failed with HTTP {status}.", serverUnavailable: "The Server is unavailable.", retry: "Retry", - noScopes: "No Dashboard scopes are configured.", - scopeUnavailable: "The selected scope is not available.", - scopeOverview: "Scope overview" + noScopes: "There is no work to show here.", + scopeUnavailable: "The selected work is not available.", + scopeOverview: "Overview for the selected work" }, zh: { - pageTitle: "PowerContext 仪表盘", - dashboardTitle: "仪表盘", + pageTitle: "PowerContext 概览", + dashboardTitle: "概览", skillsTitle: "技能", reviewTitle: "审核", handoffReportTitle: "交接报告", - brandHomeLabel: "PowerContext 仪表盘", + brandHomeLabel: "PowerContext 概览", primaryNavigation: "主导航", maintainedBy: "由 OceanBase 维护。", signOut: "退出", @@ -100,31 +100,31 @@ const translations = { authIntro: "请输入 PowerContext 服务器配置的访问令牌。令牌仅保留在当前浏览器标签页。", tokenLabel: "服务器访问令牌", continue: "继续", - selectScope: "作用域", + selectScope: "查看", period30: "过去 30 天", - estimatedReduction: "预估令牌减少量", - sources: "数据源", - memoryEntries: "记忆条目", - artifacts: "制品", + estimatedReduction: "预估上下文长度变化", + sources: "已记录材料", + memoryEntries: "记忆", + artifacts: "已保存内容", pendingReview: "待审核", - artifactFamilies: "制品类型", - artifactSubtitle: "当前制品与待审核候选", + artifactFamilies: "已保存内容", + artifactSubtitle: "查看当前可用内容和待审核内容", family: "类型", - currentArtifacts: "当前制品", - pendingCandidates: "待审核候选", + currentArtifacts: "当前可用", + pendingCandidates: "待审核", experience: "经验", handoff: "交接", memory: "记忆", skill: "技能", - dailyActivity: "每日召回", - noRecall: "无命中", - hitNoReduction: "命中 · ≤0", - reductionLow: "1–255", - reductionMedium: "256–1,023", - reductionHigh: "1,024+", - recallTrend: "召回节约趋势", - trendSubtitle: "过去 30 天的预估令牌减少量", - estimatedReductionSeries: "预估减少量", + dailyActivity: "每日上下文使用", + noRecall: "未返回上下文", + hitNoReduction: "已返回 · 未减少", + reductionLow: "少 1-255 Token", + reductionMedium: "少 256-1,023 Token", + reductionHigh: "少 1,024+ Token", + recallTrend: "上下文长度对比", + trendSubtitle: "正数表示少带入 Token,负数表示多带入。", + estimatedReductionSeries: "预计少带入的 Token", dark: "深色", light: "浅色", switchDark: "切换至深色模式", @@ -134,18 +134,18 @@ const translations = { languageChinese: "中文", languageEnglish: "EN", updated: "更新于 {value}", - recallHits: "{preparations} 次准备中命中 {hits} 次召回", - activitySummary: "过去 30 天命中 {hits} 次召回 · 预估令牌减少量 {savings}", - activityAria: "当前作用域过去 30 天的召回命中和预估令牌减少量", - activityHit: "{date}:命中 {hits} 次召回 · 预估令牌减少量 {savings}", - trendDescription: "召回命中 {hits} 次,预估令牌减少量 {savings}。", + recallHits: "{preparations} 次上下文准备中有 {hits} 次返回内容。正数表示少带入 Token。", + activitySummary: "过去 30 天有 {hits} 次返回内容。预估差值为 {savings} Token,正数表示少带入。", + activityAria: "过去 30 天返回上下文的次数和预估长度变化", + activityHit: "{date}:返回内容 {hits} 次 · 预估差值 {savings} Token", + trendDescription: "返回内容 {hits} 次。预估差值为 {savings} Token,正数表示少带入。", authRejected: "服务器拒绝了该访问令牌。", - requestFailed: "仪表盘请求失败(HTTP {status})。", - serverUnavailable: "服务器无法访问。", + requestFailed: "概览请求失败(HTTP {status})。", + serverUnavailable: "无法连接服务器。", retry: "重试", - noScopes: "未配置仪表盘作用域。", - scopeUnavailable: "选中的作用域不可用。", - scopeOverview: "作用域概览" + noScopes: "这里还没有可查看的工作。", + scopeUnavailable: "无法查看这项工作。", + scopeOverview: "所选工作的概览" } }; const authShell = document.getElementById("auth-shell"); diff --git a/src/powercontext/server/static/handoff-report.js b/src/powercontext/server/static/handoff-report.js index 8d0cac06b..58d7380ea 100644 --- a/src/powercontext/server/static/handoff-report.js +++ b/src/powercontext/server/static/handoff-report.js @@ -35,11 +35,11 @@ const authenticationRequired = document.documentElement.dataset.serverAuthRequir const translations = { en: { pageTitle: "PowerContext Handoff Report", - dashboardTitle: "Dashboard", + dashboardTitle: "Overview", skillsTitle: "Skills", reviewTitle: "Review", handoffReportTitle: "Handoff Report", - brandHomeLabel: "PowerContext Dashboard", + brandHomeLabel: "PowerContext Overview", primaryNavigation: "Primary navigation", handoffSummary: "Handoff summary", maintainedBy: "Maintained by OceanBase.", @@ -237,11 +237,11 @@ const translations = { }, zh: { pageTitle: "PowerContext 项目交接报告", - dashboardTitle: "仪表盘", + dashboardTitle: "概览", skillsTitle: "技能", reviewTitle: "审核", handoffReportTitle: "交接报告", - brandHomeLabel: "PowerContext 仪表盘", + brandHomeLabel: "PowerContext 概览", primaryNavigation: "主导航", handoffSummary: "交接摘要", maintainedBy: "由 OceanBase 维护。", diff --git a/src/powercontext/server/static/review.js b/src/powercontext/server/static/review.js index ee7a4e665..78614b487 100644 --- a/src/powercontext/server/static/review.js +++ b/src/powercontext/server/static/review.js @@ -27,11 +27,11 @@ import {createPageUi, createRequestGate} from "./page-ui.js?v=locale-complete"; const translations = { en: { pageTitle: "PowerContext Review", - dashboardTitle: "Dashboard", + dashboardTitle: "Overview", skillsTitle: "Skills", reviewTitle: "Review", handoffReportTitle: "Handoff Report", - brandHomeLabel: "PowerContext Dashboard", + brandHomeLabel: "PowerContext Overview", primaryNavigation: "Primary navigation", maintainedBy: "Maintained by OceanBase.", signOut: "Sign out", @@ -179,11 +179,11 @@ const translations = { }, zh: { pageTitle: "PowerContext 审核", - dashboardTitle: "仪表盘", + dashboardTitle: "概览", skillsTitle: "技能", reviewTitle: "审核", handoffReportTitle: "交接报告", - brandHomeLabel: "PowerContext 仪表盘", + brandHomeLabel: "PowerContext 概览", primaryNavigation: "主导航", maintainedBy: "由 OceanBase 维护。", signOut: "退出", diff --git a/src/powercontext/server/static/skills.js b/src/powercontext/server/static/skills.js index 9d5468f48..946a5478e 100644 --- a/src/powercontext/server/static/skills.js +++ b/src/powercontext/server/static/skills.js @@ -27,11 +27,11 @@ import {createPageUi, createRequestGate} from "./page-ui.js?v=locale-complete"; const translations = { en: { pageTitle: "PowerContext Skills Library", - dashboardTitle: "Dashboard", + dashboardTitle: "Overview", skillsTitle: "Skills", reviewTitle: "Review", handoffReportTitle: "Handoff Report", - brandHomeLabel: "PowerContext Dashboard", + brandHomeLabel: "PowerContext Overview", primaryNavigation: "Primary navigation", maintainedBy: "Maintained by OceanBase.", signOut: "Sign out", @@ -145,11 +145,11 @@ const translations = { }, zh: { pageTitle: "PowerContext 技能库", - dashboardTitle: "仪表盘", + dashboardTitle: "概览", skillsTitle: "技能", reviewTitle: "审核", handoffReportTitle: "交接报告", - brandHomeLabel: "PowerContext 仪表盘", + brandHomeLabel: "PowerContext 概览", primaryNavigation: "主导航", maintainedBy: "由 OceanBase 维护。", signOut: "退出", diff --git a/src/powercontext/server/templates/components/activity_heatmap.html b/src/powercontext/server/templates/components/activity_heatmap.html index 8e11f726b..2c36712e8 100644 --- a/src/powercontext/server/templates/components/activity_heatmap.html +++ b/src/powercontext/server/templates/components/activity_heatmap.html @@ -17,19 +17,19 @@
-

Daily recall

+

Daily context use

- +
diff --git a/src/powercontext/server/templates/components/footer.html b/src/powercontext/server/templates/components/footer.html index e13af2ce1..b21c2f602 100644 --- a/src/powercontext/server/templates/components/footer.html +++ b/src/powercontext/server/templates/components/footer.html @@ -19,7 +19,7 @@