@anybio/govern 0.0.0 → 0.2.1
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/CHANGELOG.md +30 -0
- package/LICENSE +202 -0
- package/NOTICE +5 -0
- package/README.md +374 -0
- package/dist/cli.js +1891 -0
- package/dist/client-CU46a__g.d.cts +1928 -0
- package/dist/client-CU46a__g.d.ts +1928 -0
- package/dist/index.cjs +1541 -0
- package/dist/index.d.cts +97 -0
- package/dist/index.d.ts +97 -0
- package/dist/index.js +1503 -0
- package/dist/langchain.cjs +1700 -0
- package/dist/langchain.d.cts +148 -0
- package/dist/langchain.d.ts +148 -0
- package/dist/langchain.js +1695 -0
- package/dist/vercel-ai.cjs +1725 -0
- package/dist/vercel-ai.d.cts +94 -0
- package/dist/vercel-ai.d.ts +94 -0
- package/dist/vercel-ai.js +1721 -0
- package/package.json +127 -6
- package/spec/openapi.json +3967 -0
- package/README +0 -3
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export { A as AUDIENCES, a as AckOptions, b as Audience, C as CHANNELS, c as Channel, D as DEFAULT_BASE_URL, d as DEFAULT_HOLD_MESSAGE, e as DEFAULT_MAX_RETRIES, f as DEFAULT_TIMEOUT_MS, g as Decision, h as DecisionStatus, i as DecisionVerdict, j as DecisionWebhookEvent, k as Disclosure, l as DisclosureAttachment, m as Draft, E as EvaluateInput, G as Govern, n as GovernEvent, o as GovernHandoffs, p as GovernOptions, q as GuardContext, r as GuardResult, H as Handoff, s as HandoffActionInput, t as HandoffContactInput, u as HandoffDetail, v as HandoffList, w as HandoffListQuery, x as HandoffRef, y as HandoffResolveInput, z as HandoffResumeInput, B as HandoffWebhookEvent, F as HeadersLike, I as IN_SESSION_CHANNELS, J as InboundFlag, K as InboundMessage, M as MAX_CONVERSATION_ID_CHARS, L as MAX_TURN_ID_CHARS, N as Mode, O as Outcome, P as PatientConsentInput, Q as PatientOptOutInput, R as PolicyRef, S as REASONS, T as RESERVED_TURN_ID_PREFIX, U as RecordDisclosureInput, V as ReleaseResult, W as ReportOutcomeInput, X as ReviewState, Y as Schemas, Z as StopClass, _ as SubmitTranscriptsInput, $ as TRANSIENT_HTTP_STATUSES, a0 as TranscriptJob, a1 as TranscriptTurnInput, a2 as UnknownWebhookEvent, a3 as VerifiedWebhook, a4 as WEBHOOK_EVENTS, a5 as WEBHOOK_HEADERS, a6 as WaitForReleaseOptions, a7 as WebhookDeliveryQuery, a8 as WebhookEvent, a9 as WebhookOptions, aa as WireCareHandoff, ab as WireConsentRequest, ac as WireDecision, ad as WireDisclosure, ae as WireDisclosureRequest, af as WireEvaluateRequest, ag as WireHandoffDetail, ah as WireHandoffList, ai as WireHandoffRef, aj as WireInboundFlag, ak as WireOptOutRequest, al as WireOutcome, am as WireOutcomeRequest, an as WirePatientState, ao as WirePolicyRef, ap as WireTranscriptBatch, aq as WireTranscriptJob, ar as WireTranscriptTurn, as as WireTranscriptTurnView, at as WireWebhookDelivery, au as createGovern, av as handleWebhook, aw as isAutomationPaused, ax as isClientMisconfiguration, ay as isInSessionChannel, az as parseEvent, aA as signWebhookPayload, aB as verifyWebhookSignature } from './client-CU46a__g.cjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error classes. No error message ever carries message content: they are built
|
|
5
|
+
* from HTTP status codes and the server's machine-readable `kind`, both of
|
|
6
|
+
* which this SDK knows the shape of.
|
|
7
|
+
*
|
|
8
|
+
* The server's own error text is not in that set. The evaluate 400 is
|
|
9
|
+
* documented as covering invalid *content*, and the document declares no
|
|
10
|
+
* schema for the body, so what is in it is the server's business and may
|
|
11
|
+
* change without this package moving. It is kept off `.message` and out of
|
|
12
|
+
* every event, and parked on `GovernApiError.serverMessage`, where reading it
|
|
13
|
+
* is a decision the caller makes for one error rather than a property of every
|
|
14
|
+
* string the SDK hands to a log.
|
|
15
|
+
*/
|
|
16
|
+
declare class GovernError extends Error {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
constructor(message: string, options?: {
|
|
19
|
+
cause?: unknown;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** The SDK was constructed or called in a way it cannot honour. */
|
|
23
|
+
declare class GovernConfigError extends GovernError {
|
|
24
|
+
readonly name = "GovernConfigError";
|
|
25
|
+
}
|
|
26
|
+
/** The API answered with a non-2xx status. */
|
|
27
|
+
declare class GovernApiError extends GovernError {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly status: number;
|
|
30
|
+
/** The server's machine-readable error kind (for example `BAD_REQUEST_ERROR`), when it sent one. */
|
|
31
|
+
readonly kind: string | null;
|
|
32
|
+
/** Whether the SDK considered the failure retryable (429 and 5xx). */
|
|
33
|
+
readonly retryable: boolean;
|
|
34
|
+
/** Milliseconds the server asked us to wait, from `Retry-After`, when it sent one. */
|
|
35
|
+
readonly retryAfterMs: number | null;
|
|
36
|
+
/**
|
|
37
|
+
* The server's own error text, collapsed to one line and bounded, or `null`.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately not part of `.message`: an error message is the string that
|
|
40
|
+
* ends up in a log line, an alert and a bug report, and the SDK cannot
|
|
41
|
+
* promise what a server put in this one. Read it when you are debugging a
|
|
42
|
+
* call, and treat what comes back the way you treat the message it was
|
|
43
|
+
* about.
|
|
44
|
+
*/
|
|
45
|
+
readonly serverMessage: string | null;
|
|
46
|
+
constructor(input: {
|
|
47
|
+
status: number;
|
|
48
|
+
kind: string | null;
|
|
49
|
+
serverMessage: string | null;
|
|
50
|
+
retryable: boolean;
|
|
51
|
+
retryAfterMs: number | null;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 409: the resource changed under you (a stale `expectedVersion` on a
|
|
56
|
+
* hand-off action) or a different report is already recorded (an outcome that
|
|
57
|
+
* disagrees with the one on file). Refresh and decide again; the SDK does not
|
|
58
|
+
* retry it.
|
|
59
|
+
*/
|
|
60
|
+
declare class GovernConflictError extends GovernApiError {
|
|
61
|
+
readonly name = "GovernConflictError";
|
|
62
|
+
}
|
|
63
|
+
/** The request could not be sent or no response arrived. */
|
|
64
|
+
declare class GovernNetworkError extends GovernError {
|
|
65
|
+
readonly name = "GovernNetworkError";
|
|
66
|
+
constructor(message: string, options?: {
|
|
67
|
+
cause?: unknown;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** One attempt exceeded `timeoutMs`. */
|
|
71
|
+
declare class GovernTimeoutError extends GovernError {
|
|
72
|
+
readonly name = "GovernTimeoutError";
|
|
73
|
+
readonly timeoutMs: number;
|
|
74
|
+
constructor(timeoutMs: number);
|
|
75
|
+
}
|
|
76
|
+
/** The caller's `AbortSignal` fired. */
|
|
77
|
+
declare class GovernAbortError extends GovernError {
|
|
78
|
+
readonly name = "GovernAbortError";
|
|
79
|
+
constructor(reason?: unknown);
|
|
80
|
+
}
|
|
81
|
+
/** A webhook delivery failed verification or could not be parsed. */
|
|
82
|
+
declare class GovernWebhookError extends GovernError {
|
|
83
|
+
readonly name = "GovernWebhookError";
|
|
84
|
+
}
|
|
85
|
+
/** The API surface called is not available to this application. */
|
|
86
|
+
declare class GovernNotAvailableError extends GovernError {
|
|
87
|
+
readonly name = "GovernNotAvailableError";
|
|
88
|
+
}
|
|
89
|
+
declare function isGovernError(error: unknown): error is GovernError;
|
|
90
|
+
|
|
91
|
+
/** SHA-256 over the UTF-8 bytes of `text`, lowercase hex. The outcome hash the API expects. */
|
|
92
|
+
declare function sha256Hex(text: string): Promise<string>;
|
|
93
|
+
|
|
94
|
+
declare const SDK_VERSION = "0.2.1";
|
|
95
|
+
declare const SDK_NAME = "@anybio/govern";
|
|
96
|
+
|
|
97
|
+
export { GovernAbortError, GovernApiError, GovernConfigError, GovernConflictError, GovernError, GovernNetworkError, GovernNotAvailableError, GovernTimeoutError, GovernWebhookError, SDK_NAME, SDK_VERSION, isGovernError, sha256Hex };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export { A as AUDIENCES, a as AckOptions, b as Audience, C as CHANNELS, c as Channel, D as DEFAULT_BASE_URL, d as DEFAULT_HOLD_MESSAGE, e as DEFAULT_MAX_RETRIES, f as DEFAULT_TIMEOUT_MS, g as Decision, h as DecisionStatus, i as DecisionVerdict, j as DecisionWebhookEvent, k as Disclosure, l as DisclosureAttachment, m as Draft, E as EvaluateInput, G as Govern, n as GovernEvent, o as GovernHandoffs, p as GovernOptions, q as GuardContext, r as GuardResult, H as Handoff, s as HandoffActionInput, t as HandoffContactInput, u as HandoffDetail, v as HandoffList, w as HandoffListQuery, x as HandoffRef, y as HandoffResolveInput, z as HandoffResumeInput, B as HandoffWebhookEvent, F as HeadersLike, I as IN_SESSION_CHANNELS, J as InboundFlag, K as InboundMessage, M as MAX_CONVERSATION_ID_CHARS, L as MAX_TURN_ID_CHARS, N as Mode, O as Outcome, P as PatientConsentInput, Q as PatientOptOutInput, R as PolicyRef, S as REASONS, T as RESERVED_TURN_ID_PREFIX, U as RecordDisclosureInput, V as ReleaseResult, W as ReportOutcomeInput, X as ReviewState, Y as Schemas, Z as StopClass, _ as SubmitTranscriptsInput, $ as TRANSIENT_HTTP_STATUSES, a0 as TranscriptJob, a1 as TranscriptTurnInput, a2 as UnknownWebhookEvent, a3 as VerifiedWebhook, a4 as WEBHOOK_EVENTS, a5 as WEBHOOK_HEADERS, a6 as WaitForReleaseOptions, a7 as WebhookDeliveryQuery, a8 as WebhookEvent, a9 as WebhookOptions, aa as WireCareHandoff, ab as WireConsentRequest, ac as WireDecision, ad as WireDisclosure, ae as WireDisclosureRequest, af as WireEvaluateRequest, ag as WireHandoffDetail, ah as WireHandoffList, ai as WireHandoffRef, aj as WireInboundFlag, ak as WireOptOutRequest, al as WireOutcome, am as WireOutcomeRequest, an as WirePatientState, ao as WirePolicyRef, ap as WireTranscriptBatch, aq as WireTranscriptJob, ar as WireTranscriptTurn, as as WireTranscriptTurnView, at as WireWebhookDelivery, au as createGovern, av as handleWebhook, aw as isAutomationPaused, ax as isClientMisconfiguration, ay as isInSessionChannel, az as parseEvent, aA as signWebhookPayload, aB as verifyWebhookSignature } from './client-CU46a__g.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Error classes. No error message ever carries message content: they are built
|
|
5
|
+
* from HTTP status codes and the server's machine-readable `kind`, both of
|
|
6
|
+
* which this SDK knows the shape of.
|
|
7
|
+
*
|
|
8
|
+
* The server's own error text is not in that set. The evaluate 400 is
|
|
9
|
+
* documented as covering invalid *content*, and the document declares no
|
|
10
|
+
* schema for the body, so what is in it is the server's business and may
|
|
11
|
+
* change without this package moving. It is kept off `.message` and out of
|
|
12
|
+
* every event, and parked on `GovernApiError.serverMessage`, where reading it
|
|
13
|
+
* is a decision the caller makes for one error rather than a property of every
|
|
14
|
+
* string the SDK hands to a log.
|
|
15
|
+
*/
|
|
16
|
+
declare class GovernError extends Error {
|
|
17
|
+
readonly name: string;
|
|
18
|
+
constructor(message: string, options?: {
|
|
19
|
+
cause?: unknown;
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/** The SDK was constructed or called in a way it cannot honour. */
|
|
23
|
+
declare class GovernConfigError extends GovernError {
|
|
24
|
+
readonly name = "GovernConfigError";
|
|
25
|
+
}
|
|
26
|
+
/** The API answered with a non-2xx status. */
|
|
27
|
+
declare class GovernApiError extends GovernError {
|
|
28
|
+
readonly name: string;
|
|
29
|
+
readonly status: number;
|
|
30
|
+
/** The server's machine-readable error kind (for example `BAD_REQUEST_ERROR`), when it sent one. */
|
|
31
|
+
readonly kind: string | null;
|
|
32
|
+
/** Whether the SDK considered the failure retryable (429 and 5xx). */
|
|
33
|
+
readonly retryable: boolean;
|
|
34
|
+
/** Milliseconds the server asked us to wait, from `Retry-After`, when it sent one. */
|
|
35
|
+
readonly retryAfterMs: number | null;
|
|
36
|
+
/**
|
|
37
|
+
* The server's own error text, collapsed to one line and bounded, or `null`.
|
|
38
|
+
*
|
|
39
|
+
* Deliberately not part of `.message`: an error message is the string that
|
|
40
|
+
* ends up in a log line, an alert and a bug report, and the SDK cannot
|
|
41
|
+
* promise what a server put in this one. Read it when you are debugging a
|
|
42
|
+
* call, and treat what comes back the way you treat the message it was
|
|
43
|
+
* about.
|
|
44
|
+
*/
|
|
45
|
+
readonly serverMessage: string | null;
|
|
46
|
+
constructor(input: {
|
|
47
|
+
status: number;
|
|
48
|
+
kind: string | null;
|
|
49
|
+
serverMessage: string | null;
|
|
50
|
+
retryable: boolean;
|
|
51
|
+
retryAfterMs: number | null;
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* 409: the resource changed under you (a stale `expectedVersion` on a
|
|
56
|
+
* hand-off action) or a different report is already recorded (an outcome that
|
|
57
|
+
* disagrees with the one on file). Refresh and decide again; the SDK does not
|
|
58
|
+
* retry it.
|
|
59
|
+
*/
|
|
60
|
+
declare class GovernConflictError extends GovernApiError {
|
|
61
|
+
readonly name = "GovernConflictError";
|
|
62
|
+
}
|
|
63
|
+
/** The request could not be sent or no response arrived. */
|
|
64
|
+
declare class GovernNetworkError extends GovernError {
|
|
65
|
+
readonly name = "GovernNetworkError";
|
|
66
|
+
constructor(message: string, options?: {
|
|
67
|
+
cause?: unknown;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
/** One attempt exceeded `timeoutMs`. */
|
|
71
|
+
declare class GovernTimeoutError extends GovernError {
|
|
72
|
+
readonly name = "GovernTimeoutError";
|
|
73
|
+
readonly timeoutMs: number;
|
|
74
|
+
constructor(timeoutMs: number);
|
|
75
|
+
}
|
|
76
|
+
/** The caller's `AbortSignal` fired. */
|
|
77
|
+
declare class GovernAbortError extends GovernError {
|
|
78
|
+
readonly name = "GovernAbortError";
|
|
79
|
+
constructor(reason?: unknown);
|
|
80
|
+
}
|
|
81
|
+
/** A webhook delivery failed verification or could not be parsed. */
|
|
82
|
+
declare class GovernWebhookError extends GovernError {
|
|
83
|
+
readonly name = "GovernWebhookError";
|
|
84
|
+
}
|
|
85
|
+
/** The API surface called is not available to this application. */
|
|
86
|
+
declare class GovernNotAvailableError extends GovernError {
|
|
87
|
+
readonly name = "GovernNotAvailableError";
|
|
88
|
+
}
|
|
89
|
+
declare function isGovernError(error: unknown): error is GovernError;
|
|
90
|
+
|
|
91
|
+
/** SHA-256 over the UTF-8 bytes of `text`, lowercase hex. The outcome hash the API expects. */
|
|
92
|
+
declare function sha256Hex(text: string): Promise<string>;
|
|
93
|
+
|
|
94
|
+
declare const SDK_VERSION = "0.2.1";
|
|
95
|
+
declare const SDK_NAME = "@anybio/govern";
|
|
96
|
+
|
|
97
|
+
export { GovernAbortError, GovernApiError, GovernConfigError, GovernConflictError, GovernError, GovernNetworkError, GovernNotAvailableError, GovernTimeoutError, GovernWebhookError, SDK_NAME, SDK_VERSION, isGovernError, sha256Hex };
|