@open-agent-toolkit/cli 0.1.33 → 0.1.35

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 (97) hide show
  1. package/assets/docs/cli-utilities/config-and-local-state.md +20 -0
  2. package/assets/docs/cli-utilities/configuration.md +17 -6
  3. package/assets/docs/cli-utilities/index.md +5 -0
  4. package/assets/docs/cli-utilities/tool-packs.md +1 -1
  5. package/assets/docs/cli-utilities/workflow-gates.md +163 -0
  6. package/assets/docs/contributing/design-principles.md +1 -1
  7. package/assets/docs/contributing/skills.md +25 -0
  8. package/assets/docs/reference/cli-reference.md +3 -0
  9. package/assets/docs/reference/file-locations.md +1 -0
  10. package/assets/docs/reference/oat-directory-structure.md +3 -0
  11. package/assets/public-package-versions.json +4 -4
  12. package/assets/skills/oat-project-implement/SKILL.md +23 -1
  13. package/assets/skills/oat-project-plan/SKILL.md +23 -1
  14. package/dist/app/create-program.d.ts.map +1 -1
  15. package/dist/app/create-program.js +3 -6
  16. package/dist/app/help-config.d.ts +12 -0
  17. package/dist/app/help-config.d.ts.map +1 -0
  18. package/dist/app/help-config.js +15 -0
  19. package/dist/commands/doctor/index.d.ts.map +1 -1
  20. package/dist/commands/doctor/index.js +2 -1
  21. package/dist/commands/gate/index.d.ts +35 -0
  22. package/dist/commands/gate/index.d.ts.map +1 -0
  23. package/dist/commands/gate/index.js +500 -0
  24. package/dist/commands/index.d.ts.map +1 -1
  25. package/dist/commands/index.js +6 -0
  26. package/dist/commands/init/index.d.ts.map +1 -1
  27. package/dist/commands/init/index.js +2 -1
  28. package/dist/commands/init/tools/brainstorm/index.d.ts.map +1 -1
  29. package/dist/commands/init/tools/brainstorm/index.js +2 -1
  30. package/dist/commands/init/tools/core/index.d.ts.map +1 -1
  31. package/dist/commands/init/tools/core/index.js +18 -0
  32. package/dist/commands/init/tools/docs/index.d.ts.map +1 -1
  33. package/dist/commands/init/tools/docs/index.js +2 -1
  34. package/dist/commands/init/tools/ideas/index.d.ts.map +1 -1
  35. package/dist/commands/init/tools/ideas/index.js +2 -1
  36. package/dist/commands/init/tools/project-management/index.d.ts.map +1 -1
  37. package/dist/commands/init/tools/project-management/index.js +19 -0
  38. package/dist/commands/init/tools/research/index.d.ts.map +1 -1
  39. package/dist/commands/init/tools/research/index.js +2 -1
  40. package/dist/commands/init/tools/utility/index.d.ts.map +1 -1
  41. package/dist/commands/init/tools/utility/index.js +2 -1
  42. package/dist/commands/init/tools/workflows/index.d.ts.map +1 -1
  43. package/dist/commands/init/tools/workflows/index.js +2 -1
  44. package/dist/commands/internal/validate-oat-skills.d.ts +3 -0
  45. package/dist/commands/internal/validate-oat-skills.d.ts.map +1 -1
  46. package/dist/commands/internal/validate-oat-skills.js +44 -2
  47. package/dist/commands/project/split/evaluate-signals.d.ts.map +1 -1
  48. package/dist/commands/project/split/evaluate-signals.js +11 -1
  49. package/dist/commands/project/split/run.d.ts.map +1 -1
  50. package/dist/commands/project/split/run.js +14 -0
  51. package/dist/commands/project/split/validate-plan.d.ts.map +1 -1
  52. package/dist/commands/project/split/validate-plan.js +30 -6
  53. package/dist/commands/project/validate-plan/index.d.ts +6 -1
  54. package/dist/commands/project/validate-plan/index.d.ts.map +1 -1
  55. package/dist/commands/project/validate-plan/index.js +36 -9
  56. package/dist/commands/providers/inspect/inspect.d.ts.map +1 -1
  57. package/dist/commands/providers/inspect/inspect.js +2 -1
  58. package/dist/commands/providers/list/list.d.ts.map +1 -1
  59. package/dist/commands/providers/list/list.js +2 -1
  60. package/dist/commands/providers/set/index.d.ts.map +1 -1
  61. package/dist/commands/providers/set/index.js +6 -2
  62. package/dist/commands/remove/skill/remove-skill.d.ts.map +1 -1
  63. package/dist/commands/remove/skill/remove-skill.js +2 -1
  64. package/dist/commands/remove/skills/remove-skills.d.ts.map +1 -1
  65. package/dist/commands/remove/skills/remove-skills.js +2 -1
  66. package/dist/commands/repo/pr-comments/triage-collection/triage-comments.d.ts +1 -0
  67. package/dist/commands/repo/pr-comments/triage-collection/triage-comments.d.ts.map +1 -1
  68. package/dist/commands/repo/pr-comments/triage-collection/triage-comments.js +25 -13
  69. package/dist/commands/shared/scope-option.d.ts +21 -0
  70. package/dist/commands/shared/scope-option.d.ts.map +1 -0
  71. package/dist/commands/shared/scope-option.js +24 -0
  72. package/dist/commands/status/index.d.ts.map +1 -1
  73. package/dist/commands/status/index.js +2 -1
  74. package/dist/commands/sync/index.d.ts.map +1 -1
  75. package/dist/commands/sync/index.js +2 -1
  76. package/dist/commands/tools/info/index.d.ts.map +1 -1
  77. package/dist/commands/tools/info/index.js +2 -1
  78. package/dist/commands/tools/install/index.d.ts.map +1 -1
  79. package/dist/commands/tools/install/index.js +2 -0
  80. package/dist/commands/tools/list/index.d.ts.map +1 -1
  81. package/dist/commands/tools/list/index.js +2 -1
  82. package/dist/commands/tools/outdated/index.d.ts.map +1 -1
  83. package/dist/commands/tools/outdated/index.js +2 -1
  84. package/dist/commands/tools/remove/index.d.ts.map +1 -1
  85. package/dist/commands/tools/remove/index.js +2 -1
  86. package/dist/commands/tools/update/index.d.ts.map +1 -1
  87. package/dist/commands/tools/update/index.js +6 -2
  88. package/dist/config/oat-config.d.ts +22 -0
  89. package/dist/config/oat-config.d.ts.map +1 -1
  90. package/dist/config/oat-config.js +136 -0
  91. package/dist/config/resolve.d.ts +3 -1
  92. package/dist/config/resolve.d.ts.map +1 -1
  93. package/dist/config/resolve.js +103 -1
  94. package/dist/validation/skills.d.ts +2 -0
  95. package/dist/validation/skills.d.ts.map +1 -1
  96. package/dist/validation/skills.js +39 -0
  97. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { readOatConfig, readOatLocalConfig, readUserConfig, } from './oat-config.js';
