@moda-ai/cli 1.55.93 → 1.55.95

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.
@@ -36,6 +36,10 @@ import {
36
36
  validateHarnessReport,
37
37
  writeHarnessReportArtifacts
38
38
  } from "./cli-krm4w2v9.js";
39
+ import {
40
+ createCommandContext,
41
+ stringOption
42
+ } from "./cli-13zdcv4w.js";
39
43
  import {
40
44
  assertFlags,
41
45
  assertPositionals,
@@ -45,10 +49,6 @@ import {
45
49
  ApiError,
46
50
  callControlAPI
47
51
  } from "./cli-dxajrq9h.js";
48
- import {
49
- createCommandContext,
50
- stringOption
51
- } from "./cli-13zdcv4w.js";
52
52
  import {
53
53
  EXIT_DEGRADED,
54
54
  embeddedTenantIdFromApiKey,
@@ -2029,6 +2029,13 @@ function classesInType(type, checker, out = []) {
2029
2029
  out.push(cls);
2030
2030
  for (const argument of type.typeArguments ?? [])
2031
2031
  classesInType(argument, checker, out);
2032
+ } else if (import_typescript3.default.isImportTypeNode(type) && type.qualifier) {
2033
+ const name = import_typescript3.default.isQualifiedName(type.qualifier) ? type.qualifier.right : type.qualifier;
2034
+ const cls = classOfDeclaration(valueDeclaration(resolvedSymbol(name, checker)));
2035
+ if (cls)
2036
+ out.push(cls);
2037
+ for (const argument of type.typeArguments ?? [])
2038
+ classesInType(argument, checker, out);
2032
2039
  } else if (import_typescript3.default.isUnionTypeNode(type) || import_typescript3.default.isIntersectionTypeNode(type)) {
2033
2040
  for (const member of type.types)
2034
2041
  classesInType(member, checker, out);
@@ -19413,8 +19420,19 @@ class PromptResolver {
19413
19420
  this.maxParamLevels = options.maxParamLevels ?? DEFAULT_MAX_PARAM_LEVELS;
19414
19421
  this.keepAll = options.keepAll === true;
19415
19422
  this.views = Object.entries(options.views ?? {}).map(([name, admits]) => ({ name, admits, refs: new Map }));
19423
+ if (options.viewOf) {
19424
+ const byName = new Map(this.views.map((view) => [view.name, view]));
19425
+ const viewOf = options.viewOf;
19426
+ this.viewFor = (site) => {
19427
+ const view = byName.get(viewOf(site) ?? "");
19428
+ return view && view.admits(site) ? [view] : [];
19429
+ };
19430
+ }
19416
19431
  }
19432
+ viewFor;
19417
19433
  refMaps(walk) {
19434
+ if (this.viewFor)
19435
+ return [this.refs, ...this.viewFor(walk.site).map((view) => view.refs)];
19418
19436
  return this.views.length ? [this.refs, ...this.views.filter((view) => view.admits(walk.site)).map((view) => view.refs)] : [this.refs];
19419
19437
  }
19420
19438
  resolveArgument(site, role, node, project = []) {
@@ -20515,7 +20533,16 @@ class PromptResolver {
20515
20533
  }
20516
20534
  return;
20517
20535
  }
20536
+ declarationsByNode = new WeakMap;
20518
20537
  declarationsOf(node) {
20538
+ const cached = this.declarationsByNode.get(node);
20539
+ if (cached)
20540
+ return cached;
20541
+ const declarations = this.lookupDeclarations(node);
20542
+ this.declarationsByNode.set(node, declarations);
20543
+ return declarations;
20544
+ }
20545
+ lookupDeclarations(node) {
20519
20546
  const path = this.relative(node.getSourceFile().fileName);
20520
20547
  const checker = this.context.checkerFor(path);
20521
20548
  if (!checker)
@@ -20955,6 +20982,8 @@ var HARNESS_FAMILY_FLAGS = [
20955
20982
  "no-remote",
20956
20983
  "offset",
20957
20984
  "out",
20985
+ "diff",
20986
+ "calls",
20958
20987
  "path",
20959
20988
  "promote",
20960
20989
  "remote",
@@ -20980,10 +21009,30 @@ async function runHarnessCommand(context) {
20980
21009
  if (context.dryRun && !HARNESS_DRY_RUN_SUBCOMMANDS.has(subcommand)) {
20981
21010
  throw new CliInputError(`'moda harness ${subcommand}' has no dry-run mode, so nothing was sent.`, `Remove --dry-run to run it for real. Harness commands with a real dry-run: ${[...HARNESS_DRY_RUN_SUBCOMMANDS].join(", ")}.`);
20982
21011
  }
21012
+ if (subcommand === "skeleton" || subcommand === "skeleton-diff") {
21013
+ const { runSkeletonCommand } = await import("./cli-gcqpbes6.js");
21014
+ return runSkeletonCommand(context);
21015
+ }
20983
21016
  if (subcommand === "register")
20984
21017
  return runHarnessRegister(context);
20985
21018
  if (subcommand === "registration")
20986
21019
  return runHarnessRegistration(context);
21020
+ if (subcommand === "impact") {
21021
+ assertFlags("harness impact", context.flags, ["path", "from", "to", "diff", "calls"]);
21022
+ assertPositionals("harness impact", context.positionals, 1, "moda harness impact --from=<commit> --to=<commit>");
21023
+ if (!context.flags.from)
21024
+ throw new CliInputError("harness impact requires --from=<old-commit>.");
21025
+ const { localChangeImpact, readRecordedImpactCalls } = await import("./change-impact-3n23nhd8.js");
21026
+ const result = localChangeImpact({
21027
+ checkout: resolve10(context.cwd, context.flags.path ?? "."),
21028
+ from: context.flags.from,
21029
+ to: context.flags.to,
21030
+ diff: context.flags.diff ? readFileSync14(resolve10(context.cwd, context.flags.diff), "utf8") : undefined,
21031
+ calls: context.flags.calls ? readRecordedImpactCalls(resolve10(context.cwd, context.flags.calls)) : undefined
21032
+ });
21033
+ context.output.writeData(result);
21034
+ return { exitCode: 0 };
21035
+ }
20987
21036
  const rootDir = resolve10(context.cwd, context.flags.path ?? ".");
20988
21037
  const selectedAgentId = selectedRuntimeAgentId(context.flags);
20989
21038
  const tenant = resolveHarnessTenant(context.flags, context);
@@ -21203,7 +21252,7 @@ async function runHarnessCommand(context) {
21203
21252
  }
21204
21253
  await confirmHarnessDelete(context, idOrKey);
21205
21254
  const response = await callControlAPI(`/harnesses/${encodeURIComponent(idOrKey)}`, { method: "DELETE" }, profileOptions);
21206
- writeHumanProgress(context, `Deleted harness ${response.harnessKey ?? idOrKey} from tenant ${response.tenantId ?? "unknown"} ` + `(${response.deleted?.versions ?? 0} versions, ${response.deleted?.agents ?? 0} agents, ` + `${response.deleted?.artifacts ?? 0} artifacts, ${response.deleted?.relationships ?? 0} relationships).`);
21255
+ writeHumanProgress(context, `Deleted harness ${response.harnessKey ?? idOrKey} from tenant ${response.tenantId ?? "unknown"} (${response.deleted?.versions ?? 0} versions, ${response.deleted?.agents ?? 0} agents, ${response.deleted?.artifacts ?? 0} artifacts, ${response.deleted?.relationships ?? 0} relationships).`);
21207
21256
  context.output.writeData({ ...response, dryRun: false });
21208
21257
  return { exitCode: 0 };
21209
21258
  }
@@ -21245,7 +21294,7 @@ async function runHarnessCommand(context) {
21245
21294
  throw new CliInputError("Focused remote prompt analysis is not supported yet.", "Use local --analyst=claude|codex|cursor|local-scan, or drop --concern for a full remote report.");
21246
21295
  }
21247
21296
  if (context.flags["github-actions"] === "true") {
21248
- const { runGithubActionsAnalyze } = await import("./harness-github-actions-3m6k2a71.js");
21297
+ const { runGithubActionsAnalyze } = await import("./harness-github-actions-h9b973z0.js");
21249
21298
  const result = await runGithubActionsAnalyze(rootDir, {
21250
21299
  writeReport: (report2) => {
21251
21300
  const normalized = normalizeHarnessReport(report2);
@@ -21396,8 +21445,8 @@ async function runHarnessCommand(context) {
21396
21445
  }
21397
21446
  const { artifacts, unknowns, canonicalAgentIdentities } = deterministicGraphItems(rootDir, promote === "all" ? undefined : promote);
21398
21447
  tagComponentStatus({ runtimeAgents: [], artifacts }, rootDir);
21399
- const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-dcsgqzfr.js");
21400
- const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-ekdmgbb6.js");
21448
+ const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-0na4ydkc.js");
21449
+ const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-zp7y6mft.js");
21401
21450
  let components = { runtimeAgents: [], artifacts: [], warnings: [] };
21402
21451
  if (promote === "all" || promote === "topology" || promote === "tools") {
21403
21452
  const { result, ctx } = extractHarnessWithContext2(rootDir);
@@ -21469,8 +21518,8 @@ async function runHarnessCommand(context) {
21469
21518
  }
21470
21519
  case "extract": {
21471
21520
  writeHumanProgress(context, "Harness extract: tracing model call sites (no LLM, no network)...");
21472
- const { extractHarnessWithContext: extractHarnessWithContext2, serializeExtractResult } = await import("./index-dcsgqzfr.js");
21473
- const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-ekdmgbb6.js");
21521
+ const { extractHarnessWithContext: extractHarnessWithContext2, serializeExtractResult } = await import("./index-0na4ydkc.js");
21522
+ const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-zp7y6mft.js");
21474
21523
  const { result, ctx } = extractHarnessWithContext2(rootDir, { fresh: true });
21475
21524
  const items = deterministicGraphItems(rootDir);
21476
21525
  const artifacts = items.artifacts;
@@ -21604,7 +21653,7 @@ async function runHarnessCommand(context) {
21604
21653
  return { exitCode: 0 };
21605
21654
  }
21606
21655
  default:
21607
- throw new CliInputError(`Unknown harness command '${subcommand}'.`, "Usage: moda harness analyze|pull|validate-report|approve|scan|candidates|extract|sync|delete|list|show|versions|diff|agents|graph|explain|write-summary|status|register|registration");
21656
+ throw new CliInputError(`Unknown harness command '${subcommand}'.`, "Usage: moda harness analyze|pull|validate-report|approve|scan|candidates|extract|skeleton|skeleton-diff|sync|delete|list|show|versions|diff|agents|graph|explain|write-summary|status|register|registration");
21608
21657
  }
21609
21658
  }
21610
21659
  function writeHarnessAnalyzeResult(context, payload) {
@@ -22377,8 +22426,8 @@ var CONCERN_PROMOTED_ARTIFACT_TYPES = {
22377
22426
  evals: new Set(["model_config", "eval"])
22378
22427
  };
22379
22428
  async function deterministicFloorGraph(rootDir, options = {}) {
22380
- const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-dcsgqzfr.js");
22381
- const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-ekdmgbb6.js");
22429
+ const { extractHarnessWithContext: extractHarnessWithContext2 } = await import("./index-0na4ydkc.js");
22430
+ const { enumerateHarnessComponents, mergeEnumeratedComponents } = await import("./index-zp7y6mft.js");
22382
22431
  const { result, ctx } = extractHarnessWithContext2(rootDir);
22383
22432
  const items = deterministicGraphItems(rootDir);
22384
22433
  const components = mergeEnumeratedComponents(items.artifacts, enumerateHarnessComponents(result, ctx));
@@ -28806,7 +28855,7 @@ function normalizedModels(ctx, roles = []) {
28806
28855
  }
28807
28856
  return { rewritten: out, outputs: served, spans };
28808
28857
  }
28809
- function collectModels(result, ctx) {
28858
+ function collectModels(result, ctx, options = {}) {
28810
28859
  const byId = new Map;
28811
28860
  const add = (id, resolution, at, site) => {
28812
28861
  let entry = byId.get(id);
@@ -28930,7 +28979,7 @@ function collectModels(result, ctx) {
28930
28979
  resolution: entry.resolution,
28931
28980
  definition: definitions[0],
28932
28981
  ...definitions.length > 1 ? { otherDefinitions: definitions.slice(1, 8) } : {},
28933
- calledFrom: sites.slice(0, MAX_CALLED_FROM).map((site) => ({
28982
+ calledFrom: sites.slice(0, options.maxCalledFrom ?? MAX_CALLED_FROM).map((site) => ({
28934
28983
  callSite: site.id,
28935
28984
  path: site.path,
28936
28985
  line: site.line,
@@ -29893,14 +29942,17 @@ function emitTools(result, ctx) {
29893
29942
  }
29894
29943
  }
29895
29944
  for (const property of object.properties) {
29896
- if (!import_typescript14.default.isPropertyAssignment(property) || !isToolValue(property.initializer, checker))
29945
+ if (!import_typescript14.default.isPropertyAssignment(property) && !import_typescript14.default.isShorthandPropertyAssignment(property))
29946
+ continue;
29947
+ const initializer = import_typescript14.default.isPropertyAssignment(property) ? property.initializer : property.name;
29948
+ if (!isToolValue(initializer, checker))
29897
29949
  continue;
29898
29950
  const list = import_typescript14.default.isComputedPropertyName(property.name) ? names(property.name.expression) : [propertyNameText(property.name)].filter((key) => Boolean(key));
29899
29951
  if (list.length === 0)
29900
29952
  continue;
29901
29953
  const agents = owners.ownersOf(property, program);
29902
- const options = toolOptions(property.initializer);
29903
- const definitions = definitionNodes(property.initializer, checker);
29954
+ const options = toolOptions(initializer);
29955
+ const definitions = definitionNodes(initializer, checker);
29904
29956
  for (const name of list)
29905
29957
  for (const definition of definitions)
29906
29958
  add(name, "record", at(property, "tools record key"), agents, definition, options ? displayNameOf(options, tracer) : undefined, enclosingName(property));
@@ -30413,8 +30465,15 @@ var MAX_HELPER_CALLERS = 200;
30413
30465
  var MAX_DERIVED = 5000;
30414
30466
  var MAX_CALLER_CHAIN = 3;
30415
30467
  var cache2 = new Map;
30416
- function clearExtractCache() {
30417
- cache2.clear();
30468
+ function clearExtractCache(rootDir) {
30469
+ if (rootDir === undefined)
30470
+ cache2.clear();
30471
+ else {
30472
+ const prefix = `${resolve14(rootDir)}\x00`;
30473
+ for (const key of cache2.keys())
30474
+ if (key.startsWith(prefix))
30475
+ cache2.delete(key);
30476
+ }
30418
30477
  }
30419
30478
  function extractHarness(rootDir, options = {}) {
30420
30479
  return extractHarnessWithContext(rootDir, options).result;
@@ -30956,4 +31015,4 @@ function assignAgentIds(result, agentForScope) {
30956
31015
  }
30957
31016
  }
30958
31017
 
30959
- export { unwrap, enclosingClass, returnExpressions, importOrigin, resolvedSymbol, valueDeclaration, EXTRACT_SCHEMA_VERSION, valueChildren, selectKey, allValues, renderings, frameworkBaseOf, createFrameworkMemo, CALL_SINKS, registerCallSink, registerClassSink, checkPromptMapping, safePromptEvidencePath, discoverHarnessPromptSources, isModelId, collectModels, modelArtifacts, modelUnknowns, collectModelLiterals, TEST_PATH2 as TEST_PATH, EVAL_PATH2 as EVAL_PATH, enumerationRepository, nameOf, visit, componentId, artifact, emptyResult, stableResult, toolNamesOf, surfaceOf, emitToolsCached, workspacePackages, toolArtifacts, clearExtractCache, extractHarness, extractHarnessWithContext, extractFingerprint, scopeOf, serializeExtractResult, assignAgentIds, createAgentScopeResolver, enumerateAgents, startRemoteAnalyze, pollRemoteAnalyzeUntilDone, isRecoverableRemoteRun, runHarnessCommand, writeHarnessAnalyzeResult, emitWrittenArtifacts, analyzeHarnessPrompts, isToolGroupPlaceholder, deterministicOnlyArtifactTypes, repairExternalAnalystReport, deriveRelationshipsFromGraph, deterministicFloorGraph, deterministicArtifacts, deterministicGraphItems, mergeDeterministicArtifacts, analystRefutations, describeCodingAgentEvent, analystEventProgress, isRetryableExternalAnalystFailure, sleep, summarizeInvalidAnalystReport, isDeterministicLocalAnalyst, resolveHarnessAnalyzeConcern, resolveExternalHarnessAnalystInvocation, detectAvailableCodingAgents, codingAgentDisplayName, runCodingAgent, readOnlyClaudeExtraArgs, resolveAnalystModel, renderExternalHarnessAnalystPrompt, CONCERN_CANDIDATE_KINDS, SEED_CANDIDATE_KIND_LABELS, renderAnalystCandidateLines, renderAnalystSeedLines, truncateText, scanHarness, summarizeHarness, buildSourceSnapshot, writeHumanProgress, describeSyncIdentity, describeSyncTenantLabel, findFresherHarnessReports, writeHarnessArtifacts, assertHarnessGraphSyncQuality, graphForSync, inventoryFiles, numericEnv, numericEnvAllowZero, computeDeterministicFloor, stableId, titleFromId, promptNameFromPath };
31018
+ export { svelteVirtualName, relPath, lineOf, unwrap, propertyNameText, calleeChain, isFunctionLike, enclosingFunction, functionName, enclosingClass, returnExpressions, importOrigin, resolvedSymbol, valueDeclaration, isTestPath, isEvalPath, EXTRACT_SCHEMA_VERSION, valueChildren, selectKey, allValues, renderings, receiverClasses, frameworkBaseOf, createFrameworkMemo, CALL_SINKS, registerCallSink, registerClassSink, evalFileSignal, evalSuiteKey, checkPromptMapping, safePromptEvidencePath, discoverHarnessPromptSources, isModelId, collectModels, modelArtifacts, modelUnknowns, collectModelLiterals, parse, TEST_PATH2 as TEST_PATH, EVAL_PATH2 as EVAL_PATH, enumerationRepository, nameOf, visit, componentId, artifact, emptyResult, stableResult, toolNamesOf, surfaceOf, emitToolsCached, workspacePackages, toolArtifacts, clearExtractCache, extractHarness, extractHarnessWithContext, extractFingerprint, scopeOf, serializeExtractResult, assignAgentIds, createAgentScopeResolver, enumerateAgents, startRemoteAnalyze, pollRemoteAnalyzeUntilDone, isRecoverableRemoteRun, resolvePromptArguments, runHarnessCommand, writeHarnessAnalyzeResult, emitWrittenArtifacts, analyzeHarnessPrompts, isToolGroupPlaceholder, deterministicOnlyArtifactTypes, repairExternalAnalystReport, deriveRelationshipsFromGraph, deterministicFloorGraph, deterministicArtifacts, deterministicGraphItems, mergeDeterministicArtifacts, analystRefutations, describeCodingAgentEvent, analystEventProgress, isRetryableExternalAnalystFailure, sleep, summarizeInvalidAnalystReport, isDeterministicLocalAnalyst, resolveHarnessAnalyzeConcern, resolveExternalHarnessAnalystInvocation, detectAvailableCodingAgents, codingAgentDisplayName, runCodingAgent, readOnlyClaudeExtraArgs, resolveAnalystModel, renderExternalHarnessAnalystPrompt, CONCERN_CANDIDATE_KINDS, SEED_CANDIDATE_KIND_LABELS, renderAnalystCandidateLines, renderAnalystSeedLines, truncateText, scanHarness, summarizeHarness, buildSourceSnapshot, writeHumanProgress, describeSyncIdentity, describeSyncTenantLabel, findFresherHarnessReports, writeHarnessArtifacts, assertHarnessGraphSyncQuality, graphForSync, inventoryFiles, numericEnv, numericEnvAllowZero, computeDeterministicFloor, stableId, titleFromId, promptNameFromPath };