@aaac/runtime 0.2.5 → 0.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/adapters/adk-sdk.d.ts +2 -2
  2. package/dist/adapters/adk-sdk.js +1 -1
  3. package/dist/adapters/claude-agent-sdk.d.ts +9 -2
  4. package/dist/adapters/claude-agent-sdk.js +109 -73
  5. package/dist/adapters/claude-agent-sdk.js.map +1 -1
  6. package/dist/adapters/mock.d.ts +1 -1
  7. package/dist/adapters/openai-agents-sdk.d.ts +2 -2
  8. package/dist/adapters/openai-agents-sdk.js +1 -1
  9. package/dist/{chunk-3DDB34BU.js → chunk-D2UXESPT.js} +2 -2
  10. package/dist/chunk-D2UXESPT.js.map +1 -0
  11. package/dist/{chunk-MG2ULUX6.js → chunk-DEBCJKRX.js} +2 -2
  12. package/dist/{chunk-2INQL5TG.js → chunk-GWNXNSGL.js} +6 -5
  13. package/dist/chunk-GWNXNSGL.js.map +1 -0
  14. package/dist/{chunk-MSVIEEGR.js → chunk-HR2Q64AO.js} +29 -5
  15. package/dist/chunk-HR2Q64AO.js.map +1 -0
  16. package/dist/{chunk-VJXGCWSZ.js → chunk-MG7WSWJU.js} +16 -1
  17. package/dist/chunk-MG7WSWJU.js.map +1 -0
  18. package/dist/{chunk-FKAI54OM.js → chunk-QVMLALPF.js} +2 -2
  19. package/dist/{chunk-F5R46S7I.js → chunk-Y7NORFFM.js} +2 -2
  20. package/dist/claude-bundles/full.js +134 -133
  21. package/dist/claude-bundles/lean.js +5 -4
  22. package/dist/generator/index.d.ts +2 -2
  23. package/dist/generator/index.js +2 -2
  24. package/dist/{guardrail-hooks-CB23nhZV.d.ts → guardrail-hooks-B-qe4ebW.d.ts} +16 -3
  25. package/dist/{hook-protocol-CFnNudiV.d.ts → hook-protocol-BH86kCQB.d.ts} +2 -0
  26. package/dist/{hooks-lite-CoWWnCRH.d.ts → hooks-lite-DvZu9Jhx.d.ts} +2 -2
  27. package/dist/{index-BlSepCSZ.d.ts → index-C2DHitGz.d.ts} +9 -1
  28. package/dist/index.d.ts +11 -7
  29. package/dist/index.js +314 -196
  30. package/dist/index.js.map +1 -1
  31. package/dist/lib/claude-native/hooks-lite.d.ts +3 -3
  32. package/dist/lib/claude-native/hooks-lite.js +3 -3
  33. package/dist/lib/claude-native/hooks-prompt.d.ts +4 -4
  34. package/dist/lib/claude-native/hooks-prompt.js +3 -3
  35. package/dist/lib/claude-native/index.d.ts +7 -7
  36. package/dist/lib/claude-native/index.js +6 -6
  37. package/dist/{navigation-context-B-RpUg3_.d.ts → navigation-context-D1NbiipT.d.ts} +1 -1
  38. package/dist/{task-runner-37cFPFas.d.ts → task-runner-CgQx1KUq.d.ts} +25 -1
  39. package/dist/{workspace-user-prompt-submit-D11Iu0zO.d.ts → workspace-user-prompt-submit-aErGPoX4.d.ts} +2 -2
  40. package/package.json +5 -5
  41. package/dist/chunk-2INQL5TG.js.map +0 -1
  42. package/dist/chunk-3DDB34BU.js.map +0 -1
  43. package/dist/chunk-MSVIEEGR.js.map +0 -1
  44. package/dist/chunk-VJXGCWSZ.js.map +0 -1
  45. /package/dist/{chunk-MG2ULUX6.js.map → chunk-DEBCJKRX.js.map} +0 -0
  46. /package/dist/{chunk-FKAI54OM.js.map → chunk-QVMLALPF.js.map} +0 -0
  47. /package/dist/{chunk-F5R46S7I.js.map → chunk-Y7NORFFM.js.map} +0 -0
package/dist/index.js CHANGED
@@ -14,13 +14,15 @@ import {
14
14
  resolveGuardrailContext,
15
15
  resolveNavigationDsl,
16
16
  resolveNavigationSources
17
- } from "./chunk-MG2ULUX6.js";
17
+ } from "./chunk-DEBCJKRX.js";
18
18
  import {
19
19
  jsonSchemaToZod
20
20
  } from "./chunk-ET6TGQRT.js";
