Add MindSpace page live edit, chat skills, and H5 deploy tooling.
Introduce page edit sessions with draft preview and patch API, chat skill picker, user memory profile, h5ApiBase resolution, voice WAV transport, and scripts for 105/g2 deployment and Plaza local dev. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+16
-2
@@ -6,12 +6,14 @@ import path from 'node:path';
|
||||
import { fileURLToPath } from 'node:url';
|
||||
import {
|
||||
buildPublicUrl,
|
||||
buildPublicZonePageUrl,
|
||||
buildPublishConstraints,
|
||||
buildSandboxSessionConstraints,
|
||||
ensureUserPublishLayout,
|
||||
isPathInsidePublishDir,
|
||||
migrateUserPublishDir,
|
||||
PUBLISH_ROOT_DIR,
|
||||
PUBLIC_ZONE_DIR,
|
||||
resolveLegacyPublishDir,
|
||||
} from './user-publish.mjs';
|
||||
import { syncSkillsToWorkspace } from './skills-registry.mjs';
|
||||
@@ -35,6 +37,14 @@ test('publish dir and public url use stable user id', () => {
|
||||
buildPublicUrl('https://g2.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/report.html`,
|
||||
);
|
||||
assert.equal(
|
||||
buildPublicZonePageUrl('https://g2.tkmind.cn', USER_ID, 'report.html'),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
);
|
||||
assert.equal(
|
||||
buildPublicZonePageUrl('https://g2.tkmind.cn', USER_ID, `${PUBLIC_ZONE_DIR}/report.html`),
|
||||
`https://g2.tkmind.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/report.html`,
|
||||
);
|
||||
const catalog = listPlatformSkillCatalog(platformRoot);
|
||||
syncSkillsToWorkspace({
|
||||
h5Root: platformRoot,
|
||||
@@ -47,7 +57,8 @@ test('publish dir and public url use stable user id', () => {
|
||||
const skillPath = path.join(layout.publishDir, '.agents', 'skills', 'static-page-publish', 'SKILL.md');
|
||||
assert.ok(fs.existsSync(skillPath));
|
||||
const skillText = fs.readFileSync(skillPath, 'utf8');
|
||||
assert.match(skillText, new RegExp(`g2\\.tkmind\\.cn/${PUBLISH_ROOT_DIR}/${USER_ID}`));
|
||||
assert.match(skillText, new RegExp(`g2\\.tkmind\\.cn/${PUBLISH_ROOT_DIR}/${USER_ID}/${PUBLIC_ZONE_DIR}/`));
|
||||
assert.match(skillText, /public\/report\.html/);
|
||||
assert.match(skillText, /\[.*\]\(.*\)/);
|
||||
assert.match(skillText, /mindspace-cover/);
|
||||
assert.match(skillText, /\.thumbnail\.svg/);
|
||||
@@ -80,7 +91,8 @@ test('buildPublishConstraints scopes default search to user workspace', () => {
|
||||
assert.match(constraints, /\*\*John\*\*/);
|
||||
assert.doesNotMatch(constraints, /对用户统一称 \*\*TKMind\*\*/);
|
||||
assert.match(constraints, /禁止用公网 URL 列目录/);
|
||||
assert.match(constraints, /oa\//);
|
||||
assert.match(constraints, /public\/页面\.html/);
|
||||
assert.match(constraints, /\/public\//);
|
||||
});
|
||||
|
||||
test('buildSandboxSessionConstraints documents shell and forbids public url browsing', () => {
|
||||
@@ -91,6 +103,8 @@ test('buildSandboxSessionConstraints documents shell and forbids public url brow
|
||||
assert.match(text, /shell 已开启/);
|
||||
assert.match(text, /禁止.*curl/);
|
||||
assert.match(text, /tree 已开启/);
|
||||
assert.match(text, /public\/xxx\.html/);
|
||||
assert.match(text, /\/public\//);
|
||||
});
|
||||
|
||||
test('isPathInsidePublishDir blocks escape', () => {
|
||||
|
||||
Reference in New Issue
Block a user