@puku-ai/sdk 4.0.3 → 4.0.4

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 (199) hide show
  1. package/README.md +24 -7
  2. package/dist/index.cjs +85 -0
  3. package/dist/vendor/_vendor/partial-json-parser/parser.cjs +225 -0
  4. package/dist/vendor/api-promise.cjs +18 -0
  5. package/dist/vendor/client.cjs +1013 -0
  6. package/dist/vendor/core/api-promise.cjs +80 -0
  7. package/dist/vendor/core/api.cjs +2 -0
  8. package/dist/vendor/core/credentials.cjs +313 -0
  9. package/dist/vendor/core/error.cjs +156 -0
  10. package/dist/vendor/core/middleware.cjs +173 -0
  11. package/dist/vendor/core/pagination.cjs +215 -0
  12. package/dist/vendor/core/resource.cjs +11 -0
  13. package/dist/vendor/core/streaming.cjs +346 -0
  14. package/dist/vendor/core/uploads.cjs +5 -0
  15. package/dist/vendor/error.cjs +18 -0
  16. package/dist/vendor/helpers/beta/environments.cjs +30 -0
  17. package/dist/vendor/helpers/beta/json-schema.cjs +56 -0
  18. package/dist/vendor/helpers/beta/mcp.cjs +418 -0
  19. package/dist/vendor/helpers/beta/memory.cjs +17 -0
  20. package/dist/vendor/helpers/beta/standard-schema.cjs +57 -0
  21. package/dist/vendor/helpers/beta/zod.cjs +88 -0
  22. package/dist/vendor/helpers/index.cjs +7 -0
  23. package/dist/vendor/helpers/json-schema.cjs +36 -0
  24. package/dist/vendor/helpers/zod.cjs +77 -0
  25. package/dist/vendor/index.cjs +54 -0
  26. package/dist/vendor/internal/builtin-types.cjs +3 -0
  27. package/dist/vendor/internal/constants.cjs +12 -0
  28. package/dist/vendor/internal/decoders/jsonl.cjs +40 -0
  29. package/dist/vendor/internal/decoders/line.cjs +109 -0
  30. package/dist/vendor/internal/detect-platform.cjs +159 -0
  31. package/dist/vendor/internal/errors.cjs +42 -0
  32. package/dist/vendor/internal/file-store.cjs +535 -0
  33. package/dist/vendor/internal/headers.cjs +119 -0
  34. package/dist/vendor/internal/message-stream-utils.cjs +33 -0
  35. package/dist/vendor/internal/node.browser.cjs +21 -0
  36. package/dist/vendor/internal/node.cjs +55 -0
  37. package/dist/vendor/internal/parse.cjs +65 -0
  38. package/dist/vendor/internal/qs/formats.cjs +12 -0
  39. package/dist/vendor/internal/qs/index.cjs +13 -0
  40. package/dist/vendor/internal/qs/stringify.cjs +276 -0
  41. package/dist/vendor/internal/qs/types.cjs +2 -0
  42. package/dist/vendor/internal/qs/utils.cjs +229 -0
  43. package/dist/vendor/internal/request-options.cjs +31 -0
  44. package/dist/vendor/internal/request-signal.cjs +49 -0
  45. package/dist/vendor/internal/shim-types.cjs +3 -0
  46. package/dist/vendor/internal/shims.cjs +91 -0
  47. package/dist/vendor/internal/stainless-helper-header.cjs +90 -0
  48. package/dist/vendor/internal/stream-utils.cjs +37 -0
  49. package/dist/vendor/internal/to-file.cjs +95 -0
  50. package/dist/vendor/internal/types.cjs +3 -0
  51. package/dist/vendor/internal/uploads.cjs +148 -0
  52. package/dist/vendor/internal/utils/abort.cjs +24 -0
  53. package/dist/vendor/internal/utils/async-queue.cjs +69 -0
  54. package/dist/vendor/internal/utils/backoff.cjs +43 -0
  55. package/dist/vendor/internal/utils/base64.cjs +37 -0
  56. package/dist/vendor/internal/utils/bytes.cjs +30 -0
  57. package/dist/vendor/internal/utils/env.cjs +21 -0
  58. package/dist/vendor/internal/utils/log.cjs +111 -0
  59. package/dist/vendor/internal/utils/path.cjs +78 -0
  60. package/dist/vendor/internal/utils/promise.cjs +17 -0
  61. package/dist/vendor/internal/utils/query.cjs +41 -0
  62. package/dist/vendor/internal/utils/sleep.cjs +27 -0
  63. package/dist/vendor/internal/utils/time.cjs +7 -0
  64. package/dist/vendor/internal/utils/uuid.cjs +18 -0
  65. package/dist/vendor/internal/utils/values.cjs +125 -0
  66. package/dist/vendor/internal/utils.cjs +24 -0
  67. package/dist/vendor/lib/BetaMessageStream.cjs +665 -0
  68. package/dist/vendor/lib/MessageStream.cjs +612 -0
  69. package/dist/vendor/lib/beta-parser.cjs +78 -0
  70. package/dist/vendor/lib/credentials/credential-chain.cjs +244 -0
  71. package/dist/vendor/lib/credentials/identity-token.cjs +71 -0
  72. package/dist/vendor/lib/credentials/oidc-federation.cjs +81 -0
  73. package/dist/vendor/lib/credentials/token-cache.cjs +113 -0
  74. package/dist/vendor/lib/credentials/types.cjs +267 -0
  75. package/dist/vendor/lib/credentials/user-oauth.cjs +129 -0
  76. package/dist/vendor/lib/credentials.cjs +7 -0
  77. package/dist/vendor/lib/environments/index.cjs +17 -0
  78. package/dist/vendor/lib/environments/poller.cjs +226 -0
  79. package/dist/vendor/lib/environments/worker.cjs +609 -0
  80. package/dist/vendor/lib/helper-client.cjs +57 -0
  81. package/dist/vendor/lib/middleware.cjs +779 -0
  82. package/dist/vendor/lib/parser.cjs +65 -0
  83. package/dist/vendor/lib/sessions/accumulate.cjs +44 -0
  84. package/dist/vendor/lib/standard-schema.cjs +44 -0
  85. package/dist/vendor/lib/tools/BetaRunnableTool.cjs +30 -0
  86. package/dist/vendor/lib/tools/BetaToolRunner.cjs +500 -0
  87. package/dist/vendor/lib/tools/CompactionControl.cjs +27 -0
  88. package/dist/vendor/lib/tools/SessionToolRunner.cjs +740 -0
  89. package/dist/vendor/lib/tools/ToolError.cjs +46 -0
  90. package/dist/vendor/lib/transform-json-schema.cjs +113 -0
  91. package/dist/vendor/pagination.cjs +18 -0
  92. package/dist/vendor/resource.cjs +18 -0
  93. package/dist/vendor/resources/beta/agents/agents.cjs +159 -0
  94. package/dist/vendor/resources/beta/agents/index.cjs +8 -0
  95. package/dist/vendor/resources/beta/agents/versions.cjs +35 -0
  96. package/dist/vendor/resources/beta/agents.cjs +18 -0
  97. package/dist/vendor/resources/beta/beta.cjs +105 -0
  98. package/dist/vendor/resources/beta/deployment-runs.cjs +54 -0
  99. package/dist/vendor/resources/beta/deployments.cjs +195 -0
  100. package/dist/vendor/resources/beta/dreams.cjs +115 -0
  101. package/dist/vendor/resources/beta/environments/environments.cjs +178 -0
  102. package/dist/vendor/resources/beta/environments/index.cjs +8 -0
  103. package/dist/vendor/resources/beta/environments/work.cjs +256 -0
  104. package/dist/vendor/resources/beta/environments.cjs +18 -0
  105. package/dist/vendor/resources/beta/files.cjs +123 -0
  106. package/dist/vendor/resources/beta/index.cjs +38 -0
  107. package/dist/vendor/resources/beta/memory-stores/index.cjs +10 -0
  108. package/dist/vendor/resources/beta/memory-stores/memories.cjs +129 -0
  109. package/dist/vendor/resources/beta/memory-stores/memory-stores.cjs +173 -0
  110. package/dist/vendor/resources/beta/memory-stores/memory-versions.cjs +80 -0
  111. package/dist/vendor/resources/beta/memory-stores.cjs +18 -0
  112. package/dist/vendor/resources/beta/messages/batches.cjs +206 -0
  113. package/dist/vendor/resources/beta/messages/index.cjs +11 -0
  114. package/dist/vendor/resources/beta/messages/messages.cjs +189 -0
  115. package/dist/vendor/resources/beta/messages.cjs +18 -0
  116. package/dist/vendor/resources/beta/models.cjs +59 -0
  117. package/dist/vendor/resources/beta/organization/api-keys.cjs +55 -0
  118. package/dist/vendor/resources/beta/organization/compliance-settings.cjs +51 -0
  119. package/dist/vendor/resources/beta/organization/external-keys.cjs +118 -0
  120. package/dist/vendor/resources/beta/organization/federation/federation.cjs +49 -0
  121. package/dist/vendor/resources/beta/organization/federation/index.cjs +10 -0
  122. package/dist/vendor/resources/beta/organization/federation/issuers.cjs +168 -0
  123. package/dist/vendor/resources/beta/organization/federation/rules/index.cjs +8 -0
  124. package/dist/vendor/resources/beta/organization/federation/rules/rules.cjs +226 -0
  125. package/dist/vendor/resources/beta/organization/federation/rules/workspaces.cjs +113 -0
  126. package/dist/vendor/resources/beta/organization/federation/rules.cjs +18 -0
  127. package/dist/vendor/resources/beta/organization/federation.cjs +18 -0
  128. package/dist/vendor/resources/beta/organization/index.cjs +24 -0
  129. package/dist/vendor/resources/beta/organization/invites.cjs +75 -0
  130. package/dist/vendor/resources/beta/organization/organization.cjs +90 -0
  131. package/dist/vendor/resources/beta/organization/rate-limits.cjs +30 -0
  132. package/dist/vendor/resources/beta/organization/service-accounts/index.cjs +8 -0
  133. package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.cjs +202 -0
  134. package/dist/vendor/resources/beta/organization/service-accounts/workspaces.cjs +124 -0
  135. package/dist/vendor/resources/beta/organization/service-accounts.cjs +18 -0
  136. package/dist/vendor/resources/beta/organization/users.cjs +66 -0
  137. package/dist/vendor/resources/beta/organization/workspaces/index.cjs +12 -0
  138. package/dist/vendor/resources/beta/organization/workspaces/members.cjs +101 -0
  139. package/dist/vendor/resources/beta/organization/workspaces/rate-limits.cjs +33 -0
  140. package/dist/vendor/resources/beta/organization/workspaces/service-accounts.cjs +188 -0
  141. package/dist/vendor/resources/beta/organization/workspaces/workspaces.cjs +140 -0
  142. package/dist/vendor/resources/beta/organization/workspaces.cjs +18 -0
  143. package/dist/vendor/resources/beta/organization.cjs +18 -0
  144. package/dist/vendor/resources/beta/sessions/events.cjs +119 -0
  145. package/dist/vendor/resources/beta/sessions/index.cjs +12 -0
  146. package/dist/vendor/resources/beta/sessions/resources.cjs +131 -0
  147. package/dist/vendor/resources/beta/sessions/sessions.cjs +186 -0
  148. package/dist/vendor/resources/beta/sessions/threads/events.cjs +60 -0
  149. package/dist/vendor/resources/beta/sessions/threads/index.cjs +8 -0
  150. package/dist/vendor/resources/beta/sessions/threads/threads.cjs +116 -0
  151. package/dist/vendor/resources/beta/sessions/threads.cjs +18 -0
  152. package/dist/vendor/resources/beta/sessions.cjs +18 -0
  153. package/dist/vendor/resources/beta/skills/index.cjs +8 -0
  154. package/dist/vendor/resources/beta/skills/skills.cjs +132 -0
  155. package/dist/vendor/resources/beta/skills/versions.cjs +128 -0
  156. package/dist/vendor/resources/beta/skills.cjs +18 -0
  157. package/dist/vendor/resources/beta/tunnels/certificates.cjs +128 -0
  158. package/dist/vendor/resources/beta/tunnels/index.cjs +8 -0
  159. package/dist/vendor/resources/beta/tunnels/tunnels.cjs +209 -0
  160. package/dist/vendor/resources/beta/tunnels.cjs +18 -0
  161. package/dist/vendor/resources/beta/user-profiles.cjs +117 -0
  162. package/dist/vendor/resources/beta/vaults/credentials.cjs +176 -0
  163. package/dist/vendor/resources/beta/vaults/index.cjs +8 -0
  164. package/dist/vendor/resources/beta/vaults/vaults.cjs +177 -0
  165. package/dist/vendor/resources/beta/vaults.cjs +18 -0
  166. package/dist/vendor/resources/beta/webhooks.cjs +32 -0
  167. package/dist/vendor/resources/beta.cjs +18 -0
  168. package/dist/vendor/resources/completions.cjs +22 -0
  169. package/dist/vendor/resources/files.cjs +51 -0
  170. package/dist/vendor/resources/index.cjs +31 -0
  171. package/dist/vendor/resources/messages/batches.cjs +160 -0
  172. package/dist/vendor/resources/messages/index.cjs +8 -0
  173. package/dist/vendor/resources/messages/messages.cjs +159 -0
  174. package/dist/vendor/resources/messages.cjs +18 -0
  175. package/dist/vendor/resources/models.cjs +44 -0
  176. package/dist/vendor/resources/shared.cjs +3 -0
  177. package/dist/vendor/resources/skills/index.cjs +8 -0
  178. package/dist/vendor/resources/skills/skills.cjs +72 -0
  179. package/dist/vendor/resources/skills/versions.cjs +40 -0
  180. package/dist/vendor/resources/skills.cjs +18 -0
  181. package/dist/vendor/resources/top-level.cjs +3 -0
  182. package/dist/vendor/resources.cjs +17 -0
  183. package/dist/vendor/streaming.cjs +18 -0
  184. package/dist/vendor/tools/agent-toolset/fs-util.cjs +193 -0
  185. package/dist/vendor/tools/agent-toolset/memories.cjs +916 -0
  186. package/dist/vendor/tools/agent-toolset/node.browser.cjs +147 -0
  187. package/dist/vendor/tools/agent-toolset/node.cjs +939 -0
  188. package/dist/vendor/tools/agent-toolset/skills.cjs +325 -0
  189. package/dist/vendor/tools/agent-toolset/sync-interval.cjs +28 -0
  190. package/dist/vendor/tools/memory/node.browser.cjs +48 -0
  191. package/dist/vendor/tools/memory/node.cjs +364 -0
  192. package/dist/vendor/uploads.cjs +18 -0
  193. package/dist/vendor/version.cjs +4 -0
  194. package/package.json +12 -13
  195. package/sdk.cjs +0 -14271
  196. package/sdk.cjs.map +0 -149
  197. package/sdk.d.ts +0 -10866
  198. package/sdk.mjs +0 -68
  199. package/sdk.mjs.map +0 -149
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
16
+ };
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ __exportStar(require("./messages/index"), exports);
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Models = void 0;
5
+ const resource_1 = require("../../core/resource");
6
+ const pagination_1 = require("../../core/pagination");
7
+ const headers_1 = require("../../internal/headers");
8
+ const path_1 = require("../../internal/utils/path");
9
+ class Models extends resource_1.APIResource {
10
+ /**
11
+ * Get a specific model.
12
+ *
13
+ * The Models API response can be used to determine information about a specific
14
+ * model or resolve a model alias to a model ID.
15
+ *
16
+ * @example
17
+ * ```ts
18
+ * const betaModelInfo = await client.beta.models.retrieve(
19
+ * 'model_id',
20
+ * );
21
+ * ```
22
+ */
23
+ retrieve(modelID, params = {}, options) {
24
+ const { betas } = params ?? {};
25
+ return this._client.get((0, path_1.path) `/v1/models/${modelID}?beta=true`, {
26
+ ...options,
27
+ headers: (0, headers_1.buildHeaders)([
28
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
29
+ options?.headers,
30
+ ]),
31
+ });
32
+ }
33
+ /**
34
+ * List available models.
35
+ *
36
+ * The Models API response can be used to determine which models are available for
37
+ * use in the API. More recently released models are listed first.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * // Automatically fetches more pages as needed.
42
+ * for await (const betaModelInfo of client.beta.models.list()) {
43
+ * // ...
44
+ * }
45
+ * ```
46
+ */
47
+ list(params = {}, options) {
48
+ const { betas, ...query } = params ?? {};
49
+ return this._client.getAPIList('/v1/models?beta=true', (pagination_1.Page), {
50
+ query,
51
+ ...options,
52
+ headers: (0, headers_1.buildHeaders)([
53
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
54
+ options?.headers,
55
+ ]),
56
+ });
57
+ }
58
+ }
59
+ exports.Models = Models;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.APIKeys = void 0;
5
+ const resource_1 = require("../../../core/resource");
6
+ const pagination_1 = require("../../../core/pagination");
7
+ const path_1 = require("../../../internal/utils/path");
8
+ class APIKeys extends resource_1.APIResource {
9
+ /**
10
+ * Get API Key
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const betaAPIKey =
15
+ * await client.beta.organization.apiKeys.retrieve(
16
+ * 'api_key_id',
17
+ * );
18
+ * ```
19
+ */
20
+ retrieve(apiKeyID, options) {
21
+ return this._client.get((0, path_1.path) `/v1/organizations/api_keys/${apiKeyID}?beta=true`, options);
22
+ }
23
+ /**
24
+ * Update API Key
25
+ *
26
+ * @example
27
+ * ```ts
28
+ * const betaAPIKey =
29
+ * await client.beta.organization.apiKeys.update(
30
+ * 'api_key_id',
31
+ * );
32
+ * ```
33
+ */
34
+ update(apiKeyID, body, options) {
35
+ return this._client.post((0, path_1.path) `/v1/organizations/api_keys/${apiKeyID}?beta=true`, { body, ...options });
36
+ }
37
+ /**
38
+ * List API Keys
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * // Automatically fetches more pages as needed.
43
+ * for await (const betaAPIKey of client.beta.organization.apiKeys.list()) {
44
+ * // ...
45
+ * }
46
+ * ```
47
+ */
48
+ list(query = {}, options) {
49
+ return this._client.getAPIList('/v1/organizations/api_keys?beta=true', (pagination_1.Page), {
50
+ query,
51
+ ...options,
52
+ });
53
+ }
54
+ }
55
+ exports.APIKeys = APIKeys;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ComplianceSettings = void 0;
5
+ const resource_1 = require("../../../core/resource");
6
+ class ComplianceSettings extends resource_1.APIResource {
7
+ /**
8
+ * Retrieve your organization's Compliance Settings.
9
+ *
10
+ * Compliance Settings is a singleton resource: there is exactly one per
11
+ * organization, addressed without an identifier. The `state` field reflects
12
+ * whether the Compliance API is enabled. An organization with a parent
13
+ * organization reads the state inherited from the parent's configuration.
14
+ *
15
+ * @example
16
+ * ```ts
17
+ * const betaComplianceSettings =
18
+ * await client.beta.organization.complianceSettings.retrieve();
19
+ * ```
20
+ */
21
+ retrieve(options) {
22
+ return this._client.get('/v1/organizations/compliance_settings?beta=true', options);
23
+ }
24
+ /**
25
+ * Update your organization's Compliance Settings.
26
+ *
27
+ * Setting `state` to `enabled` turns on the Compliance API and begins capturing
28
+ * organization activity events. Setting it to `disabled` turns both off. `state`
29
+ * reflects whether the Compliance API is enabled.
30
+ *
31
+ * A request that sets `state` to its current value succeeds and leaves the
32
+ * resource unchanged. A `disabled` request stays in effect until a later `enabled`
33
+ * request or the organization's next provisioning action that enables Access
34
+ * Transparency: enabling Access Transparency also enables the Compliance API,
35
+ * which serves its activity events, so such provisioning (including re-runs)
36
+ * re-enables the Compliance API even after a `disabled` request. Automated
37
+ * provisioning never disables compliance settings.
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const betaComplianceSettings =
42
+ * await client.beta.organization.complianceSettings.update({
43
+ * state: { type: 'enabled' },
44
+ * });
45
+ * ```
46
+ */
47
+ update(body, options) {
48
+ return this._client.post('/v1/organizations/compliance_settings?beta=true', { body, ...options });
49
+ }
50
+ }
51
+ exports.ComplianceSettings = ComplianceSettings;
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ExternalKeys = void 0;
5
+ const resource_1 = require("../../../core/resource");
6
+ const pagination_1 = require("../../../core/pagination");
7
+ const path_1 = require("../../../internal/utils/path");
8
+ class ExternalKeys extends resource_1.APIResource {
9
+ /**
10
+ * Create an external key config owned by the caller's organization.
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * const betaExternalKey =
15
+ * await client.beta.organization.externalKeys.create({
16
+ * provider_config: {
17
+ * kms_arn:
18
+ * 'arn:aws:kms:us-east-1:111122223333:key/abcd1234-5678-90ab-cdef-000011112222',
19
+ * type: 'aws',
20
+ * },
21
+ * });
22
+ * ```
23
+ */
24
+ create(body, options) {
25
+ return this._client.post('/v1/organizations/external_keys?beta=true', { body, ...options });
26
+ }
27
+ /**
28
+ * Retrieve a single external key config in the caller's organization by ID.
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const betaExternalKey =
33
+ * await client.beta.organization.externalKeys.retrieve(
34
+ * 'external_key_id',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(externalKeyID, options) {
39
+ return this._client.get((0, path_1.path) `/v1/organizations/external_keys/${externalKeyID}?beta=true`, options);
40
+ }
41
+ /**
42
+ * Partially update an external key config. Omitted fields are left unchanged.
43
+ *
44
+ * `display_name` is always editable. `geo` and `provider_config` cannot be changed
45
+ * once any workspace references this config, because previously encrypted data
46
+ * requires the original key identity to decrypt.
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const betaExternalKey =
51
+ * await client.beta.organization.externalKeys.update(
52
+ * 'external_key_id',
53
+ * );
54
+ * ```
55
+ */
56
+ update(externalKeyID, body, options) {
57
+ return this._client.post((0, path_1.path) `/v1/organizations/external_keys/${externalKeyID}?beta=true`, {
58
+ body,
59
+ ...options,
60
+ });
61
+ }
62
+ /**
63
+ * List external key configs in the caller's organization.
64
+ *
65
+ * Results are ordered by creation time (newest first). Use the `next_page` cursor
66
+ * from the response to fetch subsequent pages.
67
+ *
68
+ * @example
69
+ * ```ts
70
+ * // Automatically fetches more pages as needed.
71
+ * for await (const betaExternalKey of client.beta.organization.externalKeys.list()) {
72
+ * // ...
73
+ * }
74
+ * ```
75
+ */
76
+ list(query = {}, options) {
77
+ return this._client.getAPIList('/v1/organizations/external_keys?beta=true', (pagination_1.PageCursor), {
78
+ query,
79
+ ...options,
80
+ });
81
+ }
82
+ /**
83
+ * Delete an external key config.
84
+ *
85
+ * The request is rejected if any workspace still references this config.
86
+ *
87
+ * @example
88
+ * ```ts
89
+ * const externalKey =
90
+ * await client.beta.organization.externalKeys.delete(
91
+ * 'external_key_id',
92
+ * );
93
+ * ```
94
+ */
95
+ delete(externalKeyID, options) {
96
+ return this._client.delete((0, path_1.path) `/v1/organizations/external_keys/${externalKeyID}?beta=true`, options);
97
+ }
98
+ /**
99
+ * Validate an external key config against the customer's KMS.
100
+ *
101
+ * PukuAI performs an encrypt/decrypt roundtrip against the configured KMS key
102
+ * and waits up to 30 seconds for the result. The response status is `success` if
103
+ * the roundtrip succeeded, or `failure` with an error message if it failed or
104
+ * timed out.
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const response =
109
+ * await client.beta.organization.externalKeys.validate(
110
+ * 'external_key_id',
111
+ * );
112
+ * ```
113
+ */
114
+ validate(externalKeyID, options) {
115
+ return this._client.post((0, path_1.path) `/v1/organizations/external_keys/${externalKeyID}/validate?beta=true`, options);
116
+ }
117
+ }
118
+ exports.ExternalKeys = ExternalKeys;
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ exports.Federation = void 0;
38
+ const resource_1 = require("../../../../core/resource");
39
+ const IssuersAPI = __importStar(require("./issuers"));
40
+ const issuers_1 = require("./issuers");
41
+ const RulesAPI = __importStar(require("./rules/rules"));
42
+ const rules_1 = require("./rules/rules");
43
+ class Federation extends resource_1.APIResource {
44
+ issuers = new IssuersAPI.Issuers(this._client);
45
+ rules = new RulesAPI.Rules(this._client);
46
+ }
47
+ exports.Federation = Federation;
48
+ Federation.Issuers = issuers_1.Issuers;
49
+ Federation.Rules = rules_1.Rules;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Rules = exports.Issuers = exports.Federation = void 0;
5
+ var federation_1 = require("./federation");
6
+ Object.defineProperty(exports, "Federation", { enumerable: true, get: function () { return federation_1.Federation; } });
7
+ var issuers_1 = require("./issuers");
8
+ Object.defineProperty(exports, "Issuers", { enumerable: true, get: function () { return issuers_1.Issuers; } });
9
+ var index_1 = require("./rules/index");
10
+ Object.defineProperty(exports, "Rules", { enumerable: true, get: function () { return index_1.Rules; } });
@@ -0,0 +1,168 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Issuers = void 0;
5
+ const resource_1 = require("../../../../core/resource");
6
+ const pagination_1 = require("../../../../core/pagination");
7
+ const headers_1 = require("../../../../internal/headers");
8
+ const path_1 = require("../../../../internal/utils/path");
9
+ class Issuers extends resource_1.APIResource {
10
+ /**
11
+ * **Requires an OAuth access token with the `org:admin` scope**, from
12
+ * `ant auth login --scope org:admin` or a workload identity federation rule; Admin
13
+ * API keys are not accepted. See
14
+ * [Manage WIF with the Admin API](/docs/en/manage-puku/wif-admin-api).
15
+ *
16
+ * Register an OIDC issuer that PukuAI will trust for workload identity
17
+ * federation in your organization.
18
+ *
19
+ * The `jwks` field controls how the issuer's signing keys are obtained and takes
20
+ * one of three shapes selected by `type`: `discovery` (resolve keys through OIDC
21
+ * discovery), `explicit_url` (fetch keys from a fixed JWKS URL), or `inline`
22
+ * (provide a static key set). When `jwks.type` is `discovery` and no
23
+ * `discovery_base` is set, the issuer URL must be publicly reachable over HTTPS so
24
+ * PukuAI can fetch the discovery document; for `explicit_url` and `inline`
25
+ * modes the issuer URL is only matched as the JWT's `iss` claim and is not
26
+ * fetched.
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const betaFederationIssuer =
31
+ * await client.beta.organization.federation.issuers.create({
32
+ * issuer_url: 'x',
33
+ * name: 'x',
34
+ * });
35
+ * ```
36
+ */
37
+ create(params, options) {
38
+ const { betas, ...body } = params;
39
+ return this._client.post('/v1/organizations/federation_issuers?beta=true', {
40
+ body,
41
+ ...options,
42
+ headers: (0, headers_1.buildHeaders)([
43
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
44
+ options?.headers,
45
+ ]),
46
+ });
47
+ }
48
+ /**
49
+ * **Requires an OAuth access token with the `org:admin` scope**, from
50
+ * `ant auth login --scope org:admin` or a workload identity federation rule; Admin
51
+ * API keys are not accepted. See
52
+ * [Manage WIF with the Admin API](/docs/en/manage-puku/wif-admin-api).
53
+ *
54
+ * Retrieve a federation issuer by its ID (`fdis_...`).
55
+ *
56
+ * @example
57
+ * ```ts
58
+ * const betaFederationIssuer =
59
+ * await client.beta.organization.federation.issuers.retrieve(
60
+ * 'federation_issuer_id',
61
+ * );
62
+ * ```
63
+ */
64
+ retrieve(federationIssuerID, params = {}, options) {
65
+ const { betas } = params ?? {};
66
+ return this._client.get((0, path_1.path) `/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, {
67
+ ...options,
68
+ headers: (0, headers_1.buildHeaders)([
69
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
70
+ options?.headers,
71
+ ]),
72
+ });
73
+ }
74
+ /**
75
+ * **Requires an OAuth access token with the `org:admin` scope**, from
76
+ * `ant auth login --scope org:admin` or a workload identity federation rule; Admin
77
+ * API keys are not accepted. See
78
+ * [Manage WIF with the Admin API](/docs/en/manage-puku/wif-admin-api).
79
+ *
80
+ * Partially update a federation issuer.
81
+ *
82
+ * Setting `jwks` replaces the full JWKS shape at once. Archived issuers cannot be
83
+ * updated; this returns 400. Create a new issuer instead.
84
+ *
85
+ * Updating an issuer that backs a rule with a scope outside `workspace:developer`
86
+ * or `workspace:inference` requires a Console session.
87
+ *
88
+ * @example
89
+ * ```ts
90
+ * const betaFederationIssuer =
91
+ * await client.beta.organization.federation.issuers.update(
92
+ * 'federation_issuer_id',
93
+ * );
94
+ * ```
95
+ */
96
+ update(federationIssuerID, params, options) {
97
+ const { betas, ...body } = params;
98
+ return this._client.post((0, path_1.path) `/v1/organizations/federation_issuers/${federationIssuerID}?beta=true`, {
99
+ body,
100
+ ...options,
101
+ headers: (0, headers_1.buildHeaders)([
102
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
103
+ options?.headers,
104
+ ]),
105
+ });
106
+ }
107
+ /**
108
+ * **Requires an OAuth access token with the `org:admin` scope**, from
109
+ * `ant auth login --scope org:admin` or a workload identity federation rule; Admin
110
+ * API keys are not accepted. See
111
+ * [Manage WIF with the Admin API](/docs/en/manage-puku/wif-admin-api).
112
+ *
113
+ * List federation issuers in your organization.
114
+ *
115
+ * Archived issuers are excluded unless `include_archived=true`.
116
+ *
117
+ * @example
118
+ * ```ts
119
+ * // Automatically fetches more pages as needed.
120
+ * for await (const betaFederationIssuer of client.beta.organization.federation.issuers.list()) {
121
+ * // ...
122
+ * }
123
+ * ```
124
+ */
125
+ list(params = {}, options) {
126
+ const { betas, ...query } = params ?? {};
127
+ return this._client.getAPIList('/v1/organizations/federation_issuers?beta=true', (pagination_1.PageCursor), {
128
+ query,
129
+ ...options,
130
+ headers: (0, headers_1.buildHeaders)([
131
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
132
+ options?.headers,
133
+ ]),
134
+ });
135
+ }
136
+ /**
137
+ * **Requires an OAuth access token with the `org:admin` scope**, from
138
+ * `ant auth login --scope org:admin` or a workload identity federation rule; Admin
139
+ * API keys are not accepted. See
140
+ * [Manage WIF with the Admin API](/docs/en/manage-puku/wif-admin-api).
141
+ *
142
+ * Archive a federation issuer.
143
+ *
144
+ * Idempotent; re-archiving returns the issuer with its original `archived_at`.
145
+ * Rejected with 400 if any live (non-archived) federation rule still references
146
+ * the issuer; archive those rules first (a rule's issuer cannot be changed), or
147
+ * recreate them against another issuer.
148
+ *
149
+ * @example
150
+ * ```ts
151
+ * const betaFederationIssuer =
152
+ * await client.beta.organization.federation.issuers.archive(
153
+ * 'federation_issuer_id',
154
+ * );
155
+ * ```
156
+ */
157
+ archive(federationIssuerID, params = {}, options) {
158
+ const { betas } = params ?? {};
159
+ return this._client.post((0, path_1.path) `/v1/organizations/federation_issuers/${federationIssuerID}/archive?beta=true`, {
160
+ ...options,
161
+ headers: (0, headers_1.buildHeaders)([
162
+ { ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
163
+ options?.headers,
164
+ ]),
165
+ });
166
+ }
167
+ }
168
+ exports.Issuers = Issuers;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.Workspaces = exports.Rules = void 0;
5
+ var rules_1 = require("./rules");
6
+ Object.defineProperty(exports, "Rules", { enumerable: true, get: function () { return rules_1.Rules; } });
7
+ var workspaces_1 = require("./workspaces");
8
+ Object.defineProperty(exports, "Workspaces", { enumerable: true, get: function () { return workspaces_1.Workspaces; } });