@open-agent-toolkit/cli 0.0.10 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +12 -20
- package/assets/docs/{guide/getting-started.md → cli-utilities/bootstrap.md} +8 -2
- package/assets/docs/cli-utilities/config-and-local-state.md +84 -0
- package/assets/docs/{guide → cli-utilities}/configuration.md +2 -2
- package/assets/docs/cli-utilities/index.md +41 -0
- package/assets/docs/cli-utilities/overview.md +33 -0
- package/assets/docs/{guide → cli-utilities}/tool-packs.md +9 -3
- package/assets/docs/contributing/design-principles.md +3 -3
- package/assets/docs/contributing/documentation.md +12 -4
- package/assets/docs/{guide/documentation/quickstart.md → docs-tooling/add-docs-to-a-repo.md} +1 -1
- package/assets/docs/{guide/documentation → docs-tooling}/commands.md +8 -1
- package/assets/docs/docs-tooling/index.md +40 -0
- package/assets/docs/docs-tooling/overview.md +31 -0
- package/assets/docs/{guide/documentation → docs-tooling}/workflows.md +3 -3
- package/assets/docs/guide/concepts.md +9 -9
- package/assets/docs/guide/index.md +14 -11
- package/assets/docs/index.md +34 -18
- package/assets/docs/{guide/provider-sync → provider-sync}/commands.md +10 -4
- package/assets/docs/{guide/provider-sync → provider-sync}/config.md +1 -1
- package/assets/docs/provider-sync/index.md +43 -0
- package/assets/docs/{guide/provider-sync → provider-sync}/manifest-and-drift.md +8 -0
- package/assets/docs/provider-sync/overview.md +38 -0
- package/assets/docs/{guide/provider-sync → provider-sync}/scope-and-surface.md +3 -3
- package/assets/docs/quickstart.md +43 -126
- package/assets/docs/reference/cli-reference.md +35 -0
- package/assets/docs/reference/docs-index-contract.md +1 -2
- package/assets/docs/reference/index.md +5 -4
- package/assets/docs/workflows/index.md +40 -0
- package/assets/docs/workflows/overview.md +38 -0
- package/assets/docs/workflows/projects/index.md +37 -0
- package/assets/docs/{guide/workflow → workflows/projects}/lifecycle.md +6 -0
- package/assets/docs/{guide/workflow → workflows/projects}/repo-analysis.md +6 -0
- package/assets/docs/{guide/workflow → workflows/projects}/state-machine.md +8 -0
- package/assets/docs/{guide → workflows}/skills/index.md +2 -2
- package/assets/public-package-versions.json +4 -4
- package/assets/skills/oat-agent-instructions-analyze/scripts/resolve-instruction-files.sh +0 -0
- package/assets/skills/oat-agent-instructions-analyze/scripts/resolve-providers.sh +0 -0
- package/assets/skills/oat-project-complete/SKILL.md +19 -26
- package/assets/skills/oat-project-document/SKILL.md +2 -2
- package/assets/skills/oat-project-import-plan/scripts/find-recent-provider-plans.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/scripts/dispatch.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/scripts/reconcile.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/scripts/review-gate.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/tests/test-dry-run.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/tests/test-reconcile.sh +0 -0
- package/assets/skills/oat-project-subagent-implement/tests/test-review-gate.sh +0 -0
- package/assets/skills/oat-repo-maintainability-review/scripts/resolve-analysis-output.sh +0 -0
- package/assets/skills/oat-review-provide/scripts/resolve-review-output.sh +0 -0
- package/assets/skills/oat-worktree-bootstrap-auto/scripts/bootstrap.sh +0 -0
- package/dist/app/create-program.js +1 -1
- package/dist/commands/docs/init/index.d.ts.map +1 -1
- package/dist/commands/docs/init/index.js +4 -0
- package/dist/commands/docs/init/resolve-options.d.ts +1 -1
- package/dist/commands/docs/init/resolve-options.d.ts.map +1 -1
- package/dist/commands/docs/init/resolve-options.js +1 -0
- package/dist/commands/docs/init/scaffold.d.ts.map +1 -1
- package/dist/commands/docs/init/scaffold.js +10 -2
- package/dist/commands/internal/index.d.ts.map +1 -1
- package/dist/commands/internal/index.js +3 -1
- package/dist/commands/internal/validate-oat-skills.d.ts +2 -2
- package/dist/commands/internal/validate-oat-skills.d.ts.map +1 -1
- package/dist/commands/internal/validate-oat-skills.js +5 -4
- package/dist/commands/internal/validate-skill-version-bumps.d.ts +10 -0
- package/dist/commands/internal/validate-skill-version-bumps.d.ts.map +1 -0
- package/dist/commands/internal/validate-skill-version-bumps.js +74 -0
- package/dist/manifest/manager.js +1 -1
- package/dist/validation/index.d.ts +2 -2
- package/dist/validation/index.d.ts.map +1 -1
- package/dist/validation/index.js +1 -1
- package/dist/validation/skills.d.ts +25 -1
- package/dist/validation/skills.d.ts.map +1 -1
- package/dist/validation/skills.js +95 -1
- package/package.json +17 -17
- package/assets/docs/guide/cli-reference.md +0 -211
- package/assets/docs/guide/documentation/index.md +0 -27
- package/assets/docs/guide/provider-sync/index.md +0 -65
- package/assets/docs/guide/workflow/index.md +0 -34
- /package/assets/docs/{guide/provider-sync → provider-sync}/providers.md +0 -0
- /package/assets/docs/{guide → workflows}/ideas/index.md +0 -0
- /package/assets/docs/{guide → workflows}/ideas/lifecycle.md +0 -0
- /package/assets/docs/{guide/workflow → workflows/projects}/artifacts.md +0 -0
- /package/assets/docs/{guide/workflow → workflows/projects}/hill-checkpoints.md +0 -0
- /package/assets/docs/{guide/workflow → workflows/projects}/pr-flow.md +0 -0
- /package/assets/docs/{guide/workflow → workflows/projects}/reviews.md +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-complete
|
|
3
|
-
version: 1.3.
|
|
3
|
+
version: 1.3.4
|
|
4
4
|
description: Use when all implementation work is finished and the project is ready to close. Marks the OAT project lifecycle as complete.
|
|
5
5
|
disable-model-invocation: true
|
|
6
6
|
user-invocable: true
|
|
@@ -300,35 +300,30 @@ The archive-side effects in this step are CLI-owned. Follow the canonical behavi
|
|
|
300
300
|
|
|
301
301
|
```bash
|
|
302
302
|
ARCHIVED_ROOT=".oat/projects/archived"
|
|
303
|
-
|
|
304
|
-
/^worktree / { wt=$2 }
|
|
305
|
-
/^branch refs\\/heads\\/main$/ { print wt; exit }
|
|
306
|
-
')
|
|
307
|
-
MAIN_REPO_ARCHIVE=""
|
|
308
|
-
if [[ -n "$MAIN_WORKTREE_PATH" ]]; then
|
|
309
|
-
MAIN_REPO_ARCHIVE="${MAIN_WORKTREE_PATH}/.oat/projects/archived"
|
|
310
|
-
fi
|
|
303
|
+
PRIMARY_REPO_ARCHIVE=""
|
|
311
304
|
LOCAL_ARCHIVED_ROOT=".oat/projects/archived"
|
|
312
|
-
|
|
305
|
+
USE_PRIMARY_REPO_ARCHIVE="false"
|
|
313
306
|
|
|
314
|
-
# Heuristic: if this checkout is a worktree and the
|
|
315
|
-
# use
|
|
307
|
+
# Heuristic: if this checkout is a worktree and the primary repo archive parent
|
|
308
|
+
# exists, use that durable archive path as the canonical archive destination.
|
|
316
309
|
if git rev-parse --is-inside-work-tree >/dev/null 2>&1; then
|
|
317
310
|
GIT_COMMON_DIR=$(git rev-parse --git-common-dir 2>/dev/null || true)
|
|
318
311
|
GIT_DIR=$(git rev-parse --git-dir 2>/dev/null || true)
|
|
319
312
|
if [[ -n "$GIT_COMMON_DIR" && -n "$GIT_DIR" && "$GIT_COMMON_DIR" != "$GIT_DIR" ]]; then
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
313
|
+
PRIMARY_REPO_ROOT=$(cd "$(dirname "$GIT_COMMON_DIR")" && pwd)
|
|
314
|
+
PRIMARY_REPO_ARCHIVE="${PRIMARY_REPO_ROOT}/.oat/projects/archived"
|
|
315
|
+
if [[ -d "$(dirname "$PRIMARY_REPO_ARCHIVE")" ]]; then
|
|
316
|
+
USE_PRIMARY_REPO_ARCHIVE="true"
|
|
317
|
+
ARCHIVED_ROOT="$PRIMARY_REPO_ARCHIVE"
|
|
323
318
|
else
|
|
324
|
-
echo "Warning: Running in a worktree, but
|
|
319
|
+
echo "Warning: Running in a worktree, but the primary repo archive path is unavailable: $PRIMARY_REPO_ARCHIVE"
|
|
325
320
|
echo "A worktree-local archive may be deleted when the worktree is removed and is not a durable archive."
|
|
326
321
|
echo "Require explicit confirmation before proceeding with local-only archive."
|
|
327
322
|
fi
|
|
328
323
|
fi
|
|
329
324
|
fi
|
|
330
325
|
|
|
331
|
-
if [[ "$
|
|
326
|
+
if [[ "$USE_PRIMARY_REPO_ARCHIVE" != "true" ]]; then
|
|
332
327
|
ARCHIVED_ROOT="$LOCAL_ARCHIVED_ROOT"
|
|
333
328
|
fi
|
|
334
329
|
|
|
@@ -354,10 +349,10 @@ echo "Project archived to $ARCHIVE_PATH"
|
|
|
354
349
|
|
|
355
350
|
**Worktree durability guard (required):**
|
|
356
351
|
|
|
357
|
-
- If running in a worktree and
|
|
358
|
-
- Ask the user explicitly: "
|
|
352
|
+
- If running in a worktree and the primary repo archive path is unavailable, do not silently continue with a local-only archive.
|
|
353
|
+
- Ask the user explicitly: "Primary repo archive path is unavailable, so this archive may be lost when the worktree is deleted. Continue with local-only archive anyway?"
|
|
359
354
|
- If the user declines, skip archiving and continue the completion flow without archive.
|
|
360
|
-
-
|
|
355
|
+
- Resolve the durable repo root from `git rev-parse --git-common-dir` and `git rev-parse --git-dir`, matching the CLI helper in `packages/cli/src/commands/project/archive/archive-utils.ts`. Do not rely on a `main` checkout or default-branch naming.
|
|
361
356
|
|
|
362
357
|
**Git handling after archive:**
|
|
363
358
|
|
|
@@ -376,16 +371,14 @@ If running from a git worktree, the primary repo archive directory is the canoni
|
|
|
376
371
|
Reference path:
|
|
377
372
|
|
|
378
373
|
```bash
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
')
|
|
383
|
-
MAIN_REPO_ARCHIVE="${MAIN_WORKTREE_PATH}/.oat/projects/archived"
|
|
374
|
+
GIT_COMMON_DIR=$(git rev-parse --git-common-dir)
|
|
375
|
+
PRIMARY_REPO_ROOT=$(cd "$(dirname "$GIT_COMMON_DIR")" && pwd)
|
|
376
|
+
PRIMARY_REPO_ARCHIVE="${PRIMARY_REPO_ROOT}/.oat/projects/archived"
|
|
384
377
|
```
|
|
385
378
|
|
|
386
379
|
Guidance:
|
|
387
380
|
|
|
388
|
-
- In a worktree, prefer moving directly to `
|
|
381
|
+
- In a worktree, prefer moving directly to `PRIMARY_REPO_ARCHIVE` instead of archiving locally and copying later.
|
|
389
382
|
- Do not treat the worktree-local archive as durable.
|
|
390
383
|
- If forced to use a local-only archive, warn and require explicit user confirmation.
|
|
391
384
|
- Do not hardcode user-specific absolute paths.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: oat-project-document
|
|
3
|
-
version: 1.0.
|
|
3
|
+
version: 1.0.1
|
|
4
4
|
description: Run when implementation is complete and documentation needs updating. Analyzes project artifacts to produce documentation update recommendations, then applies approved changes before project completion.
|
|
5
5
|
argument-hint: '[project-path] [--auto]'
|
|
6
6
|
disable-model-invocation: true
|
|
@@ -222,7 +222,7 @@ Scan the repository for all documentation and instruction surfaces.
|
|
|
222
222
|
|
|
223
223
|
4. **Reference files:**
|
|
224
224
|
- Check `.oat/repo/reference/` directory
|
|
225
|
-
- Read: `current-state.md`, `backlog.md`, `roadmap.md`, `decision-record.md` (whichever exist)
|
|
225
|
+
- Read: `current-state.md`, `backlog/index.md`, `backlog/completed.md`, `roadmap.md`, `decision-record.md`, and relevant `backlog/items/*.md` files as needed (whichever exist)
|
|
226
226
|
|
|
227
227
|
**3b. Instruction surfaces (secondary — strong signals only):**
|
|
228
228
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Command, Option } from 'commander';
|
|
2
2
|
const PROGRAM_NAME = 'oat';
|
|
3
3
|
const PROGRAM_DESCRIPTION = 'Open Agent Toolkit CLI for provider interoperability';
|
|
4
|
-
const PROGRAM_VERSION = '0.0.
|
|
4
|
+
const PROGRAM_VERSION = '0.0.16';
|
|
5
5
|
const SCOPE_CHOICES = ['project', 'user', 'all'];
|
|
6
6
|
export function createProgram() {
|
|
7
7
|
return new Command()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":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qB,EAAE,CACrB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,MAAM,KACT,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACnC;AA+CD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,GAAG,MAAM,CAc7E;AAyDD,wBAAgB,qBAAqB,CACnC,SAAS,GAAE,OAAO,CAAC,oBAAoB,CAAM,GAC5C,OAAO,CAsCT"}
|
|
@@ -117,6 +117,10 @@ export function createDocsInitCommand(overrides = {}) {
|
|
|
117
117
|
.addOption(new Option('--app-name <name>', 'Docs app name'))
|
|
118
118
|
.addOption(new Option('--target-dir <path>', 'Target directory for the docs app'))
|
|
119
119
|
.addOption(new Option('--description <text>', 'Site description'))
|
|
120
|
+
.addOption(new Option('--lint <mode>', 'Markdown lint mode').choices([
|
|
121
|
+
'none',
|
|
122
|
+
'markdownlint-cli2',
|
|
123
|
+
]))
|
|
120
124
|
.addOption(new Option('--format <mode>', 'Markdown format mode').choices([
|
|
121
125
|
'oxfmt',
|
|
122
126
|
'none',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { PromptContext, SelectChoice } from '../../shared/shared.prompts.js';
|
|
2
2
|
export type DocsRepoShape = 'monorepo' | 'single-package';
|
|
3
3
|
export type DocsFramework = 'fumadocs' | 'mkdocs';
|
|
4
|
-
export type DocsLintMode = 'none';
|
|
4
|
+
export type DocsLintMode = 'none' | 'markdownlint-cli2';
|
|
5
5
|
export type DocsFormatMode = 'oxfmt' | 'none';
|
|
6
6
|
export interface DocsInitResolvedOptions {
|
|
7
7
|
repoRoot: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/resolve-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACb,MAAM,iCAAiC,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"resolve-options.d.ts","sourceRoot":"","sources":["../../../../src/commands/docs/init/resolve-options.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACb,MAAM,iCAAiC,CAAC;AAGzC,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,gBAAgB,CAAC;AAC1D,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,mBAAmB,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9C,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,aAAa,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,YAAY,CAAC;IACnB,MAAM,EAAE,cAAc,CAAC;CACxB;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,aAAa,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,CAAC,EAAE,aAAa,CAAC;IAClC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,gBAAgB,EAAE,CAChB,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,GAAG,EA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oBAAoB,CACxC,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAYxB;AA4ID,wBAAsB,eAAe,CACnC,OAAO,EAAE,sBAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,CAoChC"}
|
|
@@ -71,7 +71,7 @@ const OAT_DEP_PACKAGES = [
|
|
|
71
71
|
'docs-theme',
|
|
72
72
|
'docs-transforms',
|
|
73
73
|
];
|
|
74
|
-
const DEFAULT_OAT_PUBLISHED_VERSION = '0.0.
|
|
74
|
+
const DEFAULT_OAT_PUBLISHED_VERSION = '0.0.16';
|
|
75
75
|
const PUBLIC_PACKAGE_VERSIONS_FILE = 'public-package-versions.json';
|
|
76
76
|
export async function detectIsOatRepo(repoRoot) {
|
|
77
77
|
for (const pkg of OAT_DEP_PACKAGES) {
|
|
@@ -126,6 +126,9 @@ function humanizeAppName(appName) {
|
|
|
126
126
|
}
|
|
127
127
|
function buildDevDependencies(lint, format) {
|
|
128
128
|
const entries = [];
|
|
129
|
+
if (lint === 'markdownlint-cli2') {
|
|
130
|
+
entries.push(' "markdownlint-cli2": "^0.13.0"');
|
|
131
|
+
}
|
|
129
132
|
if (format === 'oxfmt') {
|
|
130
133
|
entries.push(' "oxfmt": "^0.36.0"');
|
|
131
134
|
}
|
|
@@ -133,6 +136,9 @@ function buildDevDependencies(lint, format) {
|
|
|
133
136
|
}
|
|
134
137
|
function buildFumaDevDependencies(lint, format) {
|
|
135
138
|
const entries = [];
|
|
139
|
+
if (lint === 'markdownlint-cli2') {
|
|
140
|
+
entries.push(' "markdownlint-cli2": "^0.13.0"');
|
|
141
|
+
}
|
|
136
142
|
if (format === 'oxfmt') {
|
|
137
143
|
entries.push(' "oxfmt": "^0.36.0"');
|
|
138
144
|
}
|
|
@@ -161,7 +167,9 @@ function renderTemplate(template, options, depContext) {
|
|
|
161
167
|
'{{PACKAGE_NAME}}': options.appName,
|
|
162
168
|
'{{SITE_NAME}}': siteName,
|
|
163
169
|
'{{SITE_DESCRIPTION}}': options.siteDescription,
|
|
164
|
-
'{{DOCS_LINT_SCRIPT}}':
|
|
170
|
+
'{{DOCS_LINT_SCRIPT}}': options.lint === 'markdownlint-cli2'
|
|
171
|
+
? "markdownlint-cli2 'docs/**/*.md'"
|
|
172
|
+
: "echo 'docs lint disabled'",
|
|
165
173
|
'{{DOCS_FORMAT_SCRIPT}}': options.format === 'oxfmt'
|
|
166
174
|
? "oxfmt 'docs/**/*.md'"
|
|
167
175
|
: "echo 'docs formatting disabled'",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,qBAAqB,IAAI,OAAO,CAK/C"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { Command } from 'commander';
|
|
2
2
|
import { createValidateOatSkillsCommand } from './validate-oat-skills.js';
|
|
3
|
+
import { createValidateSkillVersionBumpsCommand } from './validate-skill-version-bumps.js';
|
|
3
4
|
export function createInternalCommand() {
|
|
4
5
|
return new Command('internal')
|
|
5
6
|
.description('Internal OAT maintenance commands')
|
|
6
|
-
.addCommand(createValidateOatSkillsCommand())
|
|
7
|
+
.addCommand(createValidateOatSkillsCommand())
|
|
8
|
+
.addCommand(createValidateSkillVersionBumpsCommand());
|
|
7
9
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type CommandContext, type GlobalOptions } from '../../app/command-context.js';
|
|
2
|
-
import { type ValidateOatSkillsResult } from '../../validation/index.js';
|
|
2
|
+
import { type ValidateOatSkillsOptions, type ValidateOatSkillsResult } from '../../validation/index.js';
|
|
3
3
|
import { Command } from 'commander';
|
|
4
4
|
interface ValidateOatSkillsDependencies {
|
|
5
5
|
buildCommandContext: (options: GlobalOptions) => CommandContext;
|
|
6
|
-
validateOatSkills: (repoRoot: string) => Promise<ValidateOatSkillsResult>;
|
|
6
|
+
validateOatSkills: (repoRoot: string, options?: ValidateOatSkillsOptions) => Promise<ValidateOatSkillsResult>;
|
|
7
7
|
}
|
|
8
8
|
export declare function createValidateOatSkillsCommand(overrides?: Partial<ValidateOatSkillsDependencies>): Command;
|
|
9
9
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate-oat-skills.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/validate-oat-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,6BAA6B;IACrC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,iBAAiB,EAAE,
|
|
1
|
+
{"version":3,"file":"validate-oat-skills.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/validate-oat-skills.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,6BAA6B;IACrC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,iBAAiB,EAAE,CACjB,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,wBAAwB,KAC/B,OAAO,CAAC,uBAAuB,CAAC,CAAC;CACvC;AAkED,wBAAgB,8BAA8B,CAC5C,SAAS,GAAE,OAAO,CAAC,6BAA6B,CAAM,GACrD,OAAO,CAkBT"}
|
|
@@ -21,9 +21,9 @@ function reportFindings(context, result) {
|
|
|
21
21
|
}
|
|
22
22
|
context.logger.error('\nFix the issues above, then re-run: pnpm oat:validate-skills');
|
|
23
23
|
}
|
|
24
|
-
async function runValidateOatSkills(context, dependencies) {
|
|
24
|
+
async function runValidateOatSkills(context, options, dependencies) {
|
|
25
25
|
try {
|
|
26
|
-
const result = await dependencies.validateOatSkills(context.cwd);
|
|
26
|
+
const result = await dependencies.validateOatSkills(context.cwd, options);
|
|
27
27
|
if (result.findings.length > 0) {
|
|
28
28
|
reportFindings(context, result);
|
|
29
29
|
process.exitCode = 1;
|
|
@@ -59,8 +59,9 @@ export function createValidateOatSkillsCommand(overrides = {}) {
|
|
|
59
59
|
};
|
|
60
60
|
return new Command('validate-oat-skills')
|
|
61
61
|
.description('Validate required structure of oat-* workflow skills')
|
|
62
|
-
.
|
|
62
|
+
.option('--base-ref <ref>', 'Also require changed canonical skills to bump version relative to this git ref')
|
|
63
|
+
.action(async (options, command) => {
|
|
63
64
|
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
64
|
-
await runValidateOatSkills(context, dependencies);
|
|
65
|
+
await runValidateOatSkills(context, options, dependencies);
|
|
65
66
|
});
|
|
66
67
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type CommandContext, type GlobalOptions } from '../../app/command-context.js';
|
|
2
|
+
import { type ValidateChangedSkillVersionBumpsOptions, type ValidateChangedSkillVersionBumpsResult } from '../../validation/index.js';
|
|
3
|
+
import { Command } from 'commander';
|
|
4
|
+
interface ValidateSkillVersionBumpsDependencies {
|
|
5
|
+
buildCommandContext: (options: GlobalOptions) => CommandContext;
|
|
6
|
+
validateChangedSkillVersionBumps: (repoRoot: string, options: ValidateChangedSkillVersionBumpsOptions) => Promise<ValidateChangedSkillVersionBumpsResult>;
|
|
7
|
+
}
|
|
8
|
+
export declare function createValidateSkillVersionBumpsCommand(overrides?: Partial<ValidateSkillVersionBumpsDependencies>): Command;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=validate-skill-version-bumps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate-skill-version-bumps.d.ts","sourceRoot":"","sources":["../../../src/commands/internal/validate-skill-version-bumps.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,aAAa,EACnB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAEL,KAAK,uCAAuC,EAC5C,KAAK,sCAAsC,EAC5C,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,UAAU,qCAAqC;IAC7C,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,cAAc,CAAC;IAChE,gCAAgC,EAAE,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,uCAAuC,KAC7C,OAAO,CAAC,sCAAsC,CAAC,CAAC;CACtD;AA8ED,wBAAgB,sCAAsC,CACpD,SAAS,GAAE,OAAO,CAAC,qCAAqC,CAAM,GAC7D,OAAO,CAyBT"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { buildCommandContext, } from '../../app/command-context.js';
|
|
2
|
+
import { readGlobalOptions } from '../shared/shared.utils.js';
|
|
3
|
+
import { validateChangedSkillVersionBumps as defaultValidateChangedSkillVersionBumps, } from '../../validation/index.js';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
const DEFAULT_DEPENDENCIES = {
|
|
6
|
+
buildCommandContext,
|
|
7
|
+
validateChangedSkillVersionBumps: defaultValidateChangedSkillVersionBumps,
|
|
8
|
+
};
|
|
9
|
+
function reportFindings(context, baseRef, result) {
|
|
10
|
+
if (context.json) {
|
|
11
|
+
context.logger.json({
|
|
12
|
+
status: 'failed',
|
|
13
|
+
baseRef,
|
|
14
|
+
validatedSkillCount: result.validatedSkillCount,
|
|
15
|
+
findings: result.findings,
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
context.logger.error('Canonical skill version validation failed:\n');
|
|
20
|
+
for (const finding of result.findings) {
|
|
21
|
+
context.logger.error(`- ${finding.file}: ${finding.message}`);
|
|
22
|
+
}
|
|
23
|
+
context.logger.error(`\nFix the issues above, then re-run: oat internal validate-skill-version-bumps --base-ref ${baseRef}`);
|
|
24
|
+
}
|
|
25
|
+
async function runValidateSkillVersionBumps(context, options, dependencies) {
|
|
26
|
+
try {
|
|
27
|
+
const result = await dependencies.validateChangedSkillVersionBumps(context.cwd, options);
|
|
28
|
+
if (result.findings.length > 0) {
|
|
29
|
+
reportFindings(context, options.baseRef, result);
|
|
30
|
+
process.exitCode = 1;
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (context.json) {
|
|
34
|
+
context.logger.json({
|
|
35
|
+
status: 'ok',
|
|
36
|
+
baseRef: options.baseRef,
|
|
37
|
+
validatedSkillCount: result.validatedSkillCount,
|
|
38
|
+
findings: result.findings,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
if (result.validatedSkillCount === 0) {
|
|
43
|
+
context.logger.info(`OK: 0 canonical skills changed relative to ${options.baseRef} - nothing to validate`);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
context.logger.info(`OK: validated ${result.validatedSkillCount} changed canonical skill version bump checks against ${options.baseRef}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
process.exitCode = 0;
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
53
|
+
if (context.json) {
|
|
54
|
+
context.logger.json({ status: 'error', message });
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
context.logger.error(message);
|
|
58
|
+
}
|
|
59
|
+
process.exitCode = 2;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
export function createValidateSkillVersionBumpsCommand(overrides = {}) {
|
|
63
|
+
const dependencies = {
|
|
64
|
+
...DEFAULT_DEPENDENCIES,
|
|
65
|
+
...overrides,
|
|
66
|
+
};
|
|
67
|
+
return new Command('validate-skill-version-bumps')
|
|
68
|
+
.description('Validate that changed canonical skills bump version relative to a git base ref')
|
|
69
|
+
.requiredOption('--base-ref <ref>', 'Git ref used as the comparison base for changed canonical skills')
|
|
70
|
+
.action(async (options, command) => {
|
|
71
|
+
const context = dependencies.buildCommandContext(readGlobalOptions(command));
|
|
72
|
+
await runValidateSkillVersionBumps(context, options, dependencies);
|
|
73
|
+
});
|
|
74
|
+
}
|
package/dist/manifest/manager.js
CHANGED
|
@@ -3,7 +3,7 @@ import { mkdir, readFile, rename, writeFile } from 'node:fs/promises';
|
|
|
3
3
|
import { dirname } from 'node:path';
|
|
4
4
|
import { CliError } from '../errors/index.js';
|
|
5
5
|
import { ManifestSchema, } from './manifest.types.js';
|
|
6
|
-
const OAT_VERSION = '0.0.
|
|
6
|
+
const OAT_VERSION = '0.0.16';
|
|
7
7
|
function formatIssuePath(path) {
|
|
8
8
|
if (path.length === 0) {
|
|
9
9
|
return '(root)';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { ValidateOatSkillsResult, ValidationFinding } from './skills.js';
|
|
2
|
-
export { validateOatSkills } from './skills.js';
|
|
1
|
+
export type { ValidateChangedSkillVersionBumpsOptions, ValidateChangedSkillVersionBumpsResult, ValidateOatSkillsOptions, ValidateOatSkillsResult, ValidationFinding, } from './skills.js';
|
|
2
|
+
export { validateChangedSkillVersionBumps, validateOatSkills } from './skills.js';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,YAAY,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validation/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,uCAAuC,EACvC,sCAAsC,EACtC,wBAAwB,EACxB,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,gCAAgC,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/validation/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { validateOatSkills } from './skills.js';
|
|
1
|
+
export { validateChangedSkillVersionBumps, validateOatSkills } from './skills.js';
|
|
@@ -6,5 +6,29 @@ export interface ValidateOatSkillsResult {
|
|
|
6
6
|
validatedSkillCount: number;
|
|
7
7
|
findings: ValidationFinding[];
|
|
8
8
|
}
|
|
9
|
-
export
|
|
9
|
+
export interface ValidateChangedSkillVersionBumpsOptions {
|
|
10
|
+
baseRef: string;
|
|
11
|
+
}
|
|
12
|
+
export interface ValidateChangedSkillVersionBumpsResult {
|
|
13
|
+
validatedSkillCount: number;
|
|
14
|
+
findings: ValidationFinding[];
|
|
15
|
+
}
|
|
16
|
+
export interface ValidateOatSkillsOptions {
|
|
17
|
+
baseRef?: string;
|
|
18
|
+
}
|
|
19
|
+
export type ExecFileResult = {
|
|
20
|
+
stdout: string;
|
|
21
|
+
stderr: string;
|
|
22
|
+
};
|
|
23
|
+
export type ExecFileLike = (file: string, args: string[], options?: {
|
|
24
|
+
cwd?: string;
|
|
25
|
+
env?: NodeJS.ProcessEnv;
|
|
26
|
+
}) => Promise<ExecFileResult>;
|
|
27
|
+
interface ValidateOatSkillsDependencies {
|
|
28
|
+
gitExecFile?: ExecFileLike;
|
|
29
|
+
env?: NodeJS.ProcessEnv;
|
|
30
|
+
}
|
|
31
|
+
export declare function validateChangedSkillVersionBumps(repoRoot: string, options: ValidateChangedSkillVersionBumpsOptions, dependencies?: ValidateOatSkillsDependencies): Promise<ValidateChangedSkillVersionBumpsResult>;
|
|
32
|
+
export declare function validateOatSkills(repoRoot: string, options?: ValidateOatSkillsOptions, dependencies?: ValidateOatSkillsDependencies): Promise<ValidateOatSkillsResult>;
|
|
33
|
+
export {};
|
|
10
34
|
//# sourceMappingURL=skills.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skills.d.ts","sourceRoot":"","sources":["../../src/validation/skills.ts"],"names":[],"mappings":"
|
|
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;AAgOD,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,OAAO,GAAE,wBAA6B,EACtC,YAAY,GAAE,6BAAkC,GAC/C,OAAO,CAAC,uBAAuB,CAAC,CA6HlC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
import { execFile as execFileCallback } from 'node:child_process';
|
|
1
2
|
import { readdir, readFile, stat } from 'node:fs/promises';
|
|
2
3
|
import { join } from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
3
5
|
import { getFrontmatterBlock } from '../commands/shared/frontmatter.js';
|
|
6
|
+
const execFileAsync = promisify(execFileCallback);
|
|
4
7
|
async function isDirectory(path) {
|
|
5
8
|
try {
|
|
6
9
|
const s = await stat(path);
|
|
@@ -22,6 +25,17 @@ function getFrontmatterScalar(frontmatter, key) {
|
|
|
22
25
|
function isValidSemver(value) {
|
|
23
26
|
return /^\d+\.\d+\.\d+$/.test(value);
|
|
24
27
|
}
|
|
28
|
+
function compareSemver(left, right) {
|
|
29
|
+
const leftParts = left.split('.').map(Number);
|
|
30
|
+
const rightParts = right.split('.').map(Number);
|
|
31
|
+
for (let index = 0; index < 3; index += 1) {
|
|
32
|
+
const diff = (leftParts[index] ?? 0) - (rightParts[index] ?? 0);
|
|
33
|
+
if (diff !== 0) {
|
|
34
|
+
return diff;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return 0;
|
|
38
|
+
}
|
|
25
39
|
function hasProgressIndicatorsSection(content) {
|
|
26
40
|
return /^## Progress Indicators \(User-Facing\)\s*$/m.test(content);
|
|
27
41
|
}
|
|
@@ -64,7 +78,83 @@ function validateQuickStartSemantics(skillPath, content, findings) {
|
|
|
64
78
|
});
|
|
65
79
|
}
|
|
66
80
|
}
|
|
67
|
-
|
|
81
|
+
async function listChangedSkillFiles(repoRoot, baseRef, dependencies) {
|
|
82
|
+
const execFile = dependencies.gitExecFile ?? execFileAsync;
|
|
83
|
+
const { stdout } = await execFile('git', [
|
|
84
|
+
'diff',
|
|
85
|
+
'--name-only',
|
|
86
|
+
'--diff-filter=ACMR',
|
|
87
|
+
`${baseRef}...HEAD`,
|
|
88
|
+
'--',
|
|
89
|
+
'.agents/skills/*/SKILL.md',
|
|
90
|
+
], {
|
|
91
|
+
cwd: repoRoot,
|
|
92
|
+
env: dependencies.env ?? process.env,
|
|
93
|
+
});
|
|
94
|
+
return stdout
|
|
95
|
+
.split('\n')
|
|
96
|
+
.map((line) => line.trim())
|
|
97
|
+
.filter((line) => line.length > 0);
|
|
98
|
+
}
|
|
99
|
+
async function readFileAtGitRef(repoRoot, ref, filePath, dependencies) {
|
|
100
|
+
const execFile = dependencies.gitExecFile ?? execFileAsync;
|
|
101
|
+
try {
|
|
102
|
+
const { stdout } = await execFile('git', ['show', `${ref}:${filePath}`], {
|
|
103
|
+
cwd: repoRoot,
|
|
104
|
+
env: dependencies.env ?? process.env,
|
|
105
|
+
});
|
|
106
|
+
return stdout;
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
async function collectChangedSkillVersionBumpFindings(repoRoot, baseRef, changedSkillFiles, findings, dependencies) {
|
|
113
|
+
for (const relativeSkillPath of changedSkillFiles) {
|
|
114
|
+
const skillPath = join(repoRoot, relativeSkillPath);
|
|
115
|
+
const currentContent = await readFile(skillPath, 'utf8');
|
|
116
|
+
const baseContent = await readFileAtGitRef(repoRoot, baseRef, relativeSkillPath, dependencies);
|
|
117
|
+
if (baseContent === null || baseContent === currentContent) {
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const currentFrontmatter = getFrontmatterBlock(currentContent);
|
|
121
|
+
const baseFrontmatter = getFrontmatterBlock(baseContent);
|
|
122
|
+
const currentVersion = currentFrontmatter
|
|
123
|
+
? getFrontmatterScalar(currentFrontmatter, 'version')
|
|
124
|
+
: null;
|
|
125
|
+
const baseVersion = baseFrontmatter
|
|
126
|
+
? getFrontmatterScalar(baseFrontmatter, 'version')
|
|
127
|
+
: null;
|
|
128
|
+
if (!currentVersion || !baseVersion) {
|
|
129
|
+
continue;
|
|
130
|
+
}
|
|
131
|
+
if (currentVersion === baseVersion) {
|
|
132
|
+
findings.push({
|
|
133
|
+
file: skillPath,
|
|
134
|
+
message: `Changed canonical skill must bump frontmatter version relative to ${baseRef} (still ${currentVersion})`,
|
|
135
|
+
});
|
|
136
|
+
continue;
|
|
137
|
+
}
|
|
138
|
+
if (isValidSemver(currentVersion) &&
|
|
139
|
+
isValidSemver(baseVersion) &&
|
|
140
|
+
compareSemver(currentVersion, baseVersion) <= 0) {
|
|
141
|
+
findings.push({
|
|
142
|
+
file: skillPath,
|
|
143
|
+
message: `Changed canonical skill version must increase relative to ${baseRef} (base ${baseVersion}, current ${currentVersion})`,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
export async function validateChangedSkillVersionBumps(repoRoot, options, dependencies = {}) {
|
|
149
|
+
const findings = [];
|
|
150
|
+
const changedSkillFiles = await listChangedSkillFiles(repoRoot, options.baseRef, dependencies);
|
|
151
|
+
await collectChangedSkillVersionBumpFindings(repoRoot, options.baseRef, changedSkillFiles, findings, dependencies);
|
|
152
|
+
return {
|
|
153
|
+
validatedSkillCount: changedSkillFiles.length,
|
|
154
|
+
findings,
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
export async function validateOatSkills(repoRoot, options = {}, dependencies = {}) {
|
|
68
158
|
const skillsRoot = join(repoRoot, '.agents', 'skills');
|
|
69
159
|
const findings = [];
|
|
70
160
|
if (!(await isDirectory(skillsRoot))) {
|
|
@@ -162,5 +252,9 @@ export async function validateOatSkills(repoRoot) {
|
|
|
162
252
|
validateQuickStartSemantics(skillPath, content, findings);
|
|
163
253
|
}
|
|
164
254
|
}
|
|
255
|
+
if (options.baseRef) {
|
|
256
|
+
const changedSkillFiles = await listChangedSkillFiles(repoRoot, options.baseRef, dependencies);
|
|
257
|
+
await collectChangedSkillVersionBumpFindings(repoRoot, options.baseRef, changedSkillFiles, findings, dependencies);
|
|
258
|
+
}
|
|
165
259
|
return { validatedSkillCount: oatSkillDirs.length, findings };
|
|
166
260
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@open-agent-toolkit/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
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",
|
|
@@ -25,21 +25,6 @@
|
|
|
25
25
|
"publishConfig": {
|
|
26
26
|
"access": "public"
|
|
27
27
|
},
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "bash scripts/bundle-assets.sh && tsc && tsc-alias",
|
|
30
|
-
"clean": "rm -rf dist",
|
|
31
|
-
"dev": "tsx watch src/index.ts",
|
|
32
|
-
"check": "oxlint . && oxfmt --check .",
|
|
33
|
-
"check:fix": "oxlint --fix . && oxfmt .",
|
|
34
|
-
"format": "oxfmt --check .",
|
|
35
|
-
"format:fix": "oxfmt .",
|
|
36
|
-
"lint": "oxlint .",
|
|
37
|
-
"lint:fix": "oxlint --fix .",
|
|
38
|
-
"test": "vitest run",
|
|
39
|
-
"test:watch": "vitest",
|
|
40
|
-
"test:coverage": "vitest run --coverage",
|
|
41
|
-
"type-check": "tsc --noEmit"
|
|
42
|
-
},
|
|
43
28
|
"dependencies": {
|
|
44
29
|
"@iarna/toml": "2.2.5",
|
|
45
30
|
"@inquirer/prompts": "^8.2.0",
|
|
@@ -58,5 +43,20 @@
|
|
|
58
43
|
},
|
|
59
44
|
"engines": {
|
|
60
45
|
"node": ">=22.17.0"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "bash scripts/bundle-assets.sh && tsc && tsc-alias",
|
|
49
|
+
"clean": "rm -rf dist",
|
|
50
|
+
"dev": "tsx watch src/index.ts",
|
|
51
|
+
"check": "oxlint . && oxfmt --check .",
|
|
52
|
+
"check:fix": "oxlint --fix . && oxfmt .",
|
|
53
|
+
"format": "oxfmt --check .",
|
|
54
|
+
"format:fix": "oxfmt .",
|
|
55
|
+
"lint": "oxlint .",
|
|
56
|
+
"lint:fix": "oxlint --fix .",
|
|
57
|
+
"test": "vitest run",
|
|
58
|
+
"test:watch": "vitest",
|
|
59
|
+
"test:coverage": "vitest run --coverage",
|
|
60
|
+
"type-check": "tsc --noEmit"
|
|
61
61
|
}
|
|
62
|
-
}
|
|
62
|
+
}
|