docks-kit 0.24.0 → 0.26.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.
Files changed (49) hide show
  1. package/AGENTS.md +21 -136
  2. package/README.md +54 -9
  3. package/cli/dist/docks-kit.js +24688 -0
  4. package/cli/docs/command-guards.md +1 -1
  5. package/cli/docs/install.md +30 -9
  6. package/cli/docs/omp-context.md +1 -1
  7. package/cli/docs/omp-models.md +5 -4
  8. package/cli/docs/sync-layers.md +46 -75
  9. package/cli/docs/toolchain.md +4 -5
  10. package/cli/src/agentDocs/agentFirstCheck.ts +786 -0
  11. package/cli/src/agentDocs/bridgeCheck.ts +226 -0
  12. package/cli/src/agentDocs/commands.ts +63 -0
  13. package/cli/src/agentDocs/prTemplate.ts +211 -0
  14. package/cli/src/agentDocs/services.ts +202 -0
  15. package/cli/src/agentDocs/shared.ts +730 -0
  16. package/cli/src/agentDocs/verifySkill.ts +136 -0
  17. package/cli/src/argv.ts +25 -1
  18. package/cli/src/commands/agentDocs.ts +29 -0
  19. package/cli/src/commands/plan.ts +29 -0
  20. package/cli/src/commands/skill.ts +29 -0
  21. package/cli/src/commands/update.ts +90 -31
  22. package/cli/src/engine-native/DESIGN.md +5 -6
  23. package/cli/src/engine-native/engineCtx.ts +0 -3
  24. package/cli/src/engine-native/failures.ts +2 -2
  25. package/cli/src/engine-native/ompChild.ts +1 -1
  26. package/cli/src/engine-native/ompKitPlugin.ts +7 -16
  27. package/cli/src/engine-native/ompPlugins.ts +205 -221
  28. package/cli/src/engine-native/ompSync.ts +5 -14
  29. package/cli/src/generated/sotPayload.ts +308 -12
  30. package/cli/src/main.ts +12 -3
  31. package/cli/src/plan/bytes.ts +110 -0
  32. package/cli/src/plan/checkout.ts +341 -0
  33. package/cli/src/plan/commands.ts +1192 -0
  34. package/cli/src/plan/github.ts +816 -0
  35. package/cli/src/plan/records.ts +623 -0
  36. package/cli/src/plan/repository.ts +53 -0
  37. package/cli/src/plan/reviews.ts +292 -0
  38. package/cli/src/plan/services.ts +256 -0
  39. package/cli/src/plan/types.ts +164 -0
  40. package/cli/src/skills/commands.ts +142 -0
  41. package/cli/src/skills/config.json +30 -0
  42. package/cli/src/skills/files.ts +74 -0
  43. package/cli/src/skills/frontmatter.ts +148 -0
  44. package/cli/src/skills/guard.ts +366 -0
  45. package/cli/src/skills/kitGate.ts +406 -0
  46. package/cli/src/skills/rubric.ts +143 -0
  47. package/cli/tsconfig.json +1 -0
  48. package/package.json +7 -4
  49. package/cli/src/engine-native/ompMarketplace.ts +0 -140
