@getmagical/cli 0.1.17 → 0.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1345,7 +1345,7 @@ var require_helpers = __commonJS({
1345
1345
  if (instance.helpers[helperName]) {
1346
1346
  instance.hooks[helperName] = instance.helpers[helperName];
1347
1347
  if (!keepHelper) {
1348
- delete instance.helpers[helperName];
1348
+ instance.helpers[helperName] = void 0;
1349
1349
  }
1350
1350
  }
1351
1351
  }
@@ -1437,22 +1437,6 @@ var require_logger = __commonJS({
1437
1437
  }
1438
1438
  });
1439
1439
 
1440
- // ../../node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js
1441
- var require_create_new_lookup_object = __commonJS({
1442
- "../../node_modules/handlebars/dist/cjs/handlebars/internal/create-new-lookup-object.js"(exports) {
1443
- "use strict";
1444
- exports.__esModule = true;
1445
- exports.createNewLookupObject = createNewLookupObject;
1446
- var _utils = require_utils();
1447
- function createNewLookupObject() {
1448
- for (var _len = arguments.length, sources = Array(_len), _key = 0; _key < _len; _key++) {
1449
- sources[_key] = arguments[_key];
1450
- }
1451
- return _utils.extend.apply(void 0, [/* @__PURE__ */ Object.create(null)].concat(sources));
1452
- }
1453
- }
1454
- });
1455
-
1456
1440
  // ../../node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
