Skip to content

PowerContext v0.2.0

Latest

Choose a tag to compare

@Teingi Teingi released this 07 Sep 03:59
· 63 commits to master since this release
685b31d

PowerContext v0.2.0

中文

PowerContext v0.2.0 让跨会话、跨 Agent 的上下文有了更完整的组织、访问控制和分发能力。你可以把工作组织到由 Server 管理的 Scope 中,授权接手者访问指定 Handoff,将审核过的 Skill 连同脚本和资源文件发布到本机或远程工作环境,并通过原生后台服务持续运行个人 Server。

主要变化

按工作范围组织上下文

  • 新增 Scope 创建、更新、默认 Scope 和持久绑定接口。Agent 集成通过 Server 解析工作范围,在后续会话中复用同一个 Scope。
  • 支持 Scope 父子关系和显式上下文引用。父子关系用于组织工作;需要共享的上下文通过引用明确指定。
  • Dashboard 和 Handoff Report 支持单个 Scope、Scope 子树和全部 Scope 视图。Server 启动时创建默认 Scope,网页可发现和选择已创建的 Scope。
  • 支持将可发布 Artifact 的指定 Revision 复制到另一个 Scope,并保留来源信息。

控制上下文的访问权限

  • HTTP、MCP 和 Dashboard 数据接口统一执行访问控制,可按 Server、Scope、Artifact 授权,并进一步限定到单个 Memory Entry。
  • 可将指定 Handoff 授予接手者,支持读取、继续工作和确认接收;授权范围涵盖该 Handoff 的历史及后续 Revision。
  • 支持角色查询、权限检查、Binding 创建、替换与撤销,以及审计记录。内置授权实现之外,提供 Casbin 和 AuthZEN 适配器。
  • 本地默认关闭访问控制。多用户部署需要为每位调用者建立独立身份;内置静态 Token 仍代表单个管理员,不能区分不同用户。

管理和分发完整的 Skill 包

  • 标准 Skill 包支持 SKILL.md、脚本和资源文件,保留文件内容及可执行权限,并通过审核生成不可变 Revision。
  • Skills Library 支持包内容检查、导入、派生、下载、使用记录,以及 active、deprecated、retired 生命周期管理。
  • 可将审核后的指定 Revision 发布到本机 Codex 或 Claude Code 目标,也可通过注册的远程 Receiver 拉取并回报安装状态。
  • 发布和撤回会检查本地内容变化,保护用户修改过的文件。审核、下载和安装 Skill 不会执行其中的脚本。

让个人 Server 在后台持续运行

  • 新增 powercontext service installstatusuninstall,支持 macOS LaunchAgent、Linux systemd --user 和 Windows 当前用户计划任务。
  • 服务可在终端关闭后继续运行,并使用明确指定的环境文件。状态命令提供注册状态、服务健康信息和日志位置。
  • Windows 支持显式选择是否在登录时启动;交互安装时默认不启用登录自启动。

扩展应用接入与推理配置

  • 新增按 Scope 划分的 Source 和 Artifact REST 接口:创建、读取 Source,以及创建、列举、读取和替换 Artifact,支持读取指定历史 Revision。
  • 新增 Source Definition、Connector 和投影契约,并提供独立的 OpenDAL 文本文件采集验证集成。该集成提交不可变快照,尚不提供完整的逻辑 Source 多次观测与删除同步。
  • 生成、Embedding 和重排可分别配置端点、凭据和模型参数,便于连接不同推理服务。生成参数支持传递提供方的扩展设置。
  • 新增可复用的 Agent Plugin 和集成能力清单,改善 Host 内诊断,以及 Codex 中显式记忆请求的路由。

改善可观测性和文档

  • 新增进程运行指标,帮助观察 Server 的资源使用和运行状态。
  • /docs 提供 Scalar 交互式 HTTP API 参考。
  • 中英文网站采用新的文档结构,补充 Agent、HTTP API 生命周期教程和 Benchmark 结果页面。

