mdkg 0.2.0 → 0.3.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/CHANGELOG.md +87 -1
- package/CLI_COMMAND_MATRIX.md +1176 -0
- package/README.md +58 -5
- package/dist/cli.js +267 -12
- package/dist/command-contract.json +7473 -0
- package/dist/commands/capability.js +13 -8
- package/dist/commands/doctor.js +370 -86
- package/dist/commands/fix.js +924 -0
- package/dist/commands/format.js +9 -3
- package/dist/commands/skill.js +13 -3
- package/dist/commands/skill_support.js +3 -3
- package/dist/commands/spec.js +101 -0
- package/dist/commands/status.js +270 -0
- package/dist/commands/subgraph.js +300 -0
- package/dist/commands/validate.js +1 -1
- package/dist/commands/work.js +569 -20
- package/dist/commands/workspace.js +19 -7
- package/dist/graph/agent_file_types.js +95 -7
- package/dist/graph/capabilities_indexer.js +89 -2
- package/dist/graph/frontmatter.js +6 -0
- package/dist/graph/node.js +8 -2
- package/dist/init/AGENT_START.md +5 -1
- package/dist/init/CLI_COMMAND_MATRIX.md +36 -0
- package/dist/init/README.md +41 -2
- package/dist/init/init-manifest.json +20 -20
- package/dist/init/templates/default/receipt.md +12 -1
- package/dist/init/templates/default/spec.md +8 -6
- package/dist/init/templates/default/work.md +5 -1
- package/dist/init/templates/default/work_order.md +11 -0
- package/dist/init/templates/specs/agent.SPEC.md +45 -4
- package/dist/init/templates/specs/api.SPEC.md +1 -0
- package/dist/init/templates/specs/base.SPEC.md +45 -12
- package/dist/init/templates/specs/capability.SPEC.md +16 -3
- package/dist/init/templates/specs/integration.SPEC.md +1 -0
- package/dist/init/templates/specs/model.SPEC.md +1 -0
- package/dist/init/templates/specs/project.SPEC.md +14 -1
- package/dist/init/templates/specs/{omniruntime-agent.SPEC.md → runtime-agent.SPEC.md} +13 -3
- package/dist/init/templates/specs/runtime-image.SPEC.md +1 -0
- package/dist/init/templates/specs/tool.SPEC.md +1 -0
- package/dist/util/argparse.js +9 -0
- package/package.json +12 -3
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadCapabilityRecords = loadCapabilityRecords;
|
|
4
|
+
exports.filterCapabilityRecords = filterCapabilityRecords;
|
|
5
|
+
exports.resolveCapabilityRecord = resolveCapabilityRecord;
|
|
3
6
|
exports.runCapabilityListCommand = runCapabilityListCommand;
|
|
4
7
|
exports.runCapabilitySearchCommand = runCapabilitySearchCommand;
|
|
5
8
|
exports.runCapabilityShowCommand = runCapabilityShowCommand;
|
|
@@ -29,7 +32,7 @@ function normalizeVisibility(value) {
|
|
|
29
32
|
}
|
|
30
33
|
throw new errors_1.UsageError(`--visibility must be one of ${capabilities_indexer_1.CAPABILITY_VISIBILITIES.join(", ")}`);
|
|
31
34
|
}
|
|
32
|
-
function
|
|
35
|
+
function loadCapabilityRecords(options) {
|
|
33
36
|
const config = (0, config_1.loadConfig)(options.root);
|
|
34
37
|
const { index, stale, rebuilt } = (0, capabilities_index_cache_1.loadCapabilitiesIndex)({
|
|
35
38
|
root: options.root,
|
|
@@ -46,7 +49,7 @@ function loadRecords(options) {
|
|
|
46
49
|
}
|
|
47
50
|
return [...index.records, ...subgraph.records];
|
|
48
51
|
}
|
|
49
|
-
function
|
|
52
|
+
function filterCapabilityRecords(records, options) {
|
|
50
53
|
const kind = normalizeKind(options.kind);
|
|
51
54
|
const visibility = normalizeVisibility(options.visibility);
|
|
52
55
|
return records.filter((record) => {
|
|
@@ -78,6 +81,7 @@ function capabilitySearchText(record) {
|
|
|
78
81
|
...record.headings.map((heading) => heading.text),
|
|
79
82
|
JSON.stringify(record.spec ?? {}),
|
|
80
83
|
JSON.stringify(record.work ?? {}),
|
|
84
|
+
JSON.stringify(record.linkage ?? {}),
|
|
81
85
|
JSON.stringify(record.skill ?? {}),
|
|
82
86
|
]
|
|
83
87
|
.filter((value) => typeof value === "string" && value.length > 0)
|
|
@@ -117,6 +121,7 @@ function requirementMatch(record, required) {
|
|
|
117
121
|
...record.tags,
|
|
118
122
|
JSON.stringify(record.spec ?? {}),
|
|
119
123
|
JSON.stringify(record.work ?? {}),
|
|
124
|
+
JSON.stringify(record.linkage ?? {}),
|
|
120
125
|
JSON.stringify(record.skill ?? {}),
|
|
121
126
|
]
|
|
122
127
|
.join(" ")
|
|
@@ -199,7 +204,7 @@ function printCapabilityList(records, json, query) {
|
|
|
199
204
|
console.log(`${record.qid} | ${record.kind} | ${record.visibility} | ${label} | ${record.title}`);
|
|
200
205
|
}
|
|
201
206
|
}
|
|
202
|
-
function
|
|
207
|
+
function resolveCapabilityRecord(records, id) {
|
|
203
208
|
const normalized = id.toLowerCase();
|
|
204
209
|
const exact = records.find((record) => record.qid === id || record.id === id);
|
|
205
210
|
if (exact) {
|
|
@@ -233,19 +238,19 @@ function printCapability(record, json) {
|
|
|
233
238
|
console.log(`path: ${record.path}`);
|
|
234
239
|
}
|
|
235
240
|
function runCapabilityListCommand(options) {
|
|
236
|
-
const records =
|
|
241
|
+
const records = filterCapabilityRecords(loadCapabilityRecords(options), options);
|
|
237
242
|
printCapabilityList(records, options.json);
|
|
238
243
|
}
|
|
239
244
|
function runCapabilitySearchCommand(options) {
|
|
240
|
-
const records =
|
|
245
|
+
const records = filterCapabilityRecords(loadCapabilityRecords(options), options).filter((record) => matchesQuery(record, options.query));
|
|
241
246
|
printCapabilityList(records, options.json, options.query);
|
|
242
247
|
}
|
|
243
248
|
function runCapabilityShowCommand(options) {
|
|
244
|
-
const records =
|
|
245
|
-
printCapability(
|
|
249
|
+
const records = loadCapabilityRecords(options);
|
|
250
|
+
printCapability(resolveCapabilityRecord(records, options.id), options.json);
|
|
246
251
|
}
|
|
247
252
|
function runCapabilityResolveCommand(options) {
|
|
248
|
-
const records =
|
|
253
|
+
const records = filterCapabilityRecords(loadCapabilityRecords(options), options);
|
|
249
254
|
const items = resolveCapabilities(records, options).map((record, rank) => ({
|
|
250
255
|
rank: rank + 1,
|
|
251
256
|
score: resolveScore(record, options),
|