0d986f60bd
web-platform-ci / Standalone decision service (no cloud credentials) (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
lekiwi-compatibility / cpu-compatibility (push) Has been cancelled
集成服务器托管模型、自然语言移动与有界抓放、内置 LeKiwi URL 导入和双摄像头;同步部署契约与指定域名 iframe 白名单,保留原有物理安全、会话及调用预算防护。 更新 npm 包及锁文件版本、CHANGELOG 与发布文档。提交前 typecheck、120 项定向前端测试和 44 项后端测试通过(3 项可选跳过);真实 v2 云模型抓放仍待单独验收,不包含运行密钥或构建产物。
39 lines
1.6 KiB
TypeScript
39 lines
1.6 KiB
TypeScript
import { expect, test } from '@playwright/test';
|
|
import { resolve } from 'node:path';
|
|
import { writeFile } from 'node:fs/promises';
|
|
import { startLiveDecisionService } from './fixtures/decisionService';
|
|
import type {} from '../physics/agent';
|
|
|
|
test.use({ trace: 'off', video: 'off' });
|
|
test('显式 opt-in:旧 v1 Bearer 客户端真实 API 物理兼容(非 v2 产品验收)', async ({
|
|
page,
|
|
}, info) => {
|
|
test.skip(process.env.LEKIWI_LIVE_API !== '1', '需明确授权 .env 两个角色与一次付费回合');
|
|
const service = await startLiveDecisionService();
|
|
try {
|
|
await page.goto('/physics/agent.html');
|
|
await page.waitForFunction(() => Boolean(window.lekiwiAgent));
|
|
await page.evaluate(
|
|
(url) => window.lekiwiAgent.boot(url),
|
|
`/@fs${resolve('build/lekiwi/lekiwi-v1.zip')}`,
|
|
);
|
|
const data = await page.evaluate((connection) => window.lekiwiAgent.task(0, connection), {
|
|
address: service.endpoint,
|
|
token: service.token,
|
|
});
|
|
const encoded = JSON.stringify(data, null, 2);
|
|
if (encoded.includes(service.token)) throw new Error('证据包含服务令牌');
|
|
await writeFile(info.outputPath('v1-live-physical-evidence.json'), encoded);
|
|
expect(data.state, data.error).toBe('succeeded');
|
|
expect(data.transported).toBeGreaterThanOrEqual(0.5);
|
|
expect(data.llmCalls).toBe(1);
|
|
expect(data.jevCalls).toBe(11);
|
|
} catch (error) {
|
|
await page.close().catch(() => undefined);
|
|
// eslint-disable-next-line preserve-caught-error -- Private bridge credentials must not enter errors.
|
|
throw new Error(String(error).replaceAll(service.token, '[redacted]'));
|
|
} finally {
|
|
await service.stop();
|
|
}
|
|
});
|