OpenWriterControle/package.json
Darren Hinde d2a633d7dc
feat(cli): Bun-first CLI migration with 7 commands and comprehensive test suite (#259)
* feat(cli): migrate packages/cli to Bun-first with full test suite

- Replace fs-extra with Bun.file/Bun.write/node:fs/promises across all 9 source files
- Fix --help fast-path so all 8 subcommands are visible
- Replace tsup/tsx/vitest with bun build/bun run/bun:test
- Replace __dirname with import.meta.dir; use JSON import assertion for version
- Fix hardcoded OAC_VERSION in add.ts; add hashesMatch import to status.ts
- Replace computeFileHash with Bun.file().bytes() in sha256.ts
- Rename checkNodeVersion → checkBunVersion; parallelise doctor checks
- Fix TypeScript void-inference errors in update.ts, list.ts, status.ts
  by replacing .catch() with let/try-catch where result is used downstream
- Add ManifestError named error class; remove unsafe type casts
- Add 43 bun:test unit tests (sha256, manifest, installer, version) — 0 failures

* fix(cli): resolve critical bugs and standards violations found in review

Critical bug fixes:
- ide-detect.ts: replace Bun.file(dir).exists() with stat().isDirectory()
  for all directory checks — Bun.file().exists() always returns false for
  directories, breaking Cursor/Windsurf/OpenCode/Claude detection entirely
- bundled.ts: add registry.json exclusion anchor to findPackageRoot() to
  prevent monorepo root from matching before the CLI package root

Standards cleanup (§4.1, §5.1, §6.1, §15.3, §21.1):
- status.ts: parallelise findModifiedFiles + detectIdes with Promise.all
- apply.ts: fix duplicate warn/limit messages; remove else after return in
  reportWarnings; remove redundant mkdir before Bun.write
- version.ts: remove unnecessary (pkgJson as {version?:string}) cast
- manifest.ts: remove redundant mkdir before Bun.write; remove as unknown cast
- installer.ts: remove redundant mkdir calls before Bun.write throughout
- add.ts: add comment explaining why node:fs/promises rm is used

Tests (43 → 142, +99 new tests across 4 new files):
- ide-detect.test.ts: 26 tests covering all 4 IDEs, both claude indicators,
  detectIdes parallel, isIdePresent — directly validates the directory fix
- bundled.test.ts: 27 tests for classifyBundledFile, findPackageRoot,
  listBundledFiles, getBundledFilePath, bundledFileExists
- config.test.ts: 25 tests for readConfig/writeConfig round-trips,
  createDefaultConfig, mergeConfig, isYoloMode, isAutoBackup
- installer-update.test.ts: 14 tests covering all 5 updateFiles decision
  branches (install/update/skip/yolo/dry-run) plus isProjectRoot
- sha256.test.ts: +4 tests for empty file, large file, binary content

* fix(cli): fix P0 bugs — global flags, .git detection, package root resolution

- Remove duplicate --dry-run/--yolo/--verbose from parent program; Commander.js
  global option stealing caused all safety flags to be silently dropped in every
  subcommand action callback
- Fix isProjectRoot() to use stat() for .git detection; Bun.file().exists()
  returns false for directories, breaking oac init in standard git repos
- Add OAC_PACKAGE_ROOT env var override to getPackageRoot() for dev/monorepo mode;
  registry.json heuristic excluded the repo root causing oac init/add/update to
  throw when run from source
- Fix build script: remove --banner flag that caused double shebang in dist/index.js
- Rewrite bin/oac.js to invoke bun instead of node (dist is bun-only target)
- Refactor installer.ts let accumulators to const using Promise.all + reduce
- Add MVP planning docs (00-MVP-PLAN.md, master synthesis, project breakdown)

* fix(install.sh): handle both singular and plural component type formats

The get_registry_key() function was always adding 's' to the type,
causing 'contexts' to become 'contextss' which doesn't exist in registry.json.

Now handles:
- Singular forms: context → contexts, agent → agents, skill → skills
- Plural forms: contexts → contexts (unchanged), agents → agents
- Config stays singular
- Fallback for any type ending in 's'

Fixes #257
2026-03-24 21:54:03 +00:00

118 lines
5.6 KiB
JSON

{
"name": "@nextsystems/oac",
"version": "0.7.1",
"description": "AI agent framework for plan-first development workflows with approval-based execution. Multi-language support for TypeScript, Python, Go, Rust and more.",
"workspaces": [
"evals/framework",
"packages/cli",
"packages/compatibility-layer"
],
"bin": {
"oac": "./bin/oac.js"
},
"files": [
".opencode/agent/",
".opencode/command/",
".opencode/context/",
".opencode/plugin/",
".opencode/profiles/",
".opencode/prompts/",
".opencode/scripts/",
".opencode/skills/",
".opencode/tool/",
".opencode/config.json",
".opencode/opencode.json",
"!.opencode/tool/node_modules/",
"!.opencode/node_modules/",
"!**/node_modules/",
"scripts/",
"bin/",
"registry.json",
"install.sh",
"VERSION",
"LICENSE",
"README.md",
"CHANGELOG.md",
"CONTEXT_SYSTEM_GUIDE.md",
"packages/cli/dist/"
],
"engines": {
"node": ">=18.0.0"
},
"scripts": {
"test": "npm run test:all",
"test:all": "cd evals/framework && npm run eval:sdk",
"test:core": "npm run test:openagent:core",
"test:openagent": "cd evals/framework && npm run eval:sdk -- --agent=openagent",
"test:openagent:core": "cd evals/framework && npm run eval:sdk:core -- --agent=openagent",
"test:opencoder": "cd evals/framework && npm run eval:sdk -- --agent=opencoder",
"test:openagent:grok": "npm run test:openagent -- --model=opencode/grok-code-fast",
"test:openagent:claude": "npm run test:openagent -- --model=anthropic/claude-3-5-sonnet-20241022",
"test:openagent:gpt4": "npm run test:openagent -- --model=openai/gpt-4-turbo",
"test:opencoder:grok": "npm run test:opencoder -- --model=opencode/grok-code-fast",
"test:opencoder:claude": "npm run test:opencoder -- --model=anthropic/claude-3-5-sonnet-20241022",
"test:opencoder:gpt4": "npm run test:opencoder -- --model=openai/gpt-4-turbo",
"test:all:grok": "npm run test:all -- --model=opencode/grok-code-fast",
"test:all:claude": "npm run test:all -- --model=anthropic/claude-3-5-sonnet-20241022",
"test:all:gpt4": "npm run test:all -- --model=openai/gpt-4-turbo",
"test:pattern": "cd evals/framework && npm run eval:sdk -- --pattern",
"test:debug": "cd evals/framework && npm run eval:sdk -- --debug",
"test:openagent:developer": "npm run test:openagent -- --pattern='developer/*.yaml'",
"test:openagent:context": "npm run test:openagent -- --pattern='context-loading/*.yaml'",
"test:openagent:business": "npm run test:openagent -- --pattern='business/*.yaml'",
"test:opencoder:developer": "npm run test:opencoder -- --pattern='developer/*.yaml'",
"test:opencoder:bash": "npm run test:opencoder -- --pattern='developer/bash-*.yaml'",
"test:ci": "npm run test:ci:openagent && npm run test:ci:opencoder",
"test:ci:openagent": "npm run test:openagent -- --pattern='smoke-test.yaml' --no-evaluators",
"test:ci:opencoder": "npm run test:opencoder -- --pattern='developer/simple-bash-test.yaml' --no-evaluators",
"dashboard": "cd evals/results && ./serve.sh",
"dashboard:open": "npm run dashboard && open http://localhost:8000",
"results:openagent": "echo 'OpenAgent results:' && ls -lh evals/results/history/*openagent*.json 2>/dev/null | tail -5 || echo 'No results yet'",
"results:opencoder": "echo 'OpenCoder results:' && ls -lh evals/results/history/*opencoder*.json 2>/dev/null | tail -5 || echo 'No results yet'",
"results:latest": "cat evals/results/latest.json 2>/dev/null | jq '.agent, .passed, .failed' || echo 'No results yet'",
"version": "node -p \"require('./package.json').version\"",
"version:bump": "./scripts/versioning/bump-version.sh",
"version:bump:patch": "npm version patch --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"version:bump:minor": "npm version minor --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"version:bump:major": "npm version major --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"version:bump:alpha": "npm version prerelease --preid=alpha --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"version:bump:beta": "npm version prerelease --preid=beta --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"version:bump:rc": "npm version prerelease --preid=rc --no-git-tag-version && node -p \"require('./package.json').version\" > VERSION",
"dev:setup": "cd evals/framework && npm install",
"dev:build": "cd evals/framework && npm run build",
"dev:test": "cd evals/framework && npm test",
"dev:clean": "cd evals/framework && rm -rf dist node_modules && npm install",
"validate:registry": "bun run scripts/registry/validate-registry.ts",
"validate:context-links": "bun run scripts/validation/validate-markdown-links.ts",
"validate:registry:verbose": "bun run scripts/registry/validate-registry.ts -v",
"validate:registry:fix": "bun run scripts/registry/validate-registry.ts -f"
},
"keywords": [
"opencode",
"openagents",
"ai-agents",
"code-generation",
"development-workflow",
"plan-first",
"context-aware",
"typescript",
"python",
"go",
"rust",
"cli",
"automation"
],
"author": "Darren Hinde",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/darrenhinde/OpenAgentsControl.git"
},
"bugs": {
"url": "https://github.com/darrenhinde/OpenAgentsControl/issues"
},
"homepage": "https://github.com/darrenhinde/OpenAgentsControl#readme",
"devDependencies": {
"glob": "^13.0.0"
}
}