@konbakuyomu/smart-search-darwin-arm64 0.1.27 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konbakuyomu/smart-search-darwin-arm64",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "Self-contained Smart Search CLI for darwin/arm64",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -5,6 +5,7 @@ import hashlib
5
5
  import json
6
6
  import os
7
7
  from pathlib import Path
8
+ import re
8
9
  import time
9
10
  import uuid
10
11
 
@@ -64,31 +65,49 @@ def hashes_at(dest, names):
64
65
  return hashes
65
66
 
66
67
 
68
+ def _owner_identity(owner: str) -> str:
69
+ # mise keeps one directory per version; its tool directory identifies the installation.
70
+ for parent in Path(owner).parents:
71
+ if parent.name == "npm-konbakuyomu-smart-search" and parent.parent.name == "installs":
72
+ return str(parent)
73
+ return owner
74
+
75
+
76
+ def _version_key(value) -> tuple[int, int, int] | None:
77
+ if isinstance(value, str):
78
+ match = re.match(r"^(\d+)\.(\d+)\.(\d+)", value)
79
+ if match:
80
+ return tuple(int(part) for part in match.groups())
81
+ return None
82
+
83
+
67
84
  def cli_owner():
68
85
  """Identify the installation, independent of its product version or config profile."""
69
86
  import sys
70
87
  if os.getenv(skills.PACKAGE_ROOT_ENV):
71
- return str(Path(os.environ[skills.PACKAGE_ROOT_ENV]).resolve())
88
+ return _owner_identity(str(Path(os.environ[skills.PACKAGE_ROOT_ENV]).resolve()))
72
89
  if getattr(sys, "frozen", False):
73
90
  from .desktop_cli import tools_directory
74
91
  root = tools_directory()
75
92
  if Path(sys.executable).resolve().is_relative_to(root / "standalone/versions"):
76
- return str(root / "standalone")
77
- return str(Path(sys.executable).resolve())
78
- return str(Path(__file__).resolve().parent)
93
+ return _owner_identity(str(root / "standalone"))
94
+ return _owner_identity(str(Path(sys.executable).resolve()))
95
+ return _owner_identity(str(Path(__file__).resolve().parent))
79
96
 
80
97
 
81
98
  def register(installed, files, *, directory=None):
82
99
  directory = Path(directory) if directory else state_directory()
83
100
  if not installed:
84
101
  return
102
+ from .cli import _get_version
85
103
  from .config import config
86
104
  with file_lock(directory / "state.json"):
87
105
  state = load(directory)
88
106
  managed = state.setdefault("managed", {})
89
107
  for row in installed:
90
108
  managed[row["target"]] = {"path": row["path"], "files": hashes_at(Path(row["path"]), files),
91
- "owner": cli_owner(), "config_dir": str(config.config_file.parent)}
109
+ "owner": cli_owner(), "config_dir": str(config.config_file.parent),
110
+ "cli_version": _get_version()}
92
111
  state.setdefault("auto_check", True)
93
112
  save(state, directory)
94
113
 
@@ -129,7 +148,11 @@ def _maintain_locked(directory, force):
129
148
  try:
130
149
  if not isinstance(receipt, dict) or not isinstance(receipt.get("path"), str):
131
150
  raise ValueError("Invalid managed Skill receipt")
132
- if receipt.get("owner", owner) != owner:
151
+ if _owner_identity(receipt.get("owner", owner)) != owner:
152
+ continue
153
+ receipt_version, current_version = _version_key(receipt.get("cli_version")), _version_key(version)
154
+ # An older CLI never overwrites Skills written by a newer one.
155
+ if receipt_version is not None and current_version is not None and receipt_version > current_version:
133
156
  continue
134
157
  config_dir = receipt.get("config_dir")
135
158
  if config_dir is not None and (not isinstance(config_dir, str) or not Path(config_dir).is_absolute()):
@@ -148,6 +171,7 @@ def _maintain_locked(directory, force):
148
171
  continue
149
172
  changed = skills._write_skill_files(dest, files, directory / "backups", backup_prefix=target + "-")
150
173
  receipt["files"] = hashes_at(dest, files)
174
+ receipt["cli_version"] = version
151
175
  results.append({"target": target, "status": "updated", **changed})
152
176
  except (OSError, ValueError, TypeError):
153
177
  results.append({"target": target, "status": "needs_attention"})
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: smart-search
3
- Version: 0.1.27
3
+ Version: 0.1.28
4
4
  Summary: CLI-first multi-source web research with xAI/OpenAI-compatible search, Exa, Context7, Zhipu, Tavily, Firecrawl, and Deep Research planning.
5
5
  Requires-Python: >=3.10
6
6
  Description-Content-Type: text/markdown
@@ -1,13 +1,13 @@
1
1
  ../../../bin/smart-search,sha256=q9upy4clf9uCDMAJIt-pBkuMwhZ7KupZeJLPO-SMjG4,206
