feat: release v1.0.2 LeKiwi 语言控制与网站嵌入
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
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 云模型抓放仍待单独验收,不包含运行密钥或构建产物。
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
import { LANGUAGE_VERSION } from './LanguageScene';
|
||||
import { validateJevDecision, type AgentVersion, type JevDecision, type Skill } from './protocol';
|
||||
|
||||
export const QUALITY_POINTS = { poor: 0, partial: 25, good: 75, excellent: 100 } as const;
|
||||
/** Supervisory advice can veto but cannot grant physical authority. */
|
||||
export class TaskSupervisor {
|
||||
last?: JevDecision;
|
||||
get qualityScore(): number | undefined {
|
||||
const score = this.last?.score;
|
||||
return score && score !== 'unavailable' ? QUALITY_POINTS[score] : undefined;
|
||||
}
|
||||
inspect(
|
||||
value: unknown,
|
||||
candidates: readonly (Skill | 'stop')[],
|
||||
version: AgentVersion,
|
||||
secure: boolean,
|
||||
): JevDecision {
|
||||
const decision = validateJevDecision(value, candidates, version);
|
||||
this.last = decision;
|
||||
if (version === LANGUAGE_VERSION && decision.noul !== 'allow')
|
||||
throw new Error(`Noul 拦截:${decision.reason ?? 'insufficient_evidence'}`);
|
||||
if (decision.choice === 'stop' || decision.recovery === 'stop')
|
||||
throw new Error('Jev 请求安全停止');
|
||||
if (decision.grasp === 'secure' && !secure) throw new Error('Jev 抓持判断与本地物理证据矛盾');
|
||||
if (
|
||||
['carry', 'stop-base'].includes(decision.choice) &&
|
||||
(decision.grasp !== 'secure' || !secure)
|
||||
)
|
||||
throw new Error('搬运前未取得一致抓持证据');
|
||||
return decision;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user