1457
1441
  var require_proto_access = __commonJS({
1458
1442
  "../../node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(exports) {
@@ -1464,25 +1448,28 @@ var require_proto_access = __commonJS({
1464
1448
  function _interopRequireDefault(obj) {
1465
1449
  return obj && obj.__esModule ? obj : { "default": obj };
1466
1450
  }
1467
- var _createNewLookupObject = require_create_new_lookup_object();
1451
+ var _utils = require_utils();
1468
1452
  var _logger = require_logger();
1469
1453
  var _logger2 = _interopRequireDefault(_logger);
1470
1454
  var loggedProperties = /* @__PURE__ */ Object.create(null);
1471
1455
  function createProtoAccessControl(runtimeOptions) {
1472
- var defaultMethodWhiteList = /* @__PURE__ */ Object.create(null);
1473
- defaultMethodWhiteList["constructor"] = false;
1474
- defaultMethodWhiteList["__defineGetter__"] = false;
1475
- defaultMethodWhiteList["__defineSetter__"] = false;
1476
- defaultMethodWhiteList["__lookupGetter__"] = false;
1477
- var defaultPropertyWhiteList = /* @__PURE__ */ Object.create(null);
1478
- defaultPropertyWhiteList["__proto__"] = false;
1456
+ var propertyWhiteList = /* @__PURE__ */ Object.create(null);
1457
+ propertyWhiteList["__proto__"] = false;
1458
+ _utils.extend(propertyWhiteList, runtimeOptions.allowedProtoProperties);
1459
+ var methodWhiteList = /* @__PURE__ */ Object.create(null);
1460
+ methodWhiteList["constructor"] = false;
1461
+ methodWhiteList["__defineGetter__"] = false;
1462
+ methodWhiteList["__defineSetter__"] = false;
1463
+ methodWhiteList["__lookupGetter__"] = false;
1464
+ methodWhiteList["__lookupSetter__"] = false;
1465
+ _utils.extend(methodWhiteList, runtimeOptions.allowedProtoMethods);
1479
1466
  return {
1480
1467
  properties: {
1481
- whitelist: _createNewLookupObject.createNewLookupObject(defaultPropertyWhiteList, runtimeOptions.allowedProtoProperties),
1468
+ whitelist: propertyWhiteList,
1482
1469
  defaultValue: runtimeOptions.allowProtoPropertiesByDefault
1483
1470
  },
1484
1471
  methods: {
1485
- whitelist: _createNewLookupObject.createNewLookupObject(defaultMethodWhiteList, runtimeOptions.allowedProtoMethods),
1472
+ whitelist: methodWhiteList,
1486
1473
  defaultValue: runtimeOptions.allowProtoMethodsByDefault
1487
1474
  }
1488
1475
  };
@@ -1535,7 +1522,7 @@ var require_base = __commonJS({
1535
1522
  var _logger = require_logger();
1536
1523
  var _logger2 = _interopRequireDefault(_logger);
1537
1524
  var _internalProtoAccess = require_proto_access();
1538
- var VERSION = "4.7.8";
1525
+ var VERSION = "4.7.9";
1539
1526
  exports.VERSION = VERSION;
1540
1527
  var COMPILER_REVISION = 8;
1541
1528
  exports.COMPILER_REVISION = COMPILER_REVISION;
@@ -1721,14 +1708,12 @@ var require_runtime = __commonJS({
1721
1708
  }
1722
1709
  }
1723
1710
  partial = env.VM.resolvePartial.call(this, partial, context, options);
1724
- var extendedOptions = Utils.extend({}, options, {
1725
- hooks: this.hooks,
1726
- protoAccessControl: this.protoAccessControl
1727
- });
1728
- var result = env.VM.invokePartial.call(this, partial, context, extendedOptions);
1711
+ options.hooks = this.hooks;
1712
+ options.protoAccessControl = this.protoAccessControl;
1713
+ var result = env.VM.invokePartial.call(this, partial, context, options);
1729
1714
  if (result == null && env.compile) {
1730
1715
  options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
1731
- result = options.partials[options.name](context, extendedOptions);
1716
+ result = options.partials[options.name](context, options);
1732
1717
  }
1733
1718
  if (result != null) {
1734
1719
  if (options.indent) {
@@ -1773,7 +1758,7 @@ var require_runtime = __commonJS({
1773
1758
  for (var i = 0; i < len; i++) {
1774
1759
  var result = depths[i] && container.lookupProperty(depths[i], name);
1775
1760
  if (result != null) {
1776
- return depths[i][name];
1761
+ return result;
1777
1762
  }
1778
1763
  }
1779
1764
  },
@@ -1839,8 +1824,9 @@ var require_runtime = __commonJS({
1839
1824
  ret.isTop = true;
1840
1825
  ret._setup = function(options) {
1841
1826
  if (!options.partial) {
1842
- var mergedHelpers = Utils.extend({}, env.helpers, options.helpers);
1843
- wrapHelpersToPassLookupProperty(mergedHelpers, container);
1827
+ var mergedHelpers = {};
1828
+ addHelpers(mergedHelpers, env.helpers, container);
1829
+ addHelpers(mergedHelpers, options.helpers, container);
1844
1830
  container.helpers = mergedHelpers;
1845
1831
  if (templateSpec.usePartial) {
1846
1832
  container.partials = container.mergeIfNeeded(options.partials, env.partials);
@@ -1890,18 +1876,18 @@ var require_runtime = __commonJS({
1890
1876
  function resolvePartial(partial, context, options) {
1891
1877
  if (!partial) {
1892
1878
  if (options.name === "@partial-block") {
1893
- partial = options.data["partial-block"];
1879
+ partial = lookupOwnProperty(options.data, "partial-block");
1894
1880
  } else {
1895
- partial = options.partials[options.name];
1881
+ partial = lookupOwnProperty(options.partials, options.name);
1896
1882
  }
1897
1883
  } else if (!partial.call && !options.name) {
1898
1884
  options.name = partial;
1899
- partial = options.partials[partial];
1885
+ partial = lookupOwnProperty(options.partials, partial);
1900
1886
  }
1901
1887
  return partial;
1902
1888
  }
1903
1889
  function invokePartial(partial, context, options) {
1904
- var currentPartialBlock = options.data && options.data["partial-block"];
1890
+ var currentPartialBlock = lookupOwnProperty(options.data, "partial-block");
1905
1891
  options.partial = true;
1906
1892
  if (options.ids) {
1907
1893
  options.data.contextPath = options.ids[0] || options.data.contextPath;
@@ -1934,6 +1920,11 @@ var require_runtime = __commonJS({
1934
1920
  function noop() {
1935
1921
  return "";
1936
1922
  }
1923
+ function lookupOwnProperty(obj, name) {
1924
+ if (obj && Object.prototype.hasOwnProperty.call(obj, name)) {
1925
+ return obj[name];
1926
+ }
1927
+ }
1937
1928
  function initData(context, data) {
1938
1929
  if (!data || !("root" in data)) {
1939
1930
  data = data ? _base.createFrame(data) : {};
@@ -1949,16 +1940,18 @@ var require_runtime = __commonJS({
1949
1940
  }
1950
1941
  return prog;
1951
1942
  }
1952
- function wrapHelpersToPassLookupProperty(mergedHelpers, container) {
1953
- Object.keys(mergedHelpers).forEach(function(helperName) {
1954
- var helper = mergedHelpers[helperName];
1943
+ function addHelpers(mergedHelpers, helpers, container) {
1944
+ if (!helpers) return;
1945
+ Object.keys(helpers).forEach(function(helperName) {
1946
+ var helper = helpers[helperName];
1955
1947
  mergedHelpers[helperName] = passLookupPropertyOption(helper, container);
1956
1948
  });
1957
1949
  }
1958
1950
  function passLookupPropertyOption(helper, container) {
1959
1951
  var lookupProperty = container.lookupProperty;
1960
1952
  return _internalWrapHelper.wrapHelper(helper, function(options) {
1961
- return Utils.extend({ lookupProperty }, options);
1953
+ options.lookupProperty = lookupProperty;
1954
+ return options;
1962
1955
  });
1963
1956
  }
1964
1957
  }
@@ -2768,7 +2761,7 @@ var require_parser = __commonJS({
2768
2761
  break;
2769
2762
  }
2770
2763
  };
2771
- lexer2.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2764
+ lexer2.rules = [/^(?:[^\x00]*?(?=(\{\{)))/, /^(?:[^\x00]+)/, /^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/, /^(?:\{\{\{\{(?=[^\/]))/, /^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/, /^(?:[^\x00]+?(?=(\{\{\{\{)))/, /^(?:[\s\S]*?--(~)?\}\})/, /^(?:\()/, /^(?:\))/, /^(?:\{\{\{\{)/, /^(?:\}\}\}\})/, /^(?:\{\{(~)?>)/, /^(?:\{\{(~)?#>)/, /^(?:\{\{(~)?#\*?)/, /^(?:\{\{(~)?\/)/, /^(?:\{\{(~)?\^\s*(~)?\}\})/, /^(?:\{\{(~)?\s*else\s*(~)?\}\})/, /^(?:\{\{(~)?\^)/, /^(?:\{\{(~)?\s*else\b)/, /^(?:\{\{(~)?\{)/, /^(?:\{\{(~)?&)/, /^(?:\{\{(~)?!--)/, /^(?:\{\{(~)?![\s\S]*?\}\})/, /^(?:\{\{(~)?\*?)/, /^(?:=)/, /^(?:\.\.)/, /^(?:\.(?=([=~}\s\/.)|])))/, /^(?:[\/.])/, /^(?:\s+)/, /^(?:\}(~)?\}\})/, /^(?:(~)?\}\})/, /^(?:"(\\["]|[^"])*")/, /^(?:'(\\[']|[^'])*')/, /^(?:@)/, /^(?:true(?=([~}\s)])))/, /^(?:false(?=([~}\s)])))/, /^(?:undefined(?=([~}\s)])))/, /^(?:null(?=([~}\s)])))/, /^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/, /^(?:as\s+\|)/, /^(?:\|)/, /^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)|]))))/, /^(?:\[(\\\]|[^\]])*\])/, /^(?:.)/, /^(?:$)/];
2772
2765
  lexer2.conditions = { "mu": { "rules": [7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44], "inclusive": false }, "emu": { "rules": [2], "inclusive": false }, "com": { "rules": [6], "inclusive": false }, "raw": { "rules": [3, 4, 5], "inclusive": false }, "INITIAL": { "rules": [0, 1, 44], "inclusive": true } };
2773
2766
  return lexer2;
2774
2767
  })();
@@ -3275,12 +3268,15 @@ var require_base2 = __commonJS({
3275
3268
  var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
3276
3269
  var _helpers = require_helpers2();
3277
3270
  var Helpers = _interopRequireWildcard(_helpers);
3271
+ var _exception = require_exception();
3272
+ var _exception2 = _interopRequireDefault(_exception);
3278
3273
  var _utils = require_utils();
3279
3274
  exports.parser = _parser2["default"];
3280
3275
  var yy = {};
3281
3276
  _utils.extend(yy, Helpers);
3282
3277
  function parseWithoutProcessing(input, options) {
3283
3278
  if (input.type === "Program") {
3279
+ validateInputAst(input);
3284
3280
  return input;
3285
3281
  }
3286
3282
  _parser2["default"].yy = yy;
@@ -3295,6 +3291,51 @@ var require_base2 = __commonJS({
3295
3291
  var strip = new _whitespaceControl2["default"](options);
3296
3292
  return strip.accept(ast);
3297
3293
  }
3294
+ function validateInputAst(ast) {
3295
+ validateAstNode(ast);
3296
+ }
3297
+ function validateAstNode(node) {
3298
+ if (node == null) {
3299
+ return;
3300
+ }
3301
+ if (Array.isArray(node)) {
3302
+ node.forEach(validateAstNode);
3303
+ return;
3304
+ }
3305
+ if (typeof node !== "object") {
3306
+ return;
3307
+ }
3308
+ if (node.type === "PathExpression") {
3309
+ if (!isValidDepth(node.depth)) {
3310
+ throw new _exception2["default"]("Invalid AST: PathExpression.depth must be an integer");
3311
+ }
3312
+ if (!Array.isArray(node.parts)) {
3313
+ throw new _exception2["default"]("Invalid AST: PathExpression.parts must be an array");
3314
+ }
3315
+ for (var i = 0; i < node.parts.length; i++) {
3316
+ if (typeof node.parts[i] !== "string") {
3317
+ throw new _exception2["default"]("Invalid AST: PathExpression.parts must only contain strings");
3318
+ }
3319
+ }
3320
+ } else if (node.type === "NumberLiteral") {
3321
+ if (typeof node.value !== "number" || !isFinite(node.value)) {
3322
+ throw new _exception2["default"]("Invalid AST: NumberLiteral.value must be a number");
3323
+ }
3324
+ } else if (node.type === "BooleanLiteral") {
3325
+ if (typeof node.value !== "boolean") {
3326
+ throw new _exception2["default"]("Invalid AST: BooleanLiteral.value must be a boolean");
3327
+ }
3328
+ }
3329
+ Object.keys(node).forEach(function(propertyName) {
3330
+ if (propertyName === "loc") {
3331
+ return;
3332
+ }
3333
+ validateAstNode(node[propertyName]);
3334
+ });
3335
+ }
3336
+ function isValidDepth(depth) {
3337
+ return typeof depth === "number" && isFinite(depth) && Math.floor(depth) === depth && depth >= 0;
3338
+ }
3298
3339
  }
3299
3340
  });
3300
3341
 
@@ -5734,12 +5775,10 @@ var require_javascript_compiler = __commonJS({
5734
5775
  var programs = _context.programs;
5735
5776
  var decorators = _context.decorators;
5736
5777
  for (i = 0, l = programs.length; i < l; i++) {
5737
- if (programs[i]) {
5738
- ret[i] = programs[i];
5739
- if (decorators[i]) {
5740
- ret[i + "_d"] = decorators[i];
5741
- ret.useDecorators = true;
5742
- }
5778
+ ret[i] = programs[i];
5779
+ if (decorators[i]) {
5780
+ ret[i + "_d"] = decorators[i];
5781
+ ret.useDecorators = true;
5743
5782
  }
5744
5783
  }
5745
5784
  if (this.environment.usePartial) {
@@ -6000,22 +6039,25 @@ var require_javascript_compiler = __commonJS({
6000
6039
  }
6001
6040
  this.resolvePath("data", parts, 0, true, strict);
6002
6041
  },
6003
- resolvePath: function resolvePath(type, parts, i, falsy, strict) {
6042
+ resolvePath: function resolvePath(type, parts, startPartIndex, falsy, strict) {
6004
6043
  var _this2 = this;
6005
6044
  if (this.options.strict || this.options.assumeObjects) {
6006
- this.push(strictLookup(this.options.strict && strict, this, parts, i, type));
6045
+ this.push(strictLookup(this.options.strict && strict, this, parts, startPartIndex, type));
6007
6046
  return;
6008
6047
  }
6009
6048
  var len = parts.length;
6010
- for (; i < len; i++) {
6011
- this.replaceStack(function(current) {
6012
- var lookup = _this2.nameLookup(current, parts[i], type);
6049
+ var _loop = function(i2) {
6050
+ _this2.replaceStack(function(current) {
6051
+ var lookup = _this2.nameLookup(current, parts[i2], type);
6013
6052
  if (!falsy) {
6014
6053
  return [" != null ? ", lookup, " : ", current];
6015
6054
  } else {
6016
6055
  return [" && ", lookup];
6017
6056
  }
6018
6057
  });
6058
+ };
6059
+ for (var i = startPartIndex; i < len; i++) {
6060
+ _loop(i);
6019
6061
  }
6020
6062
  },
6021
6063
  // [resolvePossibleLambda]
@@ -6119,7 +6161,9 @@ var require_javascript_compiler = __commonJS({
6119
6161
  // and inserts the decorator into the decorators list.
6120
6162
  registerDecorator: function registerDecorator(paramSize, name) {
6121
6163
  var foundDecorator = this.nameLookup("decorators", name, "decorator"), options = this.setupHelperArgs(name, paramSize);
6122
- this.decorators.push(["fn = ", this.decorators.functionCall(foundDecorator, "", ["fn", "props", "container", options]), " || fn;"]);
6164
+ this.decorators.push(["var decorator = ", foundDecorator, ";"]);
6165
+ this.decorators.push(['if (typeof decorator !== "function") { throw new Error(', this.quotedString('Missing decorator: "' + name + '"'), "); }"]);
6166
+ this.decorators.push(["fn = ", this.decorators.functionCall("decorator", "", ["fn", "props", "container", options]), " || fn;"]);
6123
6167
  },
6124
6168
  // [invokeHelper]
6125
6169
  //
@@ -6266,8 +6310,7 @@ var require_javascript_compiler = __commonJS({
6266
6310
  compiler = new this.compiler();
6267
6311
  var existing = this.matchExistingProgram(child);
6268
6312
  if (existing == null) {
6269
- this.context.programs.push("");
6270
- var index = this.context.programs.length;
6313
+ var index = this.context.programs.push("") - 1;
6271
6314
  child.index = index;
6272
6315
  child.name = "program" + index;
6273
6316
  this.context.programs[index] = compiler.compile(child, options, this.context, !this.precompile);
@@ -6511,16 +6554,16 @@ var require_javascript_compiler = __commonJS({
6511
6554
  JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
6512
6555
  return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
6513
6556
  };
6514
- function strictLookup(requireTerminal, compiler, parts, i, type) {
6557
+ function strictLookup(requireTerminal, compiler, parts, startPartIndex, type) {
6515
6558
  var stack = compiler.popStack(), len = parts.length;
6516
6559
  if (requireTerminal) {
6517
6560
  len--;
6518
6561
  }
6519
- for (; i < len; i++) {
6562
+ for (var i = startPartIndex; i < len; i++) {
6520
6563
  stack = compiler.nameLookup(stack, parts[i], type);
6521
6564
  }
6522
6565
  if (requireTerminal) {
6523
- return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[i]), ", ", JSON.stringify(compiler.source.currentLocation), " )"];
6566
+ return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[len]), ", ", JSON.stringify(compiler.source.currentLocation), " )"];
6524
6567
  } else {
6525
6568
  return stack;
6526
6569
  }
@@ -7603,6 +7646,16 @@ function ErrFromThrowable(error) {
7603
7646
  error
7604
7647
  };
7605
7648
  }
7649
+ function resolveAppErrorInfo(errorInfo, cause) {
7650
+ if (typeof errorInfo !== "function") {
7651
+ return errorInfo;
7652
+ }
7653
+ const result = fromThrowable(() => errorInfo(cause), "resolve-app-error-info-error");
7654
+ return isOk(result) ? result.value : void 0;
7655
+ }
7656
+ function isOk(result) {
7657
+ return result._tag === "Ok";
7658
+ }
7606
7659
  function isErr(result) {
7607
7660
  return result._tag === "Err";
7608
7661
  }
@@ -7611,7 +7664,7 @@ function fromThrowable(fn, errorType, errorInfo) {
7611
7664
  const result = fn();
7612
7665
  if (result && typeof result.then === "function") {
7613
7666
  return result.then((value) => Ok(value)).catch((err) => Err({
7614
- ...errorInfo,
7667
+ ...resolveAppErrorInfo(errorInfo, err),
7615
7668
  type: errorType,
7616
7669
  cause: err
7617
7670
  }));
@@ -7619,7 +7672,7 @@ function fromThrowable(fn, errorType, errorInfo) {
7619
7672
  return Ok(result);
7620
7673
  } catch (err) {
7621
7674
  return Err({
7622
- ...errorInfo,
7675
+ ...resolveAppErrorInfo(errorInfo, err),
7623
7676
  type: errorType,
7624
7677
  cause: err
7625
7678
  });
@@ -8299,6 +8352,7 @@ var browserProviderOptionsSchema = z6.object({
8299
8352
  viewport: viewportSizeSchema.optional()
8300
8353
  }).optional().describe("Configuration options for local browser execution (development only)."),
8301
8354
  hyperbrowser: z6.object({
8355
+ solveCaptchas: z6.boolean().default(true).optional().describe("Automatically solve CAPTCHAs in the background when encountered."),
8302
8356
  viewport: viewportSizeSchema.optional()
8303
8357
  }).optional().describe("Configuration options specific to the Hyperbrowser provider."),
8304
8358
  steel: z6.object({
@@ -10021,6 +10075,7 @@ var agentBrowserProviderOptionsSelection = ` browserbase {
10021
10075
  }
10022
10076
  }
10023
10077
  hyperbrowser {
10078
+ solveCaptchas
10024
10079
  viewport {
10025
10080
  width
10026
10081
  height
@@ -10383,14 +10438,12 @@ query GetAutomationAgents($ids: [ID!]!) {
10383
10438
  operationName: "GetAutomationDiffFromPublished",
10384
10439
  kind: "query",
10385
10440
  inputSchema: z17.object({
10386
- automationId: z17.string().min(1),
10387
- draftVersionId: z17.string().min(1).optional(),
10388
- publishedVersionId: z17.string().min(1).optional()
10441
+ automationId: z17.string().min(1)
10389
10442
  }),
10390
10443
  cli: {
10391
10444
  name: "get-automation-diff-from-published",
10392
10445
  path: ["automations", "diff-from-published"],
10393
- description: "Fetch draft-vs-published automation change scope.",
10446
+ description: "Fetch draft-vs-published automation JSON Patch.",
10394
10447
  resultKey: "automationDiffFromPublished",
10395
10448
  options: [
10396
10449
  stringOption({
@@ -10398,39 +10451,128 @@ query GetAutomationAgents($ids: [ID!]!) {
10398
10451
  flagName: "automation-id",
10399
10452
  description: "Automation ID.",
10400
10453
  required: true
10401
- }),
10402
- stringOption({
10403
- inputKey: "draftVersionId",
10404
- flagName: "draft-version-id",
10405
- description: "Draft automation version ID to compare from."
10406
- }),
10407
- stringOption({
10408
- inputKey: "publishedVersionId",
10409
- flagName: "published-version-id",
10410
- description: "Published automation version ID to compare against."
10411
10454
  })
10412
10455
  ]
10413
10456
  },
10414
10457
  mcp: { fileName: "automationDiffFromPublished.graphql" },
10415
- document: `# Query deterministic draft-vs-published agent and field changes
10416
- query GetAutomationDiffFromPublished($automationId: ID!, $draftVersionId: ID, $publishedVersionId: ID) {
10417
- automationDiffFromPublished(automationId: $automationId, draftVersionId: $draftVersionId, publishedVersionId: $publishedVersionId) {
10458
+ document: `# Query JSON Patch changes from published automation JSON to draft automation JSON
10459
+ query GetAutomationDiffFromPublished($automationId: ID!) {
10460
+ automationDiffFromPublished(automationId: $automationId) {
10418
10461
  automationId
10419
10462
  automationName
10420
10463
  mode
10421
- publishedAutomationId
10464
+ draftVersionId
10465
+ publishedVersionId
10422
10466
  hasChanges
10423
- changedAgents {
10424
- agentId
10425
- agentName
10426
- changeTypes
10427
- changedFields
10428
- changes {
10429
- type
10430
- field
10431
- }
10432
- }
10467
+ changes
10433
10468
  }
10469
+ }`
10470
+ }),
10471
+ createOperationSpec({
10472
+ operationName: "GetAutomationDiffVersions",
10473
+ kind: "query",
10474
+ inputSchema: z17.object({
10475
+ baseVersionId: z17.string().min(1),
10476
+ targetVersionId: z17.string().min(1)
10477
+ }),
10478
+ cli: {
10479
+ name: "get-automation-diff-versions",
10480
+ path: ["automations", "diff-versions"],
10481
+ description: "Fetch automation JSON Patch between two saved versions.",
10482
+ resultKey: "automationDiffVersions",
10483
+ options: [
10484
+ stringOption({
10485
+ inputKey: "baseVersionId",
10486
+ flagName: "base-version-id",
10487
+ description: "Older automation version ID to compare from.",
10488
+ required: true
10489
+ }),
10490
+ stringOption({
10491
+ inputKey: "targetVersionId",
10492
+ flagName: "target-version-id",
10493
+ description: "Newer automation version ID to compare to.",
10494
+ required: true
10495
+ })
10496
+ ]
10497
+ },
10498
+ mcp: { fileName: "automationDiffVersions.graphql" },
10499
+ document: `# Query JSON Patch changes between two normalized automation JSON payloads
10500
+ query GetAutomationDiffVersions($baseVersionId: ID!, $targetVersionId: ID!) {
10501
+ automationDiffVersions(baseVersionId: $baseVersionId, targetVersionId: $targetVersionId) {
10502
+ baseAutomationId
10503
+ baseAutomationName
10504
+ baseVersionId
10505
+ targetAutomationId
10506
+ targetAutomationName
10507
+ targetVersionId
10508
+ mode
10509
+ hasChanges
10510
+ changes
10511
+ }
10512
+ }`
10513
+ }),
10514
+ createOperationSpec({
10515
+ operationName: "GetAutomationVersionJson",
10516
+ kind: "query",
10517
+ inputSchema: z17.object({
10518
+ versionId: z17.string().min(1),
10519
+ paths: z17.array(z17.string().min(1)).optional(),
10520
+ format: z17.enum(["normalized", "export"]).optional()
10521
+ }),
10522
+ cli: {
10523
+ name: "get-automation-version-json",
10524
+ path: ["automations", "versions", "get-json"],
10525
+ description: "Fetch one saved automation version as normalized automation JSON by default. Pass --format export for raw import/export JSON.",
10526
+ resultKey: "automationVersionJson",
10527
+ options: [
10528
+ stringOption({
10529
+ inputKey: "versionId",
10530
+ flagName: "version-id",
10531
+ description: "Saved automation version ID.",
10532
+ required: true
10533
+ }),
10534
+ stringOption({
10535
+ inputKey: "format",
10536
+ flagName: "format",
10537
+ description: "Optional output format: normalized or export."
10538
+ }),
10539
+ stringArrayOption({
10540
+ inputKey: "paths",
10541
+ flagName: "paths",
10542
+ description: "Optional comma-separated JSON Pointer paths to fetch from normalized automation JSON."
10543
+ })
10544
+ ]
10545
+ },
10546
+ mcp: { fileName: "automationVersionJson.graphql" },
10547
+ document: `# Query one saved automation version as normalized automation JSON by default, or raw import/export JSON with format: export
10548
+ query GetAutomationVersionJson($versionId: ID!, $paths: [String!], $format: String) {
10549
+ automationVersionJson(versionId: $versionId, paths: $paths, format: $format)
10550
+ }`
10551
+ }),
10552
+ createOperationSpec({
10553
+ operationName: "GetAutomationVersionJsonSkeleton",
10554
+ kind: "query",
10555
+ inputSchema: z17.object({
10556
+ versionId: z17.string().min(1)
10557
+ }),
10558
+ cli: {
10559
+ name: "get-automation-version-json-skeleton",
10560
+ path: ["automations", "versions", "get-skeleton"],
10561
+ description: "Fetch one saved automation version as compact normalized automation JSON skeleton.",
10562
+ resultKey: "automationVersionJsonSkeleton",
10563
+ options: [
10564
+ stringOption({
10565
+ inputKey: "versionId",
10566
+ flagName: "version-id",
10567
+ description: "Saved automation version ID.",
10568
+ required: true
10569
+ })
10570
+ ]
10571
+ },
10572
+ mcp: { fileName: "automationVersionJsonSkeleton.graphql" },
10573
+ document: `# Query one saved automation version as compact normalized automation JSON skeleton
10574
+ query GetAutomationVersionJsonSkeleton($versionId: ID!) {
10575
+ automationVersionJsonSkeleton(versionId: $versionId)
10434
10576
  }`
10435
10577
  }),
10436
10578
  createOperationSpec({