@nirmos/sdk 0.3.4 → 0.3.5

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Nirmos TypeScript SDK
2
2
 
3
- Documentation and offline checks target SDK **0.3.3**.
3
+ Documentation and offline checks track the version in [package.json](./package.json).
4
4
 
5
5
  One client for Nirmos management and AI execution. Works in modern browsers and Node 18+ with ESM/CommonJS; no runtime dependencies.
6
6
 
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
4
  // Generated from package.json by scripts/generate-version.mjs.
5
- exports.SDK_VERSION = "0.3.4";
5
+ exports.SDK_VERSION = "0.3.5";
6
6
  //# sourceMappingURL=version.js.map
@@ -1,2 +1,2 @@
1
- export declare const SDK_VERSION = "0.3.4";
1
+ export declare const SDK_VERSION = "0.3.5";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,3 +1,3 @@
1
1
  // Generated from package.json by scripts/generate-version.mjs.
2
- export const SDK_VERSION = "0.3.4";
2
+ export const SDK_VERSION = "0.3.5";
3
3
  //# sourceMappingURL=version.js.map
@@ -94,6 +94,7 @@ const sdk = new Nirmos({
94
94
  JSON.stringify({
95
95
  id: "run",
96
96
  status: ++polls === 1 ? "RUNNING" : "COMPLETED",
97
+ summary: polls === 1 ? null : { overallPassRate: 0.5, byEvaluator: { exact_match: { count: 2, passRate: 0.5, average: null } } },
97
98
  }),
98
99
  );
99
100
  if (path === "/v1/evaluations/runs/run/results") {
@@ -143,6 +144,7 @@ assert.deepEqual(
143
144
  result.results.data.map((trial) => trial.scores[0].passed),
144
145
  [true, false],
145
146
  );
147
+ assert.equal(result.summary.overallPassRate, 0.5);
146
148
  assert.equal(archived.length, 3);
147
149
  console.log(
148
150
  "Offline workflow verified: two cases, pinned versions, mappings, polling, true/false scores and archive.",
@@ -167,7 +167,12 @@ export async function evaluationQuickstart(client, options) {
167
167
  trial.scores.some((score) => score.status !== "COMPLETED" || score.error))) {
168
168
  throw new Error("Run ended with missing or failed trials/scores; inspect results");
169
169
  }
170
- return { runId, results }; // passed:false is a valid evaluation outcome.
170
+ // Runtime GET returns persisted aggregates after terminal processing.
171
+ const summary = run.summary;
172
+ if (!summary || typeof summary.overallPassRate !== "number")
173
+ throw new Error("Missing aggregate scores; inspect the terminal run");
174
+ console.log({ overallPassRate: summary.overallPassRate, byEvaluator: summary.byEvaluator });
175
+ return { runId, results, summary }; // passed:false is a valid evaluation outcome.
171
176
  }
172
177
  await new Promise((resolve) => setTimeout(resolve, options.pollMs ?? 2000));
173
178
  }
@@ -202,7 +202,12 @@ export async function evaluationQuickstart(
202
202
  "Run ended with missing or failed trials/scores; inspect results",
203
203
  );
204
204
  }
205
- return { runId, results }; // passed:false is a valid evaluation outcome.
205
+ // Runtime GET returns persisted aggregates after terminal processing.
206
+ const summary = run.summary;
207
+ if (!summary || typeof summary.overallPassRate !== "number")
208
+ throw new Error("Missing aggregate scores; inspect the terminal run");
209
+ console.log({ overallPassRate: summary.overallPassRate, byEvaluator: summary.byEvaluator });
210
+ return { runId, results, summary }; // passed:false is a valid evaluation outcome.
206
211
  }
207
212
  await new Promise((resolve) =>
208
213
  setTimeout(resolve, options.pollMs ?? 2000),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nirmos/sdk",
3
- "version": "0.3.4",
3
+ "version": "0.3.5",
4
4
  "description": "Official TypeScript SDK for the Nirmos AI platform.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -1,2 +1,2 @@
1
1
  // Generated from package.json by scripts/generate-version.mjs.
2
- export const SDK_VERSION = "0.3.4";
2
+ export const SDK_VERSION = "0.3.5";