@formfeed/mcp 0.3.13 → 0.3.15
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/README.md +7 -6
- package/THIRD_PARTY_LICENSES.md +1 -1
- package/bin/formfeed-mcp.mjs +485 -246
- package/package.json +1 -1
package/bin/formfeed-mcp.mjs
CHANGED
|
@@ -4601,9 +4601,9 @@ var require_lib = __commonJS({
|
|
|
4601
4601
|
}
|
|
4602
4602
|
});
|
|
4603
4603
|
|
|
4604
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4604
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/utils.js
|
|
4605
4605
|
var require_utils3 = __commonJS({
|
|
4606
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4606
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports) {
|
|
4607
4607
|
"use strict";
|
|
4608
4608
|
exports.__esModule = true;
|
|
4609
4609
|
exports.extend = extend;
|
|
@@ -4662,7 +4662,7 @@ var require_utils3 = __commonJS({
|
|
|
4662
4662
|
}
|
|
4663
4663
|
function escapeExpression(string) {
|
|
4664
4664
|
if (typeof string !== "string") {
|
|
4665
|
-
if (string && string.toHTML) {
|
|
4665
|
+
if (string && typeof string.toHTML === "function") {
|
|
4666
4666
|
return string.toHTML();
|
|
4667
4667
|
} else if (string == null) {
|
|
4668
4668
|
return "";
|
|
@@ -4700,19 +4700,21 @@ var require_utils3 = __commonJS({
|
|
|
4700
4700
|
}
|
|
4701
4701
|
});
|
|
4702
4702
|
|
|
4703
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4703
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/exception.js
|
|
4704
4704
|
var require_exception = __commonJS({
|
|
4705
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4705
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/exception.js"(exports, module) {
|
|
4706
4706
|
"use strict";
|
|
4707
4707
|
exports.__esModule = true;
|
|
4708
4708
|
var errorProps = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"];
|
|
4709
4709
|
function Exception(message2, node) {
|
|
4710
4710
|
var loc = node && node.loc, line2 = void 0, endLineNumber = void 0, column = void 0, endColumn = void 0;
|
|
4711
|
-
if (loc) {
|
|
4711
|
+
if (loc && loc.start) {
|
|
4712
4712
|
line2 = loc.start.line;
|
|
4713
|
-
endLineNumber = loc.end.line;
|
|
4714
4713
|
column = loc.start.column;
|
|
4715
|
-
|
|
4714
|
+
if (loc.end) {
|
|
4715
|
+
endLineNumber = loc.end.line;
|
|
4716
|
+
endColumn = loc.end.column;
|
|
4717
|
+
}
|
|
4716
4718
|
message2 += " - " + line2 + ":" + column;
|
|
4717
4719
|
}
|
|
4718
4720
|
var tmp = Error.prototype.constructor.call(this, message2);
|
|
@@ -4749,9 +4751,9 @@ var require_exception = __commonJS({
|
|
|
4749
4751
|
}
|
|
4750
4752
|
});
|
|
4751
4753
|
|
|
4752
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4754
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js
|
|
4753
4755
|
var require_block_helper_missing = __commonJS({
|
|
4754
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4756
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(exports, module) {
|
|
4755
4757
|
"use strict";
|
|
4756
4758
|
exports.__esModule = true;
|
|
4757
4759
|
var _utils = require_utils3();
|
|
@@ -4785,9 +4787,9 @@ var require_block_helper_missing = __commonJS({
|
|
|
4785
4787
|
}
|
|
4786
4788
|
});
|
|
4787
4789
|
|
|
4788
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4790
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js
|
|
4789
4791
|
var require_each = __commonJS({
|
|
4790
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4792
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(exports, module) {
|
|
4791
4793
|
"use strict";
|
|
4792
4794
|
exports.__esModule = true;
|
|
4793
4795
|
function _interopRequireDefault(obj) {
|
|
@@ -4796,6 +4798,15 @@ var require_each = __commonJS({
|
|
|
4796
4798
|
var _utils = require_utils3();
|
|
4797
4799
|
var _exception = require_exception();
|
|
4798
4800
|
var _exception2 = _interopRequireDefault(_exception);
|
|
4801
|
+
function closeIterator(iterator) {
|
|
4802
|
+
try {
|
|
4803
|
+
var _close = iterator["return"];
|
|
4804
|
+
if (_utils.isFunction(_close)) {
|
|
4805
|
+
_close.call(iterator);
|
|
4806
|
+
}
|
|
4807
|
+
} catch (closeError) {
|
|
4808
|
+
}
|
|
4809
|
+
}
|
|
4799
4810
|
exports["default"] = function(instance) {
|
|
4800
4811
|
instance.registerHelper("each", function(context, options) {
|
|
4801
4812
|
if (!options) {
|
|
@@ -4811,7 +4822,7 @@ var require_each = __commonJS({
|
|
|
4811
4822
|
if (options.data) {
|
|
4812
4823
|
data = _utils.createFrame(options.data);
|
|
4813
4824
|
}
|
|
4814
|
-
function execIteration(field, index, last) {
|
|
4825
|
+
function execIteration(field, index, last, value) {
|
|
4815
4826
|
if (data) {
|
|
4816
4827
|
data.key = field;
|
|
4817
4828
|
data.index = index;
|
|
@@ -4821,40 +4832,46 @@ var require_each = __commonJS({
|
|
|
4821
4832
|
data.contextPath = contextPath + field;
|
|
4822
4833
|
}
|
|
4823
4834
|
}
|
|
4824
|
-
ret = ret + fn(
|
|
4835
|
+
ret = ret + fn(value, {
|
|
4825
4836
|
data,
|
|
4826
|
-
blockParams: _utils.blockParams([
|
|
4837
|
+
blockParams: _utils.blockParams([value, field], [contextPath + field, null])
|
|
4827
4838
|
});
|
|
4828
4839
|
}
|
|
4829
4840
|
if (context && typeof context === "object") {
|
|
4830
4841
|
if (_utils.isArray(context)) {
|
|
4831
4842
|
for (var j2 = context.length; i < j2; i++) {
|
|
4832
4843
|
if (i in context) {
|
|
4833
|
-
execIteration(i, i, i === context.length - 1);
|
|
4844
|
+
execIteration(i, i, i === context.length - 1, context[i]);
|
|
4834
4845
|
}
|
|
4835
4846
|
}
|
|
4836
4847
|
} else if (typeof Symbol === "function" && context[Symbol.iterator]) {
|
|
4837
|
-
var newContext = [];
|
|
4838
4848
|
var iterator = context[Symbol.iterator]();
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4849
|
+
var current = iterator.next();
|
|
4850
|
+
while (!current.done) {
|
|
4851
|
+
var next = iterator.next();
|
|
4852
|
+
try {
|
|
4853
|
+
execIteration(i, i, next.done, current.value);
|
|
4854
|
+
} catch (e) {
|
|
4855
|
+
if (!next.done) {
|
|
4856
|
+
closeIterator(iterator);
|
|
4857
|
+
}
|
|
4858
|
+
throw e;
|
|
4859
|
+
}
|
|
4860
|
+
current = next;
|
|
4861
|
+
i++;
|
|
4845
4862
|
}
|
|
4846
4863
|
} else {
|
|
4847
4864
|
(function() {
|
|
4848
4865
|
var priorKey = void 0;
|
|
4849
4866
|
Object.keys(context).forEach(function(key) {
|
|
4850
4867
|
if (priorKey !== void 0) {
|
|
4851
|
-
execIteration(priorKey, i - 1);
|
|
4868
|
+
execIteration(priorKey, i - 1, false, context[priorKey]);
|
|
4852
4869
|
}
|
|
4853
4870
|
priorKey = key;
|
|
4854
4871
|
i++;
|
|
4855
4872
|
});
|
|
4856
4873
|
if (priorKey !== void 0) {
|
|
4857
|
-
execIteration(priorKey, i - 1, true);
|
|
4874
|
+
execIteration(priorKey, i - 1, true, context[priorKey]);
|
|
4858
4875
|
}
|
|
4859
4876
|
})();
|
|
4860
4877
|
}
|
|
@@ -4869,9 +4886,9 @@ var require_each = __commonJS({
|
|
|
4869
4886
|
}
|
|
4870
4887
|
});
|
|
4871
4888
|
|
|
4872
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4889
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js
|
|
4873
4890
|
var require_helper_missing = __commonJS({
|
|
4874
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4891
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(exports, module) {
|
|
4875
4892
|
"use strict";
|
|
4876
4893
|
exports.__esModule = true;
|
|
4877
4894
|
function _interopRequireDefault(obj) {
|
|
@@ -4892,9 +4909,9 @@ var require_helper_missing = __commonJS({
|
|
|
4892
4909
|
}
|
|
4893
4910
|
});
|
|
4894
4911
|
|
|
4895
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4912
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js
|
|
4896
4913
|
var require_if = __commonJS({
|
|
4897
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4914
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(exports, module) {
|
|
4898
4915
|
"use strict";
|
|
4899
4916
|
exports.__esModule = true;
|
|
4900
4917
|
function _interopRequireDefault(obj) {
|
|
@@ -4932,9 +4949,9 @@ var require_if = __commonJS({
|
|
|
4932
4949
|
}
|
|
4933
4950
|
});
|
|
4934
4951
|
|
|
4935
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4952
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js
|
|
4936
4953
|
var require_log = __commonJS({
|
|
4937
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4954
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(exports, module) {
|
|
4938
4955
|
"use strict";
|
|
4939
4956
|
exports.__esModule = true;
|
|
4940
4957
|
exports["default"] = function(instance) {
|
|
@@ -4957,9 +4974,9 @@ var require_log = __commonJS({
|
|
|
4957
4974
|
}
|
|
4958
4975
|
});
|
|
4959
4976
|
|
|
4960
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4977
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js
|
|
4961
4978
|
var require_lookup = __commonJS({
|
|
4962
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4979
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(exports, module) {
|
|
4963
4980
|
"use strict";
|
|
4964
4981
|
exports.__esModule = true;
|
|
4965
4982
|
exports["default"] = function(instance) {
|
|
@@ -4974,9 +4991,9 @@ var require_lookup = __commonJS({
|
|
|
4974
4991
|
}
|
|
4975
4992
|
});
|
|
4976
4993
|
|
|
4977
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
4994
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js
|
|
4978
4995
|
var require_with = __commonJS({
|
|
4979
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
4996
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(exports, module) {
|
|
4980
4997
|
"use strict";
|
|
4981
4998
|
exports.__esModule = true;
|
|
4982
4999
|
function _interopRequireDefault(obj) {
|
|
@@ -5013,9 +5030,9 @@ var require_with = __commonJS({
|
|
|
5013
5030
|
}
|
|
5014
5031
|
});
|
|
5015
5032
|
|
|
5016
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5033
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers.js
|
|
5017
5034
|
var require_helpers = __commonJS({
|
|
5018
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5035
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/helpers.js"(exports) {
|
|
5019
5036
|
"use strict";
|
|
5020
5037
|
exports.__esModule = true;
|
|
5021
5038
|
exports.registerDefaultHelpers = registerDefaultHelpers;
|
|
@@ -5057,9 +5074,9 @@ var require_helpers = __commonJS({
|
|
|
5057
5074
|
}
|
|
5058
5075
|
});
|
|
5059
5076
|
|
|
5060
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5077
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js
|
|
5061
5078
|
var require_inline = __commonJS({
|
|
5062
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5079
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(exports, module) {
|
|
5063
5080
|
"use strict";
|
|
5064
5081
|
exports.__esModule = true;
|
|
5065
5082
|
var _utils = require_utils3();
|
|
@@ -5084,9 +5101,9 @@ var require_inline = __commonJS({
|
|
|
5084
5101
|
}
|
|
5085
5102
|
});
|
|
5086
5103
|
|
|
5087
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5104
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/decorators.js
|
|
5088
5105
|
var require_decorators = __commonJS({
|
|
5089
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5106
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/decorators.js"(exports) {
|
|
5090
5107
|
"use strict";
|
|
5091
5108
|
exports.__esModule = true;
|
|
5092
5109
|
exports.registerDefaultDecorators = registerDefaultDecorators;
|
|
@@ -5101,9 +5118,9 @@ var require_decorators = __commonJS({
|
|
|
5101
5118
|
}
|
|
5102
5119
|
});
|
|
5103
5120
|
|
|
5104
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5121
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/logger.js
|
|
5105
5122
|
var require_logger = __commonJS({
|
|
5106
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5123
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/logger.js"(exports, module) {
|
|
5107
5124
|
"use strict";
|
|
5108
5125
|
exports.__esModule = true;
|
|
5109
5126
|
var _utils = require_utils3();
|
|
@@ -5142,13 +5159,14 @@ var require_logger = __commonJS({
|
|
|
5142
5159
|
}
|
|
5143
5160
|
});
|
|
5144
5161
|
|
|
5145
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5162
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
|
|
5146
5163
|
var require_proto_access = __commonJS({
|
|
5147
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5164
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(exports) {
|
|
5148
5165
|
"use strict";
|
|
5149
5166
|
exports.__esModule = true;
|
|
5150
5167
|
exports.createProtoAccessControl = createProtoAccessControl;
|
|
5151
5168
|
exports.resultIsAllowed = resultIsAllowed;
|
|
5169
|
+
exports.isPrototypeConstructor = isPrototypeConstructor;
|
|
5152
5170
|
exports.resetLoggedProperties = resetLoggedProperties;
|
|
5153
5171
|
function _interopRequireDefault(obj) {
|
|
5154
5172
|
return obj && obj.__esModule ? obj : { "default": obj };
|
|
@@ -5186,6 +5204,9 @@ var require_proto_access = __commonJS({
|
|
|
5186
5204
|
return checkWhiteList(protoAccessControl.properties, propertyName);
|
|
5187
5205
|
}
|
|
5188
5206
|
}
|
|
5207
|
+
function isPrototypeConstructor(parent, propertyName, result) {
|
|
5208
|
+
return propertyName === "constructor" && typeof result === "function" && parent === result.prototype;
|
|
5209
|
+
}
|
|
5189
5210
|
function checkWhiteList(protoAccessControlForType, propertyName) {
|
|
5190
5211
|
if (protoAccessControlForType.whitelist[propertyName] !== void 0) {
|
|
5191
5212
|
return protoAccessControlForType.whitelist[propertyName] === true;
|
|
@@ -5210,9 +5231,9 @@ var require_proto_access = __commonJS({
|
|
|
5210
5231
|
}
|
|
5211
5232
|
});
|
|
5212
5233
|
|
|
5213
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5234
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/base.js
|
|
5214
5235
|
var require_base = __commonJS({
|
|
5215
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5236
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/base.js"(exports) {
|
|
5216
5237
|
"use strict";
|
|
5217
5238
|
exports.__esModule = true;
|
|
5218
5239
|
exports.HandlebarsEnvironment = HandlebarsEnvironment;
|
|
@@ -5227,7 +5248,7 @@ var require_base = __commonJS({
|
|
|
5227
5248
|
var _logger = require_logger();
|
|
5228
5249
|
var _logger2 = _interopRequireDefault(_logger);
|
|
5229
5250
|
var _internalProtoAccess = require_proto_access();
|
|
5230
|
-
var VERSION = "4.7.
|
|
5251
|
+
var VERSION = "4.7.10";
|
|
5231
5252
|
exports.VERSION = VERSION;
|
|
5232
5253
|
var COMPILER_REVISION = 8;
|
|
5233
5254
|
exports.COMPILER_REVISION = COMPILER_REVISION;
|
|
@@ -5311,9 +5332,9 @@ var require_base = __commonJS({
|
|
|
5311
5332
|
}
|
|
5312
5333
|
});
|
|
5313
5334
|
|
|
5314
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5335
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/safe-string.js
|
|
5315
5336
|
var require_safe_string = __commonJS({
|
|
5316
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5337
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports, module) {
|
|
5317
5338
|
"use strict";
|
|
5318
5339
|
exports.__esModule = true;
|
|
5319
5340
|
function SafeString(string) {
|
|
@@ -5327,9 +5348,9 @@ var require_safe_string = __commonJS({
|
|
|
5327
5348
|
}
|
|
5328
5349
|
});
|
|
5329
5350
|
|
|
5330
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5351
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js
|
|
5331
5352
|
var require_wrapHelper = __commonJS({
|
|
5332
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5353
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(exports) {
|
|
5333
5354
|
"use strict";
|
|
5334
5355
|
exports.__esModule = true;
|
|
5335
5356
|
exports.wrapHelper = wrapHelper;
|
|
@@ -5347,9 +5368,9 @@ var require_wrapHelper = __commonJS({
|
|
|
5347
5368
|
}
|
|
5348
5369
|
});
|
|
5349
5370
|
|
|
5350
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5371
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/runtime.js
|
|
5351
5372
|
var require_runtime = __commonJS({
|
|
5352
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5373
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/runtime.js"(exports) {
|
|
5353
5374
|
"use strict";
|
|
5354
5375
|
exports.__esModule = true;
|
|
5355
5376
|
exports.checkRevision = checkRevision;
|
|
@@ -5416,7 +5437,13 @@ var require_runtime = __commonJS({
|
|
|
5416
5437
|
options.hooks = this.hooks;
|
|
5417
5438
|
options.protoAccessControl = this.protoAccessControl;
|
|
5418
5439
|
var result = env.VM.invokePartial.call(this, partial, context, options);
|
|
5440
|
+
if (result == null && Utils.isFunction(partial)) {
|
|
5441
|
+
throw new _exception2["default"]("The partial " + options.name + " returned no output: partials must return a string");
|
|
5442
|
+
}
|
|
5419
5443
|
if (result == null && env.compile) {
|
|
5444
|
+
if (typeof partial !== "string") {
|
|
5445
|
+
throw new _exception2["default"]("The partial " + options.name + " could not be compiled: partials must be strings or functions returning strings");
|
|
5446
|
+
}
|
|
5420
5447
|
options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
|
|
5421
5448
|
result = options.partials[options.name](context, options);
|
|
5422
5449
|
}
|
|
@@ -5450,7 +5477,7 @@ var require_runtime = __commonJS({
|
|
|
5450
5477
|
if (result == null) {
|
|
5451
5478
|
return result;
|
|
5452
5479
|
}
|
|
5453
|
-
if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
|
|
5480
|
+
if (Object.prototype.hasOwnProperty.call(parent, propertyName) && !_internalProtoAccess.isPrototypeConstructor(parent, propertyName, result)) {
|
|
5454
5481
|
return result;
|
|
5455
5482
|
}
|
|
5456
5483
|
if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
|
|
@@ -5585,7 +5612,7 @@ var require_runtime = __commonJS({
|
|
|
5585
5612
|
} else {
|
|
5586
5613
|
partial = lookupOwnProperty(options.partials, options.name);
|
|
5587
5614
|
}
|
|
5588
|
-
} else if (
|
|
5615
|
+
} else if (typeof partial !== "function" && !options.name) {
|
|
5589
5616
|
options.name = partial;
|
|
5590
5617
|
partial = lookupOwnProperty(options.partials, partial);
|
|
5591
5618
|
}
|
|
@@ -5662,9 +5689,9 @@ var require_runtime = __commonJS({
|
|
|
5662
5689
|
}
|
|
5663
5690
|
});
|
|
5664
5691
|
|
|
5665
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5692
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js
|
|
5666
5693
|
var require_no_conflict = __commonJS({
|
|
5667
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5694
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(exports, module) {
|
|
5668
5695
|
"use strict";
|
|
5669
5696
|
exports.__esModule = true;
|
|
5670
5697
|
exports["default"] = function(Handlebars2) {
|
|
@@ -5688,9 +5715,9 @@ var require_no_conflict = __commonJS({
|
|
|
5688
5715
|
}
|
|
5689
5716
|
});
|
|
5690
5717
|
|
|
5691
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5718
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars.runtime.js
|
|
5692
5719
|
var require_handlebars_runtime = __commonJS({
|
|
5693
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5720
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars.runtime.js"(exports, module) {
|
|
5694
5721
|
"use strict";
|
|
5695
5722
|
exports.__esModule = true;
|
|
5696
5723
|
function _interopRequireDefault(obj) {
|
|
@@ -5744,9 +5771,9 @@ var require_handlebars_runtime = __commonJS({
|
|
|
5744
5771
|
}
|
|
5745
5772
|
});
|
|
5746
5773
|
|
|
5747
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5774
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js
|
|
5748
5775
|
var require_ast = __commonJS({
|
|
5749
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5776
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(exports, module) {
|
|
5750
5777
|
"use strict";
|
|
5751
5778
|
exports.__esModule = true;
|
|
5752
5779
|
var AST = {
|
|
@@ -5773,9 +5800,9 @@ var require_ast = __commonJS({
|
|
|
5773
5800
|
}
|
|
5774
5801
|
});
|
|
5775
5802
|
|
|
5776
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
5803
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js
|
|
5777
5804
|
var require_parser2 = __commonJS({
|
|
5778
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
5805
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(exports, module) {
|
|
5779
5806
|
"use strict";
|
|
5780
5807
|
exports.__esModule = true;
|
|
5781
5808
|
var handlebars = (function() {
|
|
@@ -6483,9 +6510,19 @@ var require_parser2 = __commonJS({
|
|
|
6483
6510
|
}
|
|
6484
6511
|
});
|
|
6485
6512
|
|
|
6486
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
6513
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/node-types.js
|
|
6514
|
+
var require_node_types = __commonJS({
|
|
6515
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/node-types.js"(exports) {
|
|
6516
|
+
"use strict";
|
|
6517
|
+
exports.__esModule = true;
|
|
6518
|
+
var NODE_TYPES = ["Program", "BlockStatement", "DecoratorBlock", "PartialStatement", "PartialBlockStatement", "Decorator", "MustacheStatement", "ContentStatement", "CommentStatement", "SubExpression", "PathExpression", "StringLiteral", "NumberLiteral", "BooleanLiteral", "UndefinedLiteral", "NullLiteral", "Hash", "HashPair"];
|
|
6519
|
+
exports.NODE_TYPES = NODE_TYPES;
|
|
6520
|
+
}
|
|
6521
|
+
});
|
|
6522
|
+
|
|
6523
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js
|
|
6487
6524
|
var require_visitor = __commonJS({
|
|
6488
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
6525
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(exports, module) {
|
|
6489
6526
|
"use strict";
|
|
6490
6527
|
exports.__esModule = true;
|
|
6491
6528
|
function _interopRequireDefault(obj) {
|
|
@@ -6493,9 +6530,14 @@ var require_visitor = __commonJS({
|
|
|
6493
6530
|
}
|
|
6494
6531
|
var _exception = require_exception();
|
|
6495
6532
|
var _exception2 = _interopRequireDefault(_exception);
|
|
6533
|
+
var _utils = require_utils3();
|
|
6534
|
+
var _nodeTypes = require_node_types();
|
|
6496
6535
|
function Visitor() {
|
|
6497
6536
|
this.parents = [];
|
|
6498
6537
|
}
|
|
6538
|
+
function isDispatchable(visitor, type) {
|
|
6539
|
+
return _utils.indexOf(_nodeTypes.NODE_TYPES, type) !== -1 || !(type in Visitor.prototype) && typeof visitor[type] === "function";
|
|
6540
|
+
}
|
|
6499
6541
|
Visitor.prototype = {
|
|
6500
6542
|
constructor: Visitor,
|
|
6501
6543
|
mutating: false,
|
|
@@ -6503,7 +6545,7 @@ var require_visitor = __commonJS({
|
|
|
6503
6545
|
acceptKey: function acceptKey(node, name) {
|
|
6504
6546
|
var value = this.accept(node[name]);
|
|
6505
6547
|
if (this.mutating) {
|
|
6506
|
-
if (value && !
|
|
6548
|
+
if (value && !isDispatchable(this, value.type)) {
|
|
6507
6549
|
throw new _exception2["default"]('Unexpected node type "' + value.type + '" found when accepting ' + name + " on " + node.type);
|
|
6508
6550
|
}
|
|
6509
6551
|
node[name] = value;
|
|
@@ -6533,7 +6575,7 @@ var require_visitor = __commonJS({
|
|
|
6533
6575
|
if (!object) {
|
|
6534
6576
|
return;
|
|
6535
6577
|
}
|
|
6536
|
-
if (!this[object.type]) {
|
|
6578
|
+
if (!isDispatchable(this, object.type) || !this[object.type]) {
|
|
6537
6579
|
throw new _exception2["default"]("Unknown type: " + object.type, object);
|
|
6538
6580
|
}
|
|
6539
6581
|
if (this.current) {
|
|
@@ -6604,9 +6646,9 @@ var require_visitor = __commonJS({
|
|
|
6604
6646
|
}
|
|
6605
6647
|
});
|
|
6606
6648
|
|
|
6607
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
6649
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js
|
|
6608
6650
|
var require_whitespace_control = __commonJS({
|
|
6609
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
6651
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(exports, module) {
|
|
6610
6652
|
"use strict";
|
|
6611
6653
|
exports.__esModule = true;
|
|
6612
6654
|
function _interopRequireDefault(obj) {
|
|
@@ -6640,7 +6682,7 @@ var require_whitespace_control = __commonJS({
|
|
|
6640
6682
|
omitRight(body, i);
|
|
6641
6683
|
if (omitLeft(body, i)) {
|
|
6642
6684
|
if (current.type === "PartialStatement") {
|
|
6643
|
-
current.indent = /([ \t]
|
|
6685
|
+
current.indent = /(?:^|[^ \t])([ \t]+)$/.exec(body[i - 1].original)[1];
|
|
6644
6686
|
}
|
|
6645
6687
|
}
|
|
6646
6688
|
}
|
|
@@ -6716,7 +6758,7 @@ var require_whitespace_control = __commonJS({
|
|
|
6716
6758
|
return isRoot;
|
|
6717
6759
|
}
|
|
6718
6760
|
if (prev.type === "ContentStatement") {
|
|
6719
|
-
return (sibling || !isRoot ?
|
|
6761
|
+
return (sibling || !isRoot ? /(?:^|\S)[^\S\n]*\n\s*$/ : /^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(prev.original);
|
|
6720
6762
|
}
|
|
6721
6763
|
}
|
|
6722
6764
|
function isNextWhitespace(body, i, isRoot) {
|
|
@@ -6746,7 +6788,7 @@ var require_whitespace_control = __commonJS({
|
|
|
6746
6788
|
return;
|
|
6747
6789
|
}
|
|
6748
6790
|
var original = current.value;
|
|
6749
|
-
current.value = current.value.replace(multiple ?
|
|
6791
|
+
current.value = current.value.replace(multiple ? /(^|\S)\s+$/ : /(^|[^ \t])[ \t]+$/, "$1");
|
|
6750
6792
|
current.leftStripped = current.value !== original;
|
|
6751
6793
|
return current.leftStripped;
|
|
6752
6794
|
}
|
|
@@ -6755,9 +6797,9 @@ var require_whitespace_control = __commonJS({
|
|
|
6755
6797
|
}
|
|
6756
6798
|
});
|
|
6757
6799
|
|
|
6758
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
6800
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js
|
|
6759
6801
|
var require_helpers2 = __commonJS({
|
|
6760
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
6802
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(exports) {
|
|
6761
6803
|
"use strict";
|
|
6762
6804
|
exports.__esModule = true;
|
|
6763
6805
|
exports.SourceLocation = SourceLocation;
|
|
@@ -6943,9 +6985,9 @@ var require_helpers2 = __commonJS({
|
|
|
6943
6985
|
}
|
|
6944
6986
|
});
|
|
6945
6987
|
|
|
6946
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
6988
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js
|
|
6947
6989
|
var require_base2 = __commonJS({
|
|
6948
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
6990
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(exports) {
|
|
6949
6991
|
"use strict";
|
|
6950
6992
|
exports.__esModule = true;
|
|
6951
6993
|
exports.parseWithoutProcessing = parseWithoutProcessing;
|
|
@@ -6973,15 +7015,12 @@ var require_base2 = __commonJS({
|
|
|
6973
7015
|
var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
|
|
6974
7016
|
var _helpers = require_helpers2();
|
|
6975
7017
|
var Helpers = _interopRequireWildcard(_helpers);
|
|
6976
|
-
var _exception = require_exception();
|
|
6977
|
-
var _exception2 = _interopRequireDefault(_exception);
|
|
6978
7018
|
var _utils = require_utils3();
|
|
6979
7019
|
exports.parser = _parser2["default"];
|
|
6980
7020
|
var yy = {};
|
|
6981
7021
|
_utils.extend(yy, Helpers);
|
|
6982
7022
|
function parseWithoutProcessing(input, options) {
|
|
6983
7023
|
if (input.type === "Program") {
|
|
6984
|
-
validateInputAst(input);
|
|
6985
7024
|
return input;
|
|
6986
7025
|
}
|
|
6987
7026
|
_parser2["default"].yy = yy;
|
|
@@ -6996,57 +7035,12 @@ var require_base2 = __commonJS({
|
|
|
6996
7035
|
var strip = new _whitespaceControl2["default"](options);
|
|
6997
7036
|
return strip.accept(ast);
|
|
6998
7037
|
}
|
|
6999
|
-
function validateInputAst(ast) {
|
|
7000
|
-
validateAstNode(ast);
|
|
7001
|
-
}
|
|
7002
|
-
function validateAstNode(node) {
|
|
7003
|
-
if (node == null) {
|
|
7004
|
-
return;
|
|
7005
|
-
}
|
|
7006
|
-
if (Array.isArray(node)) {
|
|
7007
|
-
node.forEach(validateAstNode);
|
|
7008
|
-
return;
|
|
7009
|
-
}
|
|
7010
|
-
if (typeof node !== "object") {
|
|
7011
|
-
return;
|
|
7012
|
-
}
|
|
7013
|
-
if (node.type === "PathExpression") {
|
|
7014
|
-
if (!isValidDepth(node.depth)) {
|
|
7015
|
-
throw new _exception2["default"]("Invalid AST: PathExpression.depth must be an integer");
|
|
7016
|
-
}
|
|
7017
|
-
if (!Array.isArray(node.parts)) {
|
|
7018
|
-
throw new _exception2["default"]("Invalid AST: PathExpression.parts must be an array");
|
|
7019
|
-
}
|
|
7020
|
-
for (var i = 0; i < node.parts.length; i++) {
|
|
7021
|
-
if (typeof node.parts[i] !== "string") {
|
|
7022
|
-
throw new _exception2["default"]("Invalid AST: PathExpression.parts must only contain strings");
|
|
7023
|
-
}
|
|
7024
|
-
}
|
|
7025
|
-
} else if (node.type === "NumberLiteral") {
|
|
7026
|
-
if (typeof node.value !== "number" || !isFinite(node.value)) {
|
|
7027
|
-
throw new _exception2["default"]("Invalid AST: NumberLiteral.value must be a number");
|
|
7028
|
-
}
|
|
7029
|
-
} else if (node.type === "BooleanLiteral") {
|
|
7030
|
-
if (typeof node.value !== "boolean") {
|
|
7031
|
-
throw new _exception2["default"]("Invalid AST: BooleanLiteral.value must be a boolean");
|
|
7032
|
-
}
|
|
7033
|
-
}
|
|
7034
|
-
Object.keys(node).forEach(function(propertyName) {
|
|
7035
|
-
if (propertyName === "loc") {
|
|
7036
|
-
return;
|
|
7037
|
-
}
|
|
7038
|
-
validateAstNode(node[propertyName]);
|
|
7039
|
-
});
|
|
7040
|
-
}
|
|
7041
|
-
function isValidDepth(depth) {
|
|
7042
|
-
return typeof depth === "number" && isFinite(depth) && Math.floor(depth) === depth && depth >= 0;
|
|
7043
|
-
}
|
|
7044
7038
|
}
|
|
7045
7039
|
});
|
|
7046
7040
|
|
|
7047
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
7041
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js
|
|
7048
7042
|
var require_compiler = __commonJS({
|
|
7049
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
7043
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(exports) {
|
|
7050
7044
|
"use strict";
|
|
7051
7045
|
exports.__esModule = true;
|
|
7052
7046
|
exports.Compiler = Compiler;
|
|
@@ -7060,6 +7054,7 @@ var require_compiler = __commonJS({
|
|
|
7060
7054
|
var _utils = require_utils3();
|
|
7061
7055
|
var _ast = require_ast();
|
|
7062
7056
|
var _ast2 = _interopRequireDefault(_ast);
|
|
7057
|
+
var _nodeTypes = require_node_types();
|
|
7063
7058
|
var slice = [].slice;
|
|
7064
7059
|
function Compiler() {
|
|
7065
7060
|
}
|
|
@@ -7113,7 +7108,7 @@ var require_compiler = __commonJS({
|
|
|
7113
7108
|
return guid;
|
|
7114
7109
|
},
|
|
7115
7110
|
accept: function accept(node) {
|
|
7116
|
-
if (!this[node.type]) {
|
|
7111
|
+
if (_utils.indexOf(_nodeTypes.NODE_TYPES, node.type) === -1 || !this[node.type]) {
|
|
7117
7112
|
throw new _exception2["default"]("Unknown type: " + node.type, node);
|
|
7118
7113
|
}
|
|
7119
7114
|
this.sourceNode.unshift(node);
|
|
@@ -7122,6 +7117,7 @@ var require_compiler = __commonJS({
|
|
|
7122
7117
|
return ret;
|
|
7123
7118
|
},
|
|
7124
7119
|
Program: function Program(program) {
|
|
7120
|
+
validateBlockParams(program);
|
|
7125
7121
|
this.options.blockParams.unshift(program.blockParams);
|
|
7126
7122
|
var body = program.body, bodyLength = body.length;
|
|
7127
7123
|
for (var i = 0; i < bodyLength; i++) {
|
|
@@ -7205,6 +7201,9 @@ var require_compiler = __commonJS({
|
|
|
7205
7201
|
this.DecoratorBlock(decorator);
|
|
7206
7202
|
},
|
|
7207
7203
|
ContentStatement: function ContentStatement(content) {
|
|
7204
|
+
if (content.value != null && typeof content.value !== "string") {
|
|
7205
|
+
throw invalidAst(content, "value must be a string");
|
|
7206
|
+
}
|
|
7208
7207
|
if (content.value) {
|
|
7209
7208
|
this.opcode("appendContent", content.value);
|
|
7210
7209
|
}
|
|
@@ -7224,7 +7223,7 @@ var require_compiler = __commonJS({
|
|
|
7224
7223
|
},
|
|
7225
7224
|
ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
|
|
7226
7225
|
var path = sexpr.path, name = path.parts[0], isBlock = program != null || inverse != null;
|
|
7227
|
-
this.opcode("getContext", path
|
|
7226
|
+
this.opcode("getContext", validateDepth(path));
|
|
7228
7227
|
this.opcode("pushProgram", program);
|
|
7229
7228
|
this.opcode("pushProgram", inverse);
|
|
7230
7229
|
path.strict = true;
|
|
@@ -7251,27 +7250,32 @@ var require_compiler = __commonJS({
|
|
|
7251
7250
|
}
|
|
7252
7251
|
},
|
|
7253
7252
|
PathExpression: function PathExpression(path) {
|
|
7254
|
-
|
|
7255
|
-
|
|
7256
|
-
|
|
7253
|
+
var depth = validateDepth(path);
|
|
7254
|
+
var parts = validateParts(path);
|
|
7255
|
+
this.addDepth(depth);
|
|
7256
|
+
this.opcode("getContext", depth);
|
|
7257
|
+
var name = parts[0], scoped = _ast2["default"].helpers.scopedId(path), blockParamId = !depth && !scoped && this.blockParamIndex(name);
|
|
7257
7258
|
if (blockParamId) {
|
|
7258
|
-
this.opcode("lookupBlockParam", blockParamId,
|
|
7259
|
+
this.opcode("lookupBlockParam", blockParamId, parts);
|
|
7259
7260
|
} else if (!name) {
|
|
7260
7261
|
this.opcode("pushContext");
|
|
7261
7262
|
} else if (path.data) {
|
|
7262
7263
|
this.options.data = true;
|
|
7263
|
-
this.opcode("lookupData",
|
|
7264
|
+
this.opcode("lookupData", depth, parts, path.strict);
|
|
7264
7265
|
} else {
|
|
7265
|
-
this.opcode("lookupOnContext",
|
|
7266
|
+
this.opcode("lookupOnContext", parts, path.falsy, path.strict, scoped);
|
|
7266
7267
|
}
|
|
7267
7268
|
},
|
|
7268
7269
|
StringLiteral: function StringLiteral(string) {
|
|
7270
|
+
validateLiteral(string);
|
|
7269
7271
|
this.opcode("pushString", string.value);
|
|
7270
7272
|
},
|
|
7271
7273
|
NumberLiteral: function NumberLiteral(number) {
|
|
7274
|
+
validateLiteral(number);
|
|
7272
7275
|
this.opcode("pushLiteral", number.value);
|
|
7273
7276
|
},
|
|
7274
7277
|
BooleanLiteral: function BooleanLiteral(bool) {
|
|
7278
|
+
validateLiteral(bool);
|
|
7275
7279
|
this.opcode("pushLiteral", bool.value);
|
|
7276
7280
|
},
|
|
7277
7281
|
UndefinedLiteral: function UndefinedLiteral() {
|
|
@@ -7281,7 +7285,16 @@ var require_compiler = __commonJS({
|
|
|
7281
7285
|
this.opcode("pushLiteral", "null");
|
|
7282
7286
|
},
|
|
7283
7287
|
Hash: function Hash(hash) {
|
|
7284
|
-
var pairs = hash.pairs, i = 0, l3 =
|
|
7288
|
+
var pairs = hash.pairs, i = 0, l3 = void 0;
|
|
7289
|
+
if (!_utils.isArray(pairs)) {
|
|
7290
|
+
throw invalidAst(hash, "pairs must be an array");
|
|
7291
|
+
}
|
|
7292
|
+
l3 = pairs.length;
|
|
7293
|
+
for (var j2 = 0; j2 < l3; j2++) {
|
|
7294
|
+
if (!pairs[j2] || typeof pairs[j2].key !== "string") {
|
|
7295
|
+
throw invalidAst(hash, "pair keys must be strings");
|
|
7296
|
+
}
|
|
7297
|
+
}
|
|
7285
7298
|
this.opcode("pushHash");
|
|
7286
7299
|
for (; i < l3; i++) {
|
|
7287
7300
|
this.pushParam(pairs[i].value);
|
|
@@ -7306,6 +7319,7 @@ var require_compiler = __commonJS({
|
|
|
7306
7319
|
this.useDepths = true;
|
|
7307
7320
|
},
|
|
7308
7321
|
classifySexpr: function classifySexpr(sexpr) {
|
|
7322
|
+
validateParts(sexpr.path);
|
|
7309
7323
|
var isSimple = _ast2["default"].helpers.simpleId(sexpr.path);
|
|
7310
7324
|
var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
|
|
7311
7325
|
var isHelper = !isBlockParam && _ast2["default"].helpers.helperExpression(sexpr);
|
|
@@ -7332,15 +7346,20 @@ var require_compiler = __commonJS({
|
|
|
7332
7346
|
}
|
|
7333
7347
|
},
|
|
7334
7348
|
pushParam: function pushParam(val2) {
|
|
7349
|
+
validateLiteral(val2);
|
|
7335
7350
|
var value = val2.value != null ? val2.value : val2.original || "";
|
|
7351
|
+
var depth = validateDepth(val2);
|
|
7336
7352
|
if (this.stringParams) {
|
|
7353
|
+
if (typeof value !== "number" && typeof value !== "boolean") {
|
|
7354
|
+
value = String(value);
|
|
7355
|
+
}
|
|
7337
7356
|
if (value.replace) {
|
|
7338
7357
|
value = value.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".");
|
|
7339
7358
|
}
|
|
7340
|
-
if (
|
|
7341
|
-
this.addDepth(
|
|
7359
|
+
if (depth) {
|
|
7360
|
+
this.addDepth(depth);
|
|
7342
7361
|
}
|
|
7343
|
-
this.opcode("getContext",
|
|
7362
|
+
this.opcode("getContext", depth);
|
|
7344
7363
|
this.opcode("pushStringParam", value, val2.type);
|
|
7345
7364
|
if (val2.type === "SubExpression") {
|
|
7346
7365
|
this.accept(val2);
|
|
@@ -7348,8 +7367,8 @@ var require_compiler = __commonJS({
|
|
|
7348
7367
|
} else {
|
|
7349
7368
|
if (this.trackIds) {
|
|
7350
7369
|
var blockParamIndex = void 0;
|
|
7351
|
-
if (val2.parts && !_ast2["default"].helpers.scopedId(val2) && !
|
|
7352
|
-
blockParamIndex = this.blockParamIndex(val2
|
|
7370
|
+
if (val2.parts && !_ast2["default"].helpers.scopedId(val2) && !depth) {
|
|
7371
|
+
blockParamIndex = this.blockParamIndex(validateParts(val2)[0]);
|
|
7353
7372
|
}
|
|
7354
7373
|
if (blockParamIndex) {
|
|
7355
7374
|
var blockParamChild = val2.parts.slice(1).join(".");
|
|
@@ -7437,6 +7456,48 @@ var require_compiler = __commonJS({
|
|
|
7437
7456
|
};
|
|
7438
7457
|
return ret;
|
|
7439
7458
|
}
|
|
7459
|
+
function invalidAst(node, message2) {
|
|
7460
|
+
return new _exception2["default"]("Invalid AST: " + node.type + " " + message2, node);
|
|
7461
|
+
}
|
|
7462
|
+
function validateDepth(node) {
|
|
7463
|
+
var depth = node.depth;
|
|
7464
|
+
if (depth == null) {
|
|
7465
|
+
return 0;
|
|
7466
|
+
}
|
|
7467
|
+
if (typeof depth !== "number" || !isFinite(depth) || Math.floor(depth) !== depth || depth < 0) {
|
|
7468
|
+
throw invalidAst(node, "depth must be a non-negative integer");
|
|
7469
|
+
}
|
|
7470
|
+
return depth;
|
|
7471
|
+
}
|
|
7472
|
+
function validateLiteral(node) {
|
|
7473
|
+
var value = node.value;
|
|
7474
|
+
if (node.type === "StringLiteral" && typeof value !== "string") {
|
|
7475
|
+
throw invalidAst(node, "value must be a string");
|
|
7476
|
+
} else if (node.type === "NumberLiteral" && typeof value !== "number") {
|
|
7477
|
+
throw invalidAst(node, "value must be a number");
|
|
7478
|
+
} else if (node.type === "BooleanLiteral" && typeof value !== "boolean") {
|
|
7479
|
+
throw invalidAst(node, "value must be a boolean");
|
|
7480
|
+
}
|
|
7481
|
+
}
|
|
7482
|
+
function validateStringArray(node, value, name) {
|
|
7483
|
+
if (!_utils.isArray(value)) {
|
|
7484
|
+
throw invalidAst(node, name + " must be an array");
|
|
7485
|
+
}
|
|
7486
|
+
for (var i = 0; i < value.length; i++) {
|
|
7487
|
+
if (typeof value[i] !== "string") {
|
|
7488
|
+
throw invalidAst(node, name + " must only contain strings");
|
|
7489
|
+
}
|
|
7490
|
+
}
|
|
7491
|
+
return value;
|
|
7492
|
+
}
|
|
7493
|
+
function validateParts(path) {
|
|
7494
|
+
return validateStringArray(path, path.parts, "parts");
|
|
7495
|
+
}
|
|
7496
|
+
function validateBlockParams(program) {
|
|
7497
|
+
if (program.blockParams != null) {
|
|
7498
|
+
validateStringArray(program, program.blockParams, "blockParams");
|
|
7499
|
+
}
|
|
7500
|
+
}
|
|
7440
7501
|
function argEquals(a, b2) {
|
|
7441
7502
|
if (a === b2) {
|
|
7442
7503
|
return true;
|
|
@@ -9224,12 +9285,24 @@ var require_source_map = __commonJS({
|
|
|
9224
9285
|
}
|
|
9225
9286
|
});
|
|
9226
9287
|
|
|
9227
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
9288
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
|
|
9228
9289
|
var require_code_gen = __commonJS({
|
|
9229
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
9290
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(exports) {
|
|
9230
9291
|
"use strict";
|
|
9231
9292
|
exports.__esModule = true;
|
|
9293
|
+
exports.safeJsonLiteral = safeJsonLiteral;
|
|
9232
9294
|
var _utils = require_utils3();
|
|
9295
|
+
var NEEDS_ESCAPING = /[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/;
|
|
9296
|
+
var SCRIPT_DELIMITERS = /<(?=!--|\/?script)/gi;
|
|
9297
|
+
function escapeScriptDelimiters(code) {
|
|
9298
|
+
return code.replace(SCRIPT_DELIMITERS, "\\u003C");
|
|
9299
|
+
}
|
|
9300
|
+
function escapeSurrogate(surrogate) {
|
|
9301
|
+
return "\\u" + surrogate.charCodeAt(0).toString(16);
|
|
9302
|
+
}
|
|
9303
|
+
function safeJsonLiteral(value) {
|
|
9304
|
+
return escapeScriptDelimiters(JSON.stringify(value).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/[\ud800-\udfff]/g, escapeSurrogate));
|
|
9305
|
+
}
|
|
9233
9306
|
var SourceNode = void 0;
|
|
9234
9307
|
try {
|
|
9235
9308
|
if (typeof define !== "function" || !define.amd) {
|
|
@@ -9322,7 +9395,11 @@ var require_code_gen = __commonJS({
|
|
|
9322
9395
|
return this.wrap([fn, type ? "." + type + "(" : "(", params, ")"]);
|
|
9323
9396
|
},
|
|
9324
9397
|
quotedString: function quotedString(str2) {
|
|
9325
|
-
|
|
9398
|
+
str2 = str2 + "";
|
|
9399
|
+
if (!NEEDS_ESCAPING.test(str2)) {
|
|
9400
|
+
return '"' + str2 + '"';
|
|
9401
|
+
}
|
|
9402
|
+
return safeJsonLiteral(str2);
|
|
9326
9403
|
},
|
|
9327
9404
|
objectLiteral: function objectLiteral(obj) {
|
|
9328
9405
|
var _this = this;
|
|
@@ -9356,13 +9433,12 @@ var require_code_gen = __commonJS({
|
|
|
9356
9433
|
}
|
|
9357
9434
|
};
|
|
9358
9435
|
exports["default"] = CodeGen;
|
|
9359
|
-
module.exports = exports["default"];
|
|
9360
9436
|
}
|
|
9361
9437
|
});
|
|
9362
9438
|
|
|
9363
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
9439
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
|
|
9364
9440
|
var require_javascript_compiler = __commonJS({
|
|
9365
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
9441
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(exports, module) {
|
|
9366
9442
|
"use strict";
|
|
9367
9443
|
exports.__esModule = true;
|
|
9368
9444
|
function _interopRequireDefault(obj) {
|
|
@@ -9386,7 +9462,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
9386
9462
|
return this.internalNameLookup(parent, name);
|
|
9387
9463
|
},
|
|
9388
9464
|
depthedLookup: function depthedLookup(name) {
|
|
9389
|
-
return [this.aliasable("container.lookup"), "(depths, ",
|
|
9465
|
+
return [this.aliasable("container.lookup"), "(depths, ", this.quotedString(name), ")"];
|
|
9390
9466
|
},
|
|
9391
9467
|
compilerInfo: function compilerInfo() {
|
|
9392
9468
|
var revision = _base.COMPILER_REVISION, versions = _base.REVISION_CHANGES[revision];
|
|
@@ -9412,7 +9488,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
9412
9488
|
// END PUBLIC API
|
|
9413
9489
|
internalNameLookup: function internalNameLookup(parent, name) {
|
|
9414
9490
|
this.lookupPropertyFunctionIsUsed = true;
|
|
9415
|
-
return ["lookupProperty(", parent, ",",
|
|
9491
|
+
return ["lookupProperty(", parent, ",", this.quotedString(name), ")"];
|
|
9416
9492
|
},
|
|
9417
9493
|
lookupPropertyFunctionIsUsed: false,
|
|
9418
9494
|
compile: function compile(environment, options, context, asObject2) {
|
|
@@ -9951,7 +10027,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
9951
10027
|
delete options.name;
|
|
9952
10028
|
}
|
|
9953
10029
|
if (indent) {
|
|
9954
|
-
options.indent =
|
|
10030
|
+
options.indent = this.quotedString(indent);
|
|
9955
10031
|
}
|
|
9956
10032
|
options.helpers = "helpers";
|
|
9957
10033
|
options.partials = "partials";
|
|
@@ -9997,7 +10073,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
9997
10073
|
},
|
|
9998
10074
|
pushId: function pushId(type, name, child) {
|
|
9999
10075
|
if (type === "BlockParam") {
|
|
10000
|
-
this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " +
|
|
10076
|
+
this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + this.quotedString("." + child) : ""));
|
|
10001
10077
|
} else if (type === "PathExpression") {
|
|
10002
10078
|
this.pushString(name);
|
|
10003
10079
|
} else if (type === "SubExpression") {
|
|
@@ -10235,7 +10311,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
10235
10311
|
},
|
|
10236
10312
|
setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
|
|
10237
10313
|
var options = this.setupParams(helper, paramSize, params);
|
|
10238
|
-
options.loc =
|
|
10314
|
+
options.loc = locationLiteral(this);
|
|
10239
10315
|
options = this.objectLiteral(options);
|
|
10240
10316
|
if (useRegister) {
|
|
10241
10317
|
this.useRegister("options");
|
|
@@ -10259,6 +10335,10 @@ var require_javascript_compiler = __commonJS({
|
|
|
10259
10335
|
JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
|
|
10260
10336
|
return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
|
|
10261
10337
|
};
|
|
10338
|
+
function locationLiteral(compiler) {
|
|
10339
|
+
var loc = compiler.source.currentLocation;
|
|
10340
|
+
return loc ? _codeGen.safeJsonLiteral(loc) : "undefined";
|
|
10341
|
+
}
|
|
10262
10342
|
function strictLookup(requireTerminal, compiler, parts, startPartIndex, type) {
|
|
10263
10343
|
var stack = compiler.popStack(), len = parts.length;
|
|
10264
10344
|
if (requireTerminal) {
|
|
@@ -10268,7 +10348,7 @@ var require_javascript_compiler = __commonJS({
|
|
|
10268
10348
|
stack = compiler.nameLookup(stack, parts[i], type);
|
|
10269
10349
|
}
|
|
10270
10350
|
if (requireTerminal) {
|
|
10271
|
-
return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[len]), ", ",
|
|
10351
|
+
return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[len]), ", ", locationLiteral(compiler), " )"];
|
|
10272
10352
|
} else {
|
|
10273
10353
|
return stack;
|
|
10274
10354
|
}
|
|
@@ -10278,9 +10358,9 @@ var require_javascript_compiler = __commonJS({
|
|
|
10278
10358
|
}
|
|
10279
10359
|
});
|
|
10280
10360
|
|
|
10281
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
10361
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars.js
|
|
10282
10362
|
var require_handlebars = __commonJS({
|
|
10283
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
10363
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars.js"(exports, module) {
|
|
10284
10364
|
"use strict";
|
|
10285
10365
|
exports.__esModule = true;
|
|
10286
10366
|
function _interopRequireDefault(obj) {
|
|
@@ -10325,9 +10405,9 @@ var require_handlebars = __commonJS({
|
|
|
10325
10405
|
}
|
|
10326
10406
|
});
|
|
10327
10407
|
|
|
10328
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
10408
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js
|
|
10329
10409
|
var require_printer = __commonJS({
|
|
10330
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
10410
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js"(exports) {
|
|
10331
10411
|
"use strict";
|
|
10332
10412
|
exports.__esModule = true;
|
|
10333
10413
|
exports.print = print;
|
|
@@ -10471,9 +10551,9 @@ var require_printer = __commonJS({
|
|
|
10471
10551
|
}
|
|
10472
10552
|
});
|
|
10473
10553
|
|
|
10474
|
-
// node_modules/.pnpm/handlebars@4.7.
|
|
10554
|
+
// node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/lib/index.js
|
|
10475
10555
|
var require_lib2 = __commonJS({
|
|
10476
|
-
"node_modules/.pnpm/handlebars@4.7.
|
|
10556
|
+
"node_modules/.pnpm/handlebars@4.7.10/node_modules/handlebars/lib/index.js"(exports, module) {
|
|
10477
10557
|
"use strict";
|
|
10478
10558
|
var handlebars = require_handlebars()["default"];
|
|
10479
10559
|
var printer = require_printer();
|
|
@@ -21408,7 +21488,9 @@ var require_liquid_node = __commonJS({
|
|
|
21408
21488
|
});
|
|
21409
21489
|
|
|
21410
21490
|
// packages/mcp/src/lib/transports.ts
|
|
21411
|
-
import {
|
|
21491
|
+
import {
|
|
21492
|
+
createServer
|
|
21493
|
+
} from "node:http";
|
|
21412
21494
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
21413
21495
|
|
|
21414
21496
|
// packages/mcp/src/lib/server.ts
|
|
@@ -21427,6 +21509,15 @@ var EngineSyntaxError = class extends Error {
|
|
|
21427
21509
|
return { line: this.line, column: this.column };
|
|
21428
21510
|
}
|
|
21429
21511
|
};
|
|
21512
|
+
function notText(engine, source) {
|
|
21513
|
+
const kind = source === null || source === void 0 ? String(source) : Array.isArray(source) ? "an array" : typeof source === "object" ? "an object" : `a ${typeof source}`;
|
|
21514
|
+
return new EngineSyntaxError(
|
|
21515
|
+
engine,
|
|
21516
|
+
`A template must be text, not ${kind}`,
|
|
21517
|
+
1,
|
|
21518
|
+
1
|
|
21519
|
+
);
|
|
21520
|
+
}
|
|
21430
21521
|
var RenderLimitError = class extends Error {
|
|
21431
21522
|
constructor(limit, message2) {
|
|
21432
21523
|
super(message2);
|
|
@@ -78884,7 +78975,8 @@ var builtinRoots = /* @__PURE__ */ new Set([
|
|
|
78884
78975
|
]);
|
|
78885
78976
|
function withBrand(data, ctx) {
|
|
78886
78977
|
const root = data ?? {};
|
|
78887
|
-
if (!ctx.brand || typeof root !== "object" || Array.isArray(root))
|
|
78978
|
+
if (!ctx.brand || typeof root !== "object" || Array.isArray(root))
|
|
78979
|
+
return root;
|
|
78888
78980
|
return { brand: ctx.brand, ...root };
|
|
78889
78981
|
}
|
|
78890
78982
|
function createInstance(ctx) {
|
|
@@ -79183,6 +79275,11 @@ var HandlebarsCompiled = class {
|
|
|
79183
79275
|
}
|
|
79184
79276
|
const src = ctx.partials(inc.name);
|
|
79185
79277
|
if (src === void 0) continue;
|
|
79278
|
+
if (typeof src !== "string")
|
|
79279
|
+
throw new RenderError(
|
|
79280
|
+
"handlebars",
|
|
79281
|
+
`Partial "${inc.name}" is not text`
|
|
79282
|
+
);
|
|
79186
79283
|
partials[inc.name] = src;
|
|
79187
79284
|
collect(src, depth + 1);
|
|
79188
79285
|
}
|
|
@@ -79210,6 +79307,7 @@ var HandlebarsCompiled = class {
|
|
|
79210
79307
|
var handlebarsEngine = {
|
|
79211
79308
|
id: "handlebars",
|
|
79212
79309
|
compile(source, opts = {}) {
|
|
79310
|
+
if (typeof source !== "string") throw notText("handlebars", source);
|
|
79213
79311
|
const name = opts.name ?? "template";
|
|
79214
79312
|
try {
|
|
79215
79313
|
createInstance(validationContext).precompile(source, { strict: false });
|
|
@@ -79478,7 +79576,8 @@ var stringMethods = {
|
|
|
79478
79576
|
};
|
|
79479
79577
|
function keywordArgs(args2) {
|
|
79480
79578
|
const last = args2.at(-1);
|
|
79481
|
-
if (!last || typeof last !== "object" || !Object.prototype.hasOwnProperty.call(last, "__keywords"))
|
|
79579
|
+
if (!last || typeof last !== "object" || !Object.prototype.hasOwnProperty.call(last, "__keywords"))
|
|
79580
|
+
return void 0;
|
|
79482
79581
|
const { __keywords: _marker, ...named } = last;
|
|
79483
79582
|
return named;
|
|
79484
79583
|
}
|
|
@@ -79492,11 +79591,15 @@ function namespace(...args2) {
|
|
|
79492
79591
|
return ns;
|
|
79493
79592
|
}
|
|
79494
79593
|
function setNamespaceAttribute(target, key, value) {
|
|
79495
|
-
if (!(target instanceof JinjaNamespace))
|
|
79594
|
+
if (!(target instanceof JinjaNamespace))
|
|
79595
|
+
throw new Error("Cannot assign attribute on non-namespace object");
|
|
79496
79596
|
target[String(key)] = value;
|
|
79497
79597
|
}
|
|
79498
79598
|
var toList = (v2) => Array.isArray(v2) ? v2 : v2 === void 0 || v2 === null ? [] : typeof v2 === "string" ? [...v2] : [v2];
|
|
79499
|
-
var attributeOf = (item, path) => String(path ?? "").split(".").reduce(
|
|
79599
|
+
var attributeOf = (item, path) => String(path ?? "").split(".").reduce(
|
|
79600
|
+
(acc, key) => acc !== null && typeof acc === "object" ? acc[key] : void 0,
|
|
79601
|
+
item
|
|
79602
|
+
);
|
|
79500
79603
|
var jinjaTests = {
|
|
79501
79604
|
none: (v2) => v2 === null,
|
|
79502
79605
|
true: (v2) => v2 === true,
|
|
@@ -79517,50 +79620,65 @@ function runTest(self2, name, value, arg) {
|
|
|
79517
79620
|
function installJinjaFilters(env) {
|
|
79518
79621
|
const lookup = env;
|
|
79519
79622
|
const helperTruncate = lookup.getFilter("truncate");
|
|
79520
|
-
lookup.addFilter(
|
|
79521
|
-
|
|
79522
|
-
|
|
79523
|
-
|
|
79524
|
-
|
|
79525
|
-
|
|
79526
|
-
|
|
79527
|
-
|
|
79528
|
-
|
|
79529
|
-
|
|
79530
|
-
|
|
79531
|
-
|
|
79532
|
-
|
|
79533
|
-
|
|
79534
|
-
|
|
79623
|
+
lookup.addFilter(
|
|
79624
|
+
"truncate",
|
|
79625
|
+
function(value, ...args2) {
|
|
79626
|
+
const named = keywordArgs(args2);
|
|
79627
|
+
const p = named ? args2.slice(0, -1) : args2;
|
|
79628
|
+
if (!named && typeof p[1] !== "boolean" && p.length < 3)
|
|
79629
|
+
return helperTruncate.call(this, value, ...args2);
|
|
79630
|
+
const s = String(value ?? "");
|
|
79631
|
+
const length = Number(p[0] ?? named?.["length"] ?? 255);
|
|
79632
|
+
const killwords = Boolean(p[1] ?? named?.["killwords"] ?? false);
|
|
79633
|
+
const end = String(p[2] ?? named?.["end"] ?? "...");
|
|
79634
|
+
const leeway = Number(p[3] ?? named?.["leeway"] ?? 5);
|
|
79635
|
+
if (s.length <= length + leeway) return s;
|
|
79636
|
+
const cut = s.slice(0, Math.max(0, length - end.length));
|
|
79637
|
+
if (killwords) return cut + end;
|
|
79638
|
+
const space = cut.lastIndexOf(" ");
|
|
79639
|
+
return (space >= 0 ? cut.slice(0, space) : cut) + end;
|
|
79640
|
+
}
|
|
79641
|
+
);
|
|
79535
79642
|
const helperSum = lookup.getFilter("sum");
|
|
79536
|
-
lookup.addFilter(
|
|
79537
|
-
|
|
79538
|
-
|
|
79539
|
-
|
|
79540
|
-
|
|
79541
|
-
|
|
79542
|
-
|
|
79643
|
+
lookup.addFilter(
|
|
79644
|
+
"sum",
|
|
79645
|
+
function(value, ...args2) {
|
|
79646
|
+
const named = keywordArgs(args2);
|
|
79647
|
+
if (!named) return helperSum.call(this, value, ...args2);
|
|
79648
|
+
const p = args2.slice(0, -1);
|
|
79649
|
+
const total = helperSum.call(
|
|
79650
|
+
this,
|
|
79651
|
+
value,
|
|
79652
|
+
p[0] ?? named["attribute"]
|
|
79653
|
+
);
|
|
79654
|
+
return total + Number(p[1] ?? named["start"] ?? 0);
|
|
79655
|
+
}
|
|
79656
|
+
);
|
|
79543
79657
|
const helperMap = lookup.getFilter("map");
|
|
79544
|
-
lookup.addFilter(
|
|
79545
|
-
|
|
79546
|
-
|
|
79547
|
-
|
|
79548
|
-
|
|
79549
|
-
|
|
79550
|
-
return
|
|
79551
|
-
|
|
79552
|
-
|
|
79553
|
-
|
|
79554
|
-
|
|
79555
|
-
|
|
79556
|
-
filter
|
|
79557
|
-
|
|
79558
|
-
|
|
79658
|
+
lookup.addFilter(
|
|
79659
|
+
"map",
|
|
79660
|
+
function(value, ...args2) {
|
|
79661
|
+
const named = keywordArgs(args2);
|
|
79662
|
+
const p = named ? args2.slice(0, -1) : args2;
|
|
79663
|
+
if (named && "attribute" in named)
|
|
79664
|
+
return toList(value).map((item) => {
|
|
79665
|
+
const v2 = attributeOf(item, named["attribute"]);
|
|
79666
|
+
return v2 === void 0 && "default" in named ? named["default"] : v2;
|
|
79667
|
+
});
|
|
79668
|
+
const items = toList(value);
|
|
79669
|
+
if (typeof p[0] === "string" && !items.some((item) => item !== null && typeof item === "object")) {
|
|
79670
|
+
let filter;
|
|
79671
|
+
try {
|
|
79672
|
+
filter = lookup.getFilter(p[0]);
|
|
79673
|
+
} catch {
|
|
79674
|
+
filter = void 0;
|
|
79675
|
+
}
|
|
79676
|
+
if (filter)
|
|
79677
|
+
return items.map((item) => filter.call(this, item, ...p.slice(1)));
|
|
79559
79678
|
}
|
|
79560
|
-
|
|
79679
|
+
return helperMap.call(this, value, ...args2);
|
|
79561
79680
|
}
|
|
79562
|
-
|
|
79563
|
-
});
|
|
79681
|
+
);
|
|
79564
79682
|
const byAttribute = (keep) => function(value, attribute, test, arg) {
|
|
79565
79683
|
return toList(value).filter((item) => {
|
|
79566
79684
|
const v2 = attributeOf(item, attribute);
|
|
@@ -79589,14 +79707,16 @@ function pythonRepr(v2) {
|
|
|
79589
79707
|
if (v2 === null || v2 === void 0) return "None";
|
|
79590
79708
|
if (v2 === true) return "True";
|
|
79591
79709
|
if (v2 === false) return "False";
|
|
79592
|
-
if (typeof v2 === "number")
|
|
79710
|
+
if (typeof v2 === "number")
|
|
79711
|
+
return Number.isNaN(v2) ? "nan" : Number.isFinite(v2) ? String(v2) : v2 > 0 ? "inf" : "-inf";
|
|
79593
79712
|
if (typeof v2 === "string") {
|
|
79594
79713
|
const quote = v2.includes("'") && !v2.includes('"') ? '"' : "'";
|
|
79595
79714
|
const escaped = v2.replace(/\\/g, "\\\\").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
|
|
79596
79715
|
return quote + (quote === "'" ? escaped.replace(/'/g, "\\'") : escaped) + quote;
|
|
79597
79716
|
}
|
|
79598
79717
|
if (Array.isArray(v2)) return `[${v2.map(pythonRepr).join(", ")}]`;
|
|
79599
|
-
if (isPlainObject2(v2))
|
|
79718
|
+
if (isPlainObject2(v2))
|
|
79719
|
+
return `{${Object.entries(v2).map(([k2, item]) => `${pythonRepr(k2)}: ${pythonRepr(item)}`).join(", ")}}`;
|
|
79600
79720
|
return String(v2);
|
|
79601
79721
|
}
|
|
79602
79722
|
var compatInstalled = false;
|
|
@@ -79613,7 +79733,8 @@ function installCompat() {
|
|
|
79613
79733
|
import_nunjucks.default.runtime["formfeedSetAttribute"] = setNamespaceAttribute;
|
|
79614
79734
|
import_nunjucks.default.compiler.Compiler.prototype.compileSet = function(node, frame) {
|
|
79615
79735
|
const [target, ...more] = node.targets;
|
|
79616
|
-
if (!target || more.length || target.typename !== "LookupVal")
|
|
79736
|
+
if (!target || more.length || target.typename !== "LookupVal")
|
|
79737
|
+
return compileSet.call(this, node, frame);
|
|
79617
79738
|
this._emit("runtime.formfeedSetAttribute(");
|
|
79618
79739
|
this._compileExpression(target["target"], frame);
|
|
79619
79740
|
this._emit(", ");
|
|
@@ -79624,7 +79745,10 @@ function installCompat() {
|
|
|
79624
79745
|
this._emitLine(");");
|
|
79625
79746
|
};
|
|
79626
79747
|
const suppressValue = import_nunjucks.default.runtime.suppressValue;
|
|
79627
|
-
import_nunjucks.default.runtime.suppressValue = (val2, autoescape) => suppressValue(
|
|
79748
|
+
import_nunjucks.default.runtime.suppressValue = (val2, autoescape) => suppressValue(
|
|
79749
|
+
Array.isArray(val2) || isPlainObject2(val2) ? pythonRepr(val2) : val2,
|
|
79750
|
+
autoescape
|
|
79751
|
+
);
|
|
79628
79752
|
const original = import_nunjucks.default.runtime.memberLookup;
|
|
79629
79753
|
import_nunjucks.default.runtime.memberLookup = (obj, val2, ...rest) => {
|
|
79630
79754
|
if (typeof obj === "string" && typeof val2 === "string" && Object.prototype.hasOwnProperty.call(stringMethods, val2)) {
|
|
@@ -79728,7 +79852,8 @@ function walk2(node, w) {
|
|
|
79728
79852
|
case "Symbol":
|
|
79729
79853
|
case "LookupVal": {
|
|
79730
79854
|
const p = pathOf(node);
|
|
79731
|
-
if (node.typename === "Symbol" && jinjaLiterals.has(String(node.value)))
|
|
79855
|
+
if (node.typename === "Symbol" && jinjaLiterals.has(String(node.value)))
|
|
79856
|
+
return;
|
|
79732
79857
|
if (p) {
|
|
79733
79858
|
const root = p.path[0] ?? "";
|
|
79734
79859
|
const bound = inScope(w, root);
|
|
@@ -79783,7 +79908,9 @@ function walk2(node, w) {
|
|
|
79783
79908
|
const nameNode = node["name"];
|
|
79784
79909
|
const names = nameNode.typename === "Array" ? nameNode.children ?? [] : [nameNode];
|
|
79785
79910
|
const root = source?.path[0] ?? "";
|
|
79786
|
-
const items = !source ? null : inScope(w, root) ? ((s) => s ? [...s, ...source.path.slice(1)] : null)(
|
|
79911
|
+
const items = !source ? null : inScope(w, root) ? ((s) => s ? [...s, ...source.path.slice(1)] : null)(
|
|
79912
|
+
sourceOf(w, root)
|
|
79913
|
+
) : source.path;
|
|
79787
79914
|
const scope = /* @__PURE__ */ new Map();
|
|
79788
79915
|
for (const n of names) {
|
|
79789
79916
|
const name = String(n.value);
|
|
@@ -79811,7 +79938,8 @@ function walk2(node, w) {
|
|
|
79811
79938
|
range: nodeRange(p.root, p.path.join(".").length),
|
|
79812
79939
|
kind: "assigned"
|
|
79813
79940
|
});
|
|
79814
|
-
if (p.path.length === 1 || !inScope(w, p.path[0] ?? ""))
|
|
79941
|
+
if (p.path.length === 1 || !inScope(w, p.path[0] ?? ""))
|
|
79942
|
+
w.scopes[0]?.set(p.path[0] ?? "", null);
|
|
79815
79943
|
}
|
|
79816
79944
|
}
|
|
79817
79945
|
walk2(node["value"], w);
|
|
@@ -80002,6 +80130,7 @@ var Jinja2Template = class {
|
|
|
80002
80130
|
var jinja2Engine = {
|
|
80003
80131
|
id: "jinja2",
|
|
80004
80132
|
compile(source, opts = {}) {
|
|
80133
|
+
if (typeof source !== "string") throw notText("jinja2", source);
|
|
80005
80134
|
const name = opts.name ?? "template";
|
|
80006
80135
|
try {
|
|
80007
80136
|
installCompat();
|
|
@@ -80171,12 +80300,18 @@ function createLiquid(ctx) {
|
|
|
80171
80300
|
parseLimit: 2e6
|
|
80172
80301
|
});
|
|
80173
80302
|
for (const [name, { fn }] of ctx.helpers.bind(ctx))
|
|
80174
|
-
liquid.registerFilter(
|
|
80175
|
-
|
|
80176
|
-
|
|
80177
|
-
|
|
80178
|
-
|
|
80179
|
-
|
|
80303
|
+
liquid.registerFilter(
|
|
80304
|
+
name,
|
|
80305
|
+
function(input, ...argv) {
|
|
80306
|
+
const tokens = this.token?.args ?? [];
|
|
80307
|
+
return fn(
|
|
80308
|
+
...collectKeywordArgs(
|
|
80309
|
+
[input, ...argv],
|
|
80310
|
+
(i) => i > 0 && Array.isArray(tokens[i - 1])
|
|
80311
|
+
)
|
|
80312
|
+
);
|
|
80313
|
+
}
|
|
80314
|
+
);
|
|
80180
80315
|
return liquid;
|
|
80181
80316
|
}
|
|
80182
80317
|
var validationContext3 = {
|
|
@@ -80410,6 +80545,7 @@ var LiquidCompiled = class {
|
|
|
80410
80545
|
var liquidEngine = {
|
|
80411
80546
|
id: "liquid",
|
|
80412
80547
|
compile(source, opts = {}) {
|
|
80548
|
+
if (typeof source !== "string") throw notText("liquid", source);
|
|
80413
80549
|
const name = opts.name ?? "template";
|
|
80414
80550
|
try {
|
|
80415
80551
|
createLiquid(validationContext3).parse(source, name);
|
|
@@ -81976,7 +82112,8 @@ var Formfeed = class {
|
|
|
81976
82112
|
`render ${target.id} has no output (${target.status})`,
|
|
81977
82113
|
0
|
|
81978
82114
|
);
|
|
81979
|
-
const
|
|
82115
|
+
const fetchImpl = this.fetchImpl;
|
|
82116
|
+
const res = await fetchImpl(target.download_url, {
|
|
81980
82117
|
signal: options.signal
|
|
81981
82118
|
});
|
|
81982
82119
|
if (!res.ok)
|
|
@@ -82492,8 +82629,9 @@ var Formfeed = class {
|
|
|
82492
82629
|
() => controller.abort(options.signal?.reason)
|
|
82493
82630
|
);
|
|
82494
82631
|
let res;
|
|
82632
|
+
const fetchImpl = this.fetchImpl;
|
|
82495
82633
|
try {
|
|
82496
|
-
res = await
|
|
82634
|
+
res = await fetchImpl(url, {
|
|
82497
82635
|
method,
|
|
82498
82636
|
headers,
|
|
82499
82637
|
body: body === void 0 ? void 0 : isForm ? body : JSON.stringify(body),
|
|
@@ -82565,7 +82703,7 @@ var encoder2 = new TextEncoder();
|
|
|
82565
82703
|
// packages/mcp/src/lib/server.ts
|
|
82566
82704
|
import { z as z3 } from "zod";
|
|
82567
82705
|
var CONVERT_LIMIT_BYTES = 20 * 1024 * 1024;
|
|
82568
|
-
var SERVER_INFO = { name: "formfeed", version: "0.3.
|
|
82706
|
+
var SERVER_INFO = { name: "formfeed", version: "0.3.15" };
|
|
82569
82707
|
var READS = {
|
|
82570
82708
|
readOnlyHint: true,
|
|
82571
82709
|
destructiveHint: false,
|
|
@@ -82637,7 +82775,7 @@ function createFormfeedServer(options) {
|
|
|
82637
82775
|
...options.fetch ? { fetch: options.fetch } : {}
|
|
82638
82776
|
});
|
|
82639
82777
|
const server = new McpServer(SERVER_INFO, {
|
|
82640
|
-
instructions: "Formfeed renders PDFs and images from HTML templates, and fills Word and PowerPoint templates (as DOCX, PPTX or PDF). Start with list_templates, read the data shape with get_template_schema, check data with validate_template, then call render and hand the download_url to the user. convert_to_pdf turns office documents into PDFs."
|
|
82778
|
+
instructions: "Formfeed renders PDFs and images from HTML templates, and fills Word and PowerPoint templates (as DOCX, PPTX or PDF). Start with list_templates, read the data shape with get_template_schema, check data with validate_template, then call render and hand the download_url to the user. convert_to_pdf turns office documents into PDFs. get_workspace says which workspace this server works in and what the period has left."
|
|
82641
82779
|
});
|
|
82642
82780
|
server.registerTool(
|
|
82643
82781
|
"list_templates",
|
|
@@ -82961,6 +83099,30 @@ function createFormfeedServer(options) {
|
|
|
82961
83099
|
}
|
|
82962
83100
|
}
|
|
82963
83101
|
);
|
|
83102
|
+
server.registerTool(
|
|
83103
|
+
"get_workspace",
|
|
83104
|
+
{
|
|
83105
|
+
title: "Which workspace this server works in",
|
|
83106
|
+
description: "Returns the workspace and organisation this server acts in, the plan, the environment (live or test) and the units of the current period: included, used and the balance of prepaid units. Call it when the user asks where a document will land or how many renders are left, or when list_templates returns nothing you expected. A signed-in agent works in the workspace chosen when it was connected, which the person changes in Formfeed under Account \u2192 Connected agents; an API key works in the workspace it was made for. Read-only and free.",
|
|
83107
|
+
inputSchema: {},
|
|
83108
|
+
annotations: READS
|
|
83109
|
+
},
|
|
83110
|
+
async () => {
|
|
83111
|
+
try {
|
|
83112
|
+
const { workspace, organization, plan, environment, period: period2, units } = await client.account.get();
|
|
83113
|
+
return text3({
|
|
83114
|
+
workspace,
|
|
83115
|
+
organization,
|
|
83116
|
+
plan,
|
|
83117
|
+
environment,
|
|
83118
|
+
period: period2,
|
|
83119
|
+
units
|
|
83120
|
+
});
|
|
83121
|
+
} catch (e) {
|
|
83122
|
+
return failure(e);
|
|
83123
|
+
}
|
|
83124
|
+
}
|
|
83125
|
+
);
|
|
82964
83126
|
return server;
|
|
82965
83127
|
}
|
|
82966
83128
|
|
|
@@ -82993,12 +83155,20 @@ function tokenExpired(token, now = Date.now()) {
|
|
|
82993
83155
|
}
|
|
82994
83156
|
}
|
|
82995
83157
|
function json(body, status, headers = {}) {
|
|
82996
|
-
return new Response(JSON.stringify(body), {
|
|
83158
|
+
return new Response(JSON.stringify(body), {
|
|
83159
|
+
status,
|
|
83160
|
+
headers: { "content-type": "application/json", ...headers }
|
|
83161
|
+
});
|
|
82997
83162
|
}
|
|
82998
83163
|
function bearer(request) {
|
|
82999
83164
|
const auth = request.headers.get("authorization") ?? "";
|
|
83000
83165
|
return /^Bearer\s+/i.test(auth) ? auth.replace(/^Bearer\s+/i, "").trim() : "";
|
|
83001
83166
|
}
|
|
83167
|
+
function challenge(metadata, description) {
|
|
83168
|
+
return {
|
|
83169
|
+
"www-authenticate": description ? `Bearer realm="formfeed", resource_metadata="${metadata}", error="invalid_token", error_description="${description}"` : `Bearer realm="formfeed", resource_metadata="${metadata}"`
|
|
83170
|
+
};
|
|
83171
|
+
}
|
|
83002
83172
|
function mcpFetchHandler(options = {}) {
|
|
83003
83173
|
const authorizationServer2 = options.authorizationServer?.replace(/\/$/, "");
|
|
83004
83174
|
return async (request) => {
|
|
@@ -83007,41 +83177,99 @@ function mcpFetchHandler(options = {}) {
|
|
|
83007
83177
|
const path = url.pathname.replace(/\/+$/, "") || "/";
|
|
83008
83178
|
if (path === "/healthz") return json({ ok: true }, 200);
|
|
83009
83179
|
if (path === RESOURCE_METADATA_PATH || path.startsWith(`${RESOURCE_METADATA_PATH}${MCP_PATH}`)) {
|
|
83010
|
-
if (!authorizationServer2)
|
|
83011
|
-
|
|
83180
|
+
if (!authorizationServer2)
|
|
83181
|
+
return json(
|
|
83182
|
+
{
|
|
83183
|
+
error: "This endpoint takes API keys only; no authorization server is configured"
|
|
83184
|
+
},
|
|
83185
|
+
404
|
|
83186
|
+
);
|
|
83187
|
+
const workspaceId2 = path.slice(
|
|
83188
|
+
`${RESOURCE_METADATA_PATH}${MCP_PATH}/`.length
|
|
83189
|
+
);
|
|
83012
83190
|
if (path === RESOURCE_METADATA_PATH || path === `${RESOURCE_METADATA_PATH}${MCP_PATH}`)
|
|
83013
83191
|
return json(
|
|
83014
83192
|
{
|
|
83015
83193
|
resource: `${origin}${MCP_PATH}`,
|
|
83016
83194
|
authorization_servers: [authorizationServer2],
|
|
83017
83195
|
bearer_methods_supported: ["header"],
|
|
83196
|
+
scopes_supported: ["openid", "email", "profile"],
|
|
83018
83197
|
resource_name: "Formfeed",
|
|
83019
83198
|
resource_documentation: "https://docs.formfeed.dev/integrations/mcp",
|
|
83020
|
-
//
|
|
83199
|
+
// a signed-in client works in the workspace chosen at consent; this path pins another one
|
|
83021
83200
|
formfeed_workspace_path: `${origin}${MCP_PATH}/{workspace_id}`
|
|
83022
83201
|
},
|
|
83023
83202
|
200
|
|
83024
83203
|
);
|
|
83025
|
-
if (!WORKSPACE_ID.test(workspaceId2))
|
|
83026
|
-
|
|
83204
|
+
if (!WORKSPACE_ID.test(workspaceId2))
|
|
83205
|
+
return json({ error: "The workspace id is not a UUID" }, 404);
|
|
83206
|
+
return json(
|
|
83207
|
+
resourceMetadata(origin, workspaceId2, authorizationServer2),
|
|
83208
|
+
200
|
|
83209
|
+
);
|
|
83027
83210
|
}
|
|
83028
|
-
if (path !== MCP_PATH && !path.startsWith(`${MCP_PATH}/`))
|
|
83211
|
+
if (path !== MCP_PATH && !path.startsWith(`${MCP_PATH}/`))
|
|
83212
|
+
return new Response(null, { status: 404 });
|
|
83029
83213
|
const workspaceId = path === MCP_PATH ? null : path.slice(MCP_PATH.length + 1);
|
|
83030
83214
|
if (workspaceId !== null && !WORKSPACE_ID.test(workspaceId))
|
|
83031
|
-
return json(
|
|
83215
|
+
return json(
|
|
83216
|
+
{
|
|
83217
|
+
error: `The path is /mcp for an API key or /mcp/<workspace id> for a signed-in member`
|
|
83218
|
+
},
|
|
83219
|
+
404
|
|
83220
|
+
);
|
|
83032
83221
|
const credential = bearer(request);
|
|
83033
83222
|
if (workspaceId === null) {
|
|
83034
|
-
|
|
83035
|
-
if (!
|
|
83036
|
-
return json(
|
|
83223
|
+
const metadata = `${origin}${RESOURCE_METADATA_PATH}${MCP_PATH}`;
|
|
83224
|
+
if (!credential)
|
|
83225
|
+
return authorizationServer2 ? json(
|
|
83226
|
+
{
|
|
83227
|
+
error: "Authorization: Bearer <formfeed api key> required, or sign in with your Formfeed account"
|
|
83228
|
+
},
|
|
83229
|
+
401,
|
|
83230
|
+
challenge(metadata)
|
|
83231
|
+
) : json(
|
|
83232
|
+
{ error: "Authorization: Bearer <formfeed api key> required" },
|
|
83233
|
+
401,
|
|
83234
|
+
{ "www-authenticate": 'Bearer realm="formfeed"' }
|
|
83235
|
+
);
|
|
83236
|
+
if (!API_KEY.test(credential) && JWT.test(credential)) {
|
|
83237
|
+
if (!authorizationServer2)
|
|
83238
|
+
return json(
|
|
83239
|
+
{
|
|
83240
|
+
error: "This endpoint takes API keys only; no authorization server is configured for a sign-in"
|
|
83241
|
+
},
|
|
83242
|
+
401,
|
|
83243
|
+
{ "www-authenticate": 'Bearer realm="formfeed"' }
|
|
83244
|
+
);
|
|
83245
|
+
if (tokenExpired(credential))
|
|
83246
|
+
return json(
|
|
83247
|
+
{ error: "The access token expired" },
|
|
83248
|
+
401,
|
|
83249
|
+
challenge(metadata, "the access token expired")
|
|
83250
|
+
);
|
|
83251
|
+
}
|
|
83037
83252
|
} else {
|
|
83038
|
-
if (!authorizationServer2)
|
|
83253
|
+
if (!authorizationServer2)
|
|
83254
|
+
return json(
|
|
83255
|
+
{
|
|
83256
|
+
error: "This endpoint takes API keys only; connect to /mcp with a key"
|
|
83257
|
+
},
|
|
83258
|
+
404
|
|
83259
|
+
);
|
|
83039
83260
|
const metadata = `${origin}${RESOURCE_METADATA_PATH}${MCP_PATH}/${workspaceId}`;
|
|
83040
|
-
|
|
83041
|
-
|
|
83042
|
-
|
|
83043
|
-
|
|
83044
|
-
|
|
83261
|
+
if (!credential || !JWT.test(credential))
|
|
83262
|
+
return json(
|
|
83263
|
+
{ error: "Sign in: this endpoint takes an OAuth access token" },
|
|
83264
|
+
401,
|
|
83265
|
+
challenge(metadata, "an access token is required")
|
|
83266
|
+
);
|
|
83267
|
+
if (tokenExpired(credential))
|
|
83268
|
+
return json(
|
|
83269
|
+
{ error: "The access token expired" },
|
|
83270
|
+
401,
|
|
83271
|
+
challenge(metadata, "the access token expired")
|
|
83272
|
+
);
|
|
83045
83273
|
}
|
|
83046
83274
|
const mcp = createFormfeedServer({
|
|
83047
83275
|
apiKey: credential,
|
|
@@ -83050,7 +83278,10 @@ function mcpFetchHandler(options = {}) {
|
|
|
83050
83278
|
...options.region ? { region: options.region } : {},
|
|
83051
83279
|
...options.fetch ? { fetch: options.fetch } : {}
|
|
83052
83280
|
});
|
|
83053
|
-
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
83281
|
+
const transport = new WebStandardStreamableHTTPServerTransport({
|
|
83282
|
+
sessionIdGenerator: void 0,
|
|
83283
|
+
enableJsonResponse: true
|
|
83284
|
+
});
|
|
83054
83285
|
await mcp.connect(transport);
|
|
83055
83286
|
try {
|
|
83056
83287
|
return await transport.handleRequest(request);
|
|
@@ -83073,8 +83304,11 @@ async function startHttp(options = {}) {
|
|
|
83073
83304
|
const handler = mcpFetchHandler(handlerOptions);
|
|
83074
83305
|
const server = createServer((req, res) => {
|
|
83075
83306
|
void toRequest(req, host).then(handler).then((response) => send(response, res)).catch((e) => {
|
|
83076
|
-
if (!res.headersSent)
|
|
83077
|
-
|
|
83307
|
+
if (!res.headersSent)
|
|
83308
|
+
res.writeHead(500, { "content-type": "application/json" });
|
|
83309
|
+
res.end(
|
|
83310
|
+
JSON.stringify({ error: e instanceof Error ? e.message : String(e) })
|
|
83311
|
+
);
|
|
83078
83312
|
});
|
|
83079
83313
|
});
|
|
83080
83314
|
await new Promise((resolve2, reject) => {
|
|
@@ -83132,13 +83366,18 @@ var authorizationServer = flag("--auth-server") ?? process.env["FORMFEED_AUTH_SE
|
|
|
83132
83366
|
var publicOrigin = flag("--public-origin") ?? process.env["FORMFEED_PUBLIC_ORIGIN"];
|
|
83133
83367
|
if (args.includes("--help") || args.includes("-h")) {
|
|
83134
83368
|
process.stdout.write(
|
|
83135
|
-
"formfeed-mcp: Model Context Protocol server for Formfeed\n\n formfeed-mcp stdio; needs FORMFEED_API_KEY\n formfeed-mcp --http Streamable HTTP on --port (8790) and --host (127.0.0.1); the key comes from Authorization: Bearer\n --auth-server <issuer> (or FORMFEED_AUTH_SERVER) also
|
|
83369
|
+
"formfeed-mcp: Model Context Protocol server for Formfeed\n\n formfeed-mcp stdio; needs FORMFEED_API_KEY\n formfeed-mcp --http Streamable HTTP on --port (8790) and --host (127.0.0.1); the key comes from Authorization: Bearer\n --auth-server <issuer> (or FORMFEED_AUTH_SERVER) also takes OAuth access tokens on /mcp and /mcp/<workspace id>;\n --public-origin <url> (or FORMFEED_PUBLIC_ORIGIN) is the origin clients see behind a proxy\n"
|
|
83136
83370
|
);
|
|
83137
83371
|
} else if (args.includes("--http")) {
|
|
83138
|
-
startHttp({
|
|
83139
|
-
(
|
|
83140
|
-
|
|
83141
|
-
|
|
83372
|
+
startHttp({
|
|
83373
|
+
port: Number(flag("--port") ?? 8790),
|
|
83374
|
+
host: flag("--host") ?? "127.0.0.1",
|
|
83375
|
+
baseUrl,
|
|
83376
|
+
region,
|
|
83377
|
+
authorizationServer,
|
|
83378
|
+
publicOrigin
|
|
83379
|
+
}).then((h) => process.stderr.write(`formfeed-mcp listening on ${h.url}
|
|
83380
|
+
`));
|
|
83142
83381
|
} else {
|
|
83143
83382
|
const apiKey = process.env["FORMFEED_API_KEY"];
|
|
83144
83383
|
if (!apiKey) {
|