@c4a/context 0.6.1-beta.3 → 0.6.1-beta.4
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 +8 -6
- package/README.zh-CN.md +5 -4
- package/docs/getting-started.md +20 -15
- package/docs/guides/agent-guide.md +24 -17
- package/docs/guides/package-outputs.md +40 -37
- package/docs/reference/package-templates.md +36 -48
- package/docs/reference/project-api.md +75 -12
- package/docs/reference/template-variables.md +12 -11
- package/index.d.ts +1 -0
- package/index.js +34 -43
- package/package.json +1 -1
- package/phases.d.ts +8 -5
- package/templates/package-templates/kb/AGENTS.md +7 -10
- package/templates/package-templates/kb/skills/knowledge-query/SKILL.md +88 -180
- package/templates/package-templates/kb/wikis/index.md +1 -1
- package/templates/package-templates.zh-CN/kb/AGENTS.md +30 -0
- package/templates/package-templates.zh-CN/kb/skills/knowledge-query/SKILL.md +91 -0
- package/templates/package-templates.zh-CN/kb/wikis/index.md +39 -0
- package/templates/package-templates.zh-CN/llms/llms.txt +8 -0
|
@@ -49,10 +49,11 @@ knowledge/codegraph/module-a/...
|
|
|
49
49
|
knowledge/codegraph/module-b/...
|
|
50
50
|
```
|
|
51
51
|
|
|
52
|
-
For prose Views,
|
|
53
|
-
|
|
54
|
-
`containment` only
|
|
55
|
-
|
|
52
|
+
For prose Views, provide a stable filename `slug` and omit `path`; the CLI
|
|
53
|
+
derives the path. Omit `containment` when the page is an independent collection
|
|
54
|
+
entry, producing `knowledge/<collection>/<slug>.md`. Set `containment` only
|
|
55
|
+
when the approved structure intentionally places the page under a parent path;
|
|
56
|
+
it is not a required source/module wrapper.
|
|
56
57
|
|
|
57
58
|
The registry stores this as one date entry containing several `modules` entries,
|
|
58
59
|
and materializes each module at `sources/repo/<date>/<module>`.
|
|
@@ -179,7 +180,10 @@ with the next declared command in `workflow.current.commands`.
|
|
|
179
180
|
Each command item declares its effect and availability. The current route's
|
|
180
181
|
`gate` identifies the decision and authority boundary. Write commands are bound
|
|
181
182
|
to the workflow revision; after one succeeds, rerun status instead of reusing
|
|
182
|
-
the old command.
|
|
183
|
+
the old command. An external command also declares
|
|
184
|
+
`execution.target: agent-host`; execute it as a top-level Agent-host action so
|
|
185
|
+
network and credential-store access are not lost inside a restricted child
|
|
186
|
+
sandbox.
|
|
183
187
|
|
|
184
188
|
### `allSources("repo")`
|
|
185
189
|
|
|
@@ -245,6 +249,10 @@ context review approve-all <collection> --managed --format json
|
|
|
245
249
|
context review approve-all --all --managed --format json
|
|
246
250
|
```
|
|
247
251
|
|
|
252
|
+
The default JSON result reports counts and change totals without listing every
|
|
253
|
+
candidate id or materialized path. Add `--verbose` only when debugging requires
|
|
254
|
+
the complete candidate and page details.
|
|
255
|
+
|
|
248
256
|
Managed structure confirmation and Review use only the revision-bound commands
|
|
249
257
|
returned by `workflow.current`. Source boundaries and unread source bodies,
|
|
250
258
|
external operations, payload validation, deterministic close, and verification
|
|
@@ -374,15 +382,56 @@ context run align:file:<source-name>:architecture --view structure-summary --inp
|
|
|
374
382
|
context run align:file:<source-name>:architecture --stage --input <structure.yaml> --format json
|
|
375
383
|
```
|
|
376
384
|
|
|
385
|
+
When `workflow.current.batch` is present, several independent document slots
|
|
386
|
+
can be prepared in one Agent pass and validated or staged through one command:
|
|
387
|
+
|
|
388
|
+
```yaml
|
|
389
|
+
schema: context.prose.structure-batch.v1
|
|
390
|
+
items:
|
|
391
|
+
- phase_id: align:file:<source-a>:architecture
|
|
392
|
+
input: .tmp/agent-payloads/<source-a>-structure.yaml
|
|
393
|
+
- phase_id: align:file:<source-b>:architecture
|
|
394
|
+
input: .tmp/agent-payloads/<source-b>-structure.yaml
|
|
395
|
+
```
|
|
396
|
+
|
|
397
|
+
```bash
|
|
398
|
+
context run --batch-input .tmp/agent-payloads/prose-structure-batch.yaml --validate --format json
|
|
399
|
+
context run --batch-input .tmp/agent-payloads/prose-structure-batch.yaml --stage --managed --format json
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
Batch preflight validates every payload before writing. Stage writes ready
|
|
403
|
+
slots serially; it does not merge documents or decide their semantic shape.
|
|
404
|
+
|
|
405
|
+
Align results expose a recommended `payload_target.path` under
|
|
406
|
+
`.tmp/agent-payloads/`. Agents should use it for transient structure inputs and
|
|
407
|
+
may remove the file after a successful stage. The CLI continues to accept an
|
|
408
|
+
explicit alternative path; this is an authoring convention, not validation.
|
|
409
|
+
|
|
410
|
+
For the ordinary path, `read-plan` is a complete authoring packet: it includes
|
|
411
|
+
the payload contract, a budgeted canonical source-ref map, exact source-body
|
|
412
|
+
resources, and a direct `--stage` command. Read the bodies, author the payload,
|
|
413
|
+
and run that stage command. Request `source-index` only when the packet reports
|
|
414
|
+
omitted refs, and request `existing-knowledge` only when reusing or checking an
|
|
415
|
+
approved identity. The separate schema and validate views are optional
|
|
416
|
+
diagnostic tools, not required lifecycle steps.
|
|
417
|
+
|
|
377
418
|
`--validate`, `--stage`, and `--confirm` are mutually exclusive operations. An
|
|
378
419
|
`--input` without an operation is rejected unless the selected view explicitly
|
|
379
420
|
consumes that input. Deterministic boundary repairs run internally before the
|
|
380
|
-
result is returned.
|
|
421
|
+
result is returned. `self_healed` includes input/output Section counts, the
|
|
422
|
+
number of original Sections split, and structural reason codes. Stage performs validation before writing and returns the
|
|
423
|
+
same diagnostics on failure; in managed mode, a valid stage also confirms the
|
|
424
|
+
structure. Successful standalone validation returns a stage command with the
|
|
381
425
|
same file path. JSON run output keeps `next_action` first;
|
|
382
426
|
schema and full reports stay behind explicit Views, while `--verbose` restores
|
|
383
427
|
the full phase result and repeated contracts. Long diagnostics return a compact
|
|
384
428
|
first page plus an exact diagnostics continuation command.
|
|
385
429
|
|
|
430
|
+
Validation returns `state: ready | repair-required | invalid`. Only `ready`
|
|
431
|
+
sets `valid: true` and may proceed to stage. `error_free: true` with
|
|
432
|
+
`state: repair-required` means no error diagnostic remains, but a declared
|
|
433
|
+
confirmation blocker still requires repair; it is not a successful result.
|
|
434
|
+
|
|
386
435
|
`existing-knowledge` is the authoring-time lookup for approved identities. It
|
|
387
436
|
returns stable NodeRefs, ViewRefs, titles, tags, collections, and section counts
|
|
388
437
|
without exposing workspace storage paths. `--query` performs deterministic
|
|
@@ -414,7 +463,20 @@ After capture, the capture phase itself exposes collection-neutral `read-plan`,
|
|
|
414
463
|
Status selects `route.document.classification-required` until every captured
|
|
415
464
|
target has an evidence-backed, user-confirmed align declaration. Align then
|
|
416
465
|
adds `schema` and `structure-summary` for structure work. Agents should not
|
|
417
|
-
|
|
466
|
+
scan `sources/` or `.tmp` to invent evidence. They may read only the exact
|
|
467
|
+
source-body files selected as required resources by the current Route; those
|
|
468
|
+
files carry stable content digests and must be read in full before a receipt is
|
|
469
|
+
reported. Read all required direct paths, then execute the Route's single
|
|
470
|
+
`resources.after_read.command`; the CLI writes and carries the merged receipt
|
|
471
|
+
set without requiring Agent-authored JSON. That acknowledgement response
|
|
472
|
+
already contains the re-evaluated `workflow.current`, so no additional status
|
|
473
|
+
command is needed.
|
|
474
|
+
|
|
475
|
+
Generated Context Views use the same content-addressed rule. Materialization
|
|
476
|
+
returns a receipt-set path and an exact post-read command. Read the complete
|
|
477
|
+
file, then execute that command; unchanged content remains current across
|
|
478
|
+
workflow revisions, while write and external commands still require the exact
|
|
479
|
+
current revision.
|
|
418
480
|
|
|
419
481
|
Compile `read-plan`, `blockers`, and `diagnostics` Views are workspace-read-only
|
|
420
482
|
and may run concurrently. Compile `--validate`, compile `--stage`, structure
|
|
@@ -451,9 +513,9 @@ compile:file:<source-name>:architecture
|
|
|
451
513
|
compile:lark:<source-name>:architecture
|
|
452
514
|
```
|
|
453
515
|
|
|
454
|
-
Compile requires confirmed
|
|
455
|
-
structure for the compile round; if the user wants to change nodes,
|
|
456
|
-
ownership, or relationships, return to the align/structure gate.
|
|
516
|
+
Compile requires confirmed CLI-managed lifecycle structure. It freezes the
|
|
517
|
+
current structure for the compile round; if the user wants to change nodes,
|
|
518
|
+
section ownership, or relationships, return to the align/structure gate.
|
|
457
519
|
|
|
458
520
|
Common commands:
|
|
459
521
|
|
|
@@ -537,7 +599,7 @@ package from a larger monorepo source.
|
|
|
537
599
|
Use `context source inspect <date>/<module>` to list detected module/package
|
|
538
600
|
boundaries before choosing the source. Use `context run <phase-id> --dry-run
|
|
539
601
|
--format json` to check the resolved modules, file counts, symbol counts, and
|
|
540
|
-
candidate estimate before writing
|
|
602
|
+
candidate estimate before writing the ignored lifecycle candidate ledger. The dry-run
|
|
541
603
|
preview also includes `knowledgeTree` and `knowledgePathExamples`, which show
|
|
542
604
|
where approved Markdown will land after review apply.
|
|
543
605
|
Its module and total summaries distinguish `discoveredFiles`, `analyzedFiles`,
|
|
@@ -619,7 +681,8 @@ structure slots and every declared `pendingStructureTargets` item in the round;
|
|
|
619
681
|
codegraph waits for every pending extract phase in the confirmed module round.
|
|
620
682
|
Candidate count/hash therefore describes the complete current batch rather than
|
|
621
683
|
one page, source slot, or module. Deterministic close later merges all active
|
|
622
|
-
slots into `knowledge/structure.yaml
|
|
684
|
+
slots into `knowledge/structure.yaml`, retains only their source, collection,
|
|
685
|
+
and consumed snapshot hash as `source_inputs`, then removes the lifecycle slots.
|
|
623
686
|
|
|
624
687
|
`status.structureBatch` lists unclassified, configuration-required, pending,
|
|
625
688
|
and active structure slots together with the execution policy for the round.
|
|
@@ -91,13 +91,13 @@ Read node_modules/@c4a/context/docs/reference/template-variables.md.
|
|
|
91
91
|
|---|---|---|
|
|
92
92
|
| `packageName` | string | Package name from `kbPackage()` / `llmsPackage()`. |
|
|
93
93
|
| `packageKind` | string | `kb` or `llms`. |
|
|
94
|
-
| `knowledgeNamespace` | string |
|
|
95
|
-
| `namespacedKnowledge` | boolean |
|
|
94
|
+
| `knowledgeNamespace` | string | Legacy configured namespace when an older workspace still declares one; otherwise empty. It does not change output paths. |
|
|
95
|
+
| `namespacedKnowledge` | boolean | Always `false`; retained so older templates remain renderable. |
|
|
96
96
|
| `skillsRoot` | string | Skills root, currently `skills`. |
|
|
97
|
-
| `wikisRoot` | string | Final wikis root
|
|
98
|
-
| `guidesRoot` | string | Final guides root
|
|
99
|
-
| `rulesRoot` | string | Final rules root
|
|
100
|
-
| `featsRoot` | string | Final feats root
|
|
97
|
+
| `wikisRoot` | string | Final wikis root: `wikis`. |
|
|
98
|
+
| `guidesRoot` | string | Final guides root: `guides`. |
|
|
99
|
+
| `rulesRoot` | string | Final rules root: `rules`. |
|
|
100
|
+
| `featsRoot` | string | Final feats root: `feats`. |
|
|
101
101
|
| `skillName` | string | Author-maintained name of the Skill currently being rendered. Empty outside a `skills/<name>/...` template. |
|
|
102
102
|
| `skillPath` | string | Final package-relative `SKILL.md` path for the Skill currently being rendered. Empty outside a Skill template. |
|
|
103
103
|
| `knowledgeCount` | number | Selected approved Markdown file count. |
|
|
@@ -139,7 +139,7 @@ Each item contains:
|
|
|
139
139
|
| `internal_collection` | Alias for `internalCollection`. |
|
|
140
140
|
| `collection` | Internal approved collection; alias for `internalCollection`. |
|
|
141
141
|
| `okf_root` | OKF output root, for example `wikis`, `guides`, `rules`, or `feats`. |
|
|
142
|
-
| `okf_root_path` | Final package-relative OKF root
|
|
142
|
+
| `okf_root_path` | Final flat package-relative OKF root. |
|
|
143
143
|
| `node_ref` | Stable NodeRef from approved frontmatter, for example `entity/button`. |
|
|
144
144
|
| `view_ref` | Stable ViewRef from approved frontmatter, for example `architecture:entity/button`. |
|
|
145
145
|
| `pathWithinCollection` | Path below the OKF root, for example `component-lib/symbol/button.md`. |
|
|
@@ -177,7 +177,7 @@ Each group contains:
|
|
|
177
177
|
| `internalCollection` | Internal approved collection; alias for `collection`. |
|
|
178
178
|
| `internal_collection` | Alias for `internalCollection`. |
|
|
179
179
|
| `okf_root` | OKF output root for this group, for example `wikis`, `guides`, `rules`, or `feats`. |
|
|
180
|
-
| `okf_root_path` | Final package-relative OKF root
|
|
180
|
+
| `okf_root_path` | Final flat package-relative OKF root. |
|
|
181
181
|
| `title` | Display title; defaults to `name`, or the OKF root title for a root group. |
|
|
182
182
|
| `count` | Number of selected pages in this group. |
|
|
183
183
|
| `hasIndex` | Whether the active package navigation policy generates `indexPath`. |
|
|
@@ -236,6 +236,7 @@ non-root directory gets its own index only when it contains more than 50
|
|
|
236
236
|
descendant knowledge pages. Configure this with
|
|
237
237
|
`kbPackage({ navigation: { foldDirectoryIndexes, maxInlineEntries } })`.
|
|
238
238
|
|
|
239
|
-
The output is only a starter. Edit
|
|
240
|
-
`src/package-templates/kb
|
|
241
|
-
|
|
239
|
+
The output is only a starter. Edit the files under
|
|
240
|
+
`src/package-templates/kb/` when the package needs different reading paths or
|
|
241
|
+
navigation before `context build`. An unchanged generated starter must instead
|
|
242
|
+
be explicitly accepted through the current package-template Review Route.
|
package/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export type PackageTemplateInput = string | {
|
|
|
19
19
|
vars?: Record<string, TemplateVarValue>;
|
|
20
20
|
};
|
|
21
21
|
export type PackageDistributionDefinition = {
|
|
22
|
+
/** @deprecated Accepted for older workspaces; package output roots are flat. */
|
|
22
23
|
knowledgeNamespace: string;
|
|
23
24
|
};
|
|
24
25
|
export type BasePackageDefinition = {
|
package/index.js
CHANGED
|
@@ -7088,9 +7088,9 @@ var sourceSnapshotResource = (sourceDefinition, sourceType) => ({
|
|
|
7088
7088
|
sourceType,
|
|
7089
7089
|
path: `sources/${sourceType}/${getSourceName(sourceDefinition)}/manifest.json`
|
|
7090
7090
|
});
|
|
7091
|
-
var
|
|
7092
|
-
kind: "
|
|
7093
|
-
path: "
|
|
7091
|
+
var lifecycleStructureResource = (collection, status) => ({
|
|
7092
|
+
kind: "lifecycle.structure",
|
|
7093
|
+
path: ".tmp/context-runtime/lifecycle/structure.yaml",
|
|
7094
7094
|
profileCollection: collection,
|
|
7095
7095
|
...status === undefined ? {} : { status }
|
|
7096
7096
|
});
|
|
@@ -7150,7 +7150,7 @@ var alignProse = (definition) => {
|
|
|
7150
7150
|
kind: "source",
|
|
7151
7151
|
source: definition.source
|
|
7152
7152
|
}],
|
|
7153
|
-
writes: [
|
|
7153
|
+
writes: [lifecycleStructureResource(definition.collection, "draft")],
|
|
7154
7154
|
source: definition.source,
|
|
7155
7155
|
collection: definition.collection
|
|
7156
7156
|
};
|
|
@@ -7160,7 +7160,7 @@ var alignProse = (definition) => {
|
|
|
7160
7160
|
kind: "phase.align.prose",
|
|
7161
7161
|
id: `align:${sourceType}:${sourceId}:${definition.collection}`,
|
|
7162
7162
|
reads: [sourceSnapshotResource(definition.source, sourceType)],
|
|
7163
|
-
writes: [
|
|
7163
|
+
writes: [lifecycleStructureResource(definition.collection, "draft")],
|
|
7164
7164
|
source: definition.source,
|
|
7165
7165
|
sourceType,
|
|
7166
7166
|
collection: definition.collection
|
|
@@ -7176,12 +7176,12 @@ var compileProse = (definition) => {
|
|
|
7176
7176
|
reads: [{
|
|
7177
7177
|
kind: "source",
|
|
7178
7178
|
source: definition.source
|
|
7179
|
-
},
|
|
7179
|
+
}, lifecycleStructureResource(definition.collection, "confirmed")],
|
|
7180
7180
|
writes: [
|
|
7181
|
-
|
|
7181
|
+
lifecycleStructureResource(definition.collection, "frozen"),
|
|
7182
7182
|
{
|
|
7183
|
-
kind: "
|
|
7184
|
-
path: "
|
|
7183
|
+
kind: "lifecycle.candidates",
|
|
7184
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7185
7185
|
status: "draft"
|
|
7186
7186
|
}
|
|
7187
7187
|
],
|
|
@@ -7196,13 +7196,13 @@ var compileProse = (definition) => {
|
|
|
7196
7196
|
id: `compile:${sourceType}:${sourceId}:${definition.collection}`,
|
|
7197
7197
|
reads: [
|
|
7198
7198
|
sourceSnapshotResource(definition.source, sourceType),
|
|
7199
|
-
|
|
7199
|
+
lifecycleStructureResource(definition.collection, "confirmed")
|
|
7200
7200
|
],
|
|
7201
7201
|
writes: [
|
|
7202
|
-
|
|
7202
|
+
lifecycleStructureResource(definition.collection, "frozen"),
|
|
7203
7203
|
{
|
|
7204
|
-
kind: "
|
|
7205
|
-
path: "
|
|
7204
|
+
kind: "lifecycle.candidates",
|
|
7205
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7206
7206
|
status: "draft"
|
|
7207
7207
|
}
|
|
7208
7208
|
],
|
|
@@ -7234,8 +7234,8 @@ var extractTs = (definition) => {
|
|
|
7234
7234
|
source: sourceDefinition
|
|
7235
7235
|
}],
|
|
7236
7236
|
writes: [{
|
|
7237
|
-
kind: "
|
|
7238
|
-
path: "
|
|
7237
|
+
kind: "lifecycle.candidates",
|
|
7238
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7239
7239
|
collection: definition.collection,
|
|
7240
7240
|
status: "draft"
|
|
7241
7241
|
}],
|
|
@@ -7247,7 +7247,7 @@ var extractTs = (definition) => {
|
|
|
7247
7247
|
exportedOnly: definition.exportedOnly ?? mode === "exports",
|
|
7248
7248
|
out: {
|
|
7249
7249
|
kind: "codegraph-entities",
|
|
7250
|
-
candidateFile: "
|
|
7250
|
+
candidateFile: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7251
7251
|
approvedPagesDir: `knowledge/${definition.collection}`,
|
|
7252
7252
|
initialStatus: "draft"
|
|
7253
7253
|
}
|
|
@@ -7267,8 +7267,8 @@ var reviewValidity = (definition) => {
|
|
|
7267
7267
|
kind: "phase.review.validity",
|
|
7268
7268
|
id: "review:all:validity",
|
|
7269
7269
|
reads: [{
|
|
7270
|
-
kind: "
|
|
7271
|
-
path: "
|
|
7270
|
+
kind: "lifecycle.candidates",
|
|
7271
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7272
7272
|
status: "draft"
|
|
7273
7273
|
}],
|
|
7274
7274
|
writes: [
|
|
@@ -7281,8 +7281,12 @@ var reviewValidity = (definition) => {
|
|
|
7281
7281
|
path: "knowledge"
|
|
7282
7282
|
},
|
|
7283
7283
|
{
|
|
7284
|
-
kind: "
|
|
7285
|
-
path: "
|
|
7284
|
+
kind: "knowledge.decisions",
|
|
7285
|
+
path: "knowledge/decisions.json"
|
|
7286
|
+
},
|
|
7287
|
+
{
|
|
7288
|
+
kind: "lifecycle.candidates",
|
|
7289
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7286
7290
|
status: "rejected"
|
|
7287
7291
|
}
|
|
7288
7292
|
],
|
|
@@ -7297,8 +7301,8 @@ var reviewValidity = (definition) => {
|
|
|
7297
7301
|
kind: "phase.review.validity",
|
|
7298
7302
|
id: `review:${definition.collection}:validity`,
|
|
7299
7303
|
reads: [{
|
|
7300
|
-
kind: "
|
|
7301
|
-
path: "
|
|
7304
|
+
kind: "lifecycle.candidates",
|
|
7305
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7302
7306
|
collection: definition.collection,
|
|
7303
7307
|
status: "draft"
|
|
7304
7308
|
}],
|
|
@@ -7314,8 +7318,12 @@ var reviewValidity = (definition) => {
|
|
|
7314
7318
|
status: "approved"
|
|
7315
7319
|
},
|
|
7316
7320
|
{
|
|
7317
|
-
kind: "
|
|
7318
|
-
path: "
|
|
7321
|
+
kind: "knowledge.decisions",
|
|
7322
|
+
path: "knowledge/decisions.json"
|
|
7323
|
+
},
|
|
7324
|
+
{
|
|
7325
|
+
kind: "lifecycle.candidates",
|
|
7326
|
+
path: ".tmp/context-runtime/lifecycle/candidates.jsonl",
|
|
7319
7327
|
collection: definition.collection,
|
|
7320
7328
|
status: "rejected"
|
|
7321
7329
|
}
|
|
@@ -11772,22 +11780,8 @@ function assertUniquePhaseIds(phases) {
|
|
|
11772
11780
|
firstById.set(phase.id, { index, kind: phase.kind });
|
|
11773
11781
|
}
|
|
11774
11782
|
}
|
|
11775
|
-
function assertUniquePackageKnowledgeNamespaces(packages) {
|
|
11776
|
-
const firstByNamespace = new Map;
|
|
11777
|
-
for (const [index, pkg] of packages.entries()) {
|
|
11778
|
-
const namespace = pkg.kind === "package.kb" ? pkg.distribution?.knowledgeNamespace : undefined;
|
|
11779
|
-
if (namespace === undefined)
|
|
11780
|
-
continue;
|
|
11781
|
-
const first = firstByNamespace.get(namespace);
|
|
11782
|
-
if (first !== undefined) {
|
|
11783
|
-
throw new TypeError(`Duplicate package knowledge namespace ${JSON.stringify(namespace)}: packages[${first.index}] (${first.name}) conflicts with packages[${index}] (${pkg.name}). Every distributable knowledge package namespace must be unique.`);
|
|
11784
|
-
}
|
|
11785
|
-
firstByNamespace.set(namespace, { index, name: pkg.name });
|
|
11786
|
-
}
|
|
11787
|
-
}
|
|
11788
11783
|
var defineProject = (project) => {
|
|
11789
11784
|
assertUniquePhaseIds(project.phases);
|
|
11790
|
-
assertUniquePackageKnowledgeNamespaces(project.packages);
|
|
11791
11785
|
return {
|
|
11792
11786
|
kind: "context.project",
|
|
11793
11787
|
project
|
|
@@ -11926,15 +11920,12 @@ var createPackageDefinitionBase = (kind, definition) => {
|
|
|
11926
11920
|
};
|
|
11927
11921
|
var kbPackage = (definition) => {
|
|
11928
11922
|
const base = createPackageDefinitionBase("kb", definition);
|
|
11929
|
-
const distribution = normalizePackageDistribution(definition.distribution
|
|
11930
|
-
if (distribution === undefined) {
|
|
11931
|
-
throw new TypeError("KB package distribution must resolve to a knowledge namespace.");
|
|
11932
|
-
}
|
|
11923
|
+
const distribution = normalizePackageDistribution(definition.distribution);
|
|
11933
11924
|
return {
|
|
11934
11925
|
kind: "package.kb",
|
|
11935
11926
|
...base,
|
|
11936
11927
|
navigation: normalizePackageNavigation(definition.navigation),
|
|
11937
|
-
distribution
|
|
11928
|
+
...distribution === undefined ? {} : { distribution }
|
|
11938
11929
|
};
|
|
11939
11930
|
};
|
|
11940
11931
|
var llmsPackage = (definition) => ({
|
package/package.json
CHANGED
package/phases.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type FileCaptureProcessorDefinition, type KnowledgeCollection, type MarkdownTransform, type PackageKind, type PackageSelectDefinition, type DocumentMainlineCollection } from "./contracts.js";
|
|
2
2
|
import { DOCUMENT_COMPILE_ACTION_SCHEMA_VERSION } from "./documentEvidence.js";
|
|
3
3
|
import type { DocumentSourceDefinition, DocumentSourceType, FileSourceDefinition, FileSourceReference, LarkSourceDefinition, LarkSourceReference, RepoProjectSourceDefinition, SourceCollectionReference, SourceDefinition } from "./sources.js";
|
|
4
4
|
export type PhaseResourceReference = {
|
|
@@ -10,13 +10,13 @@ export type PhaseResourceReference = {
|
|
|
10
10
|
sourceType: DocumentSourceType;
|
|
11
11
|
path: string;
|
|
12
12
|
} | {
|
|
13
|
-
kind: "
|
|
13
|
+
kind: "lifecycle.candidates";
|
|
14
14
|
path: string;
|
|
15
15
|
collection?: KnowledgeCollection;
|
|
16
|
-
status?:
|
|
16
|
+
status?: "draft" | "rejected";
|
|
17
17
|
} | {
|
|
18
|
-
kind: "
|
|
19
|
-
path: "
|
|
18
|
+
kind: "lifecycle.structure";
|
|
19
|
+
path: ".tmp/context-runtime/lifecycle/structure.yaml";
|
|
20
20
|
profileCollection?: DocumentMainlineCollection;
|
|
21
21
|
status?: "draft" | "confirmed" | "frozen";
|
|
22
22
|
} | {
|
|
@@ -28,6 +28,9 @@ export type PhaseResourceReference = {
|
|
|
28
28
|
kind: "knowledge.approved";
|
|
29
29
|
path: "knowledge";
|
|
30
30
|
select?: PackageSelectDefinition;
|
|
31
|
+
} | {
|
|
32
|
+
kind: "knowledge.decisions";
|
|
33
|
+
path: "knowledge/decisions.json";
|
|
31
34
|
} | {
|
|
32
35
|
kind: "package.template";
|
|
33
36
|
path: string;
|
|
@@ -12,21 +12,18 @@ Use the Markdown files in this package as source-linked product and code
|
|
|
12
12
|
knowledge. Prefer cited facts from the included knowledge pages over memory.
|
|
13
13
|
|
|
14
14
|
The bundled knowledge-query Skill teaches agents how to navigate OKF indexes
|
|
15
|
-
and cite copied OKF root directories, starting with
|
|
16
|
-
`{{wikisRoot}}/`. Customize template files before build when the package needs
|
|
17
|
-
product-specific skills or routing rules.
|
|
15
|
+
and cite copied OKF root directories, starting with `{{wikisRoot}}/`.
|
|
18
16
|
|
|
19
17
|
Selected OKF root directories such as `{{wikisRoot}}/`, `{{guidesRoot}}/`,
|
|
20
|
-
`{{rulesRoot}}/`, and `{{featsRoot}}/` follow
|
|
21
|
-
at the top level, and no `context`
|
|
18
|
+
`{{rulesRoot}}/`, and `{{featsRoot}}/` follow an OKF-compatible Context profile:
|
|
19
|
+
OKF fields and Context extension fields stay at the top level, and no `context`
|
|
20
|
+
or `schema` field is emitted. Root mapping:
|
|
22
21
|
`{{wikisRoot}}/` maps from structured `codegraph`, `business`, and `product` knowledge;
|
|
23
22
|
`{{guidesRoot}}/` maps from `architecture`, `sop`, `faq`, `decision`, and `incident`;
|
|
24
23
|
`{{rulesRoot}}/` maps from `standards` and `test`; `{{featsRoot}}/` maps from `feats`. Treat
|
|
25
|
-
`{{wikisRoot}}/` as the entity-and-relationship layer; guides and rules may
|
|
26
|
-
constrain that layer.
|
|
27
|
-
the
|
|
28
|
-
other selected OKF root indexes are generated unless this template supplies
|
|
29
|
-
them.
|
|
24
|
+
`{{wikisRoot}}/` as the entity-and-relationship layer; guides and rules may
|
|
25
|
+
explain or constrain that layer. Other selected OKF root indexes are generated
|
|
26
|
+
unless the template supplies them.
|
|
30
27
|
|
|
31
28
|
## Included Knowledge
|
|
32
29
|
|