修复

  • 修复 Memory 提交后旧 sqlite-vec 行未清理、导致向量数据持续累积的问题。
  • 修复 Windows 上二进制游标密钥的持久化问题。
  • 修复环境文件解析、客户端 Server URL 诊断,以及无推理模型的最小 Server 配置验证。
  • 改善 DSH 在工具和命令入口处理 Scope 解析失败的行为。
  • OceanBase 启动检查会明确拒绝使用旧式大小写不敏感排序规则的身份列,避免不同资源身份被当作同一个值。

安装与升级

需要 Python 3.11 或更新版本。已有部署请先阅读下方兼容性说明,再安装或升级:

uv tool install --force "powercontext[cli,server]==0.2.0"

在单独的终端中运行 Server:

powercontext server run

在另一个终端中配置同版本的 Agent 集成并检查连接,以 Codex 为例:

powercontext setup codex --source oceanbase/powercontext --ref powercontext-v0.2.0
powercontext doctor
powercontext ready

如需后台运行,请先停止前台 Server,再执行:

powercontext service install
powercontext service status

如果已有服务使用环境文件,升级后重新执行 powercontext service install --env-file /path/to/powercontext.env,沿用原有配置。

兼容性与升级注意事项

  • Scope 接入方式有变化。 数据操作要求 scope_id 已在 Server 注册。旧客户端自行拼接的项目或会话标识不能直接替代 Scope ID;未注册的值返回 scope_not_found。请使用默认 Scope、创建 Scope 或解析持久绑定,并同步升级 Server、客户端和 Agent 集成。
  • 旧数据需要单独评估迁移。 旧版本仅作为 Runtime 分区使用的 Scope 不会自动注册到新的 Scope 目录。新建 Scope 也不会自动接管旧分区的数据。保留旧数据库备份,在切换前确认所需数据的导出、迁移和读取结果。
  • OceanBase 排序规则检查更严格。 身份列需要 utf8mb4_bin;使用旧排序规则的已有表会阻止 Server 启动。请按故障排查指南迁移并验证数据。
  • 访问控制使用 POWERCONTEXT_SERVER_ACCESS_MODE 默认值为 disabled;远程或多用户部署应使用 enforced 并配置身份认证。已有 AUTH_ENABLED=true 配合 AUTH_TOKEN 的配置会映射到 enforced 模式。AuthZEN 适配器仅提供权限决策,不提供 Binding 管理或授权资源列举。
  • 重新检查服务配置。 升级包或修改环境文件后,需重新执行 service install。个人服务不复制当前终端中的环境变量;需要持久生效的设置应放入显式指定的环境文件。
  • 按能力选择依赖。 默认 SQLite 和显式 Memory 操作仍不需要推理服务;自动提取、生成和向量检索需要相应模型配置。嵌入式 seekDB 仍限于有兼容安装包的 Linux/macOS 环境。

完整变更 · 中文文档

English

PowerContext v0.2.0 adds a fuller way to organize, authorize, and distribute context across sessions and Agents. You can organize work in Server-owned Scopes, grant a receiver access to a specific Handoff, publish reviewed Skills together with their scripts and resources to local or remote workspaces, and keep a personal Server running as a native background service.

Highlights

Organize context around the work

  • New APIs create and update Scopes, select a default Scope, and maintain durable bindings. Agent integrations resolve work boundaries through the Server and reuse the same Scope across sessions.
  • Scope parent relationships organize work, while explicit context references identify the context to share.
  • The Dashboard and Handoff Reports support exact-Scope, subtree, and all-Scope views. Server startup creates a default Scope, and the web UI discovers created Scopes for selection.
  • Publish an exact Revision of a supported Artifact into another Scope while preserving its provenance.

