|
|
1 month ago | |
|---|---|---|
| .. | ||
| types | 1 month ago | |
| utils | 1 month ago | |
| .context-manifest.json | 1 month ago | |
| README.md | 1 month ago | |
| cleanup-tmp.sh | 1 month ago | |
| install-context.js | 1 month ago | |
| install-context.sh | 1 month ago | |
| install-context.ts | 1 month ago | |
| test-install.ts | 1 month ago | |
| tsconfig.json | 1 month ago | |
TypeScript implementation of the context installer for the Claude Code plugin.
This directory contains a TypeScript-based context installer that downloads context files from the OpenAgents Control repository using git sparse-checkout.
install-context.ts - Main installer script with CLI interfacetest-install.ts - Test script for verifying installation against real GitHub repositorytypes/registry.ts - Registry schema and types (with Zod validation)types/manifest.ts - Manifest schema and typesutils/registry-fetcher.ts - Fetch and parse registry.json from GitHubutils/git-sparse.ts - Git sparse-checkout operations# Install essential profile (default)
bun run plugins/claude-code/scripts/install-context.ts
# Install specific profile
bun run plugins/claude-code/scripts/install-context.ts --profile=standard
# Install specific components
bun run plugins/claude-code/scripts/install-context.ts --component=core-standards --component=openagents-repo
# Dry run (see what would be installed)
bun run plugins/claude-code/scripts/install-context.ts --profile=extended --dry-run
# Force reinstall with verbose output
bun run plugins/claude-code/scripts/install-context.ts --force --verbose
# Run test suite
bun run plugins/claude-code/scripts/test-install.ts
✅ Fetch registry.json from GitHub
✅ Parse and validate with Zod
✅ Filter context components by profile
✅ Download using git sparse-checkout
✅ Create manifest tracking installation
✅ Handle errors gracefully
✅ Dry run mode
✅ Verbose logging
✅ Force reinstall option
The registry-fetcher utility:
The git-sparse utility:
--filter=blob:none --sparseThe installer creates a .context-manifest.json file tracking:
The test script (test-install.ts) verifies:
To test actual installation, uncomment Test 4 in test-install.ts.
Context Installer
========================
ℹ Profile: essential
ℹ Repository: darrenhinde/OpenAgentsControl
ℹ Branch: main
ℹ Dry run: false
ℹ Fetching registry from GitHub...
✓ Registry version: 2.0.0
✓ Context components available: 150
ℹ Filtering by profile: essential
✓ Selected 12 components
ℹ Downloading context files...
✓ Files downloaded successfully
ℹ Copying files to context directory...
✓ Files copied to: /path/to/context
ℹ Creating manifest...
✓ Manifest created: .context-manifest.json
ℹ Verifying installation...
✓ Installation complete!
ℹ Files verified: 12/12
The installer handles:
All errors are logged with clear messages and the installer exits with appropriate exit codes.
All types are defined in types/ directory with Zod schemas for runtime validation.
Run tests before committing changes:
bun run plugins/claude-code/scripts/test-install.ts
To add a new profile, update the Profile type in types/registry.ts and the profile mapping in utils/registry-fetcher.ts.
This TypeScript implementation replaces the original install-context.js with:
The JavaScript version is kept for backward compatibility but the TypeScript version is recommended for new installations.