@openclaw/zalouser 2026.5.2 → 2026.5.3-beta.2

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 (95) hide show
  1. package/dist/accounts-C00IMUgd.js +63 -0
  2. package/dist/accounts.runtime-uG7S8cXT.js +2 -0
  3. package/dist/api-BRwdUWuS.js +139 -0
  4. package/dist/api.js +7 -0
  5. package/dist/channel-ou_w_2j-.js +484 -0
  6. package/dist/channel-plugin-api.js +2 -0
  7. package/dist/channel.runtime-C9WxiAiR.js +25 -0
  8. package/dist/channel.setup-CiDeBFrn.js +10 -0
  9. package/dist/contract-api.js +3 -0
  10. package/dist/doctor-contract-DgqHp8E2.js +128 -0
  11. package/dist/doctor-contract-api.js +2 -0
  12. package/dist/index.js +27 -0
  13. package/dist/monitor-Cg7K_s_s.js +705 -0
  14. package/dist/runtime-QNU7vLgI.js +106 -0
  15. package/dist/runtime-api.js +22 -0
  16. package/dist/secret-contract-api.js +5 -0
  17. package/dist/security-audit-BZLhil-V.js +34 -0
  18. package/dist/send-BsmySxe3.js +534 -0
  19. package/dist/session-route-C0-Xr8bt.js +92 -0
  20. package/dist/setup-core-CqipqY98.js +40 -0
  21. package/dist/setup-entry.js +11 -0
  22. package/dist/setup-plugin-api.js +2 -0
  23. package/dist/setup-surface-NCOuKu-l.js +359 -0
  24. package/dist/shared-DSy8aIUx.js +120 -0
  25. package/dist/test-api.js +5 -0
  26. package/dist/zalo-js-CHCUlY3c.js +1279 -0
  27. package/package.json +15 -6
  28. package/api.ts +0 -9
  29. package/channel-plugin-api.ts +0 -3
  30. package/contract-api.ts +0 -2
  31. package/doctor-contract-api.ts +0 -1
  32. package/index.ts +0 -34
  33. package/runtime-api.ts +0 -67
  34. package/secret-contract-api.ts +0 -4
  35. package/setup-entry.ts +0 -9
  36. package/setup-plugin-api.ts +0 -2
  37. package/src/accounts.runtime.ts +0 -1
  38. package/src/accounts.test-mocks.ts +0 -14
  39. package/src/accounts.test.ts +0 -266
  40. package/src/accounts.ts +0 -131
  41. package/src/channel-api.ts +0 -20
  42. package/src/channel.adapters.ts +0 -391
  43. package/src/channel.directory.test.ts +0 -59
  44. package/src/channel.runtime.ts +0 -12
  45. package/src/channel.sendpayload.test.ts +0 -172
  46. package/src/channel.setup.test.ts +0 -33
  47. package/src/channel.setup.ts +0 -12
  48. package/src/channel.test.ts +0 -377
  49. package/src/channel.ts +0 -219
  50. package/src/config-schema.ts +0 -33
  51. package/src/directory.ts +0 -54
  52. package/src/doctor-contract.ts +0 -156
  53. package/src/doctor.test.ts +0 -77
  54. package/src/doctor.ts +0 -37
  55. package/src/group-policy.test.ts +0 -61
  56. package/src/group-policy.ts +0 -83
  57. package/src/message-sid.test.ts +0 -66
  58. package/src/message-sid.ts +0 -80
  59. package/src/monitor.account-scope.test.ts +0 -107
  60. package/src/monitor.group-gating.test.ts +0 -816
  61. package/src/monitor.send-mocks.ts +0 -20
  62. package/src/monitor.ts +0 -1044
  63. package/src/probe.test.ts +0 -60
  64. package/src/probe.ts +0 -35
  65. package/src/qr-temp-file.ts +0 -22
  66. package/src/reaction.test.ts +0 -19
  67. package/src/reaction.ts +0 -32
  68. package/src/runtime.ts +0 -9
  69. package/src/security-audit.test.ts +0 -80
  70. package/src/security-audit.ts +0 -71
  71. package/src/send.test.ts +0 -395
  72. package/src/send.ts +0 -272
  73. package/src/session-route.ts +0 -121
  74. package/src/setup-core.ts +0 -33
  75. package/src/setup-surface.test.ts +0 -363
  76. package/src/setup-surface.ts +0 -470
  77. package/src/setup-test-helpers.ts +0 -42
  78. package/src/shared.ts +0 -92
  79. package/src/status-issues.test.ts +0 -31
  80. package/src/status-issues.ts +0 -58
  81. package/src/test-helpers.ts +0 -26
  82. package/src/text-styles.test.ts +0 -203
  83. package/src/text-styles.ts +0 -540
  84. package/src/tool.test.ts +0 -212
  85. package/src/tool.ts +0 -210
  86. package/src/types.ts +0 -125
  87. package/src/zalo-js.credentials.test.ts +0 -465
  88. package/src/zalo-js.test-mocks.ts +0 -89
  89. package/src/zalo-js.ts +0 -1911
  90. package/src/zca-client.test.ts +0 -24
  91. package/src/zca-client.ts +0 -259
  92. package/src/zca-constants.ts +0 -55
  93. package/src/zca-js-exports.d.ts +0 -22
  94. package/test-api.ts +0 -21
  95. package/tsconfig.json +0 -16
