@openrouter/sdk 1.5.5 → 1.5.7

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.
Files changed (160) hide show
  1. package/esm/funcs/generationsGetGeneration.d.ts +1 -1
  2. package/esm/funcs/generationsGetGeneration.js +2 -2
  3. package/esm/lib/config.d.ts +2 -2
  4. package/esm/lib/config.js +2 -2
  5. package/esm/models/errors/index.d.ts +0 -2
  6. package/esm/models/errors/index.js +0 -2
  7. package/esm/models/index.d.ts +0 -40
  8. package/esm/models/index.js +0 -40
  9. package/esm/models/operations/index.d.ts +0 -15
  10. package/esm/models/operations/index.js +0 -15
  11. package/esm/sdk/sdk.d.ts +0 -3
  12. package/esm/sdk/sdk.js +0 -4
  13. package/jsr.json +1 -1
  14. package/package.json +5 -5
  15. package/esm/funcs/internsChat.d.ts +0 -42
  16. package/esm/funcs/internsChat.js +0 -109
  17. package/esm/funcs/internsCreateIntern.d.ts +0 -21
  18. package/esm/funcs/internsCreateIntern.js +0 -103
  19. package/esm/funcs/internsDeleteIntern.d.ts +0 -21
  20. package/esm/funcs/internsDeleteIntern.js +0 -108
  21. package/esm/funcs/internsGetIntern.d.ts +0 -21
  22. package/esm/funcs/internsGetIntern.js +0 -105
  23. package/esm/funcs/internsGetInternConnections.d.ts +0 -21
  24. package/esm/funcs/internsGetInternConnections.js +0 -105
  25. package/esm/funcs/internsGetInternDaemon.d.ts +0 -21
  26. package/esm/funcs/internsGetInternDaemon.js +0 -105
  27. package/esm/funcs/internsGetInternDaemonAccess.d.ts +0 -23
  28. package/esm/funcs/internsGetInternDaemonAccess.js +0 -107
  29. package/esm/funcs/internsGetInternIcon.d.ts +0 -20
  30. package/esm/funcs/internsGetInternIcon.js +0 -109
  31. package/esm/funcs/internsInvoke.d.ts +0 -26
  32. package/esm/funcs/internsInvoke.js +0 -119
  33. package/esm/funcs/internsListInterns.d.ts +0 -21
  34. package/esm/funcs/internsListInterns.js +0 -107
  35. package/esm/funcs/internsProvisionIntern.d.ts +0 -21
  36. package/esm/funcs/internsProvisionIntern.js +0 -105
  37. package/esm/funcs/internsSignInternDaemonAccessRequest.d.ts +0 -22
  38. package/esm/funcs/internsSignInternDaemonAccessRequest.js +0 -109
  39. package/esm/funcs/internsSignInternDaemonRequest.d.ts +0 -20
  40. package/esm/funcs/internsSignInternDaemonRequest.js +0 -109
  41. package/esm/funcs/internsSuspendIntern.d.ts +0 -21
  42. package/esm/funcs/internsSuspendIntern.js +0 -105
  43. package/esm/funcs/internsUpdateIntern.d.ts +0 -21
  44. package/esm/funcs/internsUpdateIntern.js +0 -108
  45. package/esm/models/createinternrequest.d.ts +0 -43
  46. package/esm/models/createinternrequest.js +0 -24
  47. package/esm/models/deleteinternrequest.d.ts +0 -18
  48. package/esm/models/deleteinternrequest.js +0 -18
  49. package/esm/models/deleteinternresponse.d.ts +0 -10
  50. package/esm/models/deleteinternresponse.js +0 -14
  51. package/esm/models/errors/internchaterrorresponse.d.ts +0 -31
  52. package/esm/models/errors/internchaterrorresponse.js +0 -35
  53. package/esm/models/errors/internlifecycleerror.d.ts +0 -25
  54. package/esm/models/errors/internlifecycleerror.js +0 -35
  55. package/esm/models/intern.d.ts +0 -120
  56. package/esm/models/intern.js +0 -74
  57. package/esm/models/internapprovalmode.d.ts +0 -16
  58. package/esm/models/internapprovalmode.js +0 -15
  59. package/esm/models/internchatassistantmessage.d.ts +0 -24
  60. package/esm/models/internchatassistantmessage.js +0 -22
  61. package/esm/models/internchatchoice.d.ts +0 -37
  62. package/esm/models/internchatchoice.js +0 -33
  63. package/esm/models/internchatcompletionchunk.d.ts +0 -48
  64. package/esm/models/internchatcompletionchunk.js +0 -34
  65. package/esm/models/internchatcompletionrequest.d.ts +0 -40
  66. package/esm/models/internchatcompletionrequest.js +0 -25
  67. package/esm/models/internchatdelta.d.ts +0 -24
  68. package/esm/models/internchatdelta.js +0 -28
  69. package/esm/models/internchatdevelopermessage.d.ts +0 -21
  70. package/esm/models/internchatdevelopermessage.js +0 -15
  71. package/esm/models/internchatechoedtoolcall.d.ts +0 -21
  72. package/esm/models/internchatechoedtoolcall.js +0 -15
  73. package/esm/models/internchatechoedtoolcallfunction.d.ts +0 -17
  74. package/esm/models/internchatechoedtoolcallfunction.js +0 -14
  75. package/esm/models/internchaterror.d.ts +0 -22
  76. package/esm/models/internchaterror.js +0 -17
  77. package/esm/models/internchaterrormetadata.d.ts +0 -48
  78. package/esm/models/internchaterrormetadata.js +0 -39
  79. package/esm/models/internchatmessage.d.ts +0 -16
  80. package/esm/models/internchatmessage.js +0 -22
  81. package/esm/models/internchatmessagecontent.d.ts +0 -12
  82. package/esm/models/internchatmessagecontent.js +0 -12
  83. package/esm/models/internchatprompttokensdetails.d.ts +0 -13
  84. package/esm/models/internchatprompttokensdetails.js +0 -19
  85. package/esm/models/internchatsteeredresponse.d.ts +0 -33
  86. package/esm/models/internchatsteeredresponse.js +0 -28
  87. package/esm/models/internchatstreamerror.d.ts +0 -22
  88. package/esm/models/internchatstreamerror.js +0 -17
  89. package/esm/models/internchatstreamingresponse.d.ts +0 -17
  90. package/esm/models/internchatstreamingresponse.js +0 -29
  91. package/esm/models/internchatsystemmessage.d.ts +0 -21
  92. package/esm/models/internchatsystemmessage.js +0 -15
  93. package/esm/models/internchattextpart.d.ts +0 -24
  94. package/esm/models/internchattextpart.js +0 -19
  95. package/esm/models/internchattoolcall.d.ts +0 -30
  96. package/esm/models/internchattoolcall.js +0 -23
  97. package/esm/models/internchattoolcallfunction.d.ts +0 -24
  98. package/esm/models/internchattoolcallfunction.js +0 -20
  99. package/esm/models/internchattoolmessage.d.ts +0 -23
  100. package/esm/models/internchattoolmessage.js +0 -21
  101. package/esm/models/internchatusage.d.ts +0 -24
  102. package/esm/models/internchatusage.js +0 -27
  103. package/esm/models/internchatusermessage.d.ts +0 -21
  104. package/esm/models/internchatusermessage.js +0 -15
  105. package/esm/models/internconnection.d.ts +0 -118
  106. package/esm/models/internconnection.js +0 -105
  107. package/esm/models/internconnectionlist.d.ts +0 -11
  108. package/esm/models/internconnectionlist.js +0 -15
  109. package/esm/models/interndaemonaccess.d.ts +0 -24
  110. package/esm/models/interndaemonaccess.js +0 -23
  111. package/esm/models/interninvokeacceptedresponse.d.ts +0 -34
  112. package/esm/models/interninvokeacceptedresponse.js +0 -30
  113. package/esm/models/interninvokerequest.d.ts +0 -23
  114. package/esm/models/interninvokerequest.js +0 -19
  115. package/esm/models/internlifecycleerror.d.ts +0 -23
  116. package/esm/models/internlifecycleerror.js +0 -32
  117. package/esm/models/internlistresponse.d.ts +0 -22
  118. package/esm/models/internlistresponse.js +0 -23
  119. package/esm/models/operations/createintern.d.ts +0 -61
  120. package/esm/models/operations/createintern.js +0 -25
  121. package/esm/models/operations/createinternchatcompletion.d.ts +0 -77
  122. package/esm/models/operations/createinternchatcompletion.js +0 -71
  123. package/esm/models/operations/deleteintern.d.ts +0 -61
  124. package/esm/models/operations/deleteintern.js +0 -24
  125. package/esm/models/operations/getintern.d.ts +0 -58
  126. package/esm/models/operations/getintern.js +0 -21
  127. package/esm/models/operations/getinternconnections.d.ts +0 -58
  128. package/esm/models/operations/getinternconnections.js +0 -21
  129. package/esm/models/operations/getinterndaemon.d.ts +0 -58
  130. package/esm/models/operations/getinterndaemon.js +0 -21
  131. package/esm/models/operations/getinterndaemonaccess.d.ts +0 -58
  132. package/esm/models/operations/getinterndaemonaccess.js +0 -21
  133. package/esm/models/operations/getinternicon.d.ts +0 -63
  134. package/esm/models/operations/getinternicon.js +0 -22
  135. package/esm/models/operations/invokeintern.d.ts +0 -72
  136. package/esm/models/operations/invokeintern.js +0 -38
  137. package/esm/models/operations/listinterns.d.ts +0 -87
  138. package/esm/models/operations/listinterns.js +0 -40
  139. package/esm/models/operations/provisionintern.d.ts +0 -58
  140. package/esm/models/operations/provisionintern.js +0 -21
  141. package/esm/models/operations/signinterndaemonaccessrequest.d.ts +0 -72
  142. package/esm/models/operations/signinterndaemonaccessrequest.js +0 -38
  143. package/esm/models/operations/signinterndaemonrequest.d.ts +0 -72
  144. package/esm/models/operations/signinterndaemonrequest.js +0 -38
  145. package/esm/models/operations/suspendintern.d.ts +0 -58
  146. package/esm/models/operations/suspendintern.js +0 -21
  147. package/esm/models/operations/updateintern.d.ts +0 -61
  148. package/esm/models/operations/updateintern.js +0 -24
  149. package/esm/models/provisioninternresponse.d.ts +0 -10
  150. package/esm/models/provisioninternresponse.js +0 -14
  151. package/esm/models/signinterndaemonrequest.d.ts +0 -54
  152. package/esm/models/signinterndaemonrequest.js +0 -30
  153. package/esm/models/signinterndaemonresponse.d.ts +0 -32
  154. package/esm/models/signinterndaemonresponse.js +0 -27
  155. package/esm/models/suspendinternresponse.d.ts +0 -10
  156. package/esm/models/suspendinternresponse.js +0 -14
  157. package/esm/models/updateinternrequest.d.ts +0 -33
  158. package/esm/models/updateinternrequest.js +0 -16
  159. package/esm/sdk/interns.d.ts +0 -143
  160. package/esm/sdk/interns.js +0 -163
