@dv.nghiem/flowdeck 0.3.7 → 0.3.8

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.
@@ -1,35 +1,5 @@
1
1
  // @bun
2
- var __create = Object.create;
3
- var __getProtoOf = Object.getPrototypeOf;
4
2
  var __defProp = Object.defineProperty;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- function __accessProp(key) {
8
- return this[key];
9
- }
10
- var __toESMCache_node;
11
- var __toESMCache_esm;
12
- var __toESM = (mod, isNodeMode, target) => {
13
- var canCache = mod != null && typeof mod === "object";
14
- if (canCache) {
15
- var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
16
- var cached = cache.get(mod);
17
- if (cached)
18
- return cached;
19
- }
20
- target = mod != null ? __create(__getProtoOf(mod)) : {};
21
- const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
22
- for (let key of __getOwnPropNames(mod))
23
- if (!__hasOwnProp.call(to, key))
24
- __defProp(to, key, {
25
- get: __accessProp.bind(mod, key),
26
- enumerable: true
27
- });
28
- if (canCache)
29
- cache.set(mod, to);
30
- return to;
31
- };
32
- var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
33
3
  var __returnValue = (v) => v;
34
4
  function __exportSetter(name, newValue) {
35
5
  this[name] = __returnValue.bind(null, newValue);
@@ -43,770 +13,11 @@ var __export = (target, all) => {
43
13
  set: __exportSetter.bind(all, name)
44
14
  });
45
15
  };
