mdkg 0.1.1 → 0.1.3
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 +104 -0
- package/README.md +124 -18
- package/dist/cli.js +567 -15
- package/dist/commands/archive.js +486 -0
- package/dist/commands/bundle.js +743 -0
- package/dist/commands/bundle_import.js +255 -0
- package/dist/commands/capability.js +162 -0
- package/dist/commands/checkpoint.js +31 -5
- package/dist/commands/doctor.js +269 -9
- package/dist/commands/format.js +38 -9
- package/dist/commands/index.js +12 -12
- package/dist/commands/init.js +194 -63
- package/dist/commands/init_manifest.js +19 -6
- package/dist/commands/list.js +5 -2
- package/dist/commands/new.js +36 -7
- 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 +23 -6
- package/dist/commands/upgrade.js +24 -1
- package/dist/commands/validate.js +20 -1
- package/dist/commands/work.js +397 -0
- package/dist/commands/workspace.js +12 -2
- package/dist/core/config.js +115 -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 +23 -6
- 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/reindex.js +46 -0
- package/dist/graph/skills_index_cache.js +2 -2
- package/dist/graph/skills_indexer.js +8 -3
- package/dist/graph/sqlite_index.js +293 -0
- 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 +24 -0
- package/dist/init/CLI_COMMAND_MATRIX.md +61 -3
- package/dist/init/README.md +70 -4
- package/dist/init/config.json +18 -2
- package/dist/init/core/guide.md +6 -2
- package/dist/init/core/rule-1-mdkg-conventions.md +2 -1
- package/dist/init/core/rule-3-cli-contract.md +72 -4
- package/dist/init/core/rule-4-repo-safety-and-ignores.md +47 -11
- package/dist/init/core/rule-5-release-and-versioning.md +4 -3
- package/dist/init/core/rule-6-templates-and-schemas.md +7 -0
- package/dist/init/init-manifest.json +21 -16
- 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/atomic.js +44 -0
- package/dist/util/lock.js +72 -0
- package/dist/util/refs.js +40 -0
- package/dist/util/zip.js +153 -0
- package/package.json +14 -5
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,23 @@ 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");
|
|
174
|
+
log(" - .mdkg/index/imports.json when bundle imports are configured");
|
|
175
|
+
log(" - .mdkg/index/mdkg.sqlite when index.backend is sqlite");
|
|
160
176
|
printGlobalOptions(log);
|
|
161
177
|
}
|
|
162
178
|
function printShowHelp(log) {
|
|
@@ -195,6 +211,7 @@ function printPackHelp(log) {
|
|
|
195
211
|
log(" -f, --format <fmt> Output format: md|json|toon|xml (default md)");
|
|
196
212
|
log(" -o, --out <path> Output file path");
|
|
197
213
|
log(" --profile <name> Body profile: standard|concise|headers (default standard)");
|
|
214
|
+
log(" --visibility <level> Filter output: public|internal|private");
|
|
198
215
|
log(" --skills <mode> Skill inclusion: none|auto|<slug,slug,...> (default auto)");
|
|
199
216
|
log(" --skills-depth <mode> Skill body mode: meta|full (default meta)");
|
|
200
217
|
log(" --dry-run Preview selection/order/stats without writing files");
|
|
@@ -207,6 +224,7 @@ function printPackHelp(log) {
|
|
|
207
224
|
log(" mdkg pack --list-profiles");
|
|
208
225
|
log(" mdkg pack task-1");
|
|
209
226
|
log(" mdkg pack task-1 --profile concise --dry-run --stats");
|
|
227
|
+
log(" mdkg pack task-1 --visibility public --dry-run");
|
|
210
228
|
log(" mdkg pack task-1 --skills auto --skills-depth full");
|
|
211
229
|
log(" mdkg pack epic-2 --format json --profile headers");
|
|
212
230
|
printGlobalOptions(log);
|
|
@@ -283,6 +301,153 @@ function printSkillHelp(log, subcommand) {
|
|
|
283
301
|
printGlobalOptions(log);
|
|
284
302
|
}
|
|
285
303
|
}
|
|
304
|
+
function printCapabilityHelp(log, subcommand) {
|
|
305
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
306
|
+
case "list":
|
|
307
|
+
log("Usage:");
|
|
308
|
+
log(" mdkg capability list [--kind <kind>] [--visibility <level>] [--json]");
|
|
309
|
+
log("\nKinds:");
|
|
310
|
+
log(" skill spec work core design");
|
|
311
|
+
printGlobalOptions(log);
|
|
312
|
+
return;
|
|
313
|
+
case "search":
|
|
314
|
+
log("Usage:");
|
|
315
|
+
log(' mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]');
|
|
316
|
+
log("\nKinds:");
|
|
317
|
+
log(" skill spec work core design");
|
|
318
|
+
printGlobalOptions(log);
|
|
319
|
+
return;
|
|
320
|
+
case "show":
|
|
321
|
+
log("Usage:");
|
|
322
|
+
log(" mdkg capability show <id-or-qid-or-slug> [--json]");
|
|
323
|
+
printGlobalOptions(log);
|
|
324
|
+
return;
|
|
325
|
+
default:
|
|
326
|
+
log("Usage:");
|
|
327
|
+
log(" mdkg capability list [--kind <kind>] [--visibility <level>] [--json]");
|
|
328
|
+
log(' mdkg capability search "<query>" [--kind <kind>] [--visibility <level>] [--json]');
|
|
329
|
+
log(" mdkg capability show <id-or-qid-or-slug> [--json]");
|
|
330
|
+
log("\nNotes:");
|
|
331
|
+
log(" Capability records are deterministic cache projections from Markdown.");
|
|
332
|
+
log(" Cached kinds: skill, spec, work, core, design.");
|
|
333
|
+
printGlobalOptions(log);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
function printArchiveHelp(log, subcommand) {
|
|
337
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
338
|
+
case "add":
|
|
339
|
+
log("Usage:");
|
|
340
|
+
log(" mdkg archive add <file> [--id <archive.id>] [--kind source|artifact] [--visibility private|internal|public] [--title <title>] [--refs <...>] [--relates <...>] [--json]");
|
|
341
|
+
break;
|
|
342
|
+
case "list":
|
|
343
|
+
log("Usage:");
|
|
344
|
+
log(" mdkg archive list [--kind source|artifact] [--visibility private|internal|public] [--ws <alias>] [--json]");
|
|
345
|
+
break;
|
|
346
|
+
case "show":
|
|
347
|
+
log("Usage:");
|
|
348
|
+
log(" mdkg archive show <id-or-archive-uri> [--ws <alias>] [--json]");
|
|
349
|
+
break;
|
|
350
|
+
case "verify":
|
|
351
|
+
log("Usage:");
|
|
352
|
+
log(" mdkg archive verify [id-or-archive-uri] [--ws <alias>] [--json]");
|
|
353
|
+
break;
|
|
354
|
+
case "compress":
|
|
355
|
+
log("Usage:");
|
|
356
|
+
log(" mdkg archive compress <id-or-archive-uri> [--ws <alias>] [--json]");
|
|
357
|
+
log(" mdkg archive compress --all [--json]");
|
|
358
|
+
break;
|
|
359
|
+
default:
|
|
360
|
+
log("Usage:");
|
|
361
|
+
log(" mdkg archive add <file> [--id <archive.id>] [--kind source|artifact] [--visibility private|internal|public] [--json]");
|
|
362
|
+
log(" mdkg archive list [--kind source|artifact] [--visibility private|internal|public] [--json]");
|
|
363
|
+
log(" mdkg archive show <id-or-archive-uri> [--json]");
|
|
364
|
+
log(" mdkg archive verify [id-or-archive-uri] [--json]");
|
|
365
|
+
log(" mdkg archive compress <id-or-archive-uri|--all> [--json]");
|
|
366
|
+
log("\nNotes:");
|
|
367
|
+
log(" - archive add copies the source, writes a sidecar, and writes a deterministic zip cache");
|
|
368
|
+
log(" - archive visibility defaults to private");
|
|
369
|
+
log(" - archive://<archive.id> refs are validated against local archive sidecars");
|
|
370
|
+
log(" - archive verify checks sidecar and zip payload integrity; missing raw source copies are ok when the zip cache is valid");
|
|
371
|
+
}
|
|
372
|
+
printGlobalOptions(log);
|
|
373
|
+
}
|
|
374
|
+
function printBundleHelp(log, subcommand) {
|
|
375
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
376
|
+
case "import":
|
|
377
|
+
log("Usage:");
|
|
378
|
+
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]");
|
|
379
|
+
log(" mdkg bundle import list [--json]");
|
|
380
|
+
log(" mdkg bundle import rm <alias> [--json]");
|
|
381
|
+
log(" mdkg bundle import enable <alias> [--json]");
|
|
382
|
+
log(" mdkg bundle import disable <alias> [--json]");
|
|
383
|
+
log(" mdkg bundle import verify [alias|--all] [--json]");
|
|
384
|
+
break;
|
|
385
|
+
case "create":
|
|
386
|
+
log("Usage:");
|
|
387
|
+
log(" mdkg bundle create [--profile private|public] [--ws <alias|all>] [--output <path>] [--json]");
|
|
388
|
+
break;
|
|
389
|
+
case "verify":
|
|
390
|
+
log("Usage:");
|
|
391
|
+
log(" mdkg bundle verify [bundle-path] [--json]");
|
|
392
|
+
break;
|
|
393
|
+
case "show":
|
|
394
|
+
log("Usage:");
|
|
395
|
+
log(" mdkg bundle show <bundle-path> [--json]");
|
|
396
|
+
break;
|
|
397
|
+
case "list":
|
|
398
|
+
log("Usage:");
|
|
399
|
+
log(" mdkg bundle list [--json]");
|
|
400
|
+
break;
|
|
401
|
+
default:
|
|
402
|
+
log("Usage:");
|
|
403
|
+
log(" mdkg bundle create [--profile private|public] [--ws <alias|all>] [--output <path>] [--json]");
|
|
404
|
+
log(" mdkg bundle verify [bundle-path] [--json]");
|
|
405
|
+
log(" mdkg bundle show <bundle-path> [--json]");
|
|
406
|
+
log(" mdkg bundle list [--json]");
|
|
407
|
+
log(" mdkg bundle import add/list/rm/enable/disable/verify ...");
|
|
408
|
+
log("\nNotes:");
|
|
409
|
+
log(" - bundles are explicit full .mdkg graph snapshots, not task context packs");
|
|
410
|
+
log(" - bundle imports are read-only graph views projected under their import alias");
|
|
411
|
+
log(" - private is the default profile; public bundles fail closed on private refs");
|
|
412
|
+
log(" - .mdkg/bundles/ is commit-eligible when your repo tracks snapshot bundles");
|
|
413
|
+
}
|
|
414
|
+
printGlobalOptions(log);
|
|
415
|
+
}
|
|
416
|
+
function printWorkHelp(log, subcommand) {
|
|
417
|
+
switch ((subcommand ?? "").toLowerCase()) {
|
|
418
|
+
case "contract":
|
|
419
|
+
log("Usage:");
|
|
420
|
+
log(' mdkg work contract new "<title>" --id <work.id> --agent-id <agent.id> --kind <kind> --inputs <...> --outputs <...> [--required-capabilities <...>] [--pricing-model <...>] [--json]');
|
|
421
|
+
break;
|
|
422
|
+
case "order":
|
|
423
|
+
log("Usage:");
|
|
424
|
+
log(' mdkg work order new "<title>" --id <order.id> --work-id <work.id> --requester <ref> [--request-ref <ref>] [--input-refs <...>] [--requested-outputs <...>] [--json]');
|
|
425
|
+
log(" mdkg work order update <id-or-qid> [--status <status>] [--add-input-refs <...>] [--add-artifacts <...>] [--json]");
|
|
426
|
+
break;
|
|
427
|
+
case "receipt":
|
|
428
|
+
log("Usage:");
|
|
429
|
+
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]');
|
|
430
|
+
log(" mdkg work receipt update <id-or-qid> [--receipt-status <status>] [--add-artifacts <...>] [--add-proof-refs <...>] [--add-attestation-refs <...>] [--json]");
|
|
431
|
+
break;
|
|
432
|
+
case "artifact":
|
|
433
|
+
log("Usage:");
|
|
434
|
+
log(" mdkg work artifact add <order-or-receipt-id-or-qid> <file> [--id <archive.id>] [--kind source|artifact] [--json]");
|
|
435
|
+
break;
|
|
436
|
+
default:
|
|
437
|
+
log("Usage:");
|
|
438
|
+
log(" mdkg work contract new ...");
|
|
439
|
+
log(" mdkg work order new|update ...");
|
|
440
|
+
log(" mdkg work receipt new|update ...");
|
|
441
|
+
log(" mdkg work artifact add ...");
|
|
442
|
+
log("\nNotes:");
|
|
443
|
+
log(" - work commands mutate semantic mirror files only");
|
|
444
|
+
log(" - production order, receipt, feedback, dispute, payment, ledger, marketplace inventory, fulfillment, and execution state remains canonical outside mdkg");
|
|
445
|
+
log(" - do not store raw secrets, credentials, live payment state, ledger mutations, or canonical marketplace state in work mirrors");
|
|
446
|
+
log(" - artifact:// refs identify external/runtime-managed artifacts; archive:// refs identify committed mdkg archive sidecars");
|
|
447
|
+
log(" - update and artifact commands accept local ids or local qids; imported bundle qids are read-only");
|
|
448
|
+
}
|
|
449
|
+
printGlobalOptions(log);
|
|
450
|
+
}
|
|
286
451
|
function printTaskHelp(log, subcommand) {
|
|
287
452
|
switch ((subcommand ?? "").toLowerCase()) {
|
|
288
453
|
case "start":
|
|
@@ -376,7 +541,12 @@ function printDoctorHelp(log) {
|
|
|
376
541
|
log(" - Node.js version compatibility");
|
|
377
542
|
log(" - mdkg repo root + .mdkg/config.json");
|
|
378
543
|
log(" - Template schema availability");
|
|
544
|
+
log(" - Archive sidecar storage hygiene");
|
|
545
|
+
log(" - Bundle snapshot storage guidance");
|
|
546
|
+
log(" - Bundle import health and staleness");
|
|
379
547
|
log(" - Index load/rebuild health");
|
|
548
|
+
log(" - Capability cache load/rebuild health");
|
|
549
|
+
log(" - SQLite cache health when enabled");
|
|
380
550
|
log("\nOptions:");
|
|
381
551
|
log(" --json Emit machine-readable JSON output");
|
|
382
552
|
printGlobalOptions(log);
|
|
@@ -420,6 +590,18 @@ function printCommandHelp(log, command, subcommand) {
|
|
|
420
590
|
case "skill":
|
|
421
591
|
printSkillHelp(log, subcommand);
|
|
422
592
|
return;
|
|
593
|
+
case "capability":
|
|
594
|
+
printCapabilityHelp(log, subcommand);
|
|
595
|
+
return;
|
|
596
|
+
case "archive":
|
|
597
|
+
printArchiveHelp(log, subcommand);
|
|
598
|
+
return;
|
|
599
|
+
case "bundle":
|
|
600
|
+
printBundleHelp(log, subcommand);
|
|
601
|
+
return;
|
|
602
|
+
case "work":
|
|
603
|
+
printWorkHelp(log, subcommand);
|
|
604
|
+
return;
|
|
423
605
|
case "task":
|
|
424
606
|
printTaskHelp(log, subcommand);
|
|
425
607
|
return;
|
|
@@ -614,8 +796,9 @@ function runWorkspaceSubcommand(parsed, root) {
|
|
|
614
796
|
throw new errors_1.UsageError("workspace add requires <alias> <path>");
|
|
615
797
|
}
|
|
616
798
|
const mdkgDir = requireFlagValue("--mdkg-dir", parsed.flags["--mdkg-dir"]);
|
|
799
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
617
800
|
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
618
|
-
(0, workspace_1.runWorkspaceAddCommand)({ root, alias, workspacePath, mdkgDir, json });
|
|
801
|
+
(0, workspace_1.runWorkspaceAddCommand)({ root, alias, workspacePath, mdkgDir, visibility, json });
|
|
619
802
|
return 0;
|
|
620
803
|
}
|
|
621
804
|
case "rm": {
|
|
@@ -649,6 +832,369 @@ function runWorkspaceSubcommand(parsed, root) {
|
|
|
649
832
|
throw new errors_1.UsageError("workspace requires ls/add/rm/enable/disable");
|
|
650
833
|
}
|
|
651
834
|
}
|
|
835
|
+
function runCapabilitySubcommand(parsed, root) {
|
|
836
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
837
|
+
switch (subcommand) {
|
|
838
|
+
case "list": {
|
|
839
|
+
if (parsed.positionals.length > 2) {
|
|
840
|
+
throw new errors_1.UsageError("capability list does not accept positional arguments");
|
|
841
|
+
}
|
|
842
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
843
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
844
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
845
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
846
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
847
|
+
(0, capability_1.runCapabilityListCommand)({ root, kind, visibility, json, noCache, noReindex });
|
|
848
|
+
return 0;
|
|
849
|
+
}
|
|
850
|
+
case "search": {
|
|
851
|
+
if (parsed.positionals.length < 3) {
|
|
852
|
+
throw new errors_1.UsageError("capability search requires a query");
|
|
853
|
+
}
|
|
854
|
+
const query = parsed.positionals.slice(2).join(" ");
|
|
855
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
856
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
857
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
858
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
859
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
860
|
+
(0, capability_1.runCapabilitySearchCommand)({ root, query, kind, visibility, json, noCache, noReindex });
|
|
861
|
+
return 0;
|
|
862
|
+
}
|
|
863
|
+
case "show": {
|
|
864
|
+
const id = parsed.positionals[2];
|
|
865
|
+
if (!id || parsed.positionals.length > 3) {
|
|
866
|
+
throw new errors_1.UsageError("capability show requires <id-or-qid-or-slug>");
|
|
867
|
+
}
|
|
868
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
869
|
+
const noCache = parseBooleanFlag("--no-cache", parsed.flags["--no-cache"]);
|
|
870
|
+
const noReindex = parseBooleanFlag("--no-reindex", parsed.flags["--no-reindex"]);
|
|
871
|
+
(0, capability_1.runCapabilityShowCommand)({ root, id, json, noCache, noReindex });
|
|
872
|
+
return 0;
|
|
873
|
+
}
|
|
874
|
+
default:
|
|
875
|
+
throw new errors_1.UsageError("capability requires list/search/show");
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
function runArchiveSubcommand(parsed, root) {
|
|
879
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
880
|
+
switch (subcommand) {
|
|
881
|
+
case "add": {
|
|
882
|
+
const file = parsed.positionals[2];
|
|
883
|
+
if (!file || parsed.positionals.length > 3) {
|
|
884
|
+
throw new errors_1.UsageError("archive add requires <file>");
|
|
885
|
+
}
|
|
886
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
887
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
888
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
889
|
+
const title = requireFlagValue("--title", parsed.flags["--title"]);
|
|
890
|
+
const refs = requireFlagValue("--refs", parsed.flags["--refs"]);
|
|
891
|
+
const relates = requireFlagValue("--relates", parsed.flags["--relates"]);
|
|
892
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
893
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
894
|
+
(0, archive_1.runArchiveAddCommand)({ root, file, id, ws, kind, title, refs, relates, visibility, json });
|
|
895
|
+
return 0;
|
|
896
|
+
}
|
|
897
|
+
case "list": {
|
|
898
|
+
if (parsed.positionals.length > 2) {
|
|
899
|
+
throw new errors_1.UsageError("archive list does not accept positional arguments");
|
|
900
|
+
}
|
|
901
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
902
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
903
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
904
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
905
|
+
(0, archive_1.runArchiveListCommand)({ root, ws, kind, visibility, json });
|
|
906
|
+
return 0;
|
|
907
|
+
}
|
|
908
|
+
case "show": {
|
|
909
|
+
const id = parsed.positionals[2];
|
|
910
|
+
if (!id || parsed.positionals.length > 3) {
|
|
911
|
+
throw new errors_1.UsageError("archive show requires <id-or-archive-uri>");
|
|
912
|
+
}
|
|
913
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
914
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
915
|
+
(0, archive_1.runArchiveShowCommand)({ root, id, ws, json });
|
|
916
|
+
return 0;
|
|
917
|
+
}
|
|
918
|
+
case "verify": {
|
|
919
|
+
if (parsed.positionals.length > 3) {
|
|
920
|
+
throw new errors_1.UsageError("archive verify accepts at most one id");
|
|
921
|
+
}
|
|
922
|
+
const id = parsed.positionals[2];
|
|
923
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
924
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
925
|
+
(0, archive_1.runArchiveVerifyCommand)({ root, id, ws, json });
|
|
926
|
+
return 0;
|
|
927
|
+
}
|
|
928
|
+
case "compress": {
|
|
929
|
+
if (parsed.positionals.length > 3) {
|
|
930
|
+
throw new errors_1.UsageError("archive compress accepts at most one id");
|
|
931
|
+
}
|
|
932
|
+
const id = parsed.positionals[2];
|
|
933
|
+
const all = parseBooleanFlag("--all", parsed.flags["--all"]);
|
|
934
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
935
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
936
|
+
(0, archive_1.runArchiveCompressCommand)({ root, id, all, ws, json });
|
|
937
|
+
return 0;
|
|
938
|
+
}
|
|
939
|
+
default:
|
|
940
|
+
throw new errors_1.UsageError("archive requires add/list/show/verify/compress");
|
|
941
|
+
}
|
|
942
|
+
}
|
|
943
|
+
function runBundleSubcommand(parsed, root) {
|
|
944
|
+
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
945
|
+
switch (subcommand) {
|
|
946
|
+
case "import": {
|
|
947
|
+
const action = (parsed.positionals[2] ?? "").toLowerCase();
|
|
948
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
949
|
+
switch (action) {
|
|
950
|
+
case "add": {
|
|
951
|
+
const alias = parsed.positionals[3];
|
|
952
|
+
const bundlePath = parsed.positionals[4];
|
|
953
|
+
if (!alias || !bundlePath || parsed.positionals.length > 5) {
|
|
954
|
+
throw new errors_1.UsageError("bundle import add requires <alias> <bundle-path>");
|
|
955
|
+
}
|
|
956
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
957
|
+
const profile = requireFlagValue("--profile", parsed.flags["--pack-profile"]);
|
|
958
|
+
const sourcePath = requireFlagValue("--source-path", parsed.flags["--source-path"]);
|
|
959
|
+
const sourceRepo = requireFlagValue("--source-repo", parsed.flags["--source-repo"]);
|
|
960
|
+
const maxStaleRaw = requireFlagValue("--max-stale-seconds", parsed.flags["--max-stale-seconds"]);
|
|
961
|
+
const maxStaleSeconds = maxStaleRaw === undefined ? undefined : Number.parseInt(maxStaleRaw, 10);
|
|
962
|
+
(0, bundle_import_1.runBundleImportAddCommand)({
|
|
963
|
+
root,
|
|
964
|
+
alias,
|
|
965
|
+
bundlePath,
|
|
966
|
+
visibility,
|
|
967
|
+
profile,
|
|
968
|
+
sourcePath,
|
|
969
|
+
sourceRepo,
|
|
970
|
+
maxStaleSeconds,
|
|
971
|
+
json,
|
|
972
|
+
});
|
|
973
|
+
return 0;
|
|
974
|
+
}
|
|
975
|
+
case "list": {
|
|
976
|
+
if (parsed.positionals.length > 3) {
|
|
977
|
+
throw new errors_1.UsageError("bundle import list does not accept positional arguments");
|
|
978
|
+
}
|
|
979
|
+
(0, bundle_import_1.runBundleImportListCommand)({ root, json });
|
|
980
|
+
return 0;
|
|
981
|
+
}
|
|
982
|
+
case "rm":
|
|
983
|
+
case "remove": {
|
|
984
|
+
const alias = parsed.positionals[3];
|
|
985
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
986
|
+
throw new errors_1.UsageError("bundle import rm requires <alias>");
|
|
987
|
+
}
|
|
988
|
+
(0, bundle_import_1.runBundleImportRemoveCommand)({ root, alias, json });
|
|
989
|
+
return 0;
|
|
990
|
+
}
|
|
991
|
+
case "enable": {
|
|
992
|
+
const alias = parsed.positionals[3];
|
|
993
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
994
|
+
throw new errors_1.UsageError("bundle import enable requires <alias>");
|
|
995
|
+
}
|
|
996
|
+
(0, bundle_import_1.runBundleImportEnableCommand)({ root, alias, json });
|
|
997
|
+
return 0;
|
|
998
|
+
}
|
|
999
|
+
case "disable": {
|
|
1000
|
+
const alias = parsed.positionals[3];
|
|
1001
|
+
if (!alias || parsed.positionals.length > 4) {
|
|
1002
|
+
throw new errors_1.UsageError("bundle import disable requires <alias>");
|
|
1003
|
+
}
|
|
1004
|
+
(0, bundle_import_1.runBundleImportDisableCommand)({ root, alias, json });
|
|
1005
|
+
return 0;
|
|
1006
|
+
}
|
|
1007
|
+
case "verify": {
|
|
1008
|
+
if (parsed.positionals.length > 4) {
|
|
1009
|
+
throw new errors_1.UsageError("bundle import verify accepts at most one alias");
|
|
1010
|
+
}
|
|
1011
|
+
const alias = parsed.positionals[3];
|
|
1012
|
+
const all = parseBooleanFlag("--all", parsed.flags["--all"]);
|
|
1013
|
+
(0, bundle_import_1.runBundleImportVerifyCommand)({ root, alias, all, json });
|
|
1014
|
+
return 0;
|
|
1015
|
+
}
|
|
1016
|
+
default:
|
|
1017
|
+
throw new errors_1.UsageError("bundle import requires add/list/rm/enable/disable/verify");
|
|
1018
|
+
}
|
|
1019
|
+
}
|
|
1020
|
+
case "create": {
|
|
1021
|
+
if (parsed.positionals.length > 2) {
|
|
1022
|
+
throw new errors_1.UsageError("bundle create does not accept positional arguments");
|
|
1023
|
+
}
|
|
1024
|
+
const profile = requireFlagValue("--profile", parsed.flags["--pack-profile"]);
|
|
1025
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
1026
|
+
const output = requireFlagValue("--output", parsed.flags["--out"]);
|
|
1027
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1028
|
+
(0, bundle_1.runBundleCreateCommand)({ root, profile, ws, output, json });
|
|
1029
|
+
return 0;
|
|
1030
|
+
}
|
|
1031
|
+
case "verify": {
|
|
1032
|
+
if (parsed.positionals.length > 3) {
|
|
1033
|
+
throw new errors_1.UsageError("bundle verify accepts at most one bundle path");
|
|
1034
|
+
}
|
|
1035
|
+
const bundlePath = parsed.positionals[2];
|
|
1036
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1037
|
+
(0, bundle_1.runBundleVerifyCommand)({ root, bundlePath, json });
|
|
1038
|
+
return 0;
|
|
1039
|
+
}
|
|
1040
|
+
case "show": {
|
|
1041
|
+
const bundlePath = parsed.positionals[2];
|
|
1042
|
+
if (!bundlePath || parsed.positionals.length > 3) {
|
|
1043
|
+
throw new errors_1.UsageError("bundle show requires <bundle-path>");
|
|
1044
|
+
}
|
|
1045
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1046
|
+
(0, bundle_1.runBundleShowCommand)({ root, bundlePath, json });
|
|
1047
|
+
return 0;
|
|
1048
|
+
}
|
|
1049
|
+
case "list": {
|
|
1050
|
+
if (parsed.positionals.length > 2) {
|
|
1051
|
+
throw new errors_1.UsageError("bundle list does not accept positional arguments");
|
|
1052
|
+
}
|
|
1053
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1054
|
+
(0, bundle_1.runBundleListCommand)({ root, json });
|
|
1055
|
+
return 0;
|
|
1056
|
+
}
|
|
1057
|
+
default:
|
|
1058
|
+
throw new errors_1.UsageError("bundle requires create/list/show/verify/import");
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
function runWorkSubcommand(parsed, root) {
|
|
1062
|
+
const domain = (parsed.positionals[1] ?? "").toLowerCase();
|
|
1063
|
+
const action = (parsed.positionals[2] ?? "").toLowerCase();
|
|
1064
|
+
const ws = requireFlagValue("--ws", parsed.flags["--ws"]);
|
|
1065
|
+
const json = parseBooleanFlag("--json", parsed.flags["--json"]);
|
|
1066
|
+
if (domain === "contract" && action === "new") {
|
|
1067
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1068
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1069
|
+
const agentId = requireFlagValue("--agent-id", parsed.flags["--agent-id"]);
|
|
1070
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
1071
|
+
const inputs = requireFlagValue("--inputs", parsed.flags["--inputs"]);
|
|
1072
|
+
const outputs = requireFlagValue("--outputs", parsed.flags["--outputs"]);
|
|
1073
|
+
if (!title || !id || !agentId || !kind || !inputs || !outputs) {
|
|
1074
|
+
throw new errors_1.UsageError("work contract new requires title, --id, --agent-id, --kind, --inputs, and --outputs");
|
|
1075
|
+
}
|
|
1076
|
+
const requiredCapabilities = requireFlagValue("--required-capabilities", parsed.flags["--required-capabilities"]);
|
|
1077
|
+
const pricingModel = requireFlagValue("--pricing-model", parsed.flags["--pricing-model"]);
|
|
1078
|
+
(0, work_1.runWorkContractNewCommand)({
|
|
1079
|
+
root,
|
|
1080
|
+
ws,
|
|
1081
|
+
title,
|
|
1082
|
+
id,
|
|
1083
|
+
agentId,
|
|
1084
|
+
kind,
|
|
1085
|
+
inputs,
|
|
1086
|
+
outputs,
|
|
1087
|
+
requiredCapabilities,
|
|
1088
|
+
pricingModel,
|
|
1089
|
+
json,
|
|
1090
|
+
});
|
|
1091
|
+
return 0;
|
|
1092
|
+
}
|
|
1093
|
+
if (domain === "order" && action === "new") {
|
|
1094
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1095
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1096
|
+
const workId = requireFlagValue("--work-id", parsed.flags["--work-id"]);
|
|
1097
|
+
const requester = requireFlagValue("--requester", parsed.flags["--requester"]);
|
|
1098
|
+
if (!title || !id || !workId || !requester) {
|
|
1099
|
+
throw new errors_1.UsageError("work order new requires title, --id, --work-id, and --requester");
|
|
1100
|
+
}
|
|
1101
|
+
const requestRef = requireFlagValue("--request-ref", parsed.flags["--request-ref"]);
|
|
1102
|
+
const inputRefs = requireFlagValue("--input-refs", parsed.flags["--input-refs"]);
|
|
1103
|
+
const requestedOutputs = requireFlagValue("--requested-outputs", parsed.flags["--requested-outputs"]);
|
|
1104
|
+
const constraintRefs = requireFlagValue("--constraint-refs", parsed.flags["--constraint-refs"]);
|
|
1105
|
+
(0, work_1.runWorkOrderNewCommand)({
|
|
1106
|
+
root,
|
|
1107
|
+
ws,
|
|
1108
|
+
title,
|
|
1109
|
+
id,
|
|
1110
|
+
workId,
|
|
1111
|
+
requester,
|
|
1112
|
+
requestRef,
|
|
1113
|
+
inputRefs,
|
|
1114
|
+
requestedOutputs,
|
|
1115
|
+
constraintRefs,
|
|
1116
|
+
json,
|
|
1117
|
+
});
|
|
1118
|
+
return 0;
|
|
1119
|
+
}
|
|
1120
|
+
if (domain === "order" && action === "update") {
|
|
1121
|
+
const id = parsed.positionals[3];
|
|
1122
|
+
if (!id || parsed.positionals.length > 4) {
|
|
1123
|
+
throw new errors_1.UsageError("work order update requires <id-or-qid>");
|
|
1124
|
+
}
|
|
1125
|
+
const status = requireFlagValue("--status", parsed.flags["--status"]);
|
|
1126
|
+
const addInputRefs = requireFlagValue("--add-input-refs", parsed.flags["--add-input-refs"]);
|
|
1127
|
+
const addArtifacts = requireFlagValue("--add-artifacts", parsed.flags["--add-artifacts"]);
|
|
1128
|
+
(0, work_1.runWorkOrderUpdateCommand)({ root, ws, id, status, addInputRefs, addArtifacts, json });
|
|
1129
|
+
return 0;
|
|
1130
|
+
}
|
|
1131
|
+
if (domain === "receipt" && action === "new") {
|
|
1132
|
+
const title = parsed.positionals.slice(3).join(" ");
|
|
1133
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1134
|
+
const workOrderId = requireFlagValue("--work-order-id", parsed.flags["--work-order-id"]);
|
|
1135
|
+
const outcome = requireFlagValue("--outcome", parsed.flags["--outcome"]);
|
|
1136
|
+
if (!title || !id || !workOrderId || !outcome) {
|
|
1137
|
+
throw new errors_1.UsageError("work receipt new requires title, --id, --work-order-id, and --outcome");
|
|
1138
|
+
}
|
|
1139
|
+
const receiptStatus = requireFlagValue("--receipt-status", parsed.flags["--receipt-status"]);
|
|
1140
|
+
const costRef = requireFlagValue("--cost-ref", parsed.flags["--cost-ref"]);
|
|
1141
|
+
const artifacts = requireFlagValue("--artifacts", parsed.flags["--artifacts"]);
|
|
1142
|
+
const proofRefs = requireFlagValue("--proof-refs", parsed.flags["--proof-refs"]);
|
|
1143
|
+
const attestationRefs = requireFlagValue("--attestation-refs", parsed.flags["--attestation-refs"]);
|
|
1144
|
+
const inputHashes = requireFlagValue("--input-hashes", parsed.flags["--input-hashes"]);
|
|
1145
|
+
const outputHashes = requireFlagValue("--output-hashes", parsed.flags["--output-hashes"]);
|
|
1146
|
+
(0, work_1.runWorkReceiptNewCommand)({
|
|
1147
|
+
root,
|
|
1148
|
+
ws,
|
|
1149
|
+
title,
|
|
1150
|
+
id,
|
|
1151
|
+
workOrderId,
|
|
1152
|
+
outcome,
|
|
1153
|
+
receiptStatus,
|
|
1154
|
+
costRef,
|
|
1155
|
+
artifacts,
|
|
1156
|
+
proofRefs,
|
|
1157
|
+
attestationRefs,
|
|
1158
|
+
inputHashes,
|
|
1159
|
+
outputHashes,
|
|
1160
|
+
json,
|
|
1161
|
+
});
|
|
1162
|
+
return 0;
|
|
1163
|
+
}
|
|
1164
|
+
if (domain === "receipt" && action === "update") {
|
|
1165
|
+
const id = parsed.positionals[3];
|
|
1166
|
+
if (!id || parsed.positionals.length > 4) {
|
|
1167
|
+
throw new errors_1.UsageError("work receipt update requires <id-or-qid>");
|
|
1168
|
+
}
|
|
1169
|
+
const receiptStatus = requireFlagValue("--receipt-status", parsed.flags["--receipt-status"]);
|
|
1170
|
+
const addArtifacts = requireFlagValue("--add-artifacts", parsed.flags["--add-artifacts"]);
|
|
1171
|
+
const addProofRefs = requireFlagValue("--add-proof-refs", parsed.flags["--add-proof-refs"]);
|
|
1172
|
+
const addAttestationRefs = requireFlagValue("--add-attestation-refs", parsed.flags["--add-attestation-refs"]);
|
|
1173
|
+
(0, work_1.runWorkReceiptUpdateCommand)({
|
|
1174
|
+
root,
|
|
1175
|
+
ws,
|
|
1176
|
+
id,
|
|
1177
|
+
receiptStatus,
|
|
1178
|
+
addArtifacts,
|
|
1179
|
+
addProofRefs,
|
|
1180
|
+
addAttestationRefs,
|
|
1181
|
+
json,
|
|
1182
|
+
});
|
|
1183
|
+
return 0;
|
|
1184
|
+
}
|
|
1185
|
+
if (domain === "artifact" && action === "add") {
|
|
1186
|
+
const targetId = parsed.positionals[3];
|
|
1187
|
+
const file = parsed.positionals[4];
|
|
1188
|
+
if (!targetId || !file || parsed.positionals.length > 5) {
|
|
1189
|
+
throw new errors_1.UsageError("work artifact add requires <order-or-receipt-id-or-qid> <file>");
|
|
1190
|
+
}
|
|
1191
|
+
const id = requireFlagValue("--id", parsed.flags["--id"]);
|
|
1192
|
+
const kind = requireFlagValue("--kind", parsed.flags["--kind"]);
|
|
1193
|
+
(0, work_1.runWorkArtifactAddCommand)({ root, ws, targetId, file, id, kind, json });
|
|
1194
|
+
return 0;
|
|
1195
|
+
}
|
|
1196
|
+
throw new errors_1.UsageError("work requires contract new, order new/update, receipt new/update, or artifact add");
|
|
1197
|
+
}
|
|
652
1198
|
function runSkillSubcommand(parsed, root) {
|
|
653
1199
|
const subcommand = (parsed.positionals[1] ?? "").toLowerCase();
|
|
654
1200
|
switch (subcommand) {
|
|
@@ -906,11 +1452,10 @@ function runCommand(parsed, root, runtime) {
|
|
|
906
1452
|
switch (command) {
|
|
907
1453
|
case "init": {
|
|
908
1454
|
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`");
|
|
1455
|
+
for (const removedFlag of ["--llm", "--agents", "--claude", "--omni"]) {
|
|
1456
|
+
if (parsed.flags[removedFlag] !== undefined) {
|
|
1457
|
+
throw new errors_1.UsageError(`\`mdkg init ${removedFlag}\` was removed; use \`mdkg init --agent\``);
|
|
1458
|
+
}
|
|
914
1459
|
}
|
|
915
1460
|
const agent = parseBooleanFlag("--agent", parsed.flags["--agent"]);
|
|
916
1461
|
const noUpdateIgnores = parseBooleanFlag("--no-update-ignores", parsed.flags["--no-update-ignores"]);
|
|
@@ -924,9 +1469,6 @@ function runCommand(parsed, root, runtime) {
|
|
|
924
1469
|
updateNpmignore,
|
|
925
1470
|
updateDockerignore,
|
|
926
1471
|
noUpdateIgnores,
|
|
927
|
-
createAgents,
|
|
928
|
-
createClaude,
|
|
929
|
-
createLlm,
|
|
930
1472
|
agent,
|
|
931
1473
|
});
|
|
932
1474
|
return 0;
|
|
@@ -1019,6 +1561,14 @@ function runCommand(parsed, root, runtime) {
|
|
|
1019
1561
|
return runWorkspaceSubcommand(parsed, root);
|
|
1020
1562
|
case "skill":
|
|
1021
1563
|
return runSkillSubcommand(parsed, root);
|
|
1564
|
+
case "capability":
|
|
1565
|
+
return runCapabilitySubcommand(parsed, root);
|
|
1566
|
+
case "archive":
|
|
1567
|
+
return runArchiveSubcommand(parsed, root);
|
|
1568
|
+
case "bundle":
|
|
1569
|
+
return runBundleSubcommand(parsed, root);
|
|
1570
|
+
case "work":
|
|
1571
|
+
return runWorkSubcommand(parsed, root);
|
|
1022
1572
|
case "task":
|
|
1023
1573
|
return runTaskSubcommand(parsed, root);
|
|
1024
1574
|
case "event":
|
|
@@ -1129,6 +1679,7 @@ function runCommand(parsed, root, runtime) {
|
|
|
1129
1679
|
const maxTokens = parseNumberFlag("--max-tokens", parsed.flags["--max-tokens"]);
|
|
1130
1680
|
const skills = requireFlagValue("--skills", parsed.flags["--skills"]);
|
|
1131
1681
|
const skillsDepth = requireFlagValue("--skills-depth", parsed.flags["--skills-depth"]);
|
|
1682
|
+
const visibility = requireFlagValue("--visibility", parsed.flags["--visibility"]);
|
|
1132
1683
|
const dryRun = parseBooleanFlag("--dry-run", parsed.flags["--dry-run"]);
|
|
1133
1684
|
const stats = parseBooleanFlag("--stats", parsed.flags["--stats"]);
|
|
1134
1685
|
const statsOut = requireFlagValue("--stats-out", parsed.flags["--stats-out"]);
|
|
@@ -1153,6 +1704,7 @@ function runCommand(parsed, root, runtime) {
|
|
|
1153
1704
|
maxTokens,
|
|
1154
1705
|
skills,
|
|
1155
1706
|
skillsDepth,
|
|
1707
|
+
visibility,
|
|
1156
1708
|
dryRun,
|
|
1157
1709
|
stats,
|
|
1158
1710
|
statsOut,
|