Convert gitgram/ and aitimemachine/ from embedded git repos (which showed as opaque submodule gitlinks on GitHub) into fully-tracked first-party content. AITM now merges its 7 vendored repos as first-party engines: - memory: beads (Go task DAG) + context7 (docs SDK), unified into saved_contexts - git: vendored C git (bundled binary) + gitnexus (in-process code intelligence) - agentic: a2a (@a2a-js/sdk) + pal (AITM-managed Python subprocess) Includes the full session's product build: Gitgram web/mobile/backend features, AITM website/CLI/MCP, the unified memory layer, engine build tooling (scripts/build-engines.sh, Dockerfile, CI), docs (README, ENGINES.md, ARCHITECTURE.md), and extensive test suites. Build artifacts, node_modules, external/, and gemini-cli are gitignored. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
46 lines
2.0 KiB
TypeScript
46 lines
2.0 KiB
TypeScript
import { describe, it, expect } from 'vitest';
|
|
import { isLanguageAvailable, loadLanguage } from '../../src/core/tree-sitter/parser-loader.js';
|
|
import { SupportedLanguages } from '../../src/config/supported-languages.js';
|
|
|
|
describe('isLanguageAvailable', () => {
|
|
it('returns true for installed languages', () => {
|
|
expect(isLanguageAvailable(SupportedLanguages.TypeScript)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.JavaScript)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.Python)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.Java)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.Go)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.Rust)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.PHP)).toBe(true);
|
|
expect(isLanguageAvailable(SupportedLanguages.Ruby)).toBe(true);
|
|
});
|
|
|
|
it('returns false for fabricated language values', () => {
|
|
expect(isLanguageAvailable('erlang' as SupportedLanguages)).toBe(false);
|
|
expect(isLanguageAvailable('haskell' as SupportedLanguages)).toBe(false);
|
|
});
|
|
|
|
it('returns true for Swift in the default install', () => {
|
|
expect(isLanguageAvailable(SupportedLanguages.Swift)).toBe(true);
|
|
});
|
|
|
|
it('handles Kotlin based on optional dependency availability', () => {
|
|
// Kotlin is now optional — result depends on whether tree-sitter-kotlin is installed
|
|
const result = isLanguageAvailable(SupportedLanguages.Kotlin);
|
|
expect(typeof result).toBe('boolean');
|
|
// Either way, it should not throw
|
|
});
|
|
});
|
|
|
|
describe('Kotlin optional dependency', () => {
|
|
it('handles Kotlin loading gracefully', async () => {
|
|
// Kotlin is optional — it either loads successfully or throws an error
|
|
try {
|
|
await loadLanguage(SupportedLanguages.Kotlin);
|
|
// If it succeeds, tree-sitter-kotlin is installed
|
|
} catch (e: any) {
|
|
// If it fails, it should be because tree-sitter-kotlin is not installed
|
|
expect(e.message).toContain('Unsupported language');
|
|
}
|
|
});
|
|
});
|