@benchsdk/client 0.4.0 → 0.5.2
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 +2 -0
- package/dist/index.cjs +7 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -3
- package/dist/index.d.ts +13 -3
- package/dist/index.js +5 -20
- package/dist/index.js.map +1 -1
- package/package.json +9 -10
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# @benchsdk/client
|
|
2
2
|
|
|
3
|
+
> **Backwards-compatibility shim.** `@benchsdk/client` re-exports the full `@benchsdk/runner` surface and preserves the legacy `createBenchmarkClient().runWorker(options)` spelling. New projects should import from `@benchsdk/runner` for authoring/operator helpers or `@benchsdk/api` for raw REST types.
|
|
4
|
+
|
|
3
5
|
Client and worker helpers for the ComputeSDK benchmark orchestrator.
|
|
4
6
|
|
|
5
7
|
This package talks to the platform-owned benchmark/run/participant/worker API. It does not mint canonical run, worker, attempt, event, or task IDs. Workers claim platform-assigned work, execute task indexes in their assigned range, and send `task_results` batches back to the platform.
|
package/dist/index.cjs
CHANGED
|
@@ -15,44 +15,29 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
15
|
}
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
19
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
20
|
|
|
20
21
|
// src/index.ts
|
|
21
22
|
var src_exports = {};
|
|
22
23
|
__export(src_exports, {
|
|
23
|
-
|
|
24
|
-
BenchmarkReporter: () => import_worker2.BenchmarkReporter,
|
|
25
|
-
claimBenchmarkReporter: () => import_worker2.claimBenchmarkReporter,
|
|
26
|
-
createBenchmarkClient: () => createBenchmarkClient,
|
|
27
|
-
createSystemMetricsCollector: () => import_worker2.createSystemMetricsCollector,
|
|
28
|
-
filterParticipantsByEnv: () => import_worker2.filterParticipantsByEnv,
|
|
29
|
-
runWorker: () => import_worker2.runWorker,
|
|
30
|
-
selectParticipants: () => import_worker2.selectParticipants
|
|
24
|
+
createBenchmarkClient: () => createBenchmarkClient
|
|
31
25
|
});
|
|
32
26
|
module.exports = __toCommonJS(src_exports);
|
|
27
|
+
__reExport(src_exports, require("@benchsdk/runner"), module.exports);
|
|
33
28
|
|
|
34
29
|
// src/client.ts
|
|
35
|
-
var
|
|
36
|
-
var import_worker = require("@benchsdk/worker");
|
|
30
|
+
var import_runner = require("@benchsdk/runner");
|
|
37
31
|
function createBenchmarkClient(config = {}) {
|
|
38
|
-
const apiClient = (0,
|
|
32
|
+
const apiClient = (0, import_runner.createBenchmarkClient)(config);
|
|
39
33
|
return {
|
|
40
34
|
...apiClient,
|
|
41
|
-
runWorker: (options) => (0,
|
|
35
|
+
runWorker: (options) => (0, import_runner.runWorker)(apiClient, options)
|
|
42
36
|
};
|
|
43
37
|
}
|
|
44
|
-
|
|
45
|
-
// src/index.ts
|
|
46
|
-
var import_worker2 = require("@benchsdk/worker");
|
|
47
38
|
// Annotate the CommonJS export names for ESM import in node:
|
|
48
39
|
0 && (module.exports = {
|
|
49
|
-
BenchmarkApiError,
|
|
50
|
-
BenchmarkReporter,
|
|
51
|
-
claimBenchmarkReporter,
|
|
52
40
|
createBenchmarkClient,
|
|
53
|
-
|
|
54
|
-
filterParticipantsByEnv,
|
|
55
|
-
runWorker,
|
|
56
|
-
selectParticipants
|
|
41
|
+
...require("@benchsdk/runner")
|
|
57
42
|
});
|
|
58
43
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/client.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts"],"sourcesContent":["/**\n * @deprecated `@benchsdk/client` is a backwards-compatibility shim over\n * `@benchsdk/runner`. New code should import from `@benchsdk/runner`.\n */\nexport * from '@benchsdk/runner';\nexport { createBenchmarkClient } from './client.js';\nexport type { BenchmarkClient, BenchmarkClientConfig } from './client.js';\n","import { createBenchmarkClient as createApiClient, BenchmarkApiError, runWorker } from '@benchsdk/runner';\nimport type {\n BenchmarkClient as BenchmarkApiClient,\n BenchmarkClientConfig,\n RunWorkerOptions,\n RunWorkerResult,\n} from '@benchsdk/runner';\n\nexport { BenchmarkApiError };\n\n/**\n * @deprecated `@benchsdk/client` is a backwards-compatibility shim. The\n * `runWorker` method is available here for existing callers; new code should\n * import `runWorker` from `@benchsdk/runner` directly.\n */\nexport type BenchmarkClient = BenchmarkApiClient & {\n runWorker(options: RunWorkerOptions): Promise<RunWorkerResult>;\n};\n\nexport type { BenchmarkClientConfig };\n\n/**\n * @deprecated Use `createBenchmarkClient` from `@benchsdk/runner` and call\n * `runWorker(client, options)` instead. This wrapper only exists to preserve the\n * `client.runWorker(...)` spelling used by older `@benchsdk/client` consumers.\n */\nexport function createBenchmarkClient(config: BenchmarkClientConfig = {}): BenchmarkClient {\n const apiClient = createApiClient(config);\n return {\n ...apiClient,\n runWorker: (options: RunWorkerOptions) => runWorker(apiClient, options),\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,wBAAc,6BAJd;;;ACAA,oBAAuF;AA0BhF,SAAS,sBAAsB,SAAgC,CAAC,GAAoB;AACzF,QAAM,gBAAY,cAAAA,uBAAgB,MAAM;AACxC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW,CAAC,gBAA8B,yBAAU,WAAW,OAAO;AAAA,EACxE;AACF;","names":["createApiClient"]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { BenchmarkClient as BenchmarkClient$1, RunWorkerOptions, RunWorkerResult, BenchmarkClientConfig } from '@benchsdk/
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
1
|
+
import { BenchmarkClient as BenchmarkClient$1, RunWorkerOptions, RunWorkerResult, BenchmarkClientConfig } from '@benchsdk/runner';
|
|
2
|
+
export * from '@benchsdk/runner';
|
|
3
|
+
export { BenchmarkClientConfig } from '@benchsdk/runner';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated `@benchsdk/client` is a backwards-compatibility shim. The
|
|
7
|
+
* `runWorker` method is available here for existing callers; new code should
|
|
8
|
+
* import `runWorker` from `@benchsdk/runner` directly.
|
|
9
|
+
*/
|
|
5
10
|
type BenchmarkClient = BenchmarkClient$1 & {
|
|
6
11
|
runWorker(options: RunWorkerOptions): Promise<RunWorkerResult>;
|
|
7
12
|
};
|
|
8
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `createBenchmarkClient` from `@benchsdk/runner` and call
|
|
16
|
+
* `runWorker(client, options)` instead. This wrapper only exists to preserve the
|
|
17
|
+
* `client.runWorker(...)` spelling used by older `@benchsdk/client` consumers.
|
|
18
|
+
*/
|
|
9
19
|
declare function createBenchmarkClient(config?: BenchmarkClientConfig): BenchmarkClient;
|
|
10
20
|
|
|
11
21
|
export { type BenchmarkClient, createBenchmarkClient };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import { BenchmarkClient as BenchmarkClient$1, RunWorkerOptions, RunWorkerResult, BenchmarkClientConfig } from '@benchsdk/
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
1
|
+
import { BenchmarkClient as BenchmarkClient$1, RunWorkerOptions, RunWorkerResult, BenchmarkClientConfig } from '@benchsdk/runner';
|
|
2
|
+
export * from '@benchsdk/runner';
|
|
3
|
+
export { BenchmarkClientConfig } from '@benchsdk/runner';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated `@benchsdk/client` is a backwards-compatibility shim. The
|
|
7
|
+
* `runWorker` method is available here for existing callers; new code should
|
|
8
|
+
* import `runWorker` from `@benchsdk/runner` directly.
|
|
9
|
+
*/
|
|
5
10
|
type BenchmarkClient = BenchmarkClient$1 & {
|
|
6
11
|
runWorker(options: RunWorkerOptions): Promise<RunWorkerResult>;
|
|
7
12
|
};
|
|
8
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `createBenchmarkClient` from `@benchsdk/runner` and call
|
|
16
|
+
* `runWorker(client, options)` instead. This wrapper only exists to preserve the
|
|
17
|
+
* `client.runWorker(...)` spelling used by older `@benchsdk/client` consumers.
|
|
18
|
+
*/
|
|
9
19
|
declare function createBenchmarkClient(config?: BenchmarkClientConfig): BenchmarkClient;
|
|
10
20
|
|
|
11
21
|
export { type BenchmarkClient, createBenchmarkClient };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@benchsdk/runner";
|
|
3
|
+
|
|
1
4
|
// src/client.ts
|
|
2
|
-
import { createBenchmarkClient as createApiClient, BenchmarkApiError } from "@benchsdk/
|
|
3
|
-
import { runWorker } from "@benchsdk/worker";
|
|
5
|
+
import { createBenchmarkClient as createApiClient, BenchmarkApiError, runWorker } from "@benchsdk/runner";
|
|
4
6
|
function createBenchmarkClient(config = {}) {
|
|
5
7
|
const apiClient = createApiClient(config);
|
|
6
8
|
return {
|
|
@@ -8,24 +10,7 @@ function createBenchmarkClient(config = {}) {
|
|
|
8
10
|
runWorker: (options) => runWorker(apiClient, options)
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
|
|
12
|
-
// src/index.ts
|
|
13
|
-
import {
|
|
14
|
-
BenchmarkReporter,
|
|
15
|
-
claimBenchmarkReporter,
|
|
16
|
-
createSystemMetricsCollector,
|
|
17
|
-
filterParticipantsByEnv,
|
|
18
|
-
runWorker as runWorker2,
|
|
19
|
-
selectParticipants
|
|
20
|
-
} from "@benchsdk/worker";
|
|
21
13
|
export {
|
|
22
|
-
|
|
23
|
-
BenchmarkReporter,
|
|
24
|
-
claimBenchmarkReporter,
|
|
25
|
-
createBenchmarkClient,
|
|
26
|
-
createSystemMetricsCollector,
|
|
27
|
-
filterParticipantsByEnv,
|
|
28
|
-
runWorker2 as runWorker,
|
|
29
|
-
selectParticipants
|
|
14
|
+
createBenchmarkClient
|
|
30
15
|
};
|
|
31
16
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/client.ts"],"sourcesContent":["/**\n * @deprecated `@benchsdk/client` is a backwards-compatibility shim over\n * `@benchsdk/runner`. New code should import from `@benchsdk/runner`.\n */\nexport * from '@benchsdk/runner';\nexport { createBenchmarkClient } from './client.js';\nexport type { BenchmarkClient, BenchmarkClientConfig } from './client.js';\n","import { createBenchmarkClient as createApiClient, BenchmarkApiError, runWorker } from '@benchsdk/runner';\nimport type {\n BenchmarkClient as BenchmarkApiClient,\n BenchmarkClientConfig,\n RunWorkerOptions,\n RunWorkerResult,\n} from '@benchsdk/runner';\n\nexport { BenchmarkApiError };\n\n/**\n * @deprecated `@benchsdk/client` is a backwards-compatibility shim. The\n * `runWorker` method is available here for existing callers; new code should\n * import `runWorker` from `@benchsdk/runner` directly.\n */\nexport type BenchmarkClient = BenchmarkApiClient & {\n runWorker(options: RunWorkerOptions): Promise<RunWorkerResult>;\n};\n\nexport type { BenchmarkClientConfig };\n\n/**\n * @deprecated Use `createBenchmarkClient` from `@benchsdk/runner` and call\n * `runWorker(client, options)` instead. This wrapper only exists to preserve the\n * `client.runWorker(...)` spelling used by older `@benchsdk/client` consumers.\n */\nexport function createBenchmarkClient(config: BenchmarkClientConfig = {}): BenchmarkClient {\n const apiClient = createApiClient(config);\n return {\n ...apiClient,\n runWorker: (options: RunWorkerOptions) => runWorker(apiClient, options),\n };\n}\n"],"mappings":";AAIA,cAAc;;;ACJd,SAAS,yBAAyB,iBAAiB,mBAAmB,iBAAiB;AA0BhF,SAAS,sBAAsB,SAAgC,CAAC,GAAoB;AACzF,QAAM,YAAY,gBAAgB,MAAM;AACxC,SAAO;AAAA,IACL,GAAG;AAAA,IACH,WAAW,CAAC,YAA8B,UAAU,WAAW,OAAO;AAAA,EACxE;AACF;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@benchsdk/client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Client and worker helpers for the ComputeSDK benchmark orchestrator",
|
|
@@ -39,17 +39,16 @@
|
|
|
39
39
|
"node": ">=18.0.0"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@benchsdk/
|
|
43
|
-
"@benchsdk/worker": "0.2.0"
|
|
42
|
+
"@benchsdk/runner": "0.5.2"
|
|
44
43
|
},
|
|
45
44
|
"devDependencies": {
|
|
46
|
-
"@types/node": "^20.
|
|
47
|
-
"@vitest/coverage-v8": "^1.
|
|
48
|
-
"eslint": "^8.
|
|
49
|
-
"rimraf": "^5.0.
|
|
50
|
-
"tsup": "^8.
|
|
51
|
-
"typescript": "^5.
|
|
52
|
-
"vitest": "^1.
|
|
45
|
+
"@types/node": "^20.19.43",
|
|
46
|
+
"@vitest/coverage-v8": "^1.6.1",
|
|
47
|
+
"eslint": "^8.57.1",
|
|
48
|
+
"rimraf": "^5.0.10",
|
|
49
|
+
"tsup": "^8.5.1",
|
|
50
|
+
"typescript": "^5.9.3",
|
|
51
|
+
"vitest": "^1.6.1"
|
|
53
52
|
},
|
|
54
53
|
"scripts": {
|
|
55
54
|
"build": "tsup",
|