lycheedev 1.0.0 → 1.0.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 (50) hide show
  1. package/bin/lycheedev.js +58 -8
  2. package/package.json +1 -1
  3. package/vendor/addon/Core/Bootstrap.lua +131 -131
  4. package/vendor/addon/Core/Clients/Mainline.lua +9 -9
  5. package/vendor/addon/Core/Clients/Mists.lua +9 -9
  6. package/vendor/addon/Core/Clients/Titan.lua +9 -9
  7. package/vendor/addon/Core/Compatibility.lua +43 -43
  8. package/vendor/addon/Core/Database.lua +859 -859
  9. package/vendor/addon/Core/Inspector.lua +647 -647
  10. package/vendor/addon/Core/Locale.lua +307 -307
  11. package/vendor/addon/Core/Locale_enUS.lua +318 -318
  12. package/vendor/addon/Core/Safety.lua +42 -42
  13. package/vendor/addon/Core/Serializer.lua +324 -324
  14. package/vendor/addon/Libs/AutomationQR.lua +1176 -1176
  15. package/vendor/addon/Lychee Dev_Mainline.toc +43 -43
  16. package/vendor/addon/Lychee Dev_Mists.toc +43 -43
  17. package/vendor/addon/Lychee Dev_Wrath.toc +43 -43
  18. package/vendor/addon/Modules/Automation/Controller.lua +757 -757
  19. package/vendor/addon/Modules/Automation/Report.lua +409 -409
  20. package/vendor/addon/Modules/Automation/auto/auto.lua +12 -12
  21. package/vendor/addon/Modules/Diagnostics.lua +238 -238
  22. package/vendor/addon/Modules/Events/Catalog.lua +184 -184
  23. package/vendor/addon/Modules/Events/CatalogData_Mainline.lua +1788 -1788
  24. package/vendor/addon/Modules/Events/CatalogData_Mists.lua +1489 -1489
  25. package/vendor/addon/Modules/Events/CatalogData_Titan.lua +1492 -1492
  26. package/vendor/addon/Modules/Events/Monitor.lua +181 -181
  27. package/vendor/addon/Modules/FunctionTrace.lua +85 -85
  28. package/vendor/addon/Modules/ObjectInspector.lua +329 -329
  29. package/vendor/addon/UI/AutomationOverlay.lua +183 -183
  30. package/vendor/addon/UI/Export.lua +140 -140
  31. package/vendor/addon/UI/Features.lua +890 -890
  32. package/vendor/addon/UI/MainWindow.lua +1145 -1145
  33. package/vendor/addon/UI/Pages/About.lua +223 -223
  34. package/vendor/addon/UI/Pages/Automation.lua +417 -417
  35. package/vendor/addon/UI/Pages/Diagnostics.lua +289 -289
  36. package/vendor/addon/UI/Pages/ExportRecords.lua +387 -387
  37. package/vendor/addon/UI/Pages/Object.lua +573 -573
  38. package/vendor/addon/UI/Pages/Trace.lua +165 -165
  39. package/vendor/skill/SKILL.md +94 -94
  40. package/vendor/skill/agents/openai.yaml +4 -4
  41. package/vendor/skill/references/automation.md +327 -327
  42. package/vendor/skill/references/runtime-investigations.md +97 -97
  43. package/vendor/skill/scripts/automation/__init__.py +1 -1
  44. package/vendor/skill/scripts/automation/registry.py +516 -516
  45. package/vendor/skill/scripts/automation/saved_variables.py +438 -438
  46. package/vendor/skill/scripts/automation/session.py +207 -207
  47. package/vendor/skill/scripts/automation/windows.py +573 -573
  48. package/vendor/skill/scripts/automation.py +865 -865
  49. package/vendor/skill/scripts/requirements.txt +13 -13
  50. package/vendor/skill/scripts/selftest_offline.py +981 -981
