Skip to content

feat(fs): 新增 attrs 元信息接口#2906

Merged
qin-ctx merged 2 commits into
mainfrom
feat/fs-attrs
Jul 1, 2026
Merged

feat(fs): 新增 attrs 元信息接口#2906
qin-ctx merged 2 commits into
mainfrom
feat/fs-attrs

Conversation

@qin-ctx

@qin-ctx qin-ctx commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Description

新增 GET /api/v1/fs/attrs,用于读取文件或目录的逻辑扩展属性。当前返回:

  • attrs.tags:显式检索标签,对外统一命名为 tags
  • attrs.memory:memory 文件里的 MEMORY_FIELDS 元信息,并去掉正文 content

同时补齐 Python SDK、Go SDK、Rust CLI 和中英文文档。

Related Issue

N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Test update

Changes Made

  • 新增 /api/v1/fs/attrs,返回 uricontext_typeattrs,其中 attrs.tags 来自向量记录里的 search_tagsattrs.memory 来自 memory 文件的 MEMORY_FIELDS
  • 新增 CLI:openviking attrs get <uri> [key]openviking attrs set-tags ...;旧的顶层 openviking set-tags 保留兼容但隐藏在 help 外。
  • 新增 SDK 方法和文档示例,覆盖 Python、Go、HTTP、CLI,以及 resource/memory 两种响应。

Testing

  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have tested this on the following platforms:
    • Linux
    • macOS
    • Windows

运行过:

pytest tests/server/test_filesystem_router.py -q
pytest sdk/python/tests/test_async_client_behaviors.py -q
cargo check -p ov_cli
GOCACHE=/tmp/openviking-go-build go test ./...

cargo fmt -p ov_cli -- --check 未通过,失败点是仓库里已有的 ov_cli 无关格式化差异;本 PR 没有全量 rustfmt,避免扩大 diff。

Checklist

  • My code follows the project's coding style
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

Screenshots (if applicable)

N/A

Additional Notes

示例:

openviking attrs get viking://resources/docs/api.md
openviking attrs get viking://resources/docs/api.md tags
openviking attrs get viking://user/alice/memories/experiences/foo.md memory.resource_refs
openviking attrs set-tags viking://resources/docs/api.md --tags team=search,env=prod
openviking attrs set-tags viking://resources/docs --tags team=search --mode append --recursive

返回示例:

{
  "uri": "viking://user/alice/memories/experiences/foo.md",
  "context_type": "memory",
  "attrs": {
    "memory": {
      "memory_type": "experiences",
      "name": "foo",
      "tags": ["ui"],
      "resource_refs": ["viking://resources/docs/api.md"]
    },
    "tags": ["team=search"]
  }
}

@qin-ctx qin-ctx merged commit 6223537 into main Jul 1, 2026
11 checks passed
@qin-ctx qin-ctx deleted the feat/fs-attrs branch July 1, 2026 03:57
@github-project-automation github-project-automation Bot moved this from Backlog to Done in OpenViking project Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants