@mutmutco/cli 3.139.3 → 3.139.4

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/main.cjs CHANGED
@@ -10746,10 +10746,10 @@ var rollout_plan_default = {
10746
10746
  note: "The v4.0.0 stamp happens at cut time (D6e #4463); until then the candidate is the origin/development head artifacts (built cli/dist + npm pack), identity proven by dist content hash (D6a)."
10747
10747
  },
10748
10748
  baseline: {
10749
- version: "3.139.3",
10750
- tag: "v3.139.3",
10751
- commit: "19258f64de5f",
10752
- npm: "@mutmutco/cli@3.139.3"
10749
+ version: "3.139.4",
10750
+ tag: "v3.139.4",
10751
+ commit: "ec2807c7a293",
10752
+ npm: "@mutmutco/cli@3.139.4"
10753
10753
  },
10754
10754
  exitCriterion: "fleet-n-of-n",
10755
10755
  hubOnlyShortcut: "forbidden",
@@ -10766,14 +10766,14 @@ var rollout_plan_default = {
10766
10766
  repo: "mutmutco/mmi-hub",
10767
10767
  role: "canary",
10768
10768
  schedule: "train",
10769
- v3Target: "v3.139.3"
10769
+ v3Target: "v3.139.4"
10770
10770
  }
10771
10771
  ],
10772
10772
  rollbackTrigger: "Any red inside the post-cut soak window: `devops train gate` FAIL attributable to the v4 doors, Hub endpoint health probe failure, a v3 client refused while the compat window must still admit it (SUPPORTED_MINOR_WINDOW=2, MIN_CLIENT_VERSION 0.0.0 \u2014 D6a), or npm consumer install/doctor failure on the v4 dist.",
10773
10773
  rollback: {
10774
10774
  independent: true,
10775
- mechanism: "npm dist-tag latest -> 3.139.3 and redeploy the Hub Lambda from tag v3.139.3 (19258f64de5f); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
10776
- v3Target: "v3.139.3 (@mutmutco/cli@3.139.3, tag commit 19258f64de5f \u2014 the preserved latest-v3 distribution, D6b)"
10775
+ mechanism: "npm dist-tag latest -> 3.139.4 and redeploy the Hub Lambda from tag v3.139.4 (ec2807c7a293); installed clients repair via `mmi-cli doctor`. No other cohort is touched.",
10776
+ v3Target: "v3.139.4 (@mutmutco/cli@3.139.4, tag commit ec2807c7a293 \u2014 the preserved latest-v3 distribution, D6b)"
10777
10777
  }
10778
10778
  },
