Skip to content

Qwen3.8-Flash-Next on any consumer hardware: one-click install for Windows / Linux. Strata inference engine, OpenAI/Anthropic API on localhost, optional image input.

C++

skills: plain card words for loading a skill (8 languages), Skills page render script

Niko1221ca34357b08c1
diff --git a/apps/host/scripts/agent-http.mjs b/apps/host/scripts/agent-http.mjs
index e7603316b..2f18b0bd1 100644
--- a/apps/host/scripts/agent-http.mjs
+++ b/apps/host/scripts/agent-http.mjs
@@ -55,7 +55,7 @@ async function stream(body, { quiet = false } = {}) {
else if (f.type === 'agent-tool') {
out = `tool ${f.tool.state} ${f.tool.verb} ${f.tool.target ?? ''}${f.tool.state === 'proposed' ? ` [asks: ${f.tool.effect}]` : ''}`;
// ANSWER=approve|deny answers every card that asks (the card is the real Approve/Deny card of Manual mode)
- if (f.tool.state === 'proposed' && process.env.ANSWER) void j('/api/chat/approval', { sessionId: body.sessionId, toolId: f.tool.id, decision: process.env.ANSWER }).then(() => console.log(`${stamp()} -> ${process.env.ANSWER} ${f.tool.id}`), e => console.log(`${stamp()} answer failed: ${e.message}`));
+ if (f.tool.state === 'proposed' && process.env.ANSWER) void j('/api/chat/approval', { sessionId: body.sessionId, toolId: f.tool.id, decision: process.env.APPROVE_MATCH && new RegExp(process.env.APPROVE_MATCH, 'i').test(`${f.tool.target} ${f.tool.effect}`) ? 'approve' : process.env.ANSWER }).then(() => console.log(`${stamp()} -> ${process.env.ANSWER} ${f.tool.id}`), e => console.log(`${stamp()} answer failed: ${e.message}`));
}
else if (f.type === 'done') out = `done ${f.finishReason} tokensOut=${f.tokensOut}`;
else if (f.type === 'error') out = `ERROR ${f.message}`;
diff --git a/apps/host/scripts/skills-shot.mjs b/apps/host/scripts/skills-shot.mjs
new file mode 100644
index 000000000..e0b23decc
--- /dev/null
+++ b/apps/host/scripts/skills-shot.mjs
@@ -0,0 +1,27 @@
+/** One short headless render of the Skills page and the New skill dialog (closed when done). STRATA_URL, SHOTS */
+import { chromium } from 'playwright-core';
+import { existsSync, mkdirSync } from 'node:fs';
+import { join, resolve } from 'node:path';
+const BASE = process.env.STRATA_URL, SHOTS = resolve(process.env.SHOTS ?? 'skills-shots');
+mkdirSync(SHOTS, { recursive: true });
+const chrome = process.env.CHROME ?? ['C:/Program Files/Google/Chrome/Application/chrome.exe', '/usr/bin/google-chrome'].find(existsSync);
+const browser = await chromium.launch({ executablePath: chrome, headless: true });
+try {
+ const page = await browser.newPage({ viewport: { width: 1360, height: 900 } });
+ await page.goto(`${BASE}/`);
+ const skip = page.getByText('Go straight to the app'); await skip.waitFor({ timeout: 8000 }).then(() => skip.click()).catch(() => {});
+ await page.getByText('Skills', { exact: true }).first().click();
+ await page.waitForSelector('.skills-page', { timeout: 15000 });
+ await page.waitForTimeout(600);
+ await page.screenshot({ path: join(SHOTS, '01-skills-list.png') });
+ await page.getByRole('button', { name: 'New skill' }).click();
+ await page.getByRole('dialog').locator('input.st-input').nth(0).fill('Folder helper');
+ await page.getByRole('dialog').locator('input.st-input').nth(1).fill('Opens a folder for you');
+ await page.getByRole('tab', { name: 'Instructions' }).click();
+ await page.getByRole('dialog').locator('textarea').fill('Open the Downloads folder, then the Documents folder, and say which two you opened.');
+ await page.screenshot({ path: join(SHOTS, '02-new-skill-dialog.png') });
+ await page.getByRole('button', { name: 'Save skill' }).click();
+ await page.waitForTimeout(1500);
+ await page.screenshot({ path: join(SHOTS, '03-after-save.png') });
+ console.log('rendered', await page.locator('.skill-row').allInnerTexts().then(r => r.map(t => t.split('\n')[0]).join(' | ')));
+} finally { await browser.close(); }
diff --git a/apps/host/server/agent/events.mjs b/apps/host/server/agent/events.mjs
index 4bc58407e..749d4b2e7 100644
--- a/apps/host/server/agent/events.mjs
+++ b/apps/host/server/agent/events.mjs
@@ -80,6 +80,7 @@ const VERBS = {
create_goal: ['Setting the goal', 'Set the goal', "Couldn't set the goal"],
update_goal: ['Updating the goal', 'Updated the goal', "Couldn't update the goal"],
get_goal: ['Checking the goal', 'Checked the goal', "Couldn't check the goal"],
+ skill: ['Loading your skill', 'Loaded your skill', "Couldn't load the skill"],
todo_write: ['Updating its to-do list', 'Updated its to-do list', "Couldn't update its to-do list"],
present: ['Showing you a result', 'Showed you a result', "Couldn't show the result"],
working_directory: ['Checking the folder', 'Checked the folder', "Couldn't check the folder"],
diff --git a/apps/host/tests/agent-skills.test.mjs b/apps/host/tests/agent-skills.test.mjs
index 32442868a..1a5b62c6a 100644
--- a/apps/host/tests/agent-skills.test.mjs
+++ b/apps/host/tests/agent-skills.test.mjs
@@ -78,6 +78,7 @@ test('real Harness: a skill saved in the app is in the catalog, loads by name, a
const pid = bridge.status().runtime.pid;
const cards = await run('s1', `SCRIPT:call skill ${JSON.stringify({ name: 'directory-opener' })}`);
assert.equal(cards.at(-1).state, 'done');
+ assert.equal(cards.at(-1).verb, 'Loaded your skill', 'the card says it in the person own words');
assert.match(cards.at(-1).result, /Open the Downloads folder, then open the Documents folder/, 'loading it returns the instructions the person wrote');
// saved later, while the agent runs
list.push({ id: 'my-release-notes', name: 'Release notes', description: 'Writes release notes', body: 'Start with one line.', enabled: true });