46
- var __require = import.meta.require;
47
-
48
- // node_modules/ejs/lib/utils.js
49
- var require_utils = __commonJS((exports) => {
50
- var regExpChars = /[|\\{}()[\]^$+*?.]/g;
51
- var hasOwnProperty = Object.prototype.hasOwnProperty;
52
- var hasOwn = function(obj, key) {
53
- return hasOwnProperty.apply(obj, [key]);
54
- };
55
- exports.escapeRegExpChars = function(string4) {
56
- if (!string4) {
57
- return "";
58
- }
59
- return String(string4).replace(regExpChars, "\\$&");
60
- };
61
- var _ENCODE_HTML_RULES = {
62
- "&": "&",
63
- "<": "&lt;",
64
- ">": "&gt;",
65
- '"': "&#34;",
66
- "'": "&#39;"
67
- };
68
- var _MATCH_HTML = /[&<>'"]/g;
69
- function encode_char(c) {
70
- return _ENCODE_HTML_RULES[c] || c;
71
- }
72
- var escapeFuncStr = `var _ENCODE_HTML_RULES = {
73
- ` + ` "&": "&amp;"
74
- ` + ` , "<": "&lt;"
75
- ` + ` , ">": "&gt;"
76
- ` + ` , '"': "&#34;"
77
- ` + ` , "'": "&#39;"
78
- ` + ` }
79
- ` + ` , _MATCH_HTML = /[&<>'"]/g;
80
- ` + `function encode_char(c) {
81
- ` + ` return _ENCODE_HTML_RULES[c] || c;
82
- ` + `};
83
- `;
84
- exports.escapeXML = function(markup) {
85
- return markup == undefined ? "" : String(markup).replace(_MATCH_HTML, encode_char);
86
- };
87
- function escapeXMLToString() {
88
- return Function.prototype.toString.call(this) + `;
89
- ` + escapeFuncStr;
90
- }
91
- try {
92
- if (typeof Object.defineProperty === "function") {
93
- Object.defineProperty(exports.escapeXML, "toString", { value: escapeXMLToString });
94
- } else {
95
- exports.escapeXML.toString = escapeXMLToString;
96
- }
97
- } catch (err) {
98
- console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
99
- }
100
- exports.shallowCopy = function(to, from) {
101
- from = from || {};
102
- if (to !== null && to !== undefined) {
103
- for (var p in from) {
104
- if (!hasOwn(from, p)) {
105
- continue;
106
- }
107
- if (p === "__proto__" || p === "constructor") {
108
- continue;
109
- }
110
- to[p] = from[p];
111
- }
112
- }
113
- return to;
114
- };
115
- exports.shallowCopyFromList = function(to, from, list) {
116
- list = list || [];
117
- from = from || {};
118
- if (to !== null && to !== undefined) {
119
- for (var i = 0;i < list.length; i++) {
120
- var p = list[i];
121
- if (typeof from[p] != "undefined") {
122
- if (!hasOwn(from, p)) {
123
- continue;
124
- }
125
- if (p === "__proto__" || p === "constructor") {
126
- continue;
127
- }
128
- to[p] = from[p];
129
- }
130
- }
131
- }
132
- return to;
133
- };
134
- exports.cache = {
135
- _data: {},
136
- set: function(key, val) {
137
- this._data[key] = val;
138
- },
139
- get: function(key) {
140
- return this._data[key];
141
- },
142
- remove: function(key) {
143
- delete this._data[key];
144
- },
145
- reset: function() {
146
- this._data = {};
147
- }
148
- };
149
- exports.hyphenToCamel = function(str) {
150
- return str.replace(/-[a-z]/g, function(match) {
151
- return match[1].toUpperCase();
152
- });
153
- };
154
- exports.createNullProtoObjWherePossible = function() {
155
- if (typeof Object.create == "function") {
156
- return function() {
157
- return Object.create(null);
158
- };
159
- }
160
- if (!({ __proto__: null } instanceof Object)) {
161
- return function() {
162
- return { __proto__: null };
163
- };
164
- }
165
- return function() {
166
- return {};
167
- };
168
- }();
169
- exports.hasOwnOnlyObject = function(obj) {
170
- var o = exports.createNullProtoObjWherePossible();
171
- for (var p in obj) {
172
- if (hasOwn(obj, p)) {
173
- o[p] = obj[p];
174
- }
175
- }
176
- return o;
177
- };
178
- });
179
-
180
- // node_modules/ejs/package.json
181
- var require_package = __commonJS((exports, module) => {
182
- module.exports = {
183
- name: "ejs",
184
- description: "Embedded JavaScript templates",
185
- keywords: [
186
- "template",
187
- "engine",
188
- "ejs"
189
- ],
190
- version: "3.1.10",
191
- author: "Matthew Eernisse <mde@fleegix.org> (http://fleegix.org)",
192
- license: "Apache-2.0",
193
- bin: {
194
- ejs: "./bin/cli.js"
195
- },
196
- main: "./lib/ejs.js",
197
- jsdelivr: "ejs.min.js",
198
- unpkg: "ejs.min.js",
199
- repository: {
200
- type: "git",
201
- url: "git://github.com/mde/ejs.git"
202
- },
203
- bugs: "https://github.com/mde/ejs/issues",
204
- homepage: "https://github.com/mde/ejs",
205
- dependencies: {
206
- jake: "^10.8.5"
207
- },
208
- devDependencies: {
209
- browserify: "^16.5.1",
210
- eslint: "^6.8.0",
211
- "git-directory-deploy": "^1.5.1",
212
- jsdoc: "^4.0.2",
213
- "lru-cache": "^4.0.1",
214
- mocha: "^10.2.0",
215
- "uglify-js": "^3.3.16"
216
- },
217
- engines: {
218
- node: ">=0.10.0"
219
- },
220
- scripts: {
221
- test: "npx jake test"
222
- }
223
- };
224
- });
225
-
226
- // node_modules/ejs/lib/ejs.js
227
- var require_ejs = __commonJS((exports) => {
228
- var fs = __require("fs");
229
- var path = __require("path");
230
- var utils = require_utils();
231
- var scopeOptionWarned = false;
232
- var _VERSION_STRING = require_package().version;
233
- var _DEFAULT_OPEN_DELIMITER = "<";
234
- var _DEFAULT_CLOSE_DELIMITER = ">";
235
- var _DEFAULT_DELIMITER = "%";
236
- var _DEFAULT_LOCALS_NAME = "locals";
237
- var _NAME = "ejs";
238
- var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
239
- var _OPTS_PASSABLE_WITH_DATA = [
240
- "delimiter",
241
- "scope",
242
- "context",
243
- "debug",
244
- "compileDebug",
245
- "client",
246
- "_with",
247
- "rmWhitespace",
248
- "strict",
249
- "filename",
250
- "async"
251
- ];
252
- var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
253
- var _BOM = /^\uFEFF/;
254
- var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
255
- exports.cache = utils.cache;
256
- exports.fileLoader = fs.readFileSync;
257
- exports.localsName = _DEFAULT_LOCALS_NAME;
258
- exports.promiseImpl = new Function("return this;")().Promise;
259
- exports.resolveInclude = function(name, filename, isDir) {
260
- var dirname2 = path.dirname;
261
- var extname = path.extname;
262
- var resolve2 = path.resolve;
263
- var includePath = resolve2(isDir ? filename : dirname2(filename), name);
264
- var ext = extname(name);
265
- if (!ext) {
266
- includePath += ".ejs";
267
- }
268
- return includePath;
269
- };
270
- function resolvePaths(name, paths) {
271
- var filePath;
272
- if (paths.some(function(v) {
273
- filePath = exports.resolveInclude(name, v, true);
274
- return fs.existsSync(filePath);
275
- })) {
276
- return filePath;
277
- }
278
- }
279
- function getIncludePath(path2, options) {
280
- var includePath;
281
- var filePath;
282
- var views = options.views;
283
- var match = /^[A-Za-z]+:\\|^\//.exec(path2);
284
- if (match && match.length) {
285
- path2 = path2.replace(/^\/*/, "");
286
- if (Array.isArray(options.root)) {
287
- includePath = resolvePaths(path2, options.root);
288
- } else {
289
- includePath = exports.resolveInclude(path2, options.root || "/", true);
290
- }
291
- } else {
292
- if (options.filename) {
293
- filePath = exports.resolveInclude(path2, options.filename);
294
- if (fs.existsSync(filePath)) {
295
- includePath = filePath;
296
- }
297
- }
298
- if (!includePath && Array.isArray(views)) {
299
- includePath = resolvePaths(path2, views);
300
- }
301
- if (!includePath && typeof options.includer !== "function") {
302
- throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
303
- }
304
- }
305
- return includePath;
306
- }
307
- function handleCache(options, template) {
308
- var func;
309
- var filename = options.filename;
310
- var hasTemplate = arguments.length > 1;
311
- if (options.cache) {
312
- if (!filename) {
313
- throw new Error("cache option requires a filename");
314
- }
315
- func = exports.cache.get(filename);
316
- if (func) {
317
- return func;
318
- }
319
- if (!hasTemplate) {
320
- template = fileLoader(filename).toString().replace(_BOM, "");
321
- }
322
- } else if (!hasTemplate) {
323
- if (!filename) {
324
- throw new Error("Internal EJS error: no file name or template " + "provided");
325
- }
326
- template = fileLoader(filename).toString().replace(_BOM, "");
327
- }
328
- func = exports.compile(template, options);
329
- if (options.cache) {
330
- exports.cache.set(filename, func);
331
- }
332
- return func;
333
- }
334
- function tryHandleCache(options, data, cb) {
335
- var result;
336
- if (!cb) {
337
- if (typeof exports.promiseImpl == "function") {
338
- return new exports.promiseImpl(function(resolve2, reject) {
339
- try {
340
- result = handleCache(options)(data);
341
- resolve2(result);
342
- } catch (err) {
343
- reject(err);
344
- }
345
- });
346
- } else {
347
- throw new Error("Please provide a callback function");
348
- }
349
- } else {
350
- try {
351
- result = handleCache(options)(data);
352
- } catch (err) {
353
- return cb(err);
354
- }
355
- cb(null, result);
356
- }
357
- }
358
- function fileLoader(filePath) {
359
- return exports.fileLoader(filePath);
360
- }
361
- function includeFile(path2, options) {
362
- var opts = utils.shallowCopy(utils.createNullProtoObjWherePossible(), options);
363
- opts.filename = getIncludePath(path2, opts);
364
- if (typeof options.includer === "function") {
365
- var includerResult = options.includer(path2, opts.filename);
366
- if (includerResult) {
367
- if (includerResult.filename) {
368
- opts.filename = includerResult.filename;
369
- }
370
- if (includerResult.template) {
371
- return handleCache(opts, includerResult.template);
372
- }
373
- }
374
- }
375
- return handleCache(opts);
376
- }
377
- function rethrow(err, str, flnm, lineno, esc2) {
378
- var lines = str.split(`
379
- `);
380
- var start = Math.max(lineno - 3, 0);
381
- var end = Math.min(lines.length, lineno + 3);
382
- var filename = esc2(flnm);
383
- var context = lines.slice(start, end).map(function(line, i) {
384
- var curr = i + start + 1;
385
- return (curr == lineno ? " >> " : " ") + curr + "| " + line;
386
- }).join(`
387
- `);
388
- err.path = filename;
389
- err.message = (filename || "ejs") + ":" + lineno + `
390
- ` + context + `
391
-
392
- ` + err.message;
393
- throw err;
394
- }
395
- function stripSemi(str) {
396
- return str.replace(/;(\s*$)/, "$1");
397
- }
398
- exports.compile = function compile(template, opts) {
399
- var templ;
400
- if (opts && opts.scope) {
401
- if (!scopeOptionWarned) {
402
- console.warn("`scope` option is deprecated and will be removed in EJS 3");
403
- scopeOptionWarned = true;
404
- }
405
- if (!opts.context) {
406
- opts.context = opts.scope;
407
- }
408
- delete opts.scope;
409
- }
410
- templ = new Template(template, opts);
411
- return templ.compile();
412
- };
413
- exports.render = function(template, d, o) {
414
- var data = d || utils.createNullProtoObjWherePossible();
415
- var opts = o || utils.createNullProtoObjWherePossible();
416
- if (arguments.length == 2) {
417
- utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
418
- }
419
- return handleCache(opts, template)(data);
420
- };
421
- exports.renderFile = function() {
422
- var args = Array.prototype.slice.call(arguments);
423
- var filename = args.shift();
424
- var cb;
425
- var opts = { filename };
426
- var data;
427
- var viewOpts;
428
- if (typeof arguments[arguments.length - 1] == "function") {
429
- cb = args.pop();
430
- }
431
- if (args.length) {
432
- data = args.shift();
433
- if (args.length) {
434
- utils.shallowCopy(opts, args.pop());
435
- } else {
436
- if (data.settings) {
437
- if (data.settings.views) {
438
- opts.views = data.settings.views;
439
- }
440
- if (data.settings["view cache"]) {
441
- opts.cache = true;
442
- }
443
- viewOpts = data.settings["view options"];
444
- if (viewOpts) {
445
- utils.shallowCopy(opts, viewOpts);
446
- }
447
- }
448
- utils.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
449
- }
450
- opts.filename = filename;
451
- } else {
452
- data = utils.createNullProtoObjWherePossible();
453
- }
454
- return tryHandleCache(opts, data, cb);
455
- };
456
- exports.Template = Template;
457
- exports.clearCache = function() {
458
- exports.cache.reset();
459
- };
460
- function Template(text, optsParam) {
461
- var opts = utils.hasOwnOnlyObject(optsParam);
462
- var options = utils.createNullProtoObjWherePossible();
463
- this.templateText = text;
464
- this.mode = null;
465
- this.truncate = false;
466
- this.currentLine = 1;
467
- this.source = "";
468
- options.client = opts.client || false;
469
- options.escapeFunction = opts.escape || opts.escapeFunction || utils.escapeXML;
470
- options.compileDebug = opts.compileDebug !== false;
471
- options.debug = !!opts.debug;
472
- options.filename = opts.filename;
473
- options.openDelimiter = opts.openDelimiter || exports.openDelimiter || _DEFAULT_OPEN_DELIMITER;
474
- options.closeDelimiter = opts.closeDelimiter || exports.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
475
- options.delimiter = opts.delimiter || exports.delimiter || _DEFAULT_DELIMITER;
476
- options.strict = opts.strict || false;
477
- options.context = opts.context;
478
- options.cache = opts.cache || false;
479
- options.rmWhitespace = opts.rmWhitespace;
480
- options.root = opts.root;
481
- options.includer = opts.includer;
482
- options.outputFunctionName = opts.outputFunctionName;
483
- options.localsName = opts.localsName || exports.localsName || _DEFAULT_LOCALS_NAME;
484
- options.views = opts.views;
485
- options.async = opts.async;
486
- options.destructuredLocals = opts.destructuredLocals;
487
- options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
488
- if (options.strict) {
489
- options._with = false;
490
- } else {
491
- options._with = typeof opts._with != "undefined" ? opts._with : true;
492
- }
493
- this.opts = options;
494
- this.regex = this.createRegex();
495
- }
496
- Template.modes = {
497
- EVAL: "eval",
498
- ESCAPED: "escaped",
499
- RAW: "raw",
500
- COMMENT: "comment",
501
- LITERAL: "literal"
502
- };
503
- Template.prototype = {
504
- createRegex: function() {
505
- var str = _REGEX_STRING;
506
- var delim = utils.escapeRegExpChars(this.opts.delimiter);
507
- var open = utils.escapeRegExpChars(this.opts.openDelimiter);
508
- var close = utils.escapeRegExpChars(this.opts.closeDelimiter);
509
- str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
510
- return new RegExp(str);
511
- },
512
- compile: function() {
513
- var src;
514
- var fn;
515
- var opts = this.opts;
516
- var prepended = "";
517
- var appended = "";
518
- var escapeFn = opts.escapeFunction;
519
- var ctor;
520
- var sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
521
- if (!this.source) {
522
- this.generateSource();
523
- prepended += ` var __output = "";
524
- ` + ` function __append(s) { if (s !== undefined && s !== null) __output += s }
525
- `;
526
- if (opts.outputFunctionName) {
527
- if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
528
- throw new Error("outputFunctionName is not a valid JS identifier.");
529
- }
530
- prepended += " var " + opts.outputFunctionName + " = __append;" + `
531
- `;
532
- }
533
- if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
534
- throw new Error("localsName is not a valid JS identifier.");
535
- }
536
- if (opts.destructuredLocals && opts.destructuredLocals.length) {
537
- var destructuring = " var __locals = (" + opts.localsName + ` || {}),
538
- `;
539
- for (var i = 0;i < opts.destructuredLocals.length; i++) {
540
- var name = opts.destructuredLocals[i];
541
- if (!_JS_IDENTIFIER.test(name)) {
542
- throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
543
- }
544
- if (i > 0) {
545
- destructuring += `,
546
- `;
547
- }
548
- destructuring += name + " = __locals." + name;
549
- }
550
- prepended += destructuring + `;
551
- `;
552
- }
553
- if (opts._with !== false) {
554
- prepended += " with (" + opts.localsName + " || {}) {" + `
555
- `;
556
- appended += " }" + `
557
- `;
558
- }
559
- appended += " return __output;" + `
560
- `;
561
- this.source = prepended + this.source + appended;
562
- }
563
- if (opts.compileDebug) {
564
- src = "var __line = 1" + `
565
- ` + " , __lines = " + JSON.stringify(this.templateText) + `
566
- ` + " , __filename = " + sanitizedFilename + ";" + `
567
- ` + "try {" + `
568
- ` + this.source + "} catch (e) {" + `
569
- ` + " rethrow(e, __lines, __filename, __line, escapeFn);" + `
570
- ` + "}" + `
571
- `;
572
- } else {
573
- src = this.source;
574
- }
575
- if (opts.client) {
576
- src = "escapeFn = escapeFn || " + escapeFn.toString() + ";" + `
577
- ` + src;
578
- if (opts.compileDebug) {
579
- src = "rethrow = rethrow || " + rethrow.toString() + ";" + `
580
- ` + src;
581
- }
582
- }
583
- if (opts.strict) {
584
- src = `"use strict";
585
- ` + src;
586
- }
587
- if (opts.debug) {
588
- console.log(src);
589
- }
590
- if (opts.compileDebug && opts.filename) {
591
- src = src + `
592
- ` + "//# sourceURL=" + sanitizedFilename + `
593
- `;
594
- }
595
- try {
596
- if (opts.async) {
597
- try {
598
- ctor = new Function("return (async function(){}).constructor;")();
599
- } catch (e) {
600
- if (e instanceof SyntaxError) {
601
- throw new Error("This environment does not support async/await");
602
- } else {
603
- throw e;
604
- }
605
- }
606
- } else {
607
- ctor = Function;
608
- }
609
- fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
610
- } catch (e) {
611
- if (e instanceof SyntaxError) {
612
- if (opts.filename) {
613
- e.message += " in " + opts.filename;
614
- }
615
- e.message += ` while compiling ejs
616
-
617
- `;
618
- e.message += `If the above error is not helpful, you may want to try EJS-Lint:
619
- `;
620
- e.message += "https://github.com/RyanZim/EJS-Lint";
621
- if (!opts.async) {
622
- e.message += `
623
- `;
624
- e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
625
- }
626
- }
627
- throw e;
628
- }
629
- var returnedFn = opts.client ? fn : function anonymous(data) {
630
- var include = function(path2, includeData) {
631
- var d = utils.shallowCopy(utils.createNullProtoObjWherePossible(), data);
632
- if (includeData) {
633
- d = utils.shallowCopy(d, includeData);
634
- }
635
- return includeFile(path2, opts)(d);
636
- };
637
- return fn.apply(opts.context, [data || utils.createNullProtoObjWherePossible(), escapeFn, include, rethrow]);
638
- };
639
- if (opts.filename && typeof Object.defineProperty === "function") {
640
- var filename = opts.filename;
641
- var basename = path.basename(filename, path.extname(filename));
642
- try {
643
- Object.defineProperty(returnedFn, "name", {
644
- value: basename,
645
- writable: false,
646
- enumerable: false,
647
- configurable: true
648
- });
649
- } catch (e) {}
650
- }
651
- return returnedFn;
652
- },
653
- generateSource: function() {
654
- var opts = this.opts;
655
- if (opts.rmWhitespace) {
656
- this.templateText = this.templateText.replace(/[\r\n]+/g, `
657
- `).replace(/^\s+|\s+$/gm, "");
658
- }
659
- this.templateText = this.templateText.replace(/[ \t]*<%_/gm, "<%_").replace(/_%>[ \t]*/gm, "_%>");
660
- var self = this;
661
- var matches = this.parseTemplateText();
662
- var d = this.opts.delimiter;
663
- var o = this.opts.openDelimiter;
664
- var c = this.opts.closeDelimiter;
665
- if (matches && matches.length) {
666
- matches.forEach(function(line, index) {
667
- var closing;
668
- if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0) {
669
- closing = matches[index + 2];
670
- if (!(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)) {
671
- throw new Error('Could not find matching close tag for "' + line + '".');
672
- }
673
- }
674
- self.scanLine(line);
675
- });
676
- }
677
- },
678
- parseTemplateText: function() {
679
- var str = this.templateText;
680
- var pat = this.regex;
681
- var result = pat.exec(str);
682
- var arr = [];
683
- var firstPos;
684
- while (result) {
685
- firstPos = result.index;
686
- if (firstPos !== 0) {
687
- arr.push(str.substring(0, firstPos));
688
- str = str.slice(firstPos);
689
- }
690
- arr.push(result[0]);
691
- str = str.slice(result[0].length);
692
- result = pat.exec(str);
693
- }
694
- if (str) {
695
- arr.push(str);
696
- }
697
- return arr;
698
- },
699
- _addOutput: function(line) {
700
- if (this.truncate) {
701
- line = line.replace(/^(?:\r\n|\r|\n)/, "");
702
- this.truncate = false;
703
- }
704
- if (!line) {
705
- return line;
706
- }
707
- line = line.replace(/\\/g, "\\\\");
708
- line = line.replace(/\n/g, "\\n");
709
- line = line.replace(/\r/g, "\\r");
710
- line = line.replace(/"/g, "\\\"");
711
- this.source += ' ; __append("' + line + '")' + `
712
- `;
713
- },
714
- scanLine: function(line) {
715
- var self = this;
716
- var d = this.opts.delimiter;
717
- var o = this.opts.openDelimiter;
718
- var c = this.opts.closeDelimiter;
719
- var newLineCount = 0;
720
- newLineCount = line.split(`
721
- `).length - 1;
722
- switch (line) {
723
- case o + d:
724
- case o + d + "_":
725
- this.mode = Template.modes.EVAL;
726
- break;
727
- case o + d + "=":
728
- this.mode = Template.modes.ESCAPED;
729
- break;
730
- case o + d + "-":
731
- this.mode = Template.modes.RAW;
732
- break;
733
- case o + d + "#":
734
- this.mode = Template.modes.COMMENT;
735
- break;
736
- case o + d + d:
737
- this.mode = Template.modes.LITERAL;
738
- this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")' + `
739
- `;
740
- break;
741
- case d + d + c:
742
- this.mode = Template.modes.LITERAL;
743
- this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")' + `
744
- `;
745
- break;
746
- case d + c:
747
- case "-" + d + c:
748
- case "_" + d + c:
749
- if (this.mode == Template.modes.LITERAL) {
750
- this._addOutput(line);
751
- }
752
- this.mode = null;
753
- this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
754
- break;
755
- default:
756
- if (this.mode) {
757
- switch (this.mode) {
758
- case Template.modes.EVAL:
759
- case Template.modes.ESCAPED:
760
- case Template.modes.RAW:
761
- if (line.lastIndexOf("//") > line.lastIndexOf(`
762
- `)) {
763
- line += `
764
- `;
765
- }
766
- }
767
- switch (this.mode) {
768
- case Template.modes.EVAL:
769
- this.source += " ; " + line + `
770
- `;
771
- break;
772
- case Template.modes.ESCAPED:
773
- this.source += " ; __append(escapeFn(" + stripSemi(line) + "))" + `
774
- `;
775
- break;
776
- case Template.modes.RAW:
777
- this.source += " ; __append(" + stripSemi(line) + ")" + `
778
- `;
779
- break;
780
- case Template.modes.COMMENT:
781
- break;
782
- case Template.modes.LITERAL:
783
- this._addOutput(line);
784
- break;
785
- }
786
- } else {
787
- this._addOutput(line);
788
- }
789
- }
790
- if (self.opts.compileDebug && newLineCount) {
791
- this.currentLine += newLineCount;
792
- this.source += " ; __line = " + this.currentLine + `
793
- `;
794
- }
795
- }
796
- };
797
- exports.escapeXML = utils.escapeXML;
798
- exports.__express = exports.renderFile;
799
- exports.VERSION = _VERSION_STRING;
800
- exports.name = _NAME;
801
- if (typeof window != "undefined") {
802
- window.ejs = exports;
803
- }
804
- });
805
16
 
806
17
  // src/dashboard/server.ts
807
18
  import http2 from "http";
808
- import fs from "fs";
809
- import path from "path";
19
+ import fs2 from "fs";
20
+ import path2 from "path";
810
21
  import { fileURLToPath } from "url";
811
22
 
812
23
  // src/dashboard/lib/state-reader.ts
@@ -817,7 +28,7 @@ import { join as join7 } from "path";
817
28
  import { join as join2, dirname, resolve } from "path";
818
29
  import { readFileSync as readFileSync2, writeFileSync as writeFileSync2, existsSync as existsSync2 } from "fs";
819
30
 
820
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/external.js
31
+ // node_modules/zod/v4/classic/external.js
821
32
  var exports_external = {};
822
33
  __export(exports_external, {
823
34
  xid: () => xid2,
@@ -1047,7 +258,7 @@ __export(exports_external, {
1047
258
  $brand: () => $brand
1048
259
  });
1049
260
 
1050
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/index.js
261
+ // node_modules/zod/v4/core/index.js
1051
262
  var exports_core2 = {};
1052
263
  __export(exports_core2, {
1053
264
  version: () => version,
@@ -1311,7 +522,7 @@ __export(exports_core2, {
1311
522
  $ZodAny: () => $ZodAny
1312
523
  });
1313
524
 
1314
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/core.js
525
+ // node_modules/zod/v4/core/core.js
1315
526
  var NEVER = Object.freeze({
1316
527
  status: "aborted"
1317
528
  });
@@ -1378,7 +589,7 @@ function config(newConfig) {
1378
589
  Object.assign(globalConfig, newConfig);
1379
590
  return globalConfig;
1380
591
  }
1381
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/util.js
592
+ // node_modules/zod/v4/core/util.js
1382
593
  var exports_util = {};
1383
594
  __export(exports_util, {
1384
595
  unwrapMessage: () => unwrapMessage,
@@ -2007,7 +1218,7 @@ class Class {
2007
1218
  constructor(..._args) {}
2008
1219
  }
2009
1220
 
2010
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/errors.js
1221
+ // node_modules/zod/v4/core/errors.js
2011
1222
  var initializer = (inst, def) => {
2012
1223
  inst.name = "$ZodError";
2013
1224
  Object.defineProperty(inst, "_zod", {
@@ -2150,7 +1361,7 @@ function prettifyError(error) {
2150
1361
  `);
2151
1362
  }
2152
1363
 
2153
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/parse.js
1364
+ // node_modules/zod/v4/core/parse.js
2154
1365
  var _parse = (_Err) => (schema, value, _ctx, _params) => {
2155
1366
  const ctx = _ctx ? Object.assign(_ctx, { async: false }) : { async: false };
2156
1367
  const result = schema._zod.run({ value, issues: [] }, ctx);
@@ -2237,7 +1448,7 @@ var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
2237
1448
  return _safeParseAsync(_Err)(schema, value, _ctx);
2238
1449
  };
2239
1450
  var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync($ZodRealError);
2240
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/regexes.js
1451
+ // node_modules/zod/v4/core/regexes.js
2241
1452
  var exports_regexes = {};
2242
1453
  __export(exports_regexes, {
2243
1454
  xid: () => xid,
@@ -2389,7 +1600,7 @@ var sha512_hex = /^[0-9a-fA-F]{128}$/;
2389
1600
  var sha512_base64 = /* @__PURE__ */ fixedBase64(86, "==");
2390
1601
  var sha512_base64url = /* @__PURE__ */ fixedBase64url(86);
2391
1602
 
2392
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/checks.js
1603
+ // node_modules/zod/v4/core/checks.js
2393
1604
  var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
2394
1605
  var _a;
2395
1606
  inst._zod ?? (inst._zod = {});
@@ -2930,7 +2141,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
2930
2141
  };
2931
2142
  });
2932
2143
 
2933
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/doc.js
2144
+ // node_modules/zod/v4/core/doc.js
2934
2145
  class Doc {
2935
2146
  constructor(args = []) {
2936
2147
  this.content = [];
@@ -2968,14 +2179,14 @@ class Doc {
2968
2179
  }
2969
2180
  }
2970
2181
 
2971
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/versions.js
2182
+ // node_modules/zod/v4/core/versions.js
2972
2183
  var version = {
2973
2184
  major: 4,
2974
2185
  minor: 1,
2975
2186
  patch: 8
2976
2187
  };
2977
2188
 
2978
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/schemas.js
2189
+ // node_modules/zod/v4/core/schemas.js
2979
2190
  var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
2980
2191
  var _a;
2981
2192
  inst ?? (inst = {});
@@ -4798,7 +4009,7 @@ function handleRefineResult(result, payload, input, inst) {
4798
4009
  payload.issues.push(issue(_iss));
4799
4010
  }
4800
4011
  }
4801
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/index.js
4012
+ // node_modules/zod/v4/locales/index.js
4802
4013
  var exports_locales = {};
4803
4014
  __export(exports_locales, {
4804
4015
  zhTW: () => zh_TW_default,
@@ -4849,7 +4060,7 @@ __export(exports_locales, {
4849
4060
  ar: () => ar_default
4850
4061
  });
4851
4062
 
4852
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ar.js
4063
+ // node_modules/zod/v4/locales/ar.js
4853
4064
  var error = () => {
4854
4065
  const Sizable = {
4855
4066
  string: { unit: "\u062D\u0631\u0641", verb: "\u0623\u0646 \u064A\u062D\u0648\u064A" },
@@ -4965,7 +4176,7 @@ function ar_default() {
4965
4176
  localeError: error()
4966
4177
  };
4967
4178
  }
4968
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/az.js
4179
+ // node_modules/zod/v4/locales/az.js
4969
4180
  var error2 = () => {
4970
4181
  const Sizable = {
4971
4182
  string: { unit: "simvol", verb: "olmal\u0131d\u0131r" },
@@ -5080,7 +4291,7 @@ function az_default() {
5080
4291
  localeError: error2()
5081
4292
  };
5082
4293
  }
5083
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/be.js
4294
+ // node_modules/zod/v4/locales/be.js
5084
4295
  function getBelarusianPlural(count, one, few, many) {
5085
4296
  const absCount = Math.abs(count);
5086
4297
  const lastDigit = absCount % 10;
@@ -5244,7 +4455,7 @@ function be_default() {
5244
4455
  localeError: error3()
5245
4456
  };
5246
4457
  }
5247
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ca.js
4458
+ // node_modules/zod/v4/locales/ca.js
5248
4459
  var error4 = () => {
5249
4460
  const Sizable = {
5250
4461
  string: { unit: "car\xE0cters", verb: "contenir" },
@@ -5361,7 +4572,7 @@ function ca_default() {
5361
4572
  localeError: error4()
5362
4573
  };
5363
4574
  }
5364
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/cs.js
4575
+ // node_modules/zod/v4/locales/cs.js
5365
4576
  var error5 = () => {
5366
4577
  const Sizable = {
5367
4578
  string: { unit: "znak\u016F", verb: "m\xEDt" },
@@ -5496,7 +4707,7 @@ function cs_default() {
5496
4707
  localeError: error5()
5497
4708
  };
5498
4709
  }
5499
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/da.js
4710
+ // node_modules/zod/v4/locales/da.js
5500
4711
  var error6 = () => {
5501
4712
  const Sizable = {
5502
4713
  string: { unit: "tegn", verb: "havde" },
@@ -5627,7 +4838,7 @@ function da_default() {
5627
4838
  localeError: error6()
5628
4839
  };
5629
4840
  }
5630
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/de.js
4841
+ // node_modules/zod/v4/locales/de.js
5631
4842
  var error7 = () => {
5632
4843
  const Sizable = {
5633
4844
  string: { unit: "Zeichen", verb: "zu haben" },
@@ -5743,7 +4954,7 @@ function de_default() {
5743
4954
  localeError: error7()
5744
4955
  };
5745
4956
  }
5746
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/en.js
4957
+ // node_modules/zod/v4/locales/en.js
5747
4958
  var parsedType = (data) => {
5748
4959
  const t = typeof data;
5749
4960
  switch (t) {
@@ -5860,7 +5071,7 @@ function en_default() {
5860
5071
  localeError: error8()
5861
5072
  };
5862
5073
  }
5863
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/eo.js
5074
+ // node_modules/zod/v4/locales/eo.js
5864
5075
  var parsedType2 = (data) => {
5865
5076
  const t = typeof data;
5866
5077
  switch (t) {
@@ -5976,7 +5187,7 @@ function eo_default() {
5976
5187
  localeError: error9()
5977
5188
  };
5978
5189
  }
5979
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/es.js
5190
+ // node_modules/zod/v4/locales/es.js
5980
5191
  var error10 = () => {
5981
5192
  const Sizable = {
5982
5193
  string: { unit: "caracteres", verb: "tener" },
@@ -6124,7 +5335,7 @@ function es_default() {
6124
5335
  localeError: error10()
6125
5336
  };
6126
5337
  }
6127
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fa.js
5338
+ // node_modules/zod/v4/locales/fa.js
6128
5339
  var error11 = () => {
6129
5340
  const Sizable = {
6130
5341
  string: { unit: "\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631", verb: "\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F" },
@@ -6246,7 +5457,7 @@ function fa_default() {
6246
5457
  localeError: error11()
6247
5458
  };
6248
5459
  }
6249
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fi.js
5460
+ // node_modules/zod/v4/locales/fi.js
6250
5461
  var error12 = () => {
6251
5462
  const Sizable = {
6252
5463
  string: { unit: "merkki\xE4", subject: "merkkijonon" },
@@ -6368,7 +5579,7 @@ function fi_default() {
6368
5579
  localeError: error12()
6369
5580
  };
6370
5581
  }
6371
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fr.js
5582
+ // node_modules/zod/v4/locales/fr.js
6372
5583
  var error13 = () => {
6373
5584
  const Sizable = {
6374
5585
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -6484,7 +5695,7 @@ function fr_default() {
6484
5695
  localeError: error13()
6485
5696
  };
6486
5697
  }
6487
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/fr-CA.js
5698
+ // node_modules/zod/v4/locales/fr-CA.js
6488
5699
  var error14 = () => {
6489
5700
  const Sizable = {
6490
5701
  string: { unit: "caract\xE8res", verb: "avoir" },
@@ -6601,7 +5812,7 @@ function fr_CA_default() {
6601
5812
  localeError: error14()
6602
5813
  };
6603
5814
  }
6604
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/he.js
5815
+ // node_modules/zod/v4/locales/he.js
6605
5816
  var error15 = () => {
6606
5817
  const Sizable = {
6607
5818
  string: { unit: "\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA", verb: "\u05DC\u05DB\u05DC\u05D5\u05DC" },
@@ -6717,7 +5928,7 @@ function he_default() {
6717
5928
  localeError: error15()
6718
5929
  };
6719
5930
  }
6720
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/hu.js
5931
+ // node_modules/zod/v4/locales/hu.js
6721
5932
  var error16 = () => {
6722
5933
  const Sizable = {
6723
5934
  string: { unit: "karakter", verb: "legyen" },
@@ -6833,7 +6044,7 @@ function hu_default() {
6833
6044
  localeError: error16()
6834
6045
  };
6835
6046
  }
6836
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/id.js
6047
+ // node_modules/zod/v4/locales/id.js
6837
6048
  var error17 = () => {
6838
6049
  const Sizable = {
6839
6050
  string: { unit: "karakter", verb: "memiliki" },
@@ -6949,7 +6160,7 @@ function id_default() {
6949
6160
  localeError: error17()
6950
6161
  };
6951
6162
  }
6952
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/is.js
6163
+ // node_modules/zod/v4/locales/is.js
6953
6164
  var parsedType3 = (data) => {
6954
6165
  const t = typeof data;
6955
6166
  switch (t) {
@@ -7066,7 +6277,7 @@ function is_default() {
7066
6277
  localeError: error18()
7067
6278
  };
7068
6279
  }
7069
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/it.js
6280
+ // node_modules/zod/v4/locales/it.js
7070
6281
  var error19 = () => {
7071
6282
  const Sizable = {
7072
6283
  string: { unit: "caratteri", verb: "avere" },
@@ -7182,7 +6393,7 @@ function it_default() {
7182
6393
  localeError: error19()
7183
6394
  };
7184
6395
  }
7185
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ja.js
6396
+ // node_modules/zod/v4/locales/ja.js
7186
6397
  var error20 = () => {
7187
6398
  const Sizable = {
7188
6399
  string: { unit: "\u6587\u5B57", verb: "\u3067\u3042\u308B" },
@@ -7297,7 +6508,7 @@ function ja_default() {
7297
6508
  localeError: error20()
7298
6509
  };
7299
6510
  }
7300
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ka.js
6511
+ // node_modules/zod/v4/locales/ka.js
7301
6512
  var parsedType4 = (data) => {
7302
6513
  const t = typeof data;
7303
6514
  switch (t) {
@@ -7422,7 +6633,7 @@ function ka_default() {
7422
6633
  localeError: error21()
7423
6634
  };
7424
6635
  }
7425
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/km.js
6636
+ // node_modules/zod/v4/locales/km.js
7426
6637
  var error22 = () => {
7427
6638
  const Sizable = {
7428
6639
  string: { unit: "\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A", verb: "\u1782\u17BD\u179A\u1798\u17B6\u1793" },
@@ -7540,11 +6751,11 @@ function km_default() {
7540
6751
  };
7541
6752
  }
7542
6753
 
7543
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/kh.js
6754
+ // node_modules/zod/v4/locales/kh.js
7544
6755
  function kh_default() {
7545
6756
  return km_default();
7546
6757
  }
7547
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ko.js
6758
+ // node_modules/zod/v4/locales/ko.js
7548
6759
  var error23 = () => {
7549
6760
  const Sizable = {
7550
6761
  string: { unit: "\uBB38\uC790", verb: "to have" },
@@ -7665,7 +6876,7 @@ function ko_default() {
7665
6876
  localeError: error23()
7666
6877
  };
7667
6878
  }
7668
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/lt.js
6879
+ // node_modules/zod/v4/locales/lt.js
7669
6880
  var parsedType5 = (data) => {
7670
6881
  const t = typeof data;
7671
6882
  return parsedTypeFromType(t, data);
@@ -7894,7 +7105,7 @@ function lt_default() {
7894
7105
  localeError: error24()
7895
7106
  };
7896
7107
  }
7897
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/mk.js
7108
+ // node_modules/zod/v4/locales/mk.js
7898
7109
  var error25 = () => {
7899
7110
  const Sizable = {
7900
7111
  string: { unit: "\u0437\u043D\u0430\u0446\u0438", verb: "\u0434\u0430 \u0438\u043C\u0430\u0430\u0442" },
@@ -8011,7 +7222,7 @@ function mk_default() {
8011
7222
  localeError: error25()
8012
7223
  };
8013
7224
  }
8014
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ms.js
7225
+ // node_modules/zod/v4/locales/ms.js
8015
7226
  var error26 = () => {
8016
7227
  const Sizable = {
8017
7228
  string: { unit: "aksara", verb: "mempunyai" },
@@ -8127,7 +7338,7 @@ function ms_default() {
8127
7338
  localeError: error26()
8128
7339
  };
8129
7340
  }
8130
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/nl.js
7341
+ // node_modules/zod/v4/locales/nl.js
8131
7342
  var error27 = () => {
8132
7343
  const Sizable = {
8133
7344
  string: { unit: "tekens" },
@@ -8244,7 +7455,7 @@ function nl_default() {
8244
7455
  localeError: error27()
8245
7456
  };
8246
7457
  }
8247
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/no.js
7458
+ // node_modules/zod/v4/locales/no.js
8248
7459
  var error28 = () => {
8249
7460
  const Sizable = {
8250
7461
  string: { unit: "tegn", verb: "\xE5 ha" },
@@ -8360,7 +7571,7 @@ function no_default() {
8360
7571
  localeError: error28()
8361
7572
  };
8362
7573
  }
8363
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ota.js
7574
+ // node_modules/zod/v4/locales/ota.js
8364
7575
  var error29 = () => {
8365
7576
  const Sizable = {
8366
7577
  string: { unit: "harf", verb: "olmal\u0131d\u0131r" },
@@ -8476,7 +7687,7 @@ function ota_default() {
8476
7687
  localeError: error29()
8477
7688
  };
8478
7689
  }
8479
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ps.js
7690
+ // node_modules/zod/v4/locales/ps.js
8480
7691
  var error30 = () => {
8481
7692
  const Sizable = {
8482
7693
  string: { unit: "\u062A\u0648\u06A9\u064A", verb: "\u0648\u0644\u0631\u064A" },
@@ -8598,7 +7809,7 @@ function ps_default() {
8598
7809
  localeError: error30()
8599
7810
  };
8600
7811
  }
8601
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/pl.js
7812
+ // node_modules/zod/v4/locales/pl.js
8602
7813
  var error31 = () => {
8603
7814
  const Sizable = {
8604
7815
  string: { unit: "znak\xF3w", verb: "mie\u0107" },
@@ -8715,7 +7926,7 @@ function pl_default() {
8715
7926
  localeError: error31()
8716
7927
  };
8717
7928
  }
8718
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/pt.js
7929
+ // node_modules/zod/v4/locales/pt.js
8719
7930
  var error32 = () => {
8720
7931
  const Sizable = {
8721
7932
  string: { unit: "caracteres", verb: "ter" },
@@ -8831,7 +8042,7 @@ function pt_default() {
8831
8042
  localeError: error32()
8832
8043
  };
8833
8044
  }
8834
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ru.js
8045
+ // node_modules/zod/v4/locales/ru.js
8835
8046
  function getRussianPlural(count, one, few, many) {
8836
8047
  const absCount = Math.abs(count);
8837
8048
  const lastDigit = absCount % 10;
@@ -8995,7 +8206,7 @@ function ru_default() {
8995
8206
  localeError: error33()
8996
8207
  };
8997
8208
  }
8998
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/sl.js
8209
+ // node_modules/zod/v4/locales/sl.js
8999
8210
  var error34 = () => {
9000
8211
  const Sizable = {
9001
8212
  string: { unit: "znakov", verb: "imeti" },
@@ -9112,7 +8323,7 @@ function sl_default() {
9112
8323
  localeError: error34()
9113
8324
  };
9114
8325
  }
9115
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/sv.js
8326
+ // node_modules/zod/v4/locales/sv.js
9116
8327
  var error35 = () => {
9117
8328
  const Sizable = {
9118
8329
  string: { unit: "tecken", verb: "att ha" },
@@ -9230,7 +8441,7 @@ function sv_default() {
9230
8441
  localeError: error35()
9231
8442
  };
9232
8443
  }
9233
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ta.js
8444
+ // node_modules/zod/v4/locales/ta.js
9234
8445
  var error36 = () => {
9235
8446
  const Sizable = {
9236
8447
  string: { unit: "\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD", verb: "\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD" },
@@ -9347,7 +8558,7 @@ function ta_default() {
9347
8558
  localeError: error36()
9348
8559
  };
9349
8560
  }
9350
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/th.js
8561
+ // node_modules/zod/v4/locales/th.js
9351
8562
  var error37 = () => {
9352
8563
  const Sizable = {
9353
8564
  string: { unit: "\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23", verb: "\u0E04\u0E27\u0E23\u0E21\u0E35" },
@@ -9464,7 +8675,7 @@ function th_default() {
9464
8675
  localeError: error37()
9465
8676
  };
9466
8677
  }
9467
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/tr.js
8678
+ // node_modules/zod/v4/locales/tr.js
9468
8679
  var parsedType6 = (data) => {
9469
8680
  const t = typeof data;
9470
8681
  switch (t) {
@@ -9579,7 +8790,7 @@ function tr_default() {
9579
8790
  localeError: error38()
9580
8791
  };
9581
8792
  }
9582
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/uk.js
8793
+ // node_modules/zod/v4/locales/uk.js
9583
8794
  var error39 = () => {
9584
8795
  const Sizable = {
9585
8796
  string: { unit: "\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432", verb: "\u043C\u0430\u0442\u0438\u043C\u0435" },
@@ -9696,11 +8907,11 @@ function uk_default() {
9696
8907
  };
9697
8908
  }
9698
8909
 
9699
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ua.js
8910
+ // node_modules/zod/v4/locales/ua.js
9700
8911
  function ua_default() {
9701
8912
  return uk_default();
9702
8913
  }
9703
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/ur.js
8914
+ // node_modules/zod/v4/locales/ur.js
9704
8915
  var error40 = () => {
9705
8916
  const Sizable = {
9706
8917
  string: { unit: "\u062D\u0631\u0648\u0641", verb: "\u06C1\u0648\u0646\u0627" },
@@ -9817,7 +9028,7 @@ function ur_default() {
9817
9028
  localeError: error40()
9818
9029
  };
9819
9030
  }
9820
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/vi.js
9031
+ // node_modules/zod/v4/locales/vi.js
9821
9032
  var error41 = () => {
9822
9033
  const Sizable = {
9823
9034
  string: { unit: "k\xFD t\u1EF1", verb: "c\xF3" },
@@ -9933,7 +9144,7 @@ function vi_default() {
9933
9144
  localeError: error41()
9934
9145
  };
9935
9146
  }
9936
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/zh-CN.js
9147
+ // node_modules/zod/v4/locales/zh-CN.js
9937
9148
  var error42 = () => {
9938
9149
  const Sizable = {
9939
9150
  string: { unit: "\u5B57\u7B26", verb: "\u5305\u542B" },
@@ -10049,7 +9260,7 @@ function zh_CN_default() {
10049
9260
  localeError: error42()
10050
9261
  };
10051
9262
  }
10052
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/zh-TW.js
9263
+ // node_modules/zod/v4/locales/zh-TW.js
10053
9264
  var error43 = () => {
10054
9265
  const Sizable = {
10055
9266
  string: { unit: "\u5B57\u5143", verb: "\u64C1\u6709" },
@@ -10166,7 +9377,7 @@ function zh_TW_default() {
10166
9377
  localeError: error43()
10167
9378
  };
10168
9379
  }
10169
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/locales/yo.js
9380
+ // node_modules/zod/v4/locales/yo.js
10170
9381
  var error44 = () => {
10171
9382
  const Sizable = {
10172
9383
  string: { unit: "\xE0mi", verb: "n\xED" },
@@ -10281,7 +9492,7 @@ function yo_default() {
10281
9492
  localeError: error44()
10282
9493
  };
10283
9494
  }
10284
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/registries.js
9495
+ // node_modules/zod/v4/core/registries.js
10285
9496
  var $output = Symbol("ZodOutput");
10286
9497
  var $input = Symbol("ZodInput");
10287
9498
 
@@ -10332,7 +9543,7 @@ function registry() {
10332
9543
  return new $ZodRegistry;
10333
9544
  }
10334
9545
  var globalRegistry = /* @__PURE__ */ registry();
10335
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/api.js
9546
+ // node_modules/zod/v4/core/api.js
10336
9547
  function _string(Class2, params) {
10337
9548
  return new Class2({
10338
9549
  type: "string",
@@ -11210,7 +10421,7 @@ function _stringFormat(Class2, format, fnOrRegex, _params = {}) {
11210
10421
  const inst = new Class2(def);
11211
10422
  return inst;
11212
10423
  }
11213
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/to-json-schema.js
10424
+ // node_modules/zod/v4/core/to-json-schema.js
11214
10425
  class JSONSchemaGenerator {
11215
10426
  constructor(params) {
11216
10427
  this.counter = 0;
@@ -11548,7 +10759,7 @@ class JSONSchemaGenerator {
11548
10759
  if (val === undefined) {
11549
10760
  if (this.unrepresentable === "throw") {
11550
10761
  throw new Error("Literal `undefined` cannot be represented in JSON Schema");
11551
- } else {}
10762
+ }
11552
10763
  } else if (typeof val === "bigint") {
11553
10764
  if (this.unrepresentable === "throw") {
11554
10765
  throw new Error("BigInt literals cannot be represented in JSON Schema");
@@ -12014,9 +11225,9 @@ function isTransforming(_schema, _ctx) {
12014
11225
  }
12015
11226
  throw new Error(`Unknown schema type: ${def.type}`);
12016
11227
  }
12017
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/core/json-schema.js
11228
+ // node_modules/zod/v4/core/json-schema.js
12018
11229
  var exports_json_schema = {};
12019
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/iso.js
11230
+ // node_modules/zod/v4/classic/iso.js
12020
11231
  var exports_iso = {};
12021
11232
  __export(exports_iso, {
12022
11233
  time: () => time2,
@@ -12057,7 +11268,7 @@ function duration2(params) {
12057
11268
  return _isoDuration(ZodISODuration, params);
12058
11269
  }
12059
11270
 
12060
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/errors.js
11271
+ // node_modules/zod/v4/classic/errors.js
12061
11272
  var initializer2 = (inst, issues) => {
12062
11273
  $ZodError.init(inst, issues);
12063
11274
  inst.name = "ZodError";
@@ -12092,7 +11303,7 @@ var ZodRealError = $constructor("ZodError", initializer2, {
12092
11303
  Parent: Error
12093
11304
  });
12094
11305
 
12095
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/parse.js
11306
+ // node_modules/zod/v4/classic/parse.js
12096
11307
  var parse3 = /* @__PURE__ */ _parse(ZodRealError);
12097
11308
  var parseAsync2 = /* @__PURE__ */ _parseAsync(ZodRealError);
12098
11309
  var safeParse2 = /* @__PURE__ */ _safeParse(ZodRealError);
@@ -12106,7 +11317,7 @@ var safeDecode2 = /* @__PURE__ */ _safeDecode(ZodRealError);
12106
11317
  var safeEncodeAsync2 = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
12107
11318
  var safeDecodeAsync2 = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
12108
11319
 
12109
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/schemas.js
11320
+ // node_modules/zod/v4/classic/schemas.js
12110
11321
  var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
12111
11322
  $ZodType.init(inst, def);
12112
11323
  inst.def = def;
@@ -13081,7 +12292,7 @@ function json(params) {
13081
12292
  function preprocess(fn, schema) {
13082
12293
  return pipe(transform(fn), schema);
13083
12294
  }
13084
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/compat.js
12295
+ // node_modules/zod/v4/classic/compat.js
13085
12296
  var ZodIssueCode = {
13086
12297
  invalid_type: "invalid_type",
13087
12298
  too_big: "too_big",
@@ -13105,7 +12316,7 @@ function getErrorMap() {
13105
12316
  }
13106
12317
  var ZodFirstPartyTypeKind;
13107
12318
  (function(ZodFirstPartyTypeKind2) {})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
13108
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/coerce.js
12319
+ // node_modules/zod/v4/classic/coerce.js
13109
12320
  var exports_coerce = {};
13110
12321
  __export(exports_coerce, {
13111
12322
  string: () => string3,
@@ -13130,7 +12341,7 @@ function date4(params) {
13130
12341
  return _coercedDate(ZodDate, params);
13131
12342
  }
13132
12343
 
13133
- // node_modules/@opencode-ai/plugin/node_modules/zod/v4/classic/external.js
12344
+ // node_modules/zod/v4/classic/external.js
13134
12345
  config(en_default());
13135
12346
  // node_modules/@opencode-ai/plugin/dist/tool.js
13136
12347
  function tool(input) {
@@ -13597,12 +12808,722 @@ function tryPort(port) {
13597
12808
  });
13598
12809
  }
13599
12810
 
12811
+ // node_modules/ejs/lib/esm/ejs.js
12812
+ import fs from "fs";
12813
+ import path from "path";
12814
+
12815
+ // node_modules/ejs/lib/esm/utils.js
12816
+ var exports_utils = {};
12817
+ __export(exports_utils, {
12818
+ default: () => utils_default
12819
+ });
12820
+ var utils = {};
12821
+ var regExpChars = /[|\\{}()[\]^$+*?.]/g;
12822
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
12823
+ var hasOwn = function(obj, key) {
12824
+ return hasOwnProperty.apply(obj, [key]);
12825
+ };
12826
+ utils.hasOwn = hasOwn;
12827
+ utils.escapeRegExpChars = function(string4) {
12828
+ if (!string4) {
12829
+ return "";
12830
+ }
12831
+ return String(string4).replace(regExpChars, "\\$&");
12832
+ };
12833
+ var _ENCODE_HTML_RULES = {
12834
+ "&": "&amp;",
12835
+ "<": "&lt;",
12836
+ ">": "&gt;",
12837
+ '"': "&#34;",
12838
+ "'": "&#39;"
12839
+ };
12840
+ var _MATCH_HTML = /[&<>'"]/g;
12841
+ function encode_char(c) {
12842
+ return _ENCODE_HTML_RULES[c] || c;
12843
+ }
12844
+ var escapeFuncStr = `var _ENCODE_HTML_RULES = {
12845
+ ` + ` "&": "&amp;"
12846
+ ` + ` , "<": "&lt;"
12847
+ ` + ` , ">": "&gt;"
12848
+ ` + ` , '"': "&#34;"
12849
+ ` + ` , "'": "&#39;"
12850
+ ` + ` }
12851
+ ` + ` , _MATCH_HTML = /[&<>'"]/g;
12852
+ ` + `function encode_char(c) {
12853
+ ` + ` return _ENCODE_HTML_RULES[c] || c;
12854
+ ` + `};
12855
+ `;
12856
+ utils.escapeXML = function(markup) {
12857
+ return markup == undefined ? "" : String(markup).replace(_MATCH_HTML, encode_char);
12858
+ };
12859
+ function escapeXMLToString() {
12860
+ return Function.prototype.toString.call(this) + `;
12861
+ ` + escapeFuncStr;
12862
+ }
12863
+ try {
12864
+ if (typeof Object.defineProperty === "function") {
12865
+ Object.defineProperty(utils.escapeXML, "toString", { value: escapeXMLToString });
12866
+ } else {
12867
+ utils.escapeXML.toString = escapeXMLToString;
12868
+ }
12869
+ } catch (err) {
12870
+ console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)");
12871
+ }
12872
+ utils.shallowCopy = function(to, from) {
12873
+ from = from || {};
12874
+ if (to !== null && to !== undefined) {
12875
+ for (var p in from) {
12876
+ if (!hasOwn(from, p)) {
12877
+ continue;
12878
+ }
12879
+ if (p === "__proto__" || p === "constructor") {
12880
+ continue;
12881
+ }
12882
+ to[p] = from[p];
12883
+ }
12884
+ }
12885
+ return to;
12886
+ };
12887
+ utils.shallowCopyFromList = function(to, from, list) {
12888
+ list = list || [];
12889
+ from = from || {};
12890
+ if (to !== null && to !== undefined) {
12891
+ for (var i = 0;i < list.length; i++) {
12892
+ var p = list[i];
12893
+ if (typeof from[p] != "undefined") {
12894
+ if (!hasOwn(from, p)) {
12895
+ continue;
12896
+ }
12897
+ if (p === "__proto__" || p === "constructor") {
12898
+ continue;
12899
+ }
12900
+ to[p] = from[p];
12901
+ }
12902
+ }
12903
+ }
12904
+ return to;
12905
+ };
12906
+ utils.cache = {
12907
+ _data: {},
12908
+ set: function(key, val) {
12909
+ this._data[key] = val;
12910
+ },
12911
+ get: function(key) {
12912
+ return this._data[key];
12913
+ },
12914
+ remove: function(key) {
12915
+ delete this._data[key];
12916
+ },
12917
+ reset: function() {
12918
+ this._data = {};
12919
+ }
12920
+ };
12921
+ utils.hyphenToCamel = function(str) {
12922
+ return str.replace(/-[a-z]/g, function(match) {
12923
+ return match[1].toUpperCase();
12924
+ });
12925
+ };
12926
+ utils.createNullProtoObjWherePossible = function() {
12927
+ if (typeof Object.create == "function") {
12928
+ return function() {
12929
+ return Object.create(null);
12930
+ };
12931
+ }
12932
+ if (!({ __proto__: null } instanceof Object)) {
12933
+ return function() {
12934
+ return { __proto__: null };
12935
+ };
12936
+ }
12937
+ return function() {
12938
+ return {};
12939
+ };
12940
+ }();
12941
+ utils.hasOwnOnlyObject = function(obj) {
12942
+ var o = utils.createNullProtoObjWherePossible();
12943
+ for (var p in obj) {
12944
+ if (hasOwn(obj, p)) {
12945
+ o[p] = obj[p];
12946
+ }
12947
+ }
12948
+ return o;
12949
+ };
12950
+ if (typeof exports_utils != "undefined") {
12951
+ module_utils.exports = utils;
12952
+ }
12953
+ var utils_default = utils;
12954
+
12955
+ // node_modules/ejs/lib/esm/ejs.js
12956
+ var DECLARATION_KEYWORD = "let";
12957
+ var ejs = {};
12958
+ var _DEFAULT_OPEN_DELIMITER = "<";
12959
+ var _DEFAULT_CLOSE_DELIMITER = ">";
12960
+ var _DEFAULT_DELIMITER = "%";
12961
+ var _DEFAULT_LOCALS_NAME = "locals";
12962
+ var _REGEX_STRING = "(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)";
12963
+ var _OPTS_PASSABLE_WITH_DATA = [
12964
+ "delimiter",
12965
+ "scope",
12966
+ "context",
12967
+ "debug",
12968
+ "compileDebug",
12969
+ "_with",
12970
+ "rmWhitespace",
12971
+ "strict",
12972
+ "filename",
12973
+ "async"
12974
+ ];
12975
+ var _OPTS_PASSABLE_WITH_DATA_EXPRESS = _OPTS_PASSABLE_WITH_DATA.concat("cache");
12976
+ var _BOM = /^\uFEFF/;
12977
+ var _JS_IDENTIFIER = /^[a-zA-Z_$][0-9a-zA-Z_$]*$/;
12978
+ ejs.cache = utils_default.cache;
12979
+ ejs.fileLoader = fs.readFileSync;
12980
+ ejs.localsName = _DEFAULT_LOCALS_NAME;
12981
+ ejs.promiseImpl = new Function("return this;")().Promise;
12982
+ ejs.resolveInclude = function(name, filename, isDir) {
12983
+ let dirname2 = path.dirname;
12984
+ let extname = path.extname;
12985
+ let resolve2 = path.resolve;
12986
+ let includePath = resolve2(isDir ? filename : dirname2(filename), name);
12987
+ let ext = extname(name);
12988
+ if (!ext) {
12989
+ includePath += ".ejs";
12990
+ }
12991
+ return includePath;
12992
+ };
12993
+ function resolvePaths(name, paths) {
12994
+ let filePath;
12995
+ if (paths.some(function(v) {
12996
+ filePath = ejs.resolveInclude(name, v, true);
12997
+ return fs.existsSync(filePath);
12998
+ })) {
12999
+ return filePath;
13000
+ }
13001
+ }
13002
+ function getIncludePath(path2, options) {
13003
+ let includePath;
13004
+ let filePath;
13005
+ let views = options.views;
13006
+ let match = /^[A-Za-z]+:\\|^\//.exec(path2);
13007
+ if (match && match.length) {
13008
+ path2 = path2.replace(/^\/*/, "");
13009
+ if (Array.isArray(options.root)) {
13010
+ includePath = resolvePaths(path2, options.root);
13011
+ } else {
13012
+ includePath = ejs.resolveInclude(path2, options.root || "/", true);
13013
+ }
13014
+ } else {
13015
+ if (options.filename) {
13016
+ filePath = ejs.resolveInclude(path2, options.filename);
13017
+ if (fs.existsSync(filePath)) {
13018
+ includePath = filePath;
13019
+ }
13020
+ }
13021
+ if (!includePath && Array.isArray(views)) {
13022
+ includePath = resolvePaths(path2, views);
13023
+ }
13024
+ if (!includePath && typeof options.includer !== "function") {
13025
+ throw new Error('Could not find the include file "' + options.escapeFunction(path2) + '"');
13026
+ }
13027
+ }
13028
+ return includePath;
13029
+ }
13030
+ function handleCache(options, template) {
13031
+ let func;
13032
+ let filename = options.filename;
13033
+ let hasTemplate = arguments.length > 1;
13034
+ if (options.cache) {
13035
+ if (!filename) {
13036
+ throw new Error("cache option requires a filename");
13037
+ }
13038
+ func = ejs.cache.get(filename);
13039
+ if (func) {
13040
+ return func;
13041
+ }
13042
+ if (!hasTemplate) {
13043
+ template = fileLoader(filename).toString().replace(_BOM, "");
13044
+ }
13045
+ } else if (!hasTemplate) {
13046
+ if (!filename) {
13047
+ throw new Error("Internal EJS error: no file name or template " + "provided");
13048
+ }
13049
+ template = fileLoader(filename).toString().replace(_BOM, "");
13050
+ }
13051
+ func = ejs.compile(template, options);
13052
+ if (options.cache) {
13053
+ ejs.cache.set(filename, func);
13054
+ }
13055
+ return func;
13056
+ }
13057
+ function tryHandleCache(options, data, cb) {
13058
+ let result;
13059
+ if (!cb) {
13060
+ if (typeof ejs.promiseImpl == "function") {
13061
+ return new ejs.promiseImpl(function(resolve2, reject) {
13062
+ try {
13063
+ result = handleCache(options)(data);
13064
+ resolve2(result);
13065
+ } catch (err) {
13066
+ reject(err);
13067
+ }
13068
+ });
13069
+ } else {
13070
+ throw new Error("Please provide a callback function");
13071
+ }
13072
+ } else {
13073
+ try {
13074
+ result = handleCache(options)(data);
13075
+ } catch (err) {
13076
+ return cb(err);
13077
+ }
13078
+ cb(null, result);
13079
+ }
13080
+ }
13081
+ function fileLoader(filePath) {
13082
+ return ejs.fileLoader(filePath);
13083
+ }
13084
+ function includeFile(path2, options) {
13085
+ let opts = utils_default.shallowCopy(utils_default.createNullProtoObjWherePossible(), options);
13086
+ opts.filename = getIncludePath(path2, opts);
13087
+ if (typeof options.includer === "function") {
13088
+ let includerResult = options.includer(path2, opts.filename);
13089
+ if (includerResult) {
13090
+ if (includerResult.filename) {
13091
+ opts.filename = includerResult.filename;
13092
+ }
13093
+ if (includerResult.template) {
13094
+ return handleCache(opts, includerResult.template);
13095
+ }
13096
+ }
13097
+ }
13098
+ return handleCache(opts);
13099
+ }
13100
+ function rethrow(err, str, flnm, lineno, esc2) {
13101
+ let lines = str.split(`
13102
+ `);
13103
+ let start = Math.max(lineno - 3, 0);
13104
+ let end = Math.min(lines.length, lineno + 3);
13105
+ let filename = esc2(flnm);
13106
+ let context = lines.slice(start, end).map(function(line, i) {
13107
+ let curr = i + start + 1;
13108
+ return (curr == lineno ? " >> " : " ") + curr + "| " + line;
13109
+ }).join(`
13110
+ `);
13111
+ err.path = filename;
13112
+ err.message = (filename || "ejs") + ":" + lineno + `
13113
+ ` + context + `
13114
+
13115
+ ` + err.message;
13116
+ throw err;
13117
+ }
13118
+ function stripSemi(str) {
13119
+ return str.replace(/;(\s*$)/, "$1");
13120
+ }
13121
+ ejs.compile = function compile(template, opts) {
13122
+ let templ;
13123
+ if (opts && opts.scope) {
13124
+ console.warn("`scope` option is deprecated and will be removed in future EJS");
13125
+ if (!opts.context) {
13126
+ opts.context = opts.scope;
13127
+ }
13128
+ delete opts.scope;
13129
+ }
13130
+ templ = new Template(template, opts);
13131
+ return templ.compile();
13132
+ };
13133
+ ejs.render = function(template, d, o) {
13134
+ let data = d || utils_default.createNullProtoObjWherePossible();
13135
+ let opts = o || utils_default.createNullProtoObjWherePossible();
13136
+ if (arguments.length == 2) {
13137
+ utils_default.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA);
13138
+ }
13139
+ return handleCache(opts, template)(data);
13140
+ };
13141
+ ejs.renderFile = function() {
13142
+ let args = Array.prototype.slice.call(arguments);
13143
+ let filename = args.shift();
13144
+ let cb;
13145
+ let opts = { filename };
13146
+ let data;
13147
+ let viewOpts;
13148
+ if (typeof arguments[arguments.length - 1] == "function") {
13149
+ cb = args.pop();
13150
+ }
13151
+ if (args.length) {
13152
+ data = args.shift();
13153
+ if (args.length) {
13154
+ utils_default.shallowCopy(opts, args.pop());
13155
+ } else {
13156
+ if (utils_default.hasOwn(data, "settings") && data.settings) {
13157
+ if (data.settings.views) {
13158
+ opts.views = data.settings.views;
13159
+ }
13160
+ if (data.settings["view cache"]) {
13161
+ opts.cache = true;
13162
+ }
13163
+ viewOpts = data.settings["view options"];
13164
+ if (viewOpts) {
13165
+ utils_default.shallowCopy(opts, viewOpts);
13166
+ }
13167
+ }
13168
+ utils_default.shallowCopyFromList(opts, data, _OPTS_PASSABLE_WITH_DATA_EXPRESS);
13169
+ }
13170
+ opts.filename = filename;
13171
+ } else {
13172
+ data = utils_default.createNullProtoObjWherePossible();
13173
+ }
13174
+ return tryHandleCache(opts, data, cb);
13175
+ };
13176
+ ejs.Template = Template;
13177
+ ejs.clearCache = function() {
13178
+ ejs.cache.reset();
13179
+ };
13180
+ function Template(text, optsParam) {
13181
+ let opts = utils_default.hasOwnOnlyObject(optsParam);
13182
+ let options = utils_default.createNullProtoObjWherePossible();
13183
+ this.templateText = text;
13184
+ this.mode = null;
13185
+ this.truncate = false;
13186
+ this.currentLine = 1;
13187
+ this.source = "";
13188
+ options.escapeFunction = opts.escape || opts.escapeFunction || utils_default.escapeXML;
13189
+ options.compileDebug = opts.compileDebug !== false;
13190
+ options.debug = !!opts.debug;
13191
+ options.filename = opts.filename;
13192
+ options.openDelimiter = opts.openDelimiter || ejs.openDelimiter || _DEFAULT_OPEN_DELIMITER;
13193
+ options.closeDelimiter = opts.closeDelimiter || ejs.closeDelimiter || _DEFAULT_CLOSE_DELIMITER;
13194
+ options.delimiter = opts.delimiter || ejs.delimiter || _DEFAULT_DELIMITER;
13195
+ options.strict = opts.strict || false;
13196
+ options.context = opts.context;
13197
+ options.cache = opts.cache || false;
13198
+ options.rmWhitespace = opts.rmWhitespace;
13199
+ options.root = opts.root;
13200
+ options.includer = opts.includer;
13201
+ options.outputFunctionName = opts.outputFunctionName;
13202
+ options.localsName = opts.localsName || ejs.localsName || _DEFAULT_LOCALS_NAME;
13203
+ options.views = opts.views;
13204
+ options.async = opts.async;
13205
+ options.destructuredLocals = opts.destructuredLocals;
13206
+ options.legacyInclude = typeof opts.legacyInclude != "undefined" ? !!opts.legacyInclude : true;
13207
+ if (options.strict) {
13208
+ options._with = false;
13209
+ } else {
13210
+ options._with = typeof opts._with != "undefined" ? opts._with : true;
13211
+ }
13212
+ this.opts = options;
13213
+ this.regex = this.createRegex();
13214
+ }
13215
+ Template.modes = {
13216
+ EVAL: "eval",
13217
+ ESCAPED: "escaped",
13218
+ RAW: "raw",
13219
+ COMMENT: "comment",
13220
+ LITERAL: "literal"
13221
+ };
13222
+ Template.prototype = {
13223
+ createRegex: function() {
13224
+ let str = _REGEX_STRING;
13225
+ let delim = utils_default.escapeRegExpChars(this.opts.delimiter);
13226
+ let open = utils_default.escapeRegExpChars(this.opts.openDelimiter);
13227
+ let close = utils_default.escapeRegExpChars(this.opts.closeDelimiter);
13228
+ str = str.replace(/%/g, delim).replace(/</g, open).replace(/>/g, close);
13229
+ return new RegExp(str);
13230
+ },
13231
+ compile: function() {
13232
+ let src;
13233
+ let fn;
13234
+ let opts = this.opts;
13235
+ let prepended = "";
13236
+ let appended = "";
13237
+ let escapeFn = opts.escapeFunction;
13238
+ let ctor;
13239
+ let sanitizedFilename = opts.filename ? JSON.stringify(opts.filename) : "undefined";
13240
+ if (!this.source) {
13241
+ this.generateSource();
13242
+ prepended += ` ${DECLARATION_KEYWORD} __output = "";
13243
+ ` + ` function __append(s) { if (s !== undefined && s !== null) __output += s }
13244
+ `;
13245
+ if (opts.outputFunctionName) {
13246
+ if (!_JS_IDENTIFIER.test(opts.outputFunctionName)) {
13247
+ throw new Error("outputFunctionName is not a valid JS identifier.");
13248
+ }
13249
+ prepended += ` ${DECLARATION_KEYWORD} ` + opts.outputFunctionName + " = __append;" + `
13250
+ `;
13251
+ }
13252
+ if (opts.localsName && !_JS_IDENTIFIER.test(opts.localsName)) {
13253
+ throw new Error("localsName is not a valid JS identifier.");
13254
+ }
13255
+ if (opts.destructuredLocals && opts.destructuredLocals.length) {
13256
+ let destructuring = ` ${DECLARATION_KEYWORD} __locals = (` + opts.localsName + ` || {}),
13257
+ `;
13258
+ for (let i = 0;i < opts.destructuredLocals.length; i++) {
13259
+ let name = opts.destructuredLocals[i];
13260
+ if (!_JS_IDENTIFIER.test(name)) {
13261
+ throw new Error("destructuredLocals[" + i + "] is not a valid JS identifier.");
13262
+ }
13263
+ if (i > 0) {
13264
+ destructuring += `,
13265
+ `;
13266
+ }
13267
+ destructuring += name + " = __locals." + name;
13268
+ }
13269
+ prepended += destructuring + `;
13270
+ `;
13271
+ }
13272
+ if (opts._with !== false) {
13273
+ prepended += " with (" + opts.localsName + " || {}) {" + `
13274
+ `;
13275
+ appended += " }" + `
13276
+ `;
13277
+ }
13278
+ appended += " return __output;" + `
13279
+ `;
13280
+ this.source = prepended + this.source + appended;
13281
+ }
13282
+ if (opts.compileDebug) {
13283
+ src = `${DECLARATION_KEYWORD} __line = 1` + `
13284
+ ` + " , __lines = " + JSON.stringify(this.templateText) + `
13285
+ ` + " , __filename = " + sanitizedFilename + ";" + `
13286
+ ` + "try {" + `
13287
+ ` + this.source + "} catch (e) {" + `
13288
+ ` + " rethrow(e, __lines, __filename, __line, escapeFn);" + `
13289
+ ` + "}" + `
13290
+ `;
13291
+ } else {
13292
+ src = this.source;
13293
+ }
13294
+ if (opts.strict) {
13295
+ src = `"use strict";
13296
+ ` + src;
13297
+ }
13298
+ if (opts.debug) {
13299
+ console.log(src);
13300
+ }
13301
+ if (opts.compileDebug && opts.filename) {
13302
+ src = src + `
13303
+ ` + "//# sourceURL=" + sanitizedFilename + `
13304
+ `;
13305
+ }
13306
+ try {
13307
+ if (opts.async) {
13308
+ try {
13309
+ ctor = new Function("return (async function(){}).constructor;")();
13310
+ } catch (e) {
13311
+ if (e instanceof SyntaxError) {
13312
+ throw new Error("This environment does not support async/await");
13313
+ } else {
13314
+ throw e;
13315
+ }
13316
+ }
13317
+ } else {
13318
+ ctor = Function;
13319
+ }
13320
+ fn = new ctor(opts.localsName + ", escapeFn, include, rethrow", src);
13321
+ } catch (e) {
13322
+ if (e instanceof SyntaxError) {
13323
+ if (opts.filename) {
13324
+ e.message += " in " + opts.filename;
13325
+ }
13326
+ e.message += ` while compiling ejs
13327
+
13328
+ `;
13329
+ e.message += `If the above error is not helpful, you may want to try EJS-Lint:
13330
+ `;
13331
+ e.message += "https://github.com/RyanZim/EJS-Lint";
13332
+ if (!opts.async) {
13333
+ e.message += `
13334
+ `;
13335
+ e.message += "Or, if you meant to create an async function, pass `async: true` as an option.";
13336
+ }
13337
+ }
13338
+ throw e;
13339
+ }
13340
+ let returnedFn = function anonymous(data) {
13341
+ let include = function(path2, includeData) {
13342
+ let d = utils_default.shallowCopy(utils_default.createNullProtoObjWherePossible(), data);
13343
+ if (includeData) {
13344
+ d = utils_default.shallowCopy(d, includeData);
13345
+ }
13346
+ return includeFile(path2, opts)(d);
13347
+ };
13348
+ return fn.apply(opts.context, [data || utils_default.createNullProtoObjWherePossible(), escapeFn, include, rethrow]);
13349
+ };
13350
+ if (opts.filename && typeof Object.defineProperty === "function") {
13351
+ let filename = opts.filename;
13352
+ let basename = path.basename(filename, path.extname(filename));
13353
+ try {
13354
+ Object.defineProperty(returnedFn, "name", {
13355
+ value: basename,
13356
+ writable: false,
13357
+ enumerable: false,
13358
+ configurable: true
13359
+ });
13360
+ } catch (e) {}
13361
+ }
13362
+ return returnedFn;
13363
+ },
13364
+ generateSource: function() {
13365
+ let opts = this.opts;
13366
+ if (opts.rmWhitespace) {
13367
+ this.templateText = this.templateText.replace(/[\r\n]+/g, `
13368
+ `).replace(/^\s+|\s+$/gm, "");
13369
+ }
13370
+ let self = this;
13371
+ let d = this.opts.delimiter;
13372
+ let o = this.opts.openDelimiter;
13373
+ let c = this.opts.closeDelimiter;
13374
+ let openWhitespaceSlurpTag = utils_default.escapeRegExpChars(o + d + "_");
13375
+ let closeWhitespaceSlurpTag = utils_default.escapeRegExpChars("_" + d + c);
13376
+ let openWhitespaceSlurpReplacement = o + d + "_";
13377
+ let closeWhitespaceSlurpReplacement = "_" + d + c;
13378
+ this.templateText = this.templateText.replace(new RegExp("[ \\t]*" + openWhitespaceSlurpTag, "gm"), openWhitespaceSlurpReplacement).replace(new RegExp(closeWhitespaceSlurpTag + "[ \\t]*", "gm"), closeWhitespaceSlurpReplacement);
13379
+ let matches = this.parseTemplateText();
13380
+ if (matches && matches.length) {
13381
+ matches.forEach(function(line, index) {
13382
+ let closing;
13383
+ if (line.indexOf(o + d) === 0 && line.indexOf(o + d + d) !== 0) {
13384
+ closing = matches[index + 2];
13385
+ if (!(closing == d + c || closing == "-" + d + c || closing == "_" + d + c)) {
13386
+ throw new Error('Could not find matching close tag for "' + line + '".');
13387
+ }
13388
+ }
13389
+ self.scanLine(line);
13390
+ });
13391
+ }
13392
+ },
13393
+ parseTemplateText: function() {
13394
+ let str = this.templateText;
13395
+ let pat = this.regex;
13396
+ let result = pat.exec(str);
13397
+ let arr = [];
13398
+ let firstPos;
13399
+ while (result) {
13400
+ firstPos = result.index;
13401
+ if (firstPos !== 0) {
13402
+ arr.push(str.substring(0, firstPos));
13403
+ str = str.slice(firstPos);
13404
+ }
13405
+ arr.push(result[0]);
13406
+ str = str.slice(result[0].length);
13407
+ result = pat.exec(str);
13408
+ }
13409
+ if (str) {
13410
+ arr.push(str);
13411
+ }
13412
+ return arr;
13413
+ },
13414
+ _addOutput: function(line) {
13415
+ if (this.truncate) {
13416
+ line = line.replace(/^(?:\r\n|\r|\n)/, "");
13417
+ this.truncate = false;
13418
+ }
13419
+ if (!line) {
13420
+ return line;
13421
+ }
13422
+ line = line.replace(/\\/g, "\\\\");
13423
+ line = line.replace(/\n/g, "\\n");
13424
+ line = line.replace(/\r/g, "\\r");
13425
+ line = line.replace(/"/g, "\\\"");
13426
+ this.source += ' ; __append("' + line + '")' + `
13427
+ `;
13428
+ },
13429
+ scanLine: function(line) {
13430
+ let self = this;
13431
+ let d = this.opts.delimiter;
13432
+ let o = this.opts.openDelimiter;
13433
+ let c = this.opts.closeDelimiter;
13434
+ let newLineCount = 0;
13435
+ newLineCount = line.split(`
13436
+ `).length - 1;
13437
+ switch (line) {
13438
+ case o + d:
13439
+ case o + d + "_":
13440
+ this.mode = Template.modes.EVAL;
13441
+ break;
13442
+ case o + d + "=":
13443
+ this.mode = Template.modes.ESCAPED;
13444
+ break;
13445
+ case o + d + "-":
13446
+ this.mode = Template.modes.RAW;
13447
+ break;
13448
+ case o + d + "#":
13449
+ this.mode = Template.modes.COMMENT;
13450
+ break;
13451
+ case o + d + d:
13452
+ this.mode = Template.modes.LITERAL;
13453
+ this.source += ' ; __append("' + line.replace(o + d + d, o + d) + '")' + `
13454
+ `;
13455
+ break;
13456
+ case d + d + c:
13457
+ this.mode = Template.modes.LITERAL;
13458
+ this.source += ' ; __append("' + line.replace(d + d + c, d + c) + '")' + `
13459
+ `;
13460
+ break;
13461
+ case d + c:
13462
+ case "-" + d + c:
13463
+ case "_" + d + c:
13464
+ if (this.mode == Template.modes.LITERAL) {
13465
+ this._addOutput(line);
13466
+ }
13467
+ this.mode = null;
13468
+ this.truncate = line.indexOf("-") === 0 || line.indexOf("_") === 0;
13469
+ break;
13470
+ default:
13471
+ if (this.mode) {
13472
+ switch (this.mode) {
13473
+ case Template.modes.EVAL:
13474
+ case Template.modes.ESCAPED:
13475
+ case Template.modes.RAW:
13476
+ if (line.lastIndexOf("//") > line.lastIndexOf(`
13477
+ `)) {
13478
+ line += `
13479
+ `;
13480
+ }
13481
+ }
13482
+ switch (this.mode) {
13483
+ case Template.modes.EVAL:
13484
+ this.source += " ; " + line + `
13485
+ `;
13486
+ break;
13487
+ case Template.modes.ESCAPED:
13488
+ this.source += " ; __append(escapeFn(" + stripSemi(line) + "))" + `
13489
+ `;
13490
+ break;
13491
+ case Template.modes.RAW:
13492
+ this.source += " ; __append(" + stripSemi(line) + ")" + `
13493
+ `;
13494
+ break;
13495
+ case Template.modes.COMMENT:
13496
+ break;
13497
+ case Template.modes.LITERAL:
13498
+ this._addOutput(line);
13499
+ break;
13500
+ }
13501
+ } else {
13502
+ this._addOutput(line);
13503
+ }
13504
+ }
13505
+ if (self.opts.compileDebug && newLineCount) {
13506
+ this.currentLine += newLineCount;
13507
+ this.source += " ; __line = " + this.currentLine + `
13508
+ `;
13509
+ }
13510
+ }
13511
+ };
13512
+ ejs.escapeXML = utils_default.escapeXML;
13513
+ ejs.__express = ejs.renderFile;
13514
+ if (typeof window != "undefined") {
13515
+ window.ejs = ejs;
13516
+ }
13517
+ if (typeof module_ejs != "undefined") {
13518
+ module_ejs.exports = ejs;
13519
+ }
13520
+ var ejs_default = ejs;
13521
+
13600
13522
  // src/dashboard/server.ts
13601
- var import_ejs = __toESM(require_ejs(), 1);
13602
- var __dirname2 = path.dirname(fileURLToPath(import.meta.url));
13523
+ var __dirname2 = path2.dirname(fileURLToPath(import.meta.url));
13603
13524
  async function startServer(port, projectDir) {
13604
- const viewsPath = path.join(__dirname2, "views");
13605
- const portFile = path.join(projectDir, ".dashboard", "port");
13525
+ const viewsPath = path2.join(__dirname2, "views");
13526
+ const portFile = path2.join(projectDir, ".dashboard", "port");
13606
13527
  const server = http2.createServer(async (req, res) => {
13607
13528
  if (req.url === "/health") {
13608
13529
  res.writeHead(200, { "Content-Type": "application/json" });
@@ -13612,8 +13533,8 @@ async function startServer(port, projectDir) {
13612
13533
  const data = readDashboardData(projectDir);
13613
13534
  if (req.url === "/refresh" || req.url === "/") {
13614
13535
  try {
13615
- const template = fs.readFileSync(path.join(viewsPath, "index.ejs"), "utf-8");
13616
- const html = import_ejs.default.render(template, data);
13536
+ const template = fs2.readFileSync(path2.join(viewsPath, "index.ejs"), "utf-8");
13537
+ const html = ejs_default.render(template, data);
13617
13538
  res.writeHead(200, { "Content-Type": "text/html" });
13618
13539
  res.end(html);
13619
13540
  } catch (err) {
@@ -13625,7 +13546,7 @@ async function startServer(port, projectDir) {
13625
13546
  res.writeHead(404);
13626
13547
  res.end("Not Found");
13627
13548
  });
13628
- fs.writeFileSync(portFile, String(port), "utf-8");
13549
+ fs2.writeFileSync(portFile, String(port), "utf-8");
13629
13550
  server.listen(port, () => {
13630
13551
  console.log(`Dashboard server running on port ${port}`);
13631
13552
  });