@spzhongwin/skill-logger-plugin 1.0.11 → 1.0.13

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.
Files changed (54) hide show
  1. package/dist/active-skills.js +67 -0
  2. package/dist/active-skills.test.js +29 -0
  3. package/dist/config-sync.js +439 -0
  4. package/dist/config-sync.test.js +145 -0
  5. package/dist/hooks.js +337 -0
  6. package/dist/hooks.test.js +123 -0
  7. package/dist/http.js +54 -0
  8. package/dist/identity.js +56 -0
  9. package/dist/index.js +240 -78
  10. package/dist/index.test.js +39 -0
  11. package/dist/integration.test.js +102 -0
  12. package/dist/matcher.js +362 -0
  13. package/dist/matcher.test.js +139 -0
  14. package/dist/paths.js +62 -0
  15. package/dist/paths.test.js +49 -0
  16. package/dist/reporter.js +267 -0
  17. package/dist/reporter.test.js +128 -0
  18. package/dist/semver.js +64 -0
  19. package/dist/semver.test.js +21 -0
  20. package/dist/skill-version.js +23 -0
  21. package/dist/types.js +9 -0
  22. package/dist/updater.js +352 -0
  23. package/dist/updater.test.js +212 -0
  24. package/dist/ws-client.js +484 -0
  25. package/openclaw.plugin.json +50 -50
  26. package/package.json +37 -37
  27. package/src/active-skills.test.ts +32 -32
  28. package/src/active-skills.ts +77 -77
  29. package/src/config-sync.test.ts +165 -165
  30. package/src/config-sync.ts +544 -544
  31. package/src/hooks.test.ts +251 -251
  32. package/src/hooks.ts +517 -517
  33. package/src/http.ts +61 -61
  34. package/src/identity.ts +64 -64
  35. package/src/index.test.ts +53 -53
  36. package/src/index.ts +226 -226
  37. package/src/integration.test.ts +119 -119
  38. package/src/matcher.test.ts +170 -170
  39. package/src/matcher.ts +393 -393
  40. package/src/paths.test.ts +57 -57
  41. package/src/paths.ts +84 -84
  42. package/src/reporter.test.ts +139 -139
  43. package/src/reporter.ts +298 -298
  44. package/src/sample-config.json +72 -72
  45. package/src/semver.test.ts +23 -23
  46. package/src/semver.ts +60 -60
  47. package/src/skill-version.ts +53 -53
  48. package/src/types.ts +198 -198
  49. package/src/updater.test.ts +325 -237
  50. package/src/updater.ts +549 -433
  51. package/src/ws-client.test.ts +48 -37
  52. package/src/ws-client.ts +717 -642
  53. package/test-ws.ts +17 -17
  54. package/tsconfig.json +14 -14
@@ -1,37 +1,48 @@
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
+ shouldSyncBuiltInTemplate,
7
+ } from "./ws-client.ts";
8
+
9
+ describe("assistant workspace naming", () => {
10
+ it("accepts workspace-assistant-* only when suffix is at least 5 digits", () => {
11
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-12345"), "assistant-12345");
12
+ assert.equal(
13
+ parseAssistantWorkspaceAgentId("workspace-assistant-12342325232333223223"),
14
+ "assistant-12342325232333223223"
15
+ );
16
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-000001"), "assistant-000001");
17
+ });
18
+
19
+ it("rejects short, non-numeric, and malformed workspace names", () => {
20
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234"), undefined);
21
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-1234a"), undefined);
22
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-assistant-abcde"), undefined);
23
+ assert.equal(parseAssistantWorkspaceAgentId("workspace-coder-12345"), undefined);
24
+ });
25
+
26
+ it("normalizes command userId using the same numeric suffix rule", () => {
27
+ assert.equal(normalizeAssistantUserId("12345"), "12345");
28
+ assert.equal(normalizeAssistantUserId("assistant-12345"), "12345");
29
+ assert.equal(normalizeAssistantUserId("assistant-000001"), "000001");
30
+ });
31
+
32
+ it("rejects unsafe or non-conforming command userId values", () => {
33
+ assert.equal(normalizeAssistantUserId("1234"), undefined);
34
+ assert.equal(normalizeAssistantUserId("assistant-1234"), undefined);
35
+ assert.equal(normalizeAssistantUserId("assistant-1234a"), undefined);
36
+ assert.equal(normalizeAssistantUserId("../assistant-12345"), undefined);
37
+ });
38
+ });
39
+
40
+ describe("built-in template update boundary", () => {
41
+ it("only syncs the template for an explicit built-in UPDATE_SKILL command", () => {
42
+ assert.equal(shouldSyncBuiltInTemplate("UPDATE_SKILL", true), true);
43
+ assert.equal(shouldSyncBuiltInTemplate("UPDATE_SKILL", false), false);
44
+ assert.equal(shouldSyncBuiltInTemplate("UPDATE_SKILL", undefined), false);
45
+ assert.equal(shouldSyncBuiltInTemplate("INSTALL_SKILL", true), false);
46
+ assert.equal(shouldSyncBuiltInTemplate("UNINSTALL_SKILL", true), false);
47
+ });
48
+ });