nexgenk 1.3.0 → 1.4.1

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 (2) hide show
  1. package/dist/main.mjs +182 -79
  2. package/package.json +1 -1
package/dist/main.mjs CHANGED
@@ -111222,7 +111222,7 @@ function dump$1(input, options) {
111222
111222
  if (writeNode(state, 0, value, true, true)) return state.dump + "\n";
111223
111223
  return "";
111224
111224
  }
111225
- var common, exception, snippet, TYPE_CONSTRUCTOR_OPTIONS, YAML_NODE_KINDS, type$2, schema, str$3, seq, map, failsafe, _null, bool, int, YAML_FLOAT_PATTERN, SCIENTIFIC_WITHOUT_DOT, float, json, core, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestamp$1, merge, BASE64_MAP, binary, _hasOwnProperty$3, _toString$2, omap, _toString$1, pairs, _hasOwnProperty$2, set$1, _default, _hasOwnProperty$1, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP, PATTERN_NON_PRINTABLE, PATTERN_NON_ASCII_LINE_BREAKS, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, PATTERN_TAG_URI, simpleEscapeCheck, simpleEscapeMap, i$1, directiveHandlers, loader, _toString, _hasOwnProperty, CHAR_BOM, CHAR_TAB, CHAR_LINE_FEED, CHAR_CARRIAGE_RETURN, CHAR_SPACE, CHAR_EXCLAMATION, CHAR_DOUBLE_QUOTE, CHAR_SHARP, CHAR_PERCENT, CHAR_AMPERSAND, CHAR_SINGLE_QUOTE, CHAR_ASTERISK, CHAR_COMMA, CHAR_MINUS, CHAR_COLON, CHAR_EQUALS, CHAR_GREATER_THAN, CHAR_QUESTION, CHAR_COMMERCIAL_AT, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_GRAVE_ACCENT, CHAR_LEFT_CURLY_BRACKET, CHAR_VERTICAL_LINE, CHAR_RIGHT_CURLY_BRACKET, ESCAPE_SEQUENCES, DEPRECATED_BOOLEANS_SYNTAX, DEPRECATED_BASE60_SYNTAX, QUOTING_TYPE_SINGLE, QUOTING_TYPE_DOUBLE, STYLE_PLAIN, STYLE_SINGLE, STYLE_LITERAL, STYLE_FOLDED, STYLE_DOUBLE, dumper, load;
111225
+ var common, exception, snippet, TYPE_CONSTRUCTOR_OPTIONS, YAML_NODE_KINDS, type$2, schema, str$3, seq, map, failsafe, _null, bool$1, int, YAML_FLOAT_PATTERN, SCIENTIFIC_WITHOUT_DOT, float, json, core, YAML_DATE_REGEXP, YAML_TIMESTAMP_REGEXP, timestamp$1, merge, BASE64_MAP, binary, _hasOwnProperty$3, _toString$2, omap, _toString$1, pairs, _hasOwnProperty$2, set$1, _default, _hasOwnProperty$1, CONTEXT_FLOW_IN, CONTEXT_FLOW_OUT, CONTEXT_BLOCK_IN, CONTEXT_BLOCK_OUT, CHOMPING_CLIP, CHOMPING_STRIP, CHOMPING_KEEP, PATTERN_NON_PRINTABLE, PATTERN_NON_ASCII_LINE_BREAKS, PATTERN_FLOW_INDICATORS, PATTERN_TAG_HANDLE, PATTERN_TAG_URI, simpleEscapeCheck, simpleEscapeMap, i$1, directiveHandlers, loader, _toString, _hasOwnProperty, CHAR_BOM, CHAR_TAB, CHAR_LINE_FEED, CHAR_CARRIAGE_RETURN, CHAR_SPACE, CHAR_EXCLAMATION, CHAR_DOUBLE_QUOTE, CHAR_SHARP, CHAR_PERCENT, CHAR_AMPERSAND, CHAR_SINGLE_QUOTE, CHAR_ASTERISK, CHAR_COMMA, CHAR_MINUS, CHAR_COLON, CHAR_EQUALS, CHAR_GREATER_THAN, CHAR_QUESTION, CHAR_COMMERCIAL_AT, CHAR_LEFT_SQUARE_BRACKET, CHAR_RIGHT_SQUARE_BRACKET, CHAR_GRAVE_ACCENT, CHAR_LEFT_CURLY_BRACKET, CHAR_VERTICAL_LINE, CHAR_RIGHT_CURLY_BRACKET, ESCAPE_SEQUENCES, DEPRECATED_BOOLEANS_SYNTAX, DEPRECATED_BASE60_SYNTAX, QUOTING_TYPE_SINGLE, QUOTING_TYPE_DOUBLE, STYLE_PLAIN, STYLE_SINGLE, STYLE_LITERAL, STYLE_FOLDED, STYLE_DOUBLE, dumper, load;
111226
111226
  var init_js_yaml = __esmMin((() => {
111227
111227
  common = {
111228
111228
  isNothing,
@@ -111330,7 +111330,7 @@ var init_js_yaml = __esmMin((() => {
111330
111330
  },
111331
111331
  defaultStyle: "lowercase"
111332
111332
  });
111333
- bool = new type$2("tag:yaml.org,2002:bool", {
111333
+ bool$1 = new type$2("tag:yaml.org,2002:bool", {
111334
111334
  kind: "scalar",
111335
111335
  resolve: resolveYamlBoolean,
111336
111336
  construct: constructYamlBoolean,
@@ -111387,7 +111387,7 @@ var init_js_yaml = __esmMin((() => {
111387
111387
  });
111388
111388
  json = failsafe.extend({ implicit: [
111389
111389
  _null,
111390
- bool,
111390
+ bool$1,
111391
111391
  int,
111392
111392
  float
111393
111393
  ] });
@@ -119809,10 +119809,10 @@ function globSegmentsMatchPrefix(globSegments, relSegments) {
119809
119809
  }
119810
119810
  function compileGrepPattern(req) {
119811
119811
  const flags = req.case_sensitive ? "g" : "gi";
119812
- const body = req.regex ? req.pattern : escapeRegExp$2(req.pattern);
119812
+ const body = req.regex ? req.pattern : escapeRegExp$3(req.pattern);
119813
119813
  return new RegExp(body, flags);
119814
119814
  }
119815
- function escapeRegExp$2(s) {
119815
+ function escapeRegExp$3(s) {
119816
119816
  return s.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
119817
119817
  }
119818
119818
  function stripTrailingNewline(s) {
@@ -123382,8 +123382,8 @@ var init_env$1 = __esmMin((() => {
123382
123382
  ]);
123383
123383
  }));
123384
123384
  // ../../packages/agent-core-v2/src/workspace/workspaceTrust/trustEnv.ts
123385
- function trustWorkspaceEnvTrusted(getEnv) {
123386
- return parseBooleanEnv(getEnv(TRUST_WORKSPACE_ENV)) === true;
123385
+ function workspaceTrustOverride(getEnv) {
123386
+ return parseBooleanEnv(getEnv(TRUST_WORKSPACE_ENV));
123387
123387
  }
123388
123388
  var TRUST_WORKSPACE_ENV;
123389
123389
  var init_trustEnv = __esmMin((() => {
@@ -123483,7 +123483,7 @@ var init_workspaceTrustStore = __esmMin((() => {
123483
123483
  initialization;
123484
123484
  initializationFailed = false;
123485
123485
  root;
123486
- envTrusted;
123486
+ envOverride;
123487
123487
  trusted = false;
123488
123488
  mutationTail = Promise.resolve();
123489
123489
  changeEmitter = this._register(new Emitter());
@@ -123493,7 +123493,7 @@ var init_workspaceTrustStore = __esmMin((() => {
123493
123493
  this.docs = docs;
123494
123494
  this.telemetry = telemetry;
123495
123495
  this.root = root;
123496
- this.envTrusted = trustWorkspaceEnvTrusted((name) => bootstrap.getEnv(name));
123496
+ this.envOverride = workspaceTrustOverride((name) => bootstrap.getEnv(name));
123497
123497
  }
123498
123498
  get ready() {
123499
123499
  if (this.initialization !== void 0) return this.initialization;
@@ -123514,7 +123514,7 @@ var init_workspaceTrustStore = __esmMin((() => {
123514
123514
  return this.trusted;
123515
123515
  }
123516
123516
  isTrusted() {
123517
- return this.envTrusted || this.trusted;
123517
+ return this.trusted || (this.envOverride ?? true);
123518
123518
  }
123519
123519
  async get() {
123520
123520
  await this.ready;
@@ -123627,7 +123627,7 @@ var init_workspaceTrustService = __esmMin((() => {
123627
123627
  }
123628
123628
  async initialize() {
123629
123629
  await this.inner.ready;
123630
- this.trusted = this.inner.isPersistedTrusted();
123630
+ this.trusted = this.inner.isTrusted();
123631
123631
  }
123632
123632
  };
123633
123633
  WorkspaceTrustService = __decorate([
@@ -125575,9 +125575,9 @@ var init_update_config = __esmMin((() => {
125575
125575
  };
125576
125576
  }));
125577
125577
  // ../../packages/agent-core-v2/src/features/wave/wave.ts
125578
- var WAVE_FLAG_ID, WAVE_FLAG_ENV, WAVE_SEAT_PROFILE, WAVE_TOOL_DOMAIN;
125578
+ var WAVE_FLAG_ID$1, WAVE_FLAG_ENV, WAVE_SEAT_PROFILE, WAVE_TOOL_DOMAIN;
125579
125579
  var init_wave$3 = __esmMin((() => {
125580
- WAVE_FLAG_ID = "wave";
125580
+ WAVE_FLAG_ID$1 = "wave";
125581
125581
  WAVE_FLAG_ENV = "NEXGEN_EXPERIMENTAL_WAVE";
125582
125582
  WAVE_SEAT_PROFILE = "wave-seat";
125583
125583
  WAVE_TOOL_DOMAIN = "wave";
@@ -125604,7 +125604,7 @@ var init_wave$1 = __esmMin((() => {
125604
125604
  ...parsed$1,
125605
125605
  path: PSEUDO_PATH$1,
125606
125606
  dir: PSEUDO_PATH$1,
125607
- experimentalFlag: WAVE_FLAG_ID,
125607
+ experimentalFlag: WAVE_FLAG_ID$1,
125608
125608
  metadata: {
125609
125609
  ...parsed$1.metadata,
125610
125610
  type: parsed$1.metadata.type ?? "inline"
@@ -125726,7 +125726,7 @@ function expandSkillParameters(body, rawArgs, context) {
125726
125726
  for (let index = 0; index < (context.argumentNames?.length ?? 0); index++) {
125727
125727
  const name = context.argumentNames?.[index];
125728
125728
  if (name === void 0) continue;
125729
- const escaped = escapeRegExp$1(name);
125729
+ const escaped = escapeRegExp$2(name);
125730
125730
  content = content.replaceAll(new RegExp(`\\$${escaped}(?![\\[\\w])`, "g"), escapeXmlTags(tokens[index] ?? ""));
125731
125731
  }
125732
125732
  content = content.replaceAll(/\$ARGUMENTS\[(\d+)\]/g, (_match, indexText) => {
@@ -125816,7 +125816,7 @@ function tokenizeArgs(raw) {
125816
125816
  if (hasContent) out.push(current);
125817
125817
  return out;
125818
125818
  }
125819
- function escapeRegExp$1(value) {
125819
+ function escapeRegExp$2(value) {
125820
125820
  return value.replaceAll(/[\\^$.*+?()[\]{}|]/g, "\\$&");
125821
125821
  }
125822
125822
  var LISTING_DESC_MAX, InMemorySkillCatalog, SOURCE_GROUPS, graphemeSegmenter$3;
@@ -219306,6 +219306,9 @@ function num(value, fallback) {
219306
219306
  function text(value, fallback) {
219307
219307
  return typeof value === "string" ? value : fallback;
219308
219308
  }
219309
+ function bool(value, fallback) {
219310
+ return typeof value === "boolean" ? value : fallback;
219311
+ }
219309
219312
  function strArray$1(value, fallback) {
219310
219313
  return Array.isArray(value) && value.every((item) => typeof item === "string") ? value : fallback;
219311
219314
  }
@@ -219335,7 +219338,8 @@ function makeWaveConfig(raw, loadedFrom) {
219335
219338
  minGoalChars: num(thresholds["minGoalChars"], DEFAULT_THRESHOLDS.minGoalChars),
219336
219339
  minScopeChars: num(thresholds["minScopeChars"], DEFAULT_THRESHOLDS.minScopeChars),
219337
219340
  minFieldChars: num(thresholds["minFieldChars"], DEFAULT_THRESHOLDS.minFieldChars),
219338
- minMetricChars: num(thresholds["minMetricChars"], DEFAULT_THRESHOLDS.minMetricChars)
219341
+ minMetricChars: num(thresholds["minMetricChars"], DEFAULT_THRESHOLDS.minMetricChars),
219342
+ allowVerifyTargetMissing: bool(thresholds["allowVerifyTargetMissing"], DEFAULT_THRESHOLDS.allowVerifyTargetMissing)
219339
219343
  },
219340
219344
  vocabulary: {
219341
219345
  areas: strArray$1(vocabulary["areas"], DEFAULT_VOCABULARY.areas),
@@ -219359,7 +219363,8 @@ function makeWaveConfig(raw, loadedFrom) {
219359
219363
  minAxes: num(quorum["minAxes"], DEFAULT_QUORUM.minAxes),
219360
219364
  axes: strArray$1(quorum["axes"], DEFAULT_QUORUM.axes)
219361
219365
  },
219362
- loadedFrom
219366
+ loadedFrom,
219367
+ missingKeys: CONFIG_REQUIRED_KEYS.filter((key) => base[key] === void 0)
219363
219368
  };
219364
219369
  }
219365
219370
  function readWaveConfig(fs, root) {
@@ -219378,7 +219383,7 @@ function containedPath(root, candidate) {
219378
219383
  if (resolved !== resolvedRoot && !resolved.startsWith(`${resolvedRoot}${sep}`)) throw new Error(`ruta fuera del workspace: ${candidate}`);
219379
219384
  return resolved;
219380
219385
  }
219381
- var DEFAULT_LAYOUT, DEFAULT_THRESHOLDS, DEFAULT_VOCABULARY, DEFAULT_ROLES, DEFAULT_QUORUM;
219386
+ var DEFAULT_LAYOUT, DEFAULT_THRESHOLDS, DEFAULT_VOCABULARY, DEFAULT_ROLES, DEFAULT_QUORUM, CONFIG_REQUIRED_KEYS;
219382
219387
  var init_config$6 = __esmMin((() => {
219383
219388
  DEFAULT_LAYOUT = {
219384
219389
  waves: "design/waves",
@@ -219397,7 +219402,8 @@ var init_config$6 = __esmMin((() => {
219397
219402
  minGoalChars: 40,
219398
219403
  minScopeChars: 40,
219399
219404
  minFieldChars: 10,
219400
- minMetricChars: 4
219405
+ minMetricChars: 4,
219406
+ allowVerifyTargetMissing: false
219401
219407
  };
219402
219408
  DEFAULT_VOCABULARY = {
219403
219409
  areas: [
@@ -219476,6 +219482,13 @@ var init_config$6 = __esmMin((() => {
219476
219482
  "encaje"
219477
219483
  ]
219478
219484
  };
219485
+ CONFIG_REQUIRED_KEYS = [
219486
+ "version",
219487
+ "layout",
219488
+ "waves",
219489
+ "thresholds",
219490
+ "vocabulary"
219491
+ ];
219479
219492
  }));
219480
219493
  // ../../packages/agent-core-v2/src/features/wave/core/nodeFs.ts
219481
219494
  var nodeWaveFs;
@@ -219559,23 +219572,20 @@ function evaluateQuorum(input) {
219559
219572
  const winner = ranked[0];
219560
219573
  const second = ranked[1];
219561
219574
  if (winner === void 0) throw new Error("no hay propuestas que comparar");
219562
- if (second === void 0) {
219563
- const perJudge = input.verdicts.map((verdict) => ({
219575
+ if (second === void 0) return {
219576
+ verdict: "refine",
219577
+ winner: void 0,
219578
+ second: void 0,
219579
+ medians,
219580
+ medianMargin: 0,
219581
+ judgesHoldingMargin: 0,
219582
+ perJudge: input.verdicts.map((verdict) => ({
219564
219583
  judge: verdict.judge,
219565
219584
  margin: 0,
219566
- holds: true
219567
- }));
219568
- return {
219569
- verdict: "adopt",
219570
- winner,
219571
- second: void 0,
219572
- medians,
219573
- medianMargin: 0,
219574
- judgesHoldingMargin: perJudge.length,
219575
- perJudge,
219576
- reason: `solo hay una propuesta: ${winner}`
219577
- };
219578
- }
219585
+ holds: false
219586
+ })),
219587
+ reason: `solo hay una propuesta (${winner}): sin comparacion no hay quorum`
219588
+ };
219579
219589
  const winnerMedian = medians[winner] ?? 0;
219580
219590
  const secondMedian = medians[second] ?? 0;
219581
219591
  const medianMargin = Number((winnerMedian - secondMedian).toFixed(6));
@@ -219599,7 +219609,8 @@ function evaluateQuorum(input) {
219599
219609
  });
219600
219610
  const judgesHoldingMargin = perJudge.filter((entry) => entry.holds).length;
219601
219611
  const marginOk = medianMargin >= minPoints;
219602
- const majorityOk = judgesHoldingMargin >= minAxes;
219612
+ const requiredJudges = Math.min(minAxes, perJudge.length);
219613
+ const majorityOk = judgesHoldingMargin >= requiredJudges;
219603
219614
  if (marginOk && majorityOk) return {
219604
219615
  verdict: "adopt",
219605
219616
  winner,
@@ -219608,9 +219619,9 @@ function evaluateQuorum(input) {
219608
219619
  medianMargin,
219609
219620
  judgesHoldingMargin,
219610
219621
  perJudge,
219611
- reason: `mediana ${winner} ${winnerMedian} vs ${second} ${secondMedian}: margen ${medianMargin} en ${judgesHoldingMargin}/${perJudge.length} jueces`
219622
+ reason: `mediana ${winner} ${winnerMedian} vs ${second} ${secondMedian}: margen ${medianMargin} en ${judgesHoldingMargin}/${perJudge.length} jueces (minimo ${requiredJudges})`
219612
219623
  };
219613
- const reason = [marginOk ? void 0 : `margen ${medianMargin} < ${minPoints}`, majorityOk ? void 0 : `solo ${judgesHoldingMargin}/${perJudge.length} jueces superan el margen (minimo ${minAxes})`].filter((part) => part !== void 0).join(" y ");
219624
+ const reason = [marginOk ? void 0 : `margen ${medianMargin} < ${minPoints}`, majorityOk ? void 0 : `solo ${judgesHoldingMargin}/${perJudge.length} jueces superan el margen (minimo ${requiredJudges})`].filter((part) => part !== void 0).join(" y ");
219614
219625
  return {
219615
219626
  verdict: round >= 2 ? "deadlock" : "refine",
219616
219627
  winner,
@@ -220107,6 +220118,11 @@ var init_submit$1 = __esmMin((() => {
220107
220118
  IWaveSubmitTool = createDecorator("waveSubmitTool");
220108
220119
  }));
220109
220120
  // ../../packages/agent-core-v2/src/features/wave/tools/submit/submitRunner.ts
220121
+ function slotNames(slot, roles) {
220122
+ const configured = roles[slot.role];
220123
+ const count = typeof configured === "number" && Number.isFinite(configured) ? Math.max(0, Math.floor(configured)) : 0;
220124
+ return Array.from({ length: count }, (_, index) => `${slot.prefix}${index + 1}`);
220125
+ }
220110
220126
  function findWaveDir(root, wavesRel, wave) {
220111
220127
  const fs = nodeWaveFs;
220112
220128
  const wavesDir = containedPath(root, wavesRel);
@@ -220123,8 +220139,10 @@ function runWaveSubmitForRoot(input) {
220123
220139
  const layout = asRecord$2(asRecord$2(rawConfig)["layout"]);
220124
220140
  const wavesRel = typeof layout["waves"] === "string" ? layout["waves"] : "design/waves";
220125
220141
  const slot = ROUND_SLOTS[input.round];
220126
- if (!slot.pattern.test(input.role)) return {
220127
- output: `el rol "${input.role}" no pertenece a la ronda ${input.round} (esperado ${slot.names.join(", ")})`,
220142
+ const names = slotNames(slot, asRecord$2(asRecord$2(rawConfig)["roles"]));
220143
+ const accepted = input.round === "audit" ? names.filter((name) => name !== "R1") : input.round === "refine" ? names.slice(0, 1) : names;
220144
+ if (!accepted.includes(input.role)) return {
220145
+ output: `el rol "${input.role}" no pertenece a la ronda ${input.round} (esperado ${accepted.join(", ") || "ninguno configurado"})`,
220128
220146
  isError: true
220129
220147
  };
220130
220148
  let base;
@@ -220165,49 +220183,33 @@ var init_submitRunner = __esmMin((() => {
220165
220183
  ROUND_SLOTS = {
220166
220184
  propose: {
220167
220185
  dir: "01-proposals",
220168
- pattern: /^P\d+$/,
220169
- names: [
220170
- "P1",
220171
- "P2",
220172
- "P3"
220173
- ]
220186
+ prefix: "P",
220187
+ role: "proponents"
220174
220188
  },
220175
220189
  defend: {
220176
220190
  dir: "02-defenses",
220177
- pattern: /^D\d+$/,
220178
- names: [
220179
- "D1",
220180
- "D2",
220181
- "D3"
220182
- ]
220191
+ prefix: "D",
220192
+ role: "defenders"
220183
220193
  },
220184
220194
  attack: {
220185
220195
  dir: "03-attacks",
220186
- pattern: /^A\d+$/,
220187
- names: [
220188
- "A1",
220189
- "A2",
220190
- "A3"
220191
- ]
220196
+ prefix: "A",
220197
+ role: "adversaries"
220192
220198
  },
220193
220199
  judge: {
220194
220200
  dir: "04-verdicts",
220195
- pattern: /^J\d+$/,
220196
- names: [
220197
- "J1",
220198
- "J2",
220199
- "J3"
220200
- ]
220201
+ prefix: "J",
220202
+ role: "judges"
220201
220203
  },
220202
220204
  refine: {
220203
220205
  dir: "05-refined",
220204
- pattern: /^R1$/,
220205
- names: ["R1"]
220206
+ prefix: "R",
220207
+ role: "refiners"
220206
220208
  },
220207
220209
  audit: {
220208
220210
  dir: "05-refined",
220209
- pattern: /^R2$/,
220210
- names: ["R2"]
220211
+ prefix: "R",
220212
+ role: "refiners"
220211
220213
  }
220212
220214
  };
220213
220215
  }));
@@ -220279,6 +220281,30 @@ function walk(fs, dir, accept, acc = []) {
220279
220281
  }
220280
220282
  return acc;
220281
220283
  }
220284
+ function escapeRegExp$1(value) {
220285
+ return value.replaceAll(/[.*+?^${}()|[\]\\]/g, "\\$&");
220286
+ }
220287
+ function hasMeasure(value) {
220288
+ if (/[<>=≤≥]/.test(value)) return true;
220289
+ if (/\b(ms|s|seg|segundos?|minutos?|filas?|bytes?|p95|peticiones?|veces|puntos?|codigo|status|exact\w*)\b/i.test(value)) return true;
220290
+ return /[a-z]/i.test(value) && !/^\d+(\s+\d+)+$/.test(value);
220291
+ }
220292
+ function isDestructive(mutation) {
220293
+ return /(borrar|borra|eliminar|elimina|drop|truncate|wipe|rm -rf)[^.]{0,40}(esquema|schema|cluster|volumen|directorio|carpeta|repositorio|contenedor|base de datos|database|entorno)/i.test(mutation) || /(drop|truncate)\s+(table|database|schema)/i.test(mutation);
220294
+ }
220295
+ function verifyTargetExists(waveDir, target) {
220296
+ const resolved = resolve(waveDir, target);
220297
+ return resolved.startsWith(waveDir) && existsSync(resolved);
220298
+ }
220299
+ function waveDirectories(fs, root, cfg) {
220300
+ const dir = containedPath(root, cfg.layout.waves);
220301
+ const map = /* @__PURE__ */ new Map();
220302
+ for (const wave of cfg.waves) {
220303
+ const match = fs.list(dir).find((name) => name === wave || name.startsWith(`${wave}-`));
220304
+ if (match !== void 0) map.set(wave, join(dir, match));
220305
+ }
220306
+ return map;
220307
+ }
220282
220308
  function requiredArtifacts(cfg) {
220283
220309
  const required = ["00-brief.md"];
220284
220310
  for (let i = 1; i <= cfg.roles.proponents; i++) required.push(`01-proposals/P${i}.md`);
@@ -220454,7 +220480,9 @@ function runWaveGate(fs, root, cfg) {
220454
220480
  });
220455
220481
  block("ac", () => {
220456
220482
  const vague = vocabulary.vagueWords.map((word) => normalize$1(word)).filter(Boolean);
220483
+ const vaguePattern = vague.length === 0 ? void 0 : new RegExp(`(^|[^a-z0-9])(${vague.map(escapeRegExp$1).join("|")})[a-z]*([^a-z0-9]|$)`);
220457
220484
  const withFalsifier = /* @__PURE__ */ new Set();
220485
+ const waveDirs = waveDirectories(fs, root, cfg);
220458
220486
  for (const task of tasks) {
220459
220487
  const taskId = str$2(task["id"]);
220460
220488
  for (const raw of asArray$1(task["ac"])) {
@@ -220475,8 +220503,10 @@ function runWaveGate(fs, root, cfg) {
220475
220503
  const metric = str$2(ac["metric"]);
220476
220504
  if (metric !== "" && metric.length < thresholds.minMetricChars) add("ac.short_metric", at, `"metric" < ${thresholds.minMetricChars} caracteres`);
220477
220505
  const prose = normalize$1(`${str$2(ac["then"])} ${str$2(ac["threshold"])} ${metric}`);
220478
- const hit = vague.find((word) => new RegExp(`(^|[^a-z0-9])${word}([^a-z0-9]|$)`).test(prose));
220506
+ const hit = vaguePattern?.exec(prose)?.[2];
220479
220507
  if (hit !== void 0) add("ac.vague_language", at, `"${hit}" no es medible: el AC no muerde`);
220508
+ const thresholdText = str$2(ac["threshold"]).trim();
220509
+ if (thresholdText !== "" && !hasMeasure(thresholdText)) add("ac.threshold_not_measurable", at, `"${thresholdText}" no declara unidad, operador ni magnitud comparada`);
220480
220510
  const verify = str$2(ac["verify"]).trim();
220481
220511
  if (verify !== "") {
220482
220512
  const command = verify.split(/\s+/)[0] ?? "";
@@ -220485,14 +220515,17 @@ function runWaveGate(fs, root, cfg) {
220485
220515
  const matched = verify.match(/\b((?:[\w.-]+\/)+[\w.-]+)/)?.[1];
220486
220516
  if (matched === void 0) add("ac.verify_outside_test_plan", at, "el comando no apunta a ningun fichero o directorio verificable");
220487
220517
  else if (!vocabulary.verifyPrefixes.some((prefix) => matched.startsWith(prefix))) add("ac.verify_outside_test_plan", at, `"${matched}" fuera del test plan declarado`);
220518
+ else if (!thresholds.allowVerifyTargetMissing && !verifyTargetExists(waveDirs.get(str$2(task["wave"])) ?? root, matched)) add("ac.verify_target_missing", at, `"${matched}" no existe en el arbol: el verify saldria verde sin ejecutar nada`);
220488
220519
  }
220489
220520
  }
220490
220521
  const falsifier = record$1(ac["falsifier"]);
220491
220522
  if (Object.keys(falsifier).length > 0) {
220492
220523
  const mutation = str$2(falsifier["mutation"]);
220493
220524
  const expect = str$2(falsifier["expect"]);
220525
+ const script = str$2(falsifier["script"]);
220494
220526
  if (mutation.length < thresholds.minFieldChars) add("ac.falsifier_thin", at, "falsifier.mutation insuficiente");
220495
220527
  else if (expect.length < thresholds.minFieldChars) add("ac.falsifier_thin", at, "falsifier.expect insuficiente");
220528
+ else if (script === "" && isDestructive(mutation)) add("ac.falsifier_not_reversible", at, `"${mutation}" necesita falsifier.script con apply y restore`);
220496
220529
  else withFalsifier.add(taskId);
220497
220530
  }
220498
220531
  }
@@ -220962,7 +220995,7 @@ var init_flag$2 = __esmMin((() => {
220962
220995
  init_wave$3();
220963
220996
  init_waveFeature();
220964
220997
  waveFlag = {
220965
- id: WAVE_FLAG_ID,
220998
+ id: WAVE_FLAG_ID$1,
220966
220999
  title: "Wave workflow",
220967
221000
  description: "Enable the wave workflow: adversarial design rounds with isolated seats, the package gate, and task verification tools.",
220968
221001
  env: WAVE_FLAG_ENV,
@@ -228271,7 +228304,7 @@ var init_mcpRegistryService = __esmMin((() => {
228271
228304
  }
228272
228305
  } else {
228273
228306
  const cwd = canonicalWorkspaceRoot(query.cwd);
228274
- if (!(await readWorkspaceTrust(this.docs, cwd) || trustWorkspaceEnvTrusted((name) => this.bootstrap.getEnv(name)))) {
228307
+ if (!(await readWorkspaceTrust(this.docs, cwd) || (workspaceTrustOverride((name) => this.bootstrap.getEnv(name)) ?? true))) {
228275
228308
  const userEntries = await this.store.list();
228276
228309
  for (const server of userEntries) {
228277
228310
  const { name, ...config } = server;
@@ -394701,6 +394734,10 @@ function swarmArgumentCompletions(argumentPrefix) {
394701
394734
  function towerArgumentCompletions(argumentPrefix) {
394702
394735
  return completeLeadingArg(TOWER_ARG_COMPLETIONS, argumentPrefix);
394703
394736
  }
394737
+ /** Argument autocompletion for the `/wave` command (subcommands). */
394738
+ function waveArgumentCompletions(argumentPrefix) {
394739
+ return completeLeadingArg(WAVE_ARG_COMPLETIONS, argumentPrefix);
394740
+ }
394704
394741
  /** Argument autocompletion for the `/add-dir` command. */
394705
394742
  function addDirArgumentCompletions(argumentPrefix) {
394706
394743
  if (isPathLikeAddDirArgument(argumentPrefix)) return completeAddDirPath(argumentPrefix);
@@ -394780,7 +394817,7 @@ function resolveSlashCommandAvailability(command, args) {
394780
394817
  function sortSlashCommands(commands) {
394781
394818
  return [...commands].toSorted((a, b) => (b.priority ?? 0) - (a.priority ?? 0) || a.name.localeCompare(b.name));
394782
394819
  }
394783
- var GOAL_ARG_COMPLETIONS, GOAL_NEXT_ARG_COMPLETIONS, SWARM_ARG_COMPLETIONS, TOWER_ARG_COMPLETIONS, ADD_DIR_ARG_COMPLETIONS, BUILTIN_SLASH_COMMANDS;
394820
+ var GOAL_ARG_COMPLETIONS, GOAL_NEXT_ARG_COMPLETIONS, SWARM_ARG_COMPLETIONS, TOWER_ARG_COMPLETIONS, WAVE_ARG_COMPLETIONS, ADD_DIR_ARG_COMPLETIONS, BUILTIN_SLASH_COMMANDS;
394784
394821
  var init_registry$2 = __esmMin((() => {
394785
394822
  init_dist$5();
394786
394823
  init_complete_args();
@@ -394839,6 +394876,20 @@ var init_registry$2 = __esmMin((() => {
394839
394876
  description: "Turn tower mode off"
394840
394877
  }
394841
394878
  ];
394879
+ WAVE_ARG_COMPLETIONS = [
394880
+ {
394881
+ value: "on",
394882
+ description: "Enable the wave experiment"
394883
+ },
394884
+ {
394885
+ value: "off",
394886
+ description: "Disable the wave experiment"
394887
+ },
394888
+ {
394889
+ value: "status",
394890
+ description: "Report whether the wave experiment is on"
394891
+ }
394892
+ ];
394842
394893
  ADD_DIR_ARG_COMPLETIONS = [{
394843
394894
  value: "list",
394844
394895
  description: "Show configured additional workspace directories"
@@ -394903,7 +394954,8 @@ var init_registry$2 = __esmMin((() => {
394903
394954
  aliases: [],
394904
394955
  description: "Run a design wave: brief, adversarial swarm, gate and execution",
394905
394956
  priority: 90,
394906
- argumentHint: "<objetivo de la oleada>",
394957
+ argumentHint: "[on|off|status] | <objetivo de la oleada>",
394958
+ completeArgs: waveArgumentCompletions,
394907
394959
  availability: "idle-only",
394908
394960
  experimentalFlag: "wave"
394909
394961
  },
@@ -477539,16 +477591,66 @@ function buildWavePrompt(args) {
477539
477591
  ].join("\n");
477540
477592
  }
477541
477593
  async function handleWaveCommand(host, args) {
477542
- const objective = args.trim();
477543
- if (objective === "") {
477594
+ const input = args.trim();
477595
+ const sub = input.toLowerCase();
477596
+ if (sub === "on" || sub === "off") {
477597
+ await setWaveExperiment(host, sub === "on");
477598
+ return;
477599
+ }
477600
+ if (sub === "" || sub === "status") {
477601
+ await reportWaveStatus(host, sub === "");
477602
+ return;
477603
+ }
477604
+ if (sub === "help") {
477544
477605
  host.showNotice("Wave", WAVE_USAGE);
477545
477606
  return;
477546
477607
  }
477547
- host.sendNormalUserInput(buildWavePrompt(objective));
477608
+ host.sendNormalUserInput(buildWavePrompt(input));
477609
+ }
477610
+ async function reportWaveStatus(host, asUsage) {
477611
+ let enabled;
477612
+ try {
477613
+ enabled = (await host.harness.getExperimentalFeatures()).find((feature) => feature.id === WAVE_FLAG_ID)?.enabled === true;
477614
+ } catch (error) {
477615
+ host.showError(`Failed to read the wave experiment state: ${formatErrorMessage$2(error)}`);
477616
+ return;
477617
+ }
477618
+ if (asUsage) {
477619
+ host.showNotice(`Wave experiment: ${enabled ? "ON" : "OFF"}`, `${WAVE_USAGE}\n\n${enabled ? "Las tools Wave están disponibles en esta sesión." : "Actívalo con `/wave on`; no hace falta editar config.toml ni reiniciar."}`);
477620
+ return;
477621
+ }
477622
+ host.showStatus(enabled ? "Wave experiment is on." : "Wave experiment is off. Run `/wave on` to enable it without a restart.");
477548
477623
  }
477549
- var WAVE_USAGE;
477624
+ async function setWaveExperiment(host, enabled) {
477625
+ try {
477626
+ await host.harness.setConfig({ experimental: { [WAVE_FLAG_ID]: enabled } });
477627
+ setExperimentalFeatures(await host.harness.getExperimentalFeatures());
477628
+ host.refreshSlashCommandAutocomplete();
477629
+ } catch (error) {
477630
+ host.showError(`Failed to ${enabled ? "enable" : "disable"} the wave experiment: ${formatErrorMessage$2(error)}`);
477631
+ return;
477632
+ }
477633
+ if (!enabled) {
477634
+ host.showStatus("Wave experiment off. `/wave` is hidden until you turn it back on.");
477635
+ return;
477636
+ }
477637
+ if (host.session === void 0) {
477638
+ host.showStatus("Wave experiment on. `/wave <objetivo>` is ready.", "success");
477639
+ return;
477640
+ }
477641
+ try {
477642
+ const reloadedSession = await host.harness.reloadSession({ id: host.session.id });
477643
+ await host.reloadCurrentSessionView(reloadedSession, "Wave experiment on. Session reloaded — `/wave <objetivo>` is ready.");
477644
+ } catch (error) {
477645
+ host.showError(`Wave experiment is on, but the session could not be reloaded: ${formatErrorMessage$2(error)}`);
477646
+ }
477647
+ }
477648
+ var WAVE_USAGE, WAVE_FLAG_ID;
477550
477649
  var init_wave = __esmMin((() => {
477551
- WAVE_USAGE = "Uso: /wave <objetivo de la oleada> — abre una oleada de diseño, lanza el swarm adversarial y cierra con el gate. Requiere NEXGEN_EXPERIMENTAL_WAVE.";
477650
+ init_event_payload();
477651
+ init_experimental_flags();
477652
+ WAVE_USAGE = "Uso: /wave <objetivo de la oleada> — abre una oleada de diseño, lanza el swarm adversarial y cierra con el gate. Los subcomandos `/wave on`, `/wave off` y `/wave status` activan o consultan el experimento.";
477653
+ WAVE_FLAG_ID = "wave";
477552
477654
  }));
477553
477655
  // src/tui/commands/tower.ts
477554
477656
  async function handleTowerCommand(host, args) {
@@ -484645,6 +484747,7 @@ var init_commands = __esmMin((() => {
484645
484747
  init_config();
484646
484748
  init_swarm();
484647
484749
  init_tower();
484750
+ init_wave();
484648
484751
  init_info();
484649
484752
  init_plugins();
484650
484753
  init_reload();
@@ -501094,7 +501197,7 @@ var NexgenTUI = class {
501094
501197
  const { startup } = this.options;
501095
501198
  const config = await this.harness.getConfig({ reload: true });
501096
501199
  const patch = includeModel ? lazyModelSelection(config, startup.model ?? config.defaultModel) : {};
501097
- if (!startup.auto && !startup.yolo) patch.permissionMode = config.defaultPermissionMode ?? "manual";
501200
+ if (!startup.auto && !startup.yolo) patch.permissionMode = config.defaultPermissionMode ?? "auto";
501098
501201
  patch.configDefaultPlanMode = config.defaultPlanMode === true;
501099
501202
  if (!startup.plan) patch.planMode = config.defaultPlanMode === true;
501100
501203
  if (startup.agentProfile !== void 0 || startup.agentFiles !== void 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexgenk",
3
- "version": "1.3.0",
3
+ "version": "1.4.1",
4
4
  "description": "NexgenK — terminal AI coding agent",
5
5
  "license": "MIT",
6
6
  "author": "NexgenK",