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:
John
2026-06-15 15:04:43 -07:00
commit 2e14873f2d
272 changed files with 64133 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import {
appendPlazaEmbedQuery,
injectPlazaEmbedBootstrap,
isPlazaEmbedRequest,
publishedPageCspForEmbed,
} from './plaza-embed.mjs';
test('isPlazaEmbedRequest detects embed=plaza', () => {
assert.equal(isPlazaEmbedRequest({ embed: 'plaza' }), true);
assert.equal(isPlazaEmbedRequest({ embed: 'other' }), false);
assert.equal(isPlazaEmbedRequest({}), false);
});
test('appendPlazaEmbedQuery appends query once', () => {
assert.equal(
appendPlazaEmbedQuery('/u/john/pages/demo'),
'/u/john/pages/demo?embed=plaza',
);
assert.equal(
appendPlazaEmbedQuery('/u/john/pages/demo?embed=plaza'),
'/u/john/pages/demo?embed=plaza',
);
});
test('injectPlazaEmbedBootstrap adds script before closing body', () => {
const html = '<!doctype html><html><body><h1>Hi</h1></body></html>';
const out = injectPlazaEmbedBootstrap(html);
assert.match(out, /plaza-embed-bootstrap/);
assert.match(out, /<\/body>/);
});
test('publishedPageCspForEmbed allows inline script', () => {
assert.match(publishedPageCspForEmbed(true), /script-src 'unsafe-inline'/);
});