21
21
  import {
22
+ AdapterError,
23
+ adapterErrorKind,
22
24
  toolGrantForAgent
23
- } from "./chunk-VJXGCWSZ.js";
25
+ } from "./chunk-MG7WSWJU.js";
24
26
  import {
25
27
  OBSERVABILITY_ENV_VARS,
26
28
  buildObservabilityEnv,
@@ -47,8 +49,9 @@ import {
47
49
  import {
48
50
  PROJECT_CONFIG_FILENAME,
49
51
  loadProjectConfig,
50
- loadWorkspaceMembers
51
- } from "./chunk-F5R46S7I.js";
52
+ loadWorkspaceMembers,
53
+ readProjectManifest
54
+ } from "./chunk-Y7NORFFM.js";
52
55
  import {
53
56
  isNavigationIndex,
54
57
  renderNavigationIndexPrompt
@@ -61,16 +64,16 @@ import {
61
64
  getWarnings,
62
65
  hasBlockingViolation,
63
66
  toolTargetPath
64
- } from "./chunk-MSVIEEGR.js";
67
+ } from "./chunk-HR2Q64AO.js";
65
68
  import {
66
69
  __commonJS,
67
70
  __require,
68
71
  __toESM
69
72
  } from "./chunk-BJ7B4R26.js";
70
73
 
71
- // ../../node_modules/handlebars/dist/cjs/handlebars/utils.js
74
+ // node_modules/handlebars/dist/cjs/handlebars/utils.js
72
75
  var require_utils = __commonJS({
73
- "../../node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports) {
76
+ "node_modules/handlebars/dist/cjs/handlebars/utils.js"(exports) {
74
77
  "use strict";
75
78
  exports.__esModule = true;
76
79
  exports.extend = extend;
@@ -129,7 +132,7 @@ var require_utils = __commonJS({
129
132
  }
130
133
  function escapeExpression(string) {
131
134
  if (typeof string !== "string") {
132
- if (string && string.toHTML) {
135
+ if (string && typeof string.toHTML === "function") {
133
136
  return string.toHTML();
134
137
  } else if (string == null) {
135
138
  return "";
@@ -167,19 +170,21 @@ var require_utils = __commonJS({
167
170
  }
168
171
  });
169
172
 
170
- // ../../node_modules/handlebars/dist/cjs/handlebars/exception.js
173
+ // node_modules/handlebars/dist/cjs/handlebars/exception.js
171
174
  var require_exception = __commonJS({
172
- "../../node_modules/handlebars/dist/cjs/handlebars/exception.js"(exports, module) {
175
+ "node_modules/handlebars/dist/cjs/handlebars/exception.js"(exports, module) {
173
176
  "use strict";
174
177
  exports.__esModule = true;
175
178
  var errorProps = ["description", "fileName", "lineNumber", "endLineNumber", "message", "name", "number", "stack"];
176
179
  function Exception(message, node) {
177
180
  var loc = node && node.loc, line = void 0, endLineNumber = void 0, column = void 0, endColumn = void 0;
178
- if (loc) {
181
+ if (loc && loc.start) {
179
182
  line = loc.start.line;
180
- endLineNumber = loc.end.line;
181
183
  column = loc.start.column;
182
- endColumn = loc.end.column;
184
+ if (loc.end) {
185
+ endLineNumber = loc.end.line;
186
+ endColumn = loc.end.column;
187
+ }
183
188
  message += " - " + line + ":" + column;
184
189
  }
185
190
  var tmp = Error.prototype.constructor.call(this, message);
@@ -216,9 +221,9 @@ var require_exception = __commonJS({
216
221
  }
217
222
  });
218
223
 
219
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js
224
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js
220
225
  var require_block_helper_missing = __commonJS({
221
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(exports, module) {
226
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/block-helper-missing.js"(exports, module) {
222
227
  "use strict";
223
228
  exports.__esModule = true;
224
229
  var _utils = require_utils();
@@ -252,9 +257,9 @@ var require_block_helper_missing = __commonJS({
252
257
  }
253
258
  });
254
259
 
255
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/each.js
260
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/each.js
256
261
  var require_each = __commonJS({
257
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(exports, module) {
262
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/each.js"(exports, module) {
258
263
  "use strict";
259
264
  exports.__esModule = true;
260
265
  function _interopRequireDefault(obj) {
@@ -263,6 +268,15 @@ var require_each = __commonJS({
263
268
  var _utils = require_utils();
264
269
  var _exception = require_exception();
265
270
  var _exception2 = _interopRequireDefault(_exception);
271
+ function closeIterator(iterator) {
272
+ try {
273
+ var _close = iterator["return"];
274
+ if (_utils.isFunction(_close)) {
275
+ _close.call(iterator);
276
+ }
277
+ } catch (closeError) {
278
+ }
279
+ }
266
280
  exports["default"] = function(instance) {
267
281
  instance.registerHelper("each", function(context, options) {
268
282
  if (!options) {
@@ -278,7 +292,7 @@ var require_each = __commonJS({
278
292
  if (options.data) {
279
293
  data = _utils.createFrame(options.data);
280
294
  }
281
- function execIteration(field, index, last) {
295
+ function execIteration(field, index, last, value) {
282
296
  if (data) {
283
297
  data.key = field;
284
298
  data.index = index;
@@ -288,40 +302,46 @@ var require_each = __commonJS({
288
302
  data.contextPath = contextPath + field;
289
303
  }
290
304
  }
291
- ret = ret + fn(context[field], {
305
+ ret = ret + fn(value, {
292
306
  data,
293
- blockParams: _utils.blockParams([context[field], field], [contextPath + field, null])
307
+ blockParams: _utils.blockParams([value, field], [contextPath + field, null])
294
308
  });
295
309
  }
296
310
  if (context && typeof context === "object") {
297
311
  if (_utils.isArray(context)) {
298
312
  for (var j = context.length; i < j; i++) {
299
313
  if (i in context) {
300
- execIteration(i, i, i === context.length - 1);
314
+ execIteration(i, i, i === context.length - 1, context[i]);
301
315
  }
302
316
  }
303
317
  } else if (typeof Symbol === "function" && context[Symbol.iterator]) {
304
- var newContext = [];
305
318
  var iterator = context[Symbol.iterator]();
306
- for (var it = iterator.next(); !it.done; it = iterator.next()) {
307
- newContext.push(it.value);
308
- }
309
- context = newContext;
310
- for (var j = context.length; i < j; i++) {
311
- execIteration(i, i, i === context.length - 1);
319
+ var current = iterator.next();
320
+ while (!current.done) {
321
+ var next = iterator.next();
322
+ try {
323
+ execIteration(i, i, next.done, current.value);
324
+ } catch (e) {
325
+ if (!next.done) {
326
+ closeIterator(iterator);
327
+ }
328
+ throw e;
329
+ }
330
+ current = next;
331
+ i++;
312
332
  }
313
333
  } else {
314
334
  (function() {
315
335
  var priorKey = void 0;
316
336
  Object.keys(context).forEach(function(key) {
317
337
  if (priorKey !== void 0) {
318
- execIteration(priorKey, i - 1);
338
+ execIteration(priorKey, i - 1, false, context[priorKey]);
319
339
  }
320
340
  priorKey = key;
321
341
  i++;
322
342
  });
323
343
  if (priorKey !== void 0) {
324
- execIteration(priorKey, i - 1, true);
344
+ execIteration(priorKey, i - 1, true, context[priorKey]);
325
345
  }
326
346
  })();
327
347
  }
@@ -336,9 +356,9 @@ var require_each = __commonJS({
336
356
  }
337
357
  });
338
358
 
339
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js
359
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js
340
360
  var require_helper_missing = __commonJS({
341
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(exports, module) {
361
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/helper-missing.js"(exports, module) {
342
362
  "use strict";
343
363
  exports.__esModule = true;
344
364
  function _interopRequireDefault(obj) {
@@ -359,9 +379,9 @@ var require_helper_missing = __commonJS({
359
379
  }
360
380
  });
361
381
 
362
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/if.js
382
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/if.js
363
383
  var require_if = __commonJS({
364
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(exports, module) {
384
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/if.js"(exports, module) {
365
385
  "use strict";
366
386
  exports.__esModule = true;
367
387
  function _interopRequireDefault(obj) {
@@ -399,9 +419,9 @@ var require_if = __commonJS({
399
419
  }
400
420
  });
401
421
 
402
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/log.js
422
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/log.js
403
423
  var require_log = __commonJS({
404
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(exports, module) {
424
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/log.js"(exports, module) {
405
425
  "use strict";
406
426
  exports.__esModule = true;
407
427
  exports["default"] = function(instance) {
@@ -424,9 +444,9 @@ var require_log = __commonJS({
424
444
  }
425
445
  });
426
446
 
427
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js
447
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js
428
448
  var require_lookup = __commonJS({
429
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(exports, module) {
449
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/lookup.js"(exports, module) {
430
450
  "use strict";
431
451
  exports.__esModule = true;
432
452
  exports["default"] = function(instance) {
@@ -441,9 +461,9 @@ var require_lookup = __commonJS({
441
461
  }
442
462
  });
443
463
 
444
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers/with.js
464
+ // node_modules/handlebars/dist/cjs/handlebars/helpers/with.js
445
465
  var require_with = __commonJS({
446
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(exports, module) {
466
+ "node_modules/handlebars/dist/cjs/handlebars/helpers/with.js"(exports, module) {
447
467
  "use strict";
448
468
  exports.__esModule = true;
449
469
  function _interopRequireDefault(obj) {
@@ -480,9 +500,9 @@ var require_with = __commonJS({
480
500
  }
481
501
  });
482
502
 
483
- // ../../node_modules/handlebars/dist/cjs/handlebars/helpers.js
503
+ // node_modules/handlebars/dist/cjs/handlebars/helpers.js
484
504
  var require_helpers = __commonJS({
485
- "../../node_modules/handlebars/dist/cjs/handlebars/helpers.js"(exports) {
505
+ "node_modules/handlebars/dist/cjs/handlebars/helpers.js"(exports) {
486
506
  "use strict";
487
507
  exports.__esModule = true;
488
508
  exports.registerDefaultHelpers = registerDefaultHelpers;
@@ -524,9 +544,9 @@ var require_helpers = __commonJS({
524
544
  }
525
545
  });
526
546
 
527
- // ../../node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js
547
+ // node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js
528
548
  var require_inline = __commonJS({
529
- "../../node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(exports, module) {
549
+ "node_modules/handlebars/dist/cjs/handlebars/decorators/inline.js"(exports, module) {
530
550
  "use strict";
531
551
  exports.__esModule = true;
532
552
  var _utils = require_utils();
@@ -551,9 +571,9 @@ var require_inline = __commonJS({
551
571
  }
552
572
  });
553
573
 
554
- // ../../node_modules/handlebars/dist/cjs/handlebars/decorators.js
574
+ // node_modules/handlebars/dist/cjs/handlebars/decorators.js
555
575
  var require_decorators = __commonJS({
556
- "../../node_modules/handlebars/dist/cjs/handlebars/decorators.js"(exports) {
576
+ "node_modules/handlebars/dist/cjs/handlebars/decorators.js"(exports) {
557
577
  "use strict";
558
578
  exports.__esModule = true;
559
579
  exports.registerDefaultDecorators = registerDefaultDecorators;
@@ -568,9 +588,9 @@ var require_decorators = __commonJS({
568
588
  }
569
589
  });
570
590
 
571
- // ../../node_modules/handlebars/dist/cjs/handlebars/logger.js
591
+ // node_modules/handlebars/dist/cjs/handlebars/logger.js
572
592
  var require_logger = __commonJS({
573
- "../../node_modules/handlebars/dist/cjs/handlebars/logger.js"(exports, module) {
593
+ "node_modules/handlebars/dist/cjs/handlebars/logger.js"(exports, module) {
574
594
  "use strict";
575
595
  exports.__esModule = true;
576
596
  var _utils = require_utils();
@@ -609,13 +629,14 @@ var require_logger = __commonJS({
609
629
  }
610
630
  });
611
631
 
612
- // ../../node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
632
+ // node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js
613
633
  var require_proto_access = __commonJS({
614
- "../../node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(exports) {
634
+ "node_modules/handlebars/dist/cjs/handlebars/internal/proto-access.js"(exports) {
615
635
  "use strict";
616
636
  exports.__esModule = true;
617
637
  exports.createProtoAccessControl = createProtoAccessControl;
618
638
  exports.resultIsAllowed = resultIsAllowed;
639
+ exports.isPrototypeConstructor = isPrototypeConstructor;
619
640
  exports.resetLoggedProperties = resetLoggedProperties;
620
641
  function _interopRequireDefault(obj) {
621
642
  return obj && obj.__esModule ? obj : { "default": obj };
@@ -653,6 +674,9 @@ var require_proto_access = __commonJS({
653
674
  return checkWhiteList(protoAccessControl.properties, propertyName);
654
675
  }
655
676
  }
677
+ function isPrototypeConstructor(parent, propertyName, result) {
678
+ return propertyName === "constructor" && typeof result === "function" && parent === result.prototype;
679
+ }
656
680
  function checkWhiteList(protoAccessControlForType, propertyName) {
657
681
  if (protoAccessControlForType.whitelist[propertyName] !== void 0) {
658
682
  return protoAccessControlForType.whitelist[propertyName] === true;
@@ -677,9 +701,9 @@ var require_proto_access = __commonJS({
677
701
  }
678
702
  });
679
703
 
680
- // ../../node_modules/handlebars/dist/cjs/handlebars/base.js
704
+ // node_modules/handlebars/dist/cjs/handlebars/base.js
681
705
  var require_base = __commonJS({
682
- "../../node_modules/handlebars/dist/cjs/handlebars/base.js"(exports) {
706
+ "node_modules/handlebars/dist/cjs/handlebars/base.js"(exports) {
683
707
  "use strict";
684
708
  exports.__esModule = true;
685
709
  exports.HandlebarsEnvironment = HandlebarsEnvironment;
@@ -694,7 +718,7 @@ var require_base = __commonJS({
694
718
  var _logger = require_logger();
695
719
  var _logger2 = _interopRequireDefault(_logger);
696
720
  var _internalProtoAccess = require_proto_access();
697
- var VERSION = "4.7.9";
721
+ var VERSION = "4.7.10";
698
722
  exports.VERSION = VERSION;
699
723
  var COMPILER_REVISION = 8;
700
724
  exports.COMPILER_REVISION = COMPILER_REVISION;
@@ -778,9 +802,9 @@ var require_base = __commonJS({
778
802
  }
779
803
  });
780
804
 
781
- // ../../node_modules/handlebars/dist/cjs/handlebars/safe-string.js
805
+ // node_modules/handlebars/dist/cjs/handlebars/safe-string.js
782
806
  var require_safe_string = __commonJS({
783
- "../../node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports, module) {
807
+ "node_modules/handlebars/dist/cjs/handlebars/safe-string.js"(exports, module) {
784
808
  "use strict";
785
809
  exports.__esModule = true;
786
810
  function SafeString(string) {
@@ -794,9 +818,9 @@ var require_safe_string = __commonJS({
794
818
  }
795
819
  });
796
820
 
797
- // ../../node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js
821
+ // node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js
798
822
  var require_wrapHelper = __commonJS({
799
- "../../node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(exports) {
823
+ "node_modules/handlebars/dist/cjs/handlebars/internal/wrapHelper.js"(exports) {
800
824
  "use strict";
801
825
  exports.__esModule = true;
802
826
  exports.wrapHelper = wrapHelper;
@@ -814,9 +838,9 @@ var require_wrapHelper = __commonJS({
814
838
  }
815
839
  });
816
840
 
817
- // ../../node_modules/handlebars/dist/cjs/handlebars/runtime.js
841
+ // node_modules/handlebars/dist/cjs/handlebars/runtime.js
818
842
  var require_runtime = __commonJS({
819
- "../../node_modules/handlebars/dist/cjs/handlebars/runtime.js"(exports) {
843
+ "node_modules/handlebars/dist/cjs/handlebars/runtime.js"(exports) {
820
844
  "use strict";
821
845
  exports.__esModule = true;
822
846
  exports.checkRevision = checkRevision;
@@ -883,7 +907,13 @@ var require_runtime = __commonJS({
883
907
  options.hooks = this.hooks;
884
908
  options.protoAccessControl = this.protoAccessControl;
885
909
  var result = env.VM.invokePartial.call(this, partial, context, options);
910
+ if (result == null && Utils.isFunction(partial)) {
911
+ throw new _exception2["default"]("The partial " + options.name + " returned no output: partials must return a string");
912
+ }
886
913
  if (result == null && env.compile) {
914
+ if (typeof partial !== "string") {
915
+ throw new _exception2["default"]("The partial " + options.name + " could not be compiled: partials must be strings or functions returning strings");
916
+ }
887
917
  options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);
888
918
  result = options.partials[options.name](context, options);
889
919
  }
@@ -917,7 +947,7 @@ var require_runtime = __commonJS({
917
947
  if (result == null) {
918
948
  return result;
919
949
  }
920
- if (Object.prototype.hasOwnProperty.call(parent, propertyName)) {
950
+ if (Object.prototype.hasOwnProperty.call(parent, propertyName) && !_internalProtoAccess.isPrototypeConstructor(parent, propertyName, result)) {
921
951
  return result;
922
952
  }
923
953
  if (_internalProtoAccess.resultIsAllowed(result, container.protoAccessControl, propertyName)) {
@@ -1052,7 +1082,7 @@ var require_runtime = __commonJS({
1052
1082
  } else {
1053
1083
  partial = lookupOwnProperty(options.partials, options.name);
1054
1084
  }
1055
- } else if (!partial.call && !options.name) {
1085
+ } else if (typeof partial !== "function" && !options.name) {
1056
1086
  options.name = partial;
1057
1087
  partial = lookupOwnProperty(options.partials, partial);
1058
1088
  }
@@ -1129,9 +1159,9 @@ var require_runtime = __commonJS({
1129
1159
  }
1130
1160
  });
1131
1161
 
1132
- // ../../node_modules/handlebars/dist/cjs/handlebars/no-conflict.js
1162
+ // node_modules/handlebars/dist/cjs/handlebars/no-conflict.js
1133
1163
  var require_no_conflict = __commonJS({
1134
- "../../node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(exports, module) {
1164
+ "node_modules/handlebars/dist/cjs/handlebars/no-conflict.js"(exports, module) {
1135
1165
  "use strict";
1136
1166
  exports.__esModule = true;
1137
1167
  exports["default"] = function(Handlebars2) {
@@ -1155,9 +1185,9 @@ var require_no_conflict = __commonJS({
1155
1185
  }
1156
1186
  });
1157
1187
 
1158
- // ../../node_modules/handlebars/dist/cjs/handlebars.runtime.js
1188
+ // node_modules/handlebars/dist/cjs/handlebars.runtime.js
1159
1189
  var require_handlebars_runtime = __commonJS({
1160
- "../../node_modules/handlebars/dist/cjs/handlebars.runtime.js"(exports, module) {
1190
+ "node_modules/handlebars/dist/cjs/handlebars.runtime.js"(exports, module) {
1161
1191
  "use strict";
1162
1192
  exports.__esModule = true;
1163
1193
  function _interopRequireDefault(obj) {
@@ -1211,9 +1241,9 @@ var require_handlebars_runtime = __commonJS({
1211
1241
  }
1212
1242
  });
1213
1243
 
1214
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js
1244
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js
1215
1245
  var require_ast = __commonJS({
1216
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(exports, module) {
1246
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/ast.js"(exports, module) {
1217
1247
  "use strict";
1218
1248
  exports.__esModule = true;
1219
1249
  var AST = {
@@ -1240,9 +1270,9 @@ var require_ast = __commonJS({
1240
1270
  }
1241
1271
  });
1242
1272
 
1243
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js
1273
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js
1244
1274
  var require_parser = __commonJS({
1245
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(exports, module) {
1275
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/parser.js"(exports, module) {
1246
1276
  "use strict";
1247
1277
  exports.__esModule = true;
1248
1278
  var handlebars = (function() {
@@ -1950,9 +1980,19 @@ var require_parser = __commonJS({
1950
1980
  }
1951
1981
  });
1952
1982
 
1953
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js
1983
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/node-types.js
1984
+ var require_node_types = __commonJS({
1985
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/node-types.js"(exports) {
1986
+ "use strict";
1987
+ exports.__esModule = true;
1988
+ var NODE_TYPES = ["Program", "BlockStatement", "DecoratorBlock", "PartialStatement", "PartialBlockStatement", "Decorator", "MustacheStatement", "ContentStatement", "CommentStatement", "SubExpression", "PathExpression", "StringLiteral", "NumberLiteral", "BooleanLiteral", "UndefinedLiteral", "NullLiteral", "Hash", "HashPair"];
1989
+ exports.NODE_TYPES = NODE_TYPES;
1990
+ }
1991
+ });
1992
+
1993
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js
1954
1994
  var require_visitor = __commonJS({
1955
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(exports, module) {
1995
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/visitor.js"(exports, module) {
1956
1996
  "use strict";
1957
1997
  exports.__esModule = true;
1958
1998
  function _interopRequireDefault(obj) {
@@ -1960,9 +2000,14 @@ var require_visitor = __commonJS({
1960
2000
  }
1961
2001
  var _exception = require_exception();
1962
2002
  var _exception2 = _interopRequireDefault(_exception);
2003
+ var _utils = require_utils();
2004
+ var _nodeTypes = require_node_types();
1963
2005
  function Visitor() {
1964
2006
  this.parents = [];
1965
2007
  }
2008
+ function isDispatchable(visitor, type) {
2009
+ return _utils.indexOf(_nodeTypes.NODE_TYPES, type) !== -1 || !(type in Visitor.prototype) && typeof visitor[type] === "function";
2010
+ }
1966
2011
  Visitor.prototype = {
1967
2012
  constructor: Visitor,
1968
2013
  mutating: false,
@@ -1970,7 +2015,7 @@ var require_visitor = __commonJS({
1970
2015
  acceptKey: function acceptKey(node, name) {
1971
2016
  var value = this.accept(node[name]);
1972
2017
  if (this.mutating) {
1973
- if (value && !Visitor.prototype[value.type]) {
2018
+ if (value && !isDispatchable(this, value.type)) {
1974
2019
  throw new _exception2["default"]('Unexpected node type "' + value.type + '" found when accepting ' + name + " on " + node.type);
1975
2020
  }
1976
2021
  node[name] = value;
@@ -2000,7 +2045,7 @@ var require_visitor = __commonJS({
2000
2045
  if (!object) {
2001
2046
  return;
2002
2047
  }
2003
- if (!this[object.type]) {
2048
+ if (!isDispatchable(this, object.type) || !this[object.type]) {
2004
2049
  throw new _exception2["default"]("Unknown type: " + object.type, object);
2005
2050
  }
2006
2051
  if (this.current) {
@@ -2071,9 +2116,9 @@ var require_visitor = __commonJS({
2071
2116
  }
2072
2117
  });
2073
2118
 
2074
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js
2119
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js
2075
2120
  var require_whitespace_control = __commonJS({
2076
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(exports, module) {
2121
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/whitespace-control.js"(exports, module) {
2077
2122
  "use strict";
2078
2123
  exports.__esModule = true;
2079
2124
  function _interopRequireDefault(obj) {
@@ -2107,7 +2152,7 @@ var require_whitespace_control = __commonJS({
2107
2152
  omitRight(body, i);
2108
2153
  if (omitLeft(body, i)) {
2109
2154
  if (current.type === "PartialStatement") {
2110
- current.indent = /([ \t]+$)/.exec(body[i - 1].original)[1];
2155
+ current.indent = /(?:^|[^ \t])([ \t]+)$/.exec(body[i - 1].original)[1];
2111
2156
  }
2112
2157
  }
2113
2158
  }
@@ -2183,7 +2228,7 @@ var require_whitespace_control = __commonJS({
2183
2228
  return isRoot;
2184
2229
  }
2185
2230
  if (prev.type === "ContentStatement") {
2186
- return (sibling || !isRoot ? /\r?\n\s*?$/ : /(^|\r?\n)\s*?$/).test(prev.original);
2231
+ return (sibling || !isRoot ? /(?:^|\S)[^\S\n]*\n\s*$/ : /^\s*$|(?:^|\S)[^\S\n]*\n\s*$/).test(prev.original);
2187
2232
  }
2188
2233
  }
2189
2234
  function isNextWhitespace(body, i, isRoot) {
@@ -2213,7 +2258,7 @@ var require_whitespace_control = __commonJS({
2213
2258
  return;
2214
2259
  }
2215
2260
  var original = current.value;
2216
- current.value = current.value.replace(multiple ? /\s+$/ : /[ \t]+$/, "");
2261
+ current.value = current.value.replace(multiple ? /(^|\S)\s+$/ : /(^|[^ \t])[ \t]+$/, "$1");
2217
2262
  current.leftStripped = current.value !== original;
2218
2263
  return current.leftStripped;
2219
2264
  }
@@ -2222,9 +2267,9 @@ var require_whitespace_control = __commonJS({
2222
2267
  }
2223
2268
  });
2224
2269
 
2225
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js
2270
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js
2226
2271
  var require_helpers2 = __commonJS({
2227
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(exports) {
2272
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/helpers.js"(exports) {
2228
2273
  "use strict";
2229
2274
  exports.__esModule = true;
2230
2275
  exports.SourceLocation = SourceLocation;
@@ -2410,9 +2455,9 @@ var require_helpers2 = __commonJS({
2410
2455
  }
2411
2456
  });
2412
2457
 
2413
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/base.js
2458
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/base.js
2414
2459
  var require_base2 = __commonJS({
2415
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(exports) {
2460
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/base.js"(exports) {
2416
2461
  "use strict";
2417
2462
  exports.__esModule = true;
2418
2463
  exports.parseWithoutProcessing = parseWithoutProcessing;
@@ -2440,15 +2485,12 @@ var require_base2 = __commonJS({
2440
2485
  var _whitespaceControl2 = _interopRequireDefault(_whitespaceControl);
2441
2486
  var _helpers = require_helpers2();
2442
2487
  var Helpers = _interopRequireWildcard(_helpers);
2443
- var _exception = require_exception();
2444
- var _exception2 = _interopRequireDefault(_exception);
2445
2488
  var _utils = require_utils();
2446
2489
  exports.parser = _parser2["default"];
2447
2490
  var yy = {};
2448
2491
  _utils.extend(yy, Helpers);
2449
2492
  function parseWithoutProcessing(input, options) {
2450
2493
  if (input.type === "Program") {
2451
- validateInputAst(input);
2452
2494
  return input;
2453
2495
  }
2454
2496
  _parser2["default"].yy = yy;
@@ -2463,57 +2505,12 @@ var require_base2 = __commonJS({
2463
2505
  var strip = new _whitespaceControl2["default"](options);
2464
2506
  return strip.accept(ast);
2465
2507
  }
2466
- function validateInputAst(ast) {
2467
- validateAstNode(ast);
2468
- }
2469
- function validateAstNode(node) {
2470
- if (node == null) {
2471
- return;
2472
- }
2473
- if (Array.isArray(node)) {
2474
- node.forEach(validateAstNode);
2475
- return;
2476
- }
2477
- if (typeof node !== "object") {
2478
- return;
2479
- }
2480
- if (node.type === "PathExpression") {
2481
- if (!isValidDepth(node.depth)) {
2482
- throw new _exception2["default"]("Invalid AST: PathExpression.depth must be an integer");
2483
- }
2484
- if (!Array.isArray(node.parts)) {
2485
- throw new _exception2["default"]("Invalid AST: PathExpression.parts must be an array");
2486
- }
2487
- for (var i = 0; i < node.parts.length; i++) {
2488
- if (typeof node.parts[i] !== "string") {
2489
- throw new _exception2["default"]("Invalid AST: PathExpression.parts must only contain strings");
2490
- }
2491
- }
2492
- } else if (node.type === "NumberLiteral") {
2493
- if (typeof node.value !== "number" || !isFinite(node.value)) {
2494
- throw new _exception2["default"]("Invalid AST: NumberLiteral.value must be a number");
2495
- }
2496
- } else if (node.type === "BooleanLiteral") {
2497
- if (typeof node.value !== "boolean") {
2498
- throw new _exception2["default"]("Invalid AST: BooleanLiteral.value must be a boolean");
2499
- }
2500
- }
2501
- Object.keys(node).forEach(function(propertyName) {
2502
- if (propertyName === "loc") {
2503
- return;
2504
- }
2505
- validateAstNode(node[propertyName]);
2506
- });
2507
- }
2508
- function isValidDepth(depth) {
2509
- return typeof depth === "number" && isFinite(depth) && Math.floor(depth) === depth && depth >= 0;
2510
- }
2511
2508
  }
2512
2509
  });
2513
2510
 
2514
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js
2511
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js
2515
2512
  var require_compiler = __commonJS({
2516
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(exports) {
2513
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/compiler.js"(exports) {
2517
2514
  "use strict";
2518
2515
  exports.__esModule = true;
2519
2516
  exports.Compiler = Compiler;
@@ -2527,6 +2524,7 @@ var require_compiler = __commonJS({
2527
2524
  var _utils = require_utils();
2528
2525
  var _ast = require_ast();
2529
2526
  var _ast2 = _interopRequireDefault(_ast);
2527
+ var _nodeTypes = require_node_types();
2530
2528
  var slice = [].slice;
2531
2529
  function Compiler() {
2532
2530
  }
@@ -2580,7 +2578,7 @@ var require_compiler = __commonJS({
2580
2578
  return guid;
2581
2579
  },
2582
2580
  accept: function accept(node) {
2583
- if (!this[node.type]) {
2581
+ if (_utils.indexOf(_nodeTypes.NODE_TYPES, node.type) === -1 || !this[node.type]) {
2584
2582
  throw new _exception2["default"]("Unknown type: " + node.type, node);
2585
2583
  }
2586
2584
  this.sourceNode.unshift(node);
@@ -2589,6 +2587,7 @@ var require_compiler = __commonJS({
2589
2587
  return ret;
2590
2588
  },
2591
2589
  Program: function Program(program) {
2590
+ validateBlockParams(program);
2592
2591
  this.options.blockParams.unshift(program.blockParams);
2593
2592
  var body = program.body, bodyLength = body.length;
2594
2593
  for (var i = 0; i < bodyLength; i++) {
@@ -2672,6 +2671,9 @@ var require_compiler = __commonJS({
2672
2671
  this.DecoratorBlock(decorator);
2673
2672
  },
2674
2673
  ContentStatement: function ContentStatement(content) {
2674
+ if (content.value != null && typeof content.value !== "string") {
2675
+ throw invalidAst(content, "value must be a string");
2676
+ }
2675
2677
  if (content.value) {
2676
2678
  this.opcode("appendContent", content.value);
2677
2679
  }
@@ -2691,7 +2693,7 @@ var require_compiler = __commonJS({
2691
2693
  },
2692
2694
  ambiguousSexpr: function ambiguousSexpr(sexpr, program, inverse) {
2693
2695
  var path = sexpr.path, name = path.parts[0], isBlock = program != null || inverse != null;
2694
- this.opcode("getContext", path.depth);
2696
+ this.opcode("getContext", validateDepth(path));
2695
2697
  this.opcode("pushProgram", program);
2696
2698
  this.opcode("pushProgram", inverse);
2697
2699
  path.strict = true;
@@ -2718,27 +2720,32 @@ var require_compiler = __commonJS({
2718
2720
  }
2719
2721
  },
2720
2722
  PathExpression: function PathExpression(path) {
2721
- this.addDepth(path.depth);
2722
- this.opcode("getContext", path.depth);
2723
- var name = path.parts[0], scoped = _ast2["default"].helpers.scopedId(path), blockParamId = !path.depth && !scoped && this.blockParamIndex(name);
2723
+ var depth = validateDepth(path);
2724
+ var parts = validateParts(path);
2725
+ this.addDepth(depth);
2726
+ this.opcode("getContext", depth);
2727
+ var name = parts[0], scoped = _ast2["default"].helpers.scopedId(path), blockParamId = !depth && !scoped && this.blockParamIndex(name);
2724
2728
  if (blockParamId) {
2725
- this.opcode("lookupBlockParam", blockParamId, path.parts);
2729
+ this.opcode("lookupBlockParam", blockParamId, parts);
2726
2730
  } else if (!name) {
2727
2731
  this.opcode("pushContext");
2728
2732
  } else if (path.data) {
2729
2733
  this.options.data = true;
2730
- this.opcode("lookupData", path.depth, path.parts, path.strict);
2734
+ this.opcode("lookupData", depth, parts, path.strict);
2731
2735
  } else {
2732
- this.opcode("lookupOnContext", path.parts, path.falsy, path.strict, scoped);
2736
+ this.opcode("lookupOnContext", parts, path.falsy, path.strict, scoped);
2733
2737
  }
2734
2738
  },
2735
2739
  StringLiteral: function StringLiteral(string) {
2740
+ validateLiteral(string);
2736
2741
  this.opcode("pushString", string.value);
2737
2742
  },
2738
2743
  NumberLiteral: function NumberLiteral(number) {
2744
+ validateLiteral(number);
2739
2745
  this.opcode("pushLiteral", number.value);
2740
2746
  },
2741
2747
  BooleanLiteral: function BooleanLiteral(bool) {
2748
+ validateLiteral(bool);
2742
2749
  this.opcode("pushLiteral", bool.value);
2743
2750
  },
2744
2751
  UndefinedLiteral: function UndefinedLiteral() {
@@ -2748,7 +2755,16 @@ var require_compiler = __commonJS({
2748
2755
  this.opcode("pushLiteral", "null");
2749
2756
  },
2750
2757
  Hash: function Hash(hash) {
2751
- var pairs = hash.pairs, i = 0, l = pairs.length;
2758
+ var pairs = hash.pairs, i = 0, l = void 0;
2759
+ if (!_utils.isArray(pairs)) {
2760
+ throw invalidAst(hash, "pairs must be an array");
2761
+ }
2762
+ l = pairs.length;
2763
+ for (var j = 0; j < l; j++) {
2764
+ if (!pairs[j] || typeof pairs[j].key !== "string") {
2765
+ throw invalidAst(hash, "pair keys must be strings");
2766
+ }
2767
+ }
2752
2768
  this.opcode("pushHash");
2753
2769
  for (; i < l; i++) {
2754
2770
  this.pushParam(pairs[i].value);
@@ -2773,6 +2789,7 @@ var require_compiler = __commonJS({
2773
2789
  this.useDepths = true;
2774
2790
  },
2775
2791
  classifySexpr: function classifySexpr(sexpr) {
2792
+ validateParts(sexpr.path);
2776
2793
  var isSimple = _ast2["default"].helpers.simpleId(sexpr.path);
2777
2794
  var isBlockParam = isSimple && !!this.blockParamIndex(sexpr.path.parts[0]);
2778
2795
  var isHelper = !isBlockParam && _ast2["default"].helpers.helperExpression(sexpr);
@@ -2799,15 +2816,20 @@ var require_compiler = __commonJS({
2799
2816
  }
2800
2817
  },
2801
2818
  pushParam: function pushParam(val) {
2819
+ validateLiteral(val);
2802
2820
  var value = val.value != null ? val.value : val.original || "";
2821
+ var depth = validateDepth(val);
2803
2822
  if (this.stringParams) {
2823
+ if (typeof value !== "number" && typeof value !== "boolean") {
2824
+ value = String(value);
2825
+ }
2804
2826
  if (value.replace) {
2805
2827
  value = value.replace(/^(\.?\.\/)*/g, "").replace(/\//g, ".");
2806
2828
  }
2807
- if (val.depth) {
2808
- this.addDepth(val.depth);
2829
+ if (depth) {
2830
+ this.addDepth(depth);
2809
2831
  }
2810
- this.opcode("getContext", val.depth || 0);
2832
+ this.opcode("getContext", depth);
2811
2833
  this.opcode("pushStringParam", value, val.type);
2812
2834
  if (val.type === "SubExpression") {
2813
2835
  this.accept(val);
@@ -2815,8 +2837,8 @@ var require_compiler = __commonJS({
2815
2837
  } else {
2816
2838
  if (this.trackIds) {
2817
2839
  var blockParamIndex = void 0;
2818
- if (val.parts && !_ast2["default"].helpers.scopedId(val) && !val.depth) {
2819
- blockParamIndex = this.blockParamIndex(val.parts[0]);
2840
+ if (val.parts && !_ast2["default"].helpers.scopedId(val) && !depth) {
2841
+ blockParamIndex = this.blockParamIndex(validateParts(val)[0]);
2820
2842
  }
2821
2843
  if (blockParamIndex) {
2822
2844
  var blockParamChild = val.parts.slice(1).join(".");
@@ -2904,6 +2926,48 @@ var require_compiler = __commonJS({
2904
2926
  };
2905
2927
  return ret;
2906
2928
  }
2929
+ function invalidAst(node, message) {
2930
+ return new _exception2["default"]("Invalid AST: " + node.type + " " + message, node);
2931
+ }
2932
+ function validateDepth(node) {
2933
+ var depth = node.depth;
2934
+ if (depth == null) {
2935
+ return 0;
2936
+ }
2937
+ if (typeof depth !== "number" || !isFinite(depth) || Math.floor(depth) !== depth || depth < 0) {
2938
+ throw invalidAst(node, "depth must be a non-negative integer");
2939
+ }
2940
+ return depth;
2941
+ }
2942
+ function validateLiteral(node) {
2943
+ var value = node.value;
2944
+ if (node.type === "StringLiteral" && typeof value !== "string") {
2945
+ throw invalidAst(node, "value must be a string");
2946
+ } else if (node.type === "NumberLiteral" && typeof value !== "number") {
2947
+ throw invalidAst(node, "value must be a number");
2948
+ } else if (node.type === "BooleanLiteral" && typeof value !== "boolean") {
2949
+ throw invalidAst(node, "value must be a boolean");
2950
+ }
2951
+ }
2952
+ function validateStringArray(node, value, name) {
2953
+ if (!_utils.isArray(value)) {
2954
+ throw invalidAst(node, name + " must be an array");
2955
+ }
2956
+ for (var i = 0; i < value.length; i++) {
2957
+ if (typeof value[i] !== "string") {
2958
+ throw invalidAst(node, name + " must only contain strings");
2959
+ }
2960
+ }
2961
+ return value;
2962
+ }
2963
+ function validateParts(path) {
2964
+ return validateStringArray(path, path.parts, "parts");
2965
+ }
2966
+ function validateBlockParams(program) {
2967
+ if (program.blockParams != null) {
2968
+ validateStringArray(program, program.blockParams, "blockParams");
2969
+ }
2970
+ }
2907
2971
  function argEquals(a, b) {
2908
2972
  if (a === b) {
2909
2973
  return true;
@@ -2933,9 +2997,9 @@ var require_compiler = __commonJS({
2933
2997
  }
2934
2998
  });
2935
2999
 
2936
- // ../../node_modules/handlebars/node_modules/source-map/lib/base64.js
3000
+ // node_modules/source-map/lib/base64.js
2937
3001
  var require_base64 = __commonJS({
2938
- "../../node_modules/handlebars/node_modules/source-map/lib/base64.js"(exports) {
3002
+ "node_modules/source-map/lib/base64.js"(exports) {
2939
3003
  "use strict";
2940
3004
  var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
2941
3005
  exports.encode = function(number) {
@@ -2975,9 +3039,9 @@ var require_base64 = __commonJS({
2975
3039
  }
2976
3040
  });
2977
3041
 
2978
- // ../../node_modules/handlebars/node_modules/source-map/lib/base64-vlq.js
3042
+ // node_modules/source-map/lib/base64-vlq.js
2979
3043
  var require_base64_vlq = __commonJS({
2980
- "../../node_modules/handlebars/node_modules/source-map/lib/base64-vlq.js"(exports) {
3044
+ "node_modules/source-map/lib/base64-vlq.js"(exports) {
2981
3045
  "use strict";
2982
3046
  var base64 = require_base64();
2983
3047
  var VLQ_BASE_SHIFT = 5;
@@ -3030,9 +3094,9 @@ var require_base64_vlq = __commonJS({
3030
3094
  }
3031
3095
  });
3032
3096
 
3033
- // ../../node_modules/handlebars/node_modules/source-map/lib/util.js
3097
+ // node_modules/source-map/lib/util.js
3034
3098
  var require_util = __commonJS({
3035
- "../../node_modules/handlebars/node_modules/source-map/lib/util.js"(exports) {
3099
+ "node_modules/source-map/lib/util.js"(exports) {
3036
3100
  "use strict";
3037
3101
  function getArg(aArgs, aName, aDefaultValue) {
3038
3102
  if (aName in aArgs) {
@@ -3332,9 +3396,9 @@ var require_util = __commonJS({
3332
3396
  }
3333
3397
  });
3334
3398
 
3335
- // ../../node_modules/handlebars/node_modules/source-map/lib/array-set.js
3399
+ // node_modules/source-map/lib/array-set.js
3336
3400
  var require_array_set = __commonJS({
3337
- "../../node_modules/handlebars/node_modules/source-map/lib/array-set.js"(exports) {
3401
+ "node_modules/source-map/lib/array-set.js"(exports) {
3338
3402
  "use strict";
3339
3403
  var util = require_util();
3340
3404
  var has = Object.prototype.hasOwnProperty;
@@ -3403,9 +3467,9 @@ var require_array_set = __commonJS({
3403
3467
  }
3404
3468
  });
3405
3469
 
3406
- // ../../node_modules/handlebars/node_modules/source-map/lib/mapping-list.js
3470
+ // node_modules/source-map/lib/mapping-list.js
3407
3471
  var require_mapping_list = __commonJS({
3408
- "../../node_modules/handlebars/node_modules/source-map/lib/mapping-list.js"(exports) {
3472
+ "node_modules/source-map/lib/mapping-list.js"(exports) {
3409
3473
  "use strict";
3410
3474
  var util = require_util();
3411
3475
  function generatedPositionAfter(mappingA, mappingB) {
@@ -3443,9 +3507,9 @@ var require_mapping_list = __commonJS({
3443
3507
  }
3444
3508
  });
3445
3509
 
3446
- // ../../node_modules/handlebars/node_modules/source-map/lib/source-map-generator.js
3510
+ // node_modules/source-map/lib/source-map-generator.js
3447
3511
  var require_source_map_generator = __commonJS({
3448
- "../../node_modules/handlebars/node_modules/source-map/lib/source-map-generator.js"(exports) {
3512
+ "node_modules/source-map/lib/source-map-generator.js"(exports) {
3449
3513
  "use strict";
3450
3514
  var base64VLQ = require_base64_vlq();
3451
3515
  var util = require_util();
@@ -3720,9 +3784,9 @@ var require_source_map_generator = __commonJS({
3720
3784
  }
3721
3785
  });
3722
3786
 
3723
- // ../../node_modules/handlebars/node_modules/source-map/lib/binary-search.js
3787
+ // node_modules/source-map/lib/binary-search.js
3724
3788
  var require_binary_search = __commonJS({
3725
- "../../node_modules/handlebars/node_modules/source-map/lib/binary-search.js"(exports) {
3789
+ "node_modules/source-map/lib/binary-search.js"(exports) {
3726
3790
  "use strict";
3727
3791
  exports.GREATEST_LOWER_BOUND = 1;
3728
3792
  exports.LEAST_UPPER_BOUND = 2;
@@ -3777,9 +3841,9 @@ var require_binary_search = __commonJS({
3777
3841
  }
3778
3842
  });
3779
3843
 
3780
- // ../../node_modules/handlebars/node_modules/source-map/lib/quick-sort.js
3844
+ // node_modules/source-map/lib/quick-sort.js
3781
3845
  var require_quick_sort = __commonJS({
3782
- "../../node_modules/handlebars/node_modules/source-map/lib/quick-sort.js"(exports) {
3846
+ "node_modules/source-map/lib/quick-sort.js"(exports) {
3783
3847
  "use strict";
3784
3848
  function swap(ary, x, y) {
3785
3849
  var temp = ary[x];
@@ -3813,9 +3877,9 @@ var require_quick_sort = __commonJS({
3813
3877
  }
3814
3878
  });
3815
3879
 
3816
- // ../../node_modules/handlebars/node_modules/source-map/lib/source-map-consumer.js
3880
+ // node_modules/source-map/lib/source-map-consumer.js
3817
3881
  var require_source_map_consumer = __commonJS({
3818
- "../../node_modules/handlebars/node_modules/source-map/lib/source-map-consumer.js"(exports) {
3882
+ "node_modules/source-map/lib/source-map-consumer.js"(exports) {
3819
3883
  "use strict";
3820
3884
  var util = require_util();
3821
3885
  var binarySearch = require_binary_search();
@@ -4415,9 +4479,9 @@ var require_source_map_consumer = __commonJS({
4415
4479
  }
4416
4480
  });
4417
4481
 
4418
- // ../../node_modules/handlebars/node_modules/source-map/lib/source-node.js
4482
+ // node_modules/source-map/lib/source-node.js
4419
4483
  var require_source_node = __commonJS({
4420
- "../../node_modules/handlebars/node_modules/source-map/lib/source-node.js"(exports) {
4484
+ "node_modules/source-map/lib/source-node.js"(exports) {
4421
4485
  "use strict";
4422
4486
  var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
4423
4487
  var util = require_util();
@@ -4681,9 +4745,9 @@ var require_source_node = __commonJS({
4681
4745
  }
4682
4746
  });
4683
4747
 
4684
- // ../../node_modules/handlebars/node_modules/source-map/source-map.js
4748
+ // node_modules/source-map/source-map.js
4685
4749
  var require_source_map = __commonJS({
4686
- "../../node_modules/handlebars/node_modules/source-map/source-map.js"(exports) {
4750
+ "node_modules/source-map/source-map.js"(exports) {
4687
4751
  "use strict";
4688
4752
  exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
4689
4753
  exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
@@ -4691,12 +4755,24 @@ var require_source_map = __commonJS({
4691
4755
  }
4692
4756
  });
4693
4757
 
4694
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
4758
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js
4695
4759
  var require_code_gen = __commonJS({
4696
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(exports, module) {
4760
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/code-gen.js"(exports) {
4697
4761
  "use strict";
4698
4762
  exports.__esModule = true;
4763
+ exports.safeJsonLiteral = safeJsonLiteral;
4699
4764
  var _utils = require_utils();
4765
+ var NEEDS_ESCAPING = /[\x00-\x1f\\"\u2028\u2029<\ud800-\udfff]/;
4766
+ var SCRIPT_DELIMITERS = /<(?=!--|\/?script)/gi;
4767
+ function escapeScriptDelimiters(code) {
4768
+ return code.replace(SCRIPT_DELIMITERS, "\\u003C");
4769
+ }
4770
+ function escapeSurrogate(surrogate) {
4771
+ return "\\u" + surrogate.charCodeAt(0).toString(16);
4772
+ }
4773
+ function safeJsonLiteral(value) {
4774
+ return escapeScriptDelimiters(JSON.stringify(value).replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029").replace(/[\ud800-\udfff]/g, escapeSurrogate));
4775
+ }
4700
4776
  var SourceNode = void 0;
4701
4777
  try {
4702
4778
  if (typeof define !== "function" || !define.amd) {
@@ -4789,7 +4865,11 @@ var require_code_gen = __commonJS({
4789
4865
  return this.wrap([fn, type ? "." + type + "(" : "(", params, ")"]);
4790
4866
  },
4791
4867
  quotedString: function quotedString(str) {
4792
- return '"' + (str + "").replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\u2028/g, "\\u2028").replace(/\u2029/g, "\\u2029") + '"';
4868
+ str = str + "";
4869
+ if (!NEEDS_ESCAPING.test(str)) {
4870
+ return '"' + str + '"';
4871
+ }
4872
+ return safeJsonLiteral(str);
4793
4873
  },
4794
4874
  objectLiteral: function objectLiteral(obj) {
4795
4875
  var _this = this;
@@ -4823,13 +4903,12 @@ var require_code_gen = __commonJS({
4823
4903
  }
4824
4904
  };
4825
4905
  exports["default"] = CodeGen;
4826
- module.exports = exports["default"];
4827
4906
  }
4828
4907
  });
4829
4908
 
4830
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
4909
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js
4831
4910
  var require_javascript_compiler = __commonJS({
4832
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(exports, module) {
4911
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/javascript-compiler.js"(exports, module) {
4833
4912
  "use strict";
4834
4913
  exports.__esModule = true;
4835
4914
  function _interopRequireDefault(obj) {
@@ -4853,7 +4932,7 @@ var require_javascript_compiler = __commonJS({
4853
4932
  return this.internalNameLookup(parent, name);
4854
4933
  },
4855
4934
  depthedLookup: function depthedLookup(name) {
4856
- return [this.aliasable("container.lookup"), "(depths, ", JSON.stringify(name), ")"];
4935
+ return [this.aliasable("container.lookup"), "(depths, ", this.quotedString(name), ")"];
4857
4936
  },
4858
4937
  compilerInfo: function compilerInfo() {
4859
4938
  var revision = _base.COMPILER_REVISION, versions = _base.REVISION_CHANGES[revision];
@@ -4879,7 +4958,7 @@ var require_javascript_compiler = __commonJS({
4879
4958
  // END PUBLIC API
4880
4959
  internalNameLookup: function internalNameLookup(parent, name) {
4881
4960
  this.lookupPropertyFunctionIsUsed = true;
4882
- return ["lookupProperty(", parent, ",", JSON.stringify(name), ")"];
4961
+ return ["lookupProperty(", parent, ",", this.quotedString(name), ")"];
4883
4962
  },
4884
4963
  lookupPropertyFunctionIsUsed: false,
4885
4964
  compile: function compile(environment, options, context, asObject) {
@@ -5418,7 +5497,7 @@ var require_javascript_compiler = __commonJS({
5418
5497
  delete options.name;
5419
5498
  }
5420
5499
  if (indent) {
5421
- options.indent = JSON.stringify(indent);
5500
+ options.indent = this.quotedString(indent);
5422
5501
  }
5423
5502
  options.helpers = "helpers";
5424
5503
  options.partials = "partials";
@@ -5464,7 +5543,7 @@ var require_javascript_compiler = __commonJS({
5464
5543
  },
5465
5544
  pushId: function pushId(type, name, child) {
5466
5545
  if (type === "BlockParam") {
5467
- this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + JSON.stringify("." + child) : ""));
5546
+ this.pushStackLiteral("blockParams[" + name[0] + "].path[" + name[1] + "]" + (child ? " + " + this.quotedString("." + child) : ""));
5468
5547
  } else if (type === "PathExpression") {
5469
5548
  this.pushString(name);
5470
5549
  } else if (type === "SubExpression") {
@@ -5702,7 +5781,7 @@ var require_javascript_compiler = __commonJS({
5702
5781
  },
5703
5782
  setupHelperArgs: function setupHelperArgs(helper, paramSize, params, useRegister) {
5704
5783
  var options = this.setupParams(helper, paramSize, params);
5705
- options.loc = JSON.stringify(this.source.currentLocation);
5784
+ options.loc = locationLiteral(this);
5706
5785
  options = this.objectLiteral(options);
5707
5786
  if (useRegister) {
5708
5787
  this.useRegister("options");
@@ -5726,6 +5805,10 @@ var require_javascript_compiler = __commonJS({
5726
5805
  JavaScriptCompiler.isValidJavaScriptVariableName = function(name) {
5727
5806
  return !JavaScriptCompiler.RESERVED_WORDS[name] && /^[a-zA-Z_$][0-9a-zA-Z_$]*$/.test(name);
5728
5807
  };
5808
+ function locationLiteral(compiler) {
5809
+ var loc = compiler.source.currentLocation;
5810
+ return loc ? _codeGen.safeJsonLiteral(loc) : "undefined";
5811
+ }
5729
5812
  function strictLookup(requireTerminal, compiler, parts, startPartIndex, type) {
5730
5813
  var stack = compiler.popStack(), len = parts.length;
5731
5814
  if (requireTerminal) {
@@ -5735,7 +5818,7 @@ var require_javascript_compiler = __commonJS({
5735
5818
  stack = compiler.nameLookup(stack, parts[i], type);
5736
5819
  }
5737
5820
  if (requireTerminal) {
5738
- return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[len]), ", ", JSON.stringify(compiler.source.currentLocation), " )"];
5821
+ return [compiler.aliasable("container.strict"), "(", stack, ", ", compiler.quotedString(parts[len]), ", ", locationLiteral(compiler), " )"];
5739
5822
  } else {
5740
5823
  return stack;
5741
5824
  }
@@ -5745,9 +5828,9 @@ var require_javascript_compiler = __commonJS({
5745
5828
  }
5746
5829
  });
5747
5830
 
5748
- // ../../node_modules/handlebars/dist/cjs/handlebars.js
5831
+ // node_modules/handlebars/dist/cjs/handlebars.js
5749
5832
  var require_handlebars = __commonJS({
5750
- "../../node_modules/handlebars/dist/cjs/handlebars.js"(exports, module) {
5833
+ "node_modules/handlebars/dist/cjs/handlebars.js"(exports, module) {
5751
5834
  "use strict";
5752
5835
  exports.__esModule = true;
5753
5836
  function _interopRequireDefault(obj) {
@@ -5792,9 +5875,9 @@ var require_handlebars = __commonJS({
5792
5875
  }
5793
5876
  });
5794
5877
 
5795
- // ../../node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js
5878
+ // node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js
5796
5879
  var require_printer = __commonJS({
5797
- "../../node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js"(exports) {
5880
+ "node_modules/handlebars/dist/cjs/handlebars/compiler/printer.js"(exports) {
5798
5881
  "use strict";
5799
5882
  exports.__esModule = true;
5800
5883
  exports.print = print;
@@ -5938,9 +6021,9 @@ var require_printer = __commonJS({
5938
6021
  }
5939
6022
  });
5940
6023
 
5941
- // ../../node_modules/handlebars/lib/index.js
6024
+ // node_modules/handlebars/lib/index.js
5942
6025
  var require_lib = __commonJS({
5943
- "../../node_modules/handlebars/lib/index.js"(exports, module) {
6026
+ "node_modules/handlebars/lib/index.js"(exports, module) {
5944
6027
  "use strict";
5945
6028
  var handlebars = require_handlebars()["default"];
5946
6029
  var printer = require_printer();
@@ -7036,7 +7119,11 @@ async function runTask(adapter, taskId, context, options) {
7036
7119
  } catch (err) {
7037
7120
  closeStatus = "error";
7038
7121
  closeCause = `SDK error: ${err.message}`;
7039
- return { outcome: { status: "error", message: closeCause }, follow_ups_used: 0, retries_used: 0 };
7122
+ return {
7123
+ outcome: { status: "error", message: closeCause, kind: adapterErrorKind(err) },
7124
+ follow_ups_used: 0,
7125
+ retries_used: 0
7126
+ };
7040
7127
  }
7041
7128
  let outcome = attachMemoryRef(validateOutput(fullOutput, task, schemas), adapter);
7042
7129
  outcome = await pluginRegistry.runAfterTask(taskId, outcome);
@@ -7069,7 +7156,11 @@ ${followUpPrompt}`
7069
7156
  fullOutput = await adapter.send(retryFullPrompt, { readonly: isReadonly, agents });
7070
7157
  }
7071
7158
  } catch (err) {
7072
- outcome = { status: "error", message: `SDK error on followUp ${followUpsUsed}: ${err.message}` };
7159
+ outcome = {
7160
+ status: "error",
7161
+ message: `SDK error on followUp ${followUpsUsed}: ${err.message}`,
7162
+ kind: adapterErrorKind(err)
7163
+ };
7073
7164
  continue;
7074
7165
  }
7075
7166
  } else {
@@ -7087,7 +7178,11 @@ Please re-execute the entire task.`
7087
7178
  try {
7088
7179
  fullOutput = await adapter.send(retryFullPrompt, { readonly: isReadonly, agents });
7089
7180
  } catch (err) {
7090
- outcome = { status: "error", message: `SDK error on retry ${retriesUsed}: ${err.message}` };
7181
+ outcome = {
7182
+ status: "error",
7183
+ message: `SDK error on retry ${retriesUsed}: ${err.message}`,
7184
+ kind: adapterErrorKind(err)
7185
+ };
7091
7186
  continue;
7092
7187
  }
7093
7188
  }
@@ -8436,7 +8531,7 @@ var ADAPTER_PACKAGES = {
8436
8531
  openai: "@openai/agents"
8437
8532
  };
8438
8533
  async function createAdapter(name, options) {
8439
- const { model, cwd, tools, permissionMode, guardrailHooks } = options ?? {};
8534
+ const { model, cwd, tools, permissionMode, guardrailHooks, signal, pathToClaudeCodeExecutable } = options ?? {};
8440
8535
  switch (name) {
8441
8536
  case "mock": {
8442
8537
  const { MockAdapter } = await import("./adapters/mock.js");
@@ -8450,7 +8545,9 @@ async function createAdapter(name, options) {
8450
8545
  ...model ? { model } : {},
8451
8546
  ...cwd ? { cwd } : {},
8452
8547
  ...tools ? { tools } : {},
8453
- ...permissionMode ? { permissionMode } : {}
8548
+ ...permissionMode ? { permissionMode } : {},
8549
+ ...signal ? { signal } : {},
8550
+ ...pathToClaudeCodeExecutable ? { pathToClaudeCodeExecutable } : {}
8454
8551
  });
8455
8552
  } catch (err) {
8456
8553
  throwMissingPackageError("claude", err);
@@ -8472,7 +8569,8 @@ async function createAdapter(name, options) {
8472
8569
  const { OpenAIAgentsSdkAdapter } = await import("./adapters/openai-agents-sdk.js");
8473
8570
  return new OpenAIAgentsSdkAdapter({
8474
8571
  guardrailHooks,
8475
- ...model ? { model } : {}
8572
+ ...model ? { model } : {},
8573
+ ...signal ? { signal } : {}
8476
8574
  });
8477
8575
  } catch (err) {
8478
8576
  throwMissingPackageError("openai", err);
@@ -9173,8 +9271,9 @@ async function evaluateGuardrail(opts) {
9173
9271
  let checks = [];
9174
9272
  const shellCommand = command ?? toolInput?.command;
9175
9273
  if (shellCommand !== void 0) {
9176
- response = hooks.beforeShellExecution({ command: shellCommand });
9177
- checks = hooks.runChecks({ command: shellCommand });
9274
+ const shell = { command: shellCommand, cwd: hookInput.cwd };
9275
+ response = hooks.beforeShellExecution(shell);
9276
+ checks = hooks.checkShellCommand(shell);
9178
9277
  } else if (toolName !== void 0 || toolInput !== void 0) {
9179
9278
  response = hooks.preToolUse({ tool_name: toolName, tool_input: toolInput });
9180
9279
  const checkFilePath = toolTargetPath(toolInput);
@@ -9343,6 +9442,17 @@ var ClaudeConfigSchema = z3.object({
9343
9442
  function parseClaudeConfig(raw) {
9344
9443
  return ClaudeConfigSchema.parse(raw ?? {});
9345
9444
  }
9445
+ function applyProjectEmit(config, project) {
9446
+ if (!project) return config;
9447
+ const emit = { ...config.emit };
9448
+ if (project.workflows !== void 0) emit.workflows = project.workflows;
9449
+ if (project.agents !== void 0) emit.agents = project.agents;
9450
+ if (project.harness !== void 0) emit.harness = project.harness;
9451
+ if (project.commands !== void 0) {
9452
+ emit.commands = project.commands ? config.emit.commands ?? {} : void 0;
9453
+ }
9454
+ return { ...config, emit };
9455
+ }
9346
9456
 
9347
9457
  // src/lib/claude-materialize/workflow-render.ts
9348
9458
  import { resolveSchemaRefs } from "agent-contracts";
@@ -10603,9 +10713,15 @@ function checkHookBin(file, existing) {
10603
10713
  const onDisk = recomputeMarkerFromDisk(existing);
10604
10714
  return stored !== expected || stored !== onDisk ? "changed" : null;
10605
10715
  }
10716
+ function effectiveClaudeConfig(root, raw) {
10717
+ const config = parseClaudeConfig(raw);
10718
+ const manifestPath = join7(root, PROJECT_CONFIG_FILENAME);
10719
+ if (!existsSync5(manifestPath)) return config;
10720
+ return applyProjectEmit(config, readProjectManifest(manifestPath).bindings?.claude?.emit);
10721
+ }
10606
10722
  async function syncClaude(opts) {
10607
- const config = parseClaudeConfig(opts.config);
10608
10723
  const root = resolve6(opts.projectRoot);
10724
+ const config = effectiveClaudeConfig(root, opts.config);
10609
10725
  const result = { files: [] };
10610
10726
  const sources = await resolveDslSources(root, opts.dsl, config);
10611
10727
  const rendered = await renderFiles(root, opts.dsl, config, entryAgentPromptFor(sources, config));
@@ -10669,8 +10785,8 @@ async function syncClaude(opts) {
10669
10785
  return result;
10670
10786
  }
10671
10787
  async function checkClaude(opts) {
10672
- const config = parseClaudeConfig(opts.config);
10673
10788
  const root = resolve6(opts.projectRoot);
10789
+ const config = effectiveClaudeConfig(root, opts.config);
10674
10790
  const drift = [];
10675
10791
  const sources = await resolveDslSources(root, opts.dsl, config);
10676
10792
  const rendered = await renderFiles(root, opts.dsl, config, entryAgentPromptFor(sources, config));
@@ -10824,6 +10940,7 @@ var require2 = createRequire(import.meta.url);
10824
10940
  var pkg = require2("../package.json");
10825
10941
  var version = pkg.version;
10826
10942
  export {
10943
+ AdapterError,
10827
10944
  AgentLogWriter,
10828
10945
  BoundResolver,
10829
10946
  DEFAULT_COMPONENT_ID,
@@ -10838,6 +10955,7 @@ export {
10838
10955
  UnresolvedScopeDeclarationError,
10839
10956
  WORKFLOW_INPUT_STEP_ID,
10840
10957
  WorkflowBuilder,
10958
+ adapterErrorKind,
10841
10959
  buildCandidateAgents,
10842
10960
  buildGateEvaluationPrompt,
10843
10961
  buildNavigationContext,