@open-agent-toolkit/cli 0.2.62 → 0.2.64

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 (145) hide show
  1. package/assets/bundle-metadata.json +1 -1
  2. package/assets/docs/cli-utilities/config-and-local-state.md +1 -0
  3. package/assets/docs/cli-utilities/configuration.md +10 -8
  4. package/assets/docs/cli-utilities/project-log.md +16 -0
  5. package/assets/docs/cli-utilities/tool-packs.md +83 -0
  6. package/assets/docs/cli-utilities/workflow-gates.md +124 -16
  7. package/assets/docs/contributing/skills.md +42 -7
  8. package/assets/docs/provider-sync/commands.md +3 -0
  9. package/assets/docs/provider-sync/instruction-sync.md +107 -0
  10. package/assets/docs/provider-sync/manifest-and-drift.md +105 -0
  11. package/assets/docs/reference/cli-reference.md +16 -6
  12. package/assets/docs/reference/oat-directory-structure.md +32 -31
  13. package/assets/docs/workflows/projects/lifecycle.md +45 -0
  14. package/assets/docs/workflows/projects/picking-up-projects.md +14 -0
  15. package/assets/docs/workflows/skills/explainer-kit.md +10 -4
  16. package/assets/docs/workflows/skills/repo-improve.md +15 -1
  17. package/assets/public-package-versions.json +4 -4
  18. package/assets/skills/create-agnostic-skill/SKILL.md +9 -7
  19. package/assets/skills/create-agnostic-skill/references/skill-template.md +9 -7
  20. package/assets/skills/oat-explainer-kit/SKILL.md +14 -1
  21. package/assets/skills/oat-explainer-kit/references/config-contract.md +12 -0
  22. package/assets/skills/oat-explainer-kit/references/lifecycle-contract.md +57 -10
  23. package/assets/skills/oat-explainer-kit/scripts/check-terminal-outcome.mjs +28 -5
  24. package/assets/skills/oat-explainer-kit/scripts/probe-recap-seams.mjs +371 -0
  25. package/assets/skills/oat-explainer-kit/scripts/resolve-intent.mjs +123 -1
  26. package/assets/skills/oat-project-autonomous/SKILL.md +10 -1
  27. package/assets/skills/oat-project-autonomous/references/gate-inventory.md +122 -121
  28. package/assets/skills/oat-project-complete/SKILL.md +134 -4
  29. package/assets/skills/oat-project-document/references/docs/autonomy-contract.md +122 -121
  30. package/assets/skills/oat-project-implement/SKILL.md +1 -1
  31. package/assets/skills/oat-project-implement/references/completion-and-closeout.md +38 -6
  32. package/assets/skills/oat-project-implement/references/docs/autonomy-contract.md +122 -121
  33. package/assets/skills/oat-project-lite/references/docs/autonomy-contract.md +122 -121
  34. package/assets/skills/oat-project-next/SKILL.md +62 -19
  35. package/assets/skills/oat-project-plan/SKILL.md +31 -5
  36. package/assets/skills/oat-project-pr-final/SKILL.md +281 -6
  37. package/assets/skills/oat-project-pr-final/references/docs/autonomy-contract.md +122 -121
  38. package/assets/skills/oat-project-progress/SKILL.md +12 -3
  39. package/assets/skills/oat-project-quick-start/SKILL.md +264 -4
  40. package/assets/skills/oat-project-quick-start/references/docs/autonomy-contract.md +122 -121
  41. package/assets/skills/oat-project-summary/SKILL.md +34 -23
  42. package/assets/skills/oat-repo-improve/SKILL.md +40 -5
  43. package/assets/skills/oat-repo-improve/references/plan-template.md +84 -7
  44. package/dist/agents/canonical/resolve.d.ts.map +1 -1
  45. package/dist/agents/canonical/resolve.js +25 -4
  46. package/dist/commands/config/index.d.ts +1 -0
  47. package/dist/commands/config/index.d.ts.map +1 -1
  48. package/dist/commands/config/index.js +401 -18
  49. package/dist/commands/doctor/index.d.ts +7 -0
  50. package/dist/commands/doctor/index.d.ts.map +1 -1
  51. package/dist/commands/doctor/index.js +10 -2
  52. package/dist/commands/gate/index.d.ts +3 -1
  53. package/dist/commands/gate/index.d.ts.map +1 -1
  54. package/dist/commands/gate/index.js +699 -211
  55. package/dist/commands/init/tools/index.d.ts.map +1 -1
  56. package/dist/commands/init/tools/index.js +68 -36
  57. package/dist/commands/init/tools/shared/skill-script-references.d.ts +126 -0
  58. package/dist/commands/init/tools/shared/skill-script-references.d.ts.map +1 -0
  59. package/dist/commands/init/tools/shared/skill-script-references.js +311 -0
  60. package/dist/commands/instructions/instructions.types.d.ts +63 -0
  61. package/dist/commands/instructions/instructions.types.d.ts.map +1 -1
  62. package/dist/commands/instructions/instructions.utils.d.ts +51 -2
  63. package/dist/commands/instructions/instructions.utils.d.ts.map +1 -1
  64. package/dist/commands/instructions/instructions.utils.js +201 -4
  65. package/dist/commands/instructions/sync/sync.d.ts.map +1 -1
  66. package/dist/commands/instructions/sync/sync.js +12 -1
  67. package/dist/commands/instructions/validate/validate.d.ts.map +1 -1
  68. package/dist/commands/instructions/validate/validate.js +12 -1
  69. package/dist/commands/project/log/append.d.ts +195 -0
  70. package/dist/commands/project/log/append.d.ts.map +1 -1
  71. package/dist/commands/project/log/append.js +1034 -11
  72. package/dist/commands/shared/frontmatter.d.ts +51 -0
  73. package/dist/commands/shared/frontmatter.d.ts.map +1 -1
  74. package/dist/commands/shared/frontmatter.js +118 -6
  75. package/dist/commands/status/index.d.ts.map +1 -1
  76. package/dist/commands/status/index.js +5 -3
  77. package/dist/commands/sync/index.d.ts +14 -0
  78. package/dist/commands/sync/index.d.ts.map +1 -1
  79. package/dist/commands/sync/index.js +21 -0
  80. package/dist/commands/tools/info/index.d.ts.map +1 -1
  81. package/dist/commands/tools/info/index.js +14 -1
  82. package/dist/commands/tools/info/info-tool.d.ts +12 -0
  83. package/dist/commands/tools/info/info-tool.d.ts.map +1 -1
  84. package/dist/commands/tools/info/info-tool.js +54 -6
  85. package/dist/commands/tools/info/skill-views.d.ts +86 -0
  86. package/dist/commands/tools/info/skill-views.d.ts.map +1 -0
  87. package/dist/commands/tools/info/skill-views.js +383 -0
  88. package/dist/commands/tools/install/index.d.ts.map +1 -1
  89. package/dist/commands/tools/install/index.js +3 -25
  90. package/dist/commands/tools/list/list-tools.d.ts +2 -0
  91. package/dist/commands/tools/list/list-tools.d.ts.map +1 -1
  92. package/dist/commands/tools/list/list-tools.js +23 -4
  93. package/dist/commands/tools/remove/index.d.ts.map +1 -1
  94. package/dist/commands/tools/remove/index.js +35 -42
  95. package/dist/commands/tools/remove/remove-tools.d.ts +3 -2
  96. package/dist/commands/tools/remove/remove-tools.d.ts.map +1 -1
  97. package/dist/commands/tools/remove/remove-tools.js +14 -4
  98. package/dist/commands/tools/shared/auto-sync.d.ts +12 -1
  99. package/dist/commands/tools/shared/auto-sync.d.ts.map +1 -1
  100. package/dist/commands/tools/shared/auto-sync.js +20 -4
  101. package/dist/commands/tools/shared/format-pack-inventory.d.ts +12 -1
  102. package/dist/commands/tools/shared/format-pack-inventory.d.ts.map +1 -1
  103. package/dist/commands/tools/shared/format-pack-inventory.js +48 -6
  104. package/dist/commands/tools/shared/in-process-sync.d.ts +11 -0
  105. package/dist/commands/tools/shared/in-process-sync.d.ts.map +1 -0
  106. package/dist/commands/tools/shared/in-process-sync.js +79 -0
  107. package/dist/commands/tools/shared/pack-evidence.d.ts +78 -2
  108. package/dist/commands/tools/shared/pack-evidence.d.ts.map +1 -1
  109. package/dist/commands/tools/shared/pack-evidence.js +96 -2
  110. package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts +11 -0
  111. package/dist/commands/tools/shared/pack-lifecycle-outcome.d.ts.map +1 -1
  112. package/dist/commands/tools/shared/pack-lifecycle-outcome.js +24 -3
  113. package/dist/commands/tools/shared/pack-provider-evidence.d.ts +73 -0
  114. package/dist/commands/tools/shared/pack-provider-evidence.d.ts.map +1 -0
  115. package/dist/commands/tools/shared/pack-provider-evidence.js +161 -0
  116. package/dist/commands/tools/shared/provider-context.d.ts +88 -0
  117. package/dist/commands/tools/shared/provider-context.d.ts.map +1 -0
  118. package/dist/commands/tools/shared/provider-context.js +77 -0
  119. package/dist/commands/tools/shared/provider-reachability.d.ts +93 -0
  120. package/dist/commands/tools/shared/provider-reachability.d.ts.map +1 -0
  121. package/dist/commands/tools/shared/provider-reachability.js +358 -0
  122. package/dist/commands/tools/shared/sync-evidence.d.ts +57 -0
  123. package/dist/commands/tools/shared/sync-evidence.d.ts.map +1 -0
  124. package/dist/commands/tools/shared/sync-evidence.js +147 -0
  125. package/dist/commands/tools/update/index.d.ts +0 -4
  126. package/dist/commands/tools/update/index.d.ts.map +1 -1
  127. package/dist/commands/tools/update/index.js +22 -40
  128. package/dist/commands/tools/update/update-tools.d.ts.map +1 -1
  129. package/dist/commands/tools/update/update-tools.js +23 -8
  130. package/dist/config/json.d.ts +36 -0
  131. package/dist/config/json.d.ts.map +1 -1
  132. package/dist/config/json.js +135 -3
  133. package/dist/config/oat-config.d.ts +41 -0
  134. package/dist/config/oat-config.d.ts.map +1 -1
  135. package/dist/config/oat-config.js +111 -0
  136. package/dist/drift/index.d.ts +2 -0
  137. package/dist/drift/index.d.ts.map +1 -1
  138. package/dist/drift/index.js +1 -0
  139. package/dist/drift/skill-view-diagnostic.d.ts +197 -0
  140. package/dist/drift/skill-view-diagnostic.d.ts.map +1 -0
  141. package/dist/drift/skill-view-diagnostic.js +343 -0
  142. package/dist/validation/skills.d.ts +1 -0
  143. package/dist/validation/skills.d.ts.map +1 -1
  144. package/dist/validation/skills.js +181 -19
  145. package/package.json +2 -2
