The agent got stuck where the editor has it easy: it could not make a
Sample play without a sound asset, it built instruments node by node
although the Preset menu has them ready, and it could not tell what
names an asset before reworking or deleting it.
- list_files is a new tool. It lists the pictures, fonts, sounds or
videos the server holds, with size, video state and the asset that
already wears a file. Bakes and stream copies of songs are left out.
- add_file_asset makes an asset of such a file, as the picker does.
It reuses the create rules of the import pipeline, so the four
import kinds are exported now. It refuses a file already in the
project (naming that asset), a picture without a size, a video not
yet converted and a file the server does not hold.
- run_commands fetches the file lists its steps need before it runs,
so the commands themselves stay synchronous.
- apply_preset sets one of the 16 instrument presets or 7 sfxr
presets, like the Preset menu. Presets take every note, so the
C4 to B4 range of a new Notes node is no trap there.
- get_asset gains usedBy: every asset naming the asset or one of its
frames or clips, with the object, node, item or key that does, plus
start scene, master FX and master routing of the project.
- usesOf in src/core/model/usages.ts walks the project data instead of
a list of fields, so no new field can be missed. The node every
asset has in the master routing does not count as a use.
- The relay tells the agent about all three ways.
Found on the way: suite 740 for 2e4c0a0 (#430) was red in e2e 68h
only, a sound clip 61 ms early against 50 allowed. #430 did not touch
sound timing, and e2e 68 on the same tree was green on atx (-4 ms).
Taken as a timing wobble under load until the next suite says more.
Tests:
- agent-files (new, 4 tests) with the other agent and relay tests:
130/130.
- 8 counter checks, all compiling, all red.
- e2e 71 on atx: 26/26, new 71g9 lists an uploaded sound, makes an
asset of it and fills an instrument from a preset.
- Gate on atx: CHECK EXIT 0, 326 files, 5021 tests.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2e4c0a09ea
commit
24cd9fdeaa
20 files changed
+644
-17
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { sineWav } from '../lib/audio.mjs';
|
||||
import { authHeaders, SESSION_COOKIE, sessionToken } from '../lib/auth.mjs';
|
||||
import { uploadSound } from '../lib/projects.mjs';
|
||||
|
||||
/** The tokens this step makes; a run that died halfway leaves them for the next to revoke. */
|
||||
const TOKEN_NAME = 'e2e 71';
|
||||
@@ -6,6 +8,7 @@ const TOOLS = [
|
||||
'get_view',
|
||||
'screenshot',
|
||||
'list_assets',
|
||||
'list_files',
|
||||
'get_asset',
|
||||
'get_graph',
|
||||
'lint_graph',
|
||||
@@ -516,6 +519,47 @@ export async function mcp(t) {
|
||||
}),
|
||||
);
|
||||
|
||||
// 71g9. Files the server holds (#431), an instrument preset (#432) and what uses an asset (#433):
|
||||
// a sound uploaded by the user is listed and made an asset nothing uses yet.
|
||||
const wavName = `${TOKEN_NAME} blip.wav`;
|
||||
const wav = await uploadSound(baseUrl, sineWav(0.2, 660), wavName);
|
||||
const filesListed =
|
||||
(await callTool('list_files', { type: 'sound', query: TOKEN_NAME }))?.structuredContent?.files ?? [];
|
||||
const filed = await callTool('run_commands', {
|
||||
label: 'file and preset',
|
||||
steps: [
|
||||
{ command: 'add_file_asset', args: { type: 'sound', file: wav.file }, as: 'blip' },
|
||||
{ command: 'create_asset', args: { type: 'instrument', name: `${TOKEN_NAME} keys` }, as: 'keys' },
|
||||
{ command: 'apply_preset', args: { asset: '$keys', preset: 'squareLead' } },
|
||||
],
|
||||
});
|
||||
await settle();
|
||||
const filedMade = filed?.structuredContent?.made ?? [];
|
||||
const blipId = filedMade.find((entry) => entry.step === 1)?.id;
|
||||
const keysId = filedMade.find((entry) => entry.step === 2)?.id;
|
||||
const keysGraph = keysId ? (await callTool('get_graph', { asset: keysId }))?.structuredContent : null;
|
||||
const blipRead = blipId ? (await callTool('get_asset', { asset: blipId }))?.structuredContent : null;
|
||||
const listedAgain =
|
||||
(await callTool('list_files', { type: 'sound', query: TOKEN_NAME }))?.structuredContent?.files ?? [];
|
||||
await callTool('undo');
|
||||
await settle();
|
||||
check(
|
||||
'a sound the server holds is listed, made an asset and nothing uses it yet; a preset fills an instrument',
|
||||
filesListed.some((file) => file.file === wav.file && file.name === wavName && !file.asset) &&
|
||||
filed?.isError === false &&
|
||||
blipRead?.file === wav.file &&
|
||||
JSON.stringify(blipRead?.usedBy) === '[]' &&
|
||||
listedAgain.find((file) => file.file === wav.file)?.asset?.id === blipId &&
|
||||
keysGraph?.nodes?.some((node) => node.type === 'InstrumentChip') === true &&
|
||||
!(await json('__gm.state.project.assets.map((a) => a.id)')).includes(blipId),
|
||||
JSON.stringify({
|
||||
listed: filesListed,
|
||||
text: filed?.content?.[0]?.text?.slice(0, 300),
|
||||
usedBy: blipRead?.usedBy,
|
||||
nodes: keysGraph?.nodes?.map((node) => node.type),
|
||||
}),
|
||||
);
|
||||
|
||||
// 71h. Played by the agent, the object walks left while the user holds the arrow.
|
||||
const started = await callTool('play', { action: 'play' });
|
||||
await waitUntil('__gm.state.mode === "play"', { timeout: 10000, label: 'the game runs' });
|
||||
|
||||
Reference in new issue
Block a user