mewkit 1.14.1 → 1.15.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 (264) hide show
  1. package/README.md +7 -0
  2. package/dist/commands/capabilities.d.ts +13 -0
  3. package/dist/commands/capabilities.d.ts.map +1 -0
  4. package/dist/commands/capabilities.js +230 -0
  5. package/dist/commands/capabilities.js.map +1 -0
  6. package/dist/commands/context.d.ts +10 -0
  7. package/dist/commands/context.d.ts.map +1 -0
  8. package/dist/commands/context.js +125 -0
  9. package/dist/commands/context.js.map +1 -0
  10. package/dist/commands/doctor.d.ts +27 -0
  11. package/dist/commands/doctor.d.ts.map +1 -1
  12. package/dist/commands/doctor.js +123 -0
  13. package/dist/commands/doctor.js.map +1 -1
  14. package/dist/commands/providers.d.ts +2 -0
  15. package/dist/commands/providers.d.ts.map +1 -1
  16. package/dist/commands/providers.js +77 -0
  17. package/dist/commands/providers.js.map +1 -1
  18. package/dist/commands/task-state.d.ts +13 -0
  19. package/dist/commands/task-state.d.ts.map +1 -0
  20. package/dist/commands/task-state.js +106 -0
  21. package/dist/commands/task-state.js.map +1 -0
  22. package/dist/commands/validate.d.ts +48 -1
  23. package/dist/commands/validate.d.ts.map +1 -1
  24. package/dist/commands/validate.js +97 -24
  25. package/dist/commands/validate.js.map +1 -1
  26. package/dist/core/availability.d.ts +40 -0
  27. package/dist/core/availability.d.ts.map +1 -0
  28. package/dist/core/availability.js +47 -0
  29. package/dist/core/availability.js.map +1 -0
  30. package/dist/core/bootstrap.d.ts +19 -0
  31. package/dist/core/bootstrap.d.ts.map +1 -0
  32. package/dist/core/bootstrap.js +42 -0
  33. package/dist/core/bootstrap.js.map +1 -0
  34. package/dist/core/build-capabilities.d.ts +9 -0
  35. package/dist/core/build-capabilities.d.ts.map +1 -0
  36. package/dist/core/build-capabilities.js +123 -0
  37. package/dist/core/build-capabilities.js.map +1 -0
  38. package/dist/core/build-inventory.d.ts +2 -0
  39. package/dist/core/build-inventory.d.ts.map +1 -1
  40. package/dist/core/build-inventory.js +1 -1
  41. package/dist/core/build-inventory.js.map +1 -1
  42. package/dist/core/capability-authored.d.ts +26 -0
  43. package/dist/core/capability-authored.d.ts.map +1 -0
  44. package/dist/core/capability-authored.js +117 -0
  45. package/dist/core/capability-authored.js.map +1 -0
  46. package/dist/core/capability-snapshot.d.ts +13 -0
  47. package/dist/core/capability-snapshot.d.ts.map +1 -0
  48. package/dist/core/capability-snapshot.js +53 -0
  49. package/dist/core/capability-snapshot.js.map +1 -0
  50. package/dist/core/capability.d.ts +519 -0
  51. package/dist/core/capability.d.ts.map +1 -0
  52. package/dist/core/capability.js +114 -0
  53. package/dist/core/capability.js.map +1 -0
  54. package/dist/core/compute-checksums.d.ts.map +1 -1
  55. package/dist/core/compute-checksums.js +8 -2
  56. package/dist/core/compute-checksums.js.map +1 -1
  57. package/dist/core/consolidation-ledger.d.ts +30 -0
  58. package/dist/core/consolidation-ledger.d.ts.map +1 -0
  59. package/dist/core/consolidation-ledger.js +145 -0
  60. package/dist/core/consolidation-ledger.js.map +1 -0
  61. package/dist/core/generate-capability-view.d.ts +21 -0
  62. package/dist/core/generate-capability-view.d.ts.map +1 -0
  63. package/dist/core/generate-capability-view.js +48 -0
  64. package/dist/core/generate-capability-view.js.map +1 -0
  65. package/dist/core/install-metadata.d.ts +47 -30
  66. package/dist/core/install-metadata.d.ts.map +1 -1
  67. package/dist/core/install-metadata.js +49 -9
  68. package/dist/core/install-metadata.js.map +1 -1
  69. package/dist/core/plugin-manifest.d.ts +16 -16
  70. package/dist/core/provider-adapter.d.ts +28 -0
  71. package/dist/core/provider-adapter.d.ts.map +1 -0
  72. package/dist/core/provider-adapter.js +31 -0
  73. package/dist/core/provider-adapter.js.map +1 -0
  74. package/dist/core/provider-invocation.d.ts +14 -0
  75. package/dist/core/provider-invocation.d.ts.map +1 -0
  76. package/dist/core/provider-invocation.js +56 -0
  77. package/dist/core/provider-invocation.js.map +1 -0
  78. package/dist/core/provider-lifecycle.d.ts +35 -0
  79. package/dist/core/provider-lifecycle.d.ts.map +1 -0
  80. package/dist/core/provider-lifecycle.js +101 -0
  81. package/dist/core/provider-lifecycle.js.map +1 -0
  82. package/dist/core/provider-projection.d.ts +29 -0
  83. package/dist/core/provider-projection.d.ts.map +1 -0
  84. package/dist/core/provider-projection.js +47 -0
  85. package/dist/core/provider-projection.js.map +1 -0
  86. package/dist/core/release-metadata.d.ts +9 -2
  87. package/dist/core/release-metadata.d.ts.map +1 -1
  88. package/dist/core/release-metadata.js +13 -0
  89. package/dist/core/release-metadata.js.map +1 -1
  90. package/dist/core/repo-context-adapter.d.ts +23 -0
  91. package/dist/core/repo-context-adapter.d.ts.map +1 -0
  92. package/dist/core/repo-context-adapter.js +44 -0
  93. package/dist/core/repo-context-adapter.js.map +1 -0
  94. package/dist/core/repo-context.d.ts +147 -0
  95. package/dist/core/repo-context.d.ts.map +1 -0
  96. package/dist/core/repo-context.js +204 -0
  97. package/dist/core/repo-context.js.map +1 -0
  98. package/dist/core/resolve-capabilities.d.ts +70 -0
  99. package/dist/core/resolve-capabilities.d.ts.map +1 -0
  100. package/dist/core/resolve-capabilities.js +124 -0
  101. package/dist/core/resolve-capabilities.js.map +1 -0
  102. package/dist/core/smart-update.d.ts.map +1 -1
  103. package/dist/core/smart-update.js +13 -12
  104. package/dist/core/smart-update.js.map +1 -1
  105. package/dist/core/task-record.d.ts +252 -0
  106. package/dist/core/task-record.d.ts.map +1 -0
  107. package/dist/core/task-record.js +252 -0
  108. package/dist/core/task-record.js.map +1 -0
  109. package/dist/core/validate-capabilities.d.ts +12 -0
  110. package/dist/core/validate-capabilities.d.ts.map +1 -0
  111. package/dist/core/validate-capabilities.js +138 -0
  112. package/dist/core/validate-capabilities.js.map +1 -0
  113. package/dist/index.js +66 -4
  114. package/dist/index.js.map +1 -1
  115. package/dist/migrate/capability-bootstrap-projection.d.ts +11 -0
  116. package/dist/migrate/capability-bootstrap-projection.d.ts.map +1 -0
  117. package/dist/migrate/capability-bootstrap-projection.js +48 -0
  118. package/dist/migrate/capability-bootstrap-projection.js.map +1 -0
  119. package/dist/migrate/migrate-orchestrator.d.ts.map +1 -1
  120. package/dist/migrate/migrate-orchestrator.js +22 -0
  121. package/dist/migrate/migrate-orchestrator.js.map +1 -1
  122. package/dist/migrate/reconcile/portable-registry.d.ts +18 -18
  123. package/dist/orchviz-web/index.js +3 -3
  124. package/package.json +1 -1
  125. package/dist/commands/evolve.d.ts +0 -11
  126. package/dist/commands/evolve.d.ts.map +0 -1
  127. package/dist/commands/evolve.js +0 -63
  128. package/dist/commands/evolve.js.map +0 -1
  129. package/dist/commands/health.d.ts +0 -14
  130. package/dist/commands/health.d.ts.map +0 -1
  131. package/dist/commands/health.js +0 -193
  132. package/dist/commands/health.js.map +0 -1
  133. package/dist/commands/policy.d.ts +0 -8
  134. package/dist/commands/policy.d.ts.map +0 -1
  135. package/dist/commands/policy.js +0 -65
  136. package/dist/commands/policy.js.map +0 -1
  137. package/dist/commands/portability.d.ts +0 -7
  138. package/dist/commands/portability.d.ts.map +0 -1
  139. package/dist/commands/portability.js +0 -50
  140. package/dist/commands/portability.js.map +0 -1
  141. package/dist/commands/reflect.d.ts +0 -14
  142. package/dist/commands/reflect.d.ts.map +0 -1
  143. package/dist/commands/reflect.js +0 -135
  144. package/dist/commands/reflect.js.map +0 -1
  145. package/dist/commands/simulate.d.ts +0 -14
  146. package/dist/commands/simulate.d.ts.map +0 -1
  147. package/dist/commands/simulate.js +0 -86
  148. package/dist/commands/simulate.js.map +0 -1
  149. package/dist/core/event-log.d.ts +0 -44
  150. package/dist/core/event-log.d.ts.map +0 -1
  151. package/dist/core/event-log.js +0 -169
  152. package/dist/core/event-log.js.map +0 -1
  153. package/dist/core/evolution/event-clusters.d.ts +0 -4
  154. package/dist/core/evolution/event-clusters.d.ts.map +0 -1
  155. package/dist/core/evolution/event-clusters.js +0 -82
  156. package/dist/core/evolution/event-clusters.js.map +0 -1
  157. package/dist/core/evolution/recommendation-renderer.d.ts +0 -3
  158. package/dist/core/evolution/recommendation-renderer.d.ts.map +0 -1
  159. package/dist/core/evolution/recommendation-renderer.js +0 -24
  160. package/dist/core/evolution/recommendation-renderer.js.map +0 -1
  161. package/dist/core/evolution/review-failure-clusters.d.ts +0 -10
  162. package/dist/core/evolution/review-failure-clusters.d.ts.map +0 -1
  163. package/dist/core/evolution/review-failure-clusters.js +0 -30
  164. package/dist/core/evolution/review-failure-clusters.js.map +0 -1
  165. package/dist/core/evolution/suggestions.d.ts +0 -24
  166. package/dist/core/evolution/suggestions.d.ts.map +0 -1
  167. package/dist/core/evolution/suggestions.js +0 -11
  168. package/dist/core/evolution/suggestions.js.map +0 -1
  169. package/dist/core/gate-policy.d.ts +0 -20
  170. package/dist/core/gate-policy.d.ts.map +0 -1
  171. package/dist/core/gate-policy.js +0 -64
  172. package/dist/core/gate-policy.js.map +0 -1
  173. package/dist/core/portability-matrix.d.ts +0 -17
  174. package/dist/core/portability-matrix.d.ts.map +0 -1
  175. package/dist/core/portability-matrix.js +0 -31
  176. package/dist/core/portability-matrix.js.map +0 -1
  177. package/dist/core/simulation-runner.d.ts +0 -93
  178. package/dist/core/simulation-runner.d.ts.map +0 -1
  179. package/dist/core/simulation-runner.js +0 -161
  180. package/dist/core/simulation-runner.js.map +0 -1
  181. package/dist/core/usage/usage-analyzer.d.ts +0 -18
  182. package/dist/core/usage/usage-analyzer.d.ts.map +0 -1
  183. package/dist/core/usage/usage-analyzer.js +0 -41
  184. package/dist/core/usage/usage-analyzer.js.map +0 -1
  185. package/dist/memory/archive.d.ts +0 -9
  186. package/dist/memory/archive.d.ts.map +0 -1
  187. package/dist/memory/archive.js +0 -42
  188. package/dist/memory/archive.js.map +0 -1
  189. package/dist/memory/compact.d.ts +0 -9
  190. package/dist/memory/compact.d.ts.map +0 -1
  191. package/dist/memory/compact.js +0 -33
  192. package/dist/memory/compact.js.map +0 -1
  193. package/dist/memory/conflicts.d.ts +0 -8
  194. package/dist/memory/conflicts.d.ts.map +0 -1
  195. package/dist/memory/conflicts.js +0 -28
  196. package/dist/memory/conflicts.js.map +0 -1
  197. package/dist/memory/promote.d.ts +0 -8
  198. package/dist/memory/promote.d.ts.map +0 -1
  199. package/dist/memory/promote.js +0 -10
  200. package/dist/memory/promote.js.map +0 -1
  201. package/dist/memory/store-utils.d.ts +0 -14
  202. package/dist/memory/store-utils.d.ts.map +0 -1
  203. package/dist/memory/store-utils.js +0 -44
  204. package/dist/memory/store-utils.js.map +0 -1
  205. package/dist/migrate/__tests__/frontmatter-parser.test.d.ts +0 -2
  206. package/dist/migrate/__tests__/frontmatter-parser.test.d.ts.map +0 -1
  207. package/dist/migrate/__tests__/frontmatter-parser.test.js +0 -73
  208. package/dist/migrate/__tests__/frontmatter-parser.test.js.map +0 -1
  209. package/dist/migrate/__tests__/md-strip-mewkit.test.d.ts +0 -2
  210. package/dist/migrate/__tests__/md-strip-mewkit.test.d.ts.map +0 -1
  211. package/dist/migrate/__tests__/md-strip-mewkit.test.js +0 -55
  212. package/dist/migrate/__tests__/md-strip-mewkit.test.js.map +0 -1
  213. package/dist/migrate/__tests__/migrate-scope-resolver.test.d.ts +0 -2
  214. package/dist/migrate/__tests__/migrate-scope-resolver.test.d.ts.map +0 -1
  215. package/dist/migrate/__tests__/migrate-scope-resolver.test.js +0 -53
  216. package/dist/migrate/__tests__/migrate-scope-resolver.test.js.map +0 -1
  217. package/dist/migrate/__tests__/process-lock.test.d.ts +0 -2
  218. package/dist/migrate/__tests__/process-lock.test.d.ts.map +0 -1
  219. package/dist/migrate/__tests__/process-lock.test.js +0 -63
  220. package/dist/migrate/__tests__/process-lock.test.js.map +0 -1
  221. package/dist/migrate/__tests__/provider-registry.test.d.ts +0 -2
  222. package/dist/migrate/__tests__/provider-registry.test.d.ts.map +0 -1
  223. package/dist/migrate/__tests__/provider-registry.test.js +0 -53
  224. package/dist/migrate/__tests__/provider-registry.test.js.map +0 -1
  225. package/dist/migrate/__tests__/reconciler.test.d.ts +0 -2
  226. package/dist/migrate/__tests__/reconciler.test.d.ts.map +0 -1
  227. package/dist/migrate/__tests__/reconciler.test.js +0 -180
  228. package/dist/migrate/__tests__/reconciler.test.js.map +0 -1
  229. package/dist/migrate/__tests__/skill-id-utils.test.d.ts +0 -2
  230. package/dist/migrate/__tests__/skill-id-utils.test.d.ts.map +0 -1
  231. package/dist/migrate/__tests__/skill-id-utils.test.js +0 -78
  232. package/dist/migrate/__tests__/skill-id-utils.test.js.map +0 -1
  233. package/dist/orchviz/plan/__tests__/apply-todo-toggle.test.d.ts +0 -15
  234. package/dist/orchviz/plan/__tests__/apply-todo-toggle.test.d.ts.map +0 -1
  235. package/dist/orchviz/plan/__tests__/apply-todo-toggle.test.js +0 -165
  236. package/dist/orchviz/plan/__tests__/apply-todo-toggle.test.js.map +0 -1
  237. package/dist/orchviz/plan/__tests__/atomic-write.test.d.ts +0 -11
  238. package/dist/orchviz/plan/__tests__/atomic-write.test.d.ts.map +0 -1
  239. package/dist/orchviz/plan/__tests__/atomic-write.test.js +0 -89
  240. package/dist/orchviz/plan/__tests__/atomic-write.test.js.map +0 -1
  241. package/dist/orchviz/plan/__tests__/end-to-end.test.d.ts +0 -10
  242. package/dist/orchviz/plan/__tests__/end-to-end.test.d.ts.map +0 -1
  243. package/dist/orchviz/plan/__tests__/end-to-end.test.js +0 -132
  244. package/dist/orchviz/plan/__tests__/end-to-end.test.js.map +0 -1
  245. package/dist/orchviz/plan/__tests__/etag.test.d.ts +0 -11
  246. package/dist/orchviz/plan/__tests__/etag.test.d.ts.map +0 -1
  247. package/dist/orchviz/plan/__tests__/etag.test.js +0 -92
  248. package/dist/orchviz/plan/__tests__/etag.test.js.map +0 -1
  249. package/dist/orchviz/plan/__tests__/list-plans.test.d.ts +0 -14
  250. package/dist/orchviz/plan/__tests__/list-plans.test.d.ts.map +0 -1
  251. package/dist/orchviz/plan/__tests__/list-plans.test.js +0 -154
  252. package/dist/orchviz/plan/__tests__/list-plans.test.js.map +0 -1
  253. package/dist/orchviz/server/__tests__/security-smoke.test.d.ts +0 -13
  254. package/dist/orchviz/server/__tests__/security-smoke.test.d.ts.map +0 -1
  255. package/dist/orchviz/server/__tests__/security-smoke.test.js +0 -207
  256. package/dist/orchviz/server/__tests__/security-smoke.test.js.map +0 -1
  257. package/dist/orchviz/server/__tests__/write-handlers.test.d.ts +0 -24
  258. package/dist/orchviz/server/__tests__/write-handlers.test.d.ts.map +0 -1
  259. package/dist/orchviz/server/__tests__/write-handlers.test.js +0 -347
  260. package/dist/orchviz/server/__tests__/write-handlers.test.js.map +0 -1
  261. package/dist/orchviz/test-server-boot.d.ts +0 -28
  262. package/dist/orchviz/test-server-boot.d.ts.map +0 -1
  263. package/dist/orchviz/test-server-boot.js +0 -64
  264. package/dist/orchviz/test-server-boot.js.map +0 -1
