@unifan/pi-unifan-zh 1.0.38 → 1.0.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,20 +8,17 @@ export function isExplicit03WorkTrigger(prompt: string): boolean {
|
|
|
8
8
|
const lower = trimmed.toLowerCase();
|
|
9
9
|
|
|
10
10
|
// 1. Direct skill invocation or slash command
|
|
11
|
-
if (
|
|
12
|
-
lower.startsWith("/skill:03-work") ||
|
|
13
|
-
lower === "/skill:03"
|
|
14
|
-
) {
|
|
11
|
+
if (lower.startsWith("/skill:03-work")) {
|
|
15
12
|
return true;
|
|
16
13
|
}
|
|
17
14
|
|
|
18
15
|
// 2. Strict keywords and natural language commands to start/resume 03 work
|
|
19
16
|
const strictPatterns = [
|
|
20
|
-
/^开始(
|
|
21
|
-
/^执行
|
|
17
|
+
/^开始(干活|编码|实现|写代码)/,
|
|
18
|
+
/^执行03-work/,
|
|
22
19
|
/^自主(干活|工作|编码)/,
|
|
23
|
-
/^(继续|恢复)(
|
|
24
|
-
/^resume\s+
|
|
20
|
+
/^(继续|恢复)(干活|工作|work)/i,
|
|
21
|
+
/^resume\s+work/i,
|
|
25
22
|
];
|
|
26
23
|
|
|
27
24
|
if (strictPatterns.some((p) => p.test(trimmed))) {
|
|
@@ -473,17 +473,16 @@ test("WorkLoopDriver: records failure history and triggers Stop-The-Line valve o
|
|
|
473
473
|
test("isExplicit03WorkTrigger: accurately identifies 03-work invocations vs harmless inputs", async () => {
|
|
474
474
|
// Should match explicit 03 triggers
|
|
475
475
|
assert.equal(isExplicit03WorkTrigger("/skill:03-work"), true);
|
|
476
|
-
assert.equal(isExplicit03WorkTrigger("/skill:03"), true);
|
|
477
476
|
assert.equal(isExplicit03WorkTrigger("开始干活"), true);
|
|
478
|
-
assert.equal(isExplicit03WorkTrigger("开始03"), true);
|
|
479
477
|
assert.equal(isExplicit03WorkTrigger("开始实现"), true);
|
|
480
|
-
assert.equal(isExplicit03WorkTrigger("执行03"), true);
|
|
478
|
+
assert.equal(isExplicit03WorkTrigger("执行03-work"), true);
|
|
481
479
|
assert.equal(isExplicit03WorkTrigger("继续干活"), true);
|
|
482
480
|
assert.equal(isExplicit03WorkTrigger("恢复干活"), true);
|
|
483
481
|
assert.equal(isExplicit03WorkTrigger("resume work"), true);
|
|
484
482
|
assert.equal(isExplicit03WorkTrigger("【03-work 自主循环驱动引擎 · 自动化续跑指令】"), true);
|
|
485
483
|
|
|
486
|
-
//
|
|
484
|
+
// Alias /skill:03 or plain numbers must NEVER trigger (strictly require full skill name /skill:03-work)
|
|
485
|
+
assert.equal(isExplicit03WorkTrigger("/skill:03"), false);
|
|
487
486
|
assert.equal(isExplicit03WorkTrigger("03"), false);
|
|
488
487
|
assert.equal(isExplicit03WorkTrigger("/03"), false);
|
|
489
488
|
|