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>
42 lines
1.2 KiB
TypeScript
42 lines
1.2 KiB
TypeScript
import { beforeEach } from 'vitest';
|
|
import '@testing-library/jest-dom/vitest';
|
|
|
|
const I18N_LANGUAGE_STORAGE_KEY = 'gitnexus.lng';
|
|
|
|
function ensureStorage(name: 'localStorage' | 'sessionStorage') {
|
|
const current = globalThis[name];
|
|
if (
|
|
current &&
|
|
typeof current.getItem === 'function' &&
|
|
typeof current.removeItem === 'function'
|
|
) {
|
|
return;
|
|
}
|
|
|
|
const store = new Map<string, string>();
|
|
Object.defineProperty(globalThis, name, {
|
|
configurable: true,
|
|
value: {
|
|
getItem: (key: string) => store.get(key) ?? null,
|
|
setItem: (key: string, value: string) => store.set(key, String(value)),
|
|
removeItem: (key: string) => store.delete(key),
|
|
clear: () => store.clear(),
|
|
key: (index: number) => Array.from(store.keys())[index] ?? null,
|
|
get length() {
|
|
return store.size;
|
|
},
|
|
},
|
|
});
|
|
}
|
|
|
|
ensureStorage('localStorage');
|
|
ensureStorage('sessionStorage');
|
|
localStorage.removeItem(I18N_LANGUAGE_STORAGE_KEY);
|
|
|
|
// Reset storage between tests
|
|
beforeEach(() => {
|
|
sessionStorage.removeItem('gitnexus-llm-settings');
|
|
localStorage.removeItem('gitnexus-llm-settings'); // legacy key (migration)
|
|
localStorage.removeItem(I18N_LANGUAGE_STORAGE_KEY);
|
|
});
|