Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Drop the skill sentences and test the started server's update notice (#907)

Nguyen Xuan An1c90d37a90af
diff --git a/skills/build-67js-scene/SKILL.md b/skills/build-67js-scene/SKILL.md
index d8a10187..522979af 100644
--- a/skills/build-67js-scene/SKILL.md
+++ b/skills/build-67js-scene/SKILL.md
@@ -12,8 +12,6 @@ Start the server with `npx --package @codepawlhq/67js 67js-mcp --backend gpu --a
## Loop
-When the instructions or the first `scene_capabilities` result carry `updateAvailable`, tell the user a newer 67js exists and ask whether to update; run the command for their install route only after a yes.
-
1. `scene_capabilities`: with no arguments it returns a short index of features, limits and topic names. Pass
`topic` for the field list of one feature (`environment`, `materialFields`, `geometries`, `meshEdit.bevel`,
`motion`) or `examples.scene_apply` for a complete call of a hard tool. Tool schemas list only common fields, so read the topic before a feature you have not used.
diff --git a/skills/render-67js-media/SKILL.md b/skills/render-67js-media/SKILL.md
index 50a56116..6a3f058f 100644
--- a/skills/render-67js-media/SKILL.md
+++ b/skills/render-67js-media/SKILL.md
@@ -35,7 +35,6 @@ submit call fails: tell the user which launch option is missing.
## Rules
-- When `scene_capabilities` returns `updateAvailable`, tell the user and ask whether to update; run the command only after a yes.
- Smallest output that meets the need: a still before a video, a 2 second slice before the full film.
Every film round starts as a small, low-quality preview with sound; full quality only after sign-off.
- Time is deterministic. A frame depends on its time only, so a seek gives the same pixels as the frame in a video.
diff --git a/tests/mcp-update-check.test.js b/tests/mcp-update-check.test.js
index 54b8d5a0..8b6afb15 100644
--- a/tests/mcp-update-check.test.js
+++ b/tests/mcp-update-check.test.js
@@ -4,7 +4,9 @@ import assert from 'node:assert/strict';
import { mkdir, mkdtemp, readFile, rm, writeFile } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { dirname, join } from 'node:path';
+import { existsSync } from 'node:fs';
import { Client } from '@modelcontextprotocol/client';
+import { StdioClientTransport } from '@modelcontextprotocol/client/stdio';
import { InMemoryTransport } from '@modelcontextprotocol/server';
import { createAgentMcpServer } from '../scripts/mcp-server.mjs';
import {
@@ -190,3 +192,33 @@ test('without a newer version the instructions and results carry no notice', asy
const result = (await client.callTool({ name: 'scene_capabilities', arguments: {} })).structuredContent;
assert.equal('updateAvailable' in result, false);
});
+
+const serverEntry = new URL('../bin/67js-mcp.mjs', import.meta.url).pathname.replace(/^\/(\w:)/, '$1');
+const hasBuild = existsSync(new URL('../build/mcp/server.mjs', import.meta.url));
+
+// The real bin in a child process: the cache file is seeded through XDG_CACHE_HOME and is fresh, so no request is made.
+test('the started server reads a seeded cache and reports the newer version in instructions and the first scene_capabilities', { skip: !hasBuild && 'run npm run build:mcp first' }, async () => {
+ const cacheHome = await mkdtemp(join(tmpdir(), '67js-update-cli-'));
+ const cacheFile = join(cacheHome, '67js', 'update-check.json');
+ await mkdir(dirname(cacheFile), { recursive: true });
+ await writeFile(cacheFile, JSON.stringify({ checkedAt: Date.now(), latest: '99.0.0' }));
+ const { CI, NO_UPDATE_NOTIFIER, SIXTYSEVENJS_NO_UPDATE_CHECK, ...inheritedEnvironment } = process.env;
+ const transport = new StdioClientTransport({
+ command: process.execPath,
+ args: [serverEntry, '--backend', 'cpu'],
+ env: { ...inheritedEnvironment, XDG_CACHE_HOME: cacheHome },
+ stderr: 'ignore',
+ });
+ const client = new Client({ name: 'update-check-cli-test', version: '1' });
+ try {
+ await client.connect(transport);
+ assert.match(client.getInstructions(), /A newer 67js is out \(running \d+\.\d+\.\d+, latest 99\.0\.0/);
+ const first = (await client.callTool({ name: 'scene_capabilities', arguments: {} })).structuredContent;
+ assert.equal(first.updateAvailable.latest, '99.0.0');
+ const second = (await client.callTool({ name: 'scene_capabilities', arguments: {} })).structuredContent;
+ assert.equal('updateAvailable' in second, false);
+ } finally {
+ await client.close();
+ await rm(cacheHome, { recursive: true, force: true });
+ }
+});