@@ -56,6 +56,57 @@ export declare function parseFrontmatterScalarFields(frontmatter: string, fields
56
56
  */
57
57
  export declare function parseGeneratedTime(value: string): number;
58
58
  export declare function parseFrontmatterField(filePath: string, field: string): Promise<string>;
59
+ /**
60
+ * A skill or agent frontmatter block reduced to the fields that carry a
61
+ * version, in the one shape every version read consumes.
62
+ *
63
+ * `malformed` marks input that cannot be trusted to carry a version at all:
64
+ * the YAML document has errors (including duplicate keys), or `metadata` is
65
+ * present but is not a map. A malformed block resolves to `null` rather than
66
+ * to a guessed value.
67
+ *
68
+ * `unusableVersionDeclaration` records that a `version` key was present at
69
+ * either position but produced no usable value (empty, or a non-string scalar
70
+ * such as `1.10`, which YAML reads as the number 1.1). Validation needs that
71
+ * distinction: a skill that declares nothing is unversioned, while a skill
72
+ * that declares an unusable version is broken — including when the *other*
73
+ * position still resolves. It is carried here so no caller has to re-read the
74
+ * block with a regex.
75
+ */
76
+ export interface ParsedSkillFrontmatter {
77
+ version?: string;
78
+ metadata?: {
79
+ version?: string;
80
+ };
81
+ malformed: boolean;
82
+ unusableVersionDeclaration: boolean;
83
+ }
84
+ export interface SkillVersionConflict {
85
+ metadata: string;
86
+ topLevel: string;
87
+ }
88
+ export interface ResolvedSkillVersion {
89
+ version: string;
90
+ source: 'metadata' | 'top-level';
91
+ conflict?: SkillVersionConflict;
92
+ }
93
+ /**
94
+ * Parse a raw frontmatter block into the shared version-carrying shape.
95
+ *
96
+ * Uses the `yaml` package already imported by this module so that
97
+ * `metadata.version` is read by a real YAML parser; a regex or
98
+ * indentation-based reader cannot tell a nested key from a top-level one.
99
+ */
100
+ export declare function parseSkillFrontmatter(block: string): ParsedSkillFrontmatter;
101
+ /**
102
+ * Resolve the canonical version with `metadata.version` taking precedence over
103
+ * the deprecated top-level `version` alias.
104
+ *
105
+ * When both are present and differ the resolver still reports the
106
+ * metadata value, but flags the conflict so callers that must not guess (the
107
+ * validators, canonical role identity) can reject it.
108
+ */
109
+ export declare function resolveSkillVersion(parsed: ParsedSkillFrontmatter): ResolvedSkillVersion | null;
59
110
  export declare function getSkillVersion(skillDir: string): Promise<string | null>;
60
111
  export declare function getAgentVersion(agentPath: string): Promise<string | null>;
61
112
  //# sourceMappingURL=frontmatter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/frontmatter.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,YAAI,gBAAgB,EAAE,cAAc,CAAU,CAAC;AAE/E,eAAO,MAAM,oBAAoB,YAC/B,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,CACP,CAAC;AAEX,eAAO,MAAM,gCAAgC,YAC3C,UAAU,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mCAAmC,EACnC,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACx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,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGlE;AAED,wBAAgB,mBAAmB,CACjC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,MAAM,GACZ,MAAM,GAAG,IAAI,CAKf;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,SAAS,MAAM,EAAE,GACxB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CA4BpD;AAED;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIxD;AAED,wBAAsB,qBAAqB,CACzC,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC,CASjB;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAED,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
1
+ {"version":3,"file":"frontmatter.d.ts","sourceRoot":"","sources":["../../../src/commands/shared/frontmatter.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,mBAAmB,YAAI,gBAAgB,EAAE,cAAc,CAAU,CAAC;AAE/E,eAAO,MAAM,oBAAoB,YAC/B,WAAW,EACX,MAAM,EACN,QAAQ,EACR,MAAM,EACN,WAAW,EACX,eAAe,CACP,CAAC;AAEX,eAAO,MAAM,gCAAgC,YAC3C,UAAU,EACV,YAAY,EACZ,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,mCAAmC,EACnC,WAAW,EACX,kBAAkB,EAClB,YAAY,EACZ,mBAAmB,EACnB,eAAe,EACf,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,sBAAsB,EACtB,oBAAoB,EACpB,wBAAwB,EACxB,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E,MAAM,GACf,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAKxB;AAED,wBAAsB,eAAe,CACnC,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGxB"}
@@ -201,13 +201,125 @@ export async function parseFrontmatterField(filePath, field) {
201
201
  return '';
202
202
  }
203
203
  }
204
+ /**
205
+ * Read a frontmatter value that is a plain, undecorated string.
206
+ *
207
+ * A tagged (`!!str 1.2.3`) or anchored (`&pin 1.2.3`) scalar is rejected by the
208
+ * explicit checks below, and an aliased value (`*pin`) is rejected because an
209
+ * alias node is not a scalar at all. Folded (`>-`) and literal (`|`) block
210
+ * scalars are none of those: they are ordinary string scalars and resolve
211
+ * normally.
212
+ *
213
+ * Non-string scalars are deliberately rejected rather than stringified: YAML
214
+ * reads `version: 1.10` as the number `1.1`, so accepting numbers would report
215
+ * a version the author never wrote.
216
+ */
217
+ function scalarStringValue(node) {
218
+ if (!isScalar(node) ||
219
+ node.anchor !== undefined ||
220
+ node.tag !== undefined ||
221
+ typeof node.value !== 'string') {
222
+ return undefined;
223
+ }
224
+ const trimmed = node.value.trim();
225
+ return trimmed.length > 0 ? trimmed : undefined;
226
+ }
227
+ function hasKey(map, key) {
228
+ return map.items.some((pair) => isScalar(pair.key) && pair.key.value === key);
229
+ }
230
+ function uniqueMapValue(map, key) {
231
+ const matches = map.items.filter((pair) => isScalar(pair.key) && pair.key.value === key);
232
+ return matches.length === 1 ? matches[0]?.value : undefined;
233
+ }
234
+ /**
235
+ * Parse a raw frontmatter block into the shared version-carrying shape.
236
+ *
237
+ * Uses the `yaml` package already imported by this module so that
238
+ * `metadata.version` is read by a real YAML parser; a regex or
239
+ * indentation-based reader cannot tell a nested key from a top-level one.
240
+ */
241
+ export function parseSkillFrontmatter(block) {
242
+ const document = YAML.parseDocument(block, { uniqueKeys: true });
243
+ if (document.errors.length > 0) {
244
+ return { malformed: true, unusableVersionDeclaration: false };
245
+ }
246
+ if (!isMap(document.contents)) {
247
+ return { malformed: false, unusableVersionDeclaration: false };
248
+ }
249
+ const version = scalarStringValue(uniqueMapValue(document.contents, 'version'));
250
+ const parsed = {
251
+ malformed: false,
252
+ unusableVersionDeclaration: version === undefined && hasKey(document.contents, 'version'),
253
+ };
254
+ if (version !== undefined) {
255
+ parsed.version = version;
256
+ }
257
+ const metadata = uniqueMapValue(document.contents, 'metadata');
258
+ if (metadata !== undefined) {
259
+ if (!isMap(metadata)) {
260
+ return {
261
+ malformed: true,
262
+ unusableVersionDeclaration: parsed.unusableVersionDeclaration,
263
+ };
264
+ }
265
+ const metadataVersion = scalarStringValue(uniqueMapValue(metadata, 'version'));
266
+ parsed.unusableVersionDeclaration =
267
+ parsed.unusableVersionDeclaration ||
268
+ (metadataVersion === undefined && hasKey(metadata, 'version'));
269
+ parsed.metadata =
270
+ metadataVersion === undefined ? {} : { version: metadataVersion };
271
+ }
272
+ return parsed;
273
+ }
274
+ /**
275
+ * Resolve the canonical version with `metadata.version` taking precedence over
276
+ * the deprecated top-level `version` alias.
277
+ *
278
+ * When both are present and differ the resolver still reports the
279
+ * metadata value, but flags the conflict so callers that must not guess (the
280
+ * validators, canonical role identity) can reject it.
281
+ */
282
+ export function resolveSkillVersion(parsed) {
283
+ if (parsed.malformed) {
284
+ return null;
285
+ }
286
+ const metadataVersion = parsed.metadata?.version;
287
+ const topLevel = parsed.version;
288
+ if (metadataVersion !== undefined) {
289
+ if (topLevel !== undefined && topLevel !== metadataVersion) {
290
+ return {
291
+ version: metadataVersion,
292
+ source: 'metadata',
293
+ conflict: { metadata: metadataVersion, topLevel },
294
+ };
295
+ }
296
+ return { version: metadataVersion, source: 'metadata' };
297
+ }
298
+ if (topLevel !== undefined) {
299
+ return { version: topLevel, source: 'top-level' };
300
+ }
301
+ return null;
302
+ }
303
+ async function readResolvedVersion(filePath) {
304
+ let content;
305
+ try {
306
+ content = await readFile(filePath, 'utf8');
307
+ }
308
+ catch {
309
+ return null;
310
+ }
311
+ const block = getFrontmatterBlock(content);
312
+ if (!block)
313
+ return null;
314
+ return resolveSkillVersion(parseSkillFrontmatter(block));
315
+ }
204
316
  export async function getSkillVersion(skillDir) {
205
- // parseFrontmatterField() returns '' when SKILL.md is missing or unreadable,
206
- // so read failures are normalized to null here.
207
- const version = await parseFrontmatterField(join(skillDir, 'SKILL.md'), 'version');
208
- return version.length > 0 ? version : null;
317
+ // Missing, unreadable, malformed, and empty frontmatter all normalize to
318
+ // null here so callers keep one "no comparable version" contract.
319
+ const resolved = await readResolvedVersion(join(skillDir, 'SKILL.md'));
320
+ return resolved?.version ?? null;
209
321
  }
210
322
  export async function getAgentVersion(agentPath) {
211
- const version = await parseFrontmatterField(agentPath, 'version');
212
- return version.length > 0 ? version : null;
323
+ const resolved = await readResolvedVersion(agentPath);
324
+ return resolved?.version ?? null;
213
325
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/status/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAEL,KAAK,WAAW,EAChB,KAAK,yBAAyB,EAC/B,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EACL,KAAK,cAAc,EAIpB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAIL,KAAK,sBAAsB,EAC5B,MAAM,2CAA2C,CAAC;AAEnD,OAAO,EAEL,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAGlB,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EAIL,KAAK,kBAAkB,EAEvB,KAAK,aAAa,EAEnB,MAAM,uCAAuC,CAAC;AAU/C,OAAO,EAGL,KAAK,UAAU,EAChB,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,WAAW,EAIjB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,KAAK,cAAc,EAGnB,KAAK,+BAA+B,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CAAC;IACrE,kBAAkB,EAAE,CAClB,OAAO,EAAE,yBAAyB,KAC/B,OAAO,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED,UAAU,oBAAoB;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,WAAW,CAAC;IACpB,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,IAAI,EAAE,YAAY,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB,CAAC;CACH;AA+pCD,wBAAgB,mBAAmB,CACjC,SAAS,GAAE,OAAO,CAAC,kBAAkB,CAAM,GAC1C,OAAO,CA2BT"}
@@ -274,7 +274,7 @@ function shouldReportPjmAdoption(adoption, states) {
274
274
  const pjm = states.find(({ pack }) => pack === 'project-management');
275
275
  return (pjm?.scopes ?? []).some(({ scope }) => scope === 'project');
276
276
  }
277
- async function collectPackReport(scopeRoots, unavailableScopes, userAgentCoverage, dependencies) {
277
+ async function collectPackReport(scopeRoots, unavailableScopes, userAgentCoverage, providerContexts, dependencies) {
278
278
  const roots = {
279
279
  ...(scopeRoots.has('project')
280
280
  ? { projectRoot: scopeRoots.get('project') }
@@ -322,7 +322,7 @@ async function collectPackReport(scopeRoots, unavailableScopes, userAgentCoverag
322
322
  const states = inventories
323
323
  .map((inventory) => toStatusPackState(inventory, roots))
324
324
  .filter((state) => state !== null);
325
- const evidence = packEvidenceBlock(inventories.map((canonical) => projectRenderablePackEvidence(canonical, roots)));
325
+ const evidence = packEvidenceBlock(inventories.map((canonical) => projectRenderablePackEvidence(canonical, roots, providerContexts)));
326
326
  const projectRoot = scopeRoots.get('project');
327
327
  if (!projectRoot) {
328
328
  return {
@@ -699,7 +699,9 @@ async function runStatusCommand(context, dependencies, options = {}) {
699
699
  ? 'all'
700
700
  : scopeCollections.some((collection) => collection.userAgentMaterializationCoverage === 'bundled')
701
701
  ? 'bundled'
702
- : 'none', dependencies);
702
+ : 'none', scopeCollections
703
+ .map(({ providerContext }) => providerContext)
704
+ .filter((providerContext) => providerContext !== null), dependencies);
703
705
  if (context.json) {
704
706
  const payload = {
705
707
  scope: context.scope,
@@ -1,3 +1,4 @@
1
+ import { type CommandContext } from '../../app/command-context.js';
1
2
  import { type SyncConfig } from '../../config/index.js';
2
3
  import { type ProviderScopeContext } from '../../providers/shared/index.js';
3
4
  import { type CanonicalScanTarget, type ConcreteScope } from '../../shared/types.js';
@@ -15,5 +16,18 @@ type ContextualSyncDependencies = Omit<SyncCommandDependencies, 'computeSyncPlan
15
16
  }) => Promise<ProviderScopeContext>;
16
17
  };
17
18
  export declare function createSyncCommand(overrides?: Partial<ContextualSyncDependencies>): Command;
19
+ /**
20
+ * Runs the sync command in-process against a caller-supplied context.
21
+ *
22
+ * The tools lifecycle uses this instead of spawning `oat sync --json` and
23
+ * parsing its stdout: the caller passes a JSON-capturing logger and receives
24
+ * the evidence object the sync run already builds, with no serialization
25
+ * round trip and no subprocess. Canonical path filters are validated here
26
+ * with the same rules the CLI flags use.
27
+ */
28
+ export declare function runSyncInProcess(context: CommandContext, filter?: {
29
+ installedCanonicalPaths?: string[];
30
+ removedCanonicalPaths?: string[];
31
+ }, overrides?: Partial<ContextualSyncDependencies>): Promise<void>;
18
32
  export {};
19
33
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/sync/index.ts"],"names":[],"mappings":"AAcA,OAAO,EAGL,KAAK,UAAU,EAEhB,MAAM,eAAe,CAAC;AAWvB,OAAO,EAOL,KAAK,oBAAoB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAEL,KAAK,mBAAmB,EACxB,KAAK,aAAa,EACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAI5C,OAAO,KAAK,EACV,aAAa,EAEb,uBAAuB,EAGxB,MAAM,cAAc,CAAC;AAEt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uBAAuB,EAGxB,MAAM,cAAc,CAAC;AAEtB,KAAK,0BAA0B,GAAG,IAAI,CACpC,uBAAuB,EACvB,iBAAiB,GAAG,eAAe,CACpC,GAAG;IACF,aAAa,EAAE,CACb,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,aAAa,EACpB,OAAO,CAAC,EAAE,SAAS,mBAAmB,EAAE,KACrC,UAAU,CAAC,uBAAuB,CAAC,eAAe,CAAC,CAAC,CAAC;IAC1D,eAAe,EAAE,CACf,IAAI,EAAE,UAAU,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG;QAChE,sCAAsC,CAAC,EAAE,QAAQ,CAC/C,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAClC,CAAC;KACH,KACE,UAAU,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC5D,2BAA2B,CAAC,EAAE,CAAC,KAAK,EAAE;QACpC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,MAAM,EAAE,UAAU,CAAC;KACpB,KAAK,OAAO,CAAC,oBAAoB,CAAC,CAAC;CACrC,CAAC;AA2fF,wBAAgB,iBAAiB,CAC/B,SAAS,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAClD,OAAO,CA+DT;AAED;;;;;;;;GAQG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,cAAc,EACvB,MAAM,CAAC,EAAE;IACP,uBAAuB,CAAC,EAAE,MAAM,EAAE,CAAC;IACnC,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;CAClC,EACD,SAAS,GAAE,OAAO,CAAC,0BAA0B,CAAM,GAClD,OAAO,CAAC,IAAI,CAAC,CAsBf"}
@@ -409,3 +409,24 @@ export function createSyncCommand(overrides = {}) {
409
409
  : undefined);
410
410
  });
411
411
  }
412
+ /**
413
+ * Runs the sync command in-process against a caller-supplied context.
414
+ *
415
+ * The tools lifecycle uses this instead of spawning `oat sync --json` and
416
+ * parsing its stdout: the caller passes a JSON-capturing logger and receives
417
+ * the evidence object the sync run already builds, with no serialization
418
+ * round trip and no subprocess. Canonical path filters are validated here
419
+ * with the same rules the CLI flags use.
420
+ */
421
+ export async function runSyncInProcess(context, filter, overrides = {}) {
422
+ const installPaths = validateInstallCanonicalPaths(filter?.installedCanonicalPaths);
423
+ const removePaths = validateRemoveCanonicalPaths(filter?.removedCanonicalPaths);
424
+ if (installPaths?.length && removePaths?.length) {
425
+ throw new CliError('--install-canonical and --remove-canonical cannot be combined', 1);
426
+ }
427
+ await runSyncCommand(context, { ...defaultDependencies(), ...overrides }, installPaths?.length
428
+ ? { mode: 'install', paths: installPaths }
429
+ : removePaths?.length
430
+ ? { mode: 'remove', paths: removePaths }
431
+ : undefined);
432
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,aAAa,CAAC;AA2DrB,wBAAgB,sBAAsB,CACpC,YAAY,GAAE,oBAA0C,GACvD,OAAO,CAYT"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,aAAa,CAAC;AAsErB,wBAAgB,sBAAsB,CACpC,YAAY,GAAE,oBAA0C,GACvD,OAAO,CAYT"}
@@ -1,15 +1,18 @@
1
1
  import { readFile } from 'node:fs/promises';
2
2
  import { join } from 'node:path';
3
3
  import { buildCommandContext } from '../../../app/command-context.js';
4
- import { getFrontmatterBlock, getFrontmatterField, parseFrontmatterField, } from '../../shared/frontmatter.js';
4
+ import { getFrontmatterBlock, getFrontmatterField, getSkillVersion, parseFrontmatterField, } from '../../shared/frontmatter.js';
5
5
  import { withScopeOption } from '../../shared/scope-option.js';
6
6
  import { readGlobalOptions } from '../../shared/shared.utils.js';
7
7
  import { scanTools } from '../../tools/shared/scan-tools.js';
8
+ import { detectDrift, resolveExpectedSkillProjections } from '../../../drift/index.js';
8
9
  import { resolveAssetsRoot } from '../../../fs/assets.js';
9
10
  import { fileExists } from '../../../fs/io.js';
10
11
  import { resolveProjectRoot, resolveScopeRoot } from '../../../fs/paths.js';
12
+ import { loadManifest } from '../../../manifest/manager.js';
11
13
  import { Command } from 'commander';
12
14
  import { runInfoTool, } from './info-tool.js';
15
+ import { probeProviderPath, readProjectedSkillVersion } from './skill-views.js';
13
16
  async function getToolDetail(tool, scopeRoot) {
14
17
  if (tool.type === 'skill') {
15
18
  const skillDir = join(scopeRoot, '.agents', 'skills', tool.name);
@@ -59,6 +62,16 @@ const defaultDependencies = {
59
62
  },
60
63
  resolveAssetsRoot,
61
64
  getToolDetail,
65
+ // Read-only by construction: load, detect, probe, and read a version. No
66
+ // manifest save and no writer is reachable from `oat tools info`.
67
+ skillViews: {
68
+ loadManifest,
69
+ detectDrift: (entry, scopeRoot) => detectDrift(entry, scopeRoot),
70
+ resolveExpectedProjections: resolveExpectedSkillProjections,
71
+ pathExists: probeProviderPath,
72
+ getSkillVersion,
73
+ readProjectedVersion: readProjectedSkillVersion,
74
+ },
62
75
  };
63
76
  export function createToolsInfoCommand(dependencies = defaultDependencies) {
64
77
  return withScopeOption(new Command('info'))
@@ -1,8 +1,11 @@
1
1
  import type { CommandContext } from '../../../app/command-context.js';
2
2
  import { type PackEvidenceBlockV1 } from '../../tools/shared/format-pack-inventory.js';
3
3
  import { type InventoryPackInput, type PackInventory } from '../../tools/shared/pack-inventory.js';
4
+ import { type ProviderContextDependencies } from '../../tools/shared/provider-context.js';
4
5
  import type { ScanToolsOptions } from '../../tools/shared/scan-tools.js';
5
6
  import type { ToolInfo } from '../../tools/shared/types.js';
7
+ import type { SkillViewDiagnosis } from '../../../drift/index.js';
8
+ import { type SkillViewDependencies } from './skill-views.js';
6
9
  export interface ToolDetail extends ToolInfo {
7
10
  description: string | null;
8
11
  argumentHint: string | null;
@@ -15,12 +18,21 @@ export interface InfoToolDependencies {
15
18
  resolveAssetsRoot: () => Promise<string>;
16
19
  getToolDetail: (tool: ToolInfo, scopeRoot: string) => Promise<Omit<ToolDetail, keyof ToolInfo>>;
17
20
  inventoryPack?: (input: InventoryPackInput) => Promise<PackInventory>;
21
+ providerContext?: ProviderContextDependencies;
22
+ /**
23
+ * Read-only manifest, drift, and expected-projection access for the
24
+ * provider-view diagnostic. Omitted in unit harnesses that only exercise the
25
+ * inventory surface; the command wiring always supplies it.
26
+ */
27
+ skillViews?: SkillViewDependencies;
18
28
  }
19
29
  export interface InfoToolResult {
20
30
  found: boolean;
21
31
  tool: ToolDetail | null;
22
32
  pack: PackInventory | null;
23
33
  packEvidence?: PackEvidenceBlockV1;
34
+ /** Per-scope provider-view diagnosis; additive, skills only. */
35
+ providerViews?: SkillViewDiagnosis[];
24
36
  }
25
37
  export declare function runInfoTool(context: CommandContext, name: string, dependencies: InfoToolDependencies): Promise<InfoToolResult>;
26
38
  //# sourceMappingURL=info-tool.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"info-tool.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/info-tool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAE3D,OAAO,EAML,KAAK,mBAAmB,EACzB,MAAM,8CAA8C,CAAC;AACtD,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,uCAAuC,CAAC;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAE7D,MAAM,WAAW,UAAW,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WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,UAAU,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,gEAAgE;IAChE,aAAa,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACtC;AAED,wBAAsB,WAAW,CAC/B,OAAO,EAAE,cAAc,EACvB,IAAI,EAAE,MAAM,EACZ,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,cAAc,CAAC,CA6JzB"}
@@ -2,6 +2,9 @@ import { resolveConcreteScopes } from '../../shared/shared.utils.js';
2
2
  import { formatPackEvidenceDetails, formatPackInventoryDetails, packEvidenceBlock, projectRenderablePackEvidence, unavailablePackEvidence, } from '../../tools/shared/format-pack-inventory.js';
3
3
  import { inventoryPack, } from '../../tools/shared/pack-inventory.js';
4
4
  import { PACK_MANIFEST } from '../../tools/shared/pack-manifest.js';
5
+ import { applyUserAgentCoverage } from '../../tools/shared/pack-provider-evidence.js';
6
+ import { resolvePackProviderSurface, } from '../../tools/shared/provider-context.js';
7
+ import { collectSkillViewDiagnoses, formatSkillViewLines, } from './skill-views.js';
5
8
  export async function runInfoTool(context, name, dependencies) {
6
9
  const { logger } = context;
7
10
  const scopes = resolveConcreteScopes(context.scope);
@@ -19,13 +22,27 @@ export async function runInfoTool(context, name, dependencies) {
19
22
  let pack = null;
20
23
  let evidence;
21
24
  try {
22
- pack = await (dependencies.inventoryPack ?? inventoryPack)({
25
+ // `info` resolves the same config-aware provider surface as `status` and
26
+ // `doctor`; omitting it made `info` report user agents as unmaterialized
27
+ // that an active Codex or Cursor adapter supplies.
28
+ const providerSurface = await resolvePackProviderSurface({
29
+ scopeRoots: roots,
30
+ ...(dependencies.providerContext
31
+ ? { dependencies: dependencies.providerContext }
32
+ : {}),
33
+ });
34
+ pack = applyUserAgentCoverage(await (dependencies.inventoryPack ?? inventoryPack)({
23
35
  pack: packName,
24
36
  assetsRoot,
25
37
  projectRoot: roots.project,
26
38
  userRoot: roots.user,
27
- });
28
- evidence = projectRenderablePackEvidence(pack, packRoots);
39
+ ...(roots.user
40
+ ? {
41
+ userManagedRoleMaterialization: providerSurface.userAgentCoverage !== 'none',
42
+ }
43
+ : {}),
44
+ }), providerSurface.userAgentCoverage);
45
+ evidence = projectRenderablePackEvidence(pack, packRoots, providerSurface.contexts);
29
46
  }
30
47
  catch (error) {
31
48
  evidence = unavailablePackEvidence({
@@ -62,9 +79,32 @@ export async function runInfoTool(context, name, dependencies) {
62
79
  continue;
63
80
  const detail = await dependencies.getToolDetail(match, scopeRoot);
64
81
  const toolDetail = { ...match, ...detail };
82
+ // Resolution time is the only place a name is already bound to canonical
83
+ // content, so it is where "installed but not distributed" can be answered.
84
+ const providerViews = toolDetail.type === 'skill' && dependencies.skillViews
85
+ ? await collectSkillViewDiagnoses({
86
+ skillName: toolDetail.name,
87
+ scopes,
88
+ roots,
89
+ resolvedScope: scope,
90
+ resolvedVersion: toolDetail.version,
91
+ dependencies: dependencies.skillViews,
92
+ ...(dependencies.providerContext
93
+ ? { providerContext: dependencies.providerContext }
94
+ : {}),
95
+ })
96
+ : undefined;
65
97
  if (context.json) {
66
- logger.json({ tool: toolDetail });
67
- return { found: true, tool: toolDetail, pack: null };
98
+ logger.json({
99
+ tool: toolDetail,
100
+ ...(providerViews ? { providerViews } : {}),
101
+ });
102
+ return {
103
+ found: true,
104
+ tool: toolDetail,
105
+ pack: null,
106
+ ...(providerViews ? { providerViews } : {}),
107
+ };
68
108
  }
69
109
  logger.info(`${toolDetail.name}`);
70
110
  logger.info(` Type: ${toolDetail.type}`);
@@ -87,7 +127,15 @@ export async function runInfoTool(context, name, dependencies) {
87
127
  if (toolDetail.status === 'outdated') {
88
128
  logger.warn(` Update available: ${toolDetail.version ?? '?'} -> ${toolDetail.bundledVersion ?? '?'}`);
89
129
  }
90
- return { found: true, tool: toolDetail, pack: null };
130
+ for (const line of formatSkillViewLines(providerViews ?? [])) {
131
+ logger.info(line);
132
+ }
133
+ return {
134
+ found: true,
135
+ tool: toolDetail,
136
+ pack: null,
137
+ ...(providerViews ? { providerViews } : {}),
138
+ };
91
139
  }
92
140
  if (context.json) {
93
141
  logger.json({ tool: null, error: `Tool '${name}' not found` });
@@ -0,0 +1,86 @@
1
+ import type { ProviderContextDependencies } from '../../tools/shared/provider-context.js';
2
+ import type { DriftReport, ExpectedProjection, ProjectedSkillVersion, SkillViewDiagnosis } from '../../../drift/index.js';
3
+ import type { Manifest, ManifestEntryV2 } from '../../../manifest/manifest.types.js';
4
+ import type { ProviderRegistration } from '../../../providers/shared/registry.js';
5
+ import type { ConcreteScope } from '../../../shared/types.js';
6
+ /**
7
+ * Read-only inputs the provider-view diagnostic needs.
8
+ *
9
+ * Every one of these is injected so the diagnostic path can be proven to
10
+ * mutate nothing: there is deliberately no manifest save, no writer, and no
11
+ * sync entry point in this dependency set.
12
+ */
13
+ export interface SkillViewDependencies {
14
+ loadManifest: (manifestPath: string) => Promise<Manifest>;
15
+ detectDrift: (entry: ManifestEntryV2, scopeRoot: string) => Promise<DriftReport>;
16
+ resolveExpectedProjections: (input: {
17
+ skillName: string;
18
+ scope: ConcreteScope;
19
+ registrations: readonly ProviderRegistration[];
20
+ }) => ExpectedProjection[];
21
+ /** Existence probe for a canonical or provider path. */
22
+ pathExists: (path: string) => Promise<boolean>;
23
+ /** Reads a SKILL.md version from a canonical skill directory. */
24
+ getSkillVersion: (skillDir: string) => Promise<string | null>;
25
+ /**
26
+ * Reads a projected view's version *with* the resolver's verdict. Separate
27
+ * from `getSkillVersion` on purpose: a string alone cannot say whether the
28
+ * declaration behind it conflicted, so a double that returned one would let
29
+ * a conflicting view read as cleanly resolved.
30
+ */
31
+ readProjectedVersion: (skillDir: string) => Promise<ProjectedSkillVersion>;
32
+ }
33
+ export interface CollectSkillViewsInput {
34
+ skillName: string;
35
+ scopes: readonly ConcreteScope[];
36
+ roots: Readonly<Partial<Record<ConcreteScope, string>>>;
37
+ /** Canonical version already resolved for the scope the tool resolved in. */
38
+ resolvedScope: ConcreteScope;
39
+ resolvedVersion: string | null;
40
+ dependencies: SkillViewDependencies;
41
+ providerContext?: ProviderContextDependencies;
42
+ }
43
+ /**
44
+ * Existence probe that treats only a genuinely absent path as absent.
45
+ *
46
+ * A permission or I/O failure is not evidence of a projection gap: reporting
47
+ * one as `missing-additive` would tell the user to run a sync that cannot fix
48
+ * anything. Anything we failed to read is reported as present, which downgrades
49
+ * the classification to `untracked` and suppresses the repair suggestion.
50
+ */
51
+ export declare function probeProviderPath(path: string, stat?: (target: string) => Promise<unknown>): Promise<boolean>;
52
+ /**
53
+ * Reads the version of a projected skill copy, with the state of that reading.
54
+ *
55
+ * The only thing this does differently from the canonical reader is strip the
56
+ * OAT-managed provenance banner the engine prepends to a copied `SKILL.md`
57
+ * (`engine/markers.ts`), which puts the frontmatter past byte zero where
58
+ * `getFrontmatterBlock`'s start-anchored match will not look. Everything after
59
+ * that is `parseSkillFrontmatter` + `resolveSkillVersion` — the same functions
60
+ * `getSkillVersion` uses — so a view and its canonical source can never
61
+ * resolve by different precedence rules. A private parse here previously read
62
+ * the deprecated top-level `version` while the canonical side had already
63
+ * moved to `metadata.version`, which reported a byte-identical copy as stale.
64
+ *
65
+ * The state follows the resolver, never the parse in isolation: once the
66
+ * resolver returns a version, that version is what canonical resolution would
67
+ * report too, so an ignored sibling declaration that happens to be unusable
68
+ * must not downgrade it. `unusable` and `malformed` are reserved for readings
69
+ * that produced no version at all. A read failure yields no version rather
70
+ * than a guess, so a transient failure can never launder a conflicting
71
+ * declaration into a clean one.
72
+ */
73
+ export declare function readProjectedSkillVersion(skillDir: string): Promise<ProjectedSkillVersion>;
74
+ /**
75
+ * Diagnoses one canonical skill against every provider view, for each concrete
76
+ * scope where the canonical skill exists.
77
+ *
78
+ * The scope loop is deliberately wider than `oat tools info`'s name
79
+ * resolution, which returns the first scope that has the skill: a project-scope
80
+ * copy resolving first does not make a user-scope projection gap disappear, and
81
+ * the repair for each scope is its own concrete `oat sync --scope`.
82
+ */
83
+ export declare function collectSkillViewDiagnoses(input: CollectSkillViewsInput): Promise<SkillViewDiagnosis[]>;
84
+ /** Renders the human-readable provider-view block. Pure. */
85
+ export declare function formatSkillViewLines(diagnoses: readonly SkillViewDiagnosis[]): string[];
86
+ //# sourceMappingURL=skill-views.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"skill-views.d.ts","sourceRoot":"","sources":["../../../../src/commands/tools/info/skill-views.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAE3F,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,qBAAqB,EACrB,kBAAkB,EAEnB,MAAM,cAAc,CAAC;AAGtB,OAAO,KAAK,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAqB;IACpC,YAAY,EAAE,CAAC,YAAY,EAAE,MAAM,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC1D,WAAW,EAAE,CACX,KAAK,EAAE,eAAe,EACtB,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,WAAW,CAAC,CAAC;IAC1B,0BAA0B,EAAE,CAAC,KAAK,EAAE;QAClC,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,aAAa,CAAC;QACrB,aAAa,EAAE,SAAS,oBAAoB,EAAE,CAAC;KAChD,KAAK,kBAAkB,EAAE,CAAC;IAC3B,wDAAwD;IACxD,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC/C,iEAAiE;IACjE,eAAe,EAAE,CAAC,QAAQ,EAAE,M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