@puku-ai/sdk 4.0.2 → 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.
- package/README.md +24 -7
- package/dist/index.cjs +85 -0
- package/dist/vendor/_vendor/partial-json-parser/parser.cjs +225 -0
- package/dist/vendor/api-promise.cjs +18 -0
- package/dist/vendor/client.cjs +1013 -0
- package/dist/vendor/core/api-promise.cjs +80 -0
- package/dist/vendor/core/api.cjs +2 -0
- package/dist/vendor/core/credentials.cjs +313 -0
- package/dist/vendor/core/error.cjs +156 -0
- package/dist/vendor/core/middleware.cjs +173 -0
- package/dist/vendor/core/pagination.cjs +215 -0
- package/dist/vendor/core/resource.cjs +11 -0
- package/dist/vendor/core/streaming.cjs +346 -0
- package/dist/vendor/core/uploads.cjs +5 -0
- package/dist/vendor/error.cjs +18 -0
- package/dist/vendor/helpers/beta/environments.cjs +30 -0
- package/dist/vendor/helpers/beta/json-schema.cjs +56 -0
- package/dist/vendor/helpers/beta/mcp.cjs +418 -0
- package/dist/vendor/helpers/beta/memory.cjs +17 -0
- package/dist/vendor/helpers/beta/standard-schema.cjs +57 -0
- package/dist/vendor/helpers/beta/zod.cjs +88 -0
- package/dist/vendor/helpers/index.cjs +7 -0
- package/dist/vendor/helpers/json-schema.cjs +36 -0
- package/dist/vendor/helpers/zod.cjs +77 -0
- package/dist/vendor/index.cjs +54 -0
- package/dist/vendor/internal/builtin-types.cjs +3 -0
- package/dist/vendor/internal/constants.cjs +12 -0
- package/dist/vendor/internal/decoders/jsonl.cjs +40 -0
- package/dist/vendor/internal/decoders/line.cjs +109 -0
- package/dist/vendor/internal/detect-platform.cjs +159 -0
- package/dist/vendor/internal/errors.cjs +42 -0
- package/dist/vendor/internal/file-store.cjs +535 -0
- package/dist/vendor/internal/headers.cjs +119 -0
- package/dist/vendor/internal/message-stream-utils.cjs +33 -0
- package/dist/vendor/internal/node.browser.cjs +21 -0
- package/dist/vendor/internal/node.cjs +55 -0
- package/dist/vendor/internal/parse.cjs +65 -0
- package/dist/vendor/internal/qs/formats.cjs +12 -0
- package/dist/vendor/internal/qs/index.cjs +13 -0
- package/dist/vendor/internal/qs/stringify.cjs +276 -0
- package/dist/vendor/internal/qs/types.cjs +2 -0
- package/dist/vendor/internal/qs/utils.cjs +229 -0
- package/dist/vendor/internal/request-options.cjs +31 -0
- package/dist/vendor/internal/request-signal.cjs +49 -0
- package/dist/vendor/internal/shim-types.cjs +3 -0
- package/dist/vendor/internal/shims.cjs +91 -0
- package/dist/vendor/internal/stainless-helper-header.cjs +90 -0
- package/dist/vendor/internal/stream-utils.cjs +37 -0
- package/dist/vendor/internal/to-file.cjs +95 -0
- package/dist/vendor/internal/types.cjs +3 -0
- package/dist/vendor/internal/uploads.cjs +148 -0
- package/dist/vendor/internal/utils/abort.cjs +24 -0
- package/dist/vendor/internal/utils/async-queue.cjs +69 -0
- package/dist/vendor/internal/utils/backoff.cjs +43 -0
- package/dist/vendor/internal/utils/base64.cjs +37 -0
- package/dist/vendor/internal/utils/bytes.cjs +30 -0
- package/dist/vendor/internal/utils/env.cjs +21 -0
- package/dist/vendor/internal/utils/log.cjs +111 -0
- package/dist/vendor/internal/utils/path.cjs +78 -0
- package/dist/vendor/internal/utils/promise.cjs +17 -0
- package/dist/vendor/internal/utils/query.cjs +41 -0
- package/dist/vendor/internal/utils/sleep.cjs +27 -0
- package/dist/vendor/internal/utils/time.cjs +7 -0
- package/dist/vendor/internal/utils/uuid.cjs +18 -0
- package/dist/vendor/internal/utils/values.cjs +125 -0
- package/dist/vendor/internal/utils.cjs +24 -0
- package/dist/vendor/lib/BetaMessageStream.cjs +665 -0
- package/dist/vendor/lib/MessageStream.cjs +612 -0
- package/dist/vendor/lib/beta-parser.cjs +78 -0
- package/dist/vendor/lib/credentials/credential-chain.cjs +244 -0
- package/dist/vendor/lib/credentials/identity-token.cjs +71 -0
- package/dist/vendor/lib/credentials/oidc-federation.cjs +81 -0
- package/dist/vendor/lib/credentials/token-cache.cjs +113 -0
- package/dist/vendor/lib/credentials/types.cjs +267 -0
- package/dist/vendor/lib/credentials/user-oauth.cjs +129 -0
- package/dist/vendor/lib/credentials.cjs +7 -0
- package/dist/vendor/lib/environments/index.cjs +17 -0
- package/dist/vendor/lib/environments/poller.cjs +226 -0
- package/dist/vendor/lib/environments/worker.cjs +609 -0
- package/dist/vendor/lib/helper-client.cjs +57 -0
- package/dist/vendor/lib/middleware.cjs +779 -0
- package/dist/vendor/lib/parser.cjs +65 -0
- package/dist/vendor/lib/sessions/accumulate.cjs +44 -0
- package/dist/vendor/lib/standard-schema.cjs +44 -0
- package/dist/vendor/lib/tools/BetaRunnableTool.cjs +30 -0
- package/dist/vendor/lib/tools/BetaToolRunner.cjs +500 -0
- package/dist/vendor/lib/tools/BetaToolRunner.d.ts +1 -1
- package/dist/vendor/lib/tools/CompactionControl.cjs +27 -0
- package/dist/vendor/lib/tools/SessionToolRunner.cjs +740 -0
- package/dist/vendor/lib/tools/ToolError.cjs +46 -0
- package/dist/vendor/lib/transform-json-schema.cjs +113 -0
- package/dist/vendor/pagination.cjs +18 -0
- package/dist/vendor/resource.cjs +18 -0
- package/dist/vendor/resources/beta/agents/agents.cjs +159 -0
- package/dist/vendor/resources/beta/agents/agents.d.ts +3 -3
- package/dist/vendor/resources/beta/agents/agents.js +1 -1
- package/dist/vendor/resources/beta/agents/index.cjs +8 -0
- package/dist/vendor/resources/beta/agents/versions.cjs +35 -0
- package/dist/vendor/resources/beta/agents.cjs +18 -0
- package/dist/vendor/resources/beta/beta.cjs +105 -0
- package/dist/vendor/resources/beta/deployment-runs.cjs +54 -0
- package/dist/vendor/resources/beta/deployments.cjs +195 -0
- package/dist/vendor/resources/beta/dreams.cjs +115 -0
- package/dist/vendor/resources/beta/dreams.d.ts +2 -2
- package/dist/vendor/resources/beta/environments/environments.cjs +178 -0
- package/dist/vendor/resources/beta/environments/index.cjs +8 -0
- package/dist/vendor/resources/beta/environments/work.cjs +256 -0
- package/dist/vendor/resources/beta/environments.cjs +18 -0
- package/dist/vendor/resources/beta/files.cjs +123 -0
- package/dist/vendor/resources/beta/index.cjs +38 -0
- package/dist/vendor/resources/beta/memory-stores/index.cjs +10 -0
- package/dist/vendor/resources/beta/memory-stores/memories.cjs +129 -0
- package/dist/vendor/resources/beta/memory-stores/memory-stores.cjs +173 -0
- package/dist/vendor/resources/beta/memory-stores/memory-versions.cjs +80 -0
- package/dist/vendor/resources/beta/memory-stores.cjs +18 -0
- package/dist/vendor/resources/beta/messages/batches.cjs +206 -0
- package/dist/vendor/resources/beta/messages/batches.d.ts +3 -3
- package/dist/vendor/resources/beta/messages/index.cjs +11 -0
- package/dist/vendor/resources/beta/messages/messages.cjs +189 -0
- package/dist/vendor/resources/beta/messages/messages.d.ts +5 -5
- package/dist/vendor/resources/beta/messages/messages.js +4 -11
- package/dist/vendor/resources/beta/messages/messages.js.map +1 -1
- package/dist/vendor/resources/beta/messages.cjs +18 -0
- package/dist/vendor/resources/beta/models.cjs +59 -0
- package/dist/vendor/resources/beta/organization/api-keys.cjs +55 -0
- package/dist/vendor/resources/beta/organization/compliance-settings.cjs +51 -0
- package/dist/vendor/resources/beta/organization/external-keys.cjs +118 -0
- package/dist/vendor/resources/beta/organization/federation/federation.cjs +49 -0
- package/dist/vendor/resources/beta/organization/federation/index.cjs +10 -0
- package/dist/vendor/resources/beta/organization/federation/issuers.cjs +168 -0
- package/dist/vendor/resources/beta/organization/federation/rules/index.cjs +8 -0
- package/dist/vendor/resources/beta/organization/federation/rules/rules.cjs +226 -0
- package/dist/vendor/resources/beta/organization/federation/rules/workspaces.cjs +113 -0
- package/dist/vendor/resources/beta/organization/federation/rules.cjs +18 -0
- package/dist/vendor/resources/beta/organization/federation.cjs +18 -0
- package/dist/vendor/resources/beta/organization/index.cjs +24 -0
- package/dist/vendor/resources/beta/organization/invites.cjs +75 -0
- package/dist/vendor/resources/beta/organization/organization.cjs +90 -0
- package/dist/vendor/resources/beta/organization/rate-limits.cjs +30 -0
- package/dist/vendor/resources/beta/organization/service-accounts/index.cjs +8 -0
- package/dist/vendor/resources/beta/organization/service-accounts/service-accounts.cjs +202 -0
- package/dist/vendor/resources/beta/organization/service-accounts/workspaces.cjs +124 -0
- package/dist/vendor/resources/beta/organization/service-accounts.cjs +18 -0
- package/dist/vendor/resources/beta/organization/users.cjs +66 -0
- package/dist/vendor/resources/beta/organization/workspaces/index.cjs +12 -0
- package/dist/vendor/resources/beta/organization/workspaces/members.cjs +101 -0
- package/dist/vendor/resources/beta/organization/workspaces/rate-limits.cjs +33 -0
- package/dist/vendor/resources/beta/organization/workspaces/service-accounts.cjs +188 -0
- package/dist/vendor/resources/beta/organization/workspaces/workspaces.cjs +140 -0
- package/dist/vendor/resources/beta/organization/workspaces.cjs +18 -0
- package/dist/vendor/resources/beta/organization.cjs +18 -0
- package/dist/vendor/resources/beta/sessions/events.cjs +119 -0
- package/dist/vendor/resources/beta/sessions/index.cjs +12 -0
- package/dist/vendor/resources/beta/sessions/resources.cjs +131 -0
- package/dist/vendor/resources/beta/sessions/sessions.cjs +186 -0
- package/dist/vendor/resources/beta/sessions/sessions.d.ts +1 -1
- package/dist/vendor/resources/beta/sessions/threads/events.cjs +60 -0
- package/dist/vendor/resources/beta/sessions/threads/index.cjs +8 -0
- package/dist/vendor/resources/beta/sessions/threads/threads.cjs +116 -0
- package/dist/vendor/resources/beta/sessions/threads.cjs +18 -0
- package/dist/vendor/resources/beta/sessions.cjs +18 -0
- package/dist/vendor/resources/beta/skills/index.cjs +8 -0
- package/dist/vendor/resources/beta/skills/skills.cjs +132 -0
- package/dist/vendor/resources/beta/skills/versions.cjs +128 -0
- package/dist/vendor/resources/beta/skills.cjs +18 -0
- package/dist/vendor/resources/beta/tunnels/certificates.cjs +128 -0
- package/dist/vendor/resources/beta/tunnels/index.cjs +8 -0
- package/dist/vendor/resources/beta/tunnels/tunnels.cjs +209 -0
- package/dist/vendor/resources/beta/tunnels.cjs +18 -0
- package/dist/vendor/resources/beta/user-profiles.cjs +117 -0
- package/dist/vendor/resources/beta/vaults/credentials.cjs +176 -0
- package/dist/vendor/resources/beta/vaults/index.cjs +8 -0
- package/dist/vendor/resources/beta/vaults/vaults.cjs +177 -0
- package/dist/vendor/resources/beta/vaults.cjs +18 -0
- package/dist/vendor/resources/beta/webhooks.cjs +32 -0
- package/dist/vendor/resources/beta.cjs +18 -0
- package/dist/vendor/resources/completions.cjs +22 -0
- package/dist/vendor/resources/completions.d.ts +3 -3
- package/dist/vendor/resources/files.cjs +51 -0
- package/dist/vendor/resources/index.cjs +31 -0
- package/dist/vendor/resources/messages/batches.cjs +160 -0
- package/dist/vendor/resources/messages/batches.d.ts +1 -1
- package/dist/vendor/resources/messages/batches.js +1 -1
- package/dist/vendor/resources/messages/index.cjs +8 -0
- package/dist/vendor/resources/messages/messages.cjs +159 -0
- package/dist/vendor/resources/messages/messages.d.ts +7 -7
- package/dist/vendor/resources/messages/messages.js +6 -13
- package/dist/vendor/resources/messages/messages.js.map +1 -1
- package/dist/vendor/resources/messages.cjs +18 -0
- package/dist/vendor/resources/models.cjs +44 -0
- package/dist/vendor/resources/shared.cjs +3 -0
- package/dist/vendor/resources/skills/index.cjs +8 -0
- package/dist/vendor/resources/skills/skills.cjs +72 -0
- package/dist/vendor/resources/skills/versions.cjs +40 -0
- package/dist/vendor/resources/skills.cjs +18 -0
- package/dist/vendor/resources/top-level.cjs +3 -0
- package/dist/vendor/resources.cjs +17 -0
- package/dist/vendor/streaming.cjs +18 -0
- package/dist/vendor/tools/agent-toolset/fs-util.cjs +193 -0
- package/dist/vendor/tools/agent-toolset/memories.cjs +916 -0
- package/dist/vendor/tools/agent-toolset/node.browser.cjs +147 -0
- package/dist/vendor/tools/agent-toolset/node.cjs +939 -0
- package/dist/vendor/tools/agent-toolset/skills.cjs +325 -0
- package/dist/vendor/tools/agent-toolset/sync-interval.cjs +28 -0
- package/dist/vendor/tools/memory/node.browser.cjs +48 -0
- package/dist/vendor/tools/memory/node.cjs +364 -0
- package/dist/vendor/uploads.cjs +18 -0
- package/dist/vendor/version.cjs +4 -0
- package/package.json +12 -13
- package/sdk.cjs +0 -14293
- package/sdk.cjs.map +0 -149
- package/sdk.d.ts +0 -10866
- package/sdk.mjs +0 -68
- package/sdk.mjs.map +0 -149
|
@@ -0,0 +1,176 @@
|
|
|
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.Credentials = 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 Credentials extends resource_1.APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Create Credential
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const betaManagedAgentsCredential =
|
|
16
|
+
* await client.beta.vaults.credentials.create(
|
|
17
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
18
|
+
* {
|
|
19
|
+
* auth: {
|
|
20
|
+
* token: 'bearer_exampletoken',
|
|
21
|
+
* mcp_server_url:
|
|
22
|
+
* 'https://example-server.modelcontextprotocol.io/sse',
|
|
23
|
+
* type: 'static_bearer',
|
|
24
|
+
* },
|
|
25
|
+
* },
|
|
26
|
+
* );
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
create(vaultID, params, options) {
|
|
30
|
+
const { betas, ...body } = params;
|
|
31
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vaultID}/credentials?beta=true`, {
|
|
32
|
+
body,
|
|
33
|
+
...options,
|
|
34
|
+
headers: (0, headers_1.buildHeaders)([
|
|
35
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
36
|
+
options?.headers,
|
|
37
|
+
]),
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Get Credential
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const betaManagedAgentsCredential =
|
|
46
|
+
* await client.beta.vaults.credentials.retrieve(
|
|
47
|
+
* 'vcrd_011CZkZEMt8gZan2iYOQfSkw',
|
|
48
|
+
* { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },
|
|
49
|
+
* );
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
retrieve(credentialID, params, options) {
|
|
53
|
+
const { vault_id, betas } = params;
|
|
54
|
+
return this._client.get((0, path_1.path) `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
|
|
55
|
+
...options,
|
|
56
|
+
headers: (0, headers_1.buildHeaders)([
|
|
57
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
58
|
+
options?.headers,
|
|
59
|
+
]),
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Update Credential
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const betaManagedAgentsCredential =
|
|
68
|
+
* await client.beta.vaults.credentials.update(
|
|
69
|
+
* 'vcrd_011CZkZEMt8gZan2iYOQfSkw',
|
|
70
|
+
* { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
update(credentialID, params, options) {
|
|
75
|
+
const { vault_id, betas, ...body } = params;
|
|
76
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
|
|
77
|
+
body,
|
|
78
|
+
...options,
|
|
79
|
+
headers: (0, headers_1.buildHeaders)([
|
|
80
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
81
|
+
options?.headers,
|
|
82
|
+
]),
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* List Credentials
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* // Automatically fetches more pages as needed.
|
|
91
|
+
* for await (const betaManagedAgentsCredential of client.beta.vaults.credentials.list(
|
|
92
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
93
|
+
* )) {
|
|
94
|
+
* // ...
|
|
95
|
+
* }
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
list(vaultID, params = {}, options) {
|
|
99
|
+
const { betas, ...query } = params ?? {};
|
|
100
|
+
return this._client.getAPIList((0, path_1.path) `/v1/vaults/${vaultID}/credentials?beta=true`, (pagination_1.PageCursor), {
|
|
101
|
+
query,
|
|
102
|
+
...options,
|
|
103
|
+
headers: (0, headers_1.buildHeaders)([
|
|
104
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
105
|
+
options?.headers,
|
|
106
|
+
]),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Delete Credential
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* ```ts
|
|
114
|
+
* const betaManagedAgentsDeletedCredential =
|
|
115
|
+
* await client.beta.vaults.credentials.delete(
|
|
116
|
+
* 'vcrd_011CZkZEMt8gZan2iYOQfSkw',
|
|
117
|
+
* { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },
|
|
118
|
+
* );
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
121
|
+
delete(credentialID, params, options) {
|
|
122
|
+
const { vault_id, betas } = params;
|
|
123
|
+
return this._client.delete((0, path_1.path) `/v1/vaults/${vault_id}/credentials/${credentialID}?beta=true`, {
|
|
124
|
+
...options,
|
|
125
|
+
headers: (0, headers_1.buildHeaders)([
|
|
126
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
127
|
+
options?.headers,
|
|
128
|
+
]),
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Archive Credential
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* const betaManagedAgentsCredential =
|
|
137
|
+
* await client.beta.vaults.credentials.archive(
|
|
138
|
+
* 'vcrd_011CZkZEMt8gZan2iYOQfSkw',
|
|
139
|
+
* { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },
|
|
140
|
+
* );
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
archive(credentialID, params, options) {
|
|
144
|
+
const { vault_id, betas } = params;
|
|
145
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vault_id}/credentials/${credentialID}/archive?beta=true`, {
|
|
146
|
+
...options,
|
|
147
|
+
headers: (0, headers_1.buildHeaders)([
|
|
148
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
149
|
+
options?.headers,
|
|
150
|
+
]),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Validate Credential
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* const betaManagedAgentsCredentialValidation =
|
|
159
|
+
* await client.beta.vaults.credentials.mcpOAuthValidate(
|
|
160
|
+
* 'vcrd_011CZkZEMt8gZan2iYOQfSkw',
|
|
161
|
+
* { vault_id: 'vlt_011CZkZDLs7fYzm1hXNPeRjv' },
|
|
162
|
+
* );
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
mcpOAuthValidate(credentialID, params, options) {
|
|
166
|
+
const { vault_id, betas } = params;
|
|
167
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vault_id}/credentials/${credentialID}/mcp_oauth_validate?beta=true`, {
|
|
168
|
+
...options,
|
|
169
|
+
headers: (0, headers_1.buildHeaders)([
|
|
170
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
171
|
+
options?.headers,
|
|
172
|
+
]),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.Credentials = Credentials;
|
|
@@ -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.Vaults = exports.Credentials = void 0;
|
|
5
|
+
var credentials_1 = require("./credentials");
|
|
6
|
+
Object.defineProperty(exports, "Credentials", { enumerable: true, get: function () { return credentials_1.Credentials; } });
|
|
7
|
+
var vaults_1 = require("./vaults");
|
|
8
|
+
Object.defineProperty(exports, "Vaults", { enumerable: true, get: function () { return vaults_1.Vaults; } });
|
|
@@ -0,0 +1,177 @@
|
|
|
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.Vaults = void 0;
|
|
38
|
+
const resource_1 = require("../../../core/resource");
|
|
39
|
+
const CredentialsAPI = __importStar(require("./credentials"));
|
|
40
|
+
const credentials_1 = require("./credentials");
|
|
41
|
+
const pagination_1 = require("../../../core/pagination");
|
|
42
|
+
const headers_1 = require("../../../internal/headers");
|
|
43
|
+
const path_1 = require("../../../internal/utils/path");
|
|
44
|
+
class Vaults extends resource_1.APIResource {
|
|
45
|
+
credentials = new CredentialsAPI.Credentials(this._client);
|
|
46
|
+
/**
|
|
47
|
+
* Create Vault
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const betaManagedAgentsVault =
|
|
52
|
+
* await client.beta.vaults.create({
|
|
53
|
+
* display_name: 'Example vault',
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
create(params, options) {
|
|
58
|
+
const { betas, ...body } = params;
|
|
59
|
+
return this._client.post('/v1/vaults?beta=true', {
|
|
60
|
+
body,
|
|
61
|
+
...options,
|
|
62
|
+
headers: (0, headers_1.buildHeaders)([
|
|
63
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
64
|
+
options?.headers,
|
|
65
|
+
]),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Get Vault
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* const betaManagedAgentsVault =
|
|
74
|
+
* await client.beta.vaults.retrieve(
|
|
75
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
76
|
+
* );
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
retrieve(vaultID, params = {}, options) {
|
|
80
|
+
const { betas } = params ?? {};
|
|
81
|
+
return this._client.get((0, path_1.path) `/v1/vaults/${vaultID}?beta=true`, {
|
|
82
|
+
...options,
|
|
83
|
+
headers: (0, headers_1.buildHeaders)([
|
|
84
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
85
|
+
options?.headers,
|
|
86
|
+
]),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Update Vault
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* ```ts
|
|
94
|
+
* const betaManagedAgentsVault =
|
|
95
|
+
* await client.beta.vaults.update(
|
|
96
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
97
|
+
* );
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
update(vaultID, params, options) {
|
|
101
|
+
const { betas, ...body } = params;
|
|
102
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vaultID}?beta=true`, {
|
|
103
|
+
body,
|
|
104
|
+
...options,
|
|
105
|
+
headers: (0, headers_1.buildHeaders)([
|
|
106
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
107
|
+
options?.headers,
|
|
108
|
+
]),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* List Vaults
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```ts
|
|
116
|
+
* // Automatically fetches more pages as needed.
|
|
117
|
+
* for await (const betaManagedAgentsVault of client.beta.vaults.list()) {
|
|
118
|
+
* // ...
|
|
119
|
+
* }
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
list(params = {}, options) {
|
|
123
|
+
const { betas, ...query } = params ?? {};
|
|
124
|
+
return this._client.getAPIList('/v1/vaults?beta=true', (pagination_1.PageCursor), {
|
|
125
|
+
query,
|
|
126
|
+
...options,
|
|
127
|
+
headers: (0, headers_1.buildHeaders)([
|
|
128
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
129
|
+
options?.headers,
|
|
130
|
+
]),
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Delete Vault
|
|
135
|
+
*
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const betaManagedAgentsDeletedVault =
|
|
139
|
+
* await client.beta.vaults.delete(
|
|
140
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
141
|
+
* );
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
delete(vaultID, params = {}, options) {
|
|
145
|
+
const { betas } = params ?? {};
|
|
146
|
+
return this._client.delete((0, path_1.path) `/v1/vaults/${vaultID}?beta=true`, {
|
|
147
|
+
...options,
|
|
148
|
+
headers: (0, headers_1.buildHeaders)([
|
|
149
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
150
|
+
options?.headers,
|
|
151
|
+
]),
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Archive Vault
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* const betaManagedAgentsVault =
|
|
160
|
+
* await client.beta.vaults.archive(
|
|
161
|
+
* 'vlt_011CZkZDLs7fYzm1hXNPeRjv',
|
|
162
|
+
* );
|
|
163
|
+
* ```
|
|
164
|
+
*/
|
|
165
|
+
archive(vaultID, params = {}, options) {
|
|
166
|
+
const { betas } = params ?? {};
|
|
167
|
+
return this._client.post((0, path_1.path) `/v1/vaults/${vaultID}/archive?beta=true`, {
|
|
168
|
+
...options,
|
|
169
|
+
headers: (0, headers_1.buildHeaders)([
|
|
170
|
+
{ 'puku-beta': [...(betas ?? []), 'managed-agents-2026-04-01'].toString() },
|
|
171
|
+
options?.headers,
|
|
172
|
+
]),
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
exports.Vaults = Vaults;
|
|
177
|
+
Vaults.Credentials = credentials_1.Credentials;
|
|
@@ -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("./vaults/index"), exports);
|
|
@@ -0,0 +1,32 @@
|
|
|
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.Webhooks = void 0;
|
|
5
|
+
const resource_1 = require("../../core/resource");
|
|
6
|
+
const standardwebhooks_1 = require("standardwebhooks");
|
|
7
|
+
class Webhooks extends resource_1.APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Parses a webhook payload into an event without verifying its signature. Prefer
|
|
10
|
+
* `unwrap()` unless you have already verified the signature yourself.
|
|
11
|
+
*/
|
|
12
|
+
parseUnverified(body) {
|
|
13
|
+
return JSON.parse(body);
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Verifies the webhook signature from the `webhook-id`, `webhook-timestamp` and
|
|
17
|
+
* `webhook-signature` headers using your webhook signing key, then parses the
|
|
18
|
+
* payload into an event. Fails if the signature is missing or invalid.
|
|
19
|
+
*/
|
|
20
|
+
unwrap(body, options) {
|
|
21
|
+
const headers = options?.headers;
|
|
22
|
+
if (headers == null)
|
|
23
|
+
throw new Error('Webhook headers are required in order to verify the signature');
|
|
24
|
+
const keyStr = options.key === undefined ? this._client.webhookKey : options.key;
|
|
25
|
+
if (!keyStr)
|
|
26
|
+
throw new Error('Webhook key must not be null or empty in order to unwrap');
|
|
27
|
+
const wh = new standardwebhooks_1.Webhook(keyStr);
|
|
28
|
+
wh.verify(body, headers);
|
|
29
|
+
return JSON.parse(body);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.Webhooks = Webhooks;
|
|
@@ -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("./beta/index"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
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.Completions = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource");
|
|
6
|
+
const headers_1 = require("../internal/headers");
|
|
7
|
+
class Completions extends resource_1.APIResource {
|
|
8
|
+
create(params, options) {
|
|
9
|
+
const { betas, ...body } = params;
|
|
10
|
+
return this._client.post('/v1/complete', {
|
|
11
|
+
body,
|
|
12
|
+
timeout: this._client._options.timeout ?? 600000,
|
|
13
|
+
...options,
|
|
14
|
+
headers: (0, headers_1.buildHeaders)([
|
|
15
|
+
{ ...(betas?.toString() != null ? { 'puku-beta': betas?.toString() } : undefined) },
|
|
16
|
+
options?.headers,
|
|
17
|
+
]),
|
|
18
|
+
stream: params.stream ?? false,
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.Completions = Completions;
|
|
@@ -118,18 +118,18 @@ export interface CompletionCreateParamsBase {
|
|
|
118
118
|
*/
|
|
119
119
|
stream?: boolean;
|
|
120
120
|
/**
|
|
121
|
-
* @deprecated Deprecated. Models released after Puku
|
|
121
|
+
* @deprecated Deprecated. Models released after Puku AI 2.8 do not support
|
|
122
122
|
* setting temperature. A value of 1.0 of will be accepted for backwards
|
|
123
123
|
* compatibility, all other values will be rejected with a 400 error.
|
|
124
124
|
*/
|
|
125
125
|
temperature?: number;
|
|
126
126
|
/**
|
|
127
|
-
* @deprecated Deprecated. Models released after Puku
|
|
127
|
+
* @deprecated Deprecated. Models released after Puku AI 2.8 do not accept
|
|
128
128
|
* top_k; any value will be rejected with a 400 error.
|
|
129
129
|
*/
|
|
130
130
|
top_k?: number;
|
|
131
131
|
/**
|
|
132
|
-
* @deprecated Deprecated. Models released after Puku
|
|
132
|
+
* @deprecated Deprecated. Models released after Puku AI 2.8 do not support
|
|
133
133
|
* setting top_p. A value >= 0.99 will be accepted for backwards compatibility, all
|
|
134
134
|
* other values will be rejected with a 400 error.
|
|
135
135
|
*/
|
|
@@ -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.Files = 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 stainless_helper_header_1 = require("../internal/stainless-helper-header");
|
|
9
|
+
const uploads_1 = require("../internal/uploads");
|
|
10
|
+
const path_1 = require("../internal/utils/path");
|
|
11
|
+
class Files extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* List Files
|
|
14
|
+
*/
|
|
15
|
+
list(query = {}, options) {
|
|
16
|
+
return this._client.getAPIList('/v1/files', (pagination_1.PageCursor), { query, ...options });
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Delete File
|
|
20
|
+
*/
|
|
21
|
+
delete(fileID, options) {
|
|
22
|
+
return this._client.delete((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Download File
|
|
26
|
+
*/
|
|
27
|
+
download(fileID, options) {
|
|
28
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}/content`, {
|
|
29
|
+
...options,
|
|
30
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/binary' }, options?.headers]),
|
|
31
|
+
__binaryResponse: true,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Get File Metadata
|
|
36
|
+
*/
|
|
37
|
+
retrieveMetadata(fileID, options) {
|
|
38
|
+
return this._client.get((0, path_1.path) `/v1/files/${fileID}`, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Upload File
|
|
42
|
+
*/
|
|
43
|
+
upload(body, options) {
|
|
44
|
+
return this._client.post('/v1/files', (0, uploads_1.multipartFormRequestOptions)({
|
|
45
|
+
body,
|
|
46
|
+
...options,
|
|
47
|
+
headers: (0, headers_1.buildHeaders)([(0, stainless_helper_header_1.stainlessHelperHeaderFromFile)(body.file), options?.headers]),
|
|
48
|
+
}, this._client));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.Files = Files;
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
exports.Skills = exports.Models = exports.Messages = exports.Files = exports.Completions = exports.Beta = void 0;
|
|
19
|
+
__exportStar(require("./shared"), exports);
|
|
20
|
+
var beta_1 = require("./beta/beta");
|
|
21
|
+
Object.defineProperty(exports, "Beta", { enumerable: true, get: function () { return beta_1.Beta; } });
|
|
22
|
+
var completions_1 = require("./completions");
|
|
23
|
+
Object.defineProperty(exports, "Completions", { enumerable: true, get: function () { return completions_1.Completions; } });
|
|
24
|
+
var files_1 = require("./files");
|
|
25
|
+
Object.defineProperty(exports, "Files", { enumerable: true, get: function () { return files_1.Files; } });
|
|
26
|
+
var messages_1 = require("./messages/messages");
|
|
27
|
+
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
|
|
28
|
+
var models_1 = require("./models");
|
|
29
|
+
Object.defineProperty(exports, "Models", { enumerable: true, get: function () { return models_1.Models; } });
|
|
30
|
+
var skills_1 = require("./skills/skills");
|
|
31
|
+
Object.defineProperty(exports, "Skills", { enumerable: true, get: function () { return skills_1.Skills; } });
|