Control access to context

  • HTTP, MCP, and Dashboard data endpoints share one access-control boundary. Grants can target a Server, Scope, or Artifact, with finer selection of an individual Memory Entry.
  • Grant a specific Handoff to a receiver for reading, continuing work, and acknowledging receipt, covering its historical and future Revisions.
  • Query roles, check permissions, create, replace, and revoke Bindings, and inspect audit records. Casbin and AuthZEN adapters are included alongside the built-in authorization implementation.
  • Access control is disabled for the default local installation. Multi-user deployments must establish a separate identity for each caller; the built-in static token still represents one administrator and cannot distinguish users.

Manage and distribute complete Skill packages

  • Standard Skill packages include SKILL.md, scripts, and resources, preserving file contents and executable permissions. Review produces immutable Revisions.
  • The Skills Library supports package inspection, import, forking, download, usage records, and active, deprecated, and retired lifecycle states.
  • Publish a reviewed Revision to a local Codex or Claude Code target, or let an enrolled remote Receiver pull it and report installation status.
  • Publication and removal check for local changes to protect user-modified files. Reviewing, downloading, or installing a Skill does not execute its scripts.

Keep a personal Server running in the background

  • New powercontext service install, status, and uninstall commands support macOS LaunchAgents, Linux systemd --user, and Windows current-user scheduled tasks.
  • The service survives terminal closure and can use an explicitly selected environment file. Status output includes registration, service health, and log locations.
  • Windows installation lets you choose whether to start at login; interactive installation leaves login auto-start disabled by default.

Extend application integration and inference configuration

  • New scoped REST endpoints create and read Sources, and create, list, read, and replace Artifacts, including exact historical Revision reads.
  • Source Definition, Connector, and projection contracts now include an independently deployed OpenDAL text-file evaluation integration. It submits immutable snapshots; a complete logical Source model with repeated observations and deletion synchronization is not yet provided by this integration.
  • Configure separate endpoints, credentials, and model settings for generation, embeddings, and reranking. Generation settings can pass provider-specific extensions.
  • A reusable Agent Plugin and an integration capability manifest accompany clearer host-visible diagnostics and improved routing of explicit Memory requests in Codex.

Improve observability and documentation

  • New process runtime metrics expose Server resource usage and operating state.
  • /docs provides an interactive Scalar HTTP API reference.
  • The redesigned bilingual documentation site adds Agent and HTTP API lifecycle tutorials and benchmark result pages.

Fixes

  • Clean up obsolete sqlite-vec rows on Memory commits to prevent accumulating vector data.
  • Preserve binary cursor-signing keys correctly on Windows.
  • Fix environment-file parsing, client Server URL diagnostics, and validation of minimal Server configurations without inference models.
  • Handle Scope resolution failures more consistently at DSH tool and command entry points.
  • Reject legacy case-insensitive collations on OceanBase identity columns at startup, preventing distinct resource identities from comparing as the same value.

Install or upgrade

Python 3.11 or newer is required. For an existing deployment, read the compatibility notes below before upgrading:

uv tool install --force "powercontext[cli,server]==0.2.0"

Run the Server in its own terminal:

powercontext server run

In another terminal, install the matching Agent integration and check connectivity. For Codex:

powercontext setup codex --source oceanbase/powercontext --ref powercontext-v0.2.0
powercontext doctor
powercontext ready

For background operation, stop the foreground Server first, then run:

powercontext service install
powercontext service status

If an existing service uses an environment file, rerun powercontext service install --env-file /path/to/powercontext.env after upgrading to retain that configuration.