@@ -1,140 +0,0 @@
1
- /**
2
- * EngineNative omp marketplace pass: registry detection plus register, adopt,
3
- * and refresh flows. Split from ompSync.ts; the orchestration still lives
4
- * there.
5
- */
6
- import { existsSync, readFileSync } from "node:fs";
7
-
8
- import { p, processFailureSummary } from "./exec";
9
- import { recordFailure } from "./failures";
10
- import type { Ctx } from "./index";
11
- import { isObject, parseJson } from "./jq";
12
- import { spawnOmp } from "./ompChild";
13
- import type { OmpPaths } from "./ompPaths";
14
-
15
- const MARKETPLACE_NAME = "docks";
16
- const MARKETPLACE_SOURCE = "https://github.com/DocksDocks/docks.git";
17
-
18
- // ---------------------------------------------------------- marketplace ----
19
-
20
- function registryHasDocks(registryFile: string): boolean {
21
- if (!existsSync(registryFile)) return false;
22
-
23
- let registryText: string;
24
- try {
25
- registryText = readFileSync(registryFile, "utf8");
26
- } catch {
27
- return false;
28
- }
29
- const registry = parseJson(registryText);
30
- if (registry === undefined) return false;
31
- if (isObject(registry) && Object.hasOwn(registry, MARKETPLACE_NAME)) return true;
32
-
33
- const entries = Array.isArray(registry)
34
- ? registry
35
- : isObject(registry) && Array.isArray(registry["marketplaces"])
36
- ? registry["marketplaces"]
37
- : [];
38
- return entries.some((entry) => isObject(entry) && entry["name"] === MARKETPLACE_NAME);
39
- }
40
-
41
- /**
42
- * Three states, because upstream `getMarketplacesRegistryPath` copies a legacy
43
- * `configRoot` registry forward the first time it resolves an XDG data root:
44
- * the active registry lists docks, only the legacy registry lists it, or
45
- * neither does. In the middle state the kit never copies user data itself; it
46
- * takes the refresh path, whose own resolution inside omp performs that
47
- * adoption and leaves the active registry present. `paths` are the omp paths
48
- * that the sync locked.
49
- */
50
- export async function syncMarketplace(ctx: Ctx, paths: OmpPaths): Promise<void> {
51
- const { change, clearProgress, echo, progress, verbose } = ctx.services.logger;
52
- const registered = registryHasDocks(p(paths.dataRoot, "marketplaces.json"));
53
- const adoptable =
54
- !registered &&
55
- paths.dataRoot !== paths.configRoot &&
56
- registryHasDocks(p(paths.configRoot, "marketplaces.json"));
57
-
58
- // syncPlugins owns the single skip message for both missing CLIs, and it runs
59
- // right after this pass. Without omp no marketplace command can run at all,
60
- // and without git a marketplace clone cannot resolve, so both are deliberate
61
- // skips: return silently instead of spawning and recording a failure. The
62
- // probes run before the dry-run branch, so a dry run previews only the
63
- // commands that a real run on this host would run.
64
- if (ctx.services.deps.probe("omp").state === "missing") return;
65
- if (ctx.services.deps.probe("git").state === "missing") return;
66
-
67
- if (ctx.dryRun) {
68
- if (adoptable) {
69
- echo(
70
- ctx.skipPluginRefresh === true
71
- ? "[dry-run] omp plugin marketplace list"
72
- : `[dry-run] omp plugin marketplace update ${MARKETPLACE_NAME}`,
73
- );
74
- } else if (registered) verbose("omp docks marketplace already registered");
75
- else echo(`[dry-run] omp plugin marketplace add ${MARKETPLACE_SOURCE}`);
76
- return;
77
- }
78
-
79
- if (!registered && !adoptable) {
80
- progress("Registering omp docks marketplace...");
81
- const result = await spawnOmp(
82
- paths,
83
- ["plugin", "marketplace", "add", MARKETPLACE_SOURCE],
84
- ["ignore", "pipe", "pipe"],
85
- );
86
- clearProgress();
87
- if (result.error === undefined && result.exitCode === 0) {
88
- change("omp docks marketplace registered");
89
- } else {
90
- recordFailure(
91
- ctx,
92
- `omp docks marketplace registration failed: ${processFailureSummary(result)}; run manually: omp plugin marketplace add ${MARKETPLACE_SOURCE}`,
93
- );
94
- }
95
- return;
96
- }
97
-
98
- if (ctx.skipPluginRefresh === true) {
99
- if (!adoptable) {
100
- verbose("omp docks marketplace already registered; refresh-only update skipped");
101
- return;
102
- }
103
-
104
- // Adoption only needs omp to resolve the registry path. `marketplace list`
105
- // does that and fetches nothing, so it stays inside the flag's contract
106
- // while leaving the active registry present.
107
- progress("Adopting omp docks marketplace registry...");
108
- const listed = await spawnOmp(
109
- paths,
110
- ["plugin", "marketplace", "list"],
111
- ["ignore", "ignore", "pipe"],
112
- );
113
- clearProgress();
114
- if (listed.error === undefined && listed.exitCode === 0) {
115
- change("omp docks marketplace registry adopted; refresh-only update skipped");
116
- } else {
117
- recordFailure(
118
- ctx,
119
- `omp docks marketplace adoption failed: ${processFailureSummary(listed)}; run manually: omp plugin marketplace list`,
120
- );
121
- }
122
- return;
123
- }
124
-
125
- progress("Updating omp docks marketplace...");
126
- const result = await spawnOmp(
127
- paths,
128
- ["plugin", "marketplace", "update", MARKETPLACE_NAME],
129
- ["ignore", "pipe", "pipe"],
130
- );
131
- clearProgress();
132
- if (result.error === undefined && result.exitCode === 0) {
133
- verbose("omp docks marketplace refreshed");
134
- } else {
135
- recordFailure(
136
- ctx,
137
- `omp docks marketplace update failed: ${processFailureSummary(result)}; run manually: omp plugin marketplace update ${MARKETPLACE_NAME}`,
138
- );
139
- }
140
- }