Ship Assistent 0.11.9: esbuild bundle and patch-keys manifest.
Replace split Assets JS with a built bundle and aligned C#/config so SwarmUI loads one script and patch apply stays consistent; drop legacy terse persona and memory seed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
userAsksLook,
|
||||
userCommandsGenerate,
|
||||
userAsksNoGenerate,
|
||||
resolveTurnIntent,
|
||||
packWantsVision,
|
||||
} from '../src/intent.js';
|
||||
|
||||
describe('intent.js', () => {
|
||||
it('userAsksLook detects critique RU', () => {
|
||||
assert.equal(userAsksLook('посмотри на результат'), true);
|
||||
assert.equal(userAsksLook('нарисуй лису'), false);
|
||||
});
|
||||
|
||||
it('userCommandsGenerate respects veto', () => {
|
||||
assert.equal(userCommandsGenerate('сгенерируй кадр'), true);
|
||||
assert.equal(userCommandsGenerate('только запомни промпт'), false);
|
||||
assert.equal(userAsksNoGenerate('только запомни промпт'), true);
|
||||
});
|
||||
|
||||
it('resolveTurnIntent honors look without generate', () => {
|
||||
const patch = { look_at: ['generate'] };
|
||||
const intent = resolveTurnIntent(patch, 'что не так с кадром?', {}, 'ordinary');
|
||||
assert.equal(intent.generate, false);
|
||||
assert.equal(intent.look, true);
|
||||
});
|
||||
|
||||
it('packWantsVision for critique pack', () => {
|
||||
assert.equal(packWantsVision('critique_image'), true);
|
||||
assert.equal(packWantsVision('ordinary'), false);
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
import { describe, it } from 'node:test';
|
||||
import assert from 'node:assert/strict';
|
||||
import {
|
||||
extractPatch,
|
||||
isPatchObject,
|
||||
isCardObject,
|
||||
normalizePatch,
|
||||
setPatchKeys,
|
||||
} from '../src/patch.js';
|
||||
|
||||
describe('patch.js', () => {
|
||||
it('extractPatch finds generation patch in fence', () => {
|
||||
const text = 'Here you go\n```json\n{"prompt":"A red fox in snow","actions":["generate"]}\n```';
|
||||
const { prose, patch } = extractPatch(text);
|
||||
assert.ok(patch);
|
||||
assert.equal(patch.prompt, 'A red fox in snow');
|
||||
assert.ok(!prose.includes('```'));
|
||||
});
|
||||
|
||||
it('isCardObject vs isPatchObject', () => {
|
||||
const card = { kind: 'lora', name: 'Foo', triggers: ['bar'] };
|
||||
const gen = { prompt: 'test', actions: ['generate'] };
|
||||
assert.equal(isCardObject(card), true);
|
||||
assert.equal(isPatchObject(card), false);
|
||||
assert.equal(isPatchObject(gen), true);
|
||||
});
|
||||
|
||||
it('normalizePatch aliases civitai_query', () => {
|
||||
const p = normalizePatch({ civitai_query: 'anime style' });
|
||||
assert.equal(p.search_query, 'anime style');
|
||||
});
|
||||
|
||||
it('scheduler-only patch is detected with full key list', () => {
|
||||
setPatchKeys(['prompt', 'scheduler']);
|
||||
assert.equal(isPatchObject({ scheduler: 'euler' }), true);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user