codehaven 0.14.0__py3-none-any.whl

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 (57) hide show
  1. codehaven-0.14.0.dist-info/METADATA +686 -0
  2. codehaven-0.14.0.dist-info/RECORD +57 -0
  3. codehaven-0.14.0.dist-info/WHEEL +5 -0
  4. codehaven-0.14.0.dist-info/entry_points.txt +3 -0
  5. codehaven-0.14.0.dist-info/licenses/LICENSE +21 -0
  6. codehaven-0.14.0.dist-info/top_level.txt +1 -0
  7. offline_agent/__init__.py +2 -0
  8. offline_agent/__main__.py +4 -0
  9. offline_agent/agent.py +815 -0
  10. offline_agent/answers.py +438 -0
  11. offline_agent/arabic.py +106 -0
  12. offline_agent/changes.py +228 -0
  13. offline_agent/chats.py +121 -0
  14. offline_agent/cli.py +379 -0
  15. offline_agent/coder.py +199 -0
  16. offline_agent/dependencies.py +132 -0
  17. offline_agent/doctor.py +190 -0
  18. offline_agent/documents.py +189 -0
  19. offline_agent/edits.py +204 -0
  20. offline_agent/errors.py +41 -0
  21. offline_agent/evaluation.py +284 -0
  22. offline_agent/evidence.py +187 -0
  23. offline_agent/exclusions.py +95 -0
  24. offline_agent/export.py +27 -0
  25. offline_agent/gui.css +237 -0
  26. offline_agent/gui.html +177 -0
  27. offline_agent/gui.js +1213 -0
  28. offline_agent/gui.py +967 -0
  29. offline_agent/gui_arabic.js +226 -0
  30. offline_agent/guides.py +203 -0
  31. offline_agent/history.py +126 -0
  32. offline_agent/index_cache.py +78 -0
  33. offline_agent/insights.py +333 -0
  34. offline_agent/javascript.py +200 -0
  35. offline_agent/knowledge.py +569 -0
  36. offline_agent/languages.py +396 -0
  37. offline_agent/memory.py +192 -0
  38. offline_agent/messages.py +51 -0
  39. offline_agent/model.py +498 -0
  40. offline_agent/more_languages.py +253 -0
  41. offline_agent/ocr.py +204 -0
  42. offline_agent/prompts.py +130 -0
  43. offline_agent/references/langgraph-approvals.md +38 -0
  44. offline_agent/references/langgraph-checkpoints.md +37 -0
  45. offline_agent/references/langgraph-graphs.md +42 -0
  46. offline_agent/references/langgraph.md +49 -0
  47. offline_agent/review.py +205 -0
  48. offline_agent/scans.py +325 -0
  49. offline_agent/semantic.py +264 -0
  50. offline_agent/slash.py +53 -0
  51. offline_agent/study.py +210 -0
  52. offline_agent/symbols.py +201 -0
  53. offline_agent/tasks.py +164 -0
  54. offline_agent/test_runner.py +264 -0
  55. offline_agent/trace.py +239 -0
  56. offline_agent/tracebacks.py +98 -0
  57. offline_agent/workspace.py +419 -0
