Initial commit: Memind H5 portal with MindSpace, Plaza, and agent jobs.
Track application source and tests; exclude local env, user workspaces, and runtime data via .gitignore. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import test from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
applySkillGrantsToCapabilities,
|
||||
listPlatformSkillCatalog,
|
||||
normalizeSkillPatch,
|
||||
resolveSkillMap,
|
||||
} from './skills-registry.mjs';
|
||||
import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
|
||||
const h5Root = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
test('lists static-page-publish in platform catalog', () => {
|
||||
const catalog = listPlatformSkillCatalog(h5Root);
|
||||
assert.ok(catalog.some((item) => item.name === 'static-page-publish'));
|
||||
});
|
||||
|
||||
test('granting publish skill enables static_publish capability', () => {
|
||||
const caps = applySkillGrantsToCapabilities(
|
||||
{ static_publish: false, skills: false },
|
||||
{ 'static-page-publish': true },
|
||||
);
|
||||
assert.equal(caps.static_publish, true);
|
||||
assert.equal(caps.skills, true);
|
||||
});
|
||||
|
||||
test('resolveSkillMap prefers user overrides', () => {
|
||||
const catalog = listPlatformSkillCatalog(h5Root);
|
||||
const resolved = resolveSkillMap(
|
||||
{ 'static-page-publish': false },
|
||||
{ 'static-page-publish': true },
|
||||
catalog,
|
||||
);
|
||||
assert.equal(resolved['static-page-publish'], true);
|
||||
});
|
||||
|
||||
test('normalizeSkillPatch ignores unknown skills', () => {
|
||||
const catalog = listPlatformSkillCatalog(h5Root);
|
||||
assert.deepEqual(normalizeSkillPatch(catalog, { unknown: true }), {});
|
||||
});
|
||||
Reference in New Issue
Block a user