@linktr.ee/arbor-mcp 0.1.0 → 0.1.1-rc.021d585f.5625
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/dist/index.js +539 -21
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,485 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
3
8
|
var __commonJS = (cb, mod) => function __require() {
|
|
4
9
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
5
10
|
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
|
|
28
|
+
// ../../node_modules/lz-string/libs/lz-string.js
|
|
29
|
+
var require_lz_string = __commonJS({
|
|
30
|
+
"../../node_modules/lz-string/libs/lz-string.js"(exports, module) {
|
|
31
|
+
var LZString = (function() {
|
|
32
|
+
var f = String.fromCharCode;
|
|
33
|
+
var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
|
|
34
|
+
var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$";
|
|
35
|
+
var baseReverseDic = {};
|
|
36
|
+
function getBaseValue(alphabet, character) {
|
|
37
|
+
if (!baseReverseDic[alphabet]) {
|
|
38
|
+
baseReverseDic[alphabet] = {};
|
|
39
|
+
for (var i = 0; i < alphabet.length; i++) {
|
|
40
|
+
baseReverseDic[alphabet][alphabet.charAt(i)] = i;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return baseReverseDic[alphabet][character];
|
|
44
|
+
}
|
|
45
|
+
var LZString2 = {
|
|
46
|
+
compressToBase64: function(input) {
|
|
47
|
+
if (input == null) return "";
|
|
48
|
+
var res = LZString2._compress(input, 6, function(a) {
|
|
49
|
+
return keyStrBase64.charAt(a);
|
|
50
|
+
});
|
|
51
|
+
switch (res.length % 4) {
|
|
52
|
+
// To produce valid Base64
|
|
53
|
+
default:
|
|
54
|
+
// When could this happen ?
|
|
55
|
+
case 0:
|
|
56
|
+
return res;
|
|
57
|
+
case 1:
|
|
58
|
+
return res + "===";
|
|
59
|
+
case 2:
|
|
60
|
+
return res + "==";
|
|
61
|
+
case 3:
|
|
62
|
+
return res + "=";
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
decompressFromBase64: function(input) {
|
|
66
|
+
if (input == null) return "";
|
|
67
|
+
if (input == "") return null;
|
|
68
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
69
|
+
return getBaseValue(keyStrBase64, input.charAt(index));
|
|
70
|
+
});
|
|
71
|
+
},
|
|
72
|
+
compressToUTF16: function(input) {
|
|
73
|
+
if (input == null) return "";
|
|
74
|
+
return LZString2._compress(input, 15, function(a) {
|
|
75
|
+
return f(a + 32);
|
|
76
|
+
}) + " ";
|
|
77
|
+
},
|
|
78
|
+
decompressFromUTF16: function(compressed) {
|
|
79
|
+
if (compressed == null) return "";
|
|
80
|
+
if (compressed == "") return null;
|
|
81
|
+
return LZString2._decompress(compressed.length, 16384, function(index) {
|
|
82
|
+
return compressed.charCodeAt(index) - 32;
|
|
83
|
+
});
|
|
84
|
+
},
|
|
85
|
+
//compress into uint8array (UCS-2 big endian format)
|
|
86
|
+
compressToUint8Array: function(uncompressed) {
|
|
87
|
+
var compressed = LZString2.compress(uncompressed);
|
|
88
|
+
var buf = new Uint8Array(compressed.length * 2);
|
|
89
|
+
for (var i = 0, TotalLen = compressed.length; i < TotalLen; i++) {
|
|
90
|
+
var current_value = compressed.charCodeAt(i);
|
|
91
|
+
buf[i * 2] = current_value >>> 8;
|
|
92
|
+
buf[i * 2 + 1] = current_value % 256;
|
|
93
|
+
}
|
|
94
|
+
return buf;
|
|
95
|
+
},
|
|
96
|
+
//decompress from uint8array (UCS-2 big endian format)
|
|
97
|
+
decompressFromUint8Array: function(compressed) {
|
|
98
|
+
if (compressed === null || compressed === void 0) {
|
|
99
|
+
return LZString2.decompress(compressed);
|
|
100
|
+
} else {
|
|
101
|
+
var buf = new Array(compressed.length / 2);
|
|
102
|
+
for (var i = 0, TotalLen = buf.length; i < TotalLen; i++) {
|
|
103
|
+
buf[i] = compressed[i * 2] * 256 + compressed[i * 2 + 1];
|
|
104
|
+
}
|
|
105
|
+
var result = [];
|
|
106
|
+
buf.forEach(function(c) {
|
|
107
|
+
result.push(f(c));
|
|
108
|
+
});
|
|
109
|
+
return LZString2.decompress(result.join(""));
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
//compress into a string that is already URI encoded
|
|
113
|
+
compressToEncodedURIComponent: function(input) {
|
|
114
|
+
if (input == null) return "";
|
|
115
|
+
return LZString2._compress(input, 6, function(a) {
|
|
116
|
+
return keyStrUriSafe.charAt(a);
|
|
117
|
+
});
|
|
118
|
+
},
|
|
119
|
+
//decompress from an output of compressToEncodedURIComponent
|
|
120
|
+
decompressFromEncodedURIComponent: function(input) {
|
|
121
|
+
if (input == null) return "";
|
|
122
|
+
if (input == "") return null;
|
|
123
|
+
input = input.replace(/ /g, "+");
|
|
124
|
+
return LZString2._decompress(input.length, 32, function(index) {
|
|
125
|
+
return getBaseValue(keyStrUriSafe, input.charAt(index));
|
|
126
|
+
});
|
|
127
|
+
},
|
|
128
|
+
compress: function(uncompressed) {
|
|
129
|
+
return LZString2._compress(uncompressed, 16, function(a) {
|
|
130
|
+
return f(a);
|
|
131
|
+
});
|
|
132
|
+
},
|
|
133
|
+
_compress: function(uncompressed, bitsPerChar, getCharFromInt) {
|
|
134
|
+
if (uncompressed == null) return "";
|
|
135
|
+
var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii;
|
|
136
|
+
for (ii = 0; ii < uncompressed.length; ii += 1) {
|
|
137
|
+
context_c = uncompressed.charAt(ii);
|
|
138
|
+
if (!Object.prototype.hasOwnProperty.call(context_dictionary, context_c)) {
|
|
139
|
+
context_dictionary[context_c] = context_dictSize++;
|
|
140
|
+
context_dictionaryToCreate[context_c] = true;
|
|
141
|
+
}
|
|
142
|
+
context_wc = context_w + context_c;
|
|
143
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionary, context_wc)) {
|
|
144
|
+
context_w = context_wc;
|
|
145
|
+
} else {
|
|
146
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
147
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
148
|
+
for (i = 0; i < context_numBits; i++) {
|
|
149
|
+
context_data_val = context_data_val << 1;
|
|
150
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
151
|
+
context_data_position = 0;
|
|
152
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
153
|
+
context_data_val = 0;
|
|
154
|
+
} else {
|
|
155
|
+
context_data_position++;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
value = context_w.charCodeAt(0);
|
|
159
|
+
for (i = 0; i < 8; i++) {
|
|
160
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
161
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
162
|
+
context_data_position = 0;
|
|
163
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
164
|
+
context_data_val = 0;
|
|
165
|
+
} else {
|
|
166
|
+
context_data_position++;
|
|
167
|
+
}
|
|
168
|
+
value = value >> 1;
|
|
169
|
+
}
|
|
170
|
+
} else {
|
|
171
|
+
value = 1;
|
|
172
|
+
for (i = 0; i < context_numBits; i++) {
|
|
173
|
+
context_data_val = context_data_val << 1 | value;
|
|
174
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
175
|
+
context_data_position = 0;
|
|
176
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
177
|
+
context_data_val = 0;
|
|
178
|
+
} else {
|
|
179
|
+
context_data_position++;
|
|
180
|
+
}
|
|
181
|
+
value = 0;
|
|
182
|
+
}
|
|
183
|
+
value = context_w.charCodeAt(0);
|
|
184
|
+
for (i = 0; i < 16; i++) {
|
|
185
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
186
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
187
|
+
context_data_position = 0;
|
|
188
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
189
|
+
context_data_val = 0;
|
|
190
|
+
} else {
|
|
191
|
+
context_data_position++;
|
|
192
|
+
}
|
|
193
|
+
value = value >> 1;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
context_enlargeIn--;
|
|
197
|
+
if (context_enlargeIn == 0) {
|
|
198
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
199
|
+
context_numBits++;
|
|
200
|
+
}
|
|
201
|
+
delete context_dictionaryToCreate[context_w];
|
|
202
|
+
} else {
|
|
203
|
+
value = context_dictionary[context_w];
|
|
204
|
+
for (i = 0; i < context_numBits; i++) {
|
|
205
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
206
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
207
|
+
context_data_position = 0;
|
|
208
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
209
|
+
context_data_val = 0;
|
|
210
|
+
} else {
|
|
211
|
+
context_data_position++;
|
|
212
|
+
}
|
|
213
|
+
value = value >> 1;
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
context_enlargeIn--;
|
|
217
|
+
if (context_enlargeIn == 0) {
|
|
218
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
219
|
+
context_numBits++;
|
|
220
|
+
}
|
|
221
|
+
context_dictionary[context_wc] = context_dictSize++;
|
|
222
|
+
context_w = String(context_c);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (context_w !== "") {
|
|
226
|
+
if (Object.prototype.hasOwnProperty.call(context_dictionaryToCreate, context_w)) {
|
|
227
|
+
if (context_w.charCodeAt(0) < 256) {
|
|
228
|
+
for (i = 0; i < context_numBits; i++) {
|
|
229
|
+
context_data_val = context_data_val << 1;
|
|
230
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
231
|
+
context_data_position = 0;
|
|
232
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
233
|
+
context_data_val = 0;
|
|
234
|
+
} else {
|
|
235
|
+
context_data_position++;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
value = context_w.charCodeAt(0);
|
|
239
|
+
for (i = 0; i < 8; i++) {
|
|
240
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
241
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
242
|
+
context_data_position = 0;
|
|
243
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
244
|
+
context_data_val = 0;
|
|
245
|
+
} else {
|
|
246
|
+
context_data_position++;
|
|
247
|
+
}
|
|
248
|
+
value = value >> 1;
|
|
249
|
+
}
|
|
250
|
+
} else {
|
|
251
|
+
value = 1;
|
|
252
|
+
for (i = 0; i < context_numBits; i++) {
|
|
253
|
+
context_data_val = context_data_val << 1 | value;
|
|
254
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
255
|
+
context_data_position = 0;
|
|
256
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
257
|
+
context_data_val = 0;
|
|
258
|
+
} else {
|
|
259
|
+
context_data_position++;
|
|
260
|
+
}
|
|
261
|
+
value = 0;
|
|
262
|
+
}
|
|
263
|
+
value = context_w.charCodeAt(0);
|
|
264
|
+
for (i = 0; i < 16; i++) {
|
|
265
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
266
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
267
|
+
context_data_position = 0;
|
|
268
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
269
|
+
context_data_val = 0;
|
|
270
|
+
} else {
|
|
271
|
+
context_data_position++;
|
|
272
|
+
}
|
|
273
|
+
value = value >> 1;
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
context_enlargeIn--;
|
|
277
|
+
if (context_enlargeIn == 0) {
|
|
278
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
279
|
+
context_numBits++;
|
|
280
|
+
}
|
|
281
|
+
delete context_dictionaryToCreate[context_w];
|
|
282
|
+
} else {
|
|
283
|
+
value = context_dictionary[context_w];
|
|
284
|
+
for (i = 0; i < context_numBits; i++) {
|
|
285
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
286
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
287
|
+
context_data_position = 0;
|
|
288
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
289
|
+
context_data_val = 0;
|
|
290
|
+
} else {
|
|
291
|
+
context_data_position++;
|
|
292
|
+
}
|
|
293
|
+
value = value >> 1;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
context_enlargeIn--;
|
|
297
|
+
if (context_enlargeIn == 0) {
|
|
298
|
+
context_enlargeIn = Math.pow(2, context_numBits);
|
|
299
|
+
context_numBits++;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
value = 2;
|
|
303
|
+
for (i = 0; i < context_numBits; i++) {
|
|
304
|
+
context_data_val = context_data_val << 1 | value & 1;
|
|
305
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
306
|
+
context_data_position = 0;
|
|
307
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
308
|
+
context_data_val = 0;
|
|
309
|
+
} else {
|
|
310
|
+
context_data_position++;
|
|
311
|
+
}
|
|
312
|
+
value = value >> 1;
|
|
313
|
+
}
|
|
314
|
+
while (true) {
|
|
315
|
+
context_data_val = context_data_val << 1;
|
|
316
|
+
if (context_data_position == bitsPerChar - 1) {
|
|
317
|
+
context_data.push(getCharFromInt(context_data_val));
|
|
318
|
+
break;
|
|
319
|
+
} else context_data_position++;
|
|
320
|
+
}
|
|
321
|
+
return context_data.join("");
|
|
322
|
+
},
|
|
323
|
+
decompress: function(compressed) {
|
|
324
|
+
if (compressed == null) return "";
|
|
325
|
+
if (compressed == "") return null;
|
|
326
|
+
return LZString2._decompress(compressed.length, 32768, function(index) {
|
|
327
|
+
return compressed.charCodeAt(index);
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
_decompress: function(length, resetValue, getNextValue) {
|
|
331
|
+
var dictionary = [], next, enlargeIn = 4, dictSize = 4, numBits = 3, entry = "", result = [], i, w, bits, resb, maxpower, power, c, data = { val: getNextValue(0), position: resetValue, index: 1 };
|
|
332
|
+
for (i = 0; i < 3; i += 1) {
|
|
333
|
+
dictionary[i] = i;
|
|
334
|
+
}
|
|
335
|
+
bits = 0;
|
|
336
|
+
maxpower = Math.pow(2, 2);
|
|
337
|
+
power = 1;
|
|
338
|
+
while (power != maxpower) {
|
|
339
|
+
resb = data.val & data.position;
|
|
340
|
+
data.position >>= 1;
|
|
341
|
+
if (data.position == 0) {
|
|
342
|
+
data.position = resetValue;
|
|
343
|
+
data.val = getNextValue(data.index++);
|
|
344
|
+
}
|
|
345
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
346
|
+
power <<= 1;
|
|
347
|
+
}
|
|
348
|
+
switch (next = bits) {
|
|
349
|
+
case 0:
|
|
350
|
+
bits = 0;
|
|
351
|
+
maxpower = Math.pow(2, 8);
|
|
352
|
+
power = 1;
|
|
353
|
+
while (power != maxpower) {
|
|
354
|
+
resb = data.val & data.position;
|
|
355
|
+
data.position >>= 1;
|
|
356
|
+
if (data.position == 0) {
|
|
357
|
+
data.position = resetValue;
|
|
358
|
+
data.val = getNextValue(data.index++);
|
|
359
|
+
}
|
|
360
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
361
|
+
power <<= 1;
|
|
362
|
+
}
|
|
363
|
+
c = f(bits);
|
|
364
|
+
break;
|
|
365
|
+
case 1:
|
|
366
|
+
bits = 0;
|
|
367
|
+
maxpower = Math.pow(2, 16);
|
|
368
|
+
power = 1;
|
|
369
|
+
while (power != maxpower) {
|
|
370
|
+
resb = data.val & data.position;
|
|
371
|
+
data.position >>= 1;
|
|
372
|
+
if (data.position == 0) {
|
|
373
|
+
data.position = resetValue;
|
|
374
|
+
data.val = getNextValue(data.index++);
|
|
375
|
+
}
|
|
376
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
377
|
+
power <<= 1;
|
|
378
|
+
}
|
|
379
|
+
c = f(bits);
|
|
380
|
+
break;
|
|
381
|
+
case 2:
|
|
382
|
+
return "";
|
|
383
|
+
}
|
|
384
|
+
dictionary[3] = c;
|
|
385
|
+
w = c;
|
|
386
|
+
result.push(c);
|
|
387
|
+
while (true) {
|
|
388
|
+
if (data.index > length) {
|
|
389
|
+
return "";
|
|
390
|
+
}
|
|
391
|
+
bits = 0;
|
|
392
|
+
maxpower = Math.pow(2, numBits);
|
|
393
|
+
power = 1;
|
|
394
|
+
while (power != maxpower) {
|
|
395
|
+
resb = data.val & data.position;
|
|
396
|
+
data.position >>= 1;
|
|
397
|
+
if (data.position == 0) {
|
|
398
|
+
data.position = resetValue;
|
|
399
|
+
data.val = getNextValue(data.index++);
|
|
400
|
+
}
|
|
401
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
402
|
+
power <<= 1;
|
|
403
|
+
}
|
|
404
|
+
switch (c = bits) {
|
|
405
|
+
case 0:
|
|
406
|
+
bits = 0;
|
|
407
|
+
maxpower = Math.pow(2, 8);
|
|
408
|
+
power = 1;
|
|
409
|
+
while (power != maxpower) {
|
|
410
|
+
resb = data.val & data.position;
|
|
411
|
+
data.position >>= 1;
|
|
412
|
+
if (data.position == 0) {
|
|
413
|
+
data.position = resetValue;
|
|
414
|
+
data.val = getNextValue(data.index++);
|
|
415
|
+
}
|
|
416
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
417
|
+
power <<= 1;
|
|
418
|
+
}
|
|
419
|
+
dictionary[dictSize++] = f(bits);
|
|
420
|
+
c = dictSize - 1;
|
|
421
|
+
enlargeIn--;
|
|
422
|
+
break;
|
|
423
|
+
case 1:
|
|
424
|
+
bits = 0;
|
|
425
|
+
maxpower = Math.pow(2, 16);
|
|
426
|
+
power = 1;
|
|
427
|
+
while (power != maxpower) {
|
|
428
|
+
resb = data.val & data.position;
|
|
429
|
+
data.position >>= 1;
|
|
430
|
+
if (data.position == 0) {
|
|
431
|
+
data.position = resetValue;
|
|
432
|
+
data.val = getNextValue(data.index++);
|
|
433
|
+
}
|
|
434
|
+
bits |= (resb > 0 ? 1 : 0) * power;
|
|
435
|
+
power <<= 1;
|
|
436
|
+
}
|
|
437
|
+
dictionary[dictSize++] = f(bits);
|
|
438
|
+
c = dictSize - 1;
|
|
439
|
+
enlargeIn--;
|
|
440
|
+
break;
|
|
441
|
+
case 2:
|
|
442
|
+
return result.join("");
|
|
443
|
+
}
|
|
444
|
+
if (enlargeIn == 0) {
|
|
445
|
+
enlargeIn = Math.pow(2, numBits);
|
|
446
|
+
numBits++;
|
|
447
|
+
}
|
|
448
|
+
if (dictionary[c]) {
|
|
449
|
+
entry = dictionary[c];
|
|
450
|
+
} else {
|
|
451
|
+
if (c === dictSize) {
|
|
452
|
+
entry = w + w.charAt(0);
|
|
453
|
+
} else {
|
|
454
|
+
return null;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
result.push(entry);
|
|
458
|
+
dictionary[dictSize++] = w + entry.charAt(0);
|
|
459
|
+
enlargeIn--;
|
|
460
|
+
w = entry;
|
|
461
|
+
if (enlargeIn == 0) {
|
|
462
|
+
enlargeIn = Math.pow(2, numBits);
|
|
463
|
+
numBits++;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
}
|
|
467
|
+
};
|
|
468
|
+
return LZString2;
|
|
469
|
+
})();
|
|
470
|
+
if (typeof define === "function" && define.amd) {
|
|
471
|
+
define(function() {
|
|
472
|
+
return LZString;
|
|
473
|
+
});
|
|
474
|
+
} else if (typeof module !== "undefined" && module != null) {
|
|
475
|
+
module.exports = LZString;
|
|
476
|
+
} else if (typeof angular !== "undefined" && angular != null) {
|
|
477
|
+
angular.module("LZString", []).factory("LZString", function() {
|
|
478
|
+
return LZString;
|
|
479
|
+
});
|
|
480
|
+
}
|
|
481
|
+
}
|
|
482
|
+
});
|
|
6
483
|
|
|
7
484
|
// ../../apps/playroom/src/hash-code.js
|
|
8
485
|
var require_hash_code = __commonJS({
|
|
@@ -35,7 +512,7 @@ import {
|
|
|
35
512
|
} from "@modelcontextprotocol/sdk/types.js";
|
|
36
513
|
|
|
37
514
|
// ../../apps/playroom/src/canonical-snippet-lookup.ts
|
|
38
|
-
|
|
515
|
+
var import_lz_string = __toESM(require_lz_string());
|
|
39
516
|
|
|
40
517
|
// ../../apps/playroom/src/compositions.ts
|
|
41
518
|
var compositions_default = [
|
|
@@ -103,6 +580,20 @@ var compositions_default = [
|
|
|
103
580
|
<AvatarGroupCount count={5} size="sm" />
|
|
104
581
|
</AvatarGroup>`
|
|
105
582
|
},
|
|
583
|
+
// ── Backdrop ──
|
|
584
|
+
// Maps to figma-mappings `Backdrop` (node 11643-116065). DNG-196 follow-up of DNG-50.
|
|
585
|
+
// Default = dark scrim (matches production parity for Dialog/Drawer);
|
|
586
|
+
// `inverted` flips to light scrim for dark surfaces.
|
|
587
|
+
{
|
|
588
|
+
group: "Backdrop",
|
|
589
|
+
name: "Backdrop",
|
|
590
|
+
code: "<Backdrop />"
|
|
591
|
+
},
|
|
592
|
+
{
|
|
593
|
+
group: "Backdrop",
|
|
594
|
+
name: "Backdrop (inverted)",
|
|
595
|
+
code: "<Backdrop inverted />"
|
|
596
|
+
},
|
|
106
597
|
// ── Badge ──
|
|
107
598
|
{
|
|
108
599
|
group: "Badge",
|
|
@@ -897,35 +1388,51 @@ function findCanonicalEntryByGroup(group) {
|
|
|
897
1388
|
return null;
|
|
898
1389
|
}
|
|
899
1390
|
function buildPlayroomUrl(jsx) {
|
|
900
|
-
const compressed = compressToEncodedURIComponent(
|
|
1391
|
+
const compressed = (0, import_lz_string.compressToEncodedURIComponent)(
|
|
901
1392
|
JSON.stringify({ code: jsx })
|
|
902
1393
|
);
|
|
903
1394
|
return `${PLAYROOM_HOMEPAGE_URL}#?code=${compressed}`;
|
|
904
1395
|
}
|
|
905
|
-
async function mintPlayroomUrl(jsx, slugClient) {
|
|
1396
|
+
async function mintPlayroomUrl(jsx, slugClient, opts) {
|
|
1397
|
+
const title = typeof opts?.title === "string" && opts.title.length > 0 ? opts.title : void 0;
|
|
1398
|
+
const derivedTitleAtSave = typeof opts?.derivedTitleAtSave === "string" && opts.derivedTitleAtSave.length > 0 ? opts.derivedTitleAtSave : void 0;
|
|
906
1399
|
let result;
|
|
907
1400
|
try {
|
|
908
|
-
|
|
1401
|
+
const mintOpts = title === void 0 ? void 0 : derivedTitleAtSave === void 0 ? { title } : { title, derivedTitleAtSave };
|
|
1402
|
+
result = await slugClient.mintOrReuse(jsx, mintOpts);
|
|
909
1403
|
} catch {
|
|
910
1404
|
return {
|
|
911
|
-
url: buildPlayroomUrl(jsx),
|
|
1405
|
+
url: appendTitleParam(buildPlayroomUrl(jsx), title),
|
|
912
1406
|
source: "lz-string-fallback",
|
|
913
1407
|
reason: "network"
|
|
914
1408
|
};
|
|
915
1409
|
}
|
|
916
1410
|
if (result.ok) {
|
|
917
1411
|
return {
|
|
918
|
-
url: result.url,
|
|
1412
|
+
url: appendTitleParam(result.url, title),
|
|
919
1413
|
source: result.source,
|
|
920
1414
|
slug: result.slug
|
|
921
1415
|
};
|
|
922
1416
|
}
|
|
923
1417
|
return {
|
|
924
|
-
url: buildPlayroomUrl(jsx),
|
|
1418
|
+
url: appendTitleParam(buildPlayroomUrl(jsx), title),
|
|
925
1419
|
source: "lz-string-fallback",
|
|
926
1420
|
reason: result.reason
|
|
927
1421
|
};
|
|
928
1422
|
}
|
|
1423
|
+
function appendTitleParam(url, title) {
|
|
1424
|
+
if (!title) return url;
|
|
1425
|
+
const encoded = encodeURIComponent(title);
|
|
1426
|
+
const hashIdx = url.indexOf("#");
|
|
1427
|
+
if (hashIdx === -1) {
|
|
1428
|
+
const sep2 = url.indexOf("?") === -1 ? "?" : "&";
|
|
1429
|
+
return `${url}${sep2}title=${encoded}`;
|
|
1430
|
+
}
|
|
1431
|
+
const before = url.slice(0, hashIdx);
|
|
1432
|
+
const hash = url.slice(hashIdx);
|
|
1433
|
+
const sep = before.indexOf("?") === -1 ? "?" : "&";
|
|
1434
|
+
return `${before}${sep}title=${encoded}${hash}`;
|
|
1435
|
+
}
|
|
929
1436
|
function lookupByArborName(arborName) {
|
|
930
1437
|
const normalized = typeof arborName === "string" ? arborName.trim() : "";
|
|
931
1438
|
if (!normalized) {
|
|
@@ -990,7 +1497,7 @@ function createSlugClient(opts) {
|
|
|
990
1497
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
991
1498
|
const endpointUrl = opts.endpoint.toString();
|
|
992
1499
|
const inflight = /* @__PURE__ */ new Map();
|
|
993
|
-
async function performMint(jsx, key) {
|
|
1500
|
+
async function performMint(jsx, key, mintOpts) {
|
|
994
1501
|
const controller = new AbortController();
|
|
995
1502
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
|
996
1503
|
const headers = {
|
|
@@ -1002,12 +1509,19 @@ function createSlugClient(opts) {
|
|
|
1002
1509
|
if (opts.producerName) {
|
|
1003
1510
|
headers["X-Arbor-Producer"] = opts.producerName;
|
|
1004
1511
|
}
|
|
1512
|
+
const requestBody = { snippet: jsx };
|
|
1513
|
+
if (mintOpts && typeof mintOpts.title === "string" && mintOpts.title.length > 0) {
|
|
1514
|
+
requestBody.title = mintOpts.title;
|
|
1515
|
+
if (typeof mintOpts.derivedTitleAtSave === "string" && mintOpts.derivedTitleAtSave.length > 0) {
|
|
1516
|
+
requestBody.derivedTitleAtSave = mintOpts.derivedTitleAtSave;
|
|
1517
|
+
}
|
|
1518
|
+
}
|
|
1005
1519
|
let response;
|
|
1006
1520
|
try {
|
|
1007
1521
|
response = await fetchImpl(endpointUrl, {
|
|
1008
1522
|
method: "POST",
|
|
1009
1523
|
headers,
|
|
1010
|
-
body: JSON.stringify(
|
|
1524
|
+
body: JSON.stringify(requestBody),
|
|
1011
1525
|
signal: controller.signal
|
|
1012
1526
|
});
|
|
1013
1527
|
} catch (err) {
|
|
@@ -1034,24 +1548,28 @@ function createSlugClient(opts) {
|
|
|
1034
1548
|
cache.set(key, branded);
|
|
1035
1549
|
return { ok: true, source: "minted", slug: branded, url };
|
|
1036
1550
|
}
|
|
1037
|
-
async function mintOrReuse(jsx) {
|
|
1551
|
+
async function mintOrReuse(jsx, mintOpts) {
|
|
1038
1552
|
const byteLength = new TextEncoder().encode(jsx).length;
|
|
1039
1553
|
if (byteLength > MAX_SNIPPET_BYTES) {
|
|
1040
1554
|
return { ok: false, reason: "oversize" };
|
|
1041
1555
|
}
|
|
1042
1556
|
const key = hashCode(jsx);
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
const
|
|
1046
|
-
|
|
1557
|
+
const hasTitleOverride = typeof mintOpts?.title === "string" && mintOpts.title.length > 0;
|
|
1558
|
+
if (!hasTitleOverride) {
|
|
1559
|
+
const cached = cache.get(key);
|
|
1560
|
+
if (cached) {
|
|
1561
|
+
const url = `${PLAYROOM_BASE_URL}?slug=${cached}`;
|
|
1562
|
+
return { ok: true, source: "cached", slug: cached, url };
|
|
1563
|
+
}
|
|
1564
|
+
const existing = inflight.get(key);
|
|
1565
|
+
if (existing) return existing;
|
|
1566
|
+
const promise = performMint(jsx, key, mintOpts).finally(() => {
|
|
1567
|
+
inflight.delete(key);
|
|
1568
|
+
});
|
|
1569
|
+
inflight.set(key, promise);
|
|
1570
|
+
return promise;
|
|
1047
1571
|
}
|
|
1048
|
-
|
|
1049
|
-
if (existing) return existing;
|
|
1050
|
-
const promise = performMint(jsx, key).finally(() => {
|
|
1051
|
-
inflight.delete(key);
|
|
1052
|
-
});
|
|
1053
|
-
inflight.set(key, promise);
|
|
1054
|
-
return promise;
|
|
1572
|
+
return performMint(jsx, key, mintOpts);
|
|
1055
1573
|
}
|
|
1056
1574
|
return { mintOrReuse };
|
|
1057
1575
|
}
|