Compatibility and upgrade notes

  • Scope integration has changed. Data operations require a scope_id registered with the Server. Project or session identifiers constructed by older clients cannot substitute for Scope IDs; unregistered values return scope_not_found. Use the default Scope, create a Scope, or resolve a durable binding, and upgrade the Server, clients, and Agent integrations together.
  • Existing data needs a migration assessment. Scopes previously used only as Runtime partitions are not automatically registered in the new Scope catalog. Creating a new Scope does not adopt data from an old partition. Retain a backup of the old database and verify the required data export, migration, and reads before switching.
  • OceanBase collation checks are stricter. Identity columns require utf8mb4_bin; existing tables using legacy collations prevent Server startup. Follow the troubleshooting guide to migrate and verify the data.
  • Access control uses POWERCONTEXT_SERVER_ACCESS_MODE. It defaults to disabled; remote or multi-user deployments should use enforced with authentication. Existing AUTH_ENABLED=true plus AUTH_TOKEN configuration maps to enforced mode. The AuthZEN adapter provides authorization decisions only, without Binding management or authorized resource listing.
  • Refresh service configuration. Rerun service install after upgrading the package or changing the environment file. The personal service does not copy the current shell environment; put persistent settings in an explicitly selected environment file.
  • Choose dependencies by capability. Default SQLite storage and explicit Memory operations still work without inference services. Automatic extraction, generation, and vector search require their respective model configuration. Embedded seekDB remains limited to Linux/macOS environments with compatible wheels.

What's Changed

  • Feat/reusable agent plugin by @curryxjh in #1342
  • feat(inference): support extra generation model settings by @Teingi in #1394
  • docs(rfc): define scope organization and agent integration by @PsiACE in #1345
  • feat: publish Scalar HTTP API reference by @PsiACE in #1373
  • feat(metrics): expose process runtime metrics by @PsiACE in #1403
  • feat(site): add benchmark results page by @Teingi in #1409
  • docs: add Agent and HTTP API lifecycle tutorials by @Teingi in #1411
  • feat(site): add benchmark leaderboards by @Teingi in #1413
  • feat: add host-visible integration diagnostics by @Alanxtl in #1360
  • doc: add contract doc for rfc 1299 by @Alanxtl in #1361
  • feat(web): simplify product language by @PsiACE in #1414
  • chore: update icon of readme by @Alanxtl in #1431
  • docs(rfc): propose topic memory artifacts by @frf12 in #1417
  • fix(oceanbase): reject legacy schema collations by @Vanillaxi in #1389
  • feat(inference): support workload-specific model endpoints by @PsiACE in #1380
  • fix: doctor POWERCONTEXT_CLIENT_SERVER_URL invalid by @thunguo in #1434
  • feat(e2e): support forbidden recall context by @russell001209-ai in #1432
  • docs: finalize documentation classification and reference guides by @chenncy in #1415
  • feat(integrations): add capability manifest contract by @AsperforMias in #1416
  • feat: add personal Server service lifecycle by @Pika-Yalei in #1418
  • docs: simplify README around handoff and context by @PsiACE in #1439
  • feat(sources): add Source Definition and Connector contracts by @PsiACE in #1400
  • docs(rfc): define access control by @Teingi in #1396
  • fix(codex): route explicit memory requests by @beatenevo in #1436
  • feat(skill): add standard package lifecycle and remote distribution by @Teingi in #1351
  • feat: add windows launch service by @Alanxtl in #1441
  • feat: implement scope organization runtime for RFC #1345 by @PsiACE in #1401
  • fix: update validation to accept minimal server environment without inference models by @jiannnnyyyyy in #1445
  • docs: separate released and unreleased install paths by @Teingi in #1448
  • fix: env file parser by @thunguo in #1444
  • feat(website): establish new site style and structure by @PsiACE in #1456
  • feat(api): implement source and artifact base REST APIs by @Zxf-xufeng in #1438
  • docs(rfc): define source and artifact REST APIs by @Zxf-xufeng in #1437
  • fix(persistence): stop leaking sqlite-vec rows on Memory commits by @AbyssWhalen in #1470
  • build(deps-dev): bump postcss from 8.5.6 to 8.5.23 in /website by @dependabot[bot] in #1462
  • feat(server): add access control by @Teingi in #1398
  • fix(server): preserve binary cursor keys on Windows by @knqiufan in #1464
  • fix(dsh): handle Scope failures at tool and command boundaries by @knqiufan in #1452
  • feat: add default scope for powercontext web by @jiannnnyyyyy in #1453
  • chore(release): prepare v0.2.0 by @Teingi in #1481

New Contributors

Full Changelog: powercontext-v0.1.0...powercontext-v0.2.0