@happyrobot-ai/sdk 0.1.14 → 0.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyrobot-ai/sdk",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "TypeScript SDK for the HappyRobot Public API",
5
5
  "main": "./index.js",
6
6
  "module": "./index.mjs",
@@ -11,7 +11,7 @@
11
11
  * GET /adversarial-tests/runs/:run_id/messages
12
12
  */
13
13
  import type { HttpClient } from "../core/http";
14
- import type { GetAdversarialTestResponse, PatchAdversarialTestBody, PatchAdversarialTestResponse, RunAdversarialTestBody, RunAdversarialTestResponse, ListAdversarialTestRunsResponse, ListAdversarialTestRunMessagesResponse } from "../types/adversarial-tests.types";
14
+ import type { AdversarialTestEffectiveScope, GetAdversarialTestResponse, PatchAdversarialTestBody, PatchAdversarialTestResponse, RunAdversarialTestBody, RunAdversarialTestResponse, ListAdversarialTestRunsResponse, ListAdversarialTestRunMessagesResponse } from "../types/adversarial-tests.types";
15
15
  export declare class AdversarialTestsResource {
16
16
  private readonly http;
17
17
  constructor(http: HttpClient);
@@ -33,4 +33,10 @@ export declare class AdversarialTestsResource {
33
33
  }>;
34
34
  /** Get the conversation messages from a test run. */
35
35
  getRunMessages(runId: string): Promise<ListAdversarialTestRunMessagesResponse>;
36
+ /**
37
+ * Get the resolved audit scope for a test — the northstar categories
38
+ * that BEA will grade against. Generated tests inherit suite scope;
39
+ * standalone tests carry their own.
40
+ */
41
+ getEffectiveScope(testId: string): Promise<AdversarialTestEffectiveScope>;
36
42
  }
@@ -70,6 +70,17 @@ class AdversarialTestsResource {
70
70
  path: `/adversarial-tests/runs/${enc(runId)}/messages`,
71
71
  });
72
72
  }
73
+ /**
74
+ * Get the resolved audit scope for a test — the northstar categories
75
+ * that BEA will grade against. Generated tests inherit suite scope;
76
+ * standalone tests carry their own.
77
+ */
78
+ async getEffectiveScope(testId) {
79
+ return this.http.request({
80
+ method: "GET",
81
+ path: `/adversarial-tests/${enc(testId)}/effective-scope`,
82
+ });
83
+ }
73
84
  }
74
85
  exports.AdversarialTestsResource = AdversarialTestsResource;
75
86
  function enc(s) {
@@ -7,8 +7,10 @@ import type { PatchAdversarialTestBodySchema, PatchAdversarialTestResponseSchema
7
7
  import type { RunAdversarialTestBodySchema, RunAdversarialTestResponseSchema } from "../../routes/adversarial-tests/run/post";
8
8
  import type { AdversarialTestRunMessageSchema, GetAdversarialTestRunMessagesResponseSchema } from "../../routes/adversarial-tests/runs/:run_id/messages/get";
9
9
  import type { AuditRemarkApiSchema, AdversarialTestRunApiSchema, GetAdversarialTestRunsResponseSchema } from "../../routes/adversarial-tests/runs/get";
10
+ import type { EffectiveScopeApiSchema } from "../../routes/adversarial-tests/effective-scope/get";
10
11
  import type { AdversarialTestApiSchema } from "../../routes/nodes/:node_id/adversarial-tests/get";
11
12
  export type AdversarialTest = z.infer<typeof AdversarialTestApiSchema>;
13
+ export type AdversarialTestEffectiveScope = z.infer<typeof EffectiveScopeApiSchema>;
12
14
  export type GetAdversarialTestResponse = z.infer<typeof GetAdversarialTestByIdResponseSchema>;
13
15
  export type PatchAdversarialTestBody = z.input<typeof PatchAdversarialTestBodySchema>;
14
16
  export type PatchAdversarialTestResponse = z.infer<typeof PatchAdversarialTestResponseSchema>;