@spzhongwin/skill-logger-plugin 1.0.8 → 1.0.10
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.
- package/openclaw.plugin.json +50 -50
- package/package.json +37 -37
- package/src/active-skills.test.ts +32 -32
- package/src/active-skills.ts +77 -77
- package/src/config-sync.test.ts +165 -165
- package/src/config-sync.ts +544 -544
- package/src/hooks.test.ts +251 -251
- package/src/hooks.ts +517 -517
- package/src/http.ts +61 -61
- package/src/identity.ts +64 -64
- package/src/index.test.ts +53 -53
- package/src/index.ts +226 -226
- package/src/integration.test.ts +119 -119
- package/src/matcher.test.ts +170 -170
- package/src/matcher.ts +393 -393
- package/src/paths.test.ts +57 -57
- package/src/paths.ts +84 -84
- package/src/reporter.test.ts +139 -139
- package/src/reporter.ts +298 -298
- package/src/sample-config.json +72 -72
- package/src/semver.test.ts +23 -23
- package/src/semver.ts +60 -60
- package/src/skill-version.ts +53 -53
- package/src/types.ts +198 -198
- package/src/updater.test.ts +237 -237
- package/src/updater.ts +433 -406
- package/src/ws-client.test.ts +37 -37
- package/src/ws-client.ts +642 -598
- package/test-ws.ts +17 -17
- package/tsconfig.json +14 -14
- package/dist/active-skills.js +0 -67
- package/dist/active-skills.test.js +0 -29
- package/dist/config-sync.js +0 -439
- package/dist/config-sync.test.js +0 -145
- package/dist/hooks.js +0 -337
- package/dist/hooks.test.js +0 -123
- package/dist/http.js +0 -54
- package/dist/identity.js +0 -56
- package/dist/index.js +0 -2564
- package/dist/index.test.js +0 -39
- package/dist/integration.test.js +0 -102
- package/dist/matcher.js +0 -362
- package/dist/matcher.test.js +0 -139
- package/dist/paths.js +0 -62
- package/dist/paths.test.js +0 -49
- package/dist/reporter.js +0 -267
- package/dist/reporter.test.js +0 -128
- package/dist/semver.js +0 -64
- package/dist/semver.test.js +0 -21
- package/dist/skill-version.js +0 -23
- package/dist/types.js +0 -9
- package/dist/updater.js +0 -352
- package/dist/updater.test.js +0 -212
- package/dist/ws-client.js +0 -484
package/src/ws-client.test.ts
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { describe, it } from "node:test";
|
|
2
|
-
import assert from "node:assert/strict";
|
|
3
|
-
import {
|
|
4
|
-
normalizeAssistantUserId,
|
|
5
|
-
parseAssistantWorkspaceAgentId,
|
|
6
|
-
} from "./ws-client.ts";
|
|
7
|
-
|
|
8
|
-
describe("assistant workspace naming", () => {
|
|
9
|
-
it("accepts workspace-assistant-* only when suffix is at least 5 digits", () => {
|
|
10
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-12345"), "assistant-12345");
|
|
11
|
-
assert.equal(
|
|
12
|
-
parseAssistantWorkspaceAgentId("workspace-assistant-12342325232333223223"),
|
|
13
|
-
"assistant-12342325232333223223"
|
|
14
|
-
);
|
|
15
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-000001"), "assistant-000001");
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("rejects short, non-numeric, and malformed workspace names", () => {
|
|
19
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234"), undefined);
|
|
20
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234a"), undefined);
|
|
21
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-abcde"), undefined);
|
|
22
|
-
assert.equal(parseAssistantWorkspaceAgentId("workspace-coder-12345"), undefined);
|
|
23
|
-
});
|
|
24
|
-
|
|
25
|
-
it("normalizes command userId using the same numeric suffix rule", () => {
|
|
26
|
-
assert.equal(normalizeAssistantUserId("12345"), "12345");
|
|
27
|
-
assert.equal(normalizeAssistantUserId("assistant-12345"), "12345");
|
|
28
|
-
assert.equal(normalizeAssistantUserId("assistant-000001"), "000001");
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it("rejects unsafe or non-conforming command userId values", () => {
|
|
32
|
-
assert.equal(normalizeAssistantUserId("1234"), undefined);
|
|
33
|
-
assert.equal(normalizeAssistantUserId("assistant-1234"), undefined);
|
|
34
|
-
assert.equal(normalizeAssistantUserId("assistant-1234a"), undefined);
|
|
35
|
-
assert.equal(normalizeAssistantUserId("../assistant-12345"), undefined);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
1
|
+
import { describe, it } from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import {
|
|
4
|
+
normalizeAssistantUserId,
|
|
5
|
+
parseAssistantWorkspaceAgentId,
|
|
6
|
+
} from "./ws-client.ts";
|
|
7
|
+
|
|
8
|
+
describe("assistant workspace naming", () => {
|
|
9
|
+
it("accepts workspace-assistant-* only when suffix is at least 5 digits", () => {
|
|
10
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-12345"), "assistant-12345");
|
|
11
|
+
assert.equal(
|
|
12
|
+
parseAssistantWorkspaceAgentId("workspace-assistant-12342325232333223223"),
|
|
13
|
+
"assistant-12342325232333223223"
|
|
14
|
+
);
|
|
15
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-000001"), "assistant-000001");
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it("rejects short, non-numeric, and malformed workspace names", () => {
|
|
19
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234"), undefined);
|
|
20
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234a"), undefined);
|
|
21
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-abcde"), undefined);
|
|
22
|
+
assert.equal(parseAssistantWorkspaceAgentId("workspace-coder-12345"), undefined);
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
it("normalizes command userId using the same numeric suffix rule", () => {
|
|
26
|
+
assert.equal(normalizeAssistantUserId("12345"), "12345");
|
|
27
|
+
assert.equal(normalizeAssistantUserId("assistant-12345"), "12345");
|
|
28
|
+
assert.equal(normalizeAssistantUserId("assistant-000001"), "000001");
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
it("rejects unsafe or non-conforming command userId values", () => {
|
|
32
|
+
assert.equal(normalizeAssistantUserId("1234"), undefined);
|
|
33
|
+
assert.equal(normalizeAssistantUserId("assistant-1234"), undefined);
|
|
34
|
+
assert.equal(normalizeAssistantUserId("assistant-1234a"), undefined);
|
|
35
|
+
assert.equal(normalizeAssistantUserId("../assistant-12345"), undefined);
|
|
36
|
+
});
|
|
37
|
+
});
|