@@ -1,324 +1,324 @@
1
- local ADDON_NAME, ns = ...
2
-
3
- local DEFAULT_MAX_DEPTH = 6
4
- local DEFAULT_MAX_ENTRIES = 200
5
- local DEFAULT_MAX_OUTPUT_BYTES = 44000
6
- local STREAM_CHUNK_BYTES = 44000
7
- local STREAM_YIELD_BYTES = 4096
8
- local STREAM_MAX_DEPTH = 32
9
- local STREAM_MAX_ENTRIES = 10000
10
- local STREAM_MAX_OUTPUT_BYTES = 16 * 1024 * 1024
11
-
12
- local function SortKey(value)
13
- if issecretvalue and issecretvalue(value) then
14
- return "0:<secret>"
15
- end
16
-
17
- local valueType = type(value)
18
- if valueType == "number" then
19
- return "1:" .. tostring(value)
20
- elseif valueType == "string" then
21
- return "2:" .. value
22
- elseif valueType == "boolean" then
23
- return value and "3:1" or "3:0"
24
- end
25
- return "4:" .. valueType .. ":" .. tostring(value)
26
- end
27
-
28
- local function Append(state, text)
29
- if state.truncated then
30
- return
31
- end
32
-
33
- if state.length + #text > state.maxOutputBytes then
34
- state.parts[#state.parts + 1] = "\n... <output truncated>"
35
- state.truncated = true
36
- state.incomplete = true
37
- return
38
- end
39
-
40
- state.parts[#state.parts + 1] = text
41
- state.length = state.length + #text
42
- end
43
-
44
- local function SerializeValue(value, state, depth, indent)
45
- if state.truncated then
46
- return
47
- end
48
-
49
- if issecretvalue and issecretvalue(value) then
50
- Append(state, "<secret>")
51
- return
52
- end
53
-
54
- local valueType = type(value)
55
-
56
- if valueType == "string" then
57
- Append(state, string.format("%q", value))
58
- elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
59
- Append(state, tostring(value))
60
- elseif valueType ~= "table" then
61
- Append(state, "<" .. valueType .. ": " .. tostring(value) .. ">")
62
- elseif state.seen[value] then
63
- Append(state, "<cycle>")
64
- elseif depth >= state.maxDepth then
65
- Append(state, "<max depth>")
66
- state.incomplete = true
67
- else
68
- state.seen[value] = true
69
-
70
- local keys = {}
71
- local secretKeyCount = 0
72
- for key in pairs(value) do
73
- if issecretvalue and issecretvalue(key) then
74
- secretKeyCount = secretKeyCount + 1
75
- else
76
- keys[#keys + 1] = key
77
- end
78
- end
79
- table.sort(keys, function(left, right)
80
- return SortKey(left) < SortKey(right)
81
- end)
82
-
83
- if #keys == 0 and secretKeyCount == 0 then
84
- Append(state, "{}")
85
- else
86
- Append(state, "{")
87
- local count = math.min(#keys, state.maxEntries)
88
- for index = 1, count do
89
- local key = keys[index]
90
- Append(state, "\n" .. indent .. " [")
91
- SerializeValue(key, state, depth + 1, indent .. " ")
92
- Append(state, "] = ")
93
- SerializeValue(value[key], state, depth + 1, indent .. " ")
94
- Append(state, ",")
95
- end
96
- if #keys > state.maxEntries then
97
- Append(state, "\n" .. indent .. " ... <" .. (#keys - state.maxEntries) .. " entries omitted>")
98
- state.incomplete = true
99
- end
100
- if secretKeyCount > 0 then
101
- Append(state, "\n" .. indent .. " ... <" .. secretKeyCount .. " secret keys omitted>")
102
- end
103
- Append(state, "\n" .. indent .. "}")
104
- end
105
-
106
- state.seen[value] = nil
107
- end
108
- end
109
-
110
- local function SerializeWithLimits(value, maxDepth, maxEntries, maxOutputBytes)
111
- local state = {
112
- parts = {},
113
- length = 0,
114
- seen = {},
115
- truncated = false,
116
- incomplete = false,
117
- maxDepth = maxDepth,
118
- maxEntries = maxEntries,
119
- maxOutputBytes = maxOutputBytes,
120
- }
121
- SerializeValue(value, state, 0, "")
122
- return table.concat(state.parts), state.incomplete
123
- end
124
-
125
- function ns.Serialize(value)
126
- return SerializeWithLimits(value, DEFAULT_MAX_DEPTH, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_OUTPUT_BYTES)
127
- end
128
-
129
- function ns.SerializeValues(values)
130
- local lines = {}
131
- for index = 1, values.n do
132
- lines[index] = "[" .. index .. "] = " .. ns.Serialize(values[index])
133
- end
134
- return table.concat(lines, "\n")
135
- end
136
-
137
- local function CreateStreamCoroutine(value, streamState)
138
- return coroutine.create(function()
139
- local parts = {}
140
- local length = 0
141
- local emitted = 0
142
- local seen = {}
143
- local stopped = false
144
-
145
- local function Flush()
146
- if length == 0 then
147
- return
148
- end
149
- local text = table.concat(parts)
150
- parts = {}
151
- length = 0
152
- emitted = emitted + #text
153
- coroutine.yield(text)
154
- end
155
-
156
- local function Emit(text)
157
- if stopped then
158
- return false
159
- end
160
-
161
- local remaining = STREAM_MAX_OUTPUT_BYTES - emitted - length
162
- if #text > remaining then
163
- local marker = "\n... <output limit reached>"
164
- local available = math.max(0, remaining - #marker)
165
- if available > 0 then
166
- parts[#parts + 1] = text:sub(1, available)
167
- length = length + available
168
- end
169
- if remaining >= #marker then
170
- parts[#parts + 1] = marker
171
- length = length + #marker
172
- end
173
- streamState.limited = true
174
- stopped = true
175
- return false
176
- end
177
-
178
- parts[#parts + 1] = text
179
- length = length + #text
180
- if length >= STREAM_YIELD_BYTES then
181
- Flush()
182
- end
183
- return true
184
- end
185
-
186
- local SerializeStreamValue
187
- SerializeStreamValue = function(current, depth, indent)
188
- if stopped then
189
- return
190
- elseif issecretvalue and issecretvalue(current) then
191
- Emit("<secret>")
192
- return
193
- end
194
-
195
- local valueType = type(current)
196
- if valueType == "string" then
197
- Emit(string.format("%q", current))
198
- elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
199
- Emit(tostring(current))
200
- elseif valueType ~= "table" then
201
- Emit("<" .. valueType .. ": " .. tostring(current) .. ">")
202
- elseif seen[current] then
203
- Emit("<cycle>")
204
- elseif depth >= STREAM_MAX_DEPTH then
205
- Emit("<max depth>")
206
- streamState.limited = true
207
- else
208
- seen[current] = true
209
- local keys = {}
210
- local secretKeyCount = 0
211
- for key in pairs(current) do
212
- if issecretvalue and issecretvalue(key) then
213
- secretKeyCount = secretKeyCount + 1
214
- else
215
- keys[#keys + 1] = key
216
- end
217
- end
218
- table.sort(keys, function(left, right)
219
- return SortKey(left) < SortKey(right)
220
- end)
221
-
222
- if #keys == 0 and secretKeyCount == 0 then
223
- Emit("{}")
224
- else
225
- Emit("{")
226
- local count = math.min(#keys, STREAM_MAX_ENTRIES)
227
- for index = 1, count do
228
- if stopped then
229
- break
230
- end
231
- local key = keys[index]
232
- Emit("\n" .. indent .. " [")
233
- SerializeStreamValue(key, depth + 1, indent .. " ")
234
- Emit("] = ")
235
- SerializeStreamValue(current[key], depth + 1, indent .. " ")
236
- Emit(",")
237
- end
238
- if not stopped and #keys > STREAM_MAX_ENTRIES then
239
- Emit("\n" .. indent .. " ... <"
240
- .. (#keys - STREAM_MAX_ENTRIES) .. " entries omitted>")
241
- streamState.limited = true
242
- end
243
- if not stopped and secretKeyCount > 0 then
244
- Emit("\n" .. indent .. " ... <"
245
- .. secretKeyCount .. " secret keys omitted>")
246
- end
247
- if not stopped then
248
- Emit("\n" .. indent .. "}")
249
- end
250
- end
251
- seen[current] = nil
252
- end
253
- end
254
-
255
- SerializeStreamValue(value, 0, "")
256
- Flush()
257
- end)
258
- end
259
-
260
- function ns.CreateSerializationStream(value)
261
- local state = { limited = false }
262
- local thread = CreateStreamCoroutine(value, state)
263
- local stream = {
264
- finished = false,
265
- pending = "",
266
- state = state,
267
- }
268
-
269
- function stream:ReadChunk(maxBytes)
270
- maxBytes = math.max(1, math.floor(tonumber(maxBytes) or STREAM_CHUNK_BYTES))
271
- local output = {}
272
- local outputLength = 0
273
-
274
- while outputLength < maxBytes and (self.pending ~= "" or not self.finished) do
275
- if self.pending == "" then
276
- local succeeded, segment = coroutine.resume(thread)
277
- if not succeeded then
278
- self.finished = true
279
- self.state.limited = true
280
- self.errorMessage = tostring(segment)
281
- break
282
- elseif coroutine.status(thread) == "dead" then
283
- self.finished = true
284
- break
285
- end
286
- self.pending = segment or ""
287
- end
288
-
289
- if self.pending ~= "" then
290
- local take = math.min(#self.pending, maxBytes - outputLength)
291
- output[#output + 1] = self.pending:sub(1, take)
292
- self.pending = self.pending:sub(take + 1)
293
- outputLength = outputLength + take
294
- end
295
- end
296
-
297
- return table.concat(output), self.finished and self.pending == ""
298
- end
299
-
300
- function stream:IsFinished()
301
- return self.finished and self.pending == ""
302
- end
303
-
304
- function stream:WasLimited()
305
- return self.state.limited
306
- end
307
-
308
- return stream
309
- end
310
-
311
- function ns.SerializeForExport(value)
312
- local stream = ns.CreateSerializationStream(value)
313
- local parts = {}
314
- repeat
315
- local chunk = stream:ReadChunk()
316
- if chunk ~= "" then
317
- parts[#parts + 1] = chunk
318
- end
319
- until stream:IsFinished()
320
- if stream.errorMessage then
321
- error(stream.errorMessage, 0)
322
- end
323
- return table.concat(parts), stream:WasLimited(), stream.errorMessage
324
- end
1
+ local ADDON_NAME, ns = ...
2
+
3
+ local DEFAULT_MAX_DEPTH = 6
4
+ local DEFAULT_MAX_ENTRIES = 200
5
+ local DEFAULT_MAX_OUTPUT_BYTES = 44000
6
+ local STREAM_CHUNK_BYTES = 44000
7
+ local STREAM_YIELD_BYTES = 4096
8
+ local STREAM_MAX_DEPTH = 32
9
+ local STREAM_MAX_ENTRIES = 10000
10
+ local STREAM_MAX_OUTPUT_BYTES = 16 * 1024 * 1024
11
+
12
+ local function SortKey(value)
13
+ if issecretvalue and issecretvalue(value) then
14
+ return "0:<secret>"
15
+ end
16
+
17
+ local valueType = type(value)
18
+ if valueType == "number" then
19
+ return "1:" .. tostring(value)
20
+ elseif valueType == "string" then
21
+ return "2:" .. value
22
+ elseif valueType == "boolean" then
23
+ return value and "3:1" or "3:0"
24
+ end
25
+ return "4:" .. valueType .. ":" .. tostring(value)
26
+ end
27
+
28
+ local function Append(state, text)
29
+ if state.truncated then
30
+ return
31
+ end
32
+
33
+ if state.length + #text > state.maxOutputBytes then
34
+ state.parts[#state.parts + 1] = "\n... <output truncated>"
35
+ state.truncated = true
36
+ state.incomplete = true
37
+ return
38
+ end
39
+
40
+ state.parts[#state.parts + 1] = text
41
+ state.length = state.length + #text
42
+ end
43
+
44
+ local function SerializeValue(value, state, depth, indent)
45
+ if state.truncated then
46
+ return
47
+ end
48
+
49
+ if issecretvalue and issecretvalue(value) then
50
+ Append(state, "<secret>")
51
+ return
52
+ end
53
+
54
+ local valueType = type(value)
55
+
56
+ if valueType == "string" then
57
+ Append(state, string.format("%q", value))
58
+ elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
59
+ Append(state, tostring(value))
60
+ elseif valueType ~= "table" then
61
+ Append(state, "<" .. valueType .. ": " .. tostring(value) .. ">")
62
+ elseif state.seen[value] then
63
+ Append(state, "<cycle>")
64
+ elseif depth >= state.maxDepth then
65
+ Append(state, "<max depth>")
66
+ state.incomplete = true
67
+ else
68
+ state.seen[value] = true
69
+
70
+ local keys = {}
71
+ local secretKeyCount = 0
72
+ for key in pairs(value) do
73
+ if issecretvalue and issecretvalue(key) then
74
+ secretKeyCount = secretKeyCount + 1
75
+ else
76
+ keys[#keys + 1] = key
77
+ end
78
+ end
79
+ table.sort(keys, function(left, right)
80
+ return SortKey(left) < SortKey(right)
81
+ end)
82
+
83
+ if #keys == 0 and secretKeyCount == 0 then
84
+ Append(state, "{}")
85
+ else
86
+ Append(state, "{")
87
+ local count = math.min(#keys, state.maxEntries)
88
+ for index = 1, count do
89
+ local key = keys[index]
90
+ Append(state, "\n" .. indent .. " [")
91
+ SerializeValue(key, state, depth + 1, indent .. " ")
92
+ Append(state, "] = ")
93
+ SerializeValue(value[key], state, depth + 1, indent .. " ")
94
+ Append(state, ",")
95
+ end
96
+ if #keys > state.maxEntries then
97
+ Append(state, "\n" .. indent .. " ... <" .. (#keys - state.maxEntries) .. " entries omitted>")
98
+ state.incomplete = true
99
+ end
100
+ if secretKeyCount > 0 then
101
+ Append(state, "\n" .. indent .. " ... <" .. secretKeyCount .. " secret keys omitted>")
102
+ end
103
+ Append(state, "\n" .. indent .. "}")
104
+ end
105
+
106
+ state.seen[value] = nil
107
+ end
108
+ end
109
+
110
+ local function SerializeWithLimits(value, maxDepth, maxEntries, maxOutputBytes)
111
+ local state = {
112
+ parts = {},
113
+ length = 0,
114
+ seen = {},
115
+ truncated = false,
116
+ incomplete = false,
117
+ maxDepth = maxDepth,
118
+ maxEntries = maxEntries,
119
+ maxOutputBytes = maxOutputBytes,
120
+ }
121
+ SerializeValue(value, state, 0, "")
122
+ return table.concat(state.parts), state.incomplete
123
+ end
124
+
125
+ function ns.Serialize(value)
126
+ return SerializeWithLimits(value, DEFAULT_MAX_DEPTH, DEFAULT_MAX_ENTRIES, DEFAULT_MAX_OUTPUT_BYTES)
127
+ end
128
+
129
+ function ns.SerializeValues(values)
130
+ local lines = {}
131
+ for index = 1, values.n do
132
+ lines[index] = "[" .. index .. "] = " .. ns.Serialize(values[index])
133
+ end
134
+ return table.concat(lines, "\n")
135
+ end
136
+
137
+ local function CreateStreamCoroutine(value, streamState)
138
+ return coroutine.create(function()
139
+ local parts = {}
140
+ local length = 0
141
+ local emitted = 0
142
+ local seen = {}
143
+ local stopped = false
144
+
145
+ local function Flush()
146
+ if length == 0 then
147
+ return
148
+ end
149
+ local text = table.concat(parts)
150
+ parts = {}
151
+ length = 0
152
+ emitted = emitted + #text
153
+ coroutine.yield(text)
154
+ end
155
+
156
+ local function Emit(text)
157
+ if stopped then
158
+ return false
159
+ end
160
+
161
+ local remaining = STREAM_MAX_OUTPUT_BYTES - emitted - length
162
+ if #text > remaining then
163
+ local marker = "\n... <output limit reached>"
164
+ local available = math.max(0, remaining - #marker)
165
+ if available > 0 then
166
+ parts[#parts + 1] = text:sub(1, available)
167
+ length = length + available
168
+ end
169
+ if remaining >= #marker then
170
+ parts[#parts + 1] = marker
171
+ length = length + #marker
172
+ end
173
+ streamState.limited = true
174
+ stopped = true
175
+ return false
176
+ end
177
+
178
+ parts[#parts + 1] = text
179
+ length = length + #text
180
+ if length >= STREAM_YIELD_BYTES then
181
+ Flush()
182
+ end
183
+ return true
184
+ end
185
+
186
+ local SerializeStreamValue
187
+ SerializeStreamValue = function(current, depth, indent)
188
+ if stopped then
189
+ return
190
+ elseif issecretvalue and issecretvalue(current) then
191
+ Emit("<secret>")
192
+ return
193
+ end
194
+
195
+ local valueType = type(current)
196
+ if valueType == "string" then
197
+ Emit(string.format("%q", current))
198
+ elseif valueType == "number" or valueType == "boolean" or valueType == "nil" then
199
+ Emit(tostring(current))
200
+ elseif valueType ~= "table" then
201
+ Emit("<" .. valueType .. ": " .. tostring(current) .. ">")
202
+ elseif seen[current] then
203
+ Emit("<cycle>")
204
+ elseif depth >= STREAM_MAX_DEPTH then
205
+ Emit("<max depth>")
206
+ streamState.limited = true
207
+ else
208
+ seen[current] = true
209
+ local keys = {}
210
+ local secretKeyCount = 0
211
+ for key in pairs(current) do
212
+ if issecretvalue and issecretvalue(key) then
213
+ secretKeyCount = secretKeyCount + 1
214
+ else
215
+ keys[#keys + 1] = key
216
+ end
217
+ end
218
+ table.sort(keys, function(left, right)
219
+ return SortKey(left) < SortKey(right)
220
+ end)
221
+
222
+ if #keys == 0 and secretKeyCount == 0 then
223
+ Emit("{}")
224
+ else
225
+ Emit("{")
226
+ local count = math.min(#keys, STREAM_MAX_ENTRIES)
227
+ for index = 1, count do
228
+ if stopped then
229
+ break
230
+ end
231
+ local key = keys[index]
232
+ Emit("\n" .. indent .. " [")
233
+ SerializeStreamValue(key, depth + 1, indent .. " ")
234
+ Emit("] = ")
235
+ SerializeStreamValue(current[key], depth + 1, indent .. " ")
236
+ Emit(",")
237
+ end
238
+ if not stopped and #keys > STREAM_MAX_ENTRIES then
239
+ Emit("\n" .. indent .. " ... <"
240
+ .. (#keys - STREAM_MAX_ENTRIES) .. " entries omitted>")
241
+ streamState.limited = true
242
+ end
243
+ if not stopped and secretKeyCount > 0 then
244
+ Emit("\n" .. indent .. " ... <"
245
+ .. secretKeyCount .. " secret keys omitted>")
246
+ end
247
+ if not stopped then
248
+ Emit("\n" .. indent .. "}")
249
+ end
250
+ end
251
+ seen[current] = nil
252
+ end
253
+ end
254
+
255
+ SerializeStreamValue(value, 0, "")
256
+ Flush()
257
+ end)
258
+ end
259
+
260
+ function ns.CreateSerializationStream(value)
261
+ local state = { limited = false }
262
+ local thread = CreateStreamCoroutine(value, state)
263
+ local stream = {
264
+ finished = false,
265
+ pending = "",
266
+ state = state,
267
+ }
268
+
269
+ function stream:ReadChunk(maxBytes)
270
+ maxBytes = math.max(1, math.floor(tonumber(maxBytes) or STREAM_CHUNK_BYTES))
271
+ local output = {}
272
+ local outputLength = 0
273
+
274
+ while outputLength < maxBytes and (self.pending ~= "" or not self.finished) do
275
+ if self.pending == "" then
276
+ local succeeded, segment = coroutine.resume(thread)
277
+ if not succeeded then
278
+ self.finished = true
279
+ self.state.limited = true
280
+ self.errorMessage = tostring(segment)
281
+ break
282
+ elseif coroutine.status(thread) == "dead" then
283
+ self.finished = true
284
+ break
285
+ end
286
+ self.pending = segment or ""
287
+ end
288
+
289
+ if self.pending ~= "" then
290
+ local take = math.min(#self.pending, maxBytes - outputLength)
291
+ output[#output + 1] = self.pending:sub(1, take)
292
+ self.pending = self.pending:sub(take + 1)
293
+ outputLength = outputLength + take
294
+ end
295
+ end
296
+
297
+ return table.concat(output), self.finished and self.pending == ""
298
+ end
299
+
300
+ function stream:IsFinished()
301
+ return self.finished and self.pending == ""
302
+ end
303
+
304
+ function stream:WasLimited()
305
+ return self.state.limited
306
+ end
307
+
308
+ return stream
309
+ end
310
+
311
+ function ns.SerializeForExport(value)
312
+ local stream = ns.CreateSerializationStream(value)
313
+ local parts = {}
314
+ repeat
315
+ local chunk = stream:ReadChunk()
316
+ if chunk ~= "" then
317
+ parts[#parts + 1] = chunk
318
+ end
319
+ until stream:IsFinished()
320
+ if stream.errorMessage then
321
+ error(stream.errorMessage, 0)
322
+ end
323
+ return table.concat(parts), stream:WasLimited(), stream.errorMessage
324
+ end