opencode-swarm 7.146.5 → 7.147.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.
Files changed (48) hide show
  1. package/dist/cli/{ast-diff-wbjcazfx.js → ast-diff-665tewz6.js} +1 -1
  2. package/dist/cli/{config-doctor-28e6h9ex.js → config-doctor-7a2z00qt.js} +2 -2
  3. package/dist/cli/{core-n57ssze0.js → core-50jqqm4g.js} +1 -1
  4. package/dist/cli/{curator-e6p9vysv.js → curator-3t7e3hf9.js} +18 -18
  5. package/dist/cli/{curator-llm-factory-bzvv3grb.js → curator-llm-factory-7cm4494k.js} +18 -18
  6. package/dist/cli/{evidence-summary-service-b2xp0m26.js → evidence-summary-service-8n16gxgm.js} +6 -6
  7. package/dist/cli/{gate-evidence-fmbx6hp1.js → gate-evidence-496qt72z.js} +2 -2
  8. package/dist/cli/{guardrail-explain-g1nqbz0j.js → guardrail-explain-my9zj5pj.js} +19 -19
  9. package/dist/cli/{guardrail-log-1bbg0vx4.js → guardrail-log-dy9b5qtt.js} +3 -3
  10. package/dist/cli/{hive-promoter-trew6apr.js → hive-promoter-mspppqbp.js} +18 -18
  11. package/dist/cli/{index-ymyv4d36.js → index-15twmgzf.js} +20 -20
  12. package/dist/cli/{index-fymrwjak.js → index-20ndbsmh.js} +3 -3
  13. package/dist/cli/{index-55g08cg2.js → index-6c17bqbj.js} +5 -5
  14. package/dist/cli/{index-npw2xm46.js → index-92r9z3yk.js} +538 -82
  15. package/dist/cli/{index-7pggq9ys.js → index-a3fky5pd.js} +1 -1
  16. package/dist/cli/{index-vjkfhqef.js → index-argd4rp4.js} +1 -1
  17. package/dist/cli/{index-0pya01vw.js → index-at1m1k5k.js} +3 -3
  18. package/dist/cli/{index-7sy3aa9m.js → index-b43rt5ph.js} +3 -3
  19. package/dist/cli/{index-fjhc8mk2.js → index-b67y7an8.js} +1 -1
  20. package/dist/cli/{index-53asfj0j.js → index-bgefx261.js} +1 -1
  21. package/dist/cli/{index-zqmzn9hk.js → index-er61pycf.js} +4 -4
  22. package/dist/cli/{index-hn0hvgtt.js → index-hmssmyvh.js} +1 -1
  23. package/dist/cli/{index-cpzra8my.js → index-k5ng170v.js} +1 -1
  24. package/dist/cli/{index-52460nma.js → index-mdwvn7qe.js} +2 -2
  25. package/dist/cli/{index-gqx0rq53.js → index-mfmegbz2.js} +1 -1
  26. package/dist/cli/{index-p4ar0k0n.js → index-ms46zgwb.js} +2 -2
  27. package/dist/cli/{index-aybph866.js → index-pna97bbk.js} +3 -3
  28. package/dist/cli/{index-rqgnad5w.js → index-sh8xbyca.js} +1 -1
  29. package/dist/cli/{index-ktpj357z.js → index-tya6ytex.js} +1 -1
  30. package/dist/cli/{index-cp8jp4cv.js → index-w4ybhzyg.js} +3 -3
  31. package/dist/cli/{index-cyxdm0v3.js → index-yjvtk1w2.js} +2 -2
  32. package/dist/cli/{index-d3t7q4b8.js → index-yq1fxahj.js} +1 -1
  33. package/dist/cli/index.js +18 -18
  34. package/dist/cli/{knowledge-escalator-dyrrftth.js → knowledge-escalator-7gw36zj8.js} +6 -6
  35. package/dist/cli/{knowledge-events-hqrwgn29.js → knowledge-events-r1xak0yw.js} +4 -4
  36. package/dist/cli/{knowledge-store-fn7whe2j.js → knowledge-store-wzzke013.js} +1 -1
  37. package/dist/cli/{knowledge-validator-6zb1j8c4.js → knowledge-validator-mma2bbgp.js} +2 -2
  38. package/dist/cli/{scan-cursor-m04qgx82.js → scan-cursor-0vcx58aa.js} +2 -2
  39. package/dist/cli/{schema-40w13gdv.js → schema-qr135rxc.js} +1 -1
  40. package/dist/cli/{scope-persistence-fz2r889v.js → scope-persistence-x7v9mb9k.js} +4 -4
  41. package/dist/cli/{skill-generator-413k36q9.js → skill-generator-aee04dwa.js} +7 -7
  42. package/dist/cli/{worktree-isolation-50afhbga.js → worktree-isolation-ar52a7xr.js} +18 -18
  43. package/dist/index.js +25 -8
  44. package/dist/lang/symbol-visibility.d.ts +13 -0
  45. package/dist/tools/repo-graph/builder.d.ts +19 -0
  46. package/dist/tools/repo-graph/ontology.d.ts +23 -0
  47. package/dist/tools/repo-graph/types.d.ts +34 -6
  48. package/package.json +1 -1
@@ -9,13 +9,13 @@ import {
9
9
  } from "./index-hcb25p12.js";
10
10
  import {
11
11
  stableCanonicalStringify
12
- } from "./index-fjhc8mk2.js";
12
+ } from "./index-b67y7an8.js";
13
13
  import {
14
14
  detectStraySwarmDirs,
15
15
  readDoctorArtifact,
16
16
  removeStraySwarmDir,
17
17
  runConfigDoctor
18
- } from "./index-d3t7q4b8.js";
18
+ } from "./index-yq1fxahj.js";
19
19
  import {
20
20
  MAX_TRANSIENT_RETRIES,
21
21
  archiveEvidence,
@@ -61,7 +61,7 @@ import {
61
61
  updateTaskStatus,
62
62
  validateProjectRoot,
63
63
  validateSymlinkBoundary
64
- } from "./index-0pya01vw.js";
64
+ } from "./index-at1m1k5k.js";
65
65
  import {
66
66
  EvaluationTaskV1Schema,
67
67
  GateAuditManifestV1Schema,
@@ -104,12 +104,12 @@ import {
104
104
  } from "./index-y8552snf.js";
105
105
  import {
106
106
  readRecentEscalations
107
- } from "./index-55g08cg2.js";
107
+ } from "./index-6c17bqbj.js";
108
108
  import {
109
109
  alreadyCuratedThisGeneration,
110
110
  claimNextScanBatch,
111
111
  resolveCohortId
112
- } from "./index-ktpj357z.js";
112
+ } from "./index-tya6ytex.js";
113
113
  import {
114
114
  CURATOR_INIT_PROMPT,
115
115
  CURATOR_PHASE_PROMPT,
@@ -179,7 +179,7 @@ import {
179
179
  retireSkill,
180
180
  selectCandidateEntries,
181
181
  syncBundledProjectSkillsIfMissingAsync
182
- } from "./index-fymrwjak.js";
182
+ } from "./index-20ndbsmh.js";
183
183
  import {
184
184
  appendUnactionable,
185
185
  quarantineEntry,
@@ -190,7 +190,7 @@ import {
190
190
  validateActionableFields,
191
191
  validateLesson,
192
192
  validateSkillPath
193
- } from "./index-53asfj0j.js";
193
+ } from "./index-bgefx261.js";
194
194
  import {
195
195
  authorizeCuration,
196
196
  buildConfigFingerprintInput
@@ -247,18 +247,18 @@ import {
247
247
  transitionTaskWorkflowEvidence,
248
248
  withTaskEvidenceTransaction,
249
249
  writeWorkflowWalFile
250
- } from "./index-vjkfhqef.js";
250
+ } from "./index-argd4rp4.js";
251
251
  import {
252
252
  provisionWorktree,
253
253
  removeWorktree
254
- } from "./index-cpzra8my.js";
254
+ } from "./index-k5ng170v.js";
255
255
  import {
256
256
  MAX_PENDING_SCOPE_BINDINGS,
257
257
  canonicalWorkspaceIdentity,
258
258
  clearAllScopes,
259
259
  clearScopeBindingFromDisk,
260
260
  clearScopeBindings
261
- } from "./index-p4ar0k0n.js";
261
+ } from "./index-ms46zgwb.js";
262
262
  import {
263
263
  appendLedgerEvent,
264
264
  computePlanHash,
@@ -273,14 +273,14 @@ import {
273
273
  readPlanEpochIdentity,
274
274
  replayFromLedgerWithStatus,
275
275
  takeSnapshotEvent
276
- } from "./index-hn0hvgtt.js";
276
+ } from "./index-hmssmyvh.js";
277
277
  import {
278
278
  isPathWithinDeclaredScope,
279
279
  sanitizeDiagnosticText
280
280
  } from "./index-556ja8an.js";
281
281
  import {
282
282
  getLanguageForExtension
283
- } from "./index-7sy3aa9m.js";
283
+ } from "./index-b43rt5ph.js";
284
284
  import {
285
285
  withTimeout,
286
286
  yieldToEventLoop
@@ -324,7 +324,7 @@ import {
324
324
  transactFile,
325
325
  transactKnowledge,
326
326
  wordBigrams
327
- } from "./index-zqmzn9hk.js";
327
+ } from "./index-er61pycf.js";
328
328
  import {
329
329
  MAX_EVENT_LOG_ENTRIES,
330
330
  _internals as _internals2,
@@ -338,10 +338,10 @@ import {
338
338
  recordKnowledgeEvent,
339
339
  recordPhaseCloseIntent,
340
340
  resolveKnowledgeEventsPath
341
- } from "./index-cp8jp4cv.js";
341
+ } from "./index-w4ybhzyg.js";
342
342
  import {
343
343
  resolveWorktreeIsolationConfig
344
- } from "./index-cyxdm0v3.js";
344
+ } from "./index-yjvtk1w2.js";
345
345
  import {
346
346
  RetrospectiveEvidenceSchema
347
347
  } from "./index-gprxjmm7.js";
@@ -351,7 +351,7 @@ import {
351
351
  init_loader,
352
352
  loadPluginConfig,
353
353
  loadPluginConfigWithMeta
354
- } from "./index-gqx0rq53.js";
354
+ } from "./index-mfmegbz2.js";
355
355
  import {
356
356
  DEFAULT_SKILL_OPT_CONFIG,
357
357
  FALLBACK_MODELS_MAX,
@@ -365,7 +365,7 @@ import {
365
365
  package_default,
366
366
  resolveAutoReviewConfig,
367
367
  stripKnownSwarmPrefix
368
- } from "./index-rqgnad5w.js";
368
+ } from "./index-sh8xbyca.js";
369
369
  import {
370
370
  AGENT_TOOL_MAP,
371
371
  ALL_AGENT_NAMES,
@@ -4286,7 +4286,7 @@ async function cleanupRecoveredWorktree(directory, descriptor) {
4286
4286
  awaitingMergeByCallID,
4287
4287
  cleanupStandardWorktreeForCallId,
4288
4288
  standardWorktreeByCallID
4289
- } = await import("./worktree-isolation-50afhbga.js");
4289
+ } = await import("./worktree-isolation-ar52a7xr.js");
4290
4290
  standardWorktreeByCallID.delete(descriptor.callID);
4291
4291
  if (hasResidue)
