Files
memind/mindspace-local-runtime-services.test.mjs
T
john 7f8d692d16 fix(agent): recover stale runs and improve new-user OA delivery
Fix DEV logout cookie clearing, materialize selected MindSpace OA assets before agent runs, and recover zombie runs from synced workspace pages. Add client run wait timeout, harness retry limits, page-edit asset forwarding, and logout/john2 scenario tests.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-10 20:05:52 +08:00

41 lines
1.5 KiB
JavaScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { createMindSpaceLocalRuntimeServices } from './mindspace-local-runtime-services.mjs';
test('createMindSpaceLocalRuntimeServices assembles local runtime-backed service bindings', () => {
const pool = {
query: async () => {
throw new Error('not implemented in unit test');
},
};
const services = createMindSpaceLocalRuntimeServices({
pool,
h5Root: '/tmp/h5',
env: {
MINDSPACE_STORAGE_ROOT: '/srv/mindspace-data',
H5_PUBLIC_BASE_URL: 'https://example.com',
},
maxFileBytes: 8192,
publicPageLimit: 8,
resolveUserIdForAgentSession: async () => 'user-1',
resolveWorkspaceRoot: async () => '/tmp/workspace',
conversationPackageBackfill: () => [],
conversationPackagePublicHtmlHydrator: () => [],
logger: { info() {}, warn() {}, error() {} },
});
assert.equal(services.storageRoot, '/srv/mindspace-data');
assert.equal(services.publicBaseUrl, 'https://example.com');
assert.equal(services.storageAdapter.kind, 'local-fs');
assert.ok(services.serviceFacade);
assert.ok(services.conversationPackageRegistry);
assert.ok(services.assetService);
assert.ok(services.pageService);
assert.ok(services.pageSyncService);
assert.ok(services.publicationService);
assert.ok(services.cleanupService);
assert.ok(services.agentJobService);
assert.ok(services.pageLiveEditService);
assert.ok(services.assetAgentService);
});