@project-ava-supernova/core 0.2.189 → 0.2.190
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/dist/agent/agent.d.ts +1 -1
- package/dist/agent/agent.d.ts.map +1 -1
- package/dist/agent/agent.js +44 -30
- package/dist/agent/agent.js.map +1 -1
- package/dist/agent/system-prompt.d.ts.map +1 -1
- package/dist/agent/system-prompt.js +1224 -1223
- package/dist/agent/system-prompt.js.map +1 -1
- package/dist/audit/cost.d.ts.map +1 -1
- package/dist/audit/cost.js +10 -9
- package/dist/audit/cost.js.map +1 -1
- package/dist/auto/auto-coordinator.d.ts +1 -1
- package/dist/auto/auto-coordinator.js +2 -2
- package/dist/auto/coordinator-model.d.ts +6 -4
- package/dist/auto/coordinator-model.d.ts.map +1 -1
- package/dist/auto/coordinator-model.js +4 -3
- package/dist/auto/coordinator-model.js.map +1 -1
- package/dist/auto/intent-gate.d.ts +2 -2
- package/dist/auto/intent-gate.d.ts.map +1 -1
- package/dist/auto/intent-gate.js +4 -5
- package/dist/auto/intent-gate.js.map +1 -1
- package/dist/auto/longxiang-router.d.ts +5 -1
- package/dist/auto/longxiang-router.d.ts.map +1 -1
- package/dist/auto/longxiang-router.js +5 -1
- package/dist/auto/longxiang-router.js.map +1 -1
- package/dist/auto/model-router.d.ts.map +1 -1
- package/dist/auto/model-router.js +17 -14
- package/dist/auto/model-router.js.map +1 -1
- package/dist/auto/supernova-router.d.ts +2 -3
- package/dist/auto/supernova-router.d.ts.map +1 -1
- package/dist/auto/supernova-router.js +2 -3
- package/dist/auto/supernova-router.js.map +1 -1
- package/dist/auto/task-classifier.d.ts.map +1 -1
- package/dist/auto/task-classifier.js +3 -1
- package/dist/auto/task-classifier.js.map +1 -1
- package/dist/docs/content/concepts.js +7 -7
- package/dist/docs/content/concepts.js.map +1 -1
- package/dist/docs/data/providers.d.ts.map +1 -1
- package/dist/docs/data/providers.js +2 -4
- package/dist/docs/data/providers.js.map +1 -1
- package/dist/docs/i18n/translations.d.ts.map +1 -1
- package/dist/docs/i18n/translations.js +1 -1
- package/dist/docs/i18n/translations.js.map +1 -1
- package/dist/i18n/keep-english.d.ts.map +1 -1
- package/dist/i18n/keep-english.js +3 -0
- package/dist/i18n/keep-english.js.map +1 -1
- package/dist/i18n/locales/ar.d.ts.map +1 -1
- package/dist/i18n/locales/ar.js +47 -0
- package/dist/i18n/locales/ar.js.map +1 -1
- package/dist/i18n/locales/de.d.ts.map +1 -1
- package/dist/i18n/locales/de.js +47 -0
- package/dist/i18n/locales/de.js.map +1 -1
- package/dist/i18n/locales/en.d.ts +47 -0
- package/dist/i18n/locales/en.d.ts.map +1 -1
- package/dist/i18n/locales/en.js +47 -0
- package/dist/i18n/locales/en.js.map +1 -1
- package/dist/i18n/locales/es.d.ts.map +1 -1
- package/dist/i18n/locales/es.js +47 -0
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.d.ts.map +1 -1
- package/dist/i18n/locales/fr.js +47 -0
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hi.d.ts.map +1 -1
- package/dist/i18n/locales/hi.js +47 -0
- package/dist/i18n/locales/hi.js.map +1 -1
- package/dist/i18n/locales/id.d.ts.map +1 -1
- package/dist/i18n/locales/id.js +47 -0
- package/dist/i18n/locales/id.js.map +1 -1
- package/dist/i18n/locales/it.d.ts.map +1 -1
- package/dist/i18n/locales/it.js +47 -0
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/ja.d.ts.map +1 -1
- package/dist/i18n/locales/ja.js +47 -0
- package/dist/i18n/locales/ja.js.map +1 -1
- package/dist/i18n/locales/ko.d.ts.map +1 -1
- package/dist/i18n/locales/ko.js +47 -0
- package/dist/i18n/locales/ko.js.map +1 -1
- package/dist/i18n/locales/nl.d.ts.map +1 -1
- package/dist/i18n/locales/nl.js +47 -0
- package/dist/i18n/locales/nl.js.map +1 -1
- package/dist/i18n/locales/pl.d.ts.map +1 -1
- package/dist/i18n/locales/pl.js +47 -0
- package/dist/i18n/locales/pl.js.map +1 -1
- package/dist/i18n/locales/pt.d.ts.map +1 -1
- package/dist/i18n/locales/pt.js +47 -0
- package/dist/i18n/locales/pt.js.map +1 -1
- package/dist/i18n/locales/ru.d.ts.map +1 -1
- package/dist/i18n/locales/ru.js +47 -0
- package/dist/i18n/locales/ru.js.map +1 -1
- package/dist/i18n/locales/th.d.ts.map +1 -1
- package/dist/i18n/locales/th.js +47 -0
- package/dist/i18n/locales/th.js.map +1 -1
- package/dist/i18n/locales/tr.d.ts.map +1 -1
- package/dist/i18n/locales/tr.js +47 -0
- package/dist/i18n/locales/tr.js.map +1 -1
- package/dist/i18n/locales/uk.d.ts.map +1 -1
- package/dist/i18n/locales/uk.js +47 -0
- package/dist/i18n/locales/uk.js.map +1 -1
- package/dist/i18n/locales/vi.d.ts.map +1 -1
- package/dist/i18n/locales/vi.js +47 -0
- package/dist/i18n/locales/vi.js.map +1 -1
- package/dist/i18n/locales/zh-CN.d.ts.map +1 -1
- package/dist/i18n/locales/zh-CN.js +47 -0
- package/dist/i18n/locales/zh-CN.js.map +1 -1
- package/dist/i18n/locales/zh-TW.d.ts.map +1 -1
- package/dist/i18n/locales/zh-TW.js +47 -0
- package/dist/i18n/locales/zh-TW.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/connection.d.ts +37 -1
- package/dist/mcp/connection.d.ts.map +1 -1
- package/dist/mcp/connection.js +146 -3
- package/dist/mcp/connection.js.map +1 -1
- package/dist/mcp/index.d.ts +8 -1
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +4 -1
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/manager.d.ts +61 -4
- package/dist/mcp/manager.d.ts.map +1 -1
- package/dist/mcp/manager.js +211 -15
- package/dist/mcp/manager.js.map +1 -1
- package/dist/mcp/page.d.ts +1 -1
- package/dist/mcp/page.d.ts.map +1 -1
- package/dist/mcp/page.js +15 -2
- package/dist/mcp/page.js.map +1 -1
- package/dist/mcp/permissions.d.ts +29 -9
- package/dist/mcp/permissions.d.ts.map +1 -1
- package/dist/mcp/permissions.js +26 -15
- package/dist/mcp/permissions.js.map +1 -1
- package/dist/mcp/servers-config.d.ts +7 -0
- package/dist/mcp/servers-config.d.ts.map +1 -1
- package/dist/mcp/servers-config.js +2 -0
- package/dist/mcp/servers-config.js.map +1 -1
- package/dist/mcp/suggested.d.ts +7 -4
- package/dist/mcp/suggested.d.ts.map +1 -1
- package/dist/mcp/suggested.js +14 -3
- package/dist/mcp/suggested.js.map +1 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +7 -1
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/unreal-context.d.ts +36 -0
- package/dist/mcp/unreal-context.d.ts.map +1 -0
- package/dist/mcp/unreal-context.js +163 -0
- package/dist/mcp/unreal-context.js.map +1 -0
- package/dist/mcp/unreal-install.d.ts +67 -0
- package/dist/mcp/unreal-install.d.ts.map +1 -0
- package/dist/mcp/unreal-install.js +182 -0
- package/dist/mcp/unreal-install.js.map +1 -0
- package/dist/mcp/unreal-panel.d.ts +38 -0
- package/dist/mcp/unreal-panel.d.ts.map +1 -0
- package/dist/mcp/unreal-panel.js +59 -0
- package/dist/mcp/unreal-panel.js.map +1 -0
- package/dist/mcp/unreal.d.ts +94 -0
- package/dist/mcp/unreal.d.ts.map +1 -0
- package/dist/mcp/unreal.js +174 -0
- package/dist/mcp/unreal.js.map +1 -0
- package/dist/memory-v4/model.js +1 -1
- package/dist/memory-v4/model.js.map +1 -1
- package/dist/personas/conductor.d.ts +1 -1
- package/dist/personas/types.d.ts +1 -1
- package/dist/providers/qwen/models.d.ts.map +1 -1
- package/dist/providers/qwen/models.js +52 -35
- package/dist/providers/qwen/models.js.map +1 -1
- package/dist/providers/request-shaping/model-ids.d.ts +3 -1
- package/dist/providers/request-shaping/model-ids.d.ts.map +1 -1
- package/dist/providers/request-shaping/model-ids.js +14 -7
- package/dist/providers/request-shaping/model-ids.js.map +1 -1
- package/dist/tools/blender/build-model.js +1 -1
- package/dist/tools/blender/build-model.js.map +1 -1
- package/dist/tools/blender/live-tools.js +2 -2
- package/dist/tools/blender/live-tools.js.map +1 -1
- package/dist/tools/blender/runner-py.d.ts.map +1 -1
- package/dist/tools/blender/runner-py.js +3 -1
- package/dist/tools/blender/runner-py.js.map +1 -1
- package/dist/tools/connection-tools.js +1 -1
- package/dist/tools/connection-tools.js.map +1 -1
- package/dist/tools/tool-registry.d.ts.map +1 -1
- package/dist/tools/tool-registry.js +5 -3
- package/dist/tools/tool-registry.js.map +1 -1
- package/dist/tools/tool-request-words.d.ts.map +1 -1
- package/dist/tools/tool-request-words.js +20 -2
- package/dist/tools/tool-request-words.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Telling Ava that Unreal Editor is connected — the part of Code, Talk and Plan
|
|
3
|
+
* mode's prompt that names it (plan 2026-11-18-unreal, Phase 1).
|
|
4
|
+
*
|
|
5
|
+
* Why it exists: 18 Nov, his first live test. Unreal was connected, he asked
|
|
6
|
+
* "what level is open in Unreal?" with the Talk switch on, and Ava answered by
|
|
7
|
+
* searching the files of a DIFFERENT project (Dawn Sets, the folder open in
|
|
8
|
+
* VS Code), landing on a saved map. The editor had his test project open, on
|
|
9
|
+
* an untitled level that had never been saved — something no file can show.
|
|
10
|
+
* The tools were there; nothing told her they were the live editor, or that
|
|
11
|
+
* the editor's project wasn't the folder she could read.
|
|
12
|
+
*
|
|
13
|
+
* Read fresh each turn: the editor opening, closing or switching project shows
|
|
14
|
+
* up on the next message.
|
|
15
|
+
*/
|
|
16
|
+
import { readFileSync, readdirSync, statSync } from 'node:fs';
|
|
17
|
+
import { join } from 'node:path';
|
|
18
|
+
import { McpServers } from './manager.js';
|
|
19
|
+
const norm = (p) => p.replace(/\\/g, '/').replace(/\/+$/, '').toLowerCase();
|
|
20
|
+
/**
|
|
21
|
+
* The open editors' tools, for the mode's own list of what she can use (",
|
|
22
|
+
* mcp_unreal_list_toolsets, …"), or '' when no editor is open.
|
|
23
|
+
*
|
|
24
|
+
* Why: 18 Nov, the second live test. The Unreal tools were offered and the
|
|
25
|
+
* section below was in the prompt, but it came AFTER Talk's closed list of
|
|
26
|
+
* "What you can do" — and DeepSeek Flash followed the list, read the
|
|
27
|
+
* .uproject from disk and said the editor's tools "aren't wired into my tool
|
|
28
|
+
* set". A tool missing from the list a mode opens with reads as not there.
|
|
29
|
+
*/
|
|
30
|
+
export function unrealToolNames() {
|
|
31
|
+
let editors;
|
|
32
|
+
try {
|
|
33
|
+
editors = McpServers.current().unrealEditors();
|
|
34
|
+
}
|
|
35
|
+
catch {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
const names = editors.filter((e) => e.open).flatMap((e) => ['list_toolsets', 'describe_toolsets', 'describe_tools', 'call_tool'].map((t) => `${e.toolPrefix}${t}`));
|
|
39
|
+
return names.length ? `, ${names.join(', ')}` : '';
|
|
40
|
+
}
|
|
41
|
+
/** The section for one mode, or '' when no Unreal server is set up. */
|
|
42
|
+
export function unrealPromptSection(mode) {
|
|
43
|
+
let editors;
|
|
44
|
+
try {
|
|
45
|
+
editors = McpServers.current().unrealEditors();
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return '';
|
|
49
|
+
}
|
|
50
|
+
if (!editors.length)
|
|
51
|
+
return '';
|
|
52
|
+
const root = McpServers.current().projectFolder;
|
|
53
|
+
const lines = [];
|
|
54
|
+
for (const e of editors) {
|
|
55
|
+
if (!e.open) {
|
|
56
|
+
lines.push(`- Unreal Engine is set up in Connections ("${e.id}"), but the editor isn't open. If they ask about their Unreal project in the editor, say so: open the project in Unreal, then press Restart on Unreal's card in Connections. Don't answer from files as if it were the editor.`);
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const p = e.toolPrefix;
|
|
60
|
+
lines.push(`- **Unreal Engine ${e.engineVersion ?? ''} is open on this computer**${e.project ? `, with the project "${e.project}"` : ''}${e.projectDir ? ` (${e.projectDir})` : ''}. Its tools reach the LIVE editor: ${p}list_toolsets, ${p}describe_toolsets, ${p}describe_tools and ${p}call_tool.`);
|
|
61
|
+
lines.push(`- For anything about Unreal or what is in the editor — the open project and level, its actors, assets, how it looks, the log, what just happened — ask the editor FIRST: ${p}list_toolsets to see what it offers, then ${p}call_tool. Files come second. Never work it out from files: a level that was never saved, and every change since the last save, exist only in the editor.`);
|
|
62
|
+
if (e.projectDir && root && norm(e.projectDir) !== norm(root)) {
|
|
63
|
+
lines.push(`- The folder open here (${root}) is a different project from the one in the editor. Files you read are that folder's, not the editor's: say which project you mean, and ask if it's unclear which they do.`);
|
|
64
|
+
}
|
|
65
|
+
if (e.toolsetsOff) {
|
|
66
|
+
lines.push(`- Most of Unreal's tools are switched off in this project: tell them to turn on All Toolsets (Edit → Plugins in Unreal) and restart the editor.`);
|
|
67
|
+
}
|
|
68
|
+
lines.push(mode === 'build'
|
|
69
|
+
? `- Tools that only look run straight away; anything that changes the project or runs something asks them first, so say what you're about to do.`
|
|
70
|
+
: `- Here you may use its tools that only look. Anything that changes the project or runs something waits for ${mode === 'talk' ? 'the Build switch' : 'Code mode'}: describe it instead.`);
|
|
71
|
+
}
|
|
72
|
+
const open = editors.filter((e) => e.open);
|
|
73
|
+
const kimodo = open.some((e) => !!e.projectDir && projectUsesKimodo(e.projectDir));
|
|
74
|
+
return `\n## Unreal Editor\n${lines.join('\n')}\n${open.length ? UNREAL_KNOWLEDGE : ''}${kimodo ? KIMODO_KNOWLEDGE : ''}`;
|
|
75
|
+
}
|
|
76
|
+
const kimodoSeen = new Map();
|
|
77
|
+
/**
|
|
78
|
+
* Has the open project switched the Kimodo plugin on (its .uproject's
|
|
79
|
+
* Plugins)? The Kimodo guide is ~300 words, so it goes only to projects that
|
|
80
|
+
* use it. Cached by the .uproject's modified time, so it's read fresh each
|
|
81
|
+
* turn, cheaply. Unreadable → no.
|
|
82
|
+
*/
|
|
83
|
+
export function projectUsesKimodo(projectDir) {
|
|
84
|
+
try {
|
|
85
|
+
const file = readdirSync(projectDir).find((f) => f.toLowerCase().endsWith('.uproject'));
|
|
86
|
+
if (!file)
|
|
87
|
+
return false;
|
|
88
|
+
const path = join(projectDir, file);
|
|
89
|
+
const mtime = statSync(path).mtimeMs;
|
|
90
|
+
const seen = kimodoSeen.get(path);
|
|
91
|
+
if (seen && seen.mtime === mtime)
|
|
92
|
+
return seen.on;
|
|
93
|
+
const plugins = JSON.parse(readFileSync(path, 'utf8')).Plugins ?? [];
|
|
94
|
+
const on = plugins.some((p) => p.Name === 'Kimodo' && p.Enabled !== false);
|
|
95
|
+
kimodoSeen.set(path, { mtime, on });
|
|
96
|
+
return on;
|
|
97
|
+
}
|
|
98
|
+
catch {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* How work in Unreal goes — knowledge, not rules (plan 2026-11-18-unreal,
|
|
104
|
+
* Phase 3). Read from his live 5.9 editor on 19 Nov (114 toolsets, 1,919
|
|
105
|
+
* tools): Unreal's own Python read_me, GetProjectContext, the Agent Skills it
|
|
106
|
+
* ships, and the tools' own descriptions — so she leans on what THIS editor
|
|
107
|
+
* says, not on memory of older engines. Names are `Toolset.Tool` as call_tool
|
|
108
|
+
* takes them. Only sent while an editor is open.
|
|
109
|
+
*/
|
|
110
|
+
const UNREAL_KNOWLEDGE = `
|
|
111
|
+
### Working in Unreal
|
|
112
|
+
- **This editor tells you how it works.** AIAssistantEditor.AIAssistantToolset.GetProjectContext gives Unreal's conventions (100 units is 1 metre, folder paths end in /, screen coordinates run 0–1 from the top left); GetDockedContext shows what they have open. When a request is unclear, look at what they have selected (EditorToolset.EditorAppToolset.GetSelectedActors / GetSelectedAssets).
|
|
113
|
+
- **Epic ships Agent Skills** for this build — guides written for assistants: scene capture and diagnosing how things look, PCG, cloth, Dataflow, widgets and more. ToolsetRegistry.AgentSkillToolset.ListSkills, then GetSkills for the one that fits, before that kind of work. Creating or changing a skill is theirs to ask for.
|
|
114
|
+
- **Tool names and arguments change between preview builds.** Describe a toolset or tool (describe_toolsets / describe_tools) before calling one you haven't used in this chat, rather than writing a call from memory.
|
|
115
|
+
- **Python** (editor_toolset.toolsets.python_scripting.PythonScriptingTools): call read_me once per chat before execute_python. Look an API up with search_symbols / get_symbol before calling it — an API they don't find doesn't exist in this editor — and prefer a registered tool over Python. A script returns its last expression; print goes to the Output Log under LogPython (read it with ConsoleToolset.LogsToolset.GetLogEntries). Keep each script short. RunConsoleCommand refuses Python. A class Python doesn't list (some plugins' classes) can still be read and changed through EditorToolset.ObjectToolset — ListProperties, GetProperties, SetProperties work on any object by its path — so "not in the Python API" doesn't mean out of reach.
|
|
116
|
+
- **Bringing files in** (a model from Blender, a texture): there is no import tool — import with Python (AssetTools.import_asset_tasks with an AssetImportTask; Interchange reads .glb and .fbx), looking it up with get_symbol first. From the Design Studio's Blender room (~/.ava/creative/blender/<model>/): **props come in as the .glb** — on this editor it imports cleaner than the .fbx (packed metallic-roughness, its own Materials / Textures folders, no warnings); **rigged or animated models (characters) as the .fbx**, Unreal's long-standing route for skeletons and animation. An import saves the new assets; placing them in the level doesn't save the level.
|
|
117
|
+
- **C++**: you write it with your own file tools in the project's Source folder. Compile with LiveCodingToolset (IsLiveCodingReady, EnableLiveCoding if it's off, then CompileLiveCoding). Live Coding is for changing function bodies; new classes and new or changed reflected members (UPROPERTY, UFUNCTION, USTRUCT) need the editor closed and a full build — say so rather than forcing it.
|
|
118
|
+
- **See your work, don't assume it.** Make the change → compile if it was code → StartPIE (it times out after 30 seconds) → look → read the log for errors and warnings (GetLogEntries) → StopPIE → fix. Looking: SceneCaptureToolset.CaptureGameViewport shows play as the player sees it, game UI included; CaptureActiveEditorView renders the 3D scene from the editor camera, offscreen, without the editor's UI; EditorToolset.EditorAppToolset.CaptureEditorImage shows the whole editor window as they see it. You see the image; they don't. For lighting and material problems, the scene-capture skill explains the diagnostic modes.
|
|
119
|
+
- **Nothing is saved until it's saved.** A new level lives in /Temp until they save it; edits to an asset are unsaved until AssetToolset.SaveAsset. Say what's unsaved; every editor change is also in Undo history (Ctrl+Z).
|
|
120
|
+
- One Unreal call runs at a time, and compiling or starting play can take a while: tell them what you're waiting on.
|
|
121
|
+
- **When a plugin gives the editor a button, menu or dialog for a job, that is the way it's meant to be done** — tell them which to press rather than rebuilding the job by hand from lower-level tools.
|
|
122
|
+
- **Stop and report rather than hunting.** When two different approaches to the same step have failed, stop: tell them what you tried, what you found, and what you'd suggest — then wait. Long hunts through tools and engine source drift, and they are worse than a clear "here's where I'm stuck".
|
|
123
|
+
`;
|
|
124
|
+
/**
|
|
125
|
+
* Kimodo — Epic's text-to-animation plugin (with AnimGenOffline) in 5.9.
|
|
126
|
+
* REWRITTEN 19 Nov from Epic's own sources, replacing a version I had patched
|
|
127
|
+
* together guess by guess (his words: "papering over cracks"): the setup from
|
|
128
|
+
* KimodoSettings.h / kimodo_generate.py; the way to MAKE animations from
|
|
129
|
+
* Epic's Add Character flow and its automated tests (KimodoAddCharacterTest,
|
|
130
|
+
* KimodoRetargetPoseTest, the AnimGenOffline toolbar menu). What it replaced:
|
|
131
|
+
* Ava building characters by hand (bare mesh + section, no spline/rig),
|
|
132
|
+
* "the shoulders aren't retargeted" (Epic tests SOMA→Manny shoulders to within
|
|
133
|
+
* 2°), retargeter-building advice, and a debug view that can't show text-only
|
|
134
|
+
* generations. His call (16 Nov): Ava GUIDES setup, he does each step; the
|
|
135
|
+
* token never goes through chat. Sent only when the project has Kimodo on.
|
|
136
|
+
*/
|
|
137
|
+
const KIMODO_KNOWLEDGE = `
|
|
138
|
+
### Animation with Kimodo (this project has it on)
|
|
139
|
+
Kimodo turns a description into character animation, on their own computer, through Epic's AnimGenOffline plugin.
|
|
140
|
+
|
|
141
|
+
**Setting it up (once — theirs to do; guide a step at a time, let them say when each is done)**
|
|
142
|
+
1. A Hugging Face account (huggingface.co).
|
|
143
|
+
2. Llama 3 access FIRST — signed in, request it at huggingface.co/meta-llama/Meta-Llama-3-8B-Instruct. Meta approves it by hand, which can take a while. There is no separate "Llama key": it's a permission on their account.
|
|
144
|
+
3. A read token: huggingface.co/settings/tokens → a token of type Read.
|
|
145
|
+
4. In Unreal: Edit → Editor Preferences, type "Hugging Face" in the search box (searching "Kimodo" hides the field) → Plugins → Kimodo → Authentication → Hugging Face Token. It saves on its own. The token goes there and nowhere else — never into this chat; if one is pasted here, say it has been sent to their AI provider and they should delete it on Hugging Face and make a new one.
|
|
146
|
+
- An empty field can still work (Kimodo also reads HF_TOKEN or a token saved by "hf auth login"): if generating works, nothing needs adding.
|
|
147
|
+
- Performance (same page; explain, change only when asked): Model Placement GPU (CUDA), CPU fallback takes minutes; Text Encoder Precision 4 bit (~6 GB, default) or Full (~16 GB); Text Encoder Placement CPU by default; Unload Model When Idle after 15 minutes. The first Generate downloads the models, once.
|
|
148
|
+
- "No Hugging Face token is configured" (-100) → steps 3–4. "Your Hugging Face token does not have access to the gated text encoder repo" (-101) → wrong or expired token, or that account's Llama 3 request isn't approved yet.
|
|
149
|
+
- **Kimodo's Python packages** (read from the plugin and checked on a working install, 19 Nov). The editor installs them at startup into the project's Intermediate/PipInstall from Epic's pinned list, Intermediate/PipInstall/merged_requirements.txt (torch 2.5.1+cu124, torchaudio 2.5.1+cu124, torchvision 0.20.1+cu124 from https://download.pytorch.org/whl/cu124/, numpy 1.26.4, scipy 1.11.4, transformers 5.1.0, peft 0.18.1, accelerate 1.13.0, huggingface-hub 1.6.0 …), hash-checked. In this preview that fails two ways: an unpinned colorama (from click) makes pip refuse the whole set ("In --require-hashes mode…" in the log; the worker then can't import numpy or torch), and **omegaconf**, which Kimodo's model loading imports, isn't on the list at all. The fix, run with that project's own Python (Intermediate/PipInstall/Scripts/python.exe -m pip …): install the same pinned list without the hashes (the same versions — never a different torch/CUDA build, numpy 2 or newer transformers, which Epic's code isn't pinned to), using that extra index, then omegaconf==2.3.0, then pip check, which must say "No broken requirements found". hydra-core isn't needed (the plugin replaces it). Several GB: explain and ask before installing.
|
|
150
|
+
|
|
151
|
+
**Making animations — Epic's way; don't improvise around it**
|
|
152
|
+
Everything lives in Sequencer's toolbar: the **AnimGenOffline** dropdown (Add Character, Generate Anims, Export Anims, Batch Import, Create Level Sequence, Delete Selected) and a **Generate** button. These are editor buttons, not tools you can call: tell them which to press, then do what you can around it.
|
|
153
|
+
- **A character comes from AnimGenOffline → Add Character**, with a Level Sequence open (Create Level Sequence in the same menu makes one). The dialog chooses the pose generator (Kimodo), the character from its grid — plugin defaults (Kimodo's SOMA, and the mannequins AnimGenOffline ships under /AnimGenOffline/Characters: UE5 Manny and Quinn, UEFN, UE4 Mannequin) and their saved favourites — and Features (Spline, Transform Track, Control Rig). Retargeting Setup left empty is "Generated automatically" — leave it so. Never assemble a character by hand (placing a mesh and adding a section misses the spline, transform track and rig the dialog sets up). Epic tests Kimodo's retargeting onto its shipped mannequins, so use those.
|
|
154
|
+
- **Describing the movement** on the section Add Character made — this part you can do:
|
|
155
|
+
- Keyed: SequencerScripting.MovieSceneSectionExtensions.AddStringKey on the section's "AnimDescriptionChannel" at a frame; keys at different frames change the movement over time.
|
|
156
|
+
- Or one description for the whole section: EditorToolset.ObjectToolset.SetProperties on the section's PoseGenerator (GetProperties on the section gives its path), AnimDescriptionOverride. With both empty Kimodo makes "Neutral Locomotion".
|
|
157
|
+
- The same PoseGenerator holds NumVariations (1–8), RandomSeed (same seed and settings repeat a result), QualityLevel, and MovementSource: "Sequencer" (the default) follows the character's own movement — the spline Add Character made; "GeneratedAnimation" lets Kimodo move the character itself. Python's API list doesn't include Kimodo's class; ObjectToolset reaches it.
|
|
158
|
+
- **Generating**: they press Generate (toolbar) or AnimGenOffline → Generate Anims. It also runs when the sequence evaluates after a change; the log shows "[Kimodo] Sampling … frames".
|
|
159
|
+
- **Keeping it**: AnimGenOffline → Export Anims.
|
|
160
|
+
- **Known in this 5.9 preview** (found by him, 19 Nov, in a fresh Third Person template): on SOMA the motion is right, but Kimodo's automatic retarget onto Epic's UE5 Manny and Quinn leaves the upper body leaning back, shoulders about 12 cm behind the hips. It's the retarget, not the motion or their setup — tell them so straight away rather than investigating. Options: generate on SOMA when posture matters; a Forward Retargeter (Add Character's Retargeting Setup) with the spine corrected, if they ask for one; and it's worth reporting to Epic.
|
|
161
|
+
- **If a result looks wrong** (posture, feet, drifting): capture it, say plainly what you see, and check what you set (description, MovementSource, the character chosen). Don't build retargeters, rigs or work-arounds to compensate unless they ask — the setup Epic built and tests is the baseline, and a fault that remains with it is a preview issue worth reporting to Epic. Say which it looks like and let them decide.
|
|
162
|
+
`;
|
|
163
|
+
//# sourceMappingURL=unreal-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreal-context.js","sourceRoot":"","sources":["../../src/mcp/unreal-context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,IAAI,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAEpF;;;;;;;;;GASG;AACH,MAAM,UAAU,eAAe;IAC7B,IAAI,OAAgD,CAAC;IACrD,IAAI,CAAC;QACH,OAAO,GAAG,UAAU,CAAC,OAAO,EAAE,CAAC,aAAa,EAAE,CAAC;IACjD,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAA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;;;;;;;;;;CAyBxB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Putting Ava where Unreal's Assistant panel can start her (plan
|
|
3
|
+
* 2026-11-18-unreal, Phase 2 step 2): ~/.ava/bin/Ava.exe and its program.
|
|
4
|
+
*
|
|
5
|
+
* ~/.ava/bin/Ava.exe Node's own runtime, renamed — the
|
|
6
|
+
* panel shows the program's file name
|
|
7
|
+
* (his decision 5: "Ava.exe"). Renaming
|
|
8
|
+
* keeps Node's signature (checked on his
|
|
9
|
+
* machine 18 Nov: Valid, OpenJS Foundation).
|
|
10
|
+
* ~/.ava/bin/ava-unreal/ava-unreal.mjs Ava (packages/cli/src/acp), one file
|
|
11
|
+
* ~/.ava/bin/ava-unreal/native/ the keychain build for this machine
|
|
12
|
+
* ~/.ava/bin/ava-unreal/data, fonts/ for PDFs (pdfkit, AVA_FONTS_DIR)
|
|
13
|
+
*
|
|
14
|
+
* In ~/.ava so it follows him between apps: set up from the extension or the
|
|
15
|
+
* IDE, it's the same Ava.exe. Each app says where its copy of the program is
|
|
16
|
+
* (setUnrealProgramSource); the IDE gives its own Node, the extension
|
|
17
|
+
* downloads Node's official zip from nodejs.org (his decision 6), checked
|
|
18
|
+
* against the SHA-256 below before anything is used.
|
|
19
|
+
*/
|
|
20
|
+
/** The Node the IDE ships (ide/scripts/bundle-sidecar.mjs) and the extension downloads. */
|
|
21
|
+
export declare const UNREAL_NODE_VERSION = "24.22.1";
|
|
22
|
+
export interface UnrealProgramSource {
|
|
23
|
+
/** The app's folder holding ava-unreal.mjs and native/. */
|
|
24
|
+
programDir: string;
|
|
25
|
+
/** pdfkit's data folder and the PDF fonts, as the app ships them. */
|
|
26
|
+
dataDir?: string;
|
|
27
|
+
fontsDir?: string;
|
|
28
|
+
/** A Node runtime (UNREAL_NODE_VERSION) to copy as Ava.exe — the IDE's own; the extension downloads one. */
|
|
29
|
+
node: () => Promise<string>;
|
|
30
|
+
/** Setting up downloads Node (the extension): the page says so first. */
|
|
31
|
+
downloadsNode?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/** Each app, at start: where its copy of the program is. */
|
|
34
|
+
export declare function setUnrealProgramSource(s: UnrealProgramSource): void;
|
|
35
|
+
export declare const unrealBinDir: (home?: string) => string;
|
|
36
|
+
export declare function unrealProgramPaths(home?: string): {
|
|
37
|
+
command: string;
|
|
38
|
+
program: string;
|
|
39
|
+
dir: string;
|
|
40
|
+
};
|
|
41
|
+
export interface UnrealProgramState {
|
|
42
|
+
/** Ava in Unreal's panel runs on Windows for now (Ava.exe). */
|
|
43
|
+
supported: boolean;
|
|
44
|
+
/** This app can set it up (it has the program to copy). */
|
|
45
|
+
canInstall: boolean;
|
|
46
|
+
installed: boolean;
|
|
47
|
+
/** Installed, and the same as this app's copy. */
|
|
48
|
+
current: boolean;
|
|
49
|
+
/** Setting it up (or updating) will download Node from nodejs.org (36 MB). */
|
|
50
|
+
downloadsNode: boolean;
|
|
51
|
+
/** What to paste into Unreal: Custom Agent Command, and its one argument. */
|
|
52
|
+
command: string;
|
|
53
|
+
args: string[];
|
|
54
|
+
}
|
|
55
|
+
export declare function unrealProgramState(home?: string): Promise<UnrealProgramState>;
|
|
56
|
+
/**
|
|
57
|
+
* Put Ava.exe and her program in ~/.ava/bin (or bring them up to date).
|
|
58
|
+
* Throws with words for him: Unreal holding Ava.exe open, a failed download.
|
|
59
|
+
*/
|
|
60
|
+
export declare function installUnrealProgram(home?: string): Promise<UnrealProgramState>;
|
|
61
|
+
/**
|
|
62
|
+
* Node's official Windows zip from nodejs.org, checked against the pinned
|
|
63
|
+
* SHA-256, unpacked with Windows' own tar (it reads zip). Returns node.exe's
|
|
64
|
+
* path in a temp folder. For the extension, which ships no Node of its own.
|
|
65
|
+
*/
|
|
66
|
+
export declare function downloadNodeRuntime(): Promise<string>;
|
|
67
|
+
//# sourceMappingURL=unreal-install.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreal-install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IG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,MAAM,CAAC,CAyB3D"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Putting Ava where Unreal's Assistant panel can start her (plan
|
|
3
|
+
* 2026-11-18-unreal, Phase 2 step 2): ~/.ava/bin/Ava.exe and its program.
|
|
4
|
+
*
|
|
5
|
+
* ~/.ava/bin/Ava.exe Node's own runtime, renamed — the
|
|
6
|
+
* panel shows the program's file name
|
|
7
|
+
* (his decision 5: "Ava.exe"). Renaming
|
|
8
|
+
* keeps Node's signature (checked on his
|
|
9
|
+
* machine 18 Nov: Valid, OpenJS Foundation).
|
|
10
|
+
* ~/.ava/bin/ava-unreal/ava-unreal.mjs Ava (packages/cli/src/acp), one file
|
|
11
|
+
* ~/.ava/bin/ava-unreal/native/ the keychain build for this machine
|
|
12
|
+
* ~/.ava/bin/ava-unreal/data, fonts/ for PDFs (pdfkit, AVA_FONTS_DIR)
|
|
13
|
+
*
|
|
14
|
+
* In ~/.ava so it follows him between apps: set up from the extension or the
|
|
15
|
+
* IDE, it's the same Ava.exe. Each app says where its copy of the program is
|
|
16
|
+
* (setUnrealProgramSource); the IDE gives its own Node, the extension
|
|
17
|
+
* downloads Node's official zip from nodejs.org (his decision 6), checked
|
|
18
|
+
* against the SHA-256 below before anything is used.
|
|
19
|
+
*/
|
|
20
|
+
import { createHash } from 'node:crypto';
|
|
21
|
+
import { execFile } from 'node:child_process';
|
|
22
|
+
import { copyFile, mkdir, readFile, readdir, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
23
|
+
import { existsSync } from 'node:fs';
|
|
24
|
+
import { tmpdir } from 'node:os';
|
|
25
|
+
import { dirname, join } from 'node:path';
|
|
26
|
+
import { promisify } from 'node:util';
|
|
27
|
+
import { AVA_HOME } from '../core/constants.js';
|
|
28
|
+
const run = promisify(execFile);
|
|
29
|
+
/** The Node the IDE ships (ide/scripts/bundle-sidecar.mjs) and the extension downloads. */
|
|
30
|
+
export const UNREAL_NODE_VERSION = '24.22.1';
|
|
31
|
+
/** nodejs.org/dist/v24.22.1/SHASUMS256.txt, 18 Nov 2026. */
|
|
32
|
+
const NODE_ZIPS = {
|
|
33
|
+
x64: { file: `node-v${UNREAL_NODE_VERSION}-win-x64`, sha256: 'd2046d28c2c3dcd211ac5145c0bf30e2047ef9dfb306693c8c6e2eccd8b95fa5' },
|
|
34
|
+
arm64: { file: `node-v${UNREAL_NODE_VERSION}-win-arm64`, sha256: 'a0c807319fede24c4a0d8f84564c82a619bd313b16b10c007c383c2609e99171' },
|
|
35
|
+
};
|
|
36
|
+
let source = null;
|
|
37
|
+
/** Each app, at start: where its copy of the program is. */
|
|
38
|
+
export function setUnrealProgramSource(s) {
|
|
39
|
+
source = s;
|
|
40
|
+
}
|
|
41
|
+
export const unrealBinDir = (home = AVA_HOME) => join(home, 'bin');
|
|
42
|
+
export function unrealProgramPaths(home = AVA_HOME) {
|
|
43
|
+
const bin = unrealBinDir(home);
|
|
44
|
+
const dir = join(bin, 'ava-unreal');
|
|
45
|
+
return { command: join(bin, 'Ava.exe'), program: join(dir, 'ava-unreal.mjs'), dir };
|
|
46
|
+
}
|
|
47
|
+
const sha = async (file) => createHash('sha256').update(await readFile(file)).digest('hex');
|
|
48
|
+
async function readStamp(dir) {
|
|
49
|
+
try {
|
|
50
|
+
return JSON.parse(await readFile(join(dir, 'version.json'), 'utf8'));
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return null;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export async function unrealProgramState(home = AVA_HOME) {
|
|
57
|
+
const p = unrealProgramPaths(home);
|
|
58
|
+
const installed = existsSync(p.command) && existsSync(p.program);
|
|
59
|
+
let current = false;
|
|
60
|
+
if (installed && source) {
|
|
61
|
+
const stamp = await readStamp(p.dir);
|
|
62
|
+
const mine = await sha(join(source.programDir, 'ava-unreal.mjs')).catch(() => '');
|
|
63
|
+
current = !!stamp && stamp.program === mine && stamp.node === UNREAL_NODE_VERSION;
|
|
64
|
+
}
|
|
65
|
+
return {
|
|
66
|
+
supported: process.platform === 'win32',
|
|
67
|
+
canInstall: !!source && existsSync(join(source.programDir, 'ava-unreal.mjs')),
|
|
68
|
+
downloadsNode: !!source?.downloadsNode && (!existsSync(p.command) || await nodeVersionOf(p.command) !== UNREAL_NODE_VERSION),
|
|
69
|
+
installed,
|
|
70
|
+
current,
|
|
71
|
+
command: p.command,
|
|
72
|
+
args: [p.program],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
async function nodeVersionOf(exe) {
|
|
76
|
+
try {
|
|
77
|
+
return (await run(exe, ['--version'], { timeout: 15_000 })).stdout.trim().replace(/^v/, '');
|
|
78
|
+
}
|
|
79
|
+
catch {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function copyDir(from, to, only) {
|
|
84
|
+
await mkdir(to, { recursive: true });
|
|
85
|
+
for (const name of await readdir(from)) {
|
|
86
|
+
if (only && !only(name))
|
|
87
|
+
continue;
|
|
88
|
+
const a = join(from, name);
|
|
89
|
+
const b = join(to, name);
|
|
90
|
+
const s = await stat(a);
|
|
91
|
+
if (s.isDirectory()) {
|
|
92
|
+
await copyDir(a, b);
|
|
93
|
+
continue;
|
|
94
|
+
}
|
|
95
|
+
const there = await stat(b).catch(() => null);
|
|
96
|
+
if (there && there.size === s.size)
|
|
97
|
+
continue; // fonts don't change in place; the program is checked by hash
|
|
98
|
+
await copyFile(a, b);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Put Ava.exe and her program in ~/.ava/bin (or bring them up to date).
|
|
103
|
+
* Throws with words for him: Unreal holding Ava.exe open, a failed download.
|
|
104
|
+
*/
|
|
105
|
+
export async function installUnrealProgram(home = AVA_HOME) {
|
|
106
|
+
if (process.platform !== 'win32')
|
|
107
|
+
throw new Error('Ava in Unreal\'s panel runs on Windows for now.');
|
|
108
|
+
if (!source)
|
|
109
|
+
throw new Error('This app can\'t set up Ava for Unreal.');
|
|
110
|
+
const src = source;
|
|
111
|
+
const p = unrealProgramPaths(home);
|
|
112
|
+
await mkdir(p.dir, { recursive: true });
|
|
113
|
+
// Ava.exe — Node, unchanged but for its name.
|
|
114
|
+
if (await nodeVersionOf(p.command) !== UNREAL_NODE_VERSION) {
|
|
115
|
+
const node = await src.node();
|
|
116
|
+
const v = await nodeVersionOf(node);
|
|
117
|
+
if (v !== UNREAL_NODE_VERSION)
|
|
118
|
+
throw new Error(`The Node runtime found is ${v ?? 'unreadable'}, not ${UNREAL_NODE_VERSION}.`);
|
|
119
|
+
const temp = `${p.command}.new`;
|
|
120
|
+
await copyFile(node, temp);
|
|
121
|
+
// A download's temp folder (downloadNodeRuntime) goes once it's copied.
|
|
122
|
+
// (<temp>/ava-node-<time>/<zip folder>/node.exe)
|
|
123
|
+
if (/[\\/]ava-node-\d+[\\/]/.test(node))
|
|
124
|
+
await rm(dirname(dirname(node)), { recursive: true, force: true }).catch(() => { });
|
|
125
|
+
try {
|
|
126
|
+
await rename(temp, p.command);
|
|
127
|
+
}
|
|
128
|
+
catch (e) {
|
|
129
|
+
await rm(temp, { force: true });
|
|
130
|
+
if (e.code === 'EBUSY' || e.code === 'EPERM') {
|
|
131
|
+
throw new Error('Unreal is using Ava right now. Close Ava\'s chats in the Assistant panel (or Unreal), then try again.');
|
|
132
|
+
}
|
|
133
|
+
throw e;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
// Her program, this machine's keychain build, and the PDF files.
|
|
137
|
+
await copyFile(join(src.programDir, 'ava-unreal.mjs'), p.program);
|
|
138
|
+
const target = `win32-${process.arch}-msvc`;
|
|
139
|
+
await copyDir(join(src.programDir, 'native'), join(p.dir, 'native'), (n) => n === `keyring.${target}.node` || n.startsWith('LICENSE'));
|
|
140
|
+
if (src.dataDir && existsSync(src.dataDir))
|
|
141
|
+
await copyDir(src.dataDir, join(p.dir, 'data'));
|
|
142
|
+
if (src.fontsDir && existsSync(src.fontsDir))
|
|
143
|
+
await copyDir(src.fontsDir, join(p.dir, 'fonts'));
|
|
144
|
+
await writeFile(join(p.dir, 'version.json'), JSON.stringify({ program: await sha(p.program), node: UNREAL_NODE_VERSION }));
|
|
145
|
+
return unrealProgramState(home);
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Node's official Windows zip from nodejs.org, checked against the pinned
|
|
149
|
+
* SHA-256, unpacked with Windows' own tar (it reads zip). Returns node.exe's
|
|
150
|
+
* path in a temp folder. For the extension, which ships no Node of its own.
|
|
151
|
+
*/
|
|
152
|
+
export async function downloadNodeRuntime() {
|
|
153
|
+
const z = NODE_ZIPS[process.arch];
|
|
154
|
+
if (process.platform !== 'win32' || !z)
|
|
155
|
+
throw new Error('Ava in Unreal\'s panel runs on Windows (x64 or Arm) for now.');
|
|
156
|
+
const url = `https://nodejs.org/dist/v${UNREAL_NODE_VERSION}/${z.file}.zip`;
|
|
157
|
+
const res = await fetch(url);
|
|
158
|
+
if (!res.ok)
|
|
159
|
+
throw new Error(`Couldn't download Node from nodejs.org (${res.status}).`);
|
|
160
|
+
const body = Buffer.from(await res.arrayBuffer());
|
|
161
|
+
const got = createHash('sha256').update(body).digest('hex');
|
|
162
|
+
if (got !== z.sha256)
|
|
163
|
+
throw new Error('The Node download didn\'t match its published checksum, so it wasn\'t used.');
|
|
164
|
+
const work = join(tmpdir(), `ava-node-${Date.now()}`);
|
|
165
|
+
await mkdir(work, { recursive: true });
|
|
166
|
+
const zip = join(work, `${z.file}.zip`);
|
|
167
|
+
await writeFile(zip, body);
|
|
168
|
+
// Windows' own tar (System32, bsdtar) reads zip; a `tar` found first on PATH
|
|
169
|
+
// may be Git's GNU tar, which doesn't (seen 18 Nov). Relative paths and cwd:
|
|
170
|
+
// a drive letter reads as a remote host to some tars.
|
|
171
|
+
const tar = join(process.env.SystemRoot ?? 'C:\\Windows', 'System32', 'tar.exe');
|
|
172
|
+
try {
|
|
173
|
+
await run(tar, ['-xf', `${z.file}.zip`, `${z.file}/node.exe`], { cwd: work, timeout: 120_000 });
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
await rm(work, { recursive: true, force: true }).catch(() => { });
|
|
177
|
+
throw new Error('Node downloaded, but Windows couldn\'t unpack it.');
|
|
178
|
+
}
|
|
179
|
+
await rm(zip, { force: true }).catch(() => { });
|
|
180
|
+
return join(work, z.file, 'node.exe');
|
|
181
|
+
}
|
|
182
|
+
//# sourceMappingURL=unreal-install.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreal-install.js","sourceRoot":"","sources":["../../src/mcp/unreal-install.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAEhD,MAAM,GAAG,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC;AAEhC,2FAA2F;AAC3F,MAAM,CAAC,MAAM,mBAAmB,GAAG,SAAS,CAAC;AAE7C,4DAA4D;AAC5D,MAAM,SAAS,GAAqD;IAClE,GAAG,EAAE,EAAE,IAAI,EAAE,SAAS,mBAAmB,UAAU,EAAE,MAAM,EAAE,kEAAkE,EAAE;IACjI,KAAK,EAAE,EAAE,IAAI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,EAAE,GAAG,CAAC,CAAC,IAAI,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,WAAW,CAAC,EAAE,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,CAAC,CAAC;IAClG,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACjE,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,EAAE,CAAC,GAAG,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC/C,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ava in Unreal Editor's Assistant panel (plan 2026-11-18-unreal, Phase 2):
|
|
3
|
+
* the parts of the panel program (packages/cli/src/acp) that belong in core —
|
|
4
|
+
* making sure Unreal is in his Connections, and telling Ava where she is.
|
|
5
|
+
*
|
|
6
|
+
* What the panel is, from Phase 0 (his editor, 18 Nov): Unreal starts the
|
|
7
|
+
* program, speaks ACP to it, and hands it the editor's own MCP server in
|
|
8
|
+
* session/new. It shows Markdown and tool calls, and a permission prompt with
|
|
9
|
+
* only Deny / Allow Once. It does NOT show plans, images or any card.
|
|
10
|
+
*/
|
|
11
|
+
import { type McpServerStatus } from './manager.js';
|
|
12
|
+
export interface UnrealServerInPanel {
|
|
13
|
+
/** His server's id in ~/.ava/mcp.json. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** Ava added it just now (it wasn't in his Connections). */
|
|
16
|
+
added: boolean;
|
|
17
|
+
/** He has it switched off in Connections. */
|
|
18
|
+
off: boolean;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Unreal's server, as Unreal handed it over, in his Connections.
|
|
22
|
+
*
|
|
23
|
+
* His decision 4 (18 Nov, "agreed with you"): when it isn't there, Ava adds
|
|
24
|
+
* it — the same entry as Suggested → Add — because the panel's prompt has no
|
|
25
|
+
* "always" button, so "always allow" lives on the Connections page, and the
|
|
26
|
+
* IDE and VS Code reach the editor too. One he has switched off stays off.
|
|
27
|
+
*/
|
|
28
|
+
export declare function ensureUnrealServer(url: string): Promise<UnrealServerInPanel>;
|
|
29
|
+
/** Wait for his Unreal server to finish connecting, and say where it got to. */
|
|
30
|
+
export declare function settleUnrealServer(id: string, ms?: number): Promise<McpServerStatus | undefined>;
|
|
31
|
+
/**
|
|
32
|
+
* The part of her system prompt that says she is in Unreal's panel. `fromUnreal`
|
|
33
|
+
* is the text Unreal adds to a chat's first message (how to link assets, to
|
|
34
|
+
* use its tools, to switch on All Toolsets) — kept for the whole chat, as
|
|
35
|
+
* later messages don't repeat it.
|
|
36
|
+
*/
|
|
37
|
+
export declare function unrealPanelPrompt(fromUnreal?: string): string;
|
|
38
|
+
//# sourceMappingURL=unreal-panel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreal-panel.d.ts","sourceRoot":"","sources":["../../src/mcp/unreal-panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,cAAc,CAAC;AAQhE,MAAM,WAAW,mBAAmB;IAClC,0CAA0C;IAC1C,EAAE,EAAE,MAAM,CAAC;IACX,4DAA4D;IAC5D,KAAK,EAAE,OAAO,CAAC;IACf,6CAA6C;IAC7C,GAAG,EAAE,OAAO,CAAC;CACd;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAUlF;AAED,gFAAgF;AAChF,wBAAsB,kBAAkB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAEtG;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAW7D"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ava in Unreal Editor's Assistant panel (plan 2026-11-18-unreal, Phase 2):
|
|
3
|
+
* the parts of the panel program (packages/cli/src/acp) that belong in core —
|
|
4
|
+
* making sure Unreal is in his Connections, and telling Ava where she is.
|
|
5
|
+
*
|
|
6
|
+
* What the panel is, from Phase 0 (his editor, 18 Nov): Unreal starts the
|
|
7
|
+
* program, speaks ACP to it, and hands it the editor's own MCP server in
|
|
8
|
+
* session/new. It shows Markdown and tool calls, and a permission prompt with
|
|
9
|
+
* only Deny / Allow Once. It does NOT show plans, images or any card.
|
|
10
|
+
*/
|
|
11
|
+
import { McpServers } from './manager.js';
|
|
12
|
+
import { readMcpFile } from './servers-config.js';
|
|
13
|
+
import { addMcpServers, settleMcpServers } from './setup.js';
|
|
14
|
+
import { MCP_SUGGESTIONS } from './suggested.js';
|
|
15
|
+
const sameUrl = (a, b) => !!a && a.trim().replace(/\/+$/, '').toLowerCase() === b.trim().replace(/\/+$/, '').toLowerCase();
|
|
16
|
+
/**
|
|
17
|
+
* Unreal's server, as Unreal handed it over, in his Connections.
|
|
18
|
+
*
|
|
19
|
+
* His decision 4 (18 Nov, "agreed with you"): when it isn't there, Ava adds
|
|
20
|
+
* it — the same entry as Suggested → Add — because the panel's prompt has no
|
|
21
|
+
* "always" button, so "always allow" lives on the Connections page, and the
|
|
22
|
+
* IDE and VS Code reach the editor too. One he has switched off stays off.
|
|
23
|
+
*/
|
|
24
|
+
export async function ensureUnrealServer(url) {
|
|
25
|
+
const { file } = await readMcpFile();
|
|
26
|
+
for (const [id, e] of Object.entries(file.mcpServers)) {
|
|
27
|
+
if (sameUrl(e.url, url))
|
|
28
|
+
return { id, added: false, off: e.enabled === false };
|
|
29
|
+
}
|
|
30
|
+
let id = 'unreal';
|
|
31
|
+
for (let n = 2; file.mcpServers[id]; n++)
|
|
32
|
+
id = `unreal-${n}`;
|
|
33
|
+
const view = MCP_SUGGESTIONS.find((s) => s.id === 'unreal')?.view;
|
|
34
|
+
await addMcpServers([{ id, entry: { type: 'http', url, ...(view ? { ava: { view, at: new Date().toISOString() } } : {}) } }]);
|
|
35
|
+
return { id, added: true, off: false };
|
|
36
|
+
}
|
|
37
|
+
/** Wait for his Unreal server to finish connecting, and say where it got to. */
|
|
38
|
+
export async function settleUnrealServer(id, ms = 30_000) {
|
|
39
|
+
return (await settleMcpServers([id], ms))[0] ?? McpServers.current().status().find((s) => s.scope === 'user' && s.id === id);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* The part of her system prompt that says she is in Unreal's panel. `fromUnreal`
|
|
43
|
+
* is the text Unreal adds to a chat's first message (how to link assets, to
|
|
44
|
+
* use its tools, to switch on All Toolsets) — kept for the whole chat, as
|
|
45
|
+
* later messages don't repeat it.
|
|
46
|
+
*/
|
|
47
|
+
export function unrealPanelPrompt(fromUnreal) {
|
|
48
|
+
const notes = fromUnreal?.trim();
|
|
49
|
+
return `
|
|
50
|
+
## Where you are: inside Unreal Editor
|
|
51
|
+
You are in Unreal Editor's Assistant panel, beside their project — the same Ava, with the same memory, as in VS Code and the Ava IDE.
|
|
52
|
+
- The panel shows text: Markdown and your tool calls. It shows no cards, no pictures and no plan view. Write a plan as a short numbered list. Screenshots you take you can see, but they can't: link the saved file instead.
|
|
53
|
+
- There are no question cards here. When you need their answer, ask it in your reply and stop.
|
|
54
|
+
- Before a change in the editor, the panel asks them: Allow once, Allow for this session (that tool — for Unreal, that one Unreal tool — stops asking until this chat ends), or Deny. It has no "always" button. Each Unreal tool they allow is listed under "Asked recently in Unreal" on the Unreal card in Connections (VS Code or the Ava IDE), where "Always allow" stops it asking. Never tell them you can grant that yourself.
|
|
55
|
+
- Their mode menu here has Code, Code · Talk and Plan. "The Build switch" means choosing Code in that menu.
|
|
56
|
+
- The Brainstorm, Learning, Health and Creative Studio rooms and the dashboard are in VS Code and the Ava IDE, not here: say so if they ask for one.
|
|
57
|
+
${notes ? `\n### Unreal's own notes for assistants in this panel\n${notes}\n` : ''}`;
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=unreal-panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unreal-panel.js","sourceRoot":"","sources":["../../src/mcp/unreal-panel.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,UAAU,EAAwB,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,MAAM,OAAO,GAAG,CAAC,CAAqB,EAAE,CAAS,EAAE,EAAE,CACnD,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;AAWnG;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAC,GAAW;IAClD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,WAAW,EAAE,CAAC;IACrC,KAAK,MAAM,CAAC,EAAE,EAAE,CAAC,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QACtD,IAAI,OAAO,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC;YAAE,OAAO,EAAE,EAAE,EAAE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