@@ -1,22 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as operations from "../models/operations/index.js";
9
- import { APIPromise } from "../types/async.js";
10
- import { Result } from "../types/fp.js";
11
- /**
12
- * Sign a daemon request with the caller's identity (deprecated alias)
13
- *
14
- * @remarks
15
- * Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
16
- *
17
- * If set, this operation will use {@link Security.apiKey} from the global security.
18
- *
19
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
20
- */
21
- export declare function internsSignInternDaemonAccessRequest(client: OpenRouterCore, request: operations.SignInternDaemonAccessRequestRequest, options?: RequestOptions): APIPromise<Result<operations.SignInternDaemonAccessRequestResponse, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
22
- //# sourceMappingURL=internsSignInternDaemonAccessRequest.d.ts.map
@@ -1,109 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 89cb6ec2c0e2
4
- */
5
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
- import { matchStatusCode } from "../lib/http.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
13
- import { SignInternDaemonAccessRequestRequest$outboundSchema as operations_SignInternDaemonAccessRequestRequest$outboundSchema, SignInternDaemonAccessRequestResponse$inboundSchema as operations_SignInternDaemonAccessRequestResponse$inboundSchema } from "../models/operations/signinterndaemonaccessrequest.js";
14
- import { APIPromise } from "../types/async.js";
15
- /**
16
- * Sign a daemon request with the caller's identity (deprecated alias)
17
- *
18
- * @remarks
19
- * Deprecated alias of `POST /interns/{internId}/daemon/sign` with the same request, response, and errors. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
20
- *
21
- * If set, this operation will use {@link Security.apiKey} from the global security.
22
- *
23
- * @deprecated method: This will be removed in a future release, please migrate away from it as soon as possible.
24
- */
25
- export function internsSignInternDaemonAccessRequest(client, request, options) {
26
- return new APIPromise($do(client, request, options));
27
- }
28
- async function $do(client, request, options) {
29
- const parsed = safeParse(request, (value) => operations_SignInternDaemonAccessRequestRequest$outboundSchema.parse(value), "Input validation failed");
30
- if (!parsed.ok) {
31
- return [parsed, { status: "invalid" }];
32
- }
33
- const payload = parsed.value;
34
- const body = encodeJSON("body", payload.SignInternDaemonRequest, {
35
- explode: true,
36
- });
37
- const pathParams = {
38
- internId: encodeSimple("internId", payload.internId, {
39
- explode: false,
40
- charEncoding: "percent",
41
- }),
42
- };
43
- const path = pathToFunc("/interns/{internId}/daemon-access/sign")(pathParams);
44
- const headers = new Headers(compactMap({
45
- "Content-Type": "application/json",
46
- Accept: "application/json",
47
- "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
48
- "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
49
- "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
50
- }));
51
- const secConfig = await extractSecurity(client._options.apiKey);
52
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
53
- const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
54
- const context = {
55
- options: client._options,
56
- baseURL: options?.serverURL ?? client._baseURL ?? "",
57
- operationID: "signInternDaemonAccessRequest",
58
- oAuth2Scopes: null,
59
- resolvedSecurity: requestSecurity,
60
- securitySource: client._options.apiKey,
61
- retryConfig: options?.retries
62
- || client._options.retryConfig
63
- || {
64
- strategy: "backoff",
65
- backoff: {
66
- initialInterval: 500,
67
- maxInterval: 60000,
68
- exponent: 1.5,
69
- maxElapsedTime: 3600000,
70
- },
71
- retryConnectionErrors: true,
72
- }
73
- || { strategy: "none" },
74
- retryCodes: options?.retryCodes || ["5XX"],
75
- };
76
- const requestRes = client._createRequest(context, {
77
- security: requestSecurity,
78
- method: "POST",
79
- baseURL: options?.serverURL,
80
- path: path,
81
- headers: headers,
82
- body: body,
83
- userAgent: client._options.userAgent,
84
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
85
- }, options);
86
- if (!requestRes.ok) {
87
- return [requestRes, { status: "invalid" }];
88
- }
89
- const req = requestRes.value;
90
- const doResult = await client._do(req, {
91
- context,
92
- isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
93
- retryConfig: context.retryConfig,
94
- retryCodes: context.retryCodes,
95
- });
96
- if (!doResult.ok) {
97
- return [doResult, { status: "request-error", request: req }];
98
- }
99
- const response = doResult.value;
100
- const responseFields = {
101
- HttpMeta: { Response: response, Request: req },
102
- };
103
- const [result] = await M.match(M.json(200, operations_SignInternDaemonAccessRequestResponse$inboundSchema, { key: "Result" }), M.jsonErr([400, 401, 403, 404, 408, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr(429, errors_InternLifecycleError$inboundSchema, { hdrs: true }), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
104
- if (!result.ok) {
105
- return [result, { status: "complete", request: req, response }];
106
- }
107
- return [result, { status: "complete", request: req, response }];
108
- }
109
- //# sourceMappingURL=internsSignInternDaemonAccessRequest.js.map
@@ -1,20 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as operations from "../models/operations/index.js";
9
- import { APIPromise } from "../types/async.js";
10
- import { Result } from "../types/fp.js";
11
- /**
12
- * Sign a daemon request with the caller's identity
13
- *
14
- * @remarks
15
- * Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user's personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
16
- *
17
- * If set, this operation will use {@link Security.apiKey} from the global security.
18
- */
19
- export declare function internsSignInternDaemonRequest(client: OpenRouterCore, request: operations.SignInternDaemonRequestRequest, options?: RequestOptions): APIPromise<Result<operations.SignInternDaemonRequestResponse, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
20
- //# sourceMappingURL=internsSignInternDaemonRequest.d.ts.map
@@ -1,109 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 597f99f3800d
4
- */
5
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
- import { matchStatusCode } from "../lib/http.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
13
- import { SignInternDaemonRequestRequest$outboundSchema as operations_SignInternDaemonRequestRequest$outboundSchema, SignInternDaemonRequestResponse$inboundSchema as operations_SignInternDaemonRequestResponse$inboundSchema } from "../models/operations/signinterndaemonrequest.js";
14
- import { APIPromise } from "../types/async.js";
15
- /**
16
- * Sign a daemon request with the caller's identity
17
- *
18
- * @remarks
19
- * Signs the SHA-256 digest of one request the CLI is about to send to the intern daemon, binding it to the intern and to the signed-in member so personal connections resolve. Only an OAuth session from `ori login --oidc` whose grant carries `vault:read` can sign: an API key is refused with 403 because it names no person, and an `interns`-only grant is refused with 403 because a proof releases that user's personal connections. The route is behind the same gate as chat and counts against the chat turn limiter. The response is sent with `Cache-Control: no-store`. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
20
- *
21
- * If set, this operation will use {@link Security.apiKey} from the global security.
22
- */
23
- export function internsSignInternDaemonRequest(client, request, options) {
24
- return new APIPromise($do(client, request, options));
25
- }
26
- async function $do(client, request, options) {
27
- const parsed = safeParse(request, (value) => operations_SignInternDaemonRequestRequest$outboundSchema.parse(value), "Input validation failed");
28
- if (!parsed.ok) {
29
- return [parsed, { status: "invalid" }];
30
- }
31
- const payload = parsed.value;
32
- const body = encodeJSON("body", payload.SignInternDaemonRequest, {
33
- explode: true,
34
- });
35
- const pathParams = {
36
- internId: encodeSimple("internId", payload.internId, {
37
- explode: false,
38
- charEncoding: "percent",
39
- }),
40
- };
41
- const path = pathToFunc("/interns/{internId}/daemon/sign")(pathParams);
42
- const headers = new Headers(compactMap({
43
- "Content-Type": "application/json",
44
- Accept: "application/json",
45
- "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
46
- "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
47
- "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
48
- }));
49
- const secConfig = await extractSecurity(client._options.apiKey);
50
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
51
- const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
52
- const context = {
53
- options: client._options,
54
- baseURL: options?.serverURL ?? client._baseURL ?? "",
55
- operationID: "signInternDaemonRequest",
56
- oAuth2Scopes: null,
57
- resolvedSecurity: requestSecurity,
58
- securitySource: client._options.apiKey,
59
- retryConfig: options?.retries
60
- || client._options.retryConfig
61
- || {
62
- strategy: "backoff",
63
- backoff: {
64
- initialInterval: 500,
65
- maxInterval: 60000,
66
- exponent: 1.5,
67
- maxElapsedTime: 3600000,
68
- },
69
- retryConnectionErrors: true,
70
- }
71
- || { strategy: "none" },
72
- retryCodes: options?.retryCodes || ["5XX"],
73
- };
74
- const requestRes = client._createRequest(context, {
75
- security: requestSecurity,
76
- method: "POST",
77
- baseURL: options?.serverURL,
78
- path: path,
79
- headers: headers,
80
- body: body,
81
- userAgent: client._options.userAgent,
82
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
83
- }, options);
84
- if (!requestRes.ok) {
85
- return [requestRes, { status: "invalid" }];
86
- }
87
- const req = requestRes.value;
88
- const doResult = await client._do(req, {
89
- context,
90
- isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
91
- retryConfig: context.retryConfig,
92
- retryCodes: context.retryCodes,
93
- });
94
- if (!doResult.ok) {
95
- return [doResult, { status: "request-error", request: req }];
96
- }
97
- const response = doResult.value;
98
- const responseFields = {
99
- HttpMeta: { Response: response, Request: req },
100
- };
101
- const [result] = await M.match(M.json(200, operations_SignInternDaemonRequestResponse$inboundSchema, {
102
- key: "Result",
103
- }), M.jsonErr([400, 401, 403, 404, 408, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr(429, errors_InternLifecycleError$inboundSchema, { hdrs: true }), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
104
- if (!result.ok) {
105
- return [result, { status: "complete", request: req, response }];
106
- }
107
- return [result, { status: "complete", request: req, response }];
108
- }
109
- //# sourceMappingURL=internsSignInternDaemonRequest.js.map
@@ -1,21 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as models from "../models/index.js";
9
- import * as operations from "../models/operations/index.js";
10
- import { APIPromise } from "../types/async.js";
11
- import { Result } from "../types/fp.js";
12
- /**
13
- * Suspend an intern
14
- *
15
- * @remarks
16
- * Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
17
- *
18
- * If set, this operation will use {@link Security.apiKey} from the global security.
19
- */
20
- export declare function internsSuspendIntern(client: OpenRouterCore, request: operations.SuspendInternRequest, options?: RequestOptions): APIPromise<Result<models.SuspendInternResponse, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
- //# sourceMappingURL=internsSuspendIntern.d.ts.map
@@ -1,105 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 5928ef254c09
4
- */
5
- import { encodeSimple } from "../lib/encodings.js";
6
- import { matchStatusCode } from "../lib/http.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
13
- import { SuspendInternResponse$inboundSchema as models_SuspendInternResponse$inboundSchema } from "../models/suspendinternresponse.js";
14
- import { SuspendInternRequest$outboundSchema as operations_SuspendInternRequest$outboundSchema } from "../models/operations/suspendintern.js";
15
- import { APIPromise } from "../types/async.js";
16
- /**
17
- * Suspend an intern
18
- *
19
- * @remarks
20
- * Stops the intern runtime while keeping its disk and configuration for a later provision call. This operation takes no request body. A body carrying any field is refused with 400 rather than ignored. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
- *
22
- * If set, this operation will use {@link Security.apiKey} from the global security.
23
- */
24
- export function internsSuspendIntern(client, request, options) {
25
- return new APIPromise($do(client, request, options));
26
- }
27
- async function $do(client, request, options) {
28
- const parsed = safeParse(request, (value) => operations_SuspendInternRequest$outboundSchema.parse(value), "Input validation failed");
29
- if (!parsed.ok) {
30
- return [parsed, { status: "invalid" }];
31
- }
32
- const payload = parsed.value;
33
- const body = null;
34
- const pathParams = {
35
- internId: encodeSimple("internId", payload.internId, {
36
- explode: false,
37
- charEncoding: "percent",
38
- }),
39
- };
40
- const path = pathToFunc("/interns/{internId}/suspend")(pathParams);
41
- const headers = new Headers(compactMap({
42
- Accept: "application/json",
43
- "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
44
- "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
45
- "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
46
- }));
47
- const secConfig = await extractSecurity(client._options.apiKey);
48
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
49
- const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
50
- const context = {
51
- options: client._options,
52
- baseURL: options?.serverURL ?? client._baseURL ?? "",
53
- operationID: "suspendIntern",
54
- oAuth2Scopes: null,
55
- resolvedSecurity: requestSecurity,
56
- securitySource: client._options.apiKey,
57
- retryConfig: options?.retries
58
- || client._options.retryConfig
59
- || {
60
- strategy: "backoff",
61
- backoff: {
62
- initialInterval: 500,
63
- maxInterval: 60000,
64
- exponent: 1.5,
65
- maxElapsedTime: 3600000,
66
- },
67
- retryConnectionErrors: true,
68
- }
69
- || { strategy: "none" },
70
- retryCodes: options?.retryCodes || ["5XX"],
71
- };
72
- const requestRes = client._createRequest(context, {
73
- security: requestSecurity,
74
- method: "POST",
75
- baseURL: options?.serverURL,
76
- path: path,
77
- headers: headers,
78
- body: body,
79
- userAgent: client._options.userAgent,
80
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
81
- }, options);
82
- if (!requestRes.ok) {
83
- return [requestRes, { status: "invalid" }];
84
- }
85
- const req = requestRes.value;
86
- const doResult = await client._do(req, {
87
- context,
88
- isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
89
- retryConfig: context.retryConfig,
90
- retryCodes: context.retryCodes,
91
- });
92
- if (!doResult.ok) {
93
- return [doResult, { status: "request-error", request: req }];
94
- }
95
- const response = doResult.value;
96
- const responseFields = {
97
- HttpMeta: { Response: response, Request: req },
98
- };
99
- const [result] = await M.match(M.json(200, models_SuspendInternResponse$inboundSchema), M.jsonErr([400, 401, 403, 404, 408, 409, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr([500, 502], errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
100
- if (!result.ok) {
101
- return [result, { status: "complete", request: req, response }];
102
- }
103
- return [result, { status: "complete", request: req, response }];
104
- }
105
- //# sourceMappingURL=internsSuspendIntern.js.map
@@ -1,21 +0,0 @@
1
- import { OpenRouterCore } from "../core.js";
2
- import { RequestOptions } from "../lib/sdks.js";
3
- import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
- import * as errors from "../models/errors/index.js";
5
- import { OpenRouterError } from "../models/errors/openroutererror.js";
6
- import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
7
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
- import * as models from "../models/index.js";
9
- import * as operations from "../models/operations/index.js";
10
- import { APIPromise } from "../types/async.js";
11
- import { Result } from "../types/fp.js";
12
- /**
13
- * Update an intern
14
- *
15
- * @remarks
16
- * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
17
- *
18
- * If set, this operation will use {@link Security.apiKey} from the global security.
19
- */
20
- export declare function internsUpdateIntern(client: OpenRouterCore, request: operations.UpdateInternRequest, options?: RequestOptions): APIPromise<Result<models.Intern, errors.InternLifecycleError | OpenRouterError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
21
- //# sourceMappingURL=internsUpdateIntern.d.ts.map
@@ -1,108 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 1d493469e489
4
- */
5
- import { encodeJSON, encodeSimple } from "../lib/encodings.js";
6
- import { matchStatusCode } from "../lib/http.js";
7
- import * as M from "../lib/matchers.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
11
- import { pathToFunc } from "../lib/url.js";
12
- import { InternLifecycleError$inboundSchema as errors_InternLifecycleError$inboundSchema } from "../models/errors/internlifecycleerror.js";
13
- import { Intern$inboundSchema as models_Intern$inboundSchema } from "../models/intern.js";
14
- import { UpdateInternRequest$outboundSchema as operations_UpdateInternRequest$outboundSchema } from "../models/operations/updateintern.js";
15
- import { APIPromise } from "../types/async.js";
16
- /**
17
- * Update an intern
18
- *
19
- * @remarks
20
- * Changes the intern name, description, instructions or model. Omitted fields stay unchanged. The request body is capped at 1048576 bytes and a larger body is refused with 413. A non-empty body must declare `Content-Type: application/json` or it is refused with 415. The API key selects the caller, workspace and visible interns. An intern's own API key sees only that intern: the collection and every other intern answer 404 to it. There is no default workspace fallback. Requests on regional hostnames such as `eu.openrouter.ai` are refused. [API key](/docs/api-reference/authentication) required.
21
- *
22
- * If set, this operation will use {@link Security.apiKey} from the global security.
23
- */
24
- export function internsUpdateIntern(client, request, options) {
25
- return new APIPromise($do(client, request, options));
26
- }
27
- async function $do(client, request, options) {
28
- const parsed = safeParse(request, (value) => operations_UpdateInternRequest$outboundSchema.parse(value), "Input validation failed");
29
- if (!parsed.ok) {
30
- return [parsed, { status: "invalid" }];
31
- }
32
- const payload = parsed.value;
33
- const body = encodeJSON("body", payload.UpdateInternRequest, {
34
- explode: true,
35
- });
36
- const pathParams = {
37
- internId: encodeSimple("internId", payload.internId, {
38
- explode: false,
39
- charEncoding: "percent",
40
- }),
41
- };
42
- const path = pathToFunc("/interns/{internId}")(pathParams);
43
- const headers = new Headers(compactMap({
44
- "Content-Type": "application/json",
45
- Accept: "application/json",
46
- "HTTP-Referer": encodeSimple("HTTP-Referer", payload["HTTP-Referer"] ?? client._options.httpReferer, { explode: false, charEncoding: "none" }),
47
- "X-OpenRouter-Categories": encodeSimple("X-OpenRouter-Categories", payload.appCategories ?? client._options.appCategories, { explode: false, charEncoding: "none" }),
48
- "X-OpenRouter-Title": encodeSimple("X-OpenRouter-Title", payload.appTitle ?? client._options.appTitle, { explode: false, charEncoding: "none" }),
49
- }));
50
- const secConfig = await extractSecurity(client._options.apiKey);
51
- const securityInput = secConfig == null ? {} : { apiKey: secConfig };
52
- const requestSecurity = resolveGlobalSecurity(securityInput, [0]);
53
- const context = {
54
- options: client._options,
55
- baseURL: options?.serverURL ?? client._baseURL ?? "",
56
- operationID: "updateIntern",
57
- oAuth2Scopes: null,
58
- resolvedSecurity: requestSecurity,
59
- securitySource: client._options.apiKey,
60
- retryConfig: options?.retries
61
- || client._options.retryConfig
62
- || {
63
- strategy: "backoff",
64
- backoff: {
65
- initialInterval: 500,
66
- maxInterval: 60000,
67
- exponent: 1.5,
68
- maxElapsedTime: 3600000,
69
- },
70
- retryConnectionErrors: true,
71
- }
72
- || { strategy: "none" },
73
- retryCodes: options?.retryCodes || ["5XX"],
74
- };
75
- const requestRes = client._createRequest(context, {
76
- security: requestSecurity,
77
- method: "PATCH",
78
- baseURL: options?.serverURL,
79
- path: path,
80
- headers: headers,
81
- body: body,
82
- userAgent: client._options.userAgent,
83
- timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
84
- }, options);
85
- if (!requestRes.ok) {
86
- return [requestRes, { status: "invalid" }];
87
- }
88
- const req = requestRes.value;
89
- const doResult = await client._do(req, {
90
- context,
91
- isErrorStatusCode: (statusCode) => matchStatusCode({ status: statusCode }, ["4XX", "5XX"]),
92
- retryConfig: context.retryConfig,
93
- retryCodes: context.retryCodes,
94
- });
95
- if (!doResult.ok) {
96
- return [doResult, { status: "request-error", request: req }];
97
- }
98
- const response = doResult.value;
99
- const responseFields = {
100
- HttpMeta: { Response: response, Request: req },
101
- };
102
- const [result] = await M.match(M.json(200, models_Intern$inboundSchema), M.jsonErr([400, 401, 403, 404, 408, 409, 413, 415], errors_InternLifecycleError$inboundSchema), M.jsonErr(500, errors_InternLifecycleError$inboundSchema), M.fail("4XX"), M.fail("5XX"))(response, req, { extraFields: responseFields });
103
- if (!result.ok) {
104
- return [result, { status: "complete", request: req, response }];
105
- }
106
- return [result, { status: "complete", request: req, response }];
107
- }
108
- //# sourceMappingURL=internsUpdateIntern.js.map
@@ -1,43 +0,0 @@
1
- import * as z from "zod/v4";
2
- /**
3
- * Settings for a new intern.
4
- */
5
- export type CreateInternRequest = {
6
- /**
7
- * Free-form description, or null.
8
- */
9
- description?: string | null | undefined;
10
- /**
11
- * Standing instructions the intern boots with, or null.
12
- */
13
- instructions?: string | null | undefined;
14
- /**
15
- * Intern name, unique per creator within the workspace.
16
- */
17
- name: string;
18
- /**
19
- * Start provisioning during this create operation. Defaults to false.
20
- */
21
- provision?: boolean | undefined;
22
- /**
23
- * Vault owned by another intern in this workspace to attach as a borrowed vault.
24
- */
25
- vaultId?: string | undefined;
26
- /**
27
- * Workspace that will own the intern. Defaults to the workspace the API key resolves to. When given, it must match the API key workspace.
28
- */
29
- workspaceId?: string | undefined;
30
- };
31
- /** @internal */
32
- export type CreateInternRequest$Outbound = {
33
- description?: string | null | undefined;
34
- instructions?: string | null | undefined;
35
- name: string;
36
- provision: boolean;
37
- vault_id?: string | undefined;
38
- workspace_id?: string | undefined;
39
- };
40
- /** @internal */
41
- export declare const CreateInternRequest$outboundSchema: z.ZodType<CreateInternRequest$Outbound, CreateInternRequest>;
42
- export declare function createInternRequestToJSON(createInternRequest: CreateInternRequest): string;
43
- //# sourceMappingURL=createinternrequest.d.ts.map
@@ -1,24 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 98307ca98901
4
- */
5
- import * as z from "zod/v4";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
- /** @internal */
8
- export const CreateInternRequest$outboundSchema = z.object({
9
- description: z.nullable(z.string()).optional(),
10
- instructions: z.nullable(z.string()).optional(),
11
- name: z.string(),
12
- provision: z.boolean().default(false),
13
- vaultId: z.string().optional(),
14
- workspaceId: z.string().optional(),
15
- }).transform((v) => {
16
- return remap$(v, {
17
- vaultId: "vault_id",
18
- workspaceId: "workspace_id",
19
- });
20
- });
21
- export function createInternRequestToJSON(createInternRequest) {
22
- return JSON.stringify(CreateInternRequest$outboundSchema.parse(createInternRequest));
23
- }
24
- //# sourceMappingURL=createinternrequest.js.map
@@ -1,18 +0,0 @@
1
- import * as z from "zod/v4";
2
- /**
3
- * Optional consent for a teardown that discards the workspace.
4
- */
5
- export type DeleteInternRequest = {
6
- /**
7
- * Delete even though the workspace backup was not confirmed. Defaults to false, which refuses the teardown when a workspace archive is missing.
8
- */
9
- acknowledgeWorkspaceLoss?: boolean | undefined;
10
- };
11
- /** @internal */
12
- export type DeleteInternRequest$Outbound = {
13
- acknowledge_workspace_loss: boolean;
14
- };
15
- /** @internal */
16
- export declare const DeleteInternRequest$outboundSchema: z.ZodType<DeleteInternRequest$Outbound, DeleteInternRequest>;
17
- export declare function deleteInternRequestToJSON(deleteInternRequest: DeleteInternRequest): string;
18
- //# sourceMappingURL=deleteinternrequest.d.ts.map
@@ -1,18 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 732bd4f781c2
4
- */
5
- import * as z from "zod/v4";
6
- import { remap as remap$ } from "../lib/primitives.js";
7
- /** @internal */
8
- export const DeleteInternRequest$outboundSchema = z.object({
9
- acknowledgeWorkspaceLoss: z.boolean().default(false),
10
- }).transform((v) => {
11
- return remap$(v, {
12
- acknowledgeWorkspaceLoss: "acknowledge_workspace_loss",
13
- });
14
- });
15
- export function deleteInternRequestToJSON(deleteInternRequest) {
16
- return JSON.stringify(DeleteInternRequest$outboundSchema.parse(deleteInternRequest));
17
- }
18
- //# sourceMappingURL=deleteinternrequest.js.map
@@ -1,10 +0,0 @@
1
- import * as z from "zod/v4";
2
- import { Result as SafeParseResult } from "../types/fp.js";
3
- import { SDKValidationError } from "./errors/sdkvalidationerror.js";
4
- export type DeleteInternResponse = {
5
- deleting: true;
6
- };
7
- /** @internal */
8
- export declare const DeleteInternResponse$inboundSchema: z.ZodType<DeleteInternResponse, unknown>;
9
- export declare function deleteInternResponseFromJSON(jsonString: string): SafeParseResult<DeleteInternResponse, SDKValidationError>;
10
- //# sourceMappingURL=deleteinternresponse.d.ts.map