@delta-infra/cli 1.0.94 → 1.0.95

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/checksums.txt CHANGED
@@ -1,5 +1,5 @@
1
- 1a680424f9d53ec58263ca23f8b4e55404929cabc4e2313dc562325f684480f4 delta-cli-darwin-amd64.tar.gz
2
- da0d075b7fe9890449ff437159c52a741ba5eeb1f74d1adebdb4f432b8fafb27 delta-cli-darwin-arm64.tar.gz
3
- ff5c95b561247352645db84688d9694e0198b79203223b2b9d50189e1305dd25 delta-cli-linux-amd64.tar.gz
4
- d0cd2aa31ee177ec35e242674c822767f901b6d861c4da753c7cf3fd83b44877 delta-cli-linux-arm64.tar.gz
5
- 65984f247a4c45b44b29a905cf051c8fa19dc629eafc9cddc2e1a6eedfd2a52e delta-cli-windows-amd64.zip
1
+ 0b9863b2c604158b04f5684d664fea330bff12fec612e2cafbab41e0f2803d5a delta-cli-darwin-amd64.tar.gz
2
+ f5e1af65d56e92d1d85f1819170e9c9d4b9a91b486554ea18bc6d321d9a4b11a delta-cli-darwin-arm64.tar.gz
3
+ 61164a36cbee95f1afb8f9aae8ac68f1247bd1b305004389c27142a337e8a58d delta-cli-linux-amd64.tar.gz
4
+ a440b6a8c1d55b4c8135f0200969b40e91462819d2a92f2549219fd51cc89bf8 delta-cli-linux-arm64.tar.gz
5
+ 819126d165bdf8f34f187b498e5ce7e029a68f20c3c392422c1ffd7fe9d891ad delta-cli-windows-amd64.zip
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-infra/cli",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "Delta Infra CLI for sandbox compute and science tools.",
5
5
  "bin": {
6
6
  "delta-cli": "scripts/run.js"
@@ -85,6 +85,24 @@ var _MIRROR_LIST = [
85
85
  ["gh-proxy.com", "https://gh-proxy.com"],
86
86
  ];
87
87
 
88
+ // A safe "discard" output path for curl. /dev/null does not exist on Windows
89
+ // and makes curl fail with "client returned ERROR on write" (exit 23), which
90
+ // silently broke mirror probing on Windows. Use a throwaway temp file instead.
91
+ function discardOutputPath() {
92
+ if (process.platform !== "win32") return "/dev/null";
93
+ try {
94
+ return path.join(os.tmpdir(), "delta-cli-probe-" + process.pid + ".out");
95
+ } catch {
96
+ return "delta-cli-probe-" + process.pid + ".out";
97
+ }
98
+ }
99
+
100
+ function removeDiscardOutput(p) {
101
+ if (process.platform === "win32" && p) {
102
+ try { fs.unlinkSync(p); } catch {}
103
+ }
104
+ }
105
+
88
106
  // Quick connectivity check: fetch a small file (checksums.txt) from each
89
107
  // mirror and return only the ones that respond within the probe timeout.
90
108
  function probeMirrors(version, cb) {
@@ -113,10 +131,11 @@ function probeMirrors(version, cb) {
113
131
  var host = entry[0];
114
132
  var prefix = entry[1];
115
133
  var testUrl = prefix + probeUrl;
134
+ var discardPath = discardOutputPath();
116
135
  var args = [
117
136
  "--fail", "--location", "--silent", "--show-error",
118
137
  "--connect-timeout", "3", "--max-time", "5",
119
- "--output", "/dev/null", testUrl,
138
+ "--output", discardPath, testUrl,
120
139
  ];
121
140
  var child;
122
141
  try {
@@ -126,6 +145,7 @@ function probeMirrors(version, cb) {
126
145
  child.stdout.on("data", function(d) { stdout += d; });
127
146
  child.stderr.on("data", function(d) { stderr += d; });
128
147
  child.on("close", function(code) {
148
+ removeDiscardOutput(discardPath);
129
149
  if (code === 0) {
130
150
  results.push(prefix + "/https://github.com/" + REPO + "/releases/download/v" + version + "/" + archiveName);
131
151
  }
@@ -133,10 +153,12 @@ function probeMirrors(version, cb) {
133
153
  if (pending === 0) finish();
134
154
  });
135
155
  child.on("error", function() {
156
+ removeDiscardOutput(discardPath);
136
157
  pending--;
137
158
  if (pending === 0) finish();
138
159
  });
139
160
  } catch (e) {
161
+ removeDiscardOutput(discardPath);
140
162
  pending--;
141
163
  if (pending === 0) finish();
142
164
  }
@@ -150,7 +172,10 @@ function releaseAssetUrls(version, assetName, cb) {
150
172
  var urls = [];
151
173
  var mirror = process.env.DELTA_CLI_MIRROR || "";
152
174
  if (mirror) {
153
- urls.push("" + mirror.replace(/\/$/, "") + "/yzailab/delta-infra-cli/releases/download/v" + version + "/" + assetName);
175
+ // The mirror proxies the full GitHub release URL by prefixing it (same
176
+ // scheme the probed mirrors use, e.g. https://<mirror>/https://github.com/...).
177
+ // A bare "https://<mirror>/yzailab/..." 404s on these proxy-style mirrors.
178
+ urls.push("" + mirror.replace(/\/$/, "") + "/https://github.com/" + REPO + "/releases/download/v" + version + "/" + assetName);
154
179
  }
155
180
  // Probe mirrors in parallel first, then fallback
156
181
  probeMirrors(version, function(mirrorUrls) {
@@ -0,0 +1,49 @@
1
+ # skills/delta-science — Science Skill Package
2
+
3
+ **Parent:** `../AGENTS.md`
4
+
5
+ ## OVERVIEW
6
+
7
+ Single public `delta-science` skill: the company online-Science unified entrypoint. It is host-neutral and routed exclusively through `delta-cli science invoke -> Science Server`. Per-tool operation contracts live in `references/` and are loaded on demand; there are no separate planner-visible per-tool skills.
8
+
9
+ ## STRUCTURE
10
+
11
+ ```
12
+ delta-science/
13
+ ├── SKILL.md # single entrypoint: routing, CLI-only execution, cross-tool handoff
14
+ ├── agents/
15
+ │ └── openai.yaml # host agent registration
16
+ └── references/
17
+ ├── cli-contract.md # CLI envelope/exit-code contract
18
+ ├── routing-index.md # stable routing rules across tools
19
+ ├── workflows.md # multi-tool workflows
20
+ └── <tool>.md # per-tool operation contract (pubchem, rdkit, pymatgen, gsasii,
21
+ # lammps, delta-bo, ldm-bo, ldm, strbo, synbo, antbo, ...)
22
+ ```
23
+
24
+ ## WHERE TO LOOK
25
+
26
+ | Path | Content |
27
+ |------|---------|
28
+ | `SKILL.md` | Service boundary, 安全红线 (no curl/requests/httpx/browser direct gateway), invocation template, cross-tool handoff |
29
+ | `references/cli-contract.md` | `delta-cli science` envelope + exit-code contract; `ok:true` gate |
30
+ | `references/routing-index.md` | Which tool handles which science domain; stable routing |
31
+ | `references/<tool>.md` | Authoritative operation + request field schema per tool |
32
+
33
+ ## CONVENTIONS
34
+
35
+ - All science operations go through `delta-cli science invoke --tool T --endpoint E --data JSON`; no alternate routes
36
+ - Tool/endpoint names are exact contracts from the server DB — read the matching reference first; never invent fields/enums from memory
37
+ - Success is reported only when subprocess exit is 0 AND top-level JSON `ok` is `true`; `data` holds the service response
38
+ - `references/` holds operation contracts; `retired_skills` (old per-tool skills) are removed, not referenced
39
+ - Host-neutral: `delta-cli` is the sole service boundary; no host-specific tool/env dependencies
40
+ - Discover newly-deployed tools via `delta-cli science list` / `delta-cli science endpoints list <tool>`; do not copy the server registry into the Skill
41
+
42
+ ## ANTI-PATTERNS
43
+
44
+ - Do not call `curl`/`requests`/`httpx`/browser/PowerShell web directly against the gateway
45
+ - Do not bypass delta-cli via the legacy `large-discovery-model` Skill or gateway scripts
46
+ - Do not fabricate science data or mislabel local-tool (RDKit/pymatgen/LAMMPS/etc.) results as Science results
47
+ - Do not create extra JSON/CSV/report/image artifacts unless the user explicitly asks to save/export/plot
48
+ - Do not embed realistic credentials or API keys in examples
49
+ - Do not break relative links between SKILL.md and `references/`