@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.
- 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/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/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/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/index.cjs +11 -0
- package/dist/vendor/resources/beta/messages/messages.cjs +189 -0
- 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/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/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/index.cjs +8 -0
- package/dist/vendor/resources/messages/messages.cjs +159 -0
- 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 -14271
- 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,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;
|
|
@@ -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; } });
|
|
@@ -0,0 +1,160 @@
|
|
|
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.Batches = 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 jsonl_1 = require("../../internal/decoders/jsonl");
|
|
9
|
+
const error_1 = require("../../error");
|
|
10
|
+
const path_1 = require("../../internal/utils/path");
|
|
11
|
+
class Batches extends resource_1.APIResource {
|
|
12
|
+
/**
|
|
13
|
+
* Send a batch of Message creation requests.
|
|
14
|
+
*
|
|
15
|
+
* The Message Batches API can be used to process multiple Messages API requests at
|
|
16
|
+
* once. Once a Message Batch is created, it begins processing immediately. Batches
|
|
17
|
+
* can take up to 24 hours to complete.
|
|
18
|
+
*
|
|
19
|
+
* Learn more about the Message Batches API in our
|
|
20
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```ts
|
|
24
|
+
* const messageBatch = await client.messages.batches.create({
|
|
25
|
+
* requests: [
|
|
26
|
+
* {
|
|
27
|
+
* custom_id: 'my-custom-id-1',
|
|
28
|
+
* params: {
|
|
29
|
+
* max_tokens: 1024,
|
|
30
|
+
* messages: [
|
|
31
|
+
* { content: 'Hello, world', role: 'user' },
|
|
32
|
+
* ],
|
|
33
|
+
* model: 'puku-ai-2.8',
|
|
34
|
+
* },
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
create(params, options) {
|
|
41
|
+
const { user_profile_id, ...body } = params;
|
|
42
|
+
return this._client.post('/v1/messages/batches', {
|
|
43
|
+
body,
|
|
44
|
+
...options,
|
|
45
|
+
headers: (0, headers_1.buildHeaders)([
|
|
46
|
+
{ ...(user_profile_id != null ? { 'puku-user-profile-id': user_profile_id } : undefined) },
|
|
47
|
+
options?.headers,
|
|
48
|
+
]),
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* This endpoint is idempotent and can be used to poll for Message Batch
|
|
53
|
+
* completion. To access the results of a Message Batch, make a request to the
|
|
54
|
+
* `results_url` field in the response.
|
|
55
|
+
*
|
|
56
|
+
* Learn more about the Message Batches API in our
|
|
57
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* const messageBatch = await client.messages.batches.retrieve(
|
|
62
|
+
* 'message_batch_id',
|
|
63
|
+
* );
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
retrieve(messageBatchID, options) {
|
|
67
|
+
return this._client.get((0, path_1.path) `/v1/messages/batches/${messageBatchID}`, options);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* List all Message Batches within a Workspace. Most recently created batches are
|
|
71
|
+
* returned first.
|
|
72
|
+
*
|
|
73
|
+
* Learn more about the Message Batches API in our
|
|
74
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* // Automatically fetches more pages as needed.
|
|
79
|
+
* for await (const messageBatch of client.messages.batches.list()) {
|
|
80
|
+
* // ...
|
|
81
|
+
* }
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
list(query = {}, options) {
|
|
85
|
+
return this._client.getAPIList('/v1/messages/batches', (pagination_1.Page), { query, ...options });
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Delete a Message Batch.
|
|
89
|
+
*
|
|
90
|
+
* Message Batches can only be deleted once they've finished processing. If you'd
|
|
91
|
+
* like to delete an in-progress batch, you must first cancel it.
|
|
92
|
+
*
|
|
93
|
+
* Learn more about the Message Batches API in our
|
|
94
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* const deletedMessageBatch =
|
|
99
|
+
* await client.messages.batches.delete('message_batch_id');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
delete(messageBatchID, options) {
|
|
103
|
+
return this._client.delete((0, path_1.path) `/v1/messages/batches/${messageBatchID}`, options);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Batches may be canceled any time before processing ends. Once cancellation is
|
|
107
|
+
* initiated, the batch enters a `canceling` state, at which time the system may
|
|
108
|
+
* complete any in-progress, non-interruptible requests before finalizing
|
|
109
|
+
* cancellation.
|
|
110
|
+
*
|
|
111
|
+
* The number of canceled requests is specified in `request_counts`. To determine
|
|
112
|
+
* which requests were canceled, check the individual results within the batch.
|
|
113
|
+
* Note that cancellation may not result in any canceled requests if they were
|
|
114
|
+
* non-interruptible.
|
|
115
|
+
*
|
|
116
|
+
* Learn more about the Message Batches API in our
|
|
117
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const messageBatch = await client.messages.batches.cancel(
|
|
122
|
+
* 'message_batch_id',
|
|
123
|
+
* );
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
cancel(messageBatchID, options) {
|
|
127
|
+
return this._client.post((0, path_1.path) `/v1/messages/batches/${messageBatchID}/cancel`, options);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Streams the results of a Message Batch as a `.jsonl` file.
|
|
131
|
+
*
|
|
132
|
+
* Each line in the file is a JSON object containing the result of a single request
|
|
133
|
+
* in the Message Batch. Results are not guaranteed to be in the same order as
|
|
134
|
+
* requests. Use the `custom_id` field to match results to requests.
|
|
135
|
+
*
|
|
136
|
+
* Learn more about the Message Batches API in our
|
|
137
|
+
* [user guide](https://platform.puku.com/docs/en/build-with-puku/batch-processing)
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* ```ts
|
|
141
|
+
* const messageBatchIndividualResponse =
|
|
142
|
+
* await client.messages.batches.results('message_batch_id');
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
async results(messageBatchID, options) {
|
|
146
|
+
const batch = await this.retrieve(messageBatchID);
|
|
147
|
+
if (!batch.results_url) {
|
|
148
|
+
throw new error_1.PukuError(`No batch \`results_url\`; Has it finished processing? ${batch.processing_status} - ${batch.id}`);
|
|
149
|
+
}
|
|
150
|
+
return this._client
|
|
151
|
+
.get(batch.results_url, {
|
|
152
|
+
...options,
|
|
153
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/binary' }, options?.headers]),
|
|
154
|
+
stream: true,
|
|
155
|
+
__binaryResponse: true,
|
|
156
|
+
})
|
|
157
|
+
._thenUnwrap((_, props) => jsonl_1.JSONLDecoder.fromResponse(props.response, props.controller));
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
exports.Batches = Batches;
|
|
@@ -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.Messages = exports.Batches = void 0;
|
|
5
|
+
var batches_1 = require("./batches");
|
|
6
|
+
Object.defineProperty(exports, "Batches", { enumerable: true, get: function () { return batches_1.Batches; } });
|
|
7
|
+
var messages_1 = require("./messages");
|
|
8
|
+
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_1.Messages; } });
|