dsh-origin-bridge 0.4.0 → 0.4.1

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/asciiio.py CHANGED
@@ -3,7 +3,7 @@
3
3
  Why not just originpro's from_file: Origin's ASCII import is fussy about
4
4
  multi-row headers, '#'/'//' comment lines and space-aligned columns, and it
5
5
  fails by producing an empty sheet rather than an error. Why not the original
6
- optima-plot read_dat: it splits on TAB only, so space- or comma-aligned .dat
6
+ the old read_dat: it splits on TAB only, so space- or comma-aligned .dat
7
7
  files silently turn into a single NaN column.
8
8
 
9
9
  This reader sniffs the delimiter, handles BOM and GBK, skips comment lines, and
package/edge_checks.py CHANGED
@@ -164,7 +164,7 @@ def main():
164
164
  proc.stdin.flush()
165
165
  line = proc.stdout.readline()
166
166
  info = json.loads(line)["result"]["serverInfo"]
167
- check("bin/origin-bridge.mjs launcher", info.get("name") == "optima-plot", info)
167
+ check("bin/origin-bridge.mjs launcher", info.get("name") == "origin-bridge", info)
168
168
  except Exception as exc:
169
169
  check("bin/origin-bridge.mjs launcher", False, repr(exc)[:120])
170
170
  finally:
package/originlab.py CHANGED
@@ -891,7 +891,7 @@ def view(graph, width=900):
891
891
  raise OriginError("graph_not_found", "没有可预览的图页;先 origin_inspect 看页面")
892
892
  # Unique name: a fixed path would let two dsh sessions overwrite each
893
893
  # other's preview mid-read.
894
- fd, tmp = tempfile.mkstemp(prefix="optima_plot_view_", suffix=".png")
894
+ fd, tmp = tempfile.mkstemp(prefix="origin_bridge_view_", suffix=".png")
895
895
  os.close(fd)
896
896
  os.remove(tmp)
897
897
  # save_fig rejects a type that disagrees with the extension, and its
@@ -1097,7 +1097,7 @@ def _save_project(path=""):
1097
1097
  # Never default to the process CWD: under dsh that is the plugin's
1098
1098
  # node_modules folder, so an unnamed save would litter the install.
1099
1099
  target = os.path.join(_safe(lambda: op.path("u"), "") or os.getcwd(),
1100
- time.strftime("optima_plot_%Y%m%d_%H%M%S.opju"))
1100
+ time.strftime("origin_bridge_%Y%m%d_%H%M%S.opju"))
1101
1101
  if not target.lower().endswith((".opju", ".opj")):
1102
1102
  target += ".opju"
1103
1103
  os.makedirs(os.path.dirname(target) or ".", exist_ok=True)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-origin-bridge",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Drive local Origin/OriginPro from chat: import .dat/.csv/Excel/workstation .bin data, plot, fit, and save editable .opju projects. Third-party tool, not affiliated with or endorsed by OriginLab Corporation.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/server.py CHANGED
@@ -1,4 +1,4 @@
1
- """optima-plot MCP server.
1
+ """origin-bridge MCP server.
2
2
 
3
3
  Deliberately a synchronous, newline-delimited JSON-RPC loop over stdio instead
4
4
  of the official `mcp` SDK's asyncio transport: on Windows the SDK builds an
@@ -19,8 +19,8 @@ sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
19
19
 
20
20
  import originlab # noqa: E402
21
21
 
22
- SERVER_NAME = "optima-plot"
23
- SERVER_VERSION = "0.3.0"
22
+ SERVER_NAME = "origin-bridge"
23
+ SERVER_VERSION = "0.4.1"
24
24
  PROTOCOL = "2024-11-05"
25
25
 
26
26
 
package/smoke_test.py CHANGED
@@ -241,7 +241,7 @@ def main():
241
241
  lyr.get("layer_name_from_origin"))
242
242
  check("add_layer proof", lyr.get("proof_level") == "verified", lyr.get("proof_level"))
243
243
 
244
- # --- merged from optima-plot: multi-series, dual-Y, legend, matrix, presets ---
244
+ # --- merged features: multi-series, dual-Y, legend, matrix, presets ---
245
245
  ms = rpc.tool("origin_plot", {"worksheet": wb["worksheet"], "x": 1, "y": [2, 3],
246
246
  "plot_type": "line_symbol"})
247
247
  check("multi-series in one layer", ms.get("ok") and ms.get("plots_in_layer") == 2
@@ -318,7 +318,7 @@ def main():
318
318
 
319
319
  import tempfile as _tf
320
320
  def _previews():
321
- return len([f for f in os.listdir(_tf.gettempdir()) if f.startswith("optima_plot_view_")])
321
+ return len([f for f in os.listdir(_tf.gettempdir()) if f.startswith("origin_bridge_view_")])
322
322
  before = _previews()
323
323
  vw = rpc.tool("origin_view", {"graph": gr_handle, "width": 700})
324
324
  check("view returns image content", "image" in vw.get("_content_types", []) and vw.get("_image_len", 0) > 2000,
@@ -1,5 +1,5 @@
1
1
  """
2
- Optima-Plot Template Catalog.
2
+ Origin Bridge Template Catalog.
3
3
 
4
4
  A curated library of 30+ scientific chart templates inspired by the
5
5
  editaplot project. Each template declares:
@@ -744,7 +744,7 @@ def render_template(name: str, data_path: str, output_dir: str,
744
744
 
745
745
  # Make available at import time
746
746
  if __name__ == '__main__':
747
- print(f'Optima-Plot has {len(TEMPLATES)} templates:')
747
+ print(f'Origin Bridge has {len(TEMPLATES)} templates:')
748
748
  by_cat = {}
749
749
  for t in TEMPLATES:
750
750
  by_cat.setdefault(t['category'], []).append(t['name'])