refactor(app): remove the wiki Tauri commands (P2.2)

get_wiki_pages, get_wiki_page, get_wiki_page_content and
compile_wiki_section proxied to the sidecar's /api/wiki routes, which
served the wiki-compiler package and left with the old memory engine in
P1.5. No screen called them. Remove the commands, their TypeScript
bindings and tests. cargo check and the 32 Rust tests pass.
This commit is contained in:
shumeiko.it
2026-11-01 00:42:39 +01:00
parent 2edfd01e6e
commit 4c1b404339
7 changed files with 7 additions and 183 deletions

View File

@@ -24,10 +24,6 @@ import {
saveMemory,
searchEntities,
getIdentity,
compileWikiSection,
getWikiPages,
getWikiPage,
getWikiPageContent,
isFirstLaunch,
markFirstLaunchComplete,
resetFirstLaunch,
@@ -285,36 +281,6 @@ describe('memory + identity bindings', () => {
});
});
describe('wiki bindings', () => {
beforeEach(() => {
mockedInvoke.mockReset();
});
it('compileWikiSection defaults args + invokes', async () => {
mockedInvoke.mockResolvedValue({});
await compileWikiSection();
expect(mockedInvoke).toHaveBeenCalledWith('compile_wiki_section', {});
});
it('getWikiPages takes no args', async () => {
mockedInvoke.mockResolvedValue([]);
await getWikiPages();
expect(mockedInvoke).toHaveBeenCalledWith('get_wiki_pages');
});
it('getWikiPage passes slug', async () => {
mockedInvoke.mockResolvedValue({ slug: 's', title: 't' });
await getWikiPage('my-slug');
expect(mockedInvoke).toHaveBeenCalledWith('get_wiki_page', { slug: 'my-slug' });
});
it('getWikiPageContent passes slug', async () => {
mockedInvoke.mockResolvedValue({ slug: 's', content: '# md' });
await getWikiPageContent('my-slug');
expect(mockedInvoke).toHaveBeenCalledWith('get_wiki_page_content', { slug: 'my-slug' });
});
});
describe('onboarding flag bindings (A10)', () => {
beforeEach(() => {
mockedInvoke.mockReset();

View File

@@ -148,63 +148,6 @@ export function getIdentity(): Promise<IdentityResponse> {
return invoke<IdentityResponse>('get_identity');
}
// ─── wiki commands (A4) ────────────────────────────────────────────────────
// CC Sesija A §2.1 Task A4. Reads compiled wiki pages from sidecar (sourced
// from per-workspace MindDB by packages/wiki-compiler) + triggers compile.
/**
* One entry in the wiki page index from GET /api/wiki/pages. Shape varies by
* page type (entity/concept/synthesis); raw fields preserved for the React
* adapter to project into typed UI cells.
*/
export interface WikiPageMeta {
slug: string;
title?: string;
type?: string;
[key: string]: unknown;
}
export interface WikiPageContent {
slug: string;
content: string;
[key: string]: unknown;
}
/** List all compiled wiki pages (slug + metadata, no body). */
export function getWikiPages(): Promise<WikiPageMeta[] | { pages: WikiPageMeta[] }> {
return invoke<WikiPageMeta[] | { pages: WikiPageMeta[] }>('get_wiki_pages');
}
/** Fetch a single wiki page's metadata by slug. */
export function getWikiPage(slug: string): Promise<WikiPageMeta> {
return invoke<WikiPageMeta>('get_wiki_page', { slug });
}
/** Fetch the full markdown content for a wiki page by slug. */
export function getWikiPageContent(slug: string): Promise<WikiPageContent> {
return invoke<WikiPageContent>('get_wiki_page_content', { slug });
}
export interface CompileWikiArgs {
workspaceId?: string;
}
/**
* Sidecar POST /api/wiki/compile triggers wiki-compiler. Response is a summary
* envelope from packages/wiki-compiler — exact shape depends on compiler version
* (page counts, entity counts, gap reports). Raw shape preserved.
*/
export interface CompileWikiResponse {
pageCount?: number;
entityCount?: number;
gaps?: number;
[key: string]: unknown;
}
export function compileWikiSection(args: CompileWikiArgs = {}): Promise<CompileWikiResponse> {
return invoke<CompileWikiResponse>('compile_wiki_section', args as unknown as Record<string, unknown>);
}
// ─── run_agent_query (streaming) ───────────────────────────────────────────
// CC Sesija A §2.1 Task A3.