4292
4292
  awaitingMergeByCallID.set(descriptor.callID, {
@@ -4388,7 +4388,7 @@ async function recoverCoderSettlement(directory, taskId) {
4388
4388
  awaitingMergeByCallID,
4389
4389
  finishStandardWorktreeDispatch,
4390
4390
  standardWorktreeByCallID
4391
- } = await import("./worktree-isolation-50afhbga.js");
4391
+ } = await import("./worktree-isolation-ar52a7xr.js");
4392
4392
  const descriptor = wal.worktree;
4393
4393
  const reconstructedDispatch = {
4394
4394
  callID: descriptor.callID,
@@ -15831,7 +15831,7 @@ function planMerges(active, threshold, maxComparisons, maxMerges) {
15831
15831
  };
15832
15832
  }
15833
15833
  async function sweepActiveNearDuplicates(directory, options = {}) {
15834
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
15834
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-pna97bbk.js");
15835
15835
  const { config } = loadPluginConfigWithMeta2(directory);
15836
15836
  const sweepConfig = config.learning?.dedup_sweep;
15837
15837
  if (sweepConfig?.enabled === false)
@@ -16915,7 +16915,7 @@ async function runCuratorPhase(directory, phase, agentsDispatched, config, knowl
16915
16915
  }
16916
16916
  if (config.skill_generation_enabled === true && skillCandidates.length > 0) {
16917
16917
  try {
16918
- const skillModule = await import("./skill-generator-413k36q9.js");
16918
+ const skillModule = await import("./skill-generator-aee04dwa.js");
16919
16919
  for (const cand of skillCandidates) {
16920
16920
  if (cand.confidence < (config.min_skill_confidence ?? DEFAULT_SKILL_MIN_CONFIDENCE)) {
16921
16921
  continue;
@@ -17375,7 +17375,7 @@ async function applyCuratorKnowledgeUpdates(directory, recommendations, knowledg
17375
17375
  } catch {}
17376
17376
  }
17377
17377
  if (contradictedEntries.length > 0 && knowledgeConfig.contradiction_threshold_action === "quarantine") {
17378
- const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-dyrrftth.js");
17378
+ const { maybeQuarantineOnContradiction } = await import("./knowledge-escalator-7gw36zj8.js");
17379
17379
  for (const { id } of contradictedEntries) {
17380
17380
  try {
17381
17381
  await maybeQuarantineOnContradiction(directory, id, knowledgeConfig.contradiction_quarantine_threshold, knowledgeConfig.contradiction_quarantine_window_days);
@@ -18194,7 +18194,7 @@ async function runCuratorPostMortem(directory, options = {}) {
18194
18194
  warnings.push("Failed to collect knowledge summary.");
18195
18195
  }
18196
18196
  try {
18197
- const { getScanStatus } = await import("./scan-cursor-m04qgx82.js");
18197
+ const { getScanStatus } = await import("./scan-cursor-0vcx58aa.js");
18198
18198
  const scanStatus = await getScanStatus(directory);
18199
18199
  if (scanStatus.remaining_estimate > 0) {
18200
18200
  warnings.push(`Fair scan: reviewed ${knowledgeSummary.length} entries this sweep (generation ${scanStatus.generation}); ${scanStatus.remaining_estimate} more eligible entries will be visited in future curation sweeps.`);
@@ -18366,9 +18366,9 @@ var _internals24 = {
18366
18366
  verifyPostMortemKnowledgeActions,
18367
18367
  repairPostMortemActions,
18368
18368
  loadDefaultKnowledgeConfig: async (directory) => {
18369
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
18369
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qr135rxc.js");
18370
18370
  try {
18371
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
18371
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-pna97bbk.js");
18372
18372
  const loaded = loadPluginConfigWithMeta2(directory);
18373
18373
  return KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
18374
18374
  } catch {
@@ -18376,11 +18376,11 @@ var _internals24 = {
18376
18376
  }
18377
18377
  },
18378
18378
  applyCuratorKnowledgeUpdates: async (directory, recommendations, knowledgeConfig, generation) => {
18379
- const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-e6p9vysv.js");
18379
+ const { applyCuratorKnowledgeUpdates: applyCuratorKnowledgeUpdates2 } = await import("./curator-3t7e3hf9.js");
18380
18380
  return applyCuratorKnowledgeUpdates2(directory, recommendations, knowledgeConfig, generation);
18381
18381
  },
18382
18382
  checkHivePromotions: async (entries, knowledgeConfig, directory) => {
18383
- const { checkHivePromotions } = await import("./hive-promoter-trew6apr.js");
18383
+ const { checkHivePromotions } = await import("./hive-promoter-mspppqbp.js");
18384
18384
  return checkHivePromotions(entries, knowledgeConfig, directory);
18385
18385
  },
18386
18386
  applyProposalTriage: async (directory, triage) => {
@@ -18389,7 +18389,7 @@ var _internals24 = {
18389
18389
  activateProposal,
18390
18390
  listSkills: listSkills2,
18391
18391
  sanitizeSlug
18392
- } = await import("./skill-generator-413k36q9.js");
18392
+ } = await import("./skill-generator-aee04dwa.js");
18393
18393
  const result = {
18394
18394
  approved: [],
18395
18395
  rejected: [],
@@ -19725,9 +19725,9 @@ function hashContent(content) {
19725
19725
  return createHash8("sha1").update(content).digest("hex");
19726
19726
  }
19727
19727
  async function loadConfigForPolicyCurator(directory) {
19728
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
19728
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qr135rxc.js");
19729
19729
  try {
19730
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
19730
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-pna97bbk.js");
19731
19731
  const { config: loadedConfig } = loadPluginConfigWithMeta2(directory);
19732
19732
  return KnowledgeConfigSchema2.parse(loadedConfig.knowledge ?? {});
19733
19733
  } catch {
@@ -30915,7 +30915,7 @@ async function runFinalizeStage(ctx) {
30915
30915
  }
30916
30916
  }
30917
30917
  try {
30918
- const { CuratorConfigSchema: CCS } = await import("./schema-40w13gdv.js");
30918
+ const { CuratorConfigSchema: CCS } = await import("./schema-qr135rxc.js");
30919
30919
  const { config: pmLoadedConfig } = _internals39.loadPluginConfigWithMeta(ctx.directory);
30920
30920
  const curatorCfg = CCS.parse(pmLoadedConfig.curator ?? {});
30921
30921
  if (curatorCfg.enabled && curatorCfg.postmortem_enabled) {
@@ -33108,9 +33108,9 @@ var _internals43 = {
33108
33108
  loadPluginConfigWithMeta,
33109
33109
  loadCuratorDeps: async () => {
33110
33110
  const [{ CuratorConfigSchema }, curator, { createCuratorLLMDelegate: createCuratorLLMDelegate2 }] = await Promise.all([
33111
- import("./schema-40w13gdv.js"),
33112
- import("./curator-e6p9vysv.js"),
33113
- import("./curator-llm-factory-bzvv3grb.js")
33111
+ import("./schema-qr135rxc.js"),
33112
+ import("./curator-3t7e3hf9.js"),
33113
+ import("./curator-llm-factory-7cm4494k.js")
33114
33114
  ]);
33115
33115
  return { CuratorConfigSchema, curator, createCuratorLLMDelegate: createCuratorLLMDelegate2 };
33116
33116
  }
@@ -34064,7 +34064,7 @@ async function computeCurationDiagnostics(directory, entries) {
34064
34064
  let scanCompleted = false;
34065
34065
  let scanRemaining = 0;
34066
34066
  try {
34067
- const { getScanStatus } = await import("./scan-cursor-m04qgx82.js");
34067
+ const { getScanStatus } = await import("./scan-cursor-0vcx58aa.js");
34068
34068
  const status = await getScanStatus(directory);
34069
34069
  scanGeneration = status.generation;
34070
34070
  scanCompleted = status.completed;
@@ -34074,10 +34074,10 @@ async function computeCurationDiagnostics(directory, entries) {
34074
34074
  try {
34075
34075
  const { isLinked: isLinked2 } = await import("./knowledge-link-jkx8xjxp.js");
34076
34076
  if (isLinked2(directory)) {
34077
- const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-40w13gdv.js");
34077
+ const { KnowledgeConfigSchema: KnowledgeConfigSchema2 } = await import("./schema-qr135rxc.js");
34078
34078
  let config;
34079
34079
  try {
34080
- const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-aybph866.js");
34080
+ const { loadPluginConfigWithMeta: loadPluginConfigWithMeta2 } = await import("./index-pna97bbk.js");
34081
34081
  const loaded = loadPluginConfigWithMeta2(directory);
34082
34082
  config = KnowledgeConfigSchema2.parse(loaded.config.knowledge ?? {});
34083
34083
  } catch {
@@ -35360,7 +35360,7 @@ async function handleDoctorCommand(directory, args) {
35360
35360
  const result = runConfigDoctor(config, directory);
35361
35361
  let output;
35362
35362
  if (enableAutoFix && result.hasAutoFixableIssues) {
35363
- const { runConfigDoctorWithFixes } = await import("./config-doctor-28e6h9ex.js");
35363
+ const { runConfigDoctorWithFixes } = await import("./config-doctor-7a2z00qt.js");
35364
35364
  const fixResult = await runConfigDoctorWithFixes(directory, config, true, {
35365
35365
  applyLossy: true
35366
35366
  });
@@ -36300,7 +36300,7 @@ async function handleEvidenceCommand(directory, args) {
36300
36300
  return formatTaskEvidenceMarkdown(evidenceData);
36301
36301
  }
36302
36302
  async function handleEvidenceSummaryCommand(directory) {
36303
- const { buildEvidenceSummary } = await import("./evidence-summary-service-b2xp0m26.js");
36303
+ const { buildEvidenceSummary } = await import("./evidence-summary-service-8n16gxgm.js");
36304
36304
  const artifact = await buildEvidenceSummary(directory);
36305
36305
  if (!artifact) {
36306
36306
  return "No plan found. Run `/swarm plan` to check plan status.";
@@ -44771,6 +44771,27 @@ var PRIVATE_INFO = {
44771
44771
  exportedReason: "unknown",
44772
44772
  apiSurfaceKind: "private"
44773
44773
  };
44774
+ var CONTAINER_SCOPED_GRAMMARS = new Set(["java", "kotlin", "csharp"]);
44775
+ var TYPE_DECLARATION_NODE_TYPES = new Set([
44776
+ "class_declaration",
44777
+ "interface_declaration",
44778
+ "enum_declaration",
44779
+ "record_declaration",
44780
+ "struct_declaration",
44781
+ "object_declaration"
44782
+ ]);
44783
+ function containerScopedDefaultVisibility(grammarId, containerType) {
44784
+ if (containerType === "interface_declaration")
44785
+ return "public";
44786
+ switch (grammarId) {
44787
+ case "kotlin":
44788
+ return "public";
44789
+ case "java":
44790
+ return "package";
44791
+ default:
44792
+ return containerType === undefined ? "internal" : "private";
44793
+ }
44794
+ }
44774
44795
  function collectCommonJsExports(source) {
44775
44796
  const sanitized = maskCommentsAndStrings(source);
44776
44797
  const exportsByLocal = new Map;
@@ -44833,8 +44854,9 @@ function collectPythonAllNames(source) {
44833
44854
  return names;
44834
44855
  }
44835
44856
  function getSymbolVisibilityInfo(ctx) {
44836
- if (hasPrivateContainer(ctx.defNode))
44857
+ if (hasPrivateContainer(ctx.defNode, ctx.grammarId)) {
44837
44858
  return { ...PRIVATE_INFO };
44859
+ }
44838
44860
  if (ctx.explicitExported || ctx.commonJsExport) {
44839
44861
  return {
44840
44862
  exported: true,
@@ -44864,6 +44886,15 @@ function getSymbolVisibilityInfo(ctx) {
44864
44886
  apiSurfaceKind: "public"
44865
44887
  };
44866
44888
  }
44889
+ if (ownVisibility === "unknown" && CONTAINER_SCOPED_GRAMMARS.has(ctx.grammarId)) {
44890
+ const implicit = containerScopedDefaultVisibility(ctx.grammarId, ctx.parentContainerType);
44891
+ return {
44892
+ exported: false,
44893
+ visibility: implicit,
44894
+ exportedReason: "module_public",
44895
+ apiSurfaceKind: implicit === "private" ? "private" : "public"
44896
+ };
44897
+ }
44867
44898
  return {
44868
44899
  exported: false,
44869
44900
  visibility: ownVisibility,
@@ -44879,6 +44910,15 @@ function getSymbolVisibilityInfo(ctx) {
44879
44910
  apiSurfaceKind: ownVisibility === "private" ? "private" : "public"
44880
44911
  };
44881
44912
  }
44913
+ if (!ctx.isTopLevel && CONTAINER_SCOPED_GRAMMARS.has(ctx.grammarId) && TYPE_DECLARATION_NODE_TYPES.has(ctx.defNode.type)) {
44914
+ const nestedVisibility = ownVisibility === "unknown" ? containerScopedDefaultVisibility(ctx.grammarId, ctx.parentContainerType) : ownVisibility;
44915
+ return {
44916
+ exported: false,
44917
+ visibility: nestedVisibility,
44918
+ exportedReason: ownVisibility === "unknown" ? "module_public" : "modifier",
44919
+ apiSurfaceKind: nestedVisibility === "private" ? "private" : "public"
44920
+ };
44921
+ }
44882
44922
  if (!ctx.isTopLevel)
44883
44923
  return { ...PRIVATE_INFO };
44884
44924
  switch (ctx.grammarId) {
@@ -44975,7 +45015,7 @@ function cppVisibility(ctx) {
44975
45015
  };
44976
45016
  }
44977
45017
  function visibilityFromText(grammarId, text) {
44978
- const normalized = declarationPrefix(text).trimStart();
45018
+ const normalized = declarationPrefix(grammarId, text).trimStart();
44979
45019
  if (/\b(private|fileprivate)\b/.test(normalized))
44980
45020
  return "private";
44981
45021
  if (/\bprotected\b/.test(normalized))
@@ -44992,26 +45032,155 @@ function visibilityFromText(grammarId, text) {
44992
45032
  }
44993
45033
  return "unknown";
44994
45034
  }
44995
- function declarationPrefix(text) {
44996
- const bodyStart = text.search(/[{\n]/);
44997
- return bodyStart === -1 ? text : text.slice(0, bodyStart);
45035
+ var ANNOTATED_DECLARATION_GRAMMARS = new Set(["java", "kotlin", "csharp"]);
45036
+ function endOfStringLiteral(text, quote) {
45037
+ const q = text[quote];
45038
+ const verbatim = q === '"' && text[quote - 1] === "@";
45039
+ let i = quote + 1;
45040
+ while (i < text.length) {
45041
+ if (verbatim) {
45042
+ if (text[i] === q) {
45043
+ if (text[i + 1] === q) {
45044
+ i += 2;
45045
+ continue;
45046
+ }
45047
+ return i;
45048
+ }
45049
+ i++;
45050
+ continue;
45051
+ }
45052
+ if (text[i] === "\\") {
45053
+ i += 2;
45054
+ continue;
45055
+ }
45056
+ if (text[i] === q)
45057
+ return i;
45058
+ i++;
45059
+ }
45060
+ return text.length;
45061
+ }
45062
+ function skipBalanced(text, open2, ignoreQuotes = false) {
45063
+ const openCh = text[open2];
45064
+ const closeCh = openCh === "(" ? ")" : "]";
45065
+ let depth = 0;
45066
+ for (let i = open2;i < text.length; i++) {
45067
+ const ch = text[i];
45068
+ if (!ignoreQuotes && (ch === '"' || ch === "'")) {
45069
+ i = endOfStringLiteral(text, i);
45070
+ continue;
45071
+ }
45072
+ if (ch === openCh)
45073
+ depth++;
45074
+ else if (ch === closeCh) {
45075
+ depth--;
45076
+ if (depth === 0)
45077
+ return i + 1;
45078
+ }
45079
+ }
45080
+ return -1;
45081
+ }
45082
+ function skipBalancedResilient(text, open2) {
45083
+ const strict = skipBalanced(text, open2);
45084
+ if (strict !== -1)
45085
+ return strict;
45086
+ return skipBalanced(text, open2, true);
45087
+ }
45088
+ function stripLeadingAnnotations(text) {
45089
+ let i = 0;
45090
+ for (;; ) {
45091
+ while (i < text.length && /\s/.test(text[i]))
45092
+ i++;
45093
+ const ch = text[i];
45094
+ if (ch === "/" && text[i + 1] === "*") {
45095
+ const end = text.indexOf("*/", i + 2);
45096
+ if (end === -1)
45097
+ return "";
45098
+ i = end + 2;
45099
+ continue;
45100
+ }
45101
+ if (ch === "/" && text[i + 1] === "/") {
45102
+ const end = text.indexOf(`
45103
+ `, i + 2);
45104
+ if (end === -1)
45105
+ return "";
45106
+ i = end + 1;
45107
+ continue;
45108
+ }
45109
+ if (ch === "@") {
45110
+ let j = i + 1;
45111
+ while (j < text.length && /[\w.:]/.test(text[j]))
45112
+ j++;
45113
+ let k = j;
45114
+ while (k < text.length && /\s/.test(text[k]))
45115
+ k++;
45116
+ if (text[k] === "(") {
45117
+ const end = skipBalancedResilient(text, k);
45118
+ if (end === -1)
45119
+ return text.slice(i);
45120
+ i = end;
45121
+ } else if (j === i + 1) {
45122
+ i = j;
45123
+ } else {
45124
+ i = j;
45125
+ }
45126
+ continue;
45127
+ }
45128
+ if (ch === "[") {
45129
+ const end = skipBalancedResilient(text, i);
45130
+ if (end === -1)
45131
+ return text.slice(i);
45132
+ i = end;
45133
+ continue;
45134
+ }
45135
+ return text.slice(i);
45136
+ }
45137
+ }
45138
+ function maskStringLiterals(text) {
45139
+ let out = "";
45140
+ for (let i = 0;i < text.length; i++) {
45141
+ const ch = text[i];
45142
+ if (ch !== '"' && ch !== "'") {
45143
+ out += ch;
45144
+ continue;
45145
+ }
45146
+ const end = endOfStringLiteral(text, i);
45147
+ out += ch;
45148
+ out += " ".repeat(Math.max(0, Math.min(end, text.length) - i - 1));
45149
+ if (end < text.length)
45150
+ out += text[end];
45151
+ i = end;
45152
+ }
45153
+ return out;
45154
+ }
45155
+ var HEADER_SCAN_LIMIT = 4096;
45156
+ function declarationPrefix(grammarId, text) {
45157
+ if (!ANNOTATED_DECLARATION_GRAMMARS.has(grammarId)) {
45158
+ const bodyStart2 = text.search(/[{\n]/);
45159
+ return bodyStart2 === -1 ? text : text.slice(0, bodyStart2);
45160
+ }
45161
+ const stripped = stripLeadingAnnotations(text);
45162
+ const window = stripped.length > HEADER_SCAN_LIMIT ? stripped.slice(0, HEADER_SCAN_LIMIT) : stripped;
45163
+ const scanned = maskStringLiterals(window);
45164
+ const bodyStart = scanned.search(/[{\n]/);
45165
+ return bodyStart === -1 ? scanned : scanned.slice(0, bodyStart);
44998
45166
  }
44999
45167
  function defaultModuleVisibility(grammarId) {
45000
45168
  switch (grammarId) {
45001
- case "kotlin":
45002
45169
  case "swift":
45003
45170
  case "csharp":
45004
45171
  return "internal";
45172
+ case "kotlin":
45173
+ return "public";
45005
45174
  case "php":
45006
45175
  return "public";
45007
45176
  default:
45008
45177
  return "public";
45009
45178
  }
45010
45179
  }
45011
- function hasPrivateContainer(node) {
45180
+ function hasPrivateContainer(node, grammarId) {
45012
45181
  let current = node.parent;
45013
45182
  while (current) {
45014
- if (isContainerNode(current) && visibilityFromText("", current.text) === "private") {
45183
+ if (isContainerNode(current) && visibilityFromText(grammarId, current.text) === "private") {
45015
45184
  return true;
45016
45185
  }
45017
45186
  current = current.parent;
@@ -45019,7 +45188,7 @@ function hasPrivateContainer(node) {
45019
45188
  return false;
45020
45189
  }
45021
45190
  function isContainerNode(node) {
45022
- return /(?:class|struct|interface|object|protocol|namespace|module)/.test(node.type);
45191
+ return /(?:class|struct|interface|object|protocol|namespace|module)/.test(node.type) || /^(?:enum|record)_declaration$/.test(node.type);
45023
45192
  }
45024
45193
  function isMemberLikeNode(node) {
45025
45194
  return /(?:method|function)_declaration|function_definition/.test(node.type);
@@ -45118,6 +45287,7 @@ var QUERIES = {
45118
45287
  (lexical_declaration
45119
45288
  (variable_declarator name: (identifier) @const.name)
45120
45289
  ) @const.def
45290
+ (method_definition name: (property_identifier) @method.name) @method.def
45121
45291
  `,
45122
45292
  imports: `
45123
45293
  (import_statement) @import
@@ -45225,12 +45395,21 @@ var QUERIES = {
45225
45395
  (method_declaration
45226
45396
  (identifier) @func.name
45227
45397
  ) @func.def
45398
+ (constructor_declaration
45399
+ (identifier) @ctor.name
45400
+ ) @ctor.def
45228
45401
  (class_declaration
45229
45402
  (identifier) @class.name
45230
45403
  ) @class.def
45231
45404
  (interface_declaration
45232
45405
  (identifier) @interface.name
45233
45406
  ) @interface.def
45407
+ (enum_declaration
45408
+ (identifier) @enum.name
45409
+ ) @enum.def
45410
+ (record_declaration
45411
+ (identifier) @record.name
45412
+ ) @record.def
45234
45413
  `,
45235
45414
  imports: `
45236
45415
  (import_declaration) @import
@@ -45266,9 +45445,12 @@ var QUERIES = {
45266
45445
  csharp: {
45267
45446
  defs: `
45268
45447
  (method_declaration name: (identifier) @func.name) @func.def
45448
+ (constructor_declaration name: (identifier) @ctor.name) @ctor.def
45269
45449
  (class_declaration name: (identifier) @class.name) @class.def
45270
45450
  (interface_declaration name: (identifier) @interface.name) @interface.def
45271
45451
  (struct_declaration name: (identifier) @struct.name) @struct.def
45452
+ (enum_declaration name: (identifier) @enum.name) @enum.def
45453
+ (record_declaration name: (identifier) @record.name) @record.def
45272
45454
  `,
45273
45455
  imports: `
45274
45456
  (using_directive) @import
@@ -45376,7 +45558,9 @@ var CAPTURE_KIND = {
45376
45558
  mod: "type",
45377
45559
  object: "class",
45378
45560
  mixin: "type",
45379
- protocol: "interface"
45561
+ protocol: "interface",
45562
+ record: "class",
45563
+ ctor: "method"
45380
45564
  };
45381
45565
  var DEF_TYPES = new Set([
45382
45566
  "function_declaration",
@@ -45392,6 +45576,8 @@ var DEF_TYPES = new Set([
45392
45576
  "struct_specifier",
45393
45577
  "struct_item",
45394
45578
  "struct_declaration",
45579
+ "record_declaration",
45580
+ "constructor_declaration",
45395
45581
  "method_declaration",
45396
45582
  "type_declaration",
45397
45583
  "object_declaration",
@@ -45410,6 +45596,15 @@ var DEF_TYPES = new Set([
45410
45596
  "method",
45411
45597
  "class"
45412
45598
  ]);
45599
+ var JVM_GRAMMARS = new Set(["java", "kotlin", "csharp"]);
45600
+ var JVM_CONTAINER_TYPES = new Set([
45601
+ "class_declaration",
45602
+ "interface_declaration",
45603
+ "struct_declaration",
45604
+ "object_declaration",
45605
+ "enum_declaration",
45606
+ "record_declaration"
45607
+ ]);
45413
45608
  var PARAM_TYPES = new Set([
45414
45609
  "formal_parameters",
45415
45610
  "required_parameter",
@@ -45488,17 +45683,24 @@ function buildFacts(tree, qs, grammarId) {
45488
45683
  const kindKey = defCap.name.replace(/\.def$/, "");
45489
45684
  const originalDefNode = asTs(defCap.node);
45490
45685
  let defNode = originalDefNode;
45491
- let kind = CAPTURE_KIND[kindKey] ?? "function";
45686
+ let kind = Object.hasOwn(CAPTURE_KIND, kindKey) ? CAPTURE_KIND[kindKey] : "function";
45492
45687
  if (grammarId === "python" && kindKey === "func" && hasAncestorOfType(originalDefNode, "class_definition")) {
45493
45688
  kind = "method";
45494
45689
  }
45495
45690
  if (grammarId === "rust" && kindKey === "func" && hasAncestorOfType(originalDefNode, "impl_item")) {
45496
45691
  kind = "method";
45497
45692
  }
45693
+ let parentContainerType;
45694
+ if (JVM_GRAMMARS.has(grammarId)) {
45695
+ parentContainerType = nearestAncestorType(originalDefNode, JVM_CONTAINER_TYPES);
45696
+ if (parentContainerType !== undefined && (kindKey === "func" || kindKey === "ctor")) {
45697
+ kind = "method";
45698
+ }
45699
+ }
45498
45700
  const explicitExported = exportNodes.some((en) => isNodeInside(en, defNode));
45499
45701
  let isDefaultExport = false;
45500
45702
  if (explicitExported && isEsMGrammar(grammarId)) {
45501
- isDefaultExport = exportNodes.some((en) => isNodeInside(en, defNode) && isDefaultExportStatement(en));
45703
+ isDefaultExport = exportNodes.some((en) => isDefaultExportStatement(en) && isOwnExportDeclaration(en, defNode));
45502
45704
  }
45503
45705
  if (grammarId === "dart" && defNode.type === "function_signature") {
45504
45706
  const rawBody = defNode.nextSibling;
@@ -45545,7 +45747,8 @@ function buildFacts(tree, qs, grammarId) {
45545
45747
  explicitExported,
45546
45748
  commonJsExport,
45547
45749
  pythonAllNames,
45548
- pythonParentClassExported
45750
+ pythonParentClassExported,
45751
+ parentContainerType
45549
45752
  });
45550
45753
  const exportedName = isDefaultExport ? "default" : commonJsExport?.exportedName ?? localName;
45551
45754
  defs.push({
@@ -45670,6 +45873,26 @@ function buildFacts(tree, qs, grammarId) {
45670
45873
  enclosingDecl: findEnclosingDecl(refNode, topLevelDefs)
45671
45874
  });
45672
45875
  }
45876
+ if (isEsMGrammar(grammarId)) {
45877
+ for (const en of exportNodes) {
45878
+ if (!isDefaultExportStatement(en))
45879
+ continue;
45880
+ const owner = en.childForFieldName?.("declaration") ?? en.childForFieldName?.("value");
45881
+ if (!owner)
45882
+ continue;
45883
+ const alreadyNamed = defs.some((d) => d.startLine === owner.startPosition.row + 1 && d.name === "default");
45884
+ if (alreadyNamed)
45885
+ continue;
45886
+ const kind = owner.type.includes("class") ? "class" : "function";
45887
+ defs.push({
45888
+ name: "default",
45889
+ kind,
45890
+ exported: true,
45891
+ startLine: owner.startPosition.row + 1,
45892
+ endLine: owner.endPosition.row + 1
45893
+ });
45894
+ }
45895
+ }
45673
45896
  return { defs, imports, refs };
45674
45897
  }
45675
45898
  function safeMatches(lang, pattern, root) {
@@ -45991,7 +46214,7 @@ function parseGoImportHardened(text) {
45991
46214
  const t = text.trim();
45992
46215
  if (t.startsWith("import ("))
45993
46216
  return null;
45994
- const aliased = t.match(/^([\w._]+)\s+["`]([^"`]+)["`]$/) ?? t.match(/^import\s+([\w._]+)\s+["`]([^"`]+)["`]/);
46217
+ const aliased = t.match(/^(?!import\b)([\w._]+)\s+["`]([^"`]+)["`]$/) ?? t.match(/^import\s+([\w._]+)\s+["`]([^"`]+)["`]/);
45995
46218
  if (aliased) {
45996
46219
  if (aliased[1] === "_") {
45997
46220
  return { specifier: aliased[2], importType: "sideeffect", bindings: [] };
@@ -46018,13 +46241,29 @@ function parseGoImportHardened(text) {
46018
46241
  bindings: []
46019
46242
  };
46020
46243
  }
46244
+ function finalDottedSegment(path71) {
46245
+ const withoutGenerics = path71.replace(/<.*>$/s, "");
46246
+ const lastDot = withoutGenerics.lastIndexOf(".");
46247
+ return lastDot === -1 ? withoutGenerics : withoutGenerics.slice(lastDot + 1);
46248
+ }
46021
46249
  function parseJavaImport(text) {
46022
46250
  const t = text.trim();
46023
- const m = t.match(/^import\s+(?:static\s+)?([^;\s]+)\s*;?\s*$/);
46024
- if (m) {
46025
- return { specifier: m[1], importType: "namespace", bindings: [] };
46026
- }
46027
- return null;
46251
+ const m = t.match(/^import\s+(static\s+)?([^;\s]+)\s*;?\s*$/);
46252
+ if (!m)
46253
+ return null;
46254
+ const isStatic = Boolean(m[1]);
46255
+ const path71 = m[2];
46256
+ const last = finalDottedSegment(path71);
46257
+ if (last === "*") {
46258
+ return { specifier: path71, importType: "namespace", bindings: [] };
46259
+ }
46260
+ const lastDot = path71.lastIndexOf(".");
46261
+ const specifier = isStatic && lastDot !== -1 ? path71.slice(0, lastDot) : path71;
46262
+ return {
46263
+ specifier,
46264
+ importType: "named",
46265
+ bindings: [{ imported: last, local: last }]
46266
+ };
46028
46267
  }
46029
46268
  function parseKotlinImport(text) {
46030
46269
  const t = text.trim();
@@ -46033,30 +46272,39 @@ function parseKotlinImport(text) {
46033
46272
  return {
46034
46273
  specifier: aliased[1],
46035
46274
  importType: "named",
46036
- bindings: [{ imported: aliased[1], local: aliased[2] }]
46275
+ bindings: [
46276
+ { imported: finalDottedSegment(aliased[1]), local: aliased[2] }
46277
+ ]
46037
46278
  };
46038
46279
  }
46039
46280
  const simple = t.match(/^import\s+([^;\s]+)/);
46040
- if (simple) {
46041
- return { specifier: simple[1], importType: "namespace", bindings: [] };
46281
+ if (!simple)
46282
+ return null;
46283
+ const path71 = simple[1];
46284
+ const last = finalDottedSegment(path71);
46285
+ if (last === "*") {
46286
+ return { specifier: path71, importType: "namespace", bindings: [] };
46042
46287
  }
46043
- return null;
46288
+ return {
46289
+ specifier: path71,
46290
+ importType: "named",
46291
+ bindings: [{ imported: last, local: last }]
46292
+ };
46044
46293
  }
46045
46294
  function parseCSharpUsing(text) {
46046
46295
  const t = text.trim();
46047
- const m = t.match(/^using\s+(?:static\s+)?([^=;\s]+)\s*(?:=\s*(.+?))?\s*;?\s*$/);
46048
- if (m) {
46049
- const specifier = m[2] ? m[2].trim() : m[1].trim();
46050
- if (m[2]) {
46051
- return {
46052
- specifier,
46053
- importType: "named",
46054
- bindings: [{ imported: specifier, local: m[1].trim() }]
46055
- };
46056
- }
46057
- return { specifier: m[1].trim(), importType: "namespace", bindings: [] };
46296
+ const m = t.match(/^(?:global\s+)?using\s+(?:static\s+)?([^=;\s]+)\s*(?:=\s*(.+?))?\s*;?\s*$/);
46297
+ if (!m)
46298
+ return null;
46299
+ if (m[2]) {
46300
+ const target = m[2].trim();
46301
+ return {
46302
+ specifier: target,
46303
+ importType: "named",
46304
+ bindings: [{ imported: finalDottedSegment(target), local: m[1].trim() }]
46305
+ };
46058
46306
  }
46059
- return null;
46307
+ return { specifier: m[1].trim(), importType: "namespace", bindings: [] };
46060
46308
  }
46061
46309
  function parseCppInclude(text) {
46062
46310
  const t = text.trim();
@@ -46152,6 +46400,15 @@ function findEnclosingDecl(refNode, topLevelDefs) {
46152
46400
  function isNodeInside(outer, inner) {
46153
46401
  return inner.startIndex >= outer.startIndex && inner.endIndex <= outer.endIndex;
46154
46402
  }
46403
+ function nearestAncestorType(node, types) {
46404
+ let current = node.parent;
46405
+ while (current) {
46406
+ if (types.has(current.type))
46407
+ return current.type;
46408
+ current = current.parent;
46409
+ }
46410
+ return;
46411
+ }
46155
46412
  function hasAncestorOfType(node, types) {
46156
46413
  const typeSet = typeof types === "string" ? new Set([types]) : types;
46157
46414
  let current = node.parent;
@@ -46192,6 +46449,13 @@ function isInsideImportStatement(node) {
46192
46449
  function nodeKey(node) {
46193
46450
  return `${node.startPosition.row},${node.startPosition.column}-${node.endPosition.row},${node.endPosition.column}`;
46194
46451
  }
46452
+ function isOwnExportDeclaration(en, defNode) {
46453
+ const owner = en.childForFieldName?.("declaration") ?? en.childForFieldName?.("value");
46454
+ if (owner) {
46455
+ return owner.startIndex === defNode.startIndex && owner.endIndex === defNode.endIndex;
46456
+ }
46457
+ return isNodeInside(en, defNode);
46458
+ }
46195
46459
  function isDefaultExportStatement(en) {
46196
46460
  if (en.children.some((c) => c !== null && c.type === "default")) {
46197
46461
  return true;
@@ -47046,6 +47310,124 @@ function addRole(roles, role) {
47046
47310
  function boundaryForModule(moduleName, hasManifest) {
47047
47311
  return inferPackageBoundary(moduleName, hasManifest);
47048
47312
  }
47313
+ var blankKeepingNewlines = (m) => m.replace(/[^\n]/g, " ");
47314
+ function maskMultilineStringLiterals(text, language) {
47315
+ const csharp = language === "csharp";
47316
+ let out = "";
47317
+ let i = 0;
47318
+ while (i < text.length) {
47319
+ const ch = text[i];
47320
+ const openLen = quoteRunLength(text, i);
47321
+ if (openLen >= 3) {
47322
+ const delim = csharp ? openLen : 3;
47323
+ const end = findClosingQuoteRun(text, i + delim, delim, language === "java");
47324
+ if (end === -1) {
47325
+ out += text.slice(i);
47326
+ break;
47327
+ }
47328
+ const fence = '"'.repeat(delim);
47329
+ out += `${fence}${blankKeepingNewlines(text.slice(i + delim, end))}${fence}`;
47330
+ i = end + delim;
47331
+ continue;
47332
+ }
47333
+ const prefixLen = csharp ? matchVerbatimPrefix(text, i) : 0;
47334
+ if (prefixLen > 0) {
47335
+ const bodyStart = i + prefixLen;
47336
+ let j = bodyStart;
47337
+ let closed = -1;
47338
+ while (j < text.length) {
47339
+ if (text[j] === '"') {
47340
+ if (text[j + 1] === '"') {
47341
+ j += 2;
47342
+ continue;
47343
+ }
47344
+ closed = j;
47345
+ break;
47346
+ }
47347
+ j++;
47348
+ }
47349
+ if (closed === -1) {
47350
+ out += text.slice(i);
47351
+ break;
47352
+ }
47353
+ out += `${text.slice(i, bodyStart)}${blankKeepingNewlines(text.slice(bodyStart, closed))}"`;
47354
+ i = closed + 1;
47355
+ continue;
47356
+ }
47357
+ if (ch === '"' || ch === "'") {
47358
+ let j = i + 1;
47359
+ while (j < text.length && text[j] !== ch && text[j] !== `
47360
+ `) {
47361
+ if (text[j] === "\\" && text[j + 1] !== `
47362
+ `)
47363
+ j++;
47364
+ j++;
47365
+ }
47366
+ if (j >= text.length || text[j] === `
47367
+ `) {
47368
+ out += ch;
47369
+ i++;
47370
+ continue;
47371
+ }
47372
+ out += text.slice(i, j + 1);
47373
+ i = j + 1;
47374
+ continue;
47375
+ }
47376
+ out += ch;
47377
+ i++;
47378
+ }
47379
+ return out;
47380
+ }
47381
+ function quoteRunLength(text, i) {
47382
+ let n = 0;
47383
+ while (text[i + n] === '"')
47384
+ n++;
47385
+ return n;
47386
+ }
47387
+ function findClosingQuoteRun(text, from, delim, escapes) {
47388
+ let j = from;
47389
+ while (j < text.length) {
47390
+ if (escapes && text[j] === "\\") {
47391
+ j += 2;
47392
+ continue;
47393
+ }
47394
+ if (text[j] !== '"') {
47395
+ j++;
47396
+ continue;
47397
+ }
47398
+ const runLen = quoteRunLength(text, j);
47399
+ if (runLen >= delim)
47400
+ return j + runLen - delim;
47401
+ j += runLen;
47402
+ }
47403
+ return -1;
47404
+ }
47405
+ function matchVerbatimPrefix(text, i) {
47406
+ if (text.startsWith('@"', i))
47407
+ return 2;
47408
+ if (text.startsWith('$@"', i) || text.startsWith('@$"', i))
47409
+ return 3;
47410
+ return 0;
47411
+ }
47412
+ function sourceBoundaryForLanguage(language, content) {
47413
+ if (language !== "java" && language !== "kotlin" && language !== "csharp") {
47414
+ return null;
47415
+ }
47416
+ const scanned = maskMultilineStringLiterals(content, language);
47417
+ if (language === "java" || language === "kotlin") {
47418
+ const pkg = scanned.match(/^[ \t]*package[ \t]+([A-Za-z_][\w.]*)[ \t]*;?/m);
47419
+ if (pkg?.[1])
47420
+ return pkg[1];
47421
+ return null;
47422
+ }
47423
+ if (language === "csharp") {
47424
+ const ns = scanned.match(/^[ \t]*namespace[ \t]+([A-Za-z_][\w.]*)\s*[;{]/m);
47425
+ if (ns?.[1])
47426
+ return ns[1];
47427
+ return null;
47428
+ }
47429
+ return null;
47430
+ }
47049
47431
  function inferRoles(moduleName, content) {
47050
47432
  const normalized = normalizeModuleName(moduleName).toLowerCase();
47051
47433
  const roles = new Set;
@@ -47305,7 +47687,7 @@ function extractFileOntology(input) {
47305
47687
  const findings = buildFindings(roles, routes, dataOperations, security);
47306
47688
  return {
47307
47689
  roles,
47308
- packageBoundary: boundaryForModule(moduleName, input.hasManifest),
47690
+ packageBoundary: sourceBoundaryForLanguage(input.language, content) ?? boundaryForModule(moduleName, input.hasManifest),
47309
47691
  routes,
47310
47692
  dataOperations,
47311
47693
  security,
@@ -47495,6 +47877,15 @@ function parseFileImports(rawContent, sourceFile, workspaceRoot) {
47495
47877
  if (ext === ".go") {
47496
47878
  return parseGoFileImports(rawContent);
47497
47879
  }
47880
+ if (ext === ".java") {
47881
+ return parseJavaFileImports(rawContent);
47882
+ }
47883
+ if (ext === ".kt" || ext === ".kts") {
47884
+ return parseKotlinFileImports(rawContent);
47885
+ }
47886
+ if (ext === ".cs" || ext === ".csx") {
47887
+ return parseCSharpFileImports(rawContent);
47888
+ }
47498
47889
  const imports = [];
47499
47890
  const content = stripComments2(rawContent);
47500
47891
  const importRegex = /import\s+(?:\{[\s\S]*?\}|(?:\*\s+as\s+\w+)|\w+)\s+from\s+['"`]([^'"`\0\t\r\n]+)['"`]|import\s+['"`]([^'"`\0\t\r\n]+)['"`]|require\s*\(\s*['"`]([^'"`\0\t\r\n]+)['"`]\s*\)|export\s*\{[^}]*\}\s*from\s+['"`]([^'"`\0\t\r\n]+)['"`]|export\s+\*(?:\s+as\s+\w+)?\s+from\s+['"`]([^'"`\0\t\r\n]+)['"`]|import\s*\(\s*['"`]([^'"`\0\t\r\n]+)['"`]\s*\)/g;
@@ -47544,6 +47935,70 @@ function makeParsedImport(specifier, importType, bindings, reExport = false) {
47544
47935
  reExport
47545
47936
  };
47546
47937
  }
47938
+ function finalDottedSegment2(value) {
47939
+ const parts = value.split(".").filter(Boolean);
47940
+ return parts[parts.length - 1] ?? value;
47941
+ }
47942
+ function parseJavaFileImports(rawContent) {
47943
+ const imports = [];
47944
+ const content = maskMultilineStringLiterals(stripComments2(rawContent), "java");
47945
+ const re = /^[ \t]*import[ \t]+(static[ \t]+)?([A-Za-z_][\w.]*(?:\.\*)?)[ \t]*;?[ \t]*\r?$/gm;
47946
+ for (let m = re.exec(content);m !== null; m = re.exec(content)) {
47947
+ const isStatic = Boolean(m[1]);
47948
+ const raw = m[2];
47949
+ if (raw.endsWith(".*")) {
47950
+ const parsed2 = makeParsedImport(raw, "namespace", []);
47951
+ if (parsed2)
47952
+ imports.push(parsed2);
47953
+ continue;
47954
+ }
47955
+ const imported = finalDottedSegment2(raw);
47956
+ const specifier = isStatic ? raw.split(".").slice(0, -1).join(".") : raw;
47957
+ const parsed = makeParsedImport(specifier, "named", [
47958
+ { imported, local: imported }
47959
+ ]);
47960
+ if (parsed)
47961
+ imports.push(parsed);
47962
+ }
47963
+ return imports;
47964
+ }
47965
+ function parseKotlinFileImports(rawContent) {
47966
+ const imports = [];
47967
+ const content = stripComments2(rawContent);
47968
+ const re = /^[ \t]*import[ \t]+([A-Za-z_][\w.]*(?:\.\*)?)(?:[ \t]+as[ \t]+([A-Za-z_]\w*))?[ \t]*;?[ \t]*\r?$/gm;
47969
+ for (let m = re.exec(content);m !== null; m = re.exec(content)) {
47970
+ const raw = m[1];
47971
+ const alias = m[2];
47972
+ if (raw.endsWith(".*")) {
47973
+ const parsed2 = makeParsedImport(raw, "namespace", []);
47974
+ if (parsed2)
47975
+ imports.push(parsed2);
47976
+ continue;
47977
+ }
47978
+ const imported = finalDottedSegment2(raw);
47979
+ const parsed = makeParsedImport(raw, "named", [
47980
+ { imported, local: alias ?? imported }
47981
+ ]);
47982
+ if (parsed)
47983
+ imports.push(parsed);
47984
+ }
47985
+ return imports;
47986
+ }
47987
+ function parseCSharpFileImports(rawContent) {
47988
+ const imports = [];
47989
+ const content = stripComments2(rawContent);
47990
+ const re = /^[ \t]*(?:global[ \t]+)?using[ \t]+(static[ \t]+)?(?:([A-Za-z_]\w*)[ \t]*=[ \t]*)?([A-Za-z_][\w.]*)[ \t]*;[ \t]*\r?$/gm;
47991
+ for (let m = re.exec(content);m !== null; m = re.exec(content)) {
47992
+ const alias = m[2];
47993
+ const specifier = m[3];
47994
+ const parsed = alias ? makeParsedImport(specifier, "named", [
47995
+ { imported: finalDottedSegment2(specifier), local: alias }
47996
+ ]) : makeParsedImport(specifier, "namespace", []);
47997
+ if (parsed)
47998
+ imports.push(parsed);
47999
+ }
48000
+ return imports;
48001
+ }
47547
48002
  function parsePythonFileImports(rawContent, sourceFile) {
47548
48003
  const imports = [];
47549
48004
  const isPackageInit = sourceFile ? ["__init__.py", "__init__.pyw"].includes(path73.basename(sourceFile)) : false;
@@ -47951,6 +48406,7 @@ async function walkRepoGraphInputs(dir, options) {
47951
48406
  elapsedMs: Math.max(0, _internals61.now() - ctx.startedAt)
47952
48407
  };
47953
48408
  }
48409
+ var JVM_DOTNET_RANGE_GRAMMARS = new Set(["java", "kotlin", "csharp"]);
47954
48410
 
47955
48411
  // src/tools/repo-graph/query.ts
47956
48412
  var DEAD_EXPORT_EXCLUDED_ROLES = new Set([
@@ -66091,7 +66547,7 @@ function buildDetailedHelp(commandName, entry) {
66091
66547
  async function handleHelpCommand(ctx) {
66092
66548
  const targetCommand = ctx.args.join(" ");
66093
66549
  if (!targetCommand) {
66094
- const { buildHelpText } = await import("./index-ymyv4d36.js");
66550
+ const { buildHelpText } = await import("./index-15twmgzf.js");
66095
66551
  return buildHelpText();
66096
66552
  }
66097
66553
  const tokens = targetCommand.split(/\s+/);
@@ -66100,7 +66556,7 @@ async function handleHelpCommand(ctx) {
66100
66556
  return _internals94.buildDetailedHelp(resolved.key, resolved.entry);
66101
66557
  }
66102
66558
  const similar = _internals94.findSimilarCommands(targetCommand);
66103
- const { buildHelpText: fullHelp } = await import("./index-ymyv4d36.js");
66559
+ const { buildHelpText: fullHelp } = await import("./index-15twmgzf.js");
66104
66560
  if (similar.length > 0) {
66105
66561
  return `Command '/swarm ${targetCommand}' not found.
66106
66562
 
@@ -66277,7 +66733,7 @@ var COMMAND_REGISTRY = {
66277
66733
  },
66278
66734
  "guardrail explain": {
66279
66735
  handler: async (ctx) => {
66280
- const { handleGuardrailExplain } = await import("./guardrail-explain-g1nqbz0j.js");
66736
+ const { handleGuardrailExplain } = await import("./guardrail-explain-my9zj5pj.js");
66281
66737
  return handleGuardrailExplain(ctx.directory, ctx.args);
66282
66738
  },
66283
66739
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -66287,7 +66743,7 @@ var COMMAND_REGISTRY = {
66287
66743
  },
66288
66744
  "guardrail-explain": {
66289
66745
  handler: async (ctx) => {
66290
- const { handleGuardrailExplain } = await import("./guardrail-explain-g1nqbz0j.js");
66746
+ const { handleGuardrailExplain } = await import("./guardrail-explain-my9zj5pj.js");
66291
66747
  return handleGuardrailExplain(ctx.directory, ctx.args);
66292
66748
  },
66293
66749
  description: "Dry-run: show what the guardrails would do to a command or write target (executes nothing)",
@@ -66297,7 +66753,7 @@ var COMMAND_REGISTRY = {
66297
66753
  },
66298
66754
  "guardrail-log": {
66299
66755
  handler: async (ctx) => {
66300
- const { handleGuardrailLog } = await import("./guardrail-log-1bbg0vx4.js");
66756
+ const { handleGuardrailLog } = await import("./guardrail-log-dy9b5qtt.js");
66301
66757
  return handleGuardrailLog(ctx.directory, ctx.args);
66302
66758
  },
66303
66759
  description: "Read the guardrail decision log (use --blocks-only for blocks)",
@@ -73903,7 +74359,7 @@ async function precreateStandardWorktreeSession(args) {
73903
74359
  const laneProfile = computeLaneRuntimeProfile(worktreeConfig.runtime_isolation, laneIndex, provisionResult.worktreePath);
73904
74360
  if (laneProfile) {
73905
74361
  try {
73906
- const { writeLaneProfileToDiskReal } = await import("./core-n57ssze0.js");
74362
+ const { writeLaneProfileToDiskReal } = await import("./core-50jqqm4g.js");
73907
74363
  await writeLaneProfileToDiskReal(provisionResult.worktreePath, laneProfile.laneIndex, laneProfile.envOverrides);
73908
74364
  } catch {}
73909
74365
  }
@@ -74561,7 +75017,7 @@ async function finishStandardWorktreeDispatch(directory, dispatch, config, callI
74561
75017
  }
74562
75018
  clearWorktreeMergeStatus(statusKey);
74563
75019
  try {
74564
- const { removeLaneProfileFromDiskReal } = await import("./core-n57ssze0.js");
75020
+ const { removeLaneProfileFromDiskReal } = await import("./core-50jqqm4g.js");
74565
75021
  await removeLaneProfileFromDiskReal(dispatch.handle.worktreePath, dispatch.laneIndex);
74566
75022
  } catch {}
74567
75023
  const state = serializationStateBySessionID.get(dispatch.parentSessionID);