2
- smart_search-0.1.27.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3
- smart_search-0.1.27.dist-info/METADATA,sha256=LMSQhB2hP-JkC32uD3_kIV1Ri3Aa_RzVALiZvQ6Xcf4,6721
4
- smart_search-0.1.27.dist-info/RECORD,,
5
- smart_search-0.1.27.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- smart_search-0.1.27.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
7
- smart_search-0.1.27.dist-info/direct_url.json,sha256=uxzJhtkKbMt-CGh9XSoaSD7MmHAe_3DVycaTwRP2IhQ,76
8
- smart_search-0.1.27.dist-info/entry_points.txt,sha256=fiHguhz7hQ6ybeepO0OPpZm19XCi2J-Bkigf8DGBuKM,55
9
- smart_search-0.1.27.dist-info/licenses/LICENSE,sha256=o_zbH827gkTiZfsNLJGQn1z8Z4eLAvb8heFaSqSGVv8,1067
10
- smart_search-0.1.27.dist-info/top_level.txt,sha256=mBPprcb_b3tBApeRa2nlLaGj3UVNxXCdyz6QQvDzJpc,13
2
+ smart_search-0.1.28.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
3
+ smart_search-0.1.28.dist-info/METADATA,sha256=Hq7LYe74BDvia9_K6HfeDQIVI96TX7DphV9HjqK-CVI,6721
4
+ smart_search-0.1.28.dist-info/RECORD,,
5
+ smart_search-0.1.28.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ smart_search-0.1.28.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
7
+ smart_search-0.1.28.dist-info/direct_url.json,sha256=uxzJhtkKbMt-CGh9XSoaSD7MmHAe_3DVycaTwRP2IhQ,76
8
+ smart_search-0.1.28.dist-info/entry_points.txt,sha256=fiHguhz7hQ6ybeepO0OPpZm19XCi2J-Bkigf8DGBuKM,55
9
+ smart_search-0.1.28.dist-info/licenses/LICENSE,sha256=o_zbH827gkTiZfsNLJGQn1z8Z4eLAvb8heFaSqSGVv8,1067
10
+ smart_search-0.1.28.dist-info/top_level.txt,sha256=mBPprcb_b3tBApeRa2nlLaGj3UVNxXCdyz6QQvDzJpc,13
11
11
  smart_search/__init__.py,sha256=da1PTClDMl-IBkrSvq6JC1lnS-K_BASzCvxVhNxN5Ls,13
12
12
  smart_search/__pycache__/__init__.cpython-313.pyc,,
13
13
  smart_search/__pycache__/activity.cpython-313.pyc,,
@@ -96,7 +96,7 @@ smart_search/providers/zhipu_mcp.py,sha256=4XgckrHzwSdhUtMlTSvhVxrAA7Fr7QX_4BYWf
96
96
  smart_search/sciverse_schema.py,sha256=ml5iDXEpY7cnEMz74BGTo4yxX7UvPOe_i7w4Pi5t1wY,18178
97
97
  smart_search/service.py,sha256=ImjlAf5EQdD5Rt89651pJa-tfauVjA3uMHk5sUHuE_E,188360
98
98
  smart_search/skill_installer.py,sha256=CvM9GQShaTR8ttNhilx8Up0vVsHZfsnYD5uM7wZrzBs,21782
99
- smart_search/skill_maintenance.py,sha256=DSNe1L5URx5vlupb56G5z96oE9hHpgl5wYUmjhkvMGQ,7687
99
+ smart_search/skill_maintenance.py,sha256=2s2-1ZEEjRg2MfRKlaw6Y51OO86kOf9axl7fW6KMv0g,8818
100
100
  smart_search/sources.py,sha256=WvyRXqX_IdbDPpsqcSbulipxNtZvQbWv1MsZ2Ud5bTY,14376
101
101
  smart_search/state_files.py,sha256=K02dlR3Xuj2vIkRiEdrFr3OSiEsPxN5_HSo4NTmz0sc,2063
102
102
  smart_search/ui_api.py,sha256=x3ULS415MPjZ96iZSOeNK4npzOLJ6GK_DymYi6_tPgA,10027
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@konbakuyomu/smart-search",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "description": "CLI-first multi-source web research with xAI/OpenAI-compatible search, Exa, Context7, Zhipu, Tavily, Firecrawl, and Deep Research planning.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/konbakuyomu/smartsearch#readme",
@@ -39,11 +39,11 @@
39
39
  },
40
40
  "smartSearchBinary": true,
41
41
  "optionalDependencies": {
42
- "@konbakuyomu/smart-search-darwin-x64": "0.1.27",
43
- "@konbakuyomu/smart-search-darwin-arm64": "0.1.27",
44
- "@konbakuyomu/smart-search-win32-x64": "0.1.27",
45
- "@konbakuyomu/smart-search-win32-arm64": "0.1.27",
46
- "@konbakuyomu/smart-search-linux-x64": "0.1.27",
47
- "@konbakuyomu/smart-search-linux-arm64": "0.1.27"
42
+ "@konbakuyomu/smart-search-darwin-x64": "0.1.28",
43
+ "@konbakuyomu/smart-search-darwin-arm64": "0.1.28",
44
+ "@konbakuyomu/smart-search-win32-x64": "0.1.28",
45
+ "@konbakuyomu/smart-search-win32-arm64": "0.1.28",
46
+ "@konbakuyomu/smart-search-linux-x64": "0.1.28",
47
+ "@konbakuyomu/smart-search-linux-arm64": "0.1.28"
48
48
  }
49
49
  }
Binary file