跳到主要内容

Artifacts

Artifacts 是 Anyy 可以在会话内附加、检查和保留的 scoped 文件。它们覆盖生成图片、TTS 音频、渠道附件,以及通过 artifact 系统保存的其他文件型输出。

Artifact 使用 canonical ref 寻址:

artifact://artifact/<id>

Artifact ref 不是文件系统路径。在暴露任何本地文件路径前,Anyy 会通过 artifact store 和当前运行时 scope 解析它。

哪些内容会创建 Artifact

常见来源:

来源Artifact kind
收到的渠道附件imagevideoaudiovoicefile
image_generate生成的图片 artifact 和 outbound 图片附件。
text_to_speech生成的音频/语音 artifact 和 outbound 音频附件。
运行时文件注册服务注册文件时产生的 scoped local artifact record。

当前轮会收到当前和最近 scoped artifacts 的 manifest。已知时,manifest 包含 ref、kind、content type、filename、size、digest、status 和可用 actions。

Artifact 工具集

模型可见的 artifact 工具位于可选的 artifact 工具集:

工具用途策略
artifact_list列出当前会话 scoped artifacts。直接读取;成功时记录 runtime read 审计。
artifact_inspect检查图片或视频 artifact。直接读取;成功时记录 runtime read 审计。
artifact_pinPin 住 artifact,让普通 retention cleanup 保留它。记录 config-low 变更审计。

artifact_list 接受 kind 过滤:imagevideoaudiovoicefile。默认 limit 是 20,最大 50。

artifact_inspect 需要 canonical artifact_ref。它支持图片和视频 artifact。PDF、文档或普通文件请使用 manifest 路径配合文件、进程或技能工具处理。

artifact_inspect 接受可选 promptmax_tokens,上限为 1024。

Pin Artifact

Pin 会改变 scoped artifact 的 retention 状态:

{
"artifact_ref": "artifact://artifact/art_123",
"label": "final mockup",
"note": "Keep this image for later comparison."
}

Pin 不会让 artifact 全局公开。它只告诉 retention 逻辑不要在普通 cleanup 中移除这个 artifact。

Path Broker

需要本地路径时,Anyy 会通过 path broker 解析 artifact。Broker 会验证:

检查作用
ScopeArtifact 必须属于当前会话、owner、role/workspace 或 channel scope。
Status已删除、过期、不可用或不支持的 artifact 不会 materialize。
路径安全Artifact ID 和相对存储路径必须安全。
文件完整性验证源字节时,size 和 SHA-256 必须匹配 manifest。
本地后端当前 build 只支持 local artifact backend。

如果字节可用,broker 会在 profile artifact 区域 materialize 一个可读本地路径。否则 manifest 会记录不可用原因,例如 missingexpireddeletedunsafestalemissing_bytes

Retention

Artifacts 可能按存储和 retention 策略过期。最近 artifacts 仍可能以 manifest 形式出现在会话上下文中,但不可用字节会被标记,不会假装文件可读。

如果希望 Anyy 在普通 retention cleanup 后仍保留某个 artifact,请使用 artifact_pin。需要长期人工管理的文件,应要求 Anyy 保存或导出到普通项目路径。