10779
10779
  {
@@ -23042,8 +23042,12 @@ var import_node_path22 = require("node:path");
23042
23042
  // src/repo-index-v4/language.ts
23043
23043
  var LANGUAGE_BY_EXTENSION = {
23044
23044
  ".ts": { name: "typescript", parserName: "typescript" },
23045
+ ".mts": { name: "typescript", parserName: "typescript" },
23046
+ ".cts": { name: "typescript", parserName: "typescript" },
23045
23047
  ".tsx": { name: "tsx", parserName: "tsx" },
23046
23048
  ".js": { name: "javascript", parserName: "javascript" },
23049
+ ".mjs": { name: "javascript", parserName: "javascript" },
23050
+ ".cjs": { name: "javascript", parserName: "javascript" },
23047
23051
  ".jsx": { name: "jsx", parserName: "javascript" },
23048
23052
  ".py": { name: "python", parserName: "python" },
23049
23053
  ".go": { name: "go", parserName: "go" },
@@ -23209,6 +23213,7 @@ async function buildStructuralChunks(cwd, repo, commit) {
23209
23213
  var V4_MAX_CHUNKS = 1e4;
23210
23214
  var V4_MAX_ARTIFACT_BYTES = 64 * 1024 * 1024;
23211
23215
  var V4_EMBED_BATCH = 32;
23216
+ var V4_VECTOR_DECIMAL_PLACES = 6;
23212
23217
  var COMMIT = /^[a-f0-9]{40}$/;
23213
23218
  function canonicalJson(value) {
23214
23219
  if (value === null || typeof value !== "object") return JSON.stringify(value);
@@ -23219,6 +23224,9 @@ function canonicalJson(value) {
23219
23224
  function sha2562(value) {
23220
23225
  return (0, import_node_crypto7.createHash)("sha256").update(canonicalJson(value)).digest("hex");
23221
23226
  }
23227
+ function quantizeV4Vector(vector) {
23228
+ return vector.map((value) => Number(value.toFixed(V4_VECTOR_DECIMAL_PLACES)));
23229
+ }
23222
23230
  function statePath(cwd) {
23223
23231
  return repoRuntimeStatePath(cwd, "repo-index", "v4.json");
23224
23232
  }
@@ -23271,14 +23279,17 @@ ${chunk.blurb ?? ""}`;
23271
23279
  var V4_EMBED_TIMEOUT_MS = 15 * 6e4;
23272
23280
  function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
23273
23281
  if (!chunks.length) return { embeddings: [] };
23274
- const runner = (0, import_node_path23.join)(cwd, "repo-indexer", "src", "batch.mjs");
23275
- const fallback = (0, import_node_path23.join)(process.cwd(), "repo-indexer", "src", "batch.mjs");
23276
- const file = (0, import_node_fs25.existsSync)(runner) ? runner : fallback;
23282
+ const orchestratorRunner = (0, import_node_path23.join)(process.cwd(), "repo-indexer", "src", "batch.mjs");
23283
+ const targetRunner = (0, import_node_path23.join)(cwd, "repo-indexer", "src", "batch.mjs");
23284
+ const file = (0, import_node_fs25.existsSync)(orchestratorRunner) ? orchestratorRunner : targetRunner;
23277
23285
  if (!(0, import_node_fs25.existsSync)(file)) return { embeddings: [], reason: "embeddings-unavailable" };
23278
23286
  const request = { texts: chunks.map((chunk) => ({ id: chunk.id, text: embeddingInput(cwd, chunk) })), maxBatch: V4_EMBED_BATCH };
23279
23287
  const env = { ...process.env, ...modelDirectory ? { MMI_REPO_INDEXER_MODEL_DIR: modelDirectory } : {} };
23280
23288
  const result = (0, import_node_child_process13.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: V4_EMBED_TIMEOUT_MS, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
23281
- if (result.error || result.status !== 0) return { embeddings: [], reason: "embeddings-unavailable" };
23289
+ if (result.error || result.status !== 0) {
23290
+ const detail = result.error?.message ?? result.signal ?? `exit status ${result.status ?? "unknown"}`;
23291
+ throw new Error(`repo-index v4 embedding runner failed: ${detail}`);
23292
+ }
23282
23293
  try {
23283
23294
  const response = JSON.parse(result.stdout);
23284
23295
  if (!response.ok || !response.provenance || !Array.isArray(response.embeddings)) return { embeddings: [], reason: "embeddings-unavailable" };
@@ -23321,7 +23332,7 @@ async function buildRepoIndexV4(cwd, repo, opts = {}) {
23321
23332
  const reusableIds = new Set(reusable.map((e) => e.chunkId));
23322
23333
  const missing = chunks.filter((chunk) => !reusableIds.has(chunk.id));
23323
23334
  const generated = missing.length === 0 ? { embeddings: [] } : opts.embed === false ? { embeddings: [], reason: "embeddings-unavailable" } : runEmbedder(cwd, missing, opts.modelDirectory, createdAt);
23324
- const embeddings = [...reusable, ...generated.embeddings].sort((a, b) => a.chunkId.localeCompare(b.chunkId));
23335
+ const embeddings = [...reusable, ...generated.embeddings].map((embedding) => ({ ...embedding, vector: quantizeV4Vector(embedding.vector) })).sort((a, b) => a.chunkId.localeCompare(b.chunkId));
23325
23336
  const chunksDigest = sha2562(chunks);
23326
23337
  const embeddingsDigest = sha2562(embeddings);
23327
23338
  const artifact = (kind, digest) => {
@@ -23649,6 +23660,41 @@ var import_node_os12 = require("node:os");
23649
23660
  var import_node_path25 = require("node:path");
23650
23661
  var import_node_child_process14 = require("node:child_process");
23651
23662
 
23663
+ // ../infra/src/repo-index-roster.ts
23664
+ var ORG2 = "mutmutco";
23665
+ function normalizeRepoIndexRepo(raw) {
23666
+ if (typeof raw !== "string") return null;
23667
+ const value = raw.trim().replace(/\.git$/, "");
23668
+ if (!value) return null;
23669
+ if (value.includes("/")) {
23670
+ const [owner, name, ...rest] = value.split("/");
23671
+ if (!owner || !name || rest.length) return null;
23672
+ return `${owner.toLowerCase()}/${name.toLowerCase()}`;
23673
+ }
23674
+ if (!/^[A-Za-z0-9._-]+$/.test(value)) return null;
23675
+ return `${ORG2}/${value.toLowerCase()}`;
23676
+ }
23677
+ function repoIndexRepoIsEligible(project2, repo) {
23678
+ const normalized = normalizeRepoIndexRepo(repo);
23679
+ if (!normalized || project2.class === "content") return false;
23680
+ return !(project2.repoIndexExcludedRepos ?? []).some(
23681
+ (excluded) => normalizeRepoIndexRepo(excluded) === normalized
23682
+ );
23683
+ }
23684
+ function repoIndexRoster(projects) {
23685
+ const excluded = new Set(
23686
+ projects.flatMap((project2) => project2.repoIndexExcludedRepos ?? []).map(normalizeRepoIndexRepo).filter((repo) => repo !== null)
23687
+ );
23688
+ const roster = /* @__PURE__ */ new Set();
23689
+ for (const project2 of projects) {
23690
+ for (const repo of project2.repos ?? []) {
23691
+ const normalized = normalizeRepoIndexRepo(repo);
23692
+ if (normalized && repoIndexRepoIsEligible(project2, normalized) && !excluded.has(normalized)) roster.add(normalized);
23693
+ }
23694
+ }
23695
+ return roster;
23696
+ }
23697
+
23652
23698
  // src/repo-index-v4/edges.ts
23653
23699
  var import_node_fs26 = require("node:fs");
23654
23700
  var import_node_path24 = require("node:path");
@@ -23753,20 +23799,12 @@ function buildGraphEdges(cwd, repo, commit, rosterRepos2) {
23753
23799
  // src/repo-index-sync.ts
23754
23800
  var MAX_EMBED_BACKFILL_ROUNDS = 40;
23755
23801
  function normalizeRepo(raw) {
23756
- const t = raw.trim().replace(/\.git$/, "");
23757
- if (t.includes("/")) {
23758
- const [owner, name] = t.split("/");
23759
- return `${(owner || "").toLowerCase()}/${(name || "").toLowerCase()}`;
23760
- }
23761
- return `mutmutco/${t.toLowerCase()}`;
23802
+ const normalized = normalizeRepoIndexRepo(raw);
23803
+ if (!normalized) throw new Error(`invalid repository: ${raw}`);
23804
+ return normalized;
23762
23805
  }
23763
23806
  function rosterRepos(projects) {
23764
- const set = /* @__PURE__ */ new Set();
23765
- for (const p of projects) {
23766
- if (p.class === "content") continue;
23767
- for (const r of p.repos ?? []) set.add(normalizeRepo(r));
23768
- }
23769
- return [...set].sort((a, b) => a.localeCompare(b));
23807
+ return [...repoIndexRoster(projects)].sort((a, b) => a.localeCompare(b));
23770
23808
  }
23771
23809
  function shallowClone(repo, dest, token) {
23772
23810
  const basic = Buffer.from(`x-access-token:${token}`, "utf8").toString("base64");
@@ -24599,7 +24637,7 @@ async function syncProjectInfo(plan, client, apply) {
24599
24637
  }
24600
24638
 
24601
24639
  // src/project-set.ts
24602
- var UNSET_KEYS = ["oauth", "requiredRuntimeSecrets", "requiredBuildSecrets", "tenantTasks", "secrets", "edgeDomains", "requiredGcpApis", "publishRequired", "publishDir", "dsManifestPath", "fofuEnabled", "consumesDesignSystem", "ci", "requiredChecks", "ciExemptReason", "gate", "seedCanary"];
24640
+ var UNSET_KEYS = ["oauth", "requiredRuntimeSecrets", "requiredBuildSecrets", "tenantTasks", "secrets", "edgeDomains", "requiredGcpApis", "publishRequired", "publishDir", "dsManifestPath", "fofuEnabled", "consumesDesignSystem", "ci", "requiredChecks", "ciExemptReason", "gate", "seedCanary", "repoIndexExcludedRepos"];
24603
24641
  var UNSET_KEY_SET = new Set(UNSET_KEYS);
24604
24642
  var RUNTIME_SECRET_STAGES = ["dev", "rc", "main"];
24605
24643
  var SECRET_CONSUMERS = ["runtime", "build", "lambda", "actions", "agent", "box"];
@@ -24970,6 +25008,7 @@ var SETTABLE_VAR_KEYS = [
24970
25008
  "branch",
24971
25009
  "vaultPath",
24972
25010
  "repos",
25011
+ "repoIndexExcludedRepos",
24973
25012
  "oauth",
24974
25013
  "publishRequired",
24975
25014
  "publishDir",
@@ -25005,6 +25044,7 @@ var SETTABLE_VAR_HINTS = {
25005
25044
  runtimeVaultOnly: "true|false",
25006
25045
  seedCanary: "true|false",
25007
25046
  repos: 'JSON array, e.g. ["mutmutco/mm-foo"]',
25047
+ repoIndexExcludedRepos: "JSON array; excludes only these registered repos from repo-index",
25008
25048
  oauth: "JSON {subdomains,domains,callbackPath,fofuSubdomain}",
25009
25049
  requiredGcpApis: "comma-string",
25010
25050
  requiredRuntimeSecrets: 'JSON stage map, e.g. {"dev":["KEY"],"rc":["KEY"],"main":["KEY"]}',
@@ -25096,7 +25136,7 @@ function buildProjectSetPatch(input) {
25096
25136
  patch[key] = parsePortRangeVar(raw);
25097
25137
  } else if (key === "oauth") {
25098
25138
  patch[key] = parseOauthVar(raw);
25099
- } else if (key === "repos") {
25139
+ } else if (key === "repos" || key === "repoIndexExcludedRepos") {
25100
25140
  patch[key] = parseReposVar(raw);
25101
25141
  } else if (key === "publishRequired") {
25102
25142
  patch[key] = parsePublishRequiredVar(raw);
@@ -197,8 +197,12 @@ function listCandidatePaths(cwd, exec = import_node_child_process2.execFileSync)
197
197
  // src/repo-index-v4/language.ts
198
198
  var LANGUAGE_BY_EXTENSION = {
199
199
  ".ts": { name: "typescript", parserName: "typescript" },
200
+ ".mts": { name: "typescript", parserName: "typescript" },
201
+ ".cts": { name: "typescript", parserName: "typescript" },
200
202
  ".tsx": { name: "tsx", parserName: "tsx" },
201
203
  ".js": { name: "javascript", parserName: "javascript" },
204
+ ".mjs": { name: "javascript", parserName: "javascript" },
205
+ ".cjs": { name: "javascript", parserName: "javascript" },
202
206
  ".jsx": { name: "jsx", parserName: "javascript" },
203
207
  ".py": { name: "python", parserName: "python" },
204
208
  ".go": { name: "go", parserName: "go" },
@@ -371,6 +375,7 @@ var import_node_path4 = require("node:path");
371
375
  var V4_MAX_CHUNKS = 1e4;
372
376
  var V4_MAX_ARTIFACT_BYTES = 64 * 1024 * 1024;
373
377
  var V4_EMBED_BATCH = 32;
378
+ var V4_VECTOR_DECIMAL_PLACES = 6;
374
379
  var COMMIT = /^[a-f0-9]{40}$/;
375
380
  function canonicalJson(value) {
376
381
  if (value === null || typeof value !== "object") return JSON.stringify(value);
@@ -381,6 +386,9 @@ function canonicalJson(value) {
381
386
  function sha2562(value) {
382
387
  return (0, import_node_crypto3.createHash)("sha256").update(canonicalJson(value)).digest("hex");
383
388
  }
389
+ function quantizeV4Vector(vector) {
390
+ return vector.map((value) => Number(value.toFixed(V4_VECTOR_DECIMAL_PLACES)));
391
+ }
384
392
  function statePath(cwd) {
385
393
  return repoRuntimeStatePath(cwd, "repo-index", "v4.json");
386
394
  }
@@ -433,14 +441,17 @@ ${chunk.blurb ?? ""}`;
433
441
  var V4_EMBED_TIMEOUT_MS = 15 * 6e4;
434
442
  function runEmbedder(cwd, chunks, modelDirectory, createdAt) {
435
443
  if (!chunks.length) return { embeddings: [] };
436
- const runner = (0, import_node_path4.join)(cwd, "repo-indexer", "src", "batch.mjs");
437
- const fallback = (0, import_node_path4.join)(process.cwd(), "repo-indexer", "src", "batch.mjs");
438
- const file = (0, import_node_fs3.existsSync)(runner) ? runner : fallback;
444
+ const orchestratorRunner = (0, import_node_path4.join)(process.cwd(), "repo-indexer", "src", "batch.mjs");
445
+ const targetRunner = (0, import_node_path4.join)(cwd, "repo-indexer", "src", "batch.mjs");
446
+ const file = (0, import_node_fs3.existsSync)(orchestratorRunner) ? orchestratorRunner : targetRunner;
439
447
  if (!(0, import_node_fs3.existsSync)(file)) return { embeddings: [], reason: "embeddings-unavailable" };
440
448
  const request = { texts: chunks.map((chunk) => ({ id: chunk.id, text: embeddingInput(cwd, chunk) })), maxBatch: V4_EMBED_BATCH };
441
449
  const env = { ...process.env, ...modelDirectory ? { MMI_REPO_INDEXER_MODEL_DIR: modelDirectory } : {} };
442
450
  const result = (0, import_node_child_process3.spawnSync)(process.execPath, [file], { input: JSON.stringify(request), encoding: "utf8", windowsHide: true, timeout: V4_EMBED_TIMEOUT_MS, maxBuffer: V4_MAX_ARTIFACT_BYTES, env });
443
- if (result.error || result.status !== 0) return { embeddings: [], reason: "embeddings-unavailable" };
451
+ if (result.error || result.status !== 0) {
452
+ const detail = result.error?.message ?? result.signal ?? `exit status ${result.status ?? "unknown"}`;
453
+ throw new Error(`repo-index v4 embedding runner failed: ${detail}`);
454
+ }
444
455
  try {
445
456
  const response = JSON.parse(result.stdout);
446
457
  if (!response.ok || !response.provenance || !Array.isArray(response.embeddings)) return { embeddings: [], reason: "embeddings-unavailable" };
@@ -483,7 +494,7 @@ async function buildRepoIndexV4(cwd, repo, opts = {}) {
483
494
  const reusableIds = new Set(reusable.map((e) => e.chunkId));
484
495
  const missing = chunks.filter((chunk) => !reusableIds.has(chunk.id));
485
496
  const generated = missing.length === 0 ? { embeddings: [] } : opts.embed === false ? { embeddings: [], reason: "embeddings-unavailable" } : runEmbedder(cwd, missing, opts.modelDirectory, createdAt);
486
- const embeddings = [...reusable, ...generated.embeddings].sort((a, b) => a.chunkId.localeCompare(b.chunkId));
497
+ const embeddings = [...reusable, ...generated.embeddings].map((embedding) => ({ ...embedding, vector: quantizeV4Vector(embedding.vector) })).sort((a, b) => a.chunkId.localeCompare(b.chunkId));
487
498
  const chunksDigest = sha2562(chunks);
488
499
  const embeddingsDigest = sha2562(embeddings);
489
500
  const artifact = (kind, digest) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mutmutco/cli",
3
- "version": "3.139.3",
3
+ "version": "3.139.4",
4
4
  "description": "MMI Future CLI — the org dev toolbox and shared cross-IDE engine for every registry-declared MMI coding surface.",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",