@@ -1,26 +0,0 @@
1
- import type { RuntimeEnv } from "../runtime-api.js";
2
- import type { ResolvedZalouserAccount } from "./types.js";
3
-
4
- export function createZalouserRuntimeEnv(): RuntimeEnv {
5
- return {
6
- log: () => {},
7
- error: () => {},
8
- exit: ((code: number): never => {
9
- throw new Error(`exit ${code}`);
10
- }) as RuntimeEnv["exit"],
11
- };
12
- }
13
-
14
- export function createDefaultResolvedZalouserAccount(
15
- overrides: Partial<ResolvedZalouserAccount> = {},
16
- ): ResolvedZalouserAccount {
17
- return {
18
- accountId: "default",
19
- profile: "default",
20
- name: "test",
21
- enabled: true,
22
- authenticated: true,
23
- config: {},
24
- ...overrides,
25
- };
26
- }
@@ -1,203 +0,0 @@
1
- import { describe, expect, it } from "vitest";
2
- import { parseZalouserTextStyles } from "./text-styles.js";
3
- import { TextStyle } from "./zca-constants.js";
4
-
5
- describe("parseZalouserTextStyles", () => {
6
- it("renders inline markdown emphasis as Zalo style ranges", () => {
7
- expect(parseZalouserTextStyles("**bold** *italic* ~~strike~~")).toEqual({
8
- text: "bold italic strike",
9
- styles: [
10
- { start: 0, len: 4, st: TextStyle.Bold },
11
- { start: 5, len: 6, st: TextStyle.Italic },
12
- { start: 12, len: 6, st: TextStyle.StrikeThrough },
13
- ],
14
- });
15
- });
16
-
17
- it("keeps inline code and plain math markers literal", () => {
18
- expect(parseZalouserTextStyles("before `inline *code*` after\n2 * 3 * 4")).toEqual({
19
- text: "before `inline *code*` after\n2 * 3 * 4",
20
- styles: [],
21
- });
22
- });
23
-
24
- it("preserves backslash escapes inside code spans and fenced code blocks", () => {
25
- expect(parseZalouserTextStyles("before `\\*` after\n```ts\n\\*\\_\\\\\n```")).toEqual({
26
- text: "before `\\*` after\n\\*\\_\\\\",
27
- styles: [],
28
- });
29
- });
30
-
31
- it("closes fenced code blocks when the input uses CRLF newlines", () => {
32
- expect(parseZalouserTextStyles("```\r\n*code*\r\n```\r\n**after**")).toEqual({
33
- text: "*code*\nafter",
34
- styles: [{ start: 7, len: 5, st: TextStyle.Bold }],
35
- });
36
- });
37
-
38
- it("maps headings, block quotes, and lists into line styles", () => {
39
- expect(parseZalouserTextStyles(["# Title", "> quoted", " - nested"].join("\n"))).toEqual({
40
- text: "Title\nquoted\nnested",
41
- styles: [
42
- { start: 0, len: 5, st: TextStyle.Bold },
43
- { start: 0, len: 5, st: TextStyle.Big },
44
- { start: 6, len: 6, st: TextStyle.Indent, indentSize: 1 },
45
- { start: 13, len: 6, st: TextStyle.UnorderedList },
46
- ],
47
- });
48
- });
49
-
50
- it("treats 1-3 leading spaces as markdown padding for headings and lists", () => {
51
- expect(parseZalouserTextStyles(" # Title\n 1. item\n - bullet")).toEqual({
52
- text: "Title\nitem\nbullet",
53
- styles: [
54
- { start: 0, len: 5, st: TextStyle.Bold },
55
- { start: 0, len: 5, st: TextStyle.Big },
56
- { start: 6, len: 4, st: TextStyle.OrderedList },
57
- { start: 11, len: 6, st: TextStyle.UnorderedList },
58
- ],
59
- });
60
- });
61
-
62
- it("strips fenced code markers and preserves leading indentation with nbsp", () => {
63
- expect(parseZalouserTextStyles("```ts\n const x = 1\n\treturn x\n```")).toEqual({
64
- text: "\u00A0\u00A0const x = 1\n\u00A0\u00A0\u00A0\u00A0return x",
65
- styles: [],
66
- });
67
- });
68
-
69
- it("treats tilde fences as literal code blocks", () => {
70
- expect(parseZalouserTextStyles("~~~bash\n*cmd*\n~~~")).toEqual({
71
- text: "*cmd*",
72
- styles: [],
73
- });
74
- });
75
-
76
- it("treats fences indented under list items as literal code blocks", () => {
77
- expect(parseZalouserTextStyles(" ```\n*cmd*\n ```")).toEqual({
78
- text: "*cmd*",
79
- styles: [],
80
- });
81
- });
82
-
83
- it("treats quoted backtick fences as literal code blocks", () => {
84
- expect(parseZalouserTextStyles("> ```js\n> *cmd*\n> ```")).toEqual({
85
- text: "*cmd*",
86
- styles: [],
87
- });
88
- });
89
-
90
- it("treats quoted tilde fences as literal code blocks", () => {
91
- expect(parseZalouserTextStyles("> ~~~\n> *cmd*\n> ~~~")).toEqual({
92
- text: "*cmd*",
93
- styles: [],
94
- });
95
- });
96
-
97
- it("preserves quote-prefixed lines inside normal fenced code blocks", () => {
98
- expect(parseZalouserTextStyles("```\n> prompt\n```")).toEqual({
99
- text: "> prompt",
100
- styles: [],
101
- });
102
- });
103
-
104
- it("does not treat quote-prefixed fence text inside code as a closing fence", () => {
105
- expect(parseZalouserTextStyles("```\n> ```\n*still code*\n```")).toEqual({
106
- text: "> ```\n*still code*",
107
- styles: [],
108
- });
109
- });
110
-
111
- it("treats indented blockquotes as quoted lines", () => {
112
- expect(parseZalouserTextStyles(" > quoted")).toEqual({
113
- text: "quoted",
114
- styles: [{ start: 0, len: 6, st: TextStyle.Indent, indentSize: 1 }],
115
- });
116
- });
117
-
118
- it("treats spaced nested blockquotes as deeper quoted lines", () => {
119
- expect(parseZalouserTextStyles("> > quoted")).toEqual({
120
- text: "quoted",
121
- styles: [{ start: 0, len: 6, st: TextStyle.Indent, indentSize: 2 }],
122
- });
123
- });
124
-
125
- it("treats indented quoted fences as literal code blocks", () => {
126
- expect(parseZalouserTextStyles(" > ```\n > *cmd*\n > ```")).toEqual({
127
- text: "*cmd*",
128
- styles: [],
129
- });
130
- });
131
-
132
- it("treats spaced nested quoted fences as literal code blocks", () => {
133
- expect(parseZalouserTextStyles("> > ```\n> > code\n> > ```")).toEqual({
134
- text: "code",
135
- styles: [],
136
- });
137
- });
138
-
139
- it("preserves inner quote markers inside quoted fenced code blocks", () => {
140
- expect(parseZalouserTextStyles("> ```\n>> prompt\n> ```")).toEqual({
141
- text: "> prompt",
142
- styles: [],
143
- });
144
- });
145
-
146
- it("keeps quote indentation on heading lines", () => {
147
- expect(parseZalouserTextStyles("> # Title")).toEqual({
148
- text: "Title",
149
- styles: [
150
- { start: 0, len: 5, st: TextStyle.Bold },
151
- { start: 0, len: 5, st: TextStyle.Big },
152
- { start: 0, len: 5, st: TextStyle.Indent, indentSize: 1 },
153
- ],
154
- });
155
- });
156
-
157
- it("keeps unmatched fences literal", () => {
158
- expect(parseZalouserTextStyles("```python")).toEqual({
159
- text: "```python",
160
- styles: [],
161
- });
162
- });
163
-
164
- it("keeps unclosed fenced blocks literal until eof", () => {
165
- expect(parseZalouserTextStyles("```python\n\\*not italic*\n_next_")).toEqual({
166
- text: "```python\n\\*not italic*\n_next_",
167
- styles: [],
168
- });
169
- });
170
-
171
- it("supports nested markdown and tag styles regardless of order", () => {
172
- expect(parseZalouserTextStyles("**{red}x{/red}** {red}**y**{/red}")).toEqual({
173
- text: "x y",
174
- styles: [
175
- { start: 0, len: 1, st: TextStyle.Bold },
176
- { start: 0, len: 1, st: TextStyle.Red },
177
- { start: 2, len: 1, st: TextStyle.Red },
178
- { start: 2, len: 1, st: TextStyle.Bold },
179
- ],
180
- });
181
- });
182
-
183
- it("treats small text tags as normal text", () => {
184
- expect(parseZalouserTextStyles("{small}tiny{/small}")).toEqual({
185
- text: "tiny",
186
- styles: [],
187
- });
188
- });
189
-
190
- it("keeps escaped markers literal", () => {
191
- expect(parseZalouserTextStyles("\\*literal\\* \\{underline}tag{/underline}")).toEqual({
192
- text: "*literal* {underline}tag{/underline}",
193
- styles: [],
194
- });
195
- });
196
-
197
- it("keeps indented code blocks literal", () => {
198
- expect(parseZalouserTextStyles(" *cmd*")).toEqual({
199
- text: "\u00A0\u00A0\u00A0\u00A0*cmd*",
200
- styles: [],
201
- });
202
- });
203
- });