1
+ import { BUILTIN_EXEC_TARGETS, readOatConfig, readOatLocalConfig, readUserConfig, } from './oat-config.js';
2
2
  const DEFAULT_DEPENDENCIES = {
3
3
  readOatConfig,
4
4
  readOatLocalConfig,
@@ -139,6 +139,105 @@ export async function resolveEffectiveConfig(repoRoot, userConfigDir, env = proc
139
139
  resolved,
140
140
  };
141
141
  }
142
+ export function resolveGate(effective, skillName) {
143
+ for (const skills of [
144
+ effective.local.workflow?.gates?.skills,
145
+ effective.shared.workflow?.gates?.skills,
146
+ effective.user.workflow?.gates?.skills,
147
+ ]) {
148
+ if (!skills || !hasOwn(skills, skillName)) {
149
+ continue;
150
+ }
151
+ return skills[skillName] ?? null;
152
+ }
153
+ return null;
154
+ }
155
+ export function resolveExecTargets(effective) {
156
+ const targets = cloneExecTargetRegistry(BUILTIN_EXEC_TARGETS);
157
+ for (const execTargets of [
158
+ effective.user.workflow?.gates?.execTargets,
159
+ effective.shared.workflow?.gates?.execTargets,
160
+ effective.local.workflow?.gates?.execTargets,
161
+ ]) {
162
+ mergeExecTargetLayer(targets, execTargets);
163
+ }
164
+ return targets;
165
+ }
166
+ function mergeExecTargetLayer(targets, layer) {
167
+ if (!layer) {
168
+ return;
169
+ }
170
+ for (const [id, override] of Object.entries(layer)) {
171
+ if (override === null) {
172
+ delete targets[id];
173
+ continue;
174
+ }
175
+ const existing = targets[id];
176
+ if (existing) {
177
+ targets[id] = cloneExecTarget({
178
+ runtime: override.runtime ?? existing.runtime,
179
+ baseCommand: override.baseCommand ?? existing.baseCommand,
180
+ hostDetectionCommand: override.hostDetectionCommand ?? existing.hostDetectionCommand,
181
+ availabilityCommand: override.availabilityCommand ?? existing.availabilityCommand,
182
+ priority: override.priority ?? existing.priority,
183
+ });
184
+ continue;
185
+ }
186
+ const completeTarget = toCompleteExecTarget(override);
187
+ if (completeTarget) {
188
+ targets[id] = completeTarget;
189
+ }
190
+ }
191
+ }
192
+ function cloneExecTargetRegistry(registry) {
193
+ return Object.fromEntries(Object.entries(registry).map(([id, target]) => [
194
+ id,
195
+ cloneExecTarget(target),
196
+ ]));
197
+ }
198
+ function cloneExecTarget(target) {
199
+ const next = {
200
+ runtime: target.runtime,
201
+ baseCommand: [...target.baseCommand],
202
+ priority: target.priority,
203
+ };
204
+ if (target.hostDetectionCommand) {
205
+ next.hostDetectionCommand = [...target.hostDetectionCommand];
206
+ }
207
+ if (target.availabilityCommand) {
208
+ next.availabilityCommand = [...target.availabilityCommand];
209
+ }
210
+ return next;
211
+ }
212
+ function toCompleteExecTarget(target) {
213
+ const runtime = typeof target.runtime === 'string' ? target.runtime.trim() : '';
214
+ if (!runtime || !isValidArgv(target.baseCommand)) {
215
+ return null;
216
+ }
217
+ const completeTarget = {
218
+ runtime,
219
+ baseCommand: [...target.baseCommand],
220
+ priority: typeof target.priority === 'number' && Number.isFinite(target.priority)
221
+ ? target.priority
222
+ : 0,
223
+ };
224
+ if (isValidArgv(target.hostDetectionCommand)) {
225
+ completeTarget.hostDetectionCommand = [...target.hostDetectionCommand];
226
+ }
227
+ if (isValidArgv(target.availabilityCommand)) {
228
+ completeTarget.availabilityCommand = [...target.availabilityCommand];
229
+ }
230
+ return completeTarget;
231
+ }
232
+ function isValidArgv(value) {
233
+ if (!Array.isArray(value) ||
234
+ value.length === 0 ||
235
+ !value.every((part) => typeof part === 'string')) {
236
+ return false;
237
+ }
238
+ const [executable] = value;
239
+ return executable !== undefined && executable.trim().length > 0;
240
+ }
142
241
  function flattenConfig(value, prefix = '') {
143
242
  if (!isRecord(value)) {
144
243
  return {};
@@ -168,6 +267,9 @@ function resolveEnvOverride(key, env) {
168
267
  function isRecord(value) {
169
268
  return typeof value === 'object' && value !== null && !Array.isArray(value);
170
269
  }
270
+ function hasOwn(value, key) {
271
+ return Object.prototype.hasOwnProperty.call(value, key);
272
+ }
171
273
  function isResolvedValue(value) {
172
274
  return value !== undefined && value !== null;
173
275
  }
@@ -1,6 +1,7 @@
1
1
  export interface ValidationFinding {
2
2
  file: string;
3
3
  message: string;
4
+ severity?: 'error' | 'warning';
4
5
  }
5
6
  export interface ValidateOatSkillsResult {
6
7
  validatedSkillCount: number;
@@ -15,6 +16,7 @@ export interface ValidateChangedSkillVersionBumpsResult {
15
16
  }
16
17
  export interface ValidateOatSkillsOptions {
17
18
  baseRef?: string;
19
+ gateSkillNames?: readonly string[];
18
20
  }
19
21
  export type ExecFileResult = {
20
22
  stdout: string;
@@ -1 +1 @@
1
- {"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/validation/skills.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,uCAAuC;IACtD,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,sCAAsC;IACrD,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,CACzB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,CAAC,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KAChD,OAAO,CAAC,cAAc,CAAC,CAAC;AAE7B,UAAU,6BAA6B;IACrC,WAAW,CAAC,EAAE,YAAY,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;CACzB;AAmPD,wBAAsB,gCAAgC,CACpD,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uCAAuC,EAChD,YAAY,GAAE,6BAAkC,GAC/C,OAAO,CAAC,sCAAsC,CAAC,CAoBjD;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OA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6BAAkC,GAC/C,OAAO,CAAC,sCAAsC,CAAC,CAoBjD;AAED,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,MAAM,EAChB,OAAO,GAAE,wBAA6B,EACtC,YAAY,GAAE,6BAAkC,GAC/C,OAAO,CAAC,uBAAuB,CAAC,CAmIlC"}
@@ -22,6 +22,10 @@ function getFrontmatterScalar(frontmatter, key) {
22
22
  const match = frontmatter.match(re);
23
23
  return match?.[1]?.trim() ?? null;
24
24
  }
25
+ function hasTrueFrontmatterValue(frontmatter, key) {
26
+ return (frontmatterHasKey(frontmatter, key) &&
27
+ getFrontmatterScalar(frontmatter, key) === 'true');
28
+ }
25
29
  function isValidSemver(value) {
26
30
  return /^\d+\.\d+\.\d+$/.test(value);
27
31
  }
@@ -87,6 +91,40 @@ function validateQuickStartSemantics(skillPath, content, findings) {
87
91
  });
88
92
  }
89
93
  }
94
+ function normalizeGateSkillNames(gateSkillNames) {
95
+ if (!gateSkillNames) {
96
+ return [];
97
+ }
98
+ return [
99
+ ...new Set(gateSkillNames.map((name) => name.trim()).filter(Boolean)),
100
+ ].sort();
101
+ }
102
+ async function collectGateabilityFindings(skillsRoot, gateSkillNames, findings) {
103
+ for (const skillName of normalizeGateSkillNames(gateSkillNames)) {
104
+ const skillPath = join(skillsRoot, skillName, 'SKILL.md');
105
+ let content;
106
+ try {
107
+ content = await readFile(skillPath, 'utf8');
108
+ }
109
+ catch {
110
+ findings.push({
111
+ file: skillPath,
112
+ message: `Configured gate targets unknown skill: ${skillName}`,
113
+ severity: 'warning',
114
+ });
115
+ continue;
116
+ }
117
+ const frontmatter = getFrontmatterBlock(content);
118
+ if (frontmatter === null ||
119
+ !hasTrueFrontmatterValue(frontmatter, 'oat_gateable')) {
120
+ findings.push({
121
+ file: skillPath,
122
+ message: 'Configured gate targets skill without oat_gateable: true',
123
+ severity: 'warning',
124
+ });
125
+ }
126
+ }
127
+ }
90
128
  async function listChangedSkillFiles(repoRoot, baseRef, dependencies) {
91
129
  const execFile = dependencies.gitExecFile ?? execFileAsync;
92
130
  const { stdout } = await execFile('git', [
@@ -261,6 +299,7 @@ export async function validateOatSkills(repoRoot, options = {}, dependencies = {
261
299
  validateQuickStartSemantics(skillPath, content, findings);
262
300
  }
263
301
  }
302
+ await collectGateabilityFindings(skillsRoot, options.gateSkillNames, findings);
264
303
  if (options.baseRef) {
265
304
  const changedSkillFiles = await listChangedSkillFiles(repoRoot, options.baseRef, dependencies);
266
305
  await collectChangedSkillVersionBumpFindings(repoRoot, options.baseRef, changedSkillFiles, findings, dependencies);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-agent-toolkit/cli",
3
- "version": "0.1.33",
3
+ "version": "0.1.35",
4
4
  "private": false,
5
5
  "description": "Open Agent Toolkit CLI",
6
6
  "homepage": "https://github.com/voxmedia/open-agent-toolkit/tree/main/packages/cli",
@@ -34,7 +34,7 @@
34
34
  "ora": "^9.0.0",
35
35
  "yaml": "2.8.2",
36
36
  "zod": "^3.25.76",
37
- "@open-agent-toolkit/control-plane": "0.1.33"
37
+ "@open-agent-toolkit/control-plane": "0.1.35"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/node": "^22.10.0",