@yourtechtribe-labs/koncept-cli 0.1.0-alpha.5 → 0.2.0-alpha.0
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 +14 -3
- package/dist/commands/affected.d.ts +9 -0
- package/dist/commands/affected.d.ts.map +1 -0
- package/dist/commands/affected.js +0 -0
- package/dist/commands/affected.js.map +1 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +83 -4
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +20 -1
- package/dist/commands/verify.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +2 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# @yourtechtribe-labs/koncept-cli
|
|
2
2
|
|
|
3
|
-
> CLI for [koncepto](https://github.com/yourtechtribe-labs/koncept-mcp) — initialize, verify, list, and
|
|
3
|
+
> CLI for [koncepto](https://github.com/yourtechtribe-labs/koncept-mcp) — initialize, verify (with auto-link suggestions), list, link, and impact analysis (`affected`) on `.koncept/` semantic concept graphs.
|
|
4
4
|
|
|
5
|
-
**Status**: pre-alpha (`v0.
|
|
5
|
+
**Status**: pre-alpha (`v0.2.0-alpha.0`).
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -28,10 +28,11 @@ npx koncepto init
|
|
|
28
28
|
|
|
29
29
|
### `koncepto verify`
|
|
30
30
|
|
|
31
|
-
Validates every concept YAML against the schema, checks cross-references, and writes the index. Exits non-zero on any issue (parse error, duplicate id, unresolved related concept, missing participant file).
|
|
31
|
+
Validates every concept YAML against the schema, checks cross-references, and writes the index. Exits non-zero on any issue (parse error, duplicate id, unresolved related concept, missing participant file). On a clean run, also surfaces auto-link suggestions (pairs of concepts that share participants or tags but are not linked via `related_concepts`) — non-blocking; pass `--no-suggestions` to silence.
|
|
32
32
|
|
|
33
33
|
```bash
|
|
34
34
|
npx koncepto verify
|
|
35
|
+
npx koncepto verify --no-suggestions
|
|
35
36
|
```
|
|
36
37
|
|
|
37
38
|
### `koncepto list`
|
|
@@ -52,6 +53,16 @@ npx koncepto link concept-schema src/lib/foo.ts --role=reader --purpose="parses
|
|
|
52
53
|
|
|
53
54
|
Roles: `writer`, `reader`, `tester`, `docs`.
|
|
54
55
|
|
|
56
|
+
### `koncepto affected [--from <ref>] [--files=a,b,c] [--json]`
|
|
57
|
+
|
|
58
|
+
Reports which concepts and invariants are touched by a set of changed files. Defaults to `git diff --name-only HEAD`; pass `--from HEAD~3` for a wider range or `--files=path1,path2` to bypass git entirely. Output is grouped by concept, ordered by max severity. Exits `1` when any touched invariant has severity `high` (useful as a pre-commit gate), `0` otherwise, `2` on operational failure.
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npx koncepto affected
|
|
62
|
+
npx koncepto affected --from HEAD~5 --json
|
|
63
|
+
npx koncepto affected --files=src/auth.ts,src/db.ts
|
|
64
|
+
```
|
|
65
|
+
|
|
55
66
|
## Companion package
|
|
56
67
|
|
|
57
68
|
Pair this CLI with [`@yourtechtribe-labs/koncept-mcp-server`](https://www.npmjs.com/package/@yourtechtribe-labs/koncept-mcp-server) to expose your concept graph to AI coding agents (Claude Code, Cursor, etc.) over MCP.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CommandContext } from '../index.js';
|
|
2
|
+
export interface AffectedOptions {
|
|
3
|
+
rootDir: string;
|
|
4
|
+
from: string;
|
|
5
|
+
filesOverride: string[] | null;
|
|
6
|
+
json: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function runAffected(ctx: CommandContext): Promise<number>;
|
|
9
|
+
//# sourceMappingURL=affected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affected.d.ts","sourceRoot":"","sources":["../../src/commands/affected.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAC9B,IAAI,EAAE,OAAO,CAAA;CACd;AAED,wBAAsB,WAAW,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CA0BtE"}
|
|
Binary file
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"affected.js","sourceRoot":"","sources":["../../src/commands/affected.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EACL,eAAe,EACf,YAAY,GAEb,MAAM,kCAAkC,CAAA;AAUzC,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,GAAmB;IACnD,MAAM,IAAI,GAAG,YAAY,CAAC,GAAG,CAAC,CAAA;IAC9B,MAAM,WAAW,GAAG,mBAAmB,CAAC,IAAI,CAAC,CAAA;IAC7C,IAAI,CAAC,WAAW,CAAC,EAAE,EAAE,CAAC;QACpB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,WAAW,CAAC,KAAK,IAAI,CAAC,CAAA;QACjE,OAAO,CAAC,CAAA;IACV,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC/C,IAAI,MAAM,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAChD,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,WAAW,EAAE,CAAC;YACnC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,8CAA8C,CAAC,CAAC,QAAQ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C,IAAI,CAAC,CAAA;QACjD,CAAC;IACH,CAAC;IACD,IAAI,MAAM,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACtC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,eAAe,CAAC,MAAM,iCAAiC,CAAC,CAAA;QAC3F,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,eAAe,EAAE,CAAC;YACvC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;QACpC,CAAC;IACH,CAAC;AACH,CAAC;AAED,SAAS,WAAW,CAAC,MAAsB;IACzC,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QAChC,KAAK,MAAM,GAAG,IAAI,CAAC,CAAC,UAAU,EAAE,CAAC;YAC/B,IAAI,GAAG,CAAC,QAAQ,KAAK,MAAM;gBAAE,OAAO,CAAC,CAAA;QACvC,CAAC;IACH,CAAC;IACD,OAAO,CAAC,CAAA;AACV,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAwGjD,wBAAsB,OAAO,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAoBlE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -11,25 +11,101 @@ making changes.
|
|
|
11
11
|
|
|
12
12
|
\`\`\`
|
|
13
13
|
.koncept/
|
|
14
|
-
├── concepts/
|
|
15
|
-
├──
|
|
16
|
-
|
|
14
|
+
├── concepts/ YAML files — one concept per file (indexed)
|
|
15
|
+
├── EXAMPLE.yaml Reference concept showing every field. NOT indexed.
|
|
16
|
+
├── index.json Generated by \`koncepto verify\`. Do not hand-edit.
|
|
17
|
+
└── README.md This file.
|
|
17
18
|
\`\`\`
|
|
18
19
|
|
|
20
|
+
## Concept schema (v0.1)
|
|
21
|
+
|
|
22
|
+
Each \`concepts/<id>.yaml\` MUST validate against this shape:
|
|
23
|
+
|
|
24
|
+
| Field | Type | Required | Notes |
|
|
25
|
+
| ------------------ | ------------------------------- | -------- | ------------------------------------------------------------------------- |
|
|
26
|
+
| \`id\` | kebab-case string | yes | Must match \`^[a-z][a-z0-9-]+$\` and be unique across the registry. |
|
|
27
|
+
| \`name\` | string | yes | Human-readable title. |
|
|
28
|
+
| \`type\` | enum | yes | \`behavioral-invariant\` \\| \`architectural-decision\` \\| \`data-flow\` \\| \`ui-pattern\` \\| \`naming-convention\`. |
|
|
29
|
+
| \`status\` | enum | no | \`active\` (default) \\| \`deprecated\` \\| \`superseded\`. |
|
|
30
|
+
| \`description\` | string | yes | Why this concept exists; what changing it would break. |
|
|
31
|
+
| \`source_of_truth\` | { file, symbol? } | yes | The single file (and optionally symbol) that defines the concept. |
|
|
32
|
+
| \`participants\` | [{ file, role, purpose }] | no | Files that participate. \`role\` ∈ \`writer\` \\| \`reader\` \\| \`tester\` \\| \`docs\`. |
|
|
33
|
+
| \`invariants\` | [{ id, description, severity, automated_check }] | no | Properties that MUST hold. \`severity\` ∈ \`high\` \\| \`medium\` \\| \`low\`. |
|
|
34
|
+
| \`risks_if_broken\` | [string] | no | What goes wrong when an invariant is violated. |
|
|
35
|
+
| \`related_concepts\` | [kebab-id] | no | Cross-references to other concept ids in this registry. |
|
|
36
|
+
| \`tags\` | [string] | no | Free-form tags for search/filter. |
|
|
37
|
+
| \`created\` | ISO date string | yes | When the concept was first authored. |
|
|
38
|
+
| \`last_updated\` | ISO date string | yes | When it was last revised. |
|
|
39
|
+
| \`captured_by\` | string | no | Who/what authored it (e.g. \`@alice\`, \`koncepto-trial\`). |
|
|
40
|
+
| \`references\` | [string] | no | External links / file paths providing context. |
|
|
41
|
+
|
|
42
|
+
See \`EXAMPLE.yaml\` (sibling of this README) for a fully-populated reference.
|
|
43
|
+
Full Zod schema: \`@yourtechtribe-labs/koncept-core\` → \`ConceptSchema\`.
|
|
44
|
+
|
|
19
45
|
## Workflow
|
|
20
46
|
|
|
21
|
-
1.
|
|
47
|
+
1. Copy \`EXAMPLE.yaml\` into \`concepts/<your-id>.yaml\` and edit.
|
|
22
48
|
2. Run \`koncepto verify\` to validate parse + cross-refs + paths.
|
|
23
49
|
3. Commit \`.koncept/\` so AI agents and teammates see the graph.
|
|
24
50
|
|
|
25
51
|
Concepts MUST be version-controlled. The index is regenerated, but commit it
|
|
26
52
|
so CI / agents have a fast lookup without re-indexing.
|
|
27
53
|
`;
|
|
54
|
+
const EXAMPLE_TEMPLATE = `# Reference concept — sits OUTSIDE concepts/ so it is not indexed.
|
|
55
|
+
# Copy this file into concepts/<your-id>.yaml and edit.
|
|
56
|
+
#
|
|
57
|
+
# Every required field is filled in; optional fields are commented to show
|
|
58
|
+
# their shape. See ../README.md for field-by-field documentation.
|
|
59
|
+
|
|
60
|
+
id: example-concept
|
|
61
|
+
name: Example concept (rename me)
|
|
62
|
+
type: behavioral-invariant # behavioral-invariant | architectural-decision | data-flow | ui-pattern | naming-convention
|
|
63
|
+
status: active # active (default) | deprecated | superseded
|
|
64
|
+
description: >
|
|
65
|
+
One paragraph explaining the concept. Why does it exist? What invariants
|
|
66
|
+
does it enforce? What would break if a future change violated it?
|
|
67
|
+
|
|
68
|
+
source_of_truth:
|
|
69
|
+
file: src/path/to/canonical.ts
|
|
70
|
+
# symbol: someExportedFunction # optional — narrow to a symbol within the file
|
|
71
|
+
|
|
72
|
+
participants:
|
|
73
|
+
- file: src/path/to/canonical.ts
|
|
74
|
+
role: writer # writer | reader | tester | docs
|
|
75
|
+
purpose: Defines the behavior protected by this concept.
|
|
76
|
+
- file: tests/canonical.test.ts
|
|
77
|
+
role: tester
|
|
78
|
+
purpose: Locks in the invariants below.
|
|
79
|
+
|
|
80
|
+
invariants:
|
|
81
|
+
- id: example-invariant
|
|
82
|
+
description: A property that MUST hold across the participants above.
|
|
83
|
+
severity: high # high | medium | low
|
|
84
|
+
automated_check: false # true if a test/CI rule already enforces this
|
|
85
|
+
|
|
86
|
+
risks_if_broken:
|
|
87
|
+
- What goes wrong if a future change silently violates the invariant.
|
|
88
|
+
|
|
89
|
+
related_concepts: [] # list of kebab-case ids of sibling concepts
|
|
90
|
+
# related_concepts:
|
|
91
|
+
# - some-other-concept
|
|
92
|
+
|
|
93
|
+
tags:
|
|
94
|
+
- example
|
|
95
|
+
- documentation
|
|
96
|
+
|
|
97
|
+
created: '2026-01-01'
|
|
98
|
+
last_updated: '2026-01-01'
|
|
99
|
+
captured_by: koncepto-init
|
|
100
|
+
references:
|
|
101
|
+
- https://example.com/spec
|
|
102
|
+
`;
|
|
28
103
|
export async function runInit(ctx) {
|
|
29
104
|
const root = join(ctx.rootDir, '.koncept');
|
|
30
105
|
const concepts = join(root, 'concepts');
|
|
31
106
|
const indexFile = join(root, 'index.json');
|
|
32
107
|
const readme = join(root, 'README.md');
|
|
108
|
+
const example = join(root, 'EXAMPLE.yaml');
|
|
33
109
|
await mkdir(concepts, { recursive: true });
|
|
34
110
|
if (!(await fileExists(indexFile))) {
|
|
35
111
|
await writeFile(indexFile, '[]\n', 'utf-8');
|
|
@@ -37,6 +113,9 @@ export async function runInit(ctx) {
|
|
|
37
113
|
if (!(await fileExists(readme))) {
|
|
38
114
|
await writeFile(readme, README_TEMPLATE, 'utf-8');
|
|
39
115
|
}
|
|
116
|
+
if (!(await fileExists(example))) {
|
|
117
|
+
await writeFile(example, EXAMPLE_TEMPLATE, 'utf-8');
|
|
118
|
+
}
|
|
40
119
|
process.stdout.write(`koncepto: initialized ${root}\n`);
|
|
41
120
|
return 0;
|
|
42
121
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,MAAM,eAAe,GAAG
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAGhC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDvB,CAAA;AAED,MAAM,gBAAgB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgDxB,CAAA;AAED,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,GAAmB;IAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAA;IAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IACvC,MAAM,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,YAAY,CAAC,CAAA;IAC1C,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,EAAE,WAAW,CAAC,CAAA;IACtC,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,EAAE,cAAc,CAAC,CAAA;IAE1C,MAAM,KAAK,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1C,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC;QACnC,MAAM,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7C,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,CAAA;IACnD,CAAC;IACD,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;QACjC,MAAM,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,OAAO,CAAC,CAAA;IACrD,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,yBAAyB,IAAI,IAAI,CAAC,CAAA;IACvD,OAAO,CAAC,CAAA;AACV,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,IAAI,CAAC,IAAI,CAAC,CAAA;QAChB,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAA;IACd,CAAC;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"verify.d.ts","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAEjD,wBAAsB,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAyCpE"}
|
package/dist/commands/verify.js
CHANGED
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import { indexConcepts, isIndexClean, writeIndex, } from '@yourtechtribe-labs/koncept-core';
|
|
1
|
+
import { indexConcepts, isIndexClean, loadConcepts, suggestLinks, writeIndex, } from '@yourtechtribe-labs/koncept-core';
|
|
2
2
|
export async function runVerify(ctx) {
|
|
3
3
|
const result = await indexConcepts(ctx.rootDir);
|
|
4
4
|
await writeIndex(ctx.rootDir, result.entries);
|
|
5
5
|
const quiet = ctx.flags.quiet === true;
|
|
6
|
+
const wantSuggestions = ctx.flags['no-suggestions'] !== true;
|
|
6
7
|
if (!quiet) {
|
|
7
8
|
process.stdout.write(`koncepto verify: ${result.entries.length} concept(s) indexed\n`);
|
|
8
9
|
}
|
|
9
10
|
if (isIndexClean(result)) {
|
|
10
11
|
if (!quiet)
|
|
11
12
|
process.stdout.write('koncepto verify: ✓ all checks passed\n');
|
|
13
|
+
if (wantSuggestions && !quiet) {
|
|
14
|
+
const loaded = await loadConcepts(ctx.rootDir);
|
|
15
|
+
printSuggestions(suggestLinks(loaded.concepts));
|
|
16
|
+
}
|
|
12
17
|
return 0;
|
|
13
18
|
}
|
|
14
19
|
for (const e of result.errors) {
|
|
@@ -30,4 +35,18 @@ export async function runVerify(ctx) {
|
|
|
30
35
|
}
|
|
31
36
|
return 1;
|
|
32
37
|
}
|
|
38
|
+
function printSuggestions(suggestions) {
|
|
39
|
+
if (suggestions.length === 0)
|
|
40
|
+
return;
|
|
41
|
+
process.stdout.write(`\nSuggestions (${suggestions.length}, not blocking — pass --no-suggestions to silence):\n`);
|
|
42
|
+
for (const s of suggestions) {
|
|
43
|
+
process.stdout.write(` ◦ ${s.a} ↔ ${s.b}\n`);
|
|
44
|
+
if (s.shared_participants.length > 0) {
|
|
45
|
+
process.stdout.write(` shared participants: ${s.shared_participants.join(', ')}\n`);
|
|
46
|
+
}
|
|
47
|
+
if (s.shared_tags.length > 0) {
|
|
48
|
+
process.stdout.write(` shared tags: ${s.shared_tags.join(', ')}\n`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
33
52
|
//# sourceMappingURL=verify.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,aAAa,EACb,YAAY,EACZ,UAAU,
|
|
1
|
+
{"version":3,"file":"verify.js","sourceRoot":"","sources":["../../src/commands/verify.ts"],"names":[],"mappings":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MAAM,GAAG,CAAC,EAAE,CAAC;YACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,8BAA8B,CAAC,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CACnE,CAAA;QACH,CAAC;QACD,IAAI,CAAC,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC7B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC1E,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AA4BA,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,CAAA;CACxC;AAYD,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuBtF"}
|
package/dist/index.js
CHANGED
|
@@ -6,16 +6,20 @@ import { runInit } from './commands/init.js';
|
|
|
6
6
|
import { runVerify } from './commands/verify.js';
|
|
7
7
|
import { runList } from './commands/list.js';
|
|
8
8
|
import { runLink } from './commands/link.js';
|
|
9
|
-
|
|
9
|
+
import { runAffected } from './commands/affected.js';
|
|
10
|
+
import { VERSION } from './version.js';
|
|
10
11
|
const HELP = `koncepto ${VERSION}
|
|
11
12
|
|
|
12
13
|
Usage:
|
|
13
14
|
koncepto init Bootstrap .koncept/ in cwd
|
|
14
15
|
koncepto verify Validate concepts and write index.json
|
|
16
|
+
[--no-suggestions] (suppress auto-link suggestions)
|
|
15
17
|
koncepto list [--type] [--tag] List concepts (with optional filters)
|
|
16
18
|
[--status]
|
|
17
19
|
koncepto link <id> <file> Add a participant to an existing concept
|
|
18
20
|
--role=<r> --purpose=<p>
|
|
21
|
+
koncepto affected [--from <ref>] Report concepts/invariants touched by a diff
|
|
22
|
+
[--files=a,b,c] [--json]
|
|
19
23
|
|
|
20
24
|
Flags:
|
|
21
25
|
--help, --version
|
|
@@ -25,6 +29,7 @@ const COMMANDS = {
|
|
|
25
29
|
verify: runVerify,
|
|
26
30
|
list: runList,
|
|
27
31
|
link: runLink,
|
|
32
|
+
affected: runAffected,
|
|
28
33
|
};
|
|
29
34
|
export async function run(argv, cwd = process.cwd()) {
|
|
30
35
|
const { command, positional, flags } = parseArgs(argv);
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAChD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC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8B,OAAO,MAAM,IAAI,EAAE,CAAC,CAAA;QACvE,OAAO,EAAE,CAAA;IACX,CAAC;IAED,OAAO,OAAO,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAA;AAC9D,CAAC;AAED,MAAM,eAAe,GACnB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS;IAC7B,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAEzD,IAAI,eAAe,EAAE,CAAC;IACpB,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACvB,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;SAClC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;QACtB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACzD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC,CAAC,CAAA;AACN,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,OAAO,EAAE,MAAoB,CAAA"}
|
package/dist/version.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { fileURLToPath } from 'node:url';
|
|
3
|
+
const pkgUrl = new URL('../package.json', import.meta.url);
|
|
4
|
+
const pkg = JSON.parse(readFileSync(fileURLToPath(pkgUrl), 'utf-8'));
|
|
5
|
+
export const VERSION = pkg.version;
|
|
6
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC1D,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,aAAa,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,CAElE,CAAA;AAED,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yourtechtribe-labs/koncept-cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
4
|
"description": "CLI for koncepto — init, verify, list, link operations on .koncept/ concept graphs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"mcp",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"node": ">=18.0.0"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@yourtechtribe-labs/koncept-core": "^0.
|
|
33
|
+
"@yourtechtribe-labs/koncept-core": "^0.2.0-alpha.0",
|
|
34
34
|
"glob": "13.0.6",
|
|
35
35
|
"yaml": "2.8.4"
|
|
36
36
|
},
|