@allansantos-dev/smart-tool 0.9.80 → 0.9.82

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 (65) hide show
  1. package/CHANGELOG.md +129 -0
  2. package/NOTICE +1 -1
  3. package/README.md +59 -14
  4. package/agent_redirect.py +32 -0
  5. package/autostart.py +32 -25
  6. package/browser_bridge.py +320 -0
  7. package/browser_control.py +76 -39
  8. package/browser_service_client.py +1 -7
  9. package/client_hooks.py +42 -41
  10. package/code_graph.py +56 -15
  11. package/code_graph_java.mjs +21 -12
  12. package/code_health.py +19 -12
  13. package/code_impact.py +1 -1
  14. package/codex_config.py +3 -0
  15. package/config.py +35 -0
  16. package/daemon_launcher.py +37 -5
  17. package/doc_candidates.py +63 -0
  18. package/doc_check.py +9 -3
  19. package/doc_extras.py +2 -3
  20. package/doc_insights.py +26 -2
  21. package/doc_prose.py +59 -11
  22. package/doc_registry.py +241 -0
  23. package/doc_scope.py +205 -39
  24. package/doc_turn.py +205 -0
  25. package/doc_validate.py +52 -9
  26. package/document_read.py +4 -2
  27. package/dossier.py +40 -5
  28. package/edit_shape.py +119 -0
  29. package/endpoint_sync.py +3 -21
  30. package/engine_home.py +95 -0
  31. package/hook_call.py +132 -0
  32. package/hook_decision.py +337 -23
  33. package/hooks/pretool_router.py +36 -29
  34. package/hooks/turn_end.py +40 -0
  35. package/index_views.py +5 -0
  36. package/install.py +90 -36
  37. package/install_runtime.py +24 -10
  38. package/lazy_mcp_proxy.py +10 -9
  39. package/link_check.py +69 -0
  40. package/local_embedder.py +9 -2
  41. package/locales/pt-BR.json +72 -4
  42. package/model_breaker.py +6 -5
  43. package/model_client.py +1 -1
  44. package/model_health.py +24 -6
  45. package/notice_action.py +9 -0
  46. package/package.json +2 -2
  47. package/pr_comment.py +94 -0
  48. package/pr_impact.py +216 -35
  49. package/process_limits.py +17 -3
  50. package/project_admission.py +17 -15
  51. package/project_identity.py +19 -1
  52. package/project_scan.py +98 -0
  53. package/removed_callers.py +146 -0
  54. package/scout_access.py +48 -0
  55. package/setup_ui.py +33 -4
  56. package/shell_reads.py +67 -0
  57. package/smart_tool_daemon.py +149 -39
  58. package/tray.py +60 -9
  59. package/update_splash.py +2 -2
  60. package/venv_launch.py +67 -0
  61. package/version.py +1 -1
  62. package/web_adapters/node/engine-home.mjs +42 -0
  63. package/web_adapters/node/package-lock.json +13 -0
  64. package/web_adapters/node/package.json +1 -0
  65. package/web_document_graph.py +12 -1
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Brings a shared engine of the engine registry up: installs it or updates it with the kit's SHA-256 and Ed25519 checks,
3
+ * starts it hidden and waits for its announce file. A home that already answers at the registry's version or newer is
4
+ * left alone, whichever way it was installed: the kit only knows the copy it installed itself and would replace a
5
+ * working one. Prints one JSON object on stdout and exits 0 also for a refusal, so the caller reads `ok` and `reason`.
6
+ *
7
+ * Usage: node engine-home.mjs <casa-de-embeddings|motor-de-grafo>
8
+ */
9
+ import { ensureHome, discover, CASA, GRAFO } from "engine-kit/kit/client.mjs";
10
+ import { resolve } from "engine-kit/kit/resolve.mjs";
11
+
12
+ const ENGINES = { [CASA]: true, [GRAFO]: true };
13
+
14
+ const parts = (version) => String(version ?? "").split(".").map((piece) => Number.parseInt(piece, 10) || 0);
15
+
16
+ /** True when `version` is the same as `wanted` or newer. */
17
+ const atLeast = (version, wanted) => {
18
+ const [have, need] = [parts(version), parts(wanted)];
19
+ for (let index = 0; index < Math.max(have.length, need.length); index += 1) {
20
+ if ((have[index] ?? 0) !== (need[index] ?? 0)) { return (have[index] ?? 0) > (need[index] ?? 0); }
21
+ }
22
+ return true;
23
+ };
24
+
25
+ const show = ({ shutdownToken, engine, ...visible }) => console.log(JSON.stringify(visible));
26
+
27
+ const name = process.argv[2];
28
+ if (!ENGINES[name]) {
29
+ console.log(JSON.stringify({ ok: false, reason: `unknown engine ${name}` }));
30
+ } else {
31
+ try {
32
+ const running = await discover(name);
33
+ const registry = running.ok ? await resolve(name) : null;
34
+ if (running.ok && registry?.ok && atLeast(running.version, registry.engine.version)) {
35
+ show({ ...running, installed: running.version });
36
+ } else {
37
+ show(await ensureHome(name));
38
+ }
39
+ } catch (error) {
40
+ console.log(JSON.stringify({ ok: false, reason: `${name}: ${error?.message ?? error}` }));
41
+ }
42
+ }
@@ -10,6 +10,7 @@
10
10
  "dependencies": {
11
11
  "@angular/compiler": "20.3.0",
12
12
  "@playwright/mcp": "0.0.83",
13
+ "engine-kit": "0.2.16",
13
14
  "java-parser": "3.0.1",
14
15
  "open-websearch": "2.1.11",
15
16
  "typescript": "5.9.3"
@@ -1186,6 +1187,18 @@
1186
1187
  "url": "https://github.com/fb55/encoding-sniffer?sponsor=1"
1187
1188
  }
