Skip to content

External Entrances ​

Some content belongs next to your knowledge without becoming part of it: a team's engineering handbook on another site, a Skill published in another repository. imports.yaml at the root of the Context knowledge workspace declares such entrances. Context never downloads, installs or captures them; it only knows where they are so pages and packages can link to them.

You needUse
A link readers can followAn import in imports.yaml
A conclusion that must be traceable and tracked for changeA registered, captured source
Docs or Skills in this same repositorySame-Repository Docs

Declare an entrance ​

Ask the Agent to keep a lasting association; quick lookups during a question do not register anything.

yaml
protocol: context.imports/v1
imports:
  engineering-guide:
    kind: knowledge
    url: https://docs.example.org/engineering/
    description: Engineering conventions
  release-check:
    kind: skill
    url: https://github.com/example/skills/tree/v1/skills/release-check
    path: skills/release-check
    version: v1

The stable ID and url are required; kind, format, title, description, path and version are optional free-form hints. URLs must be HTTP(S) without credentials — never put access tokens in query strings. Use a new ID when the target's identity changes.

markdown
See the [Engineering guide](context:import/engineering-guide).

Build turns this into the declared URL as-is; it never guesses provider URLs, appends path or rewrites the version. An unknown ID keeps the label as plain text and produces a build warning.

To give readers a directory of all entrances, enable the imports page on the package; importsPage: { site: true } also adds it to the website navigation:

ts
kbPackage({ name: "handbook", template: { path: "src/package-templates/kb" }, importsPage: true });

The page lists declared metadata only. Check that every entrance suits the audience before exposing private ones.

Entrances are not evidence ​

An import adds nothing to knowledge/structure.yaml references and has no citation format. When asked to check imports, the Agent compares current versions with version using its own authorized tools; a target it cannot reach is reported as "version unknown", never as a change. The CLI itself never contacts providers.

外部入口 ​

有些内容应当放在你的知识旁边,却不应成为知识的一部分:例如另一个站点上的团队工程手册,或发布在另一个仓库中的 Skill。Context 知识工作区根目录下的 imports.yaml 用于声明这类入口。Context 从不下载、安装或采集它们,只记录它们的位置,以便页面和知识包链接过去。

你需要使用
读者可以点击跳转的链接imports.yaml 中的一个导入项
必须可追溯、需要跟踪变化的结论已登记并已采集的来源
同一仓库中的文档或 Skill同仓库文档

声明入口 ​

需要建立长期关联时请告诉 Agent;提问过程中的临时查阅不会登记任何内容。

yaml
protocol: context.imports/v1
imports:
  engineering-guide:
    kind: knowledge
    url: https://docs.example.org/engineering/
    description: Engineering conventions
  release-check:
    kind: skill
    url: https://github.com/example/skills/tree/v1/skills/release-check
    path: skills/release-check
    version: v1

稳定 ID 和 url 是必填项;kind、format、title、description、path 和 version 是可选的自由格式提示。URL 必须是不含凭据的 HTTP(S) 地址,切勿在查询字符串中放入访问令牌。当目标的身份发生变化时,请使用新的 ID。

在页面中链接入口 ​

markdown
See the [Engineering guide](context:import/engineering-guide).

构建时会把它原样替换为声明的 URL;不会猜测 Provider 的 URL、追加 path 或改写版本。未知的 ID 会保留链接文字作为纯文本,并产生一条构建警告。

如果想给读者提供所有入口的目录,可以在知识包上启用导入页;importsPage: { site: true } 还会把它加入网站导航:

ts
kbPackage({ name: "handbook", template: { path: "src/package-templates/kb" }, importsPage: true });

该页面只列出声明的元数据。在暴露私有入口之前,请确认每个入口都适合目标读者。

入口不是证据 ​

导入项不会向 knowledge/structure.yaml 的引用中添加任何内容,也没有引用格式。当你要求检查导入项时,Agent 会使用自身获得授权的工具,把当前版本与 version 进行比较;无法访问的目标会报告为“版本未知”,而不会报告为发生了变化。CLI 本身从不联系 Provider。