mdkg 0.1.1 → 0.1.2
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 +79 -0
- package/README.md +105 -14
- package/dist/cli.js +564 -15
- package/dist/commands/archive.js +474 -0
- package/dist/commands/bundle.js +743 -0
- package/dist/commands/bundle_import.js +243 -0
- package/dist/commands/capability.js +162 -0
- package/dist/commands/doctor.js +223 -0
- package/dist/commands/format.js +38 -9
- package/dist/commands/index.js +11 -0
- package/dist/commands/init.js +188 -63
- package/dist/commands/init_manifest.js +19 -6
- package/dist/commands/list.js +5 -2
- package/dist/commands/new.js +3 -0
- package/dist/commands/next.js +7 -0
- package/dist/commands/node_card.js +4 -1
- package/dist/commands/pack.js +62 -2
- package/dist/commands/query_output.js +1 -0
- package/dist/commands/search.js +5 -2
- package/dist/commands/show.js +7 -14
- package/dist/commands/skill_mirror.js +22 -0
- package/dist/commands/task.js +3 -0
- package/dist/commands/upgrade.js +24 -1
- package/dist/commands/validate.js +14 -1
- package/dist/commands/work.js +365 -0
- package/dist/commands/workspace.js +12 -2
- package/dist/core/config.js +100 -1
- package/dist/graph/agent_file_types.js +78 -5
- package/dist/graph/archive_file.js +125 -0
- package/dist/graph/archive_integrity.js +66 -0
- package/dist/graph/bundle_imports.js +418 -0
- package/dist/graph/capabilities_index_cache.js +103 -0
- package/dist/graph/capabilities_indexer.js +231 -0
- package/dist/graph/frontmatter.js +19 -0
- package/dist/graph/index_cache.js +21 -4
- package/dist/graph/indexer.js +4 -1
- package/dist/graph/node.js +23 -4
- package/dist/graph/node_body.js +37 -0
- package/dist/graph/skills_indexer.js +8 -3
- package/dist/graph/validate_graph.js +83 -7
- package/dist/graph/visibility.js +214 -0
- package/dist/graph/workspace_files.js +22 -0
- package/dist/init/AGENT_START.md +21 -0
- package/dist/init/CLI_COMMAND_MATRIX.md +56 -3
- package/dist/init/README.md +59 -2
- package/dist/init/config.json +13 -1
- package/dist/init/core/guide.md +6 -2
- package/dist/init/core/rule-3-cli-contract.md +71 -4
- package/dist/init/core/rule-4-repo-safety-and-ignores.md +20 -0
- package/dist/init/core/rule-6-templates-and-schemas.md +7 -0
- package/dist/init/init-manifest.json +19 -14
- package/dist/init/skills/default/build-pack-and-execute-task/SKILL.md +2 -1
- package/dist/init/skills/default/verify-close-and-checkpoint/SKILL.md +26 -0
- package/dist/init/templates/default/archive.md +33 -0
- package/dist/init/templates/default/receipt.md +15 -1
- package/dist/init/templates/default/work.md +6 -1
- package/dist/init/templates/default/work_order.md +15 -1
- package/dist/pack/export_md.js +3 -0
- package/dist/pack/export_xml.js +3 -0
- package/dist/pack/order.js +1 -0
- package/dist/pack/pack.js +3 -13
- package/dist/util/argparse.js +30 -0
- package/dist/util/refs.js +40 -0
- package/dist/util/zip.js +153 -0
- package/package.json +8 -2
package/dist/cli.js
CHANGED
|
@@ -18,6 +18,10 @@ const next_1 = require("./commands/next");
|
|
|
18
18
|
const validate_1 = require("./commands/validate");
|
|
19
19
|
const format_1 = require("./commands/format");
|
|
20
20
|
const doctor_1 = require("./commands/doctor");
|
|
21
|
+
const capability_1 = require("./commands/capability");
|
|
22
|
+
const archive_1 = require("./commands/archive");
|
|
23
|
+
const bundle_1 = require("./commands/bundle");
|
|
24
|
+
const bundle_import_1 = require("./commands/bundle_import");
|
|
21
25
|
const checkpoint_1 = require("./commands/checkpoint");
|
|
22
26
|
const init_1 = require("./commands/init");
|
|
23
27
|
const new_1 = require("./commands/new");
|
|
@@ -26,6 +30,7 @@ const upgrade_1 = require("./commands/upgrade");
|
|
|
26
30
|
const event_1 = require("./commands/event");
|
|
27
31
|
const skill_1 = require("./commands/skill");
|
|
28
32
|
const task_1 = require("./commands/task");
|
|
33
|
+
const work_1 = require("./commands/work");
|
|
29
34
|
const workspace_1 = require("./commands/workspace");
|
|
30
35
|
const profile_1 = require("./pack/profile");
|
|
31
36
|
const errors_1 = require("./util/errors");
|
|
@@ -55,6 +60,10 @@ function printUsage(log) {
|
|
|
55
60
|
log(" search Search nodes by query");
|
|
56
61
|
log(" pack Generate a context pack");
|
|
57
62
|
log(" skill Create, list, show, search, and validate skills");
|
|
63
|
+
log(" capability List, search, and show cached capability surfaces");
|
|
64
|
+
log(" archive Add, list, show, verify, and compress archive sidecars");
|
|
65
|
+
log(" bundle Create, list, show, and verify full graph snapshot bundles");
|
|
66
|
+
log(" work Create and update work contracts, orders, receipts, and artifacts");
|
|
58
67
|
log(" task Start, update, and complete task-like nodes");
|
|
59
68
|
log(" next Suggest the next work item");
|
|
60
69
|
log(" validate Validate frontmatter + graph");
|
|
@@ -67,7 +76,7 @@ function printUsage(log) {
|
|
|
67
76
|
log(" doctor Run install and workspace diagnostics");
|
|
68
77
|
log(" workspace Manage workspaces (ls/add/rm/enable/disable)");
|
|
69
78
|
log("\nQuickstart:");
|
|
70
|
-
log(" mdkg init --
|
|
79
|
+
log(" mdkg init --agent");
|
|
71
80
|
log(" mdkg upgrade");
|
|
72
81
|
log(" mdkg upgrade --apply");
|
|
73
82
|
log(' mdkg new task "..." --status todo --priority 1');
|
|
@@ -80,7 +89,7 @@ function printUsage(log) {
|
|
|
80
89
|
log(' mdkg skill new release-readiness "release readiness audit" --description "use when preparing a release"');
|
|
81
90
|
log(" mdkg skill list --tags stage:plan --json");
|
|
82
91
|
log(" mdkg validate");
|
|
83
|
-
log("\
|
|
92
|
+
log("\nAgent-ready bootstrap:");
|
|
84
93
|
log(" mdkg init --agent");
|
|
85
94
|
log("\nRun `mdkg help <command>` or `mdkg <command> --help` for details.");
|
|
86
95
|
printGlobalOptions(log);
|
|
@@ -90,13 +99,11 @@ function printInitHelp(log) {
|
|
|
90
99
|
log(" mdkg init [options]");
|
|
91
100
|
log("\nOptions:");
|
|
92
101
|
log(" --force Overwrite existing mdkg files");
|
|
93
|
-
log(" --
|
|
94
|
-
log(" --agent Add SOUL/HUMAN/skills/events scaffolding and skill mirrors");
|
|
102
|
+
log(" --agent Create the complete agent bootstrap, skills, events, and mirrors");
|
|
95
103
|
log(" --no-update-ignores Skip default .gitignore/.npmignore updates");
|
|
96
104
|
log(" --update-gitignore Append mdkg ignore entries");
|
|
97
105
|
log(" --update-npmignore Append mdkg ignore entries");
|
|
98
106
|
log(" --update-dockerignore Append mdkg ignore entries");
|
|
99
|
-
log("\nCompatibility flags still supported but not shown in the primary onboarding story.");
|
|
100
107
|
printGlobalOptions(log);
|
|
101
108
|
}
|
|
102
109
|
function printUpgradeHelp(log) {
|
|
@@ -122,6 +129,7 @@ function printNewHelp(log) {
|
|
|
122
129
|
log("\nAgent workflow file types:");
|
|
123
130
|
log(" spec work work_order receipt feedback dispute proposal");
|
|
124
131
|
log(" Use --id <portable-id> with these types for semantic ids like agent.image-worker.");
|
|
132
|
+
log(" Use `mdkg archive add` for archive sidecars instead of `mdkg new archive`.");
|
|
125
133
|
log("\nOptions:");
|
|
126
134
|
log(" --id <portable-id> Explicit id for agent workflow file types");
|
|
127
135
|
log(" --ws <alias> Workspace alias (default root)");
|
|
@@ -148,15 +156,21 @@ function printGuideHelp(log) {
|
|
|
148
156
|
function printWorkspaceHelp(log) {
|
|
149
157
|
log("Usage:");
|
|
150
158
|
log(" mdkg workspace ls [--json]");
|
|
151
|
-
log(" mdkg workspace add <alias> <path> [--mdkg-dir <dir>] [--json]");
|
|
159
|
+
log(" mdkg workspace add <alias> <path> [--mdkg-dir <dir>] [--visibility <level>] [--json]");
|
|
152
160
|
log(" mdkg workspace rm <alias> [--json]");
|
|
153
161
|
log(" mdkg workspace enable <alias> [--json]");
|
|
154
162
|
log(" mdkg workspace disable <alias> [--json]");
|
|
163
|
+
log("\nVisibility levels:");
|
|
164
|
+
log(" private internal public");
|
|
155
165
|
printGlobalOptions(log);
|
|
156
166
|
}
|
|
157
167
|
function printIndexHelp(log) {
|
|
158
168
|
log("Usage:");
|
|
159
169
|
log(" mdkg index [--tolerant]");
|
|
170
|
+
log("\nWrites:");
|
|
171
|
+
log(" - .mdkg/index/global.json");
|
|
172
|
+
log(" - .mdkg/index/skills.json");
|
|
173
|
+
log(" - .mdkg/index/capabilities.json");
|
|
160
174
|
printGlobalOptions(log);
|
|
161
175
|
}
|
|
162
176
|
function printShowHelp(log) {
|
|
@@ -195,6 +209,7 @@ function printPackHelp(log) {
|
|
|
195
209
|
log(" -f, --format <fmt> Output format: md|json|toon|xml (default md)");
|
|
196
210
|
log(" -o, --out <path> Output file path");
|
|
197
211
|
log(" --profile <name> Body profile: standard|concise|headers (default standard)");
|
|
212
|
+
log(" --visibility <level> Filter output: public|internal|private");
|
|
198
213
|
log(" --skills <mode> Skill inclusion: none|auto|<slug,slug,...> (default auto)");
|
|
199
214
|
log(" --skills-depth <mode> Skill body mode: meta|full (default meta)");
|
|
200
215
|
log(" --dry-run Preview selection/order/stats without writing files");
|
|
@@ -207,6 +222,7 @@ function printPackHelp(log) {
|
|
|
207
222
|
log(" mdkg pack --list-profiles");
|
|
208
223
|
log(" mdkg pack task-1");
|
|
209
224
|
log(" mdkg pack task-1 --profile concise --dry-run --stats");
|
|
225
|
+
log(" mdkg pack task-1 --visibility public --dry-run");
|
|
210
226
|
log(" mdkg pack task-1 --skills auto --skills-depth full");
|
|
211
227
|
log(" mdkg pack epic-2 --format json --profile headers");
|
|
212
228
|
printGlobalOptions(log);
|
|
@@ -283,6 +299,153 @@ function printSkillHelp(log, subcommand) {
|
|
|
283
299
|
printGlobalOptions(log);
|
|
284
300
|
}
|
|
285
301
|
}
|
|
302
|
+
function printCapabilityHelp(log, subcommand) {
|
|
303
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
304
|
+
case "list":
|
|
305
|
+
log("Usage:");
|
|
306
|
+
log(" mdkg capability list [--kind <kind>] [--visibility <level>] [--json]");
|
|
307
|
+
log("\nKinds:");
|
|
308
|
+
log(" skill spec work core design");
|
|
309
|
+
printGlobalOptions(log);
|
|
310
|
+
return;
|
|
311
|
+
case "search":
|
|
312
|
+
log("Usage:");
|
|
313
|
+
log(' mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]');
|
|
314
|
+
log("\nKinds:");
|
|
315
|
+
log(" skill spec work core design");
|
|
316
|
+
printGlobalOptions(log);
|
|
317
|
+
return;
|
|
318
|
+
case "show":
|
|
319
|
+
log("Usage:");
|
|
320
|
+
log(" mdkg capability show <id-or-qid-or-slug> [--json]");
|
|
321
|
+
printGlobalOptions(log);
|
|
322
|
+
return;
|
|
323
|
+
default:
|
|
324
|
+
log("Usage:");
|
|
325
|
+
log(" mdkg capability list [--kind <kind>] [--visibility <level>] [--json]");
|
|
326
|
+
log(' mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]');
|
|
327
|
+
log(" mdkg capability show <id-or-qid-or-slug> [--json]");
|
|
328
|
+
log("\nNotes:");
|
|
329
|
+
log(" Capability records are deterministic cache projections from Markdown.");
|
|
330
|
+
log(" Cached kinds: skill, spec, work, core, design.");
|
|
331
|
+
printGlobalOptions(log);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
function printArchiveHelp(log, subcommand) {
|
|
335
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
336
|
+
case "add":
|
|
337
|
+
log("Usage:");
|
|
338
|
+
log(" mdkg archive add <file> [--id <archive.id>] [--kind source|artifact] [--visibility private|internal|public] [--title <title>] [--refs <...>] [--relates <...>] [--json]");
|
|
339
|
+
break;
|
|
340
|
+
case "list":
|
|
341
|
+
log("Usage:");
|
|
342
|
+
log(" mdkg archive list [--kind source|artifact] [--visibility private|internal|public] [--ws <alias>] [--json]");
|
|
343
|
+
break;
|
|
344
|
+
case "show":
|
|
345
|
+
log("Usage:");
|
|
346
|
+
log(" mdkg archive show <id-or-archive-uri> [--ws <alias>] [--json]");
|
|
347
|
+
break;
|
|
348
|
+
case "verify":
|
|
349
|
+
log("Usage:");
|
|
350
|
+
log(" mdkg archive verify [id-or-archive-uri] [--ws <alias>] [--json]");
|
|
351
|
+
break;
|
|
352
|
+
case "compress":
|
|
353
|
+
log("Usage:");
|
|
354
|
+
log(" mdkg archive compress <id-or-archive-uri> [--ws <alias>] [--json]");
|
|
355
|
+
log(" mdkg archive compress --all [--json]");
|
|
356
|
+
break;
|
|
357
|
+
default:
|
|
358
|
+
log("Usage:");
|
|
359
|
+
log(" mdkg archive add <file> [--id <archive.id>] [--kind source|artifact] [--visibility private|internal|public] [--json]");
|
|
360
|
+
log(" mdkg archive list [--kind source|artifact] [--visibility private|internal|public] [--json]");
|
|
361
|
+
log(" mdkg archive show <id-or-archive-uri> [--json]");
|
|
362
|
+
log(" mdkg archive verify [id-or-archive-uri] [--json]");
|
|
363
|
+
log(" mdkg archive compress <id-or-archive-uri|--all> [--json]");
|
|
364
|
+
log("\nNotes:");
|
|
365
|
+
log(" - archive add copies the source, writes a sidecar, and writes a deterministic zip cache");
|
|
366
|
+
log(" - archive visibility defaults to private");
|
|
367
|
+
log(" - archive://<archive.id> refs are validated against local archive sidecars");
|
|
368
|
+
log(" - archive verify checks sidecar and zip payload integrity; missing raw source copies are ok when the zip cache is valid");
|
|
369
|
+
}
|
|
370
|
+
printGlobalOptions(log);
|
|
371
|
+
}
|
|
372
|
+
function printBundleHelp(log, subcommand) {
|
|
373
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
374
|
+
case "import":
|
|
375
|
+
log("Usage:");
|
|
376
|
+
log(" mdkg bundle import add <alias> <bundle-path> [--visibility private|internal|public] [--profile private|public] [--source-path <path>] [--source-repo <ref>] [--max-stale-seconds <seconds>] [--json]");
|
|
377
|
+
log(" mdkg bundle import list [--json]");
|
|
378
|
+
log(" mdkg bundle import rm <alias> [--json]");
|
|
379
|
+
log(" mdkg bundle import enable <alias> [--json]");
|
|
380
|
+
log(" mdkg bundle import disable <alias> [--json]");
|
|
381
|
+
log(" mdkg bundle import verify [alias|--all] [--json]");
|
|
382
|
+
break;
|
|
383
|
+
case "create":
|
|
384
|
+
log("Usage:");
|
|
385
|
+
log(" mdkg bundle create [--profile private|public] [--ws <alias|all>] [--output <path>] [--json]");
|
|
386
|
+
break;
|
|
387
|
+
case "verify":
|
|
388
|
+
log("Usage:");
|
|
389
|
+
log(" mdkg bundle verify [bundle-path] [--json]");
|
|
390
|
+
break;
|
|
391
|
+
case "show":
|
|
392
|
+
log("Usage:");
|
|
393
|
+
log(" mdkg bundle show <bundle-path> [--json]");
|
|
394
|
+
break;
|
|
395
|
+
case "list":
|
|
396
|
+
log("Usage:");
|
|
397
|
+
log(" mdkg bundle list [--json]");
|
|
398
|
+
break;
|
|
399
|
+
default:
|
|
400
|
+
log("Usage:");
|
|
401
|
+
log(" mdkg bundle create [--profile private|public] [--ws <alias|all>] [--output <path>] [--json]");
|
|
402
|
+
log(" mdkg bundle verify [bundle-path] [--json]");
|
|
403
|
+
log(" mdkg bundle show <bundle-path> [--json]");
|
|
404
|
+
log(" mdkg bundle list [--json]");
|
|
405
|
+
log(" mdkg bundle import add/list/rm/enable/disable/verify ...");
|
|
406
|
+
log("\nNotes:");
|
|
407
|
+
log(" - bundles are explicit full .mdkg graph snapshots, not task context packs");
|
|
408
|
+
log(" - bundle imports are read-only graph views projected under their import alias");
|
|
409
|
+
log(" - private is the default profile; public bundles fail closed on private refs");
|
|
410
|
+
log(" - .mdkg/bundles/ is commit-eligible when your repo tracks snapshot bundles");
|
|
411
|
+
}
|
|
412
|
+
printGlobalOptions(log);
|
|
413
|
+
}
|
|
414
|
+
function printWorkHelp(log, subcommand) {
|
|
415
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
416
|
+
case "contract":
|
|
417
|
+
log("Usage:");
|
|
418
|
+
log(' mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--required-capabilities <...>] [--pricing-model <...>] [--json]');
|
|
419
|
+
break;
|
|
420
|
+
case "order":
|
|
421
|
+
log("Usage:");
|
|
422
|
+
log(' mdkg work order new "<title>" --id <order.id> --work-id <work.id> --requester <ref> [--request-ref <ref>] [--input-refs <...>] [--requested-outputs <...>] [--json]');
|
|
423
|
+
log(" mdkg work order update <id-or-qid> [--status <status>] [--add-input-refs <...>] [--add-artifacts <...>] [--json]");
|
|
424
|
+
break;
|
|
425
|
+
case "receipt":
|
|
426
|
+
log("Usage:");
|
|
427
|
+
log(' mdkg work receipt new "<title>" --id <receipt.id> --work-order-id <order.id> --outcome success|partial|failure [--receipt-status recorded|verified|rejected|superseded] [--json]');
|
|
428
|
+
log(" mdkg work receipt update <id-or-qid> [--receipt-status <status>] [--add-artifacts <...>] [--add-proof-refs <...>] [--add-attestation-refs <...>] [--json]");
|
|
429
|
+
break;
|
|
430
|
+
case "artifact":
|
|
431
|
+
log("Usage:");
|
|
432
|
+
log(" mdkg work artifact add <order-or-receipt-id-or-qid> <file> [--id <archive.id>] [--kind source|artifact] [--json]");
|
|
433
|
+
break;
|
|
434
|
+
default:
|
|
435
|
+
log("Usage:");
|
|
436
|
+
log(" mdkg work contract new ...");
|
|
437
|
+
log(" mdkg work order new|update ...");
|
|
438
|
+
log(" mdkg work receipt new|update ...");
|
|
439
|
+
log(" mdkg work artifact add ...");
|
|
440
|
+
log("\nNotes:");
|
|
441
|
+
log(" - work commands mutate semantic mirror files only");
|
|
442
|
+
log(" - production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg");
|
|
443
|
+
log(" - do not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in work mirrors");
|
|
444
|
+
log(" - artifact:// refs identify external/runtime-managed artifacts; archive:// refs identify committed mdkg archive sidecars");
|
|
445
|
+
log(" - update and artifact commands accept local ids or local qids; imported bundle qids are read-only");
|
|
446
|
+
}
|
|
447
|
+
printGlobalOptions(log);
|
|
448
|
+
}
|
|
286
449
|
function printTaskHelp(log, subcommand) {
|
|
287
450
|
switch ((subcommand ?? "").toLowerCase()) {
|
|
288
451
|
case "start":
|
|
@@ -376,7 +539,11 @@ function printDoctorHelp(log) {
|
|
|
376
539
|
log(" - Node.js version compatibility");
|
|
377
540
|
log(" - mdkg repo root + .mdkg/config.json");
|
|
378
541
|
log(" - Template schema availability");
|
|
542
|
+
log(" - Archive sidecar storage hygiene");
|
|
543
|
+
log(" - Bundle snapshot storage guidance");
|
|
544
|
+
log(" - Bundle import health and staleness");
|
|
379
545
|
log(" - Index load/rebuild health");
|
|
546
|
+
log(" - Capability cache load/rebuild health");
|
|
380
547
|
log("\nOptions:");
|
|
381
548
|
log(" --json Emit machine-readable JSON output");
|
|
382
549
|
printGlobalOptions(log);
|
|
@@ -420,6 +587,18 @@ function printCommandHelp(log, command, subcommand) {
|
|
|
420
587
|
case "skill":
|
|
421
588
|
printSkillHelp(log, subcommand);
|
|
422
589
|
return;
|
|
590
|
+
case "capability":
|
|
591
|
+
printCapabilityHelp(log, subcommand);
|
|
592
|
+
return;
|
|
593
|
+
case "archive":
|
|
594
|
+
printArchiveHelp(log, subcommand);
|
|
595
|
+
return;
|
|
596
|
+
case "bundle":
|
|
597
|
+
printBundleHelp(log, subcommand);
|
|
598
|
+
return;
|
|
599
|
+
case "work":
|
|
600
|
+
printWorkHelp(log, subcommand);
|
|
601
|
+
return;
|
|
423
602
|
case "task":
|
|
424
603
|
printTaskHelp(log, subcommand);
|
|
425
604
|
return;
|
|
@@ -614,8 +793,9 @@ function runWorkspaceSubcommand(parsed, root) {
|
|
|
614
793
|
throw new errors_1.UsageError("workspace add requires <alias> <path>");
|
|
615
794
|
}
|
|
616
795
|
const mdkgDir = requireFlagValue("--mdkg-dir", parsed.flags["--mdkg-dir"]);
|
|
796
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
617
797
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
618
|
-
(0, workspace_1.runWorkspaceAddCommand)({ root, alias, workspacePath, mdkgDir, json });
|
|
798
|
+
(0, workspace_1.runWorkspaceAddCommand)({ root, alias, workspacePath, mdkgDir, visibility, json });
|
|
619
799
|
return 0;
|
|
620
800
|
}
|
|
621
801
|
case "rm": {
|
|
@@ -649,6 +829,369 @@ function runWorkspaceSubcommand(parsed, root) {
|
|
|
649
829
|
throw new errors_1.UsageError("workspace requires ls/add/rm/enable/disable");
|
|
650
830
|
}
|
|
651
831
|
}
|
|
832
|
+
function runCapabilitySubcommand(parsed, root) {
|
|
833
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
834
|
+
switch (subcommand) {
|
|
835
|
+
case "list": {
|
|
836
|
+
if (parsed.positionals.length > 2) {
|
|
837
|
+
throw new errors_1.UsageError("capability list does not accept positional arguments");
|
|
838
|
+
}
|
|
839
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
840
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
841
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
842
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
843
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
844
|
+
(0, capability_1.runCapabilityListCommand)({ root, kind, visibility, json, noCache, noReindex });
|
|
845
|
+
return 0;
|
|
846
|
+
}
|
|
847
|
+
case "search": {
|
|
848
|
+
if (parsed.positionals.length < 3) {
|
|
849
|
+
throw new errors_1.UsageError("capability search requires a query");
|
|
850
|
+
}
|
|
851
|
+
const query = parsed.positionals.slice(2).join(" ");
|
|
852
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
853
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
854
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
855
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
856
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
857
|
+
(0, capability_1.runCapabilitySearchCommand)({ root, query, kind, visibility, json, noCache, noReindex });
|
|
858
|
+
return 0;
|
|
859
|
+
}
|
|
860
|
+
case "show": {
|
|
861
|
+
const id = parsed.positionals[2];
|
|
862
|
+
if (!id || parsed.positionals.length > 3) {
|
|
863
|
+
throw new errors_1.UsageError("capability show requires <id-or-qid-or-slug>");
|
|
864
|
+
}
|
|
865
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
866
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
867
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
868
|
+
(0, capability_1.runCapabilityShowCommand)({ root, id, json, noCache, noReindex });
|
|
869
|
+
return 0;
|
|
870
|
+
}
|
|
871
|
+
default:
|
|
872
|
+
throw new errors_1.UsageError("capability requires list/search/show");
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
function runArchiveSubcommand(parsed, root) {
|
|
876
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
877
|
+
switch (subcommand) {
|
|
878
|
+
case "add": {
|
|
879
|
+
const file = parsed.positionals[2];
|
|
880
|
+
if (!file || parsed.positionals.length > 3) {
|
|
881
|
+
throw new errors_1.UsageError("archive add requires <file>");
|
|
882
|
+
}
|
|
883
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
884
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
885
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
886
|
+
const title = requireFlagValue("--title", parsed.flags["--title"]);
|
|
887
|
+
const refs = requireFlagValue("--refs", parsed.flags["--refs"]);
|
|
888
|
+
const relates = requireFlagValue("--relates", parsed.flags["--relates"]);
|
|
889
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
890
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
891
|
+
(0, archive_1.runArchiveAddCommand)({ root, file, id, ws, kind, title, refs, relates, visibility, json });
|
|
892
|
+
return 0;
|
|
893
|
+
}
|
|
894
|
+
case "list": {
|
|
895
|
+
if (parsed.positionals.length > 2) {
|
|
896
|
+
throw new errors_1.UsageError("archive list does not accept positional arguments");
|
|
897
|
+
}
|
|
898
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
899
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
900
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
901
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
902
|
+
(0, archive_1.runArchiveListCommand)({ root, ws, kind, visibility, json });
|
|
903
|
+
return 0;
|
|
904
|
+
}
|
|
905
|
+
case "show": {
|
|
906
|
+
const id = parsed.positionals[2];
|
|
907
|
+
if (!id || parsed.positionals.length > 3) {
|
|
908
|
+
throw new errors_1.UsageError("archive show requires <id-or-archive-uri>");
|
|
909
|
+
}
|
|
910
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
911
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
912
|
+
(0, archive_1.runArchiveShowCommand)({ root, id, ws, json });
|
|
913
|
+
return 0;
|
|
914
|
+
}
|
|
915
|
+
case "verify": {
|
|
916
|
+
if (parsed.positionals.length > 3) {
|
|
917
|
+
throw new errors_1.UsageError("archive verify accepts at most one id");
|
|
918
|
+
}
|
|
919
|
+
const id = parsed.positionals[2];
|
|
920
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
921
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
922
|
+
(0, archive_1.runArchiveVerifyCommand)({ root, id, ws, json });
|
|
923
|
+
return 0;
|
|
924
|
+
}
|
|
925
|
+
case "compress": {
|
|
926
|
+
if (parsed.positionals.length > 3) {
|
|
927
|
+
throw new errors_1.UsageError("archive compress accepts at most one id");
|
|
928
|
+
}
|
|
929
|
+
const id = parsed.positionals[2];
|
|
930
|
+
const all = parseBooleanFlag("--all", parsed.flags["--all"]);
|
|
931
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
932
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
933
|
+
(0, archive_1.runArchiveCompressCommand)({ root, id, all, ws, json });
|
|
934
|
+
return 0;
|
|
935
|
+
}
|
|
936
|
+
default:
|
|
937
|
+
throw new errors_1.UsageError("archive requires add/list/show/verify/compress");
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function runBundleSubcommand(parsed, root) {
|
|
941
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
942
|
+
switch (subcommand) {
|
|
943
|
+
case "import": {
|
|
944
|
+
const action = (parsed.positionals[2] ?? "").toLowerCase();
|
|
945
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
946
|
+
switch (action) {
|
|
947
|
+
case "add": {
|
|
948
|
+
const alias = parsed.positionals[3];
|
|
949
|
+
const bundlePath = parsed.positionals[4];
|
|
950
|
+
if (!alias || !bundlePath || parsed.positionals.length > 5) {
|
|
951
|
+
throw new errors_1.UsageError("bundle import add requires <alias> <bundle-path>");
|
|
952
|
+
}
|
|
953
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
954
|
+
const profile = requireFlagValue("--profile", parsed.flags["--pack-profile"]);
|
|
955
|
+
const sourcePath = requireFlagValue("--source-path", parsed.flags["--source-path"]);
|
|
956
|
+
const sourceRepo = requireFlagValue("--source-repo", parsed.flags["--source-repo"]);
|
|
957
|
+
const maxStaleRaw = requireFlagValue("--max-stale-seconds", parsed.flags["--max-stale-seconds"]);
|
|
958
|
+
const maxStaleSeconds = maxStaleRaw === undefined ? undefined : Number.parseInt(maxStaleRaw, 10);
|
|
959
|
+
(0, bundle_import_1.runBundleImportAddCommand)({
|
|
960
|
+
root,
|
|
961
|
+
alias,
|
|
962
|
+
bundlePath,
|
|
963
|
+
visibility,
|
|
964
|
+
profile,
|
|
965
|
+
sourcePath,
|
|
966
|
+
sourceRepo,
|
|
967
|
+
maxStaleSeconds,
|
|
968
|
+
json,
|
|
969
|
+
});
|
|
970
|
+
return 0;
|
|
971
|
+
}
|
|
972
|
+
case "list": {
|
|
973
|
+
if (parsed.positionals.length > 3) {
|
|
974
|
+
throw new errors_1.UsageError("bundle import list does not accept positional arguments");
|
|
975
|
+
}
|
|
976
|
+
(0, bundle_import_1.runBundleImportListCommand)({ root, json });
|
|
977
|
+
return 0;
|
|
978
|
+
}
|
|
979
|
+
case "rm":
|
|
980
|
+
case "remove": {
|
|
981
|
+
const alias = parsed.positionals[3];
|
|
982
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
983
|
+
throw new errors_1.UsageError("bundle import rm requires <alias>");
|
|
984
|
+
}
|
|
985
|
+
(0, bundle_import_1.runBundleImportRemoveCommand)({ root, alias, json });
|
|
986
|
+
return 0;
|
|
987
|
+
}
|
|
988
|
+
case "enable": {
|
|
989
|
+
const alias = parsed.positionals[3];
|
|
990
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
991
|
+
throw new errors_1.UsageError("bundle import enable requires <alias>");
|
|
992
|
+
}
|
|
993
|
+
(0, bundle_import_1.runBundleImportEnableCommand)({ root, alias, json });
|
|
994
|
+
return 0;
|
|
995
|
+
}
|
|
996
|
+
case "disable": {
|
|
997
|
+
const alias = parsed.positionals[3];
|
|
998
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
999
|
+
throw new errors_1.UsageError("bundle import disable requires <alias>");
|
|
1000
|
+
}
|
|
1001
|
+
(0, bundle_import_1.runBundleImportDisableCommand)({ root, alias, json });
|
|
1002
|
+
return 0;
|
|
1003
|
+
}
|
|
1004
|
+
case "verify": {
|
|
1005
|
+
if (parsed.positionals.length > 4) {
|
|
1006
|
+
throw new errors_1.UsageError("bundle import verify accepts at most one alias");
|
|
1007
|
+
}
|
|
1008
|
+
const alias = parsed.positionals[3];
|
|
1009
|
+
const all = parseBooleanFlag("--all", parsed.flags["--all"]);
|
|
1010
|
+
(0, bundle_import_1.runBundleImportVerifyCommand)({ root, alias, all, json });
|
|
1011
|
+
return 0;
|
|
1012
|
+
}
|
|
1013
|
+
default:
|
|
1014
|
+
throw new errors_1.UsageError("bundle import requires add/list/rm/enable/disable/verify");
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
case "create": {
|
|
1018
|
+
if (parsed.positionals.length > 2) {
|
|
1019
|
+
throw new errors_1.UsageError("bundle create does not accept positional arguments");
|
|
1020
|
+
}
|
|
1021
|
+
const profile = requireFlagValue("--profile", parsed.flags["--pack-profile"]);
|
|
1022
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
1023
|
+
const output = requireFlagValue("--output", parsed.flags["--out"]);
|
|
1024
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1025
|
+
(0, bundle_1.runBundleCreateCommand)({ root, profile, ws, output, json });
|
|
1026
|
+
return 0;
|
|
1027
|
+
}
|
|
1028
|
+
case "verify": {
|
|
1029
|
+
if (parsed.positionals.length > 3) {
|
|
1030
|
+
throw new errors_1.UsageError("bundle verify accepts at most one bundle path");
|
|
1031
|
+
}
|
|
1032
|
+
const bundlePath = parsed.positionals[2];
|
|
1033
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1034
|
+
(0, bundle_1.runBundleVerifyCommand)({ root, bundlePath, json });
|
|
1035
|
+
return 0;
|
|
1036
|
+
}
|
|
1037
|
+
case "show": {
|
|
1038
|
+
const bundlePath = parsed.positionals[2];
|
|
1039
|
+
if (!bundlePath || parsed.positionals.length > 3) {
|
|
1040
|
+
throw new errors_1.UsageError("bundle show requires <bundle-path>");
|
|
1041
|
+
}
|
|
1042
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1043
|
+
(0, bundle_1.runBundleShowCommand)({ root, bundlePath, json });
|
|
1044
|
+
return 0;
|
|
1045
|
+
}
|
|
1046
|
+
case "list": {
|
|
1047
|
+
if (parsed.positionals.length > 2) {
|
|
1048
|
+
throw new errors_1.UsageError("bundle list does not accept positional arguments");
|
|
1049
|
+
}
|
|
1050
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1051
|
+
(0, bundle_1.runBundleListCommand)({ root, json });
|
|
1052
|
+
return 0;
|
|
1053
|
+
}
|
|
1054
|
+
default:
|
|
1055
|
+
throw new errors_1.UsageError("bundle requires create/list/show/verify/import");
|
|
1056
|
+
}
|
|
1057
|
+
}
|
|
1058
|
+
function runWorkSubcommand(parsed, root) {
|
|
1059
|
+
const domain = (parsed.positionals[1] ?? "").toLowerCase();
|
|
1060
|
+
const action = (parsed.positionals[2] ?? "").toLowerCase();
|
|
1061
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
1062
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1063
|
+
if (domain === "contract" && action === "new") {
|
|
1064
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1065
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1066
|
+
const agentId = requireFlagValue("--agent-id", parsed.flags["--agent-id"]);
|
|
1067
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
1068
|
+
const inputs = requireFlagValue("--inputs", parsed.flags["--inputs"]);
|
|
1069
|
+
const outputs = requireFlagValue("--outputs", parsed.flags["--outputs"]);
|
|
1070
|
+
if (!title || !id || !agentId || !kind || !inputs || !outputs) {
|
|
1071
|
+
throw new errors_1.UsageError("work contract new requires title, --id, --agent-id, --kind, --inputs, and --outputs");
|
|
1072
|
+
}
|
|
1073
|
+
const requiredCapabilities = requireFlagValue("--required-capabilities", parsed.flags["--required-capabilities"]);
|
|
1074
|
+
const pricingModel = requireFlagValue("--pricing-model", parsed.flags["--pricing-model"]);
|
|
1075
|
+
(0, work_1.runWorkContractNewCommand)({
|
|
1076
|
+
root,
|
|
1077
|
+
ws,
|
|
1078
|
+
title,
|
|
1079
|
+
id,
|
|
1080
|
+
agentId,
|
|
1081
|
+
kind,
|
|
1082
|
+
inputs,
|
|
1083
|
+
outputs,
|
|
1084
|
+
requiredCapabilities,
|
|
1085
|
+
pricingModel,
|
|
1086
|
+
json,
|
|
1087
|
+
});
|
|
1088
|
+
return 0;
|
|
1089
|
+
}
|
|
1090
|
+
if (domain === "order" && action === "new") {
|
|
1091
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1092
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1093
|
+
const workId = requireFlagValue("--work-id", parsed.flags["--work-id"]);
|
|
1094
|
+
const requester = requireFlagValue("--requester", parsed.flags["--requester"]);
|
|
1095
|
+
if (!title || !id || !workId || !requester) {
|
|
1096
|
+
throw new errors_1.UsageError("work order new requires title, --id, --work-id, and --requester");
|
|
1097
|
+
}
|
|
1098
|
+
const requestRef = requireFlagValue("--request-ref", parsed.flags["--request-ref"]);
|
|
1099
|
+
const inputRefs = requireFlagValue("--input-refs", parsed.flags["--input-refs"]);
|
|
1100
|
+
const requestedOutputs = requireFlagValue("--requested-outputs", parsed.flags["--requested-outputs"]);
|
|
1101
|
+
const constraintRefs = requireFlagValue("--constraint-refs", parsed.flags["--constraint-refs"]);
|
|
1102
|
+
(0, work_1.runWorkOrderNewCommand)({
|
|
1103
|
+
root,
|
|
1104
|
+
ws,
|
|
1105
|
+
title,
|
|
1106
|
+
id,
|
|
1107
|
+
workId,
|
|
1108
|
+
requester,
|
|
1109
|
+
requestRef,
|
|
1110
|
+
inputRefs,
|
|
1111
|
+
requestedOutputs,
|
|
1112
|
+
constraintRefs,
|
|
1113
|
+
json,
|
|
1114
|
+
});
|
|
1115
|
+
return 0;
|
|
1116
|
+
}
|
|
1117
|
+
if (domain === "order" && action === "update") {
|
|
1118
|
+
const id = parsed.positionals[3];
|
|
1119
|
+
if (!id || parsed.positionals.length > 4) {
|
|
1120
|
+
throw new errors_1.UsageError("work order update requires <id-or-qid>");
|
|
1121
|
+
}
|
|
1122
|
+
const status = requireFlagValue("--status", parsed.flags["--status"]);
|
|
1123
|
+
const addInputRefs = requireFlagValue("--add-input-refs", parsed.flags["--add-input-refs"]);
|
|
1124
|
+
const addArtifacts = requireFlagValue("--add-artifacts", parsed.flags["--add-artifacts"]);
|
|
1125
|
+
(0, work_1.runWorkOrderUpdateCommand)({ root, ws, id, status, addInputRefs, addArtifacts, json });
|
|
1126
|
+
return 0;
|
|
1127
|
+
}
|
|
1128
|
+
if (domain === "receipt" && action === "new") {
|
|
1129
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1130
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1131
|
+
const workOrderId = requireFlagValue("--work-order-id", parsed.flags["--work-order-id"]);
|
|
1132
|
+
const outcome = requireFlagValue("--outcome", parsed.flags["--outcome"]);
|
|
1133
|
+
if (!title || !id || !workOrderId || !outcome) {
|
|
1134
|
+
throw new errors_1.UsageError("work receipt new requires title, --id, --work-order-id, and --outcome");
|
|
1135
|
+
}
|
|
1136
|
+
const receiptStatus = requireFlagValue("--receipt-status", parsed.flags["--receipt-status"]);
|
|
1137
|
+
const costRef = requireFlagValue("--cost-ref", parsed.flags["--cost-ref"]);
|
|
1138
|
+
const artifacts = requireFlagValue("--artifacts", parsed.flags["--artifacts"]);
|
|
1139
|
+
const proofRefs = requireFlagValue("--proof-refs", parsed.flags["--proof-refs"]);
|
|
1140
|
+
const attestationRefs = requireFlagValue("--attestation-refs", parsed.flags["--attestation-refs"]);
|
|
1141
|
+
const inputHashes = requireFlagValue("--input-hashes", parsed.flags["--input-hashes"]);
|
|
1142
|
+
const outputHashes = requireFlagValue("--output-hashes", parsed.flags["--output-hashes"]);
|
|
1143
|
+
(0, work_1.runWorkReceiptNewCommand)({
|
|
1144
|
+
root,
|
|
1145
|
+
ws,
|
|
1146
|
+
title,
|
|
1147
|
+
id,
|
|
1148
|
+
workOrderId,
|
|
1149
|
+
outcome,
|
|
1150
|
+
receiptStatus,
|
|
1151
|
+
costRef,
|
|
1152
|
+
artifacts,
|
|
1153
|
+
proofRefs,
|
|
1154
|
+
attestationRefs,
|
|
1155
|
+
inputHashes,
|
|
1156
|
+
outputHashes,
|
|
1157
|
+
json,
|
|
1158
|
+
});
|
|
1159
|
+
return 0;
|
|
1160
|
+
}
|
|
1161
|
+
if (domain === "receipt" && action === "update") {
|
|
1162
|
+
const id = parsed.positionals[3];
|
|
1163
|
+
if (!id || parsed.positionals.length > 4) {
|
|
1164
|
+
throw new errors_1.UsageError("work receipt update requires <id-or-qid>");
|
|
1165
|
+
}
|
|
1166
|
+
const receiptStatus = requireFlagValue("--receipt-status", parsed.flags["--receipt-status"]);
|
|
1167
|
+
const addArtifacts = requireFlagValue("--add-artifacts", parsed.flags["--add-artifacts"]);
|
|
1168
|
+
const addProofRefs = requireFlagValue("--add-proof-refs", parsed.flags["--add-proof-refs"]);
|
|
1169
|
+
const addAttestationRefs = requireFlagValue("--add-attestation-refs", parsed.flags["--add-attestation-refs"]);
|
|
1170
|
+
(0, work_1.runWorkReceiptUpdateCommand)({
|
|
1171
|
+
root,
|
|
1172
|
+
ws,
|
|
1173
|
+
id,
|
|
1174
|
+
receiptStatus,
|
|
1175
|
+
addArtifacts,
|
|
1176
|
+
addProofRefs,
|
|
1177
|
+
addAttestationRefs,
|
|
1178
|
+
json,
|
|
1179
|
+
});
|
|
1180
|
+
return 0;
|
|
1181
|
+
}
|
|
1182
|
+
if (domain === "artifact" && action === "add") {
|
|
1183
|
+
const targetId = parsed.positionals[3];
|
|
1184
|
+
const file = parsed.positionals[4];
|
|
1185
|
+
if (!targetId || !file || parsed.positionals.length > 5) {
|
|
1186
|
+
throw new errors_1.UsageError("work artifact add requires <order-or-receipt-id-or-qid> <file>");
|
|
1187
|
+
}
|
|
1188
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1189
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
1190
|
+
(0, work_1.runWorkArtifactAddCommand)({ root, ws, targetId, file, id, kind, json });
|
|
1191
|
+
return 0;
|
|
1192
|
+
}
|
|
1193
|
+
throw new errors_1.UsageError("work requires contract new, order new/update, receipt new/update, or artifact add");
|
|
1194
|
+
}
|
|
652
1195
|
function runSkillSubcommand(parsed, root) {
|
|
653
1196
|
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
654
1197
|
switch (subcommand) {
|
|
@@ -906,11 +1449,10 @@ function runCommand(parsed, root, runtime) {
|
|
|
906
1449
|
switch (command) {
|
|
907
1450
|
case "init": {
|
|
908
1451
|
const force = parseBooleanFlag("--force", parsed.flags["--force"]);
|
|
909
|
-
const
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
throw new errors_1.UsageError("`mdkg init --omni` was removed; use `mdkg init --agent`");
|
|
1452
|
+
for (const removedFlag of ["--llm", "--agents", "--claude", "--omni"]) {
|
|
1453
|
+
if (parsed.flags[removedFlag] !== undefined) {
|
|
1454
|
+
throw new errors_1.UsageError(`\`mdkg init ${removedFlag}\` was removed; use \`mdkg init --agent\``);
|
|
1455
|
+
}
|
|
914
1456
|
}
|
|
915
1457
|
const agent = parseBooleanFlag("--agent", parsed.flags["--agent"]);
|
|
916
1458
|
const noUpdateIgnores = parseBooleanFlag("--no-update-ignores", parsed.flags["--no-update-ignores"]);
|
|
@@ -924,9 +1466,6 @@ function runCommand(parsed, root, runtime) {
|
|
|
924
1466
|
updateNpmignore,
|
|
925
1467
|
updateDockerignore,
|
|
926
1468
|
noUpdateIgnores,
|
|
927
|
-
createAgents,
|
|
928
|
-
createClaude,
|
|
929
|
-
createLlm,
|
|
930
1469
|
agent,
|
|
931
1470
|
});
|
|
932
1471
|
return 0;
|
|
@@ -1019,6 +1558,14 @@ function runCommand(parsed, root, runtime) {
|
|
|
1019
1558
|
return runWorkspaceSubcommand(parsed, root);
|
|
1020
1559
|
case "skill":
|
|
1021
1560
|
return runSkillSubcommand(parsed, root);
|
|
1561
|
+
case "capability":
|
|
1562
|
+
return runCapabilitySubcommand(parsed, root);
|
|
1563
|
+
case "archive":
|
|
1564
|
+
return runArchiveSubcommand(parsed, root);
|
|
1565
|
+
case "bundle":
|
|
1566
|
+
return runBundleSubcommand(parsed, root);
|
|
1567
|
+
case "work":
|
|
1568
|
+
return runWorkSubcommand(parsed, root);
|
|
1022
1569
|
case "task":
|
|
1023
1570
|
return runTaskSubcommand(parsed, root);
|
|
1024
1571
|
case "event":
|
|
@@ -1129,6 +1676,7 @@ function runCommand(parsed, root, runtime) {
|
|
|
1129
1676
|
const maxTokens = parseNumberFlag("--max-tokens", parsed.flags["--max-tokens"]);
|
|
1130
1677
|
const skills = requireFlagValue("--skills", parsed.flags["--skills"]);
|
|
1131
1678
|
const skillsDepth = requireFlagValue("--skills-depth", parsed.flags["--skills-depth"]);
|
|
1679
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
1132
1680
|
const dryRun = parseBooleanFlag("--dry-run", parsed.flags["--dry-run"]);
|
|
1133
1681
|
const stats = parseBooleanFlag("--stats", parsed.flags["--stats"]);
|
|
1134
1682
|
const statsOut = requireFlagValue("--stats-out", parsed.flags["--stats-out"]);
|
|
@@ -1153,6 +1701,7 @@ function runCommand(parsed, root, runtime) {
|
|
|
1153
1701
|
maxTokens,
|
|
1154
1702
|
skills,
|
|
1155
1703
|
skillsDepth,
|
|
1704
|
+
visibility,
|
|
1156
1705
|
dryRun,
|
|
1157
1706
|
stats,
|
|
1158
1707
|
statsOut,
|