@omnara/sdk 0.1.0
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 +37 -0
- package/dist/auth-CnOxLjlL.d.ts +6 -0
- package/dist/browser.d.ts +32 -0
- package/dist/browser.js +121 -0
- package/dist/browser.js.map +1 -0
- package/dist/chunk-CT4AUW4R.js +3657 -0
- package/dist/chunk-CT4AUW4R.js.map +1 -0
- package/dist/chunk-DGGYBF7D.js +3642 -0
- package/dist/chunk-DGGYBF7D.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +10 -0
- package/dist/chunk-PZ5AY32C.js.map +1 -0
- package/dist/chunk-TMPF6DRL.js +35 -0
- package/dist/chunk-TMPF6DRL.js.map +1 -0
- package/dist/index.d.ts +86 -0
- package/dist/index.js +254 -0
- package/dist/index.js.map +1 -0
- package/dist/sdk.gen-j-xlf6lr.d.ts +12953 -0
- package/dist/tanstack.d.ts +2786 -0
- package/dist/tanstack.js +2954 -0
- package/dist/tanstack.js.map +1 -0
- package/dist/zod.d.ts +12526 -0
- package/dist/zod.js +1428 -0
- package/dist/zod.js.map +1 -0
- package/package.json +64 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// src/errors.ts
|
|
2
|
+
var ApiError = class _ApiError extends Error {
|
|
3
|
+
status;
|
|
4
|
+
code;
|
|
5
|
+
constructor(status, message, code) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = "ApiError";
|
|
8
|
+
this.status = status;
|
|
9
|
+
this.code = code;
|
|
10
|
+
}
|
|
11
|
+
static async fromResponse(response) {
|
|
12
|
+
let message = `request failed with status ${response.status}`;
|
|
13
|
+
let code;
|
|
14
|
+
let data;
|
|
15
|
+
try {
|
|
16
|
+
data = await response.clone().json();
|
|
17
|
+
} catch {
|
|
18
|
+
data = void 0;
|
|
19
|
+
}
|
|
20
|
+
if (data && typeof data === "object") {
|
|
21
|
+
if ("error" in data && typeof data.error === "string") {
|
|
22
|
+
message = data.error;
|
|
23
|
+
}
|
|
24
|
+
if ("code" in data && typeof data.code === "string") {
|
|
25
|
+
code = data.code;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return new _ApiError(response.status, message, code);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
ApiError
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=chunk-TMPF6DRL.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/errors.ts"],"sourcesContent":["import type { Error as ApiErrorBody } from './generated/types.gen'\n\nexport type ApiErrorCode = ApiErrorBody['code']\n\nexport class ApiError extends Error {\n readonly status: number\n readonly code: ApiErrorCode | undefined\n\n constructor(status: number, message: string, code?: ApiErrorCode) {\n super(message)\n this.name = 'ApiError'\n this.status = status\n this.code = code\n }\n\n static async fromResponse(response: Response): Promise<ApiError> {\n let message = `request failed with status ${response.status}`\n let code: ApiErrorCode | undefined\n let data: unknown\n try {\n data = await response.clone().json()\n } catch {\n data = undefined\n }\n if (data && typeof data === 'object') {\n if ('error' in data && typeof data.error === 'string') {\n message = data.error\n }\n if ('code' in data && typeof data.code === 'string') {\n code = data.code as ApiErrorCode\n }\n }\n return new ApiError(response.status, message, code)\n }\n}\n"],"mappings":";AAIO,IAAM,WAAN,MAAM,kBAAiB,MAAM;AAAA,EACzB;AAAA,EACA;AAAA,EAET,YAAY,QAAgB,SAAiB,MAAqB;AAChE,UAAM,OAAO;AACb,SAAK,OAAO;AACZ,SAAK,SAAS;AACd,SAAK,OAAO;AAAA,EACd;AAAA,EAEA,aAAa,aAAa,UAAuC;AAC/D,QAAI,UAAU,8BAA8B,SAAS,MAAM;AAC3D,QAAI;AACJ,QAAI;AACJ,QAAI;AACF,aAAO,MAAM,SAAS,MAAM,EAAE,KAAK;AAAA,IACrC,QAAQ;AACN,aAAO;AAAA,IACT;AACA,QAAI,QAAQ,OAAO,SAAS,UAAU;AACpC,UAAI,WAAW,QAAQ,OAAO,KAAK,UAAU,UAAU;AACrD,kBAAU,KAAK;AAAA,MACjB;AACA,UAAI,UAAU,QAAQ,OAAO,KAAK,SAAS,UAAU;AACnD,eAAO,KAAK;AAAA,MACd;AAAA,IACF;AACA,WAAO,IAAI,UAAS,SAAS,QAAQ,SAAS,IAAI;AAAA,EACpD;AACF;","names":[]}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { A as AuthStrategy } from './auth-CnOxLjlL.js';
|
|
2
|
+
export { b as bearerToken } from './auth-CnOxLjlL.js';
|
|
3
|
+
import { fx as Config, fy as Client, fz as StreamEventsData, fA as AgentEventStreamData, fB as Error$1 } from './sdk.gen-j-xlf6lr.js';
|
|
4
|
+
export { A as AcceptInvitationData, b as AcceptInvitationError, fC as AcceptInvitationErrors, a as AcceptInvitationResponse, fD as AcceptInvitationResponses, bE as Actor, fE as ActorId, fF as ActorProvider, fG as Agent, bH as AgentConfig, fH as AgentConfigId, fI as AgentConfigModel, fJ as AgentControlType, fK as AgentCount, fL as AgentCronTriggerTarget, fM as AgentEvent, fN as AgentEventId, fO as AgentId, fP as AgentInput, fQ as AgentInputContentBlock, fR as AgentInputDeliveryMode, fS as AgentInputEnvelope, fT as AgentInputEvent, fU as AgentInputId, fV as AgentInputKind, fW as AgentInteraction, fX as AgentInteractionId, fY as AgentInteractionKind, fZ as AgentInteractionState, f_ as AgentMachineBinding, f$ as AgentMachineBindingId, g0 as AgentMachineBindingKind, g1 as AgentMachineBindingState, g2 as AgentMcpConnection, g3 as AgentModel, bN as AgentProfile, g4 as AgentProfileCronTriggerTarget, g5 as AgentProfileId, g6 as AgentSequence, g7 as AgentSequenceCursor, g8 as AgentTurn, g9 as AgentTurnId, c as ArchiveAgentData, e as ArchiveAgentError, ga as ArchiveAgentErrors, d as ArchiveAgentResponse, gb as ArchiveAgentResponses, bS as Artifact, gc as ArtifactId, gd as AwsCredentialsSecretMaterial, B as BootstrapDaemonData, g as BootstrapDaemonError, ge as BootstrapDaemonErrors, gf as BootstrapDaemonResponse, f as BootstrapDaemonResponse2, gg as BootstrapDaemonResponses, C as CancelAgentData, i as CancelAgentError, gh as CancelAgentErrors, gi as CancelAgentRequest, gj as CancelAgentResponse, h as CancelAgentResponse2, gk as CancelAgentResponses, j as CancelQueuedBacklogInputData, l as CancelQueuedBacklogInputError, gl as CancelQueuedBacklogInputErrors, k as CancelQueuedBacklogInputResponse, gm as CancelQueuedBacklogInputResponses, gn as ClientErrorCode, go as ClientOptions, gp as ConfiguredModel, gq as ConfiguredModelId, cN as ConfiguredModelList, gr as ConfiguredModelRevisionId, gs as ConfiguredModelSummary, m as ConnectByoMachineData, o as ConnectByoMachineError, gt as ConnectByoMachineErrors, gu as ConnectByoMachineRequest, gv as ConnectByoMachineResponse, n as ConnectByoMachineResponse2, gw as ConnectByoMachineResponses, gx as ContentBlockMetadata, gy as ContextCheckpointEvent, gz as ContextCheckpointId, p as CreateAgentConfigData, r as CreateAgentConfigError, gA as CreateAgentConfigErrors, gB as CreateAgentConfigRequest, q as CreateAgentConfigResponse, gC as CreateAgentConfigResponses, v as CreateAgentData, x as CreateAgentError, gD as CreateAgentErrors, gE as CreateAgentInputContentBlock, s as CreateAgentInputData, gF as CreateAgentInputDeliveryMode, u as CreateAgentInputError, gG as CreateAgentInputErrors, gH as CreateAgentInputRequest, t as CreateAgentInputResponse, gI as CreateAgentInputResponses, y as CreateAgentProfileData, D as CreateAgentProfileError, gJ as CreateAgentProfileErrors, gK as CreateAgentProfileRequest, z as CreateAgentProfileResponse, gL as CreateAgentProfileResponses, gM as CreateAgentRequest, w as CreateAgentResponse, gN as CreateAgentResponses, E as CreateByoMachineDaemonTokenData, G as CreateByoMachineDaemonTokenError, gO as CreateByoMachineDaemonTokenErrors, F as CreateByoMachineDaemonTokenResponse, gP as CreateByoMachineDaemonTokenResponses, H as CreateConfiguredModelData, J as CreateConfiguredModelError, gQ as CreateConfiguredModelErrors, gR as CreateConfiguredModelRequest, I as CreateConfiguredModelResponse, gS as CreateConfiguredModelResponses, K as CreateCronTriggerData, M as CreateCronTriggerError, gT as CreateCronTriggerErrors, gU as CreateCronTriggerRequest, L as CreateCronTriggerResponse, gV as CreateCronTriggerResponses, N as CreateIntegrationOAuthSetupData, Q as CreateIntegrationOAuthSetupError, gW as CreateIntegrationOAuthSetupErrors, gX as CreateIntegrationOAuthSetupRequest, P as CreateIntegrationOAuthSetupResponse, gY as CreateIntegrationOAuthSetupResponses, gZ as CreateMachineDaemonTokenRequest, g_ as CreateMachineDaemonTokenResponse, R as CreateMachineData, T as CreateMachineError, g$ as CreateMachineErrors, U as CreateMachinePoolData, W as CreateMachinePoolError, h0 as CreateMachinePoolErrors, h1 as CreateMachinePoolRequest, h2 as CreateMachinePoolRequestBase, V as CreateMachinePoolResponse, h3 as CreateMachinePoolResponses, h4 as CreateMachineRequest, S as CreateMachineResponse, h5 as CreateMachineResponses, X as CreateModelProviderConfigData, Z as CreateModelProviderConfigError, h6 as CreateModelProviderConfigErrors, h7 as CreateModelProviderConfigRequest, h8 as CreateModelProviderConfigResponse, Y as CreateModelProviderConfigResponse2, h9 as CreateModelProviderConfigResponses, _ as CreateOrgApiKeyData, a0 as CreateOrgApiKeyError, ha as CreateOrgApiKeyErrors, hb as CreateOrgApiKeyRequest, hc as CreateOrgApiKeyResponse, $ as CreateOrgApiKeyResponse2, hd as CreateOrgApiKeyResponses, a1 as CreateOrgInvitationData, a3 as CreateOrgInvitationError, he as CreateOrgInvitationErrors, hf as CreateOrgInvitationRequest, a2 as CreateOrgInvitationResponse, hg as CreateOrgInvitationResponses, a4 as CreateOrganizationData, a6 as CreateOrganizationError, hh as CreateOrganizationErrors, hi as CreateOrganizationRequest, hj as CreateOrganizationResponse, a5 as CreateOrganizationResponse2, hk as CreateOrganizationResponses, a7 as CreatePersonalAccessTokenData, a9 as CreatePersonalAccessTokenError, hl as CreatePersonalAccessTokenErrors, hm as CreatePersonalAccessTokenRequest, hn as CreatePersonalAccessTokenResponse, a8 as CreatePersonalAccessTokenResponse2, ho as CreatePersonalAccessTokenResponses, aj as CreateProjectData, al as CreateProjectError, hp as CreateProjectErrors, aa as CreateProjectMachineGrantData, ac as CreateProjectMachineGrantError, hq as CreateProjectMachineGrantErrors, hr as CreateProjectMachineGrantRequest, hs as CreateProjectMachineGrantResponse, ab as CreateProjectMachineGrantResponse2, ht as CreateProjectMachineGrantResponses, ad as CreateProjectMachinePoolGrantData, af as CreateProjectMachinePoolGrantError, hu as CreateProjectMachinePoolGrantErrors, hv as CreateProjectMachinePoolGrantRequest, ae as CreateProjectMachinePoolGrantResponse, hw as CreateProjectMachinePoolGrantResponses, ag as CreateProjectModelGrantData, ai as CreateProjectModelGrantError, hx as CreateProjectModelGrantErrors, hy as CreateProjectModelGrantRequest, ah as CreateProjectModelGrantResponse, hz as CreateProjectModelGrantResponses, hA as CreateProjectRequest, ak as CreateProjectResponse, hB as CreateProjectResponses, ap as CreateSecretData, ar as CreateSecretError, hC as CreateSecretErrors, am as CreateSecretGrantData, ao as CreateSecretGrantError, hD as CreateSecretGrantErrors, an as CreateSecretGrantResponse, hE as CreateSecretGrantResponses, hF as CreateSecretRequest, aq as CreateSecretResponse, hG as CreateSecretResponses, as as CreateSecretVersionData, au as CreateSecretVersionError, hH as CreateSecretVersionErrors, at as CreateSecretVersionResponse, hI as CreateSecretVersionResponses, ay as CreateSkillData, aA as CreateSkillError, hJ as CreateSkillErrors, av as CreateSkillGrantData, ax as CreateSkillGrantError, hK as CreateSkillGrantErrors, aw as CreateSkillGrantResponse, hL as CreateSkillGrantResponses, hM as CreateSkillRequest, az as CreateSkillResponse, hN as CreateSkillResponses, aB as CreateSlackSetupData, aD as CreateSlackSetupError, hO as CreateSlackSetupErrors, hP as CreateSlackSetupRequest, aC as CreateSlackSetupResponse, hQ as CreateSlackSetupResponses, hR as CreatedResourceListSort, hS as CronExpression, hT as CronMessageTemplate, hU as CronTimezone, bV as CronTrigger, hV as CronTriggerFailureReport, hW as CronTriggerId, hX as CronTriggerTarget, hY as CurrentAgentResponse, bY as CurrentUser, hZ as CurrentUserIdentity, h_ as CurrentUserOrg, h$ as DaemonRuntime, i0 as DaemonRuntimeId, i1 as DaemonRuntimeReconciliation, i2 as DaemonRuntimeState, aE as DeclineInvitationData, aG as DeclineInvitationError, i3 as DeclineInvitationErrors, aF as DeclineInvitationResponse, i4 as DeclineInvitationResponses, aH as DeleteAgentProfileData, aJ as DeleteAgentProfileError, i5 as DeleteAgentProfileErrors, aI as DeleteAgentProfileResponse, i6 as DeleteAgentProfileResponses, aK as DeleteConfiguredModelData, aM as DeleteConfiguredModelError, i7 as DeleteConfiguredModelErrors, aL as DeleteConfiguredModelResponse, i8 as DeleteConfiguredModelResponses, aN as DeleteCronTriggerData, aP as DeleteCronTriggerError, i9 as DeleteCronTriggerErrors, aO as DeleteCronTriggerResponse, ia as DeleteCronTriggerResponses, aQ as DeleteCurrentUserData, aS as DeleteCurrentUserError, ib as DeleteCurrentUserErrors, aR as DeleteCurrentUserResponse, ic as DeleteCurrentUserResponses, aT as DeleteIntegrationInstallData, aV as DeleteIntegrationInstallError, id as DeleteIntegrationInstallErrors, aU as DeleteIntegrationInstallResponse, ie as DeleteIntegrationInstallResponses, aW as DeleteMachineData, aY as DeleteMachineError, ig as DeleteMachineErrors, aZ as DeleteMachinePoolData, a$ as DeleteMachinePoolError, ih as DeleteMachinePoolErrors, a_ as DeleteMachinePoolResponse, ii as DeleteMachinePoolResponses, aX as DeleteMachineResponse, ij as DeleteMachineResponses, b0 as DeleteModelProviderConfigData, b2 as DeleteModelProviderConfigError, ik as DeleteModelProviderConfigErrors, b1 as DeleteModelProviderConfigResponse, il as DeleteModelProviderConfigResponses, b3 as DeleteOrgInvitationData, b5 as DeleteOrgInvitationError, im as DeleteOrgInvitationErrors, b4 as DeleteOrgInvitationResponse, io as DeleteOrgInvitationResponses, b6 as DeleteOrganizationData, b8 as DeleteOrganizationError, ip as DeleteOrganizationErrors, b7 as DeleteOrganizationResponse, iq as DeleteOrganizationResponses, bi as DeleteProjectData, bk as DeleteProjectError, ir as DeleteProjectErrors, b9 as DeleteProjectMachineGrantData, bb as DeleteProjectMachineGrantError, is as DeleteProjectMachineGrantErrors, ba as DeleteProjectMachineGrantResponse, it as DeleteProjectMachineGrantResponses, bc as DeleteProjectMachinePoolGrantData, be as DeleteProjectMachinePoolGrantError, iu as DeleteProjectMachinePoolGrantErrors, bd as DeleteProjectMachinePoolGrantResponse, iv as DeleteProjectMachinePoolGrantResponses, bf as DeleteProjectModelGrantData, bh as DeleteProjectModelGrantError, iw as DeleteProjectModelGrantErrors, bg as DeleteProjectModelGrantResponse, ix as DeleteProjectModelGrantResponses, bj as DeleteProjectResponse, iy as DeleteProjectResponses, bo as DeleteSecretData, bq as DeleteSecretError, iz as DeleteSecretErrors, bl as DeleteSecretGrantData, bn as DeleteSecretGrantError, iA as DeleteSecretGrantErrors, bm as DeleteSecretGrantResponse, iB as DeleteSecretGrantResponses, bp as DeleteSecretResponse, iC as DeleteSecretResponses, bu as DeleteSkillData, bw as DeleteSkillError, iD as DeleteSkillErrors, br as DeleteSkillGrantData, bt as DeleteSkillGrantError, iE as DeleteSkillGrantErrors, bs as DeleteSkillGrantResponse, iF as DeleteSkillGrantResponses, bv as DeleteSkillResponse, iG as DeleteSkillResponses, bx as DemoteSteeringInputToQueuedData, bz as DemoteSteeringInputToQueuedError, iH as DemoteSteeringInputToQueuedErrors, by as DemoteSteeringInputToQueuedResponse, iI as DemoteSteeringInputToQueuedResponses, iJ as DirectSecretAvailability, iK as DirectSkillAvailability, iL as DiscoveredProviderModel, bA as EndMachineDaemonRuntimeData, bC as EndMachineDaemonRuntimeError, iM as EndMachineDaemonRuntimeErrors, bB as EndMachineDaemonRuntimeResponse, iN as EndMachineDaemonRuntimeResponses, iO as ErrorContentBlock, iP as ExternalActorParams, iQ as GenericSecretMaterial, bD as GetActorData, bF as GetActorError, iR as GetActorErrors, iS as GetActorResponse, iT as GetActorResponses, bG as GetAgentConfigData, bI as GetAgentConfigError, iU as GetAgentConfigErrors, iV as GetAgentConfigResponse, iW as GetAgentConfigResponses, bJ as GetAgentData, bL as GetAgentError, iX as GetAgentErrors, bM as GetAgentProfileData, bO as GetAgentProfileError, iY as GetAgentProfileErrors, iZ as GetAgentProfileResponse, i_ as GetAgentProfileResponses, bK as GetAgentResponse, i$ as GetAgentResponse2, j0 as GetAgentResponses, bP as GetArtifactContentData, bQ as GetArtifactContentError, j1 as GetArtifactContentErrors, j2 as GetArtifactContentResponse, j3 as GetArtifactContentResponses, bR as GetArtifactData, bT as GetArtifactError, j4 as GetArtifactErrors, j5 as GetArtifactResponse, j6 as GetArtifactResponses, bU as GetCronTriggerData, bW as GetCronTriggerError, j7 as GetCronTriggerErrors, j8 as GetCronTriggerResponse, j9 as GetCronTriggerResponses, bX as GetCurrentUserData, bZ as GetCurrentUserError, ja as GetCurrentUserErrors, jb as GetCurrentUserResponse, jc as GetCurrentUserResponses, b_ as GetDaemonSkillArchiveData, b$ as GetDaemonSkillArchiveError, jd as GetDaemonSkillArchiveErrors, je as GetDaemonSkillArchiveResponse, jf as GetDaemonSkillArchiveResponses, c0 as GetMachineData, c2 as GetMachineError, jg as GetMachineErrors, c3 as GetMachinePoolData, c5 as GetMachinePoolError, jh as GetMachinePoolErrors, ji as GetMachinePoolResponse, jj as GetMachinePoolResponses, jk as GetMachineResponse, jl as GetMachineResponses, c6 as GetModelCatalogData, c8 as GetModelCatalogError, jm as GetModelCatalogErrors, jn as GetModelCatalogResponse, jo as GetModelCatalogResponses, c9 as GetModelProviderConfigData, cb as GetModelProviderConfigError, jp as GetModelProviderConfigErrors, jq as GetModelProviderConfigResponse, jr as GetModelProviderConfigResponses, cc as GetOrgApiKeyData, ce as GetOrgApiKeyError, js as GetOrgApiKeyErrors, jt as GetOrgApiKeyResponse, ju as GetOrgApiKeyResponses, cf as GetOrgOverviewData, ch as GetOrgOverviewError, jv as GetOrgOverviewErrors, jw as GetOrgOverviewResponse, jx as GetOrgOverviewResponses, ci as GetProjectAvailableSecretData, ck as GetProjectAvailableSecretError, jy as GetProjectAvailableSecretErrors, jz as GetProjectAvailableSecretResponse, jA as GetProjectAvailableSecretResponses, cl as GetProjectMachinePoolGrantData, cn as GetProjectMachinePoolGrantError, jB as GetProjectMachinePoolGrantErrors, jC as GetProjectMachinePoolGrantResponse, jD as GetProjectMachinePoolGrantResponses, co as GetSecretData, cq as GetSecretError, jE as GetSecretErrors, jF as GetSecretResponse, jG as GetSecretResponses, cr as GetSkillData, ct as GetSkillError, jH as GetSkillErrors, jI as GetSkillResponse, jJ as GetSkillResponses, cu as GetToolCatalogData, cw as GetToolCatalogError, jK as GetToolCatalogErrors, jL as GetToolCatalogResponse, jM as GetToolCatalogResponses, jN as GrantedSecretAvailability, jO as GrantedSkillAvailability, jP as IdempotencyKey, jQ as InlineMediaContentBlock, jR as InstallationId, jS as IntegrationInstall, jT as IntegrationInstallAgentProfileFilter, jU as IntegrationInstallId, jV as IntegrationInstallOAuthFlowIdFilter, jW as IntegrationOAuthFlowId, jX as IntegrationOAuthSetup, jY as IntegrationTarget, jZ as InteractionAnswer, j_ as InteractionForm, j$ as InteractionFormContextItem, k0 as InteractionFormOption, k1 as InteractionFormQuestion, k2 as InteractionResolution, k3 as JsonBlob, k4 as LaunchAgentResponse, cx as ListActorsData, cz as ListActorsError, k5 as ListActorsErrors, cy as ListActorsResponse, k6 as ListActorsResponse2, k7 as ListActorsResponses, cT as ListAgentEventsResponse, dC as ListAgentInputsResponse, cA as ListAgentInteractionsData, cC as ListAgentInteractionsError, k8 as ListAgentInteractionsErrors, cB as ListAgentInteractionsResponse, k9 as ListAgentInteractionsResponse2, ka as ListAgentInteractionsResponses, cD as ListAgentProfilesData, cF as ListAgentProfilesError, kb as ListAgentProfilesErrors, cE as ListAgentProfilesResponse, kc as ListAgentProfilesResponse2, kd as ListAgentProfilesResponses, dX as ListAgentTurnsResponse, cG as ListAgentsData, cI as ListAgentsError, ke as ListAgentsErrors, cH as ListAgentsResponse, kf as ListAgentsResponse2, kg as ListAgentsResponses, cJ as ListByoMachineDaemonTokensData, cL as ListByoMachineDaemonTokensError, kh as ListByoMachineDaemonTokensErrors, ki as ListByoMachineDaemonTokensResponse, kj as ListByoMachineDaemonTokensResponses, cM as ListConfiguredModelsData, cO as ListConfiguredModelsError, kk as ListConfiguredModelsErrors, kl as ListConfiguredModelsResponse, km as ListConfiguredModelsResponses, cP as ListCronTriggersData, cR as ListCronTriggersError, kn as ListCronTriggersErrors, cQ as ListCronTriggersResponse, ko as ListCronTriggersResponse2, kp as ListCronTriggersResponses, cS as ListEventsData, cU as ListEventsError, kq as ListEventsErrors, kr as ListEventsResponse, ks as ListEventsResponses, cV as ListIntegrationInstallsData, cX as ListIntegrationInstallsError, kt as ListIntegrationInstallsErrors, cW as ListIntegrationInstallsResponse, ku as ListIntegrationInstallsResponse2, kv as ListIntegrationInstallsResponses, cK as ListMachineDaemonTokensResponse, cY as ListMachinePoolsData, c_ as ListMachinePoolsError, kw as ListMachinePoolsErrors, cZ as ListMachinePoolsResponse, kx as ListMachinePoolsResponse2, ky as ListMachinePoolsResponses, c$ as ListMemberProjectAccessData, d1 as ListMemberProjectAccessError, kz as ListMemberProjectAccessErrors, kA as ListMemberProjectAccessResponse, kB as ListMemberProjectAccessResponses, d2 as ListModelProviderConfigsData, d4 as ListModelProviderConfigsError, kC as ListModelProviderConfigsErrors, kD as ListModelProviderConfigsResponse, kE as ListModelProviderConfigsResponses, d5 as ListOrgApiKeyProjectAccessData, d6 as ListOrgApiKeyProjectAccessError, kF as ListOrgApiKeyProjectAccessErrors, kG as ListOrgApiKeyProjectAccessResponse, kH as ListOrgApiKeyProjectAccessResponses, d7 as ListOrgApiKeysData, d9 as ListOrgApiKeysError, kI as ListOrgApiKeysErrors, d8 as ListOrgApiKeysResponse, kJ as ListOrgApiKeysResponse2, kK as ListOrgApiKeysResponses, da as ListOrgInvitationsData, dc as ListOrgInvitationsError, kL as ListOrgInvitationsErrors, db as ListOrgInvitationsResponse, kM as ListOrgInvitationsResponse2, kN as ListOrgInvitationsResponses, dd as ListOrgMembersData, df as ListOrgMembersError, kO as ListOrgMembersErrors, de as ListOrgMembersResponse, kP as ListOrgMembersResponse2, kQ as ListOrgMembersResponses, dg as ListPendingInvitationsData, dh as ListPendingInvitationsError, kR as ListPendingInvitationsErrors, kS as ListPendingInvitationsResponse, kT as ListPendingInvitationsResponses, di as ListPersonalAccessTokensData, dk as ListPersonalAccessTokensError, kU as ListPersonalAccessTokensErrors, dj as ListPersonalAccessTokensResponse, kV as ListPersonalAccessTokensResponse2, kW as ListPersonalAccessTokensResponses, dl as ListProjectAvailableSecretsData, dn as ListProjectAvailableSecretsError, kX as ListProjectAvailableSecretsErrors, kY as ListProjectAvailableSecretsResponse, kZ as ListProjectAvailableSecretsResponses, dp as ListProjectAvailableSkillsData, dr as ListProjectAvailableSkillsError, k_ as ListProjectAvailableSkillsErrors, k$ as ListProjectAvailableSkillsResponse, l0 as ListProjectAvailableSkillsResponses, ds as ListProjectMachineGrantsData, du as ListProjectMachineGrantsError, l1 as ListProjectMachineGrantsErrors, dt as ListProjectMachineGrantsResponse, l2 as ListProjectMachineGrantsResponse2, l3 as ListProjectMachineGrantsResponses, dv as ListProjectMachinePoolGrantsData, dx as ListProjectMachinePoolGrantsError, l4 as ListProjectMachinePoolGrantsErrors, dw as ListProjectMachinePoolGrantsResponse, l5 as ListProjectMachinePoolGrantsResponse2, l6 as ListProjectMachinePoolGrantsResponses, d0 as ListProjectMembershipGrantsResponse, dy as ListProjectModelGrantsData, dA as ListProjectModelGrantsError, l7 as ListProjectModelGrantsErrors, dz as ListProjectModelGrantsResponse, l8 as ListProjectModelGrantsResponse2, l9 as ListProjectModelGrantsResponses, dm as ListProjectSecretAccessesResponse, dq as ListProjectSkillAccessesResponse, e3 as ListProjectsResponse, dB as ListQueuedBacklogInputsData, dD as ListQueuedBacklogInputsError, la as ListQueuedBacklogInputsErrors, lb as ListQueuedBacklogInputsResponse, lc as ListQueuedBacklogInputsResponses, dE as ListSecretGrantsData, dG as ListSecretGrantsError, ld as ListSecretGrantsErrors, dF as ListSecretGrantsResponse, le as ListSecretGrantsResponse2, lf as ListSecretGrantsResponses, dH as ListSecretsData, dJ as ListSecretsError, lg as ListSecretsErrors, dI as ListSecretsResponse, lh as ListSecretsResponse2, li as ListSecretsResponses, dK as ListSkillGrantsData, dM as ListSkillGrantsError, lj as ListSkillGrantsErrors, dL as ListSkillGrantsResponse, lk as ListSkillGrantsResponse2, ll as ListSkillGrantsResponses, dN as ListSkillsData, dP as ListSkillsError, lm as ListSkillsErrors, dO as ListSkillsResponse, ln as ListSkillsResponse2, lo as ListSkillsResponses, dQ as ListToolCallsData, dS as ListToolCallsError, lp as ListToolCallsErrors, dR as ListToolCallsResponse, lq as ListToolCallsResponse2, lr as ListToolCallsResponses, dT as ListTurnEventsData, dV as ListTurnEventsError, ls as ListTurnEventsErrors, dU as ListTurnEventsResponse, lt as ListTurnEventsResponse2, lu as ListTurnEventsResponses, dW as ListTurnsData, dY as ListTurnsError, lv as ListTurnsErrors, lw as ListTurnsResponse, lx as ListTurnsResponses, dZ as ListVisibleMachinesData, d$ as ListVisibleMachinesError, ly as ListVisibleMachinesErrors, d_ as ListVisibleMachinesResponse, lz as ListVisibleMachinesResponse2, lA as ListVisibleMachinesResponses, e0 as ListVisibleProjectMachinesData, e1 as ListVisibleProjectMachinesError, lB as ListVisibleProjectMachinesErrors, lC as ListVisibleProjectMachinesResponse, lD as ListVisibleProjectMachinesResponses, e2 as ListVisibleProjectsData, e4 as ListVisibleProjectsError, lE as ListVisibleProjectsErrors, lF as ListVisibleProjectsResponse, lG as ListVisibleProjectsResponses, c1 as Machine, lH as MachineAccess, lI as MachineAccessSource, lJ as MachineAccessSourceKind, lK as MachineConnectionState, lL as MachineDaemonToken, lM as MachineDaemonTokenId, lN as MachineFailureReport, lO as MachineId, lP as MachineLifecycleState, lQ as MachineMetadata, c4 as MachinePool, lR as MachinePoolId, lS as MachinePoolSummary, lT as MachineSourceKind, lU as MachineSourceKindFilter, lV as MachineSummary, lW as MachineSummaryFields, lX as ManagementKind, lY as McpoAuthFlowId, lZ as McpoAuthStartMetadata, l_ as McpoAuthStartRequest, l$ as McpoAuthStartResponse, m0 as MediaRefContentBlock, m1 as Metadata, m2 as ModelApiFormat, m3 as ModelApiVariantOptions, m4 as ModelCacheRetention, m5 as ModelCallContextId, c7 as ModelCatalog, m6 as ModelOutputBlockStartDelta, m7 as ModelOutputBlockStopDelta, m8 as ModelOutputContentBlock, m9 as ModelOutputDelta, ma as ModelOutputErrorDelta, mb as ModelOutputEvent, mc as ModelOutputMessageStopDelta, md as ModelOutputStopReason, me as ModelOutputStreamBlock, mf as ModelOutputStreamDelta, mg as ModelOutputTextDelta, mh as ModelOutputTextStreamBlock, mi as ModelOutputThinkingDelta, mj as ModelOutputThinkingStreamBlock, mk as ModelOutputToolArgumentsDelta, ml as ModelOutputToolUseStreamBlock, mm as ModelProviderApiVariant, mn as ModelProviderApiVariantResponse, mo as ModelProviderAuthKind, ca as ModelProviderConfig, mp as ModelProviderConfigId, d3 as ModelProviderConfigList, mq as ModelStopReason, mr as ModelToolCallContentBlock, ms as ModelUsage, e5 as MoveQueuedBacklogInputData, e7 as MoveQueuedBacklogInputError, mt as MoveQueuedBacklogInputErrors, mu as MoveQueuedBacklogInputRequest, e6 as MoveQueuedBacklogInputResponse, mv as MoveQueuedBacklogInputResponses, mw as OAuthRefreshSecretMaterial, mx as OAuthTokenSetSecretMaterial, my as OkResponse, cd as OrgApiKey, mz as OrgApiKeyId, mA as OrgApiKeyRole, mB as OrgInvitation, mC as OrgInvitationId, mD as OrgMember, cg as OrgOverviewResponse, mE as OrgSecretOwner, mF as OrgSecretOwnerInput, mG as OrgSkillOwner, mH as OrgSkillOwnerInput, mI as Organization, mJ as OrganizationId, mK as OrganizationMembership, mL as PageCursor, mM as PageLimit, mN as PersonalAccessToken, mO as PersonalAccessTokenId, mP as ProcessActionId, mQ as ProcessActionReconciliationClaim, mR as ProcessActionReconciliationDirective, mS as ProcessId, mT as ProcessReconciliationClaim, mU as ProcessReconciliationDirective, mV as Project, mW as ProjectAccess, mX as ProjectFields, mY as ProjectId, mZ as ProjectMachineGrant, m_ as ProjectMachineGrantId, m$ as ProjectMachineGrantListItem, n0 as ProjectMachineGrantSourceKind, cm as ProjectMachinePoolGrant, n1 as ProjectMachinePoolGrantId, n2 as ProjectMachinePoolGrantListItem, n3 as ProjectMembershipGrant, n4 as ProjectModelGrant, n5 as ProjectModelGrantEnvelope, n6 as ProjectModelGrantId, n7 as ProjectModelGrantListItem, cj as ProjectSecretAccess, n8 as ProjectSecretOwner, n9 as ProjectSecretOwnerInput, na as ProjectSkillAccess, nb as ProjectSkillOwner, nc as ProjectSkillOwnerInput, e8 as PromoteQueuedInputToSteeringData, ea as PromoteQueuedInputToSteeringError, nd as PromoteQueuedInputToSteeringErrors, ne as PromoteQueuedInputToSteeringRequest, e9 as PromoteQueuedInputToSteeringResponse, nf as PromoteQueuedInputToSteeringResponses, eb as PutActorData, ed as PutActorError, ng as PutActorErrors, ec as PutActorResponse, nh as PutActorResponses, ni as ReasoningContentBlock, ee as RecordMachineFailureData, eg as RecordMachineFailureError, nj as RecordMachineFailureErrors, ef as RecordMachineFailureResponse, nk as RecordMachineFailureResponses, nl as RegisterDaemonRuntimeRequest, nm as RegisterDaemonRuntimeResponse, eh as RegisterMachineDaemonRuntimeData, ej as RegisterMachineDaemonRuntimeError, nn as RegisterMachineDaemonRuntimeErrors, ei as RegisterMachineDaemonRuntimeResponse, no as RegisterMachineDaemonRuntimeResponses, ek as RemoveMemberProjectAccessData, em as RemoveMemberProjectAccessError, np as RemoveMemberProjectAccessErrors, el as RemoveMemberProjectAccessResponse, nq as RemoveMemberProjectAccessResponses, en as RemoveOrgApiKeyProjectRoleData, ep as RemoveOrgApiKeyProjectRoleError, nr as RemoveOrgApiKeyProjectRoleErrors, eo as RemoveOrgApiKeyProjectRoleResponse, ns as RemoveOrgApiKeyProjectRoleResponses, eq as RemoveOrgMemberData, es as RemoveOrgMemberError, nt as RemoveOrgMemberErrors, er as RemoveOrgMemberResponse, nu as RemoveOrgMemberResponses, et as RenameAgentProfileData, ev as RenameAgentProfileError, nv as RenameAgentProfileErrors, nw as RenameAgentProfileRequest, eu as RenameAgentProfileResponse, nx as RenameAgentProfileResponses, ew as ResolveAgentInteractionData, ey as ResolveAgentInteractionError, ny as ResolveAgentInteractionErrors, nz as ResolveAgentInteractionRequest, ex as ResolveAgentInteractionResponse, nA as ResolveAgentInteractionResponses, nB as ResourceListSort, nC as ResourceNameFilter, ez as RevokeMachineDaemonTokenData, eB as RevokeMachineDaemonTokenError, nD as RevokeMachineDaemonTokenErrors, eA as RevokeMachineDaemonTokenResponse, nE as RevokeMachineDaemonTokenResponses, eC as RevokeOrgApiKeyData, eE as RevokeOrgApiKeyError, nF as RevokeOrgApiKeyErrors, eD as RevokeOrgApiKeyResponse, nG as RevokeOrgApiKeyResponses, eF as RevokePersonalAccessTokenData, eH as RevokePersonalAccessTokenError, nH as RevokePersonalAccessTokenErrors, eG as RevokePersonalAccessTokenResponse, nI as RevokePersonalAccessTokenResponses, cp as Secret, nJ as SecretAvailability, nK as SecretAvailabilitySourceFilter, nL as SecretGrant, nM as SecretGrantCreateRequest, nN as SecretGrantId, nO as SecretGrantListItem, nP as SecretId, nQ as SecretKind, nR as SecretKindFilter, nS as SecretMaterial, nT as SecretMcpoAuthFlowIdFilter, nU as SecretMetadataFilter, nV as SecretOwner, nW as SecretOwnerInput, nX as SecretOwnerKindFilter, nY as SecretOwnerProjectIdFilter, nZ as SecretVersionRequest, n_ as ServerErrorCode, eI as SetMemberProjectAccessData, eK as SetMemberProjectAccessError, n$ as SetMemberProjectAccessErrors, eJ as SetMemberProjectAccessResponse, o0 as SetMemberProjectAccessResponses, eL as SetOrgApiKeyProjectRoleData, eN as SetOrgApiKeyProjectRoleError, o1 as SetOrgApiKeyProjectRoleErrors, eM as SetOrgApiKeyProjectRoleResponse, o2 as SetOrgApiKeyProjectRoleResponses, o3 as SetProjectMembershipRequest, cs as Skill, o4 as SkillAvailability, o5 as SkillAvailabilitySourceFilter, o6 as SkillGrant, o7 as SkillGrantCreateRequest, o8 as SkillGrantId, o9 as SkillGrantListItem, oa as SkillId, ob as SkillOwner, oc as SkillOwnerInput, od as SkillOwnerKindFilter, oe as SkillOwnerProjectIdFilter, of as SkillRevisionId, og as SlackSetup, oh as SlackSetupIcon, eO as SleepMachineDaemonRuntimeData, eQ as SleepMachineDaemonRuntimeError, oi as SleepMachineDaemonRuntimeErrors, eP as SleepMachineDaemonRuntimeResponse, oj as SleepMachineDaemonRuntimeResponses, eR as SocketMachineDaemonRuntimeData, eS as SocketMachineDaemonRuntimeError, ok as SocketMachineDaemonRuntimeErrors, eT as StartSecretMcpoAuthData, eV as StartSecretMcpoAuthError, ol as StartSecretMcpoAuthErrors, eU as StartSecretMcpoAuthResponse, om as StartSecretMcpoAuthResponses, on as StreamEventsError, oo as StreamEventsErrors, op as StreamEventsResponse, oq as StreamEventsResponses, or as StructuredDataContentBlock, eW as SubmitToolCallResultData, eY as SubmitToolCallResultError, os as SubmitToolCallResultErrors, ot as SubmitToolCallResultRequest, ou as SubmitToolCallResultResponse, eX as SubmitToolCallResultResponse2, ov as SubmitToolCallResultResponses, ow as SubmitToolResultContentBlock, ox as TextContentBlock, oy as Timestamp, oz as ToolCall, oA as ToolCallId, oB as ToolCallOutcome, oC as ToolCallState, oD as ToolCallType, oE as ToolCallUpdate, cv as ToolCatalog, oF as ToolCatalogEntry, oG as ToolInput, oH as ToolPermissionMode, oI as ToolPermissionProfile, oJ as ToolPermissionSelection, oK as ToolResult, oL as ToolResultContentBlock, oM as ToolResultEvent, eZ as UpdateAgentConfigData, e$ as UpdateAgentConfigError, oN as UpdateAgentConfigErrors, oO as UpdateAgentConfigRequest, oP as UpdateAgentConfigResponse, e_ as UpdateAgentConfigResponse2, oQ as UpdateAgentConfigResponses, f0 as UpdateAgentProfileData, f2 as UpdateAgentProfileError, oR as UpdateAgentProfileErrors, oS as UpdateAgentProfileRequest, f1 as UpdateAgentProfileResponse, oT as UpdateAgentProfileResponses, f3 as UpdateConfiguredModelData, f5 as UpdateConfiguredModelError, oU as UpdateConfiguredModelErrors, oV as UpdateConfiguredModelRequest, f4 as UpdateConfiguredModelResponse, oW as UpdateConfiguredModelResponses, f6 as UpdateCronTriggerData, f8 as UpdateCronTriggerError, oX as UpdateCronTriggerErrors, oY as UpdateCronTriggerRequest, f7 as UpdateCronTriggerResponse, oZ as UpdateCronTriggerResponses, f9 as UpdateMachineData, fb as UpdateMachineError, o_ as UpdateMachineErrors, fc as UpdateMachinePoolData, fe as UpdateMachinePoolError, o$ as UpdateMachinePoolErrors, p0 as UpdateMachinePoolRequest, fd as UpdateMachinePoolResponse, p1 as UpdateMachinePoolResponses, p2 as UpdateMachineRequest, fa as UpdateMachineResponse, p3 as UpdateMachineResponses, ff as UpdateModelProviderConfigData, fh as UpdateModelProviderConfigError, p4 as UpdateModelProviderConfigErrors, p5 as UpdateModelProviderConfigRequest, fg as UpdateModelProviderConfigResponse, p6 as UpdateModelProviderConfigResponses, fi as UpdateOrgApiKeyData, fk as UpdateOrgApiKeyError, p7 as UpdateOrgApiKeyErrors, p8 as UpdateOrgApiKeyRequest, fj as UpdateOrgApiKeyResponse, p9 as UpdateOrgApiKeyResponses, fl as UpdateOrgMemberData, fn as UpdateOrgMemberError, pa as UpdateOrgMemberErrors, pb as UpdateOrgMemberRequest, fm as UpdateOrgMemberResponse, pc as UpdateOrgMemberResponses, fo as UpdateProjectMachinePoolGrantData, fq as UpdateProjectMachinePoolGrantError, pd as UpdateProjectMachinePoolGrantErrors, pe as UpdateProjectMachinePoolGrantRequest, fp as UpdateProjectMachinePoolGrantResponse, pf as UpdateProjectMachinePoolGrantResponses, fr as UpdateProjectModelGrantData, ft as UpdateProjectModelGrantError, pg as UpdateProjectModelGrantErrors, ph as UpdateProjectModelGrantRequest, fs as UpdateProjectModelGrantResponse, pi as UpdateProjectModelGrantResponses, fu as UpdateSecretData, fw as UpdateSecretError, pj as UpdateSecretErrors, pk as UpdateSecretRequest, fv as UpdateSecretResponse, pl as UpdateSecretResponses, pm as UserId, pn as UserSecretOwner, po as UserSecretOwnerInput, pp as UserSkillOwner, pq as UserSkillOwnerInput, pr as VisibleMachine, ps as VisibleProject, pt as Warning, pu as sdk } from './sdk.gen-j-xlf6lr.js';
|
|
5
|
+
import * as z from 'zod';
|
|
6
|
+
|
|
7
|
+
declare const createClient: (config?: Config) => Client;
|
|
8
|
+
|
|
9
|
+
type OmnaraClient = ReturnType<typeof createClient>;
|
|
10
|
+
interface OmnaraClientOptions {
|
|
11
|
+
baseUrl?: string;
|
|
12
|
+
credentials?: RequestCredentials;
|
|
13
|
+
auth?: AuthStrategy;
|
|
14
|
+
headers?: Record<string, string>;
|
|
15
|
+
}
|
|
16
|
+
declare function createOmnaraClient(options?: OmnaraClientOptions): OmnaraClient;
|
|
17
|
+
|
|
18
|
+
type AgentEventStreamErrorKind = 'aborted' | 'contract' | 'http' | 'transport';
|
|
19
|
+
declare class AgentEventStreamError extends Error {
|
|
20
|
+
readonly kind: AgentEventStreamErrorKind;
|
|
21
|
+
readonly retryable: boolean;
|
|
22
|
+
readonly status: number | undefined;
|
|
23
|
+
constructor({ kind, message, retryable, status, cause, }: {
|
|
24
|
+
kind: AgentEventStreamErrorKind;
|
|
25
|
+
message: string;
|
|
26
|
+
retryable: boolean;
|
|
27
|
+
status?: number;
|
|
28
|
+
cause?: unknown;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
interface OpenAgentEventStreamOptions {
|
|
32
|
+
client: OmnaraClient;
|
|
33
|
+
path: StreamEventsData['path'];
|
|
34
|
+
query?: StreamEventsData['query'];
|
|
35
|
+
headers?: StreamEventsData['headers'];
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
}
|
|
38
|
+
interface AgentEventStream {
|
|
39
|
+
stream: AsyncGenerator<AgentEventStreamData>;
|
|
40
|
+
}
|
|
41
|
+
declare function openAgentEventStream({ client, path, query, headers, signal, }: OpenAgentEventStreamOptions): Promise<AgentEventStream>;
|
|
42
|
+
|
|
43
|
+
declare const zDeviceAuthFailureResponse: z.ZodObject<{
|
|
44
|
+
error: z.ZodEnum<{
|
|
45
|
+
access_denied: "access_denied";
|
|
46
|
+
expired_token: "expired_token";
|
|
47
|
+
}>;
|
|
48
|
+
}, z.core.$strip>;
|
|
49
|
+
type DeviceAuthFailureCode = z.infer<typeof zDeviceAuthFailureResponse>['error'];
|
|
50
|
+
declare class DeviceAuthError extends Error {
|
|
51
|
+
readonly code: DeviceAuthFailureCode;
|
|
52
|
+
constructor(code: DeviceAuthFailureCode);
|
|
53
|
+
}
|
|
54
|
+
interface DeviceAuthStart {
|
|
55
|
+
deviceCode: string;
|
|
56
|
+
userCode: string;
|
|
57
|
+
verificationUri: string;
|
|
58
|
+
verificationUriComplete: string;
|
|
59
|
+
expiresInSeconds: number;
|
|
60
|
+
intervalSeconds: number;
|
|
61
|
+
}
|
|
62
|
+
interface StartDeviceAuthOptions {
|
|
63
|
+
baseUrl: string;
|
|
64
|
+
clientName: string;
|
|
65
|
+
tokenName: string;
|
|
66
|
+
fetch?: typeof fetch;
|
|
67
|
+
}
|
|
68
|
+
declare function startDeviceAuth(options: StartDeviceAuthOptions): Promise<DeviceAuthStart>;
|
|
69
|
+
interface PollDeviceAuthTokenOptions {
|
|
70
|
+
baseUrl: string;
|
|
71
|
+
deviceCode: string;
|
|
72
|
+
intervalSeconds: number;
|
|
73
|
+
fetch?: typeof fetch;
|
|
74
|
+
sleep?: (seconds: number) => Promise<void>;
|
|
75
|
+
}
|
|
76
|
+
declare function pollDeviceAuthToken(options: PollDeviceAuthTokenOptions): Promise<string>;
|
|
77
|
+
|
|
78
|
+
type ApiErrorCode = Error$1['code'];
|
|
79
|
+
declare class ApiError extends Error {
|
|
80
|
+
readonly status: number;
|
|
81
|
+
readonly code: ApiErrorCode | undefined;
|
|
82
|
+
constructor(status: number, message: string, code?: ApiErrorCode);
|
|
83
|
+
static fromResponse(response: Response): Promise<ApiError>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export { AgentEventStreamData, AgentEventStreamError, type AgentEventStreamErrorKind, ApiError, type ApiErrorCode, AuthStrategy, DeviceAuthError, type DeviceAuthFailureCode, type DeviceAuthStart, Error$1 as Error, type OmnaraClient, type OmnaraClientOptions, type OpenAgentEventStreamOptions, type PollDeviceAuthTokenOptions, type StartDeviceAuthOptions, StreamEventsData, createOmnaraClient, openAgentEventStream, pollDeviceAuthToken, startDeviceAuth };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ApiError
|
|
3
|
+
} from "./chunk-TMPF6DRL.js";
|
|
4
|
+
import {
|
|
5
|
+
createClient,
|
|
6
|
+
createConfig,
|
|
7
|
+
isUnknownEnumError,
|
|
8
|
+
sdk_gen_exports,
|
|
9
|
+
streamEvents
|
|
10
|
+
} from "./chunk-DGGYBF7D.js";
|
|
11
|
+
import {
|
|
12
|
+
zStreamEventsResponse
|
|
13
|
+
} from "./chunk-CT4AUW4R.js";
|
|
14
|
+
import "./chunk-PZ5AY32C.js";
|
|
15
|
+
|
|
16
|
+
// src/agent-event-stream.ts
|
|
17
|
+
var AgentEventStreamError = class extends Error {
|
|
18
|
+
kind;
|
|
19
|
+
retryable;
|
|
20
|
+
status;
|
|
21
|
+
constructor({
|
|
22
|
+
kind,
|
|
23
|
+
message,
|
|
24
|
+
retryable,
|
|
25
|
+
status,
|
|
26
|
+
cause
|
|
27
|
+
}) {
|
|
28
|
+
super(message, { cause });
|
|
29
|
+
this.name = "AgentEventStreamError";
|
|
30
|
+
this.kind = kind;
|
|
31
|
+
this.retryable = retryable;
|
|
32
|
+
this.status = status;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
var generatedHTTPError = /^SSE failed: (\d{3})(?:\s|$)/;
|
|
36
|
+
function classifyStreamError(error, signal) {
|
|
37
|
+
if (error instanceof AgentEventStreamError) return error;
|
|
38
|
+
if (signal?.aborted === true || error instanceof Error && error.name === "AbortError") {
|
|
39
|
+
return new AgentEventStreamError({
|
|
40
|
+
kind: "aborted",
|
|
41
|
+
message: "Agent event stream canceled",
|
|
42
|
+
retryable: false,
|
|
43
|
+
cause: error
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
const match = error instanceof Error ? generatedHTTPError.exec(error.message) : null;
|
|
47
|
+
const status = match?.[1] == null ? void 0 : Number.parseInt(match[1], 10);
|
|
48
|
+
if (status != null) {
|
|
49
|
+
return new AgentEventStreamError({
|
|
50
|
+
kind: "http",
|
|
51
|
+
message: `Agent event stream request failed with HTTP ${status}`,
|
|
52
|
+
retryable: status === 408 || status === 429 || status >= 500,
|
|
53
|
+
status,
|
|
54
|
+
cause: error
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
return new AgentEventStreamError({
|
|
58
|
+
kind: "transport",
|
|
59
|
+
message: "Agent event stream disconnected",
|
|
60
|
+
retryable: true,
|
|
61
|
+
cause: error
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
async function* validatedFrames(source, sourceError, signal) {
|
|
65
|
+
try {
|
|
66
|
+
for await (const data of source) {
|
|
67
|
+
const parsed = await zStreamEventsResponse.safeParseAsync(data);
|
|
68
|
+
if (parsed.success) {
|
|
69
|
+
yield parsed.data;
|
|
70
|
+
} else if (isUnknownEnumError(parsed.error, data)) {
|
|
71
|
+
yield data;
|
|
72
|
+
} else {
|
|
73
|
+
throw new AgentEventStreamError({
|
|
74
|
+
kind: "contract",
|
|
75
|
+
message: "Agent event stream received data that does not match the API contract",
|
|
76
|
+
retryable: false,
|
|
77
|
+
cause: parsed.error
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} catch (error2) {
|
|
82
|
+
throw classifyStreamError(error2, signal);
|
|
83
|
+
}
|
|
84
|
+
const error = sourceError();
|
|
85
|
+
if (error != null) throw error;
|
|
86
|
+
}
|
|
87
|
+
async function openAgentEventStream({
|
|
88
|
+
client,
|
|
89
|
+
path,
|
|
90
|
+
query,
|
|
91
|
+
headers,
|
|
92
|
+
signal
|
|
93
|
+
}) {
|
|
94
|
+
let connectionError;
|
|
95
|
+
try {
|
|
96
|
+
const result = await streamEvents({
|
|
97
|
+
client,
|
|
98
|
+
path,
|
|
99
|
+
query,
|
|
100
|
+
headers,
|
|
101
|
+
signal,
|
|
102
|
+
responseValidator: void 0,
|
|
103
|
+
sseMaxRetryAttempts: 1,
|
|
104
|
+
onSseError: (error) => {
|
|
105
|
+
connectionError = classifyStreamError(error, signal);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
stream: validatedFrames(result.stream, () => connectionError, signal)
|
|
110
|
+
};
|
|
111
|
+
} catch (error) {
|
|
112
|
+
throw classifyStreamError(error, signal);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// src/auth.ts
|
|
117
|
+
function bearerToken(token) {
|
|
118
|
+
const resolve = typeof token === "function" ? token : () => token;
|
|
119
|
+
return {
|
|
120
|
+
async authenticate(request) {
|
|
121
|
+
const value = await resolve();
|
|
122
|
+
if (value) request.headers.set("Authorization", `Bearer ${value}`);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
// src/client.ts
|
|
128
|
+
function createOmnaraClient(options = {}) {
|
|
129
|
+
const client = createClient(
|
|
130
|
+
createConfig({
|
|
131
|
+
throwOnError: true
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
client.setConfig({
|
|
135
|
+
baseUrl: options.baseUrl ?? "",
|
|
136
|
+
credentials: options.credentials,
|
|
137
|
+
headers: options.headers
|
|
138
|
+
});
|
|
139
|
+
const { auth } = options;
|
|
140
|
+
if (auth) {
|
|
141
|
+
client.interceptors.request.use(async (request) => {
|
|
142
|
+
await auth.authenticate(request);
|
|
143
|
+
return request;
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
client.interceptors.response.use(async (response) => {
|
|
147
|
+
if (!response.ok) throw await ApiError.fromResponse(response);
|
|
148
|
+
return response;
|
|
149
|
+
});
|
|
150
|
+
return client;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// src/device.ts
|
|
154
|
+
import * as z from "zod";
|
|
155
|
+
var zDeviceAuthStartResponse = z.object({
|
|
156
|
+
device_code: z.string().min(1),
|
|
157
|
+
user_code: z.string().min(1),
|
|
158
|
+
verification_uri: z.string().min(1),
|
|
159
|
+
verification_uri_complete: z.string().min(1),
|
|
160
|
+
expires_in: z.number().int().positive(),
|
|
161
|
+
interval: z.number().int().positive()
|
|
162
|
+
});
|
|
163
|
+
var zDeviceAuthWaitingResponse = z.object({
|
|
164
|
+
interval: z.number().int().positive()
|
|
165
|
+
});
|
|
166
|
+
var zDeviceAuthFailureResponse = z.object({
|
|
167
|
+
error: z.enum(["access_denied", "expired_token"])
|
|
168
|
+
});
|
|
169
|
+
var zDeviceAuthApprovedResponse = z.object({
|
|
170
|
+
access_token: z.string().min(1),
|
|
171
|
+
token_type: z.string()
|
|
172
|
+
});
|
|
173
|
+
var DEVICE_AUTH_FAILURE_MESSAGES = {
|
|
174
|
+
access_denied: "the login request was denied",
|
|
175
|
+
expired_token: "the login request expired before it was approved"
|
|
176
|
+
};
|
|
177
|
+
var DeviceAuthError = class extends Error {
|
|
178
|
+
code;
|
|
179
|
+
constructor(code) {
|
|
180
|
+
super(DEVICE_AUTH_FAILURE_MESSAGES[code]);
|
|
181
|
+
this.name = "DeviceAuthError";
|
|
182
|
+
this.code = code;
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
async function postDeviceAuthJSON(fetchImpl, baseUrl, path, body) {
|
|
186
|
+
return fetchImpl(`${baseUrl.replace(/\/+$/, "")}${path}`, {
|
|
187
|
+
method: "POST",
|
|
188
|
+
headers: { "Content-Type": "application/json" },
|
|
189
|
+
body: JSON.stringify(body)
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
async function startDeviceAuth(options) {
|
|
193
|
+
const response = await postDeviceAuthJSON(
|
|
194
|
+
options.fetch ?? fetch,
|
|
195
|
+
options.baseUrl,
|
|
196
|
+
"/api/auth/device/code",
|
|
197
|
+
{ client_name: options.clientName, token_name: options.tokenName }
|
|
198
|
+
);
|
|
199
|
+
if (!response.ok) throw await ApiError.fromResponse(response);
|
|
200
|
+
const data = zDeviceAuthStartResponse.parse(await response.json());
|
|
201
|
+
return {
|
|
202
|
+
deviceCode: data.device_code,
|
|
203
|
+
userCode: data.user_code,
|
|
204
|
+
verificationUri: new URL(data.verification_uri, options.baseUrl).toString(),
|
|
205
|
+
verificationUriComplete: new URL(data.verification_uri_complete, options.baseUrl).toString(),
|
|
206
|
+
expiresInSeconds: data.expires_in,
|
|
207
|
+
intervalSeconds: data.interval
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
function defaultSleep(seconds) {
|
|
211
|
+
return new Promise((resolve) => setTimeout(resolve, seconds * 1e3));
|
|
212
|
+
}
|
|
213
|
+
async function pollDeviceAuthToken(options) {
|
|
214
|
+
const fetchImpl = options.fetch ?? fetch;
|
|
215
|
+
const sleep = options.sleep ?? defaultSleep;
|
|
216
|
+
let interval = options.intervalSeconds;
|
|
217
|
+
while (true) {
|
|
218
|
+
await sleep(interval);
|
|
219
|
+
const response = await postDeviceAuthJSON(
|
|
220
|
+
fetchImpl,
|
|
221
|
+
options.baseUrl,
|
|
222
|
+
"/api/auth/device/token",
|
|
223
|
+
{
|
|
224
|
+
device_code: options.deviceCode
|
|
225
|
+
}
|
|
226
|
+
);
|
|
227
|
+
if (response.status === 200) {
|
|
228
|
+
return zDeviceAuthApprovedResponse.parse(await response.json()).access_token;
|
|
229
|
+
}
|
|
230
|
+
if (response.status === 202) {
|
|
231
|
+
interval = zDeviceAuthWaitingResponse.parse(await response.json()).interval;
|
|
232
|
+
continue;
|
|
233
|
+
}
|
|
234
|
+
if (response.status === 400) {
|
|
235
|
+
const failure = zDeviceAuthFailureResponse.safeParse(
|
|
236
|
+
await response.clone().json().catch(() => void 0)
|
|
237
|
+
);
|
|
238
|
+
if (failure.success) throw new DeviceAuthError(failure.data.error);
|
|
239
|
+
}
|
|
240
|
+
throw await ApiError.fromResponse(response);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
export {
|
|
244
|
+
AgentEventStreamError,
|
|
245
|
+
ApiError,
|
|
246
|
+
DeviceAuthError,
|
|
247
|
+
bearerToken,
|
|
248
|
+
createOmnaraClient,
|
|
249
|
+
openAgentEventStream,
|
|
250
|
+
pollDeviceAuthToken,
|
|
251
|
+
sdk_gen_exports as sdk,
|
|
252
|
+
startDeviceAuth
|
|
253
|
+
};
|
|
254
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agent-event-stream.ts","../src/auth.ts","../src/client.ts","../src/device.ts"],"sourcesContent":["import type { OmnaraClient } from './client'\nimport { streamEvents } from './generated/sdk.gen'\nimport type { AgentEventStreamData, StreamEventsData } from './generated/types.gen'\nimport { zStreamEventsResponse } from './generated/zod.gen'\nimport { isUnknownEnumError } from './validate-response'\n\nexport type AgentEventStreamErrorKind = 'aborted' | 'contract' | 'http' | 'transport'\n\nexport class AgentEventStreamError extends Error {\n readonly kind: AgentEventStreamErrorKind\n readonly retryable: boolean\n readonly status: number | undefined\n\n constructor({\n kind,\n message,\n retryable,\n status,\n cause,\n }: {\n kind: AgentEventStreamErrorKind\n message: string\n retryable: boolean\n status?: number\n cause?: unknown\n }) {\n super(message, { cause })\n this.name = 'AgentEventStreamError'\n this.kind = kind\n this.retryable = retryable\n this.status = status\n }\n}\n\nexport interface OpenAgentEventStreamOptions {\n client: OmnaraClient\n path: StreamEventsData['path']\n query?: StreamEventsData['query']\n headers?: StreamEventsData['headers']\n signal?: AbortSignal\n}\n\nexport interface AgentEventStream {\n stream: AsyncGenerator<AgentEventStreamData>\n}\n\nconst generatedHTTPError = /^SSE failed: (\\d{3})(?:\\s|$)/\n\nfunction classifyStreamError(error: unknown, signal?: AbortSignal): AgentEventStreamError {\n if (error instanceof AgentEventStreamError) return error\n if (signal?.aborted === true || (error instanceof Error && error.name === 'AbortError')) {\n return new AgentEventStreamError({\n kind: 'aborted',\n message: 'Agent event stream canceled',\n retryable: false,\n cause: error,\n })\n }\n const match = error instanceof Error ? generatedHTTPError.exec(error.message) : null\n const status = match?.[1] == null ? undefined : Number.parseInt(match[1], 10)\n if (status != null) {\n return new AgentEventStreamError({\n kind: 'http',\n message: `Agent event stream request failed with HTTP ${status}`,\n retryable: status === 408 || status === 429 || status >= 500,\n status,\n cause: error,\n })\n }\n return new AgentEventStreamError({\n kind: 'transport',\n message: 'Agent event stream disconnected',\n retryable: true,\n cause: error,\n })\n}\n\nasync function* validatedFrames(\n source: AsyncIterable<unknown>,\n sourceError: () => AgentEventStreamError | undefined,\n signal?: AbortSignal,\n): AsyncGenerator<AgentEventStreamData> {\n try {\n for await (const data of source) {\n const parsed = await zStreamEventsResponse.safeParseAsync(data)\n if (parsed.success) {\n yield parsed.data\n } else if (isUnknownEnumError(parsed.error, data)) {\n yield data as AgentEventStreamData\n } else {\n throw new AgentEventStreamError({\n kind: 'contract',\n message: 'Agent event stream received data that does not match the API contract',\n retryable: false,\n cause: parsed.error,\n })\n }\n }\n } catch (error) {\n throw classifyStreamError(error, signal)\n }\n const error = sourceError()\n if (error != null) throw error\n}\n\nexport async function openAgentEventStream({\n client,\n path,\n query,\n headers,\n signal,\n}: OpenAgentEventStreamOptions): Promise<AgentEventStream> {\n let connectionError: AgentEventStreamError | undefined\n try {\n const result = await streamEvents({\n client,\n path,\n query,\n headers,\n signal,\n responseValidator: undefined,\n sseMaxRetryAttempts: 1,\n onSseError: (error) => {\n connectionError = classifyStreamError(error, signal)\n },\n })\n return {\n stream: validatedFrames(result.stream, () => connectionError, signal),\n }\n } catch (error) {\n throw classifyStreamError(error, signal)\n }\n}\n","export interface AuthStrategy {\n authenticate(request: Request): void | Promise<void>\n}\n\nexport function bearerToken(token: string | (() => string | Promise<string>)): AuthStrategy {\n const resolve = typeof token === 'function' ? token : () => token\n return {\n async authenticate(request) {\n const value = await resolve()\n if (value) request.headers.set('Authorization', `Bearer ${value}`)\n },\n }\n}\n","import type { AuthStrategy } from './auth'\nimport { ApiError } from './errors'\nimport { createClient, createConfig } from './generated/client'\n\nexport type OmnaraClient = ReturnType<typeof createClient>\n\nexport interface OmnaraClientOptions {\n baseUrl?: string\n credentials?: RequestCredentials\n auth?: AuthStrategy\n headers?: Record<string, string>\n}\n\nexport function createOmnaraClient(options: OmnaraClientOptions = {}): OmnaraClient {\n const client = createClient(\n createConfig({\n throwOnError: true,\n }),\n )\n client.setConfig({\n baseUrl: options.baseUrl ?? '',\n credentials: options.credentials,\n headers: options.headers,\n })\n const { auth } = options\n if (auth) {\n client.interceptors.request.use(async (request) => {\n await auth.authenticate(request)\n return request\n })\n }\n client.interceptors.response.use(async (response) => {\n if (!response.ok) throw await ApiError.fromResponse(response)\n return response\n })\n return client\n}\n","import * as z from 'zod'\n\nimport { ApiError } from './errors'\n\nconst zDeviceAuthStartResponse = z.object({\n device_code: z.string().min(1),\n user_code: z.string().min(1),\n verification_uri: z.string().min(1),\n verification_uri_complete: z.string().min(1),\n expires_in: z.number().int().positive(),\n interval: z.number().int().positive(),\n})\n\nconst zDeviceAuthWaitingResponse = z.object({\n interval: z.number().int().positive(),\n})\n\nconst zDeviceAuthFailureResponse = z.object({\n error: z.enum(['access_denied', 'expired_token']),\n})\n\nconst zDeviceAuthApprovedResponse = z.object({\n access_token: z.string().min(1),\n token_type: z.string(),\n})\n\nexport type DeviceAuthFailureCode = z.infer<typeof zDeviceAuthFailureResponse>['error']\n\nconst DEVICE_AUTH_FAILURE_MESSAGES: Record<DeviceAuthFailureCode, string> = {\n access_denied: 'the login request was denied',\n expired_token: 'the login request expired before it was approved',\n}\n\nexport class DeviceAuthError extends Error {\n readonly code: DeviceAuthFailureCode\n\n constructor(code: DeviceAuthFailureCode) {\n super(DEVICE_AUTH_FAILURE_MESSAGES[code])\n this.name = 'DeviceAuthError'\n this.code = code\n }\n}\n\nexport interface DeviceAuthStart {\n deviceCode: string\n userCode: string\n verificationUri: string\n verificationUriComplete: string\n expiresInSeconds: number\n intervalSeconds: number\n}\n\nasync function postDeviceAuthJSON(\n fetchImpl: typeof fetch,\n baseUrl: string,\n path: string,\n body: unknown,\n): Promise<Response> {\n return fetchImpl(`${baseUrl.replace(/\\/+$/, '')}${path}`, {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify(body),\n })\n}\n\nexport interface StartDeviceAuthOptions {\n baseUrl: string\n clientName: string\n tokenName: string\n fetch?: typeof fetch\n}\n\nexport async function startDeviceAuth(options: StartDeviceAuthOptions): Promise<DeviceAuthStart> {\n const response = await postDeviceAuthJSON(\n options.fetch ?? fetch,\n options.baseUrl,\n '/api/auth/device/code',\n { client_name: options.clientName, token_name: options.tokenName },\n )\n if (!response.ok) throw await ApiError.fromResponse(response)\n const data = zDeviceAuthStartResponse.parse(await response.json())\n return {\n deviceCode: data.device_code,\n userCode: data.user_code,\n verificationUri: new URL(data.verification_uri, options.baseUrl).toString(),\n verificationUriComplete: new URL(data.verification_uri_complete, options.baseUrl).toString(),\n expiresInSeconds: data.expires_in,\n intervalSeconds: data.interval,\n }\n}\n\nfunction defaultSleep(seconds: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, seconds * 1000))\n}\n\nexport interface PollDeviceAuthTokenOptions {\n baseUrl: string\n deviceCode: string\n intervalSeconds: number\n fetch?: typeof fetch\n sleep?: (seconds: number) => Promise<void>\n}\n\nexport async function pollDeviceAuthToken(options: PollDeviceAuthTokenOptions): Promise<string> {\n const fetchImpl = options.fetch ?? fetch\n const sleep = options.sleep ?? defaultSleep\n let interval = options.intervalSeconds\n while (true) {\n await sleep(interval)\n const response = await postDeviceAuthJSON(\n fetchImpl,\n options.baseUrl,\n '/api/auth/device/token',\n {\n device_code: options.deviceCode,\n },\n )\n if (response.status === 200) {\n return zDeviceAuthApprovedResponse.parse(await response.json()).access_token\n }\n if (response.status === 202) {\n interval = zDeviceAuthWaitingResponse.parse(await response.json()).interval\n continue\n }\n if (response.status === 400) {\n const failure = zDeviceAuthFailureResponse.safeParse(\n await response\n .clone()\n .json()\n .catch((): unknown => undefined),\n )\n if (failure.success) throw new DeviceAuthError(failure.data.error)\n }\n throw await ApiError.fromResponse(response)\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAQO,IAAM,wBAAN,cAAoC,MAAM;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EAET,YAAY;AAAA,IACV;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,GAMG;AACD,UAAM,SAAS,EAAE,MAAM,CAAC;AACxB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,YAAY;AACjB,SAAK,SAAS;AAAA,EAChB;AACF;AAcA,IAAM,qBAAqB;AAE3B,SAAS,oBAAoB,OAAgB,QAA6C;AACxF,MAAI,iBAAiB,sBAAuB,QAAO;AACnD,MAAI,QAAQ,YAAY,QAAS,iBAAiB,SAAS,MAAM,SAAS,cAAe;AACvF,WAAO,IAAI,sBAAsB;AAAA,MAC/B,MAAM;AAAA,MACN,SAAS;AAAA,MACT,WAAW;AAAA,MACX,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AACA,QAAM,QAAQ,iBAAiB,QAAQ,mBAAmB,KAAK,MAAM,OAAO,IAAI;AAChF,QAAM,SAAS,QAAQ,CAAC,KAAK,OAAO,SAAY,OAAO,SAAS,MAAM,CAAC,GAAG,EAAE;AAC5E,MAAI,UAAU,MAAM;AAClB,WAAO,IAAI,sBAAsB;AAAA,MAC/B,MAAM;AAAA,MACN,SAAS,+CAA+C,MAAM;AAAA,MAC9D,WA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