Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "context",
"version": "0.7.50",
"version": "0.7.55",
"packageManager": "bun@1.3.9",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ files:
- resources/manuals/reference/code-extractors.md
- resources/manuals/guides/knowledge-updates.md
- resources/manuals/guides/repo-content.md
- resources/manuals/guides/imports.md
- resources/manuals/guides/note.md
- resources/manuals/guides/sessions.md
- resources/manuals/guides/workspace-prepare.md
Expand Down
2 changes: 1 addition & 1 deletion packages/context-cli/context-workflow/provider.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
schema: agent-graph.provider.v1
id: c4a/context
version: 0.7.50
version: 0.7.55
name: Context workflow
description: Internal work contract for Context knowledge workspaces.
graphs:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
id: context.sdk.imports
kind: procedure
mediaType: text/markdown
---

# External associations

Workspace-root `imports.yaml` declares external entrances without downloading,
installing or capturing their contents. Maintain it through the Context entry when
the task requests a lasting association. Temporary query reads do not register
dependencies. Same-repository authored documents and Skills use
[repo-content](repo-content.md) instead.

```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. Kind and format are open strings; versions are
opaque hints, not necessarily SemVer. Paths are source-relative without traversal.
Reader URLs must be HTTP(S), without credentials or whitespace; this is local
syntax validation, not a provider whitelist or availability check. Do not put
access tokens in query strings. The SDK exports `importsRegistrySchema` for local
validation. Unknown providers and offline operation do not cause network checks.

Use a new ID when replacing the source identity. A declaration is neither proof
of reading nor an installation record. Do not expand transitive imports or infer
permission from a readable service. Only relevant originals are read through
existing host tools. Installed capability identity belongs to the host, not a
Context lock file.

## Entrances and evidence

An import is a reader entrance, not recorded evidence. It adds no entry to
`knowledge/structure.yaml` `references[]`, produces no review hint and has no
`import:` reference format. When an article's conclusion must be traceable or
tracked for change, register the needed external content as a source and capture
it; the import can remain as the reader entrance.

The CLI never contacts providers or compares versions. When asked to update or
check imports, the Agent observes current versions with existing authorized host
tools and compares them with `version`. Unreachable, unauthorized or failed checks
are reported as "version unknown" and are never treated as a change.

## Links and output

`[Engineering guide](context:import/engineering-guide)` in an article projects to
the declared URL. Build never guesses a provider-specific URL, appends `path` or
rewrites the version. Use an entrance that already opens the intended target.
Missing IDs keep the reader label as non-clickable text and produce a build link
warning. An invalid or unreadable declaration skips the optional directory and
degrades affected links the same way; unrelated outputs still build. Correct
`imports.yaml` or the article link to restore navigation. Merely registering
entries emits no page.

For an optional declaration-only directory:

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

This generates `wikis/imports.md` and includes it in package navigation. With an
existing `site` configuration, `importsPage: { site: true }` also adds a website
navigation item. `false` or omission disables generation. Initialization enables
the package directory when a valid `imports.yaml` already exists. An invalid
declaration is preserved with a warning; initialization continues without enabling
that directory. When first configuring
a new workspace's KB later, enable it if the declaration is present; preserve
existing settings and explicit user choices. The directory contains only declared metadata,
not approved article bodies or installation commands. Check audience suitability
before exposing private entrances.

Navigation links are not source evidence. Imports declaration support alone does
not authorize fabricated `import:` fragment references or advancement of article
evidence baselines.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ empty diff. Inspect/edit does not advance references; delivery or an explicit
no-impact outcome settles the selected scope. Historical locators always store
the real repository path at the cited commit, not today's registration path.

External associations in `imports.yaml` are entrances, not recorded evidence:
they create no `references[]` and no review hints, and the CLI never checks
their versions. When the user asks to update or check external associations,
use existing authorized Host tools (for example `git ls-remote`, a package
manager or a web read) to observe each selected entry's current version and
compare it with its optional `version`. If it differs, read only what the
linked articles rely on, report whether they need revision and update
`version` once settled. Unreachable, unauthorized or failed checks are
"version unknown": report them, keep `version` unchanged, and never treat them
as changed. When an article's conclusion must trace or track external content,
register the needed part as a source and capture it; do not cite the
association itself as evidence.

Before starting production, compare the proposed content with the workspace's
reader purpose. For clearly unrelated anecdotes or personal rankings, briefly
recommend leaving them out of the formal manual or saving them separately because
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Same-repository originals have an optional [repository entrance](repo-content.md
not the full document tree. It does not expose that page on a configured website;
use `repoContentPage: { site: true }` to opt in. Existing declarations are kept.

External associations have an optional [directory](imports.md): `importsPage: true`
generates `wikis/imports.md` from declarations only; `{ site: true }` also exposes
it on a configured website. Neither option downloads or installs external content.

When first declaring a KB for a new workspace, enable `repoContentPage: true`
if `repo-content.yaml` exists and `importsPage: true` if `imports.yaml` exists.
Keep existing package settings and explicit user choices; website exposure stays opt-in.

Output channels support multiple selection. In a new workspace without explicit
preferences, the Agent proposes and configures KB + website as the default. Honor
user feedback, session authority and existing workspace declarations; LLMS is an
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,19 @@ empty diff. Inspect/edit does not advance references; delivery or an explicit
no-impact outcome settles the selected scope. Historical locators always store
the real repository path at the cited commit, not today's registration path.

External associations in `imports.yaml` are entrances, not recorded evidence:
they create no `references[]` and no review hints, and the CLI never checks
their versions. When the user asks to update or check external associations,
use existing authorized Host tools (for example `git ls-remote`, a package
manager or a web read) to observe each selected entry's current version and
compare it with its optional `version`. If it differs, read only what the
linked articles rely on, report whether they need revision and update
`version` once settled. Unreachable, unauthorized or failed checks are
"version unknown": report them, keep `version` unchanged, and never treat them
as changed. When an article's conclusion must trace or track external content,
register the needed part as a source and capture it; do not cite the
association itself as evidence.

Before starting production, compare the proposed content with the workspace's
reader purpose. For clearly unrelated anecdotes or personal rankings, briefly
recommend leaving them out of the formal manual or saving them separately because
Expand Down
2 changes: 1 addition & 1 deletion packages/context-cli/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@c4a/context-cli",
"description": "Local runtime and Agent integration for traceable knowledge production",
"version": "0.7.50",
"version": "0.7.55",
"type": "module",
"license": "MIT",
"engines": {
Expand Down
7 changes: 5 additions & 2 deletions packages/context-cli/scripts/build-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ async function writeClaudeCommands(
): Promise<void> {
const commandsRoot = join(outputRoot, "commands");
await mkdir(commandsRoot, { recursive: true });
await copyDir(join(PLUGIN_SOURCE_ROOT, "skills/context/references"), join(outputRoot, "resources/context"));
for (const command of commands) {
const body = [
"---",
Expand All @@ -294,7 +295,7 @@ async function writeClaudeCommands(
] : []),
"---",
"",
command.body.trimEnd(),
(command.slug === "context" ? command.body.replaceAll("](references/", "](../resources/context/") : command.body).trimEnd(),
"",
].join("\n");
await writeFile(join(commandsRoot, `${command.slug}.md`), body, "utf8");
Expand Down Expand Up @@ -368,8 +369,10 @@ async function buildVercel(): Promise<void> {
async function writeCursorCommands(outRoot: string, commands: readonly CommandSource[]): Promise<void> {
const dest = join(outRoot, "commands");
await mkdir(dest, { recursive: true });
await copyDir(join(PLUGIN_SOURCE_ROOT, "skills/context/references"), join(outRoot, "resources/context"));
for (const command of commands) {
const rewrittenBody = rewriteClaudeSlashCommandsForCursor(command.body);
const rewrittenBody = rewriteClaudeSlashCommandsForCursor(command.slug === "context"
? command.body.replaceAll("](references/", "](../resources/context/") : command.body);
const body = stripHtmlComments(rewrittenBody).trimStart();
const file = `---\ndescription: ${JSON.stringify(command.description)}\n---\n\n${body.trimEnd()}\n`;
await writeFile(join(dest, cursorCommandFileName(command.slug)), file, "utf8");
Expand Down
1 change: 1 addition & 0 deletions packages/context-cli/scripts/build-workflow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const sdkManuals = [
"guides/source-batches.md",
"guides/knowledge-updates.md",
"guides/repo-content.md",
"guides/imports.md",
"guides/workspace-prepare.md",
"guides/workspace-commit.md",
"guides/workspace-restore.md",
Expand Down
Loading
Loading