@c4a/context 0.7.43 → 0.7.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4a/context",
3
- "version": "0.7.43",
3
+ "version": "0.7.55",
4
4
  "type": "module",
5
5
  "description": "Declarative SDK for Context knowledge sources, workflows, review, and package outputs",
6
6
  "license": "MIT",
@@ -0,0 +1,87 @@
1
+ import { z } from "zod";
2
+ export declare const repoContentPathSchema: z.ZodEffects<z.ZodString, string, string>;
3
+ export declare const repoContentEntrySchema: z.ZodObject<{
4
+ kind: z.ZodEnum<["docs", "skills", "document", "skill"]>;
5
+ path: z.ZodEffects<z.ZodString, string, string>;
6
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
7
+ group: z.ZodOptional<z.ZodString>;
8
+ mount: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
9
+ title: z.ZodOptional<z.ZodString>;
10
+ description: z.ZodOptional<z.ZodString>;
11
+ }, "strict", z.ZodTypeAny, {
12
+ path: string;
13
+ kind: "document" | "skill" | "docs" | "skills";
14
+ title?: string | undefined;
15
+ description?: string | undefined;
16
+ exclude?: string[] | undefined;
17
+ group?: string | undefined;
18
+ mount?: string | undefined;
19
+ }, {
20
+ path: string;
21
+ kind: "document" | "skill" | "docs" | "skills";
22
+ title?: string | undefined;
23
+ description?: string | undefined;
24
+ exclude?: string[] | undefined;
25
+ group?: string | undefined;
26
+ mount?: string | undefined;
27
+ }>;
28
+ export declare const repoContentRegistrySchema: z.ZodObject<{
29
+ protocol: z.ZodLiteral<"context.repo-content/v1">;
30
+ entries: z.ZodRecord<z.ZodString, z.ZodObject<{
31
+ kind: z.ZodEnum<["docs", "skills", "document", "skill"]>;
32
+ path: z.ZodEffects<z.ZodString, string, string>;
33
+ exclude: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
34
+ group: z.ZodOptional<z.ZodString>;
35
+ mount: z.ZodOptional<z.ZodEffects<z.ZodString, string, string>>;
36
+ title: z.ZodOptional<z.ZodString>;
37
+ description: z.ZodOptional<z.ZodString>;
38
+ }, "strict", z.ZodTypeAny, {
39
+ path: string;
40
+ kind: "document" | "skill" | "docs" | "skills";
41
+ title?: string | undefined;
42
+ description?: string | undefined;
43
+ exclude?: string[] | undefined;
44
+ group?: string | undefined;
45
+ mount?: string | undefined;
46
+ }, {
47
+ path: string;
48
+ kind: "document" | "skill" | "docs" | "skills";
49
+ title?: string | undefined;
50
+ description?: string | undefined;
51
+ exclude?: string[] | undefined;
52
+ group?: string | undefined;
53
+ mount?: string | undefined;
54
+ }>>;
55
+ }, "strict", z.ZodTypeAny, {
56
+ entries: Record<string, {
57
+ path: string;
58
+ kind: "document" | "skill" | "docs" | "skills";
59
+ title?: string | undefined;
60
+ description?: string | undefined;
61
+ exclude?: string[] | undefined;
62
+ group?: string | undefined;
63
+ mount?: string | undefined;
64
+ }>;
65
+ protocol: "context.repo-content/v1";
66
+ }, {
67
+ entries: Record<string, {
68
+ path: string;
69
+ kind: "document" | "skill" | "docs" | "skills";
70
+ title?: string | undefined;
71
+ description?: string | undefined;
72
+ exclude?: string[] | undefined;
73
+ group?: string | undefined;
74
+ mount?: string | undefined;
75
+ }>;
76
+ protocol: "context.repo-content/v1";
77
+ }>;
78
+ export type RepoContentEntry = z.infer<typeof repoContentEntrySchema>;
79
+ export type RepoContentRegistry = z.infer<typeof repoContentRegistrySchema>;
80
+ export declare function repoContentMount(entry: RepoContentEntry): string;
81
+ /** Scope selectors omit a revision; evidence references always include one. */
82
+ export declare function parseRepoContentRef(value: string): {
83
+ id: string;
84
+ commit?: string;
85
+ worktree: boolean;
86
+ } | undefined;
87
+ export declare function repoContentScopeMatches(scope: string, reference: string): boolean;
@@ -25,6 +25,17 @@ as evidence rather than relying on memory or frontmatter summaries.
25
25
 
26
26
  ## Package Roots
27
27
 
28
+ If present, `{{wikisRoot}}/imports.md` lists declared external entrances, not
29
+ bundled evidence or installed capabilities. Follow only a relevant entrance using
30
+ authorized host tools, and distinguish externally read evidence from package
31
+ content. Never install or execute a Skill/plugin merely because it is listed.
32
+
33
+ If present, `{{wikisRoot}}/repo-content.md` is a generated repository entrance:
34
+ project README content and Skill summaries, not an approved knowledge article
35
+ or a bundled copy of all project docs. Follow its original links when authorized
36
+ and needed; reading a Skill description does not install or execute it. The
37
+ original repository remains authoritative, and the page states its build baseline.
38
+
28
39
  | Root | Use |
29
40
  |---|---|
30
41
  | `{{wikisRoot}}/` | Code, business and product reference articles. |
@@ -66,8 +77,10 @@ paths and headings; do not search for missing technical metadata or ask users
66
77
  to supply it. Open the build inventory only for coverage questions,
