meshapi-code 0.4.1__py3-none-any.whl → 0.4.2__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.
meshapi/__init__.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.4.1"
1
+ __version__ = "0.4.2"
meshapi/tools.py CHANGED
@@ -212,6 +212,18 @@ def execute(name: str, arguments: dict) -> str:
212
212
  path = arguments.get("path")
213
213
  if not path:
214
214
  return "Error: read_file requires a `path` argument."
215
+ # Guard against reading an image as text — return a helpful message
216
+ # so the model directs the user to /image instead of looping on a
217
+ # utf-8 decode error.
218
+ suffix = Path(path).suffix.lower()
219
+ if suffix in (".png", ".jpg", ".jpeg", ".gif", ".webp"):
220
+ return (
221
+ f"Error: {Path(path).name} is an image file and read_file only "
222
+ "reads text. Tell the user to attach the image instead — either "
223
+ f"by typing `/image {path}` or by including the path in their "
224
+ "next prompt (auto-attach picks up paths starting with /, ~, "
225
+ "./, ../, or http(s)://)."
226
+ )
215
227
  try:
216
228
  return Path(path).expanduser().read_text()
217
229
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: meshapi-code
3
- Version: 0.4.1
3
+ Version: 0.4.2
4
4
  Summary: Terminal chat for Mesh API — OpenAI-compatible LLM gateway
5
5
  Project-URL: Homepage, https://meshapi.ai
6
6
  Project-URL: Documentation, https://docs.meshapi.ai
@@ -1,4 +1,4 @@
1
- meshapi/__init__.py,sha256=pMtTmSUht-XtbR_7Doz6bsQqopJJd8rZ8I8zy2HwwoA,22
1
+ meshapi/__init__.py,sha256=6hfVa12Q-nXyUEXr6SyKpqPEDJW6vlRHyPxlA27PfTs,22
2
2
  meshapi/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
3
3
  meshapi/attachments.py,sha256=Mpsxm66QT_cJV4TXlnYU23ZhFm4vdzFEyXDenXjxpEU,5475
4
4
  meshapi/cli.py,sha256=N2uqztGWVCP3z6_kkPKUieWIiTrg187LN5Zy5640e_k,37447
@@ -10,10 +10,10 @@ meshapi/permissions.py,sha256=BPLYiPrlLR1js9k64szm9b11fXYx0ZZcQ2a08GLNRg8,1033
10
10
  meshapi/plan.py,sha256=JWgzm2Qtbdso7nnoR7K896d7n7ufwlhT-2F09PGXXKs,2561
11
11
  meshapi/render.py,sha256=VwgDbYSElwEJ0WhSMpRZ8Tw_EA0A09s8D4yVh_nUL3o,4737
12
12
  meshapi/statusbar.py,sha256=yqF6fzCaZMXMzUmX1vzmKWAMbCe_YRsbnA27meA3vaw,1361
13
- meshapi/tools.py,sha256=OKJkLiJMDBiHss4FymoysrK7QsVP3yHhdh_4Mmmk9f4,13036
14
- meshapi_code-0.4.1.dist-info/METADATA,sha256=yegzqYueiE0cOvtC6DWirpfV3Vn9f___2tYs4_VmyKs,7595
15
- meshapi_code-0.4.1.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
16
- meshapi_code-0.4.1.dist-info/entry_points.txt,sha256=ZCXZ_SgrhWIQEHSjAXz0pUlyGbIQKZ68vp_Cg1Y0rME,45
17
- meshapi_code-0.4.1.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
18
- meshapi_code-0.4.1.dist-info/licenses/NOTICE,sha256=wF-6Apse4eVIOpbNP3WLtTaOJClNFK7Jok2BnUvSo9U,191
19
- meshapi_code-0.4.1.dist-info/RECORD,,
13
+ meshapi/tools.py,sha256=lL8oxj7uxCyojmRvgjlzZSxs-DoIc8fhxnhiuNfm3RA,13728
14
+ meshapi_code-0.4.2.dist-info/METADATA,sha256=gCzLZHiASN2ljGD_CXxQpphNq5YKtWh4La50cxl69Tw,7595
15
+ meshapi_code-0.4.2.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
16
+ meshapi_code-0.4.2.dist-info/entry_points.txt,sha256=ZCXZ_SgrhWIQEHSjAXz0pUlyGbIQKZ68vp_Cg1Y0rME,45
17
+ meshapi_code-0.4.2.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
18
+ meshapi_code-0.4.2.dist-info/licenses/NOTICE,sha256=wF-6Apse4eVIOpbNP3WLtTaOJClNFK7Jok2BnUvSo9U,191
19
+ meshapi_code-0.4.2.dist-info/RECORD,,