@@ -0,0 +1,419 @@
1
+ """Bounded, read-only UTF-8 workspace access: listing, reading, paging, and literal search. Nothing here writes files."""
2
+ import ast
3
+ import errno
4
+ import json
5
+ import os
6
+ import re
7
+ import stat
8
+ from pathlib import Path, PurePath
9
+ from .exclusions import Exclusions, IgnoreConfigurationError
10
+
11
+ # Directory names that are never listed or read: version control, environments, build output, and credential folders.
12
+ EXCLUDED = {".git", ".venv", "venv", "node_modules", "__pycache__", "dist", "build",
13
+ ".aws", ".ssh", ".codex", ".agents"}
14
+ MAX_BYTES = 64_000 # The largest file uploaded, read from a picture or document, and one page of a read.
15
+ # The largest project file listed, searched, indexed, or read in pages. Only bounded parts of a file ever reach a
16
+ # prompt, so this limits memory, not prompt size. It was MAX_BYTES until large projects showed that their central
17
+ # modules (FastAPI's routing.py and applications.py, about 176 KB each) were invisible to search and reads.
18
+ READ_BYTES = 1_000_000
19
+ MAX_FILES = 5000 # The most files one listing returns; callers report the listing as limited at this size.
20
+ MAX_MATCHES, SEARCH_BYTES = 50, 15_800
21
+ # Opening a file one directory at a time, refusing symlinks at each step, needs these; Windows lacks them.
22
+ SAFE_OPEN = all(hasattr(os, flag) for flag in ("O_DIRECTORY", "O_NOFOLLOW", "O_NONBLOCK")) and os.open in os.supports_dir_fd # Bounds on one search result, so it always fits in a prompt.
23
+
24
+
25
+ def line_range(spec):
26
+ """Parse an optional read range such as 120-180 or 120; anything else means the whole file."""
27
+ match = re.fullmatch(r"\s*(?:lines?\s*)?(\d+)(?:\s*[-:]\s*(\d+))?\s*", spec or "", re.I)
28
+ if not match:
29
+ return None
30
+ start, end = int(match[1]), int(match[2]) if match[2] else None
31
+ if start < 1 or (end is not None and end < start):
32
+ raise ValueError("Read range must be start-end with 1 <= start <= end")
33
+ return start, end
34
+
35
+
36
+ def symbol_lines(name, text, symbol):
37
+ """Line range (start, end) of a named part of a file, or None when nothing by that name is defined.
38
+
39
+ Python files are parsed, never executed: a function or class (decorators included, Class.method for
40
+ methods), a module-level variable, a route path such as /health, or "imports". Anything else, in any file,
41
+ matches the first line that mentions the name.
42
+ """
43
+ symbol = re.sub(r"^(?:async\s+def|def|class)\s+", "", symbol.strip().strip("`'\" ")).removesuffix("()").strip()
44
+ symbol = re.sub(r"\[[^\]]*\]$", "", symbol) # CATALOG[123] names a part of CATALOG.
45
+ if not symbol:
46
+ return None
47
+ if Path(name).suffix in (".py", ".pyi"):
48
+ try:
49
+ tree = ast.parse(text)
50
+ except (SyntaxError, ValueError):
51
+ tree = None
52
+ found = python_symbol(tree, text, symbol) if tree is not None else None
53
+ if found is not None:
54
+ return found
55
+ # Not a definition, such as a row in a data table: fall through to the first line that mentions it.
56
+ lines = text.splitlines()
57
+ pattern = re.compile(rf"(?<![\w.]){re.escape(symbol)}(?![\w])")
58
+ for number, line in enumerate(lines, 1):
59
+ if pattern.search(line):
60
+ return number, number
61
+ # A member defined by assignment, as JavaScript modules do: exports.compileETag = function ..., app.listen = ...
62
+ # The dot before the name kept these from matching above, so every exported function looked "not found".
63
+ member = symbol.rsplit(".", 1)[-1]
64
+ assigned = re.compile(rf"\.{re.escape(member)}\s*=(?!=)")
65
+ for number, line in enumerate(lines, 1):
66
+ if assigned.search(line):
67
+ return number, number
68
+ return None
69
+
70
+
71
+ def python_symbol(tree, text, symbol):
72
+ """Line range of a named part of a parsed Python module, or None: see symbol_lines for what can be named."""
73
+ if symbol.lower() == "imports":
74
+ imports = [node for node in tree.body if isinstance(node, (ast.Import, ast.ImportFrom))]
75
+ return (imports[0].lineno, imports[-1].end_lineno) if imports else None
76
+ owner, _, member = symbol.rpartition(".")
77
+ classes = [node for node in tree.body if isinstance(node, ast.ClassDef)]
78
+ # Class.method looks only inside that class; a bare name looks at module level, then inside every class.
79
+ scopes = ([c.body for c in classes if c.name == owner] if owner else [tree.body] + [c.body for c in classes])
80
+ # A name starting with / is a route path, found as a quoted string in a decorator such as @app.get("/health").
81
+ route = re.compile(rf"[\"']{re.escape(symbol)}[\"']") if symbol.startswith("/") else None
82
+ for node in (node for body in scopes for node in body):
83
+ if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
84
+ decorators = [ast.get_source_segment(text, d) or "" for d in node.decorator_list]
85
+ if node.name == member or (route and any(route.search(d) for d in decorators)):
86
+ # Start at the first decorator, so the range covers the whole definition.
87
+ return min([node.lineno] + [d.lineno for d in node.decorator_list]), node.end_lineno
88
+ elif isinstance(node, (ast.Assign, ast.AnnAssign)):
89
+ targets = node.targets if isinstance(node, ast.Assign) else [node.target]
90
+ if any(isinstance(t, ast.Name) and t.id == member for t in targets):
91
+ return node.lineno, node.end_lineno
92
+ return None
93
+
94
+
95
+ def sections(text, limit, focus=(), overhead=0):
96
+ """Line ranges (1-based, inclusive) to show of a file too long for limit bytes.
97
+
98
+ Shows the start and the end of the file, plus a few lines around each focus line, because what a task
99
+ asks about is often not in the first page. overhead is extra bytes per line, such as a line number.
100
+ """
101
+ lines = text.splitlines(keepends=True)
102
+ cost = [len(line.encode()) + overhead for line in lines]
103
+ if sum(cost) <= limit:
104
+ return [(1, max(1, len(lines)))]
105
+ chosen, used = set(), 0
106
+
107
+ def take(indexes, budget):
108
+ """Choose lines in the given order until budget bytes are spent, skipping lines already chosen."""
109
+ nonlocal used
110
+ spent = 0
111
+ for index in indexes:
112
+ if index in chosen:
113
+ continue
114
+ if spent + cost[index] > budget:
115
+ return
116
+ chosen.add(index)
117
+ spent += cost[index]
118
+ used += cost[index]
119
+
120
+ if focus:
121
+ # Three lines either side of each focus line, using at most 30% of the limit.
122
+ window = [index for line in focus for index in range(max(0, line - 4), min(len(lines), line + 3))]
123
+ take(window, limit * 3 // 10)
124
+ remaining = limit - used
125
+ # Three quarters of what is left goes to the start of the file, and the rest to its end.
126
+ take(range(len(lines)), remaining * 3 // 4)
127
+ take(reversed(range(len(lines))), limit - used)
128
+ if not chosen:
129
+ chosen.add(0) # A single line longer than the limit still gets shown; callers mark it incomplete.
130
+ # Merge neighbouring line indexes into 1-based inclusive ranges.
131
+ ranges = []
132
+ for index in sorted(chosen):
133
+ if ranges and ranges[-1][1] == index:
134
+ ranges[-1][1] = index + 1
135
+ else:
136
+ ranges.append([index + 1, index + 1])
137
+ return [tuple(pair) for pair in ranges]
138
+
139
+
140
+ # A definition line in common languages: optional modifiers, a keyword, then the name (group 2).
141
+ DEFINITION = re.compile(r"^(\s*)(?:[\w@.<>\[\],\s]*\s)?(?:function|class|def|func|fn|interface|struct|impl)\s+([\w$]+)")
142
+
143
+
144
+ def enclosing_parts(name, text):
145
+ """Map a function: line number -> (enclosing name, whether that line is the definition itself)."""
146
+ spans = []
147
+ if Path(name).suffix in (".py", ".pyi"):
148
+ try:
149
+ tree = ast.parse(text)
150
+ except (SyntaxError, ValueError, RecursionError, MemoryError):
151
+ tree = None
152
+ if tree is not None:
153
+ def visit(node, prefix):
154
+ """Record the line span and dotted name of every function and class, however deeply nested."""
155
+ for child in ast.iter_child_nodes(node):
156
+ if isinstance(child, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
157
+ qualified = prefix + child.name
158
+ spans.append((child.lineno, child.end_lineno, qualified))
159
+ visit(child, qualified + ".")
160
+ else:
161
+ visit(child, prefix)
162
+ visit(tree, "")
163
+
164
+ def lookup(number):
165
+ """The innermost function or class that contains the line."""
166
+ inside = [span for span in spans if span[0] <= number <= span[1]]
167
+ if not inside:
168
+ return None, False
169
+ innermost = max(inside, key=lambda span: span[0])
170
+ return innermost[2], innermost[0] == number
171
+ return lookup
172
+ lines = text.splitlines()
173
+
174
+ def lookup(number):
175
+ """The nearest definition line at or above the line: a heuristic for other languages and unparsable Python."""
176
+ for index in range(min(number, len(lines)) - 1, -1, -1):
177
+ found = DEFINITION.match(lines[index])
178
+ if found:
179
+ return found[2], index == number - 1
180
+ return None, False
181
+ return lookup
182
+
183
+
184
+ def combined(roots, *, excludes=()):
185
+ """One workspace for several repository folders: their common parent, limited to them.
186
+
187
+ A single folder, or a folder that holds all the others, is opened as it is."""
188
+ paths = [Path(root).expanduser().resolve(strict=True) for root in roots]
189
+ common = Path(os.path.commonpath([str(path) for path in paths]))
190
+ if len(paths) == 1 or common in paths:
191
+ return Workspace(common, excludes=excludes)
192
+ return Workspace(common, excludes=excludes, scopes=[path.relative_to(common).as_posix() for path in paths])
193
+
194
+
195
+ class Workspace:
196
+ """Read-only view of one directory tree. Every name is checked by path() before it is listed, read, or searched."""
197
+
198
+ def __init__(self, root, *, excludes=(), scopes=()):
199
+ """Resolve the root once, so later checks compare against the real directory, and load the ignore rules.
200
+
201
+ scopes, folders under root such as ("api", "web"), limits the workspace to them: several repositories
202
+ are opened together as the folders of their common parent, and nothing else under that parent is seen.
203
+ """
204
+ self.root = Path(root).resolve(strict=True)
205
+ if not self.root.is_dir():
206
+ raise ValueError("Workspace must be a directory")
207
+ # The root as a string, and its case-folded form with a trailing separator: path() works on strings, because
208
+ # pathlib's own symlink, resolve, and relative_to checks cost seconds per listing on a large project.
209
+ self.root_text = str(self.root)
210
+ self.root_key = os.path.normcase(self.root_text)
211
+ self.excludes = tuple(excludes)
212
+ self.scopes = tuple(sorted({PurePath(scope).as_posix().strip("/") for scope in scopes if str(scope).strip("/.")}))
213
+ self.exclusions = Exclusions(self.root, self.excludes)
214
+ for scope in self.scopes:
215
+ if not self.path(scope).is_dir():
216
+ raise ValueError(f"{scope} is not a folder under {self.root}")
217
+
218
+ def path(self, name):
219
+ """Return the real path for a workspace-relative name.
220
+
221
+ Raises ValueError when the name would leave the root, or is hidden, excluded, reached through a symlink,
222
+ or ignored by the ignore rules. This is the one gate every file access goes through.
223
+ """
224
+ rel = PurePath(name) if name else None
225
+ # Path traversal: no absolute paths and no .. components.
226
+ if not name or rel.is_absolute() or rel.anchor or ".." in rel.parts:
227
+ raise ValueError("Use a relative path inside the workspace")
228
+ if any(p in EXCLUDED or p.startswith(".") for p in rel.parts):
229
+ raise ValueError("Hidden and excluded paths are unavailable")
230
+ if self.scopes:
231
+ posix = "/".join(rel.parts)
232
+ # Inside an opened repository, or a folder on the way to one; nothing else under the common parent.
233
+ if not any(posix == scope or posix.startswith(scope + "/") or scope.startswith(posix + "/") for scope in self.scopes):
234
+ raise ValueError(f"{name} is not in one of the opened repositories")
235
+ # A symlink at any level could point outside the workspace, so each component is checked, not only the last.
236
+ current = self.root_text
237
+ for part in rel.parts:
238
+ current = os.path.join(current, part)
239
+ if os.path.islink(current):
240
+ raise ValueError("Symlink paths are unavailable")
241
+ # Final guard: the fully resolved path must still be inside the root.
242
+ real = os.path.normcase(os.path.realpath(current))
243
+ if real != self.root_key and not real.startswith(self.root_key.rstrip(os.sep) + os.sep):
244
+ raise ValueError("Use a relative path inside the workspace")
245
+ if self.exclusions.ignored(rel, directory=os.path.isdir(current)):
246
+ raise ValueError(f"Path is excluded by ignore rules: {name}")
247
+ return self.root / rel
248
+
249
+ def files(self, scope=""):
250
+ """Relative paths of the readable files under scope, in sorted walk order, at most MAX_FILES of them.
251
+
252
+ Hidden, excluded, ignored, symlinked, and oversized files are left out.
253
+ """
254
+ if self.scopes and (not scope or any(other.startswith(scope.strip("/") + "/") for other in self.scopes)):
255
+ # Several repositories: each one's files, in the order the repositories were given, within the one bound.
256
+ found = []
257
+ for other in self.scopes:
258
+ if not scope or other.startswith(scope.strip("/") + "/"):
259
+ found += self.files(other)[:MAX_FILES - len(found)]
260
+ return found
261
+ start = self.path(scope) if scope else self.root
262
+ if not start.is_dir():
263
+ raise ValueError("File listing scope must be a directory")
264
+ found = []
265
+
266
+ def relative(base, name):
267
+ """The workspace-relative POSIX name of name inside the walked directory base."""
268
+ inside = base[len(self.root_text):].strip(os.sep)
269
+ return (inside.replace(os.sep, "/") + "/" + name) if inside else name
270
+
271
+ def visible_directory(base, name):
272
+ """Whether a directory passes path(). A broken ignore file is an error to report, not a reason to hide it."""
273
+ try:
274
+ self.path(relative(base, name))
275
+ return True
276
+ except IgnoreConfigurationError:
277
+ raise
278
+ except (ValueError, OSError):
279
+ return False
280
+
281
+ for base, dirs, files in os.walk(start, followlinks=False):
282
+ # Assigning in place prunes the walk, so an excluded directory is never entered.
283
+ dirs[:] = sorted(d for d in dirs if visible_directory(base, d))
284
+ for name in sorted(files):
285
+ if name.startswith("."):
286
+ continue
287
+ rel = relative(base, name)
288
+ try:
289
+ status = os.stat(self.path(rel))
290
+ if stat.S_ISREG(status.st_mode) and status.st_size <= READ_BYTES:
291
+ found.append(rel)
292
+ except IgnoreConfigurationError:
293
+ raise
294
+ except (ValueError, OSError):
295
+ continue
296
+ if len(found) >= MAX_FILES:
297
+ return found
298
+ return found
299
+
300
+ def read_bytes(self, name, limit=READ_BYTES):
301
+ """Return (the first limit + 1 bytes of a file, its mode), opened so that no symlink is ever followed.
302
+
303
+ path() checks the name first. The checks and the open are separate steps, so a directory swapped for a
304
+ symlink in between could otherwise lead the open out of the workspace. On macOS and Linux the file is
305
+ therefore opened one component at a time from the root with O_NOFOLLOW, which refuses a symlink at any
306
+ level at the moment of opening. Windows has no such open, and uses the checks alone.
307
+ """
308
+ self.path(name)
309
+ parts = PurePath(name).parts
310
+ if SAFE_OPEN:
311
+ parent = os.open(self.root_text, os.O_RDONLY | os.O_DIRECTORY)
312
+ try:
313
+ for part in parts[:-1]:
314
+ child = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=parent)
315
+ os.close(parent)
316
+ parent = child
317
+ # O_NONBLOCK stops a named pipe from hanging the open; fstat below rejects anything but a regular file.
318
+ descriptor = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=parent)
319
+ except OSError as exc:
320
+ if exc.errno in (errno.ELOOP, errno.ENOTDIR):
321
+ raise ValueError("Symlink paths are unavailable") from None
322
+ raise
323
+ finally:
324
+ os.close(parent)
325
+ else:
326
+ target = self.root / name
327
+ if not target.is_file():
328
+ raise ValueError("Only regular files can be read")
329
+ descriptor = os.open(target, os.O_RDONLY | getattr(os, "O_BINARY", 0))
330
+ with os.fdopen(descriptor, "rb") as handle:
331
+ info = os.fstat(handle.fileno())
332
+ if not stat.S_ISREG(info.st_mode):
333
+ raise ValueError("Only regular files can be read")
334
+ # One byte past the limit is enough to know the file is too large, without reading all of it.
335
+ return handle.read(limit + 1), info.st_mode
336
+
337
+ def read(self, name):
338
+ """Return a file's text. Raises ValueError for anything but a UTF-8 text file of at most READ_BYTES."""
339
+ raw, _ = self.read_bytes(name)
340
+ if len(raw) > READ_BYTES or b"\0" in raw:
341
+ raise ValueError(f"Only UTF-8 text files up to {READ_BYTES // 1_000_000} MB can be read")
342
+ # Windows line endings become plain ones, so a stray carriage return never reaches the model or a citation.
343
+ # Nothing is written back: the file on disk keeps its own line endings.
344
+ return raw.decode("utf-8").replace("\r\n", "\n")
345
+
346
+ def page(self, name, spec="", limit=MAX_BYTES):
347
+ """Return (text, start, end, total) for a line range, cut at a line boundary to fit limit bytes."""
348
+ text = self.read(name)
349
+ lines = text.splitlines(keepends=True)
350
+ total = len(lines)
351
+ requested = line_range(spec)
352
+ if requested is None and len(text.encode()) <= limit:
353
+ return text, 1, max(1, total), total
354
+ start, end = requested or (1, None)
355
+ if start > total:
356
+ raise ValueError(f"{name} has {total} lines; request a range within 1-{total}")
357
+ shown, size = [], 0
358
+ for line in lines[start - 1:min(end or total, total)]:
359
+ size += len(line.encode())
360
+ # The first line is always shown, even when it alone is over the limit.
361
+ if shown and size > limit:
362
+ break
363
+ shown.append(line)
364
+ return "".join(shown), start, start + len(shown) - 1, total
365
+
366
+ def search(self, query, scope=""):
367
+ """Case-sensitive literal search; return bounded, numbered UTF-8 snippets."""
368
+ if (not isinstance(query, str) or not query.strip() or len(query) > 256
369
+ or any(c in query for c in "\n\r\0")):
370
+ raise ValueError("Search requires a nonblank single-line literal of at most 256 characters")
371
+ if scope:
372
+ target = self.path(scope)
373
+ if not target.exists():
374
+ raise ValueError("Search scope does not exist")
375
+ candidates = [scope] if target.is_file() else self.files(scope)
376
+ else:
377
+ candidates = self.files()
378
+ result = {"query": query, "scope": scope or ".", "literal": True,
379
+ "matches": [], "files_searched": 0, "files_skipped": 0,
380
+ "limit_reached": False, "candidate_limit_reached": len(candidates) >= MAX_FILES}
381
+ for name in candidates:
382
+ try:
383
+ text = self.read(name)
384
+ except (ValueError, OSError, UnicodeError):
385
+ result["files_skipped"] += 1
386
+ continue
387
+ result["files_searched"] += 1
388
+ lookup = None
389
+ for number, line in enumerate(text.splitlines(), 1):
390
+ index = line.find(query)
391
+ if index < 0:
392
+ continue
393
+ # Show up to 40 characters before the match, and 320 characters in all.
394
+ start = max(0, index - 40)
395
+ snippet = line[start:start + 320]
396
+ match = {"path": name, "line": number, "text": snippet,
397
+ "snippet_truncated": start > 0 or start + len(snippet) < len(line)}
398
+ # Built once per file, and only for a file that has a match.
399
+ lookup = lookup or enclosing_parts(name, text)
400
+ # Name the surrounding function, so "who calls X?" is answered by the result itself.
401
+ part, defines = lookup(number)
402
+ if part:
403
+ match["in"] = part
404
+ if defines:
405
+ match["defines"] = True
406
+ if len(result["matches"]) >= MAX_MATCHES:
407
+ result["limit_reached"] = True
408
+ return json.dumps(result, ensure_ascii=False)
409
+ result["matches"].append(match)
410
+ # Reserve room for counters and the truncation flag on later iterations.
411
+ if len(json.dumps(result, ensure_ascii=False).encode()) > SEARCH_BYTES:
412
+ result["matches"].pop()
413
+ result["limit_reached"] = True
414
+ return json.dumps(result, ensure_ascii=False)
415
+ if not result["matches"]:
416
+ result["note"] = ("No matches for this exact literal and scope among searched files. "
417
+ "This does not establish that a framework is absent. "
418
+ "Do not append file extensions or globs to a source-text query.")
419
+ return json.dumps(result, ensure_ascii=False)