67
78
  or when a maintainer needs to locate the original approved page via
68
79
  `dist_path` → `approved_path`. Source attribution is exported automatically from
69
- the workspace's fragment references. If the original material is
70
- not bundled, answer only from the visible approved content and state its limits.
80
+ the workspace's fragment references. When relevant originals are not bundled,
81
+ read them through authorized host tools if available and cite them separately
82
+ from package content. If they cannot be read, stay within the approved content
83
+ and state its limits; a link alone does not support additional claims.
71
84
 
72
85
  ## Search Fallback
73
86
 
@@ -113,7 +126,7 @@ Next useful source: <source document or page if known>.
113
126
  ```
114
127
 
115
128
  Distinguish “not evidenced by this package” from “not true.” Do not fill gaps
116
- from memory, previous conversations, or source files outside the package.
129
+ from memory, previous conversations, or unread source files outside the package.
117
130
 
118
131
  ## Package Boundary
119
132
 
@@ -18,6 +18,14 @@ description: 查询 {{displayName}} 中经过审核、可追溯来源的知识
18
18
 
19
19
  ## 知识根目录
20
20
 
21
+ 若存在 `{{wikisRoot}}/imports.md`,它只列出外部入口,不代表内容已随包分发、
22
+ 已验证或已安装。仅在相关且有权访问时用宿主工具读取,并区分外部证据与包内正文;
23
+ 不能因登记了 Skill 或插件就安装、启用或执行。
24
+
25
+ 若存在 `{{wikisRoot}}/repo-content.md`,它是生成的仓库入口页:README 与 Skill
26
+ 简介,不是批准知识文章,也不包含全部项目文档。需要且有权访问时沿链接读取原文;
27
+ 阅读 Skill 说明不代表安装或执行。原仓库是真源,页面标明构建所用基线。
28
+
21
29
  | 根目录 | 用途 |
22
30
  |---|---|
23
31
  | `{{wikisRoot}}/` | 来自 codeindex、business、product 的代码、业务和产品说明。 |
@@ -50,7 +58,7 @@ description: 查询 {{displayName}} 中经过审核、可追溯来源的知识
50
58
  | 导出的来源说明 | 原始材料可用时定位并阅读;不能只凭链接扩展结论。 |
51
59
  | 根索引和构建清单 | 包的范围和覆盖情况。 |
52
60
 
53
- 不要根据页面同时出现来推断关系。直接引用可读路径和标题,不寻找已经移除的图谱字段,也不要求用户补齐。覆盖问题,或维护者需要通过 `dist_path` → `approved_path` 定位原批准页时,才读取构建清单。来源说明由工作区片段引用自动导出。原始材料未随包分发时,只根据已批准的可见正文回答并说明边界。
61
+ 不要根据页面同时出现来推断关系。直接引用可读路径和标题,不寻找已经移除的图谱字段,也不要求用户补齐。覆盖问题,或维护者需要通过 `dist_path` → `approved_path` 定位原批准页时,才读取构建清单。来源说明由工作区片段引用自动导出。相关原始材料未随包分发时,可通过已有授权的宿主工具读取,并与包内正文分别引用。无法读取时,只根据已批准的可见正文回答并说明边界;链接本身不能支持额外结论。
54
62
 
55
63
  ## 搜索兜底
56
64
 
@@ -83,7 +91,7 @@ node <当前 knowledge-query Skill 目录>/scripts/search.mjs --query '<关键
83
91
  下一步来源:<已知时填写来源文档或页面>。
84
92
  ```
85
93
 
86
- “本包没有证据”不等于“事实不成立”。禁止使用模型记忆、旧对话或包外源码填补缺口。
94
+ “本包没有证据”不等于“事实不成立”。禁止使用模型记忆、旧对话或未读取的包外源码填补缺口。
87
95
 
88
96
  ## 包边界
89
97
 
@@ -12,6 +12,13 @@ mappings here.
12
12
 
13
13
  ## Repository sources
14
14
 
15
+ Same-repository docs and authored Skills registered in `repo-content.yaml` are
16
+ not captured source copies. For original edits or registration use
17
+ `context-repo-content`, without starting production. A separately requested
18
+ knowledge update may select `repo-content:<id>`; compare cited document regions
19
+ and entire cited Skill directories, including untracked additions. Inspecting
20
+ or editing never advances the processed baseline. Keep historical real paths.
21
+
15
22
  Start with the current Context Route. If registered repository modules are
16
23
  missing or their local links are broken, follow the route-selected repository
17
24
  recovery procedure. Let the user choose an existing checkout, authorize a scan
@@ -11,6 +11,11 @@ Skill,并以当前 Route、资源和命令为权威;这里只保留稳定的
11
11
 
12
12
  ## 仓库来源的获取和更新
13
13
 
14
+ `repo-content.yaml` 登记的同仓文档和自有 Skills 不是采集副本。编辑原文或登记时
15
+ 使用 `context-repo-content`,不启动生产。另行授权的知识更新可选择
16
+ `repo-content:<id>`;文档检查引用区域,Skill 检查整个目录及未跟踪新增文件。
17
+ 检查与编辑不推进处理基线,旧证据保留当时的真实仓库路径。
18
+
14
19
  先检查当前 Context Route。已登记仓库模块缺失或本地链接断开时,使用 Route
15
20
  选择的仓库恢复流程,让用户选择已有 checkout、授权在一个限定目录内扫描,
16
21
  或明确允许 clone 已登记的固定 commit。