feat: update Makelore modules and conversations
Some checks failed
Electron E2E / Electron E2E (macos-latest) (push) Has been cancelled
Electron E2E / Electron E2E (ubuntu-latest) (push) Has been cancelled
Electron E2E / Electron E2E (windows-latest) (push) Has been cancelled

This commit is contained in:
inman
2026-07-31 10:08:41 +08:00
parent b8ca3f8eea
commit 80e8386fa6
175 changed files with 8036 additions and 10581 deletions

View File

@@ -10,37 +10,37 @@ afterEach(async () => {
await Promise.all(temporaryDirectories.splice(0).map((directory) => rm(directory, { recursive: true, force: true })));
});
async function createProjectConfig(templateId: string, superpowersEnabled?: boolean): Promise<string> {
async function createProjectConfig(superpowersEnabled?: boolean): Promise<string> {
const projectPath = await mkdtemp(path.join(tmpdir(), 'niancode-superpowers-plugin-'));
temporaryDirectories.push(projectPath);
await mkdir(path.join(projectPath, '.niancode'), { recursive: true });
await writeFile(
path.join(projectPath, '.niancode', 'project.json'),
JSON.stringify({ templateId, ...(typeof superpowersEnabled === 'boolean' ? { superpowersEnabled } : {}) }),
JSON.stringify({ schemaVersion: 1, ...(typeof superpowersEnabled === 'boolean' ? { superpowersEnabled } : {}) }),
'utf8',
);
return projectPath;
}
describe('bundled Superpowers plugin project gating', () => {
it('uses the project setting and template fallback', async () => {
const gamePath = await createProjectConfig('game-development');
const standardPath = await createProjectConfig('standard-development');
const explicitGamePath = await createProjectConfig('game-development', true);
it('uses only the explicit project setting', async () => {
const defaultPath = await createProjectConfig();
const disabledPath = await createProjectConfig(false);
const enabledPath = await createProjectConfig(true);
expect(isSuperpowersEnabledForDirectory(gamePath)).toBe(false);
expect(isSuperpowersEnabledForDirectory(standardPath)).toBe(true);
expect(isSuperpowersEnabledForDirectory(explicitGamePath)).toBe(true);
expect(isSuperpowersEnabledForDirectory(defaultPath)).toBe(true);
expect(isSuperpowersEnabledForDirectory(disabledPath)).toBe(false);
expect(isSuperpowersEnabledForDirectory(enabledPath)).toBe(true);
});
it('returns no hooks when a project disables Superpowers', async () => {
const projectPath = await createProjectConfig('game-development', false);
const projectPath = await createProjectConfig(false);
await expect(SuperpowersPlugin({ directory: projectPath })).resolves.toEqual({});
});
it('registers the Skills path and bootstrap when a project enables Superpowers', async () => {
const projectPath = await createProjectConfig('standard-development', true);
const projectPath = await createProjectConfig(true);
const hooks = await SuperpowersPlugin({ directory: projectPath });
const config = { skills: { paths: [] as string[] } };