@@ -0,0 +1,117 @@
1
+ /** All fields of an authored entry originate from this file. */
2
+ const ALL_AUTHORED = (fields) => Object.fromEntries(fields.map((f) => [f, "authored"]));
3
+ const AUTHORED_FIELDS = ["kind", "description", "intents", "whenToUse", "invocation", "requirements", "owner"];
4
+ function authored(partial) {
5
+ return {
6
+ aliases: [],
7
+ sourcePath: null,
8
+ inventoryId: null,
9
+ owner: "integration",
10
+ installedState: "unknown",
11
+ whenToUse: null,
12
+ invocation: { kind: "none", id: "none" },
13
+ requirements: [],
14
+ // Authored tool / context-/state-service entries are describe-only and are themselves the
15
+ // context/state providers — none needs to acquire a repo-context envelope before running.
16
+ contextRequirement: null,
17
+ support: {},
18
+ verification: { kind: "unknown" },
19
+ dependencies: { upstream: [], downstream: [] },
20
+ provenance: ALL_AUTHORED(AUTHORED_FIELDS),
21
+ ...partial,
22
+ };
23
+ }
24
+ /** Minimal, real authored set. Expanded in later slices as adapter evidence lands. */
25
+ export const AUTHORED_CAPABILITIES = [
26
+ // Tool entries are describe-only (no user-facing intents): they model the external
27
+ // integration + its requirement and stay discoverable via `list`/`explain`, but a user
28
+ // intent like "create a jira issue" must resolve to the INVOCABLE skill, not to a tool
29
+ // entry whose invocation is `none`. Wiring a tool's invocation to its skill entrypoint
30
+ // is adapter work (deferred), so until then the tool must not win intent resolution.
31
+ authored({
32
+ id: "jira",
33
+ kind: "tool",
34
+ description: "Jira issue tracking integration (surfaced via the mk:jira hub skills).",
35
+ intents: [],
36
+ requirements: [{ type: "mcp_or_app", id: "jira", provenance: "authored" }],
37
+ }),
38
+ authored({
39
+ id: "browser",
40
+ kind: "tool",
41
+ description: "Browser automation (surfaced via mk:agent-browser / mk:playwright-cli).",
42
+ intents: [],
43
+ requirements: [{ type: "external_binary", id: "chromium", provenance: "authored" }],
44
+ }),
45
+ authored({
46
+ id: "project-context",
47
+ kind: "context-service",
48
+ description: "Loads project conventions and context at session start.",
49
+ intents: ["load project context", "read project conventions"],
50
+ requirements: [{ type: "file_or_config", id: "docs/project-context.md", provenance: "authored" }],
51
+ }),
52
+ authored({
53
+ id: "wiki-recall",
54
+ kind: "context-service",
55
+ description: "Disciplined recall of long-term, provenance-bearing project knowledge.",
56
+ intents: ["search project knowledge", "recall prior decisions"],
57
+ // Provided by the `mewkit wiki context` subcommand — availability = CLI present,
58
+ // not a file on disk (a path probe would misreport a CLI subcommand as missing).
59
+ requirements: [{ type: "external_binary", id: "mewkit", provenance: "authored" }],
60
+ }),
61
+ authored({
62
+ id: "task-record",
63
+ kind: "state-service",
64
+ description: "Durable task/plan records under tasks/.",
65
+ intents: ["record task state", "resume a plan"],
66
+ requirements: [{ type: "file_or_config", id: "tasks", provenance: "authored" }],
67
+ }),
68
+ authored({
69
+ id: "trace-log",
70
+ kind: "state-service",
71
+ description: "Append-only trace/friction log for cross-session recall.",
72
+ intents: ["record friction", "audit trace"],
73
+ // Provided by the `mewkit trace` subcommand — availability = CLI present.
74
+ requirements: [{ type: "external_binary", id: "mewkit", provenance: "authored" }],
75
+ }),
76
+ ];
77
+ /**
78
+ * Flagship intent overlay for disk-backed capabilities. Batch 1: scout/research +
79
+ * plan→cook→review. When a built capability's id is here, its inferred keyword intents
80
+ * are REPLACED by this curated, bounded set and its `intents` provenance becomes
81
+ * `authored` — deterministic resolution for the highest-traffic flows. Keys must be real
82
+ * capability ids (validated by the live-harness test).
83
+ */
84
+ export const AUTHORED_INTENTS = {
85
+ // Batch 1: scout/research + plan→cook→review.
86
+ "mk:scout": { intents: ["scout the codebase", "find related files", "orient in the code", "locate code"], aliases: ["scout"] },
87
+ "mk:research": { intents: ["research a library", "evaluate a technology", "gather best practices"], aliases: ["research"] },
88
+ "mk:plan-creator": { intents: ["plan this feature", "create a plan", "draft a spec", "design the approach"], aliases: ["plan"] },
89
+ "mk:cook": { intents: ["implement this feature", "build this", "write the code", "make this change"], aliases: ["cook", "implement"] },
90
+ "mk:review": { intents: ["review this code", "code review", "check before shipping", "audit the change"], aliases: ["review"] },
91
+ // Batch 2: fix/test/ship + wiki authoring + memory. jira/browser stay owned by their
92
+ // authored tool entries; wiki-recall (read service) keeps the recall intents, so mk:wiki
93
+ // here owns only the authoring verbs — no phrase collides across capabilities.
94
+ "mk:fix": { intents: ["fix this bug", "fix the failing test", "debug this error"], aliases: ["fix"] },
95
+ "mk:testing": { intents: ["run the tests", "write tests for this", "check test coverage"], aliases: ["test"] },
96
+ "mk:ship": { intents: ["ship this change", "open a pull request", "create the PR"], aliases: ["ship"] },
97
+ "mk:wiki": { intents: ["propose a wiki page", "initialize the wiki", "approve a wiki page"], aliases: ["wiki"] },
98
+ "mk:memory": { intents: ["remember this decision", "recall a past fix", "prune old memory"], aliases: ["memory"] },
99
+ };
100
+ /**
101
+ * Capabilities that must acquire a task-scoped repo-context envelope before source-grounded work
102
+ * (Phase 5, slice 2). Applied as an authored overlay in build-capabilities. Only the
103
+ * source-grounded flagship flows are here — scout/research/planning + build/fix/test + review.
104
+ * Ship (VCS operation), memory, wiki authoring, and the external-tool entries need no repo
105
+ * grounding before they run, so they are deliberately absent. Keys must be real capability ids
106
+ * (validated by the live-harness test).
107
+ */
108
+ export const AUTHORED_CONTEXT_REQUIREMENTS = {
109
+ "mk:scout": { reason: "orients in the code by reading task-relevant files" },
110
+ "mk:research": { reason: "grounds findings in the repository's actual code and config" },
111
+ "mk:plan-creator": { reason: "plans against the real affected files and their revisions" },
112
+ "mk:cook": { reason: "edits source and must verify against fresh, correctly-scoped evidence" },
113
+ "mk:review": { reason: "reviews a change against the repository state it targets" },
114
+ "mk:fix": { reason: "proves a bug's cause in the actual source before changing behavior" },
115
+ "mk:testing": { reason: "writes/runs tests against the real code under test" },
116
+ };
117
+ //# sourceMappingURL=capability-authored.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-authored.js","sourceRoot":"","sources":["../../src/core/capability-authored.ts"],"names":[],"mappings":"AAOA,gEAAgE;AAChE,MAAM,YAAY,GAAG,CAAC,MAAgB,EAA8B,EAAE,CACrE,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,UAAwB,CAAC,CAAC,CAAC,CAAC;AAEtE,MAAM,eAAe,GAAG,CAAC,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AAE/G,SAAS,QAAQ,CAChB,OACyB;IAEzB,OAAO;QACN,OAAO,EAAE,EAAE;QACX,UAAU,EAAE,IAAI;QAChB,WAAW,EAAE,IAAI;QACjB,KAAK,EAAE,aAAa;QACpB,cAAc,EAAE,SAAS;QACzB,SAAS,EAAE,IAAI;QACf,UAAU,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE;QACxC,YAAY,EAAE,EAAE;QAChB,0FAA0F;QAC1F,0FAA0F;QAC1F,kBAAkB,EAAE,IAAI;QACxB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACjC,YAAY,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;QAC9C,UAAU,EAAE,YAAY,CAA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0 +1,13 @@
1
+ import { type CapabilityEntry, type CapabilityManifest } from "./capability.js";
2
+ export declare const CODEX_CAPABILITY_SNAPSHOT_FILENAME = "capabilities.json";
3
+ export interface CapabilitySource {
4
+ kind: "claude-directory" | "codex-snapshot";
5
+ path: string;
6
+ entries: CapabilityEntry[];
7
+ }
8
+ export declare function capabilityManifestFromClaude(claudeDir: string): CapabilityManifest;
9
+ export declare function readCapabilitySnapshot(snapshotPath: string): CapabilityEntry[];
10
+ /** Source preference is intentional: a live `.claude/` installation is canonical; a Codex
11
+ * snapshot is only the portable projection when that source surface is absent. */
12
+ export declare function findCapabilitySource(cwd?: string): CapabilitySource | null;
13
+ //# sourceMappingURL=capability-snapshot.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-snapshot.d.ts","sourceRoot":"","sources":["../../src/core/capability-snapshot.ts"],"names":[],"mappings":"AAOA,OAAO,EAAkD,KAAK,eAAe,EAAE,KAAK,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhI,eAAO,MAAM,kCAAkC,sBAAsB,CAAC;AAEtE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,kBAAkB,GAAG,gBAAgB,CAAC;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,EAAE,CAAC;CAC3B;AAED,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,CAElF;AAWD,wBAAgB,sBAAsB,CAAC,YAAY,EAAE,MAAM,GAAG,eAAe,EAAE,CAa9E;AAED;kFACkF;AAClF,wBAAgB,oBAAoB,CAAC,GAAG,SAAgB,GAAG,gBAAgB,GAAG,IAAI,CAgBjF"}
@@ -0,0 +1,53 @@
1
+ // Provider projections need the same semantic manifest as a `.claude/` install, but must not
2
+ // depend on that source tree remaining present. A snapshot is data-only: provider-native
3
+ // invocation remains owned by trusted adapter constants.
4
+ import fs from "node:fs";
5
+ import { homedir } from "node:os";
6
+ import path from "node:path";
7
+ import { buildCapabilities } from "./build-capabilities.js";
8
+ import { CapabilityManifestSchema, KNOWN_INVOCATION_IDS } from "./capability.js";
9
+ export const CODEX_CAPABILITY_SNAPSHOT_FILENAME = "capabilities.json";
10
+ export function capabilityManifestFromClaude(claudeDir) {
11
+ return { schemaVersion: "1.0", entries: buildCapabilities(claudeDir) };
12
+ }
13
+ function validateSnapshot(manifest, snapshotPath) {
14
+ for (const entry of manifest.entries) {
15
+ if (!KNOWN_INVOCATION_IDS.has(entry.invocation.id)) {
16
+ throw new Error(`Capability snapshot at ${snapshotPath} contains unknown invocation id for ${entry.id}. Regenerate it with \`npx mewkit migrate codex\`.`);
17
+ }
18
+ }
19
+ return manifest.entries;
20
+ }
21
+ export function readCapabilitySnapshot(snapshotPath) {
22
+ let raw;
23
+ try {
24
+ raw = JSON.parse(fs.readFileSync(snapshotPath, "utf-8"));
25
+ }
26
+ catch (error) {
27
+ const detail = error instanceof Error ? error.message : String(error);
28
+ throw new Error(`Could not read capability snapshot at ${snapshotPath}: ${detail}. Regenerate it with \`npx mewkit migrate codex\`.`);
29
+ }
30
+ const parsed = CapabilityManifestSchema.safeParse(raw);
31
+ if (!parsed.success) {
32
+ throw new Error(`Capability snapshot at ${snapshotPath} is invalid: ${parsed.error.issues[0]?.message ?? "schema validation failed"}. Regenerate it with \`npx mewkit migrate codex\`.`);
33
+ }
34
+ return validateSnapshot(parsed.data, snapshotPath);
35
+ }
36
+ /** Source preference is intentional: a live `.claude/` installation is canonical; a Codex
37
+ * snapshot is only the portable projection when that source surface is absent. */
38
+ export function findCapabilitySource(cwd = process.cwd()) {
39
+ const claudeDir = path.join(cwd, ".claude");
40
+ if (fs.existsSync(claudeDir) && fs.statSync(claudeDir).isDirectory()) {
41
+ return { kind: "claude-directory", path: claudeDir, entries: buildCapabilities(claudeDir) };
42
+ }
43
+ const projectSnapshot = path.join(cwd, ".codex", CODEX_CAPABILITY_SNAPSHOT_FILENAME);
44
+ if (fs.existsSync(projectSnapshot)) {
45
+ return { kind: "codex-snapshot", path: projectSnapshot, entries: readCapabilitySnapshot(projectSnapshot) };
46
+ }
47
+ const globalSnapshot = path.join(homedir(), ".codex", CODEX_CAPABILITY_SNAPSHOT_FILENAME);
48
+ if (fs.existsSync(globalSnapshot)) {
49
+ return { kind: "codex-snapshot", path: globalSnapshot, entries: readCapabilitySnapshot(globalSnapshot) };
50
+ }
51
+ return null;
52
+ }
53
+ //# sourceMappingURL=capability-snapshot.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-snapshot.js","sourceRoot":"","sources":["../../src/core/capability-snapshot.ts"],"names":[],"mappings":"AAAA,6FAA6F;AAC7F,yFAAyF;AACzF,yDAAyD;AACzD,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAiD,MAAM,iBAAiB,CAAC;AAEhI,MAAM,CAAC,MAAM,kCAAkC,GAAG,mBAAmB,CAAC;AAQtE,MAAM,UAAU,4BAA4B,CAAC,SAAiB;IAC7D,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,EAAE,CAAC;AACxE,CAAC;AAED,SAAS,gBAAgB,CAAC,QAA4B,EAAE,YAAoB;IAC3E,KAAK,MAAM,KAAK,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,CAAC;YACpD,MAAM,IAAI,KAAK,CAAC,0BAA0B,YAAY,uCAAuC,KAAK,CAAC,EAAE,oDAAoD,CAAC,CAAC;QAC5J,CAAC;IACF,CAAC;IACD,OAAO,QAAQ,CAAC,OAAO,CAAC;AACzB,CAAC;AAED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