feat: integrate production cockpit AI assistant

This commit is contained in:
vee
2026-09-08 17:46:07 +08:00
parent 5e228e12ae
commit 93103c2579
66 changed files with 11046 additions and 374 deletions
+10 -10
View File
@@ -281,7 +281,7 @@ test("wake preview uses the structured remainder and ignores duplicate, stale, a
generation: 9,
utteranceId: "utterance-9",
phase: "armed",
wakeWord: "你好,双十一",
wakeWord: "你好,小迪",
lastAppliedPreviewSequence: 0,
});
const context = { generation: 9, utteranceId: "utterance-9", requestedSequence: 2 };
@@ -289,10 +289,10 @@ test("wake preview uses the structured remainder and ignores duplicate, stale, a
assert.equal(api.applyPreview({
sequence: 2,
stale: false,
raw_text: "你好双十一打开空调",
raw_text: "你好小迪打开空调",
live_text: "ignored fallback",
wake_word: {
configured_word: "你好,双十一",
configured_word: "你好,小迪",
detected: true,
remainder: "打开空调",
},
@@ -300,7 +300,7 @@ test("wake preview uses the structured remainder and ignores duplicate, stale, a
assert.equal(harness.elements.input.value, "打开空调");
assert.equal(harness.elements.input.dataset.speechStage, "partial");
assert.equal(api.state.phase, "capturing");
assert.equal(api.state.wakeWord, "你好,双十一");
assert.equal(api.state.wakeWord, "你好,小迪");
assert.equal(harness.opened(), 1);
assert.equal(api.applyPreview({
@@ -374,7 +374,7 @@ test("clicking the microphone starts manual capture immediately without a wake w
loaded: true,
load_state: "ready",
live_preview: { recommended_interval_ms: 850 },
wake_word: { primary: "你好,双十一" },
wake_word: { primary: "你好,小迪" },
});
},
});
@@ -421,11 +421,11 @@ test("background wake standby stays gated until wake detection and then shows on
assert.equal(api.applyPreview({
sequence: 2,
raw_text: "你好双十一打开空调到24度",
raw_text: "你好小迪打开空调到24度",
live_text: "打开空调到24度",
wake_word: {
detected: true,
configured_word: "你好,双十一",
configured_word: "你好,小迪",
remainder: "打开空调到24度",
},
}, { ...context, requestedSequence: 2 }), true);
@@ -652,10 +652,10 @@ test("status reads the primary wake word instead of stringifying its object", ()
const harness = createHarness();
const api = harness.sandbox.CognitiveAgentSpeech.__test;
assert.equal(
api.configuredWakeWord({ wake_word: { primary: "你好,双十一" } }),
"你好,双十一",
api.configuredWakeWord({ wake_word: { primary: "你好,小迪" } }),
"你好,小迪",
);
assert.equal(api.configuredWakeWord({}), "你好,双十一");
assert.equal(api.configuredWakeWord({}), "你好,小迪");
assert.deepEqual(
{ ...api.speechStatusReadiness({ enabled: true, loaded: false, load_state: "loading" }) },
{ loadState: "loading", ready: false },