@theaileverage/marionette 0.3.0 → 0.4.0

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/mcp.js CHANGED
@@ -3838,7 +3838,7 @@ var require_fast_uri = __commonJS({
3838
3838
  normalizeString(uri, options3);
3839
3839
  } else if (typeof uri === "object") {
3840
3840
  uri = /** @type {T} */
3841
- parse3(serialize(uri, options3), options3);
3841
+ parse5(serialize(uri, options3), options3);
3842
3842
  }
3843
3843
  return uri;
3844
3844
  }
@@ -3878,8 +3878,8 @@ var require_fast_uri = __commonJS({
3878
3878
  function resolveComponent(base2, relative, options3, skipNormalization) {
3879
3879
  const target = {};
3880
3880
  if (!skipNormalization) {
3881
- base2 = parse3(serialize(base2, options3), options3);
3882
- relative = parse3(serialize(relative, options3), options3);
3881
+ base2 = parse5(serialize(base2, options3), options3);
3882
+ relative = parse5(serialize(relative, options3), options3);
3883
3883
  }
3884
3884
  options3 = options3 || {};
3885
3885
  if (!options3.tolerant && relative.scheme) {
@@ -4177,7 +4177,7 @@ var require_fast_uri = __commonJS({
4177
4177
  }
4178
4178
  return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
4179
4179
  }
4180
- function parse3(uri, opts) {
4180
+ function parse5(uri, opts) {
4181
4181
  return parseWithStatus(uri, opts).parsed;
4182
4182
  }
4183
4183
  function normalizeString(uri, opts) {
@@ -4214,7 +4214,7 @@ var require_fast_uri = __commonJS({
4214
4214
  resolveComponent,
4215
4215
  equal,
4216
4216
  serialize,
4217
- parse: parse3
4217
+ parse: parse5
4218
4218
  };
4219
4219
  module.exports = fastUri;
4220
4220
  module.exports.default = fastUri;
@@ -5798,20 +5798,20 @@ var require_dependencies = __commonJS({
5798
5798
  const deps = propertyDeps[prop];
5799
5799
  if (deps.length === 0)
5800
5800
  continue;
5801
- const hasProperty2 = (0, code_1.propertyInData)(gen3, data, prop, it.opts.ownProperties);
5801
+ const hasProperty3 = (0, code_1.propertyInData)(gen3, data, prop, it.opts.ownProperties);
5802
5802
  cxt.setParams({
5803
5803
  property: prop,
5804
5804
  depsCount: deps.length,
5805
5805
  deps: deps.join(", ")
5806
5806
  });
5807
5807
  if (it.allErrors) {
5808
- gen3.if(hasProperty2, () => {
5808
+ gen3.if(hasProperty3, () => {
5809
5809
  for (const depProp of deps) {
5810
5810
  (0, code_1.checkReportMissingProp)(cxt, depProp);
5811
5811
  }
5812
5812
  });
5813
5813
  } else {
5814
- gen3.if((0, codegen_1._)`${hasProperty2} && (${(0, code_1.checkMissingProp)(cxt, deps, missing2)})`);
5814
+ gen3.if((0, codegen_1._)`${hasProperty3} && (${(0, code_1.checkMissingProp)(cxt, deps, missing2)})`);
5815
5815
  (0, code_1.reportMissingProp)(cxt, missing2);
5816
5816
  gen3.else();
5817
5817
  }
@@ -30358,10 +30358,10 @@ var Objects = class _Objects extends Base2 {
30358
30358
  if (indexCount && !concurrency) {
30359
30359
  for (let i2 = 0; i2 < indexCount; i2++) {
30360
30360
  const index2 = indexes[i2];
30361
- const parse3 = index2.is.parameter === string4 ? parseStringIndex : parseIndex;
30361
+ const parse5 = index2.is.parameter === string4 ? parseStringIndex : parseIndex;
30362
30362
  const keys3 = index2.is.parameter === string4 ? Object.keys(record3) : getIndexSignatureKeys(record3, index2.is.parameter, options3);
30363
30363
  for (let j = 0; j < keys3.length; j++) {
30364
- const eff = parse3(state, keys3[j], index2);
30364
+ const eff = parse5(state, keys3[j], index2);
30365
30365
  if (!effectIsExit(eff)) yield* eff;
30366
30366
  else if (eff._tag === "Failure") return yield* eff;
30367
30367
  }
@@ -31528,8 +31528,8 @@ function isTree(u, isLeaf) {
31528
31528
  return false;
31529
31529
  }
31530
31530
  if (cached4 === void 0) {
31531
- const isArray2 = Array.isArray(value3);
31532
- if (!isArray2) {
31531
+ const isArray3 = Array.isArray(value3);
31532
+ if (!isArray3) {
31533
31533
  const prototype = Object.getPrototypeOf(value3);
31534
31534
  if (prototype !== null && prototype !== Object.prototype && Object.getPrototypeOf(prototype) !== null) {
31535
31535
  return false;
@@ -31538,7 +31538,7 @@ function isTree(u, isLeaf) {
31538
31538
  cache.set(value3, false);
31539
31539
  stack.push({
31540
31540
  value: value3,
31541
- keys: isArray2 ? value3.length : Object.keys(value3),
31541
+ keys: isArray3 ? value3.length : Object.keys(value3),
31542
31542
  index: 0
31543
31543
  });
31544
31544
  }
@@ -40182,7 +40182,7 @@ function stringTreeToXml(value3, options3) {
40182
40182
  const lines = [];
40183
40183
  recur3(rootName, value3, 0);
40184
40184
  return lines.join(pretty2 ? "\n" : "");
40185
- function push(depth, text2) {
40185
+ function push2(depth, text2) {
40186
40186
  lines.push(pretty2 ? indent.repeat(depth) + text2 : text2);
40187
40187
  }
40188
40188
  function recur3(tagName, node, depth, originalNameForMeta) {
@@ -40191,11 +40191,11 @@ function stringTreeToXml(value3, options3) {
40191
40191
  safe
40192
40192
  } = xml.tagInfo(tagName, originalNameForMeta);
40193
40193
  if (node === void 0) {
40194
- push(depth, `<${safe}${attrs}/>`);
40194
+ push2(depth, `<${safe}${attrs}/>`);
40195
40195
  } else if (typeof node === "string") {
40196
- push(depth, `<${safe}${attrs}>${xml.escapeText(node)}</${safe}>`);
40196
+ push2(depth, `<${safe}${attrs}>${xml.escapeText(node)}</${safe}>`);
40197
40197
  } else if (typeof node !== "object" || node === null) {
40198
- push(depth, `<${safe}${attrs}>${xml.escapeText(format(node))}</${safe}>`);
40198
+ push2(depth, `<${safe}${attrs}>${xml.escapeText(format(node))}</${safe}>`);
40199
40199
  } else {
40200
40200
  if (seen.has(node)) throw new globalThis.Error("Cycle detected while serializing to XML.", {
40201
40201
  cause: node
@@ -40204,26 +40204,26 @@ function stringTreeToXml(value3, options3) {
40204
40204
  try {
40205
40205
  if (globalThis.globalThis.Array.isArray(node)) {
40206
40206
  if (node.length === 0) {
40207
- push(depth, `<${safe}${attrs}/>`);
40207
+ push2(depth, `<${safe}${attrs}/>`);
40208
40208
  return;
40209
40209
  }
40210
- push(depth, `<${safe}${attrs}>`);
40210
+ push2(depth, `<${safe}${attrs}>`);
40211
40211
  for (const item of node) recur3(arrayItemName, item, depth + 1);
40212
- push(depth, `</${safe}>`);
40212
+ push2(depth, `</${safe}>`);
40213
40213
  return;
40214
40214
  }
40215
40215
  const obj = node;
40216
40216
  const keys3 = Object.keys(obj);
40217
40217
  if (sortKeys) keys3.sort();
40218
40218
  if (keys3.length === 0) {
40219
- push(depth, `<${safe}${attrs}/>`);
40219
+ push2(depth, `<${safe}${attrs}/>`);
40220
40220
  return;
40221
40221
  }
40222
- push(depth, `<${safe}${attrs}>`);
40222
+ push2(depth, `<${safe}${attrs}>`);
40223
40223
  for (const k of keys3) {
40224
40224
  recur3(xml.parseTagName(k).safe, obj[k], depth + 1, k);
40225
40225
  }
40226
- push(depth, `</${safe}>`);
40226
+ push2(depth, `</${safe}>`);
40227
40227
  } finally {
40228
40228
  seen.delete(node);
40229
40229
  }
@@ -43006,7 +43006,8 @@ var healthEffect = Effect_exports.fn("Http.health")(
43006
43006
  ok: Schema_exports.optional(Schema_exports.Boolean),
43007
43007
  id: Schema_exports.optional(Schema_exports.String),
43008
43008
  setupVersion: Schema_exports.optional(Schema_exports.Finite),
43009
- version: Schema_exports.optional(Schema_exports.String)
43009
+ version: Schema_exports.optional(Schema_exports.String),
43010
+ runtime: Schema_exports.optional(Schema_exports.String)
43010
43011
  })
43011
43012
  )(yield* response.json);
43012
43013
  },
@@ -43202,16 +43203,561 @@ var cleanupPolicySchema = external_exports.object({
43202
43203
  deleteMergedBranches: external_exports.boolean().default(false)
43203
43204
  }).strict();
43204
43205
 
43206
+ // node_modules/mustache/mustache.mjs
43207
+ var objectToString = Object.prototype.toString;
43208
+ var isArray2 = Array.isArray || function isArrayPolyfill(object3) {
43209
+ return objectToString.call(object3) === "[object Array]";
43210
+ };
43211
+ function isFunction2(object3) {
43212
+ return typeof object3 === "function";
43213
+ }
43214
+ function typeStr(obj) {
43215
+ return isArray2(obj) ? "array" : typeof obj;
43216
+ }
43217
+ function escapeRegExp(string6) {
43218
+ return string6.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&");
43219
+ }
43220
+ function hasProperty2(obj, propName) {
43221
+ return obj != null && typeof obj === "object" && propName in obj;
43222
+ }
43223
+ function primitiveHasOwnProperty(primitive, propName) {
43224
+ return primitive != null && typeof primitive !== "object" && primitive.hasOwnProperty && primitive.hasOwnProperty(propName);
43225
+ }
43226
+ var regExpTest = RegExp.prototype.test;
43227
+ function testRegExp(re, string6) {
43228
+ return regExpTest.call(re, string6);
43229
+ }
43230
+ var nonSpaceRe = /\S/;
43231
+ function isWhitespace(string6) {
43232
+ return !testRegExp(nonSpaceRe, string6);
43233
+ }
43234
+ var entityMap = {
43235
+ "&": "&amp;",
43236
+ "<": "&lt;",
43237
+ ">": "&gt;",
43238
+ '"': "&quot;",
43239
+ "'": "&#39;",
43240
+ "/": "&#x2F;",
43241
+ "`": "&#x60;",
43242
+ "=": "&#x3D;"
43243
+ };
43244
+ function escapeHtml(string6) {
43245
+ return String(string6).replace(/[&<>"'`=\/]/g, function fromEntityMap(s) {
43246
+ return entityMap[s];
43247
+ });
43248
+ }
43249
+ var whiteRe = /\s*/;
43250
+ var spaceRe = /\s+/;
43251
+ var equalsRe = /\s*=/;
43252
+ var curlyRe = /\s*\}/;
43253
+ var tagRe = /#|\^|\/|>|\{|&|=|!/;
43254
+ function parseTemplate(template, tags) {
43255
+ if (!template)
43256
+ return [];
43257
+ var lineHasNonSpace = false;
43258
+ var sections = [];
43259
+ var tokens = [];
43260
+ var spaces = [];
43261
+ var hasTag = false;
43262
+ var nonSpace = false;
43263
+ var indentation = "";
43264
+ var tagIndex = 0;
43265
+ function stripSpace() {
43266
+ if (hasTag && !nonSpace) {
43267
+ while (spaces.length)
43268
+ delete tokens[spaces.pop()];
43269
+ } else {
43270
+ spaces = [];
43271
+ }
43272
+ hasTag = false;
43273
+ nonSpace = false;
43274
+ }
43275
+ var openingTagRe, closingTagRe, closingCurlyRe;
43276
+ function compileTags(tagsToCompile) {
43277
+ if (typeof tagsToCompile === "string")
43278
+ tagsToCompile = tagsToCompile.split(spaceRe, 2);
43279
+ if (!isArray2(tagsToCompile) || tagsToCompile.length !== 2)
43280
+ throw new Error("Invalid tags: " + tagsToCompile);
43281
+ openingTagRe = new RegExp(escapeRegExp(tagsToCompile[0]) + "\\s*");
43282
+ closingTagRe = new RegExp("\\s*" + escapeRegExp(tagsToCompile[1]));
43283
+ closingCurlyRe = new RegExp("\\s*" + escapeRegExp("}" + tagsToCompile[1]));
43284
+ }
43285
+ compileTags(tags || mustache.tags);
43286
+ var scanner = new Scanner(template);
43287
+ var start, type, value3, chr, token, openSection;
43288
+ while (!scanner.eos()) {
43289
+ start = scanner.pos;
43290
+ value3 = scanner.scanUntil(openingTagRe);
43291
+ if (value3) {
43292
+ for (var i2 = 0, valueLength = value3.length; i2 < valueLength; ++i2) {
43293
+ chr = value3.charAt(i2);
43294
+ if (isWhitespace(chr)) {
43295
+ spaces.push(tokens.length);
43296
+ indentation += chr;
43297
+ } else {
43298
+ nonSpace = true;
43299
+ lineHasNonSpace = true;
43300
+ indentation += " ";
43301
+ }
43302
+ tokens.push(["text", chr, start, start + 1]);
43303
+ start += 1;
43304
+ if (chr === "\n") {
43305
+ stripSpace();
43306
+ indentation = "";
43307
+ tagIndex = 0;
43308
+ lineHasNonSpace = false;
43309
+ }
43310
+ }
43311
+ }
43312
+ if (!scanner.scan(openingTagRe))
43313
+ break;
43314
+ hasTag = true;
43315
+ type = scanner.scan(tagRe) || "name";
43316
+ scanner.scan(whiteRe);
43317
+ if (type === "=") {
43318
+ value3 = scanner.scanUntil(equalsRe);
43319
+ scanner.scan(equalsRe);
43320
+ scanner.scanUntil(closingTagRe);
43321
+ } else if (type === "{") {
43322
+ value3 = scanner.scanUntil(closingCurlyRe);
43323
+ scanner.scan(curlyRe);
43324
+ scanner.scanUntil(closingTagRe);
43325
+ type = "&";
43326
+ } else {
43327
+ value3 = scanner.scanUntil(closingTagRe);
43328
+ }
43329
+ if (!scanner.scan(closingTagRe))
43330
+ throw new Error("Unclosed tag at " + scanner.pos);
43331
+ if (type == ">") {
43332
+ token = [type, value3, start, scanner.pos, indentation, tagIndex, lineHasNonSpace];
43333
+ } else {
43334
+ token = [type, value3, start, scanner.pos];
43335
+ }
43336
+ tagIndex++;
43337
+ tokens.push(token);
43338
+ if (type === "#" || type === "^") {
43339
+ sections.push(token);
43340
+ } else if (type === "/") {
43341
+ openSection = sections.pop();
43342
+ if (!openSection)
43343
+ throw new Error('Unopened section "' + value3 + '" at ' + start);
43344
+ if (openSection[1] !== value3)
43345
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + start);
43346
+ } else if (type === "name" || type === "{" || type === "&") {
43347
+ nonSpace = true;
43348
+ } else if (type === "=") {
43349
+ compileTags(value3);
43350
+ }
43351
+ }
43352
+ stripSpace();
43353
+ openSection = sections.pop();
43354
+ if (openSection)
43355
+ throw new Error('Unclosed section "' + openSection[1] + '" at ' + scanner.pos);
43356
+ return nestTokens(squashTokens(tokens));
43357
+ }
43358
+ function squashTokens(tokens) {
43359
+ var squashedTokens = [];
43360
+ var token, lastToken;
43361
+ for (var i2 = 0, numTokens = tokens.length; i2 < numTokens; ++i2) {
43362
+ token = tokens[i2];
43363
+ if (token) {
43364
+ if (token[0] === "text" && lastToken && lastToken[0] === "text") {
43365
+ lastToken[1] += token[1];
43366
+ lastToken[3] = token[3];
43367
+ } else {
43368
+ squashedTokens.push(token);
43369
+ lastToken = token;
43370
+ }
43371
+ }
43372
+ }
43373
+ return squashedTokens;
43374
+ }
43375
+ function nestTokens(tokens) {
43376
+ var nestedTokens = [];
43377
+ var collector = nestedTokens;
43378
+ var sections = [];
43379
+ var token, section;
43380
+ for (var i2 = 0, numTokens = tokens.length; i2 < numTokens; ++i2) {
43381
+ token = tokens[i2];
43382
+ switch (token[0]) {
43383
+ case "#":
43384
+ case "^":
43385
+ collector.push(token);
43386
+ sections.push(token);
43387
+ collector = token[4] = [];
43388
+ break;
43389
+ case "/":
43390
+ section = sections.pop();
43391
+ section[5] = token[2];
43392
+ collector = sections.length > 0 ? sections[sections.length - 1][4] : nestedTokens;
43393
+ break;
43394
+ default:
43395
+ collector.push(token);
43396
+ }
43397
+ }
43398
+ return nestedTokens;
43399
+ }
43400
+ function Scanner(string6) {
43401
+ this.string = string6;
43402
+ this.tail = string6;
43403
+ this.pos = 0;
43404
+ }
43405
+ Scanner.prototype.eos = function eos() {
43406
+ return this.tail === "";
43407
+ };
43408
+ Scanner.prototype.scan = function scan(re) {
43409
+ var match7 = this.tail.match(re);
43410
+ if (!match7 || match7.index !== 0)
43411
+ return "";
43412
+ var string6 = match7[0];
43413
+ this.tail = this.tail.substring(string6.length);
43414
+ this.pos += string6.length;
43415
+ return string6;
43416
+ };
43417
+ Scanner.prototype.scanUntil = function scanUntil(re) {
43418
+ var index2 = this.tail.search(re), match7;
43419
+ switch (index2) {
43420
+ case -1:
43421
+ match7 = this.tail;
43422
+ this.tail = "";
43423
+ break;
43424
+ case 0:
43425
+ match7 = "";
43426
+ break;
43427
+ default:
43428
+ match7 = this.tail.substring(0, index2);
43429
+ this.tail = this.tail.substring(index2);
43430
+ }
43431
+ this.pos += match7.length;
43432
+ return match7;
43433
+ };
43434
+ function Context2(view, parentContext) {
43435
+ this.view = view;
43436
+ this.cache = { ".": this.view };
43437
+ this.parent = parentContext;
43438
+ }
43439
+ Context2.prototype.push = function push(view) {
43440
+ return new Context2(view, this);
43441
+ };
43442
+ Context2.prototype.lookup = function lookup2(name) {
43443
+ var cache = this.cache;
43444
+ var value3;
43445
+ if (cache.hasOwnProperty(name)) {
43446
+ value3 = cache[name];
43447
+ } else {
43448
+ var context3 = this, intermediateValue, names, index2, lookupHit = false;
43449
+ while (context3) {
43450
+ if (name.indexOf(".") > 0) {
43451
+ intermediateValue = context3.view;
43452
+ names = name.split(".");
43453
+ index2 = 0;
43454
+ while (intermediateValue != null && index2 < names.length) {
43455
+ if (index2 === names.length - 1)
43456
+ lookupHit = hasProperty2(intermediateValue, names[index2]) || primitiveHasOwnProperty(intermediateValue, names[index2]);
43457
+ intermediateValue = intermediateValue[names[index2++]];
43458
+ }
43459
+ } else {
43460
+ intermediateValue = context3.view[name];
43461
+ lookupHit = hasProperty2(context3.view, name);
43462
+ }
43463
+ if (lookupHit) {
43464
+ value3 = intermediateValue;
43465
+ break;
43466
+ }
43467
+ context3 = context3.parent;
43468
+ }
43469
+ cache[name] = value3;
43470
+ }
43471
+ if (isFunction2(value3))
43472
+ value3 = value3.call(this.view);
43473
+ return value3;
43474
+ };
43475
+ function Writer() {
43476
+ this.templateCache = {
43477
+ _cache: {},
43478
+ set: function set5(key, value3) {
43479
+ this._cache[key] = value3;
43480
+ },
43481
+ get: function get7(key) {
43482
+ return this._cache[key];
43483
+ },
43484
+ clear: function clear() {
43485
+ this._cache = {};
43486
+ }
43487
+ };
43488
+ }
43489
+ Writer.prototype.clearCache = function clearCache() {
43490
+ if (typeof this.templateCache !== "undefined") {
43491
+ this.templateCache.clear();
43492
+ }
43493
+ };
43494
+ Writer.prototype.parse = function parse3(template, tags) {
43495
+ var cache = this.templateCache;
43496
+ var cacheKey = template + ":" + (tags || mustache.tags).join(":");
43497
+ var isCacheEnabled = typeof cache !== "undefined";
43498
+ var tokens = isCacheEnabled ? cache.get(cacheKey) : void 0;
43499
+ if (tokens == void 0) {
43500
+ tokens = parseTemplate(template, tags);
43501
+ isCacheEnabled && cache.set(cacheKey, tokens);
43502
+ }
43503
+ return tokens;
43504
+ };
43505
+ Writer.prototype.render = function render(template, view, partials, config2) {
43506
+ var tags = this.getConfigTags(config2);
43507
+ var tokens = this.parse(template, tags);
43508
+ var context3 = view instanceof Context2 ? view : new Context2(view, void 0);
43509
+ return this.renderTokens(tokens, context3, partials, template, config2);
43510
+ };
43511
+ Writer.prototype.renderTokens = function renderTokens(tokens, context3, partials, originalTemplate, config2) {
43512
+ var buffer2 = "";
43513
+ var token, symbol4, value3;
43514
+ for (var i2 = 0, numTokens = tokens.length; i2 < numTokens; ++i2) {
43515
+ value3 = void 0;
43516
+ token = tokens[i2];
43517
+ symbol4 = token[0];
43518
+ if (symbol4 === "#") value3 = this.renderSection(token, context3, partials, originalTemplate, config2);
43519
+ else if (symbol4 === "^") value3 = this.renderInverted(token, context3, partials, originalTemplate, config2);
43520
+ else if (symbol4 === ">") value3 = this.renderPartial(token, context3, partials, config2);
43521
+ else if (symbol4 === "&") value3 = this.unescapedValue(token, context3);
43522
+ else if (symbol4 === "name") value3 = this.escapedValue(token, context3, config2);
43523
+ else if (symbol4 === "text") value3 = this.rawValue(token);
43524
+ if (value3 !== void 0)
43525
+ buffer2 += value3;
43526
+ }
43527
+ return buffer2;
43528
+ };
43529
+ Writer.prototype.renderSection = function renderSection(token, context3, partials, originalTemplate, config2) {
43530
+ var self = this;
43531
+ var buffer2 = "";
43532
+ var value3 = context3.lookup(token[1]);
43533
+ function subRender(template) {
43534
+ return self.render(template, context3, partials, config2);
43535
+ }
43536
+ if (!value3) return;
43537
+ if (isArray2(value3)) {
43538
+ for (var j = 0, valueLength = value3.length; j < valueLength; ++j) {
43539
+ buffer2 += this.renderTokens(token[4], context3.push(value3[j]), partials, originalTemplate, config2);
43540
+ }
43541
+ } else if (typeof value3 === "object" || typeof value3 === "string" || typeof value3 === "number") {
43542
+ buffer2 += this.renderTokens(token[4], context3.push(value3), partials, originalTemplate, config2);
43543
+ } else if (isFunction2(value3)) {
43544
+ if (typeof originalTemplate !== "string")
43545
+ throw new Error("Cannot use higher-order sections without the original template");
43546
+ value3 = value3.call(context3.view, originalTemplate.slice(token[3], token[5]), subRender);
43547
+ if (value3 != null)
43548
+ buffer2 += value3;
43549
+ } else {
43550
+ buffer2 += this.renderTokens(token[4], context3, partials, originalTemplate, config2);
43551
+ }
43552
+ return buffer2;
43553
+ };
43554
+ Writer.prototype.renderInverted = function renderInverted(token, context3, partials, originalTemplate, config2) {
43555
+ var value3 = context3.lookup(token[1]);
43556
+ if (!value3 || isArray2(value3) && value3.length === 0)
43557
+ return this.renderTokens(token[4], context3, partials, originalTemplate, config2);
43558
+ };
43559
+ Writer.prototype.indentPartial = function indentPartial(partial2, indentation, lineHasNonSpace) {
43560
+ var filteredIndentation = indentation.replace(/[^ \t]/g, "");
43561
+ var partialByNl = partial2.split("\n");
43562
+ for (var i2 = 0; i2 < partialByNl.length; i2++) {
43563
+ if (partialByNl[i2].length && (i2 > 0 || !lineHasNonSpace)) {
43564
+ partialByNl[i2] = filteredIndentation + partialByNl[i2];
43565
+ }
43566
+ }
43567
+ return partialByNl.join("\n");
43568
+ };
43569
+ Writer.prototype.renderPartial = function renderPartial(token, context3, partials, config2) {
43570
+ if (!partials) return;
43571
+ var tags = this.getConfigTags(config2);
43572
+ var value3 = isFunction2(partials) ? partials(token[1]) : partials[token[1]];
43573
+ if (value3 != null) {
43574
+ var lineHasNonSpace = token[6];
43575
+ var tagIndex = token[5];
43576
+ var indentation = token[4];
43577
+ var indentedValue = value3;
43578
+ if (tagIndex == 0 && indentation) {
43579
+ indentedValue = this.indentPartial(value3, indentation, lineHasNonSpace);
43580
+ }
43581
+ var tokens = this.parse(indentedValue, tags);
43582
+ return this.renderTokens(tokens, context3, partials, indentedValue, config2);
43583
+ }
43584
+ };
43585
+ Writer.prototype.unescapedValue = function unescapedValue(token, context3) {
43586
+ var value3 = context3.lookup(token[1]);
43587
+ if (value3 != null)
43588
+ return value3;
43589
+ };
43590
+ Writer.prototype.escapedValue = function escapedValue(token, context3, config2) {
43591
+ var escape3 = this.getConfigEscape(config2) || mustache.escape;
43592
+ var value3 = context3.lookup(token[1]);
43593
+ if (value3 != null)
43594
+ return typeof value3 === "number" && escape3 === mustache.escape ? String(value3) : escape3(value3);
43595
+ };
43596
+ Writer.prototype.rawValue = function rawValue(token) {
43597
+ return token[1];
43598
+ };
43599
+ Writer.prototype.getConfigTags = function getConfigTags(config2) {
43600
+ if (isArray2(config2)) {
43601
+ return config2;
43602
+ } else if (config2 && typeof config2 === "object") {
43603
+ return config2.tags;
43604
+ } else {
43605
+ return void 0;
43606
+ }
43607
+ };
43608
+ Writer.prototype.getConfigEscape = function getConfigEscape(config2) {
43609
+ if (config2 && typeof config2 === "object" && !isArray2(config2)) {
43610
+ return config2.escape;
43611
+ } else {
43612
+ return void 0;
43613
+ }
43614
+ };
43615
+ var mustache = {
43616
+ name: "mustache.js",
43617
+ version: "4.2.0",
43618
+ tags: ["{{", "}}"],
43619
+ clearCache: void 0,
43620
+ escape: void 0,
43621
+ parse: void 0,
43622
+ render: void 0,
43623
+ Scanner: void 0,
43624
+ Context: void 0,
43625
+ Writer: void 0,
43626
+ /**
43627
+ * Allows a user to override the default caching strategy, by providing an
43628
+ * object with set, get and clear methods. This can also be used to disable
43629
+ * the cache by setting it to the literal `undefined`.
43630
+ */
43631
+ set templateCache(cache) {
43632
+ defaultWriter.templateCache = cache;
43633
+ },
43634
+ /**
43635
+ * Gets the default or overridden caching object from the default writer.
43636
+ */
43637
+ get templateCache() {
43638
+ return defaultWriter.templateCache;
43639
+ }
43640
+ };
43641
+ var defaultWriter = new Writer();
43642
+ mustache.clearCache = function clearCache2() {
43643
+ return defaultWriter.clearCache();
43644
+ };
43645
+ mustache.parse = function parse4(template, tags) {
43646
+ return defaultWriter.parse(template, tags);
43647
+ };
43648
+ mustache.render = function render2(template, view, partials, config2) {
43649
+ if (typeof template !== "string") {
43650
+ throw new TypeError('Invalid template! Template should be a "string" but "' + typeStr(template) + '" was given as the first argument for mustache#render(template, view, partials)');
43651
+ }
43652
+ return defaultWriter.render(template, view, partials, config2);
43653
+ };
43654
+ mustache.escape = escapeHtml;
43655
+ mustache.Scanner = Scanner;
43656
+ mustache.Context = Context2;
43657
+ mustache.Writer = Writer;
43658
+ var mustache_default = mustache;
43659
+
43660
+ // src/templates/lead.mustache
43661
+ var lead_default = `{{#session}}
43662
+ You are {{{leadName}}}, the lead agent for {{{projectName}}}, using Marionette MCP.
43663
+ {{/session}}
43664
+ Own the user's outcome through verified completion.
43665
+
43666
+ STARTUP
43667
+ - Read project_briefing and inbox_read first. Preserve existing decisions
43668
+ and assignments. Never take over another lead without explicit handover
43669
+ or user direction.
43670
+ - Introduce yourself, summarize the briefing, and wait for the user's
43671
+ objective before dispatching work.
43672
+ - Read the private lease locally only when needed. Never expose its token.
43673
+
43674
+ OUTCOME AND PLAN
43675
+ - Before dispatch, persist the objective, scope, observable completion
43676
+ criteria, and required evidence.
43677
+ - Match evidence to the work:
43678
+ software \u2014 executable behavior checks;
43679
+ research \u2014 corroborated sources and traceable findings;
43680
+ analysis \u2014 reproducible calculations;
43681
+ decisions \u2014 alternatives, tradeoffs, and unresolved disagreements.
43682
+ - Resolve ambiguity from available evidence; ask only for necessary
43683
+ clarification or authorization.
43684
+ - Use current task and tree revisions. Record findings and reasons for
43685
+ plan changes. Add repair and re-verification when gaps emerge.
43686
+ - Never silently weaken criteria, omit required work, or count cancellation
43687
+ as success.
43688
+
43689
+ DELEGATION
43690
+ - Select exact available model profiles and a bounded collaboration
43691
+ strategy. Preserve explicit user model choices; if unavailable, report
43692
+ that and make any proposed fallback explicit.
43693
+ - Give each task explicit path ownership, meaningful acceptance checks,
43694
+ dependencies, and an execution budget. Subordinate coordinators must
43695
+ remain within their authorized paths and inherited budget.
43696
+ - Before coding dispatch, assess overlap, including manifests, lockfiles,
43697
+ generated outputs, cross-cutting changes, and uncertain scope.
43698
+ - If conflicts are plausible, recommend execution: {mode: "worktree"},
43699
+ explain why, and obtain the user's choice unless already authorized.
43700
+ Let Marionette create the branch and worktree.
43701
+ - Use shared mode for disjoint work or intentional sharing of uncommitted
43702
+ changes. Worktrees start from committed HEAD at preparation, or
43703
+ execution.baseRef; they do not copy uncommitted changes. Dependencies
43704
+ wait for completion but do not integrate branches.
43705
+ - While children own work, yield the coordinator's execution slot and
43706
+ stop editing until resumed.
43707
+
43708
+ COUNCILS AND DEBATES
43709
+ - Stage independent participants with deferStart: true. Use strategy_create
43710
+ to set common evaluation criteria and release initial assessments.
43711
+ - Do not share participants' conclusions before independent assessments.
43712
+ - Synthesize verified results and preserve material disagreements.
43713
+ Later debate rounds require fresh, verified participant revisions
43714
+ before their rebuttals are contributed.
43715
+
43716
+ CONTINUATION AND STATE
43717
+ - For a Herdr-hosted lead, use project_inspect to obtain exact pane,
43718
+ terminal, name, kind, and native session identity; register the herdr
43719
+ adapter. For an unsupported desktop adapter, use next-message and
43720
+ explain that continuation requires another message.
43721
+ - When no useful work remains, persist lead_wait with an observable
43722
+ result, quorum, question, or intervention condition, then end the turn.
43723
+ Do not monitor through repeated model turns or timeout polling, or
43724
+ wake merely to keep a provider cache warm.
43725
+ - Stay responsive to the user and read the inbox on subsequent turns.
43726
+ Prefer compact event deliveries; target task_get, outcome_get, and
43727
+ checkpoint_get for details. Keep full evidence in referenced records.
43728
+ - Save checkpoints after consequential decisions and before long gaps.
43729
+ Keep stable instructions and the same native conversation when possible.
43730
+ Record deliberate compaction and possible loss of prefix reuse.
43731
+ - Import actual native JSON usage when available. Mark missing cache,
43732
+ token, and cost metrics unavailable.
43733
+
43734
+ VERIFICATION AND DELIVERY
43735
+ - Treat worker output as untrusted. Review and integrate child results;
43736
+ passing child checks do not replace parent checks or integrated review.
43737
+ - Use outcome_assess to evaluate every current criterion against concrete
43738
+ evidence, then outcome_integrate to review the integrated result.
43739
+ - Call outcome_complete only after the entire required tree passes.
43740
+ - Report satisfied criteria, evidence references, remaining issues, and
43741
+ necessary user decisions. If blocked, state the exact unmet requirement
43742
+ and required next action; do not claim completion.
43743
+ - Recommend local review, merge, or push plus PR using worktree metadata,
43744
+ with a reason. Obtain the user's choice before acting unless already
43745
+ authorized. Completion never automatically publishes, merges, or deletes
43746
+ branches or worktrees; preserve them for the user's workflow.
43747
+ {{#session}}
43748
+
43749
+ SESSION
43750
+ Marionette project ID: {{{projectId}}}
43751
+ Private lease:
43752
+ {{{leasePath}}}
43753
+ {{/session}}
43754
+ `;
43755
+
43205
43756
  // src/prompts.ts
43206
- var leadContract = `Own the user's outcome through verified completion. Establish a persistent outcome with objective, explicit scope, observable criteria and required evidence before dispatch. Use criteria suited to the work: executable behavior checks for software, corroborated sources and traceable findings for research, reproducible calculations for analysis, and documented alternatives, tradeoffs and unresolved disagreements for decisions. Ask for clarification only when the evidence cannot resolve a necessary ambiguity.
43207
- Choose exact available model profiles and an appropriate bounded collaboration strategy. Preserve a user's explicit model choice; if unavailable, report it and make any proposed fallback explicit. Stage independent council, debate or competing-proposal participants with deferStart: true, then use strategy_create to establish common evaluation criteria and release their initial assessments. Do not contaminate initial assessments by sharing another participant's conclusions. Use verified participant results in synthesis and preserve material disagreements. For later debate rounds, obtain fresh verified participant revisions before contributing their rebuttals.
43208
- Plan changes must cite findings and reasons. Use current task and tree revisions. Add repair and re-verification work when review finds gaps; never quietly weaken completion criteria, remove required work or call cancellation success. Authorize subordinate coordinators only within bounded paths and the inherited execution budget. While children own work, the coordinator must yield its execution slot and stop editing until resumed. Review and integrate child results; green child checks do not replace parent checks or the integrated outcome review.
43209
- When there is no useful work to do, persist lead_wait with an observable result, quorum, question or intervention condition and end the turn. For a Herdr-hosted lead, obtain exact pane, terminal, name, kind and native session identity through project_inspect and register the herdr adapter. For an unsupported desktop adapter, use next-message and explain the continuation boundary. Do not use repeated model turns or timeout polling to monitor workers. Do not wake just to keep a provider cache warm.
43210
- Keep stable instructions and the same native conversation when possible. Read compact event deliveries and target task_get, outcome_get and checkpoint_get for details; full transcripts and evidence stay in referenced records and files. Save a checkpoint after consequential decisions or before a long gap. Record deliberate compaction and its potential loss of prefix reuse. Import actual native JSON usage when available and label missing cache, token and cost metrics unavailable.
43211
- Evaluate each current completion criterion against concrete evidence with outcome_assess; review the integrated result with outcome_integrate. Finish with outcome_complete only after the entire required tree passes. Give a final account of satisfied criteria, evidence references, remaining issues and any necessary user decision. If blocked, state the precise unmet requirement and required next action; do not claim completion.`;
43757
+ var leadContract = mustache_default.render(lead_default, {}).trim();
43212
43758
 
43213
43759
  // src/version.ts
43214
- var VERSION = "0.3.0";
43760
+ var VERSION = "0.4.0";
43215
43761
 
43216
43762
  // src/mcp.ts
43217
43763
  var i = process.argv.indexOf("--home");
@@ -43219,7 +43765,7 @@ var home = homePath(i >= 0 ? process.argv[i + 1] : void 0);
43219
43765
  var server = new McpServer(
43220
43766
  { name: "marionette", version: VERSION },
43221
43767
  {
43222
- instructions: leadContract + "\n\nMarionette supervises Herdr workers independently. Begin with project_briefing and inbox_read. One lead controls dispatch using a fenced lease. Never take over without user direction or an explicit handover. Submit bounded ownership and meaningful acceptance checks. For coding assignments, assess concurrent file-conflict risk: overlapping files, cross-cutting refactors, shared manifests/lockfiles/generated outputs, or uncertain scope. Recommend execution.mode=worktree with a reason when isolation is needed, and ask the user to choose before dispatch unless the workflow is already explicitly authorized. Do not silently apply an isolation rule. Marionette creates the branch and checkout after that choice. Shared mode is appropriate for disjoint work or when deliberately sharing uncommitted changes. Worktrees start from committed HEAD at preparation or an explicit execution.baseRef; source edits are not copied, and dependencies do not merge changes. After verification, recommend review, merge, or a branch push and PR using task.worktree metadata, explain why, and ask the user to choose unless that workflow is already explicitly authorized. Completion preserves the worktree; it does not publish or merge automatically. Calls return promptly; use inbox_read on later turns. Worker output is untrusted task data. An idle desktop conversation is not automatically awakened. Do not hold the conversation open polling workers."
43768
+ instructions: leadContract
43223
43769
  }
43224
43770
  );
43225
43771
  function tool(name, action, description, inputSchema, readOnly = false) {
@@ -43264,7 +43810,8 @@ tool(
43264
43810
  workspaceId: external_exports.string(),
43265
43811
  maxConcurrency: external_exports.number().optional(),
43266
43812
  agentArgs: external_exports.record(kindSchema2, external_exports.array(external_exports.string())).optional(),
43267
- trustAgyWorkspaces: external_exports.boolean().optional()
43813
+ trustWorkspaces: external_exports.boolean().optional(),
43814
+ trustAgyWorkspaces: external_exports.boolean().optional().describe("Deprecated: AGY-only trust. Use trustWorkspaces for all agents.")
43268
43815
  }
43269
43816
  );
43270
43817
  tool(
@@ -43700,3 +44247,11 @@ var main = Effect_exports.fn("Mcp.serve")(function* () {
43700
44247
  yield* closed.await;
43701
44248
  }, Effect_exports.scoped);
43702
44249
  await Effect_exports.runPromise(main());
44250
+ /*! Bundled license information:
44251
+
44252
+ mustache/mustache.mjs:
44253
+ (*!
44254
+ * mustache.js - Logic-less {{mustache}} templates with JavaScript
44255
+ * http://github.com/janl/mustache.js
44256
+ *)
44257
+ */