1188
1189
  },
1190
+ "node_modules/engine-kit": {
1191
+ "version": "0.2.16",
1192
+ "resolved": "https://registry.npmjs.org/engine-kit/-/engine-kit-0.2.16.tgz",
1193
+ "integrity": "sha512-TFX/ojYSvW2Om/wL3hMuQ5Hcy2eV+mpNbPln1okculMucOT3cN68HMBYNpcA+5LftusrPVpjsiJfpi+csWL7rg==",
1194
+ "license": "MIT",
1195
+ "bin": {
1196
+ "engine-kit": "kit/cli.mjs"
1197
+ },
1198
+ "engines": {
1199
+ "node": ">=18"
1200
+ }
1201
+ },
1189
1202
  "node_modules/entities": {
1190
1203
  "version": "4.5.0",
1191
1204
  "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz",
@@ -6,6 +6,7 @@
6
6
  "dependencies": {
7
7
  "@angular/compiler": "20.3.0",
8
8
  "@playwright/mcp": "0.0.83",
9
+ "engine-kit": "0.2.16",
9
10
  "java-parser": "3.0.1",
10
11
  "open-websearch": "2.1.11",
11
12
  "typescript": "5.9.3"
@@ -5,14 +5,25 @@ from html.parser import HTMLParser
5
5
  from urllib.parse import unquote,urlsplit
6
6
 
7
7
 
8
+ def local_target(origin,value):
9
+ """Caminho do alvo de uma referência local: relativo à pasta de `origin` (ou à raiz, se começar com '/')."""
10
+ path=urlsplit(value).path
11
+ return posixpath.normpath(posixpath.join(posixpath.dirname(origin),unquote(path))) if not path.startswith('/') else unquote(path).lstrip('/')
12
+
13
+
8
14
  def analyze(sources,all_paths):
15
+ """Referências locais e externas de HTML, CSS e Markdown.
16
+
17
+ Parâmetros: sources (dict caminho -> texto); all_paths (caminhos existentes, para resolver os alvos).
18
+ Retorna: dict com `dependencies` (source, target, specifier, line, kind, resolution), `diagnostics` e `parsed`.
19
+ """
9
20
  paths=set(all_paths);dependencies=[];diagnostics=[];parsed=[]
10
21
  def reference(origin,value,line,kind):
11
22
  if not value or value.startswith(('#','data:','javascript:','mailto:','tel:')):return
12
23
  url=urlsplit(value)
13
24
  if url.scheme or url.netloc:
14
25
  dependencies.append({'source':origin,'target':None,'specifier':value[:300],'line':line,'kind':kind,'resolution':'external'});return
15
- target=posixpath.normpath(posixpath.join(posixpath.dirname(origin),unquote(url.path))) if not url.path.startswith('/') else unquote(url.path).lstrip('/')
26
+ target=local_target(origin,value)
16
27
  if target.startswith('../') or target==origin:return
17
28
  found=target if target in paths else None
18
29
  dependencies.append({'source':origin,'target':found,'specifier':value[:300],'line':line,'kind':kind,'resolution':'resolved' if found else 'unresolved'})