@happyrobot-ai/sdk 0.1.34 → 0.1.35
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
|
@@ -2,15 +2,24 @@
|
|
|
2
2
|
* Audit remark resource — client.auditRemarks.*
|
|
3
3
|
*
|
|
4
4
|
* Maps to:
|
|
5
|
+
* GET /audit-remarks/:audit_remark_id
|
|
6
|
+
* GET /workflows/:workflow_id/audits/remarks
|
|
5
7
|
* GET /audit-remarks/:audit_remark_id/feedback
|
|
6
8
|
* POST /audit-remarks/:audit_remark_id/feedback
|
|
7
9
|
* DELETE /audit-remarks/:audit_remark_id/feedback
|
|
8
10
|
*/
|
|
9
11
|
import type { HttpClient } from "../core/http";
|
|
10
|
-
import type { AuditRemarkFeedback, SubmitAuditRemarkFeedbackBody } from "../types/audit-remarks.types";
|
|
12
|
+
import type { AuditRemarkDetail, AuditRemarkFeedback, ListWorkflowAuditRemarksQuery, ListWorkflowAuditRemarksResponse, SubmitAuditRemarkFeedbackBody } from "../types/audit-remarks.types";
|
|
11
13
|
export declare class AuditRemarksResource {
|
|
12
14
|
private readonly http;
|
|
13
15
|
constructor(http: HttpClient);
|
|
16
|
+
/** Get a single behavioral audit remark by ID. */
|
|
17
|
+
get(auditRemarkId: string): Promise<AuditRemarkDetail>;
|
|
18
|
+
/**
|
|
19
|
+
* List audit remarks across all northstar criteria for a workflow.
|
|
20
|
+
* Cursor-paginated; optionally filter by northstar, grade, or status.
|
|
21
|
+
*/
|
|
22
|
+
listByWorkflow(workflowId: string, query?: ListWorkflowAuditRemarksQuery): Promise<ListWorkflowAuditRemarksResponse>;
|
|
14
23
|
/** Get the current user's feedback for an audit remark, or null if none exists. */
|
|
15
24
|
getFeedback(auditRemarkId: string): Promise<AuditRemarkFeedback | null>;
|
|
16
25
|
/** Submit a thumbs up/down for an audit remark. */
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
* Audit remark resource — client.auditRemarks.*
|
|
4
4
|
*
|
|
5
5
|
* Maps to:
|
|
6
|
+
* GET /audit-remarks/:audit_remark_id
|
|
7
|
+
* GET /workflows/:workflow_id/audits/remarks
|
|
6
8
|
* GET /audit-remarks/:audit_remark_id/feedback
|
|
7
9
|
* POST /audit-remarks/:audit_remark_id/feedback
|
|
8
10
|
* DELETE /audit-remarks/:audit_remark_id/feedback
|
|
@@ -14,6 +16,24 @@ class AuditRemarksResource {
|
|
|
14
16
|
constructor(http) {
|
|
15
17
|
this.http = http;
|
|
16
18
|
}
|
|
19
|
+
/** Get a single behavioral audit remark by ID. */
|
|
20
|
+
async get(auditRemarkId) {
|
|
21
|
+
return this.http.request({
|
|
22
|
+
method: "GET",
|
|
23
|
+
path: `/audit-remarks/${enc(auditRemarkId)}`,
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* List audit remarks across all northstar criteria for a workflow.
|
|
28
|
+
* Cursor-paginated; optionally filter by northstar, grade, or status.
|
|
29
|
+
*/
|
|
30
|
+
async listByWorkflow(workflowId, query) {
|
|
31
|
+
return this.http.request({
|
|
32
|
+
method: "GET",
|
|
33
|
+
path: `/workflows/${enc(workflowId)}/audits/remarks`,
|
|
34
|
+
query: query,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
17
37
|
/** Get the current user's feedback for an audit remark, or null if none exists. */
|
|
18
38
|
async getFeedback(auditRemarkId) {
|
|
19
39
|
return this.http.request({
|
|
@@ -1,6 +1,69 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Audit remark types.
|
|
3
3
|
*/
|
|
4
|
+
export type AuditRemarkGrade = "passed" | "failed" | "not_applicable";
|
|
5
|
+
export type AuditRemarkStatus = "open" | "resolved" | "dismissed";
|
|
6
|
+
export interface AuditRemarkMessage {
|
|
7
|
+
role: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export interface AuditRemarkUserFeedback {
|
|
11
|
+
polarity: boolean;
|
|
12
|
+
issue_attribution: string | null;
|
|
13
|
+
}
|
|
14
|
+
/** A single behavioral audit remark with full detail. */
|
|
15
|
+
export interface AuditRemarkDetail {
|
|
16
|
+
id: string;
|
|
17
|
+
run_id: string;
|
|
18
|
+
run_url: string;
|
|
19
|
+
timestamp: string;
|
|
20
|
+
updated_at: string;
|
|
21
|
+
grade: AuditRemarkGrade;
|
|
22
|
+
passed?: boolean | null;
|
|
23
|
+
status: AuditRemarkStatus;
|
|
24
|
+
category: string;
|
|
25
|
+
northstar_id: string;
|
|
26
|
+
northstar_name: string;
|
|
27
|
+
use_case_id: string;
|
|
28
|
+
node_id: string | null;
|
|
29
|
+
message_ids: string[];
|
|
30
|
+
messages: AuditRemarkMessage[];
|
|
31
|
+
correction: string | null;
|
|
32
|
+
correction_reason: string | null;
|
|
33
|
+
org_id: string;
|
|
34
|
+
user_feedback?: AuditRemarkUserFeedback | null;
|
|
35
|
+
}
|
|
36
|
+
/** A remark as returned by the workflow-wide listing (no use_case/node/category). */
|
|
37
|
+
export interface WorkflowAuditRemark {
|
|
38
|
+
id: string;
|
|
39
|
+
run_id: string;
|
|
40
|
+
run_url: string;
|
|
41
|
+
timestamp: string;
|
|
42
|
+
grade: AuditRemarkGrade;
|
|
43
|
+
passed?: boolean | null;
|
|
44
|
+
status: AuditRemarkStatus;
|
|
45
|
+
northstar_id: string;
|
|
46
|
+
northstar_name: string;
|
|
47
|
+
message_ids: string[];
|
|
48
|
+
messages: AuditRemarkMessage[];
|
|
49
|
+
correction: string | null;
|
|
50
|
+
correction_reason: string | null;
|
|
51
|
+
org_id: string;
|
|
52
|
+
user_feedback?: AuditRemarkUserFeedback | null;
|
|
53
|
+
}
|
|
54
|
+
export interface ListWorkflowAuditRemarksQuery {
|
|
55
|
+
northstar_id?: string;
|
|
56
|
+
grade?: AuditRemarkGrade;
|
|
57
|
+
status?: AuditRemarkStatus;
|
|
58
|
+
cursor?: string;
|
|
59
|
+
/** 1–100, default 25. */
|
|
60
|
+
limit?: number;
|
|
61
|
+
}
|
|
62
|
+
export interface ListWorkflowAuditRemarksResponse {
|
|
63
|
+
data: WorkflowAuditRemark[];
|
|
64
|
+
next_cursor: string | null;
|
|
65
|
+
total: number;
|
|
66
|
+
}
|
|
4
67
|
export interface AuditRemarkFeedback {
|
|
5
68
|
id: string;
|
|
6
69
|
polarity: boolean;
|