@root-signals/scorable-cli 0.1.1 → 0.1.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.
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAGA,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,OAAO,CAAC,CAoDlB"}
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAMA,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE;IACR,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,GACA,OAAO,CAAC,OAAO,CAAC,CAoDlB"}
package/dist/client.js CHANGED
@@ -1,5 +1,7 @@
1
+ import { createRequire } from "node:module";
1
2
  import { getApiKey, getBaseUrl } from "./auth.js";
2
3
  import { printError, printJson } from "./output.js";
4
+ const { version } = createRequire(import.meta.url)("../package.json");
3
5
  export async function apiRequest(method, endpoint, options) {
4
6
  const apiKey = options?.apiKey ?? getApiKey();
5
7
  const baseUrl = options?.baseUrl ?? getBaseUrl();
@@ -16,7 +18,7 @@ export async function apiRequest(method, endpoint, options) {
16
18
  Authorization: `Api-Key ${apiKey}`,
17
19
  "Content-Type": "application/json",
18
20
  Accept: "application/json",
19
- "User-Agent": "scorable-cli/1.0",
21
+ "User-Agent": `scorable/${version}`,
20
22
  };
21
23
  let response;
22
24
  try {
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { registerJudgeCommands } from "./commands/judge/index.js";
4
4
  import { registerPromptTestCommands } from "./commands/prompt-test/index.js";
5
5
  export function createCli() {
6
6
  const program = new Command()
7
- .name("scorable-cli")
7
+ .name("scorable")
8
8
  .description("A CLI tool to interact with the Scorable API")
9
9
  .exitOverride();
10
10
  registerJudgeCommands(program);
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@root-signals/scorable-cli",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "CLI for Scorable",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Scorable",
7
7
  "bin": {
8
- "scorable": "./dist/index.js"
8
+ "scorable": "./dist/index.js",
9
+ "scorable-cli": "./dist/index.js"
9
10
  },
10
11
  "files": [
11
12
  "dist/**/*.js",