@dotdrelle/wiki-manager 0.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +58 -0
- package/LICENSE +108 -0
- package/README.md +693 -0
- package/agents.docker-compose.yml +96 -0
- package/bin/wiki-manager.js +34 -0
- package/bunfig.toml +1 -0
- package/docker-compose.yml +135 -0
- package/mcp.endpoints.example.json +28 -0
- package/package.json +57 -0
- package/src/agent/graph.js +638 -0
- package/src/agent/llm.js +239 -0
- package/src/cli/wiki-manager.js +389 -0
- package/src/commands/slash.js +1044 -0
- package/src/core/activity.js +236 -0
- package/src/core/activity.test.js +127 -0
- package/src/core/agentEvents.js +238 -0
- package/src/core/agentEvents.test.js +134 -0
- package/src/core/compose.js +310 -0
- package/src/core/documentIntake.js +311 -0
- package/src/core/documentIntake.test.js +121 -0
- package/src/core/env.js +57 -0
- package/src/core/jobQueue.js +197 -0
- package/src/core/mcp.js +402 -0
- package/src/core/mcp.test.js +228 -0
- package/src/core/plan.js +181 -0
- package/src/core/plan.test.js +168 -0
- package/src/core/skills.js +142 -0
- package/src/core/wikirc.js +65 -0
- package/src/core/workspaces.js +81 -0
- package/src/shell/FileEditorDialog.tsx +94 -0
- package/src/shell/LeftPane.tsx +680 -0
- package/src/shell/RightPane.tsx +291 -0
- package/src/shell/SlashDialog.tsx +39 -0
- package/src/shell/renderer.ts +69 -0
- package/src/shell/repl.js +1490 -0
- package/src/shell/tui.tsx +205 -0
- package/src/shell/useAgent.ts +47 -0
- package/src/shell/useSession.ts +370 -0
- package/tsconfig.json +16 -0
- package/wiki-workspace +773 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** @jsxImportSource @opentui/solid */
|
|
2
|
+
import { createEffect, createSignal, Show } from 'solid-js';
|
|
3
|
+
|
|
4
|
+
export type ActiveFileEditor = {
|
|
5
|
+
title: string;
|
|
6
|
+
filePath: string;
|
|
7
|
+
displayPath: string;
|
|
8
|
+
content: string;
|
|
9
|
+
language?: string;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export function FileEditorDialog(props: {
|
|
13
|
+
editor: ActiveFileEditor | null;
|
|
14
|
+
width: number;
|
|
15
|
+
height: number;
|
|
16
|
+
onSave: (content: string) => { ok: true } | { ok: false; error: string };
|
|
17
|
+
onCancel: () => void;
|
|
18
|
+
}) {
|
|
19
|
+
let textareaRef: any;
|
|
20
|
+
const [error, setError] = createSignal<string | null>(null);
|
|
21
|
+
const [draftContent, setDraftContent] = createSignal<string | null>(null);
|
|
22
|
+
|
|
23
|
+
createEffect(() => {
|
|
24
|
+
const editor = props.editor;
|
|
25
|
+
setError(null);
|
|
26
|
+
setDraftContent(editor?.content ?? null);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const dialogWidth = () => Math.max(52, Math.min(110, Math.floor(props.width * 0.74)));
|
|
30
|
+
const dialogHeight = () => Math.max(16, Math.min(34, Math.floor(props.height * 0.72)));
|
|
31
|
+
const left = () => Math.max(1, Math.floor((props.width - dialogWidth()) / 2));
|
|
32
|
+
const top = () => Math.max(1, Math.floor((props.height - dialogHeight()) / 2));
|
|
33
|
+
const editorHeight = () => Math.max(6, dialogHeight() - 8);
|
|
34
|
+
|
|
35
|
+
const save = () => {
|
|
36
|
+
const content = String(textareaRef?.plainText ?? draftContent() ?? props.editor?.content ?? '');
|
|
37
|
+
const result = props.onSave(content);
|
|
38
|
+
if (result.ok === false) setError(result.error);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<Show when={props.editor}>
|
|
43
|
+
{(editor) => (
|
|
44
|
+
<box
|
|
45
|
+
position="absolute"
|
|
46
|
+
left={left()}
|
|
47
|
+
top={top()}
|
|
48
|
+
width={dialogWidth()}
|
|
49
|
+
height={dialogHeight()}
|
|
50
|
+
zIndex={30}
|
|
51
|
+
border
|
|
52
|
+
borderStyle="rounded"
|
|
53
|
+
borderColor="#5DADE2"
|
|
54
|
+
backgroundColor="#111318"
|
|
55
|
+
padding={1}
|
|
56
|
+
flexDirection="column"
|
|
57
|
+
overflow="hidden"
|
|
58
|
+
>
|
|
59
|
+
<text height={1} fg="#FBBF24">{editor().title}</text>
|
|
60
|
+
<text height={1} fg="#7F8C8D">{editor().displayPath}</text>
|
|
61
|
+
<box
|
|
62
|
+
height={editorHeight()}
|
|
63
|
+
flexDirection="column"
|
|
64
|
+
border
|
|
65
|
+
borderStyle="single"
|
|
66
|
+
borderColor="#4B5563"
|
|
67
|
+
backgroundColor="#0B0D12"
|
|
68
|
+
overflow="hidden"
|
|
69
|
+
>
|
|
70
|
+
<textarea
|
|
71
|
+
ref={textareaRef}
|
|
72
|
+
focused
|
|
73
|
+
height={editorHeight() - 2}
|
|
74
|
+
width={dialogWidth() - 6}
|
|
75
|
+
initialValue={editor().content}
|
|
76
|
+
wrapMode="word"
|
|
77
|
+
keyBindings={[{ name: 's', ctrl: true, action: 'submit' }]}
|
|
78
|
+
onSubmit={save}
|
|
79
|
+
onContentChange={setDraftContent}
|
|
80
|
+
/>
|
|
81
|
+
</box>
|
|
82
|
+
<Show when={error()}>
|
|
83
|
+
{(message) => <text height={1} fg="#F87171">{message()}</text>}
|
|
84
|
+
</Show>
|
|
85
|
+
<box height={1} flexDirection="row">
|
|
86
|
+
<text fg="#111318" bg="#8BD5CA"> Save Ctrl+S </text>
|
|
87
|
+
<text fg="#7F8C8D"> </text>
|
|
88
|
+
<text fg="#D6DEE8" bg="#4B5563"> Cancel Esc </text>
|
|
89
|
+
</box>
|
|
90
|
+
</box>
|
|
91
|
+
)}
|
|
92
|
+
</Show>
|
|
93
|
+
);
|
|
94
|
+
}
|