@c4a/context 0.7.12 → 0.7.14-beta.1
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/README.md +1 -0
- package/README.zh-CN.md +1 -0
- package/docs/README.md +1 -0
- package/docs/README.zh-CN.md +1 -0
- package/docs/guides/knowledge-updates.md +82 -19
- package/docs/guides/package-outputs.md +25 -0
- package/docs/guides/page-customization.md +87 -0
- package/docs/reference/project-api.md +6 -0
- package/index.js +12 -1
- package/indexerToolSnapshot.d.ts +24 -24
- package/package.json +1 -1
- package/packageSite.d.ts +77 -0
- package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +17 -0
- package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +13 -0
package/README.md
CHANGED
|
@@ -116,6 +116,7 @@ a source alone does not start indexing.
|
|
|
116
116
|
- [Project API](./docs/reference/project-api.md)
|
|
117
117
|
- [Indexer Provider Protocol](./docs/reference/indexer-provider-protocol.md)
|
|
118
118
|
- [Package Outputs](./docs/guides/package-outputs.md)
|
|
119
|
+
- [Page content customization](./docs/guides/page-customization.md) — homepage slots, custom pages and floating chat widgets.
|
|
119
120
|
- [Package Templates](./docs/reference/package-templates.md)
|
|
120
121
|
|
|
121
122
|
- [Update existing knowledge](./docs/guides/knowledge-updates.md)
|
package/README.zh-CN.md
CHANGED
|
@@ -107,6 +107,7 @@ knowledge/architecture/product-guides/component-input-fields.md
|
|
|
107
107
|
- [项目 API](./docs/reference/project-api.md)
|
|
108
108
|
- [Indexer Provider 协议](./docs/reference/indexer-provider-protocol.md)
|
|
109
109
|
- [知识包输出](./docs/guides/package-outputs.md)
|
|
110
|
+
- [页面内容定制](./docs/guides/page-customization.md):首页插槽、自定义页面与浮动聊天组件。
|
|
110
111
|
- [知识包模板](./docs/reference/package-templates.md)
|
|
111
112
|
|
|
112
113
|
- [更新已有知识](./docs/guides/knowledge-updates.md)
|
package/docs/README.md
CHANGED
|
@@ -22,6 +22,7 @@ preload the whole manual set.
|
|
|
22
22
|
|
|
23
23
|
| Current need | Read |
|
|
24
24
|
|---|---|
|
|
25
|
+
| Customize website pages, homepage slots or a floating chat widget | [Page Content Customization](./guides/page-customization.md) |
|
|
25
26
|
| Understand the whole knowledge-project shape | [Getting Started](./getting-started.md) |
|
|
26
27
|
| Know what the Agent may decide or change | [Agent Guide](./guides/agent-guide.md) and [Agent Dialogue](./guides/agent-dialogue.md) |
|
|
27
28
|
| Configure sources, capture, Indexers, or packages | [Project API](./reference/project-api.md) |
|
package/docs/README.zh-CN.md
CHANGED
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
| 选择代码提取方式 | [Code Extractor Selection](./reference/code-extractors.md) |
|
|
27
27
|
| 选择 Agent 知识包或 LLM 文档 | [Package Outputs](./guides/package-outputs.md) |
|
|
28
28
|
| 自定义包文件和索引 | [Package Templates](./reference/package-templates.md) 和 [Template Variables](./reference/template-variables.md) |
|
|
29
|
+
| 定制网站页面、首页区域和右下角聊天浮层 | [页面内容定制](./guides/page-customization.md) |
|
|
29
30
|
| 保留飞书图片和内嵌资源 | [Lark Resource Materialization](./guides/lark-resources.md) |
|
|
30
31
|
|
|
31
32
|
默认提供 Code、Markdown、Note、Sessions 四类 Indexer。安装和技能开关由 Host 管理;
|
|
@@ -101,12 +101,11 @@ configuration/template approval, before the final build. The record response
|
|
|
101
101
|
returns the next workspace Route, so no extra status call is needed. Build retries
|
|
102
102
|
reuse the recorded version when formal content is unchanged. If build preparation
|
|
103
103
|
or rendering fails and formal corrections are needed, `version inspect` returns
|
|
104
|
-
`reusable_version` for
|
|
105
|
-
publication
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
sealed and further formal changes require an increase. Intermediate batches
|
|
104
|
+
`reusable_version` for an untagged current entry. Before amending, read the
|
|
105
|
+
publication target's remote version using the distribution skill. An unpublished
|
|
106
|
+
preview may reuse its version with the complete iteration's title, changes and
|
|
107
|
+
triggers; preserve the original delivery description. Published content requires
|
|
108
|
+
an increasing version. A local build alone does not seal a version. Intermediate batches
|
|
110
109
|
do not each receive a version.
|
|
111
110
|
|
|
112
111
|
The workspace AGENTS.md and version-writing instructions require each entry's
|
|
@@ -143,19 +142,23 @@ are `initial`, `note`, `sessions`, `mr`, `module`, `document`, `navigation`,
|
|
|
143
142
|
`repair`, `dist`, and `other`. Agent-written fields describe the actual diff and
|
|
144
143
|
conversation; they must not expose credentials, raw transcripts or private IDs.
|
|
145
144
|
|
|
146
|
-
The CLI
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
145
|
+
The CLI updates `package.json`, `changelog.yaml` and generated `CHANGELOG.md` together.
|
|
146
|
+
`context version inspect --base <commit-or-tag> --format json` compares the actual
|
|
147
|
+
workspace files with Git, including untracked files. Without an explicit base it
|
|
148
|
+
uses the current version's `v<version>` tag when available, otherwise HEAD; HEAD
|
|
149
|
+
is not proof of publication. Review article bodies, assets, structure, navigation
|
|
150
|
+
and templates, not structure alone. Without Git, inspection reports local files.
|
|
151
|
+
A disposable `.tmp` checkpoint suppresses repeated recording in an uncommitted
|
|
152
|
+
iteration. Losing it does not lose knowledge or prove a new publication.
|
|
153
|
+
|
|
154
|
+
There are no root-level Context version/build/publication receipts to maintain.
|
|
155
|
+
Build freshness uses the existing local package cache. The CLI does not seal a
|
|
156
|
+
version merely because a preview was built. Before reusing a version, check the
|
|
157
|
+
actual publication target and Git tags; a published version requires an increase.
|
|
158
|
+
Publication belongs to the installed distribution tool. Record remote receipts
|
|
159
|
+
in its configuration or the existing work summary, separately for each target.
|
|
160
|
+
A successful authorized commit/tag identifies the delivered source; never create
|
|
161
|
+
one automatically, and never treat Git success as platform publication success.
|
|
159
162
|
|
|
160
163
|
Website history is available at `changelog.html`: cards are newest first, the
|
|
161
164
|
latest three expanded and older cards collapsed. The History button beside the
|
|
@@ -191,6 +194,66 @@ coverage by mechanically placing every new page under an unrelated catch-all.
|
|
|
191
194
|
Build reports missing bindings for the Agent to resolve; it does not classify
|
|
192
195
|
content. Moving a menu entry does not change the article URL.
|
|
193
196
|
|
|
197
|
+
### Reader tasks, names and reading order
|
|
198
|
+
|
|
199
|
+
Read the affected articles' bodies before changing their categories or titles.
|
|
200
|
+
Titles and outlines help locate material; they do not settle its main reader task.
|
|
201
|
+
During initial planning, keep names and placement provisional until the relevant
|
|
202
|
+
material supports them. Classify by the question the page primarily answers and
|
|
203
|
+
its intended reader, rather than its collection, source path or isolated words:
|
|
204
|
+
|
|
205
|
+
| Main reader task | Organizing emphasis |
|
|
206
|
+
| --- | --- |
|
|
207
|
+
| Understand a business process | Participants, rules, decisions and lifecycle |
|
|
208
|
+
| Understand an implementation | Components, data changes, calls and failure handling |
|
|
209
|
+
| Integrate or use a capability | Prerequisites, setup, contracts and usage |
|
|
210
|
+
| Diagnose or recover from a problem | Symptoms, checks, causes, actions and verification |
|
|
211
|
+
|
|
212
|
+
These distinctions guide placement, not a required set of top-level directories.
|
|
213
|
+
A page explaining retry scheduling and persistence belongs with its implementation;
|
|
214
|
+
a page explaining how to recover a stalled worker serves troubleshooting. The word
|
|
215
|
+
"retry" alone decides neither. Choose a primary home for a mixed page and link
|
|
216
|
+
related tasks without duplicating the same overview across categories.
|
|
217
|
+
|
|
218
|
+
Give each directory a concrete shared subject or reader task. At every parent,
|
|
219
|
+
keep its children either all directories or all articles. Place an overview in
|
|
220
|
+
the appropriate article group when the parent contains directories. Avoid empty
|
|
221
|
+
category scaffolding and chains of single-article directories that add no useful
|
|
222
|
+
choice. A residual "Other" group, when warranted, comes last; it must not absorb
|
|
223
|
+
articles whose purpose fits an existing group. Do not invent a fixed depth,
|
|
224
|
+
number of categories or page quota to make the tree look uniform.
|
|
225
|
+
|
|
226
|
+
Keep directory and article titles concise and specific to their actual subject.
|
|
227
|
+
Name the object and useful task, rather than enumerating every section heading.
|
|
228
|
+
For example, prefer "Client authentication" to "Client tokens, configuration,
|
|
229
|
+
requests, refresh and errors" when those sections all explain authentication.
|
|
230
|
+
Retain a platform or product name only when it distinguishes otherwise ambiguous
|
|
231
|
+
topics. Keep an existing accurate title when it already works; a necessary
|
|
232
|
+
technical name need not be shortened just to meet a word count.
|
|
233
|
+
|
|
234
|
+
The Agent manually arranges siblings for reading: a useful overview, prerequisites,
|
|
235
|
+
the main tasks or process sequence, then later maintenance and reference material
|
|
236
|
+
where applicable. Use a numbered list or ordered outline to review that proposal,
|
|
237
|
+
then assign explicit, distinct `order` values among siblings in the knowledge-map
|
|
238
|
+
adjustment, for example 10, 20 and 30. The list is an editing plan; persisted
|
|
239
|
+
`order` values determine navigation. Reordering YAML/JSON entries or changing the
|
|
240
|
+
plan's list order alone does not change the site. Paths, internal keys, alphabetical
|
|
241
|
+
order and source-file order are not substitutes for a reader sequence. Keep order
|
|
242
|
+
numbers out of titles. This navigation order is separate from the order in which
|
|
243
|
+
workers write their drafts.
|
|
244
|
+
|
|
245
|
+
For a long or compound page, inspect its content before suggesting a split or
|
|
246
|
+
merge. Keep one coherent task together, and separate independently useful tasks
|
|
247
|
+
only when their supported content warrants it. A long title or many headings
|
|
248
|
+
alone is insufficient. Preserve useful detail and links, and retain article IDs,
|
|
249
|
+
paths and unaffected sections when the reader task is unchanged. A navigation-only
|
|
250
|
+
change does not require a prose rewrite or file migration; changing its label does
|
|
251
|
+
not silently rename the approved article. Needed title or content revisions use
|
|
252
|
+
the existing revision and Review flow. Splits and merges use ordinary article
|
|
253
|
+
tasks, link repair and any explicit retirement after replacement content is
|
|
254
|
+
delivered. These are Agent editorial decisions, not new CLI checks or approval
|
|
255
|
+
gates.
|
|
256
|
+
|
|
194
257
|
## Edit one section or review part of a batch
|
|
195
258
|
|
|
196
259
|
The current approved-revision Route accepts either full `markdown` or explicit
|
|
@@ -25,6 +25,10 @@ change that silently enables websites for existing packages.
|
|
|
25
25
|
|
|
26
26
|
### Static documentation website
|
|
27
27
|
|
|
28
|
+
For business pages, homepage slots and a bottom-right chat/bot widget, read
|
|
29
|
+
[Page Content Customization](./page-customization.md). Presentation sources live
|
|
30
|
+
under `src/site/`; keep generated knowledge separate.
|
|
31
|
+
|
|
28
32
|
To include the default browser-readable site, enable `site` on the same
|
|
29
33
|
package. The normal `context build` produces both the Agent KB and a standalone
|
|
30
34
|
`dist/<base>-site/` directory containing `index.html`, article HTML,
|
|
@@ -476,3 +480,24 @@ Only approved selected content is exported. A map or article change invalidates
|
|
|
476
480
|
both website and LLMS outputs; failure preserves the previous staged package.
|
|
477
481
|
Standalone `llmsPackage()` uses the same map organization and supplies the full
|
|
478
482
|
text and raw article files alongside its template-rendered `llms.txt` index.
|
|
483
|
+
|
|
484
|
+
## Links to a deployed website
|
|
485
|
+
|
|
486
|
+
After a website has been built and deployed, record its complete public root:
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
context package site-url <package-name> https://example.com/docs/
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
This command adds optional `site_url` to the existing `context.site-output/v1`
|
|
493
|
+
map, in both the website and knowledge package. It normalizes a trailing slash,
|
|
494
|
+
rejects credentials/query/fragment, and never contacts the URL. The address
|
|
495
|
+
includes the deployment subpath; resolve `pages[].site_path` against it without
|
|
496
|
+
adding `base` again. Rebuilds preserve the address from the previous website
|
|
497
|
+
map and distribute the refreshed mapping with the package. Deleting dist also
|
|
498
|
+
deletes this optional delivery metadata: record it again from the deployment
|
|
499
|
+
result instead of guessing a hostname. No new workspace configuration is needed.
|
|
500
|
+
|
|
501
|
+
The address is an access hint, not proof of publication or content freshness.
|
|
502
|
+
Query Skills use it only to append related links in the final summary, with no
|
|
503
|
+
network probes or version checks. Packages without the map work as before.
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
# Page content customization
|
|
2
|
+
|
|
3
|
+
Keep trusted website code in `src/site/`. It is presentation code, not captured
|
|
4
|
+
material or approved knowledge. Configure it in the existing `kbPackage.site`:
|
|
5
|
+
|
|
6
|
+
```ts
|
|
7
|
+
site: {
|
|
8
|
+
title: "Engineering handbook",
|
|
9
|
+
extensions: {
|
|
10
|
+
root: "src/site",
|
|
11
|
+
slots: {
|
|
12
|
+
banner: "components/Banner.vue",
|
|
13
|
+
floating: "components/Chat.vue",
|
|
14
|
+
},
|
|
15
|
+
pages: { support: "pages/support.md" },
|
|
16
|
+
},
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Paths are relative to `root`. The directory can contain Vue components, CSS,
|
|
21
|
+
Markdown and imported assets. Use relative imports within this directory;
|
|
22
|
+
declare external dependencies in the workspace package manifest. Do not put
|
|
23
|
+
credentials or private configuration in frontend files. Hidden files,
|
|
24
|
+
`node_modules` and `dist` are not copied; symlinks are rejected.
|
|
25
|
+
|
|
26
|
+
## Homepage and floating slots
|
|
27
|
+
|
|
28
|
+
| Slot | Default | Customization |
|
|
29
|
+
| --- | --- | --- |
|
|
30
|
+
| `banner` | Existing homepage hero and actions | Replace with a component |
|
|
31
|
+
| `knowledge` | Knowledge-map card group | Replace with a component |
|
|
32
|
+
| `resources` | Resource card group | Replace with a component |
|
|
33
|
+
| `footer` | Existing homepage footer | Replace with a component |
|
|
34
|
+
| `floating` | Empty | Client-only component fixed at the bottom right on all pages |
|
|
35
|
+
|
|
36
|
+
Omit a slot to retain its default; set it to `false` to hide it. A component
|
|
37
|
+
replaces only its slot, not the global navigation, language switch or article
|
|
38
|
+
provenance. Components can use VitePress `useData()` and `useRoute()` for theme,
|
|
39
|
+
page and route information. Import scoped CSS from components for local styling.
|
|
40
|
+
|
|
41
|
+
The floating component owns its button, chat/bot panel and open/close behavior.
|
|
42
|
+
Keep its panel within the viewport and preserve keyboard focus and close controls.
|
|
43
|
+
Load expensive chat SDKs when opened. Its component import is client-only, but
|
|
44
|
+
other components must support static rendering: use `onMounted` for browser APIs.
|
|
45
|
+
The static website supplies no chat backend or secret storage; use an authorized
|
|
46
|
+
business service for authentication and requests. A service failure must not
|
|
47
|
+
prevent reading the handbook.
|
|
48
|
+
|
|
49
|
+
## Custom pages and navigation
|
|
50
|
+
|
|
51
|
+
Each `pages` key becomes `/custom/<key>.html` under the configured site base.
|
|
52
|
+
A page is trusted Markdown and may import Vue components, for example:
|
|
53
|
+
|
|
54
|
+
```md
|
|
55
|
+
# Support
|
|
56
|
+
|
|
57
|
+
<script setup>
|
|
58
|
+
import SupportPanel from '../components/SupportPanel.vue'
|
|
59
|
+
</script>
|
|
60
|
+
|
|
61
|
+
<SupportPanel />
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Place it using the existing knowledge-map entry structure, with
|
|
65
|
+
`target: { artifact_ref: "site:support" }`. Set `parent`, `title` and `order`
|
|
66
|
+
as for other directory entries; do not create a second menu configuration.
|
|
67
|
+
The `site:` namespace is reserved for website pages; do not use `section_key`
|
|
68
|
+
on these targets. Undeclared targets fail website building with a diagnostic.
|
|
69
|
+
Pages without directory entries remain directly accessible. Multiple entries
|
|
70
|
+
can reference one page without duplicating content.
|
|
71
|
+
|
|
72
|
+
These pages are website-only: they are not approved articles and do not enter
|
|
73
|
+
the knowledge package or LLM Docs. Update formal articles through the existing
|
|
74
|
+
knowledge revision workflow, not through a custom page that shadows their URLs.
|
|
75
|
+
|
|
76
|
+
## Build and delivery
|
|
77
|
+
|
|
78
|
+
Use the existing package build after editing configuration or presentation files;
|
|
79
|
+
site customization does not require capture, Indexer planning or a new review
|
|
80
|
+
gate. Existing authorization for building and deployment still applies.
|
|
81
|
+
Extension files and workspace dependency manifests participate in build
|
|
82
|
+
fingerprints. Build errors preserve previous outputs. Never edit the generated
|
|
83
|
+
`.tmp` website or `dist` as the source of customization.
|
|
84
|
+
|
|
85
|
+
Preview the homepage, custom pages and floating panel on desktop and mobile,
|
|
86
|
+
including a non-root `site.base`, dark mode and keyboard navigation. Publish only
|
|
87
|
+
the resulting website directory, not the source tree or workspace credentials.
|
|
@@ -187,6 +187,12 @@ or repository links. Knowledge map is projected from
|
|
|
187
187
|
`src/knowledge-map.yaml` independently of KB directories; see
|
|
188
188
|
[Package Outputs](../guides/package-outputs.md#optional-static-documentation-website).
|
|
189
189
|
|
|
190
|
+
`site.extensions` optionally names a trusted `src/site` root, homepage and floating
|
|
191
|
+
`slots`, and custom Markdown `pages`. Place custom pages in the same knowledge map
|
|
192
|
+
with `target.artifact_ref: "site:<page-key>"`. See
|
|
193
|
+
[Page content customization](../guides/page-customization.md) for the configuration
|
|
194
|
+
and the boundary between presentation code and approved knowledge.
|
|
195
|
+
|
|
190
196
|
## Knowledge requirements and Indexer Skills
|
|
191
197
|
|
|
192
198
|
When `src/indexers.yaml` is absent, the configuration Route supplies its schema.
|
package/index.js
CHANGED
|
@@ -10917,7 +10917,18 @@ var packageSiteSchema = exports_external.object({
|
|
|
10917
10917
|
description: exports_external.string().optional(),
|
|
10918
10918
|
lang: exports_external.string().min(1).default("en-US"),
|
|
10919
10919
|
base: exports_external.string().regex(/^\/(?:[a-zA-Z0-9_-]+\/)*$/, "Use / or a slash-delimited deployment path, such as /docs/").default("/"),
|
|
10920
|
-
home: packageSiteHomeSchema.optional()
|
|
10920
|
+
home: packageSiteHomeSchema.optional(),
|
|
10921
|
+
extensions: exports_external.object({
|
|
10922
|
+
root: exports_external.string().regex(/^src\/(?:[a-zA-Z0-9_-]+\/)*[a-zA-Z0-9_-]+$/).default("src/site"),
|
|
10923
|
+
slots: exports_external.object({
|
|
10924
|
+
banner: exports_external.union([exports_external.string().min(1), exports_external.literal(false)]).optional(),
|
|
10925
|
+
knowledge: exports_external.union([exports_external.string().min(1), exports_external.literal(false)]).optional(),
|
|
10926
|
+
resources: exports_external.union([exports_external.string().min(1), exports_external.literal(false)]).optional(),
|
|
10927
|
+
footer: exports_external.union([exports_external.string().min(1), exports_external.literal(false)]).optional(),
|
|
10928
|
+
floating: exports_external.union([exports_external.string().min(1), exports_external.literal(false)]).optional()
|
|
10929
|
+
}).strict().optional(),
|
|
10930
|
+
pages: exports_external.record(exports_external.string().regex(/^[a-zA-Z0-9_-]+$/), exports_external.string().min(1)).optional()
|
|
10931
|
+
}).strict().optional()
|
|
10921
10932
|
}).strict();
|
|
10922
10933
|
function normalizePackageSite(value) {
|
|
10923
10934
|
return value === undefined ? undefined : packageSiteSchema.parse(value);
|
package/indexerToolSnapshot.d.ts
CHANGED
|
@@ -132,12 +132,6 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
132
132
|
}>;
|
|
133
133
|
snapshot_digest: z.ZodString;
|
|
134
134
|
}, "strict", z.ZodTypeAny, {
|
|
135
|
-
source: {
|
|
136
|
-
source_ref: string;
|
|
137
|
-
module_ref: string | null;
|
|
138
|
-
input_digest: string;
|
|
139
|
-
};
|
|
140
|
-
protocol: "context.indexer.tool-snapshot/v1";
|
|
141
135
|
pages: {
|
|
142
136
|
page_ref: string;
|
|
143
137
|
cursor_in: string | null;
|
|
@@ -145,6 +139,12 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
145
139
|
item_count: number;
|
|
146
140
|
response_digest: string;
|
|
147
141
|
}[];
|
|
142
|
+
source: {
|
|
143
|
+
source_ref: string;
|
|
144
|
+
module_ref: string | null;
|
|
145
|
+
input_digest: string;
|
|
146
|
+
};
|
|
147
|
+
protocol: "context.indexer.tool-snapshot/v1";
|
|
148
148
|
location: {
|
|
149
149
|
site: string;
|
|
150
150
|
region: string | null;
|
|
@@ -177,12 +177,6 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
177
177
|
};
|
|
178
178
|
snapshot_digest: string;
|
|
179
179
|
}, {
|
|
180
|
-
source: {
|
|
181
|
-
source_ref: string;
|
|
182
|
-
module_ref: string | null;
|
|
183
|
-
input_digest: string;
|
|
184
|
-
};
|
|
185
|
-
protocol: "context.indexer.tool-snapshot/v1";
|
|
186
180
|
pages: {
|
|
187
181
|
page_ref: string;
|
|
188
182
|
cursor_in: string | null;
|
|
@@ -190,6 +184,12 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
190
184
|
item_count: number;
|
|
191
185
|
response_digest: string;
|
|
192
186
|
}[];
|
|
187
|
+
source: {
|
|
188
|
+
source_ref: string;
|
|
189
|
+
module_ref: string | null;
|
|
190
|
+
input_digest: string;
|
|
191
|
+
};
|
|
192
|
+
protocol: "context.indexer.tool-snapshot/v1";
|
|
193
193
|
location: {
|
|
194
194
|
site: string;
|
|
195
195
|
region: string | null;
|
|
@@ -222,12 +222,6 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
222
222
|
};
|
|
223
223
|
snapshot_digest: string;
|
|
224
224
|
}>, {
|
|
225
|
-
source: {
|
|
226
|
-
source_ref: string;
|
|
227
|
-
module_ref: string | null;
|
|
228
|
-
input_digest: string;
|
|
229
|
-
};
|
|
230
|
-
protocol: "context.indexer.tool-snapshot/v1";
|
|
231
225
|
pages: {
|
|
232
226
|
page_ref: string;
|
|
233
227
|
cursor_in: string | null;
|
|
@@ -235,6 +229,12 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
235
229
|
item_count: number;
|
|
236
230
|
response_digest: string;
|
|
237
231
|
}[];
|
|
232
|
+
source: {
|
|
233
|
+
source_ref: string;
|
|
234
|
+
module_ref: string | null;
|
|
235
|
+
input_digest: string;
|
|
236
|
+
};
|
|
237
|
+
protocol: "context.indexer.tool-snapshot/v1";
|
|
238
238
|
location: {
|
|
239
239
|
site: string;
|
|
240
240
|
region: string | null;
|
|
@@ -267,12 +267,6 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
267
267
|
};
|
|
268
268
|
snapshot_digest: string;
|
|
269
269
|
}, {
|
|
270
|
-
source: {
|
|
271
|
-
source_ref: string;
|
|
272
|
-
module_ref: string | null;
|
|
273
|
-
input_digest: string;
|
|
274
|
-
};
|
|
275
|
-
protocol: "context.indexer.tool-snapshot/v1";
|
|
276
270
|
pages: {
|
|
277
271
|
page_ref: string;
|
|
278
272
|
cursor_in: string | null;
|
|
@@ -280,6 +274,12 @@ export declare const indexerToolSnapshotSchema: z.ZodEffects<z.ZodObject<{
|
|
|
280
274
|
item_count: number;
|
|
281
275
|
response_digest: string;
|
|
282
276
|
}[];
|
|
277
|
+
source: {
|
|
278
|
+
source_ref: string;
|
|
279
|
+
module_ref: string | null;
|
|
280
|
+
input_digest: string;
|
|
281
|
+
};
|
|
282
|
+
protocol: "context.indexer.tool-snapshot/v1";
|
|
283
283
|
location: {
|
|
284
284
|
site: string;
|
|
285
285
|
region: string | null;
|
package/package.json
CHANGED
package/packageSite.d.ts
CHANGED
|
@@ -93,6 +93,50 @@ export declare const packageSiteSchema: z.ZodObject<{
|
|
|
93
93
|
featured?: boolean | undefined;
|
|
94
94
|
}[] | undefined;
|
|
95
95
|
}>>;
|
|
96
|
+
/** Trusted presentation code, relative to the workspace; never captured knowledge. */
|
|
97
|
+
extensions: z.ZodOptional<z.ZodObject<{
|
|
98
|
+
root: z.ZodDefault<z.ZodString>;
|
|
99
|
+
slots: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
banner: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
101
|
+
knowledge: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
102
|
+
resources: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
103
|
+
footer: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
104
|
+
floating: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
|
|
105
|
+
}, "strict", z.ZodTypeAny, {
|
|
106
|
+
resources?: string | false | undefined;
|
|
107
|
+
banner?: string | false | undefined;
|
|
108
|
+
knowledge?: string | false | undefined;
|
|
109
|
+
footer?: string | false | undefined;
|
|
110
|
+
floating?: string | false | undefined;
|
|
111
|
+
}, {
|
|
112
|
+
resources?: string | false | undefined;
|
|
113
|
+
banner?: string | false | undefined;
|
|
114
|
+
knowledge?: string | false | undefined;
|
|
115
|
+
footer?: string | false | undefined;
|
|
116
|
+
floating?: string | false | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
pages: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
119
|
+
}, "strict", z.ZodTypeAny, {
|
|
120
|
+
root: string;
|
|
121
|
+
slots?: {
|
|
122
|
+
resources?: string | false | undefined;
|
|
123
|
+
banner?: string | false | undefined;
|
|
124
|
+
knowledge?: string | false | undefined;
|
|
125
|
+
footer?: string | false | undefined;
|
|
126
|
+
floating?: string | false | undefined;
|
|
127
|
+
} | undefined;
|
|
128
|
+
pages?: Record<string, string> | undefined;
|
|
129
|
+
}, {
|
|
130
|
+
root?: string | undefined;
|
|
131
|
+
slots?: {
|
|
132
|
+
resources?: string | false | undefined;
|
|
133
|
+
banner?: string | false | undefined;
|
|
134
|
+
knowledge?: string | false | undefined;
|
|
135
|
+
footer?: string | false | undefined;
|
|
136
|
+
floating?: string | false | undefined;
|
|
137
|
+
} | undefined;
|
|
138
|
+
pages?: Record<string, string> | undefined;
|
|
139
|
+
}>>;
|
|
96
140
|
}, "strict", z.ZodTypeAny, {
|
|
97
141
|
lang: string;
|
|
98
142
|
base: string;
|
|
@@ -116,6 +160,17 @@ export declare const packageSiteSchema: z.ZodObject<{
|
|
|
116
160
|
featured?: boolean | undefined;
|
|
117
161
|
}[] | undefined;
|
|
118
162
|
} | undefined;
|
|
163
|
+
extensions?: {
|
|
164
|
+
root: string;
|
|
165
|
+
slots?: {
|
|
166
|
+
resources?: string | false | undefined;
|
|
167
|
+
banner?: string | false | undefined;
|
|
168
|
+
knowledge?: string | false | undefined;
|
|
169
|
+
footer?: string | false | undefined;
|
|
170
|
+
floating?: string | false | undefined;
|
|
171
|
+
} | undefined;
|
|
172
|
+
pages?: Record<string, string> | undefined;
|
|
173
|
+
} | undefined;
|
|
119
174
|
}, {
|
|
120
175
|
title?: string | undefined;
|
|
121
176
|
description?: string | undefined;
|
|
@@ -139,6 +194,17 @@ export declare const packageSiteSchema: z.ZodObject<{
|
|
|
139
194
|
featured?: boolean | undefined;
|
|
140
195
|
}[] | undefined;
|
|
141
196
|
} | undefined;
|
|
197
|
+
extensions?: {
|
|
198
|
+
root?: string | undefined;
|
|
199
|
+
slots?: {
|
|
200
|
+
resources?: string | false | undefined;
|
|
201
|
+
banner?: string | false | undefined;
|
|
202
|
+
knowledge?: string | false | undefined;
|
|
203
|
+
footer?: string | false | undefined;
|
|
204
|
+
floating?: string | false | undefined;
|
|
205
|
+
} | undefined;
|
|
206
|
+
pages?: Record<string, string> | undefined;
|
|
207
|
+
} | undefined;
|
|
142
208
|
}>;
|
|
143
209
|
export type PackageSiteDefinition = z.input<typeof packageSiteSchema>;
|
|
144
210
|
export declare function normalizePackageSite(value: PackageSiteDefinition | undefined): {
|
|
@@ -164,4 +230,15 @@ export declare function normalizePackageSite(value: PackageSiteDefinition | unde
|
|
|
164
230
|
featured?: boolean | undefined;
|
|
165
231
|
}[] | undefined;
|
|
166
232
|
} | undefined;
|
|
233
|
+
extensions?: {
|
|
234
|
+
root: string;
|
|
235
|
+
slots?: {
|
|
236
|
+
resources?: string | false | undefined;
|
|
237
|
+
banner?: string | false | undefined;
|
|
238
|
+
knowledge?: string | false | undefined;
|
|
239
|
+
footer?: string | false | undefined;
|
|
240
|
+
floating?: string | false | undefined;
|
|
241
|
+
} | undefined;
|
|
242
|
+
pages?: Record<string, string> | undefined;
|
|
243
|
+
} | undefined;
|
|
167
244
|
} | undefined;
|
|
@@ -133,3 +133,20 @@ Update the description, routing table, and package-boundary guidance to match
|
|
|
133
133
|
the actual package. If the generic behavior is intentionally sufficient,
|
|
134
134
|
explicitly accept the unchanged default during Context package-template review.
|
|
135
135
|
--}}
|
|
136
|
+
|
|
137
|
+
## Website links in the final summary
|
|
138
|
+
|
|
139
|
+
After answering from the pages actually read, optionally append one or more
|
|
140
|
+
related document links in the final summary. Read `context-site-map.json` from
|
|
141
|
+
the selected package (or its sibling website output in a workspace). Match the
|
|
142
|
+
read page to `pages[].package_path` or `approved_path`; use its `title` and resolve
|
|
143
|
+
`site_path` relative to `site_url`. The URL already includes the deployment base
|
|
144
|
+
path: do not prepend `base` again. Only cite matched articles, deduplicate links,
|
|
145
|
+
and do not invent section anchors.
|
|
146
|
+
|
|
147
|
+
This is a local formatting step, not retrieval or validation. Do not probe URLs,
|
|
148
|
+
make HTTP/HEAD requests, open a browser, inspect a deployment platform, or check
|
|
149
|
+
remote versions to add links. Never build, publish or update metadata for this
|
|
150
|
+
purpose. If the map, URL or matching page is absent or malformed, keep the local
|
|
151
|
+
citation and continue silently. A configured URL does not prove that the site
|
|
152
|
+
contains the current local revision; do not claim online verification.
|
|
@@ -97,3 +97,16 @@ node <当前 knowledge-query Skill 目录>/scripts/search.mjs --query '<关键
|
|
|
97
97
|
|
|
98
98
|
这是可直接工作的通用查询 Skill。正式发布前,如果知识包存在专用术语、常见用户意图、推荐入口、已知边界或固定任务流程,作者应修改 description、路由表和包边界说明;如果通用行为已经足够,应在 Context 的包模板 Review 中明确接受未修改模板。
|
|
99
99
|
--}}
|
|
100
|
+
|
|
101
|
+
## 总结中的网站文档链接
|
|
102
|
+
|
|
103
|
+
完成正文检索和回答后,仅在最终总结中按需附上一篇或多篇实际读取过的相关文档链接。
|
|
104
|
+
从当前知识包读取 `context-site-map.json`,按命中文章的包内路径匹配
|
|
105
|
+
`pages[].package_path`,使用 `title` 作链接文字,将 `site_path` 相对
|
|
106
|
+
`site_url` 拼接。`site_url` 已包含站点子路径,不再重复拼接 `base`。
|
|
107
|
+
同一文章只列一次,不凭标题推测页面地址或章节锚点。
|
|
108
|
+
|
|
109
|
+
这是本地引用格式化,不是检索前置步骤:不要为地址发起 HTTP/HEAD 请求、打开浏览器、
|
|
110
|
+
查询部署平台或远端版本,也不触发构建、发布或元数据修改。映射、地址或匹配项缺失、
|
|
111
|
+
格式不正确时沿用本地引用即可,不阻塞回答,不要求用户补配置。
|
|
112
|
+
记录的链接不证明线上内容与本地版本一致,不声称已验证网站。
|